Commit 2ec4c366e6 for wordpress.org
commit 2ec4c366e613aa7b81aab6d0c9facb9d85d191f2
Author: gziolo <gziolo@git.wordpress.org>
Date: Mon Apr 11 12:04:30 2022 +0000
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
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 @@
-<?php return array('a11y.js' => 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
+<?php return array('a11y.js' => 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 @@
-<?php return array('dependencies' => array(), 'version' => '650904f3ca9fdeab18131aab66cea896');
\ No newline at end of file
+<?php return array('dependencies' => 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");
-/******/ })
-/************************************************************************/
-/******/ ({
-
-/***/ "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
+/******/ (function() { // webpackBootstrap
+/******/ "use strict";
+var __webpack_exports__ = {};
+
+;// 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 @@
-<?php return array('dependencies' => array(), 'version' => 'e8d668b8e69d9bf1c99dc250d92f2b72');
\ No newline at end of file
+<?php return array('dependencies' => 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 @@
-<?php return array('dependencies' => array(), 'version' => '87b1b146f654698824fabc51262fa860');
\ No newline at end of file
+<?php return array('dependencies' => 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");
-/******/ })
-/************************************************************************/
-/******/ ({
-
-/***/ "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
+/******/ (function() { // webpackBootstrap
+/******/ "use strict";
+var __webpack_exports__ = {};
+
+;// CONCATENATED MODULE: ./node_modules/micromodal/dist/micromodal.es.js
function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function t(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}var n,i,a,r,s,l=(n=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],i=function(){function o(e){var n=e.targetModal,i=e.triggers,a=void 0===i?[]:i,r=e.onShow,s=void 0===r?function(){}:r,l=e.onClose,c=void 0===l?function(){}:l,d=e.openTrigger,u=void 0===d?"data-micromodal-trigger":d,f=e.closeTrigger,h=void 0===f?"data-micromodal-close":f,v=e.openClass,g=void 0===v?"is-open":v,m=e.disableScroll,b=void 0!==m&&m,y=e.disableFocus,p=void 0!==y&&y,w=e.awaitCloseAnimation,E=void 0!==w&&w,k=e.awaitOpenAnimation,M=void 0!==k&&k,A=e.debugMode,C=void 0!==A&&A;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this.modal=document.getElementById(n),this.config={debugMode:C,disableScroll:b,openTrigger:u,closeTrigger:h,openClass:g,onShow:s,onClose:c,awaitCloseAnimation:E,awaitOpenAnimation:M,disableFocus:p},a.length>0&&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;n<t;n++)o[n]=arguments[n];o.filter(Boolean).forEach((function(t){t.addEventListener("click",(function(t){return e.showModal(t)}))}))}},{key:"showModal",value:function(){var e=this,t=arguments.length>0&&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;",'<div class="modal" id="'.concat(e,'"></div>')),!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;",'<a href="#" data-micromodal-trigger="my-modal"></a>'))}(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 @@
-<?php return array('dependencies' => array(), 'version' => '3776ea67846b3bb10fe8f7cdd486b0ba');
\ No newline at end of file
+<?php return array('dependencies' => 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;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}o.r(t);var a,l,s,c,d,u=(a=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],l=function(){function e(t){var o=t.targetModal,n=t.triggers,r=void 0===n?[]:n,a=t.onShow,l=void 0===a?function(){}:a,s=t.onClose,c=void 0===s?function(){}:s,d=t.openTrigger,u=void 0===d?"data-micromodal-trigger":d,f=t.closeTrigger,h=void 0===f?"data-micromodal-close":f,v=t.openClass,g=void 0===v?"is-open":v,m=t.disableScroll,b=void 0!==m&&m,p=t.disableFocus,y=void 0!==p&&p,w=t.awaitCloseAnimation,k=void 0!==w&&w,E=t.awaitOpenAnimation,A=void 0!==E&&E,M=t.debugMode,S=void 0!==M&&M;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.modal=document.getElementById(o),this.config={debugMode:S,disableScroll:b,openTrigger:u,closeTrigger:h,openClass:g,onShow:l,onClose:c,awaitCloseAnimation:k,awaitOpenAnimation:A,disableFocus:y},r.length>0&&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;n<t;n++)o[n]=arguments[n];o.filter(Boolean).forEach((function(t){t.addEventListener("click",(function(t){return e.showModal(t)}))}))}},{key:"showModal",value:function(){var e=this,t=arguments.length>0&&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;",'<div class="modal" id="'.concat(e,'"></div>')),!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;",'<a href="#" data-micromodal-trigger="my-modal"></a>'))}(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;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function t(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}var n,i,a,r,l,s=(n=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],i=function(){function o(e){var n=e.targetModal,i=e.triggers,a=void 0===i?[]:i,r=e.onShow,l=void 0===r?function(){}:r,s=e.onClose,c=void 0===s?function(){}:s,d=e.openTrigger,u=void 0===d?"data-micromodal-trigger":d,f=e.closeTrigger,h=void 0===f?"data-micromodal-close":f,g=e.openClass,v=void 0===g?"is-open":g,m=e.disableScroll,b=void 0!==m&&m,y=e.disableFocus,p=void 0!==y&&y,w=e.awaitCloseAnimation,k=void 0!==w&&w,E=e.awaitOpenAnimation,A=void 0!==E&&E,L=e.debugMode,C=void 0!==L&&L;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),this.modal=document.getElementById(n),this.config={debugMode:C,disableScroll:b,openTrigger:u,closeTrigger:h,openClass:v,onShow:l,onClose:c,awaitCloseAnimation:k,awaitOpenAnimation:A,disableFocus:p},a.length>0&&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;n<t;n++)o[n]=arguments[n];o.filter(Boolean).forEach((function(t){t.addEventListener("click",(function(t){return e.showModal(t)}))}))}},{key:"showModal",value:function(){var e=this,t=arguments.length>0&&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;",'<div class="modal" id="'.concat(e,'"></div>')),!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;",'<a href="#" data-micromodal-trigger="my-modal"></a>'))}(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: {}
+/******/ (function() { // webpackBootstrap
+/******/ "use strict";
+/******/ // The require scope
+/******/ var __webpack_require__ = {};
+/******/
+/************************************************************************/
+/******/ /* 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] });
+/******/ }
+/******/ }
/******/ };
-/******/
-/******/ // 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");
-/******/ })
+/******/ }();
+/******/
+/******/ /* 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 });
+/******/ };
+/******/ }();
+/******/
/************************************************************************/
-/******/ ({
-
-/***/ "Y8OO":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["domReady"]; }());
-
-/***/ }),
-
-/***/ "jncB":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
+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; });
-
-// 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
+__webpack_require__.d(__webpack_exports__, {
+ "setup": function() { return /* binding */ setup; },
+ "speak": function() { return /* binding */ speak; }
+});
+
+;// 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<t.length;e++)t[e].textContent="";e&&e.setAttribute("hidden","hidden")}(),t=function(t){return t=t.replace(/<[^<>]+>/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<t.length;e++)t[e].textContent="";e&&e.setAttribute("hidden","hidden")}(),t=function(t){return t=t.replace(/<[^<>]+>/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: {}
+/******/ (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); }
+/******/ }();
+/******/
+/******/ /* 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 });
/******/ };
-/******/
-/******/ // 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");
-/******/ })
+/******/ }();
+/******/
/************************************************************************/
-/******/ ({
-
-/***/ "1ZqX":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["data"]; }());
-
-/***/ }),
-
-/***/ "23Y4":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
+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; });
-
-// EXTERNAL MODULE: external ["wp","richText"]
-var external_wp_richText_ = __webpack_require__("qRz9");
-
-// EXTERNAL MODULE: external ["wp","i18n"]
-var external_wp_i18n_ = __webpack_require__("l3Sj");
+__webpack_require__.d(actions_namespaceObject, {
+ "__experimentalAddAnnotation": function() { return __experimentalAddAnnotation; },
+ "__experimentalRemoveAnnotation": function() { return __experimentalRemoveAnnotation; },
+ "__experimentalRemoveAnnotationsBySource": function() { return __experimentalRemoveAnnotationsBySource; },
+ "__experimentalUpdateAnnotationRange": function() { return __experimentalUpdateAnnotationRange; }
+});
-// 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);
-
-// 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
+} = annotation;
+(0,external_wp_richText_namespaceObject.registerFormatType)(format_name, settings);
+
+;// 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);
-
-// EXTERNAL MODULE: external "lodash"
-var external_lodash_ = __webpack_require__("YLtl");
+(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/annotations', addAnnotationClassName);
-// 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,471 +430,113 @@ 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/rememo/es/rememo.js
-// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/selectors.js
-/**
- * External dependencies
- */
+var LEAF_KEY, hasWeakMap;
/**
- * 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.
+ * Arbitrary value used as key for referencing cache object in WeakMap tree.
*
- * @type {Array}
+ * @type {Object}
*/
+LEAF_KEY = {};
-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.
+ * Whether environment supports WeakMap.
*
- * @return {Array} The annotations applicable to this block.
+ * @type {boolean}
*/
+hasWeakMap = typeof WeakMap !== 'undefined';
-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.
+ * Returns the first argument as the sole entry in an array.
*
- * @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 {*} value Value to return.
*
- * @param {Object} state Editor state.
- * @return {Array} All annotations currently applied.
+ * @return {Array} Value returned as entry in array.
*/
-
-function __experimentalGetAnnotations(state) {
- return Object(external_lodash_["flatMap"])(state, annotations => {
- return annotations;
- });
+function arrayOf( value ) {
+ return [ value ];
}
-// 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'.
+ * 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 {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.
+ * @param {*} value Value to test.
*
- * @return {Object} Action object.
+ * @return {boolean} Whether value is object-like.
*/
-
-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;
+function isObjectLike( value ) {
+ return !! value && 'object' === typeof value;
}
-/**
- * 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.
+ * Creates and returns a new cache object.
*
- * @return {Object} Action object.
+ * @return {Object} Cache object.
*/
+function createCache() {
+ var cache = {
+ clear: function() {
+ cache.head = null;
+ },
+ };
-function __experimentalUpdateAnnotationRange(annotationId, start, end) {
- return {
- type: 'ANNOTATION_UPDATE_RANGE',
- annotationId,
- start,
- end
- };
+ return cache;
}
+
/**
- * Removes all annotations of a specific source.
+ * Returns true if entries within the two arrays are strictly equal by
+ * reference from a starting index.
*
- * @param {string} source The source to remove.
+ * @param {Array} a First array.
+ * @param {Array} b Second array.
+ * @param {number} fromIndex Index from which to start comparison.
*
- * @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
+ * @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;
+}
/**
- * Module Constants
- */
-
-
-/**
- * Store definition for the annotations namespace.
+ * 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.
*
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
+ * @param {Function} selector Selector function.
+ * @param {Function} getDependants Dependant getter returning an immutable
+ * reference or array of reference used in
+ * cache bust consideration.
*
- * @type {Object}
+ * @return {Function} Memoized selector.
*/
+/* harmony default export */ function rememo(selector, getDependants ) {
+ var rootCache, getCache;
-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";
-
-
-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;
- }
+ // 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
@@ -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);
+}
+
+/* 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 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
+ */
-/***/ "qRz9":
-/***/ (function(module, exports) {
-(function() { module.exports = window["wp"]["richText"]; }());
-/***/ })
-/******/ });
\ No newline at end of file
+(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;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}r={},o="undefined"!=typeof WeakMap,e.a=function(t,e){var n,l;function c(){n=o?new WeakMap:i()}function s(){var n,r,o,a,i,c=arguments.length;for(a=new Array(c),o=0;o<c;o++)a[o]=arguments[o];for(i=e.apply(null,a),(n=l(i)).isUniqueByDependants||(n.lastDependants&&!u(i,n.lastDependants,0)&&n.clear(),n.lastDependants=i),r=n.head;r;){if(u(r.args,a,1))return r!==n.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=n.head,r.prev=null,n.head.prev=r,n.head=r),r.val;r=r.next}return r={val:t.apply(null,a)},a[0]=null,r.args=a,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return e||(e=a),l=o?function(t){var e,o,a,u,l,c=n,s=!0;for(e=0;e<t.length;e++){if(o=t[e],!(l=o)||"object"!=typeof l){s=!1;break}c.has(o)?c=c.get(o):(a=new WeakMap,c.set(o,a),c=a)}return c.has(r)||((u=i()).isUniqueByDependants=s,c.set(r,u)),c.get(r)}:function(){return n},s.getDependants=e,s.clear=c,c(),s}},qRz9:function(t,e){t.exports=window.wp.richText}});
\ No newline at end of file
+!function(){"use strict";var e={d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{store:function(){return W}});var n={};e.r(n),e.d(n,{__experimentalGetAllAnnotationsForBlock:function(){return O},__experimentalGetAnnotations:function(){return R},__experimentalGetAnnotationsForBlock:function(){return b},__experimentalGetAnnotationsForRichText:function(){return I}});var r={};e.r(r),e.d(r,{__experimentalAddAnnotation:function(){return G},__experimentalRemoveAnnotation:function(){return M},__experimentalRemoveAnnotationsBySource:function(){return j},__experimentalUpdateAnnotationRange:function(){return B}});var o=window.wp.richText,a=window.wp.i18n;const i="core/annotations",l="core/annotation",u="annotation-text-";const s={name:l,title:(0,a.__)("Annotation"),tagName:"mark",className:"annotation-text",attributes:{className:"class",id:"id"},edit:()=>null,__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<e.length;r++)if(e[r]!==t[r])return!1;return!0}function T(e,t){var n,r;function o(){n=_?new WeakMap:x()}function a(){var n,o,a,i,l,u=arguments.length;for(i=new Array(u),a=0;a<u;a++)i[a]=arguments[a];for(l=t.apply(null,i),(n=r(l)).isUniqueByDependants||(n.lastDependants&&!N(l,n.lastDependants,0)&&n.clear(),n.lastDependants=l),o=n.head;o;){if(N(o.args,i,1))return o!==n.head&&(o.prev.next=o.next,o.next&&(o.next.prev=o.prev),o.next=n.head,o.prev=null,n.head.prev=o,n.head=o),o.val;o=o.next}return o={val:e.apply(null,i)},i[0]=null,o.args=i,n.head&&(n.head.prev=o,o.next=n.head),n.head=o,o.val}return t||(t=y),r=_?function(e){var t,r,o,a,i,l=n,u=!0;for(t=0;t<e.length;t++){if(r=e[t],!(i=r)||"object"!=typeof i){u=!1;break}l.has(r)?l=l.get(r):(o=new WeakMap,l.set(r,o),l=o)}return l.has(h)||((a=x()).isUniqueByDependants=u,l.set(h,a)),l.get(h)}:function(){return n},a.getDependants=t,a.clear=o,o(),a}h={},_="undefined"!=typeof WeakMap;const w=[],b=T(((e,t)=>{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: {}
+/******/ (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] });
+/******/ }
+/******/ }
/******/ };
-/******/
-/******/ // 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");
-/******/ })
+/******/ }();
+/******/
+/******/ /* webpack/runtime/hasOwnProperty shorthand */
+/******/ !function() {
+/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
+/******/ }();
+/******/
/************************************************************************/
-/******/ ({
-
-/***/ "Mmq9":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["url"]; }());
-
-/***/ }),
-
-/***/ "jqrR":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-// ESM COMPAT FLAG
-__webpack_require__.r(__webpack_exports__);
+var __webpack_exports__ = {};
-// EXTERNAL MODULE: external ["wp","i18n"]
-var external_wp_i18n_ = __webpack_require__("l3Sj");
+// EXPORTS
+__webpack_require__.d(__webpack_exports__, {
+ "default": function() { return /* binding */ build_module; }
+});
-// 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<string, any>} */
@@ -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);
-
-
-/***/ }),
-
-/***/ "l3Sj":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["i18n"]; }());
-
-/***/ })
+/* harmony default export */ var build_module = (apiFetch);
-/******/ })["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: {}
+/******/ (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); }
+/******/ }();
+/******/
+/******/ /* 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 });
/******/ };
-/******/
-/******/ // 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");
-/******/ })
+/******/ }();
+/******/
/************************************************************************/
-/******/ ({
-
-/***/ "zbAn":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
+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;e<r.length;e+=2)for(let p=0;p<c.length;p++){const l=c[p];if(-1!==r[e].indexOf(l)){r[e]=r[e].replace(new RegExp(l,"g"),n[l]),t=!0;break}}return t&&(e=r.join("")),e}function c(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf("<pre")){const n=e.split("</pre>"),p=n.pop();e="";for(let p=0;p<n.length;p++){const t=n[p],c=t.indexOf("<pre");if(-1===c){e+=t;continue}const l="<pre wp-pre-tag-"+p+"></pre>";r.push([l,t.substr(c)+"</pre>"]),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(/<br\s*\/?>\s*<br\s*\/?>/g,"\n\n")).replace(new RegExp("(<"+p+"[\\s/>])","g"),"\n\n$1")).replace(new RegExp("(</"+p+">)","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"<option")).replace(/<\/option>\s*/g,"</option>")),-1!==e.indexOf("</object>")&&(e=(e=(e=e.replace(/(<object[^>]*>)\s*/g,"$1")).replace(/\s*<\/object>/g,"</object>")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===e.indexOf("<source")&&-1===e.indexOf("<track")||(e=(e=(e=e.replace(/([<\[](?:audio|video)[^>\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==e.indexOf("<figcaption")&&(e=(e=e.replace(/\s*(<figcaption[^>]*>)/,"$1")).replace(/<\/figcaption>\s*/,"</figcaption>"));const c=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",c.forEach(n=>{e+="<p>"+n.replace(/^\n*|\n*$/g,"")+"</p>\n"}),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/<p>\s*<\/p>/g,"")).replace(/<p>([^<]+)<\/(div|address|form)>/g,"<p>$1</p></$2>")).replace(new RegExp("<p>\\s*(</?"+p+"[^>]*>)\\s*</p>","g"),"$1")).replace(/<p>(<li.+?)<\/p>/g,"$1")).replace(/<p><blockquote([^>]*)>/gi,"<blockquote$1><p>")).replace(/<\/blockquote><\/p>/g,"</p></blockquote>")).replace(new RegExp("<p>\\s*(</?"+p+"[^>]*>)","g"),"$1")).replace(new RegExp("(</?"+p+"[^>]*>)\\s*</p>","g"),"$1"),n&&(e=(e=(e=(e=e.replace(/<(script|style).*?<\/\\1>/g,e=>e[0].replace(/\n/g,"<WPPreserveNewline />"))).replace(/<br>|<br\/>/g,"<br />")).replace(/(<br \/>)?\s*\n/g,(e,n)=>n?e:"<br />\n")).replace(/<WPPreserveNewline \/>/g,"\n")),e=(e=(e=e.replace(new RegExp("(</?"+p+"[^>]*>)\\s*<br />","g"),"$1")).replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"</p>"),r.forEach(n=>{const[r,p]=n;e=e.replace(r,p)}),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?<!-- wpnl -->\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("<script")&&-1===e.indexOf("<style")||(e=e.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/g,e=>(t.push(e),"<wp-preserve>"))),-1!==e.indexOf("<pre")&&(c=!0,e=e.replace(/<pre[^>]*>[\s\S]+?<\/pre>/g,e=>(e=(e=e.replace(/<br ?\/?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/\r?\n/g,"<wp-line-break>"))),-1!==e.indexOf("[caption")&&(l=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,e=>e.replace(/<br([^>]*)>/g,"<wp-temp-br$1>").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*</("+r+")>\\s*","g"),"</$1>\n")).replace(new RegExp("\\s*<((?:"+r+")(?: [^>]*)?)>","g"),"\n<$1>")).replace(/(<p [^>]+>[\s\S]*?)<\/p>/g,"$1</p#>")).replace(/<div( [^>]*)?>\s*<p>/gi,"<div$1>\n\n")).replace(/\s*<p>/gi,"")).replace(/\s*<\/p>\s*/gi,"\n\n")).replace(/\n[\s\u00a0]+\n/g,"\n\n")).replace(/(\s*)<br ?\/?>\s*/gi,(e,n)=>n&&-1!==n.indexOf("\n")?"\n\n":"\n")).replace(/\s*<div/g,"\n<div")).replace(/<\/div>\s*/g,"</div>\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*</("+p+")>\\s*","g"),"</$1>\n")).replace(/<((li|dt|dd)[^>]*)>/g," \t<$1>")).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"\n<option")).replace(/\s*<\/select>/g,"\n</select>")),-1!==e.indexOf("<hr")&&(e=e.replace(/\s*<hr( [^>]*)?>\s*/g,"\n\n<hr$1>\n\n")),-1!==e.indexOf("<object")&&(e=e.replace(/<object[\s\S]+?<\/object>/g,e=>e.replace(/[\r\n]+/g,""))),e=(e=(e=(e=e.replace(/<\/p#>/g,"</p>\n")).replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1")).replace(/^\s+/,"")).replace(/[\s\u00a0]+$/,""),c&&(e=e.replace(/<wp-line-break>/g,"\n")),l&&(e=e.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")),t.length&&(e=e.replace(/<wp-preserve>/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;e<r.length;e+=2)for(let p=0;p<c.length;p++){const l=c[p];if(-1!==r[e].indexOf(l)){r[e]=r[e].replace(new RegExp(l,"g"),n[l]),t=!0;break}}return t&&(e=r.join("")),e}function t(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const p=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf("<pre")){const n=e.split("</pre>"),r=n.pop();e="";for(let r=0;r<n.length;r++){const t=n[r],c=t.indexOf("<pre");if(-1===c){e+=t;continue}const l="<pre wp-pre-tag-"+r+"></pre>";p.push([l,t.substr(c)+"</pre>"]),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(/<br\s*\/?>\s*<br\s*\/?>/g,"\n\n")).replace(new RegExp("(<"+t+"[\\s/>])","g"),"\n\n$1")).replace(new RegExp("(</"+t+">)","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"<option")).replace(/<\/option>\s*/g,"</option>")),-1!==e.indexOf("</object>")&&(e=(e=(e=e.replace(/(<object[^>]*>)\s*/g,"$1")).replace(/\s*<\/object>/g,"</object>")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===e.indexOf("<source")&&-1===e.indexOf("<track")||(e=(e=(e=e.replace(/([<\[](?:audio|video)[^>\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==e.indexOf("<figcaption")&&(e=(e=e.replace(/\s*(<figcaption[^>]*>)/,"$1")).replace(/<\/figcaption>\s*/,"</figcaption>"));const c=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",c.forEach((n=>{e+="<p>"+n.replace(/^\n*|\n*$/g,"")+"</p>\n"})),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/<p>\s*<\/p>/g,"")).replace(/<p>([^<]+)<\/(div|address|form)>/g,"<p>$1</p></$2>")).replace(new RegExp("<p>\\s*(</?"+t+"[^>]*>)\\s*</p>","g"),"$1")).replace(/<p>(<li.+?)<\/p>/g,"$1")).replace(/<p><blockquote([^>]*)>/gi,"<blockquote$1><p>")).replace(/<\/blockquote><\/p>/g,"</p></blockquote>")).replace(new RegExp("<p>\\s*(</?"+t+"[^>]*>)","g"),"$1")).replace(new RegExp("(</?"+t+"[^>]*>)\\s*</p>","g"),"$1"),n&&(e=(e=(e=(e=e.replace(/<(script|style).*?<\/\\1>/g,(e=>e[0].replace(/\n/g,"<WPPreserveNewline />")))).replace(/<br>|<br\/>/g,"<br />")).replace(/(<br \/>)?\s*\n/g,((e,n)=>n?e:"<br />\n"))).replace(/<WPPreserveNewline \/>/g,"\n")),e=(e=(e=e.replace(new RegExp("(</?"+t+"[^>]*>)\\s*<br />","g"),"$1")).replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"</p>"),p.forEach((n=>{const[p,r]=n;e=e.replace(p,r)})),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?<!-- wpnl -->\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("<script")&&-1===e.indexOf("<style")||(e=e.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/g,(e=>(t.push(e),"<wp-preserve>")))),-1!==e.indexOf("<pre")&&(c=!0,e=e.replace(/<pre[^>]*>[\s\S]+?<\/pre>/g,(e=>(e=(e=e.replace(/<br ?\/?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"<wp-line-break>")).replace(/\r?\n/g,"<wp-line-break>")))),-1!==e.indexOf("[caption")&&(l=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,(e=>e.replace(/<br([^>]*)>/g,"<wp-temp-br$1>").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*</("+p+")>\\s*","g"),"</$1>\n")).replace(new RegExp("\\s*<((?:"+p+")(?: [^>]*)?)>","g"),"\n<$1>")).replace(/(<p [^>]+>[\s\S]*?)<\/p>/g,"$1</p#>")).replace(/<div( [^>]*)?>\s*<p>/gi,"<div$1>\n\n")).replace(/\s*<p>/gi,"")).replace(/\s*<\/p>\s*/gi,"\n\n")).replace(/\n[\s\u00a0]+\n/g,"\n\n")).replace(/(\s*)<br ?\/?>\s*/gi,((e,n)=>n&&-1!==n.indexOf("\n")?"\n\n":"\n"))).replace(/\s*<div/g,"\n<div")).replace(/<\/div>\s*/g,"</div>\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*</("+r+")>\\s*","g"),"</$1>\n")).replace(/<((li|dt|dd)[^>]*)>/g," \t<$1>")).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"\n<option")).replace(/\s*<\/select>/g,"\n</select>")),-1!==e.indexOf("<hr")&&(e=e.replace(/\s*<hr( [^>]*)?>\s*/g,"\n\n<hr$1>\n\n")),-1!==e.indexOf("<object")&&(e=e.replace(/<object[\s\S]+?<\/object>/g,(e=>e.replace(/[\r\n]+/g,"")))),e=(e=(e=(e=e.replace(/<\/p#>/g,"</p>\n")).replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1")).replace(/^\s+/,"")).replace(/[\s\u00a0]+$/,""),c&&(e=e.replace(/<wp-line-break>/g,"\n")),l&&(e=e.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")),t.length&&(e=e.replace(/<wp-preserve>/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: {}
+/******/ (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); }
+/******/ }();
+/******/
+/******/ /* 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 });
/******/ };
-/******/
-/******/ // 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");
-/******/ })
+/******/ }();
+/******/
/************************************************************************/
-/******/ ({
-
-/***/ "ca5x":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
+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: {}
+/******/ (function() { // webpackBootstrap
+/******/ "use strict";
+/******/ // The require scope
+/******/ var __webpack_require__ = {};
+/******/
+/************************************************************************/
+/******/ /* 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] });
+/******/ }
+/******/ }
/******/ };
-/******/
-/******/ // 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");
-/******/ })
+/******/ }();
+/******/
+/******/ /* 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 });
+/******/ };
+/******/ }();
+/******/
/************************************************************************/
-/******/ ({
-
-/***/ "//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";
+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; });
-
-// 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");
+__webpack_require__.d(resolvers_namespaceObject, {
+ "getDownloadableBlocks": function() { return resolvers_getDownloadableBlocks; }
+});
-// 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 <span>by %2$s</span>'), Object(external_wp_htmlEntities_["decodeEntities"])(title), author), {
- span: Object(external_wp_element_["createElement"])("span", {
+ (0,external_wp_i18n_namespaceObject.__)('%1$s <span>by %2$s</span>'), (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
+
+
+/**
+ * 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
+;// 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;n<t.length;n++)if(O(e,t[n].innerBlocks))return!0;return!1}function k(e,t){var n,l;return null!==(n=null===(l=e.downloadableBlocks[t])||void 0===l?void 0:l.isRequesting)&&void 0!==n&&n}function j(e,t){var n,l;return null!==(n=null===(l=e.downloadableBlocks[t])||void 0===l?void 0:l.results)&&void 0!==n?n:[]}function f(e){return e.blockManagement.installedBlockTypes}const g=Object(d.createRegistrySelector)(e=>t=>{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 <span>by %2$s</span>"),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;t<arguments.length;t++){var n=arguments[t];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return l}))},ywyh:function(e,t){e.exports=window.wp.apiFetch}});
\ No newline at end of file
+!function(){"use strict";var e={n:function(t){var l=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(l,{a:l}),l},d:function(t,l){for(var n in l)e.o(l,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:l[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{store:function(){return x}});var l={};e.r(l),e.d(l,{getDownloadableBlocks:function(){return g},getErrorNoticeForBlock:function(){return h},getErrorNotices:function(){return y},getInstalledBlockTypes:function(){return _},getNewBlockTypes:function(){return w},getUnusedBlockTypes:function(){return E},isInstalling:function(){return f},isRequestingDownloadableBlocks:function(){return b}});var n={};e.r(n),e.d(n,{addInstalledBlockType:function(){return P},clearErrorNotice:function(){return F},fetchDownloadableBlocks:function(){return S},installBlockType:function(){return O},receiveDownloadableBlocks:function(){return C},removeInstalledBlockType:function(){return R},setErrorNotice:function(){return M},setIsInstalling:function(){return A},uninstallBlockType:function(){return D}});var o={};e.r(o),e.d(o,{getDownloadableBlocks:function(){return V}});var r=window.wp.element,a=window.wp.plugins,i=window.wp.hooks,s=window.wp.blocks,c=window.wp.data,d=window.wp.editor,u=window.lodash;var m=(0,c.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(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;l<t.length;l++)if(k(e,t[l].innerBlocks))return!0;return!1}function b(e,t){var l,n;return null!==(l=null===(n=e.downloadableBlocks[t])||void 0===n?void 0:n.isRequesting)&&void 0!==l&&l}function g(e,t){var l,n;return null!==(l=null===(n=e.downloadableBlocks[t])||void 0===n?void 0:n.results)&&void 0!==l?l:[]}function _(e){return e.blockManagement.installedBlockTypes}const w=(0,c.createRegistrySelector)((e=>t=>{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<arguments.length;t++){var l=arguments[t];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e},Y.apply(this,arguments)}var j=window.wp.htmlEntities;var q=function(e){let{icon:t,size:l=24,...n}=e;return(0,r.cloneElement)(t,{width:l,height:l,...n})},G=window.wp.primitives;var W=(0,r.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(G.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"}));var J=(0,r.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(G.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"}));var Q=(0,r.createElement)(G.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(G.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"}));var X=function(e){let{rating:t}=e;const l=.5*Math.round(t/.5),n=Math.floor(t),o=Math.ceil(t-n),a=5-(n+o);return(0,r.createElement)("span",{"aria-label":(0,v.sprintf)((0,v.__)("%s out of 5 stars"),l)},(0,u.times)(n,(e=>(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 <span>by %2$s</span>"),(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,12440 +1,7513 @@
-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__) {
+/***/ 6411:
+/***/ (function(module, exports) {
-"use strict";
+var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
+ autosize 4.0.4
+ license: MIT
+ http://www.jacklmoore.com/autosize
+*/
+(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__));
+ } else { var mod; }
+})(this, function (module, exports) {
+ 'use strict';
-// EXPORTS
-__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ useNotifyCopy; });
-__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ useClipboardHandler; });
+ var map = typeof Map === "function" ? new Map() : function () {
+ var keys = [];
+ var values = [];
-// EXTERNAL MODULE: external ["wp","element"]
-var external_wp_element_ = __webpack_require__("GRId");
+ return {
+ has: function has(key) {
+ return keys.indexOf(key) > -1;
+ },
+ get: function get(key) {
+ return values[keys.indexOf(key)];
+ },
+ set: function set(key, value) {
+ if (keys.indexOf(key) === -1) {
+ keys.push(key);
+ values.push(value);
+ }
+ },
+ delete: function _delete(key) {
+ var index = keys.indexOf(key);
+ if (index > -1) {
+ keys.splice(index, 1);
+ values.splice(index, 1);
+ }
+ }
+ };
+ }();
-// EXTERNAL MODULE: external ["wp","blocks"]
-var external_wp_blocks_ = __webpack_require__("HSyU");
+ var createEvent = function createEvent(name) {
+ return new Event(name, { bubbles: true });
+ };
+ try {
+ new Event('test');
+ } catch (e) {
+ // IE does not support `new Event()`
+ createEvent = function createEvent(name) {
+ var evt = document.createEvent('Event');
+ evt.initEvent(name, true, false);
+ return evt;
+ };
+ }
-// EXTERNAL MODULE: external ["wp","dom"]
-var external_wp_dom_ = __webpack_require__("1CF3");
+ function assign(ta) {
+ if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;
-// EXTERNAL MODULE: external ["wp","data"]
-var external_wp_data_ = __webpack_require__("1ZqX");
+ var heightOffset = null;
+ var clientWidth = null;
+ var cachedHeight = null;
-// EXTERNAL MODULE: external ["wp","i18n"]
-var external_wp_i18n_ = __webpack_require__("l3Sj");
+ function init() {
+ var style = window.getComputedStyle(ta, null);
-// EXTERNAL MODULE: external ["wp","notices"]
-var external_wp_notices_ = __webpack_require__("onLe");
+ if (style.resize === 'vertical') {
+ ta.style.resize = 'none';
+ } else if (style.resize === 'both') {
+ ta.style.resize = 'horizontal';
+ }
-// EXTERNAL MODULE: external ["wp","compose"]
-var external_wp_compose_ = __webpack_require__("K9lf");
+ if (style.boxSizing === 'content-box') {
+ heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));
+ } else {
+ heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
+ }
+ // Fix when a textarea is not on document body and heightOffset is Not a Number
+ if (isNaN(heightOffset)) {
+ heightOffset = 0;
+ }
-// EXTERNAL MODULE: external ["wp","blob"]
-var external_wp_blob_ = __webpack_require__("xTGt");
+ update();
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/get-paste-event-data.js
-/**
- * WordPress dependencies
- */
+ function changeOverflow(value) {
+ {
+ // Chrome/Safari-specific fix:
+ // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space
+ // made available by removing the scrollbar. The following forces the necessary text reflow.
+ var width = ta.style.width;
+ ta.style.width = '0px';
+ // Force reflow:
+ /* jshint ignore:start */
+ ta.offsetWidth;
+ /* jshint ignore:end */
+ ta.style.width = width;
+ }
+ ta.style.overflowY = value;
+ }
-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.
+ function getParentOverflows(el) {
+ var arr = [];
- 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;
- }
- }
+ while (el && el.parentNode && el.parentNode instanceof Element) {
+ if (el.parentNode.scrollTop) {
+ arr.push({
+ node: el.parentNode,
+ scrollTop: el.parentNode.scrollTop
+ });
+ }
+ el = el.parentNode;
+ }
- 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.
+ return arr;
+ }
- if (files.length && !html) {
- html = files.map(file => `<img src="${Object(external_wp_blob_["createBlobURL"])(file)}">`).join('');
- plainText = '';
- }
+ function resize() {
+ if (ta.scrollHeight === 0) {
+ // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.
+ return;
+ }
- return {
- html,
- plainText
- };
-}
+ var overflows = getParentOverflows(ta);
+ var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules
-var store = __webpack_require__("BhPs");
+ ta.style.height = '';
+ ta.style.height = ta.scrollHeight + heightOffset + 'px';
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/copy-handler/index.js
+ // used to check if an update is actually necessary on window.resize
+ clientWidth = ta.clientWidth;
+ // prevents scroll-position jumping
+ overflows.forEach(function (el) {
+ el.node.scrollTop = el.scrollTop;
+ });
-/**
- * WordPress dependencies
- */
+ if (docTop) {
+ document.documentElement.scrollTop = docTop;
+ }
+ }
+ function update() {
+ resize();
+ var styleHeight = Math.round(parseFloat(ta.style.height));
+ var computed = window.getComputedStyle(ta, null);
+ // Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box
+ var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;
+ // The actual height not matching the style height (set via the resize method) indicates that
+ // the max-height has been exceeded, in which case the overflow should be allowed.
+ if (actualHeight < styleHeight) {
+ if (computed.overflowY === 'hidden') {
+ changeOverflow('scroll');
+ resize();
+ actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
+ }
+ } else {
+ // Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands.
+ if (computed.overflowY !== 'hidden') {
+ changeOverflow('hidden');
+ resize();
+ actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
+ }
+ }
+ if (cachedHeight !== actualHeight) {
+ cachedHeight = actualHeight;
+ var evt = createEvent('autosize:resized');
+ try {
+ ta.dispatchEvent(evt);
+ } catch (err) {
+ // Firefox will throw an error on dispatchEvent for a detached element
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=889376
+ }
+ }
+ }
+ var pageResize = function pageResize() {
+ if (ta.clientWidth !== clientWidth) {
+ update();
+ }
+ };
-/**
- * Internal dependencies
- */
+ var destroy = function (style) {
+ window.removeEventListener('resize', pageResize, false);
+ ta.removeEventListener('input', update, false);
+ ta.removeEventListener('keyup', update, false);
+ ta.removeEventListener('autosize:destroy', destroy, false);
+ ta.removeEventListener('autosize:update', update, false);
+ Object.keys(style).forEach(function (key) {
+ ta.style[key] = style[key];
+ });
+ map.delete(ta);
+ }.bind(ta, {
+ height: ta.style.height,
+ resize: ta.style.resize,
+ overflowY: ta.style.overflowY,
+ overflowX: ta.style.overflowX,
+ wordWrap: ta.style.wordWrap
+ });
-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 = '';
+ ta.addEventListener('autosize:destroy', destroy, false);
- if (selectedBlockClientIds.length === 1) {
- var _getBlockType;
+ // IE9 does not fire onpropertychange or oninput for deletions,
+ // so binding to onkeyup to catch most of those events.
+ // There is no way that I know of to detect something like 'cut' in IE9.
+ if ('onpropertychange' in ta && 'oninput' in ta) {
+ ta.addEventListener('keyup', update, false);
+ }
- 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);
- }
+ window.addEventListener('resize', pageResize, false);
+ ta.addEventListener('input', update, false);
+ ta.addEventListener('autosize:update', update, false);
+ ta.style.overflowX = 'hidden';
+ ta.style.wordWrap = 'break-word';
- 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();
+ map.set(ta, {
+ destroy: destroy,
+ update: update
+ });
- if (selectedBlockClientIds.length === 0) {
- return;
- } // Always handle multiple selected blocks.
+ init();
+ }
+ function destroy(ta) {
+ var methods = map.get(ta);
+ if (methods) {
+ methods.destroy();
+ }
+ }
- 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.
+ function update(ta) {
+ var methods = map.get(ta);
+ if (methods) {
+ methods.update();
+ }
+ }
- 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.
+ var autosize = null;
- if (hasSelection) {
- return;
- }
- }
+ // Do nothing in Node.js environment and IE8 (or lower)
+ if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
+ autosize = function autosize(el) {
+ return el;
+ };
+ autosize.destroy = function (el) {
+ return el;
+ };
+ autosize.update = function (el) {
+ return el;
+ };
+ } else {
+ autosize = function autosize(el, options) {
+ if (el) {
+ Array.prototype.forEach.call(el.length ? el : [el], function (x) {
+ return assign(x, options);
+ });
+ }
+ return el;
+ };
+ autosize.destroy = function (el) {
+ if (el) {
+ Array.prototype.forEach.call(el.length ? el : [el], destroy);
+ }
+ return el;
+ };
+ autosize.update = function (el) {
+ if (el) {
+ Array.prototype.forEach.call(el.length ? el : [el], update);
+ }
+ return el;
+ };
+ }
- if (!node.contains(event.target.ownerDocument.activeElement)) {
- return;
- }
+ exports.default = autosize;
+ module.exports = exports['default'];
+});
- const eventDefaultPrevented = event.defaultPrevented;
- event.preventDefault();
+/***/ }),
- if (event.type === 'copy' || event.type === 'cut') {
- if (selectedBlockClientIds.length === 1) {
- flashBlock(selectedBlockClientIds[0]);
- }
+/***/ 4403:
+/***/ (function(module, exports) {
- 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);
- }
+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 */
- 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;
- }
+(function () {
+ 'use strict';
- 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);
- }
- }
+ var hasOwn = {}.hasOwnProperty;
- 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 classNames() {
+ var classes = [];
-function CopyHandler(_ref) {
- let {
- children
- } = _ref;
- return Object(external_wp_element_["createElement"])("div", {
- ref: useClipboardHandler()
- }, children);
-}
+ for (var i = 0; i < arguments.length; i++) {
+ var arg = arguments[i];
+ if (!arg) continue;
-/* harmony default export */ var copy_handler = __webpack_exports__["a"] = (CopyHandler);
+ var argType = typeof arg;
+ 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());
+ }
+ }
+ }
-/***/ }),
+ return classes.join(' ');
+ }
-/***/ "+6d5":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ 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 {}
+}());
-"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
- */
+/***/ }),
+/***/ 4827:
+/***/ (function(module) {
-/**
- * Internal dependencies
- */
+// 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) :
-/**
- * Returns the class names used for block moving mode.
- *
- * @param {string} clientId The block client ID to insert above.
- *
- * @return {string} The class names.
- */
+ // 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();
+ })
+ ];
+};
-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!
+module.exports = computedStyle;
- 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__) {
+/***/ 1198:
+/***/ (function(__unused_webpack_module, exports) {
"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");
+/*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;
-function _objectWithoutPropertiesLoose(source, excluded) {
- if (source == null) return {};
- var target = {};
- var sourceKeys = Object.keys(source);
- var key, i;
+ if (typeof options === 'function') {
+ callback = options;
+ options = {};
+ }
- for (i = 0; i < sourceKeys.length; i++) {
- key = sourceKeys[i];
- if (excluded.indexOf(key) >= 0) continue;
- target[key] = source[key];
- }
+ this.options = options;
+ var self = this;
- return target;
-}
+ 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
-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();
-}
+ 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
-const attributeCache = {};
-function applyAnimatedValues(instance, props) {
- if (!instance.nodeType || !instance.setAttribute) {
- return false;
- }
+ var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
- const isFilterElement = instance.nodeName === 'filter' || instance.parentNode && instance.parentNode.nodeName === 'filter';
+ 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.
- 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())));
+ function execEditLength() {
+ for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
+ var basePath =
+ /*istanbul ignore start*/
+ void 0
+ /*istanbul ignore end*/
+ ;
- if (children !== void 0) {
- instance.textContent = children;
- }
+ var addPath = bestPath[diagonalPath - 1],
+ removePath = bestPath[diagonalPath + 1],
+ _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
- for (let name in style) {
- if (style.hasOwnProperty(name)) {
- const value = dangerousStyleValue(name, style[name]);
+ if (addPath) {
+ // No one else is going to attempt to use this value, clear it
+ bestPath[diagonalPath - 1] = undefined;
+ }
- if (isCustomPropRE.test(name)) {
- instance.style.setProperty(name, value);
- } else {
- instance.style[name] = value;
- }
- }
- }
+ var canAdd = addPath && addPath.newPos + 1 < newLen,
+ canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
- names.forEach((name, i) => {
- instance.setAttribute(name, values[i]);
- });
+ 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 (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
-};
+ 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
-const prefixKey = (prefix, key) => prefix + key.charAt(0).toUpperCase() + key.substring(1);
+ basePath.newPos++;
+ self.pushComponent(basePath.components, true, undefined);
+ }
-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);
+ _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done
-const _excluded$1 = ["x", "y", "z"];
-const domTransforms = /^(matrix|translate|scale|rotate|skew)/;
-const pxTransforms = /^(translate)/;
-const degTransforms = /^(rotate|skew)/;
+ 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;
+ }
+ }
-const addUnit = (value, unit) => _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* is */ "s"].num(value) && value !== 0 ? value + unit : value;
+ 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.
-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);
+ if (callback) {
+ (function exec() {
+ setTimeout(function () {
+ // This should not happen, but we want to be safe.
- const inputs = [];
- const transforms = [];
+ /* istanbul ignore next */
+ if (editLength > maxEditLength) {
+ return callback();
+ }
- 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)]);
- }
+ if (!execEditLength()) {
+ exec();
+ }
+ }, 0);
+ })();
+ } else {
+ while (editLength <= maxEditLength) {
+ var ret = execEditLength();
- 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 (ret) {
+ return ret;
+ }
}
- });
-
- 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;
- }
+ /*istanbul ignore start*/
- get() {
- return this._value || (this._value = this._get());
- }
+ /*istanbul ignore end*/
+ pushComponent: function pushComponent(components, added, removed) {
+ var last = components[components.length - 1];
- _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;
- }
+ 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
+ });
+ }
+ },
- 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)));
- }
+ /*istanbul ignore start*/
- 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)));
- }
+ /*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;
- eventObserved(event) {
- if (event.type == 'change') {
- this._value = null;
+ while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
+ newPos++;
+ oldPos++;
+ commonCount++;
}
- Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[/* callFluidObservers */ "d"])(this, event);
- }
+ if (commonCount) {
+ basePath.components.push({
+ count: commonCount
+ });
+ }
-}
+ basePath.newPos = newPos;
+ return oldPos;
+ },
-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'];
+ /*istanbul ignore start*/
-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);
+ /*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();
+ }
+ },
- return props;
- }
-});
-const animated = host.animated;
+ /*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*/
-/***/ "+G0a":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ /*istanbul ignore end*/
+ castInput: function castInput(value) {
+ return value;
+ },
-"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
- */
+ /*istanbul ignore start*/
+ /*istanbul ignore end*/
+ tokenize: function tokenize(value) {
+ return value.split('');
+ },
+ /*istanbul ignore start*/
-/**
- * Internal dependencies
- */
+ /*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;
-/**
- * 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)
- */
+ for (; componentPos < componentLen; componentPos++) {
+ var component = components[componentPos];
-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];
-};
+ 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));
+ }
-/* harmony default export */ __webpack_exports__["a"] = (useBlockTypesState);
+ 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.
-/***/ "+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__);
+ 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();
+ }
-/**
- * WordPress dependencies
- */
+ return components;
+}
-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);
+function clonePath(path) {
+ return {
+ newPos: path.newPos,
+ components: path.components.slice(0)
+ };
+}
/***/ }),
-/***/ "+gtr":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 1973:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
+var __webpack_unused_export__;
+/*istanbul ignore start*/
-// 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);
+__webpack_unused_export__ = ({
+ value: true
+});
+exports.Kx = diffChars;
+__webpack_unused_export__ = void 0;
-// EXTERNAL MODULE: external ["wp","data"]
-var external_wp_data_ = __webpack_require__("1ZqX");
+/*istanbul ignore end*/
+var
+/*istanbul ignore start*/
+_base = _interopRequireDefault(__webpack_require__(1198))
+/*istanbul ignore end*/
+;
-// EXTERNAL MODULE: external ["wp","compose"]
-var external_wp_compose_ = __webpack_require__("K9lf");
+/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-// EXTERNAL MODULE: external ["wp","blocks"]
-var external_wp_blocks_ = __webpack_require__("HSyU");
+/*istanbul ignore end*/
+var characterDiff = new
+/*istanbul ignore start*/
+_base
+/*istanbul ignore end*/
+.
+/*istanbul ignore start*/
+default
+/*istanbul ignore end*/
+();
-// EXTERNAL MODULE: external ["wp","components"]
-var external_wp_components_ = __webpack_require__("tI+e");
+/*istanbul ignore start*/
+__webpack_unused_export__ = characterDiff;
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-mover/index.js
-var block_mover = __webpack_require__("JygI");
+/*istanbul ignore end*/
+function diffChars(oldStr, newStr, options) {
+ return characterDiff.diff(oldStr, newStr, options);
+}
-// 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");
+/***/ 1345:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-// EXTERNAL MODULE: external "lodash"
-var external_lodash_ = __webpack_require__("YLtl");
+"use strict";
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/utils.js
-/**
- * External dependencies
- */
-/**
- * WordPress dependencies
- */
+var util = __webpack_require__(5022);
+function scrollIntoView(elem, container, config) {
+ config = config || {};
+ // document 归一化到 window
+ if (container.nodeType === 9) {
+ container = util.getWindow(container);
+ }
-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);
+ 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;
- const isFocusedWithin = () => {
- return (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.contains(ref.current.ownerDocument.activeElement);
- };
+ allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;
- Object(external_wp_element_["useEffect"])(() => {
- const node = ref.current;
+ 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;
- const handleOnFocus = () => {
- if (isFocusedWithin()) {
- setIsFocused(true);
- debouncedShowMovers();
- }
+ if (isWin) {
+ win = container;
+ wh = util.height(win);
+ ww = util.width(win);
+ winScroll = {
+ left: util.scrollLeft(win),
+ top: util.scrollTop(win)
};
-
- const handleOnBlur = () => {
- if (!isFocusedWithin()) {
- setIsFocused(false);
- debouncedHideMovers();
- }
+ // elem 相对 container 可视视窗的距离
+ diffTop = {
+ left: elemOffset.left - winScroll.left - offsetLeft,
+ top: elemOffset.top - winScroll.top - offsetTop
};
- /**
- * Events are added via DOM events (vs. React synthetic events),
- * as the child React components swallow mouse events.
- */
-
+ 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 (node && !registerRef.current) {
- node.addEventListener('focus', handleOnFocus, true);
- node.addEventListener('blur', handleOnBlur, true);
- registerRef.current = true;
+ 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);
+ }
}
+ }
- return () => {
- if (node) {
- node.removeEventListener('focus', handleOnFocus);
- node.removeEventListener('blur', handleOnBlur);
+ 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);
+ }
}
- };
- }, [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");
+module.exports = scrollIntoView;
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-parent-selector/index.js
+/***/ }),
+/***/ 5425:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-/**
- * WordPress dependencies
- */
+module.exports = __webpack_require__(1345);
+/***/ }),
+/***/ 5022:
+/***/ (function(module) {
+"use strict";
-/**
- * Internal dependencies
- */
+var _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; };
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;
+function getClientPosition(elem) {
+ var box = undefined;
+ var x = undefined;
+ var y = undefined;
+ var doc = elem.ownerDocument;
+ var body = doc.body;
+ var docElem = doc && doc.documentElement;
+ // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式
+ box = elem.getBoundingClientRect();
+ // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop
+ // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确
+ // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin
-/**
- * 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.
- */
+ x = box.left;
+ y = box.top;
-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);
+ // In IE, most of the time, 2 extra pixels are added to the top and left
+ // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and
+ // IE6 standards mode, this border can be overridden by setting the
+ // document element's border to zero -- thus, we cannot rely on the
+ // offset always being 2 pixels.
- const _parentBlockType = Object(external_wp_blocks_["getBlockType"])(parentBlockName);
+ // In quirks mode, the offset can be determined by querying the body's
+ // clientLeft/clientTop, but in standards mode, it is found by querying
+ // the document element's clientLeft/clientTop. Since we already called
+ // getClientBoundingRect we have already forced a reflow, so it is not
+ // too expensive just to query them all.
- 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.
+ // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的
+ // 窗口边框标准是设 documentElement ,quirks 时设置 body
+ // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去
+ // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置
+ // 标准 ie 下 docElem.clientTop 就是 border-top
+ // ie7 html 即窗口边框改变不了。永远为 2
+ // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0
- const nodeRef = Object(external_wp_element_["useRef"])();
- const {
- gestures: showMoversGestures
- } = useShowMoversGestures({
- ref: nodeRef,
+ x -= docElem.clientLeft || body.clientLeft || 0;
+ y -= docElem.clientTop || body.clientTop || 0;
- onChange(isFocused) {
- if (isFocused && hasReducedUI) {
- return;
- }
+ return {
+ left: x,
+ top: y
+ };
+}
- toggleBlockHighlight(firstParentClientId, isFocused);
+function getScroll(w, top) {
+ var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];
+ var method = 'scroll' + (top ? 'Top' : 'Left');
+ if (typeof ret !== 'number') {
+ var d = w.document;
+ // ie6,7,8 standard mode
+ ret = d.documentElement[method];
+ if (typeof ret !== 'number') {
+ // quirks mode
+ ret = d.body[method];
}
+ }
+ return ret;
+}
- });
+function getScrollLeft(w) {
+ return getScroll(w);
+}
- if (shouldHide || firstParentClientId === undefined) {
- return null;
+function getScrollTop(w) {
+ return getScroll(w, true);
+}
+
+function getOffset(el) {
+ var pos = getClientPosition(el);
+ var doc = el.ownerDocument;
+ var w = doc.defaultView || doc.parentWindow;
+ pos.left += getScrollLeft(w);
+ pos.top += getScrollTop(w);
+ return pos;
+}
+function _getComputedStyle(elem, name, computedStyle_) {
+ var val = '';
+ var d = elem.ownerDocument;
+ var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);
+
+ // https://github.com/kissyteam/kissy/issues/61
+ if (computedStyle) {
+ val = computedStyle.getPropertyValue(name) || computedStyle[name];
}
- 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
- })
- }));
+ return val;
}
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/stack.js
-var stack = __webpack_require__("wzfx");
+var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');
+var RE_POS = /^(top|right|bottom|left)$/;
+var CURRENT_STYLE = 'currentStyle';
+var RUNTIME_STYLE = 'runtimeStyle';
+var LEFT = 'left';
+var PX = 'px';
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-title/index.js
-var block_title = __webpack_require__("f8JO");
+function _getComputedStyleIE(elem, name) {
+ // currentStyle maybe null
+ // http://msdn.microsoft.com/en-us/library/ms535231.aspx
+ var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-preview/index.js + 2 modules
-var block_preview = __webpack_require__("REKd");
+ // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值
+ // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19
+ // 在 ie 下不对,需要直接用 offset 方式
+ // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/preview-block-popover.js
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ // exclude left right for relativity
+ if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {
+ // Remember the original values
+ var style = elem.style;
+ var left = style[LEFT];
+ var rsLeft = elem[RUNTIME_STYLE][LEFT];
+ // prevent flashing of content
+ elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];
-/**
- * WordPress dependencies
- */
+ // Put in the new values to get a computed value out
+ style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;
+ ret = style.pixelLeft + PX;
+ // Revert the changed values
+ style[LEFT] = left;
-/**
- * Internal dependencies
- */
+ elem[RUNTIME_STYLE][LEFT] = rsLeft;
+ }
+ return ret === '' ? 'auto' : ret;
+}
+var getComputedStyleX = undefined;
+if (typeof window !== 'undefined') {
+ getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;
+}
-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
- })))));
+function each(arr, fn) {
+ for (var i = 0; i < arr.length; i++) {
+ fn(arr[i]);
+ }
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/block-transformations-menu.js
+function isBorderBoxFn(elem) {
+ return getComputedStyleX(elem, 'boxSizing') === 'border-box';
+}
+var BOX_MODELS = ['margin', 'border', 'padding'];
+var CONTENT_INDEX = -1;
+var PADDING_INDEX = 2;
+var BORDER_INDEX = 1;
+var MARGIN_INDEX = 0;
-/**
- * WordPress dependencies
- */
+function swap(elem, options, callback) {
+ var old = {};
+ var style = elem.style;
+ var name = undefined;
+
+ // Remember the old values, and insert the new ones
+ for (name in options) {
+ if (options.hasOwnProperty(name)) {
+ old[name] = style[name];
+ style[name] = options[name];
+ }
+ }
+ callback.call(elem);
+ // Revert the old values
+ for (name in options) {
+ if (options.hasOwnProperty(name)) {
+ style[name] = old[name];
+ }
+ }
+}
+function getPBMWidth(elem, props, which) {
+ var value = 0;
+ var prop = undefined;
+ var j = undefined;
+ var i = undefined;
+ for (j = 0; j < props.length; j++) {
+ prop = props[j];
+ if (prop) {
+ for (i = 0; i < which.length; i++) {
+ var cssProp = undefined;
+ if (prop === 'border') {
+ cssProp = prop + which[i] + 'Width';
+ } else {
+ cssProp = prop + which[i];
+ }
+ value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;
+ }
+ }
+ }
+ return value;
+}
/**
- * Internal dependencies
+ * A crude way of determining if an object is a window
+ * @member util
*/
+function isWindow(obj) {
+ // must use == for ie8
+ /* eslint eqeqeq:0 */
+ return obj != null && obj == obj.window;
+}
+var domUtils = {};
+each(['Width', 'Height'], function (name) {
+ domUtils['doc' + name] = function (refWin) {
+ var d = refWin.document;
+ return Math.max(
+ // firefox chrome documentElement.scrollHeight< body.scrollHeight
+ // ie standard mode : documentElement.scrollHeight> body.scrollHeight
+ d.documentElement['scroll' + name],
+ // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?
+ d.body['scroll' + name], domUtils['viewport' + name](d));
+ };
+ domUtils['viewport' + name] = function (win) {
+ // pc browser includes scrollbar in window.innerWidth
+ var prop = 'client' + name;
+ var doc = win.document;
+ var body = doc.body;
+ var documentElement = doc.documentElement;
+ var documentElementProp = documentElement[prop];
+ // 标准模式取 documentElement
+ // backcompat 取 body
+ return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;
+ };
+});
-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
+/*
+ 得到元素的大小信息
+ @param elem
+ @param name
+ @param {String} [extra] 'padding' : (css width) + padding
+ 'border' : (css width) + padding + border
+ 'margin' : (css width) + padding + border + margin
*/
+function getWH(elem, name, extra) {
+ if (isWindow(elem)) {
+ return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);
+ } else if (elem.nodeType === 9) {
+ return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);
+ }
+ var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
+ var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;
+ var computedStyle = getComputedStyleX(elem);
+ var isBorderBox = isBorderBoxFn(elem, computedStyle);
+ var cssBoxValue = 0;
+ if (borderBoxValue == null || borderBoxValue <= 0) {
+ borderBoxValue = undefined;
+ // Fall back to computed then un computed css if necessary
+ cssBoxValue = getComputedStyleX(elem, name);
+ if (cssBoxValue == null || Number(cssBoxValue) < 0) {
+ cssBoxValue = elem.style[name] || 0;
+ }
+ // Normalize '', auto, and prepare for extra
+ cssBoxValue = parseFloat(cssBoxValue) || 0;
+ }
+ if (extra === undefined) {
+ extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;
+ }
+ var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;
+ var val = borderBoxValue || cssBoxValue;
+ if (extra === CONTENT_INDEX) {
+ if (borderBoxValueOrIsBorderBox) {
+ return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);
+ }
+ return cssBoxValue;
+ }
+ if (borderBoxValueOrIsBorderBox) {
+ var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle);
+ return val + (extra === BORDER_INDEX ? 0 : padding);
+ }
+ return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);
+}
+var cssShow = {
+ position: 'absolute',
+ visibility: 'hidden',
+ display: 'block'
+};
+// fix #119 : https://github.com/kissyteam/kissy/issues/119
+function getWHIgnoreDisplay(elem) {
+ var val = undefined;
+ var args = arguments;
+ // in case elem is window
+ // elem.offsetWidth === undefined
+ if (elem.offsetWidth !== 0) {
+ val = getWH.apply(undefined, args);
+ } else {
+ swap(elem, cssShow, function () {
+ val = getWH.apply(undefined, args);
+ });
+ }
+ return val;
+}
+function css(el, name, v) {
+ var value = v;
+ if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {
+ for (var i in name) {
+ if (name.hasOwnProperty(i)) {
+ css(el, i, name[i]);
+ }
+ }
+ return undefined;
+ }
+ if (typeof value !== 'undefined') {
+ if (typeof value === 'number') {
+ value += 'px';
+ }
+ el.style[name] = value;
+ return undefined;
+ }
+ return getComputedStyleX(el, name);
+}
+each(['width', 'height'], function (name) {
+ var first = name.charAt(0).toUpperCase() + name.slice(1);
+ domUtils['outer' + first] = function (el, includeMargin) {
+ return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);
+ };
+ var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
-/**
- * Internal dependencies
- */
+ domUtils[name] = function (elem, val) {
+ if (val !== undefined) {
+ if (elem) {
+ var computedStyle = getComputedStyleX(elem);
+ var isBorderBox = isBorderBoxFn(elem);
+ if (isBorderBox) {
+ val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);
+ }
+ return css(elem, name, val);
+ }
+ return undefined;
+ }
+ return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);
+ };
+});
+// 设置 elem 相对 elem.ownerDocument 的坐标
+function setOffset(elem, offset) {
+ // set position first, in-case top/left are set even on static elem
+ if (css(elem, 'position') === 'static') {
+ elem.style.position = 'relative';
+ }
+ var old = getOffset(elem);
+ var ret = {};
+ var current = undefined;
+ var key = undefined;
-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"
- }));
+ for (key in offset) {
+ if (offset.hasOwnProperty(key)) {
+ current = parseFloat(css(elem, key)) || 0;
+ ret[key] = current + offset[key] - old[key];
+ }
+ }
+ css(elem, ret);
}
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right.js
-var chevron_right = __webpack_require__("1iEr");
+module.exports = _extends({
+ getWindow: function getWindow(node) {
+ var doc = node.ownerDocument || node;
+ return doc.defaultView || doc.parentWindow;
+ },
+ offset: function offset(el, value) {
+ if (typeof value !== 'undefined') {
+ setOffset(el, value);
+ } else {
+ return getOffset(el);
+ }
+ },
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/utils.js
-/**
- * WordPress dependencies
- */
+ isWindow: isWindow,
+ each: each,
+ css: css,
+ clone: function clone(obj) {
+ var ret = {};
+ for (var i in obj) {
+ if (obj.hasOwnProperty(i)) {
+ ret[i] = obj[i];
+ }
+ }
+ var overflow = obj.overflow;
+ if (overflow) {
+ for (var i in obj) {
+ if (obj.hasOwnProperty(i)) {
+ ret.overflow[i] = obj.overflow[i];
+ }
+ }
+ }
+ return ret;
+ },
+ scrollLeft: function scrollLeft(w, v) {
+ if (isWindow(w)) {
+ if (v === undefined) {
+ return getScrollLeft(w);
+ }
+ window.scrollTo(v, getScrollTop(w));
+ } else {
+ if (v === undefined) {
+ return w.scrollLeft;
+ }
+ w.scrollLeft = v;
+ }
+ },
+ scrollTop: function scrollTop(w, v) {
+ if (isWindow(w)) {
+ if (v === undefined) {
+ return getScrollTop(w);
+ }
+ window.scrollTo(getScrollLeft(w), v);
+ } else {
+ if (v === undefined) {
+ return w.scrollTop;
+ }
+ w.scrollTop = v;
+ }
+ },
-/**
- * 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`).
- */
+ viewportWidth: 0,
+ viewportHeight: 0
+}, domUtils);
-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.
+/***/ 8575:
+/***/ (function(module) {
- for (const innerBlock of innerBlocks) {
- const match = getMatchingBlockByName(innerBlock, selectedBlockName, consumedBlocks);
- if (match) return match;
+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
+ }
}
-};
-/**
- * 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
- */
+/***/ }),
+
+/***/ 9894:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+// Load in dependencies
+var computedStyle = __webpack_require__(4827);
/**
- * Internal dependencies
+ * 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';
-/**
- * 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}
- */
+ // Calculate the em based height
+ lnHeightStr = computedStyle(node, 'line-height');
+ lnHeight = parseFloat(lnHeightStr, 10);
-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.
- */
+ // Revert the lineHeight style
+ if (_lnHeightStyle) {
+ node.style.lineHeight = _lnHeightStyle;
+ } else {
+ delete node.style.lineHeight;
+ }
+ }
-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`.
- */
+ // 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);
- const consumedBlocks = new Set();
+ // 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 = ' ';
- for (const selectedBlock of selectedBlocks) {
- let isMatch = false;
+ // 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');
+ }
- 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.
+ // Set the font-size of the element
+ var fontSizeStr = computedStyle(node, 'font-size');
+ _node.style.fontSize = fontSizeStr;
- transformMatchingBlock(match, selectedBlock); // No need to loop through other pattern's blocks.
+ // 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';
- break;
- } // Bail eary if a selected block has not been matched.
+ // 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;
- if (!isMatch) return;
+ // Remove our child from the DOM
+ body.removeChild(_node);
}
- return _patternBlocks;
-};
-/**
- * @typedef {WPBlockPattern & {transformedBlocks: WPBlock[]}} TransformedBlockPattern
- */
+ // Return the calculated height
+ return lnHeight;
+}
-/**
- * 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
+// Export lineHeight
+module.exports = lineHeight;
-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]);
-};
+/***/ 7970:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-/* harmony default export */ var use_transformed_patterns = (useTransformedPatterns);
+module.exports = __webpack_require__(195);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/pattern-transformations-menu.js
+/***/ }),
+/***/ 3110:
+/***/ (function(module) {
+"use strict";
/**
- * 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 */
+var canUseDOM = !!(
+ typeof window !== 'undefined' &&
+ window.document &&
+ window.document.createElement
+);
-/**
- * Internal 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 = {
+ canUseDOM: canUseDOM,
+ canUseWorkers: typeof Worker !== 'undefined',
-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')));
-}
+ canUseEventListeners:
+ canUseDOM && !!(window.addEventListener || window.attachEvent),
-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
- })))));
-}
+ canUseViewport: canUseDOM && !!window.screen,
-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
- })));
-}
+ isInWorker: !canUseDOM // For now, this is true - might change in the future.
-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);
+module.exports = ExecutionEnvironment;
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/index.js
+/***/ }),
+
+/***/ 3812:
+/***/ (function(module) {
/**
- * External dependencies
+ * Copyright 2004-present Facebook. All Rights Reserved.
+ *
+ * @providesModule UserAgent_DEPRECATED
*/
/**
- * WordPress dependencies
+ * Provides entirely client-side User Agent and OS detection. You should prefer
+ * the non-deprecated UserAgent module when possible, which exposes our
+ * authoritative server-side PHP-based detection to the client.
+ *
+ * Usage is straightforward:
+ *
+ * if (UserAgent_DEPRECATED.ie()) {
+ * // IE
+ * }
+ *
+ * You can also do version checks:
+ *
+ * if (UserAgent_DEPRECATED.ie() >= 7) {
+ * // IE7 or better
+ * }
+ *
+ * The browser functions will return NaN if the browser does not match, so
+ * you can also do version compares the other way:
+ *
+ * if (UserAgent_DEPRECATED.ie() < 7) {
+ * // IE6 or worse
+ * }
+ *
+ * Note that the version is a float and may include a minor version number,
+ * so you should always use range operators to perform comparisons, not
+ * strict equality.
+ *
+ * **Note:** You should **strongly** prefer capability detection to browser
+ * version detection where it's reasonable:
+ *
+ * http://www.quirksmode.org/js/support.html
+ *
+ * Further, we have a large number of mature wrapper functions and classes
+ * which abstract away many browser irregularities. Check the documentation,
+ * grep for things, or ask on javascript@lists.facebook.com before writing yet
+ * another copy of "event || window.event".
+ *
*/
+var _populated = false;
+// Browsers
+var _ie, _firefox, _opera, _webkit, _chrome;
+// Actual IE browser for compatibility mode
+var _ie_real_version;
+// Platforms
+var _osx, _windows, _linux, _android;
+// Architectures
+var _win64;
-/**
- * Internal dependencies
- */
+// Devices
+var _iphone, _ipad, _native;
+var _mobile;
+function _populate() {
+ if (_populated) {
+ return;
+ }
+ _populated = true;
+ // To work around buggy JS libraries that can't handle multi-digit
+ // version numbers, Opera 10's user agent string claims it's Opera
+ // 9, then later includes a Version/X.Y field:
+ //
+ // Opera/9.80 (foo) Presto/2.2.15 Version/10.10
+ var uas = navigator.userAgent;
+ var agent = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(uas);
+ var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas);
+ _iphone = /\b(iPhone|iP[ao]d)/.exec(uas);
+ _ipad = /\b(iP[ao]d)/.exec(uas);
+ _android = /Android/i.exec(uas);
+ _native = /FBAN\/\w+;/i.exec(uas);
+ _mobile = /Mobile/i.exec(uas);
+ // Note that the IE team blog would have you believe you should be checking
+ // for 'Win64; x64'. But MSDN then reveals that you can actually be coming
+ // from either x64 or ia64; so ultimately, you should just check for Win64
+ // as in indicator of whether you're in 64-bit IE. 32-bit IE on 64-bit
+ // Windows will send 'WOW64' instead.
+ _win64 = !!(/Win64/.exec(uas));
+ if (agent) {
+ _ie = agent[1] ? parseFloat(agent[1]) : (
+ agent[5] ? parseFloat(agent[5]) : NaN);
+ // IE compatibility mode
+ if (_ie && document && document.documentMode) {
+ _ie = document.documentMode;
+ }
+ // grab the "true" ie version from the trident token if available
+ var trident = /(?:Trident\/(\d+.\d+))/.exec(uas);
+ _ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie;
-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;
+ _firefox = agent[2] ? parseFloat(agent[2]) : NaN;
+ _opera = agent[3] ? parseFloat(agent[3]) : NaN;
+ _webkit = agent[4] ? parseFloat(agent[4]) : NaN;
+ if (_webkit) {
+ // We do not add the regexp to the above test, because it will always
+ // match 'safari' only since 'AppleWebKit' appears before 'Chrome' in
+ // the userAgent string.
+ agent = /(?:Chrome\/(\d+\.\d+))/.exec(uas);
+ _chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN;
+ } else {
+ _chrome = NaN;
+ }
+ } else {
+ _ie = _firefox = _opera = _chrome = _webkit = NaN;
+ }
- 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;
+ if (os) {
+ if (os[1]) {
+ // Detect OS X version. If no version number matches, set _osx to true.
+ // Version examples: 10, 10_6_1, 10.7
+ // Parses version number as a float, taking only first two sets of
+ // digits. If only one set of digits is found, returns just the major
+ // version number.
+ var ver = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(uas);
- const _isSingleBlockSelected = blocks.length === 1;
+ _osx = ver ? parseFloat(ver[1].replace('_', '.')) : true;
+ } else {
+ _osx = false;
+ }
+ _windows = !!os[2];
+ _linux = !!os[3];
+ } else {
+ _osx = _windows = _linux = false;
+ }
+}
- const styles = _isSingleBlockSelected && getBlockStyles(firstBlockName);
+var UserAgent_DEPRECATED = {
- let _icon;
+ /**
+ * Check if the UA is Internet Explorer.
+ *
+ *
+ * @return float|NaN Version number (if match) or NaN.
+ */
+ ie: function() {
+ return _populate() || _ie;
+ },
- if (_isSingleBlockSelected) {
- _icon = blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon; // Take into account active block variations.
- } else {
- var _getBlockType;
+ /**
+ * Check if we're in Internet Explorer compatibility mode.
+ *
+ * @return bool true if in compatibility mode, false if
+ * not compatibility mode or not ie
+ */
+ ieCompatibilityMode: function() {
+ return _populate() || (_ie_real_version > _ie);
+ },
- 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 */];
- }
+ /**
+ * Whether the browser is 64-bit IE. Really, this is kind of weak sauce; we
+ * only need this because Skype can't handle 64-bit IE yet. We need to remove
+ * this when we don't need it -- tracked by #601957.
+ */
+ ie64: function() {
+ return UserAgent_DEPRECATED.ie() && _win64;
+ },
- 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.
+ /**
+ * Check if the UA is Firefox.
+ *
+ *
+ * @return float|NaN Version number (if match) or NaN.
+ */
+ firefox: function() {
+ return _populate() || _firefox;
+ },
- const onBlockTransform = name => replaceBlocks(clientIds, Object(external_wp_blocks_["switchToBlockType"])(blocks, name)); // Pattern transformation through the `Patterns` API.
+ /**
+ * Check if the UA is Opera.
+ *
+ *
+ * @return float|NaN Version number (if match) or NaN.
+ */
+ opera: function() {
+ return _populate() || _opera;
+ },
- const onPatternTransform = transformedBlocks => replaceBlocks(clientIds, transformedBlocks);
- const hasPossibleBlockTransformations = !!possibleBlockTransformations.length && canRemove;
- const hasPatternTransformation = !!(patterns !== null && patterns !== void 0 && patterns.length) && canRemove;
+ /**
+ * Check if the UA is WebKit.
+ *
+ *
+ * @return float|NaN Version number (if match) or NaN.
+ */
+ webkit: function() {
+ return _populate() || _webkit;
+ },
- 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
- })
- }));
- }
+ /**
+ * For Push
+ * WILL BE REMOVED VERY SOON. Use UserAgent_DEPRECATED.webkit
+ */
+ safari: function() {
+ return UserAgent_DEPRECATED.webkit();
+ },
- 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]);
+ /**
+ * Check if the UA is a Chrome browser.
+ *
+ *
+ * @return float|NaN Version number (if match) or NaN.
+ */
+ chrome : function() {
+ return _populate() || _chrome;
+ },
- 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);
+ /**
+ * Check if the user is running Windows.
+ *
+ * @return bool `true' if the user's OS is Windows.
+ */
+ windows: function() {
+ return _populate() || _windows;
+ },
-// 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");
+ /**
+ * Check if the user is running Mac OS X.
+ *
+ * @return float|bool Returns a float if a version number is detected,
+ * otherwise true/false.
+ */
+ osx: function() {
+ return _populate() || _osx;
+ },
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/index.js
+ /**
+ * Check if the user is running Linux.
+ *
+ * @return bool `true' if the user's OS is some flavor of Linux.
+ */
+ linux: function() {
+ return _populate() || _linux;
+ },
+ /**
+ * Check if the user is running on an iPhone or iPod platform.
+ *
+ * @return bool `true' if the user is running some flavor of the
+ * iPhone OS.
+ */
+ iphone: function() {
+ return _populate() || _iphone;
+ },
+ mobile: function() {
+ return _populate() || (_iphone || _ipad || _android || _mobile);
+ },
-/**
- * External dependencies
- */
+ nativeApp: function() {
+ // webviews inside of the native apps
+ return _populate() || _native;
+ },
-/**
- * WordPress dependencies
- */
+ android: function() {
+ return _populate() || _android;
+ },
+ ipad: function() {
+ return _populate() || _ipad;
+ }
+};
+module.exports = UserAgent_DEPRECATED;
+/***/ }),
+/***/ 7939:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
/**
- * 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);
+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';
+ }
-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;
+ 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');
}
- 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
- }));
+ return isSupported;
}
+module.exports = isEventSupported;
+
/***/ }),
-/***/ "//Lo":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 195:
+/***/ (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_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
+ * 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
*/
-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
- */
+var UserAgent_DEPRECATED = __webpack_require__(3812);
-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);
+var isEventSupported = __webpack_require__(7939);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-lowercase.js
+// Reasonable defaults
+var PIXEL_STEP = 10;
+var LINE_HEIGHT = 40;
+var PAGE_HEIGHT = 800;
/**
- * WordPress dependencies
+ * 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
-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
-
+ // 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; }
-/**
- * WordPress dependencies
- */
+ // side scrolling on FF with DOMMouseScroll
+ if ( 'axis' in event && event.axis === event.HORIZONTAL_AXIS ) {
+ sX = sY;
+ sY = 0;
+ }
-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);
+ pX = sX * PIXEL_STEP;
+ pY = sY * PIXEL_STEP;
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/text-transform-control/index.js
+ 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;
+ }
+ }
-/**
- * WordPress dependencies
- */
+ // 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 };
+}
-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.
+ * 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';
+};
-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)
- });
- })));
-}
+module.exports = normalizeWheel;
/***/ }),
-/***/ "/QNa":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 5372:
+/***/ (function(module, __unused_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
+ * 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.
*/
-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));
- }
+var ReactPropTypesSecret = __webpack_require__(9567);
- 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]);
+function emptyFunction() {}
+function emptyFunctionWithReset() {}
+emptyFunctionWithReset.resetWarningCache = emptyFunction;
- if (!subRegistry) {
- return null;
+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,
- 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);
+ any: shim,
+ arrayOf: getShim,
+ element: shim,
+ elementType: shim,
+ instanceOf: getShim,
+ node: shim,
+ objectOf: getShim,
+ oneOf: getShim,
+ oneOfType: getShim,
+ shape: getShim,
+ exact: getShim,
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/use-block-sync.js
-var use_block_sync = __webpack_require__("JGYp");
+ checkPropTypes: emptyFunctionWithReset,
+ resetWarningCache: emptyFunction
+ };
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/block-refs-provider.js
-var block_refs_provider = __webpack_require__("cDhi");
+ ReactPropTypes.PropTypes = ReactPropTypes;
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/index.js
+ return ReactPropTypes;
+};
-/**
- * WordPress dependencies
- */
+/***/ }),
+/***/ 2652:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
/**
- * Internal dependencies
+ * 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.
*/
-
-
-
-
-/** @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);
+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)();
}
-/* harmony default export */ var provider = __webpack_exports__["a"] = (with_registry_provider(BlockEditorProvider));
-
/***/ }),
-/***/ "/lNF":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 9567:
+/***/ (function(module) {
"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.
+ * Copyright (c) 2013-present, Facebook, Inc.
*
- * @return {Object} An object with block drag and drop data.
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
*/
-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.
- */
+var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
-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
+module.exports = ReactPropTypesSecret;
- 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.
+/***/ 5438:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- 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.
+"use strict";
-
- 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);
+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 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`.
+ * A light replacement for built-in textarea component
+ * which automaticaly adjusts its height to match the content
*/
-
-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);
+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 }));
+});
/***/ }),
-/***/ "0E5u":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 773:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
+var __webpack_unused_export__;
-// 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
-
+__webpack_unused_export__ = true;
+var TextareaAutosize_1 = __webpack_require__(5438);
+exports.Z = TextareaAutosize_1.TextareaAutosize;
-/**
- * WordPress dependencies
- */
-
+/***/ }),
+/***/ 3124:
+/***/ (function(module) {
-const icons = {
- left: justify_left["a" /* default */],
- center: justify_center["a" /* default */],
- right: justify_right["a" /* default */],
- 'space-between': justify_space_between["a" /* default */]
+var traverse = module.exports = function (obj) {
+ return new Traverse(obj);
};
-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
- }));
+function Traverse (obj) {
+ this.value = obj;
}
-
-/***/ }),
-
-/***/ "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
- });
+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;
+};
- 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
- });
+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;
+};
- 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
- });
+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;
+};
- 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
- */
-
-
-
+Traverse.prototype.map = function (cb) {
+ return walk(this.value, cb, true);
+};
-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
+Traverse.prototype.forEach = function (cb) {
+ this.value = walk(this.value, cb, false);
+ return this.value;
};
-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;
+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;
+};
- function applyOrUnset(align) {
- return () => onChange(value === align ? undefined : align);
- }
+Traverse.prototype.paths = function () {
+ var acc = [];
+ this.forEach(function (x) {
+ acc.push(this.path);
+ });
+ return acc;
+};
- const activeAlignment = Object(external_lodash_["find"])(alignmentControls, control => control.align === value);
+Traverse.prototype.nodes = function () {
+ var acc = [];
+ this.forEach(function (x) {
+ acc.push(this.node);
+ });
+ return acc;
+};
- function setIcon() {
- if (activeAlignment) return activeAlignment.icon;
- return Object(external_wp_i18n_["isRTL"])() ? align_right["a" /* default */] : align_left["a" /* default */];
- }
+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);
+};
- 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
+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 }
};
- }), [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();
+
+ 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;
}
- };
-
- 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 */
- ;
+
+ 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;
}
-/* 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: <mark>%s</mark>'), 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 `<input>`. This is because `title` is used
- // when creating the suggestion. Similarly `url` is used when using keyboard to select
- // the suggestion (the <form> `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 `<input>`s text value
- url: val,
- // must match the existing `<input>`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);
+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;
}
- });
-
- const onSuggestionSelected = async selectedSuggestion => {
- let suggestion = selectedSuggestion;
+ else return src;
+}
- if (CREATE_TYPE === selectedSuggestion.type) {
- // Create a new page and call onSelect with the output from the onCreateSuggestion callback
- try {
- var _suggestion;
+var objectKeys = Object.keys || function keys (obj) {
+ var res = [];
+ for (var key in obj) res.push(key)
+ return res;
+};
- suggestion = await onCreateSuggestion(selectedSuggestion.title);
+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]' }
- if ((_suggestion = suggestion) !== null && _suggestion !== void 0 && _suggestion.url) {
- onSelect(suggestion);
- }
- } catch (e) {}
+var isArray = Array.isArray || function isArray (xs) {
+ return Object.prototype.toString.call(xs) === '[object Array]';
+};
- return;
+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);
}
+};
- 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);
- }
- };
+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);
+ };
+});
- 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;
+var hasOwnProperty = Object.hasOwnProperty || function (obj, key) {
+ return key in obj;
+};
- 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");
+/***/ 9196:
+/***/ (function(module) {
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js + 1 modules
-var edit = __webpack_require__("B9Az");
+"use strict";
+module.exports = window["React"];
-// 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
- */
+/******/ });
+/************************************************************************/
+/******/ // 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__);
-const {
- Slot: ViewerSlot,
- Fill: ViewerFill
-} = Object(external_wp_components_["createSlotFill"])('BlockEditorLinkControlViewer');
+// EXPORTS
+__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; }
+});
-/* harmony default export */ var viewer_slot = (ViewerSlot);
+// 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; }
+});
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-rich-url-data.js
-/**
- * Internal dependencies
- */
+// 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
*/
+function migrateLightBlockWrapper(settings) {
+ const {
+ apiVersion = 1
+ } = settings;
-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}`);
+ if (apiVersion < 2 && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, 'lightBlockWrapper', false)) {
+ settings.apiVersion = 2;
}
-}
-
-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;
+ return settings;
}
-/* harmony default export */ var use_rich_url_data = (useRemoteUrlData);
+(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/compat/migrateLightBlockWrapper', migrateLightBlockWrapper);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/link-preview.js
+;// 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];
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }
-/**
- * External dependencies
- */
+ return target;
+ };
+ 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
*/
+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);
-
-
-
-
+;// 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
/**
- * Internal dependencies
+ * WordPress 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
+const PREFERENCES_DEFAULTS = {
+ insertUsage: {}
+};
/**
- * WordPress dependencies
+ * The default editor settings
+ *
+ * @typedef {Object} SETTINGS_DEFAULT
+ * @property {boolean} alignWide Enable/Disable Wide/Full Alignments
+ * @property {boolean} supportsLayout Enable/disable layouts support in container blocks.
+ * @property {boolean} imageEditing Image Editing settings set to false to disable.
+ * @property {Array} imageSizes Available image sizes
+ * @property {number} maxWidth Max width to constraint resizing
+ * @property {boolean|Array} allowedBlockTypes Allowed block types
+ * @property {boolean} hasFixedToolbar Whether or not the editor toolbar is fixed
+ * @property {boolean} focusMode Whether the focus mode is enabled or not
+ * @property {Array} styles Editor Styles
+ * @property {boolean} keepCaretInsideBlock Whether caret should move between blocks in edit mode
+ * @property {string} bodyPlaceholder Empty post placeholder
+ * @property {string} titlePlaceholder Empty title placeholder
+ * @property {boolean} codeEditingEnabled Whether or not the user can switch to the code editor
+ * @property {boolean} __experimentalCanUserUseUnfilteredHTML Whether the user should be able to use unfiltered HTML or the HTML should be filtered e.g., to remove elements considered insecure like iframes.
+ * @property {boolean} __experimentalBlockDirectory Whether the user has enabled the Block Directory
+ * @property {Array} __experimentalBlockPatterns Array of objects representing the block patterns
+ * @property {Array} __experimentalBlockPatternCategories Array of objects representing the block pattern categories
+ * @property {boolean} __unstableGalleryWithImageBlocks Whether the user has enabled the refactored gallery block which uses InnerBlocks
*/
+const SETTINGS_DEFAULTS = {
+ alignWide: false,
+ supportsLayout: true,
+ // 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: (0,external_wp_i18n_namespaceObject.__)('Black'),
+ slug: 'black',
+ color: '#000000'
+ }, {
+ name: (0,external_wp_i18n_namespaceObject.__)('Cyan bluish gray'),
+ slug: 'cyan-bluish-gray',
+ color: '#abb8c3'
+ }, {
+ name: (0,external_wp_i18n_namespaceObject.__)('White'),
+ slug: 'white',
+ color: '#ffffff'
+ }, {
+ name: (0,external_wp_i18n_namespaceObject.__)('Pale pink'),
+ slug: 'pale-pink',
+ color: '#f78da7'
+ }, {
+ name: (0,external_wp_i18n_namespaceObject.__)('Vivid red'),
+ slug: 'vivid-red',
+ color: '#cf2e2e'
+ }, {
+ name: (0,external_wp_i18n_namespaceObject.__)('Luminous vivid orange'),
+ slug: 'luminous-vivid-orange',
+ color: '#ff6900'
+ }, {
+ name: (0,external_wp_i18n_namespaceObject.__)('Luminous vivid amber'),
+ slug: 'luminous-vivid-amber',
+ color: '#fcb900'
+ }, {
+ name: (0,external_wp_i18n_namespaceObject.__)('Light green cyan'),
+ slug: 'light-green-cyan',
+ color: '#7bdcb5'
+ }, {
+ name: (0,external_wp_i18n_namespaceObject.__)('Vivid green cyan'),
+ slug: 'vivid-green-cyan',
+ color: '#00d084'
+ }, {
+ name: (0,external_wp_i18n_namespaceObject.__)('Pale cyan blue'),
+ slug: 'pale-cyan-blue',
+ color: '#8ed1fc'
+ }, {
+ name: (0,external_wp_i18n_namespaceObject.__)('Vivid cyan blue'),
+ slug: 'vivid-cyan-blue',
+ color: '#0693e3'
+ }, {
+ 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: (0,external_wp_i18n_namespaceObject._x)('Small', 'font size name'),
+ size: 13,
+ slug: 'small'
+ }, {
+ name: (0,external_wp_i18n_namespaceObject._x)('Normal', 'font size name'),
+ size: 16,
+ slug: 'normal'
+ }, {
+ name: (0,external_wp_i18n_namespaceObject._x)('Medium', 'font size name'),
+ size: 20,
+ slug: 'medium'
+ }, {
+ name: (0,external_wp_i18n_namespaceObject._x)('Large', 'font size name'),
+ size: 36,
+ slug: 'large'
+ }, {
+ name: (0,external_wp_i18n_namespaceObject._x)('Huge', 'font size name'),
+ size: 42,
+ slug: 'huge'
+ }],
+ // Image default size slug.
+ imageDefaultSize: 'large',
+ imageSizes: [{
+ slug: 'thumbnail',
+ name: (0,external_wp_i18n_namespaceObject.__)('Thumbnail')
+ }, {
+ slug: 'medium',
+ name: (0,external_wp_i18n_namespaceObject.__)('Medium')
+ }, {
+ slug: 'large',
+ name: (0,external_wp_i18n_namespaceObject.__)('Large')
+ }, {
+ slug: 'full',
+ name: (0,external_wp_i18n_namespaceObject.__)('Full Size')
+ }],
+ // Allow plugin to disable Image Editor if need be
+ imageEditing: true,
+ // This is current max width of the block inner area
+ // It's used to constraint image resizing and this value could be overridden later by themes
+ maxWidth: 580,
+ // Allowed block types for the editor, defaulting to true (all supported).
+ allowedBlockTypes: true,
+ // Maximum upload size in bytes allowed for the site.
+ maxUploadFileSize: 0,
+ // List of allowed mime types and file extensions.
+ allowedMimeTypes: null,
+ __experimentalCanUserUseUnfilteredHTML: false,
+ __experimentalBlockDirectory: false,
+ __mobileEnablePageTemplates: false,
+ __experimentalBlockPatterns: [],
+ __experimentalBlockPatternCategories: [],
+ __experimentalSpotlightEntityBlocks: [],
+ __experimentalGenerateAnchors: false,
+ __unstableGalleryWithImageBlocks: false,
+ // 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: (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: (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: (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: (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: (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: (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: (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: (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: (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: (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: (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: (0,external_wp_i18n_namespaceObject.__)('Midnight'),
+ gradient: 'linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)',
+ slug: 'midnight'
+ }]
+};
-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.
- */
+;// 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.
+ */
- Object(external_wp_element_["useEffect"])(() => {
- return () => {
- // componentDidUnmount
- if (cancelableCreateSuggestion.current) {
- cancelableCreateSuggestion.current.cancel();
- }
- };
- }, []);
- return {
- createPage,
- isCreatingPage,
- errorMessage
- };
+function insertAt(array, elements, index) {
+ return [...array.slice(0, index), ...(0,external_lodash_namespaceObject.castArray)(elements), ...array.slice(index)];
}
/**
- * Creates a wrapper around a promise which allows it to be programmatically
- * cancelled.
- * See: https://reactjs.org/blog/2015/12/16/ismounted-antipattern.html
+ * Moves an element in an array.
*
- * @param {Promise} promise the Promise to make cancelable
+ * @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.
*/
-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
-
+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
*/
-
-
-
-
/**
- * Default properties associated with a link control value.
+ * 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.
*
- * @typedef WPLinkControlDefaultValue
+ * @param {Array} blocks Blocks to map.
+ * @param {?string} rootClientId Assumed root client ID.
*
- * @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.
+ * @return {Object} Block order map object.
*/
-/* eslint-disable jsdoc/valid-types */
-
+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;
+}
/**
- * Custom settings values associated with a link.
+ * 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.
*
- * @typedef {{[setting:string]:any}} WPLinkControlSettingsValue
+ * @param {Array} blocks Blocks to map.
+ * @param {?string} rootClientId Assumed root client ID.
+ *
+ * @return {Object} Block order map object.
*/
-/* eslint-enable */
+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)), {});
+}
/**
- * Custom settings values associated with a link.
+ * 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.
*
- * @typedef WPLinkControlSetting
+ * @param {Array} blocks Blocks to flatten.
+ * @param {Function} transform Transforming function to be applied to each block.
*
- * @property {string} id Identifier to use as property for setting value.
- * @property {string} title Human-readable label to show in user interface.
+ * @return {Object} Flattened object.
*/
-/**
- * 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 */
+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;
+}
/**
- * Properties associated with a search suggestion used within the LinkControl.
+ * 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.
*
- * @typedef WPLinkControlSuggestion
+ * @param {Array} blocks Blocks to flatten.
*
- * @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.
+ * @return {Object} Flattened block attributes object.
*/
-/** @typedef {(title:string)=>WPLinkControlSuggestion} WPLinkControlCreateSuggestionProp */
+function getFlattenedBlocksWithoutAttributes(blocks) {
+ return flattenBlocks(blocks, block => (0,external_lodash_namespaceObject.omit)(block, 'attributes'));
+}
/**
- * @typedef WPLinkControlProps
+ * 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.
*
- * @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.
+ * @param {Array} blocks Blocks to flatten.
+ *
+ * @return {Object} Flattened block attributes object.
*/
+
+function getFlattenedBlockAttributes(blocks) {
+ return flattenBlocks(blocks, block => block.attributes);
+}
/**
- * 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.
+ * Returns an object against which it is safe to perform mutating operations,
+ * given the original object and its current working copy.
*
- * @param {WPLinkControlProps} props Component props.
+ * @param {Object} original Original object.
+ * @param {Object} working Working object.
+ *
+ * @return {Object} Mutation-safe object.
*/
-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;
+function getMutateSafeObject(original, working) {
+ if (original === working) {
+ return { ...original
+ };
}
- 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.
+ 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.
+ */
- 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.
+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.
+ */
- 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
- */
+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];
- 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.
- */
+ 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.
- 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);
+ for (const block of flattenedBlocks) {
+ result[block.clientId] = {};
}
- const {
- createPage,
- isCreatingPage,
- errorMessage
- } = useCreatePage(createSuggestion);
-
- const handleSelectSuggestion = updatedValue => {
- onChange({ ...updatedValue,
- title: internalTextValue || (updatedValue === null || updatedValue === void 0 ? void 0 : updatedValue.title)
+ 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])
});
- 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.
+ return result;
+}
- 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.
+function updateParentInnerBlocksInTree(state, tree, updatedClientIds) {
+ let updateChildrenOfUpdatedClientIds = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
+ const uncontrolledParents = new Set([]);
+ const controlledParents = new Set();
- })))), 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());
-}
+ for (const clientId of updatedClientIds) {
+ let current = updateChildrenOfUpdatedClientIds ? clientId : state.parents[clientId];
-LinkControl.ViewerFill = ViewerFill;
-/* harmony default export */ var link_control = (LinkControl);
+ 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.
-// 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");
+ for (const clientId of uncontrolledParents) {
+ tree[clientId] = { ...tree[clientId]
+ };
+ }
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/media.js
-var library_media = __webpack_require__("rH4q");
+ 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 ).
-// 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
- */
+ for (const clientId of controlledParents) {
+ tree['controlled||' + clientId] = {
+ innerBlocks: (state.order[clientId] || []).map(subClientId => tree[subClientId])
+ };
+ }
+ return tree;
+}
/**
- * 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.
+ * 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.
*
- * @return {WPComponent} The component to be rendered.
+ * @param {Function} reducer Original reducer function.
+ *
+ * @return {Function} Enhanced reducer function.
*/
-const MediaUpload = () => null;
-/**
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-upload/README.md
- */
+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);
-/* harmony default export */ var media_upload = (Object(external_wp_components_["withFilters"])('editor.MediaUpload')(MediaUpload));
+ if (newState === state) {
+ return state;
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/media-upload/check.js
-/**
- * WordPress dependencies
- */
+ newState.tree = state.tree ? state.tree : {};
-/**
- * Internal dependencies
- */
+ 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;
-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
- */
+ 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;
+ }
-/* harmony default export */ var media_upload_check = (MediaUploadCheck);
+ 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.
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/media-replace-flow/index.js
+ 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]);
+ }
+ }
-/**
- * External dependencies
- */
+ newState.tree = updateParentInnerBlocksInTree(newState, newState.tree, parentsOfRemovedBlocks, true);
+ break;
+ }
-/**
- * WordPress dependencies
- */
+ 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;
+};
/**
- * Internal dependencies
+ * 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;
+ }
-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();
+ return { ...nextState,
+ isPersistentChange: nextIsPersistentChange
+ };
}
- };
- 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();
- }
- })));
- }
- });
-};
+ 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.
-/* 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
+ lastAction = action;
+ markNextChangeAsNotPersistent = action.type === 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT';
+ return nextState;
};
-}), 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
+ * 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);
-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
- });
- }
+ if (nextState !== state) {
+ nextState.isIgnoredChange = IGNORED_ACTION_TYPES.has(action.type);
+ }
- 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)));
+ return nextState;
+ };
}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-popover/link-viewer.js
-
-
-
/**
- * External dependencies
- */
-
-/**
- * WordPress dependencies
+ * 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;
+ }
-/**
- * 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
- }));
-}
+ if (result === clientIds) {
+ result = [...result];
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-popover/link-editor.js
+ 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;
-/**
- * External dependencies
- */
+ case 'REPLACE_BLOCKS':
+ action = { ...action,
+ type: 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN',
+ replacedClientIds: getAllChildren(action.clientIds)
+ };
+ break;
+ }
+ }
+ return reducer(state, action);
+};
/**
- * WordPress dependencies
+ * 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);
+};
/**
- * Internal dependencies
+ * 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.
*/
-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
-
+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.
-/**
- * WordPress dependencies
- */
+ 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.
-/**
- * Internal dependencies
- */
+ let stateAfterBlocksRemoval = state;
+ if (state.order[action.rootClientId]) {
+ stateAfterBlocksRemoval = reducer(stateAfterBlocksRemoval, {
+ type: 'REMOVE_BLOCKS',
+ keepControlledInnerBlocks: nestedControllers,
+ clientIds: state.order[action.rootClientId]
+ });
+ }
+ let stateAfterInsert = stateAfterBlocksRemoval;
-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;
+ 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..
- const toggleSettingsVisibility = () => {
- setIsSettingsExpanded(!isSettingsExpanded);
- };
+ stateAfterInsert.order = { ...stateAfterInsert.order,
+ ...(0,external_lodash_namespaceObject.reduce)(nestedControllers, (result, value, key) => {
+ if (state.order[key]) {
+ result[key] = state.order[key];
+ }
- 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));
-}
+ return result;
+ }, {})
+ };
+ }
-URLPopover.LinkEditor = LinkEditor;
-URLPopover.LinkViewer = LinkViewer;
+ return stateAfterInsert;
+};
/**
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-popover/README.md
+ * 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.
*/
-/* harmony default export */ var url_popover = (URLPopover);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/media-placeholder/index.js
+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);
+};
/**
- * External dependencies
+ * 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);
+};
/**
- * WordPress dependencies
+ * 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');
-/**
- * Internal dependencies
- */
+ 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;
+ },
-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"
- })));
-};
+ attributes() {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ let action = arguments.length > 1 ? arguments[1] : undefined;
-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;
+ switch (action.type) {
+ case 'RECEIVE_BLOCKS':
+ case 'INSERT_BLOCKS':
+ return { ...state,
+ ...getFlattenedBlockAttributes(action.blocks)
+ };
- 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]);
+ 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;
+ }
- const onlyAllowsImages = () => {
- if (!allowedTypes || allowedTypes.length === 0) {
- return false;
- }
+ return { ...state,
+ [action.clientId]: { ...state[action.clientId],
+ ...action.updates.attributes
+ }
+ };
- return allowedTypes.every(allowedType => allowedType === 'image' || allowedType.startsWith('image/'));
- };
+ 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 onChangeSrc = event => {
- setSrc(event.target.value);
- };
+ 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;
+ }
- const openURLInput = () => {
- setIsURLInputVisible(true);
- };
+ return result;
+ }, state[id])
+ }), {});
- const closeURLInput = () => {
- setIsURLInputVisible(false);
- };
+ if (action.clientIds.every(id => next[id] === state[id])) {
+ return state;
+ }
- const onSubmitSrc = event => {
- event.preventDefault();
+ return { ...state,
+ ...next
+ };
+ }
- if (src && onSelectURL) {
- onSelectURL(src);
- closeURLInput();
- }
- };
+ case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN':
+ if (!action.blocks) {
+ return state;
+ }
- const onFilesUpload = files => {
- if (!handleUpload) {
- return onSelect(files);
- }
+ return { ...(0,external_lodash_namespaceObject.omit)(state, action.replacedClientIds),
+ ...getFlattenedBlockAttributes(action.blocks)
+ };
- onFilesPreUpload(files);
- let setMedia;
+ case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN':
+ return (0,external_lodash_namespaceObject.omit)(state, action.removedClientIds);
+ }
- 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 = [];
+ return state;
+ },
- 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.
+ 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[''])
+ };
+ }
- return !lastMediaPassed.some(_ref4 => {
- let {
- urlSlug
- } = _ref4;
- return item.url.includes(urlSlug);
- });
- }); // Return the filtered media array along with newMedia.
+ 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)
+ };
+ }
- onSelect(filteredMedia.concat(newMedia)); // Reset lastMediaPassed and set it with ids and urls from newMedia.
+ case 'MOVE_BLOCKS_TO_POSITION':
+ {
+ const {
+ fromRootClientId = '',
+ toRootClientId = '',
+ clientIds
+ } = action;
+ const {
+ index = state[toRootClientId].length
+ } = action; // Moving inside the same parent block
- 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
+ if (fromRootClientId === toRootClientId) {
+ const subState = state[toRootClientId];
+ const fromIndex = subState.indexOf(clientIds[0]);
+ return { ...state,
+ [toRootClientId]: moveTo(state[toRootClientId], fromIndex, index, clientIds.length)
};
- });
- };
- } else {
- setMedia = onSelect;
- }
- } else {
- setMedia = _ref5 => {
- let [media] = _ref5;
- return onSelect(media);
- };
- }
+ } // Moving from a parent block to another
- mediaUpload({
- allowedTypes,
- filesList: files,
- onFileChange: setMedia,
- onError
- });
- };
- const onUpload = event => {
- onFilesUpload(event.target.files);
- };
+ return { ...state,
+ [fromRootClientId]: (0,external_lodash_namespaceObject.without)(state[fromRootClientId], ...clientIds),
+ [toRootClientId]: insertAt(state[toRootClientId], clientIds, index)
+ };
+ }
- const defaultRenderPlaceholder = content => {
- let {
- instructions,
- title
- } = labels;
+ case 'MOVE_BLOCKS_UP':
+ {
+ const {
+ clientIds,
+ rootClientId = ''
+ } = action;
+ const firstClientId = (0,external_lodash_namespaceObject.first)(clientIds);
+ const subState = state[rootClientId];
- if (!mediaUpload && !onSelectURL) {
- instructions = Object(external_wp_i18n_["__"])('To edit this block, you need permission to upload media.');
- }
+ if (!subState.length || firstClientId === (0,external_lodash_namespaceObject.first)(subState)) {
+ return state;
+ }
- 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;
+ const firstIndex = subState.indexOf(firstClientId);
+ return { ...state,
+ [rootClientId]: moveTo(subState, firstIndex, firstIndex - 1, clientIds.length)
+ };
+ }
- if (instructions === undefined && mediaUpload) {
- instructions = Object(external_wp_i18n_["__"])('Upload a media file or pick one from your media library.');
+ 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 (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 (!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)
+ };
}
- }
- if (title === undefined) {
- title = Object(external_wp_i18n_["__"])('Media');
+ case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN':
+ {
+ const {
+ clientIds
+ } = action;
- 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');
- }
- }
- }
+ if (!action.blocks) {
+ return state;
+ }
- 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 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['']];
+ }
- const renderPlaceholder = placeholder !== null && placeholder !== void 0 ? placeholder : defaultRenderPlaceholder;
+ if (clientIds.indexOf(clientId) === -1) {
+ result.push(clientId);
+ }
- const renderDropZone = () => {
- if (disableDropZone) {
- return null;
- }
+ return result;
+ }, []))])(state);
+ }
- return Object(external_wp_element_["createElement"])(external_wp_components_["DropZone"], {
- onFilesDrop: onFilesUpload,
- onHTMLDrop: onHTMLDrop
- });
- };
+ 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);
+ }
- 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'));
- };
+ return state;
+ },
- 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
- }));
- };
+ // 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;
- 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'));
- };
+ switch (action.type) {
+ case 'RECEIVE_BLOCKS':
+ return { ...state,
+ ...mapBlockParents(action.blocks)
+ };
- 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
- });
+ case 'INSERT_BLOCKS':
+ return { ...state,
+ ...mapBlockParents(action.blocks, action.rootClientId || '')
+ };
- 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);
+ case 'MOVE_BLOCKS_TO_POSITION':
+ {
+ return { ...state,
+ ...action.clientIds.reduce((accumulator, id) => {
+ accumulator[id] = action.toRootClientId || '';
+ return accumulator;
+ }, {})
+ };
}
- }));
- }
- 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);
+ 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 renderPlaceholder(uploadMediaLibraryButton);
- };
+ return state;
+ },
- if (dropZoneUIOnly || disableMediaButtons) {
- if (dropZoneUIOnly) {
- external_wp_deprecated_default()('wp.blockEditor.MediaPlaceholder dropZoneUIOnly prop', {
- since: '5.4',
- alternative: 'disableMediaButtons'
- });
+ 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 Object(external_wp_element_["createElement"])(media_upload_check, null, renderDropZone());
+ return state;
}
- 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
+ * Reducer returning typing state.
+ *
+ * @param {boolean} state Current state.
+ * @param {Object} action Dispatched action.
+ *
+ * @return {boolean} Updated state.
*/
-/* 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
+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;
+}
/**
- * Internal dependencies
+ * 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;
-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
+ switch (action.type) {
+ case 'START_DRAGGING_BLOCKS':
+ return action.clientIds;
+ case 'STOP_DRAGGING_BLOCKS':
+ return [];
+ }
+ return state;
+}
/**
- * External dependencies
+ * 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;
+}
/**
- * WordPress dependencies
+ * 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;
+ }
-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;
- }
+ case 'SELECT_BLOCK':
+ if (action.clientId === state.clientId) {
+ return state;
+ }
- 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
- }));
- }));
-};
+ return {
+ clientId: action.clientId
+ };
-/* harmony default export */ var format_toolbar = (FormatToolbar);
+ case 'REPLACE_INNER_BLOCKS':
+ case 'INSERT_BLOCKS':
+ {
+ if (!action.updateSelection || !action.blocks.length) {
+ return state;
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/format-toolbar-container.js
+ return {
+ clientId: action.blocks[0].clientId
+ };
+ }
+ case 'REMOVE_BLOCKS':
+ if (!action.clientIds || !action.clientIds.length || action.clientIds.indexOf(state.clientId) === -1) {
+ return state;
+ }
-/**
- * WordPress dependencies
- */
+ return {};
-/**
- * Internal dependencies
- */
+ 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;
+ }
-const FormatToolbarContainer = _ref => {
- let {
- inline,
- anchorRef
- } = _ref;
+ return {
+ clientId: blockToSelect.clientId
+ };
+ }
+ }
- 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 state;
+}
+/**
+ * Reducer returning the selection state.
+ *
+ * @param {boolean} state Current state.
+ * @param {Object} action Dispatched action.
+ *
+ * @return {boolean} Updated state.
+ */
- return Object(external_wp_element_["createElement"])(block_controls["b" /* default */], {
- group: "inline"
- }, Object(external_wp_element_["createElement"])(format_toolbar, null));
-};
+function selection() {
+ var _state$selectionStart, _state$selectionEnd;
-/* harmony default export */ var format_toolbar_container = (FormatToolbarContainer);
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ let action = arguments.length > 1 ? arguments[1] : undefined;
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-undo-automatic-change.js
-/**
- * WordPress dependencies
- */
+ 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
+ }
+ };
-/**
- * Internal dependencies
- */
+ 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.
-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 (!action.blocks.some(block => block.clientId === startClientId)) {
+ return {
+ selectionStart: {},
+ selectionEnd: {}
+ };
+ } // If the end of the selection won't exist after reset, collapse selection.
- if (keyCode !== external_wp_keycodes_["DELETE"] && keyCode !== external_wp_keycodes_["BACKSPACE"] && keyCode !== external_wp_keycodes_["ESCAPE"]) {
- return;
- }
- if (!didAutomaticChange()) {
- return;
+ if (!action.blocks.some(block => block.clientId === endClientId)) {
+ return { ...state,
+ selectionEnd: state.selectionStart
+ };
}
- event.preventDefault();
-
- getSettings().__experimentalUndo();
- }
+ }
- element.addEventListener('keydown', onKeyDown);
- return () => {
- element.removeEventListener('keydown', onKeyDown);
- };
- }, []);
+ return {
+ selectionStart: selectionHelper(state.selectionStart, action),
+ selectionEnd: selectionHelper(state.selectionEnd, action)
+ };
}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-caret-in-format.js
/**
- * WordPress dependencies
+ * 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;
-/**
- * Internal dependencies
- */
+ switch (action.type) {
+ case 'START_MULTI_SELECT':
+ return true;
+ case 'STOP_MULTI_SELECT':
+ return false;
+ }
-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]);
+ return state;
}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-mark-persistent.js
/**
- * WordPress dependencies
+ * 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;
+}
/**
- * Internal dependencies
+ * 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;
-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);
- };
- }
+ 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;
+ }
- __unstableMarkLastChangeAsPersistent();
- }, [html, hasActiveFormats]);
+ return state;
}
+function blocksMode() {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ let action = arguments.length > 1 ? arguments[1] : undefined;
-// EXTERNAL MODULE: external ["wp","blob"]
-var external_wp_blob_ = __webpack_require__("xTGt");
+ if (action.type === 'TOGGLE_BLOCK_MODE') {
+ const {
+ clientId
+ } = action;
+ return { ...state,
+ [clientId]: state[clientId] && state[clientId] === 'html' ? 'visual' : 'html'
+ };
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/file-paste-handler.js
+ return state;
+}
/**
- * WordPress dependencies
+ * 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 filePasteHandler(files) {
- return files.filter(_ref => {
- let {
- type
- } = _ref;
- return /^image\/(?:jpe?g|png|gif)$/.test(type);
- }).map(file => `<img src="${Object(external_wp_blob_["createBlobURL"])(file)}">`).join('');
-}
+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;
+ }
-// EXTERNAL MODULE: external ["wp","shortcode"]
-var external_wp_shortcode_ = __webpack_require__("SVSp");
+ 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.
+ */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/utils.js
+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;
+}
/**
- * WordPress dependencies
+ * 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;
-
-
-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] || [])];
- }
+ switch (action.type) {
+ case 'UPDATE_SETTINGS':
+ return { ...state,
+ ...action.settings
+ };
}
+
+ return state;
}
/**
- * Get the multiline tag based on the multiline prop.
+ * Reducer returning the user preferences.
*
- * @param {?(string|boolean)} multiline The multiline prop.
+ * @param {Object} state Current state.
+ * @param {Object} action Dispatched action.
*
- * @return {?string} The multiline tag.
+ * @return {string} Updated state.
*/
-function getMultilineTag(multiline) {
- if (multiline !== true && multiline !== 'p' && multiline !== 'li') {
- return;
- }
+function preferences() {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : PREFERENCES_DEFAULTS;
+ let action = arguments.length > 1 ? arguments[1] : undefined;
- return multiline === true ? 'p' : multiline;
-}
-function getAllowedFormats(_ref) {
- let {
- allowedFormats,
- formattingControls,
- disableFormats
- } = _ref;
+ 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`).
- if (disableFormats) {
- return getAllowedFormats.EMPTY_ARRAY;
- }
+ let id = match !== null && match !== void 0 && match.name ? `${blockName}/${match.name}` : blockName;
+ const insert = {
+ name: id
+ };
- if (!allowedFormats && !formattingControls) {
- return;
- }
+ if (blockName === 'core/block') {
+ insert.ref = attributes.ref;
+ id += '/' + attributes.ref;
+ }
- if (allowedFormats) {
- return allowedFormats;
+ return { ...prevState,
+ insertUsage: { ...prevState.insertUsage,
+ [id]: {
+ time: action.time,
+ count: prevState.insertUsage[id] ? prevState.insertUsage[id].count + 1 : 1,
+ insert
+ }
+ }
+ };
+ }, state);
}
- external_wp_deprecated_default()('wp.blockEditor.RichText formattingControls prop', {
- since: '5.4',
- alternative: 'allowedFormats'
- });
- return formattingControls.map(name => `core/${name}`);
+ return state;
}
-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`.
+ * Reducer returning an object where each key is a block client ID, its value
+ * representing the settings for its nested blocks.
*
- * @param {string} url The URL that could not be embedded.
- * @param {Function} onReplace Function to call with the created fallback block.
+ * @param {Object} state Current state.
+ * @param {Object} action Dispatched action.
+ *
+ * @return {Object} Updated state.
*/
-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
- */
+const blockListSettings = function () {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ let action = arguments.length > 1 ? arguments[1] : undefined;
-/*
- * 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.
- */
+ 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);
+ }
-function splitValue(_ref) {
- let {
- value,
- pastedBlocks = [],
- onReplace,
- onSplit,
- onSplitMiddle,
- multilineTag
- } = _ref;
+ case 'UPDATE_BLOCK_LIST_SETTINGS':
+ {
+ const {
+ clientId
+ } = action;
- if (!onReplace || !onSplit) {
- return;
- }
+ if (!action.settings) {
+ if (state.hasOwnProperty(clientId)) {
+ return (0,external_lodash_namespaceObject.omit)(state, clientId);
+ }
- 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.
+ return state;
+ }
- 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 ((0,external_lodash_namespaceObject.isEqual)(state[clientId], action.settings)) {
+ return state;
+ }
- if (!hasPastedBlocks || !Object(external_wp_richText_["isEmpty"])(before)) {
- blocks.push(onSplit(Object(external_wp_richText_["toHTMLString"])({
- value: before,
- multilineTag
- }), !isAfterOriginal));
- lastPastedBlockIndex += 1;
+ return { ...state,
+ [clientId]: action.settings
+ };
+ }
}
- 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.
-
+ 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.
+ */
- 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.
+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;
+ }
- 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.
+ if (action.type === 'SET_NAVIGATION_MODE') {
+ return action.isNavigationMode;
+ }
- const initialPosition = hasPastedBlocks ? -1 : 0;
- onReplace(blocks, indexToSelect, initialPosition);
+ return state;
}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-paste-handler.js
/**
- * WordPress dependencies
+ * 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;
+}
/**
- * Internal dependencies
+ * 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<string,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
+ }), {});
+ }
-/** @typedef {import('@wordpress/rich-text').RichTextValue} RichTextValue */
-
+ return null;
+}
/**
- * Replaces line separators with line breaks if not multiline.
- * Replaces line breaks with line separators if multiline.
+ * Reducer returning automatic change state.
*
- * @param {RichTextValue} value Value to adjust.
- * @param {boolean} isMultiline Whether to adjust to multiline or not.
+ * @param {boolean} state Current state.
+ * @param {Object} action Dispatched action.
*
- * @return {RichTextValue} Adjusted value.
+ * @return {string} Updated state.
*/
-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;
+function automaticChangeStatus(state, action) {
+ switch (action.type) {
+ case 'MARK_AUTOMATIC_CHANGE':
+ return 'pending';
- if (!isSelected) {
- event.preventDefault();
- return;
+ case 'MARK_AUTOMATIC_CHANGE_FINAL':
+ if (state === 'pending') {
+ return 'final';
}
- 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.
+ return;
- 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.
+ 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.
- html = removeWindowsFragments(html); // Strip meta tag.
+ case 'START_TYPING':
+ case 'STOP_TYPING':
+ return state;
+ } // Reset the state by default (for any action not handled).
- html = removeCharsetMetaTag(html);
- event.preventDefault(); // Allows us to ask for this information when we get a report.
+}
+/**
+ * Reducer returning current highlighted block.
+ *
+ * @param {boolean} state Current highlighted block.
+ * @param {Object} action Dispatched action.
+ *
+ * @return {string} Updated state.
+ */
- window.console.log('Received HTML:\n\n', html);
- window.console.log('Received plain text:\n\n', plainText);
+function highlightedBlock(state, action) {
+ switch (action.type) {
+ case 'TOGGLE_BLOCK_HIGHLIGHT':
+ const {
+ clientId,
+ isHighlighted
+ } = action;
- if (disableFormats) {
- onChange(Object(external_wp_richText_["insert"])(value, plainText));
- return;
+ if (isHighlighted) {
+ return clientId;
+ } else if (state === clientId) {
+ return null;
}
- 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);
+ return state;
- if (transformed !== value) {
- onChange(transformed);
- return;
+ case 'SELECT_BLOCK':
+ if (action.clientId !== state) {
+ return null;
}
- 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.
+ 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;
- 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
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ let action = arguments.length > 1 ? arguments[1] : undefined;
- window.console.log('Received items:\n\n', files);
+ switch (action.type) {
+ case 'INSERT_BLOCKS':
+ if (!action.blocks.length) {
+ return state;
+ }
- if (onReplace && Object(external_wp_richText_["isEmpty"])(value)) {
- onReplace(content);
- } else {
- splitValue({
- value,
- pastedBlocks: content,
- onReplace,
- onSplit,
- onSplitMiddle,
- multilineTag
- });
- }
+ 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
+ };
- return;
- }
+ case 'RESET_BLOCKS':
+ 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.
+ 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
+}));
- if (mode === 'AUTO' && Object(external_wp_richText_["isEmpty"])(value) && isShortcode(plainText)) {
- mode = 'BLOCKS';
- }
+;// CONCATENATED MODULE: ./node_modules/rememo/es/rememo.js
- 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
- });
+var LEAF_KEY, hasWeakMap;
- 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.
+/**
+ * Arbitrary value used as key for referencing cache object in WeakMap tree.
+ *
+ * @type {Object}
+ */
+LEAF_KEY = {};
- 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
- });
- }
- }
- }
+/**
+ * Whether environment supports WeakMap.
+ *
+ * @type {boolean}
+ */
+hasWeakMap = typeof WeakMap !== 'undefined';
- 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.
+ * Returns the first argument as the sole entry in an array.
*
- * @param {string} html the html to be normalized
- * @return {string} the normalized html
+ * @param {*} value Value to return.
+ *
+ * @return {Array} Value returned as entry in array.
*/
+function arrayOf( value ) {
+ return [ value ];
+}
-function removeWindowsFragments(html) {
- const startReg = /.*<!--StartFragment-->/s;
- const endReg = /<!--EndFragment-->.*/s;
- return html.replace(startReg, '').replace(endReg, '');
+/**
+ * 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;
}
+
/**
- * 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
+ * Creates and returns a new cache object.
*
- * @param {string} html the html to be stripped of the meta tag.
- * @return {string} the cleaned html
+ * @return {Object} Cache object.
*/
+function createCache() {
+ var cache = {
+ clear: function() {
+ cache.head = null;
+ },
+ };
+ return cache;
+}
-function removeCharsetMetaTag(html) {
- const metaTag = `<meta charset='utf-8'>`;
+/**
+ * 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 (html.startsWith(metaTag)) {
- return html.slice(metaTag.length);
- }
+ if ( a.length !== b.length ) {
+ return false;
+ }
- return html;
+ for ( i = fromIndex; i < a.length; i++ ) {
+ if ( a[ i ] !== b[ i ] ) {
+ return false;
+ }
+ }
+
+ return true;
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-input-rules.js
/**
- * WordPress dependencies
+ * 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 ];
-/**
- * Internal dependencies
- */
+ // 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;
+ }
+ }
-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;
+ // 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 );
+ }
- if (!onReplace) {
- return;
- }
+ return caches.get( LEAF_KEY );
+ }
- const {
- start,
- text
- } = value;
- const characterBefore = text.slice(start - 1, start); // The character right before the caret must be a plain space.
+ // Assign cache handler by availability of WeakMap
+ getCache = hasWeakMap ? getWeakMapCache : getRootCache;
- if (characterBefore !== ' ') {
- return;
- }
+ /**
+ * Resets root memoization cache.
+ */
+ function clear() {
+ rootCache = hasWeakMap ? new WeakMap() : createCache();
+ }
- 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;
- });
+ // 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;
- if (!transformation) {
- return;
- }
+ // Create copy of arguments (avoid leaking deoptimization).
+ args = new Array( len );
+ for ( i = 0; i < len; i++ ) {
+ args[ i ] = arguments[ i ];
+ }
- const content = Object(external_wp_richText_["toHTMLString"])({
- value: Object(external_wp_richText_["slice"])(value, start, text.length)
- });
- const block = transformation.transform(content);
- onReplace([block]);
+ dependants = getDependants.apply( null, args );
+ cache = getCache( dependants );
- __unstableMarkAutomaticChange();
- }
+ // 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();
+ }
- function onInput(event) {
- const {
- inputType,
- type
- } = event;
- const {
- value,
- onChange,
- __unstableAllowPrefixTransformations,
- formatTypes
- } = propsRef.current; // Only run input rules when inserting text.
+ cache.lastDependants = dependants;
+ }
- if (inputType !== 'insertText' && type !== 'compositionend') {
- return;
- }
+ node = cache.head;
+ while ( node ) {
+ // Check whether node arguments match arguments
+ if ( ! isShallowEqual( node.args, args, 1 ) ) {
+ node = node.next;
+ continue;
+ }
- if (__unstableAllowPrefixTransformations && inputRule) {
- inputRule();
- }
+ // At this point we can assume we've found a match
- const transformed = formatTypes.reduce((accumlator, _ref3) => {
- let {
- __unstableInputRule
- } = _ref3;
+ // 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;
+ }
- if (__unstableInputRule) {
- accumlator = __unstableInputRule(accumlator);
- }
+ node.next = cache.head;
+ node.prev = null;
+ cache.head.prev = node;
+ cache.head = node;
+ }
- return accumlator;
- }, value);
+ // Return immediately
+ return node.val;
+ }
- if (transformed !== value) {
- __unstableMarkLastChangeAsPersistent();
+ // No cached value found. Continue to insertion phase:
- onChange({ ...transformed,
- activeFormats: value.activeFormats
- });
+ node = {
+ // Generate the result from original function
+ val: selector.apply( null, args ),
+ };
- __unstableMarkAutomaticChange();
- }
- }
+ // Avoid including the source object in the cache.
+ args[ 0 ] = null;
+ node.args = args;
- element.addEventListener('input', onInput);
- element.addEventListener('compositionend', onInput);
- return () => {
- element.removeEventListener('input', onInput);
- element.removeEventListener('compositionend', onInput);
- };
- }, []);
+ // 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: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-enter.js
+;// 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
/**
- * WordPress dependencies
+ * External dependencies
*/
+/**
+ * WordPress dependencies
+ */
+
/**
- * Internal 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 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;
- }
+function getBlockName(state, clientId) {
+ const block = state.blocks.byClientId[clientId];
+ const socialLinkName = 'core/social-link';
- event.preventDefault();
- const _value = { ...value
- };
- _value.formats = removeEditorOnlyFormats(value);
- const canSplit = onReplace && onSplit;
+ 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;
+ }
- 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);
- });
+ 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.
+ */
- if (transformation) {
- onReplace([transformation.transform({
- content: _value.text
- })]);
+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.
+ */
- __unstableMarkAutomaticChange();
- }
- }
+function getBlockAttributes(state, clientId) {
+ const block = state.blocks.byClientId[clientId];
- 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 (!block) {
+ return null;
+ }
- 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
- });
- }
- }
- }
+ 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.
+ */
- element.addEventListener('keydown', onKeyDown);
- return () => {
- element.removeEventListener('keydown', onKeyDown);
- };
- }, []);
-}
+function getBlock(state, clientId) {
+ const block = state.blocks.byClientId[clientId];
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-format-types.js
-/**
- * WordPress dependencies
- */
+ 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]]);
/**
- * Internal dependencies
+ * 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;
-
-function formatTypesSelector(select) {
- return select(external_wp_richText_["store"]).getFormatTypes();
+ 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;
}
/**
- * Set of all interactive content tags.
+ * Returns a stripped down block object containing only its client ID,
+ * and its inner blocks' client IDs.
*
- * @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content
+ * @param {Object} state Editor state.
+ * @param {string} clientId Client ID of the block to get.
+ *
+ * @return {Object} Client IDs of the post blocks.
*/
-
-const interactiveContentTags = new Set(['a', 'audio', 'button', 'details', 'embed', 'iframe', 'input', 'label', 'select', 'textarea', 'video']);
+const __unstableGetClientIdWithClientIdsTree = rememo((state, clientId) => ({
+ clientId,
+ innerBlocks: __unstableGetClientIdsTree(state, clientId)
+}), state => [state.blocks.order]);
/**
- * This hook provides RichText with the `formatTypes` and its derived props from
- * experimental format type settings.
+ * 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} $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
+ * @param {Object} state Editor state.
+ * @param {?string} rootClientId Optional root client ID of block list.
+ *
+ * @return {Object[]} Client IDs of the post blocks.
*/
-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
- });
- }
+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.
+ */
- 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 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 handler = type.__experimentalCreatePrepareEditableTree(selected, {
- richTextIdentifier: identifier,
- blockClientId: clientId
- });
+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.
+ */
- if (type.__experimentalCreateOnChangeEditableValue) {
- valueHandlers.push(handler);
- } else {
- prepareHandlers.push(handler);
- }
+const getGlobalBlockCount = rememo((state, blockName) => {
+ const clientIds = getClientIdsWithDescendants(state);
- for (const key in selected) {
- dependencies.push(selected[key]);
- }
- }
+ if (!blockName) {
+ return clientIds.length;
+ }
- if (type.__experimentalCreateOnChangeEditableValue) {
- let dispatchers = {};
+ 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.
+ */
- if (type.__experimentalGetPropsForEditableTreeChangeHandler) {
- dispatchers = type.__experimentalGetPropsForEditableTreeChangeHandler(dispatch, {
- richTextIdentifier: identifier,
- blockClientId: clientId
- });
- }
+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.
+ */
- changeHandlers.push(type.__experimentalCreateOnChangeEditableValue({ ...(keyedSelected[type.name] || {}),
- ...dispatchers
- }, {
- richTextIdentifier: identifier,
- blockClientId: clientId
- }));
- }
- });
- return {
- formatTypes,
- prepareHandlers,
- valueHandlers,
- changeHandlers,
- dependencies
- };
+function getBlockCount(state, rootClientId) {
+ return getBlockOrder(state, rootClientId).length;
}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-remove-browser-shortcuts.js
/**
- * WordPress dependencies
+ * 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;
+}
/**
- * Hook to prevent default behaviors for key combinations otherwise handled
- * internally by RichText.
+ * Returns the current selection end block client ID, attribute key and text
+ * offset.
*
- * @return {import('react').RefObject} The component to be rendered.
+ * @param {Object} state Block editor state.
+ *
+ * @return {WPBlockSelection} Selection end information.
*/
-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);
- };
- }, []);
+function getSelectionEnd(state) {
+ return state.selection.selectionEnd;
}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-shortcuts.js
/**
- * WordPress dependencies
+ * 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 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);
- };
- }, []);
+function getBlockSelectionStart(state) {
+ return state.selection.selectionStart.clientId;
}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-input-events.js
/**
- * WordPress dependencies
+ * 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 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);
- };
- }, []);
+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.
+ */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/format-edit.js
+function getSelectedBlockCount(state) {
+ const multiSelectedBlockCount = getMultiSelectedBlockClientIds(state).length;
+ if (multiSelectedBlockCount) {
+ return multiSelectedBlockCount;
+ }
+ return state.selection.selectionStart.clientId ? 1 : 0;
+}
/**
- * WordPress dependencies
+ * 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;
+}
/**
- * External dependencies
+ * 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;
-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;
- }
- }
+ if (!clientId || clientId !== selectionEnd.clientId) {
+ return null;
+ }
- 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
- });
- });
+ return clientId;
}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/index.js
-
-
-
/**
- * External dependencies
+ * 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;
+}
/**
- * WordPress dependencies
+ * 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;
+}
/**
- * Internal dependencies
+ * 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.
-const keyboardShortcutContext = Object(external_wp_element_["createContext"])();
-const inputEventContext = Object(external_wp_element_["createContext"])();
+ return orderSet[nextIndex];
+}
/**
- * Removes props used for the native version of RichText so that they are not
- * passed to the DOM element and log warnings.
+ * 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} props Props to filter.
+ * @param {Object} state Editor state.
+ * @param {?string} startClientId Optional client ID of block from which to
+ * search.
*
- * @return {Object} Filtered props.
+ * @return {?string} Adjacent block's client ID, or null if none exists.
*/
-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 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 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;
- }
+function getNextBlockClientId(state, startClientId) {
+ return getAdjacentBlockClientId(state, startClientId, 1);
+}
+/* eslint-disable jsdoc/valid-types */
- 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.
+/**
+ * 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,
- 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);
+ selectionEnd
+ } = state.selection;
- adjustedOnChange = newValue => originalOnChange(external_wp_blocks_["children"].fromDOM(Object(external_wp_richText_["__unstableCreateElement"])(document, newValue).childNodes));
+ if (selectionStart.clientId === undefined || selectionEnd.clientId === undefined) {
+ return EMPTY_ARRAY;
}
- 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
- });
+ 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.
- 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;
- }
+ const rootClientId = getBlockRootClientId(state, selectionStart.clientId);
- function addInvisibleFormats(value) {
- return prepareHandlers.reduce((accumulator, fn) => fn(accumulator, value.text), value.formats);
+ if (rootClientId === null) {
+ return EMPTY_ARRAY;
}
- 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;
+ const blockOrder = getBlockOrder(state, rootClientId);
+ const startIndex = blockOrder.indexOf(selectionStart.clientId);
+ const endIndex = blockOrder.indexOf(selectionEnd.clientId);
- if (event.defaultPrevented) {
- return;
- }
+ if (startIndex > endIndex) {
+ return blockOrder.slice(endIndex, startIndex + 1);
+ }
- 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.
+ 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.
+ */
- if (!Object(external_wp_richText_["isCollapsed"])(value) || hasActiveFormats || isReverse && start !== 0 || !isReverse && end !== text.length) {
- return;
- }
+function getMultiSelectedBlockClientIds(state) {
+ const {
+ selectionStart,
+ selectionEnd
+ } = state.selection;
- 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 (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.
+ */
- if (onRemove && Object(external_wp_richText_["isEmpty"])(value) && isReverse) {
- onRemove(!isReverse);
- }
+const getMultiSelectedBlocks = rememo(state => {
+ const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state);
- event.preventDefault();
- }
+ if (!multiSelectedBlockClientIds.length) {
+ return EMPTY_ARRAY;
}
- function onFocus() {
- anchorRef.current.focus();
- }
+ 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.
+ */
- 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
- })));
+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.
+ */
- if (!wrapperClassName) {
- return content;
- }
+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.
+ */
- 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);
+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.
+ */
-const ForwardedRichTextContainer = Object(external_wp_element_["forwardRef"])(RichTextWrapper);
+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.
+ */
-ForwardedRichTextContainer.Content = _ref3 => {
- let {
- value,
- tagName: Tag,
- multiline,
- ...props
- } = _ref3;
+const isAncestorMultiSelected = rememo((state, clientId) => {
+ let ancestorClientId = clientId;
+ let isMultiSelected = false;
- // Handle deprecated `children` and `node` sources.
- if (Array.isArray(value)) {
- value = external_wp_blocks_["children"].toHTML(value);
+ while (ancestorClientId && !isMultiSelected) {
+ ancestorClientId = getBlockRootClientId(state, ancestorClientId);
+ isMultiSelected = isBlockMultiSelected(state, ancestorClientId);
}
- const MultilineTag = getMultilineTag(multiline);
+ 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.
+ */
- if (!value && MultilineTag) {
- value = `<${MultilineTag}></${MultilineTag}>`;
+function getMultiSelectedBlocksStartClientId(state) {
+ const {
+ selectionStart,
+ selectionEnd
+ } = state.selection;
+
+ if (selectionStart.clientId === selectionEnd.clientId) {
+ return null;
}
- const content = Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, value);
+ 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.
+ */
- if (Tag) {
- return Object(external_wp_element_["createElement"])(Tag, Object(external_lodash_["omit"])(props, ['format']), content);
+function getMultiSelectedBlocksEndClientId(state) {
+ const {
+ selectionStart,
+ selectionEnd
+ } = state.selection;
+
+ if (selectionStart.clientId === selectionEnd.clientId) {
+ return null;
}
- return content;
-};
+ 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.
+ */
-ForwardedRichTextContainer.isEmpty = value => {
- return !value || value.length === 0;
-};
+function getBlockIndex(state, clientId) {
+ const rootClientId = getBlockRootClientId(state, clientId);
+ return getBlockOrder(state, rootClientId).indexOf(clientId);
+}
/**
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md
+ * 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;
-/* harmony default export */ var rich_text = (ForwardedRichTextContainer);
-
-
-
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/editable-text/index.js
-
-
+ if (selectionStart.clientId !== selectionEnd.clientId) {
+ return false;
+ }
+ return selectionStart.clientId === clientId;
+}
/**
- * WordPress dependencies
+ * 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));
+}
/**
- * Internal dependencies
+ * 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 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);
-};
+ const clientIds = getMultiSelectedBlockClientIds(state);
+ const index = clientIds.indexOf(clientId);
+ return index > -1 && index < clientIds.length - 1;
+}
/**
- * Renders an editable text input in which text formatting is not allowed.
+ * 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.
*/
-
-/* harmony default export */ var editable_text = (EditableText);
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/plain-text/index.js
-
-
-
+function hasMultiSelection(state) {
+ const {
+ selectionStart,
+ selectionEnd
+ } = state.selection;
+ return selectionStart.clientId !== selectionEnd.clientId;
+}
/**
- * External dependencies
+ * 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;
+}
/**
- * WordPress dependencies
+ * 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;
+}
/**
- * Internal dependencies
+ * 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';
+}
/**
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/plain-text/README.md
+ * Returns true if the user is typing, or false otherwise.
+ *
+ * @param {Object} state Global application state.
+ *
+ * @return {boolean} Whether user is typing.
*/
-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
-
-
+function selectors_isTyping(state) {
+ return state.isTyping;
+}
/**
- * WordPress dependencies
+ * 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 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));
+function isDraggingBlocks(state) {
+ return !!state.draggedBlocks.length;
}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/responsive-block-control/index.js
-
-
/**
- * External dependencies
+ * 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;
+}
/**
- * WordPress dependencies
+ * 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));
+}
/**
- * Internal dependencies
+ * 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 ResponsiveBlockControl(props) {
+function getBlockInsertionPoint(state) {
+ let rootClientId, index;
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;
+ insertionPoint,
+ selection: {
+ selectionEnd
+ }
+ } = state;
- if (!title || !property || !renderDefaultControl) {
- return null;
+ if (insertionPoint !== null) {
+ return insertionPoint;
}
- 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 {
+ clientId
+ } = selectionEnd;
- const defaultControl = renderDefaultControl(Object(external_wp_element_["createElement"])(ResponsiveBlockControlLabel, {
- property: property,
- viewport: defaultLabel
- }), defaultLabel);
+ if (clientId) {
+ rootClientId = getBlockRootClientId(state, clientId) || undefined;
+ index = getBlockIndex(state, selectionEnd.clientId, rootClientId) + 1;
+ } else {
+ index = getBlockOrder(state).length;
+ }
- 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 {
+ rootClientId,
+ index
};
-
- 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()))));
}
+/**
+ * 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.
+ */
-/* harmony default export */ var responsive_block_control = (ResponsiveBlockControl);
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/shortcut.js
+function isBlockInsertionPointVisible(state) {
+ return state.insertionPoint !== null;
+}
/**
- * WordPress dependencies
+ * 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;
+}
/**
- * Internal dependencies
+ * 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;
+ }
-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();
- }
- }
+ const blockListSettings = getBlockListSettings(state, rootClientId);
- keyboardShortcuts.current.add(callback);
- return () => {
- keyboardShortcuts.current.delete(callback);
- };
- }, [character, type]);
- return null;
+ if (!blockListSettings) {
+ return null;
+ }
+
+ return blockListSettings.templateLock;
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/toolbar-button.js
+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;
+};
/**
- * WordPress dependencies
+ * 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.
*/
-function RichTextToolbarButton(_ref) {
- let {
- name,
- shortcutType,
- shortcutCharacter,
- ...props
- } = _ref;
- let shortcut;
- let fillName = 'RichText.ToolbarControls';
+const canInsertBlockTypeUnmemoized = function (state, blockName) {
+ let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
+ let blockType;
- if (name) {
- fillName += `.${name}`;
+ if (blockName && 'object' === typeof blockName) {
+ blockType = blockName;
+ blockName = blockType.name;
+ } else {
+ blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName);
}
- if (shortcutType && shortcutCharacter) {
- shortcut = external_wp_keycodes_["displayShortcut"][shortcutType](shortcutCharacter);
+ if (!blockType) {
+ return false;
}
- 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
- })));
-}
+ const {
+ allowedBlockTypes
+ } = getSettings(state);
+ const isBlockAllowedInEditor = checkAllowList(allowedBlockTypes, blockName, true);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/input-event.js
-/**
- * WordPress dependencies
- */
+ if (!isBlockAllowedInEditor) {
+ return false;
+ }
-/**
- * Internal dependencies
- */
+ const isLocked = !!getTemplateLock(state, rootClientId);
+ if (isLocked) {
+ return false;
+ }
-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();
- }
- }
+ const parentBlockListSettings = getBlockListSettings(state, rootClientId); // The parent block doesn't have settings indicating it doesn't support
+ // inner blocks, return false.
- callbacks.current.add(callback);
- return () => {
- callbacks.current.delete(callback);
- };
- }, [inputType]);
- return null;
-}
+ 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.
+ */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/tool-selector/index.js
+ 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]);
/**
- * WordPress dependencies
+ * 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));
+}
/**
- * Internal dependencies
+ * 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.
-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"
-}));
+ if (attributes === null) {
+ return true;
+ }
-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 */]);
+ lock
+ } = attributes;
+ const parentIsLocked = !!getTemplateLock(state, rootClientId); // If we don't have a lock on the blockType level, we differ to the parent templateLock.
- const onSwitchMode = mode => {
- setNavigationMode(mode === 'edit' ? false : true);
- };
+ 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 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.')))
- });
+
+ 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);
-/* harmony default export */ var tool_selector = (Object(external_wp_element_["forwardRef"])(ToolSelector));
+ if (attributes === null) {
+ return;
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/unit-control/index.js
+ 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);
+}
/**
- * WordPress dependencies
+ * 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));
+}
/**
- * Internal dependencies
+ * 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;
-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));
+ 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.
+ */
-// 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");
+const canIncludeBlockTypeInInserter = (state, blockType, rootClientId) => {
+ if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'inserter', true)) {
+ return false;
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-input/button.js
+ 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)
+ };
+};
/**
- * WordPress dependencies
+ * 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.
-/**
- * Internal dependencies
- */
+ const duration = Date.now() - time;
+ switch (true) {
+ case duration < MILLISECONDS_PER_HOUR:
+ return count * 4;
+ case duration < MILLISECONDS_PER_DAY:
+ return count * 2;
-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
- };
- }
+ case duration < MILLISECONDS_PER_WEEK:
+ return count / 2;
- toggle() {
- this.setState({
- expanded: !this.state.expanded
- });
+ 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).
+ */
- submitLink(event) {
- event.preventDefault();
- this.toggle();
- }
- render() {
- const {
- url,
- onChange
- } = this.props;
+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 {
- 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"
- }))));
- }
+ 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
-}
+ };
+ };
+};
/**
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-input/README.md
+ * 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.
*/
-/* 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");
+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*
+ *
+ */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-popover/image-url-input-ui.js
+ const blockParserTokenizer = /^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\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.
+ */
-/**
- * External dependencies
- */
+ 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);
-/**
- * WordPress dependencies
- */
+ 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);
+ }
-/**
- * Internal dependencies
- */
+ 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 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 groupByType = (blocks, block) => {
+ const {
+ core,
+ noncore
+ } = blocks;
+ const type = block.name.startsWith('core/') ? core : noncore;
+ type.push(block);
+ return blocks;
+ };
-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 {
+ core: coreItems,
+ noncore: nonCoreItems
+ } = items.reduce(groupByType, {
+ core: [],
+ noncore: []
});
- 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('');
- }
+ 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.
+ */
- setIsEditingLink(true);
- });
- const stopEditLink = Object(external_wp_element_["useCallback"])(() => {
- setIsEditingLink(false);
+const getBlockTransformItems = rememo(function (state, blocks) {
+ let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
+ const buildBlockTypeTransformItem = buildBlockTypeItem(state, {
+ buildScope: 'transform'
});
- const closeLinkUI = Object(external_wp_element_["useCallback"])(() => {
- setUrlInput(null);
- stopEditLink();
- setIsOpen(false);
+ 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]);
+ }
- 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();
- }
+ 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.
+ */
- if (Object(external_lodash_["isEmpty"])(newRel)) {
- newRel = undefined;
- }
- }
- }
+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));
- return newRel;
- };
+ if (hasBlockType) {
+ return true;
+ }
- const getUpdatedLinkTargetSettings = value => {
- const newLinkTarget = value ? '_blank' : undefined;
- let updatedRel;
+ 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.
+ */
- if (!newLinkTarget && !rel) {
- updatedRel = undefined;
- } else {
- updatedRel = removeNewTabRel(rel);
- }
+const __experimentalGetAllowedBlocks = rememo(function (state) {
+ let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
- return {
- linkTarget: newLinkTarget,
- rel: updatedRel
- };
- };
+ if (!rootClientId) {
+ return;
+ }
- 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;
+ 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.
+ */
- if (autocompleteElement && autocompleteElement.contains(event.target)) {
- return;
- }
+const __experimentalGetDirectInsertBlock = rememo(function (state) {
+ var _state$blockListSetti, _state$blockListSetti2;
- setIsOpen(false);
- setUrlInput(null);
- stopEditLink();
- };
- });
- const onSubmitLinkChange = Object(external_wp_element_["useCallback"])(() => {
- return event => {
- if (urlInput) {
- var _getLinkDestinations$;
+ let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
- // 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
- });
- }
+ if (!rootClientId) {
+ return;
+ }
- stopEditLink();
- setUrlInput(null);
- event.preventDefault();
- };
- });
- const onLinkRemove = Object(external_wp_element_["useCallback"])(() => {
- onChangeUrl({
- linkDestination: LINK_DESTINATION_NONE,
- href: ''
- });
- });
+ 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;
- 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 (!defaultBlock || !directInsert) {
+ return;
+ }
- 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"
- }))
- });
- }
+ if (typeof directInsert === 'function') {
+ return directInsert(getBlock(state, rootClientId)) ? defaultBlock : null;
+ }
- return linkDestinations;
- };
+ return defaultBlock;
+}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.tree[rootClientId]]);
- const onSetHref = value => {
- const linkDestinations = getLinkDestinations();
- let linkDestinationInput;
+const checkAllowListRecursive = (blocks, allowedBlockTypes) => {
+ if ((0,external_lodash_namespaceObject.isBoolean)(allowedBlockTypes)) {
+ return allowedBlockTypes;
+ }
- if (!value) {
- linkDestinationInput = LINK_DESTINATION_NONE;
- } else {
- linkDestinationInput = (Object(external_lodash_["find"])(linkDestinations, destination => {
- return destination.url === value;
- }) || {
- linkDestination: LINK_DESTINATION_CUSTOM
- }).linkDestination;
- }
+ const blocksQueue = [...blocks];
- onChangeUrl({
- linkDestination: linkDestinationInput,
- href: value
- });
- };
+ while (blocksQueue.length > 0) {
+ var _block$innerBlocks;
- const onSetNewTab = value => {
- const updatedLinkTarget = getUpdatedLinkTargetSettings(value);
- onChangeUrl(updatedLinkTarget);
- };
+ const block = blocksQueue.shift();
+ const isAllowed = checkAllowList(allowedBlockTypes, block.name || block.blockName, true);
- const onSetLinkRel = value => {
- onChangeUrl({
- rel: value
- });
- };
+ if (!isAllowed) {
+ return false;
+ }
- const onSetLinkClass = value => {
- onChangeUrl({
- linkClass: value
+ (_block$innerBlocks = block.innerBlocks) === null || _block$innerBlocks === void 0 ? void 0 : _block$innerBlocks.forEach(innerBlock => {
+ blocksQueue.push(innerBlock);
});
- };
+ }
- 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
- }))));
+ 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;
+ }
-// 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");
+ 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.
+ */
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-menu-extension/index.js
-var inserter_menu_extension = __webpack_require__("mlss");
+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.
+ */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/preview-options/index.js
+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);
-/**
- * External dependencies
- */
+ 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)]);
/**
- * WordPress dependencies
+ * 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.
+ */
-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,
+ 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.
+ */
- /* 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));
+function getBlockListSettings(state, clientId) {
+ return state.blockListSettings[clientId];
}
+/**
+ * Returns the editor settings.
+ *
+ * @param {Object} state Editor state.
+ *
+ * @return {Object} The editor settings object.
+ */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-resize-canvas/index.js
+function getSettings(state) {
+ return state.settings;
+}
/**
- * WordPress dependencies
+ * 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;
+}
/**
- * Function to resize the editor window.
+ * Returns the block list settings for an array of blocks, if any exist.
*
- * @param {string} deviceType Used for determining the size of the container (e.g. Desktop, Tablet, Mobile)
+ * @param {Object} state Editor state.
+ * @param {Array} clientIds Block client IDs.
*
- * @return {Object} Inline styles to be added to resizable container.
+ * @return {Object} An object where the keys are client ids and the values are
+ * a block list setting object.
*/
-function useResizeCanvas(deviceType) {
- const [actualWidth, updateActualWidth] = Object(external_wp_element_["useState"])(window.innerWidth);
- Object(external_wp_element_["useEffect"])(() => {
- if (deviceType === 'Desktop') {
- return;
+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;
}
- const resizeListener = () => updateActualWidth(window.innerWidth);
-
- window.addEventListener('resize', resizeListener);
- return () => {
- window.removeEventListener('resize', resizeListener);
+ return { ...blockListSettingsForBlocks,
+ [clientId]: state.blockListSettings[clientId]
};
- }, [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;
- };
+ }, {});
+}, 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 marginValue = () => window.innerHeight < 800 ? 36 : 72;
+const __experimentalGetReusableBlockTitle = rememo((state, ref) => {
+ var _reusableBlock$title;
- const contentInlineStyles = device => {
- const height = device === 'Mobile' ? '768px' : '1024px';
+ const reusableBlock = (0,external_lodash_namespaceObject.find)(getReusableBlocks(state), block => block.id === ref);
- 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'
- };
+ if (!reusableBlock) {
+ return null;
+ }
- default:
- 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.
+ */
- return contentInlineStyles(deviceType);
+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<string,Object>} Subsets of block attributes changed, keyed
+ * by block client ID.
+ */
-// 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
+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;
+}
/**
- * WordPress dependencies
+ * 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;
+}
/**
- * Internal dependencies
+ * Returns whether block moving mode is enabled.
+ *
+ * @param {Object} state Editor state.
+ *
+ * @return {string} Client Id of moving block.
*/
-
-
-
-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
-
-
+function selectors_hasBlockMovingClientId(state) {
+ return state.hasBlockMovingClientId;
+}
/**
- * WordPress dependencies
+ * 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;
+}
/**
- * Internal dependencies
+ * 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 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))));
+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.
+ */
-/* harmony default export */ var multi_selection_inspector = (Object(external_wp_data_["withSelect"])(select => {
- const {
- getMultiSelectedBlocks
- } = select(store["a" /* store */]);
- return {
- blocks: getMultiSelectedBlocks()
- };
-})(MultiSelectionInspector));
+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.
+ */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/default-style-picker/index.js
+const __experimentalGetActiveBlockIdByBlockNames = rememo((state, validBlockNames) => {
+ if (!validBlockNames.length) {
+ return null;
+ } // Check if selected block is a valid entity area.
-/**
- * WordPress dependencies
- */
+ 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]);
/**
- * Internal dependencies
+ * 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 DefaultStylePicker(_ref) {
- let {
- blockName
- } = _ref;
+function wasBlockJustInserted(state, clientId, source) {
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
- });
+ lastBlockInserted
+ } = state;
+ return lastBlockInserted.clientId === clientId && lastBlockInserted.source === source;
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-inspector/index.js
-
-
+;// 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
/**
- * WordPress dependencies
+ * External dependencies
*/
-
-
-
/**
- * Internal dependencies
+ * WordPress dependencies
*/
@@ -12442,1882 +7515,1718 @@ function DefaultStylePicker(_ref) {
+/**
+ * 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 BlockInspector = _ref => {
+const ensureDefaultBlock = () => _ref => {
let {
- showNoBlockSelectedMessage = true,
- bubblesVirtually = true
+ select,
+ dispatch
} = _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
- };
- }, []);
+ // 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 > 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')
- }));
- }
+ 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 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.'));
- }
+ const {
+ __unstableHasCustomAppender
+ } = select.getSettings();
- return null;
+ if (__unstableHasCustomAppender) {
+ return;
}
- return Object(external_wp_element_["createElement"])(BlockInspectorSingleBlock, {
- clientId: selectedBlockClientId,
- blockName: blockType.name,
- hasBlockStyles: hasBlockStyles,
- bubblesVirtually: bubblesVirtually
- });
+ 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 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 => {
+const resetBlocks = blocks => _ref2 => {
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
- }));
+ dispatch
+ } = _ref2;
+ dispatch({
+ type: 'RESET_BLOCKS',
+ blocks
+ });
+ dispatch(validateBlocksToTemplate(blocks));
};
-
-/* 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
+ * 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;
+ }
+};
/**
- * Internal 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`.
*/
-
-
-
-
+/* eslint-disable jsdoc/valid-types */
/**
- * 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.
+ * Returns an action object used in signalling that selection state should be
+ * reset to the specified selection.
*
- * @param {Object} $0 Props.
- * @param {Object} $0.children The block content and style container.
- * @param {Object} $0.__unstableContentRef Ref holding the content scroll container.
+ * @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 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)
- })))
- );
+function resetSelection(selectionStart, selectionEnd, initialPosition) {
+ /* eslint-enable jsdoc/valid-types */
+ return {
+ type: 'RESET_SELECTION',
+ selectionStart,
+ selectionEnd,
+ initialPosition
+ };
}
-
-// 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
+ * 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
+ };
+}
/**
- * WordPress dependencies
+ * 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
+ };
+}
/**
- * Internal dependencies
+ * 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 InserterLibrary(_ref) {
- let {
- rootClientId,
+function updateBlock(clientId, updates) {
+ return {
+ type: 'UPDATE_BLOCK',
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
- });
+ updates
+ };
}
+/* eslint-disable jsdoc/valid-types */
-/* harmony default export */ var library = (InserterLibrary);
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/keyboard-shortcuts/index.js
/**
- * WordPress dependencies
+ * 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;
-
-
-
-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;
+ /* 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.
+ */
-KeyboardShortcuts.Register = KeyboardShortcutsRegister;
-/* harmony default export */ var keyboard_shortcuts = (KeyboardShortcuts);
+const selectPreviousBlock = clientId => _ref4 => {
+ let {
+ select,
+ dispatch
+ } = _ref4;
+ const previousBlockClientId = select.getPreviousBlockClientId(clientId);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/selection-scroll-into-view/index.js
+ if (previousBlockClientId) {
+ dispatch.selectBlock(previousBlockClientId, -1);
+ }
+};
/**
- * WordPress dependencies
+ * 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);
+ }
+};
/**
- * Scrolls the multi block selection end into view if not in view already. This
- * is important to do after selection by keyboard.
+ * Action that starts block multi-selection.
*
- * @deprecated
+ * @return {Object} Action object.
*/
-function MultiSelectScrollIntoView() {
- external_wp_deprecated_default()('wp.blockEditor.MultiSelectScrollIntoView', {
- hint: 'This behaviour is now built-in.'
- });
- return null;
+function startMultiSelect() {
+ return {
+ type: 'START_MULTI_SELECT'
+ };
}
-
-// 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
+ * Action that stops block multi-selection.
+ *
+ * @return {Object} Action object.
*/
-
-
-
+function stopMultiSelect() {
+ return {
+ type: 'STOP_MULTI_SELECT'
+ };
+}
/**
- * Internal dependencies
+ * 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');
+};
/**
- * Set of key codes upon which typing is to be initiated on a keydown event.
+ * Action that clears the block selection.
*
- * @type {Set<number>}
+ * @return {Object} Action object.
*/
-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"]]);
+function clearSelectedBlock() {
+ return {
+ type: 'CLEAR_SELECTED_BLOCK'
+ };
+}
/**
- * 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.
+ * Action that enables or disables block selection.
*
- * @param {KeyboardEvent} event Keydown event to test.
+ * @param {boolean} [isSelectionEnabled=true] Whether block selection should
+ * be enabled.
*
- * @return {boolean} Whether event is eligible to start typing.
+ * @return {Object} Action object.
*/
-function isKeyDownEligibleForStartTyping(event) {
- const {
- keyCode,
- shiftKey
- } = event;
- return !shiftKey && KEY_DOWN_ELIGIBLE_KEY_CODES.has(keyCode);
+function toggleSelection() {
+ let isSelectionEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
+ return {
+ type: 'TOGGLE_SELECTION',
+ isSelectionEnabled
+ };
}
-/**
- * Removes the `isTyping` flag when the mouse moves in the document of the given
- * element.
- */
+function getBlocksWithDefaultStylesApplied(blocks, blockEditorSettings) {
+ var _blockEditorSettings$, _blockEditorSettings$2;
-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 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 {
- ownerDocument
- } = node;
- let lastClientX;
- let lastClientY;
- /**
- * On mouse move, unset typing flag if user has moved cursor.
- *
- * @param {MouseEvent} event Mousemove event.
- */
+ const blockName = block.name;
- 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 (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, 'defaultStylePicker', true)) {
+ return block;
+ }
- if (lastClientX && lastClientY && (lastClientX !== clientX || lastClientY !== clientY)) {
- stopTyping();
- }
+ if (!preferredStyleVariations[blockName]) {
+ return block;
+ }
- lastClientX = clientX;
- lastClientY = clientY;
+ 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;
}
- ownerDocument.addEventListener('mousemove', stopTypingOnMouseMove);
- return () => {
- ownerDocument.removeEventListener('mousemove', stopTypingOnMouseMove);
+ const {
+ attributes = {}
+ } = block;
+ const blockStyle = preferredStyleVariations[blockName];
+ return { ...block,
+ attributes: { ...attributes,
+ className: `${className || ''} is-style-${blockStyle}`.trim()
+ }
};
- }, [isTyping, stopTyping]);
+ });
}
+/* eslint-disable jsdoc/valid-types */
+
/**
- * Sets and removes the `isTyping` flag based on user actions:
+ * Action that replaces given blocks with one or more replacement blocks.
*
- * - 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.
+ * @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.
*/
-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.
- */
+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;
- 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.
+ /* 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.
- timerId = defaultView.setTimeout(() => {
- if (!Object(external_wp_dom_["isTextField"])(target)) {
- stopTyping();
- }
- });
+ for (let index = 0; index < blocks.length; index++) {
+ const block = blocks[index];
+ const canInsertBlock = select.canInsertBlockType(block.name, rootClientId);
+
+ if (!canInsertBlock) {
+ return;
}
- /**
- * Unsets typing flag if user presses Escape while typing flag is
- * active.
- *
- * @param {KeyboardEvent} event Keypress or keydown event to
- * interpret.
- */
+ }
+ 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 stopTypingOnEscapeKey(event) {
- const {
- keyCode
- } = event;
+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.
+ */
- 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.
- */
+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;
+ }
- function stopTypingOnSelectionUncollapse() {
- const selection = defaultView.getSelection();
- const isCollapsed = selection.rangeCount > 0 && selection.getRangeAt(0).collapsed;
+ dispatch({
+ type,
+ clientIds: (0,external_lodash_namespaceObject.castArray)(clientIds),
+ rootClientId
+ });
+};
- if (!isCollapsed) {
- stopTyping();
- }
- }
+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.
+ */
- 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.
- */
+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.
- 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)) {
+ 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;
- } // 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.
+ }
+ 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 (type === 'keydown' && !isKeyDownEligibleForStartTyping(event)) {
+ if (!canInsertBlocks) {
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
+ dispatch({
+ type: 'MOVE_BLOCKS_TO_POSITION',
+ fromRootClientId,
+ toRootClientId,
+ clientIds,
+ index
+ });
+ };
+};
/**
- * WordPress dependencies
+ * 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 PreserveScrollInReorder() {
- external_wp_deprecated_default()('PreserveScrollInReorder component', {
- since: '5.4',
- hint: 'This behavior is now built-in the block list'
- });
- return null;
+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);
}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/typewriter/index.js
-
-
/**
- * WordPress dependencies
+ * 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 */
/**
- * Internal dependencies
+ * 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;
-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;
+ /* 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'
+ });
}
- const {
- ownerDocument
- } = node;
- const {
- defaultView
- } = ownerDocument;
- let scrollResizeRafId;
- let onKeyDownRafId;
- let caretRect;
+ blocks = getBlocksWithDefaultStylesApplied((0,external_lodash_namespaceObject.castArray)(blocks), select.getSettings());
+ const allowedBlocks = [];
- function onScrollResize() {
- if (scrollResizeRafId) {
- return;
+ for (const block of blocks) {
+ const isValid = select.canInsertBlockType(block.name, rootClientId);
+
+ if (isValid) {
+ allowedBlocks.push(block);
}
+ }
- scrollResizeRafId = defaultView.requestAnimationFrame(() => {
- computeCaretRectangle();
- scrollResizeRafId = null;
+ 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 onKeyDown(event) {
- // Ensure the any remaining request is cancelled.
- if (onKeyDownRafId) {
- defaultView.cancelAnimationFrame(onKeyDownRafId);
- } // Use an animation frame for a smooth result.
-
+function showInsertionPoint(rootClientId, index) {
+ let __unstableOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- 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.
- */
+ 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 maintainCaretPosition(_ref) {
- let {
- keyCode
- } = _ref;
+function setTemplateValidity(isValid) {
+ return {
+ type: 'SET_TEMPLATE_VALIDITY',
+ isValid
+ };
+}
+/**
+ * Action that synchronizes the template with the list of blocks.
+ *
+ * @return {Object} Action object.
+ */
- if (!isSelectionEligibleForScroll()) {
- return;
- }
+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 currentCaretRect = Object(external_wp_dom_["computeCaretRect"])(defaultView);
+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 (!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 (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 (!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 (!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.
- if (arrowKeyCodes.has(keyCode)) {
- // Reset the caret position to maintain.
- caretRect = currentCaretRect;
- return;
- }
+ const START_OF_SELECTED_AREA = '\u0086'; // Clone the blocks so we don't insert the character in a "live" block.
- const diff = currentCaretRect.top - caretRect.top;
+ const cloneA = (0,external_wp_blocks_namespaceObject.cloneBlock)(blockA);
+ const cloneB = (0,external_wp_blocks_namespaceObject.cloneBlock)(blockB);
- if (diff === 0) {
- return;
- }
+ 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 scrollContainer = Object(external_wp_dom_["getScrollContainer"])(node); // The page must be scrollable.
- if (!scrollContainer) {
- return;
- }
+ 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
- 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 (!blocksWithTheSameType || !blocksWithTheSameType.length) {
+ return;
+ } // Calling the merge to update the attributes and remove the block to be merged
- 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.
+ const updatedAttributes = blockAType.merge(cloneA.attributes, blocksWithTheSameType[0].attributes);
- 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 (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);
+ }
- if (windowScroll) {
- defaultView.scrollBy(0, diff);
- } else {
- scrollContainer.scrollTop += diff;
- }
+ dispatch.replaceBlocks([blockA.clientId, blockB.clientId], [{ ...blockA,
+ attributes: { ...blockA.attributes,
+ ...updatedAttributes
}
- /**
- * Adds a `selectionchange` listener to reset the scroll position to be
- * maintained.
- */
+ }, ...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;
- function addSelectionChangeListener() {
- ownerDocument.addEventListener('selectionchange', computeCaretRectOnSelectionChange);
+ if (!clientIds || !clientIds.length) {
+ return;
}
- /**
- * Resets the scroll position to be maintained during a `selectionchange`
- * event. Also removes the listener, so it acts as a one-time listener.
- */
+ clientIds = (0,external_lodash_namespaceObject.castArray)(clientIds);
+ const rootClientId = select.getBlockRootClientId(clientIds[0]);
+ const canRemoveBlocks = select.canRemoveBlocks(clientIds, rootClientId);
- function computeCaretRectOnSelectionChange() {
- ownerDocument.removeEventListener('selectionchange', computeCaretRectOnSelectionChange);
- computeCaretRectangle();
+ if (!canRemoveBlocks) {
+ return;
}
- /**
- * Resets the scroll position to be maintained.
- */
-
- function computeCaretRectangle() {
- if (isSelectionEligibleForScroll()) {
- caretRect = Object(external_wp_dom_["computeCaretRect"])(defaultView);
- }
+ if (selectPrevious) {
+ dispatch.selectPreviousBlock(clientIds[0]);
}
- /**
- * 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.
- */
+ 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 isSelectionEligibleForScroll() {
- return node.contains(ownerDocument.activeElement) && ownerDocument.activeElement.isContentEditable;
- }
+function removeBlock(clientId, selectPrevious) {
+ return removeBlocks([clientId], selectPrevious);
+}
+/* eslint-disable jsdoc/valid-types */
- 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.
+/**
+ * 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;
- 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]);
+ /* 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 Typewriter(_ref2) {
- let {
- children
- } = _ref2;
- return Object(external_wp_element_["createElement"])("div", {
- ref: useTypewriter(),
- className: "block-editor__typewriter"
- }, children);
+function toggleBlockMode(clientId) {
+ return {
+ type: 'TOGGLE_BLOCK_MODE',
+ clientId
+ };
}
/**
- * The exported component. The implementation of Typewriter faced technical
- * challenges in Internet Explorer, and is simply skipped, rendering the given
- * props children instead.
+ * Returns an action object used in signalling that the user has begun to type.
*
- * @type {WPComponent}
+ * @return {Object} Action object.
*/
-
-const TypewriterOrIEBypass = isIE ? props => props.children : Typewriter;
+function startTyping() {
+ return {
+ type: 'START_TYPING'
+ };
+}
/**
- * 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.
+ * Returns an action object used in signalling that the user has stopped typing.
+ *
+ * @return {Object} Action object.
*/
-/* 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
+function stopTyping() {
+ return {
+ type: 'STOP_TYPING'
+ };
+}
/**
- * External dependencies
+ * 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
+ };
+}
/**
- * WordPress dependencies
+ * 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'
+ };
+}
/**
- * Given an element, returns true if the element is a tabbable text field, or
- * false otherwise.
+ * Action that changes the position of the user caret.
*
- * @param {Element} element Element to test.
+ * @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 {boolean} Whether element is a tabbable text field.
+ * @return {Object} Action object.
*/
-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);
- };
- }, []);
+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
+ */
-// 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
+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);
+}
/**
- * WordPress dependencies
+ * 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
+ };
+}
/**
- * Internal dependencies
+ * Action that updates the block editor settings.
+ *
+ * @param {Object} settings Updated settings
+ *
+ * @return {Object} Action object
*/
-
-const RenderedRefsContext = Object(external_wp_element_["createContext"])({});
+function updateSettings(settings) {
+ return {
+ type: 'UPDATE_SETTINGS',
+ settings
+ };
+}
/**
- * Immutably adds an unique identifier to a set scoped for a given block type.
+ * Action that signals that a temporary reusable block has been saved
+ * in order to switch its temporary id with the real id.
*
- * @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.
+ * @param {string} id Reusable block's id.
+ * @param {string} updatedId Updated block's id.
*
- * @return {Object} The list of rendered blocks grouped by block name.
+ * @return {Object} Action object.
*/
-function addToBlockType(renderedBlocks, blockName, uniqueId) {
- const result = { ...renderedBlocks,
- [blockName]: renderedBlocks[blockName] ? new Set(renderedBlocks[blockName]) : new Set()
+function __unstableSaveReusableBlock(id, updatedId) {
+ return {
+ type: 'SAVE_REUSABLE_BLOCK_SUCCESS',
+ id,
+ updatedId
};
- 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.
+ * Action that marks the last block change explicitly as persistent.
*
- * @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.
+ * @return {Object} Action object.
*/
-
-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];
+function __unstableMarkLastChangeAsPersistent() {
+ return {
+ type: 'MARK_LAST_CHANGE_AS_PERSISTENT'
+ };
}
-
-// 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
+/**
+ * Action that signals that the next block change should be marked explicitly as not persistent.
+ *
+ * @return {Object} Action object.
*/
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/*
- * Content Related Components
+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);
+ }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/*
- * State Related Components
+ 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;
+ }
-/***/ }),
-
-/***/ "16Al":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
+ const firstSelectedIndex = select.getBlockIndex(clientId);
+ return dispatch.insertDefaultBlock({}, rootClientId, firstSelectedIndex);
+};
/**
- * Copyright (c) 2013-present, Facebook, Inc.
+ * Action that inserts an empty block after a given block.
*
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
+ * @param {string} clientId
*/
+const insertAfterBlock = clientId => _ref19 => {
+ let {
+ select,
+ dispatch
+ } = _ref19;
+ if (!clientId) {
+ return;
+ }
-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;
-};
+ 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.
+ */
-/***/ "17x9":
-/***/ (function(module, exports, __webpack_require__) {
+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));
+};
/**
- * Copyright (c) 2013-present, Facebook, Inc.
+ * Action that sets whether a block has controlled inner blocks.
*
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
+ * @param {string} clientId The block's clientId.
+ * @param {boolean} hasControlledInnerBlocks True if the block's inner blocks are controlled.
*/
-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")();
+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
+ */
-/***/ "1CF3":
-/***/ (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.
+ * Block editor data store configuration.
*
- * 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.
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore
*
- * @providesModule normalizeWheel
- * @typechecks
+ * @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.
-var UserAgent_DEPRECATED = __webpack_require__("jrfk");
-
-var isEventSupported = __webpack_require__("ez49");
+(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
+ */
-// Reasonable defaults
-var PIXEL_STEP = 10;
-var LINE_HEIGHT = 40;
-var PAGE_HEIGHT = 800;
+const DEFAULT_BLOCK_EDIT_CONTEXT = {
+ name: '',
+ isSelected: false
+};
+const Context = (0,external_wp_element_namespaceObject.createContext)(DEFAULT_BLOCK_EDIT_CONTEXT);
+const {
+ Provider
+} = Context;
/**
- * 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
+ * A hook that returns the block edit context.
*
+ * @return {Object} Block edit context
*/
-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; }
+function useBlockEditContext() {
+ return (0,external_wp_element_namespaceObject.useContext)(Context);
+}
- // side scrolling on FF with DOMMouseScroll
- if ( 'axis' in event && event.axis === event.HORIZONTAL_AXIS ) {
- sX = sY;
- sY = 0;
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-display-block-controls/index.js
+/**
+ * WordPress dependencies
+ */
- pX = sX * PIXEL_STEP;
- pY = sY * PIXEL_STEP;
+/**
+ * Internal dependencies
+ */
- 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;
+
+function useDisplayBlockControls() {
+ const {
+ isSelected,
+ clientId,
+ name
+ } = useBlockEditContext();
+ return (0,external_wp_data_namespaceObject.useSelect)(select => {
+ if (isSelected) {
+ return true;
}
- }
- // Fall-back if spin cannot be determined
- if (pX && !sX) { sX = (pX < 1) ? -1 : 1; }
- if (pY && !sY) { sY = (pY < 1) ? -1 : 1; }
+ const {
+ getBlockName,
+ isFirstMultiSelectedBlock,
+ getMultiSelectedBlockClientIds
+ } = select(store);
- return { spinX : sX,
- spinY : sY,
- pixelX : pX,
- pixelY : pY };
+ if (isFirstMultiSelectedBlock(clientId)) {
+ return getMultiSelectedBlockClientIds().every(id => getBlockName(id) === name);
+ }
+
+ return false;
+ }, [clientId, isSelected, name]);
}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/hook.js
+/**
+ * WordPress dependencies
+ */
+
/**
- * 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.
+ * Internal dependencies
*/
-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"]; }());
+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;
+ }
-/***/ "1eGn":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (isParentDisplayed) {
+ return block_controls_groups.parent.Fill;
+ }
-"use strict";
+ return null;
+}
-// UNUSED EXPORTS: BlockSettingsDropdown
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/fill.js
-// 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 dependencies
+ */
-// EXTERNAL MODULE: external "lodash"
-var external_lodash_ = __webpack_require__("YLtl");
+/**
+ * WordPress dependencies
+ */
-// 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");
+/**
+ * Internal dependencies
+ */
-// 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");
+function BlockControlsFill(_ref) {
+ let {
+ group = 'default',
+ controls,
+ children,
+ __experimentalShareWithChildBlocks = false
+ } = _ref;
+ const Fill = useBlockControlsFill(group, __experimentalShareWithChildBlocks);
-// EXTERNAL MODULE: external ["wp","blocks"]
-var external_wp_blocks_ = __webpack_require__("HSyU");
+ if (!Fill) {
+ return null;
+ }
-// EXTERNAL MODULE: external ["wp","keyboardShortcuts"]
-var external_wp_keyboardShortcuts_ = __webpack_require__("hF7m");
+ 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);
+ }));
+}
-// EXTERNAL MODULE: external ["wp","compose"]
-var external_wp_compose_ = __webpack_require__("K9lf");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/slot.js
-// 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
*/
+
/**
- * 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
-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,
+const BlockFormatControls = props => {
+ return (0,external_wp_element_namespaceObject.createElement)(BlockControlsFill, _extends({
+ group: "inline"
+ }, props));
+};
- onDuplicate() {
- return duplicateBlocks(clientIds, updateSelection);
- },
+BlockFormatControls.Slot = props => {
+ return (0,external_wp_element_namespaceObject.createElement)(BlockControlsSlot, _extends({
+ group: "inline"
+ }, props));
+};
- onRemove() {
- return removeBlocks(clientIds, updateSelection);
- },
+/* harmony default export */ var block_controls = (BlockControls);
- onInsertBefore() {
- insertBeforeBlock(Object(external_lodash_["first"])(Object(external_lodash_["castArray"])(clientIds)));
- },
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-none.js
- onInsertAfter() {
- insertAfterBlock(Object(external_lodash_["last"])(Object(external_lodash_["castArray"])(clientIds)));
- },
- onMoveTo() {
- setNavigationMode(true);
- selectBlock(clientIds[0]);
- setBlockMovingClientId(clientIds[0]);
- },
+/**
+ * WordPress dependencies
+ */
- onGroup() {
- if (!blocks.length) {
- return;
- }
+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);
- const groupingBlockName = getGroupingBlockName(); // Activate the `transform` on `core/group` which does the conversion
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/position-left.js
- const newBlocks = Object(external_wp_blocks_["switchToBlockType"])(blocks, groupingBlockName);
- if (!newBlocks) {
- return;
- }
+/**
+ * WordPress dependencies
+ */
- replaceBlocks(clientIds, newBlocks);
- },
+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);
- onUngroup() {
- if (!blocks.length) {
- return;
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/position-center.js
- const innerBlocks = blocks[0].innerBlocks;
- if (!innerBlocks.length) {
- return;
- }
+/**
+ * WordPress dependencies
+ */
- replaceBlocks(clientIds, innerBlocks);
- },
+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);
- onCopy() {
- const selectedBlockClientIds = blocks.map(_ref2 => {
- let {
- clientId
- } = _ref2;
- return clientId;
- });
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/position-right.js
- if (blocks.length === 1) {
- flashBlock(selectedBlockClientIds[0]);
- }
- notifyCopy('copy', selectedBlockClientIds);
- }
+/**
+ * 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/block-editor/build-module/components/block-settings-menu/block-mode-toggle.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/stretch-wide.js
/**
- * External dependencies
+ * 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
/**
- * Internal dependencies
+ * 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);
-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
+;// 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);
-function BlockConvertButton(_ref) {
- let {
- shouldRender,
- onClick,
- small
- } = _ref;
-
- if (!shouldRender) {
- return null;
- }
-
- const label = Object(external_wp_i18n_["__"])('Convert to Blocks');
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/justify-space-between.js
- 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
*/
+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
/**
- * Internal dependencies
+ * 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
-/* 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
+/**
+ * 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
*/
@@ -14328,914 +9237,1039 @@ var block_settings_menu_controls = __webpack_require__("pXCJ");
-
-
-
-
-
-
/**
* 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 POPOVER_PROPS = {
- className: 'block-editor-block-settings-menu__popover',
- position: 'bottom right',
- isAlternate: true
+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 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];
+function useSetting(path) {
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;
+ name: blockName
+ } = useBlockEditContext();
+ const setting = (0,external_wp_data_namespaceObject.useSelect)(select => {
+ var _get;
- if (ids && ids[0]) {
- __experimentalSelectBlock(ids[0]);
+ 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;
}
- } : 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);
+ 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);
-/***/ "1iEr":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (experimentalFeaturesResult !== undefined) {
+ if (external_wp_blocks_namespaceObject.__EXPERIMENTAL_PATHS_WITH_MERGE[normalizedPath]) {
+ var _ref, _experimentalFeatures;
-"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__);
+ 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.
-/**
- * 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);
+ 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.
-/***/ }),
-/***/ "1oY3":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ return normalizedPath === 'typography.dropCap' ? true : undefined;
+ }, [blockName, path]);
+ return setting;
+}
-"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");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/justify-content-control/ui.js
/**
- * Internal dependencies
+ * WordPress 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"
- }));
+const icons = {
+ left: justify_left,
+ center: justify_center,
+ right: justify_right,
+ 'space-between': justify_space_between
};
-InspectorAdvancedControls.slotName = 'InspectorAdvancedControls';
-/**
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inspector-controls/README.md
- */
+function JustifyContentUI(_ref) {
+ let {
+ allowedControls = ['left', 'center', 'right', 'space-between'],
+ isCollapsed = true,
+ onChange,
+ value,
+ popoverProps,
+ isToolbar
+ } = _ref;
-/* harmony default export */ __webpack_exports__["b"] = (InspectorControls);
+ // 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);
-/***/ "1uGa":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/justify-content-control/index.js
-"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
+ * 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
-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;
+/**
+ * WordPress dependencies
+ */
- 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);
+/**
+ * Internal dependencies
+ */
-/***/ }),
-/***/ "2YCo":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ // Used with the default, horizontal flex orientation.
-"use strict";
+const justifyContentMap = {
+ left: 'flex-start',
+ right: 'flex-end',
+ center: 'center',
+ 'space-between': 'space-between'
+}; // Used with the vertical (column) flex orientation.
-// EXPORTS
-__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ BorderStyleControl; });
+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;
-// EXTERNAL MODULE: external ["wp","element"]
-var external_wp_element_ = __webpack_require__("GRId");
+ 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}
+ }
-// EXTERNAL MODULE: external ["wp","components"]
-var external_wp_components_ = __webpack_require__("tI+e");
+ ${appendSelectors(selector, '> *')} {
+ margin: 0;
+ }
+ `);
+ },
-// EXTERNAL MODULE: external ["wp","i18n"]
-var external_wp_i18n_ = __webpack_require__("l3Sj");
+ getOrientation(layout) {
+ const {
+ orientation = 'horizontal'
+ } = layout;
+ return orientation;
+ },
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/line-solid.js
-var line_solid = __webpack_require__("bVTw");
+ getAlignments() {
+ return [];
+ }
-// EXTERNAL MODULE: external ["wp","primitives"]
-var external_wp_primitives_ = __webpack_require__("Tqx9");
+});
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-dashed.js
+function FlexLayoutJustifyContentControl(_ref4) {
+ let {
+ layout,
+ onChange,
+ isToolbar = false
+ } = _ref4;
+ const {
+ justifyContent = 'left',
+ orientation = 'horizontal'
+ } = layout;
+ const onJustificationChange = value => {
+ onChange({ ...layout,
+ justifyContent: value
+ });
+ };
-/**
- * WordPress dependencies
- */
+ const allowedControls = ['left', 'center', 'right'];
-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);
+ if (orientation === 'horizontal') {
+ allowedControls.push('space-between');
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-dotted.js
+ 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')
+ }];
-/**
- * WordPress dependencies
- */
+ if (orientation === 'horizontal') {
+ justificationOptions.push({
+ value: 'space-between',
+ icon: justify_space_between,
+ label: (0,external_wp_i18n_namespaceObject.__)('Space between items')
+ });
+ }
-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);
+ 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)
+ });
+ })));
+}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-style-control/index.js
+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 */
-
-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.
+ * Return an SVG icon.
*
- * @param {Object} props Component props.
- * @param {Function} props.onChange Handler for changing border style selection.
- * @param {string} props.value Currently selected border style value.
+ * @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 {WPElement} Custom border style segmented control.
+ * @return {JSX.Element} Icon component
*/
-function BorderStyleControl(_ref) {
+function Icon(_ref) {
let {
- onChange,
- value
+ icon,
+ size = 24,
+ ...props
} = _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
- }))));
+ return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
+ width: size,
+ height: size,
+ ...props
+ });
}
+/* harmony default export */ var build_module_icon = (Icon);
-/***/ }),
-
-/***/ "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__);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/layouts/flow.js
/**
* 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
+ * Internal dependencies
*/
-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]);
-}
+/* 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};
+ }
-/***/ "5L8O":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ ${appendSelectors(selector, '> [data-align="full"]')} {
+ max-width: none;
+ }
+ ` : '';
+ output += `
+ ${appendSelectors(selector, '> [data-align="left"]')} {
+ float: left;
+ margin-right: 2em;
+ }
-"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");
+ ${appendSelectors(selector, '> [data-align="right"]')} {
+ float: right;
+ margin-left: 2em;
+ }
+ `;
-/**
- * External dependencies
- */
+ if (hasBlockGapStylesSupport) {
+ output += `
+ ${appendSelectors(selector, '> *')} {
+ margin-top: 0;
+ margin-bottom: 0;
+ }
+ ${appendSelectors(selector, '> * + *')} {
+ margin-top: ${blockGapValue};
+ }
+ `;
+ }
-/**
- * WordPress dependencies
- */
+ 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'
+ }];
-/**
- * Internal dependencies
- */
+ if (contentSize) {
+ alignments.unshift({
+ name: 'full'
+ });
+ }
+ if (wideSize) {
+ alignments.unshift({
+ name: 'wide',
+ info: alignmentInfo.wide
+ });
+ }
+ alignments.unshift({
+ name: 'none',
+ info: alignmentInfo.none
+ });
+ return alignments;
+ }
+});
/**
- * Zero width non-breaking space, used as padding for the paragraph when it is
- * empty.
+ * 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.
*/
-const ZWNBSP = '\ufeff';
-function DefaultBlockAppender(_ref) {
- let {
- isLocked,
- isVisible,
- onAppend,
- showPrompt,
- placeholder,
- rootClientId
- } = _ref;
+function getAlignmentsInfo(layout) {
+ const {
+ contentSize,
+ wideSize
+ } = layout;
+ const alignmentInfo = {};
+ const sizeRegex = /^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;
- if (isLocked || !isVisible) {
- return null;
+ 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);
}
- const value = Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_5__["decodeEntities"])(placeholder) || Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('Type / to choose a block');
+ 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 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
- }));
+ return alignmentInfo;
}
-/* 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");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/layouts/index.js
+/**
+ * Internal dependencies
+ */
-// EXTERNAL MODULE: external ["wp","element"]
-var external_wp_element_ = __webpack_require__("GRId");
-// EXTERNAL MODULE: external "lodash"
-var external_lodash_ = __webpack_require__("YLtl");
+const layoutTypes = [flow, flex];
+/**
+ * Retrieves a layout type by name.
+ *
+ * @param {string} name - The name of the layout type.
+ * @return {Object} Layout type.
+ */
-// EXTERNAL MODULE: external ["wp","compose"]
-var external_wp_compose_ = __webpack_require__("K9lf");
+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.
+ */
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-setting/index.js
-var use_setting = __webpack_require__("v5LD");
+function getLayoutTypes() {
+ return layoutTypes;
+}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors/with-colors.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/layout.js
/**
- * External dependencies
+ * WordPress dependencies
*/
/**
- * 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;
/**
- * Internal dependencies
+ * 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
/**
- * 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.
+ * WordPress dependencies
*/
-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.
+ * Internal dependencies
*/
-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)
+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
};
- }, {});
- 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 = {};
- }
+ }, []);
+ const layout = useLayout();
+ const layoutType = getLayoutType(layout === null || layout === void 0 ? void 0 : layout.type);
+ const layoutAlignments = layoutType.getAlignments(layout);
- getMostReadableColor(colorValue) {
- const {
- colors
- } = this.props;
- return Object(utils["d" /* getMostReadableColor */])(colors, colorValue);
- }
+ 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.
- 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;
- }, {});
- }
+ if (alignments.length === 1 && alignments[0].name === 'none') {
+ return [];
+ }
- 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
- });
- };
- }
+ return alignments;
+ } // Starting here, it's the fallback for themes not supporting the layout config.
- 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)
- };
- }
+ if (layoutType.name !== 'default') {
+ return [];
+ }
- return newState;
- }, {});
- }
+ 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.
- render() {
- return Object(external_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, this.props, {
- colors: undefined
- }, this.state, this.setters, {
- colorUtils: this.colorUtils
- }));
- }
+ if (enabledControls.length === 1 && enabledControls[0].name === 'none') {
+ return [];
+ }
- };
- }]);
+ return enabledControls;
}
-/**
- * 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.
- */
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/ui.js
-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.
+ * External dependencies
*/
-function withColors() {
- const withColorPalette = withEditorColorPalette();
+/**
+ * WordPress dependencies
+ */
- 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
+/**
+ * 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;
-/***/ "6ZVF":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (!hasEnabledControls) {
+ return null;
+ }
-"use strict";
+ function onChangeAlignment(align) {
+ onChange([value, 'none'].includes(align) ? undefined : align);
+ }
-// EXTERNAL MODULE: external ["wp","element"]
-var external_wp_element_ = __webpack_require__("GRId");
+ 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.
-// EXTERNAL MODULE: external ["wp","blocks"]
-var external_wp_blocks_ = __webpack_require__("HSyU");
+ 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));
+}
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
-var esm_extends = __webpack_require__("wx14");
+/* harmony default export */ var block_alignment_control_ui = (BlockAlignmentUI);
-// 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-alignment-control/index.js
-// 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");
+/**
+ * Internal dependencies
+ */
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-draggable-blocks/index.js
-var inserter_draggable_blocks = __webpack_require__("j6zP");
+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/components/inserter-list-item/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/align.js
@@ -15243,6 +10277,7 @@ var inserter_draggable_blocks = __webpack_require__("j6zP");
* External dependencies
*/
+
/**
* WordPress dependencies
*/
@@ -15256,359 +10291,311 @@ var inserter_draggable_blocks = __webpack_require__("j6zP");
+/**
+ * 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'];
/**
- * Return true if platform is MacOS.
+ * 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.
*
- * @param {Object} _window window object by default; used for DI testing.
+ * @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.
*
- * @return {boolean} True if MacOS; false otherwise.
+ * @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 isAppleOS() {
- let _window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
+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;
- const {
- platform
- } = _window.navigator;
- return platform.indexOf('Mac') !== -1 || ['iPad', 'iPhone'].includes(platform);
-}
+ 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 = [];
+ }
-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 (!hasWideEnabled || blockAlign === true && !hasWideBlockSupport) {
+ return (0,external_lodash_namespaceObject.without)(validAlignments, ...WIDE_ALIGNMENTS);
+ }
- if (onDragStart) {
- onHover(null);
- onDragStart(event);
- }
- },
- onDragEnd: event => {
- isDragging.current = false;
+ return validAlignments;
+}
+/**
+ * Filters registered block settings, extending attributes to include `align`.
+ *
+ * @param {Object} settings Original block settings.
+ *
+ * @return {Object} Filtered block settings.
+ */
- if (onDragEnd) {
- onDragEnd(event);
- }
+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, '']
}
- }, 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;
- }
+ 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.
+ */
- onHover(item);
- },
- onMouseEnter: () => {
- if (isDragging.current) {
- return;
- }
+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.
- 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)));
+ 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;
});
-}
-/* harmony default export */ var inserter_list_item = (Object(external_wp_element_["memo"])(InserterListItem));
+ 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
+ });
+ };
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/group.js
-var group = __webpack_require__("xkPd");
+ 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.
+ */
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/row.js
-var inserter_listbox_row = __webpack_require__("HC45");
+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.
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-types-list/index.js
+ if (align === undefined) {
+ return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, props);
+ }
+ let wrapperProps = props.wrapperProps;
-/**
- * WordPress dependencies
- */
+ if (validAlignments.some(alignment => alignment.name === align)) {
+ wrapperProps = { ...wrapperProps,
+ 'data-align': align
+ };
+ }
+ return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, _extends({}, props, {
+ wrapperProps: wrapperProps
+ }));
+});
/**
- * Internal dependencies
+ * 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);
-
-function chunk(array, size) {
- const chunks = [];
-
- for (let i = 0, j = array.length; i < j; i += size) {
- chunks.push(array.slice(i, i + size));
+ if (isAlignValid) {
+ props.className = classnames_default()(`align${align}`, props.className);
}
- 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);
+ 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);
-/* 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__);
-
-
+;// 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.
-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
- });
+ settings.attributes = { ...settings.attributes,
+ lock: {
+ type: 'object'
+ }
+ };
+ return settings;
}
+(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/lock/addAttribute', lock_addAttribute);
-/* harmony default export */ __webpack_exports__["a"] = (ContrastChecker);
+;// 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
-/***/ "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
+ * External dependencies
*/
-
/**
- * Internal dependencies
+ * WordPress dependencies
*/
/**
- * Selects the block if it receives focus.
- *
- * @param {string} clientId Block client ID.
+ * Internal dependencies
*/
-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);
- }
+function InspectorControlsFill(_ref) {
+ var _groups$group;
- node.addEventListener('focusin', onFocus);
- return () => {
- node.removeEventListener('focusin', onFocus);
- };
- }, [isBlockSelected, selectBlock]);
-}
+ 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;
+ }
-/***/ "715p":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ 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);
+ }));
+}
-"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__);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/utils.js
/**
* External dependencies
*/
@@ -15621,52 +10608,16 @@ function useFocusHandler(clientId) {
*/
const cleanEmptyObject = object => {
- if (!Object(lodash__WEBPACK_IMPORTED_MODULE_0__["isObject"])(object) || Array.isArray(object)) {
+ if (!(0,external_lodash_namespaceObject.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;
+ 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
-/***/ }),
-
-/***/ "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
@@ -15674,65 +10625,97 @@ var external_wp_tokenList_default = /*#__PURE__*/__webpack_require__.n(external_
/**
- * Returns the active style from the given className.
- *
- * @param {Array} styles Block style variations.
- * @param {string} className Class name
- *
- * @return {Object?} The active style.
+ * Internal dependencies
*/
-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;
- }
- }
+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.
- 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.
- */
+ const selectedBlockClientId = getSelectedBlockClientId();
-function replaceActiveStyle(className, activeStyle, newStyle) {
- const list = new external_wp_tokenList_default.a(className);
+ if (hasMultiSelection()) {
+ const selectedBlockClientIds = getMultiSelectedBlockClientIds();
+ const selectedBlockAttributes = selectedBlockClientIds.reduce((blockAttributes, blockId) => {
+ blockAttributes[blockId] = getBlockAttributes(blockId);
+ return blockAttributes;
+ }, {});
+ return {
+ panelId: selectedBlockClientId,
+ clientIds: selectedBlockClientIds,
+ attributes: selectedBlockAttributes
+ };
+ }
- if (activeStyle) {
- list.remove('is-style-' + activeStyle.name);
- }
+ return {
+ panelId: selectedBlockClientId,
+ clientIds: [selectedBlockClientId],
+ attributes: {
+ [selectedBlockClientId]: getBlockAttributes(selectedBlockClientId)
+ }
+ };
+ }, []);
+ const {
+ updateBlockAttributes
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store);
- list.add('is-style-' + newStyle.name);
- return list.value;
-}
+ 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.
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-preview/index.js + 2 modules
-var block_preview = __webpack_require__("REKd");
+ newBlockAttributes = { ...newBlockAttributes,
+ style: cleanEmptyObject(newBlockAttributes.style)
+ };
+ newAttributes[clientId] = newBlockAttributes;
+ });
+ updateBlockAttributes(clientIds, newAttributes, true);
+ };
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules
-var store = __webpack_require__("BhPs");
+ 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.
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-styles/index.js
+ }, children);
+}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/block-support-slot-container.js
-/**
- * External dependencies
- */
/**
@@ -15740,178 +10723,103 @@ var store = __webpack_require__("BhPs");
*/
+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
/**
- * Internal 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 InspectorControlsSlot(_ref) {
+ var _groups$group;
-function BlockStyles(_ref) {
let {
- clientId,
- onSwitch = external_lodash_["noop"],
- onHoverClassName = external_lodash_["noop"],
- itemRole
+ __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);
- 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 || ''
- };
- };
+ if (!Slot || !slot) {
+ typeof process !== "undefined" && process.env && "production" !== "production" ? 0 : void 0;
+ return null;
+ }
- 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);
+ const hasFills = Boolean(slot.fills && slot.fills.length);
- if (!styles || styles.length === 0) {
+ if (!hasFills) {
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;
+ 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
+ })));
+ }
- 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
- });
+ return (0,external_wp_element_namespaceObject.createElement)(Slot, _extends({}, props, {
+ bubblesVirtually: bubblesVirtually
}));
}
-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));
-}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/index.js
+
+
+
+/**
+ * Internal dependencies
+ */
-/* harmony default export */ var block_styles = __webpack_exports__["a"] = (BlockStyles);
+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"
+ }));
+};
-/***/ "7SSY":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+InspectorAdvancedControls.Slot = props => {
+ return (0,external_wp_element_namespaceObject.createElement)(InspectorControlsSlot, _extends({}, props, {
+ __experimentalGroup: "advanced"
+ }));
+};
-"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");
+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
/**
@@ -15926,485 +10834,517 @@ function BlockStyleItem(_ref2) {
-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"]
+/**
+ * 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: '*'
+ }
};
}
- 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);
+ 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.
+ */
-/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["memo"])(BlockIcon));
+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.
+ */
-/***/ "7bKH":
-/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) {
+function addSaveProps(extraProps, blockType, attributes) {
+ if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'anchor')) {
+ extraProps.id = attributes.anchor === '' ? null : attributes.anchor;
+ }
-"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}});
+ 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
-/***/ }),
-/***/ "7fqt":
-/***/ (function(module, exports) {
+/**
+ * External dependencies
+ */
-(function() { module.exports = window["wp"]["wordcount"]; }());
+/**
+ * WordPress dependencies
+ */
-/***/ }),
-/***/ "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);
- }
- }
+/**
+ * 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;
}
-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);
- }
+/**
+ * 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;
}
-var queue = [];
-var draining = false;
-var currentQueue;
-var queueIndex = -1;
+(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);
-function cleanUpNextTick() {
- if (!draining || !currentQueue) {
- return;
- }
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- drainQueue();
- }
-}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/generated-class-name.js
+/**
+ * External dependencies
+ */
-function drainQueue() {
- if (draining) {
- return;
- }
- var timeout = runTimeout(cleanUpNextTick);
- draining = true;
+/**
+ * WordPress dependencies
+ */
- 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);
+
+/**
+ * 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);
}
-};
+ }
-// v8 likes predictible objects
-function Item(fun, array) {
- this.fun = fun;
- this.array = array;
+ return extraProps;
}
-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 = {};
+(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/generated-class-name/save-props', addGeneratedClassName);
-function noop() {}
+;// 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
-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 [] }
+/**
+ * WordPress dependencies
+ */
-process.binding = function (name) {
- throw new Error('process.binding is not supported');
-};
+/** @typedef {import('react').ReactNode} ReactNode */
-process.cwd = function () { return '/' };
-process.chdir = function (dir) {
- throw new Error('process.chdir is not supported');
-};
-process.umask = function() { return 0; };
+/**
+ * @typedef BlockContextProviderProps
+ *
+ * @property {Record<string,*>} value Context value to merge with current
+ * value.
+ * @property {ReactNode} children Component children.
+ */
+/** @type {import('react').Context<Record<string,*>>} */
-/***/ }),
+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);
-/***/ "9Do8":
-/***/ (function(module, exports, __webpack_require__) {
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/edit.js
-"use strict";
-module.exports = __webpack_require__("zt9T");
+/**
+ * External dependencies
+ */
-/***/ }),
-/***/ "9Ma0":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/**
+ * WordPress dependencies
+ */
+
-"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");
+/**
+ * Internal dependencies
+ */
-// 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);
+/**
+ * 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 {{}}
+ */
-// EXTERNAL MODULE: external "lodash"
-var external_lodash_ = __webpack_require__("YLtl");
+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.
-// EXTERNAL MODULE: external ["wp","blocks"]
-var external_wp_blocks_ = __webpack_require__("HSyU");
+ 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]);
-// EXTERNAL MODULE: external ["wp","components"]
-var external_wp_components_ = __webpack_require__("tI+e");
+ 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.
-// EXTERNAL MODULE: external ["wp","compose"]
-var external_wp_compose_ = __webpack_require__("K9lf");
-// EXTERNAL MODULE: external ["wp","data"]
-var external_wp_data_ = __webpack_require__("1ZqX");
+ const Component = blockType.edit || blockType.save;
-// EXTERNAL MODULE: external ["wp","i18n"]
-var external_wp_i18n_ = __webpack_require__("l3Sj");
+ 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
-// 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");
+ 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));
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-up.js
-var chevron_up = __webpack_require__("XgzB");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/index.js
-// 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.
+ * Internal dependencies
*/
-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;
+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));
+}
- 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);
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more-horizontal.js
- 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');
+/**
+ * WordPress dependencies
+ */
- 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);
- }
+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);
- 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);
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/warning/index.js
- 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');
+/**
+ * External dependencies
+ */
- 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);
- }
+/**
+ * WordPress dependencies
+ */
- 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);
- }
- }
+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)))))));
}
/**
- * 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.
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/warning/README.md
*/
-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');
- }
+/* harmony default export */ var warning = (Warning);
- if (dir > 0 && isLast) {
- return Object(external_wp_i18n_["__"])('Blocks cannot be moved down as they are already at the bottom');
- }
+// 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
- 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);
- }
-}
+/**
+ * WordPress dependencies
+ */
-// 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
+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
@@ -16412,341 +11352,239 @@ var store = __webpack_require__("BhPs");
-
-
-
-
/**
* 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);
+ });
+ }
-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 */];
- }
+ 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
- return chevron_down["a" /* default */];
+ const newContent = newBlocks.map(item => (0,external_wp_blocks_namespaceObject.getSaveContent)(item.name, item.attributes, item.innerBlocks));
+ return newContent.join('');
}
- return null;
-};
+ 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
+ }));
+}
-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');
- }
+/* harmony default export */ var block_compare = (BlockCompare);
- 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');
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-invalid-warning.js
- return Object(external_wp_i18n_["__"])('Move down');
- }
- return null;
-};
+/**
+ * WordPress dependencies
+ */
-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));
-});
-/***/ }),
+/**
+ * Internal dependencies
+ */
-/***/ "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");
+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
+});
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/font-size-picker.js
-var font_size_picker = __webpack_require__("QP/w");
+const blockToHTML = block => (0,external_wp_blocks_namespaceObject.createBlock)('core/html', {
+ content: block.originalContent
+});
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
-var esm_extends = __webpack_require__("wx14");
+const blockToBlocks = block => (0,external_wp_blocks_namespaceObject.rawHandler)({
+ HTML: block.originalContent
+});
-// EXTERNAL MODULE: external ["wp","element"]
-var external_wp_element_ = __webpack_require__("GRId");
+const recoverBlock = _ref2 => {
+ let {
+ name,
+ attributes,
+ innerBlocks
+ } = _ref2;
+ return (0,external_wp_blocks_namespaceObject.createBlock)(name, attributes, innerBlocks);
+};
-// EXTERNAL MODULE: external "lodash"
-var external_lodash_ = __webpack_require__("YLtl");
+/* 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));
+ },
-// EXTERNAL MODULE: external ["wp","compose"]
-var external_wp_compose_ = __webpack_require__("K9lf");
+ convertToHTML() {
+ replaceBlock(block.clientId, blockToHTML(block));
+ },
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-setting/index.js
-var use_setting = __webpack_require__("v5LD");
+ convertToBlocks() {
+ replaceBlock(block.clientId, blockToBlocks(block));
+ },
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/with-font-sizes.js
+ attemptBlockRecovery() {
+ replaceBlock(block.clientId, recoverBlock(block));
+ }
+ };
+})])(BlockInvalidWarning));
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-crash-warning.js
-/**
- * External dependencies
- */
/**
* 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);
-const DEFAULT_FONT_SIZES = [];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-crash-boundary.js
/**
- * 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.
+ * WordPress dependencies
*/
-/* 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));
- }
+class BlockCrashBoundary extends external_wp_element_namespaceObject.Component {
+ constructor() {
+ super(...arguments);
+ this.state = {
+ hasError: false
};
- }]), 'withFontSizes');
-});
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/index.js
-
-
-
+ }
+ componentDidCatch() {
+ this.setState({
+ hasError: true
+ });
+ }
-/***/ }),
+ render() {
+ if (this.state.hasError) {
+ return this.props.fallback;
+ }
-/***/ "AHN3":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ return this.props.children;
+ }
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return STORE_NAME; });
-const STORE_NAME = 'core/block-editor';
+}
+/* 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
-/***/ "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
*/
@@ -16758,7270 +11596,6122 @@ const STORE_NAME = 'core/block-editor';
-
-
/**
* 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) {
+function BlockHTML(_ref) {
let {
- rootClientId = '',
- insertionIndex,
- clientId,
- isAppender,
- onSelect,
- shouldFocusBlock = true
+ 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 {
- 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;
+ updateBlock
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store);
- let _destinationIndex;
+ const onChange = () => {
+ const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(block.name);
- 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;
+ if (!blockType) {
+ return;
}
- 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 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 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);
+ 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 (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();
+ if (!html) {
+ setHtml({
+ content
+ });
}
- }, [showInsertionPoint, hideInsertionPoint, destinationRootClientId, destinationIndex]);
- return [destinationRootClientId, onInsertBlocks, onToggleInsertionPoint];
+ };
+
+ (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 */ __webpack_exports__["a"] = (useInsertionPoint);
+/* 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();
+
+raf.write = fn => schedule(fn, writeQueue);
+let onStartQueue = makeQueue();
-/***/ }),
+raf.onStart = fn => schedule(fn, onStartQueue);
-/***/ "B9Az":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+let onFrameQueue = makeQueue();
-"use strict";
+raf.onFrame = fn => schedule(fn, onFrameQueue);
-// EXTERNAL MODULE: external ["wp","element"]
-var external_wp_element_ = __webpack_require__("GRId");
+let onFinishQueue = makeQueue();
-// EXTERNAL MODULE: external ["wp","primitives"]
-var external_wp_primitives_ = __webpack_require__("Tqx9");
+raf.onFinish = fn => schedule(fn, onFinishQueue);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pencil.js
+let timeouts = [];
+raf.setTimeout = (handler, ms) => {
+ let time = raf.now() + ms;
-/**
- * WordPress dependencies
- */
+ let cancel = () => {
+ let i = timeouts.findIndex(t => t.cancel == cancel);
+ if (~i) timeouts.splice(i, 1);
+ pendingCount -= ~i ? 1 : 0;
+ };
-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);
+ let timeout = {
+ time,
+ handler,
+ cancel
+ };
+ timeouts.splice(findTimeout(time), 0, timeout);
+ pendingCount += 1;
+ start();
+ return timeout;
+};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/edit.js
-/**
- * Internal dependencies
- */
+let findTimeout = time => ~(~timeouts.findIndex(t => t.time > time) || ~timeouts.length);
+
+raf.cancel = fn => {
+ onStartQueue.delete(fn);
+ onFrameQueue.delete(fn);
+ updateQueue.delete(fn);
+ writeQueue.delete(fn);
+ onFinishQueue.delete(fn);
+};
+
+raf.sync = fn => {
+ sync = true;
+ raf.batchedUpdates(fn);
+ sync = false;
+};
+
+raf.throttle = fn => {
+ let lastArgs;
+
+ function queuedFn() {
+ try {
+ fn(...lastArgs);
+ } finally {
+ lastArgs = null;
+ }
+ }
+
+ function throttled(...args) {
+ lastArgs = args;
+ raf.onStart(queuedFn);
+ }
-/* harmony default export */ var edit = __webpack_exports__["a"] = (library_pencil);
+ throttled.handler = fn;
+ throttled.cancel = () => {
+ onStartQueue.delete(queuedFn);
+ lastArgs = null;
+ };
-/***/ }),
+ return throttled;
+};
-/***/ "BCrt":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+let nativeRaf = typeof window != 'undefined' ? window.requestAnimationFrame : () => {};
-"use strict";
+raf.use = impl => nativeRaf = impl;
-// 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; });
+raf.now = typeof performance != 'undefined' ? () => performance.now() : Date.now;
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/index.js + 8 modules
-var transform_styles = __webpack_require__("vSu0");
+raf.batchedUpdates = fn => fn();
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/defaults.js
-var defaults = __webpack_require__("lJLt");
+raf.catch = console.error;
+raf.frameLoop = 'always';
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/theme.js
-/**
- * Internal dependencies
- */
+raf.advance = () => {
+ if (raf.frameLoop !== 'demand') {
+ console.warn('Cannot call the manual advancement of rafz whilst frameLoop is not set as demand');
+ } else {
+ update();
+ }
+};
-/**
- * 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
- */
+let ts = -1;
+let pendingCount = 0;
+let sync = false;
-function validateThemeColors(colors) {
- if (colors === undefined) {
- colors = defaults["b" /* SETTINGS_DEFAULTS */].colors;
+function schedule(fn, queue) {
+ if (sync) {
+ queue.delete(fn);
+ fn(0);
} 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;
- }
+ queue.add(fn);
+ start();
}
-
- 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);
+function start() {
+ if (ts < 0) {
+ ts = 0;
- if (validGradients.length === 0) {
- gradients = defaults["b" /* SETTINGS_DEFAULTS */].gradients;
- } else if (validGradients.length < gradients.length) {
- // Filter out invalid gradients
- gradients = validGradients;
+ if (raf.frameLoop !== 'demand') {
+ nativeRaf(loop);
}
}
+}
- return gradients;
+function stop() {
+ ts = -1;
}
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/block-variation-transforms.js
-var block_variation_transforms = __webpack_require__("Btt3");
+function loop() {
+ if (~ts) {
+ nativeRaf(loop);
+ raf.batchedUpdates(update);
+ }
+}
-// 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)$/);
+function update() {
+ let prevTs = ts;
+ ts = raf.now();
+ let count = findTimeout(ts);
- if (!isNaN(cssUnit) && !isNaN(parseFloat(cssUnit))) {
- return {
- value: parseFloat(cssUnit),
- unit: 'px'
- };
+ if (count) {
+ eachSafely(timeouts.splice(0, count), t => t.handler());
+ pendingCount -= count;
}
- return match ? {
- value: parseFloat(match[1]) || match[1],
- unit: match[2]
- } : {
- value: cssUnit,
- unit: undefined
- };
+ onStartQueue.flush();
+ updateQueue.flush(prevTs ? Math.min(64, ts - prevTs) : 16.667);
+ onFrameQueue.flush();
+ writeQueue.flush();
+ onFinishQueue.flush();
+
+ if (!pendingCount) {
+ stop();
+ }
}
-/**
- * Evaluate a math expression.
- *
- * @param {string} expression
- * @return {number} evaluated expression.
- */
+function makeQueue() {
+ let next = new Set();
+ let current = next;
+ return {
+ add(fn) {
+ pendingCount += current == next && !next.has(fn) ? 1 : 0;
+ next.add(fn);
+ },
+
+ delete(fn) {
+ pendingCount -= current == next && next.has(fn) ? 1 : 0;
+ return next.delete(fn);
+ },
-function calculate(expression) {
- return Function(`'use strict'; return (${expression})`)();
+ flush(arg) {
+ if (current.size) {
+ next = new Set();
+ pendingCount -= current.size;
+ eachSafely(current, fn => fn(arg) && next.add(fn));
+ pendingCount += next.size;
+ current = next;
+ }
+ }
+
+ };
}
-/**
- * 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 eachSafely(values, each) {
+ values.forEach(value => {
+ try {
+ each(value);
+ } catch (e) {
+ raf.catch(e);
+ }
+ });
+}
-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);
+const __raf = {
+ count() {
+ return pendingCount;
+ },
- switch (functionUnit[0]) {
- case 'min':
- return Math.min(...units) + 'px';
+ isRunning() {
+ return ts >= 0;
+ },
- case 'max':
- return Math.max(...units) + 'px';
+ clear() {
+ ts = -1;
+ timeouts = [];
+ onStartQueue = makeQueue();
+ updateQueue = makeQueue();
+ onFrameQueue = makeQueue();
+ writeQueue = makeQueue();
+ onFinishQueue = makeQueue();
+ pendingCount = 0;
+ }
- 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';
+// EXTERNAL MODULE: external "React"
+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
- 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.
+function noop() {}
+const defineHidden = (obj, key, value) => Object.defineProperty(obj, key, {
+ value,
+ writable: true,
+ configurable: true
+});
+const react_spring_shared_esm_is = {
+ arr: Array.isArray,
+ obj: a => !!a && a.constructor.name === 'Object',
+ fun: a => typeof a === 'function',
+ str: a => typeof a === 'string',
+ num: a => typeof a === 'number',
+ und: a => a === undefined
+};
+function isEqual(a, b) {
+ if (react_spring_shared_esm_is.arr(a)) {
+ if (!react_spring_shared_esm_is.arr(b) || a.length !== b.length) return false;
- if (cssUnit === currentCssUnit || parseFloat(cssUnit)) {
- break;
+ for (let i = 0; i < a.length; i++) {
+ if (a[i] !== b[i]) return false;
}
+
+ return true;
}
- return parseUnit(cssUnit);
+ return a === b;
}
-/**
- * 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.
- */
+const react_spring_shared_esm_each = (obj, fn) => obj.forEach(fn);
+function eachProp(obj, fn, ctx) {
+ if (react_spring_shared_esm_is.arr(obj)) {
+ for (let i = 0; i < obj.length; i++) {
+ fn.call(ctx, obj[i], `${i}`);
+ }
+ return;
+ }
-function isMathExpression(cssUnit) {
- for (let i = 0; i < cssUnit.length; i++) {
- if (['+', '-', '/', '*'].includes(cssUnit[i])) {
- return true;
+ for (const key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ fn.call(ctx, obj[key], key);
}
}
-
- 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.
- */
+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();
+ react_spring_shared_esm_each(items, iterator);
+ }
+}
+const flushCalls = (queue, ...args) => flush(queue, fn => fn(...args));
+const isSSR = () => typeof window === 'undefined' || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
+let createStringInterpolator$1;
+let to;
+let colors$1 = null;
+let skipAnimation = false;
+let willAdvance = noop;
+const react_spring_shared_esm_assign = globals => {
+ if (globals.to) to = globals.to;
+ if (globals.now) raf.now = globals.now;
+ if (globals.colors !== undefined) colors$1 = globals.colors;
+ if (globals.skipAnimation != null) skipAnimation = globals.skipAnimation;
+ if (globals.createStringInterpolator) createStringInterpolator$1 = globals.createStringInterpolator;
+ if (globals.requestAnimationFrame) raf.use(globals.requestAnimationFrame);
+ if (globals.batchedUpdates) raf.batchedUpdates = globals.batchedUpdates;
+ if (globals.willAdvance) willAdvance = globals.willAdvance;
+ if (globals.frameLoop) raf.frameLoop = globals.frameLoop;
+};
-function evalMathExpression(cssUnit) {
- let errorFound = false; // Convert every part of the expression to px values.
+var globals = /*#__PURE__*/Object.freeze({
+ __proto__: null,
+ get createStringInterpolator () { return createStringInterpolator$1; },
+ get to () { return to; },
+ get colors () { return colors$1; },
+ get skipAnimation () { return skipAnimation; },
+ get willAdvance () { return willAdvance; },
+ assign: react_spring_shared_esm_assign
+});
- const cssUnitsBits = cssUnit.split(/[+-/*/]/g).filter(Boolean);
+const startQueue = new Set();
+let currentFrame = [];
+let prevFrame = [];
+let priority = 0;
+const frameLoop = {
+ get idle() {
+ return !startQueue.size && !currentFrame.length;
+ },
- for (const unit of cssUnitsBits) {
- // Standardize the unit to px and extract the value.
- const parsedUnit = parseUnit(getPxFromCssUnit(unit));
+ start(animation) {
+ if (priority > animation.priority) {
+ startQueue.add(animation);
+ raf.onStart(flushStartQueue);
+ } else {
+ startSafely(animation);
+ raf(advance);
+ }
+ },
- if (!parseFloat(parsedUnit.value)) {
- errorFound = true; // end early since we are dealing with a null value.
+ advance,
- break;
+ sort(animation) {
+ if (priority) {
+ raf.onFrame(() => frameLoop.sort(animation));
+ } else {
+ const prevIndex = currentFrame.indexOf(animation);
+
+ if (~prevIndex) {
+ currentFrame.splice(prevIndex, 1);
+ startUnsafely(animation);
+ }
}
+ },
- cssUnit = cssUnit.replace(unit, parsedUnit.value);
+ clear() {
+ currentFrame = [];
+ startQueue.clear();
}
- return errorFound ? null : calculate(cssUnit).toFixed(0) + 'px';
+};
+
+function flushStartQueue() {
+ startQueue.forEach(startSafely);
+ startQueue.clear();
+ raf(advance);
}
-/**
- * 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 startSafely(animation) {
+ if (!currentFrame.includes(animation)) startUnsafely(animation);
+}
-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
- };
+function startUnsafely(animation) {
+ currentFrame.splice(findIndex(currentFrame, other => other.priority > animation.priority), 0, animation);
+}
- if (relativeUnits[parsedUnit.unit]) {
- return (relativeUnits[parsedUnit.unit] * parsedUnit.value).toFixed(0) + 'px';
+function advance(dt) {
+ const nextFrame = prevFrame;
+
+ for (let i = 0; i < currentFrame.length; i++) {
+ const animation = currentFrame[i];
+ priority = animation.priority;
+
+ if (!animation.idle) {
+ willAdvance(animation);
+ animation.advance(dt);
+
+ if (!animation.idle) {
+ nextFrame.push(animation);
+ }
+ }
}
- if (absoluteUnits[parsedUnit.unit]) {
- return (absoluteUnits[parsedUnit.unit] * parsedUnit.value).toFixed(0) + 'px';
- }
+ priority = 0;
+ prevFrame = currentFrame;
+ prevFrame.length = 0;
+ currentFrame = nextFrame;
+ return currentFrame.length > 0;
+}
+
+function findIndex(arr, test) {
+ const index = arr.findIndex(test);
+ return index < 0 ? arr.length : index;
+}
+
+const colors = {
+ transparent: 0x00000000,
+ aliceblue: 0xf0f8ffff,
+ antiquewhite: 0xfaebd7ff,
+ aqua: 0x00ffffff,
+ aquamarine: 0x7fffd4ff,
+ azure: 0xf0ffffff,
+ beige: 0xf5f5dcff,
+ bisque: 0xffe4c4ff,
+ black: 0x000000ff,
+ blanchedalmond: 0xffebcdff,
+ blue: 0x0000ffff,
+ blueviolet: 0x8a2be2ff,
+ brown: 0xa52a2aff,
+ burlywood: 0xdeb887ff,
+ burntsienna: 0xea7e5dff,
+ cadetblue: 0x5f9ea0ff,
+ chartreuse: 0x7fff00ff,
+ chocolate: 0xd2691eff,
+ coral: 0xff7f50ff,
+ cornflowerblue: 0x6495edff,
+ cornsilk: 0xfff8dcff,
+ crimson: 0xdc143cff,
+ cyan: 0x00ffffff,
+ darkblue: 0x00008bff,
+ darkcyan: 0x008b8bff,
+ darkgoldenrod: 0xb8860bff,
+ darkgray: 0xa9a9a9ff,
+ darkgreen: 0x006400ff,
+ darkgrey: 0xa9a9a9ff,
+ darkkhaki: 0xbdb76bff,
+ darkmagenta: 0x8b008bff,
+ darkolivegreen: 0x556b2fff,
+ darkorange: 0xff8c00ff,
+ darkorchid: 0x9932ccff,
+ darkred: 0x8b0000ff,
+ darksalmon: 0xe9967aff,
+ darkseagreen: 0x8fbc8fff,
+ darkslateblue: 0x483d8bff,
+ darkslategray: 0x2f4f4fff,
+ darkslategrey: 0x2f4f4fff,
+ darkturquoise: 0x00ced1ff,
+ darkviolet: 0x9400d3ff,
+ deeppink: 0xff1493ff,
+ deepskyblue: 0x00bfffff,
+ dimgray: 0x696969ff,
+ dimgrey: 0x696969ff,
+ dodgerblue: 0x1e90ffff,
+ firebrick: 0xb22222ff,
+ floralwhite: 0xfffaf0ff,
+ forestgreen: 0x228b22ff,
+ fuchsia: 0xff00ffff,
+ gainsboro: 0xdcdcdcff,
+ ghostwhite: 0xf8f8ffff,
+ gold: 0xffd700ff,
+ goldenrod: 0xdaa520ff,
+ gray: 0x808080ff,
+ green: 0x008000ff,
+ greenyellow: 0xadff2fff,
+ grey: 0x808080ff,
+ honeydew: 0xf0fff0ff,
+ hotpink: 0xff69b4ff,
+ indianred: 0xcd5c5cff,
+ indigo: 0x4b0082ff,
+ ivory: 0xfffff0ff,
+ khaki: 0xf0e68cff,
+ lavender: 0xe6e6faff,
+ lavenderblush: 0xfff0f5ff,
+ lawngreen: 0x7cfc00ff,
+ lemonchiffon: 0xfffacdff,
+ lightblue: 0xadd8e6ff,
+ lightcoral: 0xf08080ff,
+ lightcyan: 0xe0ffffff,
+ lightgoldenrodyellow: 0xfafad2ff,
+ lightgray: 0xd3d3d3ff,
+ lightgreen: 0x90ee90ff,
+ lightgrey: 0xd3d3d3ff,
+ lightpink: 0xffb6c1ff,
+ lightsalmon: 0xffa07aff,
+ lightseagreen: 0x20b2aaff,
+ lightskyblue: 0x87cefaff,
+ lightslategray: 0x778899ff,
+ lightslategrey: 0x778899ff,
+ lightsteelblue: 0xb0c4deff,
+ lightyellow: 0xffffe0ff,
+ lime: 0x00ff00ff,
+ limegreen: 0x32cd32ff,
+ linen: 0xfaf0e6ff,
+ magenta: 0xff00ffff,
+ maroon: 0x800000ff,
+ mediumaquamarine: 0x66cdaaff,
+ mediumblue: 0x0000cdff,
+ mediumorchid: 0xba55d3ff,
+ mediumpurple: 0x9370dbff,
+ mediumseagreen: 0x3cb371ff,
+ mediumslateblue: 0x7b68eeff,
+ mediumspringgreen: 0x00fa9aff,
+ mediumturquoise: 0x48d1ccff,
+ mediumvioletred: 0xc71585ff,
+ midnightblue: 0x191970ff,
+ mintcream: 0xf5fffaff,
+ mistyrose: 0xffe4e1ff,
+ moccasin: 0xffe4b5ff,
+ navajowhite: 0xffdeadff,
+ navy: 0x000080ff,
+ oldlace: 0xfdf5e6ff,
+ olive: 0x808000ff,
+ olivedrab: 0x6b8e23ff,
+ orange: 0xffa500ff,
+ orangered: 0xff4500ff,
+ orchid: 0xda70d6ff,
+ palegoldenrod: 0xeee8aaff,
+ palegreen: 0x98fb98ff,
+ paleturquoise: 0xafeeeeff,
+ palevioletred: 0xdb7093ff,
+ papayawhip: 0xffefd5ff,
+ peachpuff: 0xffdab9ff,
+ peru: 0xcd853fff,
+ pink: 0xffc0cbff,
+ plum: 0xdda0ddff,
+ powderblue: 0xb0e0e6ff,
+ purple: 0x800080ff,
+ rebeccapurple: 0x663399ff,
+ red: 0xff0000ff,
+ rosybrown: 0xbc8f8fff,
+ royalblue: 0x4169e1ff,
+ saddlebrown: 0x8b4513ff,
+ salmon: 0xfa8072ff,
+ sandybrown: 0xf4a460ff,
+ seagreen: 0x2e8b57ff,
+ seashell: 0xfff5eeff,
+ sienna: 0xa0522dff,
+ silver: 0xc0c0c0ff,
+ skyblue: 0x87ceebff,
+ slateblue: 0x6a5acdff,
+ slategray: 0x708090ff,
+ slategrey: 0x708090ff,
+ snow: 0xfffafaff,
+ springgreen: 0x00ff7fff,
+ steelblue: 0x4682b4ff,
+ tan: 0xd2b48cff,
+ teal: 0x008080ff,
+ thistle: 0xd8bfd8ff,
+ tomato: 0xff6347ff,
+ turquoise: 0x40e0d0ff,
+ violet: 0xee82eeff,
+ wheat: 0xf5deb3ff,
+ white: 0xffffffff,
+ whitesmoke: 0xf5f5f5ff,
+ yellow: 0xffff00ff,
+ yellowgreen: 0x9acd32ff
+};
+
+const NUMBER = '[-+]?\\d*\\.?\\d+';
+const PERCENTAGE = NUMBER + '%';
- return null;
+function call(...parts) {
+ return '\\(\\s*(' + parts.join(')\\s*,\\s*(') + ')\\s*\\)';
}
-/**
- * Returns the px value of a cssUnit.
- *
- * @param {string} cssUnit
- * @param {Object} options
- * @return {string} returns the cssUnit value in a simple px format.
- */
+const rgb = new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER));
+const rgba = new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER));
+const hsl = new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE));
+const hsla = new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER));
+const hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
+const hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
+const hex6 = /^#([0-9a-fA-F]{6})$/;
+const hex8 = /^#([0-9a-fA-F]{8})$/;
-function getPxFromCssUnit(cssUnit) {
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-
- if (Number.isFinite(cssUnit)) {
- return cssUnit.toFixed(0) + 'px';
- }
+function normalizeColor(color) {
+ let match;
- if (cssUnit === undefined) {
- return null;
+ if (typeof color === 'number') {
+ return color >>> 0 === color && color >= 0 && color <= 0xffffffff ? color : null;
}
- let parsedUnit = parseUnit(cssUnit);
+ if (match = hex6.exec(color)) return parseInt(match[1] + 'ff', 16) >>> 0;
- if (!parsedUnit.unit) {
- parsedUnit = parseUnitFunction(cssUnit, options);
+ if (colors$1 && colors$1[color] !== undefined) {
+ return colors$1[color];
}
- if (isMathExpression(cssUnit) && !parsedUnit.unit) {
- return evalMathExpression(cssUnit);
+ if (match = rgb.exec(color)) {
+ return (parse255(match[1]) << 24 | parse255(match[2]) << 16 | parse255(match[3]) << 8 | 0x000000ff) >>> 0;
}
- 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);
+ if (match = rgba.exec(color)) {
+ return (parse255(match[1]) << 24 | parse255(match[2]) << 16 | parse255(match[3]) << 8 | parse1(match[4])) >>> 0;
}
- return cache[hash];
-}
-
-function hashOptions(options) {
- let hash = '';
-
- if (options.hasOwnProperty('fontSize')) {
- hash = ':' + options.width;
+ if (match = hex3.exec(color)) {
+ return parseInt(match[1] + match[1] + match[2] + match[2] + match[3] + match[3] + 'ff', 16) >>> 0;
}
- if (options.hasOwnProperty('lineHeight')) {
- hash = ':' + options.lineHeight;
- }
+ if (match = hex8.exec(color)) return parseInt(match[1], 16) >>> 0;
- if (options.hasOwnProperty('width')) {
- hash = ':' + options.width;
+ if (match = hex4.exec(color)) {
+ return parseInt(match[1] + match[1] + match[2] + match[2] + match[3] + match[3] + match[4] + match[4], 16) >>> 0;
}
- if (options.hasOwnProperty('height')) {
- hash = ':' + options.height;
+ if (match = hsl.exec(color)) {
+ return (hslToRgb(parse360(match[1]), parsePercentage(match[2]), parsePercentage(match[3])) | 0x000000ff) >>> 0;
}
- if (options.hasOwnProperty('type')) {
- hash = ':' + options.type;
+ if (match = hsla.exec(color)) {
+ return (hslToRgb(parse360(match[1]), parsePercentage(match[2]), parsePercentage(match[3])) | parse1(match[4])) >>> 0;
}
- return hash;
+ return null;
}
-/* 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)];
+function hue2rgb(p, q, t) {
+ if (t < 0) t += 1;
+ if (t > 1) t -= 1;
+ if (t < 1 / 6) return p + (q - p) * 6 * t;
+ if (t < 1 / 2) return q;
+ if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
+ return p;
}
-/**
- * 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);
+function hslToRgb(h, s, l) {
+ const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
+ const p = 2 * l - q;
+ const r = hue2rgb(p, q, h + 1 / 3);
+ const g = hue2rgb(p, q, h);
+ const b = hue2rgb(p, q, h - 1 / 3);
+ return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
}
-// 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 parse255(str) {
+ const int = parseInt(str, 10);
+ if (int < 0) return 0;
+ if (int > 255) return 255;
+ return int;
+}
-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;
+function parse360(str) {
+ const int = parseFloat(str);
+ return (int % 360 + 360) % 360 / 360;
}
-/**
- * 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 parse1(str) {
+ const num = parseFloat(str);
+ if (num < 0) return 0;
+ if (num > 1) return 255;
+ return Math.round(num * 255);
+}
-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)), {});
+function parsePercentage(str) {
+ const int = parseFloat(str);
+ if (int < 0) return 0;
+ if (int > 100) return 1;
+ return int / 100;
}
-/**
- * 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 colorToRgba(input) {
+ let int32Color = normalizeColor(input);
+ if (int32Color === null) return input;
+ int32Color = int32Color || 0;
+ let r = (int32Color & 0xff000000) >>> 24;
+ let g = (int32Color & 0x00ff0000) >>> 16;
+ let b = (int32Color & 0x0000ff00) >>> 8;
+ let a = (int32Color & 0x000000ff) / 255;
+ return `rgba(${r}, ${g}, ${b}, ${a})`;
+}
-function flattenBlocks(blocks) {
- let transform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : external_lodash_["identity"];
- const result = {};
- const stack = [...blocks];
+const createInterpolator = (range, output, extrapolate) => {
+ if (react_spring_shared_esm_is.fun(range)) {
+ return range;
+ }
- while (stack.length) {
- const {
- innerBlocks,
- ...block
- } = stack.shift();
- stack.push(...innerBlocks);
- result[block.clientId] = transform(block);
+ if (react_spring_shared_esm_is.arr(range)) {
+ return createInterpolator({
+ range,
+ output: output,
+ extrapolate
+ });
}
- 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.
- */
+ if (react_spring_shared_esm_is.str(range.output[0])) {
+ return createStringInterpolator$1(range);
+ }
+ const config = range;
+ const outputRange = config.output;
+ const inputRange = config.range || [0, 1];
+ const extrapolateLeft = config.extrapolateLeft || config.extrapolate || 'extend';
+ const extrapolateRight = config.extrapolateRight || config.extrapolate || 'extend';
-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.
- */
+ const easing = config.easing || (t => t);
+ return input => {
+ const range = findRange(input, inputRange);
+ return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight, config.map);
+ };
+};
-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 interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight, map) {
+ let result = map ? map(input) : input;
+ if (result < inputMin) {
+ if (extrapolateLeft === 'identity') return result;else if (extrapolateLeft === 'clamp') result = inputMin;
+ }
-function getMutateSafeObject(original, working) {
- if (original === working) {
- return { ...original
- };
+ if (result > inputMax) {
+ if (extrapolateRight === 'identity') return result;else if (extrapolateRight === 'clamp') result = inputMax;
}
- return working;
+ if (outputMin === outputMax) return outputMin;
+ if (inputMin === inputMax) return input <= inputMin ? outputMin : outputMax;
+ if (inputMin === -Infinity) result = -result;else if (inputMax === Infinity) result = result - inputMin;else result = (result - inputMin) / (inputMax - inputMin);
+ result = easing(result);
+ if (outputMin === -Infinity) result = -result;else if (outputMax === Infinity) result = result + outputMin;else result = result * (outputMax - outputMin) + outputMin;
+ return result;
}
-/**
- * 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 findRange(input, inputRange) {
+ for (var i = 1; i < inputRange.length - 1; ++i) if (inputRange[i] >= input) break;
-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);
+ return i - 1;
}
-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.
-
+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];
- for (const block of flattenedBlocks) {
- result[block.clientId] = {};
- }
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }
- 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 target;
+ };
- return result;
+ return react_spring_shared_esm_extends.apply(this, arguments);
}
-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];
+const $get = Symbol.for('FluidValue.get');
+const $observers = Symbol.for('FluidValue.observers');
- 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.
+const hasFluidValue = arg => Boolean(arg && arg[$get]);
+const getFluidValue = arg => arg && arg[$get] ? arg[$get]() : arg;
- for (const clientId of uncontrolledParents) {
- tree[clientId] = { ...tree[clientId]
- };
- }
+const getFluidObservers = target => target[$observers] || null;
- 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 ).
+function callFluidObserver(observer, event) {
+ if (observer.eventObserved) {
+ observer.eventObserved(event);
+ } else {
+ observer(event);
+ }
+}
+function callFluidObservers(target, event) {
+ let observers = target[$observers];
- for (const clientId of controlledParents) {
- tree['controlled||' + clientId] = {
- innerBlocks: (state.order[clientId] || []).map(subClientId => tree[subClientId])
- };
+ if (observers) {
+ observers.forEach(observer => {
+ callFluidObserver(observer, event);
+ });
}
-
- 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.
- */
+class FluidValue {
+ constructor(get) {
+ this[$get] = void 0;
+ this[$observers] = void 0;
-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 (!get && !(get = this.get)) {
+ throw Error('Unknown getter');
+ }
- if (newState === state) {
- return state;
+ setFluidGetter(this, get);
}
- 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;
- }
+const setFluidGetter = (target, get) => setHidden(target, $get, get);
- 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;
+function addFluidObserver(target, observer) {
+ if (target[$get]) {
+ let observers = target[$observers];
- 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;
- }
+ if (!observers) {
+ setHidden(target, $observers, observers = new Set());
+ }
- 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.
+ if (!observers.has(observer)) {
+ observers.add(observer);
- const parentsOfRemovedBlocks = [];
+ if (target.observerAdded) {
+ target.observerAdded(observers.size, observer);
+ }
+ }
+ }
- for (const clientId of action.clientIds) {
- if (state.parents[clientId] !== undefined && (state.parents[clientId] === '' || newState.byClientId[state.parents[clientId]])) {
- parentsOfRemovedBlocks.push(state.parents[clientId]);
- }
- }
+ return observer;
+}
- newState.tree = updateParentInnerBlocksInTree(newState, newState.tree, parentsOfRemovedBlocks, true);
- break;
- }
+function removeFluidObserver(target, observer) {
+ let observers = target[$observers];
- case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN':
- const parentsOfRemovedBlocks = [];
+ if (observers && observers.has(observer)) {
+ const count = observers.size - 1;
- for (const clientId of action.clientIds) {
- if (state.parents[clientId] !== undefined && (state.parents[clientId] === '' || newState.byClientId[state.parents[clientId]])) {
- parentsOfRemovedBlocks.push(state.parents[clientId]);
- }
- }
+ if (count) {
+ observers.delete(observer);
+ } else {
+ target[$observers] = null;
+ }
- newState.tree = updateParentInnerBlocksInTree(newState, Object(external_lodash_["omit"])(newState.tree, action.removedClientIds.concat(action.removedClientIds.map(clientId => 'controlled||' + clientId))), parentsOfRemovedBlocks, true);
- break;
+ if (target.observerRemoved) {
+ target.observerRemoved(count, observer);
+ }
+ }
+}
- case 'MOVE_BLOCKS_TO_POSITION':
- {
- const updatedBlockUids = [];
+const setHidden = (target, key, value) => Object.defineProperty(target, key, {
+ value,
+ writable: true,
+ configurable: true
+});
- if (action.fromRootClientId) {
- updatedBlockUids.push(action.fromRootClientId);
- }
+const numberRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
+const colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;
+const unitRegex = new RegExp(`(${numberRegex.source})(%|[a-z]+)`, 'i');
+const rgbaRegex = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi;
+const cssVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;
- if (action.toRootClientId) {
- updatedBlockUids.push(action.toRootClientId);
- }
+const variableToRgba = input => {
+ const [token, fallback] = parseCSSVariable(input);
- if (!action.fromRootClientId || !action.fromRootClientId) {
- updatedBlockUids.push('');
- }
+ if (!token || isSSR()) {
+ return input;
+ }
- newState.tree = updateParentInnerBlocksInTree(newState, newState.tree, updatedBlockUids, true);
- break;
- }
+ const value = window.getComputedStyle(document.documentElement).getPropertyValue(token);
- case 'MOVE_BLOCKS_UP':
- case 'MOVE_BLOCKS_DOWN':
- {
- const updatedBlockUids = [action.rootClientId ? action.rootClientId : ''];
- newState.tree = updateParentInnerBlocksInTree(newState, newState.tree, updatedBlockUids, true);
- break;
- }
+ if (value) {
+ return value.trim();
+ } else if (fallback && fallback.startsWith('--')) {
+ const _value = window.getComputedStyle(document.documentElement).getPropertyValue(fallback);
- 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);
- }
+ if (_value) {
+ return _value;
+ } else {
+ return input;
+ }
+ } else if (fallback && cssVariableRegex.test(fallback)) {
+ return variableToRgba(fallback);
+ } else if (fallback) {
+ return fallback;
}
- return newState;
+ return input;
};
-/**
- * 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.
- */
+const parseCSSVariable = current => {
+ const match = cssVariableRegex.exec(current);
+ if (!match) return [,];
+ const [, token, fallback] = match;
+ return [token, fallback];
+};
-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.
+let namedColorRegex;
- if (state === nextState && !isExplicitPersistentChange) {
- var _state$isPersistentCh;
+const rgbaRound = (_, p1, p2, p3, p4) => `rgba(${Math.round(p1)}, ${Math.round(p2)}, ${Math.round(p3)}, ${p4})`;
- 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;
+const createStringInterpolator = config => {
+ if (!namedColorRegex) namedColorRegex = colors$1 ? new RegExp(`(${Object.keys(colors$1).join('|')})(?!\\w)`, 'g') : /^\b$/;
+ const output = config.output.map(value => {
+ return getFluidValue(value).replace(cssVariableRegex, variableToRgba).replace(colorRegex, colorToRgba).replace(namedColorRegex, colorToRgba);
+ });
+ const keyframes = output.map(value => value.match(numberRegex).map(Number));
+ const outputRanges = keyframes[0].map((_, i) => keyframes.map(values => {
+ if (!(i in values)) {
+ throw Error('The arity of each "output" value must be equal');
+ }
- if (state.isPersistentChange === nextIsPersistentChange) {
- return state;
- }
+ return values[i];
+ }));
+ const interpolators = outputRanges.map(output => createInterpolator(react_spring_shared_esm_extends({}, config, {
+ output
+ })));
+ return input => {
+ var _output$find;
- return { ...nextState,
- isPersistentChange: nextIsPersistentChange
- };
- }
+ const missingUnit = !unitRegex.test(output[0]) && ((_output$find = output.find(value => unitRegex.test(value))) == null ? void 0 : _output$find.replace(numberRegex, ''));
+ let i = 0;
+ return output[0].replace(numberRegex, () => `${interpolators[i++](input)}${missingUnit || ''}`).replace(rgbaRegex, rgbaRound);
+ };
+};
- 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.
+const prefix = 'react-spring: ';
- lastAction = action;
- markNextChangeAsNotPersistent = action.type === 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT';
- return nextState;
+const once = fn => {
+ const func = fn;
+ let called = false;
+
+ if (typeof func != 'function') {
+ throw new TypeError(`${prefix}once requires a function parameter`);
+ }
+
+ return (...args) => {
+ if (!called) {
+ func(...args);
+ called = true;
+ }
};
+};
+
+const warnInterpolate = once(console.warn);
+function react_spring_shared_esm_deprecateInterpolate() {
+ warnInterpolate(`${prefix}The "interpolate" function is deprecated in v9 (use "to" instead)`);
+}
+const warnDirectCall = once(console.warn);
+function deprecateDirectCall() {
+ warnDirectCall(`${prefix}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`);
}
-/**
- * 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 isAnimatedString(value) {
+ return react_spring_shared_esm_is.str(value) && (value[0] == '#' || /\d/.test(value) || !isSSR() && cssVariableRegex.test(value) || value in (colors$1 || {}));
+}
-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);
+const react_spring_shared_esm_useOnce = effect => (0,external_React_.useEffect)(effect, emptyDeps);
+const emptyDeps = [];
- if (nextState !== state) {
- nextState.isIgnoredChange = IGNORED_ACTION_TYPES.has(action.type);
+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({});
}
+ };
+}
- return nextState;
+function makeMountedRef() {
+ const mounted = {
+ current: true,
+ unmount: () => () => {
+ mounted.current = false;
+ }
};
+ return mounted;
}
-/**
- * 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.
- */
+function useMemoOne(getResult, inputs) {
+ const [initial] = (0,external_React_.useState)(() => ({
+ inputs,
+ result: getResult()
+ }));
+ const committed = (0,external_React_.useRef)();
+ const prevCache = committed.current;
+ let cache = prevCache;
-const withInnerBlocksRemoveCascade = reducer => (state, action) => {
- // Gets all children which need to be removed.
- const getAllChildren = clientIds => {
- let result = clientIds;
+ if (cache) {
+ const useCache = Boolean(inputs && cache.inputs && areInputsEqual(inputs, cache.inputs));
- for (let i = 0; i < result.length; i++) {
- if (!state.order[result[i]] || action.keepControlledInnerBlocks && action.keepControlledInnerBlocks[result[i]]) {
- continue;
- }
+ if (!useCache) {
+ cache = {
+ inputs,
+ result: getResult()
+ };
+ }
+ } else {
+ cache = initial;
+ }
- if (result === clientIds) {
- result = [...result];
- }
+ (0,external_React_.useEffect)(() => {
+ committed.current = cache;
- result.push(...state.order[result[i]]);
+ if (prevCache == initial) {
+ initial.inputs = initial.result = undefined;
}
+ }, [cache]);
+ return cache.result;
+}
- return result;
- };
-
- if (state) {
- switch (action.type) {
- case 'REMOVE_BLOCKS':
- action = { ...action,
- type: 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN',
- removedClientIds: getAllChildren(action.clientIds)
- };
- break;
+function areInputsEqual(next, prev) {
+ if (next.length !== prev.length) {
+ return false;
+ }
- case 'REPLACE_BLOCKS':
- action = { ...action,
- type: 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN',
- replacedClientIds: getAllChildren(action.clientIds)
- };
- break;
+ for (let i = 0; i < next.length; i++) {
+ if (next[i] !== prev[i]) {
+ return false;
}
}
- 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.
- */
+ return true;
+}
+function react_spring_shared_esm_usePrev(value) {
+ const prevRef = (0,external_React_.useRef)();
+ (0,external_React_.useEffect)(() => {
+ prevRef.current = value;
+ });
+ return prevRef.current;
+}
-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;
- }
+const react_spring_shared_esm_useLayoutEffect = typeof window !== 'undefined' && window.document && window.document.createElement ? external_React_.useLayoutEffect : external_React_.useEffect;
- 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.
+;// CONCATENATED MODULE: ./node_modules/@react-spring/animated/dist/react-spring-animated.esm.js
- const nestedControllers = {};
- if (Object.keys(state.controlledInnerBlocks).length) {
- const stack = [...action.blocks];
- while (stack.length) {
- const {
- innerBlocks,
- ...block
- } = stack.shift();
- stack.push(...innerBlocks);
+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);
+ }
- 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.
+ getPayload() {
+ return this.payload || [];
+ }
+}
- let stateAfterBlocksRemoval = state;
+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 (state.order[action.rootClientId]) {
- stateAfterBlocksRemoval = reducer(stateAfterBlocksRemoval, {
- type: 'REMOVE_BLOCKS',
- keepControlledInnerBlocks: nestedControllers,
- clientIds: state.order[action.rootClientId]
- });
+ if (react_spring_shared_esm_is.num(this._value)) {
+ this.lastPosition = this._value;
+ }
}
- 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..
+ static create(value) {
+ return new AnimatedValue(value);
+ }
- stateAfterInsert.order = { ...stateAfterInsert.order,
- ...Object(external_lodash_["reduce"])(nestedControllers, (result, value, key) => {
- if (state.order[key]) {
- result[key] = state.order[key];
- }
+ getPayload() {
+ return [this];
+ }
- return result;
- }, {})
- };
+ getValue() {
+ return this._value;
}
- 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.
- */
+ setValue(value, step) {
+ if (react_spring_shared_esm_is.num(value)) {
+ this.lastPosition = value;
+ if (step) {
+ value = Math.round(value / step) * step;
-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 (this.done) {
+ this.lastPosition = value;
+ }
+ }
+ }
- if (id === updatedId) {
- return state;
+ if (this._value === value) {
+ return false;
}
- state = { ...state
- };
- state.attributes = Object(external_lodash_["mapValues"])(state.attributes, (attributes, clientId) => {
- const {
- name
- } = state.byClientId[clientId];
+ this._value = value;
+ return true;
+ }
- if (name === 'core/block' && attributes.ref === id) {
- return { ...attributes,
- ref: updatedId
- };
- }
+ reset() {
+ const {
+ done
+ } = this;
+ this.done = false;
- return attributes;
- });
+ 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;
+ }
}
- 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: []
+class AnimatedString extends AnimatedValue {
+ constructor(value) {
+ super(0);
+ this._string = null;
+ this._toString = void 0;
+ this._toString = createInterpolator({
+ output: [value, value]
});
- 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;
+ static create(value) {
+ return new AnimatedString(value);
+ }
- switch (action.type) {
- case 'RECEIVE_BLOCKS':
- case 'INSERT_BLOCKS':
- return { ...state,
- ...getFlattenedBlocksWithoutAttributes(action.blocks)
- };
+ getValue() {
+ let value = this._string;
+ return value == null ? this._string = this._toString(this._value) : value;
+ }
- case 'UPDATE_BLOCK':
- // Ignore updates if block isn't known
- if (!state[action.clientId]) {
- return state;
- } // Do nothing if only attributes change.
+ 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;
+ }
- const changes = Object(external_lodash_["omit"])(action.updates, 'attributes');
+ return true;
+ }
- if (Object(external_lodash_["isEmpty"])(changes)) {
- return state;
- }
+ reset(goal) {
+ if (goal) {
+ this._toString = createInterpolator({
+ output: [this.getValue(), goal]
+ });
+ }
- return { ...state,
- [action.clientId]: { ...state[action.clientId],
- ...changes
- }
- };
+ this._value = 0;
+ super.reset();
+ }
- case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN':
- if (!action.blocks) {
- return state;
- }
+}
- return { ...Object(external_lodash_["omit"])(state, action.replacedClientIds),
- ...getFlattenedBlocksWithoutAttributes(action.blocks)
- };
+const TreeContext = {
+ dependencies: null
+};
- case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN':
- return Object(external_lodash_["omit"])(state, action.removedClientIds);
- }
+class AnimatedObject extends Animated {
+ constructor(source) {
+ super();
+ this.source = source;
+ this.setValue(source);
+ }
- return state;
- },
+ 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;
+ }
- attributes() {
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- let action = arguments.length > 1 ? arguments[1] : undefined;
+ setValue(source) {
+ this.source = source;
+ this.payload = this._makePayload(source);
+ }
- switch (action.type) {
- case 'RECEIVE_BLOCKS':
- case 'INSERT_BLOCKS':
- return { ...state,
- ...getFlattenedBlockAttributes(action.blocks)
- };
+ reset() {
+ if (this.payload) {
+ react_spring_shared_esm_each(this.payload, node => node.reset());
+ }
+ }
- 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;
- }
+ _makePayload(source) {
+ if (source) {
+ const payload = new Set();
+ eachProp(source, this._addToPayload, payload);
+ return Array.from(payload);
+ }
+ }
- return { ...state,
- [action.clientId]: { ...state[action.clientId],
- ...action.updates.attributes
- }
- };
+ _addToPayload(source) {
+ if (TreeContext.dependencies && hasFluidValue(source)) {
+ TreeContext.dependencies.add(source);
+ }
- 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 payload = getPayload(source);
- 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;
- }
+ if (payload) {
+ react_spring_shared_esm_each(payload, node => this.add(node));
+ }
+ }
- return result;
- }, state[id])
- }), {});
+}
- if (action.clientIds.every(id => next[id] === state[id])) {
- return state;
- }
+class AnimatedArray extends AnimatedObject {
+ constructor(source) {
+ super(source);
+ }
- return { ...state,
- ...next
- };
- }
+ static create(source) {
+ return new AnimatedArray(source);
+ }
- case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN':
- if (!action.blocks) {
- return state;
- }
+ getValue() {
+ return this.source.map(node => node.getValue());
+ }
- return { ...Object(external_lodash_["omit"])(state, action.replacedClientIds),
- ...getFlattenedBlockAttributes(action.blocks)
- };
+ setValue(source) {
+ const payload = this.getPayload();
- case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN':
- return Object(external_lodash_["omit"])(state, action.removedClientIds);
+ if (source.length == payload.length) {
+ return payload.map((node, i) => node.setValue(source[i])).some(Boolean);
}
- 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[''])
- };
- }
+ super.setValue(source.map(makeAnimated));
+ return true;
+ }
- 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
+function makeAnimated(value) {
+ const nodeType = isAnimatedString(value) ? AnimatedString : AnimatedValue;
+ return nodeType.create(value);
+}
- 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
+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];
- return { ...state,
- [fromRootClientId]: Object(external_lodash_["without"])(state[fromRootClientId], ...clientIds),
- [toRootClientId]: insertAt(state[toRootClientId], clientIds, index)
- };
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
}
+ }
+ }
- 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;
- }
+ return target;
+ };
- const firstIndex = subState.indexOf(firstClientId);
- return { ...state,
- [rootClientId]: moveTo(subState, firstIndex, firstIndex - 1, clientIds.length)
- };
- }
+ return react_spring_animated_esm_extends.apply(this, arguments);
+}
- 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];
+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();
- if (!subState.length || lastClientId === Object(external_lodash_["last"])(subState)) {
- return state;
- }
+ const callback = () => {
+ const instance = instanceRef.current;
- const firstIndex = subState.indexOf(firstClientId);
- return { ...state,
- [rootClientId]: moveTo(subState, firstIndex, firstIndex + 1, clientIds.length)
- };
- }
+ if (hasInstance && !instance) {
+ return;
+ }
- case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN':
- {
- const {
- clientIds
- } = action;
+ const didUpdate = instance ? host.applyAnimatedValues(instance, props.getValue(true)) : false;
- if (!action.blocks) {
- return state;
- }
+ if (didUpdate === false) {
+ forceUpdate();
+ }
+ };
- 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['']];
- }
+ 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 (clientIds.indexOf(clientId) === -1) {
- result.push(clientId);
- }
+ 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
+ }));
+ });
+};
- return result;
- }, []))])(state);
- }
+class PropsObserver {
+ constructor(update, deps) {
+ this.update = update;
+ this.deps = deps;
+ }
- 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);
+ eventObserved(event) {
+ if (event.type == 'change') {
+ raf.write(this.update);
}
+ }
- 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;
+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];
+}
- switch (action.type) {
- case 'RECEIVE_BLOCKS':
- return { ...state,
- ...mapBlockParents(action.blocks)
- };
+function updateRef(ref, value) {
+ if (ref) {
+ if (react_spring_shared_esm_is.fun(ref)) ref(value);else ref.current = value;
+ }
- case 'INSERT_BLOCKS':
- return { ...state,
- ...mapBlockParents(action.blocks, action.rootClientId || '')
- };
+ return value;
+}
- case 'MOVE_BLOCKS_TO_POSITION':
- {
- return { ...state,
- ...action.clientIds.reduce((accumulator, id) => {
- accumulator[id] = action.toRootClientId || '';
- return accumulator;
- }, {})
- };
- }
+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
+ };
- case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN':
- return { ...Object(external_lodash_["omit"])(state, action.replacedClientIds),
- ...mapBlockParents(action.blocks, state[action.clientIds[0]])
- };
+ const animated = Component => {
+ const displayName = getDisplayName(Component) || 'Anonymous';
- case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN':
- return Object(external_lodash_["omit"])(state, action.removedClientIds);
+ 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));
}
- return state;
- },
-
- controlledInnerBlocks() {
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- let {
- type,
- clientId,
- hasControlledInnerBlocks
- } = arguments.length > 1 ? arguments[1] : undefined;
+ Component.displayName = `Animated(${displayName})`;
+ return Component;
+ };
- if (type === 'SET_HAS_CONTROLLED_INNER_BLOCKS') {
- return { ...state,
- [clientId]: hasControlledInnerBlocks
- };
+ eachProp(components, (Component, key) => {
+ if (react_spring_shared_esm_is.arr(components)) {
+ key = getDisplayName(Component);
}
- 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;
+ animated[key] = animated(Component);
+ });
+ return {
+ animated
+ };
+};
- switch (action.type) {
- case 'START_TYPING':
- return true;
+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;
- 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;
+;// CONCATENATED MODULE: ./node_modules/@react-spring/core/dist/react-spring-core.esm.js
- 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;
+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];
- switch (action.type) {
- case 'CLEAR_SELECTED_BLOCK':
- {
- if (state.clientId) {
- return {};
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
}
-
- return state;
}
+ }
- case 'SELECT_BLOCK':
- if (action.clientId === state.clientId) {
- return state;
- }
+ return target;
+ };
- return {
- clientId: action.clientId
- };
+ return react_spring_core_esm_extends.apply(this, arguments);
+}
- case 'REPLACE_INNER_BLOCKS':
- case 'INSERT_BLOCKS':
- {
- if (!action.updateSelection || !action.blocks.length) {
- return state;
- }
+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;
- return {
- clientId: action.blocks[0].clientId
- };
- }
+const noopTransform = value => value;
- case 'REMOVE_BLOCKS':
- if (!action.clientIds || !action.clientIds.length || action.clientIds.indexOf(state.clientId) === -1) {
- return state;
- }
+const getDefaultProps = (props, transform = noopTransform) => {
+ let keys = DEFAULT_PROPS;
- return {};
+ if (props.default && props.default !== true) {
+ props = props.default;
+ keys = Object.keys(props);
+ }
- case 'REPLACE_BLOCKS':
- {
- if (action.clientIds.indexOf(state.clientId) === -1) {
- return state;
- }
+ const defaults = {};
- const blockToSelect = action.blocks[action.indexToSelect] || action.blocks[action.blocks.length - 1];
+ for (const key of keys) {
+ const value = transform(props[key], key);
- if (!blockToSelect) {
- return {};
- }
+ if (!react_spring_shared_esm_is.und(value)) {
+ defaults[key] = value;
+ }
+ }
- if (blockToSelect.clientId === state.clientId) {
- return state;
- }
+ 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
+};
- return {
- clientId: blockToSelect.clientId
- };
- }
+function getForwardProps(props) {
+ const forward = {};
+ let count = 0;
+ eachProp(props, (value, prop) => {
+ if (!RESERVED_PROPS[prop]) {
+ forward[prop] = value;
+ count++;
+ }
+ });
+
+ if (count) {
+ return forward;
}
+}
- return state;
+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);
}
-/**
- * Reducer returning the selection state.
- *
- * @param {boolean} state Current state.
- * @param {Object} action Dispatched action.
- *
- * @return {boolean} Updated state.
- */
+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;
-function selection() {
- var _state$selectionStart, _state$selectionEnd;
+ (_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;
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- let action = arguments.length > 1 ? arguments[1] : undefined;
+ (_ctrl$ref2 = ctrl.ref) == null ? void 0 : _ctrl$ref2.delete(ctrl);
+ ref.add(ctrl);
+ ctrl.ref = ref;
+ }
+}
- 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
- }
- };
+function useChain(refs, timeSteps, timeFrame = 1000) {
+ useLayoutEffect(() => {
+ if (timeSteps) {
+ let prevDelay = 0;
+ each(refs, (ref, i) => {
+ const controllers = ref.current;
- case 'RESET_SELECTION':
- const {
- selectionStart,
- selectionEnd
- } = action;
- return {
- selectionStart,
- selectionEnd
- };
+ 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;
- case 'MULTI_SELECT':
- const {
- start,
- end
- } = action;
- return {
- selectionStart: {
- clientId: start
- },
- selectionEnd: {
- clientId: end
+ props.delay = key => delay + callProp(memoizedDelayProp || 0, key);
+ });
+ });
+ ref.start();
}
- };
+ });
+ } else {
+ let p = Promise.resolve();
+ each(refs, ref => {
+ const controllers = ref.current;
- 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 (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());
+ });
+ }
+ });
+ }
+ });
+}
- if (!startClientId && !endClientId) {
- return state;
- } // If the start of the selection won't exist after reset, remove selection.
+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 (!action.blocks.some(block => block.clientId === startClientId)) {
- return {
- selectionStart: {},
- selectionEnd: {}
- };
- } // If the end of the selection won't exist after reset, collapse selection.
+ 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
+};
- if (!action.blocks.some(block => block.clientId === endClientId)) {
- return { ...state,
- selectionEnd: state.selectionStart
- };
- }
+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);
}
- 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;
+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);
+ }
- switch (action.type) {
- case 'START_MULTI_SELECT':
- return true;
+ sanitizeConfig(config, newConfig);
+ Object.assign(config, newConfig);
- case 'STOP_MULTI_SELECT':
- return false;
+ for (const key in defaults) {
+ if (config[key] == null) {
+ config[key] = defaults[key];
+ }
}
- 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;
+ let {
+ mass,
+ frequency,
+ damping
+ } = config;
- switch (action.type) {
- case 'TOGGLE_SELECTION':
- return action.isSelectionEnabled;
+ 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 state;
+ return config;
}
-/**
- * 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;
+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 (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;
- }
+ 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;
+ }
- return state;
+ if (isTensionConfig) {
+ config.frequency = undefined;
+ }
+ }
}
-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'
- };
+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;
}
- 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;
+function scheduleProps(callId, {
+ key,
+ props,
+ defaultProps,
+ state,
+ actions
+}) {
+ return new Promise((resolve, reject) => {
+ var _props$cancel;
- switch (action.type) {
- case 'SHOW_INSERTION_POINT':
- const {
- rootClientId,
- index,
- __unstableWithInserter
- } = action;
- return {
- rootClientId,
- index,
- __unstableWithInserter
- };
+ let delay;
+ let timeout;
+ let cancel = matchProp((_props$cancel = props.cancel) != null ? _props$cancel : defaultProps == null ? void 0 : defaultProps.cancel, key);
- case 'HIDE_INSERTION_POINT':
- return null;
- }
+ if (cancel) {
+ onStart();
+ } else {
+ if (!react_spring_shared_esm_is.und(props.pause)) {
+ state.paused = matchProp(props.pause, key);
+ }
- 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.
- */
+ let pause = defaultProps == null ? void 0 : defaultProps.pause;
-function reducer_template() {
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
- isValid: true
- };
- let action = arguments.length > 1 ? arguments[1] : undefined;
+ if (pause !== true) {
+ pause = state.paused || matchProp(pause, key);
+ }
- switch (action.type) {
- case 'SET_TEMPLATE_VALIDITY':
- return { ...state,
- isValid: action.isValid
- };
- }
+ delay = callProp(props.delay || 0, key);
- return state;
-}
-/**
- * Reducer returning the editor setting.
- *
- * @param {Object} state Current state.
- * @param {Object} action Dispatched action.
- *
- * @return {Object} Updated state.
- */
+ if (pause) {
+ state.resumeQueue.add(onResume);
+ actions.pause();
+ } else {
+ actions.resume();
+ onResume();
+ }
+ }
-function settings() {
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaults["b" /* SETTINGS_DEFAULTS */];
- let action = arguments.length > 1 ? arguments[1] : undefined;
+ function onPause() {
+ state.resumeQueue.add(onResume);
+ state.timeouts.delete(timeout);
+ timeout.cancel();
+ delay = timeout.time - raf.now();
+ }
- switch (action.type) {
- case 'UPDATE_SETTINGS':
- return { ...state,
- ...action.settings
- };
- }
+ 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();
+ }
+ }
- return state;
-}
-/**
- * Reducer returning the user preferences.
- *
- * @param {Object} state Current state.
- * @param {Object} action Dispatched action.
- *
- * @return {string} Updated state.
- */
+ function onStart() {
+ if (state.delayed) {
+ state.delayed = false;
+ }
-function preferences() {
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaults["a" /* PREFERENCES_DEFAULTS */];
- let action = arguments.length > 1 ? arguments[1] : undefined;
+ state.pauseQueue.delete(onPause);
+ state.timeouts.delete(timeout);
- 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`).
+ if (callId <= (state.cancelId || 0)) {
+ cancel = true;
+ }
- let id = match !== null && match !== void 0 && match.name ? `${blockName}/${match.name}` : blockName;
- const insert = {
- name: id
- };
+ try {
+ actions.start(react_spring_core_esm_extends({}, props, {
+ callId,
+ cancel
+ }), resolve);
+ } catch (err) {
+ reject(err);
+ }
+ }
+ });
+}
- if (blockName === 'core/block') {
- insert.ref = attributes.ref;
- id += '/' + attributes.ref;
- }
+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
+});
- return { ...prevState,
- insertUsage: { ...prevState.insertUsage,
- [id]: {
- time: action.time,
- count: prevState.insertUsage[id] ? prevState.insertUsage[id].count + 1 : 1,
- insert
- }
- }
- };
- }, state);
+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;
-}
-/**
- * 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.
- */
+ 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 blockListSettings = function () {
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- let action = arguments.length > 1 ? arguments[1] : undefined;
+ const bailIfEnded = bailSignal => {
+ const bailResult = callId <= (state.cancelId || 0) && getCancelledResult(target) || callId !== state.asyncId && getFinishedResult(target, false);
- 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);
+ if (bailResult) {
+ bailSignal.result = bailResult;
+ bail(bailSignal);
+ throw bailSignal;
}
+ };
- case 'UPDATE_BLOCK_LIST_SETTINGS':
- {
- const {
- clientId
- } = action;
+ 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;
+ }
- if (!action.settings) {
- if (state.hasOwnProperty(clientId)) {
- return Object(external_lodash_["omit"])(state, clientId);
+ 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);
- return state;
+ if (state.paused) {
+ await new Promise(resume => {
+ state.resumeQueue.add(resume);
+ });
}
- if (Object(external_lodash_["isEqual"])(state[clientId], action.settings)) {
- return state;
+ 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)));
}
- return { ...state,
- [clientId]: action.settings
- };
+ 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;
}
- 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.
- */
+}
+class SkipAniamtionSignal extends Error {
+ constructor() {
+ super('SkipAnimationSignal');
+ this.result = void 0;
+ }
-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;
+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;
}
- if (action.type === 'SET_NAVIGATION_MODE') {
- return action.isNavigationMode;
+ get priority() {
+ return this._priority;
}
- 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.
- */
+ set priority(priority) {
+ if (this._priority != priority) {
+ this._priority = priority;
-function reducer_hasBlockMovingClientId() {
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
- let action = arguments.length > 1 ? arguments[1] : undefined;
+ this._onPriorityChange(priority);
+ }
+ }
- // Let inserting block always trigger Edit mode.
- if (action.type === 'SET_BLOCK_MOVING_MODE') {
- return action.hasBlockMovingClientId;
+ get() {
+ const node = getAnimated(this);
+ return node && node.getValue();
}
- if (action.type === 'SET_NAVIGATION_MODE') {
- return null;
+ to(...args) {
+ return globals.to(this, args);
}
- 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<string,Object>} state Current state.
- * @param {Object} action Action object.
- *
- * @return {[string,Object]} Updated state.
- */
+ interpolate(...args) {
+ react_spring_shared_esm_deprecateInterpolate();
+ return globals.to(this, args);
+ }
-function lastBlockAttributesChange(state, action) {
- switch (action.type) {
- case 'UPDATE_BLOCK':
- if (!action.updates.attributes) {
- break;
- }
+ toJSON() {
+ return this.get();
+ }
- return {
- [action.clientId]: action.updates.attributes
- };
+ observerAdded(count) {
+ if (count == 1) this._attach();
+ }
- case 'UPDATE_BLOCK_ATTRIBUTES':
- return action.clientIds.reduce((accumulator, id) => ({ ...accumulator,
- [id]: action.uniqueByBlock ? action.attributes[id] : action.attributes
- }), {});
+ 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
+ });
}
- 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';
+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;
- case 'MARK_AUTOMATIC_CHANGE_FINAL':
- if (state === 'pending') {
- return 'final';
- }
+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;
- return;
+ 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
+ });
- case 'SELECTION_CHANGE':
- // As long as the state is not final, ignore any selection changes.
- if (state !== 'final') {
- return state;
+ if (react_spring_shared_esm_is.und(props.default)) {
+ props.default = true;
}
- return;
- // Undoing an automatic change should still be possible after mouse
- // move.
+ 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);
+ }
- case 'START_TYPING':
- case 'STOP_TYPING':
- return state;
- } // Reset the state by default (for any action not handled).
+ get hasAnimated() {
+ return hasAnimated(this);
+ }
-}
-/**
- * Reducer returning current highlighted block.
- *
- * @param {boolean} state Current highlighted block.
- * @param {Object} action Dispatched action.
- *
- * @return {string} Updated state.
- */
+ get isAnimating() {
+ return isAnimating(this);
+ }
-function highlightedBlock(state, action) {
- switch (action.type) {
- case 'TOGGLE_BLOCK_HIGHLIGHT':
- const {
- clientId,
- isHighlighted
- } = action;
+ get isPaused() {
+ return isPaused(this);
+ }
- if (isHighlighted) {
- return clientId;
- } else if (state === clientId) {
- return null;
- }
+ get isDelayed() {
+ return this._state.delayed;
+ }
- return state;
+ advance(dt) {
+ let idle = true;
+ let changed = false;
+ const anim = this.animation;
+ let {
+ config,
+ toValues
+ } = anim;
+ const payload = getPayload(anim.to);
- case 'SELECT_BLOCK':
- if (action.clientId !== state) {
- return null;
- }
+ 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;
- return state;
-}
-/**
- * Reducer returning the block insertion event list state.
- *
- * @param {Object} state Current state.
- * @param {Object} action Dispatched action.
- *
- * @return {Object} Updated state.
- */
+ if (!finished) {
+ position = node.lastPosition;
-function lastBlockInserted() {
- var _action$meta;
+ if (config.tension <= 0) {
+ node.done = true;
+ return;
+ }
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- let action = arguments.length > 1 ? arguments[1] : undefined;
+ 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;
- switch (action.type) {
- case 'INSERT_BLOCKS':
- if (!action.blocks.length) {
- return state;
- }
+ if (!react_spring_shared_esm_is.und(config.duration)) {
+ let p = 1;
- 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
- };
+ if (config.duration > 0) {
+ if (this._memoizedDuration !== config.duration) {
+ this._memoizedDuration = config.duration;
- case 'RESET_BLOCKS':
- return {};
- }
+ if (node.durationProgress > 0) {
+ node.elapsedTime = config.duration * node.durationProgress;
+ elapsed = node.elapsedTime += dt;
+ }
+ }
- 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
-}));
+ p = (config.progress || 0) + elapsed / this._memoizedDuration;
+ p = p > 1 ? 1 : p < 0 ? 0 : p;
+ node.durationProgress = p;
+ }
-// EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
-var rememo = __webpack_require__("pPDe");
+ 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);
-// EXTERNAL MODULE: external ["wp","element"]
-var external_wp_element_ = __webpack_require__("GRId");
+ for (let n = 0; n < numSteps; ++n) {
+ isMoving = Math.abs(velocity) > restVelocity;
-// EXTERNAL MODULE: external ["wp","hooks"]
-var external_wp_hooks_ = __webpack_require__("g56x");
+ if (!isMoving) {
+ finished = Math.abs(to - position) <= precision;
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js
-var symbol = __webpack_require__("+WrK");
+ if (finished) {
+ break;
+ }
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/selectors.js
-/**
- * External dependencies
- */
+ if (canBounce) {
+ isBouncing = position == to || position > to == isGrowing;
+ if (isBouncing) {
+ velocity = -velocity * bounceFactor;
+ position = to;
+ }
+ }
-/**
- * WordPress dependencies
- */
+ 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;
+ }
-/**
- * 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
+ if (node.setValue(position, config.round)) {
+ changed = true;
+ }
+ });
+ const node = getAnimated(this);
+ const currVal = node.getValue();
-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}
- */
+ if (idle) {
+ const finalVal = getFluidValue(anim.to);
-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.
- */
+ if ((currVal !== finalVal || changed) && !config.decay) {
+ node.setValue(finalVal);
-function getBlockName(state, clientId) {
- const block = state.blocks.byClientId[clientId];
- const socialLinkName = 'core/social-link';
+ this._onChange(finalVal);
+ } else if (changed && config.decay) {
+ this._onChange(currVal);
+ }
- 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;
+ this._stop();
+ } else if (changed) {
+ this._onChange(currVal);
+ }
}
- 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.
- */
+ set(value) {
+ raf.batchedUpdates(() => {
+ this._stop();
-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.
- */
+ this._focus(value);
-function getBlockAttributes(state, clientId) {
- const block = state.blocks.byClientId[clientId];
+ this._set(value);
+ });
+ return this;
+ }
- if (!block) {
- return null;
+ pause() {
+ this._update({
+ pause: true
+ });
}
- 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.
- */
+ resume() {
+ this._update({
+ pause: false
+ });
+ }
-function getBlock(state, clientId) {
- const block = state.blocks.byClientId[clientId];
+ finish() {
+ if (isAnimating(this)) {
+ const {
+ to,
+ config
+ } = this.animation;
+ raf.batchedUpdates(() => {
+ this._onStart();
- if (!block) {
- return null;
- }
+ if (!config.decay) {
+ this._set(to, false);
+ }
- return state.blocks.tree[clientId];
-}
-const __unstableGetBlockWithoutInnerBlocks = Object(rememo["a" /* default */])((state, clientId) => {
- const block = state.blocks.byClientId[clientId];
+ this._stop();
+ });
+ }
- if (!block) {
- return null;
+ return this;
}
- 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.
- */
+ update(props) {
+ const queue = this.queue || (this.queue = []);
+ queue.push(props);
+ return this;
+ }
-function getBlocks(state, rootClientId) {
- var _state$blocks$tree$tr;
+ start(to, arg2) {
+ let queue;
- 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.
- */
+ 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 = [];
+ }
-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.
- */
+ return Promise.all(queue.map(props => {
+ const up = this._update(props);
-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.
- */
+ return up;
+ })).then(results => getCombinedResult(this, results));
+ }
-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.
- */
+ stop(cancel) {
+ const {
+ to
+ } = this.animation;
-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.
- */
+ this._focus(this.get());
-const getGlobalBlockCount = Object(rememo["a" /* default */])((state, blockName) => {
- const clientIds = getClientIdsWithDescendants(state);
+ stopAsync(this._state, cancel && this._lastCallId);
+ raf.batchedUpdates(() => this._stop(to, cancel));
+ return this;
+ }
- if (!blockName) {
- return clientIds.length;
+ reset() {
+ this._update({
+ reset: true
+ });
}
- 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.
- */
+ eventObserved(event) {
+ if (event.type == 'change') {
+ this._start();
+ } else if (event.type == 'priority') {
+ this.priority = event.priority + 1;
+ }
+ }
-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.
- */
+ _prepareNode(props) {
+ const key = this.key || '';
+ let {
+ to,
+ from
+ } = props;
+ to = react_spring_shared_esm_is.obj(to) ? to[key] : to;
-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.
- */
+ if (to == null || isAsyncTo(to)) {
+ to = undefined;
+ }
-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.
- */
+ from = react_spring_shared_esm_is.obj(from) ? from[key] : from;
-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.
- */
+ if (from == null) {
+ from = undefined;
+ }
-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.
- */
+ const range = {
+ to,
+ from
+ };
-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.
- */
+ if (!hasAnimated(this)) {
+ if (props.reverse) [to, from] = [from, to];
+ from = getFluidValue(from);
-function getSelectedBlockCount(state) {
- const multiSelectedBlockCount = getMultiSelectedBlockClientIds(state).length;
+ if (!react_spring_shared_esm_is.und(from)) {
+ this._set(from);
+ } else if (!getAnimated(this)) {
+ this._set(to);
+ }
+ }
- if (multiSelectedBlockCount) {
- return multiSelectedBlockCount;
+ return range;
}
- 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.
- */
+ _update(_ref, isLoop) {
+ let props = react_spring_core_esm_extends({}, _ref);
-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.
- */
+ 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);
-function getSelectedBlockClientId(state) {
- const {
- selectionStart,
- selectionEnd
- } = state.selection;
- const {
- clientId
- } = selectionStart;
+ const range = this._prepareNode(props);
- if (!clientId || clientId !== selectionEnd.clientId) {
- return null;
- }
+ 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?');
+ }
- 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.
- */
+ 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);
-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
- */
+ if (isAnimating(this)) {
+ this._resume();
+ }
-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.
- */
+ 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);
-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;
+ if (nextProps) {
+ return this._update(nextProps, true);
+ }
+ }
- while (!!state.blocks.parents[current]) {
- current = state.blocks.parents[current];
- parents.push(current);
+ return result;
+ });
}
- 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.
- */
+ _merge(range, props, resolve) {
+ if (props.cancel) {
+ this.stop(true);
+ return resolve(getCancelledResult(this));
+ }
-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;
+ const hasToProp = !react_spring_shared_esm_is.und(range.to);
+ const hasFromProp = !react_spring_shared_esm_is.und(range.from);
- if (Array.isArray(blockName)) {
- return blockName.includes(name);
+ if (hasToProp || hasFromProp) {
+ if (props.callId > this._lastToId) {
+ this._lastToId = props.callId;
+ } else {
+ return resolve(getCancelledResult(this));
+ }
}
- return name === blockName;
- }), _ref2 => {
+ const {
+ key,
+ defaultProps,
+ animation: anim
+ } = this;
+ const {
+ to: prevTo,
+ from: prevFrom
+ } = anim;
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
- */
+ to = prevTo,
+ from = prevFrom
+ } = range;
-function getBlockHierarchyRootClientId(state, clientId) {
- let current = clientId;
- let parent;
+ if (hasFromProp && !hasToProp && (!props.default || react_spring_shared_esm_is.und(to))) {
+ to = from;
+ }
- do {
- parent = current;
- current = state.blocks.parents[current];
- } while (current);
+ if (props.reverse) [to, from] = [from, to];
+ const hasFromChanged = !isEqual(from, prevFrom);
- 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
- */
+ if (hasFromChanged) {
+ anim.from = from;
+ }
-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);
+ from = getFluidValue(from);
+ const hasToChanged = !isEqual(to, prevTo);
- for (let index = 0; index < maxDepth; index++) {
- if (clientParents[index] === selectedParents[index]) {
- lowestCommonAncestor = clientParents[index];
- } else {
- break;
+ if (hasToChanged) {
+ this._focus(to);
}
- }
- 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.
- */
+ const hasAsyncTo = isAsyncTo(props.to);
+ const {
+ config
+ } = anim;
+ const {
+ decay,
+ velocity
+ } = config;
-function getAdjacentBlockClientId(state, startClientId) {
- let modifier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
+ if (hasToProp || hasFromProp) {
+ config.velocity = 0;
+ }
- // Default to selected block.
- if (startClientId === undefined) {
- startClientId = getSelectedBlockClientId(state);
- } // Try multi-selection starting at extent based on modifier.
+ 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 (startClientId === undefined) {
- if (modifier < 0) {
- startClientId = getFirstMultiSelectedBlockClientId(state);
- } else {
- startClientId = getLastMultiSelectedBlockClientId(state);
+ if (!node || react_spring_shared_esm_is.und(to)) {
+ return resolve(getFinishedResult(this, true));
}
- } // Validate working start client ID.
+ 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 (!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.
+ 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 rootClientId = getBlockRootClientId(state, startClientId);
+ const goalType = node.constructor;
+ let started = hasFluidValue(to);
+ let finished = false;
- if (rootClientId === null) {
- return null;
- }
+ if (!started) {
+ const hasValueChanged = reset || !hasAnimated(this) && hasFromChanged;
- 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 (hasToChanged || hasValueChanged) {
+ finished = isEqual(computeGoal(value), goal);
+ started = !finished;
+ }
- if (nextIndex < 0) {
- return null;
- } // Block was last in set and we're attempting to get next.
+ 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 (nextIndex === orderSet.length) {
- return null;
- } // Assume incremented index is within the set.
+ 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;
- 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.
- */
+ if (!immediate && !reset) {
+ this._set(prevTo);
+ }
+ }
-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.
- */
+ 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);
-function getNextBlockClientId(state, startClientId) {
- return getAdjacentBlockClientId(state, startClientId, 1);
-}
-/* eslint-disable jsdoc/valid-types */
+ this._pendingCalls.add(resolve);
-/**
- * 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.
- */
+ if (anim.changed) raf.batchedUpdates(() => {
+ anim.changed = !reset;
+ onRest == null ? void 0 : onRest(result, this);
-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.
- */
+ if (reset) {
+ callProp(defaultProps.onRest, result);
+ } else {
+ anim.onStart == null ? void 0 : anim.onStart(result, this);
+ }
+ });
+ }
+ }
-const getSelectedBlockClientIds = Object(rememo["a" /* default */])(state => {
- const {
- selectionStart,
- selectionEnd
- } = state.selection;
+ if (reset) {
+ this._set(value);
+ }
- if (selectionStart.clientId === undefined || selectionEnd.clientId === undefined) {
- return EMPTY_ARRAY;
+ 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));
+ }
}
- 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.
+ _focus(value) {
+ const anim = this.animation;
+ if (value !== anim.to) {
+ if (getFluidObservers(this)) {
+ this._detach();
+ }
- const rootClientId = getBlockRootClientId(state, selectionStart.clientId);
+ anim.to = value;
- if (rootClientId === null) {
- return EMPTY_ARRAY;
+ if (getFluidObservers(this)) {
+ this._attach();
+ }
+ }
}
- 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);
- }
+ _attach() {
+ let priority = 0;
+ const {
+ to
+ } = this.animation;
- 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.
- */
+ if (hasFluidValue(to)) {
+ addFluidObserver(to, this);
-function getMultiSelectedBlockClientIds(state) {
- const {
- selectionStart,
- selectionEnd
- } = state.selection;
+ if (isFrameValue(to)) {
+ priority = to.priority + 1;
+ }
+ }
- if (selectionStart.clientId === selectionEnd.clientId) {
- return EMPTY_ARRAY;
+ this.priority = priority;
}
- 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);
+ _detach() {
+ const {
+ to
+ } = this.animation;
- if (!multiSelectedBlockClientIds.length) {
- return EMPTY_ARRAY;
+ if (hasFluidValue(to)) {
+ removeFluidObserver(to, this);
+ }
}
- 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.
- */
+ _set(arg, idle = true) {
+ const value = getFluidValue(arg);
-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.
- */
+ if (!react_spring_shared_esm_is.und(value)) {
+ const oldNode = getAnimated(this);
-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.
- */
+ if (!oldNode || !isEqual(value, oldNode.getValue())) {
+ const nodeType = getAnimatedType(value);
-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.
- */
+ if (!oldNode || oldNode.constructor != nodeType) {
+ setAnimated(this, nodeType.create(value));
+ } else {
+ oldNode.setValue(value);
+ }
-const isAncestorMultiSelected = Object(rememo["a" /* default */])((state, clientId) => {
- let ancestorClientId = clientId;
- let isMultiSelected = false;
+ if (oldNode) {
+ raf.batchedUpdates(() => {
+ this._onChange(value, idle);
+ });
+ }
+ }
+ }
- while (ancestorClientId && !isMultiSelected) {
- ancestorClientId = getBlockRootClientId(state, ancestorClientId);
- isMultiSelected = isBlockMultiSelected(state, ancestorClientId);
+ return getAnimated(this);
}
- 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;
+ _onStart() {
+ const anim = this.animation;
- if (selectionStart.clientId === selectionEnd.clientId) {
- return null;
+ if (!anim.changed) {
+ anim.changed = true;
+ sendEvent(this, 'onStart', getFinishedResult(this, checkFinished(this, anim.to)), this);
+ }
}
- 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.
- */
+ _onChange(value, idle) {
+ if (!idle) {
+ this._onStart();
-function getMultiSelectedBlocksEndClientId(state) {
- const {
- selectionStart,
- selectionEnd
- } = state.selection;
+ callProp(this.animation.onChange, value, this);
+ }
- if (selectionStart.clientId === selectionEnd.clientId) {
- return null;
+ callProp(this.defaultProps.onChange, value, this);
+
+ super._onChange(value, idle);
}
- 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.
- */
+ _start() {
+ const anim = this.animation;
+ getAnimated(this).reset(getFluidValue(anim.to));
-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.
- */
+ if (!anim.immediate) {
+ anim.fromValues = anim.values.map(node => node.lastPosition);
+ }
-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.
- */
+ if (!isAnimating(this)) {
+ setActiveBit(this, true);
-function isBlockSelected(state, clientId) {
- const {
- selectionStart,
- selectionEnd
- } = state.selection;
+ if (!isPaused(this)) {
+ this._resume();
+ }
+ }
+ }
- if (selectionStart.clientId !== selectionEnd.clientId) {
- return false;
+ _resume() {
+ if (globals.skipAnimation) {
+ this.finish();
+ } else {
+ frameLoop.start(this);
+ }
}
- 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
- */
+ _stop(goal, cancel) {
+ if (isAnimating(this)) {
+ setActiveBit(this, false);
+ const anim = this.animation;
+ react_spring_shared_esm_each(anim.values, node => {
+ node.done = true;
+ });
-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.
- */
+ if (anim.toValues) {
+ anim.onChange = anim.onPause = anim.onResume = undefined;
+ }
-function isBlockWithinSelection(state, clientId) {
- if (!clientId) {
- return false;
+ 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);
+ }
+ }
}
- 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;
+function checkFinished(target, to) {
+ const goal = computeGoal(to);
+ const value = computeGoal(target.get());
+ return isEqual(value, goal);
}
-/**
- * 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 createLoopUpdate(props, loop = props.loop, to = props.to) {
+ let loopRet = callProp(loop);
-function selectors_isSelectionEnabled(state) {
- return state.isSelectionEnabled;
+ 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));
+ }
}
-/**
- * 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';
+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;
}
-/**
- * Returns true if the user is typing, or false otherwise.
- *
- * @param {Object} state Global application state.
- *
- * @return {boolean} Whether user is typing.
- */
+function declareUpdate(props) {
+ const update = createUpdate(props);
-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.
- */
+ if (react_spring_shared_esm_is.und(update.default)) {
+ update.default = getDefaultProps(update);
+ }
-function isDraggingBlocks(state) {
- return !!state.draggedBlocks.length;
+ return update;
}
-/**
- * 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;
+function findDefined(values, keys) {
+ eachProp(values, (value, key) => value != null && keys.add(key));
}
-/**
- * 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);
+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;
}
-/**
- * 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;
- }
+function sendEvent(target, type, ...args) {
+ var _target$animation$typ, _target$animation, _target$defaultProps$, _target$defaultProps;
- const parents = getBlockParents(state, clientId);
- return Object(external_lodash_["some"])(parents, parentClientId => isBlockBeingDragged(state, parentClientId));
+ (_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);
}
-/**
- * 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`.
- */
+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);
-function getBlockInsertionPoint(state) {
- let rootClientId, index;
- const {
- insertionPoint,
- selection: {
- selectionEnd
+ if (flush) {
+ this._flush = flush;
}
- } = state;
- if (insertionPoint !== null) {
- return insertionPoint;
+ if (props) {
+ this.start(react_spring_core_esm_extends({
+ default: true
+ }, props));
+ }
}
- const {
- clientId
- } = selectionEnd;
-
- if (clientId) {
- rootClientId = getBlockRootClientId(state, clientId) || undefined;
- index = getBlockIndex(state, selectionEnd.clientId, rootClientId) + 1;
- } else {
- index = getBlockOrder(state).length;
+ get idle() {
+ return !this._state.asyncTo && Object.values(this.springs).every(spring => {
+ return spring.idle && !spring.isDelayed && !spring.isPaused;
+ });
}
- 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.
- */
+ get item() {
+ return this._item;
+ }
-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
- */
+ set item(item) {
+ this._item = item;
+ }
-function getTemplateLock(state, rootClientId) {
- if (!rootClientId) {
- return state.settings.templateLock;
+ get() {
+ const values = {};
+ this.each((spring, key) => values[key] = spring.get());
+ return values;
}
- const blockListSettings = getBlockListSettings(state, rootClientId);
+ set(values) {
+ for (const key in values) {
+ const value = values[key];
- if (!blockListSettings) {
- return null;
+ if (!react_spring_shared_esm_is.und(value)) {
+ this.springs[key].set(value);
+ }
+ }
}
- return blockListSettings.templateLock;
-}
+ update(props) {
+ if (props) {
+ this.queue.push(createUpdate(props));
+ }
-const checkAllowList = function (list, item) {
- let defaultResult = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
+ return this;
+ }
- if (Object(external_lodash_["isBoolean"])(list)) {
- return list;
+ 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);
}
- 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;
+ stop(arg, keys) {
+ if (arg !== !!arg) {
+ keys = arg;
}
- return list.includes(item);
+ 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;
}
- 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.
- */
+ 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;
+ }
-const canInsertBlockTypeUnmemoized = function (state, blockName) {
- let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
- let blockType;
+ 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());
+ }
- if (blockName && 'object' === typeof blockName) {
- blockType = blockName;
- blockName = blockType.name;
- } else {
- blockType = Object(external_wp_blocks_["getBlockType"])(blockName);
+ return this;
}
- if (!blockType) {
- return false;
+ each(iterator) {
+ eachProp(this.springs, iterator);
}
- const {
- allowedBlockTypes
- } = getSettings(state);
- const isBlockAllowedInEditor = checkAllowList(allowedBlockTypes, blockName, true);
+ _onFrame() {
+ const {
+ onStart,
+ onChange,
+ onRest
+ } = this._events;
+ const active = this._active.size > 0;
+ const changed = this._changed.size > 0;
- if (!isBlockAllowedInEditor) {
- return false;
- }
+ if (active && !this._started || changed && !this._started) {
+ this._started = true;
+ flush(onStart, ([onStart, result]) => {
+ result.value = this.get();
+ onStart(result, this, this._item);
+ });
+ }
- const isLocked = !!getTemplateLock(state, rootClientId);
+ const idle = !active && this._started;
+ const values = changed || idle && onRest.size ? this.get() : null;
- if (isLocked) {
- return false;
+ 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);
+ });
+ }
}
- const parentBlockListSettings = getBlockListSettings(state, rootClientId); // The parent block doesn't have settings indicating it doesn't support
- // inner blocks, return false.
+ eventObserved(event) {
+ if (event.type == 'change') {
+ this._changed.add(event.parent);
- if (rootClientId && parentBlockListSettings === undefined) {
- return false;
+ if (!event.idle) {
+ this._active.add(event.parent);
+ }
+ } else if (event.type == 'idle') {
+ this._active.delete(event.parent);
+ } else return;
+
+ raf.onFrame(this._onFrame);
}
- 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;
+}
+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 (!canInsert) {
- return canInsert;
+ if (loop) {
+ props.loop = false;
}
- /**
- * 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.
- */
+ 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;
- 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.
- */
+ 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];
-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.
- */
+ if (react_spring_shared_esm_is.fun(handler)) {
+ const queue = ctrl['_events'][key];
-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.
- */
+ props[key] = ({
+ finished,
+ cancelled
+ }) => {
+ const result = queue.get(handler);
-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 (result) {
+ if (!finished) result.finished = false;
+ if (cancelled) result.cancelled = true;
+ } else {
+ queue.set(handler, {
+ value: null,
+ finished: finished || false,
+ cancelled: cancelled || false
+ });
+ }
+ };
- if (attributes === null) {
- return true;
+ 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));
+ }
+ }
+
+ }
+ }));
}
- 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 (state.paused) {
+ await new Promise(resume => {
+ state.resumeQueue.add(resume);
+ });
+ }
- 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.
+ const result = getCombinedResult(ctrl, await Promise.all(promises));
+ if (loop && result.finished && !(isLoop && result.noop)) {
+ const nextProps = createLoopUpdate(props, loop, to);
- 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.
- */
+ if (nextProps) {
+ prepareKeys(ctrl, [nextProps]);
+ return flushUpdate(ctrl, nextProps, true);
+ }
+ }
-function selectors_canRemoveBlocks(state, clientIds) {
- let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
- return clientIds.every(clientId => canRemoveBlock(state, clientId, rootClientId));
+ if (onResolve) {
+ raf.batchedUpdates(() => onResolve(result, ctrl, ctrl.item));
+ }
+
+ return result;
}
-/**
- * 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 getSprings(ctrl, props) {
+ const springs = react_spring_core_esm_extends({}, ctrl.springs);
-function canMoveBlock(state, clientId) {
- let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
- const attributes = getBlockAttributes(state, clientId);
+ 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 (attributes === null) {
- return;
+ 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);
+ });
+ });
}
- 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.
+ setSprings(ctrl, springs);
+ return springs;
+}
+function setSprings(ctrl, springs) {
+ eachProp(springs, (spring, key) => {
+ if (!ctrl.springs[key]) {
+ ctrl.springs[key] = spring;
+ addFluidObserver(spring, ctrl);
+ }
+ });
+}
- 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.
+function createSpring(key, observer) {
+ const spring = new SpringValue();
+ spring.key = key;
+ if (observer) {
+ addFluidObserver(spring, observer);
+ }
- return !(lock !== null && lock !== void 0 && lock.move);
+ return spring;
}
-/**
- * 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));
+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);
+ });
+ }
}
-/**
- * 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;
+function prepareKeys(ctrl, queue) {
+ react_spring_shared_esm_each(queue, props => {
+ prepareSprings(ctrl.springs, props, key => {
+ return createSpring(key, ctrl);
+ });
+ });
}
-/**
- * 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.
- */
+function _objectWithoutPropertiesLoose(source, excluded) {
+ if (source == null) return {};
+ var target = {};
+ var sourceKeys = Object.keys(source);
+ var key, i;
-const canIncludeBlockTypeInInserter = (state, blockType, rootClientId) => {
- if (!Object(external_wp_blocks_["hasBlockSupport"])(blockType, 'inserter', true)) {
- return false;
+ for (i = 0; i < sourceKeys.length; i++) {
+ key = sourceKeys[i];
+ if (excluded.indexOf(key) >= 0) continue;
+ target[key] = source[key];
}
- 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
- */
+ return target;
+}
+const _excluded$3 = ["children"];
+const SpringContext = _ref => {
+ let {
+ children
+ } = _ref,
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
-const getItemFromVariation = (state, item) => variation => {
- const variationId = `${item.id}/${variation.name}`;
+ 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 {
- 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)
+ 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);
+ }
};
-};
-/**
- * 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.
- */
+ SpringRef.delete = function (ctrl) {
+ const i = current.indexOf(ctrl);
+ if (~i) current.splice(i, 1);
+ };
-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.
+ 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;
+ };
- const duration = Date.now() - time;
+ SpringRef.set = function (values) {
+ react_spring_shared_esm_each(current, ctrl => ctrl.set(values));
+ };
- switch (true) {
- case duration < MILLISECONDS_PER_HOUR:
- return count * 4;
+ 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);
- case duration < MILLISECONDS_PER_DAY:
- return count * 2;
+ if (update) {
+ results.push(ctrl.start(update));
+ }
+ }
+ });
+ return results;
+ };
- case duration < MILLISECONDS_PER_WEEK:
- return count / 2;
+ SpringRef.stop = function () {
+ react_spring_shared_esm_each(current, ctrl => ctrl.stop(...arguments));
+ return this;
+ };
- 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).
- */
+ 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;
+ };
-const buildBlockTypeItem = (state, _ref3) => {
- let {
- buildScope = 'inserter'
- } = _ref3;
- return blockType => {
- const id = blockType.name;
- let isDisabled = false;
+ SpringRef._getProps = _getProps;
+ return SpringRef;
+};
- if (!Object(external_wp_blocks_["hasBlockSupport"])(blockType.name, 'multiple', true)) {
- isDisabled = Object(external_lodash_["some"])(getBlocksByClientId(state, getClientIdsWithDescendants(state)), {
- name: blockType.name
+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 {
- 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
+ queue
+ } = state;
- };
- };
-};
-/**
- * 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.
- */
+ 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);
-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'
+ 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);
+ }
+ }
+ });
});
- /*
- * 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*
- *
- */
+ 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;
+}
- const blockParserTokenizer = /^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/;
+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 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.
- */
+const initSpringRef = () => SpringRef();
- if (external_wp_element_["Platform"].OS === 'web') {
- const content = typeof reusableBlock.content.raw === 'string' ? reusableBlock.content.raw : reusableBlock.content;
- const rawBlockMatch = content.match(blockParserTokenizer);
+const useSpringRef = () => useState(initSpringRef)[0];
- if (rawBlockMatch) {
- const [,, namespace = 'core/', blockName] = rawBlockMatch;
- const referencedBlockType = Object(external_wp_blocks_["getBlockType"])(namespace + blockName);
+function useTrail(length, propsArg, deps) {
+ var _passedRef;
- if (referencedBlockType) {
- icon = referencedBlockType.icon;
- }
+ 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);
- 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
+ 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;
+ }
};
- };
- 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
+ return result;
+ }
- if (!variations.some(_ref4 => {
- let {
- isDefault
- } = _ref4;
- return isDefault;
- })) {
- accumulator.push(item);
- }
+ 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 (variations.length) {
- const variationMapper = getItemFromVariation(state, item);
- accumulator.push(...variations.map(variationMapper));
- }
+ 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 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.
+ return result[0];
+}
- const groupByType = (blocks, block) => {
- const {
- core,
- noncore
- } = blocks;
- const type = block.name.startsWith('core/') ? core : noncore;
- type.push(block);
- return blocks;
- };
+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 {
- core: coreItems,
- noncore: nonCoreItems
- } = items.reduce(groupByType, {
- core: [],
- noncore: []
+ 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;
});
- 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.
- */
+ useOnce(() => () => {
+ each(usedTransitions.current, t => {
+ if (t.expired) {
+ clearTimeout(t.expirationId);
+ }
-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'
+ detachRefs(t.ctrl, ref);
+ t.ctrl.stop(true);
+ });
});
- 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 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;
+ }
});
- 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]);
+ each(items, (item, i) => {
+ if (!transitions[i]) {
+ transitions[i] = {
+ key: keys[i],
+ item,
+ phase: TransitionPhase.MOUNT,
+ ctrl: new Controller()
+ };
+ transitions[i].ctrl.item = item;
}
+ });
- 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 (reused.length) {
+ let i = -1;
+ const {
+ leave
+ } = propsFn ? propsFn() : props;
+ each(reused, (keyIndex, prevIndex) => {
+ const t = prevTransitions[prevIndex];
- if (hasBlockType) {
- return true;
+ 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);
+ }
+ });
}
- 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.
- */
+ if (is.fun(sort)) {
+ transitions.sort((a, b) => sort(a.item, b.item));
+ }
-const __experimentalGetAllowedBlocks = Object(rememo["a" /* default */])(function (state) {
- let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
+ 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 (!rootClientId) {
- return;
- }
+ if (prevPhase == TransitionPhase.MOUNT) {
+ to = p.enter;
+ phase = TransitionPhase.ENTER;
+ } else {
+ const isLeave = keys.indexOf(key) < 0;
- 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.
- */
+ 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;
+ }
-const __experimentalGetDirectInsertBlock = Object(rememo["a" /* default */])(function (state) {
- var _state$blockListSetti, _state$blockListSetti2;
+ to = callProp(to, t.item, i);
+ to = is.obj(to) ? inferTo(to) : {
+ to
+ };
- let rootClientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
+ if (!to.config) {
+ const config = propsConfig || defaultProps.config;
+ to.config = callProp(config, t.item, i, phase);
+ }
- if (!rootClientId) {
- return;
- }
+ delay += trail;
- 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;
+ const payload = react_spring_core_esm_extends({}, defaultProps, {
+ delay: propsDelay + delay,
+ ref: propsRef,
+ immediate: p.immediate,
+ reset: false
+ }, to);
- if (!defaultBlock || !directInsert) {
- return;
- }
+ if (phase == TransitionPhase.ENTER && is.und(payload.from)) {
+ const _p = propsFn ? propsFn() : props;
- if (typeof directInsert === 'function') {
- return directInsert(getBlock(state, rootClientId)) ? defaultBlock : null;
- }
+ const from = is.und(_p.initial) || prevTransitions ? _p.from : _p.initial;
+ payload.from = callProp(from, t.item, i);
+ }
- return defaultBlock;
-}, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.tree[rootClientId]]);
+ const {
+ onResolve
+ } = payload;
-const checkAllowListRecursive = (blocks, allowedBlockTypes) => {
- if (Object(external_lodash_["isBoolean"])(allowedBlockTypes)) {
- return allowedBlockTypes;
- }
+ payload.onResolve = result => {
+ callProp(onResolve, result);
+ const transitions = usedTransitions.current;
+ const t = transitions.find(t => t.key === key);
+ if (!t) return;
- const blocksQueue = [...blocks];
+ if (result.cancelled && t.phase != TransitionPhase.UPDATE) {
+ return;
+ }
- while (blocksQueue.length > 0) {
- var _block$innerBlocks;
+ if (t.ctrl.idle) {
+ const idle = transitions.every(t => t.ctrl.idle);
- const block = blocksQueue.shift();
- const isAllowed = checkAllowList(allowedBlockTypes, block.name || block.blockName, true);
+ if (t.phase == TransitionPhase.LEAVE) {
+ const expiry = callProp(expires, t.item);
- if (!isAllowed) {
- return false;
- }
+ if (expiry !== false) {
+ const expiryMs = expiry === true ? 0 : expiry;
+ t.expired = true;
- (_block$innerBlocks = block.innerBlocks) === null || _block$innerBlocks === void 0 ? void 0 : _block$innerBlocks.forEach(innerBlock => {
- blocksQueue.push(innerBlock);
- });
- }
+ if (!idle && expiryMs > 0) {
+ if (expiryMs <= 0x7fffffff) t.expirationId = setTimeout(forceUpdate, expiryMs);
+ return;
+ }
+ }
+ }
- return true;
-};
+ if (idle && transitions.some(t => t.expired)) {
+ exitingTransitions.current.delete(t);
-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 (exitBeforeEnter) {
+ forceChange.current = true;
+ }
- if (!pattern) {
- return null;
- }
+ forceUpdate();
+ }
+ }
+ };
- 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 springs = getSprings(t.ctrl, payload);
-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);
- });
+ if (phase === TransitionPhase.LEAVE && exitBeforeEnter) {
+ exitingTransitions.current.set(t, {
+ phase,
+ springs,
+ payload
+ });
+ } else {
+ changes.set(t, {
+ phase,
+ springs,
+ payload
+ });
+ }
});
- 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 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);
-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;
+ if (hasContext && phase == TransitionPhase.ENTER) {
+ ctrl.start({
+ default: context
+ });
+ }
- const patterns = __experimentalGetAllowedPatterns(state, rootClientId);
+ if (payload) {
+ replaceRef(ctrl, payload.ref);
- const normalizedBlockNames = Array.isArray(blockNames) ? blockNames : [blockNames];
- return patterns.filter(pattern => {
- var _pattern$blockTypes, _pattern$blockTypes$s;
+ if (ctrl.ref && !forceChange.current) {
+ ctrl.update(payload);
+ } else {
+ ctrl.start(payload);
- 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.
- */
+ if (forceChange.current) {
+ forceChange.current = false;
+ }
+ }
+ }
+ });
+ }, reset ? void 0 : deps);
-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.
- */
+ 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;
+ }));
- 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.
+ 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));
- 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.
- */
+ if (t) {
+ reused.add(t);
+ return t.key;
+ }
- 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.
- */
+ return nextKey++;
+ });
+ }
-function getBlockListSettings(state, clientId) {
- return state.blockListSettings[clientId];
+ return is.und(keys) ? items : is.fun(keys) ? items.map(keys) : toArray(keys);
}
-/**
- * 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.
- */
+const _excluded$2 = (/* unused pure expression or super */ null && (["children"]));
+function Spring(_ref) {
+ let {
+ children
+ } = _ref,
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
-function isLastBlockChangePersistent(state) {
- return state.blocks.isPersistentChange;
+ return children(useSpring(props));
}
-/**
- * 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);
+const _excluded$1 = (/* unused pure expression or super */ null && (["items", "children"]));
+function Trail(_ref) {
+ let {
+ items,
+ children
+ } = _ref,
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
- if (!reusableBlock) {
- return null;
- }
+ const trails = useTrail(items.length, props);
+ return items.map((item, index) => {
+ const result = children(item, index);
+ return is.fun(result) ? result(trails[index]) : result;
+ });
+}
- 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.
- */
+const _excluded = (/* unused pure expression or super */ null && (["items", "children"]));
+function Transition(_ref) {
+ let {
+ items,
+ children
+ } = _ref,
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
-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;
+ return useTransition(items, props)(children);
}
-/**
- * Returns the block attributes changed as a result of the last dispatched
- * action.
- *
- * @param {Object} state Block editor state.
- *
- * @return {Object<string,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
- */
+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);
-function getReusableBlocks(state) {
- var _state$settings$__exp, _state$settings;
+ const value = this._get();
- 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.
- */
+ const nodeType = getAnimatedType(value);
+ setAnimated(this, nodeType.create(value));
+ }
+ advance(_dt) {
+ const value = this._get();
-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.
- */
+ const oldValue = this.get();
-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.
- */
+ if (!isEqual(value, oldValue)) {
+ getAnimated(this).setValue(value);
-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.
- */
+ this._onChange(value, this.idle);
+ }
-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.
- */
+ if (!this.idle && checkIdle(this._active)) {
+ becomeIdle(this);
+ }
+ }
-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.
- */
+ _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;
+ });
-const __experimentalGetActiveBlockIdByBlockNames = Object(rememo["a" /* default */])((state, validBlockNames) => {
- if (!validBlockNames.length) {
- return null;
- } // Check if selected block is a valid entity area.
+ 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);
+ }
- const selectedBlockClientId = getSelectedBlockClientId(state);
+ if (isFrameValue(source)) {
+ if (!source.idle) {
+ this._active.add(source);
+ }
- if (validBlockNames.includes(getBlockName(state, selectedBlockClientId))) {
- return selectedBlockClientId;
- } // Check if first selected block is a child of a valid entity area.
+ priority = Math.max(priority, source.priority + 1);
+ }
+ });
+ this.priority = priority;
+ this._start();
+ }
- const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state);
- const entityAreaParents = getBlockParentsByBlockName(state, selectedBlockClientId || multiSelectedBlockClientIds[0], validBlockNames);
+ _detach() {
+ react_spring_shared_esm_each(react_spring_shared_esm_toArray(this.source), source => {
+ if (hasFluidValue(source)) {
+ removeFluidObserver(source, this);
+ }
+ });
- if (entityAreaParents) {
- // Last parent closest/most interior.
- return Object(external_lodash_["last"])(entityAreaParents);
+ this._active.clear();
+
+ becomeIdle(this);
}
- 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.
- */
+ 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 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");
+function isIdle(source) {
+ return source.idle !== false;
+}
-// EXTERNAL MODULE: external ["wp","i18n"]
-var external_wp_i18n_ = __webpack_require__("l3Sj");
+function checkIdle(active) {
+ return !active.size || Array.from(active).every(isIdle);
+}
-// EXTERNAL MODULE: external ["wp","richText"]
-var external_wp_richText_ = __webpack_require__("qRz9");
+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
+ });
+ }
+}
-// EXTERNAL MODULE: external ["wp","deprecated"]
-var external_wp_deprecated_ = __webpack_require__("NMb1");
-var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_);
+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));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/actions.js
-/**
- * External dependencies
- */
+globals.assign({
+ createStringInterpolator: createStringInterpolator,
+ to: (source, args) => new Interpolation(source, args)
+});
+const react_spring_core_esm_update = frameLoop.advance;
-/**
- * WordPress dependencies
- */
+;// CONCATENATED MODULE: external "ReactDOM"
+var external_ReactDOM_namespaceObject = window["ReactDOM"];
+;// CONCATENATED MODULE: ./node_modules/@react-spring/web/dist/react-spring-web.esm.js
-/**
- * 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.
+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];
+ }
- const {
- __unstableHasCustomAppender
- } = select.getSettings();
+ return target;
+}
- if (__unstableHasCustomAppender) {
- return;
- }
+const react_spring_web_esm_excluded$2 = ["style", "children", "scrollTop", "scrollLeft"];
+const isCustomPropRE = /^--/;
- 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.
- */
+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 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 isFilterElement = instance.nodeName === 'filter' || instance.parentNode && instance.parentNode.nodeName === 'filter';
-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 _ref = props,
+ {
+ style,
+ children,
+ scrollTop,
+ scrollLeft
+ } = _ref,
+ attributes = react_spring_web_esm_objectWithoutPropertiesLoose(_ref, react_spring_web_esm_excluded$2);
- const isBlocksValidToTemplate = !template || templateLock !== 'all' || Object(external_wp_blocks_["doBlocksMatchTemplate"])(blocks, template); // Update if validity has changed.
+ 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())));
- const isValidTemplate = select.isValidTemplate();
+ if (children !== void 0) {
+ instance.textContent = children;
+ }
- if (isBlocksValidToTemplate !== isValidTemplate) {
- dispatch.setTemplateValidity(isBlocksValidToTemplate);
- return isBlocksValidToTemplate;
+ 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;
+ }
+ }
}
-};
-/**
- * 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 */
+ names.forEach((name, i) => {
+ instance.setAttribute(name, values[i]);
+ });
-/**
- * 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.
- */
+ if (scrollTop !== void 0) {
+ instance.scrollTop = scrollTop;
+ }
-function resetSelection(selectionStart, selectionEnd, initialPosition) {
- /* eslint-enable jsdoc/valid-types */
- return {
- type: 'RESET_SELECTION',
- selectionStart,
- selectionEnd,
- initialPosition
- };
+ if (scrollLeft !== void 0) {
+ instance.scrollLeft = scrollLeft;
+ }
}
-/**
- * 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.
- */
+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
+};
-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.
- */
+const prefixKey = (prefix, key) => prefix + key.charAt(0).toUpperCase() + key.substring(1);
-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.
- */
+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);
-function updateBlock(clientId, updates) {
- return {
- type: 'UPDATE_BLOCK',
- clientId,
- updates
- };
-}
-/* eslint-disable jsdoc/valid-types */
+const react_spring_web_esm_excluded$1 = ["x", "y", "z"];
+const domTransforms = /^(matrix|translate|scale|rotate|skew)/;
+const pxTransforms = /^(translate)/;
+const degTransforms = /^(rotate|skew)/;
-/**
- * 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.
- */
+const addUnit = (value, unit) => react_spring_shared_esm_is.num(value) && value !== 0 ? value + unit : value;
-function selectBlock(clientId) {
- let initialPosition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
+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;
- /* 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.
- */
+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 selectPreviousBlock = clientId => _ref4 => {
- let {
- select,
- dispatch
- } = _ref4;
- const previousBlockClientId = select.getPreviousBlockClientId(clientId);
+ const inputs = [];
+ const transforms = [];
- 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.
- */
+ 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)]);
+ }
-const selectNextBlock = clientId => _ref5 => {
- let {
- select,
- dispatch
- } = _ref5;
- const nextBlockClientId = select.getNextBlockClientId(clientId);
+ 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 (nextBlockClientId) {
- dispatch.selectBlock(nextBlockClientId);
+ if (inputs.length) {
+ style.transform = new FluidTransform(inputs, transforms);
+ }
+
+ super(style);
}
-};
-/**
- * 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.
- */
+class FluidTransform extends FluidValue {
+ constructor(inputs, transforms) {
+ super();
+ this._value = null;
+ this.inputs = inputs;
+ this.transforms = transforms;
+ }
-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.
+ get() {
+ return this._value || (this._value = this._get());
+ }
- if (startBlockRootClientId !== endBlockRootClientId) {
- return;
+ _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;
}
- 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.
- */
+ 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)));
+ }
-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.
- */
+ 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)));
+ }
-function toggleSelection() {
- let isSelectionEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
- return {
- type: 'TOGGLE_SELECTION',
- isSelectionEnabled
- };
-}
+ eventObserved(event) {
+ if (event.type == 'change') {
+ this._value = null;
+ }
-function getBlocksWithDefaultStylesApplied(blocks, blockEditorSettings) {
- var _blockEditorSettings$, _blockEditorSettings$2;
+ callFluidObservers(this, event);
+ }
- 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;
+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'];
- if (!Object(external_wp_blocks_["hasBlockSupport"])(blockName, 'defaultStylePicker', true)) {
- return block;
- }
+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);
- if (!preferredStyleVariations[blockName]) {
- return block;
- }
+ return props;
+ }
+});
+const animated = host.animated;
- 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 */
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-moving-animation/index.js
+/**
+ * External dependencies
+ */
/**
- * 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.
+ * WordPress dependencies
*/
-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);
+/**
+ * Simple reducer used to increment a counter.
+ *
+ * @param {number} state Previous counter value.
+ * @return {number} New state value.
+ */
- if (!canInsertBlock) {
- return;
- }
- }
+const counterReducer = state => state + 1;
- dispatch({
- type: 'REPLACE_BLOCKS',
- clientIds,
- blocks,
- time: Date.now(),
- indexToSelect,
- initialPosition,
- meta
- });
- dispatch(ensureDefaultBlock());
+const getAbsolutePosition = element => {
+ return {
+ top: element.offsetTop,
+ left: element.offsetLeft
};
};
/**
- * Action that replaces a single block with one or more replacement blocks.
+ * Hook used to compute the styles required to move a div into a new position.
*
- * @param {(string|string[])} clientId Block client ID to replace.
- * @param {(Object|Object[])} block Replacement block(s).
+ * 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.
*
- * @return {Object} Action object.
+ * @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 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 => {
+function useMovingAnimation(_ref) {
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);
+ 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.
- if (!canMoveBlocks) {
- return;
- }
+ const preserveScrollPosition = (0,external_wp_element_namespaceObject.useMemo)(() => {
+ if (!adjustScrolling || !ref.current) {
+ return () => {};
+ }
- dispatch({
- type,
- clientIds: Object(external_lodash_["castArray"])(clientIds),
- rootClientId
- });
-};
+ const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(ref.current);
-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.
- */
+ if (!scrollContainer) {
+ return () => {};
+ }
-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.
+ const prevRect = ref.current.getBoundingClientRect();
+ return () => {
+ const blockRect = ref.current.getBoundingClientRect();
+ const diff = blockRect.top - prevRect.top;
- if (!canMoveBlocks) {
+ 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 moving inside the same root block the move is always possible.
+ }
+ if (prefersReducedMotion) {
+ // if the animation is disabled and the scroll needs to be adjusted,
+ // just move directly to the final scroll position.
+ preserveScrollPosition();
+ return;
+ }
- 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.
+ 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.
- if (!canRemoveBlocks) {
- return;
- }
+ function onFrameChange(_ref2) {
+ let {
+ x,
+ y
+ } = _ref2;
- 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 (!ref.current) {
+ return;
+ }
- if (!canInsertBlocks) {
- 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;
}
+ }
- dispatch({
- type: 'MOVE_BLOCKS_TO_POSITION',
- fromRootClientId,
- toRootClientId,
- clientIds,
- index
- });
- };
-};
+ 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';
/**
- * Action that moves given block to a new position.
+ * Returns true if two elements are contained within the same block.
*
- * @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.
+ * @param {Element} a First element.
+ * @param {Element} b Second element.
+ *
+ * @return {boolean} Whether elements are in the same block.
*/
-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);
+function isInSameBlock(a, b) {
+ return a.closest(BLOCK_SELECTOR) === b.closest(BLOCK_SELECTOR);
}
/**
- * Action that inserts a single block, optionally at a specific index respective a root block list.
+ * Returns true if an element is considered part of the block and not its inner
+ * blocks or appender.
*
- * @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.
+ * @param {Element} blockElement Block container element.
+ * @param {Element} element Element.
*
- * @return {Object} Action object.
+ * @return {boolean} Whether an element is considered part of the block and not
+ * its inner blocks or appender.
*/
-function insertBlock(block, index, rootClientId, updateSelection, meta) {
- return insertBlocks([block], index, rootClientId, updateSelection, 0, meta);
+function isInsideRootBlock(blockElement, element) {
+ const parentBlock = element.closest([BLOCK_SELECTOR, APPENDER_SELECTOR].join(','));
+ return parentBlock === blockElement;
}
-/* eslint-disable jsdoc/valid-types */
-
/**
- * Action that inserts an array of blocks, optionally at a specific index respective a root block list.
+ * Finds the block client ID given any DOM node inside the block.
*
- * @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.
+ * @param {Node?} node DOM node.
+ *
+ * @return {string|undefined} Client ID or undefined if the node is not part of
+ * a block.
*/
-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;
+function getBlockClientId(node) {
+ while (node && node.nodeType !== node.ELEMENT_NODE) {
+ node = node.parentNode;
+ }
- /* 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'
- });
- }
+ if (!node) {
+ return;
+ }
- blocks = getBlocksWithDefaultStylesApplied(Object(external_lodash_["castArray"])(blocks), select.getSettings());
- const allowedBlocks = [];
+ const elementNode =
+ /** @type {Element} */
+ node;
+ const blockNode = elementNode.closest(BLOCK_SELECTOR);
- for (const block of blocks) {
- const isValid = select.canInsertBlockType(block.name, rootClientId);
+ if (!blockNode) {
+ return;
+ }
- if (isValid) {
- allowedBlocks.push(block);
- }
- }
+ return blockNode.id.slice('block-'.length);
+}
- if (allowedBlocks.length) {
- dispatch({
- type: 'INSERT_BLOCKS',
- blocks: allowedBlocks,
- index,
- rootClientId,
- time: Date.now(),
- updateSelection,
- initialPosition: updateSelection ? initialPosition : null,
- meta
- });
- }
- };
-};
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-focus-first-element.js
/**
- * 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.
+ * External dependencies
*/
-function showInsertionPoint(rootClientId, index) {
- let __unstableOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+/**
+ * WordPress dependencies
+ */
+
+
+
- const {
- __unstableWithInserter
- } = __unstableOptions;
- return {
- type: 'SHOW_INSERTION_POINT',
- rootClientId,
- index,
- __unstableWithInserter
- };
-}
/**
- * Action that hides the insertion point.
- *
- * @return {Object} Action object.
+ * Internal dependencies
*/
-function hideInsertionPoint() {
- return {
- type: 'HIDE_INSERTION_POINT'
- };
-}
+
+
+/** @typedef {import('@wordpress/element').RefObject} RefObject */
+
/**
- * Action that resets the template validity.
+ * Returns the initial position if the block needs to be focussed, `undefined`
+ * otherwise. The initial position is either 0 (start) or -1 (end).
*
- * @param {boolean} isValid template validity flag.
+ * @param {string} clientId Block client ID.
*
- * @return {Object} Action object.
+ * @return {number} The initial position, either 0 (start) or -1 (end).
*/
-function setTemplateValidity(isValid) {
- return {
- type: 'SET_TEMPLATE_VALIDITY',
- isValid
- };
+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]);
}
/**
- * Action that synchronizes the template with the list of blocks.
+ * Transitions focus to the block or inner tabbable when the block becomes
+ * selected and an initial position is set.
*
- * @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} clientId Block client ID.
*
- * @param {string} firstBlockClientId Client ID of the first block to merge.
- * @param {string} secondBlockClientId Client ID of the second block to merge.
+ * @return {RefObject} React ref with the block element.
*/
-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;
- }
+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;
+ }
- 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 (!ref.current) {
+ return;
+ }
+
+ const {
+ ownerDocument
+ } = ref.current; // Do not focus the block if it already contains the active element.
- 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.');
+ 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;
}
- } // A robust way to retain selection position through various transforms
- // is to insert a special character at the position and then recover it.
+ (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(target, isReverse);
+ }, [initialPosition]);
+ return ref;
+}
- const START_OF_SELECTED_AREA = '\u0086'; // Clone the blocks so we don't insert the character in a "live" block.
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-is-hovered.js
+/**
+ * WordPress dependencies
+ */
- 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
+/**
+ * Internal dependencies
+ */
- 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) {
+function listener(event) {
+ if (event.defaultPrevented) {
return;
- } // Calling the merge to update the attributes and remove the block to be merged
+ }
+ 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.
+ */
- 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];
+function useIsHovered() {
+ const isEnabled = (0,external_wp_data_namespaceObject.useSelect)(select => {
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);
- }
+ 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.
- dispatch.replaceBlocks([blockA.clientId, blockB.clientId], [{ ...blockA,
- attributes: { ...blockA.attributes,
- ...updatedAttributes
+ node.classList.remove('is-hovered');
+ };
}
- }, ...blocksWithTheSameType.slice(1)], 0 // If we don't pass the `indexToSelect` it will default to the last block.
- );
-};
+ }, [isEnabled]);
+}
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-block-class-names.js
/**
- * 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.
+ * External dependencies
*/
-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;
- }
+/**
+ * WordPress dependencies
+ */
- 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]);
- }
+/**
+ * Internal dependencies
+ */
- 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.
+ * Returns the class names used for the different states of the block.
*
- * @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.
+ * @param {string} clientId The block client ID.
*
- * @return {Object} Action object.
+ * @return {string} The class names.
*/
-function removeBlock(clientId, selectPrevious) {
- return removeBlocks([clientId], selectPrevious);
+function useBlockClassNames(clientId) {
+ return (0,external_wp_data_namespaceObject.useSelect)(select => {
+ const {
+ 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()
+ });
+ }, [clientId]);
}
-/* eslint-disable jsdoc/valid-types */
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-block-default-class-name.js
/**
- * 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.
+ * WordPress dependencies
*/
-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.
+ * Internal dependencies
+ */
+
+
+/**
+ * Returns the default class name if the block is a light block and it supports
+ * `className`.
*
- * @param {string} clientId Block client ID.
+ * @param {string} clientId The block client ID.
*
- * @return {Object} Action object.
+ * @return {string} The class name, e.g. `wp-block-paragraph`.
*/
-function toggleBlockMode(clientId) {
- return {
- type: 'TOGGLE_BLOCK_MODE',
- clientId
- };
+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
/**
- * Returns an action object used in signalling that the user has begun to type.
- *
- * @return {Object} Action object.
+ * WordPress dependencies
*/
-function startTyping() {
- return {
- type: 'START_TYPING'
- };
-}
+
/**
- * Returns an action object used in signalling that the user has stopped typing.
- *
- * @return {Object} Action object.
+ * Internal dependencies
*/
-function stopTyping() {
- return {
- type: 'STOP_TYPING'
- };
-}
+
/**
- * Returns an action object used in signalling that the user has begun to drag blocks.
+ * Returns the custom class name if the block is a light block.
*
- * @param {string[]} clientIds An array of client ids being dragged
+ * @param {string} clientId The block client ID.
*
- * @return {Object} Action object.
+ * @return {string} The custom class name.
*/
-function startDraggingBlocks() {
- let clientIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- return {
- type: 'START_DRAGGING_BLOCKS',
- clientIds
- };
+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
/**
- * Returns an action object used in signalling that the user has stopped dragging blocks.
- *
- * @return {Object} Action object.
+ * External dependencies
*/
-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.
+ * WordPress dependencies
*/
-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.
+ * Internal dependencies
*/
-function exitFormattedText() {
- return {
- type: 'EXIT_FORMATTED_TEXT'
- };
-}
+
/**
- * Action that changes the position of the user caret.
+ * Returns the class names used for block moving mode.
*
- * @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.
+ * @param {string} clientId The block client ID to insert above.
*
- * @return {Object} Action object.
+ * @return {string} The class names.
*/
-function selectionChange(clientId, attributeKey, startOffset, endOffset) {
- return {
- type: 'SELECTION_CHANGE',
- clientId,
- attributeKey,
- startOffset,
- endOffset
- };
+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
/**
- * 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
+ * WordPress dependencies
+ */
+
+
+/**
+ * Internal dependencies
+ */
+
+
+
+/**
+ * Selects the block if it receives focus.
*
- * @return {Object} Action object
+ * @param {string} clientId Block client ID.
*/
-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"])();
+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);
+ }
- if (!defaultBlockName) {
- return;
- }
+ return;
+ } // If an inner block is focussed, that block is resposible for
+ // setting the selected block.
- const block = Object(external_wp_blocks_["createBlock"])(defaultBlockName, attributes);
- return insertBlock(block, index, rootClientId);
+
+ 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
/**
- * 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.
+ * WordPress dependencies
+ */
+
+
+
+
+/**
+ * Internal dependencies
+ */
+
+
+/**
+ * Adds block behaviour:
+ * - Removes the block on BACKSPACE.
+ * - Inserts a default block on ENTER.
+ * - Disables dragging of block contents.
*
- * @return {Object} Action object
+ * @param {string} clientId Block client ID.
*/
-function updateBlockListSettings(clientId, settings) {
- return {
- type: 'UPDATE_BLOCK_LIST_SETTINGS',
- clientId,
- settings
- };
+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
/**
- * Action that updates the block editor settings.
- *
- * @param {Object} settings Updated settings
- *
- * @return {Object} Action object
+ * WordPress dependencies
*/
-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.
+ * Internal dependencies
*/
-function __unstableSaveReusableBlock(id, updatedId) {
- return {
- type: 'SAVE_REUSABLE_BLOCK_SUCCESS',
- id,
- updatedId
- };
-}
+
/**
- * Action that marks the last block change explicitly as persistent.
+ * Allows navigation mode to be exited by clicking in the selected block.
*
- * @return {Object} Action object.
+ * @param {string} clientId Block client ID.
*/
-function __unstableMarkLastChangeAsPersistent() {
- return {
- type: 'MARK_LAST_CHANGE_AS_PERSISTENT'
- };
+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
/**
- * Action that signals that the next block change should be marked explicitly as not persistent.
- *
- * @return {Object} Action object.
+ * External dependencies
*/
-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.
+ * WordPress dependencies
*/
-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.
+ * WordPress dependencies
*/
-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
+ * Internal dependencies
*/
-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.
+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 blocks = select.getBlocksByClientId(clientIds);
+ const extentNode = ref.current;
- if (Object(external_lodash_["some"])(blocks, block => !block)) {
+ if (!extentNode) {
return;
- } // Return early if blocks don't support multiple usage.
-
+ } // If the block is focused, the browser will already have scrolled into
+ // view if necessary.
- const blockNames = blocks.map(block => block.name);
- if (blockNames.some(blockName => !Object(external_wp_blocks_["hasBlockSupport"])(blockName, 'multiple', true))) {
+ if (extentNode.contains(extentNode.ownerDocument.activeElement)) {
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);
+ 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 (clonedBlocks.length > 1 && updateSelection) {
- dispatch.multiSelect(Object(external_lodash_["first"])(clonedBlocks).clientId, Object(external_lodash_["last"])(clonedBlocks).clientId);
+ if (!scrollContainer) {
+ return;
}
- 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;
- }
+ lib_default()(extentNode, scrollContainer, {
+ onlyScrollIfNeeded: true
+ });
+ }, [isSelectionEnd]);
+ return ref;
+}
- const rootClientId = select.getBlockRootClientId(clientId);
- const isLocked = select.getTemplateLock(rootClientId);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/block-refs-provider.js
- 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
+ * WordPress dependencies
*/
-const insertAfterBlock = clientId => _ref19 => {
+const BlockRefs = (0,external_wp_element_namespaceObject.createContext)();
+function BlockRefsProvider(_ref) {
let {
- select,
- dispatch
- } = _ref19;
-
- if (!clientId) {
- return;
- }
-
- const rootClientId = select.getBlockRootClientId(clientId);
- const isLocked = select.getTemplateLock(rootClientId);
-
- if (isLocked) {
- return;
- }
+ 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);
+}
- const firstSelectedIndex = select.getBlockIndex(clientId);
- return dispatch.insertDefaultBlock({}, rootClientId, firstSelectedIndex + 1);
-};
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-block-refs.js
/**
- * Action that toggles the highlighted block state.
- *
- * @param {string} clientId The block's clientId.
- * @param {boolean} isHighlighted The highlight state.
+ * WordPress dependencies
*/
-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.
+ * Internal dependencies
*/
-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");
+/** @typedef {import('@wordpress/element').RefCallback} RefCallback */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js
-/**
- * WordPress dependencies
- */
+/** @typedef {import('@wordpress/element').RefObject} RefObject */
/**
- * Internal dependencies
+ * 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]);
+}
/**
- * Block editor data store configuration.
+ * Gets a ref pointing to the current block element. Continues to return a
+ * stable ref even if the block client ID changes.
*
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore
+ * @param {string} clientId The client ID to get a ref for.
*
- * @type {Object}
+ * @return {RefObject} A ref containing the element.
*/
-const storeConfig = {
- reducer: store_reducer,
- selectors: selectors_namespaceObject,
- actions: actions_namespaceObject,
- __experimentalUseThunks: true
-};
+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;
+ }
+
+ }), []);
+}
/**
- * Store definition for the block editor namespace.
+ * Return the element for a given client ID. Updates whenever the element
+ * changes, becomes available, or disappears.
*
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
+ * @param {string} clientId The client ID to an element for.
*
- * @type {Object}
+ * @return {Element|null} The block's wrapper element.
*/
-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']
-});
+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;
+}
-/***/ "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__);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-multi-selection.js
/**
* 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.
+ * Internal dependencies
*/
-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');
-};
+
+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');
+ }
+ });
+}
/**
- * Control to display unified font style and weight options.
- *
- * @param {Object} props Component props.
+ * Sets a multi-selection based on the native selection across blocks.
*
- * @return {WPElement} Font appearance control.
+ * @param {string} clientId Block client ID.
*/
-function FontAppearanceControl(props) {
+
+function useMultiSelection(clientId) {
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.
+ 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;
- const combineOptions = () => {
- const combinedOptions = [defaultOption];
- FONT_STYLES.forEach(_ref => {
+ function onSelectionChange(_ref) {
let {
- name: styleName,
- value: styleValue
+ isSelectionEnd
} = _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 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 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 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.
- 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.
+ if (isSelectionEnd) {
+ toggleRichText(node, true);
+ if (selection.rangeCount) {
+ const {
+ commonAncestorContainer
+ } = selection.getRangeAt(0);
- const selectOptions = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(() => {
- if (hasFontStyles && hasFontWeights) {
- return combineOptions();
+ 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]);
+ }
}
- 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.
+ function onSelectionEnd() {
+ ownerDocument.removeEventListener('selectionchange', onSelectionChange); // Equivalent to attaching the listener once.
- const currentSelection = selectOptions.find(option => option.style.fontStyle === fontStyle && option.style.fontWeight === fontWeight) || selectOptions[0]; // Adjusts screen reader description based on styles or weights.
+ 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.
- const getDescribedBy = () => {
- if (!currentSelection) {
- return Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__["__"])('No selected font appearance');
+ rafId = defaultView.requestAnimationFrame(() => {
+ onSelectionChange({
+ isSelectionEnd: true
+ });
+ stopMultiSelect();
+ });
}
- 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);
- }
+ function onMouseLeave(_ref2) {
+ let {
+ buttons
+ } = _ref2;
- 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);
- }
+ // 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;
+ }
- 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);
- };
+ if (!isSelectionEnabled() || !isBlockSelected(clientId)) {
+ return;
+ }
- 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);
+ 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.
-/***/ "Bpkj":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ const startParents = getBlockParents(blockSelectionStart);
-"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__);
+ 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
*/
-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);
+/**
+ * Internal dependencies
+ */
-/***/ }),
-/***/ "Btt3":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+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]);
+}
-"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__);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/index.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`.
+ * WordPress dependencies
*/
-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
+ * Internal dependencies
*/
-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.
+ * If the block count exceeds the threshold, we disable the reordering animation
+ * to avoid laginess.
*/
-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;
-}
+const BLOCK_ANIMATION_THRESHOLD = 200;
/**
- * Retrieves the gradient slug per slug.
+ * This hook is used to lightly mark an element as a block element. The element
+ * should be the outermost element of a block. Call this hook and pass the
+ * returned props to the element to mark as a block. 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 {Array} gradients Gradient Palette
- * @param {string} value Gradient value
- * @return {string} Gradient slug.
+ * @param {Object} props Optional. Props to pass to the element. Must contain
+ * the ref if one is defined.
+ * @param {Object} options Options for internal use only.
+ * @param {boolean} options.__unstableIsHtml
+ *
+ * @return {Object} Props to pass to the element to mark as a block.
*/
-function getGradientSlugByValue(gradients, value) {
- const gradient = __experimentalGetGradientObjectByGradientValue(gradients, value);
-
- return gradient && gradient.slug;
-}
-function __experimentalUseGradient() {
+function useBlockProps() {
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
let {
- gradientAttribute = 'gradient',
- customGradientAttribute = 'customGradient'
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ __unstableIsHtml
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
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]);
+ clientId,
+ className,
+ wrapperProps = {},
+ isAligned
+ } = (0,external_wp_element_namespaceObject.useContext)(BlockListBlockContext);
const {
- gradient,
- customGradient
- } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["useSelect"])(select => {
+ index,
+ mode,
+ name,
+ blockApiVersion,
+ blockTitle,
+ isPartOfSelection,
+ adjustScrolling,
+ enableAnimation
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
- getBlockAttributes
- } = select(_store__WEBPACK_IMPORTED_MODULE_5__[/* store */ "a"]);
- const attributes = getBlockAttributes(clientId) || {};
+ getBlockIndex,
+ getBlockMode,
+ getBlockName,
+ isTyping,
+ getGlobalBlockCount,
+ isBlockSelected,
+ isBlockMultiSelected,
+ isAncestorMultiSelected,
+ isFirstMultiSelectedBlock
+ } = select(store);
+ const isSelected = isBlockSelected(clientId);
+ const isPartOfMultiSelection = isBlockMultiSelected(clientId) || isAncestorMultiSelected(clientId);
+ const blockName = getBlockName(clientId);
+ const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName);
return {
- customGradient: attributes[customGradientAttribute],
- gradient: attributes[gradientAttribute]
+ index: getBlockIndex(clientId),
+ mode: getBlockMode(clientId),
+ name: blockName,
+ blockApiVersion: (blockType === null || blockType === void 0 ? void 0 : blockType.apiVersion) || 1,
+ blockTitle: blockType === null || blockType === void 0 ? void 0 : blockType.title,
+ isPartOfSelection: isSelected || isPartOfMultiSelection,
+ adjustScrolling: isSelected || isFirstMultiSelectedBlock(clientId),
+ enableAnimation: !isTyping() && getGlobalBlockCount() <= BLOCK_ANIMATION_THRESHOLD
};
- }, [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);
+ }, [clientId]); // translators: %s: Type of block (i.e. Text, Image etc)
- let gradientValue;
+ const blockLabel = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Block: %s'), blockTitle);
+ const htmlSuffix = mode === 'html' && !__unstableIsHtml ? '-visual' : '';
+ 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 = useBlockEditContext(); // Ensures it warns only inside the `edit` implementation for the block.
- if (gradient) {
- gradientValue = getGradientValueBySlug(allGradients, gradient);
- } else {
- gradientValue = customGradient;
+ if (blockApiVersion < 2 && clientId === blockEditContext.clientId) {
+ typeof process !== "undefined" && process.env && "production" !== "production" ? 0 : void 0;
}
- return {
- gradientClass,
- gradientValue,
- setGradient
+ return { ...wrapperProps,
+ ...props,
+ ref: mergedRefs,
+ id: `block-${clientId}${htmlSuffix}`,
+ tabIndex: 0,
+ role: 'document',
+ 'aria-label': blockLabel,
+ 'data-block': clientId,
+ 'data-type': name,
+ 'data-title': blockTitle,
+ 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, useBlockClassNames(clientId), useBlockDefaultClassName(clientId), useBlockCustomClassName(clientId), useBlockMovingModeClassNames(clientId)),
+ style: { ...wrapperProps.style,
+ ...props.style
+ }
};
}
-
-
-/***/ }),
-
-/***/ "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
+ * Call within a save function to get the props for the block wrapper.
+ *
+ * @param {Object} props Optional. Props to pass to the element.
*/
-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__) {
+useBlockProps.save = external_wp_blocks_namespaceObject.__unstableGetBlockProps;
-"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
- */
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block.js
/**
- * Internal dependencies
+ * External 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.
+ * WordPress dependencies
*/
-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
+ * Internal 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");
+const BlockListBlockContext = (0,external_wp_element_namespaceObject.createContext)();
/**
- * WordPress dependencies
+ * 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);
+ }
-/**
- * Internal dependencies
- */
-
-
+ if (propsA && propsB && propsA.style && propsB.style) {
+ newProps.style = { ...propsA.style,
+ ...propsB.style
+ };
+ }
+ return newProps;
+}
-function BlockPattern(_ref) {
+function Block(_ref) {
let {
- isDraggable,
- pattern,
- onClick,
- composite
+ children,
+ isHtml,
+ ...props
} = _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"
- });
+ return (0,external_wp_element_namespaceObject.createElement)("div", useBlockProps(props, {
+ __unstableIsHtml: isHtml
+ }), children);
}
-function BlockPatternList(_ref3) {
+function BlockListBlock(_ref2) {
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__);
+ mode,
+ isLocked,
+ canRemove,
+ clientId,
+ isSelected,
+ isSelectionEnabled,
+ className,
+ name,
+ isValid,
+ attributes,
+ wrapperProps,
+ setAttributes,
+ onReplace,
+ onInsertBlocksAfter,
+ onMerge,
+ toggleSelection
+ } = _ref2;
+ const {
+ 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,
+ isSelectionEnabled: isSelectionEnabled,
+ toggleSelection: toggleSelection
+ });
+ const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name); // Determine whether the block has props to apply to the wrapper.
-/**
- * WordPress dependencies
- */
+ if (blockType !== null && blockType !== void 0 && blockType.getEditWrapperProps) {
+ wrapperProps = mergeWrapperProps(wrapperProps, blockType.getEditWrapperProps(attributes));
+ }
-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);
+ 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);
+ }
-/***/ }),
+ let block;
-/***/ "G4zt":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ 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 {
+ block = (0,external_wp_element_namespaceObject.createElement)(Block, wrapperProps, blockEdit);
+ }
-"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
- */
+ 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));
+}
-/**
- * WordPress dependencies
- */
+const applyWithSelect = (0,external_wp_data_namespaceObject.withSelect)((select, _ref3) => {
+ let {
+ clientId,
+ rootClientId
+ } = _ref3;
+ const {
+ isBlockSelected,
+ getBlockMode,
+ isSelectionEnabled,
+ getTemplateLock,
+ __unstableGetBlockWithoutInnerBlocks,
+ canRemoveBlock,
+ canMoveBlock
+ } = select(store);
-/**
- * WordPress dependencies
- */
+ 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 = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, _ref4) => {
+ let {
+ select
+ } = _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).
-/**
- * Internal dependencies
- */
+ 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);
+ },
-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.
+ onInsertBlocksAfter(blocks) {
+ const {
+ clientId,
+ rootClientId
+ } = ownProps;
+ const {
+ getBlockIndex
+ } = select(store);
+ const index = getBlockIndex(clientId);
+ insertBlocks(blocks, index + 1, rootClientId);
+ },
- Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(() => {
- if (!isSelectionEnd) {
- return;
- }
+ onMerge(forward) {
+ const {
+ clientId
+ } = ownProps;
+ const {
+ getPreviousBlockClientId,
+ getNextBlockClientId
+ } = select(store);
- const extentNode = ref.current;
+ if (forward) {
+ const nextBlockClientId = getNextBlockClientId(clientId);
- if (!extentNode) {
- return;
- } // If the block is focused, the browser will already have scrolled into
- // view if necessary.
+ if (nextBlockClientId) {
+ mergeBlocks(clientId, nextBlockClientId);
+ }
+ } else {
+ const previousBlockClientId = getPreviousBlockClientId(clientId);
+ if (previousBlockClientId) {
+ mergeBlocks(previousBlockClientId, clientId);
+ }
+ }
+ },
- if (extentNode.contains(extentNode.ownerDocument.activeElement)) {
- return;
- }
+ onReplace(blocks, indexToSelect, initialPosition) {
+ if (blocks.length && !(0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(blocks[blocks.length - 1])) {
+ __unstableMarkLastChangeAsPersistent();
+ }
- 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.
+ replaceBlocks([ownProps.clientId], blocks, indexToSelect, initialPosition);
+ },
- if (!scrollContainer) {
- return;
+ toggleSelection(selectionEnabled) {
+ toggleSelection(selectionEnabled);
}
- 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");
-
+ };
+});
+/* 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
-/**
- * External dependencies
- */
/**
* 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
/**
- * Internal dependencies
+ * WordPress 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 globalTips = [(0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('While writing, you can press <kbd>/</kbd> 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 <kbd>space</kbd> 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 <kbd>backspace</kbd> 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.")];
- 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));
+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
-/***/ "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
- http://www.jacklmoore.com/autosize
-*/
-(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__));
- } else { var mod; }
-})(this, function (module, exports) {
- 'use strict';
-
- var map = typeof Map === "function" ? new Map() : function () {
- var keys = [];
- var values = [];
-
- return {
- has: function has(key) {
- return keys.indexOf(key) > -1;
- },
- get: function get(key) {
- return values[keys.indexOf(key)];
- },
- set: function set(key, value) {
- if (keys.indexOf(key) === -1) {
- keys.push(key);
- values.push(value);
- }
- },
- delete: function _delete(key) {
- var index = keys.indexOf(key);
- if (index > -1) {
- keys.splice(index, 1);
- values.splice(index, 1);
- }
- }
- };
- }();
-
- var createEvent = function createEvent(name) {
- return new Event(name, { bubbles: true });
- };
- try {
- new Event('test');
- } catch (e) {
- // IE does not support `new Event()`
- createEvent = function createEvent(name) {
- var evt = document.createEvent('Event');
- evt.initEvent(name, true, false);
- return evt;
- };
- }
-
- function assign(ta) {
- if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;
-
- var heightOffset = null;
- var clientWidth = null;
- var cachedHeight = null;
+ */
- function init() {
- var style = window.getComputedStyle(ta, null);
+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);
- if (style.resize === 'vertical') {
- ta.style.resize = 'none';
- } else if (style.resize === 'both') {
- ta.style.resize = 'horizontal';
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-icon/index.js
- if (style.boxSizing === 'content-box') {
- heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));
- } else {
- heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
- }
- // Fix when a textarea is not on document body and heightOffset is Not a Number
- if (isNaN(heightOffset)) {
- heightOffset = 0;
- }
- update();
- }
+/**
+ * External dependencies
+ */
- function changeOverflow(value) {
- {
- // Chrome/Safari-specific fix:
- // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space
- // made available by removing the scrollbar. The following forces the necessary text reflow.
- var width = ta.style.width;
- ta.style.width = '0px';
- // Force reflow:
- /* jshint ignore:start */
- ta.offsetWidth;
- /* jshint ignore:end */
- ta.style.width = width;
- }
+/**
+ * WordPress dependencies
+ */
- ta.style.overflowY = value;
- }
- function getParentOverflows(el) {
- var arr = [];
- while (el && el.parentNode && el.parentNode instanceof Element) {
- if (el.parentNode.scrollTop) {
- arr.push({
- node: el.parentNode,
- scrollTop: el.parentNode.scrollTop
- });
- }
- el = el.parentNode;
- }
- return arr;
- }
- function resize() {
- if (ta.scrollHeight === 0) {
- // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.
- return;
- }
+function BlockIcon(_ref) {
+ var _icon;
- var overflows = getParentOverflows(ta);
- var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)
+ let {
+ icon,
+ showColors = false,
+ className
+ } = _ref;
- ta.style.height = '';
- ta.style.height = ta.scrollHeight + heightOffset + 'px';
+ if (((_icon = icon) === null || _icon === void 0 ? void 0 : _icon.src) === 'block-default') {
+ icon = {
+ src: block_default
+ };
+ }
- // used to check if an update is actually necessary on window.resize
- clientWidth = ta.clientWidth;
+ 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);
+}
- // prevents scroll-position jumping
- overflows.forEach(function (el) {
- el.node.scrollTop = el.scrollTop;
- });
+/* harmony default export */ var block_icon = ((0,external_wp_element_namespaceObject.memo)(BlockIcon));
- if (docTop) {
- document.documentElement.scrollTop = docTop;
- }
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-card/index.js
- function update() {
- resize();
- var styleHeight = Math.round(parseFloat(ta.style.height));
- var computed = window.getComputedStyle(ta, null);
+/**
+ * WordPress dependencies
+ */
- // Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box
- var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;
+/**
+ * Internal dependencies
+ */
- // The actual height not matching the style height (set via the resize method) indicates that
- // the max-height has been exceeded, in which case the overflow should be allowed.
- if (actualHeight < styleHeight) {
- if (computed.overflowY === 'hidden') {
- changeOverflow('scroll');
- resize();
- actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
- }
- } else {
- // Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands.
- if (computed.overflowY !== 'hidden') {
- changeOverflow('hidden');
- resize();
- actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;
- }
- }
- if (cachedHeight !== actualHeight) {
- cachedHeight = actualHeight;
- var evt = createEvent('autosize:resized');
- try {
- ta.dispatchEvent(evt);
- } catch (err) {
- // Firefox will throw an error on dispatchEvent for a detached element
- // https://bugzilla.mozilla.org/show_bug.cgi?id=889376
- }
- }
- }
- var pageResize = function pageResize() {
- if (ta.clientWidth !== clientWidth) {
- update();
- }
- };
+function BlockCard(_ref) {
+ let {
+ title,
+ icon,
+ description,
+ blockType
+ } = _ref;
- var destroy = function (style) {
- window.removeEventListener('resize', pageResize, false);
- ta.removeEventListener('input', update, false);
- ta.removeEventListener('keyup', update, false);
- ta.removeEventListener('autosize:destroy', destroy, false);
- ta.removeEventListener('autosize:update', update, false);
+ if (blockType) {
+ external_wp_deprecated_default()('`blockType` property in `BlockCard component`', {
+ since: '5.7',
+ alternative: '`title, icon and description` properties'
+ });
+ ({
+ title,
+ icon,
+ description
+ } = blockType);
+ }
- Object.keys(style).forEach(function (key) {
- ta.style[key] = style[key];
- });
+ 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)));
+}
- map.delete(ta);
- }.bind(ta, {
- height: ta.style.height,
- resize: ta.style.resize,
- overflowY: ta.style.overflowY,
- overflowX: ta.style.overflowX,
- wordWrap: ta.style.wordWrap
- });
+/* harmony default export */ var block_card = (BlockCard);
- ta.addEventListener('autosize:destroy', destroy, false);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/with-registry-provider.js
- // IE9 does not fire onpropertychange or oninput for deletions,
- // so binding to onkeyup to catch most of those events.
- // There is no way that I know of to detect something like 'cut' in IE9.
- if ('onpropertychange' in ta && 'oninput' in ta) {
- ta.addEventListener('keyup', update, false);
- }
- window.addEventListener('resize', pageResize, false);
- ta.addEventListener('input', update, false);
- ta.addEventListener('autosize:update', update, false);
- ta.style.overflowX = 'hidden';
- ta.style.wordWrap = 'break-word';
- map.set(ta, {
- destroy: destroy,
- update: update
- });
+/**
+ * WordPress dependencies
+ */
- init();
- }
- function destroy(ta) {
- var methods = map.get(ta);
- if (methods) {
- methods.destroy();
- }
- }
- function update(ta) {
- var methods = map.get(ta);
- if (methods) {
- methods.update();
- }
- }
+/**
+ * Internal dependencies
+ */
- var autosize = null;
- // Do nothing in Node.js environment and IE8 (or lower)
- if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
- autosize = function autosize(el) {
- return el;
- };
- autosize.destroy = function (el) {
- return el;
- };
- autosize.update = function (el) {
- return el;
- };
- } else {
- autosize = function autosize(el, options) {
- if (el) {
- Array.prototype.forEach.call(el.length ? el : [el], function (x) {
- return assign(x, options);
- });
- }
- return el;
- };
- autosize.destroy = function (el) {
- if (el) {
- Array.prototype.forEach.call(el.length ? el : [el], destroy);
- }
- return el;
- };
- autosize.update = function (el) {
- if (el) {
- Array.prototype.forEach.call(el.length ? el : [el], update);
- }
- return el;
- };
- }
- exports.default = autosize;
- module.exports = exports['default'];
-});
+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));
+ }
-/***/ "GkEL":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ 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]);
-"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__);
+ 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
@@ -24030,159 +17720,281 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
+/**
+ * Internal dependencies
+ */
-function hasOnlyToolbarItem(elements) {
- const dataProp = 'toolbarItem';
- return !elements.some(element => !(dataProp in element.dataset));
-}
+/**
+ * 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.
+ */
-function getAllToolbarItemsIn(container) {
- return Array.from(container.querySelectorAll('[data-toolbar-item]'));
-}
+/**
+ * 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 hasFocusWithin(container) {
- return container.contains(container.ownerDocument.activeElement);
-}
+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);
-function focusFirstTabbableIn(container) {
- const [firstTabbable] = _wordpress_dom__WEBPACK_IMPORTED_MODULE_4__["focus"].tabbable.find(container);
+ 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.
- 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
- * <Toolbar /> 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.
+ __unstableMarkNextChangeAsNotPersistent();
- 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 (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 (!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'
+ 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;
+ }
+
+ 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()
+ }
+ });
+ }
- 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
+ previousAreBlocksDifferent = areBlocksDifferent;
});
- return () => observer.disconnect();
- }, [isAccessibleToolbar]);
- return isAccessibleToolbar;
+ return () => unsubscribe();
+ }, [registry, clientId]);
}
-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
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/provider/index.js
- 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;
+/**
+ * WordPress dependencies
+ */
- 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.
+/**
+ * Internal dependencies
+ */
- 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);
+/** @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);
+}
-/***/ "GvwK":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/* harmony default export */ var provider = (with_registry_provider(BlockEditorProvider));
-"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");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-preview/live.js
/**
@@ -24194,161 +18006,223 @@ function NavigableToolbar(_ref) {
*/
-
-function BlockCard(_ref) {
+function LiveBlockPreview(_ref) {
let {
- title,
- icon,
- description,
- blockType
+ 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)));
+}
- 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);
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-selection-clearer/index.js
- 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);
+/**
+ * WordPress dependencies
+ */
+
+
+/**
+ * Internal dependencies
+ */
-/***/ }),
-/***/ "HC45":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/**
+ * 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.
+ */
-"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");
+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 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));
+
+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'.
+ */
-/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(InserterListboxRow));
+function getDeepestNode(node, type) {
+ const child = type === 'start' ? 'firstChild' : 'lastChild';
+ const sibling = type === 'start' ? 'nextSibling' : 'previousSibling';
-/***/ }),
+ while (node[child]) {
+ node = node[child];
-/***/ "HSyU":
-/***/ (function(module, exports) {
+ while (node.nodeType === node.TEXT_NODE && /^[ \t\n]*$/.test(node.data) && node[sibling]) {
+ node = node[sibling];
+ }
+ }
-(function() { module.exports = window["wp"]["blocks"]; }());
+ return node;
+}
-/***/ }),
+function selector(select) {
+ const {
+ isMultiSelecting,
+ getMultiSelectedBlockClientIds,
+ hasMultiSelection,
+ getSelectedBlockClientId
+ } = select(store);
+ return {
+ isMultiSelecting: isMultiSelecting(),
+ multiSelectedBlockClientIds: getMultiSelectedBlockClientIds(),
+ hasMultiSelection: hasMultiSelection(),
+ selectedBlockClientId: getSelectedBlockClientId()
+ };
+}
-/***/ "HgtZ":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+function use_multi_selection_useMultiSelection() {
+ const {
+ isMultiSelecting,
+ multiSelectedBlockClientIds,
+ hasMultiSelection,
+ selectedBlockClientId
+ } = (0,external_wp_data_namespaceObject.useSelect)(selector, []);
+ const selectedRef = useBlockRef(selectedBlockClientId); // These must be in the right DOM order.
-"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
- */
+ 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.
+ */
-/**
- * Internal dependencies
- */
+ 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();
-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;
+ 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 {
- getBlockName,
- isFirstMultiSelectedBlock,
- getMultiSelectedBlockClientIds
- } = select(_store__WEBPACK_IMPORTED_MODULE_2__[/* store */ "a"]);
+ length
+ } = multiSelectedBlockClientIds;
- if (isFirstMultiSelectedBlock(clientId)) {
- return getMultiSelectedBlockClientIds().every(id => getBlockName(id) === name);
- }
+ if (length < 2) {
+ return;
+ } // The block refs might not be immediately available
+ // when dragging blocks into another block.
- return false;
- }, [clientId, isSelected, name]);
-}
+ if (!startRef.current || !endRef.current) {
+ return;
+ } // For some browsers, like Safari, it is important that focus happens
+ // BEFORE selection.
-/***/ }),
-/***/ "I5Hl":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ 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.
-"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");
+ 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]);
+}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-tab-nav.js
-/**
- * External dependencies
- */
/**
* WordPress dependencies
@@ -24358,166 +18232,191 @@ function useDisplayBlockControls() {
-
/**
* 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;
+function isFormElement(element) {
+ const {
+ tagName
+ } = element;
+ return tagName === 'INPUT' || tagName === 'BUTTON' || tagName === 'SELECT' || tagName === 'TEXTAREA';
+}
- 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');
+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 {
+ hasMultiSelection,
+ getSelectedBlockClientId,
+ getBlockCount
+ } = (0,external_wp_data_namespaceObject.useSelect)(store);
+ const {
+ 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 {
+ 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();
+ }
+ }
+
+ 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;
}
- 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 (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 (isToggleButton || hasSingleBlockType) {
- inserterButton = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Tooltip"], {
- text: label
- }, inserterButton);
+
+ if (event.keyCode !== external_wp_keycodes_namespaceObject.TAB) {
+ return;
}
- return inserterButton;
- },
- isAppender: true
- });
-}
-/**
- * Use `ButtonBlockAppender` instead.
- *
- * @deprecated
- */
+ 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.
-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));
+ 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.
-/***/ "JDWi":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ next.current.focus({
+ preventScroll: true
+ });
+ }
-"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
- */
+ 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
-/**
- * Internal dependencies
- */
+ function preventScrollOnTab(event) {
+ var _event$target;
-/**
- * Allows navigation mode to be exited by clicking in the selected block.
- *
- * @param {string} clientId Block client ID.
- */
+ if (event.keyCode !== external_wp_keycodes_namespaceObject.TAB) {
+ return;
+ }
-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 (((_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.getAttribute('role')) === 'region') {
+ return;
+ }
- if (isBlockSelected(clientId)) {
- setNavigationMode(false);
- } else {
- selectBlock(clientId);
- }
+ 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
+ });
}
}
- node.addEventListener('mousedown', onMouseDown);
+ const {
+ ownerDocument
+ } = node;
+ const {
+ defaultView
+ } = ownerDocument;
+ defaultView.addEventListener('keydown', preventScrollOnTab);
+ node.addEventListener('keydown', onKeyDown);
+ node.addEventListener('focusout', onFocusOut);
return () => {
- node.addEventListener('mousedown', onMouseDown);
+ defaultView.removeEventListener('keydown', preventScrollOnTab);
+ node.removeEventListener('keydown', onKeyDown);
+ node.removeEventListener('focusout', onFocusOut);
};
- }, [clientId, isNavigationMode, isBlockSelected, setNavigationMode]);
+ }, []);
+ const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([container, ref]);
+ return [before, mergedRefs, after];
}
-
-/***/ }),
-
-/***/ "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");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-arrow-nav.js
/**
* External dependencies
*/
@@ -24529,288 +18428,277 @@ function useNavModeExit(clientId) {
+
/**
* 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.
+ * Returns true if the element should consider edge navigation upon a keyboard
+ * event of the given directional key code, or false otherwise.
*
- * 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 {Element} element HTML element to test.
+ * @param {number} keyCode KeyboardEvent keyCode to test.
+ * @param {boolean} hasModifier Whether a modifier is pressed.
*
- * @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.
+ * @return {boolean} Whether element should consider edge navigation.
*/
-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.
+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.
- __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));
+ 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.
+ */
- if (subscribed.current) {
- pendingChanges.current.incoming = storeBlocks;
- }
+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);
- __unstableMarkNextChangeAsNotPersistent();
+ 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.
- 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.
+ focusableNodes = focusableNodes.slice(focusableNodes.indexOf(target) + 1);
+ let targetRect;
+ if (onlyVertical) {
+ targetRect = target.getBoundingClientRect();
+ }
- 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.
+ 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.
- 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();
+ if (node.isContentEditable && node.contentEditable !== 'true') {
+ return false;
}
- }, [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 (onlyVertical) {
+ const nodeRect = node.getBoundingClientRect();
- if (!isStillControlled) {
- return;
+ if (nodeRect.left >= targetRect.right || nodeRect.right <= targetRect.left) {
+ return false;
}
+ }
- const newIsPersistent = isLastBlockChangePersistent();
- const newBlocks = getBlocks(clientId);
- const areBlocksDifferent = newBlocks !== blocks;
- blocks = newBlocks;
+ return true;
+ }
- 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.
+ return (0,external_lodash_namespaceObject.find)(focusableNodes, isTabCandidate);
+}
+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 onMouseDown() {
+ verticalRect = null;
+ }
- const didPersistenceChange = previousAreBlocksDifferent && !areBlocksDifferent && newIsPersistent && !isPersistent;
+ 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 (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.
+ if (nextSelectionEndClientId) {
+ if (selectionStartClientId === nextSelectionEndClientId) {
+ selectBlock(nextSelectionEndClientId);
+ } else {
+ multiSelect(selectionStartClientId || selectedBlockClientId, nextSelectionEndClientId);
+ }
+ }
+ }
- pendingChanges.current.outgoing.push(blocks); // Inform the controlling entity that changes have been made to
- // the block-editor store they should be aware about.
+ function moveSelection(isReverse) {
+ const selectedFirstClientId = getFirstMultiSelectedBlockClientId();
+ const selectedLastClientId = getLastMultiSelectedBlockClientId();
+ const focusedBlockClientId = isReverse ? selectedFirstClientId : selectedLastClientId;
- const updateParent = isPersistent ? onChangeRef.current : onInputRef.current;
- updateParent(blocks, {
- selection: {
- selectionStart: getSelectionStart(),
- selectionEnd: getSelectionEnd(),
- initialPosition: getSelectedBlocksInitialCaretPosition()
- }
- });
+ 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.
+ */
- previousAreBlocksDifferent = areBlocksDifferent;
- });
- return () => unsubscribe();
- }, [registry, clientId]);
-}
+ 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;
-/***/ "JRTi":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (hasMultiSelection()) {
+ if (isNav) {
+ const action = isShift ? expandSelection : moveSelection;
+ action(isReverse);
+ event.preventDefault();
+ }
-"use strict";
+ 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.
-// EXPORTS
-__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ BlockEdit; });
-// UNUSED EXPORTS: useBlockEditContext
+ 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).
+
-// EXTERNAL MODULE: external ["wp","element"]
-var external_wp_element_ = __webpack_require__("GRId");
+ if (event.defaultPrevented) {
+ return;
+ }
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
-var esm_extends = __webpack_require__("wx14");
+ if (!isNav) {
+ return;
+ } // Abort if our current target is not a candidate for navigation
+ // (e.g. preserve native input behaviors).
-// 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");
+ 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.
-// 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");
+ const isReverseDir = (0,external_wp_dom_namespaceObject.isRTL)(target) ? !isReverse : isReverse;
+ const {
+ keepCaretInsideBlock
+ } = getSettings();
+ const selectedBlockClientId = getSelectedBlockClientId();
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-context/index.js
-var block_context = __webpack_require__("uoCR");
+ if (isShift) {
+ const selectionEndClientId = getMultiSelectedBlocksEndClientId();
+ const selectionBeforeEndClientId = getPreviousBlockClientId(selectionEndClientId || selectedBlockClientId);
+ const selectionAfterEndClientId = getNextBlockClientId(selectionEndClientId || selectedBlockClientId);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/edit.js
+ 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 && (0,external_wp_dom_namespaceObject.isVerticalEdge)(target, isReverse) && !keepCaretInsideBlock) {
+ const closestTabbable = getClosestTabbable(target, isReverse, node, true);
+ 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);
+ };
+ }, []);
+}
+;// 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
/**
* External dependencies
*/
-
/**
* WordPress dependencies
*/
@@ -24818,68 +18706,76 @@ var block_context = __webpack_require__("uoCR");
+
/**
* 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 => {
+function useSelectAll() {
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.
+ 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;
+ }
- const context = Object(external_wp_element_["useMemo"])(() => {
- return blockType && blockType.usesContext ? Object(external_lodash_["pick"])(blockContext, blockType.usesContext) : DEFAULT_BLOCK_CONTEXT;
- }, [blockType, blockContext]);
+ if (!(0,external_wp_dom_namespaceObject.isEntirelySelected)(event.target)) {
+ return;
+ }
- 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 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 Component = blockType.edit || blockType.save;
+ const firstClientId = (0,external_lodash_namespaceObject.first)(blockClientIds);
+ const lastClientId = (0,external_lodash_namespaceObject.last)(blockClientIds);
- 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
+ if (firstClientId === lastClientId) {
+ return;
+ }
+ multiSelect(firstClientId, lastClientId);
+ event.preventDefault();
+ }
- 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));
+ node.addEventListener('keydown', onKeyDown);
+ return () => {
+ node.removeEventListener('keydown', onKeyDown);
+ };
+ }, []);
+}
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/index.js
-// 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
+/**
+ * External dependencies
+ */
/**
* WordPress dependencies
*/
+
+
+
+
/**
* Internal dependencies
*/
@@ -24887,46 +18783,48 @@ var block_edit_context = __webpack_require__("ur0x");
-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));
+
+
+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;
+ }
+
+ node.setAttribute('aria-label', (0,external_wp_i18n_namespaceObject.__)('Multiple selected blocks'));
+ return () => {
+ node.removeAttribute('aria-label');
+ };
+ }, [hasMultiSelection])]), after];
}
+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);
+}
+/**
+ * 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.
+ */
-/***/ }),
-/***/ "JUfZ":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/* harmony default export */ var writing_flow = ((0,external_wp_element_namespaceObject.forwardRef)(WritingFlow));
-"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");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/iframe/index.js
@@ -24941,2009 +18839,1647 @@ function BlockEdit(props) {
+
/**
* 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 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;
+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;
}
- } // Shifts the toolbar to make room for the parent block selector.
+ const {
+ ownerNode,
+ cssRules
+ } = styleSheet;
- 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
- }));
-}
+ if (!cssRules) {
+ return;
+ } // Generally, ignore inline styles. We add inline styles belonging to a
+ // stylesheet later, which may or may not match the selectors.
-/* harmony default export */ __webpack_exports__["a"] = (BlockContextualToolbar);
+ 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.
-/***/ }),
-/***/ "JygI":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (ownerNode.id === 'wp-reset-editor-styles-css') {
+ return;
+ }
-"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");
+ 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));
+ }
+ }
+ });
+}
/**
- * External dependencies
+ * 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.
*/
-/**
- * WordPress dependencies
- */
+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);
+ }
+}
-/**
- * Internal dependencies
- */
+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;
+
+ 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;
-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);
+ 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;
- const onFocus = () => setIsFocused(true);
+ if (readyState !== 'interactive' && readyState !== 'complete') {
+ return false;
+ }
- const onBlur = () => setIsFocused(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).
- if (!canMove || isFirst && isLast && !rootClientId) {
- return null;
- }
+ 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;
+ }
- 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.
+ if (setDocumentIfReady()) {
+ return;
+ } // Document is not immediately loaded in Firefox.
- 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)))));
+ 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 */ __webpack_exports__["a"] = (Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_7__["withSelect"])((select, _ref2) => {
- var _getBlockListSettings;
+/* harmony default export */ var iframe = ((0,external_wp_element_namespaceObject.forwardRef)(Iframe));
- 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));
+;// 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<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.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));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])}
-/***/ }),
+;// CONCATENATED MODULE: ./node_modules/colord/plugins/a11y.mjs
+var a11y_o=function(o){var t=o/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},a11y_t=function(t){return.2126*a11y_o(t.r)+.7152*a11y_o(t.g)+.0722*a11y_o(t.b)};/* harmony default export */ function a11y(o){o.prototype.luminance=function(){return o=a11y_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=a11y_t(e),d=a11y_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}}
+
+// EXTERNAL MODULE: ./node_modules/traverse/index.js
+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
+/* 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 */ function parse(css, options) {
+ options = options || {};
+ /**
+ * Positional.
+ */
-/***/ "Jyyd":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ let lineno = 1;
+ let column = 1;
+ /**
+ * Update lineno and column based on `str`.
+ */
-"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
- */
+ function updatePosition(str) {
+ const lines = str.match(/\n/g);
-const {
- Fill: __unstableBlockSettingsMenuFirstItem,
- Slot
-} = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('__unstableBlockSettingsMenuFirstItem');
-__unstableBlockSettingsMenuFirstItem.Slot = Slot;
-/* harmony default export */ __webpack_exports__["a"] = (__unstableBlockSettingsMenuFirstItem);
+ if (lines) {
+ lineno += lines.length;
+ }
+ const i = str.lastIndexOf('\n'); // eslint-disable-next-line no-bitwise
-/***/ }),
+ column = ~i ? str.length - i : column + str.length;
+ }
+ /**
+ * Mark position and patch `node.position`.
+ */
-/***/ "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
- */
+ function position() {
+ const start = {
+ line: lineno,
+ column
+ };
+ return function (node) {
+ node.position = new Position(start);
+ whitespace();
+ return node;
+ };
+ }
+ /**
+ * Store position information for a node
+ */
-/**
- * Internal dependencies
- */
+
+ function Position(start) {
+ this.start = start;
+ this.end = {
+ line: lineno,
+ column
+ };
+ this.source = options.source;
+ }
+ /**
+ * Non-enumerable source string
+ */
+ Position.prototype.content = css;
+ /**
+ * Error `msg`.
+ */
+ const errorsList = [];
-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;
+ function error(msg) {
+ const err = new Error(options.source + ':' + lineno + ':' + column + ': ' + msg);
+ err.reason = msg;
+ err.filename = options.source;
+ err.line = lineno;
+ err.column = column;
+ err.source = css;
- // Always add the `none` option if not exists.
- if (!controls.includes('none')) {
- controls = ['none', ...controls];
+ if (options.silent) {
+ errorsList.push(err);
+ } else {
+ throw err;
+ }
}
+ /**
+ * Parse stylesheet.
+ */
- 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();
+
+ function stylesheet() {
+ const rulesList = rules();
return {
- wideControlsEnabled: settings.alignWide,
- themeSupportsLayout: settings.supportsLayout
+ type: 'stylesheet',
+ stylesheet: {
+ source: options.source,
+ rules: rulesList,
+ parsingErrors: errorsList
+ }
};
- }, []);
- 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);
+ }
+ /**
+ * Opening brace.
+ */
- 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 [];
- }
+ function open() {
+ return match(/^{\s*/);
+ }
+ /**
+ * Closing brace.
+ */
- return alignments;
- } // Starting here, it's the fallback for themes not supporting the layout config.
+
+ function close() {
+ return match(/^}/);
+ }
+ /**
+ * Parse ruleset.
+ */
- if (layoutType.name !== 'default') {
- return [];
+ function rules() {
+ let node;
+ const accumulator = [];
+ whitespace();
+ comments(accumulator);
+
+ while (css.length && css.charAt(0) !== '}' && (node = atrule() || rule())) {
+ if (node !== false) {
+ accumulator.push(node);
+ comments(accumulator);
+ }
+ }
+
+ return accumulator;
}
+ /**
+ * Match `re` and return captures.
+ */
- 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 [];
+ function match(re) {
+ const m = re.exec(css);
+
+ if (!m) {
+ return;
+ }
+
+ const str = m[0];
+ updatePosition(str);
+ css = css.slice(str.length);
+ return m;
+ }
+ /**
+ * Parse whitespace.
+ */
+
+
+ function whitespace() {
+ match(/^\s*/);
}
+ /**
+ * Parse comments;
+ */
- return enabledControls;
-}
+ function comments(accumulator) {
+ let c;
+ accumulator = accumulator || []; // eslint-disable-next-line no-cond-assign
-/***/ }),
+ while (c = comment()) {
+ if (c !== false) {
+ accumulator.push(c);
+ }
+ }
-/***/ "K8zD":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ return accumulator;
+ }
+ /**
+ * Parse comment.
+ */
-"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__);
+ function comment() {
+ const pos = position();
-/**
- * WordPress dependencies
- */
+ if ('/' !== css.charAt(0) || '*' !== css.charAt(1)) {
+ return;
+ }
-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);
+ let i = 2;
+ while ('' !== css.charAt(i) && ('*' !== css.charAt(i) || '/' !== css.charAt(i + 1))) {
+ ++i;
+ }
-/***/ }),
+ i += 2;
-/***/ "K9lf":
-/***/ (function(module, exports) {
+ if ('' === css.charAt(i - 1)) {
+ return error('End of comment missing');
+ }
-(function() { module.exports = window["wp"]["compose"]; }());
+ const str = css.slice(2, i - 2);
+ column += 2;
+ updatePosition(str);
+ css = css.slice(i);
+ column += 2;
+ return pos({
+ type: 'comment',
+ comment: str
+ });
+ }
+ /**
+ * Parse selector.
+ */
-/***/ }),
-/***/ "KyyN":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ function selector() {
+ const m = match(/^([^{]+)/);
-"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");
+ if (!m) {
+ return;
+ } // FIXME: Remove all comments from selectors http://ostermiller.org/findcomment.html
-/**
- * External dependencies
- */
+ return trim(m[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, '').replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function (matched) {
+ return matched.replace(/,/g, '\u200C');
+ }).split(/\s*(?![^(]*\)),\s*/).map(function (s) {
+ return s.replace(/\u200C/g, ',');
+ });
+ }
+ /**
+ * Parse declaration.
+ */
+ function declaration() {
+ const pos = position(); // prop
-/**
- * WordPress dependencies
- */
+ let prop = match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
+ if (!prop) {
+ return;
+ }
-/**
- * Internal dependencies
- */
+ prop = trim(prop[0]); // :
+ if (!match(/^:\s*/)) {
+ return error("property missing ':'");
+ } // val
-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 val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/);
+ const ret = pos({
+ type: 'declaration',
+ property: prop.replace(commentre, ''),
+ value: val ? trim(val[0]).replace(commentre, '') : ''
+ }); // ;
- const {
- ownerDocument
- } = node;
- const {
- defaultView,
- body
- } = ownerDocument;
- const canvas = ownerDocument.querySelector(EDITOR_STYLES_SELECTOR);
- let backgroundColor;
+ match(/^[;\s]*/);
+ return ret;
+ }
+ /**
+ * Parse declarations.
+ */
- 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.
+ function declarations() {
+ const decls = [];
- if (colordBackgroundColor.luminance() > 0.5 || colordBackgroundColor.alpha() === 0) {
- body.classList.remove('is-dark-theme');
- } else {
- body.classList.add('is-dark-theme');
+ if (!open()) {
+ return error("missing '{'");
}
- }, [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)));
-}
+ comments(decls); // declarations
+ let decl; // eslint-disable-next-line no-cond-assign
-/***/ }),
+ while (decl = declaration()) {
+ if (decl !== false) {
+ decls.push(decl);
+ comments(decls);
+ }
+ }
-/***/ "LolH":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (!close()) {
+ return error("missing '}'");
+ }
-"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");
+ return decls;
+ }
+ /**
+ * Parse keyframe.
+ */
-/**
- * WordPress dependencies
- */
+ function keyframe() {
+ let m;
+ const vals = [];
+ const pos = position(); // eslint-disable-next-line no-cond-assign
+ while (m = match(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/)) {
+ vals.push(m[1]);
+ match(/^,\s*/);
+ }
+ if (!vals.length) {
+ return;
+ }
-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.')));
-}
+ return pos({
+ type: 'keyframe',
+ values: vals,
+ declarations: declarations()
+ });
+ }
+ /**
+ * Parse keyframes.
+ */
-/* harmony default export */ __webpack_exports__["a"] = (InserterNoResults);
+ function atkeyframes() {
+ const pos = position();
+ let m = match(/^@([-\w]+)?keyframes\s*/);
-/***/ }),
+ if (!m) {
+ return;
+ }
-/***/ "M+co":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ const vendor = m[1]; // identifier
-"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");
+ m = match(/^([-\w]+)\s*/);
+ if (!m) {
+ return error('@keyframes missing name');
+ }
+ const name = m[1];
-/**
- * WordPress dependencies
- */
+ if (!open()) {
+ return error("@keyframes missing '{'");
+ }
+ let frame;
+ let frames = comments(); // eslint-disable-next-line no-cond-assign
-/**
- * Internal dependencies
- */
+ while (frame = keyframe()) {
+ frames.push(frame);
+ frames = frames.concat(comments());
+ }
+ if (!close()) {
+ return error("@keyframes missing '}'");
+ }
+ return pos({
+ type: 'keyframes',
+ name,
+ vendor,
+ keyframes: frames
+ });
+ }
+ /**
+ * Parse supports.
+ */
-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);
- }
+ function atsupports() {
+ const pos = position();
+ const m = match(/^@supports *([^{]+)/);
- if (typeof children === 'function') {
- return children(propsWithTabIndex);
+ if (!m) {
+ return;
}
- return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["Button"], propsWithTabIndex, children);
- });
-}
+ const supports = trim(m[1]);
-/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(InserterListboxItem));
+ if (!open()) {
+ return error("@supports missing '{'");
+ }
+ const style = comments().concat(rules());
-/***/ }),
+ if (!close()) {
+ return error("@supports missing '}'");
+ }
-/***/ "Mmq9":
-/***/ (function(module, exports) {
+ return pos({
+ type: 'supports',
+ supports,
+ rules: style
+ });
+ }
+ /**
+ * Parse host.
+ */
-(function() { module.exports = window["wp"]["url"]; }());
-/***/ }),
+ function athost() {
+ const pos = position();
+ const m = match(/^@host\s*/);
-/***/ "Mp0b":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (!m) {
+ return;
+ }
-"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__);
+ if (!open()) {
+ return error("@host missing '{'");
+ }
+ const style = comments().concat(rules());
-/**
- * WordPress dependencies
- */
+ if (!close()) {
+ return error("@host missing '}'");
+ }
-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);
+ return pos({
+ type: 'host',
+ rules: style
+ });
+ }
+ /**
+ * Parse media.
+ */
-/***/ }),
+ function atmedia() {
+ const pos = position();
+ const m = match(/^@media *([^{]+)/);
-/***/ "NMUH":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (!m) {
+ return;
+ }
-"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
- */
+ const media = trim(m[1]);
-/**
- * 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.
- */
+ if (!open()) {
+ return error("@media missing '{'");
+ }
-const getFontSize = (fontSizes, fontSizeAttribute, customFontSizeAttribute) => {
- if (fontSizeAttribute) {
- const fontSizeObject = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(fontSizes, {
- slug: fontSizeAttribute
- });
+ const style = comments().concat(rules());
- if (fontSizeObject) {
- return fontSizeObject;
+ if (!close()) {
+ return error("@media missing '}'");
}
+
+ return pos({
+ type: 'media',
+ media,
+ rules: style
+ });
}
+ /**
+ * Parse custom-media.
+ */
- 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
- });
+ function atcustommedia() {
+ const pos = position();
+ const m = match(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);
- if (fontSizeObject) {
- return fontSizeObject;
+ if (!m) {
+ return;
+ }
+
+ return pos({
+ type: 'custom-media',
+ name: trim(m[1]),
+ media: trim(m[2])
+ });
}
+ /**
+ * Parse paged media.
+ */
- 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;
- }
+ function atpage() {
+ const pos = position();
+ const m = match(/^@page */);
- return `has-${Object(lodash__WEBPACK_IMPORTED_MODULE_0__["kebabCase"])(fontSizeSlug)}-font-size`;
-}
+ if (!m) {
+ return;
+ }
+ const sel = selector() || [];
-/***/ }),
+ if (!open()) {
+ return error("@page missing '{'");
+ }
-/***/ "NMb1":
-/***/ (function(module, exports) {
+ let decls = comments(); // declarations
-(function() { module.exports = window["wp"]["deprecated"]; }());
+ let decl; // eslint-disable-next-line no-cond-assign
-/***/ }),
+ while (decl = declaration()) {
+ decls.push(decl);
+ decls = decls.concat(comments());
+ }
-/***/ "NTP4":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (!close()) {
+ return error("@page missing '}'");
+ }
-"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__);
+ return pos({
+ type: 'page',
+ selectors: sel,
+ declarations: decls
+ });
+ }
+ /**
+ * Parse document.
+ */
-/**
- * WordPress dependencies
- */
+ function atdocument() {
+ const pos = position();
+ const m = match(/^@([-\w]+)?document *([^{]+)/);
-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);
+ if (!m) {
+ return;
+ }
+ const vendor = trim(m[1]);
+ const doc = trim(m[2]);
-/***/ }),
+ if (!open()) {
+ return error("@document missing '{'");
+ }
-/***/ "NWDH":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ const style = comments().concat(rules());
-"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__);
+ if (!close()) {
+ return error("@document missing '}'");
+ }
+ return pos({
+ type: 'document',
+ document: doc,
+ vendor,
+ rules: style
+ });
+ }
+ /**
+ * Parse font-face.
+ */
-/**
- * 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);
+ function atfontface() {
+ const pos = position();
+ const m = match(/^@font-face\s*/);
+ if (!m) {
+ return;
+ }
-/***/ }),
+ if (!open()) {
+ return error("@font-face missing '{'");
+ }
-/***/ "NtoT":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ let decls = comments(); // declarations
-"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");
+ let decl; // eslint-disable-next-line no-cond-assign
+ while (decl = declaration()) {
+ decls.push(decl);
+ decls = decls.concat(comments());
+ }
-/**
- * External dependencies
- */
+ if (!close()) {
+ return error("@font-face missing '}'");
+ }
+
+ return pos({
+ type: 'font-face',
+ declarations: decls
+ });
+ }
+ /**
+ * Parse import
+ */
-/**
- * WordPress dependencies
- */
+ const atimport = _compileAtrule('import');
+ /**
+ * Parse charset
+ */
-/**
- * Internal dependencies
- */
+ const atcharset = _compileAtrule('charset');
+ /**
+ * Parse namespace
+ */
+ const atnamespace = _compileAtrule('namespace');
+ /**
+ * Parse non-block at-rules
+ */
-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;
+ function _compileAtrule(name) {
+ const re = new RegExp('^@' + name + '\\s*([^;]+);');
+ return function () {
+ const pos = position();
+ const m = match(re);
- 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 (!m) {
+ return;
+ }
- if (!isDisplayed) {
- return null;
+ const ret = {
+ type: name
+ };
+ ret[name] = m[1].trim();
+ return pos(ret);
+ };
}
+ /**
+ * Parse at rule.
+ */
- 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";
+ function atrule() {
+ if (css[0] !== '@') {
+ return;
+ }
-exports.__esModule = true;
-var TextareaAutosize_1 = __webpack_require__("CNgt");
-exports["default"] = TextareaAutosize_1.TextareaAutosize;
+ return atkeyframes() || atmedia() || atcustommedia() || atsupports() || atimport() || atcharset() || atnamespace() || atdocument() || atpage() || athost() || atfontface();
+ }
+ /**
+ * Parse rule.
+ */
-/***/ }),
+ function rule() {
+ const pos = position();
+ const sel = selector();
-/***/ "OL6h":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (!sel) {
+ return error('selector missing');
+ }
-"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.
- */
+ comments();
+ return pos({
+ type: 'rule',
+ selectors: sel,
+ declarations: declarations()
+ });
+ }
-function isInSameBlock(a, b) {
- return a.closest(BLOCK_SELECTOR) === b.closest(BLOCK_SELECTOR);
+ return addParent(stylesheet());
}
/**
- * 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.
+ * Trim `str`.
*/
-function isInsideRootBlock(blockElement, element) {
- const parentBlock = element.closest([BLOCK_SELECTOR, APPENDER_SELECTOR].join(','));
- return parentBlock === blockElement;
+function trim(str) {
+ return str ? str.replace(/^\s+|\s+$/g, '') : '';
}
/**
- * 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.
+ * Adds non-enumerable parent node reference to each node.
*/
-function getBlockClientId(node) {
- while (node && node.nodeType !== node.ELEMENT_NODE) {
- node = node.parentNode;
- }
- if (!node) {
- return;
- }
+function addParent(obj, parent) {
+ const isNode = obj && typeof obj.type === 'string';
+ const childParent = isNode ? obj : parent;
- const elementNode =
- /** @type {Element} */
- node;
- const blockNode = elementNode.closest(BLOCK_SELECTOR);
+ for (const k in obj) {
+ const value = obj[k];
- if (!blockNode) {
- return;
+ if (Array.isArray(value)) {
+ value.forEach(function (v) {
+ addParent(v, childParent);
+ });
+ } else if (value && typeof value === 'object') {
+ addParent(value, childParent);
+ }
}
- return blockNode.id.slice('block-'.length);
-}
+ if (isNode) {
+ Object.defineProperty(obj, 'parent', {
+ configurable: true,
+ writable: true,
+ enumerable: false,
+ value: parent || null
+ });
+ }
+ return obj;
+}
+/* eslint-enable @wordpress/no-unused-vars-before-return */
-/***/ }),
+// EXTERNAL MODULE: ./node_modules/inherits/inherits_browser.js
+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
+// Adapted from https://github.com/reworkcss/css
+// because we needed to remove source map support.
-/***/ "OzlF":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/**
+ * Expose `Compiler`.
+ */
+/* harmony default export */ var compiler = (Compiler);
+/**
+ * Initialize a compiler.
+ */
-"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__);
+function Compiler(opts) {
+ this.options = opts || {};
+}
+/**
+ * Emit `str`
+ */
+Compiler.prototype.emit = function (str) {
+ return str;
+};
/**
- * WordPress dependencies
+ * Visit `node`.
*/
-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);
+
+Compiler.prototype.visit = function (node) {
+ return this[node.type](node);
+};
+/**
+ * Map visit over array of `nodes`, optionally using a `delim`
+ */
-/***/ }),
+Compiler.prototype.mapVisit = function (nodes, delim) {
+ let buf = '';
+ delim = delim || '';
-/***/ "P7XM":
-/***/ (function(module, exports) {
+ for (let i = 0, length = nodes.length; i < length; i++) {
+ buf += this.visit(nodes[i]);
-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
+ if (delim && i < length - 1) {
+ buf += this.emit(delim);
}
}
-}
+ return buf;
+};
-/***/ }),
-
-/***/ "PKbb":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+;// 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.
-"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
+ * External 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.
+ * Expose compiler.
*/
-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]);
-}
+/* harmony default export */ var compress = (compress_Compiler);
/**
- * 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.
+ * Initialize a new `Compiler`.
*/
-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;
- }
-
- }), []);
+function compress_Compiler(options) {
+ compiler.call(this, options);
}
/**
- * 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.
+ * Inherit from `Base.prototype`.
*/
-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");
+inherits_browser_default()(compress_Compiler, compiler);
+/**
+ * Compile `node`.
+ */
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/arrow-right.js
+compress_Compiler.prototype.compile = function (node) {
+ return node.stylesheet.rules.map(this.visit, this).join('');
+};
+/**
+ * Visit comment node.
+ */
+compress_Compiler.prototype.comment = function (node) {
+ return this.emit('', node.position);
+};
/**
- * WordPress dependencies
+ * Visit import node.
*/
-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
+compress_Compiler.prototype.import = function (node) {
+ return this.emit('@import ' + node.import + ';', node.position);
+};
+/**
+ * Visit media node.
+ */
+compress_Compiler.prototype.media = function (node) {
+ return this.emit('@media ' + node.media, node.position) + this.emit('{') + this.mapVisit(node.rules) + this.emit('}');
+};
/**
- * WordPress dependencies
+ * Visit document node.
*/
-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
+compress_Compiler.prototype.document = function (node) {
+ const doc = '@' + (node.vendor || '') + 'document ' + node.document;
+ return this.emit(doc, node.position) + this.emit('{') + this.mapVisit(node.rules) + this.emit('}');
+};
/**
- * 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.
+ * Visit charset node.
*/
-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");
+compress_Compiler.prototype.charset = function (node) {
+ return this.emit('@charset ' + node.charset + ';', node.position);
+};
+/**
+ * Visit namespace node.
+ */
-// 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
+compress_Compiler.prototype.namespace = function (node) {
+ return this.emit('@namespace ' + node.namespace + ';', node.position);
+};
+/**
+ * Visit supports node.
+ */
+compress_Compiler.prototype.supports = function (node) {
+ return this.emit('@supports ' + node.supports, node.position) + this.emit('{') + this.mapVisit(node.rules) + this.emit('}');
+};
/**
- * WordPress dependencies
+ * Visit keyframes node.
*/
-
+compress_Compiler.prototype.keyframes = function (node) {
+ return this.emit('@' + (node.vendor || '') + 'keyframes ' + node.name, node.position) + this.emit('{') + this.mapVisit(node.keyframes) + this.emit('}');
+};
/**
- * Internal dependencies
+ * Visit keyframe node.
*/
+compress_Compiler.prototype.keyframe = function (node) {
+ const decls = node.declarations;
+ return this.emit(node.values.join(','), node.position) + this.emit('{') + this.mapVisit(decls) + this.emit('}');
+};
+/**
+ * Visit page node.
+ */
- // 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'
+compress_Compiler.prototype.page = function (node) {
+ const sel = node.selectors.length ? node.selectors.join(', ') : '';
+ return this.emit('@page ' + sel, node.position) + this.emit('{') + this.mapVisit(node.declarations) + this.emit('}');
};
-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;
- }
+/**
+ * Visit font-face node.
+ */
- 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}
- }
+compress_Compiler.prototype['font-face'] = function (node) {
+ return this.emit('@font-face', node.position) + this.emit('{') + this.mapVisit(node.declarations) + this.emit('}');
+};
+/**
+ * Visit host node.
+ */
- ${appendSelectors(selector, '> *')} {
- margin: 0;
- }
- `);
- },
- getOrientation(layout) {
- const {
- orientation = 'horizontal'
- } = layout;
- return orientation;
- },
+compress_Compiler.prototype.host = function (node) {
+ return this.emit('@host', node.position) + this.emit('{') + this.mapVisit(node.rules) + this.emit('}');
+};
+/**
+ * Visit custom-media node.
+ */
- getAlignments() {
- return [];
+
+compress_Compiler.prototype['custom-media'] = function (node) {
+ return this.emit('@custom-media ' + node.name + ' ' + node.media + ';', node.position);
+};
+/**
+ * Visit rule node.
+ */
+
+
+compress_Compiler.prototype.rule = function (node) {
+ const decls = node.declarations;
+
+ if (!decls.length) {
+ return '';
}
-});
+ return this.emit(node.selectors.join(','), node.position) + this.emit('{') + this.mapVisit(decls) + this.emit('}');
+};
+/**
+ * Visit declaration node.
+ */
-function FlexLayoutJustifyContentControl(_ref4) {
- let {
- layout,
- onChange,
- isToolbar = false
- } = _ref4;
- const {
- justifyContent = 'left',
- orientation = 'horizontal'
- } = layout;
- const onJustificationChange = value => {
- onChange({ ...layout,
- justifyContent: value
- });
- };
+compress_Compiler.prototype.declaration = function (node) {
+ return this.emit(node.property + ':' + node.value, node.position) + this.emit(';');
+};
- const allowedControls = ['left', 'center', 'right'];
+;// 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.
- if (orientation === 'horizontal') {
- allowedControls.push('space-between');
- }
+/**
+ * External dependencies
+ */
- 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
- }
- });
- }
+/**
+ * Internal dependencies
+ */
- 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')
- });
- }
+/**
+ * Expose compiler.
+ */
- 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)
- });
- })));
-}
+/* harmony default export */ var identity = (identity_Compiler);
+/**
+ * Initialize a new `Compiler`.
+ */
-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 identity_Compiler(options) {
+ options = options || {};
+ compiler.call(this, options);
+ this.indentation = options.indent;
}
+/**
+ * Inherit from `Base.prototype`.
+ */
-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");
+inherits_browser_default()(identity_Compiler, compiler);
+/**
+ * Compile `node`.
+ */
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/position-center.js
-var position_center = __webpack_require__("EpZT");
+identity_Compiler.prototype.compile = function (node) {
+ return this.stylesheet(node);
+};
+/**
+ * Visit stylesheet node.
+ */
-// 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
+identity_Compiler.prototype.stylesheet = function (node) {
+ return this.mapVisit(node.stylesheet.rules, '\n\n');
+};
+/**
+ * Visit comment node.
+ */
+identity_Compiler.prototype.comment = function (node) {
+ return this.emit(this.indent() + '/*' + node.comment + '*/', node.position);
+};
/**
- * WordPress dependencies
+ * Visit import node.
*/
+identity_Compiler.prototype.import = function (node) {
+ return this.emit('@import ' + node.import + ';', node.position);
+};
+/**
+ * Visit media node.
+ */
+
+identity_Compiler.prototype.media = function (node) {
+ return this.emit('@media ' + node.media, node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(node.rules, '\n\n') + this.emit(this.indent(-1) + '\n}');
+};
/**
- * Internal dependencies
+ * Visit document node.
*/
+identity_Compiler.prototype.document = function (node) {
+ const doc = '@' + (node.vendor || '') + 'document ' + node.document;
+ return this.emit(doc, node.position) + this.emit(' ' + ' {\n' + this.indent(1)) + this.mapVisit(node.rules, '\n\n') + this.emit(this.indent(-1) + '\n}');
+};
+/**
+ * Visit charset node.
+ */
-/* 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;
- }
+identity_Compiler.prototype.charset = function (node) {
+ return this.emit('@charset ' + node.charset + ';', node.position);
+};
+/**
+ * Visit namespace node.
+ */
- ${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;
- }
+identity_Compiler.prototype.namespace = function (node) {
+ return this.emit('@namespace ' + node.namespace + ';', node.position);
+};
+/**
+ * Visit supports node.
+ */
- ${appendSelectors(selector, '> [data-align="right"]')} {
- float: right;
- margin-left: 2em;
- }
- `;
+identity_Compiler.prototype.supports = function (node) {
+ return this.emit('@supports ' + node.supports, node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(node.rules, '\n\n') + this.emit(this.indent(-1) + '\n}');
+};
+/**
+ * Visit keyframes node.
+ */
- 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);
- },
+identity_Compiler.prototype.keyframes = function (node) {
+ return this.emit('@' + (node.vendor || '') + 'keyframes ' + node.name, node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(node.keyframes, '\n') + this.emit(this.indent(-1) + '}');
+};
+/**
+ * Visit keyframe node.
+ */
- getOrientation() {
- return 'vertical';
- },
- getAlignments(layout) {
- const alignmentInfo = getAlignmentsInfo(layout);
+identity_Compiler.prototype.keyframe = function (node) {
+ const decls = node.declarations;
+ return this.emit(this.indent()) + this.emit(node.values.join(', '), node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(decls, '\n') + this.emit(this.indent(-1) + '\n' + this.indent() + '}\n');
+};
+/**
+ * Visit page node.
+ */
- if (layout.alignments !== undefined) {
- if (!layout.alignments.includes('none')) {
- layout.alignments.unshift('none');
- }
- return layout.alignments.map(alignment => ({
- name: alignment,
- info: alignmentInfo[alignment]
- }));
- }
+identity_Compiler.prototype.page = function (node) {
+ const sel = node.selectors.length ? node.selectors.join(', ') + ' ' : '';
+ return this.emit('@page ' + sel, node.position) + this.emit('{\n') + this.emit(this.indent(1)) + this.mapVisit(node.declarations, '\n') + this.emit(this.indent(-1)) + this.emit('\n}');
+};
+/**
+ * Visit font-face node.
+ */
- const {
- contentSize,
- wideSize
- } = layout;
- const alignments = [{
- name: 'left'
- }, {
- name: 'center'
- }, {
- name: 'right'
- }];
- if (contentSize) {
- alignments.unshift({
- name: 'full'
- });
- }
+identity_Compiler.prototype['font-face'] = function (node) {
+ return this.emit('@font-face ', node.position) + this.emit('{\n') + this.emit(this.indent(1)) + this.mapVisit(node.declarations, '\n') + this.emit(this.indent(-1)) + this.emit('\n}');
+};
+/**
+ * Visit host node.
+ */
- if (wideSize) {
- alignments.unshift({
- name: 'wide',
- info: alignmentInfo.wide
- });
- }
- alignments.unshift({
- name: 'none',
- info: alignmentInfo.none
- });
- return alignments;
- }
+identity_Compiler.prototype.host = function (node) {
+ return this.emit('@host', node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(node.rules, '\n\n') + this.emit(this.indent(-1) + '\n}');
+};
+/**
+ * Visit custom-media node.
+ */
-});
+
+identity_Compiler.prototype['custom-media'] = function (node) {
+ return this.emit('@custom-media ' + node.name + ' ' + node.media + ';', node.position);
+};
/**
- * 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.
+ * Visit rule node.
*/
-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);
+identity_Compiler.prototype.rule = function (node) {
+ const indent = this.indent();
+ const decls = node.declarations;
+
+ if (!decls.length) {
+ return '';
}
- 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 this.emit(node.selectors.map(function (s) {
+ return indent + s;
+ }).join(',\n'), node.position) + this.emit(' {\n') + this.emit(this.indent(1)) + this.mapVisit(decls, '\n') + this.emit(this.indent(-1)) + this.emit('\n' + this.indent() + '}');
+};
+/**
+ * Visit declaration node.
+ */
+
+
+identity_Compiler.prototype.declaration = function (node) {
+ return this.emit(this.indent()) + this.emit(node.property + ': ' + node.value, node.position) + this.emit(';');
+};
+/**
+ * Increase, decrease or return current indentation.
+ */
+
+
+identity_Compiler.prototype.indent = function (level) {
+ this.level = this.level || 1;
+
+ if (null !== level) {
+ this.level += level;
+ return '';
}
- return alignmentInfo;
+ return Array(this.level).join(this.indentation || ' ');
+};
+/* eslint-enable @wordpress/no-unused-vars-before-return */
+
+;// 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.
+
+/**
+ * Internal dependencies
+ */
+
+
+/**
+ * Stringfy the given AST `node`.
+ *
+ * Options:
+ *
+ * - `compress` space-optimized output
+ * - `sourcemap` return an object with `.code` and `.map`
+ *
+ * @param {Object} node
+ * @param {Object} [options]
+ * @return {string}
+ */
+
+/* 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/layouts/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/traverse.js
+/**
+ * External dependencies
+ */
+
/**
* Internal dependencies
*/
-const layoutTypes = [flow, flex];
+
+function traverseCSS(css, callback) {
+ try {
+ const parsed = parse(css);
+ const updated = traverse_default().map(parsed, function (node) {
+ if (!node) {
+ return node;
+ }
+
+ const updatedNode = callback(node);
+ return this.update(updatedNode);
+ });
+ return stringify(updated);
+ } catch (err) {
+ // eslint-disable-next-line no-console
+ console.warn('Error while traversing the CSS: ' + err);
+ return null;
+ }
+}
+
+/* harmony default export */ var transform_styles_traverse = (traverseCSS);
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/transforms/url-rewrite.js
/**
- * Retrieves a layout type by name.
+ * Return `true` if the given path is http/https.
+ *
+ * @param {string} filePath path
+ *
+ * @return {boolean} is remote path.
+ */
+function isRemotePath(filePath) {
+ return /^(?:https?:)?\/\//.test(filePath);
+}
+/**
+ * Return `true` if the given filePath is an absolute url.
+ *
+ * @param {string} filePath path
*
- * @param {string} name - The name of the layout type.
- * @return {Object} Layout type.
+ * @return {boolean} is absolute path.
*/
-function getLayoutType() {
- let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
- return layoutTypes.find(layoutType => layoutType.name === name);
+
+function isAbsolutePath(filePath) {
+ return /^\/(?!\/)/.test(filePath);
}
/**
- * Retrieves the available layout types.
+ * Whether or not the url should be inluded.
*
- * @return {Array} Layout types.
+ * @param {Object} meta url meta info
+ *
+ * @return {boolean} is valid.
*/
-function getLayoutTypes() {
- return layoutTypes;
-}
-
-/***/ }),
+function isValidURL(meta) {
+ // ignore hashes or data uris
+ if (meta.value.indexOf('data:') === 0 || meta.value.indexOf('#') === 0) {
+ return false;
+ }
-/***/ "PS/H":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (isAbsolutePath(meta.value)) {
+ return false;
+ } // do not handle the http/https urls if `includeRemote` is false
-"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");
+ if (isRemotePath(meta.value)) {
+ return false;
+ }
+ return true;
+}
/**
- * External dependencies
+ * Get the absolute path of the url, relative to the basePath
+ *
+ * @param {string} str the url
+ * @param {string} baseURL base URL
+ *
+ * @return {string} the full path to the file
*/
+
+function getResourcePath(str, baseURL) {
+ return new URL(str, baseURL).toString();
+}
/**
- * WordPress dependencies
+ * Process the single `url()` pattern
+ *
+ * @param {string} baseURL the base URL for relative URLs.
+ *
+ * @return {Promise} the Promise.
*/
-
-
-
-
+function processURL(baseURL) {
+ return meta => ({ ...meta,
+ newUrl: 'url(' + meta.before + meta.quote + getResourcePath(meta.value, baseURL) + meta.quote + meta.after + ')'
+ });
+}
/**
- * Internal dependencies
+ * Get all `url()`s, and return the meta info
+ *
+ * @param {string} value decl.value.
+ *
+ * @return {Array} the urls.
*/
+function getURLs(value) {
+ const reg = /url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;
+ let match;
+ const URLs = [];
+ while ((match = reg.exec(value)) !== null) {
+ const meta = {
+ source: match[0],
+ before: match[1],
+ quote: match[2],
+ value: match[3],
+ after: match[4]
+ };
-
-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 {};
+ if (isValidURL(meta)) {
+ URLs.push(meta);
}
+ }
- let _previousClientId = order[insertionPoint.index - 1];
- let _nextClientId = order[insertionPoint.index];
+ return URLs;
+}
+/**
+ * Replace the raw value's `url()` segment to the new value
+ *
+ * @param {string} raw the raw value.
+ * @param {Array} URLs the URLs to replace.
+ *
+ * @return {string} the new value.
+ */
- while (isBlockBeingDragged(_previousClientId)) {
- _previousClientId = getPreviousBlockClientId(_previousClientId);
- }
- while (isBlockBeingDragged(_nextClientId)) {
- _nextClientId = getNextBlockClientId(_nextClientId);
- }
+function replaceURLs(raw, URLs) {
+ URLs.forEach(item => {
+ raw = raw.replace(item.source, item.newUrl);
+ });
+ return raw;
+}
- 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 rewrite = rootURL => node => {
+ if (node.type === 'declaration') {
+ const updatedURLs = getURLs(node.value).map(processURL(rootURL));
+ return { ...node,
+ value: replaceURLs(node.value, updatedURLs)
};
- }, []);
- 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 node;
+};
- return {
- width,
- height: previousElement ? previousElement.offsetHeight : nextElement.offsetHeight
- };
- }, [previousElement, nextElement]);
- const getAnchorRect = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(() => {
- if (!previousElement && !nextElement) {
- return {};
- }
+/* harmony default export */ var url_rewrite = (rewrite);
- const {
- ownerDocument
- } = previousElement || nextElement;
- const previousRect = previousElement ? previousElement.getBoundingClientRect() : null;
- const nextRect = nextElement ? nextElement.getBoundingClientRect() : null;
+;// 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.
+ */
+const IS_ROOT_TAG = /^(body|html|:root).*$/;
+/**
+ * Creates a callback to modify selectors so they only apply within a certain
+ * namespace.
+ *
+ * @param {string} namespace Namespace to prefix selectors with.
+ * @param {string[]} ignore Selectors to not prefix.
+ *
+ * @return {(node: Object) => Object} Callback to wrap selectors.
+ */
- 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
- };
- }
+const wrap = function (namespace) {
+ let ignore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
+ return node => {
+ /**
+ * Updates selector if necessary.
+ *
+ * @param {string} selector Selector to modify.
+ *
+ * @return {string} Updated selector.
+ */
+ const updateSelector = selector => {
+ if (ignore.includes(selector.trim())) {
+ return selector;
+ } // Anything other than a root tag is always prefixed.
- 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
- };
- }
+ {
+ if (!selector.match(IS_ROOT_TAG)) {
+ return namespace + ' ' + selector;
+ }
+ } // HTML and Body elements cannot be contained within our container so lets extract their styles.
- 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
+ return selector.replace(/^(body|html|:root)/, namespace);
};
- }, [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;
+ if (node.type === 'rule') {
+ return { ...node,
+ selectors: node.selectors.map(updateSelector)
+ };
}
- } // 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
- }
- }
+ return node;
};
- /* 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__) {
+/* harmony default export */ var transforms_wrap = (wrap);
-"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");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/index.js
/**
* External dependencies
*/
@@ -26953,193 +20489,122 @@ function InsertionPoint(_ref2) {
*/
-
/**
* Internal dependencies
*/
+
+
/**
- * Returns the class names used for the different states of the block.
- *
- * @param {string} clientId The block client ID.
+ * Applies a series of CSS rule transforms to wrap selectors inside a given class and/or rewrite URLs depending on the parameters passed.
*
- * @return {string} The class names.
+ * @param {Array} styles CSS rules.
+ * @param {string} wrapperClassName Wrapper Class Name.
+ * @return {Array} converted rules.
*/
-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 transformStyles = function (styles) {
+ let wrapperClassName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
+ return (0,external_lodash_namespaceObject.map)(styles, _ref => {
+ let {
+ css,
+ baseURL
+ } = _ref;
+ const transforms = [];
- 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]);
-}
+ if (wrapperClassName) {
+ transforms.push(transforms_wrap(wrapperClassName));
+ }
+
+ if (baseURL) {
+ transforms.push(url_rewrite(baseURL));
+ }
+ if (transforms.length) {
+ return transform_styles_traverse(css, (0,external_wp_compose_namespaceObject.compose)(transforms));
+ }
-/***/ }),
+ return css;
+ });
+};
-/***/ "Q4Sy":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/* harmony default export */ var transform_styles = (transformStyles);
-"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/editor-styles/index.js
/**
- * WordPress dependencies
+ * External 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
*/
+const EDITOR_STYLES_SELECTOR = '.editor-styles-wrapper';
+k([names, a11y]);
-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
+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;
-/**
- * WordPress dependencies
- */
+ 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');
+ }
-/**
- * Internal dependencies
- */
+ 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 LiveBlockPreview(_ref) {
+function EditorStyles(_ref) {
let {
- onClick
+ styles
} = _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)));
+ 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)));
}
-// 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
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-preview/auto.js
/**
@@ -27168,15 +20633,15 @@ function AutoBlockPreview(_ref) {
} = _ref;
const [containerResizeListener, {
width: containerWidth
- }] = Object(external_wp_compose_["useResizeObserver"])();
+ }] = (0,external_wp_compose_namespaceObject.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;
+ }] = (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 = Object(external_wp_element_["useMemo"])(() => {
+ const editorStyles = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (styles) {
return [...styles, {
css: 'body{height:auto;overflow:hidden;}',
@@ -27187,22 +20652,22 @@ function AutoBlockPreview(_ref) {
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 */]);
+ MemoizedBlockList = MemoizedBlockList || (0,external_wp_compose_namespaceObject.pure)(BlockList);
const scale = containerWidth / viewportWidth;
- return Object(external_wp_element_["createElement"])("div", {
+ return (0,external_wp_element_namespaceObject.createElement)("div", {
className: "block-editor-block-preview__container"
- }, containerResizeListener, Object(external_wp_element_["createElement"])(external_wp_components_["Disabled"], {
+ }, 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
}
- }, Object(external_wp_element_["createElement"])(iframe["a" /* default */], {
- head: Object(external_wp_element_["createElement"])(editor_styles["a" /* default */], {
+ }, (0,external_wp_element_namespaceObject.createElement)(iframe, {
+ head: (0,external_wp_element_namespaceObject.createElement)(EditorStyles, {
styles: editorStyles
}),
- contentRef: Object(external_wp_compose_["useRefEffect"])(bodyElement => {
+ contentRef: (0,external_wp_compose_namespaceObject.useRefEffect)(bodyElement => {
const {
ownerDocument: {
documentElement
@@ -27226,14 +20691,14 @@ function AutoBlockPreview(_ref) {
// See: https://github.com/WordPress/gutenberg/pull/38175.
maxHeight: MAX_HEIGHT
}
- }, contentResizeListener, Object(external_wp_element_["createElement"])(MemoizedBlockList, {
+ }, 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
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-preview/index.js
/**
@@ -27265,25 +20730,25 @@ function BlockPreview(_ref) {
__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 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 = Object(external_wp_element_["useMemo"])(() => Object(external_lodash_["castArray"])(blocks), [blocks]);
+ const renderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_lodash_namespaceObject.castArray)(blocks), [blocks]);
if (!blocks || blocks.length === 0) {
return null;
}
- return Object(external_wp_element_["createElement"])(provider["a" /* default */], {
+ return (0,external_wp_element_namespaceObject.createElement)(provider, {
value: renderedBlocks,
settings: settings
- }, __experimentalLive ? Object(external_wp_element_["createElement"])(LiveBlockPreview, {
+ }, __experimentalLive ? (0,external_wp_element_namespaceObject.createElement)(LiveBlockPreview, {
onClick: __experimentalOnClick
- }) : Object(external_wp_element_["createElement"])(auto, {
+ }) : (0,external_wp_element_namespaceObject.createElement)(auto, {
viewportWidth: viewportWidth,
__experimentalPadding: __experimentalPadding
}));
@@ -27300,7 +20765,7 @@ function BlockPreview(_ref) {
* @return {WPComponent} The component to be rendered.
*/
-/* harmony default export */ var block_preview = __webpack_exports__["a"] = (Object(external_wp_element_["memo"])(BlockPreview));
+/* 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
@@ -27324,17 +20789,17 @@ function useBlockPreview(_ref2) {
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,
+ 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 = Object(external_wp_element_["useMemo"])(() => Object(external_lodash_["castArray"])(blocks), [blocks]);
- const children = Object(external_wp_element_["createElement"])(provider["a" /* default */], {
+ 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
- }, Object(external_wp_element_["createElement"])(block_list["a" /* BlockListItems */], {
+ }, (0,external_wp_element_namespaceObject.createElement)(BlockListItems, {
renderAppender: false,
__experimentalLayout: __experimentalLayout
}));
@@ -27345,253 +20810,790 @@ function useBlockPreview(_ref2) {
};
}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/preview-panel.js
-/***/ }),
-/***/ "RMJe":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/**
+ * 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 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 drag_handle = (dragHandle);
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/draggable-chip.js
+
+
+/**
+ * WordPress dependencies
+ */
+
+
+
+/**
+ * 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);
-"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/inserter-listbox/index.js
/**
* 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
+ * Internal dependencies
*/
-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 = ' ';
+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);
+}
- // 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');
- }
+/* harmony default export */ var inserter_listbox = (InserterListbox);
- // Set the font-size of the element
- var fontSizeStr = computedStyle(node, 'font-size');
- _node.style.fontSize = fontSizeStr;
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-types-tab.js
- // 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);
+/**
+ * External dependencies
+ */
- // Assume the line height of the element is the height
- var height = _node.offsetHeight;
- lnHeight = height;
+/**
+ * WordPress dependencies
+ */
- // Remove our child from the DOM
- body.removeChild(_node);
- }
- // Return the calculated height
- return lnHeight;
-}
-// Export lineHeight
-module.exports = lineHeight;
+/**
+ * Internal dependencies
+ */
-/***/ }),
-/***/ "RxS6":
-/***/ (function(module, exports) {
-(function() { module.exports = window["wp"]["keycodes"]; }());
-/***/ }),
-/***/ "SVSp":
-/***/ (function(module, exports) {
-(function() { module.exports = window["wp"]["shortcode"]; }());
+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}
+ */
-/***/ "TSYQ":
-/***/ (function(module, exports, __webpack_require__) {
+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);
-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 */
+ if (result[namespace].length === 0) {
+ delete result[namespace];
+ }
+ });
+ return result;
+ }, [items, collections]); // Hide block preview on unmount.
-(function () {
- 'use strict';
+ (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.
+ */
- var hasOwn = {}.hasOwnProperty;
+ const currentlyRenderedCategories = (0,external_wp_compose_namespaceObject.useAsyncList)(categories);
+ const didRenderAllCategories = categories.length === currentlyRenderedCategories.length; // Async List requires an array
- function classNames() {
- var classes = [];
+ 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];
- for (var i = 0; i < arguments.length; i++) {
- var arg = arguments[i];
- if (!arg) continue;
+ if (!categoryItems || !categoryItems.length) {
+ return null;
+ }
- var argType = typeof arg;
+ 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 (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());
- }
- }
- }
+ if (!collectionItems || !collectionItems.length) {
+ return null;
+ }
- return classes.join(' ');
- }
+ 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);
- 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 {}
-}());
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/pattern-panel.js
-/***/ }),
+/**
+ * External dependencies
+ */
-/***/ "TVFh":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/**
+ * WordPress dependencies
+ */
-"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);
+function PatternInserterPanel(_ref) {
+ let {
+ selectedCategory,
+ patternCategories,
+ onClickCategory,
+ openPatternExplorer
+ } = _ref;
+ const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<');
-// EXTERNAL MODULE: external ["wp","data"]
-var external_wp_data_ = __webpack_require__("1ZqX");
+ const categoryOptions = () => {
+ const options = [];
+ patternCategories.map(patternCategory => {
+ return options.push({
+ value: patternCategory.name,
+ label: patternCategory.label
+ });
+ });
+ return options;
+ };
-// EXTERNAL MODULE: external ["wp","i18n"]
-var external_wp_i18n_ = __webpack_require__("l3Sj");
+ const onChangeSelect = selected => {
+ onClickCategory(patternCategories.find(patternCategory => selected === patternCategory.name));
+ };
-// EXTERNAL MODULE: external ["wp","compose"]
-var external_wp_compose_ = __webpack_require__("K9lf");
+ 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.
-// EXTERNAL MODULE: external "lodash"
-var external_lodash_ = __webpack_require__("YLtl");
+ const onBlur = event => {
+ if (!(event !== null && event !== void 0 && event.relatedTarget)) {
+ event.stopPropagation();
+ }
+ };
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules
-var store = __webpack_require__("BhPs");
+ 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'))));
+}
-// 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");
+/* harmony default export */ var pattern_panel = (PatternInserterPanel);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-multi-selection.js
+;// 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
*/
@@ -27602,150 +21604,252 @@ var use_block_refs = __webpack_require__("PKbb");
+
+
+
/**
* 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
+
-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'.
+ * WordPress dependencies
*/
-function getDeepestNode(node, type) {
- const child = type === 'start' ? 'firstChild' : 'lastChild';
- const sibling = type === 'start' ? 'nextSibling' : 'previousSibling';
- while (node[child]) {
- node = node[child];
+/**
+ * Internal dependencies
+ */
- while (node.nodeType === node.TEXT_NODE && /^[ \t\n]*$/.test(node.data) && node[sibling]) {
- node = node[sibling];
- }
- }
- return node;
-}
-function selector(select) {
+
+function BlockPattern(_ref) {
+ let {
+ isDraggable,
+ pattern,
+ onClick,
+ composite
+ } = _ref;
const {
- isMultiSelecting,
- getMultiSelectedBlockClientIds,
- hasMultiSelection,
- getSelectedBlockClientId
- } = select(store["a" /* store */]);
- return {
- isMultiSelecting: isMultiSelecting(),
- multiSelectedBlockClientIds: getMultiSelectedBlockClientIds(),
- hasMultiSelection: hasMultiSelection(),
- selectedBlockClientId: getSelectedBlockClientId()
- };
+ 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 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.
+function BlockPatternPlaceholder() {
+ return (0,external_wp_element_namespaceObject.createElement)("div", {
+ className: "block-editor-block-patterns-list__item is-placeholder"
+ });
+}
- 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.
- */
+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
+ });
+ }));
+}
- return Object(external_wp_compose_["useRefEffect"])(node => {
- const {
- ownerDocument
- } = node;
- const {
- defaultView
- } = ownerDocument;
+/* harmony default export */ var block_patterns_list = (BlockPatternList);
- if (!hasMultiSelection || isMultiSelecting) {
- if (!selectedBlockClientId || isMultiSelecting) {
- return;
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-explorer/sidebar.js
- const selection = defaultView.getSelection();
- if (selection.rangeCount && !selection.isCollapsed) {
- const blockNode = selectedRef.current;
- const {
- startContainer,
- endContainer
- } = selection.getRangeAt(0);
+/**
+ * WordPress dependencies
+ */
- if (!!blockNode && (!blockNode.contains(startContainer) || !blockNode.contains(endContainer))) {
- selection.removeAllRanges();
- }
- }
- return;
- }
- const {
- length
- } = multiSelectedBlockClientIds;
+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);
+ }));
+}
- if (length < 2) {
- return;
- } // The block refs might not be immediately available
- // when dragging blocks into another block.
+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
+ }));
+}
- if (!startRef.current || !endRef.current) {
- return;
- } // For some browsers, like Safari, it is important that focus happens
- // BEFORE selection.
+/* harmony default export */ var sidebar = (PatternExplorerSidebar);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/no-results.js
- 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.
+/**
+ * WordPress dependencies
+ */
- 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");
+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.')));
+}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-tab-nav.js
+/* 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
@@ -27755,198 +21859,291 @@ var external_wp_keycodes_ = __webpack_require__("RxS6");
+
/**
* 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.
+ */
-function isFormElement(element) {
- const {
- tagName
- } = element;
- return tagName === 'INPUT' || tagName === 'BUTTON' || tagName === 'SELECT' || tagName === 'TEXTAREA';
-}
+/**
+ * Returns the insertion point state given the inserter config.
+ *
+ * @param {WPInserterConfig} config Inserter Config.
+ * @return {Array} Insertion Point State (rootClientID, onInsertBlocks and onToggle).
+ */
-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"])();
+function useInsertionPoint(_ref) {
+ let {
+ rootClientId = '',
+ insertionIndex,
+ clientId,
+ isAppender,
+ onSelect,
+ shouldFocusBlock = true
+ } = _ref;
const {
- hasMultiSelection,
- getSelectedBlockClientId,
- getBlockCount
- } = Object(external_wp_data_["useSelect"])(store["a" /* store */]);
+ getSelectedBlock
+ } = (0,external_wp_data_namespaceObject.useSelect)(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.
+ destinationRootClientId,
+ destinationIndex
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
+ const {
+ getSelectedBlockClientId,
+ getBlockRootClientId,
+ getBlockIndex,
+ getBlockOrder
+ } = select(store);
+ const selectedBlockClientId = getSelectedBlockClientId();
+ let _destinationRootClientId = rootClientId;
- const focusCaptureTabIndex = !isNavigationMode ? '0' : undefined; // Reference that holds the a flag for enabling or disabling
- // capturing on the focus capture elements.
+ let _destinationIndex;
- const noCapture = Object(external_wp_element_["useRef"])();
+ 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;
+ }
- 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();
+ 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 {
- 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();
+ insertBlocks(blocks, destinationIndex, destinationRootClientId, true, shouldFocusBlock || shouldForceFocusBlock ? 0 : null, meta);
}
- }
- 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;
- }
+ 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 (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 (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);
- if (event.keyCode !== external_wp_keycodes_["TAB"]) {
- return;
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/search-items.js
+/**
+ * External dependencies
+ */
+ // Default search helpers
- const isShift = event.shiftKey;
- const direction = isShift ? 'findPrevious' : 'findNext';
+const defaultGetName = item => item.name || '';
- 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.
+const defaultGetTitle = item => item.title;
+const defaultGetDescription = item => item.description || '';
- if (isFormElement(event.target) && isFormElement(external_wp_dom_["focus"].tabbable[direction](event.target))) {
- return;
- }
+const defaultGetKeywords = item => item.keywords || [];
- 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).
+const defaultGetCategory = item => item.category;
- 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.
+const defaultGetCollection = () => null;
+/**
+ * Sanitizes the search input string.
+ *
+ * @param {string} input The search input to normalize.
+ *
+ * @return {string} The normalized search input.
+ */
- 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.
+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"
- 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
+ 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.
+ */
- function preventScrollOnTab(event) {
- var _event$target;
- if (event.keyCode !== external_wp_keycodes_["TAB"]) {
- return;
- }
+const getNormalizedSearchTerms = function () {
+ let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
+ // Extract words.
+ return (0,external_lodash_namespaceObject.words)(normalizeSearchInput(input));
+};
- if (((_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.getAttribute('role')) === 'region') {
- return;
- }
+const removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => {
+ return (0,external_lodash_namespaceObject.differenceWith)(unmatchedTerms, getNormalizedSearchTerms(unprocessedTerms), (unmatchedTerm, unprocessedTerm) => unprocessedTerm.includes(unmatchedTerm));
+};
- if (container.current === event.target) {
- return;
- }
+const searchBlockItems = (items, categories, collections, searchInput) => {
+ const normalizedSearchTerms = getNormalizedSearchTerms(searchInput);
- 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 (normalizedSearchTerms.length === 0) {
+ return items;
+ }
- if (target === focusCaptureBeforeRef.current || target === focusCaptureAfterRef.current) {
- event.preventDefault();
- target.focus({
- preventScroll: true
- });
- }
+ 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 {
- 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];
-}
+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);
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/dom.js
-var dom = __webpack_require__("OL6h");
+ if (normalizedSearchTerms.length === 0) {
+ return items;
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-arrow-nav.js
+ 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;
+ });
+};
/**
- * External dependencies
+ * 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
*/
@@ -27961,270 +22158,279 @@ var dom = __webpack_require__("OL6h");
-/**
- * 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';
+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));
}
-/**
- * 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);
+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;
- 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.
+ 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.
- focusableNodes = focusableNodes.slice(focusableNodes.indexOf(target) + 1);
- let targetRect;
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
+ if (!filterValue) {
+ return;
+ }
- if (onlyVertical) {
- targetRect = target.getBoundingClientRect();
- }
+ 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
- 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.
+/**
+ * WordPress dependencies
+ */
+
+
+
+/**
+ * Internal dependencies
+ */
- 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;
- }
+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
+ }));
+}
- return Object(external_lodash_["find"])(focusableNodes, isTabCandidate);
+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));
}
-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;
- }
+/* harmony default export */ var explorer = (PatternsExplorerModal);
- 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;
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-tab.js
- 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;
+/**
+ * WordPress dependencies
+ */
- 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);
- }
+/**
+ * Internal dependencies
+ */
- 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).
+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 (event.defaultPrevented) {
- return;
- }
+ if (!((_pattern$categories = pattern.categories) !== null && _pattern$categories !== void 0 && _pattern$categories.length)) {
+ return Infinity;
+ }
- if (!isNav) {
- return;
- } // Abort if our current target is not a candidate for navigation
- // (e.g. preserve native input behaviors).
+ 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.
- 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 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;
+ }
- const isReverseDir = Object(external_wp_dom_["isRTL"])(target) ? !isReverse : isReverse;
- const {
- keepCaretInsideBlock
- } = getSettings();
- const selectedBlockClientId = getSelectedBlockClientId();
+ 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
+ }));
+}
- if (isShift) {
- const selectionEndClientId = getMultiSelectedBlocksEndClientId();
- const selectionBeforeEndClientId = getPreviousBlockClientId(selectionEndClientId || selectedBlockClientId);
- const selectionAfterEndClientId = getNextBlockClientId(selectionEndClientId || selectedBlockClientId);
+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;
+ }
- 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);
+ return pattern.categories.some(cat => allCategories.some(category => category.name === cat));
+ }, [allCategories]); // Remove any empty categories
- 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();
+ 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')
+ });
}
- node.addEventListener('mousedown', onMouseDown);
- node.addEventListener('keydown', onKeyDown);
- return () => {
- node.removeEventListener('mousedown', onMouseDown);
- node.removeEventListener('keydown', onKeyDown);
- };
- }, []);
+ 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)
+ }));
}
-// EXTERNAL MODULE: external ["wp","keyboardShortcuts"]
-var external_wp_keyboardShortcuts_ = __webpack_require__("hF7m");
+/* 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
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-select-all.js
-/**
- * External dependencies
- */
/**
* WordPress dependencies
@@ -28232,63 +22438,91 @@ var external_wp_keyboardShortcuts_ = __webpack_require__("hF7m");
-
-
/**
* 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);
+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 (firstClientId === lastClientId) {
- return;
- }
+ if (filteredItems.length === 0) {
+ return (0,external_wp_element_namespaceObject.createElement)(no_results, null);
+ }
- multiSelect(firstClientId, lastClientId);
- event.preventDefault();
- }
+ 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.
- node.addEventListener('keydown', onKeyDown);
- return () => {
- node.removeEventListener('keydown', onKeyDown);
- };
- }, []);
+/**
+ * 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
+ */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/index.js
+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
/**
@@ -28303,6 +22537,7 @@ function useSelectAll() {
+
/**
* Internal dependencies
*/
@@ -28312,198 +22547,331 @@ function useSelectAll() {
-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);
-}
+
+
+const search_results_INITIAL_INSERTER_RESULTS = 9;
/**
- * Handles selection and navigation across blocks. This component should be
- * wrapped around BlockList.
+ * 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.
*
- * @param {Object} props Component properties.
- * @param {WPElement} props.children Children to be rendered.
+ * @type {Array}
*/
+const search_results_EMPTY_ARRAY = [];
-/* harmony default export */ var writing_flow = __webpack_exports__["a"] = (Object(external_wp_element_["forwardRef"])(WritingFlow));
-
-
-/***/ }),
+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
-/***/ "Tqx9":
-/***/ (function(module, exports) {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
+ if (!filterValue) {
+ return;
+ }
-(function() { module.exports = window["wp"]["primitives"]; }());
+ 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);
+ }
-/***/ "U1WI":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ return null;
+ }));
+}
-"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");
+/* harmony default export */ var search_results = (InserterSearchResults);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/tabs.js
/**
* WordPress dependencies
*/
-/**
- * Internal dependencies
- */
-function BlockSettingsMenu(_ref) {
+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 {
- clientIds,
- ...props
+ children,
+ showPatterns = false,
+ showReusableBlocks = false,
+ onSelect
} = _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);
+ 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);
+}
-/***/ "VKE3":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/* harmony default export */ var tabs = (InserterTabs);
-"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/inserter/menu.js
/**
* 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
+ * Internal 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");
+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;
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/default-block-appender/index.js
-var default_block_appender = __webpack_require__("5L8O");
+ 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;
+ }
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/button-block-appender/index.js
-var button_block_appender = __webpack_require__("I5Hl");
+ 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
+ }));
+}
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules
-var store = __webpack_require__("BhPs");
+/* harmony default export */ var menu = (InserterMenu);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list-appender/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/quick-inserter.js
/**
* External dependencies
*/
-
/**
* WordPress dependencies
*/
+
+
/**
* Internal dependencies
*/
@@ -28512,354 +22880,512 @@ var store = __webpack_require__("BhPs");
-function BlockListAppender(_ref) {
+
+const SEARCH_THRESHOLD = 6;
+const SHOWN_BLOCK_TYPES = 6;
+const SHOWN_BLOCK_PATTERNS = 2;
+function QuickInserter(_ref) {
let {
- blockClientIds,
+ onSelect,
rootClientId,
- canInsertDefaultBlock,
- isLocked,
- renderAppender: CustomAppender,
- className,
- selectedBlockClientId,
- tagName: TagName = 'div'
+ clientId,
+ isAppender
} = _ref;
+ 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 (isLocked || CustomAppender === false) {
- return null;
- }
-
- let appender;
+ const onBrowseAll = () => {
+ setInserterIsOpened({
+ rootClientId,
+ insertionIndex,
+ filterValue
+ });
+ };
- 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);
+ 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')));
+}
- if (!isDocumentAppender && !isParentSelected && (!selectedBlockClientId || isAnotherDefaultAppenderAlreadyDisplayed)) {
- return null;
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/index.js
- 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 dependencies
+ */
-// 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();
- }
+const defaultRenderToggle = _ref => {
+ let {
+ onToggle,
+ disabled,
+ isOpen,
+ blockTitle,
+ hasSingleBlockType,
+ toggleProps = {}
+ } = _ref;
+ let label;
- return;
- }
+ 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');
+ }
- let rootClientId;
+ const {
+ onClick,
+ ...rest
+ } = toggleProps; // Handle both onClick functions from the toggle and the parent component
- 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.
+ function handleClick(event) {
+ if (onToggle) {
+ onToggle(event);
+ }
+ if (onClick) {
+ onClick(event);
+ }
+ }
- if (getTemplateLock(rootClientId)) {
- return;
- }
+ 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));
+};
- 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;
- });
+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);
+ }
- if (!element) {
- return;
- } // The block may be in an alignment wrapper, so check the first direct
- // child if the element has no ID.
+ 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.
+ */
- 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
+ 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.
+ */
- const parentOverlay = (_element$parentElemen = element.parentElement) === null || _element$parentElemen === void 0 ? void 0 : _element$parentElemen.closest('.block-editor-block-content-overlay.overlay-active');
+ 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 (parentOverlay) {
- return;
- }
+ if (isQuick) {
+ return (0,external_wp_element_namespaceObject.createElement)(QuickInserter, {
+ onSelect: () => {
+ onClose();
+ },
+ rootClientId: rootClientId,
+ clientId: clientId,
+ isAppender: isAppender
+ });
+ }
- const clientId = element.id.slice('block-'.length);
+ return (0,external_wp_element_namespaceObject.createElement)(menu, {
+ onSelect: () => {
+ onClose();
+ },
+ rootClientId: rootClientId,
+ clientId: clientId,
+ isAppender: isAppender,
+ showInserterHelpPanel: showInserterHelpPanel
+ });
+ }
- if (!clientId) {
- return;
- } // Don't show the inserter when hovering above (conflicts with
- // block toolbar) or inside selected block(s).
+ 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
+ });
+ }
- if (getSelectedBlockClientIds().includes(clientId)) {
- return;
- }
+ 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
+ });
+ }
- 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();
- }
+/* 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;
- return;
- }
+ const allowedBlocks = __experimentalGetAllowedBlocks(rootClientId);
- const index = getBlockIndex(clientId); // Don't show the in-between inserter before the first block in
- // the list (preserves the original behaviour).
+ const directInsertBlock = __experimentalGetDirectInsertBlock(rootClientId);
- if (index === 0) {
- if (isBlockInsertionPointVisible()) {
- hideInsertionPoint();
- }
+ const hasSingleBlockType = (0,external_lodash_namespaceObject.size)(allowedBlocks) === 1 && (0,external_lodash_namespaceObject.size)(getBlockVariations(allowedBlocks[0].name, 'inserter')) === 0;
+ let allowedBlockType = false;
- return;
- }
+ if (hasSingleBlockType) {
+ allowedBlockType = allowedBlocks[0];
+ }
- showInsertionPoint(rootClientId, index, {
- __unstableWithInserter: true
- });
- }
+ 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;
- node.addEventListener('mousemove', onMouseMove);
- return () => {
- node.removeEventListener('mousemove', onMouseMove);
- };
- }, [openRef, getBlockListSettings, getBlockRootClientId, getBlockIndex, isBlockInsertionPointVisible, isMultiSelecting, showInsertionPoint, hideInsertionPoint, getSelectedBlockClientIds]);
-}
+ if (!hasSingleBlockType && !(directInsertBlock !== null && directInsertBlock !== void 0 && directInsertBlock.length)) {
+ return;
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/pre-parse-patterns.js
-/**
- * WordPress dependencies
- */
+ 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.
-/**
- * Internal dependencies
- */
+ const end = getBlockSelectionEnd();
+ if (!isAppender && end && getBlockRootClientId(end) === rootClientId) {
+ return getBlockIndex(end) + 1;
+ } // Otherwise, we insert at the end of the current rootClientId
-const requestIdleCallback = (() => {
- if (typeof window === 'undefined') {
- return callback => {
- setTimeout(() => callback(Date.now()), 0);
- };
- }
- return window.requestIdleCallback || window.requestAnimationFrame;
-})();
+ return getBlockOrder(rootClientId).length;
+ }
-const cancelIdleCallback = (() => {
- if (typeof window === 'undefined') {
- return clearTimeout;
- }
+ 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);
- return window.cancelIdleCallback || window.cancelAnimationFrame;
-})();
+ if (onSelectOrClose) {
+ onSelectOrClose();
+ }
-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;
+ 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);
}
- let handle;
- let index = -1;
-
- const callback = () => {
- index++;
-
- if (index >= patterns.length) {
- return;
- }
+ };
+}), // 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));
- Object(external_wp_data_["select"])(store["a" /* store */]).__experimentalGetParsedPattern(patterns[index].name);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/default-block-appender/index.js
- handle = requestIdleCallback(callback);
- };
- handle = requestIdleCallback(callback);
- return () => cancelIdleCallback(handle);
- }, [patterns]);
- return null;
-}
+/**
+ * External dependencies
+ */
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/layout.js
-var block_list_layout = __webpack_require__("w8sn");
+/**
+ * WordPress dependencies
+ */
-// 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
*/
/**
- * Internal dependencies
+ * Zero width non-breaking space, used as padding for the paragraph when it is
+ * empty.
*/
-
-
-function BlockToolsBackCompat(_ref) {
+const ZWNBSP = '\ufeff';
+function DefaultBlockAppender(_ref) {
let {
- children
+ isLocked,
+ isVisible,
+ onAppend,
+ showPrompt,
+ placeholder,
+ rootClientId
} = _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;
+ if (isLocked || !isVisible) {
+ return null;
}
- 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");
+ const value = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(placeholder) || (0,external_wp_i18n_namespaceObject.__)('Type / to choose a block');
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/index.js + 7 modules
-var inner_blocks = __webpack_require__("p3NJ");
+ 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
+ })
+ }, (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();
+ }
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/context.js
-var context = __webpack_require__("ur0x");
+ };
+}))(DefaultBlockAppender));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/button-block-appender/index.js
/**
@@ -28873,206 +23399,103 @@ var context = __webpack_require__("ur0x");
+
+
/**
* Internal dependencies
*/
-
-
-
-
-
-
-
-
-const elementContext = Object(external_wp_element_["createContext"])();
-const IntersectionObserver = Object(external_wp_element_["createContext"])();
-
-function Root(_ref) {
+function ButtonBlockAppender(_ref, ref) {
let {
+ rootClientId,
className,
- ...settings
+ onFocus,
+ tabIndex
} = _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
- })
- }, 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,
+ return (0,external_wp_element_namespaceObject.createElement)(inserter, {
+ position: "bottom center",
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));
-}
+ __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
+ }));
-/***/ "WbBG":
-/***/ (function(module, exports, __webpack_require__) {
+ if (isToggleButton || hasSingleBlockType) {
+ inserterButton = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
+ text: label
+ }, inserterButton);
+ }
-"use strict";
+ return inserterButton;
+ },
+ isAppender: true
+ });
+}
/**
- * Copyright (c) 2013-present, Facebook, Inc.
+ * Use `ButtonBlockAppender` instead.
*
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
+ * @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
+ */
-var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
-
-module.exports = ReactPropTypesSecret;
-
-
-/***/ }),
-
-/***/ "Wg7J":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/* harmony default export */ var button_block_appender = ((0,external_wp_element_namespaceObject.forwardRef)(ButtonBlockAppender));
-"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/");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list-appender/index.js
/**
* External dependencies
*/
+
/**
* WordPress dependencies
*/
-
-
-
/**
* Internal dependencies
*/
@@ -29081,722 +23504,658 @@ module.exports = ReactPropTypesSecret;
-
-
-
-
-
-
-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) {
+function BlockListAppender(_ref) {
let {
- filterValue,
- onSelect,
- onHover,
+ blockClientIds,
rootClientId,
- clientId,
- isAppender,
- __experimentalInsertionIndex,
- maxBlockPatterns,
- maxBlockTypes,
- showBlockDirectory = false,
- isDraggable = true,
- shouldFocusBlock = true
+ canInsertDefaultBlock,
+ isLocked,
+ renderAppender: CustomAppender,
+ className,
+ selectedBlockClientId,
+ tagName: TagName = 'div'
} = _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);
- }
+ if (isLocked || CustomAppender === false) {
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<any>} inputArray Array of items to check.
- * @return {any} The item with the most occurrences.
- */
+ let appender;
-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`.
- */
+ 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);
-function getAllUnit() {
- let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ if (!isDocumentAppender && !isParentSelected && (!selectedBlockClientId || isAnotherDefaultAppenderAlreadyDisplayed)) {
+ return null;
+ }
- if (typeof values === 'string') {
- const [, unit] = Object(external_wp_components_["__experimentalParseUnit"])(values);
- return unit || 'px';
+ 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"
+ });
+ }
}
- 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] : {};
+ 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);
+}
- /**
- * 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;
- }
+/* 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));
- 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;
-}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/use-popover-scroll.js
/**
- * Checks to determine if values are mixed.
- *
- * @param {Object} values Radius values.
- * @return {boolean} Whether values are mixed.
+ * WordPress dependencies
*/
-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.
+ * 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} values Radius values.
- * @return {boolean} Whether values are mixed.
+ * @param {Object} scrollableRef
*/
-function hasDefinedValues(values) {
- if (!values) {
- return false;
- } // A string value represents a shorthand value.
-
+function usePopoverScroll(scrollableRef) {
+ return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
+ if (!scrollableRef) {
+ return;
+ }
- if (typeof values === 'string') {
- return true;
- } // An object represents longhand border radius values, if any are set
- // flag values as being defined.
+ 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 filteredValues = Object.values(values).filter(value => {
- return !!value || value === 0;
- });
- return !!filteredValues.length;
+ 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/border-radius-control/all-input-control.js
-
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/insertion-point.js
/**
- * WordPress dependencies
+ * External dependencies
*/
-
/**
- * Internal dependencies
+ * WordPress 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
+ * Internal 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 InsertionPointOpenRef = (0,external_wp_element_namespaceObject.createContext)();
- 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.
+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;
- 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)
- }));
- }));
-}
+ const {
+ getBlockOrder,
+ getBlockListSettings,
+ getBlockInsertionPoint,
+ isBlockBeingDragged,
+ getPreviousBlockClientId,
+ getNextBlockClientId
+ } = select(store);
+ const insertionPoint = getBlockInsertionPoint();
+ const order = getBlockOrder(insertionPoint.rootClientId);
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js
-var library_link = __webpack_require__("Bpkj");
+ if (!order.length) {
+ return {};
+ }
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js
-var link_off = __webpack_require__("Mp0b");
+ let _previousClientId = order[insertionPoint.index - 1];
+ let _nextClientId = order[insertionPoint.index];
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/linked-button.js
+ 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 {};
+ }
-/**
- * WordPress dependencies
- */
+ 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;
-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
- })));
-}
+ 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 {};
+ }
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-setting/index.js
-var use_setting = __webpack_require__("v5LD");
+ const {
+ ownerDocument
+ } = previousElement || nextElement;
+ const previousRect = previousElement ? previousElement.getBoundingClientRect() : null;
+ const nextRect = nextElement ? nextElement.getBoundingClientRect() : null;
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/index.js
+ 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
+ };
+ }
-/**
- * WordPress dependencies
- */
+ 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);
+ }
+ }
-/**
- * Internal dependencies
- */
+ 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);
+}
-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
-};
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-in-between-inserter.js
/**
- * 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.
+ * WordPress dependencies
*/
-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);
- };
+/**
+ * Internal dependencies
+ */
- 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
- })));
-}
-/***/ }),
+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;
+ }
-/***/ "XNw2":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ function onMouseMove(event) {
+ var _getBlockListSettings, _element$parentElemen;
-"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__);
+ if (openRef.current) {
+ return;
+ }
+ if (isMultiSelecting()) {
+ return;
+ }
-/**
- * WordPress dependencies
- */
+ if (!event.target.classList.contains('block-editor-block-list__layout')) {
+ if (isBlockInsertionPointVisible()) {
+ hideInsertionPoint();
+ }
-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);
+ 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.
-/***/ "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__);
+ 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;
+ });
-/**
- * WordPress dependencies
- */
+ if (!element) {
+ return;
+ } // The block may be in an alignment wrapper, so check the first direct
+ // child if the element has no ID.
-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);
+ 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
-/***/ "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
- */
+ const parentOverlay = (_element$parentElemen = element.parentElement) === null || _element$parentElemen === void 0 ? void 0 : _element$parentElemen.closest('.block-editor-block-content-overlay.overlay-active');
-/**
- * WordPress dependencies
- */
+ 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).
-/**
- * Simple reducer used to increment a counter.
- *
- * @param {number} state Previous counter value.
- * @return {number} New state value.
- */
+ if (getSelectedBlockClientIds().includes(clientId)) {
+ return;
+ }
-const counterReducer = state => state + 1;
+ const elementRect = element.getBoundingClientRect();
-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.
- */
+ 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;
+ }
-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 index = getBlockIndex(clientId); // Don't show the in-between inserter before the first block in
+ // the list (preserves the original behaviour).
- const preserveScrollPosition = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useMemo"])(() => {
- if (!adjustScrolling || !ref.current) {
- return () => {};
- }
+ if (index === 0) {
+ if (isBlockInsertionPointVisible()) {
+ hideInsertionPoint();
+ }
- const scrollContainer = Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_3__["getScrollContainer"])(ref.current);
+ return;
+ }
- if (!scrollContainer) {
- return () => {};
+ showInsertionPoint(rootClientId, index, {
+ __unstableWithInserter: true
+ });
}
- const prevRect = ref.current.getBoundingClientRect();
+ node.addEventListener('mousemove', onMouseMove);
return () => {
- const blockRect = ref.current.getBoundingClientRect();
- const diff = blockRect.top - prevRect.top;
-
- if (diff) {
- scrollContainer.scrollTop += diff;
- }
+ node.removeEventListener('mousemove', onMouseMove);
};
- }, [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;
- }
+ }, [openRef, getBlockListSettings, getBlockRootClientId, getBlockIndex, isBlockInsertionPointVisible, isMultiSelecting, showInsertionPoint, hideInsertionPoint, getSelectedBlockClientIds]);
+}
- if (prefersReducedMotion) {
- // if the animation is disabled and the scroll needs to be adjusted,
- // just move directly to the final scroll position.
- preserveScrollPosition();
- return;
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/pre-parse-patterns.js
+/**
+ * WordPress dependencies
+ */
- 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;
+/**
+ * Internal dependencies
+ */
- 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.
+const requestIdleCallback = (() => {
+ if (typeof window === 'undefined') {
+ return callback => {
+ setTimeout(() => callback(Date.now()), 0);
+ };
+ }
- function onChange(_ref3) {
- let {
- value
- } = _ref3;
- let {
- x,
- y
- } = value;
- x = Math.round(x);
- y = Math.round(y);
+ return window.requestIdleCallback || window.requestAnimationFrame;
+})();
- if (x !== onChange.x || y !== onChange.y) {
- onFrameChange({
- x,
- y
- });
- onChange.x = x;
- onChange.y = y;
- }
+const cancelIdleCallback = (() => {
+ if (typeof window === 'undefined') {
+ return clearTimeout;
}
- 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;
-}
+ return window.cancelIdleCallback || window.cancelAnimationFrame;
+})();
-/* harmony default export */ __webpack_exports__["a"] = (useMovingAnimation);
+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++;
-/***/ "YLtl":
-/***/ (function(module, exports) {
+ if (index >= patterns.length) {
+ return;
+ }
-(function() { module.exports = window["lodash"]; }());
+ (0,external_wp_data_namespaceObject.select)(store).__experimentalGetParsedPattern(patterns[index].name);
-/***/ }),
+ handle = requestIdleCallback(callback);
+ };
-/***/ "YZt4":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ handle = requestIdleCallback(callback);
+ return () => cancelIdleCallback(handle);
+ }, [patterns]);
+ return null;
+}
-"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");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-block-display-information/index.js
/**
* WordPress dependencies
*/
@@ -29807,63 +24166,146 @@ function useMovingAnimation(_ref) {
*/
+/** @typedef {import('@wordpress/blocks').WPIcon} WPIcon */
+
/**
- * Returns the default class name if the block is a light block and it supports
- * `className`.
+ * Contains basic block's information for display reasons.
*
- * @param {string} clientId The block client ID.
+ * @typedef {Object} WPBlockDisplayInformation
*
- * @return {string} The class name, e.g. `wp-block-paragraph`.
+ * @property {string} title Human-readable block type label.
+ * @property {WPIcon} icon Block type icon.
+ * @property {string} description A detailed block type description.
*/
-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;
- }
+/**
+ * Hook used to try to find a matching block variation and return
+ * the appropriate information for display reasons. In order to
+ * to try to find a match we need to things:
+ * 1. Block's client id to extract it's current attributes.
+ * 2. A block variation should have set `isActive` prop to a proper function.
+ *
+ * If for any reason a block variaton match cannot be found,
+ * the returned information come from the Block Type.
+ * If no blockType is found with the provided clientId, returns null.
+ *
+ * @param {string} clientId Block's client id.
+ * @return {?WPBlockDisplayInformation} Block's display information, or `null` when the block or its type not found.
+ */
- return Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__["getBlockDefaultClassName"])(name);
+function useBlockDisplayInformation(clientId) {
+ return (0,external_wp_data_namespaceObject.useSelect)(select => {
+ if (!clientId) return null;
+ const {
+ getBlockName,
+ getBlockAttributes
+ } = select(store);
+ const {
+ getBlockType,
+ getActiveBlockVariation
+ } = select(external_wp_blocks_namespaceObject.store);
+ const blockName = getBlockName(clientId);
+ const blockType = getBlockType(blockName);
+ if (!blockType) return null;
+ const attributes = getBlockAttributes(clientId);
+ const match = getActiveBlockVariation(blockName, attributes);
+ const blockTypeInfo = {
+ title: blockType.title,
+ icon: blockType.icon,
+ description: blockType.description,
+ anchor: attributes === null || attributes === void 0 ? void 0 : attributes.anchor
+ };
+ if (!match) return blockTypeInfo;
+ return {
+ title: match.title || blockType.title,
+ icon: match.icon || blockType.icon,
+ description: match.description || blockType.description
+ };
}, [clientId]);
}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-title/index.js
+/**
+ * External dependencies
+ */
-/***/ }),
+/**
+ * WordPress dependencies
+ */
-/***/ "Z23Y":
-/***/ (function(module, exports) {
-(function() { module.exports = window["wp"]["warning"]; }());
-/***/ }),
+/**
+ * Internal dependencies
+ */
-/***/ "ZAjO":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-// EXTERNAL MODULE: external ["wp","element"]
-var external_wp_element_ = __webpack_require__("GRId");
+/**
+ * Renders the block's configured title as a string, or empty if the title
+ * cannot be determined.
+ *
+ * @example
+ *
+ * ```jsx
+ * <BlockTitle clientId="afd1cb17-2c08-4e7a-91be-007ba7ddc3a1" />
+ * ```
+ *
+ * @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 {};
+ }
-// EXTERNAL MODULE: external ["wp","blocks"]
-var external_wp_blocks_ = __webpack_require__("HSyU");
+ const {
+ getBlockName,
+ getBlockAttributes,
+ __experimentalGetReusableBlockTitle
+ } = select(store);
+ const blockName = getBlockName(clientId);
-// EXTERNAL MODULE: external ["wp","components"]
-var external_wp_components_ = __webpack_require__("tI+e");
+ if (!blockName) {
+ return {};
+ }
-// EXTERNAL MODULE: external ["wp","data"]
-var external_wp_data_ = __webpack_require__("1ZqX");
+ 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.
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/draggable-chip.js
-var draggable_chip = __webpack_require__("q3tz");
+ if (label && label !== blockType.title) {
+ return (0,external_lodash_namespaceObject.truncate)(label, {
+ length: 35
+ });
+ }
-// EXTERNAL MODULE: external ["wp","dom"]
-var external_wp_dom_ = __webpack_require__("1CF3");
+ return blockInformation.title;
+}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/use-scroll-when-dragging.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/use-scroll-when-dragging.js
/**
* WordPress dependencies
*/
@@ -29882,21 +24324,21 @@ const VELOCITY_MULTIPLIER = PIXELS_PER_SECOND_PER_PERCENTAGE * (SCROLL_INTERVAL_
*/
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.
+ 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.
- Object(external_wp_element_["useEffect"])(() => () => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => () => {
if (scrollEditorInterval.current) {
clearInterval(scrollEditorInterval.current);
scrollEditorInterval.current = null;
}
}, []);
- const startScrolling = Object(external_wp_element_["useCallback"])(event => {
+ const startScrolling = (0,external_wp_element_namespaceObject.useCallback)(event => {
dragStartY.current = event.clientY; // Find nearest parent(s) to scroll.
- scrollParentY.current = Object(external_wp_dom_["getScrollContainer"])(event.target);
+ 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.
@@ -29908,7 +24350,7 @@ function useScrollWhenDragging() {
}
}, SCROLL_INTERVAL_MS);
}, []);
- const scrollOnDragOver = Object(external_wp_element_["useCallback"])(event => {
+ const scrollOnDragOver = (0,external_wp_element_namespaceObject.useCallback)(event => {
if (!scrollParentY.current) {
return;
}
@@ -29947,10 +24389,7 @@ function useScrollWhenDragging() {
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
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/index.js
/**
@@ -29980,31 +24419,31 @@ const BlockDraggable = _ref => {
srcRootClientId,
isDraggable,
icon
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getBlockType;
const {
getBlockRootClientId,
getTemplateLock,
getBlockName
- } = select(store["a" /* store */]);
+ } = 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 = Object(external_wp_blocks_["getBlockType"])(blockName)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.icon
+ icon: (_getBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.icon
};
}, [clientIds]);
- const isDragging = Object(external_wp_element_["useRef"])(false);
+ const isDragging = (0,external_wp_element_namespaceObject.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
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store); // Stop dragging blocks if the block draggable is unmounted
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
return () => {
if (isDragging.current) {
stopDraggingBlocks();
@@ -30023,7 +24462,7 @@ const BlockDraggable = _ref => {
srcClientIds: clientIds,
srcRootClientId
};
- return Object(external_wp_element_["createElement"])(external_wp_components_["Draggable"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Draggable, {
cloneClassname: cloneClassname,
__experimentalTransferDataType: "wp-blocks",
transferData: transferData,
@@ -30046,7 +24485,7 @@ const BlockDraggable = _ref => {
onDragEnd();
}
},
- __experimentalDragComponent: Object(external_wp_element_["createElement"])(draggable_chip["a" /* default */], {
+ __experimentalDragComponent: (0,external_wp_element_namespaceObject.createElement)(BlockDraggableChip, {
count: clientIds.length,
icon: icon
})
@@ -30063,592 +24502,633 @@ const BlockDraggable = _ref => {
});
};
-/* harmony default export */ var block_draggable = __webpack_exports__["a"] = (BlockDraggable);
+/* harmony default export */ var block_draggable = (BlockDraggable);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/block-selection-button.js
-/***/ }),
-
-/***/ "Zzu2":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-// EXTERNAL MODULE: external ["wp","element"]
-var external_wp_element_ = __webpack_require__("GRId");
+/**
+ * External dependencies
+ */
-// EXTERNAL MODULE: ./node_modules/classnames/index.js
-var classnames = __webpack_require__("TSYQ");
-var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
+/**
+ * WordPress dependencies
+ */
-// 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
+ * Internal dependencies
*/
-/**
- * WordPress dependencies
- */
+/**
+ * Block selection button component, displaying the label of the block. If the block
+ * descends from a root block, a button is displayed enabling the user to select
+ * the root block.
+ *
+ * @param {string} props Component props.
+ * @param {string} props.clientId Client ID of block.
+ *
+ * @return {WPComponent} The component to be rendered.
+ */
-function Warning(_ref) {
+function BlockSelectionButton(_ref) {
let {
- className,
- actions,
- children,
- secondaryActions
+ clientId,
+ rootClientId,
+ blockElement
} = _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
- */
+ const blockInformation = useBlockDisplayInformation(clientId);
+ const selected = (0,external_wp_data_namespaceObject.useSelect)(select => {
+ var _getBlockListSettings;
+ const {
+ getBlock,
+ getBlockIndex,
+ hasBlockMovingClientId,
+ getBlockListSettings
+ } = select(store);
+ const index = getBlockIndex(clientId);
+ const {
+ name,
+ attributes
+ } = getBlock(clientId);
+ const blockMovingMode = hasBlockMovingClientId();
+ return {
+ index,
+ name,
+ attributes,
+ blockMovingMode,
+ orientation: (_getBlockListSettings = getBlockListSettings(rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation
+ };
+ }, [clientId, rootClientId]);
+ const {
+ index,
+ name,
+ attributes,
+ blockMovingMode,
+ orientation
+ } = selected;
+ const {
+ setNavigationMode,
+ removeBlock
+ } = (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.
-/* harmony default export */ var warning = __webpack_exports__["a"] = (Warning);
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
+ ref.current.focus();
+ (0,external_wp_a11y_namespaceObject.speak)(label);
+ }, [label]);
+ const {
+ hasBlockMovingClientId,
+ getBlockIndex,
+ getBlockRootClientId,
+ getClientIdsOfDescendants,
+ getSelectedBlockClientId,
+ getMultiSelectedBlocksEndClientId,
+ getPreviousBlockClientId,
+ getNextBlockClientId,
+ isNavigationMode
+ } = (0,external_wp_data_namespaceObject.useSelect)(store);
+ const {
+ selectBlock,
+ clearSelectedBlock,
+ setBlockMovingClientId,
+ moveBlockToPosition
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store);
+ function onKeyDown(event) {
+ const {
+ keyCode
+ } = 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 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_namespaceObject.BACKSPACE || keyCode === external_wp_keycodes_namespaceObject.DELETE) {
+ removeBlock(clientId);
+ event.preventDefault();
+ return;
+ }
-/***/ "abaT":
-/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) {
+ const selectedBlockClientId = getSelectedBlockClientId();
+ const selectionEndClientId = getMultiSelectedBlocksEndClientId();
+ const selectionBeforeEndClientId = getPreviousBlockClientId(selectionEndClientId || selectedBlockClientId);
+ const selectionAfterEndClientId = getNextBlockClientId(selectionEndClientId || selectedBlockClientId);
+ const navigateUp = isTab && isShift || isUp;
+ const navigateDown = isTab && !isShift || isDown; // Move out of current nesting level (no effect if at root level).
-"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<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])});
+ const navigateOut = isLeft; // Move into next nesting level (no effect if the current block has no innerBlocks).
+ const navigateIn = isRight;
+ let focusedBlockUid;
-/***/ }),
+ if (navigateUp) {
+ focusedBlockUid = selectionBeforeEndClientId;
+ } else if (navigateDown) {
+ focusedBlockUid = selectionAfterEndClientId;
+ } else if (navigateOut) {
+ var _getBlockRootClientId;
-/***/ "asom":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ focusedBlockUid = (_getBlockRootClientId = getBlockRootClientId(selectedBlockClientId)) !== null && _getBlockRootClientId !== void 0 ? _getBlockRootClientId : selectedBlockClientId;
+ } else if (navigateIn) {
+ var _getClientIdsOfDescen;
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BlockSupportSlotContainer; });
-/* 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__);
+ focusedBlockUid = (_getClientIdsOfDescen = getClientIdsOfDescendants([selectedBlockClientId])[0]) !== null && _getClientIdsOfDescen !== void 0 ? _getClientIdsOfDescen : selectedBlockClientId;
+ }
+ const startingBlockClientId = hasBlockMovingClientId();
+ if (isEscape && isNavigationMode()) {
+ clearSelectedBlock();
+ event.preventDefault();
+ }
-/**
- * WordPress dependencies
- */
+ if (isEscape && startingBlockClientId && !event.defaultPrevented) {
+ setBlockMovingClientId(null);
+ event.preventDefault();
+ }
+ if ((isEnter || isSpace) && startingBlockClientId) {
+ const sourceRoot = getBlockRootClientId(startingBlockClientId);
+ const destRoot = getBlockRootClientId(selectedBlockClientId);
+ const sourceBlockIndex = getBlockIndex(startingBlockClientId);
+ let destinationBlockIndex = getBlockIndex(selectedBlockClientId);
-function BlockSupportSlotContainer(_ref) {
- let {
- Slot,
- ...props
- } = _ref;
- const toolsPanelContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useContext"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__["__experimentalToolsPanelContext"]);
- return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(Slot, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, props, {
- fillProps: toolsPanelContext
- }));
-}
+ if (sourceBlockIndex < destinationBlockIndex && sourceRoot === destRoot) {
+ destinationBlockIndex -= 1;
+ }
+ moveBlockToPosition(startingBlockClientId, sourceRoot, destRoot, destinationBlockIndex);
+ selectBlock(startingBlockClientId);
+ setBlockMovingClientId(null);
+ }
-/***/ }),
+ if (navigateDown || navigateUp || navigateOut || navigateIn) {
+ if (focusedBlockUid) {
+ event.preventDefault();
+ selectBlock(focusedBlockUid);
+ } else if (isTab && selectedBlockClientId) {
+ let nextTabbable;
-/***/ "b2RC":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (navigateDown) {
+ nextTabbable = external_wp_dom_namespaceObject.focus.tabbable.findNext(blockElement);
-"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__);
+ if (!nextTabbable) {
+ nextTabbable = blockElement.ownerDocument.defaultView.frameElement;
+ nextTabbable = external_wp_dom_namespaceObject.focus.tabbable.findNext(nextTabbable);
+ }
+ } else {
+ nextTabbable = external_wp_dom_namespaceObject.focus.tabbable.findPrevious(blockElement);
+ }
+ if (nextTabbable) {
+ event.preventDefault();
+ nextTabbable.focus();
+ clearSelectedBlock();
+ }
+ }
+ }
+ }
-/**
- * WordPress dependencies
- */
+ const classNames = classnames_default()('block-editor-block-list__block-selection-button', {
+ 'is-block-moving-mode': !!blockMovingMode
+ });
-const grid = 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 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 */ __webpack_exports__["a"] = (grid);
+ const dragHandleLabel = (0,external_wp_i18n_namespaceObject.__)('Drag');
+ return (0,external_wp_element_namespaceObject.createElement)("div", {
+ className: classNames
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
+ justify: "center",
+ className: "block-editor-block-list__block-selection-button__content"
+ }, (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
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(block_draggable, {
+ clientIds: [clientId]
+ }, 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)))), (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"
+ }, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
+ clientId: clientId
+ })))));
+}
-/***/ }),
+/* harmony default export */ var block_selection_button = (BlockSelectionButton);
-/***/ "bTSr":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/navigable-toolbar/index.js
-"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 justifySpaceBetween = 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 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"
-}));
-/* harmony default export */ __webpack_exports__["a"] = (justifySpaceBetween);
-
-
-/***/ }),
-
-/***/ "bVTw":
-/***/ (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 lineSolid = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
- xmlns: "http://www.w3.org/2000/svg",
- width: "24",
- height: "24",
- fill: "none"
-}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
- d: "M5 11.25h14v1.5H5z"
-}));
-/* harmony default export */ __webpack_exports__["a"] = (lineSolid);
+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]'));
+}
-/***/ "bVpQ":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+function hasFocusWithin(container) {
+ return container.contains(container.ownerDocument.activeElement);
+}
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getColorObjectByAttributeValues; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getColorObjectByColorValue; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getColorClassName; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getMostReadableColor; });
-/* 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 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");
-/**
- * External dependencies
- */
+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
+ * <Toolbar /> 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);
-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"]]);
-/**
- * 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.
- */
+ 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'
+ });
+ }
-const getColorObjectByAttributeValues = (colors, definedColor, customColor) => {
- if (definedColor) {
- const colorObj = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["find"])(colors, {
- slug: definedColor
+ 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;
+}
- if (colorObj) {
- return colorObj;
+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;
- 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.
- */
+ if (initialIndex && !initialFocusOnMount) {
+ raf = window.requestAnimationFrame(() => {
+ const items = getAllToolbarItemsIn(ref.current);
+ const index = initialIndex || 0;
-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.
- */
+ if (items[index] && hasFocusWithin(ref.current)) {
+ items[index].focus();
+ }
+ });
+ }
-function getColorClassName(colorContextName, colorSlug) {
- if (!colorContextName || !colorSlug) {
- return undefined;
- }
+ 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.
- return `has-${Object(lodash__WEBPACK_IMPORTED_MODULE_0__["kebabCase"])(colorSlug)}-${colorContextName}`;
+ const items = getAllToolbarItemsIn(ref.current);
+ const index = items.findIndex(item => item.tabIndex === 0);
+ onIndexChange(index);
+ };
+ }, [initialIndex, initialFocusOnMount]);
}
-/**
- * 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;
-}
+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);
+}
-/***/ "beZb":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/* harmony default export */ var navigable_toolbar = (NavigableToolbar);
-"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/icons/build-module/library/chevron-right.js
/**
* WordPress dependencies
*/
-const stretchWide = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
+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"
-}, 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"
+}, (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 */ __webpack_exports__["a"] = (stretchWide);
-
-
-/***/ }),
-
-/***/ "btIw":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/* harmony default export */ var chevron_right = (chevronRight);
-"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/icons/build-module/library/chevron-left.js
/**
* WordPress dependencies
*/
-const keyboardReturn = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
+const chevronLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.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"
+ 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 */ __webpack_exports__["a"] = (keyboardReturn);
+/* harmony default export */ var chevron_left = (chevronLeft);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-up.js
-/***/ }),
-/***/ "c1Zz":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/**
+ * WordPress dependencies
+ */
-"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");
+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
/**
- * Internal dependencies
+ * 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;
-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
- };
- }
+ const getMovementDirection = moveDirection => {
+ if (moveDirection === 'up') {
+ if (orientation === 'horizontal') {
+ return (0,external_wp_i18n_namespaceObject.isRTL)() ? 'right' : 'left';
+ }
- return {
- panelId: selectedBlockClientId,
- clientIds: [selectedBlockClientId],
- attributes: {
- [selectedBlockClientId]: getBlockAttributes(selectedBlockClientId)
+ return 'up';
+ } else if (moveDirection === 'down') {
+ if (orientation === 'horizontal') {
+ return (0,external_wp_i18n_namespaceObject.isRTL)() ? 'left' : 'right';
}
- };
- }, []);
- 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.
+ return 'down';
+ }
- newBlockAttributes = { ...newBlockAttributes,
- style: Object(_hooks_utils__WEBPACK_IMPORTED_MODULE_4__[/* cleanEmptyObject */ "a"])(newBlockAttributes.style)
- };
- newAttributes[clientId] = newBlockAttributes;
- });
- updateBlockAttributes(clientIds, newAttributes, true);
+ return null;
};
- 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.
+ if (selectedCount > 1) {
+ return getMultiBlockMoverDescription(selectedCount, firstIndex, isFirst, isLast, dir);
+ }
- }, children);
-}
+ 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);
+ }
-/***/ "cDcd":
-/***/ (function(module, exports) {
+ 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);
+ }
-(function() { module.exports = window["React"]; }());
+ 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');
-/***/ "cDhi":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ 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);
+ }
-"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__);
+ 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);
+ }
+ }
-/**
- * WordPress dependencies
- */
+ if (dir < 0 && !isFirst) {
+ // moving up
+ const movementDirection = getMovementDirection('up');
-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);
-}
+ 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);
+ }
+ }
-/***/ "cGtP":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (dir < 0 && isFirst) {
+ // moving up, and is the first item
+ const movementDirection = getMovementDirection('up');
-"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__);
+ 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);
+ }
+ }
+}
/**
- * WordPress dependencies
+ * 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.
*/
-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
- */
+function getMultiBlockMoverDescription(selectedCount, firstIndex, isFirst, isLast, dir) {
+ const position = firstIndex + 1;
-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);
+ 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);
+ }
-/***/ "dchM":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ 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);
+ }
+}
-"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");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-mover/button.js
@@ -30656,1025 +25136,979 @@ const arrowLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["create
* 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))
- })));
-}
-/***/ }),
+const getArrowIcon = (direction, orientation) => {
+ if (direction === 'up') {
+ if (orientation === 'horizontal') {
+ return (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left;
+ }
-/***/ "dfZa":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ return chevron_up;
+ } else if (direction === 'down') {
+ if (orientation === 'horizontal') {
+ return (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right;
+ }
-"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__);
+ 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');
+ }
-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);
+ return (0,external_wp_i18n_namespaceObject.__)('Move down');
}
- getPayload() {
- return this.payload || [];
- }
+ 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;
-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;
+ const onClick = event => {
+ moverFunction(clientIds, rootClientId);
- if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].num(this._value)) {
- this.lastPosition = this._value;
+ if (props.onClick) {
+ props.onClick(event);
}
- }
+ };
- static create(value) {
- return new AnimatedValue(value);
- }
+ 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));
+});
- getPayload() {
- return [this];
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-mover/index.js
- 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;
+/**
+ * External dependencies
+ */
- if (this.done) {
- this.lastPosition = value;
- }
- }
- }
- if (this._value === value) {
- return false;
- }
+/**
+ * WordPress dependencies
+ */
- 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;
- }
+/**
+ * Internal dependencies
+ */
- 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();
+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)))));
}
-const TreeContext = {
- dependencies: null
-};
+/* harmony default export */ var block_mover = ((0,external_wp_data_namespaceObject.withSelect)((select, _ref2) => {
+ var _getBlockListSettings;
-class AnimatedObject extends Animated {
- constructor(source) {
- super();
- this.source = source;
- this.setValue(source);
- }
+ 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));
- 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;
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/utils.js
+/**
+ * External dependencies
+ */
- setValue(source) {
- this.source = source;
- this.payload = this._makePayload(source);
- }
+/**
+ * WordPress dependencies
+ */
- 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);
- }
- }
+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.
+ */
- _addToPayload(source) {
- if (TreeContext.dependencies && Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasFluidValue */ "r"])(source)) {
- TreeContext.dependencies.add(source);
+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);
}
- const payload = getPayload(source);
+ onChange(nextIsFocused);
+ };
- if (payload) {
- Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(payload, node => this.add(node));
- }
- }
+ const getIsHovered = () => {
+ return (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.matches(':hover');
+ };
-}
+ const shouldHideMovers = () => {
+ const isHovered = getIsHovered();
+ return !isFocused && !isHovered;
+ };
-class AnimatedArray extends AnimatedObject {
- constructor(source) {
- super(source);
- }
+ const clearTimeoutRef = () => {
+ const timeout = timeoutRef.current;
- static create(source) {
- return new AnimatedArray(source);
- }
+ if (timeout && utils_clearTimeout) {
+ utils_clearTimeout(timeout);
+ }
+ };
- getValue() {
- return this.source.map(node => node.getValue());
- }
+ const debouncedShowMovers = event => {
+ if (event) {
+ event.stopPropagation();
+ }
- setValue(source) {
- const payload = this.getPayload();
+ clearTimeoutRef();
- if (source.length == payload.length) {
- return payload.map((node, i) => node.setValue(source[i])).some(Boolean);
+ if (!showMovers) {
+ handleOnChange(true);
}
+ };
- super.setValue(source.map(makeAnimated));
- return true;
- }
+ const debouncedHideMovers = event => {
+ if (event) {
+ event.stopPropagation();
+ }
-}
+ clearTimeoutRef();
+ timeoutRef.current = utils_setTimeout(() => {
+ if (shouldHideMovers()) {
+ handleOnChange(false);
+ }
+ }, debounceTimeout);
+ };
-function makeAnimated(value) {
- const nodeType = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* isAnimatedString */ "t"])(value) ? AnimatedString : AnimatedValue;
- return nodeType.create(value);
+ (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 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 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);
-function _extends() {
- _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
+ const isFocusedWithin = () => {
+ return (ref === null || ref === void 0 ? void 0 : ref.current) && ref.current.contains(ref.current.ownerDocument.activeElement);
+ };
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
+ (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
}
-
- 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"])();
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-parent-selector/index.js
- const callback = () => {
- const instance = instanceRef.current;
- if (hasInstance && !instance) {
- return;
- }
- const didUpdate = instance ? host.applyAnimatedValues(instance, props.getValue(true)) : false;
+/**
+ * WordPress dependencies
+ */
- 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);
- }
- }
+/**
+ * Internal dependencies
+ */
-}
-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
- };
+/**
+ * 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.
+ */
- const animated = Component => {
- const displayName = getDisplayName(Component) || 'Anonymous';
+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);
- 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));
- }
+ const _parentBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(parentBlockName);
- Component.displayName = `Animated(${displayName})`;
- return Component;
- };
+ 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.
- 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);
+ const nodeRef = (0,external_wp_element_namespaceObject.useRef)();
+ const {
+ gestures: showMoversGestures
+ } = useShowMoversGestures({
+ ref: nodeRef,
+
+ onChange(isFocused) {
+ if (isFocused && hasReducedUI) {
+ return;
+ }
+
+ toggleBlockHighlight(firstParentClientId, isFocused);
}
- 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;
+ 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
-/***/ }),
-/***/ "eGrx":
-/***/ (function(module, exports) {
+/**
+ * WordPress dependencies
+ */
-var traverse = module.exports = function (obj) {
- return new Traverse(obj);
-};
+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);
-function Traverse (obj) {
- this.value = obj;
-}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/preview-block-popover.js
-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;
-};
+/**
+ * WordPress dependencies
+ */
-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);
-};
+/**
+ * Internal dependencies
+ */
-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;
-};
+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
+ })))));
+}
-Traverse.prototype.paths = function () {
- var acc = [];
- this.forEach(function (x) {
- acc.push(this.path);
- });
- return acc;
-};
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/block-transformations-menu.js
-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);
-};
+/**
+ * WordPress dependencies
+ */
-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]' }
+/**
+ * Internal dependencies
+ */
-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;
+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
+ */
-/***/ "ez49":
-/***/ (function(module, exports, __webpack_require__) {
-"use strict";
/**
- * Copyright 2013-2015, Facebook, Inc.
- * All rights reserved.
+ * Returns the active style from the given className.
*
- * 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.
+ * @param {Array} styles Block style variations.
+ * @param {string} className Class name
*
- * @providesModule isEventSupported
+ * @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
+ });
-var ExecutionEnvironment = __webpack_require__("o97j");
+ if (activeStyle) {
+ return activeStyle;
+ }
+ }
-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;
+ return (0,external_lodash_namespaceObject.find)(styles, 'isDefault');
}
-
/**
- * 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`.
+ * Replaces the active style in the block's className.
*
- * Borrows from Modernizr.
+ * @param {string} className Class name.
+ * @param {Object?} activeStyle The replaced style.
+ * @param {Object} newStyle The replacing style.
*
- * @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
+ * @return {string} The updated className.
*/
-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';
- }
+function replaceActiveStyle(className, activeStyle, newStyle) {
+ const list = new (external_wp_tokenList_default())(className);
- 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');
+ if (activeStyle) {
+ list.remove('is-style-' + activeStyle.name);
}
- return isSupported;
+ list.add('is-style-' + newStyle.name);
+ return list.value;
}
-module.exports = isEventSupported;
-
-
-/***/ }),
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-styles/index.js
-/***/ "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
- * <BlockTitle clientId="afd1cb17-2c08-4e7a-91be-007ba7ddc3a1" />
- * ```
- *
- * @param {Object} props
- * @param {string} props.clientId Client ID of block.
- *
- * @return {?string} Block title.
- */
-function BlockTitle(_ref) {
+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
+ clientId,
+ onSwitch = external_lodash_namespaceObject.noop,
+ onHoverClassName = external_lodash_namespaceObject.noop,
+ itemRole
} = _ref;
- const {
- attributes,
- name,
- reusableBlockTitle
- } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["useSelect"])(select => {
- if (!clientId) {
- return {};
- }
+ const selector = select => {
const {
- getBlockName,
- getBlockAttributes,
- __experimentalGetReusableBlockTitle
- } = select(_store__WEBPACK_IMPORTED_MODULE_4__[/* store */ "a"]);
- const blockName = getBlockName(clientId);
+ getBlock
+ } = select(store);
+ const block = getBlock(clientId);
- if (!blockName) {
- return {};
+ if (!block) {
+ return EMPTY_OBJECT;
}
- const isReusable = Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__["isReusableBlock"])(Object(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__["getBlockType"])(blockName));
+ const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(block.name);
+ const {
+ getBlockStyles
+ } = select(external_wp_blocks_namespaceObject.store);
return {
- attributes: getBlockAttributes(clientId),
- name: blockName,
- reusableBlockTitle: isReusable && __experimentalGetReusableBlockTitle(getBlockAttributes(clientId).ref)
+ block,
+ type: blockType,
+ styles: getBlockStyles(block.name),
+ className: block.attributes.className || ''
};
- }, [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
- });
- }
+ 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);
- return blockInformation.title;
-}
+ 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
+ });
+ }));
+}
-/***/ "fHnH":
-/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) {
+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));
+}
-"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<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.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()})};
+/* harmony default export */ var block_styles = (BlockStyles);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/block-styles-menu.js
-/***/ }),
-/***/ "fOYa":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/**
+ * WordPress dependencies
+ */
-"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");
+/**
+ * Internal dependencies
+ */
-// 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");
+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-controls/groups.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/utils.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);
+/**
+ * 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.
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules
-var store = __webpack_require__("BhPs");
+ if (consumedBlocks.has(clientId)) return;
+ if (name === selectedBlockName) return block; // Try to find a matching block from InnerBlocks recursively.
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/context.js
-var context = __webpack_require__("ur0x");
+ 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.
+ */
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-display-block-controls/index.js
-var use_display_block_controls = __webpack_require__("HgtZ");
+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-controls/hook.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/use-transformed-patterns.js
/**
* WordPress dependencies
*/
@@ -31685,199 +26119,473 @@ var use_display_block_controls = __webpack_require__("HgtZ");
*/
+/**
+ * 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`.
+ */
-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;
+ const consumedBlocks = new Set();
- return (_groups$group = block_controls_groups[group]) === null || _groups$group === void 0 ? void 0 : _groups$group.Fill;
- }
+ for (const selectedBlock of selectedBlocks) {
+ let isMatch = false;
- if (isParentDisplayed) {
- return block_controls_groups.parent.Fill;
- }
+ 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.
- return null;
-}
+ transformMatchingBlock(match, selectedBlock); // No need to loop through other pattern's blocks.
+
+ break;
+ } // Bail eary if a selected block has not been matched.
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/fill.js
+ if (!isMatch) return;
+ }
+ return _patternBlocks;
+};
/**
- * External dependencies
+ * @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 BlockControlsFill(_ref) {
+
+
+function PatternTransformationsMenu(_ref) {
let {
- group = 'default',
- controls,
- children,
- __experimentalShareWithChildBlocks = false
+ blocks,
+ patterns: statePatterns,
+ onSelect
} = _ref;
- const Fill = useBlockControlsFill(group, __experimentalShareWithChildBlocks);
+ 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')));
+}
- if (!Fill) {
- return null;
- }
+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
+ })))));
+}
- 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);
- }));
+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));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/slot.js
+/* 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
*/
-function BlockControlsSlot(_ref) {
+
+
+
+
+
+
+const BlockSwitcherDropdownMenu = _ref => {
let {
- group = 'default',
- ...props
+ clientIds,
+ blocks
} = _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);
+ 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;
- if (!hasFills) {
- return null;
- }
+ 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;
- if (group === 'default') {
- return Object(external_wp_element_["createElement"])(Slot, Object(esm_extends["a" /* default */])({}, props, {
- bubblesVirtually: true,
- fillProps: accessibleToolbarState
- }));
- }
+ const _isSingleBlockSelected = blocks.length === 1;
- 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
- })));
-}
+ const styles = _isSingleBlockSelected && getBlockStyles(firstBlockName);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-controls/index.js
+ 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.
-/**
- * Internal dependencies
- */
+ _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 BlockControls = BlockControlsFill;
-BlockControls.Slot = BlockControlsSlot; // This is just here for backward compatibility
+ const onBlockTransform = name => replaceBlocks(clientIds, (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, name)); // Pattern transformation through the `Patterns` API.
-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));
-};
+ const onPatternTransform = transformedBlocks => replaceBlocks(clientIds, transformedBlocks);
-/* harmony default export */ var block_controls = __webpack_exports__["b"] = (BlockControls);
+ 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]);
-/***/ "fPbg":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (!blocks.length || blocks.some(block => !block)) {
+ return null;
+ }
-"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__);
+ 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 alignLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
+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"
-}, 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"
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
+ d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"
}));
-/* harmony default export */ __webpack_exports__["a"] = (alignLeft);
+/* 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
+ */
-/***/ }),
-/***/ "faye":
-/***/ (function(module, exports) {
+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;
+ }
+ }
-(function() { module.exports = window["ReactDOM"]; }());
+ 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 => `<img src="${(0,external_wp_blob_namespaceObject.createBlobURL)(file)}">`).join('');
+ plainText = '';
+ }
+
+ return {
+ html,
+ plainText
+ };
+}
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/copy-handler/index.js
-/***/ "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
*/
@@ -31885,132 +26593,152 @@ const alignLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["create
+
+
+
/**
* 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]);
+function useNotifyCopy() {
const {
- getBlockRootClientId,
- getBlockIndex
- } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["useSelect"])(_store__WEBPACK_IMPORTED_MODULE_4__[/* store */ "a"]);
+ getBlockName
+ } = (0,external_wp_data_namespaceObject.useSelect)(store);
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.
- */
+ 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;
- function onKeyDown(event) {
- const {
- keyCode,
- target
- } = event;
+ 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 (keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["ENTER"] && keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["BACKSPACE"] && keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["DELETE"]) {
+ 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 (target !== node || Object(_wordpress_dom__WEBPACK_IMPORTED_MODULE_0__["isTextField"])(target)) {
+ if (!node.contains(event.target.ownerDocument.activeElement)) {
return;
}
+ const eventDefaultPrevented = event.defaultPrevented;
event.preventDefault();
- if (keyCode === _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_1__["ENTER"]) {
- insertDefaultBlock({}, getBlockRootClientId(clientId), getBlockIndex(clientId) + 1);
- } else {
- removeBlock(clientId);
+ 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);
}
- }
- /**
- * 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.
- */
+ 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;
+ }
- function onDragStart(event) {
- event.preventDefault();
+ 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.addEventListener('keydown', onKeyDown);
- node.addEventListener('dragstart', onDragStart);
+ node.ownerDocument.addEventListener('copy', handler);
+ node.ownerDocument.addEventListener('cut', handler);
+ node.ownerDocument.addEventListener('paste', handler);
return () => {
- node.removeEventListener('keydown', onKeyDown);
- node.removeEventListener('dragstart', onDragStart);
+ node.ownerDocument.removeEventListener('copy', handler);
+ node.ownerDocument.removeEventListener('cut', handler);
+ node.ownerDocument.removeEventListener('paste', handler);
};
- }, [clientId, isSelected, getBlockRootClientId, getBlockIndex, insertDefaultBlock, removeBlock]);
+ }, []);
}
+function CopyHandler(_ref) {
+ let {
+ children
+ } = _ref;
+ return (0,external_wp_element_namespaceObject.createElement)("div", {
+ ref: useClipboardHandler()
+ }, children);
+}
-/***/ }),
-
-/***/ "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");
-
-
+/* harmony default export */ var copy_handler = (CopyHandler);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-actions/index.js
/**
* External dependencies
*/
@@ -32021,298 +26749,269 @@ function useEventHandlers(clientId) {
-
-
/**
* 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 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,
-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;
- }
+ onDuplicate() {
+ return duplicateBlocks(clientIds, updateSelection);
+ },
- const {
- ownerNode,
- cssRules
- } = styleSheet;
+ onRemove() {
+ return removeBlocks(clientIds, updateSelection);
+ },
- if (!cssRules) {
- return;
- } // Generally, ignore inline styles. We add inline styles belonging to a
- // stylesheet later, which may or may not match the selectors.
+ 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)));
+ },
- 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.
+ onMoveTo() {
+ setNavigationMode(true);
+ selectBlock(clientIds[0]);
+ setBlockMovingClientId(clientIds[0]);
+ },
+ onGroup() {
+ if (!blocks.length) {
+ return;
+ }
- if (ownerNode.id === 'wp-reset-editor-styles-css') {
- return;
- }
+ const groupingBlockName = getGroupingBlockName(); // Activate the `transform` on `core/group` which does the conversion
- const isMatch = Array.from(cssRules).find(_ref => {
- let {
- selectorText
- } = _ref;
- return selectorText && (selectorText.includes(`.${BODY_CLASS_NAME}`) || selectorText.includes(`.${BLOCK_PREFIX}`));
- });
+ const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, groupingBlockName);
- 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.
+ if (!newBlocks) {
+ return;
+ }
- const inlineCssId = ownerNode.id.replace('-css', '-inline-css');
- const inlineCssElement = document.getElementById(inlineCssId);
+ replaceBlocks(clientIds, newBlocks);
+ },
+
+ onUngroup() {
+ if (!blocks.length) {
+ return;
+ }
+
+ const innerBlocks = blocks[0].innerBlocks;
+
+ if (!innerBlocks.length) {
+ return;
+ }
+
+ replaceBlocks(clientIds, innerBlocks);
+ },
- if (inlineCssElement) {
- doc.head.appendChild(inlineCssElement.cloneNode(true));
+ 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
+
+
/**
- * 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.
+ * External dependencies
*/
+/**
+ * WordPress dependencies
+ */
-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();
- }
- }
+/**
+ * Internal dependencies
+ */
- const eventTypes = ['dragover'];
- for (const name of eventTypes) {
- doc.addEventListener(name, bubbleEvent);
+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;
}
-}
-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]);
+ 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);
}
-
-async function loadScript(head, _ref2) {
+/* harmony default export */ var block_mode_toggle = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, _ref2) => {
let {
- id,
- src
+ clientId
} = _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;
-
+ 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 {
- contentRef,
- children,
- head,
- tabIndex = 0,
- ...props
+ onToggle = external_lodash_namespaceObject.noop,
+ clientId
} = _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;
+ return {
+ onToggleMode() {
+ dispatch(store).toggleBlockMode(clientId);
+ onToggle();
+ }
- if (readyState !== 'interactive' && readyState !== 'complete') {
- return false;
- }
+ };
+})])(BlockModeToggle));
- 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).
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-convert-button.js
- 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.
+/**
+ * WordPress dependencies
+ */
- 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();
+function BlockConvertButton(_ref) {
+ let {
+ shouldRender,
+ onClick,
+ small
+ } = _ref;
- if (TagName === 'style') {
- return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(TagName, {
- id,
- key: id
- }, textContent);
- }
+ if (!shouldRender) {
+ return null;
+ }
- 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);
+ 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);
}
-/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(Iframe));
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-html-convert-button.js
+/**
+ * WordPress dependencies
+ */
-/***/ }),
-/***/ "hMaJ":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/**
+ * Internal dependencies
+ */
-"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");
+/* 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
/**
- * External dependencies
+ * 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
@@ -32326,111 +27025,60 @@ function Iframe(_ref3, ref) {
*/
-const colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients'];
-function ColorGradientControlInner(_ref) {
+
+function ConvertToGroupButton(_ref) {
let {
- colors,
- gradients,
- disableCustomColors,
- disableCustomGradients,
- __experimentalHasMultipleOrigins,
- __experimentalIsRenderedInSidebar,
- className,
- label,
- onColorChange,
- onGradientChange,
- colorValue,
- gradientValue,
- clearable,
- showTitle = true,
- enableAlpha
+ clientIds,
+ isGroupable,
+ isUngroupable,
+ blocksSelection,
+ groupingBlockName,
+ onClose = () => {}
} = _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');
+ const {
+ replaceBlocks
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store);
- if (!canChooseAColor && !canChooseAGradient) {
- return null;
- }
+ const onConvertToGroup = () => {
+ // Activate the `transform` on the Grouping Block which does the conversion
+ const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocksSelection, groupingBlockName);
- 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
- }))));
-}
+ if (newBlocks) {
+ replaceBlocks(clientIds, newBlocks);
+ }
+ };
-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));
-}
+ const onConvertFromGroup = () => {
+ const innerBlocks = blocksSelection[0].innerBlocks;
-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);
- }
+ if (!innerBlocks.length) {
+ return;
+ }
- return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(ColorGradientControlSelect, props);
-}
+ replaceBlocks(clientIds, innerBlocks);
+ };
-/* harmony default export */ __webpack_exports__["a"] = (ColorGradientControl);
+ 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 ')));
+}
-/***/ }),
-/***/ "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");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js
/**
* WordPress dependencies
*/
@@ -32441,876 +27089,977 @@ function ColorGradientControl(props) {
*/
-
-
-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.
+ * Contains the properties `ConvertToGroupButton` component needs.
*
- * @param {string} clientId Block client ID.
+ * @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 useMultiSelection(clientId) {
- const {
- startMultiSelect,
- stopMultiSelect,
- multiSelect,
- selectBlock
- } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["useDispatch"])(_store__WEBPACK_IMPORTED_MODULE_2__[/* store */ "a"]);
+function useConvertToGroupButtonProps() {
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 => {
+ clientIds,
+ isGroupable,
+ isUngroupable,
+ blocksSelection,
+ groupingBlockName
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
+ var _blocksSelection$;
+
const {
- ownerDocument
- } = node;
+ getBlockRootClientId,
+ getBlocksByClientId,
+ canInsertBlockType,
+ getSelectedBlockClientIds
+ } = select(store);
const {
- defaultView
- } = ownerDocument;
- let anchorElement;
- let rafId;
+ getGroupingBlockName
+ } = select(external_wp_blocks_namespaceObject.store);
- function onSelectionChange(_ref) {
- let {
- isSelectionEnd
- } = _ref;
- const selection = defaultView.getSelection(); // If no selection is found, end multi selection and enable all rich
- // text areas.
+ const _clientIds = getSelectedBlockClientIds();
- if (!selection.rangeCount || selection.isCollapsed) {
- toggleRichText(node, true);
- return;
- }
+ const _groupingBlockName = getGroupingBlockName();
- const endClientId = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__[/* getBlockClientId */ "a"])(selection.focusNode);
- const isSingularSelection = clientId === endClientId;
+ const rootClientId = !!(_clientIds !== null && _clientIds !== void 0 && _clientIds.length) ? getBlockRootClientId(_clientIds[0]) : undefined;
+ const groupingBlockAvailable = canInsertBlockType(_groupingBlockName, rootClientId);
- 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.
+ const _blocksSelection = getBlocksByClientId(_clientIds);
- if (isSelectionEnd) {
- toggleRichText(node, true);
+ 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)
- if (selection.rangeCount) {
- const {
- commonAncestorContainer
- } = selection.getRangeAt(0);
+ const _isGroupable = groupingBlockAvailable && _blocksSelection.length && !isSingleGroupingBlock; // Do we have a single Group Block selected and does that group have inner blocks?
- 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]);
- }
+
+ 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 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.
+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));
+}
- rafId = defaultView.requestAnimationFrame(() => {
- onSelectionChange({
- isSelectionEnd: true
- });
- stopMultiSelect();
- });
- }
+BlockSettingsMenuControls.Slot = BlockSettingsMenuControlsSlot;
+/* harmony default export */ var block_settings_menu_controls = (BlockSettingsMenuControls);
- function onMouseLeave(_ref2) {
- let {
- buttons
- } = _ref2;
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-settings-dropdown.js
- // 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.
+/**
+ * External dependencies
+ */
- 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.
+/**
+ * WordPress dependencies
+ */
- 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]);
-}
-/***/ }),
+/**
+ * Internal dependencies
+ */
-/***/ "iA5R":
-/***/ (function(module, exports, __webpack_require__) {
-"use strict";
-/*istanbul ignore start*/
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.diffChars = diffChars;
-exports.characterDiff = void 0;
-/*istanbul ignore end*/
-var
-/*istanbul ignore start*/
-_base = _interopRequireDefault(__webpack_require__("smQA"))
-/*istanbul ignore end*/
-;
-/*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-/*istanbul ignore end*/
-var characterDiff = new
-/*istanbul ignore start*/
-_base
-/*istanbul ignore end*/
-.
-/*istanbul ignore start*/
-default
-/*istanbul ignore end*/
-();
+const block_settings_dropdown_POPOVER_PROPS = {
+ className: 'block-editor-block-settings-menu__popover',
+ position: 'bottom right',
+ isAlternate: true
+};
-/*istanbul ignore start*/
-exports.characterDiff = characterDiff;
+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'));
+}
-/*istanbul ignore end*/
-function diffChars(oldStr, newStr, options) {
- return characterDiff.diff(oldStr, newStr, options);
+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
-/***/ }),
-/***/ "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
+ * Internal dependencies
*/
-function Icon(_ref) {
+
+function BlockSettingsMenu(_ref) {
let {
- icon,
- size = 24,
+ clientIds,
...props
} = _ref;
- return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["cloneElement"])(icon, {
- width: size,
- height: size,
- ...props
- });
+ 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);
-/* harmony default export */ __webpack_exports__["a"] = (Icon);
-
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/index.js
-/***/ }),
-
-/***/ "j6zP":
-/***/ (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 _block_draggable_draggable_chip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("q3tz");
+/**
+ * External dependencies
+ */
/**
* WordPress dependencies
*/
+
+
+
+
+
/**
* Internal dependencies
*/
-const InserterDraggableBlocks = _ref => {
+
+
+
+
+
+function BlockToolbar(_ref) {
let {
- isEnabled,
- blocks,
- icon,
- children
+ hideDragHandle
} = _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
- });
- });
-};
+ 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.
-/* harmony default export */ __webpack_exports__["a"] = (InserterDraggableBlocks);
+ 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);
+ }
-/***/ "jB5C":
-/***/ (function(module, exports, __webpack_require__) {
+ }); // Account for the cases where the block toolbar is rendered within the
+ // header area and not contextually to the block.
-"use strict";
+ const displayHeaderToolbar = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<') || hasFixedToolbar;
+ if (blockType) {
+ if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, '__experimentalToolbar', true)) {
+ return null;
+ }
+ }
-var _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; };
+ const shouldShowMovers = displayHeaderToolbar || showMovers;
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
+ if (blockClientIds.length === 0) {
+ return null;
+ }
-var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;
+ 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
+ }));
+}
-function getClientPosition(elem) {
- var box = undefined;
- var x = undefined;
- var y = undefined;
- var doc = elem.ownerDocument;
- var body = doc.body;
- var docElem = doc && doc.documentElement;
- // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式
- box = elem.getBoundingClientRect();
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/block-contextual-toolbar.js
- // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop
- // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确
- // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin
- x = box.left;
- y = box.top;
- // In IE, most of the time, 2 extra pixels are added to the top and left
- // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and
- // IE6 standards mode, this border can be overridden by setting the
- // document element's border to zero -- thus, we cannot rely on the
- // offset always being 2 pixels.
+/**
+ * External dependencies
+ */
- // In quirks mode, the offset can be determined by querying the body's
- // clientLeft/clientTop, but in standards mode, it is found by querying
- // the document element's clientLeft/clientTop. Since we already called
- // getClientBoundingRect we have already forced a reflow, so it is not
- // too expensive just to query them all.
+/**
+ * WordPress dependencies
+ */
- // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的
- // 窗口边框标准是设 documentElement ,quirks 时设置 body
- // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去
- // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置
- // 标准 ie 下 docElem.clientTop 就是 border-top
- // ie7 html 即窗口边框改变不了。永远为 2
- // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0
- x -= docElem.clientLeft || body.clientLeft || 0;
- y -= docElem.clientTop || body.clientTop || 0;
- return {
- left: x,
- top: y
- };
-}
-function getScroll(w, top) {
- var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];
- var method = 'scroll' + (top ? 'Top' : 'Left');
- if (typeof ret !== 'number') {
- var d = w.document;
- // ie6,7,8 standard mode
- ret = d.documentElement[method];
- if (typeof ret !== 'number') {
- // quirks mode
- ret = d.body[method];
+/**
+ * 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;
}
- }
- return ret;
-}
+ } // Shifts the toolbar to make room for the parent block selector.
-function getScrollLeft(w) {
- return getScroll(w);
-}
-function getScrollTop(w) {
- return getScroll(w, true);
+ 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
+ }));
}
-function getOffset(el) {
- var pos = getClientPosition(el);
- var doc = el.ownerDocument;
- var w = doc.defaultView || doc.parentWindow;
- pos.left += getScrollLeft(w);
- pos.top += getScrollTop(w);
- return pos;
-}
-function _getComputedStyle(elem, name, computedStyle_) {
- var val = '';
- var d = elem.ownerDocument;
- var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);
+/* harmony default export */ var block_contextual_toolbar = (BlockContextualToolbar);
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/block-popover.js
+
+
+/**
+ * External dependencies
+ */
+
+
+/**
+ * WordPress dependencies
+ */
+
+
+
- // https://github.com/kissyteam/kissy/issues/61
- if (computedStyle) {
- val = computedStyle.getPropertyValue(name) || computedStyle[name];
- }
- return val;
-}
-var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');
-var RE_POS = /^(top|right|bottom|left)$/;
-var CURRENT_STYLE = 'currentStyle';
-var RUNTIME_STYLE = 'runtimeStyle';
-var LEFT = 'left';
-var PX = 'px';
-function _getComputedStyleIE(elem, name) {
- // currentStyle maybe null
- // http://msdn.microsoft.com/en-us/library/ms535231.aspx
- var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];
- // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值
- // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19
- // 在 ie 下不对,需要直接用 offset 方式
- // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了
+/**
+ * Internal dependencies
+ */
- // From the awesome hack by Dean Edwards
- // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
- // If we're not dealing with a regular pixel number
- // but a number that has a weird ending, we need to convert it to pixels
- // exclude left right for relativity
- if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {
- // Remember the original values
- var style = elem.style;
- var left = style[LEFT];
- var rsLeft = elem[RUNTIME_STYLE][LEFT];
- // prevent flashing of content
- elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];
- // Put in the new values to get a computed value out
- style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;
- ret = style.pixelLeft + PX;
- // Revert the changed values
- style[LEFT] = left;
- elem[RUNTIME_STYLE][LEFT] = rsLeft;
- }
- return ret === '' ? 'auto' : ret;
-}
-var getComputedStyleX = undefined;
-if (typeof window !== 'undefined') {
- getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;
-}
-function each(arr, fn) {
- for (var i = 0; i < arr.length; i++) {
- fn(arr[i]);
- }
-}
-function isBorderBoxFn(elem) {
- return getComputedStyleX(elem, 'boxSizing') === 'border-box';
+function block_popover_selector(select) {
+ const {
+ isNavigationMode,
+ isMultiSelecting,
+ hasMultiSelection,
+ isTyping,
+ isCaretWithinFormattedText,
+ getSettings,
+ getLastMultiSelectedBlockClientId
+ } = select(store);
+ return {
+ isNavigationMode: isNavigationMode(),
+ isMultiSelecting: isMultiSelecting(),
+ isTyping: isTyping(),
+ isCaretWithinFormattedText: isCaretWithinFormattedText(),
+ hasMultiSelection: hasMultiSelection(),
+ hasFixedToolbar: getSettings().hasFixedToolbar,
+ lastClientId: getLastMultiSelectedBlockClientId()
+ };
}
-var BOX_MODELS = ['margin', 'border', 'padding'];
-var CONTENT_INDEX = -1;
-var PADDING_INDEX = 2;
-var BORDER_INDEX = 1;
-var MARGIN_INDEX = 0;
-
-function swap(elem, options, callback) {
- var old = {};
- var style = elem.style;
- var name = undefined;
+function BlockPopover(_ref) {
+ let {
+ clientId,
+ rootClientId,
+ isValid,
+ isEmptyDefaultBlock,
+ capturingClientId,
+ __unstablePopoverSlot,
+ __unstableContentRef
+ } = _ref;
+ const {
+ isNavigationMode,
+ isMultiSelecting,
+ isTyping,
+ isCaretWithinFormattedText,
+ hasMultiSelection,
+ hasFixedToolbar,
+ lastClientId
+ } = (0,external_wp_data_namespaceObject.useSelect)(block_popover_selector, []);
+ const isInsertionPointVisible = (0,external_wp_data_namespaceObject.useSelect)(select => {
+ const {
+ isBlockInsertionPointVisible,
+ getBlockInsertionPoint,
+ getBlockOrder
+ } = select(store);
- // Remember the old values, and insert the new ones
- for (name in options) {
- if (options.hasOwnProperty(name)) {
- old[name] = style[name];
- style[name] = options[name];
+ if (!isBlockInsertionPointVisible()) {
+ return false;
}
- }
- callback.call(elem);
+ const insertionPoint = getBlockInsertionPoint();
+ const order = getBlockOrder(insertionPoint.rootClientId);
+ return order[insertionPoint.index] === clientId;
+ }, [clientId]);
+ 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
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store); // Controls when the side inserter on empty lines should
+ // be shown, including writing and selection modes.
- // Revert the old values
- for (name in options) {
- if (options.hasOwnProperty(name)) {
- style[name] = old[name];
+ const showEmptyBlockSideInserter = !isTyping && !isNavigationMode && isEmptyDefaultBlock && isValid;
+ const shouldShowBreadcrumb = isNavigationMode;
+ const shouldShowContextualToolbar = !isNavigationMode && !hasFixedToolbar && isLargeViewport && !showEmptyBlockSideInserter && !isMultiSelecting && (!isTyping || isCaretWithinFormattedText);
+ const canFocusHiddenToolbar = !isNavigationMode && !shouldShowContextualToolbar && !hasFixedToolbar && !isEmptyDefaultBlock;
+ (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/focus-toolbar', () => {
+ setIsToolbarForced(true);
+ stopTyping(true);
+ }, {
+ isDisabled: !canFocusHiddenToolbar
+ });
+ (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.
-function getPBMWidth(elem, props, which) {
- var value = 0;
- var prop = undefined;
- var j = undefined;
- var i = undefined;
- for (j = 0; j < props.length; j++) {
- prop = props[j];
- if (prop) {
- for (i = 0; i < which.length; i++) {
- var cssProp = undefined;
- if (prop === 'border') {
- cssProp = prop + which[i] + 'Width';
- } else {
- cssProp = prop + which[i];
- }
- value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;
- }
- }
+ 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;
}
- return value;
-}
-/**
- * A crude way of determining if an object is a window
- * @member util
- */
-function isWindow(obj) {
- // must use == for ie8
- /* eslint eqeqeq:0 */
- return obj != null && obj == obj.window;
-}
+ let node = selectedElement;
-var domUtils = {};
+ if (!node) {
+ return null;
+ }
-each(['Width', 'Height'], function (name) {
- domUtils['doc' + name] = function (refWin) {
- var d = refWin.document;
- return Math.max(
- // firefox chrome documentElement.scrollHeight< body.scrollHeight
- // ie standard mode : documentElement.scrollHeight> body.scrollHeight
- d.documentElement['scroll' + name],
- // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?
- d.body['scroll' + name], domUtils['viewport' + name](d));
- };
+ if (capturingClientId) {
+ node = capturingElement;
+ }
- domUtils['viewport' + name] = function (win) {
- // pc browser includes scrollbar in window.innerWidth
- var prop = 'client' + name;
- var doc = win.document;
- var body = doc.body;
- var documentElement = doc.documentElement;
- var documentElementProp = documentElement[prop];
- // 标准模式取 documentElement
- // backcompat 取 body
- return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;
- };
-});
+ let anchorRef = node;
-/*
- 得到元素的大小信息
- @param elem
- @param name
- @param {String} [extra] 'padding' : (css width) + padding
- 'border' : (css width) + padding + border
- 'margin' : (css width) + padding + border + margin
- */
-function getWH(elem, name, extra) {
- if (isWindow(elem)) {
- return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);
- } else if (elem.nodeType === 9) {
- return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);
- }
- var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
- var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;
- var computedStyle = getComputedStyleX(elem);
- var isBorderBox = isBorderBoxFn(elem, computedStyle);
- var cssBoxValue = 0;
- if (borderBoxValue == null || borderBoxValue <= 0) {
- borderBoxValue = undefined;
- // Fall back to computed then un computed css if necessary
- cssBoxValue = getComputedStyleX(elem, name);
- if (cssBoxValue == null || Number(cssBoxValue) < 0) {
- cssBoxValue = elem.style[name] || 0;
- }
- // Normalize '', auto, and prepare for extra
- cssBoxValue = parseFloat(cssBoxValue) || 0;
- }
- if (extra === undefined) {
- extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;
- }
- var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;
- var val = borderBoxValue || cssBoxValue;
- if (extra === CONTENT_INDEX) {
- if (borderBoxValueOrIsBorderBox) {
- return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);
+ if (hasMultiSelection) {
+ // Wait to render the popover until the bottom reference is available
+ // as well.
+ if (!lastSelectedElement) {
+ return null;
}
- return cssBoxValue;
+
+ anchorRef = {
+ top: node,
+ bottom: lastSelectedElement
+ };
}
- if (borderBoxValueOrIsBorderBox) {
- var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle);
- return val + (extra === BORDER_INDEX ? 0 : padding);
+
+ function onFocus() {
+ setIsInserterShown(true);
}
- return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);
-}
-var cssShow = {
- position: 'absolute',
- visibility: 'hidden',
- display: 'block'
-};
+ function onBlur() {
+ setIsInserterShown(false);
+ } // Position above the anchor, pop out towards the right, and position in the
+ // left corner. For the side inserter, pop out towards the left, and
+ // position in the right corner.
+ // To do: refactor `Popover` to make this prop clearer.
-// fix #119 : https://github.com/kissyteam/kissy/issues/119
-function getWHIgnoreDisplay(elem) {
- var val = undefined;
- var args = arguments;
- // in case elem is window
- // elem.offsetWidth === undefined
- if (elem.offsetWidth !== 0) {
- val = getWH.apply(undefined, args);
- } else {
- swap(elem, cssShow, function () {
- val = getWH.apply(undefined, args);
- });
- }
- return val;
+
+ const popoverPosition = showEmptyBlockSideInserter ? 'top left right' : 'top right left';
+ const {
+ ownerDocument
+ } = node;
+ const stickyBoundaryElement = showEmptyBlockSideInserter ? undefined : // The sticky boundary element should be the boundary at which the
+ // 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 || (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,
+ position: popoverPosition,
+ focusOnMount: false,
+ anchorRef: anchorRef,
+ className: classnames_default()('block-editor-block-list__block-popover', {
+ 'is-insertion-point-visible': isInsertionPointVisible
+ }),
+ __unstableStickyBoundaryElement: stickyBoundaryElement // Render in the old slot if needed for backward compatibility,
+ // otherwise render in place (not in the the default popover slot).
+ ,
+ __unstableSlotName: __unstablePopoverSlot || null,
+ __unstableBoundaryParent: true // Observe movement for block animations (especially horizontal).
+ ,
+ __unstableObserveElement: node,
+ shouldAnchorIncludePadding: true // Used to safeguard sticky position behavior against cases where it would permanently
+ // obscure specific sections of a block.
+ ,
+ __unstableEditorCanvasWrapper: __unstableContentRef === null || __unstableContentRef === void 0 ? void 0 : __unstableContentRef.current
+ }, (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
+ // 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
+ ,
+ tabIndex: -1,
+ className: classnames_default()('block-editor-block-list__block-popover-inserter', {
+ 'is-visible': isInserterShown
+ })
+ }, (0,external_wp_element_namespaceObject.createElement)(inserter, {
+ clientId: clientId,
+ rootClientId: rootClientId,
+ __experimentalIsQuick: true
+ })), (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,
+ __experimentalInitialIndex: initialToolbarItemIndexRef.current,
+ __experimentalOnIndexChange: index => {
+ initialToolbarItemIndexRef.current = index;
+ } // Resets the index whenever the active block changes so
+ // this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169
+ ,
+ key: clientId
+ }), shouldShowBreadcrumb && (0,external_wp_element_namespaceObject.createElement)(block_selection_button, {
+ clientId: clientId,
+ rootClientId: rootClientId,
+ blockElement: node
+ }), showEmptyBlockSideInserter && (0,external_wp_element_namespaceObject.createElement)("div", {
+ className: "block-editor-block-list__empty-block-inserter"
+ }, (0,external_wp_element_namespaceObject.createElement)(inserter, {
+ position: "bottom right",
+ rootClientId: rootClientId,
+ clientId: clientId,
+ __experimentalIsQuick: true
+ })));
}
-function css(el, name, v) {
- var value = v;
- if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {
- for (var i in name) {
- if (name.hasOwnProperty(i)) {
- css(el, i, name[i]);
- }
- }
- return undefined;
- }
- if (typeof value !== 'undefined') {
- if (typeof value === 'number') {
- value += 'px';
- }
- el.style[name] = value;
- return undefined;
+function wrapperSelector(select) {
+ const {
+ getSelectedBlockClientId,
+ getFirstMultiSelectedBlockClientId,
+ getBlockRootClientId,
+ getBlock,
+ getBlockParents,
+ __experimentalGetBlockListSettingsForBlocks
+ } = select(store);
+ const clientId = getSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();
+
+ if (!clientId) {
+ return;
}
- return getComputedStyleX(el, name);
-}
-each(['width', 'height'], function (name) {
- var first = name.charAt(0).toUpperCase() + name.slice(1);
- domUtils['outer' + first] = function (el, includeMargin) {
- return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);
- };
- var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
+ const {
+ name,
+ attributes = {},
+ isValid
+ } = getBlock(clientId) || {};
+ const blockParentsClientIds = getBlockParents(clientId); // Get Block List Settings for all ancestors of the current Block clientId
- domUtils[name] = function (elem, val) {
- if (val !== undefined) {
- if (elem) {
- var computedStyle = getComputedStyleX(elem);
- var isBorderBox = isBorderBoxFn(elem);
- if (isBorderBox) {
- val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);
- }
- return css(elem, name, val);
- }
- return undefined;
- }
- return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);
+ const parentBlockListSettings = __experimentalGetBlockListSettingsForBlocks(blockParentsClientIds); // Get the clientId of the topmost parent with the capture toolbars setting.
+
+
+ const capturingClientId = (0,external_lodash_namespaceObject.find)(blockParentsClientIds, parentClientId => {
+ var _parentBlockListSetti;
+
+ return (_parentBlockListSetti = parentBlockListSettings[parentClientId]) === null || _parentBlockListSetti === void 0 ? void 0 : _parentBlockListSetti.__experimentalCaptureToolbars;
+ });
+ return {
+ clientId,
+ rootClientId: getBlockRootClientId(clientId),
+ name,
+ isValid,
+ isEmptyDefaultBlock: name && (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)({
+ name,
+ attributes
+ }),
+ capturingClientId
};
-});
+}
-// 设置 elem 相对 elem.ownerDocument 的坐标
-function setOffset(elem, offset) {
- // set position first, in-case top/left are set even on static elem
- if (css(elem, 'position') === 'static') {
- elem.style.position = 'relative';
+function WrappedBlockPopover(_ref2) {
+ let {
+ __unstablePopoverSlot,
+ __unstableContentRef
+ } = _ref2;
+ const selected = (0,external_wp_data_namespaceObject.useSelect)(wrapperSelector, []);
+
+ if (!selected) {
+ return null;
}
- var old = getOffset(elem);
- var ret = {};
- var current = undefined;
- var key = undefined;
+ const {
+ clientId,
+ rootClientId,
+ name,
+ isValid,
+ isEmptyDefaultBlock,
+ capturingClientId
+ } = selected;
- for (key in offset) {
- if (offset.hasOwnProperty(key)) {
- current = parseFloat(css(elem, key)) || 0;
- ret[key] = current + offset[key] - old[key];
- }
+ if (!name) {
+ return null;
}
- css(elem, ret);
-}
-
-module.exports = _extends({
- getWindow: function getWindow(node) {
- var doc = node.ownerDocument || node;
- return doc.defaultView || doc.parentWindow;
- },
- offset: function offset(el, value) {
- if (typeof value !== 'undefined') {
- setOffset(el, value);
- } else {
- return getOffset(el);
- }
- },
- isWindow: isWindow,
- each: each,
- css: css,
- clone: function clone(obj) {
- var ret = {};
- for (var i in obj) {
- if (obj.hasOwnProperty(i)) {
- ret[i] = obj[i];
- }
- }
- var overflow = obj.overflow;
- if (overflow) {
- for (var i in obj) {
- if (obj.hasOwnProperty(i)) {
- ret.overflow[i] = obj.overflow[i];
- }
- }
- }
- return ret;
- },
- scrollLeft: function scrollLeft(w, v) {
- if (isWindow(w)) {
- if (v === undefined) {
- return getScrollLeft(w);
- }
- window.scrollTo(v, getScrollTop(w));
- } else {
- if (v === undefined) {
- return w.scrollLeft;
- }
- w.scrollLeft = v;
- }
- },
- scrollTop: function scrollTop(w, v) {
- if (isWindow(w)) {
- if (v === undefined) {
- return getScrollTop(w);
- }
- window.scrollTo(getScrollLeft(w), v);
- } else {
- if (v === undefined) {
- return w.scrollTop;
- }
- w.scrollTop = v;
- }
- },
+ return (0,external_wp_element_namespaceObject.createElement)(BlockPopover, {
+ clientId: clientId,
+ rootClientId: rootClientId,
+ isValid: isValid,
+ isEmptyDefaultBlock: isEmptyDefaultBlock,
+ capturingClientId: capturingClientId,
+ __unstablePopoverSlot: __unstablePopoverSlot,
+ __unstableContentRef: __unstableContentRef
+ });
+}
- viewportWidth: 0,
- viewportHeight: 0
-}, domUtils);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/back-compat.js
-/***/ }),
-/***/ "jBNB":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/**
+ * WordPress dependencies
+ */
+
-"use strict";
-// EXPORTS
-__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ BlockListBlockContext; });
+/**
+ * Internal dependencies
+ */
-// 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");
+function BlockToolsBackCompat(_ref) {
+ let {
+ children
+ } = _ref;
+ 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 (openRef || isDisabled) {
+ return children;
+ }
-// EXTERNAL MODULE: external ["wp","blocks"]
-var external_wp_blocks_ = __webpack_require__("HSyU");
+ 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);
+}
-// EXTERNAL MODULE: external ["wp","components"]
-var external_wp_components_ = __webpack_require__("tI+e");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/with-client-id.js
-// 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");
+/**
+ * WordPress dependencies
+ */
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/index.js + 1 modules
-var block_edit = __webpack_require__("JRTi");
+/**
+ * Internal dependencies
+ */
-// 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");
+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);
-// EXTERNAL MODULE: ./node_modules/diff/lib/diff/character.js
-var character = __webpack_require__("iA5R");
+;// 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-compare/block-view.js
+/**
+ * External dependencies
+ */
/**
- * WordPress dependencies
+ * Internal dependencies
*/
-function BlockView(_ref) {
+const button_block_appender_ButtonBlockAppender = _ref => {
let {
- title,
- rawContent,
- renderedContent,
- action,
- actionText,
- className
+ clientId,
+ showSeparator,
+ isFloating,
+ onAddBlock,
+ isToggle
} = _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)));
-}
+ 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/block-compare/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/default-block-appender.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
*/
@@ -33323,65 +28072,125 @@ function BlockView(_ref) {
-function BlockCompare(_ref) {
+
+const default_block_appender_DefaultBlockAppender = _ref => {
let {
- block,
- onKeep,
- onConvert,
- convertor,
- convertButtonText
+ 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));
- 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);
- });
- }
+;// 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
+ */
- 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
- }));
-}
+/**
+ * Internal dependencies
+ */
-/* 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
+/**
+ * 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);
+ }
+
+ 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
@@ -33390,6 +28199,106 @@ var store = __webpack_require__("BhPs");
+/**
+ * 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<string,WeakMap<string,*>>}
+ */
+
+const BLOCK_CONTEXT_CACHE = new WeakMap();
+/**
+ * Returns a cached context object value for a given set of attributes for the
+ * block type.
+ *
+ * @param {Record<string,*>} attributes Block attributes object.
+ * @param {WPBlockType} blockType Block type settings.
+ *
+ * @return {Record<string,*>} 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
+ */
+
/**
@@ -33397,239 +28306,407 @@ var store = __webpack_require__("BhPs");
*/
+/** @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 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
+function parseDropEvent(event) {
+ let result = {
+ srcRootClientId: null,
+ srcClientIds: null,
+ srcIndex: null,
+ type: null,
+ blocks: null
+ };
- 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')
- })));
+ 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.
+ */
-const blockToClassic = block => Object(external_wp_blocks_["createBlock"])('core/freeform', {
- content: block.originalContent
-});
+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
-const blockToHTML = block => Object(external_wp_blocks_["createBlock"])('core/html', {
- content: block.originalContent
-});
+ 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
-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);
-};
+ if (dropType === 'block') {
+ const sourceBlockIndex = getBlockIndex(sourceClientIds[0]); // If the user is dropping to the same position, return early.
-/* 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)
+ 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);
+ }
};
-}), Object(external_wp_data_["withDispatch"])((dispatch, _ref4) => {
- let {
- block
- } = _ref4;
- const {
- replaceBlock
- } = dispatch(store["a" /* store */]);
- return {
- convertToClassic() {
- replaceBlock(block.clientId, blockToClassic(block));
- },
+}
+/**
+ * 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.
+ */
- convertToHTML() {
- replaceBlock(block.clientId, blockToHTML(block));
- },
+function onFilesDrop(targetRootClientId, targetBlockIndex, hasUploadPermissions, updateBlockAttributes, canInsertBlockType, insertBlocks) {
+ return files => {
+ if (!hasUploadPermissions) {
+ return;
+ }
- convertToBlocks() {
- replaceBlock(block.clientId, blockToBlocks(block));
- },
+ 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));
- attemptBlockRecovery() {
- replaceBlock(block.clientId, recoverBlock(block));
+ 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);
+ }
};
-})])(BlockInvalidWarning));
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-crash-warning.js
+}
+;// 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
+ */
/**
- * WordPress dependencies
+ * @typedef {Object} WPPoint
+ * @property {number} x The horizontal position.
+ * @property {number} y The vertical position.
*/
/**
- * Internal dependencies
+ * 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;
-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);
+ if (pointLateralPosition >= edgeStart && pointLateralPosition <= edgeEnd) {
+ edgeLateralPosition = pointLateralPosition;
+ } else if (pointLateralPosition < edgeEnd) {
+ edgeLateralPosition = edgeStart;
+ } else {
+ edgeLateralPosition = edgeEnd;
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-crash-boundary.js
+ return Math.sqrt((pointLateralPosition - edgeLateralPosition) ** 2 + (pointForwardPosition - edgeForwardPosition) ** 2);
+}
/**
- * WordPress dependencies
+ * 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);
-class block_crash_boundary_BlockCrashBoundary extends external_wp_element_["Component"] {
- constructor() {
- super(...arguments);
- this.state = {
- hasError: false
- };
- }
+ if (candidateDistance === undefined || distance < candidateDistance) {
+ candidateDistance = distance;
+ candidateEdge = edge;
+ }
+ });
+ return [candidateDistance, candidateEdge];
+}
- componentDidCatch() {
- this.setState({
- hasError: true
- });
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/use-block-drop-zone/index.js
+/**
+ * WordPress dependencies
+ */
- render() {
- if (this.state.hasError) {
- return this.props.fallback;
- }
- return this.props.children;
- }
-}
-/* harmony default export */ var block_crash_boundary = (block_crash_boundary_BlockCrashBoundary);
+/**
+ * Internal dependencies
+ */
+
-// 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
+/** @typedef {import('../../utils/math').WPPoint} WPPoint */
/**
- * External dependencies
+ * The orientation of a block list.
+ *
+ * @typedef {'horizontal'|'vertical'|undefined} WPBlockListOrientation
*/
/**
- * WordPress dependencies
+ * 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;
+}
/**
- * Internal dependencies
+ * @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 BlockHTML(_ref) {
+function useBlockDropZone() {
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]);
+ // 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 {
- updateBlock
- } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
+ 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 onChange = () => {
- const blockType = Object(external_wp_blocks_["getBlockType"])(block.name);
+ 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 (!blockType) {
- return;
+ if (targetIndex !== null) {
+ showInsertionPoint(targetRootClientId, targetIndex);
}
+ }, []), 200);
+ return (0,external_wp_compose_namespaceObject.__experimentalUseDropZone)({
+ isDisabled: isLockedAll,
+ onDrop: onBlockDrop,
- 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
+ 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);
+ },
- 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
+ onDragLeave() {
+ throttled.cancel();
+ hideInsertionPoint();
+ setTargetBlockIndex(null);
+ },
- if (!html) {
- setHtml({
- content
- });
+ onDragEnd() {
+ throttled.cancel();
+ hideInsertionPoint();
+ setTargetBlockIndex(null);
}
- };
- 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/inner-blocks/index.js
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/block.js
/**
* External dependencies
*/
-
/**
* WordPress dependencies
*/
@@ -33638,8 +28715,6 @@ var use_block_props = __webpack_require__("nlh6");
-
-
/**
* Internal dependencies
*/
@@ -33651,4918 +28726,4610 @@ var use_block_props = __webpack_require__("nlh6");
-const BlockListBlockContext = Object(external_wp_element_["createContext"])();
+
+
+
+
/**
- * Merges wrapper props with special handling for classNames and styles.
- *
- * @param {Object} propsA
- * @param {Object} propsB
+ * 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
*
- * @return {Object} Merged props.
+ * @param {Object} props The component props.
*/
-function mergeWrapperProps(propsA, propsB) {
- const newProps = { ...propsA,
- ...propsB
- };
-
- if (propsA && propsB && propsA.className && propsB.className) {
- newProps.className = classnames_default()(propsA.className, propsB.className);
- }
+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 (propsA && propsB && propsA.style && propsB.style) {
- newProps.style = { ...propsA.style,
- ...propsB.style
- };
- }
+ if (!blockType || !blockType.providesContext) {
+ return;
+ }
- return newProps;
-}
+ 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.
-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);
+ 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 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.
+function ControlledInnerBlocks(props) {
+ useBlockSync(props);
+ return (0,external_wp_element_namespaceObject.createElement)(UncontrolledInnerBlocks, props);
+}
- if (isAligned) {
- blockEdit = Object(external_wp_element_["createElement"])("div", {
- className: "wp-block",
- "data-align": wrapperProps['data-align']
- }, blockEdit);
- }
+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
+ */
- let block;
+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 {};
+ }
- 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, {
+ 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
- })));
- } 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
+ })) : (0,external_wp_element_namespaceObject.createElement)(BlockListItems, options)
};
- 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));
}
+useInnerBlocksProps.save = external_wp_blocks_namespaceObject.__unstableGetInnerBlocksProps; // Expose default appender placeholders as components.
-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 */]);
+ForwardedInnerBlocks.DefaultBlockAppender = inner_blocks_default_block_appender;
+ForwardedInnerBlocks.ButtonBlockAppender = inner_blocks_button_block_appender;
- const block = __unstableGetBlockWithoutInnerBlocks(clientId);
+ForwardedInnerBlocks.Content = () => useInnerBlocksProps.save().children;
+/**
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md
+ */
- 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).
+/* harmony default export */ var inner_blocks = (ForwardedInnerBlocks);
- 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).
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/index.js
- 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);
- },
+/**
+ * External dependencies
+ */
- onInsertBlocksAfter(blocks) {
- const {
- clientId,
- rootClientId
- } = ownProps;
- const {
- getBlockIndex
- } = select(store["a" /* store */]);
- const index = getBlockIndex(clientId);
- insertBlocks(blocks, index + 1, rootClientId);
- },
+/**
+ * WordPress dependencies
+ */
- 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);
- }
- }
- },
+/**
+ * Internal dependencies
+ */
- 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));
-/***/ }),
-/***/ "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();
+
+const elementContext = (0,external_wp_element_namespaceObject.createContext)();
+const IntersectionObserver = (0,external_wp_element_namespaceObject.createContext)();
+
+function Root(_ref) {
+ let {
+ className,
+ ...settings
+ } = _ref;
+ 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));
+}
-module.exports = computedStyle;
+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;
+ }
-/***/ "jrfk":
-/***/ (function(module, exports) {
+ return new Observer(entries => {
+ setIntersectingBlocks(oldIntersectingBlocks => {
+ const newIntersectingBlocks = new Set(oldIntersectingBlocks);
-/**
- * Copyright 2004-present Facebook. All Rights Reserved.
- *
- * @providesModule UserAgent_DEPRECATED
- */
+ for (const entry of entries) {
+ const clientId = entry.target.getAttribute('data-block');
+ const action = entry.isIntersecting ? 'add' : 'delete';
+ newIntersectingBlocks[action](clientId);
+ }
-/**
- * Provides entirely client-side User Agent and OS detection. You should prefer
- * the non-deprecated UserAgent module when possible, which exposes our
- * authoritative server-side PHP-based detection to the client.
- *
- * Usage is straightforward:
- *
- * if (UserAgent_DEPRECATED.ie()) {
- * // IE
- * }
- *
- * You can also do version checks:
- *
- * if (UserAgent_DEPRECATED.ie() >= 7) {
- * // IE7 or better
- * }
- *
- * The browser functions will return NaN if the browser does not match, so
- * you can also do version compares the other way:
- *
- * if (UserAgent_DEPRECATED.ie() < 7) {
- * // IE6 or worse
- * }
- *
- * Note that the version is a float and may include a minor version number,
- * so you should always use range operators to perform comparisons, not
- * strict equality.
- *
- * **Note:** You should **strongly** prefer capability detection to browser
- * version detection where it's reasonable:
- *
- * http://www.quirksmode.org/js/support.html
- *
- * Further, we have a large number of mature wrapper functions and classes
- * which abstract away many browser irregularities. Check the documentation,
- * grep for things, or ask on javascript@lists.facebook.com before writing yet
- * another copy of "event || window.event".
- *
- */
+ 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
+ }));
+}
-var _populated = false;
+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));
+}
-// Browsers
-var _ie, _firefox, _opera, _webkit, _chrome;
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/control.js
-// Actual IE browser for compatibility mode
-var _ie_real_version;
-// Platforms
-var _osx, _windows, _linux, _android;
-// Architectures
-var _win64;
+/**
+ * External dependencies
+ */
-// Devices
-var _iphone, _ipad, _native;
-var _mobile;
+/**
+ * WordPress dependencies
+ */
-function _populate() {
- if (_populated) {
- return;
- }
- _populated = true;
- // To work around buggy JS libraries that can't handle multi-digit
- // version numbers, Opera 10's user agent string claims it's Opera
- // 9, then later includes a Version/X.Y field:
- //
- // Opera/9.80 (foo) Presto/2.2.15 Version/10.10
- var uas = navigator.userAgent;
- var agent = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(uas);
- var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas);
- _iphone = /\b(iPhone|iP[ao]d)/.exec(uas);
- _ipad = /\b(iP[ao]d)/.exec(uas);
- _android = /Android/i.exec(uas);
- _native = /FBAN\/\w+;/i.exec(uas);
- _mobile = /Mobile/i.exec(uas);
+/**
+ * Internal dependencies
+ */
- // Note that the IE team blog would have you believe you should be checking
- // for 'Win64; x64'. But MSDN then reveals that you can actually be coming
- // from either x64 or ia64; so ultimately, you should just check for Win64
- // as in indicator of whether you're in 64-bit IE. 32-bit IE on 64-bit
- // Windows will send 'WOW64' instead.
- _win64 = !!(/Win64/.exec(uas));
- if (agent) {
- _ie = agent[1] ? parseFloat(agent[1]) : (
- agent[5] ? parseFloat(agent[5]) : NaN);
- // IE compatibility mode
- if (_ie && document && document.documentMode) {
- _ie = document.documentMode;
- }
- // grab the "true" ie version from the trident token if available
- var trident = /(?:Trident\/(\d+.\d+))/.exec(uas);
- _ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie;
+const colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients'];
- _firefox = agent[2] ? parseFloat(agent[2]) : NaN;
- _opera = agent[3] ? parseFloat(agent[3]) : NaN;
- _webkit = agent[4] ? parseFloat(agent[4]) : NaN;
- if (_webkit) {
- // We do not add the regexp to the above test, because it will always
- // match 'safari' only since 'AppleWebKit' appears before 'Chrome' in
- // the userAgent string.
- agent = /(?:Chrome\/(\d+\.\d+))/.exec(uas);
- _chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN;
- } else {
- _chrome = NaN;
- }
- } else {
- _ie = _firefox = _opera = _chrome = _webkit = NaN;
+function ColorGradientControlInner(_ref) {
+ let {
+ colors,
+ gradients,
+ disableCustomColors,
+ disableCustomGradients,
+ __experimentalHasMultipleOrigins,
+ __experimentalIsRenderedInSidebar,
+ className,
+ label,
+ onColorChange,
+ onGradientChange,
+ colorValue,
+ gradientValue,
+ clearable,
+ showTitle = true,
+ enableAlpha
+ } = _ref;
+ 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 (!canChooseAColor && !canChooseAGradient) {
+ return null;
}
- if (os) {
- if (os[1]) {
- // Detect OS X version. If no version number matches, set _osx to true.
- // Version examples: 10, 10_6_1, 10.7
- // Parses version number as a float, taking only first two sets of
- // digits. If only one set of digits is found, returns just the major
- // version number.
- var ver = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(uas);
+ 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
+ }))));
+}
- _osx = ver ? parseFloat(ver[1].replace('_', '.')) : true;
- } else {
- _osx = false;
- }
- _windows = !!os[2];
- _linux = !!os[3];
- } else {
- _osx = _windows = _linux = false;
- }
+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));
}
-var UserAgent_DEPRECATED = {
+function ColorGradientControl(props) {
+ if ((0,external_lodash_namespaceObject.every)(colorsAndGradientKeys, key => props.hasOwnProperty(key))) {
+ return (0,external_wp_element_namespaceObject.createElement)(ColorGradientControlInner, props);
+ }
- /**
- * Check if the UA is Internet Explorer.
- *
- *
- * @return float|NaN Version number (if match) or NaN.
- */
- ie: function() {
- return _populate() || _ie;
- },
+ return (0,external_wp_element_namespaceObject.createElement)(ColorGradientControlSelect, props);
+}
- /**
- * Check if we're in Internet Explorer compatibility mode.
- *
- * @return bool true if in compatibility mode, false if
- * not compatibility mode or not ie
- */
- ieCompatibilityMode: function() {
- return _populate() || (_ie_real_version > _ie);
- },
+/* harmony default export */ var control = (ColorGradientControl);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/dropdown.js
- /**
- * Whether the browser is 64-bit IE. Really, this is kind of weak sauce; we
- * only need this because Skype can't handle 64-bit IE yet. We need to remove
- * this when we don't need it -- tracked by #601957.
- */
- ie64: function() {
- return UserAgent_DEPRECATED.ie() && _win64;
- },
- /**
- * Check if the UA is Firefox.
- *
- *
- * @return float|NaN Version number (if match) or NaN.
- */
- firefox: function() {
- return _populate() || _firefox;
- },
+/**
+ * External dependencies
+ */
- /**
- * Check if the UA is Opera.
- *
- *
- * @return float|NaN Version number (if match) or NaN.
- */
- opera: function() {
- return _populate() || _opera;
- },
+/**
+ * WordPress dependencies
+ */
- /**
- * Check if the UA is WebKit.
- *
- *
- * @return float|NaN Version number (if match) or NaN.
- */
- webkit: function() {
- return _populate() || _webkit;
- },
+/**
+ * Internal dependencies
+ */
- /**
- * For Push
- * WILL BE REMOVED VERY SOON. Use UserAgent_DEPRECATED.webkit
- */
- safari: function() {
- return UserAgent_DEPRECATED.webkit();
- },
- /**
- * Check if the UA is a Chrome browser.
- *
- *
- * @return float|NaN Version number (if match) or NaN.
- */
- chrome : function() {
- return _populate() || _chrome;
- },
+function ColorGradientSettingsDropdown(_ref) {
+ let {
+ colors,
+ gradients,
+ disableCustomColors,
+ disableCustomGradients,
+ __experimentalHasMultipleOrigins,
+ __experimentalIsRenderedInSidebar,
+ enableAlpha,
+ settings
+ } = _ref;
+ let dropdownPosition;
+ if (__experimentalIsRenderedInSidebar) {
+ dropdownPosition = 'bottom left';
+ }
- /**
- * Check if the user is running Windows.
- *
- * @return bool `true' if the user's OS is Windows.
- */
- windows: function() {
- return _populate() || _windows;
- },
+ 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;
+ let {
+ 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))
+ })));
+}
- /**
- * Check if the user is running Mac OS X.
- *
- * @return float|bool Returns a float if a version number is detected,
- * otherwise true/false.
- */
- osx: function() {
- return _populate() || _osx;
- },
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/use-common-single-multiple-selects.js
+/**
+ * Internal dependencies
+ */
- /**
- * Check if the user is running Linux.
- *
- * @return bool `true' if the user's OS is some flavor of Linux.
- */
- linux: function() {
- return _populate() || _linux;
- },
+function useCommonSingleMultipleSelects() {
+ return {
+ disableCustomColors: !useSetting('color.custom'),
+ disableCustomGradients: !useSetting('color.customGradient')
+ };
+}
- /**
- * Check if the user is running on an iPhone or iPod platform.
- *
- * @return bool `true' if the user is running some flavor of the
- * iPhone OS.
- */
- iphone: function() {
- return _populate() || _iphone;
- },
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js
+/**
+ * WordPress dependencies
+ */
- mobile: function() {
- return _populate() || (_iphone || _ipad || _android || _mobile);
- },
- nativeApp: function() {
- // webviews inside of the native apps
- return _populate() || _native;
- },
+/**
+ * Internal dependencies
+ */
- android: function() {
- return _populate() || _android;
- },
- ipad: function() {
- return _populate() || _ipad;
- }
-};
-module.exports = UserAgent_DEPRECATED;
+/**
+ * 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
+ });
+ }
-/***/ }),
+ if (shouldDisplayDefaultColors && defaultColors && defaultColors.length) {
+ result.push({
+ name: (0,external_wp_i18n_namespaceObject._x)('Default', 'Indicates this palette comes from WordPress.'),
+ colors: defaultColors
+ });
+ }
-/***/ "jwne":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (customColors && customColors.length) {
+ result.push({
+ name: (0,external_wp_i18n_namespaceObject._x)('Custom', 'Indicates this palette comes from the theme.'),
+ colors: customColors
+ });
+ }
-"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");
+ 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
+ });
+ }
-/**
- * WordPress dependencies
- */
+ 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;
+}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors/utils.js
/**
- * Internal dependencies
+ * External dependencies
*/
-function InspectorControlsSlot(_ref) {
- var _groups$group;
+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.
+ */
- 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);
+const getColorObjectByAttributeValues = (colors, definedColor, customColor) => {
+ if (definedColor) {
+ const colorObj = (0,external_lodash_namespaceObject.find)(colors, {
+ slug: definedColor
+ });
- 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;
+ if (colorObj) {
+ return colorObj;
+ }
}
- const hasFills = Boolean(slot.fills && slot.fills.length);
+ 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.
+ */
- if (!hasFills) {
- return null;
- }
+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.
+ */
- 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
- })));
+function getColorClassName(colorContextName, colorSlug) {
+ if (!colorContextName || !colorSlug) {
+ return undefined;
}
- 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
- }));
+ 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;
}
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB")))
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/border-color.js
-/***/ }),
-/***/ "kBLm":
-/***/ (function(module, __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
+ * External dependencies
*/
-
/**
- * Internal dependencies
+ * WordPress 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.
+ * Internal dependencies
*/
-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');
- };
- }
- }, [isEnabled]);
-}
-
-/***/ }),
-/***/ "kVRd":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-// EXPORTS
-__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ TextDecorationControl; });
+ // Defining empty array here instead of inline avoids unnecessary re-renders of
+// color control.
-// EXTERNAL MODULE: external ["wp","element"]
-var external_wp_element_ = __webpack_require__("GRId");
+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.
+ */
-// EXTERNAL MODULE: external ["wp","components"]
-var external_wp_components_ = __webpack_require__("tI+e");
+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;
-// EXTERNAL MODULE: external ["wp","primitives"]
-var external_wp_primitives_ = __webpack_require__("Tqx9");
+ 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;
+ });
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-underline.js
+ 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));
+}
/**
- * WordPress dependencies
+ * Filters registered block settings, extending attributes to include
+ * `borderColor` if needed.
+ *
+ * @param {Object} settings Original block settings.
+ *
+ * @return {Object} Updated block settings.
*/
-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");
+function addAttributes(settings) {
+ if (!hasBorderSupport(settings, 'color')) {
+ return settings;
+ } // Allow blocks to specify default value if needed.
-// 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
+ if (settings.attributes.borderColor) {
+ return settings;
+ } // Add new borderColor attribute to block settings.
+ return { ...settings,
+ attributes: { ...settings.attributes,
+ borderColor: {
+ type: 'string'
+ }
+ }
+ };
+}
/**
- * WordPress dependencies
+ * 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;
-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 */]
-}];
+ 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;
+}
/**
- * Control to facilitate text decoration selections.
+ * Filters the registered block settings to apply border color styles and
+ * classnames to the block edit wrapper.
*
- * @param {Object} props Component props.
- * @param {string} props.value Currently selected text decoration.
- * @param {Function} props.onChange Handles change in text decoration selection.
+ * @param {Object} settings Original block settings.
*
- * @return {WPElement} Text decoration control.
+ * @return {Object} Filtered block 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
- });
- })));
-}
+function addEditProps(settings) {
+ if (!hasBorderSupport(settings, 'color') || shouldSkipSerialization(settings)) {
+ return settings;
+ }
-/***/ }),
+ const existingGetEditWrapperProps = settings.getEditWrapperProps;
-/***/ "kWXm":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ settings.getEditWrapperProps = attributes => {
+ let props = {};
-"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__);
+ if (existingGetEditWrapperProps) {
+ props = existingGetEditWrapperProps(attributes);
+ }
+ return border_color_addSaveProps(props, settings, attributes);
+ };
+ return settings;
+}
/**
- * WordPress dependencies
+ * 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 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);
-
-/***/ }),
+const withBorderColorPaletteStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => {
+ var _getColorObjectByAttr2, _props$wrapperProps;
-/***/ "kaUp":
-/***/ (function(module, exports) {
+ 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
+ */
-/***/ "kmrn":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/**
+ * 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<any>} inputArray Array of items to check.
+ * @return {any} The item with the most occurrences.
+ */
-"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__);
+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 _extends() {
- _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
+function hasDefinedValues(values) {
+ if (!values) {
+ return false;
+ } // A string value represents a shorthand value.
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
- return target;
- };
+ if (typeof values === 'string') {
+ return true;
+ } // An object represents longhand border radius values, if any are set
+ // flag values as being defined.
- return _extends.apply(this, arguments);
-}
-function callProp(value, ...args) {
- return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(value) ? value(...args) : value;
+ const filteredValues = Object.values(values).filter(value => {
+ return !!value || value === 0;
+ });
+ return !!filteredValues.length;
}
-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;
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/all-input-control.js
- 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);
+/**
+ * WordPress dependencies
+ */
- 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
-};
+/**
+ * Internal dependencies
+ */
-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 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
+ }));
}
-function inferTo(props) {
- const to = getForwardProps(props);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/input-controls.js
- 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;
+/**
+ * WordPress dependencies
+ */
- (_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;
- }
-}
+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;
-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;
+ const createHandleOnChange = corner => next => {
+ if (!onChange) {
+ return;
+ }
- 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;
+ onChange({ ...values,
+ [corner]: next ? next : undefined
+ });
+ }; // For shorthand style & backwards compatibility, handle flat string value.
- 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 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)
+ }));
+ }));
}
-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;
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link.js
-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;
- }
-};
+/**
+ * WordPress dependencies
+ */
-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 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);
-const defaults = _extends({}, config.default, {
- mass: 1,
- damping: 1,
- easing: easings.linear,
- clamp: false
-});
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/link-off.js
-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);
- }
+/**
+ * WordPress dependencies
+ */
- sanitizeConfig(config, newConfig);
- Object.assign(config, newConfig);
+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);
- for (const key in defaults) {
- if (config[key] == null) {
- config[key] = defaults[key];
- }
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/linked-button.js
- 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;
-}
+/**
+ * WordPress dependencies
+ */
-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;
- }
- }
+function LinkedButton(_ref) {
+ let {
+ isLinked,
+ ...props
+ } = _ref;
+ 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
+ })));
}
-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;
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/index.js
-}
-function scheduleProps(callId, {
- key,
- props,
- defaultProps,
- state,
- actions
-}) {
- return new Promise((resolve, reject) => {
- var _props$cancel;
+/**
+ * WordPress dependencies
+ */
- 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;
+/**
+ * Internal dependencies
+ */
- 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;
- }
+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.
+ */
- state.pauseQueue.delete(onPause);
- state.timeouts.delete(timeout);
+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));
- if (callId <= (state.cancelId || 0)) {
- cancel = true;
- }
+ const toggleLinked = () => setIsLinked(!isLinked);
- try {
- actions.start(_extends({}, props, {
- callId,
- cancel
- }), resolve);
- } catch (err) {
- reject(err);
- }
- }
- });
+ 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
+ })));
}
-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
-});
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/border-radius.js
-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;
- }
+/**
+ * Internal dependencies
+ */
+
- 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));
+/**
+ * Inspector control panel containing the border radius related configuration.
+ *
+ * @param {Object} props Block properties.
+ *
+ * @return {WPElement} Border radius edit element.
+ */
- const bailIfEnded = bailSignal => {
- const bailResult = callId <= (state.cancelId || 0) && getCancelledResult(target) || callId !== state.asyncId && getFinishedResult(target, false);
+function BorderRadiusEdit(props) {
+ var _style$border;
- if (bailResult) {
- bailSignal.result = bailResult;
- bail(bailSignal);
- throw bailSignal;
+ const {
+ attributes: {
+ style
+ },
+ setAttributes
+ } = props;
+
+ const onChange = newRadius => {
+ let newStyle = { ...style,
+ border: { ...(style === null || style === void 0 ? void 0 : style.border),
+ radius: newRadius
}
};
- 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 (newRadius === undefined || newRadius === '') {
+ newStyle = cleanEmptyObject(newStyle);
+ }
- if (state.paused) {
- await new Promise(resume => {
- state.resumeQueue.add(resume);
- });
- }
+ setAttributes({
+ style: newStyle
+ });
+ };
- return result;
- })();
- };
+ 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
+ });
+}
- let result;
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-solid.js
- if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* Globals */ "b"].skipAnimation) {
- stopAsync(state);
- return getFinishedResult(target, false);
- }
- try {
- let animating;
+/**
+ * WordPress dependencies
+ */
- 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)));
- }
+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);
- 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;
- }
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/line-dashed.js
- 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;
- }
+/**
+ * WordPress dependencies
+ */
-}
-class SkipAniamtionSignal extends Error {
- constructor() {
- super('SkipAnimationSignal');
- this.result = void 0;
- }
+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
-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;
- }
+/**
+ * WordPress dependencies
+ */
- set priority(priority) {
- if (this._priority != priority) {
- this._priority = priority;
+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);
- this._onPriorityChange(priority);
- }
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/border-style-control/index.js
- 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);
- }
+/**
+ * WordPress dependencies
+ */
- 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();
- }
+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.
+ */
- observerRemoved(count) {
- if (count == 0) this._detach();
- }
+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
+ }))));
+}
- _attach() {}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/border-style.js
- _detach() {}
- _onChange(value, idle = false) {
- Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* callFluidObservers */ "d"])(this, {
- type: 'change',
- parent: this,
- value,
- idle
- });
- }
+/**
+ * Internal dependencies
+ */
- _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
- });
- }
+/**
+ * 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 $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;
+ const {
+ attributes: {
+ style
+ },
+ setAttributes
+ } = props;
-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()
+ const onChange = newBorderStyle => {
+ const newStyleAttributes = { ...style,
+ border: { ...(style === null || style === void 0 ? void 0 : style.border),
+ style: newBorderStyle
+ }
};
- this._pendingCalls = new Set();
- this._lastCallId = 0;
- this._lastToId = 0;
- this._memoizedDuration = 0;
+ setAttributes({
+ style: cleanEmptyObject(newStyleAttributes)
+ });
+ };
- 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
- });
+ 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
+ });
+};
- if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(props.default)) {
- props.default = true;
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/border-width.js
- this.start(props);
- }
- }
- get idle() {
- return !(isAnimating(this) || this._state.asyncTo) || isPaused(this);
- }
+/**
+ * WordPress dependencies
+ */
- 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);
- }
+/**
+ * Internal dependencies
+ */
- get isAnimating() {
- return isAnimating(this);
- }
- get isPaused() {
- return isPaused(this);
- }
- get isDelayed() {
- return this._state.delayed;
- }
+const MIN_BORDER_WIDTH = 0;
+/**
+ * Inspector control for configuring border width property.
+ *
+ * @param {Object} props Block properties.
+ *
+ * @return {WPElement} Border width edit element.
+ */
- 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);
+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.
- 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));
+ (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]);
- 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;
+ 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.
- if (!finished) {
- position = node.lastPosition;
+ 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 (config.tension <= 0) {
- node.done = true;
- return;
- }
+ 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.
- 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 (!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 (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;
- }
- }
+ 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.
- 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);
+ if (newWidth === undefined || newWidth === '') {
+ newStyle = cleanEmptyObject(newStyle);
+ }
- for (let n = 0; n < numSteps; ++n) {
- isMoving = Math.abs(velocity) > restVelocity;
+ setAttributes({
+ borderColor: borderPaletteColor,
+ style: newStyle
+ });
+ };
- if (!isMoving) {
- finished = Math.abs(to - position) <= precision;
+ 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
+ });
+};
- if (finished) {
- break;
- }
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/border.js
- if (canBounce) {
- isBouncing = position == to || position > to == isGrowing;
- if (isBouncing) {
- velocity = -velocity * bounceFactor;
- position = to;
- }
- }
+/**
+ * WordPress dependencies
+ */
- 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;
- }
+/**
+ * Internal dependencies
+ */
+
- 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);
- }
+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;
}
- set(value) {
- _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* raf */ "w"].batchedUpdates(() => {
- this._stop();
+ 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.
+ */
- this._focus(value);
+function hasBorderSupport(blockName) {
+ let feature = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'any';
- this._set(value);
- });
- return this;
+ if (external_wp_element_namespaceObject.Platform.OS !== 'web') {
+ return false;
}
- pause() {
- this._update({
- pause: true
- });
+ const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, BORDER_SUPPORT_KEY);
+
+ if (support === true) {
+ return true;
}
- resume() {
- this._update({
- pause: false
- });
+ 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);
}
- finish() {
- if (isAnimating(this)) {
- const {
- to,
- config
- } = this.animation;
- _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* raf */ "w"].batchedUpdates(() => {
- this._onStart();
+ 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.
+ */
- if (!config.decay) {
- this._set(to, false);
- }
+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.
+ */
- this._stop();
- });
- }
+const useIsBorderDisabled = () => {
+ const configs = [!useSetting('border.color'), !useSetting('border.radius'), !useSetting('border.style'), !useSetting('border.width')];
+ return configs.every(Boolean);
+};
- return this;
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/gradients/use-gradient.js
+/**
+ * External dependencies
+ */
- update(props) {
- const queue = this.queue || (this.queue = []);
- queue.push(props);
- return this;
- }
+/**
+ * WordPress dependencies
+ */
- 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);
+/**
+ * Internal dependencies
+ */
- 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;
+function __experimentalGetGradientClass(gradientSlug) {
+ if (!gradientSlug) {
+ return undefined;
}
- reset() {
- this._update({
- reset: true
- });
- }
+ 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.
+ */
- eventObserved(event) {
- if (event.type == 'change') {
- this._start();
- } else if (event.type == 'priority') {
- this.priority = event.priority + 1;
+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;
}
+
+ updateBlockAttributes(clientId, {
+ [gradientAttribute]: undefined,
+ [customGradientAttribute]: newGradientValue
+ });
+ }, [allGradients, clientId, updateBlockAttributes]);
+
+ const gradientClass = __experimentalGetGradientClass(gradient);
+
+ let gradientValue;
+
+ if (gradient) {
+ gradientValue = getGradientValueBySlug(allGradients, gradient);
+ } else {
+ gradientValue = customGradient;
}
- _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;
+ return {
+ gradientClass,
+ gradientValue,
+ setGradient
+ };
+}
- if (to == null || isAsyncTo(to)) {
- to = undefined;
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/panel-color-gradient-settings.js
- from = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].obj(from) ? from[key] : from;
- if (from == null) {
- from = undefined;
- }
- const range = {
- to,
- from
- };
+/**
+ * External dependencies
+ */
- 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);
- }
- }
+/**
+ * WordPress dependencies
+ */
- 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);
+/**
+ * Internal dependencies
+ */
- 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);
- }
- }
+ // 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)
- return result;
- });
- }
+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)
- _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);
+const gradientIndicatorAriaLabel = (0,external_wp_i18n_namespaceObject.__)('(%s: gradient %s)');
- if (hasToProp || hasFromProp) {
- if (props.callId > this._lastToId) {
- this._lastToId = props.callId;
- } else {
- return resolve(getCancelledResult(this));
- }
- }
+const panel_color_gradient_settings_colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients'];
- const {
- key,
- defaultProps,
- animation: anim
- } = this;
- const {
- to: prevTo,
- from: prevFrom
- } = anim;
+const Indicators = _ref => {
+ let {
+ colors,
+ gradients,
+ settings
+ } = _ref;
+ return settings.map((_ref2, index) => {
let {
- to = prevTo,
- from = prevFrom
- } = range;
+ colorValue,
+ gradientValue,
+ label,
+ colors: availableColors,
+ gradients: availableGradients
+ } = _ref2;
- if (hasFromProp && !hasToProp && (!props.default || _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(to))) {
- to = from;
+ if (!colorValue && !gradientValue) {
+ return null;
}
- 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;
- }
+ let ariaLabel;
- 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 (colorValue) {
+ const colorObject = getColorObjectByColorValue(availableColors || colors, colorValue);
+ ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)(colorIndicatorAriaLabel, label.toLowerCase(), colorObject && colorObject.name || colorValue);
+ } else {
+ const gradientObject = __experimentalGetGradientObjectByGradientValue(availableGradients || gradients, colorValue);
- if (hasToChanged) {
- this._focus(to);
+ ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)(gradientIndicatorAriaLabel, label.toLowerCase(), gradientObject && gradientObject.name || gradientValue);
}
- const hasAsyncTo = isAsyncTo(props.to);
- const {
- config
- } = anim;
- const {
- decay,
- velocity
- } = config;
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorIndicator, {
+ key: index,
+ colorValue: colorValue || gradientValue,
+ "aria-label": ariaLabel
+ });
+ });
+};
- if (hasToProp || hasFromProp) {
- config.velocity = 0;
- }
+const PanelColorGradientSettingsInner = _ref3 => {
+ let {
+ className,
+ colors,
+ gradients,
+ disableCustomColors,
+ disableCustomGradients,
+ children,
+ settings,
+ title,
+ showTitle = true,
+ __experimentalHasMultipleOrigins,
+ __experimentalIsRenderedInSidebar,
+ enableAlpha,
+ ...props
+ } = _ref3;
- if (props.config && !hasAsyncTo) {
- mergeConfig(config, callProp(props.config, key), props.config !== defaultProps.config ? callProp(defaultProps.config, key) : void 0);
- }
+ 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 = (0,external_wp_element_namespaceObject.createElement)("span", {
+ className: "block-editor-panel-color-gradient-settings__panel-title"
+ }, title, (0,external_wp_element_namespaceObject.createElement)(Indicators, {
+ colors: colors,
+ gradients: gradients,
+ settings: settings
+ }));
+ 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), (0,external_wp_element_namespaceObject.createElement)(ColorGradientSettingsDropdown, {
+ settings: settings,
+ colors,
+ gradients,
+ disableCustomColors,
+ disableCustomGradients,
+ __experimentalHasMultipleOrigins,
+ __experimentalIsRenderedInSidebar,
+ enableAlpha
+ }), !!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));
+};
- let node = Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* getAnimated */ "e"])(this);
+const PanelColorGradientSettingsSingleSelect = 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));
+};
- if (!node || _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(to)) {
- return resolve(getFinishedResult(this, true));
- }
+const PanelColorGradientSettingsMultipleSelect = props => {
+ const colorGradientSettings = useMultipleOriginColorsAndGradients();
+ return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsInner, _extends({}, colorGradientSettings, props));
+};
- 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));
+const PanelColorGradientSettings = 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 (hasToChanged) {
- const nodeType = Object(_react_spring_animated__WEBPACK_IMPORTED_MODULE_2__[/* getAnimatedType */ "f"])(to);
+ if (props.__experimentalHasMultipleOrigins) {
+ return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsMultipleSelect, props);
+ }
- 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`);
- }
- }
+ return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsSingleSelect, props);
+};
- const goalType = node.constructor;
- let started = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasFluidValue */ "r"])(to);
- let finished = false;
+/* harmony default export */ var panel_color_gradient_settings = (PanelColorGradientSettings);
- if (!started) {
- const hasValueChanged = reset || !hasAnimated(this) && hasFromChanged;
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/contrast-checker/index.js
- 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;
- }
- }
+/**
+ * External dependencies
+ */
- 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;
+/**
+ * WordPress dependencies
+ */
- 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);
- }
- });
- }
- }
+k([names, a11y]);
- if (reset) {
- this._set(value);
- }
+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.
- 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));
- }
- }
+ (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));
+}
- _focus(value) {
- const anim = this.animation;
+function ContrastChecker(_ref2) {
+ let {
+ backgroundColor,
+ fallbackBackgroundColor,
+ fallbackTextColor,
+ fontSize,
+ // font size value in pixels
+ isLargeText,
+ textColor
+ } = _ref2;
- if (value !== anim.to) {
- if (Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* getFluidObservers */ "p"])(this)) {
- this._detach();
- }
+ if (!(backgroundColor || fallbackBackgroundColor) || !(textColor || fallbackTextColor)) {
+ return null;
+ }
- anim.to = value;
+ const colordBackgroundColor = w(backgroundColor || fallbackBackgroundColor);
+ const colordTextColor = w(textColor || fallbackTextColor);
+ const hasTransparency = colordBackgroundColor.alpha() !== 1 || colordTextColor.alpha() !== 1;
- if (Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* getFluidObservers */ "p"])(this)) {
- this._attach();
- }
- }
+ if (hasTransparency || colordTextColor.isReadable(colordBackgroundColor, {
+ level: 'AA',
+ size: isLargeText || isLargeText !== false && fontSize >= 24 ? 'large' : 'small'
+ })) {
+ return null;
}
- _attach() {
- let priority = 0;
- const {
- to
- } = this.animation;
+ return (0,external_wp_element_namespaceObject.createElement)(ContrastCheckerMessage, {
+ backgroundColor: backgroundColor,
+ textColor: textColor,
+ colordBackgroundColor: colordBackgroundColor,
+ colordTextColor: colordTextColor
+ });
+}
- if (Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* hasFluidValue */ "r"])(to)) {
- Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* addFluidObserver */ "c"])(to, this);
+/* harmony default export */ var contrast_checker = (ContrastChecker);
- if (isFrameValue(to)) {
- priority = to.priority + 1;
- }
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/color-panel.js
- this.priority = priority;
- }
- _detach() {
- const {
- to
- } = this.animation;
+/**
+ * WordPress dependencies
+ */
- 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);
+/**
+ * Internal dependencies
+ */
- 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;
+function getComputedStyle(node) {
+ return node.ownerDocument.defaultView.getComputedStyle(node);
+}
- if (!anim.changed) {
- anim.changed = true;
- sendEvent(this, 'onStart', getFinishedResult(this, checkFinished(this, anim.to)), this);
+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;
}
- }
-
- _onChange(value, idle) {
- if (!idle) {
- this._onStart();
- callProp(this.animation.onChange, value, this);
+ if (!ref.current) {
+ return;
}
- 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));
+ setDetectedColor(getComputedStyle(ref.current).color);
+ let backgroundColorNode = ref.current;
+ let backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor;
- if (!anim.immediate) {
- anim.fromValues = anim.values.map(node => node.lastPosition);
+ while (backgroundColor === 'rgba(0, 0, 0, 0)' && backgroundColorNode.parentNode && backgroundColorNode.parentNode.nodeType === backgroundColorNode.parentNode.ELEMENT_NODE) {
+ backgroundColorNode = backgroundColorNode.parentNode;
+ backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor;
}
- if (!isAnimating(this)) {
- setActiveBit(this, true);
+ 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
+ })));
+}
- if (!isPaused(this)) {
- this._resume();
- }
- }
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/color.js
- _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;
- }
+/**
+ * External dependencies
+ */
- 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);
- }
- }
- }
+/**
+ * WordPress dependencies
+ */
-}
-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;
-}
+/**
+ * Internal dependencies
+ */
-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);
+const COLOR_SUPPORT_KEY = 'color';
- if (flush) {
- this._flush = flush;
- }
+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);
+};
- if (props) {
- this.start(_extends({
- default: true
- }, props));
- }
- }
+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;
+};
- get idle() {
- return !this._state.asyncTo && Object.values(this.springs).every(spring => {
- return spring.idle && !spring.isDelayed && !spring.isPaused;
- });
+const hasLinkColorSupport = blockType => {
+ if (external_wp_element_namespaceObject.Platform.OS !== 'web') {
+ return false;
}
- get item() {
- return this._item;
- }
+ const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY);
+ return (0,external_lodash_namespaceObject.isObject)(colorSupport) && !!colorSupport.link;
+};
- set item(item) {
- this._item = item;
- }
+const hasGradientSupport = blockType => {
+ const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY);
+ return (0,external_lodash_namespaceObject.isObject)(colorSupport) && !!colorSupport.gradients;
+};
- get() {
- const values = {};
- this.each((spring, key) => values[key] = spring.get());
- return values;
- }
+const hasBackgroundColorSupport = blockType => {
+ const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY);
+ return colorSupport && colorSupport.background !== false;
+};
- set(values) {
- for (const key in values) {
- const value = values[key];
+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.
+ */
- if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].und(value)) {
- this.springs[key].set(value);
+
+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'
}
- }
+ });
}
- update(props) {
- if (props) {
- this.queue.push(createUpdate(props));
- }
+ if (!settings.attributes.textColor) {
+ Object.assign(settings.attributes, {
+ textColor: {
+ type: 'string'
+ }
+ });
+ }
- return this;
+ if (hasGradientSupport(settings) && !settings.attributes.gradient) {
+ Object.assign(settings.attributes, {
+ gradient: {
+ type: 'string'
+ }
+ });
}
- start(props) {
- let {
- queue
- } = this;
+ 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.
+ */
- 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);
- }
+function color_addSaveProps(props, blockType, attributes) {
+ var _style$color, _style$color2, _style$color3, _style$color4, _style$elements, _style$elements$link;
- prepareKeys(this, queue);
- return flushUpdateQueue(this, queue);
+ if (!hasColorSupport(blockType) || color_shouldSkipSerialization(blockType)) {
+ return props;
}
- 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;
- }
+ const hasGradient = hasGradientSupport(blockType); // I'd have prefered to avoid the "style" attribute usage here
- 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());
- }
+ const {
+ backgroundColor,
+ textColor,
+ gradient,
+ style
+ } = attributes;
+ const backgroundClass = getColorClassName('background-color', backgroundColor);
- return this;
- }
+ const gradientClass = __experimentalGetGradientClass(gradient);
- 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());
- }
+ 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.
+ */
- return this;
+function color_addEditProps(settings) {
+ if (!hasColorSupport(settings) || color_shouldSkipSerialization(settings)) {
+ return settings;
}
- each(iterator) {
- Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* eachProp */ "l"])(this.springs, iterator);
- }
+ const existingGetEditWrapperProps = settings.getEditWrapperProps;
- _onFrame() {
- const {
- onStart,
- onChange,
- onRest
- } = this._events;
- const active = this._active.size > 0;
- const changed = this._changed.size > 0;
+ settings.getEditWrapperProps = attributes => {
+ let props = {};
- 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);
- });
+ if (existingGetEditWrapperProps) {
+ props = existingGetEditWrapperProps(attributes);
}
- const idle = !active && this._started;
- const values = changed || idle && onRest.size ? this.get() : null;
+ return color_addSaveProps(props, settings, attributes);
+ };
- 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);
- });
- }
+ return settings;
+}
- 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);
- });
- }
+const getLinkColorFromAttributeValue = (colors, value) => {
+ const attributeParsed = /var:preset\|color\|(.+)/.exec(value);
+
+ if (attributeParsed && attributeParsed[1]) {
+ return getColorObjectByAttributeValues(colors, attributeParsed[1]).color;
}
- eventObserved(event) {
- if (event.type == 'change') {
- this._changed.add(event.parent);
+ return value;
+};
- if (!event.idle) {
- this._active.add(event.parent);
- }
- } else if (event.type == 'idle') {
- this._active.delete(event.parent);
- } else return;
+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.
+ */
- _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) {
+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 {
- keys,
- to,
- from,
- loop,
- onRest,
- onResolve
- } = props;
- const defaults = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].obj(props.default) && props.default;
+ 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.
- if (loop) {
- props.loop = false;
- }
+ 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.
- 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;
+ const localAttributes = (0,external_wp_element_namespaceObject.useRef)(attributes);
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
+ localAttributes.current = attributes;
+ }, [attributes]);
- if (asyncTo) {
- props.to = undefined;
- props.onRest = undefined;
+ if (!hasColorSupport(blockName)) {
+ return null;
+ }
- if (defaults) {
- defaults.onRest = undefined;
- }
- } else {
- Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(BATCHED_EVENTS, key => {
- const handler = props[key];
+ const hasLinkColor = hasLinkColorSupport(blockName) && isLinkEnabled && solidsEnabled;
+ const hasTextColor = hasTextColorSupport(blockName) && isTextEnabled && solidsEnabled;
+ const hasBackgroundColor = hasBackgroundColorSupport(blockName) && isBackgroundEnabled && solidsEnabled;
+ const hasGradientColor = hasGradientSupport(blockName) && gradientsEnabled;
- if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(handler)) {
- const queue = ctrl['_events'][key];
+ if (!hasLinkColor && !hasTextColor && !hasBackgroundColor && !hasGradientColor) {
+ return null;
+ }
- props[key] = ({
- finished,
- cancelled
- }) => {
- const result = queue.get(handler);
+ const {
+ style,
+ textColor,
+ backgroundColor,
+ gradient
+ } = attributes;
+ let gradientValue;
- 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 (hasGradientColor && gradient) {
+ gradientValue = getGradientValueBySlug(allGradients, gradient);
+ } else if (hasGradientColor) {
+ var _style$color5;
- if (defaults) {
- defaults[key] = props[key];
- }
- }
- });
- }
+ gradientValue = style === null || style === void 0 ? void 0 : (_style$color5 = style.color) === null || _style$color5 === void 0 ? void 0 : _style$color5.gradient;
+ }
- const state = ctrl['_state'];
+ const onChangeColor = name => value => {
+ var _localAttributes$curr, _localAttributes$curr2;
- 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 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 promises = (keys || Object.keys(ctrl.springs)).map(key => ctrl.springs[key].start(props));
- const cancel = props.cancel === true || getDefaultProp(props, 'cancel') === true;
+ const onChangeGradient = value => {
+ const slug = getGradientSlugByValue(allGradients, value);
+ let newAttributes;
- 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"],
+ if (slug) {
+ var _localAttributes$curr3, _localAttributes$curr4, _localAttributes$curr5;
- start(props, resolve) {
- if (cancel) {
- stopAsync(state, ctrl['_lastAsyncId']);
- resolve(getCancelledResult(ctrl));
- } else {
- props.onRest = onRest;
- resolve(runAsync(asyncTo, props, state, ctrl));
- }
+ 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
+ };
+ }
- if (state.paused) {
- await new Promise(resume => {
- state.resumeQueue.add(resume);
+ 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
});
- }
+ };
- const result = getCombinedResult(ctrl, await Promise.all(promises));
+ 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.
+ */
- if (loop && result.finished && !(isLoop && result.noop)) {
- const nextProps = createLoopUpdate(props, loop, to);
+const withColorPaletteStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => {
+ var _props$wrapperProps;
- if (nextProps) {
- prepareKeys(ctrl, [nextProps]);
- return flushUpdate(ctrl, nextProps, true);
- }
- }
+ 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 (onResolve) {
- _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* raf */ "w"].batchedUpdates(() => onResolve(result, ctrl, ctrl.item));
+ if (!hasColorSupport(name) || color_shouldSkipSerialization(name)) {
+ return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, props);
}
- return result;
-}
-function getSprings(ctrl, props) {
- const springs = _extends({}, ctrl.springs);
+ const extraStyles = {};
- 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 (textColor) {
+ var _getColorObjectByAttr;
- if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].obj(props.to)) {
- props = _extends({}, props, {
- to: undefined
- });
- }
+ extraStyles.color = (_getColorObjectByAttr = getColorObjectByAttributeValues(colors, textColor)) === null || _getColorObjectByAttr === void 0 ? void 0 : _getColorObjectByAttr.color;
+ }
- prepareSprings(springs, props, key => {
- return createSpring(key);
- });
- });
+ if (backgroundColor) {
+ var _getColorObjectByAttr2;
+
+ extraStyles.backgroundColor = (_getColorObjectByAttr2 = getColorObjectByAttributeValues(colors, backgroundColor)) === null || _getColorObjectByAttr2 === void 0 ? void 0 : _getColorObjectByAttr2.color;
}
- 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);
+ 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);
-function createSpring(key, observer) {
- const spring = new SpringValue();
- spring.key = key;
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-appearance-control/index.js
- if (observer) {
- Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* addFluidObserver */ "c"])(spring, observer);
- }
- return spring;
-}
+/**
+ * WordPress dependencies
+ */
-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;
+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.
+ */
- for (i = 0; i < sourceKeys.length; i++) {
- key = sourceKeys[i];
- if (excluded.indexOf(key) >= 0) continue;
- target[key] = source[key];
+const getFontAppearanceLabel = (hasFontStyles, hasFontWeights) => {
+ if (!hasFontStyles) {
+ return (0,external_wp_i18n_namespaceObject.__)('Font weight');
}
- return target;
-}
+ if (!hasFontWeights) {
+ return (0,external_wp_i18n_namespaceObject.__)('Font style');
+ }
-const _excluded$3 = ["children"];
-const SpringContext = _ref => {
- let {
- children
- } = _ref,
- props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
+ 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.
+ */
- 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]);
+function FontAppearanceControl(props) {
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;
+ 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.
-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 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 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);
+ 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.
- if (update) {
- results.push(ctrl.start(update));
+
+ const weightOptions = () => {
+ const combinedOptions = [defaultOption];
+ FONT_WEIGHTS.forEach(_ref4 => {
+ let {
+ name,
+ value
+ } = _ref4;
+ combinedOptions.push({
+ key: value,
+ name,
+ style: {
+ fontStyle: undefined,
+ fontWeight: value
}
- }
+ });
});
- return results;
- };
+ return combinedOptions;
+ }; // Map font styles and weights to select options.
- SpringRef.current = current;
- SpringRef.add = function (ctrl) {
- if (!current.includes(ctrl)) {
- current.push(ctrl);
+ const selectOptions = (0,external_wp_element_namespaceObject.useMemo)(() => {
+ if (hasFontStyles && hasFontWeights) {
+ return combineOptions();
}
- };
- SpringRef.delete = function (ctrl) {
- const i = current.indexOf(ctrl);
- if (~i) current.splice(i, 1);
- };
+ 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.
- SpringRef.pause = function () {
- Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(current, ctrl => ctrl.pause(...arguments));
- return this;
- };
+ const currentSelection = selectOptions.find(option => option.style.fontStyle === fontStyle && option.style.fontWeight === fontWeight) || selectOptions[0]; // Adjusts screen reader description based on styles or weights.
- SpringRef.resume = function () {
- Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(current, ctrl => ctrl.resume(...arguments));
- return this;
- };
+ const getDescribedBy = () => {
+ if (!currentSelection) {
+ return (0,external_wp_i18n_namespaceObject.__)('No selected font appearance');
+ }
- SpringRef.set = function (values) {
- Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(current, ctrl => ctrl.set(values));
- };
+ 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);
+ }
- 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 (!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);
+ }
- if (update) {
- results.push(ctrl.start(update));
- }
- }
- });
- return results;
+ 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);
};
- SpringRef.stop = function () {
- Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(current, ctrl => ctrl.stop(...arguments));
- return this;
- };
+ 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);
+ }
+ });
+}
- 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;
- };
+;// 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 _getProps = function _getProps(arg, ctrl, index) {
- return _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(arg) ? arg(index, ctrl) : arg;
- };
+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.
+ */
- SpringRef._getProps = _getProps;
- return SpringRef;
-};
+function isLineHeightDefined(lineHeight) {
+ return lineHeight !== undefined && lineHeight !== RESET_VALUE;
+}
-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: [],
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/line-height-control/index.js
- 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);
+/**
+ * WordPress dependencies
+ */
- 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;
+/**
+ * Internal dependencies
+ */
+
+
+function LineHeightControl(_ref) {
+ let {
+ value: lineHeight,
+ onChange
+ } = _ref;
+ const isDefined = isLineHeightDefined(lineHeight);
+
+ const handleOnKeyDown = event => {
const {
- queue
- } = state;
+ keyCode
+ } = event;
- if (queue.length) {
- state.queue = [];
- Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(queue, cb => cb());
+ 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');
}
+ };
- Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* each */ "k"])(ctrls.current, (ctrl, i) => {
- ref == null ? void 0 : ref.add(ctrl);
+ const handleOnChange = nextValue => {
+ // Set the next value without modification if lineHeight has been defined
+ if (isDefined) {
+ onChange(nextValue);
+ return;
+ } // Otherwise...
- if (hasContext) {
- ctrl.start({
- default: context
- });
- }
+ /**
+ * 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.
+ */
- const update = updates[i];
- if (update) {
- replaceRef(ctrl, update.ref);
+ let adjustedNextValue = nextValue;
- 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;
-}
+ switch (nextValue) {
+ case `${STEP}`:
+ // Increment by step value
+ adjustedNextValue = BASE_DEFAULT_VALUE + STEP;
+ break;
-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;
+ 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
+ }));
}
-const initSpringRef = () => SpringRef();
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/line-height.js
-const useSpringRef = () => Object(react__WEBPACK_IMPORTED_MODULE_1__["useState"])(initSpringRef)[0];
-function useTrail(length, propsArg, deps) {
- var _passedRef;
+/**
+ * WordPress dependencies
+ */
- 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)];
+/**
+ * Internal dependencies
+ */
- 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;
- }
+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.
+ */
- 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)];
+function LineHeightEdit(props) {
+ var _style$typography;
- if (parent) {
- results.push(ctrl.start(_extends({}, props, {
- to: parent.springs
- })));
- } else {
- results.push(ctrl.start(_extends({}, props)));
+ 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 results;
};
- return result[0];
+ 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.
+ */
-let TransitionPhase;
+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 (TransitionPhase) {
- TransitionPhase["MOUNT"] = "mount";
- TransitionPhase["ENTER"] = "enter";
- TransitionPhase["UPDATE"] = "update";
- TransitionPhase["LEAVE"] = "leave";
-})(TransitionPhase || (TransitionPhase = {}));
+function hasLineHeightValue(props) {
+ var _props$attributes$sty, _props$attributes$sty2;
-function useTransition(data, props, deps) {
- const propsFn = _react_spring_shared__WEBPACK_IMPORTED_MODULE_0__[/* is */ "s"].fun(props) && props;
+ 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 {
- 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);
+ style
+ } = attributes;
+ setAttributes({
+ style: cleanEmptyObject({ ...style,
+ typography: { ...(style === null || style === void 0 ? void 0 : style.typography),
+ lineHeight: undefined
}
-
- 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
- };
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/font-appearance.js
- if (!to.config) {
- const config = propsConfig || defaultProps.config;
- to.config = callProp(config, t.item, i, phase);
- }
- delay += trail;
+/**
+ * WordPress dependencies
+ */
- const payload = _extends({}, defaultProps, {
- delay: propsDelay + delay,
- ref: propsRef,
- immediate: p.immediate,
- reset: false
- }, to);
+/**
+ * Internal dependencies
+ */
- 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;
+/**
+ * Key within block settings' support array indicating support for font style.
+ */
- if (result.cancelled && t.phase != TransitionPhase.UPDATE) {
- return;
- }
+const FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';
+/**
+ * Key within block settings' support array indicating support for font weight.
+ */
- if (t.ctrl.idle) {
- const idle = transitions.every(t => t.ctrl.idle);
+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.
+ */
- if (t.phase == TransitionPhase.LEAVE) {
- const expiry = callProp(expires, t.item);
+function FontAppearanceEdit(props) {
+ var _style$typography, _style$typography2;
- if (expiry !== false) {
- const expiryMs = expiry === true ? 0 : expiry;
- t.expired = true;
+ const {
+ attributes: {
+ style
+ },
+ setAttributes
+ } = props;
+ const hasFontStyles = !useIsFontStyleDisabled(props);
+ const hasFontWeights = !useIsFontWeightDisabled(props);
- if (!idle && expiryMs > 0) {
- if (expiryMs <= 0x7fffffff) t.expirationId = setTimeout(forceUpdate, expiryMs);
- return;
- }
- }
+ const onChange = newStyles => {
+ setAttributes({
+ style: cleanEmptyObject({ ...style,
+ typography: { ...(style === null || style === void 0 ? void 0 : style.typography),
+ fontStyle: newStyles.fontStyle,
+ fontWeight: newStyles.fontWeight
}
+ })
+ });
+ };
- if (idle && transitions.some(t => t.expired)) {
- exitingTransitions.current.delete(t);
+ 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.
+ */
- if (exitBeforeEnter) {
- forceChange.current = true;
- }
+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.
+ */
- forceUpdate();
- }
- }
- };
+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.
+ */
- const springs = getSprings(t.ctrl, payload);
+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.
+ */
- 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);
+function hasFontAppearanceValue(props) {
+ var _props$attributes$sty;
- if (hasContext && phase == TransitionPhase.ENTER) {
- ctrl.start({
- default: context
- });
+ 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
}
+ })
+ });
+}
- 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);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-family/index.js
- 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));
+/**
+ * External dependencies
+ */
- if (t) {
- reused.add(t);
- return t.key;
- }
+/**
+ * WordPress dependencies
+ */
- 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);
+/**
+ * Internal dependencies
+ */
- return children(useSpring(props));
-}
-const _excluded$1 = ["items", "children"];
-function Trail(_ref) {
+function FontFamilyControl(_ref) {
let {
- items,
- children
- } = _ref,
- props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
+ value = '',
+ onChange,
+ fontFamilies,
+ ...props
+ } = _ref;
+ const blockLevelFontFamilies = useSetting('typography.fontFamilies');
- 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;
- });
-}
+ if (!fontFamilies) {
+ fontFamilies = blockLevelFontFamilies;
+ }
-const _excluded = ["items", "children"];
-function Transition(_ref) {
- let {
- items,
- children
- } = _ref,
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
+ if ((0,external_lodash_namespaceObject.isEmpty)(fontFamilies)) {
+ return null;
+ }
- return useTransition(items, props)(children);
+ 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));
}
-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);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/font-family.js
- 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));
- }
+/**
+ * External dependencies
+ */
- advance(_dt) {
- const value = this._get();
+/**
+ * WordPress dependencies
+ */
- 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);
- }
- }
+/**
+ * Internal dependencies
+ */
- _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);
- }
- }
- }
+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
+ */
- _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);
- }
+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.
- if (isFrameValue(source)) {
- if (!source.idle) {
- this._active.add(source);
- }
- priority = Math.max(priority, source.priority + 1);
+ if (!settings.attributes.fontFamily) {
+ Object.assign(settings.attributes, {
+ fontFamily: {
+ type: 'string'
}
});
- 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);
- }
- });
+ 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
+ */
- this._active.clear();
- becomeIdle(this);
+function font_family_addSaveProps(props, blockType, attributes) {
+ if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, FONT_FAMILY_SUPPORT_KEY)) {
+ return props;
}
- 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);
- }
+ 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.
-function isIdle(source) {
- return source.idle !== false;
-}
-function checkIdle(active) {
- return !active.size || Array.from(active).every(isIdle);
+ 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 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
- });
+
+function font_family_addEditProps(settings) {
+ if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, FONT_FAMILY_SUPPORT_KEY)) {
+ return settings;
}
-}
-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));
+ const existingGetEditWrapperProps = settings.getEditWrapperProps;
-_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;
+ settings.getEditWrapperProps = attributes => {
+ let props = {};
+ if (existingGetEditWrapperProps) {
+ props = existingGetEditWrapperProps(attributes);
+ }
+ return font_family_addSaveProps(props, settings, attributes);
+ };
+ return settings;
+}
-/***/ }),
+function FontFamilyEdit(_ref) {
+ var _find;
-/***/ "l3Sj":
-/***/ (function(module, exports) {
+ 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;
-(function() { module.exports = window["wp"]["i18n"]; }());
+ 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
+ });
+ }
-/***/ }),
+ 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.
+ */
-/***/ "lJLt":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+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.
+ */
-"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__);
+function hasFontFamilyValue(props) {
+ return !!props.attributes.fontFamily;
+}
/**
- * WordPress dependencies
+ * 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.
*/
-const PREFERENCES_DEFAULTS = {
- insertUsage: {}
-};
+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
/**
- * The default editor settings
+ * 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.
*
- * @typedef {Object} SETTINGS_DEFAULT
- * @property {boolean} alignWide Enable/Disable Wide/Full Alignments
- * @property {boolean} supportsLayout Enable/disable layouts support in container blocks.
- * @property {boolean} imageEditing Image Editing settings set to false to disable.
- * @property {Array} imageSizes Available image sizes
- * @property {number} maxWidth Max width to constraint resizing
- * @property {boolean|Array} allowedBlockTypes Allowed block types
- * @property {boolean} hasFixedToolbar Whether or not the editor toolbar is fixed
- * @property {boolean} focusMode Whether the focus mode is enabled or not
- * @property {Array} styles Editor Styles
- * @property {boolean} keepCaretInsideBlock Whether caret should move between blocks in edit mode
- * @property {string} bodyPlaceholder Empty post placeholder
- * @property {string} titlePlaceholder Empty title placeholder
- * @property {boolean} codeEditingEnabled Whether or not the user can switch to the code editor
- * @property {boolean} __experimentalCanUserUseUnfilteredHTML Whether the user should be able to use unfiltered HTML or the HTML should be filtered e.g., to remove elements considered insecure like iframes.
- * @property {boolean} __experimentalBlockDirectory Whether the user has enabled the Block Directory
- * @property {Array} __experimentalBlockPatterns Array of objects representing the block patterns
- * @property {Array} __experimentalBlockPatternCategories Array of objects representing the block pattern categories
- * @property {boolean} __unstableGalleryWithImageBlocks Whether the user has enabled the refactored gallery block which uses InnerBlocks
+ * @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 SETTINGS_DEFAULTS = {
- alignWide: false,
- supportsLayout: true,
- // 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'),
- slug: 'black',
- color: '#000000'
- }, {
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Cyan bluish gray'),
- slug: 'cyan-bluish-gray',
- color: '#abb8c3'
- }, {
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('White'),
- slug: 'white',
- color: '#ffffff'
- }, {
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Pale pink'),
- slug: 'pale-pink',
- color: '#f78da7'
- }, {
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Vivid red'),
- slug: 'vivid-red',
- color: '#cf2e2e'
- }, {
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Luminous vivid orange'),
- slug: 'luminous-vivid-orange',
- color: '#ff6900'
- }, {
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Luminous vivid amber'),
- slug: 'luminous-vivid-amber',
- color: '#fcb900'
- }, {
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Light green cyan'),
- slug: 'light-green-cyan',
- color: '#7bdcb5'
- }, {
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Vivid green cyan'),
- slug: 'vivid-green-cyan',
- color: '#00d084'
- }, {
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Pale cyan blue'),
- slug: 'pale-cyan-blue',
- color: '#8ed1fc'
- }, {
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Vivid cyan blue'),
- slug: 'vivid-cyan-blue',
- color: '#0693e3'
- }, {
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('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'),
- size: 13,
- slug: 'small'
- }, {
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["_x"])('Normal', 'font size name'),
- size: 16,
- slug: 'normal'
- }, {
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["_x"])('Medium', 'font size name'),
- size: 20,
- slug: 'medium'
- }, {
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["_x"])('Large', 'font size name'),
- size: 36,
- slug: 'large'
- }, {
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["_x"])('Huge', 'font size name'),
- size: 42,
- slug: 'huge'
- }],
- // Image default size slug.
- imageDefaultSize: 'large',
- imageSizes: [{
- slug: 'thumbnail',
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Thumbnail')
- }, {
- slug: 'medium',
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Medium')
- }, {
- slug: 'large',
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Large')
- }, {
- slug: 'full',
- name: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Full Size')
- }],
- // Allow plugin to disable Image Editor if need be
- imageEditing: true,
- // This is current max width of the block inner area
- // It's used to constraint image resizing and this value could be overridden later by themes
- maxWidth: 580,
- // Allowed block types for the editor, defaulting to true (all supported).
- allowedBlockTypes: true,
- // Maximum upload size in bytes allowed for the site.
- maxUploadFileSize: 0,
- // List of allowed mime types and file extensions.
- allowedMimeTypes: null,
- __experimentalCanUserUseUnfilteredHTML: false,
- __experimentalBlockDirectory: false,
- __mobileEnablePageTemplates: false,
- __experimentalBlockPatterns: [],
- __experimentalBlockPatternCategories: [],
- __experimentalSpotlightEntityBlocks: [],
- __experimentalGenerateAnchors: false,
- __unstableGalleryWithImageBlocks: false,
- // 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'),
- 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'),
- 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'),
- 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'),
- 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'),
- 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'),
- 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'),
- 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'),
- 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'),
- 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'),
- 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'),
- 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'),
- gradient: 'linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)',
- slug: 'midnight'
- }]
+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`;
+}
-/***/ "mdLt":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/font-size-picker.js
-"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__);
/**
* WordPress dependencies
*/
+/**
+ * Internal dependencies
+ */
-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));
-}
-/* harmony default export */ __webpack_exports__["a"] = (InserterPanel);
+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
-/***/ "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
*/
-const {
- Fill: __unstableInserterMenuExtension,
- Slot
-} = Object(_wordpress_components__WEBPACK_IMPORTED_MODULE_0__["createSlotFill"])('__unstableInserterMenuExtension');
-__unstableInserterMenuExtension.Slot = Slot;
-/* harmony default export */ __webpack_exports__["a"] = (__unstableInserterMenuExtension);
-/***/ }),
-/***/ "nEW0":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/**
+ * Internal dependencies
+ */
-"use strict";
-// 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; });
-
-// UNUSED EXPORTS: callFluidObserver, colorToRgba, hex3, hex4, hex6, hex8, hsl, hsla, isSSR, rgb, rgba, setFluidGetter
-
-// 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();
-raf.write = fn => schedule(fn, writeQueue);
-let onStartQueue = makeQueue();
+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.
+ */
-raf.onStart = fn => schedule(fn, onStartQueue);
+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.
-let onFrameQueue = makeQueue();
-raf.onFrame = fn => schedule(fn, onFrameQueue);
+ if (!settings.attributes.fontSize) {
+ Object.assign(settings.attributes, {
+ fontSize: {
+ type: 'string'
+ }
+ });
+ }
-let onFinishQueue = makeQueue();
+ 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.
+ */
-raf.onFinish = fn => schedule(fn, onFinishQueue);
-let timeouts = [];
+function font_size_addSaveProps(props, blockType, attributes) {
+ if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, FONT_SIZE_SUPPORT_KEY)) {
+ return props;
+ }
-raf.setTimeout = (handler, ms) => {
- let time = raf.now() + ms;
+ if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'typography.__experimentalSkipSerialization')) {
+ return props;
+ } // Use TokenList to dedupe classes.
- let cancel = () => {
- let i = timeouts.findIndex(t => t.cancel == cancel);
- if (~i) timeouts.splice(i, 1);
- pendingCount -= ~i ? 1 : 0;
- };
- let timeout = {
- time,
- handler,
- cancel
- };
- timeouts.splice(findTimeout(time), 0, timeout);
- pendingCount += 1;
- start();
- return timeout;
-};
+ 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.
+ */
-let findTimeout = time => ~(~timeouts.findIndex(t => t.time > time) || ~timeouts.length);
-raf.cancel = fn => {
- onStartQueue.delete(fn);
- onFrameQueue.delete(fn);
- updateQueue.delete(fn);
- writeQueue.delete(fn);
- onFinishQueue.delete(fn);
-};
+function font_size_addEditProps(settings) {
+ if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, FONT_SIZE_SUPPORT_KEY)) {
+ return settings;
+ }
-raf.sync = fn => {
- sync = true;
- raf.batchedUpdates(fn);
- sync = false;
-};
+ const existingGetEditWrapperProps = settings.getEditWrapperProps;
-raf.throttle = fn => {
- let lastArgs;
+ settings.getEditWrapperProps = attributes => {
+ let props = {};
- function queuedFn() {
- try {
- fn(...lastArgs);
- } finally {
- lastArgs = null;
+ if (existingGetEditWrapperProps) {
+ props = existingGetEditWrapperProps(attributes);
}
- }
- function throttled(...args) {
- lastArgs = args;
- raf.onStart(queuedFn);
- }
+ return font_size_addSaveProps(props, settings, attributes);
+ };
- throttled.handler = fn;
+ return settings;
+}
+/**
+ * Inspector control panel containing the font size related configuration
+ *
+ * @param {Object} props
+ *
+ * @return {WPElement} Font size edit element.
+ */
- throttled.cancel = () => {
- onStartQueue.delete(queuedFn);
- lastArgs = null;
+
+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
+ });
};
- return throttled;
-};
+ 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.
+ */
-let nativeRaf = typeof window != 'undefined' ? window.requestAnimationFrame : () => {};
+function hasFontSizeValue(props) {
+ var _style$typography3;
-raf.use = impl => nativeRaf = impl;
+ 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.
+ */
-raf.now = typeof performance != 'undefined' ? () => performance.now() : Date.now;
+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.
+ */
-raf.batchedUpdates = fn => fn();
+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.
+ */
-raf.catch = console.error;
-raf.frameLoop = 'always';
+const withFontSizeInlineStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => {
+ var _style$typography4, _style$typography5;
-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();
+ 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);
}
-};
-let ts = -1;
-let pendingCount = 0;
-let sync = false;
+ 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);
-function schedule(fn, queue) {
- if (sync) {
- queue.delete(fn);
- fn(0);
- } else {
- queue.add(fn);
- start();
- }
-}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-underline.js
-function start() {
- if (ts < 0) {
- ts = 0;
- if (raf.frameLoop !== 'demand') {
- nativeRaf(loop);
- }
- }
-}
+/**
+ * WordPress dependencies
+ */
-function stop() {
- ts = -1;
-}
+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);
-function loop() {
- if (~ts) {
- nativeRaf(loop);
- raf.batchedUpdates(react_spring_rafz_esm_update);
- }
-}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-strikethrough.js
-function react_spring_rafz_esm_update() {
- let prevTs = ts;
- ts = raf.now();
- let count = findTimeout(ts);
- if (count) {
- eachSafely(timeouts.splice(0, count), t => t.handler());
- pendingCount -= count;
- }
+/**
+ * WordPress dependencies
+ */
- onStartQueue.flush();
- updateQueue.flush(prevTs ? Math.min(64, ts - prevTs) : 16.667);
- onFrameQueue.flush();
- writeQueue.flush();
- onFinishQueue.flush();
+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);
- if (!pendingCount) {
- stop();
- }
-}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/text-decoration-control/index.js
-function makeQueue() {
- let next = new Set();
- let current = next;
- return {
- add(fn) {
- pendingCount += current == next && !next.has(fn) ? 1 : 0;
- next.add(fn);
- },
- delete(fn) {
- pendingCount -= current == next && next.has(fn) ? 1 : 0;
- return next.delete(fn);
- },
+/**
+ * WordPress dependencies
+ */
- flush(arg) {
- if (current.size) {
- next = new Set();
- pendingCount -= current.size;
- eachSafely(current, fn => fn(arg) && next.add(fn));
- pendingCount += next.size;
- current = next;
- }
- }
- };
-}
-function eachSafely(values, each) {
- values.forEach(value => {
- try {
- each(value);
- } catch (e) {
- raf.catch(e);
- }
- });
+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
+ });
+ })));
}
-const __raf = {
- count() {
- return pendingCount;
- },
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/text-decoration.js
- isRunning() {
- return ts >= 0;
- },
- clear() {
- ts = -1;
- timeouts = [];
- onStartQueue = makeQueue();
- updateQueue = makeQueue();
- onFrameQueue = makeQueue();
- writeQueue = makeQueue();
- onFinishQueue = makeQueue();
- pendingCount = 0;
- }
+/**
+ * WordPress dependencies
+ */
-};
+/**
+ * Internal dependencies
+ */
-// EXTERNAL MODULE: external "React"
-var external_React_ = __webpack_require__("cDcd");
-// CONCATENATED MODULE: ./node_modules/@react-spring/shared/dist/react-spring-shared.esm.js
+/**
+ * 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
+ }
+ })
+ });
+ }
-function noop() {}
-const defineHidden = (obj, key, value) => Object.defineProperty(obj, key, {
- value,
- writable: true,
- configurable: true
-});
-const is = {
- arr: Array.isArray,
- obj: a => !!a && a.constructor.name === 'Object',
- fun: a => typeof a === 'function',
- str: a => typeof a === 'string',
- num: a => typeof a === 'number',
- und: a => a === undefined
-};
-function isEqual(a, b) {
- if (is.arr(a)) {
- if (!is.arr(b) || a.length !== b.length) return false;
+ 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.
+ */
- for (let i = 0; i < a.length; i++) {
- if (a[i] !== b[i]) return false;
- }
+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.
+ */
- return true;
- }
+function hasTextDecorationValue(props) {
+ var _props$attributes$sty, _props$attributes$sty2;
- return a === b;
+ 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);
}
-const each = (obj, fn) => obj.forEach(fn);
-function eachProp(obj, fn, ctx) {
- if (is.arr(obj)) {
- for (let i = 0; i < obj.length; i++) {
- fn.call(ctx, obj[i], `${i}`);
- }
-
- return;
- }
+/**
+ * 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.
+ */
- for (const key in obj) {
- if (obj.hasOwnProperty(key)) {
- fn.call(ctx, obj[key], key);
- }
- }
-}
-const toArray = a => is.und(a) ? [] : is.arr(a) ? a : [a];
-function flush(queue, iterator) {
- if (queue.size) {
- const items = Array.from(queue);
- queue.clear();
- each(items, iterator);
- }
+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
+ }
+ })
+ });
}
-const flushCalls = (queue, ...args) => flush(queue, fn => fn(...args));
-const isSSR = () => typeof window === 'undefined' || !window.navigator || /ServerSideRendering|^Deno\//.test(window.navigator.userAgent);
-
-let createStringInterpolator$1;
-let to;
-let colors$1 = null;
-let skipAnimation = false;
-let willAdvance = noop;
-const react_spring_shared_esm_assign = globals => {
- if (globals.to) to = globals.to;
- if (globals.now) raf.now = globals.now;
- if (globals.colors !== undefined) colors$1 = globals.colors;
- if (globals.skipAnimation != null) skipAnimation = globals.skipAnimation;
- if (globals.createStringInterpolator) createStringInterpolator$1 = globals.createStringInterpolator;
- if (globals.requestAnimationFrame) raf.use(globals.requestAnimationFrame);
- if (globals.batchedUpdates) raf.batchedUpdates = globals.batchedUpdates;
- if (globals.willAdvance) willAdvance = globals.willAdvance;
- if (globals.frameLoop) raf.frameLoop = globals.frameLoop;
-};
-
-var react_spring_shared_esm_globals = /*#__PURE__*/Object.freeze({
- __proto__: null,
- get createStringInterpolator () { return createStringInterpolator$1; },
- get to () { return to; },
- get colors () { return colors$1; },
- get skipAnimation () { return skipAnimation; },
- get willAdvance () { return willAdvance; },
- assign: react_spring_shared_esm_assign
-});
-const startQueue = new Set();
-let currentFrame = [];
-let prevFrame = [];
-let priority = 0;
-const frameLoop = {
- get idle() {
- return !startQueue.size && !currentFrame.length;
- },
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-uppercase.js
- start(animation) {
- if (priority > animation.priority) {
- startQueue.add(animation);
- raf.onStart(flushStartQueue);
- } else {
- startSafely(animation);
- raf(advance);
- }
- },
- advance,
+/**
+ * WordPress dependencies
+ */
- sort(animation) {
- if (priority) {
- raf.onFrame(() => frameLoop.sort(animation));
- } else {
- const prevIndex = currentFrame.indexOf(animation);
+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);
- if (~prevIndex) {
- currentFrame.splice(prevIndex, 1);
- startUnsafely(animation);
- }
- }
- },
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-lowercase.js
- clear() {
- currentFrame = [];
- startQueue.clear();
- }
-};
+/**
+ * WordPress dependencies
+ */
-function flushStartQueue() {
- startQueue.forEach(startSafely);
- startQueue.clear();
- raf(advance);
-}
+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);
-function startSafely(animation) {
- if (!currentFrame.includes(animation)) startUnsafely(animation);
-}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-capitalize.js
-function startUnsafely(animation) {
- currentFrame.splice(findIndex(currentFrame, other => other.priority > animation.priority), 0, animation);
-}
-function advance(dt) {
- const nextFrame = prevFrame;
+/**
+ * WordPress dependencies
+ */
- for (let i = 0; i < currentFrame.length; i++) {
- const animation = currentFrame[i];
- priority = animation.priority;
+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);
- if (!animation.idle) {
- willAdvance(animation);
- animation.advance(dt);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/text-transform-control/index.js
- if (!animation.idle) {
- nextFrame.push(animation);
- }
- }
- }
- priority = 0;
- prevFrame = currentFrame;
- prevFrame.length = 0;
- currentFrame = nextFrame;
- return currentFrame.length > 0;
-}
+/**
+ * WordPress dependencies
+ */
-function findIndex(arr, test) {
- const index = arr.findIndex(test);
- return index < 0 ? arr.length : index;
-}
-const colors = {
- transparent: 0x00000000,
- aliceblue: 0xf0f8ffff,
- antiquewhite: 0xfaebd7ff,
- aqua: 0x00ffffff,
- aquamarine: 0x7fffd4ff,
- azure: 0xf0ffffff,
- beige: 0xf5f5dcff,
- bisque: 0xffe4c4ff,
- black: 0x000000ff,
- blanchedalmond: 0xffebcdff,
- blue: 0x0000ffff,
- blueviolet: 0x8a2be2ff,
- brown: 0xa52a2aff,
- burlywood: 0xdeb887ff,
- burntsienna: 0xea7e5dff,
- cadetblue: 0x5f9ea0ff,
- chartreuse: 0x7fff00ff,
- chocolate: 0xd2691eff,
- coral: 0xff7f50ff,
- cornflowerblue: 0x6495edff,
- cornsilk: 0xfff8dcff,
- crimson: 0xdc143cff,
- cyan: 0x00ffffff,
- darkblue: 0x00008bff,
- darkcyan: 0x008b8bff,
- darkgoldenrod: 0xb8860bff,
- darkgray: 0xa9a9a9ff,
- darkgreen: 0x006400ff,
- darkgrey: 0xa9a9a9ff,
- darkkhaki: 0xbdb76bff,
- darkmagenta: 0x8b008bff,
- darkolivegreen: 0x556b2fff,
- darkorange: 0xff8c00ff,
- darkorchid: 0x9932ccff,
- darkred: 0x8b0000ff,
- darksalmon: 0xe9967aff,
- darkseagreen: 0x8fbc8fff,
- darkslateblue: 0x483d8bff,
- darkslategray: 0x2f4f4fff,
- darkslategrey: 0x2f4f4fff,
- darkturquoise: 0x00ced1ff,
- darkviolet: 0x9400d3ff,
- deeppink: 0xff1493ff,
- deepskyblue: 0x00bfffff,
- dimgray: 0x696969ff,
- dimgrey: 0x696969ff,
- dodgerblue: 0x1e90ffff,
- firebrick: 0xb22222ff,
- floralwhite: 0xfffaf0ff,
- forestgreen: 0x228b22ff,
- fuchsia: 0xff00ffff,
- gainsboro: 0xdcdcdcff,
- ghostwhite: 0xf8f8ffff,
- gold: 0xffd700ff,
- goldenrod: 0xdaa520ff,
- gray: 0x808080ff,
- green: 0x008000ff,
- greenyellow: 0xadff2fff,
- grey: 0x808080ff,
- honeydew: 0xf0fff0ff,
- hotpink: 0xff69b4ff,
- indianred: 0xcd5c5cff,
- indigo: 0x4b0082ff,
- ivory: 0xfffff0ff,
- khaki: 0xf0e68cff,
- lavender: 0xe6e6faff,
- lavenderblush: 0xfff0f5ff,
- lawngreen: 0x7cfc00ff,
- lemonchiffon: 0xfffacdff,
- lightblue: 0xadd8e6ff,
- lightcoral: 0xf08080ff,
- lightcyan: 0xe0ffffff,
- lightgoldenrodyellow: 0xfafad2ff,
- lightgray: 0xd3d3d3ff,
- lightgreen: 0x90ee90ff,
- lightgrey: 0xd3d3d3ff,
- lightpink: 0xffb6c1ff,
- lightsalmon: 0xffa07aff,
- lightseagreen: 0x20b2aaff,
- lightskyblue: 0x87cefaff,
- lightslategray: 0x778899ff,
- lightslategrey: 0x778899ff,
- lightsteelblue: 0xb0c4deff,
- lightyellow: 0xffffe0ff,
- lime: 0x00ff00ff,
- limegreen: 0x32cd32ff,
- linen: 0xfaf0e6ff,
- magenta: 0xff00ffff,
- maroon: 0x800000ff,
- mediumaquamarine: 0x66cdaaff,
- mediumblue: 0x0000cdff,
- mediumorchid: 0xba55d3ff,
- mediumpurple: 0x9370dbff,
- mediumseagreen: 0x3cb371ff,
- mediumslateblue: 0x7b68eeff,
- mediumspringgreen: 0x00fa9aff,
- mediumturquoise: 0x48d1ccff,
- mediumvioletred: 0xc71585ff,
- midnightblue: 0x191970ff,
- mintcream: 0xf5fffaff,
- mistyrose: 0xffe4e1ff,
- moccasin: 0xffe4b5ff,
- navajowhite: 0xffdeadff,
- navy: 0x000080ff,
- oldlace: 0xfdf5e6ff,
- olive: 0x808000ff,
- olivedrab: 0x6b8e23ff,
- orange: 0xffa500ff,
- orangered: 0xff4500ff,
- orchid: 0xda70d6ff,
- palegoldenrod: 0xeee8aaff,
- palegreen: 0x98fb98ff,
- paleturquoise: 0xafeeeeff,
- palevioletred: 0xdb7093ff,
- papayawhip: 0xffefd5ff,
- peachpuff: 0xffdab9ff,
- peru: 0xcd853fff,
- pink: 0xffc0cbff,
- plum: 0xdda0ddff,
- powderblue: 0xb0e0e6ff,
- purple: 0x800080ff,
- rebeccapurple: 0x663399ff,
- red: 0xff0000ff,
- rosybrown: 0xbc8f8fff,
- royalblue: 0x4169e1ff,
- saddlebrown: 0x8b4513ff,
- salmon: 0xfa8072ff,
- sandybrown: 0xf4a460ff,
- seagreen: 0x2e8b57ff,
- seashell: 0xfff5eeff,
- sienna: 0xa0522dff,
- silver: 0xc0c0c0ff,
- skyblue: 0x87ceebff,
- slateblue: 0x6a5acdff,
- slategray: 0x708090ff,
- slategrey: 0x708090ff,
- snow: 0xfffafaff,
- springgreen: 0x00ff7fff,
- steelblue: 0x4682b4ff,
- tan: 0xd2b48cff,
- teal: 0x008080ff,
- thistle: 0xd8bfd8ff,
- tomato: 0xff6347ff,
- turquoise: 0x40e0d0ff,
- violet: 0xee82eeff,
- wheat: 0xf5deb3ff,
- white: 0xffffffff,
- whitesmoke: 0xf5f5f5ff,
- yellow: 0xffff00ff,
- yellowgreen: 0x9acd32ff
-};
-const NUMBER = '[-+]?\\d*\\.?\\d+';
-const PERCENTAGE = NUMBER + '%';
+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 call(...parts) {
- return '\\(\\s*(' + parts.join(')\\s*,\\s*(') + ')\\s*\\)';
+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)
+ });
+ })));
}
-const rgb = new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER));
-const rgba = new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER));
-const hsl = new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE));
-const hsla = new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER));
-const hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
-const hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
-const hex6 = /^#([0-9a-fA-F]{6})$/;
-const hex8 = /^#([0-9a-fA-F]{8})$/;
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/text-transform.js
-function normalizeColor(color) {
- let match;
- if (typeof color === 'number') {
- return color >>> 0 === color && color >= 0 && color <= 0xffffffff ? color : null;
- }
+/**
+ * WordPress dependencies
+ */
- if (match = hex6.exec(color)) return parseInt(match[1] + 'ff', 16) >>> 0;
+/**
+ * Internal dependencies
+ */
- if (colors$1 && colors$1[color] !== undefined) {
- return colors$1[color];
- }
- if (match = rgb.exec(color)) {
- return (parse255(match[1]) << 24 | parse255(match[2]) << 16 | parse255(match[3]) << 8 | 0x000000ff) >>> 0;
- }
- if (match = rgba.exec(color)) {
- return (parse255(match[1]) << 24 | parse255(match[2]) << 16 | parse255(match[3]) << 8 | parse1(match[4])) >>> 0;
- }
- if (match = hex3.exec(color)) {
- return parseInt(match[1] + match[1] + match[2] + match[2] + match[3] + match[3] + 'ff', 16) >>> 0;
- }
+/**
+ * Key within block settings' supports array indicating support for text
+ * transforms e.g. settings found in `block.json`.
+ */
- if (match = hex8.exec(color)) return parseInt(match[1], 16) >>> 0;
+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.
+ */
- if (match = hex4.exec(color)) {
- return parseInt(match[1] + match[1] + match[2] + match[2] + match[3] + match[3] + match[4] + match[4], 16) >>> 0;
- }
+function TextTransformEdit(props) {
+ var _style$typography;
- if (match = hsl.exec(color)) {
- return (hslToRgb(parse360(match[1]), parsePercentage(match[2]), parsePercentage(match[3])) | 0x000000ff) >>> 0;
- }
+ const {
+ attributes: {
+ style
+ },
+ setAttributes
+ } = props;
- if (match = hsla.exec(color)) {
- return (hslToRgb(parse360(match[1]), parsePercentage(match[2]), parsePercentage(match[3])) | parse1(match[4])) >>> 0;
+ function onChange(newTransform) {
+ setAttributes({
+ style: cleanEmptyObject({ ...style,
+ typography: { ...(style === null || style === void 0 ? void 0 : style.typography),
+ textTransform: newTransform
+ }
+ })
+ });
}
- return null;
-}
-
-function hue2rgb(p, q, t) {
- if (t < 0) t += 1;
- if (t > 1) t -= 1;
- if (t < 1 / 6) return p + (q - p) * 6 * t;
- if (t < 1 / 2) return q;
- if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
- return p;
-}
-
-function hslToRgb(h, s, l) {
- const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
- const p = 2 * l - q;
- const r = hue2rgb(p, q, h + 1 / 3);
- const g = hue2rgb(p, q, h);
- const b = hue2rgb(p, q, h - 1 / 3);
- return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
+ 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 parse255(str) {
- const int = parseInt(str, 10);
- if (int < 0) return 0;
- if (int > 255) return 255;
- return int;
+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 parse360(str) {
- const int = parseFloat(str);
- return (int % 360 + 360) % 360 / 360;
-}
+function hasTextTransformValue(props) {
+ var _props$attributes$sty, _props$attributes$sty2;
-function parse1(str) {
- const num = parseFloat(str);
- if (num < 0) return 0;
- if (num > 1) return 255;
- return Math.round(num * 255);
+ 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 parsePercentage(str) {
- const int = parseFloat(str);
- if (int < 0) return 0;
- if (int > 100) return 1;
- return int / 100;
+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
+ }
+ })
+ });
}
-function colorToRgba(input) {
- let int32Color = normalizeColor(input);
- if (int32Color === null) return input;
- int32Color = int32Color || 0;
- let r = (int32Color & 0xff000000) >>> 24;
- let g = (int32Color & 0x00ff0000) >>> 16;
- let b = (int32Color & 0x0000ff00) >>> 8;
- let a = (int32Color & 0x000000ff) / 255;
- return `rgba(${r}, ${g}, ${b}, ${a})`;
-}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/letter-spacing-control/index.js
-const createInterpolator = (range, output, extrapolate) => {
- if (is.fun(range)) {
- return range;
- }
- if (is.arr(range)) {
- return createInterpolator({
- range,
- output: output,
- extrapolate
- });
- }
+/**
+ * WordPress dependencies
+ */
- if (is.str(range.output[0])) {
- return createStringInterpolator$1(range);
- }
- const config = range;
- const outputRange = config.output;
- const inputRange = config.range || [0, 1];
- const extrapolateLeft = config.extrapolateLeft || config.extrapolate || 'extend';
- const extrapolateRight = config.extrapolateRight || config.extrapolate || 'extend';
+/**
+ * Internal dependencies
+ */
- const easing = config.easing || (t => t);
- return input => {
- const range = findRange(input, inputRange);
- return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight, config.map);
- };
-};
+/**
+ * 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 interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight, map) {
- let result = map ? map(input) : input;
+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
+ });
+}
- if (result < inputMin) {
- if (extrapolateLeft === 'identity') return result;else if (extrapolateLeft === 'clamp') result = inputMin;
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/letter-spacing.js
- if (result > inputMax) {
- if (extrapolateRight === 'identity') return result;else if (extrapolateRight === 'clamp') result = inputMax;
- }
- if (outputMin === outputMax) return outputMin;
- if (inputMin === inputMax) return input <= inputMin ? outputMin : outputMax;
- if (inputMin === -Infinity) result = -result;else if (inputMax === Infinity) result = result - inputMin;else result = (result - inputMin) / (inputMax - inputMin);
- result = easing(result);
- if (outputMin === -Infinity) result = -result;else if (outputMax === Infinity) result = result + outputMin;else result = result * (outputMax - outputMin) + outputMin;
- return result;
-}
+/**
+ * WordPress dependencies
+ */
-function findRange(input, inputRange) {
- for (var i = 1; i < inputRange.length - 1; ++i) if (inputRange[i] >= input) break;
+/**
+ * Internal dependencies
+ */
- return i - 1;
-}
-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;
- };
+/**
+ * Key within block settings' supports array indicating support for letter-spacing
+ * e.g. settings found in `block.json`.
+ */
- return _extends.apply(this, arguments);
-}
+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.
+ */
-const $get = Symbol.for('FluidValue.get');
-const $observers = Symbol.for('FluidValue.observers');
+function LetterSpacingEdit(props) {
+ var _style$typography;
-const hasFluidValue = arg => Boolean(arg && arg[$get]);
+ const {
+ attributes: {
+ style
+ },
+ setAttributes
+ } = props;
-const getFluidValue = arg => arg && arg[$get] ? arg[$get]() : arg;
+ function onChange(newSpacing) {
+ setAttributes({
+ style: cleanEmptyObject({ ...style,
+ typography: { ...(style === null || style === void 0 ? void 0 : style.typography),
+ letterSpacing: newSpacing
+ }
+ })
+ });
+ }
-const getFluidObservers = target => target[$observers] || null;
+ 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 callFluidObserver(observer, event) {
- if (observer.eventObserved) {
- observer.eventObserved(event);
- } else {
- observer(event);
- }
+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 callFluidObservers(target, event) {
- let observers = target[$observers];
+function hasLetterSpacingValue(props) {
+ var _props$attributes$sty, _props$attributes$sty2;
- if (observers) {
- observers.forEach(observer => {
- callFluidObserver(observer, event);
- });
- }
+ 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.
+ */
-class FluidValue {
- constructor(get) {
- this[$get] = void 0;
- this[$observers] = void 0;
+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
+ }
+ })
+ });
+}
- if (!get && !(get = this.get)) {
- throw Error('Unknown getter');
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/typography.js
- setFluidGetter(this, get);
- }
-}
+/**
+ * WordPress dependencies
+ */
-const setFluidGetter = (target, get) => setHidden(target, $get, get);
-function addFluidObserver(target, observer) {
- if (target[$get]) {
- let observers = target[$observers];
- if (!observers) {
- setHidden(target, $observers, observers = new Set());
- }
+/**
+ * Internal dependencies
+ */
- if (!observers.has(observer)) {
- observers.add(observer);
- if (target.observerAdded) {
- target.observerAdded(observers.size, observer);
- }
- }
- }
- return observer;
-}
-function removeFluidObserver(target, observer) {
- let observers = target[$observers];
- if (observers && observers.has(observer)) {
- const count = observers.size - 1;
- if (count) {
- observers.delete(observer);
- } else {
- target[$observers] = null;
- }
- if (target.observerRemoved) {
- target.observerRemoved(count, observer);
- }
- }
-}
-const setHidden = (target, key, value) => Object.defineProperty(target, key, {
- value,
- writable: true,
- configurable: true
-});
-const numberRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
-const colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;
-const unitRegex = new RegExp(`(${numberRegex.source})(%|[a-z]+)`, 'i');
-const rgbaRegex = /rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi;
-const cssVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;
-const variableToRgba = input => {
- const [token, fallback] = parseCSSVariable(input);
+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']);
- if (!token || isSSR()) {
- return input;
- }
+ const createResetAllFilter = attribute => newAttributes => {
+ var _newAttributes$style;
- const value = window.getComputedStyle(document.documentElement).getPropertyValue(token);
+ return { ...newAttributes,
+ style: { ...newAttributes.style,
+ typography: { ...((_newAttributes$style = newAttributes.style) === null || _newAttributes$style === void 0 ? void 0 : _newAttributes$style.typography),
+ [attribute]: undefined
+ }
+ }
+ };
+ };
- if (value) {
- return value.trim();
- } else if (fallback && fallback.startsWith('--')) {
- const _value = window.getComputedStyle(document.documentElement).getPropertyValue(fallback);
+ 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;
- if (_value) {
- return _value;
- } else {
- return input;
- }
- } else if (fallback && cssVariableRegex.test(fallback)) {
- return variableToRgba(fallback);
- } else if (fallback) {
- return fallback;
- }
+ 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 input;
+ 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));
};
-const parseCSSVariable = current => {
- const match = cssVariableRegex.exec(current);
- if (!match) return [,];
- const [, token, fallback] = match;
- return [token, fallback];
-};
+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;
+}
-let namedColorRegex;
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/gap.js
-const rgbaRound = (_, p1, p2, p3, p4) => `rgba(${Math.round(p1)}, ${Math.round(p2)}, ${Math.round(p3)}, ${p4})`;
-const createStringInterpolator = config => {
- if (!namedColorRegex) namedColorRegex = colors$1 ? new RegExp(`(${Object.keys(colors$1).join('|')})(?!\\w)`, 'g') : /^\b$/;
- const output = config.output.map(value => {
- return getFluidValue(value).replace(cssVariableRegex, variableToRgba).replace(colorRegex, colorToRgba).replace(namedColorRegex, colorToRgba);
- });
- const keyframes = output.map(value => value.match(numberRegex).map(Number));
- const outputRanges = keyframes[0].map((_, i) => keyframes.map(values => {
- if (!(i in values)) {
- throw Error('The arity of each "output" value must be equal');
- }
+/**
+ * WordPress dependencies
+ */
- return values[i];
- }));
- const interpolators = outputRanges.map(output => createInterpolator(_extends({}, config, {
- output
- })));
- return input => {
- var _output$find;
- const missingUnit = !unitRegex.test(output[0]) && ((_output$find = output.find(value => unitRegex.test(value))) == null ? void 0 : _output$find.replace(numberRegex, ''));
- let i = 0;
- return output[0].replace(numberRegex, () => `${interpolators[i++](input)}${missingUnit || ''}`).replace(rgbaRegex, rgbaRound);
- };
-};
-const prefix = 'react-spring: ';
-const once = fn => {
- const func = fn;
- let called = false;
+/**
+ * Internal dependencies
+ */
- if (typeof func != 'function') {
- throw new TypeError(`${prefix}once requires a function parameter`);
- }
- return (...args) => {
- if (!called) {
- func(...args);
- called = true;
- }
- };
-};
-const warnInterpolate = once(console.warn);
-function deprecateInterpolate() {
- warnInterpolate(`${prefix}The "interpolate" function is deprecated in v9 (use "to" instead)`);
-}
-const warnDirectCall = once(console.warn);
-function deprecateDirectCall() {
- warnDirectCall(`${prefix}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 isAnimatedString(value) {
- return is.str(value) && (value[0] == '#' || /\d/.test(value) || !isSSR() && cssVariableRegex.test(value) || value in (colors$1 || {}));
+
+/**
+ * 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.
+ */
-const useOnce = effect => Object(external_React_["useEffect"])(effect, emptyDeps);
-const emptyDeps = [];
+function hasGapValue(props) {
+ var _props$attributes$sty, _props$attributes$sty2;
-function useForceUpdate() {
- const update = Object(external_React_["useState"])()[1];
- const mounted = Object(external_React_["useState"])(makeMountedRef)[0];
- useOnce(mounted.unmount);
- return () => {
- if (mounted.current) {
- update({});
- }
- };
+ 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 makeMountedRef() {
- const mounted = {
- current: true,
- unmount: () => () => {
- mounted.current = false;
+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
+ }
}
- };
- return mounted;
+ });
}
+/**
+ * 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 useMemoOne(getResult, inputs) {
- const [initial] = Object(external_React_["useState"])(() => ({
- inputs,
- result: getResult()
- }));
- const committed = Object(external_React_["useRef"])();
- const prevCache = committed.current;
- let cache = prevCache;
+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.
+ */
- if (cache) {
- const useCache = Boolean(inputs && cache.inputs && areInputsEqual(inputs, cache.inputs));
+function GapEdit(props) {
+ var _style$spacing;
- if (!useCache) {
- cache = {
- inputs,
- result: getResult()
- };
- }
- } else {
- cache = initial;
+ 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;
}
- Object(external_React_["useEffect"])(() => {
- committed.current = cache;
+ const onChange = next => {
+ var _window;
- if (prevCache == initial) {
- initial.inputs = initial.result = undefined;
- }
- }, [cache]);
- return cache.result;
-}
+ 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.
-function areInputsEqual(next, prev) {
- if (next.length !== prev.length) {
- return false;
- }
+ 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 ');
- for (let i = 0; i < next.length; i++) {
- if (next[i] !== prev[i]) {
- return false;
- }
- }
+ if (ref.current && isSafari) {
+ var _ref$current$parentNo;
- return true;
-}
+ (_ref$current$parentNo = ref.current.parentNode) === null || _ref$current$parentNo === void 0 ? void 0 : _ref$current$parentNo.replaceChild(ref.current, ref.current);
+ }
+ };
-function usePrev(value) {
- const prevRef = Object(external_React_["useRef"])();
- Object(external_React_["useEffect"])(() => {
- prevRef.current = value;
+ 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
});
- return prevRef.current;
}
-const useLayoutEffect = typeof window !== 'undefined' && window.document && window.document.createElement ? external_React_["useLayoutEffect"] : external_React_["useEffect"];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/margin.js
+/**
+ * WordPress dependencies
+ */
-/***/ }),
-/***/ "nQUx":
-/***/ (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_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");
/**
- * External dependencies
+ * Internal dependencies
*/
-/**
- * WordPress 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;
+}
/**
- * Internal dependencies
+ * 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;
+}
/**
- * Retrieves the block patterns inserter state.
+ * Inspector control panel containing the margin related configuration
*
- * @param {Function} onInsert function called when inserter a list of blocks.
- * @param {string=} rootClientId Insertion's root client ID.
+ * @param {Object} props Block props.
*
- * @return {Array} Returns the patterns state. (patterns, categories, onSelect handler)
+ * @return {WPElement} Margin edit element.
*/
-const usePatternsState = (onInsert, rootClientId) => {
+function MarginEdit(props) {
+ var _style$spacing;
+
const {
- patternCategories,
- patterns
- } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["useSelect"])(select => {
- const {
- __experimentalGetAllowedPatterns,
- getSettings
- } = select(_store__WEBPACK_IMPORTED_MODULE_6__[/* store */ "a"]);
- return {
- patterns: __experimentalGetAllowedPatterns(rootClientId),
- patternCategories: getSettings().__experimentalBlockPatternCategories
+ 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
+ }
};
- }, [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'
+ setAttributes({
+ style: cleanEmptyObject(newStyle)
});
- }, []);
- return [patterns, patternCategories, onClickPattern];
-};
-
-/* harmony default export */ __webpack_exports__["a"] = (usePatternsState);
+ };
+ 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
+ });
+}
-/***/ "nlh6":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/padding.js
-"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");
-/**
- * External dependencies
- */
/**
* WordPress dependencies
@@ -38571,567 +33338,902 @@ const usePatternsState = (onInsert, rootClientId) => {
+/**
+ * Internal 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
+ */
/**
- * If the block count exceeds the threshold, we disable the reordering animation
- * to avoid laginess.
+ * Internal dependencies
*/
-const BLOCK_ANIMATION_THRESHOLD = 200;
+
+
+
+
+const SPACING_SUPPORT_KEY = 'spacing';
+const ALL_SIDES = ['top', 'right', 'bottom', 'left'];
+const AXIAL_SIDES = ['vertical', 'horizontal'];
/**
- * This hook is used to lightly mark an element as a block element. The element
- * should be the outermost element of a block. Call this hook and pass the
- * returned props to the element to mark as a block. 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.
+ * Inspector controls for dimensions support.
*
- * @param {Object} props Optional. Props to pass to the element. Must contain
- * the ref if one is defined.
- * @param {Object} options Options for internal use only.
- * @param {boolean} options.__unstableIsHtml
+ * @param {Object} props Block props.
*
- * @return {Object} Props to pass to the element to mark as a block.
+ * @return {WPElement} Inspector controls for spacing support features.
*/
-function useBlockProps() {
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- let {
- __unstableIsHtml
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- const {
- clientId,
- className,
- wrapperProps = {},
- isAligned
- } = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useContext"])(_block__WEBPACK_IMPORTED_MODULE_8__[/* BlockListBlockContext */ "a"]);
- const {
- index,
- mode,
- name,
- blockApiVersion,
- blockTitle,
- isPartOfSelection,
- adjustScrolling,
- enableAnimation
- } = Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_5__["useSelect"])(select => {
- const {
- getBlockIndex,
- getBlockMode,
- getBlockName,
- isTyping,
- getGlobalBlockCount,
- isBlockSelected,
- isBlockMultiSelected,
- isAncestorMultiSelected,
- isFirstMultiSelectedBlock
- } = select(_store__WEBPACK_IMPORTED_MODULE_23__[/* store */ "a"]);
- 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);
- return {
- index: getBlockIndex(clientId),
- mode: getBlockMode(clientId),
- name: blockName,
- blockApiVersion: (blockType === null || blockType === void 0 ? void 0 : blockType.apiVersion) || 1,
- blockTitle: blockType === null || blockType === void 0 ? void 0 : blockType.title,
- isPartOfSelection: isSelected || isPartOfMultiSelection,
- adjustScrolling: isSelected || isFirstMultiSelectedBlock(clientId),
- enableAnimation: !isTyping() && getGlobalBlockCount() <= BLOCK_ANIMATION_THRESHOLD
+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
+ }
+ }
};
- }, [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 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"])({
- 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.
+ 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.
+ */
- 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;
+function hasDimensionsSupport(blockName) {
+ if (external_wp_element_namespaceObject.Platform.OS !== 'web') {
+ return false;
}
- return { ...wrapperProps,
- ...props,
- ref: mergedRefs,
- id: `block-${clientId}${htmlSuffix}`,
- tabIndex: 0,
- role: 'document',
- 'aria-label': blockLabel,
- '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', {
- '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)),
- style: { ...wrapperProps.style,
- ...props.style
- }
- };
+ return hasGapSupport(blockName) || hasPaddingSupport(blockName) || hasMarginSupport(blockName);
}
/**
- * Call within a save function to get the props for the block wrapper.
+ * Determines whether dimensions support has been disabled.
*
- * @param {Object} props Optional. Props to pass to the element.
+ * @param {Object} props Block properties.
+ *
+ * @return {boolean} If spacing support is completely disabled.
*/
-useBlockProps.save = _wordpress_blocks__WEBPACK_IMPORTED_MODULE_3__["__unstableGetBlockProps"];
+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.
+ */
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB")))
-/***/ }),
+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.
-/***/ "o97j":
-/***/ (function(module, exports, __webpack_require__) {
+ if (!support || typeof support[feature] === 'boolean') {
+ return;
+ }
-"use strict";
+ return support[feature];
+}
/**
- * Copyright (c) 2015, Facebook, Inc.
- * All rights reserved.
+ * 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.
*
- * 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.
+ * @param {string} blockName Block name.
+ * @param {string} feature The feature custom sides relate to e.g. padding or margins.
*
- * @providesModule ExecutionEnvironment
+ * @return {boolean} If the feature has a valid configuration of sides.
*/
-/*jslint evil: true */
+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
-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.
+ * External dependencies
*/
-var ExecutionEnvironment = {
-
- canUseDOM: canUseDOM,
- canUseWorkers: typeof Worker !== 'undefined',
- canUseEventListeners:
- canUseDOM && !!(window.addEventListener || window.attachEvent),
+/**
+ * WordPress dependencies
+ */
- canUseViewport: canUseDOM && !!window.screen,
- isInWorker: !canUseDOM // For now, this is true - might change in the future.
-};
-module.exports = ExecutionEnvironment;
+/**
+ * Internal dependencies
+ */
-/***/ }),
-/***/ "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; });
+const styleSupportKeys = [...TYPOGRAPHY_SUPPORT_KEYS, BORDER_SUPPORT_KEY, COLOR_SUPPORT_KEY, SPACING_SUPPORT_KEY];
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
-var esm_extends = __webpack_require__("wx14");
+const hasStyleSupport = blockType => styleSupportKeys.some(key => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, key));
-// EXTERNAL MODULE: external ["wp","element"]
-var external_wp_element_ = __webpack_require__("GRId");
+const VARIABLE_REFERENCE_PREFIX = 'var:';
+const VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|';
+const VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--';
-// EXTERNAL MODULE: ./node_modules/classnames/index.js
-var classnames = __webpack_require__("TSYQ");
-var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
+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})`;
+ }
-// EXTERNAL MODULE: external ["wp","compose"]
-var external_wp_compose_ = __webpack_require__("K9lf");
+ return uncompiledValue;
+}
+/**
+ * Returns the inline styles to add depending on the style object
+ *
+ * @param {Object} styles Styles configuration.
+ *
+ * @return {Object} Flattened CSS variables declaration.
+ */
-// EXTERNAL MODULE: external ["wp","data"]
-var external_wp_data_ = __webpack_require__("1ZqX");
-// EXTERNAL MODULE: external ["wp","blocks"]
-var external_wp_blocks_ = __webpack_require__("HSyU");
+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.
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/button-block-appender/index.js
-var button_block_appender = __webpack_require__("I5Hl");
+ 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);
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/context.js
-var block_edit_context = __webpack_require__("ur0x");
+ 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]);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/with-client-id.js
+ 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');
+}
/**
- * WordPress dependencies
+ * Filters registered block settings, extending attributes to include `style` attribute.
+ *
+ * @param {Object} settings Original block settings.
+ *
+ * @return {Object} Filtered block settings.
*/
-/**
- * Internal dependencies
- */
+function style_addAttribute(settings) {
+ if (!hasStyleSupport(settings)) {
+ return settings;
+ } // allow blocks to specify their own attribute definition with default values if needed.
-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
+ 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<string, string[]>}
+ */
+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']
+};
/**
- * External dependencies
+ * 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<string, string[]>}
*/
+const skipSerializationPathsSave = { ...skipSerializationPathsEdit,
+ [`${SPACING_SUPPORT_KEY}`]: ['spacing.blockGap']
+};
/**
- * Internal dependencies
+ * 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<string, string[]>} 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;
+ }
-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
+ 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);
+ }
});
-};
-/* harmony default export */ var inner_blocks_button_block_appender = (with_client_id(ButtonBlockAppender));
+ 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.
+ */
-// EXTERNAL MODULE: external "lodash"
-var external_lodash_ = __webpack_require__("YLtl");
+function style_addEditProps(settings) {
+ if (!hasStyleSupport(settings)) {
+ return settings;
+ }
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/default-block-appender/index.js
-var default_block_appender = __webpack_require__("5L8O");
+ const existingGetEditWrapperProps = settings.getEditWrapperProps;
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules
-var store = __webpack_require__("BhPs");
+ settings.getEditWrapperProps = attributes => {
+ let props = {};
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/default-block-appender.js
+ if (existingGetEditWrapperProps) {
+ props = existingGetEditWrapperProps(attributes);
+ }
+ return style_addSaveProps(props, settings, attributes, skipSerializationPathsEdit);
+ };
+ return settings;
+}
/**
- * External dependencies
+ * 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');
/**
- * WordPress dependencies
+ * 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
/**
- * Internal dependencies
+ * WordPress dependencies
*/
-const DefaultBlockAppender = _ref => {
+function DuotoneControl(_ref) {
let {
- clientId,
- lastBlockClientId
+ colorPalette,
+ duotonePalette,
+ disableCustomColors,
+ disableCustomDuotone,
+ value,
+ onChange
} = _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) => {
- let {
- clientId
- } = _ref2;
- const {
- getBlockOrder
- } = select(store["a" /* store */]);
- const blockClientIds = getBlockOrder(clientId);
- return {
- lastBlockClientId: Object(external_lodash_["last"])(blockClientIds)
- };
-})])(DefaultBlockAppender));
+ 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();
+ }
+ };
-// EXTERNAL MODULE: external ["wp","isShallowEqual"]
-var external_wp_isShallowEqual_ = __webpack_require__("rl8x");
-var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_);
+ 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
+ }))
+ });
+}
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/layouts/index.js + 5 modules
-var layouts = __webpack_require__("PPMp");
+/* harmony default export */ var duotone_control = (DuotoneControl);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/use-nested-settings-update.js
-/**
- * WordPress dependencies
- */
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/duotone.js
/**
- * Internal dependencies
+ * External 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.
+ * WordPress dependencies
*/
-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;
- }
+/**
+ * Internal dependencies
+ */
- 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
+const duotone_EMPTY_ARRAY = [];
+k([names]);
/**
- * External dependencies
+ * 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;
+}
/**
- * WordPress dependencies
+ * 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;
-/**
- * Internal dependencies
- */
+ 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
+ });
+ }
+ }));
+}
/**
- * 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.
+ * Filters registered block settings, extending attributes to include
+ * the `duotone` attribute.
*
- * @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.
+ * @param {Object} settings Original block settings.
+ *
+ * @return {Object} Filtered block settings.
*/
-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);
+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 (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());
- }
+ if (!settings.attributes.style) {
+ Object.assign(settings.attributes, {
+ style: {
+ type: 'object'
}
- }
- }, [innerBlocks, template, templateLock, clientId]);
-}
+ });
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/get-block-context.js
+ return settings;
+}
/**
- * External dependencies
+ * 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');
/**
- * Block context cache, implemented as a WeakMap mapping block types to a
- * WeakMap mapping attributes object to context value.
+ * Function that scopes a selector with another one. This works a bit like
+ * SCSS nesting except the `&` operator isn't supported.
*
- * @type {WeakMap<string,WeakMap<string,*>>}
+ * @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.
*/
-const BLOCK_CONTEXT_CACHE = new WeakMap();
+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(', ');
+}
/**
- * Returns a cached context object value for a given set of attributes for the
- * block type.
+ * Override the default block element to include duotone styles.
*
- * @param {Record<string,*>} attributes Block attributes object.
- * @param {WPBlockType} blockType Block type settings.
+ * @param {Function} BlockListBlock Original component.
*
- * @return {Record<string,*>} Context value.
+ * @return {Function} Wrapped component.
*/
-function getBlockContext(attributes, blockType) {
- if (!BLOCK_CONTEXT_CACHE.has(blockType)) {
- BLOCK_CONTEXT_CACHE.set(blockType, new WeakMap());
- }
- const blockTypeCache = BLOCK_CONTEXT_CACHE.get(blockType);
+const withDuotoneStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => {
+ var _props$attributes, _props$attributes$sty, _props$attributes$sty2;
- if (!blockTypeCache.has(attributes)) {
- const context = Object(external_lodash_["mapValues"])(blockType.providesContext, attributeName => attributes[attributeName]);
- blockTypeCache.set(attributes, context);
+ 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);
}
- return blockTypeCache.get(attributes);
-}
+ 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.
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-list/index.js + 4 modules
-var block_list = __webpack_require__("VyCT");
+ 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);
-// 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/hooks/layout.js
-// 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 dependencies
+ */
-// 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
*/
@@ -39139,6 +34241,10 @@ var math = __webpack_require__("vIlp");
+
+
+
+
/**
* Internal dependencies
*/
@@ -39146,127 +34252,262 @@ var math = __webpack_require__("vIlp");
-/** @typedef {import('../../utils/math').WPPoint} WPPoint */
-/**
- * The orientation of a block list.
- *
- * @typedef {'horizontal'|'vertical'|undefined} WPBlockListOrientation
- */
+
+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);
+ }));
+}
/**
- * Given a list of block DOM elements finds the index that a block should be dropped
- * at.
+ * Filters registered block settings, extending attributes to include `layout`.
*
- * @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.
+ * @param {Object} settings Original block settings.
*
- * @return {number|undefined} The block index that's closest to the drag position.
+ * @return {Object} Filtered block settings.
*/
-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.
+function layout_addAttribute(settings) {
+ if ((0,external_lodash_namespaceObject.has)(settings.attributes, ['layout', 'type'])) {
+ return settings;
+ }
- candidateDistance = distance;
- candidateIndex = index + offset;
- }
- });
- return candidateIndex;
+ if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, layoutBlockSupportKey)) {
+ settings.attributes = { ...settings.attributes,
+ layout: {
+ type: 'object'
+ }
+ };
+ }
+
+ return settings;
}
/**
- * @typedef {Object} WPBlockDropZoneConfig
- * @property {string} rootClientId The root client id for the block list.
+ * 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');
/**
- * A React hook that can be used to make a block list handle drag and drop.
+ * Override the default block element to add the layout styles.
*
- * @param {WPBlockDropZoneConfig} dropZoneConfig configuration data for the drop zone.
+ * @param {Function} BlockListBlock Original component.
+ *
+ * @return {Function} Wrapped component.
*/
-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 withLayoutStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => {
const {
- getBlockListSettings
- } = Object(external_wp_data_["useSelect"])(store["a" /* store */]);
+ 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 {
- 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;
+ 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);
- 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);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/use-border-props.js
+/**
+ * External dependencies
+ */
- if (targetIndex !== null) {
- showInsertionPoint(targetRootClientId, targetIndex);
- }
- }, []), 200);
- return Object(external_wp_compose_["__experimentalUseDropZone"])({
- isDisabled: isLockedAll,
- onDrop: onBlockDrop,
+/**
+ * Internal dependencies
+ */
- 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);
- }
+ // 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.
+ */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/index.js
+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
*/
@@ -39276,9 +34517,6 @@ function useBlockDropZone() {
*/
-
-
-
/**
* Internal dependencies
*/
@@ -39286,820 +34524,681 @@ function useBlockDropZone() {
-
-
-
-
-
-
-
+ // 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.
/**
- * 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
+ * Provides the CSS class names and inline styles for a block's color support
+ * attributes.
*
- * @param {Object} props The component props.
+ * @param {Object} attributes Block attributes.
+ *
+ * @return {Object} Color block support derived CSS classes & styles.
*/
-function UncontrolledInnerBlocks(props) {
+function getColorClassesAndStyles(attributes) {
+ var _style$color, _style$color2, _style$color3, _style$color4, _style$elements, _style$elements$link;
+
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);
+ backgroundColor,
+ textColor,
+ gradient,
+ style
+ } = attributes; // Collect color CSS classes.
- if (!blockType || !blockType.providesContext) {
- return;
- }
+ const backgroundClass = getColorClassName('background-color', backgroundColor);
+ const textClass = getColorClassName('color', textColor);
- 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.
+ const gradientClass = __experimentalGetGradientClass(gradient);
- 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.
- */
+ 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.
-function ControlledInnerBlocks(props) {
- Object(use_block_sync["a" /* default */])(props);
- return Object(external_wp_element_["createElement"])(UncontrolledInnerBlocks, props);
+ const colorStyles = (style === null || style === void 0 ? void 0 : style.color) || {};
+ const styleProp = getInlineStyles({
+ color: colorStyles
+ });
+ return {
+ className: className || undefined,
+ style: styleProp
+ };
}
-
-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));
-});
+const use_color_props_EMPTY_OBJECT = {};
/**
- * 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.
+ * Determines the color related props for a block derived from its color block
+ * support attributes.
*
- * @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.
+ * Inline styles are forced for named colors to ensure these selections are
+ * reflected when themes do not load their color stylesheets in the editor.
*
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md
+ * @param {Object} attributes Block attributes.
+ *
+ * @return {Object} ClassName & style props from colors block support.
*/
-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
- */
+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.
-/* harmony default export */ var inner_blocks = __webpack_exports__["a"] = (ForwardedInnerBlocks);
+ 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;
+ }
-/***/ "pOGT":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ return colorProps;
+}
-"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__);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/use-spacing-props.js
/**
- * External dependencies
+ * Internal 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;
+ // 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.
-const defaultGetCollection = () => null;
/**
- * Sanitizes the search input string.
+ * Provides the CSS class names and inline styles for a block's spacing support
+ * attributes.
*
- * @param {string} input The search input to normalize.
+ * @param {Object} attributes Block attributes.
*
- * @return {string} The normalized search input.
+ * @return {Object} Spacing block support derived CSS classes & styles.
*/
+function getSpacingClassesAndStyles(attributes) {
+ const {
+ style
+ } = attributes; // Collect inline styles for spacing.
-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"
+ const spacingStyles = (style === null || style === void 0 ? void 0 : style.spacing) || {};
+ const styleProp = getInlineStyles({
+ spacing: spacingStyles
+ });
+ return {
+ style: styleProp
+ };
+}
- input = input.replace(/^\//, ''); // Lowercase.
- // Input: "MEDIA"
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/use-cached-truthy.js
+/**
+ * WordPress dependencies
+ */
- input = input.toLowerCase();
- return input;
-}
/**
- * Converts the search term into a list of normalized terms.
- *
- * @param {string} input The search term to normalize.
+ * Keeps an up-to-date copy of the passed value and returns it. If value becomes falsy, it will return the last truthy copy.
*
- * @return {string[]} The normalized list of search terms.
+ * @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;
+}
-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));
-};
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/index.js
+/**
+ * Internal dependencies
+ */
-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";
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors/with-colors.js
-var LEAF_KEY, hasWeakMap;
/**
- * Arbitrary value used as key for referencing cache object in WeakMap tree.
- *
- * @type {Object}
+ * External dependencies
*/
-LEAF_KEY = {};
/**
- * Whether environment supports WeakMap.
- *
- * @type {boolean}
+ * WordPress dependencies
*/
-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.
+ * Internal dependencies
*/
-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.
+ * Higher order component factory for injecting the `colorsArray` argument as
+ * the colors prop in the `withCustomColors` HOC.
*
- * @param {Array} a First array.
- * @param {Array} b Second array.
- * @param {number} fromIndex Index from which to start comparison.
+ * @param {Array} colorsArray An array of color objects.
*
- * @return {boolean} Whether arrays are shallowly equal.
+ * @return {Function} The higher order component.
*/
-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;
- }
- }
+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.
+ */
- return true;
-}
+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');
/**
- * 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.
+ * Helper function used with `createHigherOrderComponent` to create
+ * higher order components for managing color logic.
*
- * @param {Function} selector Selector function.
- * @param {Function} getDependants Dependant getter returning an immutable
- * reference or array of reference used in
- * cache bust consideration.
+ * @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 {Function} Memoized selector.
+ * @return {WPComponent} The component that can be used as a HOC.
*/
-/* 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;
- }
+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 = {};
+ }
- // At this point we can assume we've found a match
+ getMostReadableColor(colorValue) {
+ const {
+ colors
+ } = this.props;
+ return getMostReadableColor(colors, colorValue);
+ }
- // 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;
- }
+ 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;
+ }, {});
+ }
- node.next = cache.head;
- node.prev = null;
- cache.head.prev = node;
- cache.head = node;
- }
+ 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
+ });
+ };
+ }
- // Return immediately
- return node.val;
- }
+ 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.
+ */
- // No cached value found. Continue to insertion phase:
+ if (previousColor === colorObject.color && previousColorObject) {
+ newState[colorAttributeName] = previousColorObject;
+ } else {
+ newState[colorAttributeName] = { ...colorObject,
+ class: getColorClassName(colorContext, colorObject.slug)
+ };
+ }
- node = {
- // Generate the result from original function
- val: selector.apply( null, args ),
- };
+ return newState;
+ }, {});
+ }
- // Avoid including the source object in the cache.
- args[ 0 ] = null;
- node.args = args;
+ render() {
+ return (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, _extends({}, this.props, {
+ colors: undefined
+ }, this.state, this.setters, {
+ colorUtils: this.colorUtils
+ }));
+ }
- // Don't need to check whether node is already head, since it would
- // have been returned above already if it was
+ };
+ }]);
+}
+/**
+ * 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.
+ */
- // Shift existing head down list
- if ( cache.head ) {
- cache.head.prev = node;
- node.next = cache.head;
- }
- cache.head = node;
+function createCustomColorsHOC(colorsArray) {
+ return function () {
+ const withColorPalette = withCustomColorPalette(colorsArray);
- return node.val;
- }
+ for (var _len = arguments.length, colorTypes = new Array(_len), _key = 0; _key < _len; _key++) {
+ colorTypes[_key] = arguments[_key];
+ }
- callSelector.getDependants = getDependants;
- callSelector.clear = clear;
- clear();
+ 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.
+ */
- return callSelector;
-});
+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');
+}
-/***/ "pXCJ":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors/index.js
-"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");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/gradients/index.js
-// EXTERNAL MODULE: external "lodash"
-var external_lodash_ = __webpack_require__("YLtl");
-// EXTERNAL MODULE: external ["wp","components"]
-var external_wp_components_ = __webpack_require__("tI+e");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/with-font-sizes.js
-// 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");
+/**
+ * External dependencies
+ */
-// 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.
- */
+const DEFAULT_FONT_SIZES = [];
/**
- * 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.
+ * Higher-order component, which handles font size logic for class generation,
+ * font size value retrieval, and font size change handling.
*
- * @return {ConvertToGroupButtonProps} Returns the properties needed by `ConvertToGroupButton`.
+ * @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.
*/
-function useConvertToGroupButtonProps() {
- const {
- clientIds,
- isGroupable,
- isUngroupable,
- blocksSelection,
- groupingBlockName
- } = Object(external_wp_data_["useSelect"])(select => {
- var _blocksSelection$;
+/* 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];
+ }
- const {
- getBlockRootClientId,
- getBlocksByClientId,
- canInsertBlockType,
- getSelectedBlockClientIds
- } = select(store["a" /* store */]);
- const {
- getGroupingBlockName
- } = select(external_wp_blocks_["store"]);
+ /*
+ * 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 = {};
+ }
- const _clientIds = getSelectedBlockClientIds();
+ 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;
+ }, {});
+ }
- const _groupingBlockName = getGroupingBlockName();
+ 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
+ });
+ };
+ }
- const rootClientId = !!(_clientIds !== null && _clientIds !== void 0 && _clientIds.length) ? getBlockRootClientId(_clientIds[0]) : undefined;
- const groupingBlockAvailable = canInsertBlockType(_groupingBlockName, rootClientId);
+ static getDerivedStateFromProps(_ref, previousState) {
+ let {
+ attributes,
+ fontSizes
+ } = _ref;
- const _blocksSelection = getBlocksByClientId(_clientIds);
+ 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.
- 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?
+ return previousState[fontSizeAttributeName].size !== attributes[customFontSizeAttributeName];
+ } // in this case we need to build the font size object
- const _isUngroupable = isSingleGroupingBlock && !!_blocksSelection[0].innerBlocks.length;
+ 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));
+ }
- return {
- clientIds: _clientIds,
- isGroupable: _isGroupable,
- isUngroupable: _isUngroupable,
- blocksSelection: _blocksSelection,
- groupingBlockName: _groupingBlockName
};
- }, []);
- return {
- clientIds,
- isGroupable,
- isUngroupable,
- blocksSelection,
- groupingBlockName
- };
-}
+ }]), 'withFontSizes');
+});
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/index.js
-// 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
+
+
+;// 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
/**
- * Internal dependencies
+ * 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
-function ConvertToGroupButton(_ref) {
- let {
- clientIds,
- isGroupable,
- isUngroupable,
- blocksSelection,
- groupingBlockName,
- onClose = () => {}
- } = _ref;
- const {
- replaceBlocks
- } = Object(external_wp_data_["useDispatch"])(store["a" /* store */]);
+/**
+ * WordPress dependencies
+ */
- const onConvertToGroup = () => {
- // Activate the `transform` on the Grouping Block which does the conversion
- const newBlocks = Object(external_wp_blocks_["switchToBlockType"])(blocksSelection, groupingBlockName);
+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);
- if (newBlocks) {
- replaceBlocks(clientIds, newBlocks);
- }
- };
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/alignment-control/ui.js
- const onConvertFromGroup = () => {
- const innerBlocks = blocksSelection[0].innerBlocks;
- if (!innerBlocks.length) {
- return;
- }
- replaceBlocks(clientIds, innerBlocks);
- };
+/**
+ * External dependencies
+ */
- if (!isGroupable && !isUngroupable) {
- return null;
+/**
+ * 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);
}
- 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 ')));
+ 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
+ */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu-controls/index.js
+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
/**
@@ -40112,245 +35211,310 @@ function ConvertToGroupButton(_ref) {
+
/**
* 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
- })));
- }
- });
-};
+const block_SHOWN_BLOCK_TYPES = 9;
+/** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */
+
/**
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-settings-menu-controls/README.md
+ * Creates a blocks repeater for replacing the current block with a selected block type.
*
- * @param {Object} props Fill props.
- * @return {WPElement} Element.
+ * @return {WPCompleter} A blocks completer.
*/
+function createBlockCompleter() {
+ return {
+ name: 'blocks',
+ className: 'block-editor-autocompleters__block',
+ triggerPrefix: '/',
-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);
-
+ 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));
+ },
-/***/ "pY5h":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ 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))
+ };
+ }
-"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
+ * Creates a blocks repeater for replacing the current block with a selected block type.
+ *
+ * @return {WPCompleter} A blocks completer.
*/
-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')
- };
-}
+/* harmony default export */ var autocompleters_block = (createBlockCompleter());
-/***/ }),
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/autocomplete/index.js
-/***/ "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__);
+/**
+ * External dependencies
+ */
/**
* 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
*/
/**
- * 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 BlockDraggableChip(_ref) {
+function useCompleters(_ref) {
let {
- count,
- icon
+ completers = autocomplete_EMPTY_ARRAY
} = _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"]
- })))));
+ 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
-/***/ "qRz9":
-/***/ (function(module, exports) {
-(function() { module.exports = window["wp"]["richText"]; }());
+/**
+ * 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);
-/***/ "qrxh":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-full-height-alignment-control/index.js
-"use strict";
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
-var esm_extends = __webpack_require__("wx14");
+/**
+ * WordPress dependencies
+ */
+
-// 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);
+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
+ });
+}
-// EXTERNAL MODULE: external ["wp","a11y"]
-var external_wp_a11y_ = __webpack_require__("gdqT");
+/* harmony default export */ var block_full_height_alignment_control = (BlockFullHeightAlignmentControl);
-// EXTERNAL MODULE: external ["wp","i18n"]
-var external_wp_i18n_ = __webpack_require__("l3Sj");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-matrix-control/index.js
-// 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 dependencies
+ */
-// EXTERNAL MODULE: external ["wp","compose"]
-var external_wp_compose_ = __webpack_require__("K9lf");
+/**
+ * WordPress dependencies
+ */
-// 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");
+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;
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-patterns-state.js
-var use_patterns_state = __webpack_require__("nQUx");
+ const openOnArrowDown = event => {
+ if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) {
+ event.preventDefault();
+ onToggle();
+ }
+ };
-// 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");
+ 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
+ })
+ });
+}
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules
-var store = __webpack_require__("BhPs");
+/* harmony default export */ var block_alignment_matrix_control = (BlockAlignmentMatrixControl);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/quick-inserter.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js
/**
- * External dependencies
+ * 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
*/
@@ -40358,105 +35522,94 @@ var store = __webpack_require__("BhPs");
-
/**
* 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.
+ */
-
-
-const SEARCH_THRESHOLD = 6;
-const SHOWN_BLOCK_TYPES = 6;
-const SHOWN_BLOCK_PATTERNS = 2;
-function QuickInserter(_ref) {
+function BlockBreadcrumb(_ref) {
let {
- onSelect,
- rootClientId,
- clientId,
- isAppender
+ rootLabelText
} = _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 => {
+ selectBlock,
+ clearSelectedBlock
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store);
+ const {
+ clientId,
+ parents,
+ hasSelection
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
- getSettings,
- getBlockIndex,
- getBlockCount
- } = select(store["a" /* store */]);
- const index = getBlockIndex(clientId);
+ getSelectionStart,
+ getSelectedBlockClientId,
+ getBlockParents
+ } = select(store);
+ const selectedBlockClientId = getSelectedBlockClientId();
return {
- setInserterIsOpened: getSettings().__experimentalSetIsInserterOpened,
- insertionIndex: index === -1 ? getBlockCount() : index
+ parents: getBlockParents(selectedBlockClientId),
+ clientId: selectedBlockClientId,
+ hasSelection: !!getSelectionStart().clientId
};
- }, [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
- });
- };
+ 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.
+ */
- 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,
- 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')));
-}
+ /* eslint-disable jsx-a11y/no-redundant-roles */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/index.js
+ 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
-/**
- * External dependencies
- */
/**
@@ -40464,1199 +35617,1192 @@ function QuickInserter(_ref) {
*/
-
-
-
-
-
-
-
/**
* Internal dependencies
*/
+/**
+ * External dependencies
+ */
-
-const defaultRenderToggle = _ref => {
+function BlockContentOverlay(_ref) {
let {
- onToggle,
- disabled,
- isOpen,
- blockTitle,
- hasSingleBlockType,
- toggleProps = {}
+ clientId,
+ tagName: TagName = 'div',
+ wrapperProps,
+ className
} = _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);
- } else {
- label = Object(external_wp_i18n_["_x"])('Add block', 'Generic label for block inserter button');
- }
-
+ 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 {
- 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);
- }
- }
+ 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)
+ };
+ }, [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.
- 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);
- }
+ if (isParentSelected && !isHovered && isOverlayActive) {
+ setIsOverlayActive(false);
+ } // Ensure overlay is disabled if a child block is selected.
- onToggle(isOpen) {
- const {
- onToggle
- } = this.props; // Surface toggle callback to parent component
- if (onToggle) {
- onToggle(isOpen);
+ if (hasChildSelected && isOverlayActive) {
+ setIsOverlayActive(false);
}
- }
- /**
- * 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.
- */
+ }, [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 */
- 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.
- */
+ 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 */
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/color-style-selector/index.js
- 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
- });
- }
+/**
+ * WordPress dependencies
+ */
- 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
- });
- }
+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.
+ */
-}
-/* harmony default export */ var inserter = __webpack_exports__["a"] = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withSelect"])((select, _ref4) => {
+const ColorSelectorIcon = _ref => {
let {
- clientId,
- rootClientId
- } = _ref4;
- const {
- getBlockRootClientId,
- hasInserterItems,
- __experimentalGetAllowedBlocks,
- __experimentalGetDirectInsertBlock
- } = select(store["a" /* store */]);
- const {
- getBlockVariations
- } = select(external_wp_blocks_["store"]);
- rootClientId = rootClientId || getBlockRootClientId(clientId) || undefined;
-
- const allowedBlocks = __experimentalGetAllowedBlocks(rootClientId);
+ 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 directInsertBlock = __experimentalGetDirectInsertBlock(rootClientId);
- const hasSingleBlockType = Object(external_lodash_["size"])(allowedBlocks) === 1 && Object(external_lodash_["size"])(getBlockVariations(allowedBlocks[0].name, 'inserter')) === 0;
- let allowedBlockType = false;
+const renderToggleComponent = _ref2 => {
+ let {
+ TextColor,
+ BackgroundColor
+ } = _ref2;
+ return _ref3 => {
+ let {
+ onToggle,
+ isOpen
+ } = _ref3;
- if (hasSingleBlockType) {
- allowedBlockType = allowedBlocks[0];
- }
+ const openOnArrowDown = event => {
+ if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) {
+ event.preventDefault();
+ onToggle();
+ }
+ };
- return {
- hasItems: hasInserterItems(rootClientId),
- hasSingleBlockType,
- blockTitle: allowedBlockType ? allowedBlockType.title : '',
- allowedBlockType,
- directInsertBlock,
- rootClientId
+ 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)))
+ }));
};
-}), Object(external_wp_data_["withDispatch"])((dispatch, ownProps, _ref5) => {
- let {
- select
- } = _ref5;
- return {
- insertOnlyAllowedBlock() {
- const {
- rootClientId,
- clientId,
- isAppender,
- hasSingleBlockType,
- allowedBlockType,
- directInsertBlock,
- onSelectOrClose
- } = ownProps;
+};
+
+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
+ });
+};
- if (!hasSingleBlockType && !(directInsertBlock !== null && directInsertBlock !== void 0 && directInsertBlock.length)) {
- return;
- }
+/* harmony default export */ var color_style_selector = (BlockColorsStyleSelector);
- function getInsertionIndex() {
- const {
- getBlockIndex,
- getBlockSelectionEnd,
- getBlockOrder,
- getBlockRootClientId
- } = select(store["a" /* store */]); // If the clientId is defined, we insert at the position of the block.
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js
- if (clientId) {
- return getBlockIndex(clientId);
- } // If there a selected block, we insert after the selected block.
+/**
+ * WordPress dependencies
+ */
- const end = getBlockSelectionEnd();
+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);
- if (!isAppender && end && getBlockRootClientId(end) === rootClientId) {
- return getBlockIndex(end) + 1;
- } // Otherwise, we insert at the end of the current rootClientId
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/leaf.js
- 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);
+/**
+ * External dependencies
+ */
- 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);
- }
+/**
+ * WordPress dependencies
+ */
- };
-}), // 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 => {
+
+/**
+ * Internal dependencies
+ */
+
+
+const AnimatedTreeGridRow = animated(external_wp_components_namespaceObject.__experimentalTreeGridRow);
+function ListViewLeaf(_ref) {
let {
- hasItems,
- isAppender,
- rootClientId,
- clientId
- } = _ref6;
- return hasItems || !isAppender && !rootClientId && !clientId;
-})])(inserter_Inserter));
+ 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
+ */
-/***/ "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__);
+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
*/
-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);
+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
-/***/ }),
-/***/ "rHRV":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/**
+ * External dependencies
+ */
-"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 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));
+}
-(function() { module.exports = window["wp"]["htmlEntities"]; }());
+/* 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
-/***/ "smQA":
-/***/ (function(module, exports, __webpack_require__) {
-"use strict";
-/*istanbul ignore start*/
+/**
+ * External dependencies
+ */
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = Diff;
+/**
+ * WordPress dependencies
+ */
-/*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;
+/**
+ * Internal dependencies
+ */
- 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
+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);
- 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
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/context.js
+/**
+ * WordPress dependencies
+ */
- var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
+const ListViewContext = (0,external_wp_element_namespaceObject.createContext)({
+ __experimentalFeatures: false,
+ __experimentalPersistentListViewFeatures: false
+});
+const useListViewContext = () => (0,external_wp_element_namespaceObject.useContext)(ListViewContext);
- 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.
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/block.js
- function execEditLength() {
- for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
- var basePath =
- /*istanbul ignore start*/
- void 0
- /*istanbul ignore end*/
- ;
+/**
+ * External dependencies
+ */
- var addPath = bestPath[diagonalPath - 1],
- removePath = bestPath[diagonalPath + 1],
- _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
+/**
+ * WordPress dependencies
+ */
- 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
+/**
+ * Internal dependencies
+ */
- 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();
+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.
- if (ret) {
- return ret;
- }
- }
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
+ if (withExperimentalPersistentListViewFeatures && !isTreeGridMounted && isSelected) {
+ cellRef.current.focus();
}
- },
-
- /*istanbul ignore start*/
-
- /*istanbul ignore end*/
- pushComponent: function pushComponent(components, added, removed) {
- var last = components[components.length - 1];
+ }, []);
+ 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 (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
- });
+ 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;
- /*istanbul ignore start*/
+ if (hasRenderedMovers) {
+ colSpan = 2;
+ } else if (hideBlockActions) {
+ colSpan = 3;
+ }
- /*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;
+ 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
+ });
+ }));
+}
- while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
- newPos++;
- oldPos++;
- commonCount++;
- }
+/* harmony default export */ var list_view_block = ((0,external_wp_element_namespaceObject.memo)(ListViewBlock));
- if (commonCount) {
- basePath.components.push({
- count: commonCount
- });
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/branch.js
- basePath.newPos = newPos;
- return oldPos;
- },
- /*istanbul ignore start*/
+/**
+ * External dependencies
+ */
- /*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();
- }
- },
+/**
+ * WordPress dependencies
+ */
- /*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]);
- }
- }
+/**
+ * Internal dependencies
+ */
- return ret;
- },
- /*istanbul ignore start*/
- /*istanbul ignore end*/
- castInput: function castInput(value) {
- return value;
- },
- /*istanbul ignore start*/
+/**
+ * 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
+ */
- /*istanbul ignore end*/
- tokenize: function tokenize(value) {
- return value.split('');
- },
+function countBlocks(block, expandedState, draggedClientIds) {
+ var _expandedState$block$;
- /*istanbul ignore start*/
+ const isDragged = draggedClientIds === null || draggedClientIds === void 0 ? void 0 : draggedClientIds.includes(block.clientId);
- /*istanbul ignore end*/
- join: function join(chars) {
- return chars.join('');
+ if (isDragged) {
+ return 0;
}
-};
-
-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.
+ const isExpanded = (_expandedState$block$ = expandedState[block.clientId]) !== null && _expandedState$block$ !== void 0 ? _expandedState$block$ : true;
- 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();
+ if (isExpanded) {
+ return 1 + block.innerBlocks.reduce(countReducer(expandedState, draggedClientIds), 0);
}
- return components;
-}
-
-function clonePath(path) {
- return {
- newPos: path.newPos,
- components: path.components.slice(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);
-/***/ "suLj":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (isDragged) {
+ return count;
+ }
-"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__);
+ 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);
+ }
-/**
- * WordPress dependencies
- */
+ return count + 1;
+};
-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);
+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);
+ }
-/***/ "tI+e":
-/***/ (function(module, exports) {
+ 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.
-(function() { module.exports = window["wp"]["components"]; }());
+ 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));
-/***/ "tr0p":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/drop-indicator.js
-"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 ListViewDropIndicator(_ref) {
+ let {
+ listViewRef,
+ blockDropTarget
+ } = _ref;
const {
- apiVersion = 1
- } = settings;
-
- if (apiVersion < 2 && Object(external_wp_blocks_["hasBlockSupport"])(settings, 'lightBlockWrapper', false)) {
- settings.apiVersion = 2;
- }
+ 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.
- return settings;
-}
-Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/compat/migrateLightBlockWrapper', migrateLightBlockWrapper);
+ 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.
-// 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");
+ const _blockElement = clientId ? listViewRef.current.querySelector(`[data-block="${clientId}"]`) : undefined;
-// EXTERNAL MODULE: ./node_modules/classnames/index.js
-var classnames = __webpack_require__("TSYQ");
-var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
+ 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.
-// EXTERNAL MODULE: external "lodash"
-var external_lodash_ = __webpack_require__("YLtl");
+ 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.
-// 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");
+ 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 {};
+ }
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/index.js + 4 modules
-var block_alignment_control = __webpack_require__("vtO0");
+ const indent = getDropIndicatorIndent();
+ return {
+ width: targetElement.offsetWidth - indent
+ };
+ }, [getDropIndicatorIndent, targetElement]);
+ const getAnchorRect = (0,external_wp_element_namespaceObject.useCallback)(() => {
+ if (!targetElement) {
+ return {};
+ }
-// 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");
+ 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
+ };
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/align.js
+ 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]);
-/**
- * External dependencies
- */
+ 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
/**
- * An array which includes all possible valid alignments,
- * used to validate if an alignment is valid or not.
- *
- * @constant
- * @type {string[]}
+ * WordPress dependencies
*/
-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.
+ * Internal dependencies
*/
-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;
-}
+/** @typedef {import('../../utils/math').WPPoint} WPPoint */
+
/**
- * Filters registered block settings, extending attributes to include `align`.
- *
- * @param {Object} settings Original block settings.
+ * The type of a drag event.
*
- * @return {Object} Filtered block settings.
+ * @typedef {'default'|'file'|'html'} WPDragEventType
*/
-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.
+ * An array representing data for blocks in the DOM used by drag and drop.
*
- * @return {Function} Wrapped component.
+ * @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.
*/
-const withToolbarControls = Object(external_wp_compose_["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(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
- });
- };
+/**
+ * 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.
+ */
- 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.
+ * Is the point contained by the rectangle.
*
- * @param {Function} BlockListBlock Original component.
+ * @param {WPPoint} point The point.
+ * @param {DOMRect} rect The rectangle.
*
- * @return {Function} Wrapped component.
+ * @return {boolean} True if the point is contained by the rectangle, false otherwise.
*/
-const withDataAlign = Object(external_wp_compose_["createHigherOrderComponent"])(BlockListBlock => props => {
- const {
- name,
- attributes
- } = props;
- 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.
+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.
+ */
- if (align === undefined) {
- return Object(external_wp_element_["createElement"])(BlockListBlock, props);
- }
- let wrapperProps = props.wrapperProps;
+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.
- 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
- }));
-});
+const ALLOWED_DROP_EDGES = ['top', 'bottom'];
/**
- * Override props assigned to save component to inject alignment class name if
- * block supports it.
+ * Given blocks data and the cursor position, compute the drop target.
*
- * @param {Object} props Additional props applied to save element.
- * @param {Object} blockType Block type.
- * @param {Object} attributes Block attributes.
+ * @param {WPListViewDropZoneBlocks} blocksData Data about the blocks in list view.
+ * @param {WPPoint} position The point representing the cursor position when dragging.
*
- * @return {Object} Filtered props applied to save element.
+ * @return {WPListViewDropZoneTarget} An object containing data about the drop target.
*/
-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.
+function getListViewDropTarget(blocksData, position) {
+ let candidateEdge;
+ let candidateBlockData;
+ let candidateDistance;
+ let candidateRect;
- const isAlignValid = getValidAlignments(blockAlign, hasWideBlockSupport).includes(align);
+ for (const blockData of blocksData) {
+ if (blockData.isDraggedBlock) {
+ continue;
+ }
- if (isAlignValid) {
- props.className = classnames_default()(`align${align}`, props.className);
+ 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;
+ }
+ }
}
- 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);
+ if (!candidateBlockData) {
+ return;
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/lock.js
-/**
- * External dependencies
- */
+ 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.
-/**
- * WordPress dependencies
- */
+ if (!candidateBlockData.canInsertDraggedBlocksAsSibling) {
+ return;
+ }
+ const offset = isDraggingBelow ? 1 : 0;
+ return {
+ rootClientId: candidateBlockData.rootClientId,
+ clientId: candidateBlockData.clientId,
+ blockIndex: candidateBlockData.blockIndex + offset,
+ dropPosition: candidateEdge
+ };
+}
/**
- * Filters registered block settings, extending attributes to include `lock`.
- *
- * @param {Object} settings Original block settings.
+ * A react hook for implementing a drop zone in list view.
*
- * @return {Object} Filtered block settings.
+ * @return {WPListViewDropZoneTarget} The drop target.
*/
-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.
+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);
- settings.attributes = { ...settings.attributes,
- lock: {
- type: 'object'
+ if (newTarget) {
+ setTarget(newTarget);
}
- };
- return settings;
-}
-Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/lock/addAttribute', lock_addAttribute);
+ }, [draggedBlockClientIds]), 200);
+ const ref = (0,external_wp_compose_namespaceObject.__experimentalUseDropZone)({
+ onDrop: onBlockDrop,
-// EXTERNAL MODULE: external ["wp","components"]
-var external_wp_components_ = __webpack_require__("tI+e");
+ 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);
+ },
-// EXTERNAL MODULE: external ["wp","i18n"]
-var external_wp_i18n_ = __webpack_require__("l3Sj");
+ onDragEnd() {
+ throttled.cancel();
+ setTarget(null);
+ }
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/index.js
-var inspector_controls = __webpack_require__("1oY3");
+ });
+ return {
+ ref,
+ target
+ };
+}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/anchor.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/list-view/index.js
-/**
- * External dependencies
- */
/**
* WordPress dependencies
@@ -41666,120 +36812,177 @@ var inspector_controls = __webpack_require__("1oY3");
-
-
/**
* 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;
-}
+
+
+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;
+ }
+};
/**
- * 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.
+ * 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.
*
- * @return {WPComponent} Wrapped component.
+ * @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
*/
-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)));
+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;
}
- 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.
- */
+ setExpandedState({
+ type: 'expand',
+ clientId
+ });
+ }, [setExpandedState]);
+ const collapse = (0,external_wp_element_namespaceObject.useCallback)(clientId => {
+ if (!clientId) {
+ return;
+ }
-function addSaveProps(extraProps, blockType, attributes) {
- if (Object(external_wp_blocks_["hasBlockSupport"])(blockType, 'anchor')) {
- extraProps.id = attributes.anchor === '' ? null : attributes.anchor;
- }
+ setExpandedState({
+ type: 'collapse',
+ clientId
+ });
+ }, [setExpandedState]);
+ const expandRow = (0,external_wp_element_namespaceObject.useCallback)(row => {
+ var _row$dataset;
- return extraProps;
+ 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)))));
}
-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
+/* 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
-/**
- * External dependencies
- */
/**
* WordPress dependencies
@@ -41789,89 +36992,89 @@ Object(external_wp_hooks_["addFilter"])('blocks.getSaveContent.extraProps', 'cor
-
/**
* 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;
+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
+ }));
}
-/**
- * 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 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
*/
-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);
- }
+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"
+}, (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 */ var library_layout = (layout);
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-variation-picker/index.js
- 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
*/
@@ -41882,68 +37085,170 @@ Object(external_wp_hooks_["addFilter"])('blocks.getSaveContent.extraProps', 'cor
-/**
- * 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();
- } 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);
- }
- }
- return extraProps;
+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'))));
}
-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");
+/* harmony default export */ var block_variation_picker = (BlockVariationPicker);
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/dropdown.js
-var dropdown = __webpack_require__("dchM");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/grid.js
-// 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");
+/**
+ * WordPress dependencies
+ */
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/utils.js
-var hooks_utils = __webpack_require__("715p");
+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);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/border-color.js
+;// 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
/**
- * External dependencies
+ * WordPress dependencies
*/
+
+
/**
- * WordPress dependencies
+ * 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
@@ -41951,211 +37256,238 @@ var hooks_utils = __webpack_require__("715p");
+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
- // 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.
- *
- * 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.
+ * WordPress dependencies
*/
-function BorderColorEdit(props) {
- 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));
-}
+
/**
- * Filters registered block settings, extending attributes to include
- * `borderColor` if needed.
- *
- * @param {Object} settings Original block settings.
- *
- * @return {Object} Updated block settings.
+ * Internal dependencies
*/
-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;
+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 (!hasBorderSupport(blockType, 'color') || shouldSkipSerialization(blockType)) {
- return props;
+ 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
+ }))));
}
+ 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 {
- 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.
+ 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));
+}
- props.className = newClassName ? newClassName : undefined;
- return props;
+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));
}
-/**
- * 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.
- */
+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);
-function addEditProps(settings) {
- if (!hasBorderSupport(settings, 'color') || shouldSkipSerialization(settings)) {
- return settings;
+ if (!(patterns !== null && patterns !== void 0 && patterns.length) || showBlank) {
+ return startBlankComponent;
}
- const existingGetEditWrapperProps = settings.getEditWrapperProps;
-
- settings.getEditWrapperProps = attributes => {
- let props = {};
+ const onBlockPatternSelectDefault = blocks => {
+ const clonedBlocks = blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block));
+ replaceBlock(clientId, clonedBlocks);
+ };
- if (existingGetEditWrapperProps) {
- props = existingGetEditWrapperProps(attributes);
+ 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
+ }));
+};
- return border_color_addSaveProps(props, settings, attributes);
- };
+/* harmony default export */ var block_pattern_setup = (BlockPatternSetup);
- return settings;
-}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/block-variation-transforms.js
/**
- * This adds inline styles for color palette colors.
- * Ideally, this is not needed and themes should load their palettes on the editor.
+ * 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.
*
- * @param {Function} BlockListBlock Original component.
+ * This is a simple implementation for now as it takes into account only the attributes
+ * of a block variation and not `InnerBlocks`.
*
- * @return {Function} Wrapped component.
+ * @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];
+};
-const withBorderColorPaletteStyles = Object(external_wp_compose_["createHigherOrderComponent"])(BlockListBlock => props => {
- var _getColorObjectByAttr2, _props$wrapperProps;
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-variation-transforms/index.js
- 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);
- }
+/**
+ * WordPress dependencies
+ */
+
- 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
/**
@@ -42163,93 +37495,114 @@ var border_radius_control = __webpack_require__("Wy3j");
*/
-/**
- * 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;
+function __experimentalBlockVariationTransforms(_ref) {
+ let {
+ blockClientId
+ } = _ref;
+ const [selectedValue, setSelectedValue] = (0,external_wp_element_namespaceObject.useState)();
const {
- attributes: {
- style
- },
- setAttributes
- } = props;
-
- const onChange = newRadius => {
- let newStyle = { ...style,
- border: { ...(style === null || style === void 0 ? void 0 : style.border),
- radius: newRadius
- }
+ 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;
- if (newRadius === undefined || newRadius === '') {
- newStyle = Object(hooks_utils["a" /* cleanEmptyObject */])(newStyle);
- }
+ 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
+ };
+ });
- setAttributes({
- style: newStyle
+ const onSelectVariation = variationName => {
+ updateBlockAttributes(blockClientId, { ...variations.find(_ref3 => {
+ let {
+ name
+ } = _ref3;
+ return name === variationName;
+ }).attributes
});
};
- 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
- });
+ 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
+ }))));
}
-// 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
+/* harmony default export */ var block_variation_transforms = (__experimentalBlockVariationTransforms);
-
-/**
- * Internal dependencies
- */
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-vertical-alignment-control/icons.js
/**
- * Inspector control for configuring border style property.
- *
- * @param {Object} props Block properties.
- *
- * @return {WPElement} Border style edit element.
+ * WordPress dependencies
*/
-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)
- });
- };
+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"
+}));
- 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/components/block-vertical-alignment-control/ui.js
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/border-width.js
/**
@@ -42257,964 +37610,1175 @@ const BorderStyleEdit = props => {
*/
-
/**
* 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
+};
-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]);
+function BlockVerticalAlignmentUI(_ref) {
+ let {
+ value,
+ onChange,
+ controls = ui_DEFAULT_CONTROLS,
+ isCollapsed = true,
+ isToolbar
+ } = _ref;
- 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.
+ function applyOrUnset(align) {
+ return () => onChange(value === align ? undefined : align);
+ }
- 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.
+ 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
+ */
- 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.
+/* harmony default export */ var block_vertical_alignment_control_ui = (BlockVerticalAlignmentUI);
- 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.
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-vertical-alignment-control/index.js
- 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.
+/**
+ * Internal dependencies
+ */
- if (newWidth === undefined || newWidth === '') {
- newStyle = Object(hooks_utils["a" /* cleanEmptyObject */])(newStyle);
- }
+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
+ }));
+}
- setAttributes({
- borderColor: borderPaletteColor,
- style: newStyle
- });
- };
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/color-palette/with-color-context.js
- 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
+/**
+ * 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
-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.
+ * Internal dependencies
*/
-function hasBorderSupport(blockName) {
- let feature = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'any';
+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
+ }));
+}
- if (external_wp_element_["Platform"].OS !== 'web') {
- return false;
- }
+;// 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;
+}
- const support = Object(external_wp_blocks_["getBlockSupport"])(blockName, BORDER_SUPPORT_KEY);
+// 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
- 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]);
-}
-/**
- * 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 = 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.
+/**
+ * Compute the dimension of the crop area based on media size,
+ * aspect ratio and optionally rotation
*/
-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);
-};
+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);
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/gradients/use-gradient.js
-var use_gradient = __webpack_require__("Cn0l");
+ if (fittingWidth > fittingHeight * aspect) {
+ return {
+ width: fittingHeight * aspect,
+ height: fittingHeight
+ };
+ }
-// 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");
+ return {
+ width: fittingWidth,
+ height: fittingWidth / aspect
+ };
+}
+/**
+ * Ensure a new media position stays in the crop area.
+ */
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/contrast-checker/index.js
-var contrast_checker = __webpack_require__("6c9H");
+function restrictPosition(position, mediaSize, cropSize, zoom, rotation) {
+ if (rotation === void 0) {
+ rotation = 0;
+ }
-// 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");
+ var _a = translateSize(mediaSize.width, mediaSize.height, rotation),
+ width = _a.width,
+ height = _a.height;
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/color-panel.js
+ 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));
+}
-/**
- * WordPress dependencies
+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;
+ }
-/**
- * Internal dependencies
- */
+ 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))
+ });
-function getComputedStyle(node) {
- return node.ownerDocument.defaultView.getComputedStyle(node);
+ return {
+ croppedAreaPercentages: croppedAreaPercentages,
+ croppedAreaPixels: croppedAreaPixels
+ };
}
+/**
+ * Ensure the returned value is between 0 and max
+ */
-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;
- }
-
- 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;
- }
+function limitArea(max, value) {
+ return Math.min(max, Math.max(0, value));
+}
- 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
- })));
+function noOp(_max, value) {
+ return value;
}
+/**
+ * Compute the crop and zoom from the croppedAreaPixels
+ */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/color.js
+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;
+ }
-/**
- * External dependencies
+ 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
*/
-/**
- * WordPress dependencies
+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.
+ */
-
-
-/**
- * Internal dependencies
+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";
-const COLOR_SUPPORT_KEY = 'color';
+var MIN_ZOOM = 1;
+var MAX_ZOOM = 3;
-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);
-};
+var Cropper =
+/** @class */
+function (_super) {
+ __extends(Cropper, _super);
-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;
-};
+ function Cropper() {
+ var _this = _super !== null && _super.apply(this, arguments) || this;
-const hasLinkColorSupport = blockType => {
- if (external_wp_element_["Platform"].OS !== 'web') {
- return false;
- }
+ _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
- const colorSupport = Object(external_wp_blocks_["getBlockSupport"])(blockType, COLOR_SUPPORT_KEY);
- return Object(external_lodash_["isObject"])(colorSupport) && !!colorSupport.link;
-};
+ _this.preventZoomSafari = function (e) {
+ return e.preventDefault();
+ };
-const hasGradientSupport = blockType => {
- const colorSupport = Object(external_wp_blocks_["getBlockSupport"])(blockType, COLOR_SUPPORT_KEY);
- return Object(external_lodash_["isObject"])(colorSupport) && !!colorSupport.gradients;
-};
+ _this.cleanEvents = function () {
+ document.removeEventListener('mousemove', _this.onMouseMove);
+ document.removeEventListener('mouseup', _this.onDragStopped);
+ document.removeEventListener('touchmove', _this.onTouchMove);
+ document.removeEventListener('touchend', _this.onDragStopped);
+ };
-const hasBackgroundColorSupport = blockType => {
- const colorSupport = Object(external_wp_blocks_["getBlockSupport"])(blockType, COLOR_SUPPORT_KEY);
- return colorSupport && colorSupport.background !== false;
-};
+ _this.clearScrollEvent = function () {
+ if (_this.containerRef) _this.containerRef.removeEventListener('wheel', _this.onWheel);
-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.
- */
+ if (_this.wheelTimer) {
+ clearTimeout(_this.wheelTimer);
+ }
+ };
+ _this.onMediaLoad = function () {
+ _this.computeSizes();
-function color_addAttributes(settings) {
- if (!hasColorSupport(settings)) {
- return settings;
- } // allow blocks to specify their own attribute definition with default values if needed.
+ _this.emitCropData();
+ _this.setInitialCrop();
- if (!settings.attributes.backgroundColor) {
- Object.assign(settings.attributes, {
- backgroundColor: {
- type: 'string'
+ if (_this.props.onMediaLoaded) {
+ _this.props.onMediaLoaded(_this.mediaSize);
}
- });
- }
+ };
- if (!settings.attributes.textColor) {
- Object.assign(settings.attributes, {
- textColor: {
- type: 'string'
- }
- });
- }
+ _this.setInitialCrop = function () {
+ var _a = _this.props,
+ initialCroppedAreaPixels = _a.initialCroppedAreaPixels,
+ cropSize = _a.cropSize;
- if (hasGradientSupport(settings) && !settings.attributes.gradient) {
- Object.assign(settings.attributes, {
- gradient: {
- type: 'string'
+ if (!initialCroppedAreaPixels) {
+ return;
}
- });
- }
-
- 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;
- }
+ var _b = getInitialCropFromCroppedAreaPixels(initialCroppedAreaPixels, _this.mediaSize, cropSize),
+ crop = _b.crop,
+ zoom = _b.zoom;
- const hasGradient = hasGradientSupport(blockType); // I'd have prefered to avoid the "style" attribute usage here
+ _this.props.onCropChange(crop);
- const {
- backgroundColor,
- textColor,
- gradient,
- style
- } = attributes;
- const backgroundClass = Object(utils["a" /* getColorClassName */])('background-color', backgroundColor);
+ _this.props.onZoomChange && _this.props.onZoomChange(zoom);
+ };
- const gradientClass = Object(use_gradient["a" /* __experimentalGetGradientClass */])(gradient);
+ _this.computeSizes = function () {
+ var _a, _b, _c, _d, _e, _f;
- 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.
- */
+ var mediaRef = _this.imageRef || _this.videoRef;
-function color_addEditProps(settings) {
- if (!hasColorSupport(settings) || color_shouldSkipSerialization(settings)) {
- return settings;
- }
+ 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);
- const existingGetEditWrapperProps = settings.getEditWrapperProps;
+ 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);
+ }
- settings.getEditWrapperProps = attributes => {
- let props = {};
+ _this.setState({
+ cropSize: cropSize
+ }, _this.recomputeCropPosition);
+ }
+ };
- if (existingGetEditWrapperProps) {
- props = existingGetEditWrapperProps(attributes);
- }
+ _this.onMouseDown = function (e) {
+ e.preventDefault();
+ document.addEventListener('mousemove', _this.onMouseMove);
+ document.addEventListener('mouseup', _this.onDragStopped);
- return color_addSaveProps(props, settings, attributes);
- };
+ _this.onDragStart(Cropper.getMousePoint(e));
+ };
- return settings;
-}
+ _this.onMouseMove = function (e) {
+ return _this.onDrag(Cropper.getMousePoint(e));
+ };
-const getLinkColorFromAttributeValue = (colors, value) => {
- const attributeParsed = /var:preset\|color\|(.+)/.exec(value);
+ _this.onTouchStart = function (e) {
+ document.addEventListener('touchmove', _this.onTouchMove, {
+ passive: false
+ }); // iOS 11 now defaults to passive: true
- if (attributeParsed && attributeParsed[1]) {
- return Object(utils["b" /* getColorObjectByAttributeValues */])(colors, attributeParsed[1]).color;
- }
+ document.addEventListener('touchend', _this.onDragStopped);
- return value;
-};
+ if (e.touches.length === 2) {
+ _this.onPinchStart(e);
+ } else if (e.touches.length === 1) {
+ _this.onDragStart(Cropper.getTouchPoint(e.touches[0]));
+ }
+ };
-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.
- */
+ _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]));
+ }
+ };
-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;
+ _this.onDragStart = function (_a) {
+ var _b, _c;
- 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.
+ 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);
+ };
- 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.
+ _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;
- const localAttributes = Object(external_wp_element_["useRef"])(attributes);
- Object(external_wp_element_["useEffect"])(() => {
- localAttributes.current = attributes;
- }, [attributes]);
+ _this.props.onCropChange(newPosition);
+ });
+ };
- if (!hasColorSupport(blockName)) {
- return null;
- }
+ _this.onDragStopped = function () {
+ var _a, _b;
- const hasLinkColor = hasLinkColorSupport(blockName) && isLinkEnabled && solidsEnabled;
- const hasTextColor = hasTextColorSupport(blockName) && isTextEnabled && solidsEnabled;
- const hasBackgroundColor = hasBackgroundColorSupport(blockName) && isBackgroundEnabled && solidsEnabled;
- const hasGradientColor = hasGradientSupport(blockName) && gradientsEnabled;
+ _this.cleanEvents();
- if (!hasLinkColor && !hasTextColor && !hasBackgroundColor && !hasGradientColor) {
- return null;
- }
+ _this.emitCropData();
- const {
- style,
- textColor,
- backgroundColor,
- gradient
- } = attributes;
- let gradientValue;
+ (_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a);
+ };
- if (hasGradientColor && gradient) {
- gradientValue = Object(use_gradient["e" /* getGradientValueBySlug */])(allGradients, gradient);
- } else if (hasGradientColor) {
- var _style$color5;
+ _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;
- gradientValue = style === null || style === void 0 ? void 0 : (_style$color5 = style.color) === null || _style$color5 === void 0 ? void 0 : _style$color5.gradient;
- }
+ _this.setNewZoom(newZoom, point);
- const onChangeColor = name => value => {
- var _localAttributes$curr, _localAttributes$curr2;
+ if (!_this.state.hasWheelJustStarted) {
+ _this.setState({
+ hasWheelJustStarted: true
+ }, function () {
+ var _a, _b;
- 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
+ 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);
};
- 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;
+ _this.getPointOnContainer = function (_a) {
+ var x = _a.x,
+ y = _a.y;
- if (slug) {
- var _localAttributes$curr3, _localAttributes$curr4, _localAttributes$curr5;
+ if (!_this.containerRect) {
+ throw new Error('The Cropper is not mounted');
+ }
- 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
+ return {
+ x: _this.containerRect.width / 2 - (x - _this.containerRect.left),
+ y: _this.containerRect.height / 2 - (y - _this.containerRect.top)
};
- } 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
+ _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
};
- }
-
- 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
- });
- };
+ _this.setNewZoom = function (zoom, point) {
+ if (!_this.state.cropSize || !_this.props.onZoomChange) return;
- 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.
- */
+ var zoomPoint = _this.getPointOnContainer(point);
-const withColorPaletteStyles = Object(external_wp_compose_["createHigherOrderComponent"])(BlockListBlock => props => {
- var _props$wrapperProps;
+ var zoomTarget = _this.getPointOnMedia(zoomPoint);
- 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]);
+ 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;
- if (!hasColorSupport(name) || color_shouldSkipSerialization(name)) {
- return Object(external_wp_element_["createElement"])(BlockListBlock, props);
- }
+ _this.props.onCropChange(newPosition);
- const extraStyles = {};
+ _this.props.onZoomChange(newZoom);
+ };
- if (textColor) {
- var _getColorObjectByAttr;
+ _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)
- extraStyles.color = (_getColorObjectByAttr = Object(utils["b" /* getColorObjectByAttributeValues */])(colors, textColor)) === null || _getColorObjectByAttr === void 0 ? void 0 : _getColorObjectByAttr.color;
- }
- if (backgroundColor) {
- var _getColorObjectByAttr2;
+ 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);
+ };
- extraStyles.backgroundColor = (_getColorObjectByAttr2 = Object(utils["b" /* getColorObjectByAttributeValues */])(colors, backgroundColor)) === null || _getColorObjectByAttr2 === void 0 ? void 0 : _getColorObjectByAttr2.color;
- }
+ _this.emitCropData = function () {
+ var cropData = _this.getCropData();
- 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);
+ if (!cropData) return;
+ var croppedAreaPercentages = cropData.croppedAreaPercentages,
+ croppedAreaPixels = cropData.croppedAreaPixels;
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-appearance-control/index.js
-var font_appearance_control = __webpack_require__("Bo0k");
+ if (_this.props.onCropComplete) {
+ _this.props.onCropComplete(croppedAreaPercentages, croppedAreaPixels);
+ }
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/line-height-control/index.js + 1 modules
-var line_height_control = __webpack_require__("weEX");
+ if (_this.props.onCropAreaChange) {
+ _this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels);
+ }
+ };
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/line-height.js
+ _this.emitCropAreaChange = function () {
+ var cropData = _this.getCropData();
+ if (!cropData) return;
+ var croppedAreaPercentages = cropData.croppedAreaPercentages,
+ croppedAreaPixels = cropData.croppedAreaPixels;
-/**
- * WordPress dependencies
- */
+ if (_this.props.onCropAreaChange) {
+ _this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels);
+ }
+ };
-/**
- * Internal dependencies
- */
+ _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;
+ }
-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.
- */
+ Cropper.prototype.componentDidMount = function () {
+ window.addEventListener('resize', this.computeSizes);
-function LineHeightEdit(props) {
- var _style$typography;
+ 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);
+ }
- const {
- attributes: {
- style
- },
- setAttributes
- } = props;
+ 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
- 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.
- */
+ if (this.imageRef && this.imageRef.complete) {
+ this.onMediaLoad();
+ }
+ };
-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.
- */
+ Cropper.prototype.componentWillUnmount = function () {
+ var _a;
-function hasLineHeightValue(props) {
- var _props$attributes$sty, _props$attributes$sty2;
+ window.removeEventListener('resize', this.computeSizes);
- 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.
- */
+ if (this.containerRef) {
+ this.containerRef.removeEventListener('gesturestart', this.preventZoomSafari);
+ this.containerRef.removeEventListener('gesturechange', this.preventZoomSafari);
+ }
-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
- }
- })
- });
-}
+ if (this.styleRef) {
+ (_a = this.styleRef.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(this.styleRef);
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/font-appearance.js
+ this.cleanEvents();
+ this.props.zoomWithScroll && this.clearScrollEvent();
+ };
+ Cropper.prototype.componentDidUpdate = function (prevProps) {
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
-/**
- * WordPress dependencies
- */
+ 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();
+ }
-/**
- * Internal dependencies
- */
+ 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;
+ }
-/**
- * Key within block settings' support array indicating support for font style.
- */
+ return aspect;
+ };
-const FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';
-/**
- * Key within block settings' support array indicating support for font weight.
- */
+ 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));
+ };
-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.
- */
+ Cropper.prototype.onPinchMove = function (e) {
+ var _this = this;
-function FontAppearanceEdit(props) {
- var _style$typography, _style$typography2;
+ 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);
- const {
- attributes: {
- style
- },
- setAttributes
- } = props;
- const hasFontStyles = !useIsFontStyleDisabled(props);
- const hasFontWeights = !useIsFontWeightDisabled(props);
+ _this.setNewZoom(newZoom, center);
- 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
- }
- })
+ _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;
});
};
- 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;
+ Cropper.prototype.render = function () {
+ var _this = this;
- 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.
- */
+ 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)
+ }));
+ };
-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
- }
- })
- });
-}
+ 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
+ };
-// EXTERNAL MODULE: external ["wp","tokenList"]
-var external_wp_tokenList_ = __webpack_require__("BLeD");
-var external_wp_tokenList_default = /*#__PURE__*/__webpack_require__.n(external_wp_tokenList_);
+ Cropper.getMousePoint = function (e) {
+ return {
+ x: Number(e.clientX),
+ y: Number(e.clientY)
+ };
+ };
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/font-family/index.js
-var font_family = __webpack_require__("GKUk");
+ Cropper.getTouchPoint = function (touch) {
+ return {
+ x: Number(touch.clientX),
+ y: Number(touch.clientY)
+ };
+ };
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/font-family.js
+ return Cropper;
+}((external_React_default()).Component);
+/* harmony default export */ var index_module = (Cropper);
-/**
- * External dependencies
- */
+;// 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
*/
@@ -43222,185 +38786,251 @@ var font_family = __webpack_require__("GKUk");
-/**
- * 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 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%.
-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 (crop.width < 99.9 || crop.height < 99.9) {
+ attrs = crop;
+ }
+ if (rotation > 0) {
+ attrs.rotation = rotation;
+ }
- if (!settings.attributes.fontFamily) {
- Object.assign(settings.attributes, {
- fontFamily: {
- type: 'string'
- }
+ 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();
});
- }
-
- return settings;
+ }, [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
/**
- * 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
+ * WordPress dependencies
*/
-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.
+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;
+ }
- 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.
- */
+ 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;
-function font_family_addEditProps(settings) {
- if (!Object(external_wp_blocks_["hasBlockSupport"])(settings, FONT_FAMILY_SUPPORT_KEY)) {
- return settings;
- }
+ if (angle % 180) {
+ canvas.width = event.target.height;
+ canvas.height = event.target.width;
+ } else {
+ canvas.width = event.target.width;
+ canvas.height = event.target.height;
+ }
- const existingGetEditWrapperProps = settings.getEditWrapperProps;
+ if (angle === 90 || angle === 180) {
+ translateX = canvas.width;
+ }
- settings.getEditWrapperProps = attributes => {
- let props = {};
+ if (angle === 270 || angle === 180) {
+ translateY = canvas.height;
+ }
- if (existingGetEditWrapperProps) {
- props = existingGetEditWrapperProps(attributes);
+ 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
+ });
+ });
}
- return font_family_addSaveProps(props, settings, attributes);
- };
+ const el = new window.Image();
+ el.src = url;
+ el.onload = editImage;
+ const imgCrossOrigin = (0,external_wp_hooks_namespaceObject.applyFilters)('media.crossOrigin', undefined, url);
- return settings;
+ 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 FontFamilyEdit(_ref) {
- var _find;
-
- let {
- setAttributes,
- attributes: {
- fontFamily
+function useTransformImage(imageProperties, isEditing) {
+ const transformState = useTransformState(imageProperties);
+ const {
+ initializeTransformValues
+ } = transformState;
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
+ if (isEditing) {
+ initializeTransformValues();
}
- } = _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;
+ }, [isEditing, initializeTransformValues]);
+ return transformState;
+}
- 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
- });
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/context.js
- 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.
+ * WordPress dependencies
*/
-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.
+ * Internal dependencies
*/
-function resetFontFamily(_ref5) {
+
+
+const ImageEditingContext = (0,external_wp_element_namespaceObject.createContext)({});
+const useImageEditingContext = () => (0,external_wp_element_namespaceObject.useContext)(ImageEditingContext);
+function ImageEditingProvider(_ref) {
let {
- setAttributes
- } = _ref5;
- setAttributes({
- fontFamily: undefined
+ 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);
}
-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");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/cropper.js
-// 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
+/**
+ * External dependencies
+ */
/**
@@ -43408,575 +39038,604 @@ var font_size_picker = __webpack_require__("QP/w");
*/
-
-
/**
* 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
+
-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.
+ * WordPress dependencies
*/
-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.
+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
- 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.
+ * WordPress dependencies
*/
-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.
+/**
+ * Internal dependencies
+ */
- 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;
+
+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
+ })
+ });
}
-/**
- * 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.
- */
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/check.js
-function font_size_addEditProps(settings) {
- if (!Object(external_wp_blocks_["hasBlockSupport"])(settings, FONT_SIZE_SUPPORT_KEY)) {
- return settings;
- }
- const existingGetEditWrapperProps = settings.getEditWrapperProps;
+/**
+ * WordPress dependencies
+ */
- settings.getEditWrapperProps = attributes => {
- let props = {};
+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);
- if (existingGetEditWrapperProps) {
- props = existingGetEditWrapperProps(attributes);
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/aspect-ratio.js
- 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.
+ * 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);
-function FontSizeEdit(props) {
- var _style$typography, _style$typography2;
-
- const {
- attributes: {
- fontSize,
- style
- },
- setAttributes
- } = props;
- const fontSizes = Object(use_setting["a" /* default */])('typography.fontSizes');
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-editor/aspect-ratio-dropdown.js
- 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.
+ * WordPress dependencies
*/
-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.
+ * Internal dependencies
*/
-function resetFontSize(_ref) {
+
+
+
+function AspectGroup(_ref) {
let {
- attributes = {},
- setAttributes
+ aspectRatios,
+ isDisabled,
+ label,
+ onClick,
+ value
} = _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
- }
- })
- });
+ 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);
+ }));
}
-/**
- * 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() {
+function AspectRatioDropdown(_ref3) {
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;
+ 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
+ }]
+ }));
+ });
}
-/**
- * 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.
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/rotate-right.js
- 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);
+/**
+ * WordPress dependencies
+ */
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/text-decoration-control/index.js + 1 modules
-var text_decoration_control = __webpack_require__("kVRd");
+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/hooks/text-decoration.js
+;// 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
/**
- * Key within block settings' supports array indicating support for text
- * decorations e.g. settings found in `block.json`.
+ * WordPress dependencies
*/
-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.
+ * Internal dependencies
*/
-function TextDecorationEdit(props) {
- var _style$typography;
+function FormControls() {
const {
- attributes: {
- style
- },
- setAttributes
- } = props;
+ 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
- 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.
+ * WordPress dependencies
*/
-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.
+ * Internal dependencies
*/
-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) {
+
+
+
+
+function ImageEditor(_ref) {
let {
- attributes = {},
- setAttributes
+ url,
+ width,
+ height,
+ clientWidth,
+ naturalHeight,
+ naturalWidth
} = _ref;
- const {
- style
- } = attributes;
- setAttributes({
- style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style,
- typography: { ...(style === null || style === void 0 ? void 0 : style.typography),
- textDecoration: undefined
- }
- })
- });
+ 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))));
}
-// 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
-
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-size-control/use-dimension-handler.js
/**
* WordPress dependencies
*/
-/**
- * Internal 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.
-/**
- * Key within block settings' supports array indicating support for text
- * transforms e.g. settings found in `block.json`.
- */
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
+ if (customWidth !== undefined && Number.parseInt(customWidth) !== Number.parseInt(currentWidth)) {
+ setCurrentWidth(customWidth);
+ }
-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.
- */
+ if (customHeight !== undefined && Number.parseInt(customHeight) !== Number.parseInt(currentHeight)) {
+ setCurrentHeight(customHeight);
+ }
+ }, [customWidth, customHeight]);
-function TextTransformEdit(props) {
- var _style$typography;
+ const updateDimension = (dimension, value) => {
+ if (dimension === 'width') {
+ setCurrentWidth(value);
+ } else {
+ setCurrentHeight(value);
+ }
- const {
- attributes: {
- style
- },
- setAttributes
- } = props;
+ onChange({
+ [dimension]: value === '' ? undefined : parseInt(value, 10)
+ });
+ };
- function onChange(newTransform) {
- setAttributes({
- style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style,
- typography: { ...(style === null || style === void 0 ? void 0 : style.typography),
- textTransform: newTransform
- }
- })
+ 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 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
- });
+ return {
+ currentHeight,
+ currentWidth,
+ updateDimension,
+ updateDimensions
+ };
}
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/image-size-control/index.js
+
+
/**
- * Checks if text-transform settings have been disabled.
- *
- * @param {string} name Name of the block.
- *
- * @return {boolean} Whether or not the setting is disabled.
+ * External dependencies
*/
-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.
+ * WordPress dependencies
*/
-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.
+ * Internal dependencies
*/
-function resetTextTransform(_ref) {
+
+const IMAGE_SIZE_PRESETS = [25, 50, 75, 100];
+function ImageSizeControl(_ref) {
let {
- attributes = {},
- setAttributes
+ imageWidth,
+ imageHeight,
+ imageSizeOptions = [],
+ isResizable = true,
+ slug,
+ width,
+ height,
+ onChange,
+ onChangeImage = external_lodash_namespaceObject.noop
} = _ref;
const {
- style
- } = attributes;
- setAttributes({
- style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style,
- typography: { ...(style === null || style === void 0 ? void 0 : style.typography),
- textTransform: undefined
- }
- })
- });
+ 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')))));
}
-// 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
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js
/**
* WordPress dependencies
*/
-/**
- * Internal 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
/**
- * Key within block settings' supports array indicating support for letter-spacing
- * e.g. settings found in `block.json`.
+ * External dependencies
*/
-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.
+ * WordPress dependencies
*/
-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
- }
- })
- });
+
+const LinkControlSettingsDrawer = _ref => {
+ let {
+ value,
+ onChange = external_lodash_namespaceObject.noop,
+ settings
+ } = _ref;
+
+ if (!settings || !settings.length) {
+ return null;
}
- 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.
- */
+ 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
-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.
+ * External dependencies
*/
-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
/**
@@ -43985,434 +39644,629 @@ function resetLetterSpacing(_ref) {
+
+
+
+
+
/**
* 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);
+ }
-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']);
+ updateSuggestions() {
+ var _value;
- const createResetAllFilter = attribute => newAttributes => {
- var _newAttributes$style;
+ let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
+ const {
+ __experimentalFetchLinkSuggestions: fetchLinkSuggestions,
+ __experimentalHandleURLSuggestions: handleURLSuggestions
+ } = this.props;
- return { ...newAttributes,
- style: { ...newAttributes.style,
- typography: { ...((_newAttributes$style = newAttributes.style) === null || _newAttributes$style === void 0 ? void 0 : _newAttributes$style.typography),
- [attribute]: undefined
- }
+ 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;
}
- };
- };
- 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;
+ this.setState({
+ suggestions,
+ loading: false,
+ showSuggestions: !!suggestions.length
+ });
- 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 (!!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;
}
- };
- },
- 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
+ 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;
}
- };
- },
- 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));
-};
+ }
+ }
+
+ 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
+ };
-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;
-}
+ if (renderControl) {
+ return renderControl(controlProps, inputProps, loading);
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/gap.js
+ 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'
+ };
-/**
- * WordPress dependencies
- */
+ 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;
+ }
+}
/**
- * Internal dependencies
+ * @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
-/**
- * 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.
+ * External dependencies
*/
-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.
+ * WordPress dependencies
*/
-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 LinkControlSearchCreate = _ref => {
+ let {
+ searchTerm,
+ onClick,
+ itemProps,
+ isSelected,
+ buttonText
+ } = _ref;
- 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 (!searchTerm) {
+ return null;
+ }
- if (ref.current && isSafari) {
- var _ref$current$parentNo;
+ let text;
- (_ref$current$parentNo = ref.current.parentNode) === null || _ref$current$parentNo === void 0 ? void 0 : _ref$current$parentNo.replaceChild(ref.current, ref.current);
- }
- };
+ 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: <mark>%s</mark>'), searchTerm), {
+ mark: (0,external_wp_element_namespaceObject.createElement)("mark", null)
+ });
+ }
- 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
- });
-}
+ 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/block-editor/build-module/hooks/margin.js
+;// 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);
-
-
-/**
- * Internal dependencies
- */
-
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-item.js
/**
- * Determines if there is margin support.
- *
- * @param {string|Object} blockType Block name or Block Type object.
- *
- * @return {boolean} Whether there is support.
+ * External dependencies
*/
-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.
+ * WordPress dependencies
*/
-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) {
+
+
+const LinkControlSearchItem = _ref => {
let {
- attributes = {},
- setAttributes
+ itemProps,
+ suggestion,
+ isSelected = false,
+ onClick,
+ isURL = false,
+ searchTerm = '',
+ shouldShowType = false
} = _ref;
- const {
- style
- } = attributes;
- setAttributes({
- style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style,
- spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing),
- margin: undefined
- }
+ 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
})
- });
-}
-/**
- * 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.
- */
+ }), 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);
-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;
-}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/constants.js
/**
- * Inspector control panel containing the margin related configuration
- *
- * @param {Object} props Block props.
- *
- * @return {WPElement} Margin edit element.
+ * 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.
-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
- });
-}
+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/hooks/padding.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-results.js
/**
@@ -44420,154 +40274,137 @@ function MarginEdit(props) {
*/
-
-
/**
- * Internal dependencies
+ * External dependencies
*/
-
/**
- * Determines if there is padding support.
- *
- * @param {string|Object} blockType Block name or Block Type object.
- *
- * @return {boolean} Whether there is support.
+ * Internal dependencies
*/
-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) {
+function LinkControlSearchResults(_ref) {
let {
- attributes = {},
- setAttributes
+ instanceId,
+ withCreateSuggestion,
+ currentInputValue,
+ handleSuggestionClick,
+ suggestionsListProps,
+ buildSuggestionItemProps,
+ suggestions,
+ selectedSuggestion,
+ isLoading,
+ isInitialSuggestions,
+ createSuggestionButtonText,
+ suggestionsQuery
} = _ref;
- const {
- style
- } = attributes;
- setAttributes({
- style: Object(hooks_utils["a" /* cleanEmptyObject */])({ ...style,
- spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing),
- padding: undefined
- }
- })
+ const resultsListClasses = classnames_default()('block-editor-link-control__search-results', {
+ 'is-loading': isLoading
});
-}
-/**
- * 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.
- */
+ 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.
-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;
+ 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
/**
- * Inspector control panel containing the padding related configuration
- *
- * @param {Object} props
- *
- * @return {WPElement} Padding edit element.
+ * External dependencies
*/
-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;
- }
+/**
+ * WordPress dependencies
+ */
- 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)
- });
- };
+/**
+ * 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.
+ */
- 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
- });
+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/hooks/dimensions.js
-
-
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-search-handler.js
/**
* WordPress dependencies
*/
+/**
+ * External dependencies
+ */
+
/**
* Internal dependencies
@@ -44576,408 +40413,582 @@ function PaddingEdit(props) {
+const handleNoop = () => Promise.resolve([]);
+const handleDirectEntry = val => {
+ let type = 'URL';
+ const protocol = (0,external_wp_url_namespaceObject.getProtocol)(val) || '';
-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.
- */
+ if (protocol.includes('mailto')) {
+ type = 'mailto';
+ }
-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 (protocol.includes('tel')) {
+ type = 'tel';
+ }
- if (isDisabled || !isSupported) {
- return null;
+ if ((0,external_lodash_namespaceObject.startsWith)(val, '#')) {
+ type = 'internal';
}
- const defaultSpacingControls = Object(external_wp_blocks_["getBlockSupport"])(props.name, [SPACING_SUPPORT_KEY, '__experimentalDefaultControls']);
+ return Promise.resolve([{
+ id: val,
+ title: val,
+ url: type === 'URL' ? (0,external_wp_url_namespaceObject.prependHTTP)(val) : val,
+ type
+ }]);
+};
- const createResetAllFilter = attribute => newAttributes => {
- var _newAttributes$style;
+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.
- return { ...newAttributes,
- style: { ...newAttributes.style,
- spacing: { ...((_newAttributes$style = newAttributes.style) === null || _newAttributes$style === void 0 ? void 0 : _newAttributes$style.spacing),
- [attribute]: undefined
- }
- }
- };
- };
+ if (couldBeURL && withURLSuggestion && !isInitialSuggestions) {
+ results = results[0].concat(results[1]);
+ } else {
+ results = results[0];
+ } // If displaying initial suggestions just return plain results.
- 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;
- }
+ 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 `<input>`. This is because `title` is used
+ // when creating the suggestion. Similarly `url` is used when using keyboard to select
+ // the suggestion (the <form> `onSubmit` handler falls-back to `url`).
- return hasGapSupport(blockName) || hasPaddingSupport(blockName) || hasMarginSupport(blockName);
+
+ 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 `<input>`s text value
+ url: val,
+ // must match the existing `<input>`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
+
+
/**
- * Determines whether dimensions support has been disabled.
- *
- * @param {Object} props Block properties.
- *
- * @return {boolean} If spacing support is completely disabled.
+ * External dependencies
*/
-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.
+ * WordPress dependencies
*/
-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.
+ * Internal dependencies
*/
-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");
+ // 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.
+ */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/style.js
+ 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);
+ }
+ });
-/**
- * External dependencies
- */
+ 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;
-/**
- * WordPress dependencies
- */
+ 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
/**
- * Internal dependencies
+ * 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);
-const styleSupportKeys = [...TYPOGRAPHY_SUPPORT_KEYS, BORDER_SUPPORT_KEY, COLOR_SUPPORT_KEY, SPACING_SUPPORT_KEY];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/viewer-slot.js
+/**
+ * WordPress dependencies
+ */
-const hasStyleSupport = blockType => styleSupportKeys.some(key => Object(external_wp_blocks_["hasBlockSupport"])(blockType, key));
+const {
+ Slot: ViewerSlot,
+ Fill: ViewerFill
+} = (0,external_wp_components_namespaceObject.createSlotFill)('BlockEditorLinkControlViewer');
-const VARIABLE_REFERENCE_PREFIX = 'var:';
-const VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|';
-const VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--';
+/* harmony default export */ var viewer_slot = ((/* unused pure expression or super */ null && (ViewerSlot)));
-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})`;
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-rich-url-data.js
+/**
+ * Internal dependencies
+ */
- return uncompiledValue;
-}
/**
- * Returns the inline styles to add depending on the style object
- *
- * @param {Object} styles Styles configuration.
- *
- * @return {Object} Flattened CSS variables declaration.
+ * WordPress dependencies
*/
-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]);
+function use_rich_url_data_reducer(state, action) {
+ switch (action.type) {
+ case 'RESOLVED':
+ return { ...state,
+ isFetching: false,
+ richData: action.richData
+ };
- if (value) {
- output[name] = compileStyleValue(value);
- }
- });
- } else if (!ignoredStyles.includes(path.join('.'))) {
- output[propKey] = compileStyleValue(Object(external_lodash_["get"])(styles, path));
- }
- }
- });
- return output;
+ case 'ERROR':
+ return { ...state,
+ isFetching: false,
+ richData: null
+ };
+
+ case 'LOADING':
+ return { ...state,
+ isFetching: true
+ };
+
+ default:
+ throw new Error(`Unexpected action type ${action.type}`);
+ }
}
-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);
+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
- 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 () => {
+ controller.abort();
+ };
}
-
- return '';
- }).join('\n');
+ }, [url]);
+ return state;
}
-/**
- * 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.
+/* harmony default export */ var use_rich_url_data = (useRemoteUrlData);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/link-preview.js
- 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<string, string[]>}
+ * External dependencies
*/
-
-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<string, string[]>}
+ * WordPress dependencies
*/
-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<string, string[]>} skipPaths An object of keys and paths to skip serialization.
- *
- * @return {Object} Filtered props applied to save element.
+ * Internal dependencies
*/
-function style_addSaveProps(props, blockType, attributes) {
- let skipPaths = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : skipSerializationPathsSave;
- if (!hasStyleSupport(blockType)) {
- return props;
- }
+
+function LinkPreview(_ref) {
+ var _value$url;
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;
+ 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
/**
- * 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.
+ * WordPress dependencies
*/
-function style_addEditProps(settings) {
- if (!hasStyleSupport(settings)) {
- return settings;
- }
- const existingGetEditWrapperProps = settings.getEditWrapperProps;
+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);
- settings.getEditWrapperProps = attributes => {
- let props = {};
+ const createPage = async function (suggestionTitle) {
+ setIsCreatingPage(true);
+ setErrorMessage(null);
- if (existingGetEditWrapperProps) {
- props = existingGetEditWrapperProps(attributes);
- }
+ 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
+ }
- return style_addSaveProps(props, settings, attributes, skipSerializationPathsEdit);
+ 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.
+ */
- 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');
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
+ return () => {
+ // componentDidUnmount
+ if (cancelableCreateSuggestion.current) {
+ cancelableCreateSuggestion.current.cancel();
+ }
+ };
+ }, []);
+ return {
+ createPage,
+ isCreatingPage,
+ errorMessage
+ };
+}
/**
- * Override the default block element to include duotone styles.
+ * 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 {Function} BlockListBlock Original component
- * @return {Function} Wrapped component
+ * @param {Promise} promise the Promise to make cancelable
*/
-const withElementsStyles = Object(external_wp_compose_["createHigherOrderComponent"])(BlockListBlock => props => {
- var _props$attributes$sty, _props$attributes$sty2;
+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,
- 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
+ cancel() {
+ hasCanceled_ = true;
}
- }), 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
+ };
+};
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/link-control/index.js
/**
@@ -44985,7 +40996,6 @@ var duotone_control = __webpack_require__("1uGa");
*/
-
/**
* WordPress dependencies
*/
@@ -44995,560 +41005,388 @@ var duotone_control = __webpack_require__("1uGa");
+
/**
* 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.
+ * Default properties associated with a link control value.
*
- * @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.
+ * @typedef WPLinkControlDefaultValue
*
- * @return {WPElement} Duotone element.
+ * @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.
*/
-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;
- }
+/* eslint-disable jsdoc/valid-types */
- 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.
+ * Custom settings values associated with a link.
*
- * @return {Object} Filtered block settings.
+ * @typedef {{[setting:string]:any}} WPLinkControlSettingsValue
*/
+/* eslint-enable */
-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.
+ * Custom settings values associated with a link.
*
- * @param {Function} BlockEdit Original component.
+ * @typedef WPLinkControlSetting
*
- * @return {Function} Wrapped component.
+ * @property {string} id Identifier to use as property for setting value.
+ * @property {string} title Human-readable label to show in user interface.
*/
-
-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.
+ * Properties associated with a link control value, composed as a union of the
+ * default properties and any custom settings values.
*
- * @return {string} Scoped selector.
+ * @typedef {WPLinkControlDefaultValue&WPLinkControlSettingsValue} WPLinkControlValue
*/
-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(', ');
-}
+/** @typedef {(nextValue:WPLinkControlValue)=>void} WPLinkControlOnChangeProp */
+
/**
- * Override the default block element to include duotone styles.
+ * Properties associated with a search suggestion used within the LinkControl.
*
- * @param {Function} BlockListBlock Original component.
+ * @typedef WPLinkControlSuggestion
*
- * @return {Function} Wrapped component.
+ * @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.
*/
-
-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
-
-
+/** @typedef {(title:string)=>WPLinkControlSuggestion} WPLinkControlCreateSuggestionProp */
/**
- * External dependencies
+ * @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.
*/
-
/**
- * WordPress dependencies
+ * 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
+ */
-/**
- * Internal dependencies
- */
+ 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
+ });
+ }
-const layoutBlockSupportKey = '__experimentalLayout';
+ stopEditing();
+ };
-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 handleSubmitWithEnter = event => {
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;
+ keyCode
+ } = event;
- if (!allowEditing) {
- return null;
- }
+ if (keyCode === external_wp_keycodes_namespaceObject.ENTER && !currentInputIsEmpty // disallow submitting empty values.
+ ) {
+ event.preventDefault();
+ handleSubmit();
+ }
+ };
- 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.
- */
+ 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.
- if (type === 'default' && !themeSupportsLayout) {
- return null;
- }
+ 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.
- const layoutType = Object(layouts["a" /* getLayoutType */])(type);
+ })))), 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());
+}
- const onChangeType = newType => setAttributes({
- layout: {
- type: newType
- }
- });
+LinkControl.ViewerFill = ViewerFill;
+/* harmony default export */ var link_control = (LinkControl);
- const onChangeLayout = newLayout => setAttributes({
- layout: newLayout
- });
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media.js
- 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);
- }));
-}
/**
- * Filters registered block settings, extending attributes to include `layout`.
- *
- * @param {Object} settings Original block settings.
- *
- * @return {Object} Filtered block settings.
+ * 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);
-function layout_addAttribute(settings) {
- if (Object(external_lodash_["has"])(settings.attributes, ['layout', 'type'])) {
- return settings;
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/upload.js
- if (Object(external_wp_blocks_["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.
+ * WordPress dependencies
*/
-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');
+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
/**
- * Override the default block element to add the layout styles.
- *
- * @param {Function} BlockListBlock Original component.
- *
- * @return {Function} Wrapped component.
+ * WordPress dependencies
*/
-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
+ * 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;
/**
- * Internal dependencies
+ * @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));
- // 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.
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/media-upload/check.js
+/**
+ * WordPress dependencies
+ */
-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.
+ * Internal dependencies
*/
-function getBorderClassesAndStyles(_ref) {
- var _style$border;
+function MediaUploadCheck(_ref) {
let {
- borderColor,
- style
+ fallback = null,
+ children
} = _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
- })
- };
+ const hasUploadPermissions = (0,external_wp_data_namespaceObject.useSelect)(select => {
+ const {
+ getSettings
+ } = select(store);
+ return !!getSettings().mediaUpload;
+ }, []);
+ return hasUploadPermissions ? children : fallback;
}
/**
- * 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.
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-upload/README.md
*/
-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.
+/* harmony default export */ var media_upload_check = (MediaUploadCheck);
- if (attributes.borderColor) {
- const borderColorObject = Object(utils["b" /* getColorObjectByAttributeValues */])(colors, attributes.borderColor);
- borderProps.style.borderColor = borderColorObject.color;
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/media-replace-flow/index.js
- return borderProps;
-}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/hooks/use-color-props.js
/**
* External dependencies
*/
@@ -45558,6 +41396,14 @@ function useBorderProps(attributes) {
*/
+
+
+
+
+
+
+
+
/**
* Internal dependencies
*/
@@ -45565,189 +41411,304 @@ function useBorderProps(attributes) {
- // 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 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 {
- backgroundColor,
- textColor,
- gradient,
- style
- } = attributes; // Collect color CSS classes.
+ 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 backgroundClass = Object(utils["a" /* getColorClassName */])('background-color', backgroundColor);
- const textClass = Object(utils["a" /* getColorClassName */])('color', textColor);
+ 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.
- const gradientClass = Object(use_gradient["a" /* __experimentalGetGradientClass */])(gradient);
+ setTimeout(() => {
+ createNotice('error', renderMsg, {
+ speak: true,
+ id: errorNoticeID,
+ isDismissible: true
+ });
+ }, 1000);
+ };
- 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 selectMedia = media => {
+ setMediaURLValue(media.url); // Calling `onSelect` after the state update since it might unmount the component.
- 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.
+ onSelect(media);
+ (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('The media file has been replaced'));
+ removeNotice(errorNoticeID);
+ };
- const colorStyles = (style === null || style === void 0 ? void 0 : style.color) || {};
- const styleProp = getInlineStyles({
- color: colorStyles
+ 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 {
- className: className || undefined,
- style: styleProp
+ createNotice,
+ removeNotice
};
-}
-const EMPTY_OBJECT = {};
+}), (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
+
+
/**
- * 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.
+ * External dependencies
*/
-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.
+/**
+ * WordPress dependencies
+ */
- 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);
- }
+function LinkViewerURL(_ref) {
+ let {
+ url,
+ urlLabel,
+ className
+ } = _ref;
+ const linkClassName = classnames_default()(className, 'block-editor-url-popover__link-viewer-url');
- if (textColor) {
- const textColorObject = Object(utils["b" /* getColorObjectByAttributeValues */])(colors, textColor);
- colorProps.style.color = textColorObject.color;
+ if (!url) {
+ return (0,external_wp_element_namespaceObject.createElement)("span", {
+ className: linkClassName
+ });
}
- return colorProps;
+ 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/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.
- */
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/url-popover/link-viewer.js
-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
+ * External 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
+ * WordPress dependencies
*/
-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
*/
+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
+ */
-// 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
*/
@@ -45755,1874 +41716,2136 @@ var defaults = __webpack_require__("lJLt");
+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
+ */
-/***/ }),
-
-/***/ "uoCR":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/* harmony default export */ var url_popover = (URLPopover);
-"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__);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/media-placeholder/index.js
/**
- * WordPress dependencies
+ * External dependencies
*/
-/** @typedef {import('react').ReactNode} ReactNode */
/**
- * @typedef BlockContextProviderProps
- *
- * @property {Record<string,*>} value Context value to merge with current
- * value.
- * @property {ReactNode} children Component children.
+ * WordPress dependencies
*/
-/** @type {import('react').Context<Record<string,*>>} */
-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
+ * Internal 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__) {
+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"
+ })));
+};
-"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
- */
+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;
-/**
- * WordPress dependencies
- */
+ 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);
+ };
-/**
- * Internal dependencies
- */
+ const openURLInput = () => {
+ setIsURLInputVisible(true);
+ };
+ const closeURLInput = () => {
+ setIsURLInputVisible(false);
+ };
+ const onSubmitSrc = event => {
+ event.preventDefault();
-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 (src && onSelectURL) {
+ onSelectURL(src);
+ closeURLInput();
}
+ };
- if (settings.enableCustomUnits === true) {
- return ['px', 'em', 'rem', 'vh', 'vw', '%'];
+ const onFilesUpload = files => {
+ if (!handleUpload) {
+ return onSelect(files);
}
- 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',
+ onFilesPreUpload(files);
+ let setMedia;
- /*
- * 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.
- */
+ 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 = [];
-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' );
- * ```
- */
+ 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.
-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;
+ return !lastMediaPassed.some(_ref4 => {
+ let {
+ urlSlug
+ } = _ref4;
+ return item.url.includes(urlSlug);
+ });
+ }); // Return the filtered media array along with newMedia.
- 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;
+ 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);
+ };
}
- 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.
+ mediaUpload({
+ allowedTypes,
+ filesList: files,
+ onFileChange: setMedia,
+ onError
+ });
+ };
- 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);
+ const onUpload = event => {
+ onFilesUpload(event.target.files);
+ };
- if (experimentalFeaturesResult !== undefined) {
- if (_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__["__EXPERIMENTAL_PATHS_WITH_MERGE"][normalizedPath]) {
- var _ref, _experimentalFeatures;
+ const defaultRenderPlaceholder = content => {
+ let {
+ instructions,
+ title
+ } = labels;
- return (_ref = (_experimentalFeatures = experimentalFeaturesResult.custom) !== null && _experimentalFeatures !== void 0 ? _experimentalFeatures : experimentalFeaturesResult.theme) !== null && _ref !== void 0 ? _ref : experimentalFeaturesResult.default;
+ 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.');
+ }
}
- return experimentalFeaturesResult;
- } // 2 - Use deprecated settings, otherwise.
+ 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 deprecatedSettingsValue = deprecatedFlags[normalizedPath] ? deprecatedFlags[normalizedPath](settings) : undefined;
+ 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);
+ };
- 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.
+ 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'));
+ };
- return normalizedPath === 'typography.dropCap' ? true : undefined;
- }, [blockName, path]);
- return setting;
-}
+ 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
+ });
-/***/ "v8Ku":
-/***/ (function(module, exports) {
+ 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'
+ });
+ }
-/***/ "vIlp":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ return (0,external_wp_element_namespaceObject.createElement)(media_upload_check, null, renderDropZone());
+ }
-"use strict";
-/* unused harmony export getDistanceFromPointToEdge */
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getDistanceToNearestEdge; });
+ return (0,external_wp_element_namespaceObject.createElement)(media_upload_check, {
+ fallback: renderPlaceholder(renderUrlSelectionUI())
+ }, renderMediaUploadChecked());
+}
/**
- * A string representing the name of an edge.
- *
- * @typedef {'top'|'right'|'bottom'|'left'} WPEdgeName
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-placeholder/README.md
*/
-/**
- * @typedef {Object} WPPoint
- * @property {number} x The horizontal position.
- * @property {number} y The vertical position.
- */
+/* harmony default export */ var media_placeholder = ((0,external_wp_components_namespaceObject.withFilters)('editor.MediaPlaceholder')(MediaPlaceholder));
-/**
- * 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.
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/panel-color-settings/index.js
- 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.
+ * Internal dependencies
*/
-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;
- }
+const PanelColorSettings = _ref => {
+ let {
+ colorSettings,
+ ...props
+ } = _ref;
+ const settings = colorSettings.map(_ref2 => {
+ let {
+ value,
+ onChange,
+ ...otherSettings
+ } = _ref2;
+ return { ...otherSettings,
+ colorValue: value,
+ onColorChange: onChange
+ };
});
- return [candidateDistance, candidateEdge];
-}
+ 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
-/***/ "vSu0":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
+/**
+ * External dependencies
+ */
-// EXTERNAL MODULE: external "lodash"
-var external_lodash_ = __webpack_require__("YLtl");
-// EXTERNAL MODULE: external ["wp","compose"]
-var external_wp_compose_ = __webpack_require__("K9lf");
+/**
+ * WordPress dependencies
+ */
-// EXTERNAL MODULE: ./node_modules/traverse/index.js
-var traverse = __webpack_require__("eGrx");
-var traverse_default = /*#__PURE__*/__webpack_require__.n(traverse);
-// 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) {
- options = options || {};
- /**
- * Positional.
- */
- let lineno = 1;
- let column = 1;
- /**
- * Update lineno and column based on `str`.
- */
- function updatePosition(str) {
- const lines = str.match(/\n/g);
+const format_toolbar_POPOVER_PROPS = {
+ position: 'bottom right',
+ isAlternate: true
+};
- if (lines) {
- lineno += lines.length;
+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 i = str.lastIndexOf('\n'); // eslint-disable-next-line no-bitwise
+ 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
+ }));
+ }));
+};
- column = ~i ? str.length - i : column + str.length;
- }
- /**
- * Mark position and patch `node.position`.
- */
+/* harmony default export */ var format_toolbar = (FormatToolbar);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/format-toolbar-container.js
- function position() {
- const start = {
- line: lineno,
- column
- };
- return function (node) {
- node.position = new Position(start);
- whitespace();
- return node;
- };
- }
- /**
- * Store position information for a node
- */
+/**
+ * WordPress dependencies
+ */
- function Position(start) {
- this.start = start;
- this.end = {
- line: lineno,
- column
- };
- this.source = options.source;
- }
- /**
- * Non-enumerable source string
- */
+/**
+ * Internal dependencies
+ */
- Position.prototype.content = css;
- /**
- * Error `msg`.
- */
- const errorsList = [];
- function error(msg) {
- const err = new Error(options.source + ':' + lineno + ':' + column + ': ' + msg);
- err.reason = msg;
- err.filename = options.source;
- err.line = lineno;
- err.column = column;
- err.source = css;
+const FormatToolbarContainer = _ref => {
+ let {
+ inline,
+ anchorRef
+ } = _ref;
- if (options.silent) {
- errorsList.push(err);
- } else {
- throw err;
- }
- }
- /**
- * Parse stylesheet.
- */
+ 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
- function stylesheet() {
- const rulesList = rules();
- return {
- type: 'stylesheet',
- stylesheet: {
- source: options.source,
- rules: rulesList,
- parsingErrors: errorsList
- }
- };
- }
- /**
- * Opening brace.
- */
+ 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);
- function open() {
- return match(/^{\s*/);
- }
- /**
- * Closing brace.
- */
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-undo-automatic-change.js
+/**
+ * WordPress dependencies
+ */
- function close() {
- return match(/^}/);
- }
- /**
- * Parse ruleset.
- */
+
+/**
+ * Internal dependencies
+ */
- function rules() {
- let node;
- const accumulator = [];
- whitespace();
- comments(accumulator);
+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;
- while (css.length && css.charAt(0) !== '}' && (node = atrule() || rule())) {
- if (node !== false) {
- accumulator.push(node);
- comments(accumulator);
+ if (event.defaultPrevented) {
+ return;
}
- }
- return accumulator;
- }
- /**
- * Match `re` and return captures.
- */
+ if (keyCode !== external_wp_keycodes_namespaceObject.DELETE && keyCode !== external_wp_keycodes_namespaceObject.BACKSPACE && keyCode !== external_wp_keycodes_namespaceObject.ESCAPE) {
+ return;
+ }
+ if (!didAutomaticChange()) {
+ return;
+ }
- function match(re) {
- const m = re.exec(css);
+ event.preventDefault();
- if (!m) {
- return;
+ getSettings().__experimentalUndo();
}
- const str = m[0];
- updatePosition(str);
- css = css.slice(str.length);
- return m;
- }
- /**
- * Parse whitespace.
- */
+ 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
+ */
- function whitespace() {
- match(/^\s*/);
- }
- /**
- * Parse comments;
- */
+/**
+ * Internal dependencies
+ */
- function comments(accumulator) {
- let c;
- accumulator = accumulator || []; // eslint-disable-next-line no-cond-assign
- while (c = comment()) {
- if (c !== false) {
- accumulator.push(c);
+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]);
+}
- return accumulator;
- }
- /**
- * Parse comment.
- */
-
-
- function comment() {
- const pos = position();
-
- if ('/' !== css.charAt(0) || '*' !== css.charAt(1)) {
- return;
- }
-
- let i = 2;
-
- while ('' !== css.charAt(i) && ('*' !== css.charAt(i) || '/' !== css.charAt(i + 1))) {
- ++i;
- }
-
- i += 2;
-
- if ('' === css.charAt(i - 1)) {
- return error('End of comment missing');
- }
-
- const str = css.slice(2, i - 2);
- column += 2;
- updatePosition(str);
- css = css.slice(i);
- column += 2;
- return pos({
- type: 'comment',
- comment: str
- });
- }
- /**
- * Parse selector.
- */
-
-
- function selector() {
- const m = match(/^([^{]+)/);
-
- if (!m) {
- return;
- } // FIXME: Remove all comments from selectors http://ostermiller.org/findcomment.html
-
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-mark-persistent.js
+/**
+ * WordPress dependencies
+ */
- return trim(m[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, '').replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function (matched) {
- return matched.replace(/,/g, '\u200C');
- }).split(/\s*(?![^(]*\)),\s*/).map(function (s) {
- return s.replace(/\u200C/g, ',');
- });
- }
- /**
- * Parse declaration.
- */
+/**
+ * Internal dependencies
+ */
- function declaration() {
- const pos = position(); // prop
- let prop = match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
+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.
- if (!prop) {
+ (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.
- prop = trim(prop[0]); // :
- if (!match(/^:\s*/)) {
- return error("property missing ':'");
- } // val
+ if (previousText.current !== value.text) {
+ const timeout = window.setTimeout(() => {
+ __unstableMarkLastChangeAsPersistent();
+ }, 1000);
+ previousText.current = value.text;
+ return () => {
+ window.clearTimeout(timeout);
+ };
+ }
+ __unstableMarkLastChangeAsPersistent();
+ }, [html, hasActiveFormats]);
+}
- const val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/);
- const ret = pos({
- type: 'declaration',
- property: prop.replace(commentre, ''),
- value: val ? trim(val[0]).replace(commentre, '') : ''
- }); // ;
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/file-paste-handler.js
+/**
+ * WordPress dependencies
+ */
- match(/^[;\s]*/);
- return ret;
- }
- /**
- * Parse declarations.
- */
+function filePasteHandler(files) {
+ return files.filter(_ref => {
+ let {
+ type
+ } = _ref;
+ return /^image\/(?:jpe?g|png|gif)$/.test(type);
+ }).map(file => `<img src="${(0,external_wp_blob_namespaceObject.createBlobURL)(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
- function declarations() {
- const decls = [];
- if (!open()) {
- return error("missing '{'");
- }
+/**
+ * WordPress dependencies
+ */
- comments(decls); // declarations
- let decl; // eslint-disable-next-line no-cond-assign
- while (decl = declaration()) {
- if (decl !== false) {
- decls.push(decl);
- comments(decls);
- }
- }
- if (!close()) {
- return error("missing '}'");
- }
+function addActiveFormats(value, activeFormats) {
+ if (activeFormats !== null && activeFormats !== void 0 && activeFormats.length) {
+ let index = value.formats.length;
- return decls;
+ while (index--) {
+ value.formats[index] = [...activeFormats, ...(value.formats[index] || [])];
+ }
}
- /**
- * Parse keyframe.
- */
-
-
- function keyframe() {
- let m;
- const vals = [];
- const pos = position(); // eslint-disable-next-line no-cond-assign
+}
+/**
+ * Get the multiline tag based on the multiline prop.
+ *
+ * @param {?(string|boolean)} multiline The multiline prop.
+ *
+ * @return {?string} The multiline tag.
+ */
- while (m = match(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/)) {
- vals.push(m[1]);
- match(/^,\s*/);
- }
+function getMultilineTag(multiline) {
+ if (multiline !== true && multiline !== 'p' && multiline !== 'li') {
+ return;
+ }
- if (!vals.length) {
- return;
- }
+ return multiline === true ? 'p' : multiline;
+}
+function getAllowedFormats(_ref) {
+ let {
+ allowedFormats,
+ formattingControls,
+ disableFormats
+ } = _ref;
- return pos({
- type: 'keyframe',
- values: vals,
- declarations: declarations()
- });
+ if (disableFormats) {
+ return getAllowedFormats.EMPTY_ARRAY;
}
- /**
- * Parse keyframes.
- */
-
- function atkeyframes() {
- const pos = position();
- let m = match(/^@([-\w]+)?keyframes\s*/);
+ if (!allowedFormats && !formattingControls) {
+ return;
+ }
- if (!m) {
- return;
- }
+ if (allowedFormats) {
+ return allowedFormats;
+ }
- const vendor = m[1]; // identifier
+ 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.
+ */
- m = match(/^([-\w]+)\s*/);
+function createLinkInParagraph(url, onReplace) {
+ const link = createElement("a", {
+ href: url
+ }, url);
+ onReplace(createBlock('core/paragraph', {
+ content: renderToString(link)
+ }));
+}
- if (!m) {
- return error('@keyframes missing name');
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/split-value.js
+/**
+ * WordPress dependencies
+ */
- const name = m[1];
+/*
+ * 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.
+ */
- if (!open()) {
- return error("@keyframes missing '{'");
- }
+function splitValue(_ref) {
+ let {
+ value,
+ pastedBlocks = [],
+ onReplace,
+ onSplit,
+ onSplitMiddle,
+ multilineTag
+ } = _ref;
- let frame;
- let frames = comments(); // eslint-disable-next-line no-cond-assign
+ if (!onReplace || !onSplit) {
+ return;
+ }
- while (frame = keyframe()) {
- frames.push(frame);
- frames = frames.concat(comments());
- }
+ 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.
- if (!close()) {
- return error("@keyframes missing '}'");
- }
+ 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.
- return pos({
- type: 'keyframes',
- name,
- vendor,
- keyframes: frames
- });
+ if (!hasPastedBlocks || !(0,external_wp_richText_namespaceObject.isEmpty)(before)) {
+ blocks.push(onSplit((0,external_wp_richText_namespaceObject.toHTMLString)({
+ value: before,
+ multilineTag
+ }), !isAfterOriginal));
+ lastPastedBlockIndex += 1;
}
- /**
- * Parse supports.
- */
-
- function atsupports() {
- const pos = position();
- const m = match(/^@supports *([^{]+)/);
-
- if (!m) {
- return;
- }
+ 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.
- const supports = trim(m[1]);
- if (!open()) {
- return error("@supports missing '{'");
- }
+ 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 style = comments().concat(rules());
- if (!close()) {
- return error("@supports missing '}'");
- }
+ 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.
- return pos({
- type: 'supports',
- supports,
- rules: style
- });
- }
- /**
- * Parse host.
- */
+ 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
+ */
- function athost() {
- const pos = position();
- const m = match(/^@host\s*/);
- if (!m) {
- return;
- }
- if (!open()) {
- return error("@host missing '{'");
- }
- const style = comments().concat(rules());
- if (!close()) {
- return error("@host missing '}'");
- }
- return pos({
- type: 'host',
- rules: style
- });
- }
- /**
- * Parse media.
- */
+/**
+ * Internal dependencies
+ */
- function atmedia() {
- const pos = position();
- const m = match(/^@media *([^{]+)/);
- if (!m) {
- return;
- }
- const media = trim(m[1]);
+/** @typedef {import('@wordpress/rich-text').RichTextValue} RichTextValue */
- if (!open()) {
- return error("@media missing '{'");
- }
+/**
+ * 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.
+ */
- const style = comments().concat(rules());
+function adjustLines(value, isMultiline) {
+ if (isMultiline) {
+ return (0,external_wp_richText_namespaceObject.replace)(value, /\n+/g, external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR);
+ }
- if (!close()) {
- return error("@media missing '}'");
- }
+ return (0,external_wp_richText_namespaceObject.replace)(value, new RegExp(external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR, 'g'), '\n');
+}
- return pos({
- type: 'media',
- media,
- rules: style
- });
- }
- /**
- * Parse custom-media.
- */
+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;
+ }
- function atcustommedia() {
- const pos = position();
- const m = match(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);
+ 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.
- if (!m) {
- return;
- }
+ 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.
- return pos({
- type: 'custom-media',
- name: trim(m[1]),
- media: trim(m[2])
- });
- }
- /**
- * Parse paged media.
- */
+ html = removeWindowsFragments(html); // Strip meta tag.
- function atpage() {
- const pos = position();
- const m = match(/^@page */);
+ html = removeCharsetMetaTag(html);
+ event.preventDefault(); // Allows us to ask for this information when we get a report.
- if (!m) {
- return;
- }
+ window.console.log('Received HTML:\n\n', html);
+ window.console.log('Received plain text:\n\n', plainText);
- const sel = selector() || [];
+ if (disableFormats) {
+ onChange((0,external_wp_richText_namespaceObject.insert)(value, plainText));
+ return;
+ }
- if (!open()) {
- return error("@page missing '{'");
- }
+ const transformed = formatTypes.reduce((accumlator, _ref) => {
+ let {
+ __unstablePasteRule
+ } = _ref;
- let decls = comments(); // declarations
+ // Only allow one transform.
+ if (__unstablePasteRule && accumlator === value) {
+ accumlator = __unstablePasteRule(value, {
+ html,
+ plainText
+ });
+ }
- let decl; // eslint-disable-next-line no-cond-assign
+ return accumlator;
+ }, value);
- while (decl = declaration()) {
- decls.push(decl);
- decls = decls.concat(comments());
- }
+ if (transformed !== value) {
+ onChange(transformed);
+ return;
+ }
- if (!close()) {
- return error("@page missing '}'");
- }
+ 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.
- return pos({
- type: 'page',
- selectors: sel,
- declarations: decls
- });
- }
- /**
- * Parse document.
- */
+ 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.
- function atdocument() {
- const pos = position();
- const m = match(/^@([-\w]+)?document *([^{]+)/);
- if (!m) {
- return;
- }
+ 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
- const vendor = trim(m[1]);
- const doc = trim(m[2]);
+ window.console.log('Received items:\n\n', files);
- if (!open()) {
- return error("@document missing '{'");
- }
+ if (onReplace && (0,external_wp_richText_namespaceObject.isEmpty)(value)) {
+ onReplace(content);
+ } else {
+ splitValue({
+ value,
+ pastedBlocks: content,
+ onReplace,
+ onSplit,
+ onSplitMiddle,
+ multilineTag
+ });
+ }
- const style = comments().concat(rules());
+ return;
+ }
- if (!close()) {
- return error("@document missing '}'");
- }
+ 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.
- return pos({
- type: 'document',
- document: doc,
- vendor,
- rules: style
- });
- }
- /**
- * Parse font-face.
- */
+ 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';
+ }
- function atfontface() {
- const pos = position();
- const m = match(/^@font-face\s*/);
+ const content = (0,external_wp_blocks_namespaceObject.pasteHandler)({
+ HTML: html,
+ plainText,
+ mode,
+ tagName,
+ preserveWhiteSpace
+ });
- if (!m) {
- return;
- }
+ 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.
- if (!open()) {
- return error("@font-face missing '{'");
+ 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
+ });
+ }
+ }
}
- let decls = comments(); // declarations
+ 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
+ */
- let decl; // eslint-disable-next-line no-cond-assign
+function removeWindowsFragments(html) {
+ const startReg = /.*<!--StartFragment-->/s;
+ const endReg = /<!--EndFragment-->.*/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
+ */
- while (decl = declaration()) {
- decls.push(decl);
- decls = decls.concat(comments());
- }
- if (!close()) {
- return error("@font-face missing '}'");
- }
+function removeCharsetMetaTag(html) {
+ const metaTag = `<meta charset='utf-8'>`;
- return pos({
- type: 'font-face',
- declarations: decls
- });
+ if (html.startsWith(metaTag)) {
+ return html.slice(metaTag.length);
}
- /**
- * Parse import
- */
+ return html;
+}
- const atimport = _compileAtrule('import');
- /**
- * Parse charset
- */
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-input-rules.js
+/**
+ * WordPress dependencies
+ */
- const atcharset = _compileAtrule('charset');
- /**
- * Parse namespace
- */
- const atnamespace = _compileAtrule('namespace');
- /**
- * Parse non-block at-rules
- */
+/**
+ * Internal dependencies
+ */
- function _compileAtrule(name) {
- const re = new RegExp('^@' + name + '\\s*([^;]+);');
- return function () {
- const pos = position();
- const m = match(re);
- if (!m) {
+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 ret = {
- type: name
- };
- ret[name] = m[1].trim();
- return pos(ret);
- };
- }
- /**
- * Parse at rule.
- */
-
+ const {
+ start,
+ text
+ } = value;
+ const characterBefore = text.slice(start - 1, start); // The character right before the caret must be a plain space.
- function atrule() {
- if (css[0] !== '@') {
- return;
- }
+ if (characterBefore !== ' ') {
+ return;
+ }
- return atkeyframes() || atmedia() || atcustommedia() || atsupports() || atimport() || atcharset() || atnamespace() || atdocument() || atpage() || athost() || atfontface();
- }
- /**
- * Parse rule.
- */
+ 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;
+ }
- function rule() {
- const pos = position();
- const sel = selector();
+ 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]);
- if (!sel) {
- return error('selector missing');
+ __unstableMarkAutomaticChange();
}
- comments();
- return pos({
- type: 'rule',
- selectors: sel,
- declarations: declarations()
- });
- }
-
- return addParent(stylesheet());
-});
-/**
- * Trim `str`.
- */
-
-function trim(str) {
- return str ? str.replace(/^\s+|\s+$/g, '') : '';
-}
-/**
- * Adds non-enumerable parent node reference to each node.
- */
-
+ function onInput(event) {
+ const {
+ inputType,
+ type
+ } = event;
+ const {
+ value,
+ onChange,
+ __unstableAllowPrefixTransformations,
+ formatTypes
+ } = propsRef.current; // Only run input rules when inserting text.
-function addParent(obj, parent) {
- const isNode = obj && typeof obj.type === 'string';
- const childParent = isNode ? obj : parent;
+ if (inputType !== 'insertText' && type !== 'compositionend') {
+ return;
+ }
- for (const k in obj) {
- const value = obj[k];
+ if (__unstableAllowPrefixTransformations && inputRule) {
+ inputRule();
+ }
- if (Array.isArray(value)) {
- value.forEach(function (v) {
- addParent(v, childParent);
- });
- } else if (value && typeof value === 'object') {
- addParent(value, childParent);
- }
- }
+ const transformed = formatTypes.reduce((accumlator, _ref3) => {
+ let {
+ __unstableInputRule
+ } = _ref3;
- if (isNode) {
- Object.defineProperty(obj, 'parent', {
- configurable: true,
- writable: true,
- enumerable: false,
- value: parent || null
- });
- }
+ if (__unstableInputRule) {
+ accumlator = __unstableInputRule(accumlator);
+ }
- return obj;
-}
-/* eslint-enable @wordpress/no-unused-vars-before-return */
+ return accumlator;
+ }, value);
-// EXTERNAL MODULE: ./node_modules/inherits/inherits_browser.js
-var inherits_browser = __webpack_require__("P7XM");
-var inherits_browser_default = /*#__PURE__*/__webpack_require__.n(inherits_browser);
+ if (transformed !== value) {
+ __unstableMarkLastChangeAsPersistent();
-// 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.
+ onChange({ ...transformed,
+ activeFormats: value.activeFormats
+ });
-/**
- * Expose `Compiler`.
- */
-/* harmony default export */ var stringify_compiler = (Compiler);
-/**
- * Initialize a compiler.
- */
+ __unstableMarkAutomaticChange();
+ }
+ }
-function Compiler(opts) {
- this.options = opts || {};
+ element.addEventListener('input', onInput);
+ element.addEventListener('compositionend', onInput);
+ return () => {
+ element.removeEventListener('input', onInput);
+ element.removeEventListener('compositionend', onInput);
+ };
+ }, []);
}
-/**
- * Emit `str`
- */
-
-Compiler.prototype.emit = function (str) {
- return str;
-};
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-enter.js
/**
- * Visit `node`.
+ * WordPress dependencies
*/
-
-Compiler.prototype.visit = function (node) {
- return this[node.type](node);
-};
/**
- * Map visit over array of `nodes`, optionally using a `delim`
+ * WordPress dependencies
*/
-Compiler.prototype.mapVisit = function (nodes, delim) {
- let buf = '';
- delim = delim || '';
-
- for (let i = 0, length = nodes.length; i < length; i++) {
- buf += this.visit(nodes[i]);
-
- if (delim && i < length - 1) {
- buf += this.emit(delim);
- }
- }
- return buf;
-};
-// 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.
-/**
- * External dependencies
- */
/**
* Internal dependencies
*/
-/**
- * Expose compiler.
- */
-/* harmony default export */ var compress = (compress_Compiler);
-/**
- * Initialize a new `Compiler`.
- */
+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;
+ }
-function compress_Compiler(options) {
- stringify_compiler.call(this, options);
-}
-/**
- * Inherit from `Base.prototype`.
- */
+ const {
+ removeEditorOnlyFormats,
+ value,
+ onReplace,
+ onSplit,
+ onSplitMiddle,
+ multilineTag,
+ onChange,
+ disableLineBreaks,
+ onSplitAtEnd
+ } = propsRef.current;
+ if (event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) {
+ return;
+ }
-inherits_browser_default()(compress_Compiler, stringify_compiler);
-/**
- * Compile `node`.
- */
+ event.preventDefault();
+ const _value = { ...value
+ };
+ _value.formats = removeEditorOnlyFormats(value);
+ const canSplit = onReplace && onSplit;
-compress_Compiler.prototype.compile = function (node) {
- return node.stylesheet.rules.map(this.visit, this).join('');
-};
-/**
- * Visit comment node.
- */
+ 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
+ })]);
-compress_Compiler.prototype.comment = function (node) {
- return this.emit('', node.position);
-};
-/**
- * Visit import node.
- */
+ __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;
-compress_Compiler.prototype.import = function (node) {
- return this.emit('@import ' + node.import + ';', node.position);
-};
-/**
- * Visit media node.
- */
+ 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);
+ };
+ }, []);
+}
-compress_Compiler.prototype.media = function (node) {
- return this.emit('@media ' + node.media, node.position) + this.emit('{') + this.mapVisit(node.rules) + this.emit('}');
-};
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-format-types.js
/**
- * Visit document node.
+ * WordPress dependencies
*/
-compress_Compiler.prototype.document = function (node) {
- const doc = '@' + (node.vendor || '') + 'document ' + node.document;
- return this.emit(doc, node.position) + this.emit('{') + this.mapVisit(node.rules) + this.emit('}');
-};
/**
- * Visit charset node.
+ * Internal dependencies
*/
-compress_Compiler.prototype.charset = function (node) {
- return this.emit('@charset ' + node.charset + ';', node.position);
-};
+
+function formatTypesSelector(select) {
+ return select(external_wp_richText_namespaceObject.store).getFormatTypes();
+}
/**
- * Visit namespace node.
+ * Set of all interactive content tags.
+ *
+ * @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content
*/
-compress_Compiler.prototype.namespace = function (node) {
- return this.emit('@namespace ' + node.namespace + ';', node.position);
-};
+const interactiveContentTags = new Set(['a', 'audio', 'button', 'details', 'embed', 'iframe', 'input', 'label', 'select', 'textarea', 'video']);
/**
- * Visit supports node.
+ * 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;
-compress_Compiler.prototype.supports = function (node) {
- return this.emit('@supports ' + node.supports, node.position) + this.emit('{') + this.mapVisit(node.rules) + this.emit('}');
-};
-/**
- * Visit keyframes node.
- */
+ if (allowedFormats && !allowedFormats.includes(name)) {
+ return false;
+ }
+ if (withoutInteractiveFormatting && interactiveContentTags.has(tagName)) {
+ return false;
+ }
-compress_Compiler.prototype.keyframes = function (node) {
- return this.emit('@' + (node.vendor || '') + 'keyframes ' + node.name, node.position) + this.emit('{') + this.mapVisit(node.keyframes) + this.emit('}');
-};
-/**
- * Visit keyframe node.
- */
+ 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];
-compress_Compiler.prototype.keyframe = function (node) {
- const decls = node.declarations;
- return this.emit(node.values.join(','), node.position) + this.emit('{') + this.mapVisit(decls) + this.emit('}');
-};
-/**
- * Visit page node.
- */
+ const handler = type.__experimentalCreatePrepareEditableTree(selected, {
+ richTextIdentifier: identifier,
+ blockClientId: clientId
+ });
+ if (type.__experimentalCreateOnChangeEditableValue) {
+ valueHandlers.push(handler);
+ } else {
+ prepareHandlers.push(handler);
+ }
-compress_Compiler.prototype.page = function (node) {
- const sel = node.selectors.length ? node.selectors.join(', ') : '';
- return this.emit('@page ' + sel, node.position) + this.emit('{') + this.mapVisit(node.declarations) + this.emit('}');
-};
-/**
- * Visit font-face node.
- */
+ for (const key in selected) {
+ dependencies.push(selected[key]);
+ }
+ }
+ if (type.__experimentalCreateOnChangeEditableValue) {
+ let dispatchers = {};
-compress_Compiler.prototype['font-face'] = function (node) {
- return this.emit('@font-face', node.position) + this.emit('{') + this.mapVisit(node.declarations) + this.emit('}');
-};
-/**
- * Visit host node.
- */
+ 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
+ };
+}
-compress_Compiler.prototype.host = function (node) {
- return this.emit('@host', node.position) + this.emit('{') + this.mapVisit(node.rules) + this.emit('}');
-};
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-remove-browser-shortcuts.js
/**
- * Visit custom-media node.
+ * WordPress dependencies
*/
-compress_Compiler.prototype['custom-media'] = function (node) {
- return this.emit('@custom-media ' + node.name + ' ' + node.media + ';', node.position);
-};
/**
- * Visit rule node.
+ * 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();
+ }
+ }
-compress_Compiler.prototype.rule = function (node) {
- const decls = node.declarations;
-
- if (!decls.length) {
- return '';
- }
+ node.addEventListener('keydown', onKeydown);
+ return () => {
+ node.addEventListener('keydown', onKeydown);
+ };
+ }, []);
+}
- return this.emit(node.selectors.join(','), node.position) + this.emit('{') + this.mapVisit(decls) + this.emit('}');
-};
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-shortcuts.js
/**
- * Visit declaration node.
+ * WordPress dependencies
*/
+function useShortcuts(keyboardShortcuts) {
+ return (0,external_wp_compose_namespaceObject.useRefEffect)(element => {
+ function onKeyDown(event) {
+ for (const keyboardShortcut of keyboardShortcuts.current) {
+ keyboardShortcut(event);
+ }
+ }
-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
-/* eslint-disable @wordpress/no-unused-vars-before-return */
-// Adapted from https://github.com/reworkcss/css
-// because we needed to remove source map support.
+ 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
/**
- * External dependencies
+ * WordPress dependencies
*/
-/**
- * Internal 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
-/**
- * Expose compiler.
- */
-/* harmony default export */ var identity = (identity_Compiler);
/**
- * Initialize a new `Compiler`.
+ * WordPress dependencies
*/
-function identity_Compiler(options) {
- options = options || {};
- stringify_compiler.call(this, options);
- this.indentation = options.indent;
-}
/**
- * Inherit from `Base.prototype`.
+ * External dependencies
*/
-inherits_browser_default()(identity_Compiler, stringify_compiler);
-/**
- * Compile `node`.
- */
+function FormatEdit(_ref) {
+ let {
+ formatTypes,
+ onChange,
+ onFocus,
+ value,
+ forwardedRef
+ } = _ref;
+ return formatTypes.map(settings => {
+ const {
+ name,
+ edit: Edit
+ } = settings;
-identity_Compiler.prototype.compile = function (node) {
- return this.stylesheet(node);
-};
-/**
- * Visit stylesheet node.
- */
+ 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.
-identity_Compiler.prototype.stylesheet = function (node) {
- return this.mapVisit(node.stylesheet.rules, '\n\n');
-};
-/**
- * Visit comment node.
- */
+ 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;
+ }
+ }
-identity_Compiler.prototype.comment = function (node) {
- return this.emit(this.indent() + '/*' + node.comment + '*/', node.position);
-};
-/**
- * Visit import node.
- */
+ 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
-identity_Compiler.prototype.import = function (node) {
- return this.emit('@import ' + node.import + ';', node.position);
-};
-/**
- * Visit media node.
- */
-identity_Compiler.prototype.media = function (node) {
- return this.emit('@media ' + node.media, node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(node.rules, '\n\n') + this.emit(this.indent(-1) + '\n}');
-};
/**
- * Visit document node.
+ * External dependencies
*/
-identity_Compiler.prototype.document = function (node) {
- const doc = '@' + (node.vendor || '') + 'document ' + node.document;
- return this.emit(doc, node.position) + this.emit(' ' + ' {\n' + this.indent(1)) + this.mapVisit(node.rules, '\n\n') + this.emit(this.indent(-1) + '\n}');
-};
/**
- * Visit charset node.
+ * WordPress dependencies
*/
-identity_Compiler.prototype.charset = function (node) {
- return this.emit('@charset ' + node.charset + ';', node.position);
-};
-/**
- * Visit namespace node.
- */
-identity_Compiler.prototype.namespace = function (node) {
- return this.emit('@namespace ' + node.namespace + ';', node.position);
-};
-/**
- * Visit supports node.
- */
-identity_Compiler.prototype.supports = function (node) {
- return this.emit('@supports ' + node.supports, node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(node.rules, '\n\n') + this.emit(this.indent(-1) + '\n}');
-};
-/**
- * Visit keyframes node.
- */
-identity_Compiler.prototype.keyframes = function (node) {
- return this.emit('@' + (node.vendor || '') + 'keyframes ' + node.name, node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(node.keyframes, '\n') + this.emit(this.indent(-1) + '}');
-};
+
/**
- * Visit keyframe node.
+ * Internal dependencies
*/
-identity_Compiler.prototype.keyframe = function (node) {
- const decls = node.declarations;
- return this.emit(this.indent()) + this.emit(node.values.join(', '), node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(decls, '\n') + this.emit(this.indent(-1) + '\n' + this.indent() + '}\n');
-};
-/**
- * Visit page node.
- */
-identity_Compiler.prototype.page = function (node) {
- const sel = node.selectors.length ? node.selectors.join(', ') + ' ' : '';
- return this.emit('@page ' + sel, node.position) + this.emit('{\n') + this.emit(this.indent(1)) + this.mapVisit(node.declarations, '\n') + this.emit(this.indent(-1)) + this.emit('\n}');
-};
-/**
- * Visit font-face node.
- */
-identity_Compiler.prototype['font-face'] = function (node) {
- return this.emit('@font-face ', node.position) + this.emit('{\n') + this.emit(this.indent(1)) + this.mapVisit(node.declarations, '\n') + this.emit(this.indent(-1)) + this.emit('\n}');
-};
-/**
- * Visit host node.
- */
-identity_Compiler.prototype.host = function (node) {
- return this.emit('@host', node.position) + this.emit(' {\n' + this.indent(1)) + this.mapVisit(node.rules, '\n\n') + this.emit(this.indent(-1) + '\n}');
-};
-/**
- * Visit custom-media node.
- */
-identity_Compiler.prototype['custom-media'] = function (node) {
- return this.emit('@custom-media ' + node.name + ' ' + node.media + ';', node.position);
-};
-/**
- * Visit rule node.
- */
-identity_Compiler.prototype.rule = function (node) {
- const indent = this.indent();
- const decls = node.declarations;
- if (!decls.length) {
- return '';
- }
- return this.emit(node.selectors.map(function (s) {
- return indent + s;
- }).join(',\n'), node.position) + this.emit(' {\n') + this.emit(this.indent(1)) + this.mapVisit(decls, '\n') + this.emit(this.indent(-1)) + this.emit('\n' + this.indent() + '}');
-};
-/**
- * Visit declaration node.
- */
-identity_Compiler.prototype.declaration = function (node) {
- return this.emit(this.indent()) + this.emit(node.property + ': ' + node.value, node.position) + this.emit(';');
-};
+
+const keyboardShortcutContext = (0,external_wp_element_namespaceObject.createContext)();
+const inputEventContext = (0,external_wp_element_namespaceObject.createContext)();
/**
- * Increase, decrease or return current indentation.
+ * 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']);
+}
-identity_Compiler.prototype.indent = function (level) {
- this.level = this.level || 1;
-
- if (null !== level) {
- this.level += level;
- return '';
- }
-
- return Array(this.level).join(this.indentation || ' ');
-};
-/* eslint-enable @wordpress/no-unused-vars-before-return */
+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();
-// 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.
+ const selector = select => {
+ const {
+ getSelectionStart,
+ getSelectionEnd,
+ isMultiSelecting,
+ hasMultiSelection
+ } = select(store);
+ const selectionStart = getSelectionStart();
+ const selectionEnd = getSelectionEnd();
+ let isSelected;
-/**
- * Internal dependencies
- */
+ 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.
-/**
- * Stringfy the given AST `node`.
- *
- * Options:
- *
- * - `compress` space-optimized output
- * - `sourcemap` return an object with `.code` and `.map`
- *
- * @param {Object} node
- * @param {Object} [options]
- * @return {string}
- */
-/* harmony default export */ var stringify = (function (node, options) {
- options = options || {};
- const compiler = options.compress ? new compress(options) : new identity(options);
- const code = compiler.compile(node);
- return code;
-});
+ 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.
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/traverse.js
-/**
- * External dependencies
- */
+ if (Array.isArray(originalValue)) {
+ adjustedValue = external_wp_blocks_namespaceObject.children.toHTML(originalValue);
-/**
- * Internal dependencies
- */
+ 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 traverseCSS(css, callback) {
- try {
- const parsed = parse(css);
- const updated = traverse_default.a.map(parsed, function (node) {
- if (!node) {
- return node;
+ 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);
}
-
- const updatedNode = callback(node);
- return this.update(updatedNode);
});
- return stringify(updated);
- } catch (err) {
- // eslint-disable-next-line no-console
- console.warn('Error while traversing the CSS: ' + err);
- return null;
+ return value.formats;
}
-}
-/* harmony default export */ var transform_styles_traverse = (traverseCSS);
+ function addInvisibleFormats(value) {
+ return prepareHandlers.reduce((accumulator, fn) => fn(accumulator, value.text), value.formats);
+ }
-// 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.
- *
- * @param {string} filePath path
- *
- * @return {boolean} is remote path.
- */
-function isRemotePath(filePath) {
- return /^(?:https?:)?\/\//.test(filePath);
-}
-/**
- * Return `true` if the given filePath is an absolute url.
- *
- * @param {string} filePath path
- *
- * @return {boolean} is absolute path.
- */
+ 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);
+ });
+ },
-function isAbsolutePath(filePath) {
- return /^\/(?!\/)/.test(filePath);
-}
-/**
- * Whether or not the url should be inluded.
- *
- * @param {Object} meta url meta info
- *
- * @return {boolean} is valid.
- */
+ 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;
+ }
-function isValidURL(meta) {
- // ignore hashes or data uris
- if (meta.value.indexOf('data:') === 0 || meta.value.indexOf('#') === 0) {
- return false;
- }
+ 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 (isAbsolutePath(meta.value)) {
- return false;
- } // do not handle the http/https urls if `includeRemote` is false
+ if (onRemove && (0,external_wp_richText_namespaceObject.isEmpty)(value) && isReverse) {
+ onRemove(!isReverse);
+ }
- if (isRemotePath(meta.value)) {
- return false;
+ event.preventDefault();
+ }
}
- return true;
-}
-/**
- * Get the absolute path of the url, relative to the basePath
- *
- * @param {string} str the url
- * @param {string} baseURL base URL
- *
- * @return {string} the full path to the file
- */
-
+ function onFocus() {
+ anchorRef.current.focus();
+ }
-function getResourcePath(str, baseURL) {
- return new URL(str, baseURL).toString();
-}
-/**
- * Process the single `url()` pattern
- *
- * @param {string} baseURL the base URL for relative URLs.
- *
- * @return {Promise} the Promise.
- */
+ 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;
+ }
-function processURL(baseURL) {
- return meta => ({ ...meta,
- newUrl: 'url(' + meta.before + meta.quote + getResourcePath(meta.value, baseURL) + meta.quote + meta.after + ')'
+ 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);
}
-/**
- * Get all `url()`s, and return the meta info
- *
- * @param {string} value decl.value.
- *
- * @return {Array} the urls.
- */
-
-function getURLs(value) {
- const reg = /url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;
- let match;
- const URLs = [];
+const ForwardedRichTextContainer = (0,external_wp_element_namespaceObject.forwardRef)(RichTextWrapper);
- while ((match = reg.exec(value)) !== null) {
- const meta = {
- source: match[0],
- before: match[1],
- quote: match[2],
- value: match[3],
- after: match[4]
- };
+ForwardedRichTextContainer.Content = _ref3 => {
+ let {
+ value,
+ tagName: Tag,
+ multiline,
+ ...props
+ } = _ref3;
- if (isValidURL(meta)) {
- URLs.push(meta);
- }
+ // Handle deprecated `children` and `node` sources.
+ if (Array.isArray(value)) {
+ value = external_wp_blocks_namespaceObject.children.toHTML(value);
}
- return URLs;
-}
-/**
- * Replace the raw value's `url()` segment to the new value
- *
- * @param {string} raw the raw value.
- * @param {Array} URLs the URLs to replace.
- *
- * @return {string} the new value.
- */
+ const MultilineTag = getMultilineTag(multiline);
+ if (!value && MultilineTag) {
+ value = `<${MultilineTag}></${MultilineTag}>`;
+ }
-function replaceURLs(raw, URLs) {
- URLs.forEach(item => {
- raw = raw.replace(item.source, item.newUrl);
- });
- return raw;
-}
+ const content = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, value);
-const rewrite = rootURL => node => {
- if (node.type === 'declaration') {
- const updatedURLs = getURLs(node.value).map(processURL(rootURL));
- return { ...node,
- value: replaceURLs(node.value, updatedURLs)
- };
+ if (Tag) {
+ return (0,external_wp_element_namespaceObject.createElement)(Tag, (0,external_lodash_namespaceObject.omit)(props, ['format']), content);
}
- return node;
+ return content;
};
-/* harmony default export */ var url_rewrite = (rewrite);
-
-// 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.
- */
-const IS_ROOT_TAG = /^(body|html|:root).*$/;
+ForwardedRichTextContainer.isEmpty = value => {
+ return !value || value.length === 0;
+};
/**
- * Creates a callback to modify selectors so they only apply within a certain
- * namespace.
- *
- * @param {string} namespace Namespace to prefix selectors with.
- * @param {string[]} ignore Selectors to not prefix.
- *
- * @return {(node: Object) => Object} Callback to wrap selectors.
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md
*/
-const wrap = function (namespace) {
- let ignore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- return node => {
- /**
- * Updates selector if necessary.
- *
- * @param {string} selector Selector to modify.
- *
- * @return {string} Updated selector.
- */
- const updateSelector = selector => {
- if (ignore.includes(selector.trim())) {
- return selector;
- } // Anything other than a root tag is always prefixed.
+/* harmony default export */ var rich_text = (ForwardedRichTextContainer);
- {
- if (!selector.match(IS_ROOT_TAG)) {
- return namespace + ' ' + selector;
- }
- } // HTML and Body elements cannot be contained within our container so lets extract their styles.
- return selector.replace(/^(body|html|:root)/, namespace);
- };
- if (node.type === 'rule') {
- return { ...node,
- selectors: node.selectors.map(updateSelector)
- };
- }
- return node;
- };
-};
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/editable-text/index.js
-/* harmony default export */ var transforms_wrap = (wrap);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/index.js
-/**
- * External dependencies
- */
/**
* 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);
+};
/**
- * Applies a series of CSS rule transforms to wrap selectors inside a given class and/or rewrite URLs depending on the parameters passed.
- *
- * @param {Array} styles CSS rules.
- * @param {string} wrapperClassName Wrapper Class Name.
- * @return {Array} converted rules.
+ * Renders an editable text input in which text formatting is not allowed.
*/
-const transformStyles = function (styles) {
- let wrapperClassName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
- return Object(external_lodash_["map"])(styles, _ref => {
- let {
- css,
- baseURL
- } = _ref;
- const transforms = [];
-
- if (wrapperClassName) {
- transforms.push(transforms_wrap(wrapperClassName));
- }
-
- if (baseURL) {
- transforms.push(url_rewrite(baseURL));
- }
-
- if (transforms.length) {
- return transform_styles_traverse(css, Object(external_wp_compose_["compose"])(transforms));
- }
-
- return css;
- });
-};
-
-/* harmony default export */ var transform_styles = __webpack_exports__["a"] = (transformStyles);
-
-
-/***/ }),
-
-/***/ "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);
+/* harmony default export */ var editable_text = (EditableText);
-// EXTERNAL MODULE: external ["wp","i18n"]
-var external_wp_i18n_ = __webpack_require__("l3Sj");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/plain-text/index.js
-// 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
+/**
+ * External dependencies
+ */
/**
* 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
+ */
/**
- * WordPress dependencies
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/plain-text/README.md
*/
-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);
+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));
+ }
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/position-center.js
-var position_center = __webpack_require__("EpZT");
+ 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/icons/build-module/library/position-right.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/responsive-block-control/label.js
/**
* WordPress dependencies
*/
-const positionRight = 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 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"
-}));
-/* harmony default export */ var position_right = (positionRight);
-
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/stretch-wide.js
-var stretch_wide = __webpack_require__("beZb");
-// 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");
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/ui.js
+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
/**
@@ -47636,676 +43859,679 @@ var use_available_alignments = __webpack_require__("K/rC");
-
/**
* Internal dependencies
*/
-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) {
- let {
- value,
- onChange,
- controls,
- isToolbar,
- isCollapsed = true
- } = _ref;
- const enabledControls = Object(use_available_alignments["a" /* default */])(controls);
- const hasEnabledControls = !!enabledControls.length;
+function ResponsiveBlockControl(props) {
+ const {
+ title,
+ property,
+ toggleLabel,
+ onIsResponsiveChange,
+ renderDefaultControl,
+ renderResponsiveControls,
+ isResponsive = false,
+ defaultLabel = {
+ id: 'all',
- if (!hasEnabledControls) {
- return null;
- }
+ /* 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;
- function onChangeAlignment(align) {
- onChange([value, 'none'].includes(align) ? undefined : align);
+ if (!title || !property || !renderDefaultControl) {
+ return null;
}
- 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)
- };
- })
- } : {
- 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));
-}
-
-/* harmony default export */ var ui = (BlockAlignmentUI);
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/index.js
+ 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);
-/**
- * Internal dependencies
- */
+ 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)));
+ };
-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
- }));
+ 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);
-/***/ }),
-
-/***/ "w8sn":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"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/rich-text/shortcut.js
/**
* 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.
+ * Internal dependencies
*/
-function useLayout() {
- return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useContext"])(Layout);
-}
-function LayoutStyle(_ref) {
+
+function RichTextShortcut(_ref) {
let {
- layout = {},
- ...props
+ character,
+ type,
+ onUse
} = _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));
- }
+ 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
-/***/ }),
-
-/***/ "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);
+function RichTextToolbarButton(_ref) {
+ let {
+ name,
+ shortcutType,
+ shortcutCharacter,
+ ...props
+ } = _ref;
+ let shortcut;
+ let fillName = 'RichText.ToolbarControls';
-/***/ }),
+ if (name) {
+ fillName += `.${name}`;
+ }
-/***/ "wC17":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (shortcutType && shortcutCharacter) {
+ shortcut = external_wp_keycodes_namespaceObject.displayShortcut[shortcutType](shortcutCharacter);
+ }
-"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");
+ 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
*/
-/** @typedef {import('@wordpress/blocks').WPIcon} WPIcon */
-
-/**
- * Contains basic block's information for display reasons.
- *
- * @typedef {Object} WPBlockDisplayInformation
- *
- * @property {string} title Human-readable block type label.
- * @property {WPIcon} icon Block type icon.
- * @property {string} description A detailed block type description.
- */
-
-/**
- * Hook used to try to find a matching block variation and return
- * the appropriate information for display reasons. In order to
- * to try to find a match we need to things:
- * 1. Block's client id to extract it's current attributes.
- * 2. A block variation should have set `isActive` prop to a proper function.
- *
- * If for any reason a block variaton match cannot be found,
- * the returned information come from the Block Type.
- * If no blockType is found with the provided clientId, returns null.
- *
- * @param {string} clientId Block's client id.
- * @return {?WPBlockDisplayInformation} Block's display information, or `null` when the block or its type not found.
- */
+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();
+ }
+ }
-function useBlockDisplayInformation(clientId) {
- return Object(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["useSelect"])(select => {
- if (!clientId) return null;
- const {
- getBlockName,
- getBlockAttributes
- } = select(_store__WEBPACK_IMPORTED_MODULE_2__[/* store */ "a"]);
- const {
- getBlockType,
- getActiveBlockVariation
- } = select(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__["store"]);
- const blockName = getBlockName(clientId);
- const blockType = getBlockType(blockName);
- if (!blockType) return null;
- const attributes = getBlockAttributes(clientId);
- const match = getActiveBlockVariation(blockName, attributes);
- const blockTypeInfo = {
- title: blockType.title,
- icon: blockType.icon,
- description: blockType.description,
- anchor: attributes === null || attributes === void 0 ? void 0 : attributes.anchor
- };
- if (!match) return blockTypeInfo;
- return {
- title: match.title || blockType.title,
- icon: match.icon || blockType.icon,
- description: match.description || blockType.description
+ callbacks.current.add(callback);
+ return () => {
+ callbacks.current.delete(callback);
};
- }, [clientId]);
+ }, [inputType]);
+ return null;
}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/tool-selector/index.js
-/***/ }),
-/***/ "wJiJ":
-/***/ (function(module, exports, __webpack_require__) {
-module.exports = __webpack_require__("1K8p");
+/**
+ * WordPress dependencies
+ */
-/***/ }),
-/***/ "weEX":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-// EXPORTS
-__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ LineHeightControl; });
+/**
+ * Internal dependencies
+ */
-// EXTERNAL MODULE: external ["wp","element"]
-var external_wp_element_ = __webpack_require__("GRId");
-// EXTERNAL MODULE: external ["wp","i18n"]
-var external_wp_i18n_ = __webpack_require__("l3Sj");
+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"
+}));
-// EXTERNAL MODULE: external ["wp","components"]
-var external_wp_components_ = __webpack_require__("tI+e");
+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);
-// EXTERNAL MODULE: external ["wp","keycodes"]
-var external_wp_keycodes_ = __webpack_require__("RxS6");
+ const onSwitchMode = mode => {
+ setNavigationMode(mode === 'edit' ? false : true);
+ };
-// 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).
- */
+ 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.')))
+ });
+}
-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.
- */
+/* harmony default export */ var tool_selector = ((0,external_wp_element_namespaceObject.forwardRef)(ToolSelector));
-function isLineHeightDefined(lineHeight) {
- return lineHeight !== undefined && lineHeight !== RESET_VALUE;
-}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/unit-control/index.js
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/line-height-control/index.js
/**
* WordPress dependencies
*/
-
-
/**
* Internal dependencies
*/
-function LineHeightControl(_ref) {
+function UnitControl(_ref) {
let {
- value: lineHeight,
- onChange
+ units: unitsProp,
+ ...props
} = _ref;
- const isDefined = isLineHeightDefined(lineHeight);
-
- const handleOnKeyDown = event => {
- const {
- keyCode
- } = event;
-
- 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;
- }
-
- onChange(adjustedNextValue);
- };
-
- 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
- }));
+ 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));
}
-
-/***/ }),
-
-/***/ "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/icons/build-module/library/arrow-left.js
/**
* WordPress dependencies
*/
-/**
- * Internal 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
+ */
-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);
+/**
+ * Internal dependencies
+ */
-/***/ }),
-/***/ "wx14":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+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
+ };
+ }
-"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];
+ toggle() {
+ this.setState({
+ expanded: !this.state.expanded
+ });
+ }
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
+ submitLink(event) {
+ event.preventDefault();
+ this.toggle();
+ }
- return target;
- };
+ 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"
+ }))));
+ }
- return _extends.apply(this, arguments);
}
+/**
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-input/README.md
+ */
-/***/ }),
-/***/ "wzfx":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/* harmony default export */ var url_input_button = (URLInputButton);
-"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/icons/build-module/library/close.js
/**
* WordPress dependencies
*/
-const stack = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
+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"
-}, 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"
+}, (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 */ __webpack_exports__["a"] = (stack);
+/* 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
-/***/ }),
-
-/***/ "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");
+/**
+ * External dependencies
+ */
/**
* 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.
- */
+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"
+}));
-function LetterSpacingControl(_ref) {
+const ImageURLInputUI = _ref => {
let {
- value,
- onChange,
- __unstableInputWidth = '60px'
+ linkDestination,
+ onChangeUrl,
+ url,
+ mediaType = 'image',
+ mediaUrl,
+ mediaLink,
+ linkTarget,
+ linkClass,
+ rel
} = _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 [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);
});
- 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
+ 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.
-/***/ "xCFn":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (newRel !== currentRel) {
+ newRel = newRel.trim();
+ }
-"use strict";
+ if ((0,external_lodash_namespaceObject.isEmpty)(newRel)) {
+ newRel = undefined;
+ }
+ }
+ }
-// EXPORTS
-__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ WrappedBlockPopover; });
+ return newRel;
+ };
-// EXTERNAL MODULE: external ["wp","element"]
-var external_wp_element_ = __webpack_require__("GRId");
+ const getUpdatedLinkTargetSettings = value => {
+ const newLinkTarget = value ? '_blank' : undefined;
+ let updatedRel;
-// EXTERNAL MODULE: external "lodash"
-var external_lodash_ = __webpack_require__("YLtl");
+ if (!newLinkTarget && !rel) {
+ updatedRel = undefined;
+ } else {
+ updatedRel = removeNewTabRel(rel);
+ }
-// EXTERNAL MODULE: ./node_modules/classnames/index.js
-var classnames = __webpack_require__("TSYQ");
-var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
+ return {
+ linkTarget: newLinkTarget,
+ rel: updatedRel
+ };
+ };
-// EXTERNAL MODULE: external ["wp","blocks"]
-var external_wp_blocks_ = __webpack_require__("HSyU");
+ 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;
-// EXTERNAL MODULE: external ["wp","components"]
-var external_wp_components_ = __webpack_require__("tI+e");
+ if (autocompleteElement && autocompleteElement.contains(event.target)) {
+ return;
+ }
-// EXTERNAL MODULE: external ["wp","data"]
-var external_wp_data_ = __webpack_require__("1ZqX");
+ setIsOpen(false);
+ setUrlInput(null);
+ stopEditLink();
+ };
+ });
+ const onSubmitLinkChange = (0,external_wp_element_namespaceObject.useCallback)(() => {
+ return event => {
+ if (urlInput) {
+ var _getLinkDestinations$;
-// EXTERNAL MODULE: external ["wp","keyboardShortcuts"]
-var external_wp_keyboardShortcuts_ = __webpack_require__("hF7m");
+ // 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
+ });
+ }
-// EXTERNAL MODULE: external ["wp","compose"]
-var external_wp_compose_ = __webpack_require__("K9lf");
+ stopEditLink();
+ setUrlInput(null);
+ event.preventDefault();
+ };
+ });
+ const onLinkRemove = (0,external_wp_element_namespaceObject.useCallback)(() => {
+ onChangeUrl({
+ linkDestination: LINK_DESTINATION_NONE,
+ href: ''
+ });
+ });
-// EXTERNAL MODULE: external ["wp","dom"]
-var external_wp_dom_ = __webpack_require__("1CF3");
+ const getLinkDestinations = () => {
+ const linkDestinations = [{
+ linkDestination: LINK_DESTINATION_MEDIA,
+ title: (0,external_wp_i18n_namespaceObject.__)('Media File'),
+ url: mediaType === 'image' ? mediaUrl : undefined,
+ icon
+ }];
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
-var esm_extends = __webpack_require__("wx14");
+ 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"
+ }))
+ });
+ }
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/drag-handle.js
-var drag_handle = __webpack_require__("xN+R");
+ return linkDestinations;
+ };
-// EXTERNAL MODULE: external ["wp","keycodes"]
-var external_wp_keycodes_ = __webpack_require__("RxS6");
+ const onSetHref = value => {
+ const linkDestinations = getLinkDestinations();
+ let linkDestinationInput;
-// EXTERNAL MODULE: external ["wp","a11y"]
-var external_wp_a11y_ = __webpack_require__("gdqT");
+ if (!value) {
+ linkDestinationInput = LINK_DESTINATION_NONE;
+ } else {
+ linkDestinationInput = ((0,external_lodash_namespaceObject.find)(linkDestinations, destination => {
+ return destination.url === value;
+ }) || {
+ linkDestination: LINK_DESTINATION_CUSTOM
+ }).linkDestination;
+ }
-// EXTERNAL MODULE: external ["wp","i18n"]
-var external_wp_i18n_ = __webpack_require__("l3Sj");
+ onChangeUrl({
+ linkDestination: linkDestinationInput,
+ href: value
+ });
+ };
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-title/index.js
-var block_title = __webpack_require__("f8JO");
+ const onSetNewTab = value => {
+ const updatedLinkTarget = getUpdatedLinkTargetSettings(value);
+ onChangeUrl(updatedLinkTarget);
+ };
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-icon/index.js
-var block_icon = __webpack_require__("7SSY");
+ const onSetLinkRel = value => {
+ onChangeUrl({
+ rel: value
+ });
+ };
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js + 4 modules
-var store = __webpack_require__("BhPs");
+ const onSetLinkClass = value => {
+ onChangeUrl({
+ linkClass: value
+ });
+ };
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/index.js + 1 modules
-var block_draggable = __webpack_require__("ZAjO");
+ 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
+ }))));
+};
-// 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/preview-options/index.js
/**
@@ -48320,253 +44546,162 @@ var use_block_display_information = __webpack_require__("wC17");
+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
/**
- * Internal dependencies
+ * WordPress dependencies
*/
-
-
-
-
-
/**
- * Block selection button component, displaying the label of the block. If the block
- * descends from a root block, a button is displayed enabling the user to select
- * the root block.
+ * Function to resize the editor window.
*
- * @param {string} props Component props.
- * @param {string} props.clientId Client ID of block.
+ * @param {string} deviceType Used for determining the size of the container (e.g. Desktop, Tablet, Mobile)
*
- * @return {WPComponent} The component to be rendered.
+ * @return {Object} Inline styles to be added to resizable container.
*/
-function BlockSelectionButton(_ref) {
- let {
- clientId,
- rootClientId,
- blockElement
- } = _ref;
- const blockInformation = Object(use_block_display_information["a" /* default */])(clientId);
- const selected = Object(external_wp_data_["useSelect"])(select => {
- var _getBlockListSettings;
-
- const {
- getBlock,
- getBlockIndex,
- hasBlockMovingClientId,
- getBlockListSettings
- } = select(store["a" /* store */]);
- const index = getBlockIndex(clientId);
- const {
- name,
- attributes
- } = getBlock(clientId);
- const blockMovingMode = hasBlockMovingClientId();
- return {
- index,
- name,
- attributes,
- blockMovingMode,
- orientation: (_getBlockListSettings = getBlockListSettings(rootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation
- };
- }, [clientId, rootClientId]);
- const {
- index,
- name,
- attributes,
- blockMovingMode,
- orientation
- } = selected;
- 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.
-
- Object(external_wp_element_["useEffect"])(() => {
- ref.current.focus();
- Object(external_wp_a11y_["speak"])(label);
- }, [label]);
- const {
- hasBlockMovingClientId,
- getBlockIndex,
- getBlockRootClientId,
- getClientIdsOfDescendants,
- getSelectedBlockClientId,
- getMultiSelectedBlocksEndClientId,
- getPreviousBlockClientId,
- getNextBlockClientId,
- isNavigationMode
- } = Object(external_wp_data_["useSelect"])(store["a" /* store */]);
- const {
- selectBlock,
- clearSelectedBlock,
- setBlockMovingClientId,
- moveBlockToPosition
- } = Object(external_wp_data_["useDispatch"])(store["a" /* 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 isShift = event.shiftKey;
-
- if (keyCode === external_wp_keycodes_["BACKSPACE"] || keyCode === external_wp_keycodes_["DELETE"]) {
- removeBlock(clientId);
- event.preventDefault();
+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 selectedBlockClientId = getSelectedBlockClientId();
- const selectionEndClientId = getMultiSelectedBlocksEndClientId();
- const selectionBeforeEndClientId = getPreviousBlockClientId(selectionEndClientId || selectedBlockClientId);
- const selectionAfterEndClientId = getNextBlockClientId(selectionEndClientId || selectedBlockClientId);
- const navigateUp = isTab && isShift || isUp;
- const navigateDown = isTab && !isShift || isDown; // Move out of current nesting level (no effect if at root level).
+ const resizeListener = () => updateActualWidth(window.innerWidth);
- const navigateOut = isLeft; // Move into next nesting level (no effect if the current block has no innerBlocks).
+ window.addEventListener('resize', resizeListener);
+ return () => {
+ window.removeEventListener('resize', resizeListener);
+ };
+ }, [deviceType]);
- const navigateIn = isRight;
- let focusedBlockUid;
+ const getCanvasWidth = device => {
+ let deviceWidth;
- if (navigateUp) {
- focusedBlockUid = selectionBeforeEndClientId;
- } else if (navigateDown) {
- focusedBlockUid = selectionAfterEndClientId;
- } else if (navigateOut) {
- var _getBlockRootClientId;
+ switch (device) {
+ case 'Tablet':
+ deviceWidth = 780;
+ break;
- focusedBlockUid = (_getBlockRootClientId = getBlockRootClientId(selectedBlockClientId)) !== null && _getBlockRootClientId !== void 0 ? _getBlockRootClientId : selectedBlockClientId;
- } else if (navigateIn) {
- var _getClientIdsOfDescen;
+ case 'Mobile':
+ deviceWidth = 360;
+ break;
- focusedBlockUid = (_getClientIdsOfDescen = getClientIdsOfDescendants([selectedBlockClientId])[0]) !== null && _getClientIdsOfDescen !== void 0 ? _getClientIdsOfDescen : selectedBlockClientId;
+ default:
+ return null;
}
- const startingBlockClientId = hasBlockMovingClientId();
-
- if (isEscape && isNavigationMode()) {
- clearSelectedBlock();
- event.preventDefault();
- }
+ return deviceWidth < actualWidth ? deviceWidth : actualWidth;
+ };
- if (isEscape && startingBlockClientId && !event.defaultPrevented) {
- setBlockMovingClientId(null);
- event.preventDefault();
- }
+ const marginValue = () => window.innerHeight < 800 ? 36 : 72;
- if ((isEnter || isSpace) && startingBlockClientId) {
- const sourceRoot = getBlockRootClientId(startingBlockClientId);
- const destRoot = getBlockRootClientId(selectedBlockClientId);
- const sourceBlockIndex = getBlockIndex(startingBlockClientId);
- let destinationBlockIndex = getBlockIndex(selectedBlockClientId);
+ const contentInlineStyles = device => {
+ const height = device === 'Mobile' ? '768px' : '1024px';
- if (sourceBlockIndex < destinationBlockIndex && sourceRoot === destRoot) {
- destinationBlockIndex -= 1;
- }
+ 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'
+ };
- moveBlockToPosition(startingBlockClientId, sourceRoot, destRoot, destinationBlockIndex);
- selectBlock(startingBlockClientId);
- setBlockMovingClientId(null);
+ default:
+ return null;
}
+ };
- if (navigateDown || navigateUp || navigateOut || navigateIn) {
- if (focusedBlockUid) {
- event.preventDefault();
- selectBlock(focusedBlockUid);
- } else if (isTab && selectedBlockClientId) {
- let nextTabbable;
+ return contentInlineStyles(deviceType);
+}
- if (navigateDown) {
- nextTabbable = external_wp_dom_["focus"].tabbable.findNext(blockElement);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/skip-to-selected-block/index.js
- if (!nextTabbable) {
- nextTabbable = blockElement.ownerDocument.defaultView.frameElement;
- nextTabbable = external_wp_dom_["focus"].tabbable.findNext(nextTabbable);
- }
- } else {
- nextTabbable = external_wp_dom_["focus"].tabbable.findPrevious(blockElement);
- }
- if (nextTabbable) {
- event.preventDefault();
- nextTabbable.focus();
- clearSelectedBlock();
- }
- }
- }
- }
+/**
+ * WordPress dependencies
+ */
- const classNames = classnames_default()('block-editor-block-list__block-selection-button', {
- 'is-block-moving-mode': !!blockMovingMode
- });
- const dragHandleLabel = Object(external_wp_i18n_["__"])('Drag');
- return Object(external_wp_element_["createElement"])("div", {
- className: classNames
- }, Object(external_wp_element_["createElement"])(external_wp_components_["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 */], {
- 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 */], {
- clientIds: [clientId]
- }, draggableProps => Object(external_wp_element_["createElement"])(external_wp_components_["Button"], Object(esm_extends["a" /* default */])({
- icon: drag_handle["a" /* default */],
- 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"], {
- ref: ref,
- onClick: () => setNavigationMode(false),
- onKeyDown: onKeyDown,
- label: label,
- className: "block-selection-button_select-button"
- }, Object(external_wp_element_["createElement"])(block_title["a" /* default */], {
- clientId: clientId
- })))));
-}
+/**
+ * Internal dependencies
+ */
-/* 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");
-// 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");
+const SkipToSelectedBlock = _ref => {
+ let {
+ selectedBlockClientId
+ } = _ref;
+ const ref = useBlockRef(selectedBlockClientId);
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/use-popover-scroll.js
-var use_popover_scroll = __webpack_require__("2z9l");
+ const onClick = () => {
+ ref.current.focus();
+ };
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-tools/block-popover.js
+ 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));
-/**
- * External dependencies
- */
+;// 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
/**
@@ -48577,9 +44712,6 @@ var use_popover_scroll = __webpack_require__("2z9l");
-
-
-
/**
* Internal dependencies
*/
@@ -48587,378 +44719,414 @@ var use_popover_scroll = __webpack_require__("2z9l");
-
-
-
-
-function selector(select) {
- const {
- isNavigationMode,
- isMultiSelecting,
- hasMultiSelection,
- isTyping,
- isCaretWithinFormattedText,
- getSettings,
- getLastMultiSelectedBlockClientId
- } = select(store["a" /* store */]);
- return {
- isNavigationMode: isNavigationMode(),
- isMultiSelecting: isMultiSelecting(),
- isTyping: isTyping(),
- isCaretWithinFormattedText: isCaretWithinFormattedText(),
- hasMultiSelection: hasMultiSelection(),
- hasFixedToolbar: getSettings().hasFixedToolbar,
- lastClientId: getLastMultiSelectedBlockClientId()
- };
-}
-
-function BlockPopover(_ref) {
+function MultiSelectionInspector(_ref) {
let {
- clientId,
- rootClientId,
- isValid,
- isEmptyDefaultBlock,
- capturingClientId,
- __unstablePopoverSlot,
- __unstableContentRef
+ blocks
} = _ref;
- const {
- isNavigationMode,
- isMultiSelecting,
- isTyping,
- isCaretWithinFormattedText,
- hasMultiSelection,
- hasFixedToolbar,
- lastClientId
- } = Object(external_wp_data_["useSelect"])(selector, []);
- const isInsertionPointVisible = Object(external_wp_data_["useSelect"])(select => {
- const {
- isBlockInsertionPointVisible,
- getBlockInsertionPoint,
- getBlockOrder
- } = select(store["a" /* store */]);
-
- if (!isBlockInsertionPointVisible()) {
- return false;
- }
+ 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))));
+}
- const insertionPoint = getBlockInsertionPoint();
- 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);
+/* harmony default export */ var multi_selection_inspector = ((0,external_wp_data_namespaceObject.withSelect)(select => {
const {
- stopTyping
- } = Object(external_wp_data_["useDispatch"])(store["a" /* 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', () => {
- setIsToolbarForced(true);
- stopTyping(true);
- }, {
- isDisabled: !canFocusHiddenToolbar
- });
- Object(external_wp_element_["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);
-
- if (!shouldShowBreadcrumb && !shouldShowContextualToolbar && !isToolbarForced && !showEmptyBlockSideInserter) {
- return null;
- }
-
- let node = selectedElement;
-
- if (!node) {
- return null;
- }
-
- if (capturingClientId) {
- node = capturingElement;
- }
-
- let anchorRef = node;
-
- if (hasMultiSelection) {
- // Wait to render the popover until the bottom reference is available
- // as well.
- if (!lastSelectedElement) {
- return null;
- }
-
- anchorRef = {
- top: node,
- bottom: lastSelectedElement
- };
- }
+ getMultiSelectedBlocks
+ } = select(store);
+ return {
+ blocks: getMultiSelectedBlocks()
+ };
+})(MultiSelectionInspector));
- function onFocus() {
- setIsInserterShown(true);
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/default-style-picker/index.js
- function onBlur() {
- setIsInserterShown(false);
- } // Position above the anchor, pop out towards the right, and position in the
- // left corner. For the side inserter, pop out towards the left, and
- // position in the right corner.
- // To do: refactor `Popover` to make this prop clearer.
+/**
+ * WordPress dependencies
+ */
- const popoverPosition = showEmptyBlockSideInserter ? 'top left right' : 'top right left';
- const {
- ownerDocument
- } = node;
- const stickyBoundaryElement = showEmptyBlockSideInserter ? undefined : // The sticky boundary element should be the boundary at which the
- // 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"], {
- ref: popoverScrollRef,
- noArrow: true,
- animate: false,
- position: popoverPosition,
- focusOnMount: false,
- anchorRef: anchorRef,
- className: classnames_default()('block-editor-block-list__block-popover', {
- 'is-insertion-point-visible': isInsertionPointVisible
- }),
- __unstableStickyBoundaryElement: stickyBoundaryElement // Render in the old slot if needed for backward compatibility,
- // otherwise render in place (not in the the default popover slot).
- ,
- __unstableSlotName: __unstablePopoverSlot || null,
- __unstableBoundaryParent: true // Observe movement for block animations (especially horizontal).
- ,
- __unstableObserveElement: node,
- shouldAnchorIncludePadding: true // Used to safeguard sticky position behavior against cases where it would permanently
- // obscure specific sections of a block.
- ,
- __unstableEditorCanvasWrapper: __unstableContentRef === null || __unstableContentRef === void 0 ? void 0 : __unstableContentRef.current
- }, (shouldShowContextualToolbar || isToolbarForced) && Object(external_wp_element_["createElement"])("div", {
- onFocus: onFocus,
- onBlur: onBlur // 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
- ,
- tabIndex: -1,
- className: classnames_default()('block-editor-block-list__block-popover-inserter', {
- 'is-visible': isInserterShown
- })
- }, Object(external_wp_element_["createElement"])(inserter["a" /* default */], {
- 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
- // it should focus the toolbar right after the mount.
- , {
- focusOnMount: isToolbarForced,
- __experimentalInitialIndex: initialToolbarItemIndexRef.current,
- __experimentalOnIndexChange: index => {
- initialToolbarItemIndexRef.current = index;
- } // Resets the index whenever the active block changes so
- // 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, {
- clientId: clientId,
- rootClientId: rootClientId,
- blockElement: node
- }), showEmptyBlockSideInserter && Object(external_wp_element_["createElement"])("div", {
- className: "block-editor-block-list__empty-block-inserter"
- }, Object(external_wp_element_["createElement"])(inserter["a" /* default */], {
- position: "bottom right",
- rootClientId: rootClientId,
- clientId: clientId,
- __experimentalIsQuick: true
- })));
-}
-function wrapperSelector(select) {
- const {
- getSelectedBlockClientId,
- getFirstMultiSelectedBlockClientId,
- getBlockRootClientId,
- getBlock,
- getBlockParents,
- __experimentalGetBlockListSettingsForBlocks
- } = select(store["a" /* store */]);
- const clientId = getSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();
- if (!clientId) {
- return;
- }
- const {
- name,
- attributes = {},
- isValid
- } = getBlock(clientId) || {};
- const blockParentsClientIds = getBlockParents(clientId); // Get Block List Settings for all ancestors of the current Block clientId
- const parentBlockListSettings = __experimentalGetBlockListSettingsForBlocks(blockParentsClientIds); // Get the clientId of the topmost parent with the capture toolbars setting.
+/**
+ * Internal dependencies
+ */
- const capturingClientId = Object(external_lodash_["find"])(blockParentsClientIds, parentClientId => {
- var _parentBlockListSetti;
+function DefaultStylePicker(_ref) {
+ let {
+ blockName
+ } = _ref;
+ const {
+ preferredStyle,
+ onUpdatePreferredStyleVariations,
+ styles
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
+ var _preferredStyleVariat, _preferredStyleVariat2;
- return (_parentBlockListSetti = parentBlockListSettings[parentClientId]) === null || _parentBlockListSetti === void 0 ? void 0 : _parentBlockListSetti.__experimentalCaptureToolbars;
+ 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
});
- return {
- clientId,
- rootClientId: getBlockRootClientId(clientId),
- name,
- isValid,
- isEmptyDefaultBlock: name && Object(external_wp_blocks_["isUnmodifiedDefaultBlock"])({
- name,
- attributes
- }),
- capturingClientId
- };
}
-function WrappedBlockPopover(_ref2) {
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-inspector/index.js
+
+
+/**
+ * WordPress dependencies
+ */
+
+
+
+
+/**
+ * Internal dependencies
+ */
+
+
+
+
+
+
+
+
+
+
+
+const BlockInspector = _ref => {
let {
- __unstablePopoverSlot,
- __unstableContentRef
- } = _ref2;
- const selected = Object(external_wp_data_["useSelect"])(wrapperSelector, []);
+ 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.'));
+ }
- if (!selected) {
return null;
}
- const {
+ return (0,external_wp_element_namespaceObject.createElement)(BlockInspectorSingleBlock, {
+ clientId: selectedBlockClientId,
+ blockName: blockType.name,
+ hasBlockStyles: hasBlockStyles,
+ bubblesVirtually: bubblesVirtually
+ });
+};
+
+const BlockInspectorSingleBlock = _ref2 => {
+ let {
clientId,
- rootClientId,
- name,
- isValid,
- isEmptyDefaultBlock,
- capturingClientId
- } = selected;
+ 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"
+ }));
+};
- if (!name) {
+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 Object(external_wp_element_["createElement"])(BlockPopover, {
- clientId: clientId,
- rootClientId: rootClientId,
- isValid: isValid,
- isEmptyDefaultBlock: isEmptyDefaultBlock,
- capturingClientId: capturingClientId,
- __unstablePopoverSlot: __unstablePopoverSlot,
- __unstableContentRef: __unstableContentRef
- });
-}
+ 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
-/***/ "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__);
+/**
+ * External dependencies
+ */
/**
* 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"]; }());
+/**
+ * Internal dependencies
+ */
-/***/ }),
-/***/ "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");
+/**
+ * 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.
+ */
-// EXTERNAL MODULE: external ["wp","data"]
-var external_wp_data_ = __webpack_require__("1ZqX");
+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);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/tips.js
+ 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();
-/**
- * WordPress dependencies
- */
+ 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();
-const globalTips = [Object(external_wp_element_["createInterpolateElement"])(Object(external_wp_i18n_["__"])('While writing, you can press <kbd>/</kbd> 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 <kbd>space</kbd> 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 <kbd>backspace</kbd> 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.")];
+ if (clientIds.length) {
+ event.preventDefault();
+ insertAfterBlock((0,external_lodash_namespaceObject.last)(clientIds));
+ }
+ } else if (isMatch('core/block-editor/insert-before', event)) {
+ const clientIds = getSelectedBlockClientIds();
-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]);
-}
+ 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;
+ }
-/* harmony default export */ var tips = (Tips);
+ const clientIds = getSelectedBlockClientIds();
+
+ if (clientIds.length > 1) {
+ event.preventDefault();
+ removeBlocks(clientIds);
+ }
+ } else if (isMatch('core/block-editor/unselect', event)) {
+ const clientIds = getSelectedBlockClientIds();
-// EXTERNAL MODULE: external ["wp","blocks"]
-var external_wp_blocks_ = __webpack_require__("HSyU");
+ if (clientIds.length > 1) {
+ event.preventDefault();
+ clearSelectedBlock();
+ event.target.ownerDocument.defaultView.getSelection().removeAllRanges();
+ }
+ }
+ }
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-card/index.js
-var block_card = __webpack_require__("GvwK");
+ 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)
+ })))
+ );
+}
-// 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/library.js
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/preview-panel.js
+/**
+ * External dependencies
+ */
/**
* WordPress dependencies
@@ -48972,72 +45140,178 @@ var block_preview = __webpack_require__("REKd");
-function InserterPreviewPanel(_ref) {
- var _hoveredItemBlockType, _hoveredItemBlockType2;
-
+function InserterLibrary(_ref) {
let {
- item
+ rootClientId,
+ clientId,
+ isAppender,
+ showInserterHelpPanel,
+ showMostUsedBlocks = false,
+ __experimentalInsertionIndex,
+ __experimentalFilterValue,
+ onSelect = external_lodash_namespaceObject.noop,
+ shouldFocusBlock = false
} = _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
- }));
+ 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 preview_panel = (InserterPreviewPanel);
+/* harmony default export */ var library = (InserterLibrary);
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/keyboard-shortcuts/index.js
+/**
+ * WordPress dependencies
+ */
-// 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");
+function KeyboardShortcuts() {
+ return null;
+}
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/index.js
-var inserter_listbox = __webpack_require__("wiT/");
+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;
+}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-types-tab.js
+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
+ */
/**
- * External 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
*/
@@ -49046,211 +45320,241 @@ var inserter_listbox = __webpack_require__("wiT/");
/**
- * Internal dependencies
+ * Internal dependencies
+ */
+
+
+/**
+ * Set of key codes upon which typing is to be initiated on a keydown event.
+ *
+ * @type {Set<number>}
+ */
+
+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();
+ }
-const getBlockNamespace = item => item.name.split('/')[0];
+ lastClientX = clientX;
+ lastClientY = clientY;
+ }
-const MAX_SUGGESTED_ITEMS = 6;
+ ownerDocument.addEventListener('mousemove', stopTypingOnMouseMove);
+ return () => {
+ ownerDocument.removeEventListener('mousemove', stopTypingOnMouseMove);
+ };
+ }, [isTyping, stopTyping]);
+}
/**
- * 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.
+ * Sets and removes the `isTyping` flag based on user actions:
*
- * @type {Array}
+ * - 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.
*/
-const EMPTY_ARRAY = [];
-function BlockTypesTab(_ref) {
- let {
- rootClientId,
- onInsert,
- onHover,
- showMostUsedBlocks
- } = _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);
+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 (result[namespace].length === 0) {
- delete result[namespace];
- }
- });
- return result;
- }, [items, collections]); // Hide block preview on unmount.
+ if (isTyping) {
+ let timerId;
+ /**
+ * Stops typing when focus transitions to a non-text field element.
+ *
+ * @param {FocusEvent} event Focus event.
+ */
- 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.
- */
+ 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.
- const currentlyRenderedCategories = Object(external_wp_compose_["useAsyncList"])(categories);
- const didRenderAllCategories = categories.length === currentlyRenderedCategories.length; // Async List requires an array
+ 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.
+ */
- 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;
- }
+ function stopTypingOnEscapeKey(event) {
+ const {
+ keyCode
+ } = event;
- 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 (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.
+ */
- 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);
+ function stopTypingOnSelectionUncollapse() {
+ const selection = defaultView.getSelection();
+ const isCollapsed = selection.rangeCount > 0 && selection.getRangeAt(0).collapsed;
-// EXTERNAL MODULE: ./node_modules/classnames/index.js
-var classnames = __webpack_require__("TSYQ");
-var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
+ if (!isCollapsed) {
+ stopTyping();
+ }
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/pattern-panel.js
+ 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.
+ */
-/**
- * External dependencies
- */
+ 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
-/**
- * WordPress dependencies
- */
+ 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 PatternInserterPanel(_ref) {
+function ObserveTyping(_ref) {
let {
- selectedCategory,
- patternCategories,
- onClickCategory,
- openPatternExplorer
+ children
} = _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;
- };
+ 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
+ */
- 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.
+/* harmony default export */ var observe_typing = (ObserveTyping);
- const onBlur = event => {
- if (!(event !== null && event !== void 0 && event.relatedTarget)) {
- event.stopPropagation();
- }
- };
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/preserve-scroll-in-reorder/index.js
+/**
+ * WordPress dependencies
+ */
- 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'))));
+function PreserveScrollInReorder() {
+ external_wp_deprecated_default()('PreserveScrollInReorder component', {
+ since: '5.4',
+ hint: 'This behavior is now built-in the block list'
+ });
+ return null;
}
-/* 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
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/typewriter/index.js
/**
@@ -49259,529 +45563,384 @@ var block_patterns_list = __webpack_require__("Fmc1");
-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')
- }));
-}
+/**
+ * Internal dependencies
+ */
-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);
+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;
+ }
-// EXTERNAL MODULE: external ["wp","a11y"]
-var external_wp_a11y_ = __webpack_require__("gdqT");
+ const {
+ ownerDocument
+ } = node;
+ const {
+ defaultView
+ } = ownerDocument;
+ let scrollResizeRafId;
+ let onKeyDownRafId;
+ let caretRect;
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/no-results.js
-var no_results = __webpack_require__("LolH");
+ function onScrollResize() {
+ if (scrollResizeRafId) {
+ return;
+ }
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-insertion-point.js
-var use_insertion_point = __webpack_require__("AORF");
+ scrollResizeRafId = defaultView.requestAnimationFrame(() => {
+ computeCaretRectangle();
+ scrollResizeRafId = null;
+ });
+ }
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/search-items.js
-var search_items = __webpack_require__("pOGT");
+ function onKeyDown(event) {
+ // Ensure the any remaining request is cancelled.
+ if (onKeyDownRafId) {
+ defaultView.cancelAnimationFrame(onKeyDownRafId);
+ } // Use an animation frame for a smooth result.
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-explorer/patterns-list.js
+ 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.
+ */
-/**
- * WordPress dependencies
- */
+ 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.
-/**
- * Internal dependencies
- */
+ 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.
-const INITIAL_INSERTER_RESULTS = 2;
+ if (!scrollContainer) {
+ return;
+ }
-function PatternsListHeader(_ref) {
- let {
- filterValue,
- filteredBlockPatternsLength
- } = _ref;
+ 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 (!filterValue) {
- return null;
- }
+ if (scrollY === 0 && relativeScrollPosition < initialTriggerPercentage && isLastEditableNode()) {
+ // Reset the caret position to maintain.
+ caretRect = currentCaretRect;
+ return;
+ }
- 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));
-}
+ const scrollContainerHeight = windowScroll ? defaultView.innerHeight : scrollContainer.clientHeight; // Abort if the target scroll position would scroll the caret out of
+ // view.
-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;
+ 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;
+ }
- 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);
- });
+ if (windowScroll) {
+ defaultView.scrollBy(0, diff);
+ } else {
+ scrollContainer.scrollTop += diff;
+ }
}
+ /**
+ * Adds a `selectionchange` listener to reset the scroll position to be
+ * maintained.
+ */
- return Object(search_items["b" /* searchItems */])(allPatterns, filterValue);
- }, [filterValue, selectedCategory, allPatterns]); // Announce search results on change.
- Object(external_wp_element_["useEffect"])(() => {
- if (!filterValue) {
- return;
+ function addSelectionChangeListener() {
+ ownerDocument.addEventListener('selectionchange', computeCaretRectOnSelectionChange);
}
-
- 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
- })));
-}
-
-/* harmony default export */ var patterns_list = (PatternList);
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-explorer/explorer.js
+ /**
+ * Resets the scroll position to be maintained during a `selectionchange`
+ * event. Also removes the listener, so it acts as a one-time listener.
+ */
-/**
- * WordPress dependencies
- */
+ 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.
+ */
-/**
- * Internal dependencies
- */
+ 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.
-function PatternsExplorer(_ref) {
- let {
- initialCategory,
- patternCategories
- } = _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
- }));
+ 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 PatternsExplorerModal(_ref2) {
+function Typewriter(_ref2) {
let {
- onModalClose,
- ...restProps
+ children
} = _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));
+ return (0,external_wp_element_namespaceObject.createElement)("div", {
+ ref: useTypewriter(),
+ className: "block-editor__typewriter"
+ }, children);
}
-
-/* harmony default export */ var explorer = (PatternsExplorerModal);
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-tab.js
-
-
/**
- * WordPress dependencies
+ * 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;
/**
- * Internal dependencies
+ * 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
+ */
-function BlockPatternsCategory(_ref) {
- let {
- rootClientId,
- onInsert,
- selectedCategory,
- populatedCategories
- } = _ref;
- const [allPatterns,, onClick] = Object(use_patterns_state["a" /* default */])(onInsert, rootClientId);
- const getPatternIndex = Object(external_wp_element_["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 = 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) {
- 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
- }));
-}
+/**
+ * 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.
+ */
-function BlockPatternsTabs(_ref3) {
- 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;
- }
+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;
+ }
- return pattern.categories.some(cat => allCategories.some(category => category.name === cat));
- }, [allCategories]); // Remove any empty categories
+ const focusableNodes = external_wp_dom_namespaceObject.focus.focusable.find(node);
+ const target = (0,external_lodash_namespaceObject.findLast)(focusableNodes, isTabbableTextField);
- const populatedCategories = Object(external_wp_element_["useMemo"])(() => {
- const categories = allCategories.filter(category => allPatterns.some(pattern => {
- var _pattern$categories3;
+ if (!target) {
+ return;
+ }
- 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;
+ const {
+ bottom
+ } = target.getBoundingClientRect(); // Ensure the click is below the last block.
- if (![currentName, nextName].includes('featured')) {
- return 0;
+ if (event.clientY < bottom) {
+ return;
}
- return currentName === 'featured' ? -1 : 1;
- });
-
- if (allPatterns.some(pattern => !hasRegisteredCategory(pattern)) && !categories.find(category => category.name === 'uncategorized')) {
- categories.push({
- name: 'uncategorized',
- label: Object(external_wp_i18n_["_x"])('Uncategorized')
- });
+ (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(target, true);
+ event.preventDefault();
}
- 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)
- }));
+ node.addEventListener('mousedown', onMouseDown);
+ return () => {
+ node.addEventListener('mousedown', onMouseDown);
+ };
+ }, []);
}
-/* 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/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 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';
- });
- }, [items]);
-
- if (filteredItems.length === 0) {
- return Object(external_wp_element_["createElement"])(no_results["a" /* default */], null);
- }
-
- 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.
-
+function addToBlockType(renderedBlocks, blockName, uniqueId) {
+ const result = { ...renderedBlocks,
+ [blockName]: renderedBlocks[blockName] ? new Set(renderedBlocks[blockName]) : new Set()
+ };
+ result[blockName].add(uniqueId);
+ return result;
+}
/**
- * List of reusable blocks shown in the "Reusable" tab of the inserter.
+ * 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 {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.
+ * @param {*} uniqueId Any value that acts as a unique identifier for a block instance.
+ * @param {string} blockName Optional block name.
*
- * @return {WPComponent} The component.
+ * @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 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'))));
+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];
}
-/* harmony default export */ var reusable_blocks_tab = (ReusableBlocksTab);
-// EXTERNAL MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/search-results.js
-var search_results = __webpack_require__("Wg7J");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/index.js
+/*
+ * Block Creation Components
+ */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/inserter/tabs.js
-/**
- * WordPress dependencies
- */
-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) {
- let {
- children,
- showPatterns = false,
- showReusableBlocks = false,
- onSelect
- } = _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);
-}
-/* harmony default export */ var inserter_tabs = (InserterTabs);
-// 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
- */
@@ -49793,218 +45952,36 @@ var store = __webpack_require__("BhPs");
-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
- }));
-}
-/* harmony default export */ var menu = __webpack_exports__["a"] = (InserterMenu);
-/***/ }),
-/***/ "xkPd":
-/***/ (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_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__);
-/**
- * WordPress 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);
- }
- }
- }, props));
-}
-/* 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");
-/**
- * External dependencies
- */
-/**
- * WordPress dependencies
- */
-/**
- * Internal dependencies
+/*
+ * Content Related Components
*/
@@ -50012,499 +45989,403 @@ 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 gradientIndicatorAriaLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["__"])('(%s: gradient %s)');
-const colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients'];
-const Indicators = _ref => {
- let {
- colors,
- gradients,
- settings
- } = _ref;
- return settings.map((_ref2, index) => {
- let {
- colorValue,
- gradientValue,
- label,
- colors: availableColors,
- gradients: availableGradients
- } = _ref2;
- if (!colorValue && !gradientValue) {
- return null;
- }
- 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);
- } else {
- const gradientObject = Object(_gradients__WEBPACK_IMPORTED_MODULE_8__[/* __experimentalGetGradientObjectByGradientValue */ "b"])(availableGradients || gradients, colorValue);
- ariaLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__["sprintf"])(gradientIndicatorAriaLabel, label.toLowerCase(), gradientObject && gradientObject.name || gradientValue);
- }
- return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["ColorIndicator"], {
- key: index,
- colorValue: colorValue || gradientValue,
- "aria-label": ariaLabel
- });
- });
-};
-const PanelColorGradientSettingsInner = _ref3 => {
- let {
- className,
- colors,
- gradients,
- disableCustomColors,
- disableCustomGradients,
- children,
- settings,
- title,
- showTitle = true,
- __experimentalHasMultipleOrigins,
- __experimentalIsRenderedInSidebar,
- enableAlpha,
- ...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))) {
- return null;
- }
- const titleElement = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])("span", {
- className: "block-editor-panel-color-gradient-settings__panel-title"
- }, title, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["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),
- title: showTitle ? titleElement : undefined
- }, props), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_dropdown__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], {
- settings: settings,
- colors,
- gradients,
- disableCustomColors,
- disableCustomGradients,
- __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"], {
- 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 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 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 (props.__experimentalHasMultipleOrigins) {
- return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(PanelColorGradientSettingsMultipleSelect, props);
- }
- return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(PanelColorGradientSettingsSingleSelect, props);
-};
-/* harmony default export */ __webpack_exports__["a"] = (PanelColorGradientSettings);
-/***/ }),
-/***/ "ywyh":
-/***/ (function(module, exports) {
-(function() { module.exports = window["wp"]["apiFetch"]; }());
-/***/ }),
-/***/ "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
- */
-/**
- * WordPress dependencies
+
+
+/*
+ * State Related Components
*/
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/utils/theme.js
/**
* 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).
+ * Given an array of theme colors checks colors for validity
*
- * @param {string} clientId Block client ID.
+ * @param {Array} colors The array of theme colors
*
- * @return {number} The initial position, either 0 (start) or -1 (end).
+ * @return {Array} The array of valid theme colors or the default colors
*/
-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"]);
+function validateThemeColors(colors) {
+ if (colors === undefined) {
+ colors = SETTINGS_DEFAULTS.colors;
+ } else {
+ const validColors = colors.filter(c => c.color);
- if (!isBlockSelected(clientId)) {
- return;
+ if (validColors.length === 0) {
+ colors = SETTINGS_DEFAULTS.colors;
+ } else if (validColors.length < colors.length) {
+ // Filter out invalid colors
+ colors = validColors;
}
+ }
- if (isMultiSelecting() || isNavigationMode()) {
- return;
- } // If there's no initial position, return 0 to focus the start.
-
-
- return getSelectedBlocksInitialCaretPosition();
- }, [clientId]);
+ return colors;
}
/**
- * Transitions focus to the block or inner tabbable when the block becomes
- * selected and an initial position is set.
+ * Given an array of theme gradients checks gradients for validity
*
- * @param {string} clientId Block client ID.
+ * @param {Array} gradients The array of theme gradients
*
- * @return {RefObject} React ref with the block element.
+ * @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);
-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;
+ if (validGradients.length === 0) {
+ gradients = SETTINGS_DEFAULTS.gradients;
+ } else if (validGradients.length < gradients.length) {
+ // Filter out invalid gradients
+ gradients = validGradients;
}
+ }
- if (!ref.current) {
- return;
- }
+ return gradients;
+}
- const {
- ownerDocument
- } = ref.current; // Do not focus the block if it already contains the active element.
+;// 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 (ref.current.contains(ownerDocument.activeElement)) {
- return;
- } // Find all tabbables within node.
+ 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.
+ */
- 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;
+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.
+ */
- 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;
-}
+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';
-/***/ "zQI6":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ case 'clamp':
+ if (units.length !== 3) {
+ return null;
+ }
-"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");
+ 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';
+ }
+}
/**
- * WordPress dependencies
+ * 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);
+}
/**
- * Internal dependencies
+ * 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;
+}
/**
- * 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.
+ * Evaluates the math expression and return a px value.
*
- * @return {import('react').RefCallback} Ref callback.
+ * @param {string} cssUnit the cssUnit value being evaluted.
+ * @return {string} return a converfted value to px.
*/
-function useBlockSelectionClearer() {
- 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.
+function evalMathExpression(cssUnit) {
+ let errorFound = false; // Convert every part of the expression to px values.
+
+ const cssUnitsBits = cssUnit.split(/[+-/*/]/g).filter(Boolean);
- if (event.target !== node) {
- return;
- }
+ for (const unit of cssUnitsBits) {
+ // Standardize the unit to px and extract the value.
+ const parsedUnit = parseUnit(getPxFromCssUnit(unit));
- clearSelectedBlock();
+ if (!parseFloat(parsedUnit.value)) {
+ errorFound = true; // end early since we are dealing with a null value.
+
+ break;
}
- node.addEventListener('mousedown', onMouseDown);
- return () => {
- node.removeEventListener('mousedown', onMouseDown);
- };
- }, [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));
-}
+ 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.
+ */
-/***/ }),
-/***/ "ziDm":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+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
+ };
-"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__);
+ 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;
+}
/**
- * WordPress dependencies
+ * Returns the px value of a cssUnit.
+ *
+ * @param {string} cssUnit
+ * @param {Object} options
+ * @return {string} returns the cssUnit value in a simple px format.
*/
-const alignRight = 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.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"
-}));
-/* harmony default export */ __webpack_exports__["a"] = (alignRight);
+function getPxFromCssUnit(cssUnit) {
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
-/***/ }),
+ if (Number.isFinite(cssUnit)) {
+ return cssUnit.toFixed(0) + 'px';
+ }
-/***/ "zmSX":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (cssUnit === undefined) {
+ return null;
+ }
-"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"]; });
+ let parsedUnit = parseUnit(cssUnit);
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _use_gradient__WEBPACK_IMPORTED_MODULE_0__["b"]; });
+ if (!parsedUnit.unit) {
+ parsedUnit = parseUnitFunction(cssUnit, options);
+ }
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _use_gradient__WEBPACK_IMPORTED_MODULE_0__["c"]; });
+ if (isMathExpression(cssUnit) && !parsedUnit.unit) {
+ return evalMathExpression(cssUnit);
+ }
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "d", function() { return _use_gradient__WEBPACK_IMPORTED_MODULE_0__["d"]; });
+ return convertParsedUnitToPx(parsedUnit, options);
+} // Use simple cache.
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "e", function() { return _use_gradient__WEBPACK_IMPORTED_MODULE_0__["e"]; });
+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 = '';
-/***/ "zt9T":
-/***/ (function(module, exports, __webpack_require__) {
+ if (options.hasOwnProperty('fontSize')) {
+ hash = ':' + options.width;
+ }
-"use strict";
+ if (options.hasOwnProperty('lineHeight')) {
+ hash = ':' + options.lineHeight;
+ }
+ if (options.hasOwnProperty('width')) {
+ hash = ':' + options.width;
+ }
-var util = __webpack_require__("jB5C");
+ if (options.hasOwnProperty('height')) {
+ hash = ':' + options.height;
+ }
-function scrollIntoView(elem, container, config) {
- config = config || {};
- // document 归一化到 window
- if (container.nodeType === 9) {
- container = util.getWindow(container);
+ if (options.hasOwnProperty('type')) {
+ hash = ':' + options.type;
}
- 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;
+ return hash;
+}
- allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;
+/* 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
+ */
- 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);
- }
- }
- }
- }
-}
-module.exports = scrollIntoView;
-/***/ })
-/******/ });
\ No newline at end of file
+}();
+(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=>`<img src="${Object(u.createBlobURL)(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<c.length;o++)n=c[o],t.indexOf(n)>=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&&o<t?t-i:t)}}}function a(e,t){const n=Object(r.useSelect)(e=>e(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||a<r||u){r=a;const t=e.indexOf(l),d=e[t-1];if("top"===s&&d&&d.rootClientId===l.rootClientId&&!d.isDraggedBlock?(o=d,n="bottom",c=d.element.getBoundingClientRect()):(o=l,n=s,c=i),u)break}}if(!o)return;const l="bottom"===n;if(l&&o.canInsertDraggedBlocksAsChild&&(o.innerBlockCount>0||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;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.create;Object.create;var _t=n("cDcd"),yt=n.n(_t),Et=n("wJiJ"),Ct=n.n(Et);function St(e,t,n,o,r,c){void 0===c&&(c=0);var l=At(e,t,c),i=l.width,a=l.height,s=Math.min(i,n),u=Math.min(a,o);return s>u*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;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).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: <mark>%s</mark>"),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=>`<img src="${Object(bo.createBlobURL)(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(/.*<!--StartFragment-->/s,"").replace(/<!--EndFragment-->.*/s,"")}(g),g=function(e){const t="<meta charset='utf-8'>";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}></${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<t?n:t};return(e=>{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<d?l=c:s?o.scrollBy(0,i):a.scrollTop+=i}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),b()}function b(){p()&&(l=Object(bn.computeCaretRect)(o))}function p(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",i,!0),o.addEventListener("resize",i,!0),t.addEventListener("keydown",a),t.addEventListener("keyup",s),t.addEventListener("mousedown",u),t.addEventListener("touchstart",u),()=>{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<r||(Object(bn.placeCaretAtHorizontalEdge)(o,!0),t.preventDefault())}return e.addEventListener("mousedown",t),()=>{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;r<n;r++)o[r]=arguments[r];return Object(i.createHigherOrderComponent)(d(o,t),"withCustomColors")}}function p(){const e=u();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return Object(i.createHigherOrderComponent)(d(n,e),"withColors")}},"6ZVF":function(e,t,n){"use strict";var o=n("GRId"),r=n("HSyU"),c=n("wx14"),l=n("TSYQ"),i=n.n(l),a=n("RxS6"),s=n("7SSY"),u=n("M+co"),d=n("j6zP");function b(){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 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;o<r;o+=t)n.push(e.slice(o,o+t));return n}(t,3).map((e,t)=>Object(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()<n.brightness()?Object(a.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter text color."):Object(a.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color.");return Object(o.useEffect)(()=>{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=[];++d<t;)a&&a[d].run();d=-1,t=s.length}a=null,u=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===l||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function f(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new m(e,t)),1!==s.length||u||i(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=f,r.addListener=f,r.once=f,r.off=f,r.removeListener=f,r.removeAllListeners=f,r.emit=f,r.prependListener=f,r.prependOnceListener=f,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},"9Do8":function(e,t,n){"use strict";e.exports=n("zt9T")},"9Ma0":function(e,t,n){"use strict";n.d(t,"b",(function(){return _})),n.d(t,"a",(function(){return y}));var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("YLtl"),a=n("HSyU"),s=n("tI+e"),u=n("K9lf"),d=n("1ZqX"),b=n("l3Sj"),p=n("1iEr"),m=n("2gm7"),f=n("XgzB"),h=n("NWDH");function g(e,t,n,o,r,c,l){const i=n+1,a=e=>"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;n++)t[n]=arguments[n];const r=Object(i.reduce)(t,(e,t)=>(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.length<e.length&&(e=t)}return e}function l(e){if(void 0===e)e=r.b.gradients;else{const t=e.filter(e=>e.gradient);0===t.length?e=r.b.gradients:t.length<e.length&&(e=t)}return e}var i=n("Btt3");function a(e){const t=null==e?void 0:e.trim().match(/^(0?[-.]?\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/);return isNaN(e)||isNaN(parseFloat(e))?t?{value:parseFloat(t[1])||t[1],unit:t[2]}:{value:e,unit:void 0}:{value:parseFloat(e),unit:"px"}}function s(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map(e=>a(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[0]?o[0]+"px":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;t<e.length;t++)if(["+","-","/","*"].includes(e[t]))return!0;return!1}function b(e){let t=!1;const n=e.split(/[+-/*/]/g).filter(Boolean);for(const o of n){const n=a(m(o));if(!parseFloat(n.value)){t=!0;break}e=e.replace(o,n.value)}return t?null:(o=e,Function(`'use strict'; return (${o})`)()).toFixed(0)+"px";var o}function p(e,t){const n=Object.assign({},{fontSize:16,lineHeight:16,width:375,height:812,type:"font"},t),o={em:n.fontSize,rem:n.fontSize,vh:.01*n.height,vw:.01*n.width,vmin:.01*(n.width<n.height?n.width:n.height),vmax:.01*(n.width>n.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<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)},e=>(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;e<l&&o[e]===r[e];e++)c=o[e];return c}function J(e,t){let n=arguments.length>2&&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&&o<n.length-1}function Oe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function ve(e){return e.isMultiSelecting}function je(e){return e.isSelectionEnabled}function ke(e,t){return e.blocksMode[t]||"visual"}function _e(e){return e.isTyping}function ye(e){return!!e.draggedBlocks.length}function Ee(e){return e.draggedBlocks}function Ce(e,t){return e.draggedBlocks.includes(t)}function Se(e,t){if(!ye(e))return!1;const n=$(e,t);return Object(l.some)(n,t=>Ce(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*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\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<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,s))return}a({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),a(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;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},l=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var i=n("cDcd"),a=n("17x9"),s=n("GemG"),u=n("Rk8H"),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&s(e.textarea)})):this.textarea&&s(this.textarea),this.textarea&&this.textarea.addEventListener("autosize:resized",this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener("autosize:resized",this.onResize),s.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=l(t,["onResize","maxRows","onChange","style","innerRef","children"]),s=this.state.lineHeight,u=n&&s?s*n:null;return i.createElement("textarea",c({},a,{onChange:this.onChange,style:u?c({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&s.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(i.Component);t.TextareaAutosize=i.forwardRef((function(e,t){return i.createElement(d,c({},e,{innerRef:t}))}))},Civd: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.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"}));t.a=c},Cn0l:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"e",(function(){return u})),n.d(t,"b",(function(){return d})),n.d(t,"d",(function(){return b})),n.d(t,"c",(function(){return p}));var o=n("YLtl"),r=n("GRId"),c=n("1ZqX"),l=n("ur0x"),i=n("v5LD"),a=n("BhPs");function s(e){if(e)return`has-${e}-gradient-background`}function u(e,t){const n=Object(o.find)(e,["slug",t]);return n&&n.gradient}function d(e,t){return Object(o.find)(e,["gradient",t])}function b(e,t){const n=d(e,t);return n&&n.slug}function p(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&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<t?"hidden"===n.overflowY&&(s("scroll"),u(),o="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(s("hidden"),u(),o="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),l!==o){l=o;var r=c("autosize:resized");try{e.dispatchEvent(r)}catch(e){}}}}function i(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var s=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((s=function(e){return e}).destroy=function(e){return e},s.update=function(e){return e}):((s=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return l(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e},s.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=s,e.exports=t.default})?o.apply(t,r):o)||(e.exports=c)},GkEL:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("tI+e"),l=n("NMb1"),i=n.n(l),a=n("1CF3"),s=n("hF7m");function u(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}function d(e,t,n,o,c){const[l]=Object(r.useState)(t),[i]=Object(r.useState)(o),d=Object(r.useCallback)(()=>{!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<t?"hidden"===n.overflowY&&(c("scroll"),d(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),d(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var i=l("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e,t)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default},void 0===(r="function"==typeof n?n.apply(t,o):n)||(e.exports=r)},4403:function(e,t){var n;
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
-*/!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var c=typeof o;if("string"===c||"number"===c)e.push(o);else if(Array.isArray(o)){if(o.length){var l=r.apply(null,o);l&&e.push(l)}}else if("object"===c)if(o.toString===Object.prototype.toString)for(var i in o)n.call(o,i)&&o[i]&&e.push(i);else e.push(o.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(o=function(){return r}.apply(t,[]))||(e.exports=o)}()},TVFh:function(e,t,n){"use strict";n.d(t,"b",(function(){return E}));var o=n("wx14"),r=n("GRId"),c=n("TSYQ"),l=n.n(c),i=n("1ZqX"),a=n("l3Sj"),s=n("K9lf"),u=n("YLtl"),d=n("BhPs"),b=n("PKbb");function p(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 m(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r}=e(d.a);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r()}}function f(){const{isMultiSelecting:e,multiSelectedBlockClientIds:t,hasMultiSelection:n,selectedBlockClientId:o}=Object(i.useSelect)(m,[]),r=Object(b.b)(o),c=Object(b.b)(Object(u.first)(t)),l=Object(b.b)(Object(u.last)(t));return Object(s.useRefEffect)(i=>{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.clientY<v.top)||"vertical"===i&&(t.clientX>v.right||t.clientX<v.left))return void(a()&&m());const j=c(O);0!==j?b(l,j,{__unstableWithInserter:!0}):a()&&m()}},[e,n,r,c,a,s,b,m,u])}const g="undefined"==typeof window?e=>{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<c){const e=Math.max(c-50,0),n=Math.max(c-l-50,0)/e;t.current=-25*n}else t.current=0},[]),()=>{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<s&&(s=p,u=b)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}},asom:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n("wx14"),r=n("GRId"),c=n("tI+e");function l(e){let{Slot:t,...n}=e;const l=Object(r.useContext)(c.__experimentalToolsPanelContext);return Object(r.createElement)(t,Object(o.a)({},n,{fillProps:l}))}},b2RC: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 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"}));t.a=c},bTSr: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 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"}));t.a=c},bVTw: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",width:"24",height:"24",fill:"none"},Object(o.createElement)(r.Path,{d:"M5 11.25h14v1.5H5z"}));t.a=c},bVpQ:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"d",(function(){return u}));var o=n("YLtl"),r=n("fHnH"),c=n("abaT"),l=n("7bKH");Object(r.b)([c.a,l.a]);const i=(e,t,n)=>{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<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const O=(e,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;e<r.length;e++)if(r[e].node_===d){f.circular=r[e];break}}else f.isLeaf=!0,f.keys=null;f.notLeaf=!f.isLeaf,f.notRoot=!f.isRoot}h();var g=t.call(f,f.node);return void 0!==g&&f.update&&f.update(g),p.before&&p.before.call(f,f.node),m?("object"!=typeof f.node||null===f.node||f.circular||(r.push(f),h(),s(f.keys,(function(t,r){o.push(t),p.pre&&p.pre.call(f,f.node[t],t);var c=e(f.node[t]);n&&u.call(f.node,t)&&(f.node[t]=c.node),c.isLast=r==f.keys.length-1,c.isFirst=0==r,p.post&&p.post.call(f,c),o.pop()})),r.pop()),p.after&&p.after.call(f,f.node),f):f}(e).node}function c(e){if("object"==typeof e&&null!==e){var t;if(a(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if(function(e){return"[object RegExp]"===i(e)}(e))t=new RegExp(e);else if(function(e){return"[object Error]"===i(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===i(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===i(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===i(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},o=function(){};o.prototype=n,t=new o}return s(l(e),(function(n){t[n]=e[n]})),t}return e}o.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!u.call(t,o)){t=void 0;break}t=t[o]}return t},o.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!u.call(t,o))return!1;t=t[o]}return!0},o.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];u.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},o.prototype.map=function(e){return r(this.value,e,!0)},o.prototype.forEach=function(e){return this.value=r(this.value,e,!1),this.value},o.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},o.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},o.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},o.prototype.clone=function(){var e=[],t=[];return function n(o){for(var r=0;r<e.length;r++)if(e[r]===o)return t[r];if("object"==typeof o&&null!==o){var i=c(o);return e.push(o),t.push(i),s(l(o),(function(e){i[e]=n(o[e])})),e.pop(),t.pop(),i}return o}(this.value)};var l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function i(e){return Object.prototype.toString.call(e)}var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},s=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};s(l(o.prototype),(function(e){n[e]=function(t){var n=[].slice.call(arguments,1),r=new o(t);return r[e].apply(r,n)}}));var u=Object.hasOwnProperty||function(e,t){return t in e}},ez49:function(e,t,n){"use strict";var o,r=n("o97j");r.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("",""))
+*/!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:function(e,t){"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.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,g=m&&0<=f&&f<c;if(h||g){if(!h||g&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),f=i.extractCommon(l,t,e,n),l.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+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:function(e,t,n){"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:function(e,t,n){"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=o.offset(e),f=o.outerHeight(e),h=o.outerWidth(e),g=void 0,v=void 0,b=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0,w=void 0,S=void 0;p?(E=t,S=o.height(E),w=o.width(E),C={left:o.scrollLeft(E),top:o.scrollTop(E)},_={left:m.left-C.left-c,top:m.top-C.top-a},y={left:m.left+h-(C.left+w)+d,top:m.top+f-(C.top+S)+u},k=C):(g=o.offset(t),v=t.clientHeight,b=t.clientWidth,k={left:t.scrollLeft,top:t.scrollTop},_={left:m.left-(g.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:m.top-(g.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},y={left:m.left+h-(g.left+b+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:m.top+f-(g.top+v+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),_.top<0||y.top>0?!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;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),a=/^(top|right|bottom|left)$/;var c=void 0;function u(e,t){for(var n=0;n<e.length;n++)t(e[n])}function d(e){return"border-box"===c(e,"boxSizing")}"undefined"!=typeof window&&(c=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,l=n||r.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,r=o.left,l=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=r,e.runtimeStyle.left=l}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}function f(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var s=void 0;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function h(e){return null!=e&&e==e.window}var g={};function v(e,t,n){if(h(e))return"width"===t?g.viewportWidth(e):g.viewportHeight(e);if(9===e.nodeType)return"width"===t?g.docWidth(e):g.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(c(e),d(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?1:-1);var s=void 0!==r||l,a=r||i;if(-1===n)return s?a-f(e,["border","padding"],o):i;if(s){var u=2===n?-f(e,["border"],o):f(e,["margin"],o);return a+(1===n?0:u)}return i+f(e,p.slice(n),o)}u(["Width","Height"],(function(e){g["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],g["viewport"+e](n))},g["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var b={position:"absolute",visibility:"hidden",display:"block"};function k(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=v.apply(void 0,n):m(e,b,(function(){t=v.apply(void 0,n)})),t}function _(e,t,o){var r=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):c(e,t);for(var l in t)t.hasOwnProperty(l)&&_(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);g["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];g[e]=function(t,o){if(void 0===o)return t&&k(t,e,-1);if(t){c(t);return d(t)&&(o+=f(t,["padding","border"],n)),_(t,e,o)}}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return i(e);!function(e,t){"static"===_(e,"position")&&(e.style.position="relative");var n=i(e),o={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(_(e,l))||0,o[l]=r+t[l]-n[l]);_(e,o)}(e,t)},isWindow:h,each:u,css:_,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(h(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(h(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},g)},8575:function(e){"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}}},9894:function(e,t,n){var o=n(4827);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 l=e.nodeName,i=document.createElement(l);i.innerHTML=" ","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},7970:function(e,t,n){e.exports=n(195)},3110:function(e){"use strict";var t=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},3812:function(e){var t,n,o,r,l,i,s,a,c,u,d,p,m,f,h,g=!1;function v(){if(!g){g=!0;var e=navigator.userAgent,v=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),b=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(p=/\b(iPhone|iP[ao]d)/.exec(e),m=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),f=/FBAN\/\w+;/i.exec(e),h=/Mobile/i.exec(e),d=!!/Win64/.exec(e),v){(t=v[1]?parseFloat(v[1]):v[5]?parseFloat(v[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var k=/(?:Trident\/(\d+.\d+))/.exec(e);i=k?parseFloat(k[1])+4:t,n=v[2]?parseFloat(v[2]):NaN,o=v[3]?parseFloat(v[3]):NaN,(r=v[4]?parseFloat(v[4]):NaN)?(v=/(?:Chrome\/(\d+\.\d+))/.exec(e),l=v&&v[1]?parseFloat(v[1]):NaN):l=NaN}else t=n=o=l=r=NaN;if(b){if(b[1]){var _=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);s=!_||parseFloat(_[1].replace("_","."))}else s=!1;a=!!b[2],c=!!b[3]}else s=a=c=!1}}var b={ie:function(){return v()||t},ieCompatibilityMode:function(){return v()||i>t},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<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},E=function(e){return"string"==typeof e?y(e.trim(),_.string):"object"==typeof e&&null!==e?y(e,_.object):[null,void 0]},C=function(e,t){var n=g(e);return{h:n.h,s:l(n.s+100*t,0,100),l:n.l,a:n.a}},S=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},w=function(e,t){var n=g(e);return{h:n.h,s:n.s,l:l(n.l+100*t,0,100),a:n.a}},I=function(){function e(e){this.parsed=E(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return c(S(this.rgba),2)},e.prototype.isDark=function(){return S(this.rgba)<.5},e.prototype.isLight=function(){return S(this.rgba)>=.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;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function c(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function l(e){return c(e)}function i(e){return c(e,!0)}function a(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,c=r.body,l=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=l.clientLeft||c.clientLeft||0,top:o-=l.clientTop||c.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=l(o),t.top+=i(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),u=/^(top|right|bottom|left)$/,d="left";var b=void 0;function p(e,t){for(var n=0;n<e.length;n++)t(e[n])}function m(e){return"border-box"===b(e,"boxSizing")}"undefined"!=typeof window&&(b=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,c=n||r.defaultView.getComputedStyle(e,null);return c&&(o=c.getPropertyValue(t)||c[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!u.test(t)){var o=e.style,r=o[d],c=e.runtimeStyle[d];e.runtimeStyle[d]=e.currentStyle[d],o[d]="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o[d]=r,e.runtimeStyle[d]=c}return""===n?"auto":n});var f=["margin","border","padding"];function h(e,t,n){var o={},r=e.style,c=void 0;for(c in t)t.hasOwnProperty(c)&&(o[c]=r[c],r[c]=t[c]);for(c in n.call(e),t)t.hasOwnProperty(c)&&(r[c]=o[c])}function g(e,t,n){var o=0,r=void 0,c=void 0,l=void 0;for(c=0;c<t.length;c++)if(r=t[c])for(l=0;l<n.length;l++){var i=void 0;i="border"===r?r+n[l]+"Width":r+n[l],o+=parseFloat(b(e,i))||0}return o}function O(e){return null!=e&&e==e.window}var v={};function j(e,t,n){if(O(e))return"width"===t?v.viewportWidth(e):v.viewportHeight(e);if(9===e.nodeType)return"width"===t?v.docWidth(e):v.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,c=(b(e),m(e)),l=0;(null==r||r<=0)&&(r=void 0,(null==(l=b(e,t))||Number(l)<0)&&(l=e.style[t]||0),l=parseFloat(l)||0),void 0===n&&(n=c?1:-1);var i=void 0!==r||c,a=r||l;if(-1===n)return i?a-g(e,["border","padding"],o):l;if(i){var s=2===n?-g(e,["border"],o):g(e,["margin"],o);return a+(1===n?0:s)}return l+g(e,f.slice(n),o)}p(["Width","Height"],(function(e){v["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],v["viewport"+e](n))},v["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,c=o.documentElement[n];return"CSS1Compat"===o.compatMode&&c||r&&r[n]||c}}));var k={position:"absolute",visibility:"hidden",display:"block"};function _(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=j.apply(void 0,n):h(e,k,(function(){t=j.apply(void 0,n)})),t}function y(e,t,n){var o=n;if("object"!==(void 0===t?"undefined":r(t)))return void 0!==o?("number"==typeof o&&(o+="px"),void(e.style[t]=o)):b(e,t);for(var c in t)t.hasOwnProperty(c)&&y(e,c,t[c])}p(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);v["outer"+t]=function(t,n){return t&&_(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];v[e]=function(t,o){if(void 0===o)return t&&_(t,e,-1);if(t){b(t);return m(t)&&(o+=g(t,["padding","border"],n)),y(t,e,o)}}})),e.exports=o({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return a(e);!function(e,t){"static"===y(e,"position")&&(e.style.position="relative");var n=a(e),o={},r=void 0,c=void 0;for(c in t)t.hasOwnProperty(c)&&(r=parseFloat(y(e,c))||0,o[c]=r+t[c]-n[c]);y(e,o)}(e,t)},isWindow:O,each:p,css:y,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(O(e)){if(void 0===t)return l(e);window.scrollTo(t,i(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(O(e)){if(void 0===t)return i(e);window.scrollTo(l(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},v)},jBNB:function(e,t,n){"use strict";n.d(t,"a",(function(){return x}));var o=n("GRId"),r=n("TSYQ"),c=n.n(r),l=n("YLtl"),i=n("HSyU"),a=n("tI+e"),s=n("1ZqX"),u=n("K9lf"),d=n("1CF3"),b=n("JRTi"),p=n("l3Sj"),m=n("Zzu2"),f=n("iA5R");function h(e){let{title:t,rawContent:n,renderedContent:r,action:c,actionText:l,className:i}=e;return Object(o.createElement)("div",{className:i},Object(o.createElement)("div",{className:"block-editor-block-compare__content"},Object(o.createElement)("h2",{className:"block-editor-block-compare__heading"},t),Object(o.createElement)("div",{className:"block-editor-block-compare__html"},n),Object(o.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},Object(o.createElement)(o.RawHTML,null,Object(d.safeHTML)(r)))),Object(o.createElement)("div",{className:"block-editor-block-compare__action"},Object(o.createElement)(a.Button,{variant:"secondary",tabIndex:"0",onClick:c},l)))}var g=function(e){let{block:t,onKeep:n,onConvert:r,convertor:a,convertButtonText:s}=e;const u=(d=a(t),Object(l.castArray)(d).map(e=>Object(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<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function i(e,...t){return o.s.fun(e)?e(...t):e}const a=(e,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:n<d;let f,h=!1;const g=1,O=Math.ceil(e/g);for(let e=0;e<O&&(f=Math.abs(i)>r,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<c.length;o++)n=c[o],t.indexOf(n)>=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<n;o++){const e=d.current[o]||(d.current[o]=new le(null,u.flush)),n=c?c(o,e):t[o];n&&(b[o]=J(n))}}Object(r.useMemo)(()=>{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;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}const S=(e,t)=>e.forEach(t);function w(e,t,n){if(E.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],""+o);else for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const I=e=>E.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;n<F.length;n++){const o=F[n];H=o.priority,o.idle||(L(o),o.advance(e),o.idle||t.push(o))}return H=0,z=F,z.length=0,F=t,F.length>0}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<t.length-1&&!(t[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(s<t){if("identity"===l)return s;"clamp"===l&&(s=t)}if(s>n){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;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const pe=Symbol.for("FluidValue.get"),me=Symbol.for("FluidValue.observers"),fe=e=>Boolean(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<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,c.inputs))||(c={inputs:t,result:e()})}else c=n;return Object(k.useEffect)(()=>{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||a<l){l=a,c=n+("bottom"===s||!r&&"right"===s||r&&"left"===s?1:0)}}),c}function x(){let{rootClientId:e=""}=arguments.length>0&&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.length;o++)if(e[o]!==t[o])return!1;return!0}o={},r="undefined"!=typeof WeakMap,t.a=function(e,t){var n,a;function s(){n=r?new WeakMap:l()}function u(){var n,o,r,c,l,s=arguments.length;for(c=new Array(s),r=0;r<s;r++)c[r]=arguments[r];for(l=t.apply(null,c),(n=a(l)).isUniqueByDependants||(n.lastDependants&&!i(l,n.lastDependants,0)&&n.clear(),n.lastDependants=l),o=n.head;o;){if(i(o.args,c,1))return o!==n.head&&(o.prev.next=o.next,o.next&&(o.next.prev=o.prev),o.next=n.head,o.prev=null,n.head.prev=o,n.head=o),o.val;o=o.next}return o={val:e.apply(null,c)},c[0]=null,o.args=c,n.head&&(n.head.prev=o,o.next=n.head),n.head=o,o.val}return t||(t=c),a=r?function(e){var t,r,c,i,a,s=n,u=!0;for(t=0;t<e.length;t++){if(r=e[t],!(a=r)||"object"!=typeof a){u=!1;break}s.has(r)?s=s.get(r):(c=new WeakMap,s.set(r,c),s=c)}return s.has(o)||((i=l()).isUniqueByDependants=u,s.set(o,i)),s.get(o)}:function(){return n},u.getDependants=t,u.clear=s,s(),u}},pXCJ:function(e,t,n){"use strict";var o=n("wx14"),r=n("GRId"),c=n("YLtl"),l=n("tI+e"),i=n("1ZqX"),a=n("HSyU"),s=n("BhPs");var u=n("l3Sj");function d(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:c,groupingBlockName:d,onClose:b=(()=>{})}=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;c<l;c++){var s=t[c];if(s.removed){if(s.value=e.join(o.slice(a,a+s.count)),a+=s.count,c&&t[c-1].added){var u=t[c-1];t[c-1]=t[c],t[c]=u}}else{if(!s.added&&r){var d=n.slice(i,i+s.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.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,h=p&&0<=m&&m<s;if(f||h){if(!f||h&&d.newPos<p.newPos?(o=c(p),l.pushComponent(o.components,void 0,!0)):((o=d).newPos++,l.pushComponent(o.components,!0,void 0)),m=l.extractCommon(o,t,e,n),o.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+1<r&&i+1<c&&this.equals(t[l+1],n[i+1]);)l++,i++,a++;return a&&e.components.push({count:a}),e.newPos=l,i},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},suLj: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 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"}));t.a=c},"tI+e":function(e,t){e.exports=window.wp.components},tr0p:function(e,t,n){"use strict";n.r(t),n.d(t,"__experimentalGetBorderClassesAndStyles",(function(){return St})),n.d(t,"__experimentalUseBorderProps",(function(){return wt})),n.d(t,"__experimentalGetColorClassesAndStyles",(function(){return It})),n.d(t,"__experimentalUseColorProps",(function(){return Bt})),n.d(t,"__experimentalUseCustomSides",(function(){return Ze})),n.d(t,"__experimentalGetSpacingClassesAndStyles",(function(){return Tt})),n.d(t,"useCachedTruthy",(function(){return Pt})),n.d(t,"getColorClassName",(function(){return Rt.ic})),n.d(t,"getColorObjectByAttributeValues",(function(){return Rt.jc})),n.d(t,"getColorObjectByColorValue",(function(){return Rt.kc})),n.d(t,"createCustomColorsHOC",(function(){return Rt.hc})),n.d(t,"withColors",(function(){return Rt.wc})),n.d(t,"__experimentalGetGradientClass",(function(){return Rt.yb})),n.d(t,"getGradientValueBySlug",(function(){return Rt.pc})),n.d(t,"__experimentalGetGradientObjectByGradientValue",(function(){return Rt.zb})),n.d(t,"getGradientSlugByValue",(function(){return Rt.oc})),n.d(t,"__experimentalUseGradient",(function(){return Rt.Tb})),n.d(t,"getFontSize",(function(){return Rt.lc})),n.d(t,"getFontSizeClass",(function(){return Rt.mc})),n.d(t,"getFontSizeObjectByValue",(function(){return Rt.nc})),n.d(t,"FontSizePicker",(function(){return Rt.I})),n.d(t,"withFontSizes",(function(){return Rt.xc})),n.d(t,"AlignmentControl",(function(){return Rt.a})),n.d(t,"AlignmentToolbar",(function(){return Rt.b})),n.d(t,"Autocomplete",(function(){return Rt.c})),n.d(t,"BlockAlignmentControl",(function(){return Rt.d})),n.d(t,"BlockAlignmentToolbar",(function(){return Rt.e})),n.d(t,"__experimentalBlockFullHeightAligmentControl",(function(){return Rt.nb})),n.d(t,"__experimentalBlockAlignmentMatrixControl",(function(){return Rt.lb})),n.d(t,"BlockBreadcrumb",(function(){return Rt.f})),n.d(t,"__experimentalBlockContentOverlay",(function(){return Rt.mb})),n.d(t,"BlockContextProvider",(function(){return Rt.h})),n.d(t,"BlockControls",(function(){return Rt.i})),n.d(t,"BlockFormatControls",(function(){return Rt.m})),n.d(t,"BlockColorsStyleSelector",(function(){return Rt.g})),n.d(t,"BlockEdit",(function(){return Rt.j})),n.d(t,"useBlockEditContext",(function(){return Rt.rc})),n.d(t,"BlockIcon",(function(){return Rt.n})),n.d(t,"BlockNavigationDropdown",(function(){return Rt.r})),n.d(t,"__experimentalBlockVariationPicker",(function(){return Rt.pb})),n.d(t,"__experimentalBlockPatternSetup",(function(){return Rt.ob})),n.d(t,"__experimentalBlockVariationTransforms",(function(){return Rt.qb})),n.d(t,"BlockVerticalAlignmentToolbar",(function(){return Rt.A})),n.d(t,"BlockVerticalAlignmentControl",(function(){return Rt.z})),n.d(t,"__experimentalBorderRadiusControl",(function(){return Rt.rb})),n.d(t,"__experimentalBorderStyleControl",(function(){return Rt.sb})),n.d(t,"ButtonBlockerAppender",(function(){return Rt.C})),n.d(t,"ButtonBlockAppender",(function(){return Rt.B})),n.d(t,"ColorPalette",(function(){return Rt.D})),n.d(t,"ColorPaletteControl",(function(){return Rt.E})),n.d(t,"ContrastChecker",(function(){return Rt.F})),n.d(t,"__experimentalDuotoneControl",(function(){return Rt.vb})),n.d(t,"__experimentalFontAppearanceControl",(function(){return Rt.wb})),n.d(t,"__experimentalFontFamilyControl",(function(){return Rt.xb})),n.d(t,"__experimentalLetterSpacingControl",(function(){return Rt.Fb})),n.d(t,"__experimentalTextDecorationControl",(function(){return Rt.Pb})),n.d(t,"__experimentalTextTransformControl",(function(){return Rt.Qb})),n.d(t,"__experimentalColorGradientControl",(function(){return Rt.tb})),n.d(t,"__experimentalColorGradientSettingsDropdown",(function(){return Rt.ub})),n.d(t,"__experimentalPanelColorGradientSettings",(function(){return Rt.Mb})),n.d(t,"__experimentalImageEditor",(function(){return Rt.Bb})),n.d(t,"__experimentalImageEditingProvider",(function(){return Rt.Ab})),n.d(t,"__experimentalImageSizeControl",(function(){return Rt.Cb})),n.d(t,"InnerBlocks",(function(){return Rt.J})),n.d(t,"useInnerBlocksProps",(function(){return Rt.tc})),n.d(t,"InspectorControls",(function(){return Rt.M})),n.d(t,"InspectorAdvancedControls",(function(){return Rt.L})),n.d(t,"JustifyToolbar",(function(){return Rt.O})),n.d(t,"JustifyContentControl",(function(){return Rt.N})),n.d(t,"__experimentalLinkControl",(function(){return Rt.Hb})),n.d(t,"__experimentalLinkControlSearchInput",(function(){return Rt.Ib})),n.d(t,"__experimentalLinkControlSearchResults",(function(){return Rt.Kb})),n.d(t,"__experimentalLinkControlSearchItem",(function(){return Rt.Jb})),n.d(t,"LineHeightControl",(function(){return Rt.P})),n.d(t,"__experimentalListView",(function(){return Rt.Lb})),n.d(t,"MediaReplaceFlow",(function(){return Rt.R})),n.d(t,"MediaPlaceholder",(function(){return Rt.Q})),n.d(t,"MediaUpload",(function(){return Rt.S})),n.d(t,"MediaUploadCheck",(function(){return Rt.T})),n.d(t,"PanelColorSettings",(function(){return Rt.X})),n.d(t,"PlainText",(function(){return Rt.Y})),n.d(t,"__experimentalResponsiveBlockControl",(function(){return Rt.Ob})),n.d(t,"RichText",(function(){return Rt.ab})),n.d(t,"RichTextShortcut",(function(){return Rt.bb})),n.d(t,"RichTextToolbarButton",(function(){return Rt.cb})),n.d(t,"__unstableRichTextInputEvent",(function(){return Rt.ac})),n.d(t,"ToolSelector",(function(){return Rt.eb})),n.d(t,"__experimentalUnitControl",(function(){return Rt.Rb})),n.d(t,"URLInput",(function(){return Rt.gb})),n.d(t,"URLInputButton",(function(){return Rt.hb})),n.d(t,"URLPopover",(function(){return Rt.ib})),n.d(t,"__experimentalImageURLInputUI",(function(){return Rt.Db})),n.d(t,"withColorContext",(function(){return Rt.vc})),n.d(t,"__unstableBlockSettingsMenuFirstItem",(function(){return Rt.Wb})),n.d(t,"__unstableInserterMenuExtension",(function(){return Rt.Zb})),n.d(t,"__experimentalPreviewOptions",(function(){return Rt.Nb})),n.d(t,"__experimentalUseResizeCanvas",(function(){return Rt.Vb})),n.d(t,"BlockInspector",(function(){return Rt.o})),n.d(t,"BlockList",(function(){return Rt.p})),n.d(t,"useBlockProps",(function(){return Rt.sc})),n.d(t,"__experimentalLayoutStyle",(function(){return Rt.Eb})),n.d(t,"BlockMover",(function(){return Rt.q})),n.d(t,"BlockPreview",(function(){return Rt.s})),n.d(t,"__experimentalUseBlockPreview",(function(){return Rt.Sb})),n.d(t,"BlockSelectionClearer",(function(){return Rt.t})),n.d(t,"__unstableUseBlockSelectionClearer",(function(){return Rt.bc})),n.d(t,"BlockSettingsMenu",(function(){return Rt.u})),n.d(t,"BlockSettingsMenuControls",(function(){return Rt.v})),n.d(t,"BlockTitle",(function(){return Rt.w})),n.d(t,"BlockToolbar",(function(){return Rt.x})),n.d(t,"BlockTools",(function(){return Rt.y})),n.d(t,"CopyHandler",(function(){return Rt.G})),n.d(t,"__unstableUseClipboardHandler",(function(){return Rt.dc})),n.d(t,"DefaultBlockAppender",(function(){return Rt.H})),n.d(t,"__unstableEditorStyles",(function(){return Rt.Xb})),n.d(t,"Inserter",(function(){return Rt.K})),n.d(t,"__experimentalLibrary",(function(){return Rt.Gb})),n.d(t,"BlockEditorKeyboardShortcuts",(function(){return Rt.k})),n.d(t,"MultiSelectScrollIntoView",(function(){return Rt.U})),n.d(t,"NavigableToolbar",(function(){return Rt.V})),n.d(t,"ObserveTyping",(function(){return Rt.W})),n.d(t,"__unstableUseTypingObserver",(function(){return Rt.gc})),n.d(t,"__unstableUseMouseMoveTypingReset",(function(){return Rt.ec})),n.d(t,"PreserveScrollInReorder",(function(){return Rt.Z})),n.d(t,"SkipToSelectedBlock",(function(){return Rt.db})),n.d(t,"Typewriter",(function(){return Rt.fb})),n.d(t,"__unstableUseTypewriter",(function(){return Rt.fc})),n.d(t,"Warning",(function(){return Rt.jb})),n.d(t,"WritingFlow",(function(){return Rt.kb})),n.d(t,"__unstableUseCanvasClickRedirect",(function(){return Rt.cc})),n.d(t,"useBlockDisplayInformation",(function(){return Rt.qc})),n.d(t,"__unstableIframe",(function(){return Rt.Yb})),n.d(t,"__experimentalUseNoRecursiveRenders",(function(){return Rt.Ub})),n.d(t,"BlockEditorProvider",(function(){return Rt.l})),n.d(t,"useSetting",(function(){return Rt.uc})),n.d(t,"transformStyles",(function(){return Nt.c})),n.d(t,"validateThemeColors",(function(){return Nt.d})),n.d(t,"validateThemeGradients",(function(){return Nt.e})),n.d(t,"__experimentalGetMatchingVariation",(function(){return Nt.a})),n.d(t,"getPxFromCssUnit",(function(){return Nt.b})),n.d(t,"storeConfig",(function(){return Ot.b})),n.d(t,"store",(function(){return Ot.a})),n.d(t,"SETTINGS_DEFAULTS",(function(){return Mt.b}));var o=n("HSyU"),r=n("g56x");Object(r.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&Object(o.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var c=n("wx14"),l=n("GRId"),i=n("TSYQ"),a=n.n(i),s=n("YLtl"),u=n("K9lf"),d=n("fOYa"),b=n("vtO0"),p=n("K/rC");const m=["left","center","right","wide","full"],f=["wide","full"];function h(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)?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:l<s?a:s,Math.sqrt((l-d)**2+(i-u)**2)}function r(e,t){let n,r,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return c.forEach(c=>{const l=o(e,t,c);(void 0===n||l<n)&&(n=l,r=c)}),[n,r]}n.d(t,"a",(function(){return r}))},vSu0:function(e,t,n){"use strict";var o=n("YLtl"),r=n("K9lf"),c=n("eGrx"),l=n.n(c);const i=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;var a=function(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 c(){const e={line:n,column:o};return function(t){return t.position=new l(e),f(),t}}function l(e){this.start=e,this.end={line:n,column:o},this.source=t.source}l.prototype.content=e;const a=[];function u(r){const c=new Error(t.source+":"+n+":"+o+": "+r);if(c.reason=r,c.filename=t.source,c.line=n,c.column=o,c.source=e,!t.silent)throw c;a.push(c)}function d(){return m(/^{\s*/)}function b(){return m(/^}/)}function p(){let t;const n=[];for(f(),h(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),h(n));return n}function m(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function f(){m(/^\s*/)}function h(e){let t;for(e=e||[];t=g();)!1!==t&&e.push(t);return e}function g(){const t=c();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 u("End of comment missing");const l=e.slice(2,n-2);return o+=2,r(l),e=e.slice(n),o+=2,t({type:"comment",comment:l})}function O(){const e=m(/^([^{]+)/);if(e)return s(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=c();let t=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=s(t[0]),!m(/^:\s*/))return u("property missing ':'");const n=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(i,""),value:n?s(n[0]).replace(i,""):""});return m(/^[;\s]*/),o}function j(){const e=[];if(!d())return u("missing '{'");let t;for(h(e);t=v();)!1!==t&&(e.push(t),h(e));return b()?e:u("missing '}'")}function k(){let e;const t=[],n=c();for(;e=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),m(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:j()})}const _=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=c(),o=m(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=c();let t=m(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=m(/^([-\w]+)\s*/),!t)return u("@keyframes missing name");const o=t[1];if(!d())return u("@keyframes missing '{'");let r,l=h();for(;r=k();)l.push(r),l=l.concat(h());return b()?e({type:"keyframes",name:o,vendor:n,keyframes:l}):u("@keyframes missing '}'")}()||function(){const e=c(),t=m(/^@media *([^{]+)/);if(!t)return;const n=s(t[1]);if(!d())return u("@media missing '{'");const o=h().concat(p());return b()?e({type:"media",media:n,rules:o}):u("@media missing '}'")}()||function(){const e=c(),t=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:s(t[1]),media:s(t[2])})}()||function(){const e=c(),t=m(/^@supports *([^{]+)/);if(!t)return;const n=s(t[1]);if(!d())return u("@supports missing '{'");const o=h().concat(p());return b()?e({type:"supports",supports:n,rules:o}):u("@supports missing '}'")}()||_()||y()||E()||function(){const e=c(),t=m(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=s(t[1]),o=s(t[2]);if(!d())return u("@document missing '{'");const r=h().concat(p());return b()?e({type:"document",document:o,vendor:n,rules:r}):u("@document missing '}'")}()||function(){const e=c();if(!m(/^@page */))return;const t=O()||[];if(!d())return u("@page missing '{'");let n,o=h();for(;n=v();)o.push(n),o=o.concat(h());return b()?e({type:"page",selectors:t,declarations:o}):u("@page missing '}'")}()||function(){const e=c();if(!m(/^@host\s*/))return;if(!d())return u("@host missing '{'");const t=h().concat(p());return b()?e({type:"host",rules:t}):u("@host missing '}'")}()||function(){const e=c();if(!m(/^@font-face\s*/))return;if(!d())return u("@font-face missing '{'");let t,n=h();for(;t=v();)n.push(t),n=n.concat(h());return b()?e({type:"font-face",declarations:n}):u("@font-face missing '}'")}()}function w(){const e=c(),t=O();return t?(h(),e({type:"rule",selectors:t,declarations:j()})):u("selector missing")}return function e(t,n){const o=t&&"string"==typeof t.type,r=o?t:n;for(const n in t){const o=t[n];Array.isArray(o)?o.forEach((function(t){e(t,r)})):o&&"object"==typeof o&&e(o,r)}o&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:n||null});return t}(function(){const e=p();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:a}}}())};function s(e){return e?e.replace(/^\s+|\s+$/g,""):""}var u=n("P7XM"),d=n.n(u),b=p;function p(e){this.options=e||{}}p.prototype.emit=function(e){return e},p.prototype.visit=function(e){return this[e.type](e)},p.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;o<r;o++)n+=this.visit(e[o]),t&&o<r-1&&(n+=this.emit(t));return n};var m=f;function f(e){b.call(this,e)}d()(f,b),f.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},f.prototype.comment=function(e){return this.emit("",e.position)},f.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},f.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},f.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},f.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},f.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},f.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},f.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},f.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},f.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},f.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},f.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},f.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},f.prototype.rule=function(e){const t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},f.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var h=g;function g(e){e=e||{},b.call(this,e),this.indentation=e.indent}d()(g,b),g.prototype.compile=function(e){return this.stylesheet(e)},g.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},g.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},g.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},g.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},g.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},g.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},g.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},g.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},g.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},g.prototype.keyframe=function(e){const t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},g.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},g.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},g.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},g.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},g.prototype.rule=function(e){const t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},g.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},g.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var O=function(e,t){try{const r=a(e),c=l.a.map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)}));return n=c,((o=o||{}).compress?new m(o):new h(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function v(e){return 0!==e.value.indexOf("data:")&&0!==e.value.indexOf("#")&&(t=e.value,!/^\/(?!\/)/.test(t)&&!function(e){return/^(?:https?:)?\/\//.test(e)}(e.value));var t}function j(e,t){return new URL(e,t).toString()}var k=e=>t=>{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<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return o}))},wzfx: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.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"}));t.a=c},xBDm:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n("GRId"),r=n("tI+e"),c=n("l3Sj"),l=n("v5LD");function i(e){let{value:t,onChange:n,__unstableInputWidth:i="60px"}=e;const a=Object(r.__experimentalUseCustomUnits)({availableUnits:Object(l.a)("spacing.units")||["px","em","rem"],defaultValues:{px:"2",em:".2",rem:".2"}});return Object(o.createElement)(r.__experimentalUnitControl,{label:Object(c.__)("Letter-spacing"),value:t,__unstableInputWidth:i,units:a,onChange:n})}},xCFn:function(e,t,n){"use strict";n.d(t,"a",(function(){return T}));var o=n("GRId"),r=n("YLtl"),c=n("TSYQ"),l=n.n(c),i=n("HSyU"),a=n("tI+e"),s=n("1ZqX"),u=n("hF7m"),d=n("K9lf"),b=n("1CF3"),p=n("wx14"),m=n("xN+R"),f=n("RxS6"),h=n("gdqT"),g=n("l3Sj"),O=n("f8JO"),v=n("7SSY"),j=n("BhPs"),k=n("ZAjO"),_=n("wC17");var y=function(e){let{clientId:t,rootClientId:n,blockElement:r}=e;const c=Object(_.a)(t),u=Object(s.useSelect)(e=>{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<o&&e===t&&(o-=1),U(S,e,t,o),H(S),G(null)}if(j||v||k||_)if(y)e.preventDefault(),H(y);else if(a&&m){let t;j?(t=b.focus.tabbable.findNext(r),t||(t=r.ownerDocument.defaultView.frameElement,t=b.focus.tabbable.findNext(t))):t=b.focus.tabbable.findPrevious(r),t&&(e.preventDefault(),t.focus(),V())}},label:T,className:"block-selection-button_select-button"},Object(o.createElement)(O.a,{clientId:t})))))},E=n("JUfZ"),C=n("qrxh"),S=n("PKbb"),w=n("2z9l");function I(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isCaretWithinFormattedText:c,getSettings:l,getLastMultiSelectedBlockClientId:i}=e(j.a);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),isCaretWithinFormattedText:c(),hasMultiSelection:o(),hasFixedToolbar:l().hasFixedToolbar,lastClientId:i()}}function x(e){let{clientId:t,rootClientId:n,isValid:r,isEmptyDefaultBlock:c,capturingClientId:i,__unstablePopoverSlot:p,__unstableContentRef:m}=e;const{isNavigationMode:f,isMultiSelecting:h,isTyping:g,isCaretWithinFormattedText:O,hasMultiSelection:v,hasFixedToolbar:k,lastClientId:_}=Object(s.useSelect)(I,[]),x=Object(s.useSelect)(e=>{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 <kbd>/</kbd> to quickly insert new blocks."),{kbd:Object(o.createElement)("kbd",null)}),Object(o.createInterpolateElement)(Object(c.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:Object(o.createElement)("kbd",null)}),Object(o.createInterpolateElement)(Object(c.__)("Outdent a list by pressing <kbd>backspace</kbd> 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;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(9196),a=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,l({},e,{innerRef:t}))}))},773:function(e,t,n){"use strict";var o=n(5438);t.Z=o.TextareaAutosize},3124:function(e){var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function o(e,t,n){var o=[],i=[],u=!0;return function e(d){var p=n?r(d):d,m={},f=!0,h={node:p,node_:d,path:[].concat(o),parent:i[i.length-1],parents:i,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){h.isRoot||(h.parent.node[h.key]=e),h.node=e,t&&(f=!1)},delete:function(e){delete h.parent.node[h.key],e&&(f=!1)},remove:function(e){s(h.parent.node)?h.parent.node.splice(h.key,1):delete h.parent.node[h.key],e&&(f=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){f=!1}};if(!u)return h;function g(){if("object"==typeof h.node&&null!==h.node){h.keys&&h.node_===h.node||(h.keys=l(h.node)),h.isLeaf=0==h.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){h.circular=i[e];break}}else h.isLeaf=!0,h.keys=null;h.notLeaf=!h.isLeaf,h.notRoot=!h.isRoot}g();var v=t.call(h,h.node);return void 0!==v&&h.update&&h.update(v),m.before&&m.before.call(h,h.node),f?("object"!=typeof h.node||null===h.node||h.circular||(i.push(h),g(),a(h.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(h,h.node[t],t);var l=e(h.node[t]);n&&c.call(h.node,t)&&(h.node[t]=l.node),l.isLast=r==h.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(h,l),o.pop()})),i.pop()),m.after&&m.after.call(h,h.node),h):h}(e).node}function r(e){if("object"==typeof e&&null!==e){var t;if(s(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if(function(e){return"[object RegExp]"===i(e)}(e))t=new RegExp(e);else if(function(e){return"[object Error]"===i(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===i(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===i(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===i(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},o=function(){};o.prototype=n,t=new o}return a(l(e),(function(n){t[n]=e[n]})),t}return e}n.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o)){t=void 0;break}t=t[o]}return t},n.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o))return!1;t=t[o]}return!0},n.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},n.prototype.map=function(e){return o(this.value,e,!0)},n.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},n.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},n.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},n.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},n.prototype.clone=function(){var e=[],t=[];return function n(o){for(var i=0;i<e.length;i++)if(e[i]===o)return t[i];if("object"==typeof o&&null!==o){var s=r(o);return e.push(o),t.push(s),a(l(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function i(e){return Object.prototype.toString.call(e)}var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};a(l(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),r=new n(t);return r[e].apply(r,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},9196:function(e){"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentControl:function(){return Xg},AlignmentToolbar:function(){return Qg},Autocomplete:function(){return tv},BlockAlignmentControl:function(){return zo},BlockAlignmentToolbar:function(){return Vo},BlockBreadcrumb:function(){return iv},BlockColorsStyleSelector:function(){return dv},BlockContextProvider:function(){return ir},BlockControls:function(){return qn},BlockEdit:function(){return ur},BlockEditorKeyboardShortcuts:function(){return R_},BlockEditorProvider:function(){return ic},BlockFormatControls:function(){return Kn},BlockIcon:function(){return oc},BlockInspector:function(){return T_},BlockList:function(){return Mm},BlockMover:function(){return fp},BlockNavigationDropdown:function(){return Lv},BlockPreview:function(){return Tu},BlockSelectionClearer:function(){return cc},BlockSettingsMenu:function(){return rm},BlockSettingsMenuControls:function(){return em},BlockTitle:function(){return Zd},BlockToolbar:function(){return lm},BlockTools:function(){return N_},BlockVerticalAlignmentControl:function(){return nb},BlockVerticalAlignmentToolbar:function(){return ob},ButtonBlockAppender:function(){return Ud},ButtonBlockerAppender:function(){return Hd},ColorPalette:function(){return lb},ColorPaletteControl:function(){return ib},ContrastChecker:function(){return Df},CopyHandler:function(){return Gp},DefaultBlockAppender:function(){return zd},FontSizePicker:function(){return gh},InnerBlocks:function(){return xm},Inserter:function(){return Fd},InspectorAdvancedControls:function(){return Jo},InspectorControls:function(){return er},JustifyContentControl:function(){return ho},JustifyToolbar:function(){return go},LineHeightControl:function(){return Zf},MediaPlaceholder:function(){return xk},MediaReplaceFlow:function(){return Ck},MediaUpload:function(){return yk},MediaUploadCheck:function(){return Ek},MultiSelectScrollIntoView:function(){return L_},NavigableToolbar:function(){return op},ObserveTyping:function(){return F_},PanelColorSettings:function(){return Tk},PlainText:function(){return t_},PreserveScrollInReorder:function(){return z_},RichText:function(){return Zk},RichTextShortcut:function(){return r_},RichTextToolbarButton:function(){return l_},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return C_},ToolSelector:function(){return a_},Typewriter:function(){return G_},URLInput:function(){return Yb},URLInputButton:function(){return p_},URLPopover:function(){return Bk},Warning:function(){return pr},WritingFlow:function(){return kc},__experimentalBlockAlignmentMatrixControl:function(){return rv},__experimentalBlockContentOverlay:function(){return sv},__experimentalBlockFullHeightAligmentControl:function(){return ov},__experimentalBlockPatternSetup:function(){return Kv},__experimentalBlockVariationPicker:function(){return Dv},__experimentalBlockVariationTransforms:function(){return Yv},__experimentalBorderRadiusControl:function(){return af},__experimentalBorderStyleControl:function(){return ff},__experimentalColorGradientControl:function(){return Fm},__experimentalColorGradientSettingsDropdown:function(){return zm},__experimentalDuotoneControl:function(){return vg},__experimentalFontAppearanceControl:function(){return Xf},__experimentalFontFamilyControl:function(){return ah},__experimentalGetBorderClassesAndStyles:function(){return Ng},__experimentalGetColorClassesAndStyles:function(){return Mg},__experimentalGetGradientClass:function(){return Ef},__experimentalGetGradientObjectByGradientValue:function(){return wf},__experimentalGetMatchingVariation:function(){return qv},__experimentalGetSpacingClassesAndStyles:function(){return Ag},__experimentalImageEditingProvider:function(){return Mb},__experimentalImageEditor:function(){return Gb},__experimentalImageSizeControl:function(){return $b},__experimentalImageURLInputUI:function(){return __},__experimentalLayoutStyle:function(){return Mo},__experimentalLetterSpacingControl:function(){return Oh},__experimentalLibrary:function(){return P_},__experimentalLinkControl:function(){return bk},__experimentalLinkControlSearchInput:function(){return ak},__experimentalLinkControlSearchItem:function(){return Zb},__experimentalLinkControlSearchResults:function(){return tk},__experimentalListView:function(){return Mv},__experimentalPanelColorGradientSettings:function(){return Lf},__experimentalPreviewOptions:function(){return y_},__experimentalResponsiveBlockControl:function(){return o_},__experimentalTextDecorationControl:function(){return Sh},__experimentalTextTransformControl:function(){return Rh},__experimentalUnitControl:function(){return c_},__experimentalUseBlockPreview:function(){return Nu},__experimentalUseBorderProps:function(){return Pg},__experimentalUseColorProps:function(){return Lg},__experimentalUseCustomSides:function(){return lg},__experimentalUseGradient:function(){return Bf},__experimentalUseNoRecursiveRenders:function(){return q_},__experimentalUseResizeCanvas:function(){return E_},__unstableBlockSettingsMenuFirstItem:function(){return Yp},__unstableEditorStyles:function(){return Su},__unstableIframe:function(){return Ec},__unstableInserterMenuExtension:function(){return Id},__unstableRichTextInputEvent:function(){return i_},__unstableUseBlockSelectionClearer:function(){return ac},__unstableUseCanvasClickRedirect:function(){return $_},__unstableUseClipboardHandler:function(){return Up},__unstableUseMouseMoveTypingReset:function(){return D_},__unstableUseTypewriter:function(){return U_},__unstableUseTypingObserver:function(){return O_},createCustomColorsHOC:function(){return Vg},getColorClassName:function(){return Wm},getColorObjectByAttributeValues:function(){return Um},getColorObjectByColorValue:function(){return Gm},getFontSize:function(){return mh},getFontSizeClass:function(){return hh},getFontSizeObjectByValue:function(){return fh},getGradientSlugByValue:function(){return Sf},getGradientValueBySlug:function(){return Cf},getPxFromCssUnit:function(){return iy},store:function(){return Fn},storeConfig:function(){return On},transformStyles:function(){return Eu},useBlockDisplayInformation:function(){return Qd},useBlockEditContext:function(){return Un},useBlockProps:function(){return ja},useCachedTruthy:function(){return Dg},useInnerBlocksProps:function(){return Im},useSetting:function(){return po},validateThemeColors:function(){return Y_},validateThemeGradients:function(){return X_},withColorContext:function(){return rb},withColors:function(){return Hg},withFontSizes:function(){return Gg}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return xt},__experimentalGetAllowedBlocks:function(){return at},__experimentalGetAllowedPatterns:function(){return pt},__experimentalGetBlockListSettingsForBlocks:function(){return bt},__experimentalGetDirectInsertBlock:function(){return ct},__experimentalGetLastBlockAttributeChanges:function(){return yt},__experimentalGetParsedPattern:function(){return ut},__experimentalGetPatternTransformItems:function(){return ft},__experimentalGetPatternsByBlockTypes:function(){return mt},__experimentalGetReusableBlockTitle:function(){return kt},__unstableGetBlockWithoutInnerBlocks:function(){return W},__unstableGetClientIdWithClientIdsTree:function(){return j},__unstableGetClientIdsTree:function(){return K},__unstableIsLastBlockChangeIgnored:function(){return _t},areInnerBlocksControlled:function(){return It},canInsertBlockType:function(){return qe},canInsertBlocks:function(){return Ye},canMoveBlock:function(){return Ze},canMoveBlocks:function(){return Je},canRemoveBlock:function(){return Xe},canRemoveBlocks:function(){return Qe},didAutomaticChange:function(){return St},getAdjacentBlockClientId:function(){return pe},getBlock:function(){return G},getBlockAttributes:function(){return U},getBlockCount:function(){return Z},getBlockHierarchyRootClientId:function(){return ue},getBlockIndex:function(){return Ie},getBlockInsertionPoint:function(){return He},getBlockListSettings:function(){return ht},getBlockMode:function(){return Le},getBlockName:function(){return V},getBlockOrder:function(){return Be},getBlockParents:function(){return ae},getBlockParentsByBlockName:function(){return ce},getBlockRootClientId:function(){return se},getBlockSelectionEnd:function(){return ne},getBlockSelectionStart:function(){return te},getBlockTransformItems:function(){return it},getBlocks:function(){return $},getBlocksByClientId:function(){return Q},getClientIdsOfDescendants:function(){return q},getClientIdsWithDescendants:function(){return Y},getDraggedBlockClientIds:function(){return Oe},getFirstMultiSelectedBlockClientId:function(){return ke},getGlobalBlockCount:function(){return X},getInserterItems:function(){return lt},getLastMultiSelectedBlockClientId:function(){return _e},getLowestCommonAncestorWithSelectedBlock:function(){return de},getMultiSelectedBlockClientIds:function(){return ve},getMultiSelectedBlocks:function(){return be},getMultiSelectedBlocksEndClientId:function(){return Se},getMultiSelectedBlocksStartClientId:function(){return we},getNextBlockClientId:function(){return fe},getPreviousBlockClientId:function(){return me},getSelectedBlock:function(){return ie},getSelectedBlockClientId:function(){return le},getSelectedBlockClientIds:function(){return ge},getSelectedBlockCount:function(){return oe},getSelectedBlocksInitialCaretPosition:function(){return he},getSelectionEnd:function(){return ee},getSelectionStart:function(){return J},getSettings:function(){return gt},getTemplate:function(){return We},getTemplateLock:function(){return $e},hasBlockMovingClientId:function(){return wt},hasInserterItems:function(){return st},hasMultiSelection:function(){return Pe},hasSelectedBlock:function(){return re},hasSelectedInnerBlock:function(){return Te},isAncestorBeingDragged:function(){return ze},isAncestorMultiSelected:function(){return Ce},isBlockBeingDragged:function(){return Fe},isBlockHighlighted:function(){return Bt},isBlockInsertionPointVisible:function(){return Ue},isBlockMultiSelected:function(){return Ee},isBlockSelected:function(){return xe},isBlockValid:function(){return H},isBlockWithinSelection:function(){return Ne},isCaretWithinFormattedText:function(){return Ve},isDraggingBlocks:function(){return De},isFirstMultiSelectedBlock:function(){return ye},isLastBlockChangePersistent:function(){return vt},isMultiSelecting:function(){return Me},isNavigationMode:function(){return Ct},isSelectionEnabled:function(){return Re},isTyping:function(){return Ae},isValidTemplate:function(){return Ge},wasBlockJustInserted:function(){return Tt}});var t={};n.r(t),n.d(t,{__unstableMarkAutomaticChange:function(){return In},__unstableMarkLastChangeAsPersistent:function(){return Sn},__unstableMarkNextChangeAsNotPersistent:function(){return Bn},__unstableSaveReusableBlock:function(){return wn},clearSelectedBlock:function(){return jt},duplicateBlocks:function(){return Nn},enterFormattedText:function(){return bn},exitFormattedText:function(){return kn},flashBlock:function(){return Ln},hideInsertionPoint:function(){return ln},insertAfterBlock:function(){return Mn},insertBeforeBlock:function(){return Pn},insertBlock:function(){return nn},insertBlocks:function(){return on},insertDefaultBlock:function(){return yn},mergeBlocks:function(){return cn},moveBlockToPosition:function(){return tn},moveBlocksDown:function(){return Zt},moveBlocksToPosition:function(){return en},moveBlocksUp:function(){return Jt},multiSelect:function(){return $t},receiveBlocks:function(){return Ot},removeBlock:function(){return dn},removeBlocks:function(){return un},replaceBlock:function(){return Xt},replaceBlocks:function(){return Yt},replaceInnerBlocks:function(){return pn},resetBlocks:function(){return Lt},resetSelection:function(){return Dt},selectBlock:function(){return Vt},selectNextBlock:function(){return Ut},selectPreviousBlock:function(){return Ht},selectionChange:function(){return _n},setBlockMovingClientId:function(){return Tn},setHasControlledInnerBlocks:function(){return An},setNavigationMode:function(){return xn},setTemplateValidity:function(){return sn},showInsertionPoint:function(){return rn},startDraggingBlocks:function(){return gn},startMultiSelect:function(){return Gt},startTyping:function(){return fn},stopDraggingBlocks:function(){return vn},stopMultiSelect:function(){return Wt},stopTyping:function(){return hn},synchronizeTemplate:function(){return an},toggleBlockHighlight:function(){return Rn},toggleBlockMode:function(){return mn},toggleSelection:function(){return Kt},updateBlock:function(){return zt},updateBlockAttributes:function(){return Ft},updateBlockListSettings:function(){return En},updateSettings:function(){return Cn},validateBlocksToTemplate:function(){return At}});var r=window.wp.blocks,l=window.wp.hooks;function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},i.apply(this,arguments)}(0,l.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,r.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var s=window.wp.element,a=n(4403),c=n.n(a),u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data;var f={default:(0,p.createSlotFill)("BlockControls"),block:(0,p.createSlotFill)("BlockControlsBlock"),inline:(0,p.createSlotFill)("BlockFormatControls"),other:(0,p.createSlotFill)("BlockControlsOther"),parent:(0,p.createSlotFill)("BlockControlsParent")},h=window.wp.i18n;const g={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,h.__)("Black"),slug:"black",color:"#000000"},{name:(0,h.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,h.__)("White"),slug:"white",color:"#ffffff"},{name:(0,h.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,h.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,h.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,h.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,h.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,h.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,h.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,h.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,h.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,h._x)("Small","font size name"),size:13,slug:"small"},{name:(0,h._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,h._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,h._x)("Large","font size name"),size:36,slug:"large"},{name:(0,h._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,h.__)("Thumbnail")},{slug:"medium",name:(0,h.__)("Medium")},{slug:"large",name:(0,h.__)("Large")},{slug:"full",name:(0,h.__)("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:(0,h.__)("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:(0,h.__)("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:(0,h.__)("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:(0,h.__)("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:(0,h.__)("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:(0,h.__)("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:(0,h.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,h.__)("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:(0,h.__)("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:(0,h.__)("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:(0,h.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,h.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}]};function b(e,t,n){return[...e.slice(0,n),...(0,u.castArray)(t),...e.slice(n)]}function k(e,t,n){let o=arguments.length>3&&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<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(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<e.length;o++)if(e[o]!==t[o])return!1;return!0}function D(e,t){var n,o;function r(){n=P?new WeakMap:L()}function l(){var n,r,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for(s=t.apply(null,i),(n=o(s)).isUniqueByDependants||(n.lastDependants&&!A(s,n.lastDependants,0)&&n.clear(),n.lastDependants=s),r=n.head;r;){if(A(r.args,i,1))return r!==n.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=n.head,r.prev=null,n.head.prev=r,n.head=r),r.val;r=r.next}return r={val:e.apply(null,i)},i[0]=null,r.args=i,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return t||(t=R),o=P?function(e){var t,o,r,l,i,s=n,a=!0;for(t=0;t<e.length;t++){if(o=e[t],!(i=o)||"object"!=typeof i){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has(N)||((l=L()).isUniqueByDependants=a,s.set(N,l)),s.get(N)}:function(){return n},l.getDependants=t,l.clear=r,r(),l}N={},P="undefined"!=typeof WeakMap;var O=window.wp.primitives;var F=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"}));const z=[];function V(e,t){const n=e.blocks.byClientId[t],o="core/social-link";if("web"!==s.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes[t],{service:r}=n;return r?`core/social-link-${r}`:o}return n?n.name:null}function H(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function U(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function G(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const W=D(((e,t)=>{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;e<i&&o[e]===r[e];e++)l=o[e];return l}function pe(e,t){let n=arguments.length>2&&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&&o<n.length-1}function Pe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Me(e){return e.isMultiSelecting}function Re(e){return e.isSelectionEnabled}function Le(e,t){return e.blocksMode[t]||"visual"}function Ae(e){return e.isTyping}function De(e){return!!e.draggedBlocks.length}function Oe(e){return e.draggedBlocks}function Fe(e,t){return e.draggedBlocks.includes(t)}function ze(e,t){if(!De(e))return!1;const n=ae(e,t);return(0,u.some)(n,(t=>Fe(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*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\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<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s((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;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}const Kr=(e,t)=>e.forEach(t);function qr(e,t,n){if($r.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const Yr=e=>$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;n<il.length;n++){const o=il[n];al=o.priority,o.idle||(ol(o),o.advance(e),o.idle||t.push(o))}return al=0,sl=il,sl.length=0,il=t,il.length>0}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<t.length-1&&!(t[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(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>n){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;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Rl.apply(this,arguments)}const Ll=Symbol.for("FluidValue.get"),Al=Symbol.for("FluidValue.observers"),Dl=e=>Boolean(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<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},wi.apply(this,arguments)}const Si=(e,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<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ti.apply(this,arguments)}function Ni(e,...t){return $r.fun(e)?e(...t):e}const Pi=(e,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:n<c;let f,h=!1;const g=1,v=Math.ceil(e/g);for(let e=0;e<v&&(f=Math.abs(i)>o,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<l.length;o++)n=l[o],t.indexOf(n)>=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<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,l.inputs));n||(l={inputs:t,result:e()})}else l=n;return(0,Ur.useEffect)((()=>{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<n;r++){const e=a.current[r]||(a.current[r]=new Ps(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=ws(n))}}(0,Ur.useMemo)((()=>{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<l.length;o++)n=l[o],t.indexOf(n)>=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 <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Outdent a list by pressing <kbd>backspace</kbd> 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<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},Wc=function(e){return"string"==typeof e?Gc(e.trim(),Uc.string):"object"==typeof e&&null!==e?Gc(e,Uc.object):[null,void 0]},$c=function(e,t){var n=Oc(e);return{h:n.h,s:Bc(n.s+100*t,0,100),l:n.l,a:n.a}},jc=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Kc=function(e,t){var n=Oc(e);return{h:n.h,s:n.s,l:Bc(n.l+100*t,0,100),a:n.a}},qc=function(){function e(e){this.parsed=Wc(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return Sc(jc(this.rgba),2)},e.prototype.isDark=function(){return jc(this.rgba)<.5},e.prototype.isLight=function(){return jc(this.rgba)>=.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<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var Jc=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},eu=function(e){return.2126*Jc(e.r)+.7152*Jc(e.g)+.0722*Jc(e.b)};function tu(e){e.prototype.luminance=function(){return e=eu(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,r,l,i,s,a,c=t instanceof e?t:new e(t);return l=this.rgba,i=c.toRgb(),n=(s=eu(l))>(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;o<r;o++)n+=this.visit(e[o]),t&&o<r-1&&(n+=this.emit(t));return n};var pu=mu;function mu(e){uu.call(this,e)}cu()(mu,uu),mu.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},mu.prototype.comment=function(e){return this.emit("",e.position)},mu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},mu.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},mu.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},mu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},mu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},mu.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},mu.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},mu.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},mu.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},mu.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},mu.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},mu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},mu.prototype.rule=function(e){const t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},mu.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var fu=hu;function hu(e){e=e||{},uu.call(this,e),this.indentation=e.indent}cu()(hu,uu),hu.prototype.compile=function(e){return this.stylesheet(e)},hu.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},hu.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},hu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},hu.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},hu.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},hu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},hu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},hu.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},hu.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},hu.prototype.keyframe=function(e){const t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},hu.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},hu.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},hu.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},hu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},hu.prototype.rule=function(e){const t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},hu.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},hu.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var gu=function(e,t){try{const r=lu(e),l=ou().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)}));return n=l,((o=o||{}).compress?new pu(o):new fu(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function vu(e){return 0!==e.value.indexOf("data:")&&0!==e.value.indexOf("#")&&(t=e.value,!/^\/(?!\/)/.test(t)&&!function(e){return/^(?:https?:)?\/\//.test(e)}(e.value));var t}function bu(e,t){return new URL(e,t).toString()}var ku=e=>t=>{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<r;o+=t)n.push(e.slice(o,o+t));return n}(t,3).map(((e,t)=>(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.clientY<k.top)||"vertical"===m&&(t.clientX>k.right||t.clientX<k.left))return void(l()&&p());const _=r(b);0!==_?u(d,_,{__unstableWithInserter:!0}):l()&&p()}}),[e,n,o,r,l,i,u,p,a])}const Yd="undefined"==typeof window?e=>{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<l){const e=Math.max(l-50,0),n=Math.max(l-i-50,0)/e;t.current=-25*n}else t.current=0}),[]),()=>{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<o&&e===t&&(o-=1),A(F,e,t,o),M(F),L(null)}if(b||v||_||y)if(E)e.preventDefault(),M(E);else if(a&&m){let t;b?(t=rr.focus.tabbable.findNext(o),t||(t=o.ownerDocument.defaultView.frameElement,t=rr.focus.tabbable.findNext(t))):t=rr.focus.tabbable.findPrevious(o),t&&(e.preventDefault(),t.focus(),R())}},label:E,className:"block-selection-button_select-button"},(0,s.createElement)(Zd,{clientId:t})))))};function tp(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}function np(e,t,n,o,r){const[l]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!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=>`<img src="${(0,Vp.createBlobURL)(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&&r<t?t-s:t)}}}function km(e,t){const n=(0,m.useSelect)((e=>e(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:i<c?a:c,Math.sqrt((i-d)**2+(s-u)**2)}function ym(e,t){let n,o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=_m(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function Em(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,h.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=ym(t,s,o);if(void 0===i||a<i){i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0)}})),l}function Cm(){let{rootClientId:e=""}=arguments.length>0&&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()<n.brightness()?(0,h.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter text color."):(0,h.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color.");return(0,s.useEffect)((()=>{(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<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(zg(o,t),"withCustomColors")}}function Hg(){const e=Fg();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(zg(n,e),"withColors")}const Ug=[];var Gg=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=(0,u.reduce)(t,((e,t)=>(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||a<r||u){r=a;const t=e.indexOf(i),d=e[t-1];if("top"===c&&d&&d.rootClientId===i.rootClientId&&!d.isDraggedBlock?(o=d,n="bottom",l=d.element.getBoundingClientRect()):(o=i,n=c,l=s),u)break}}if(!o)return;const i="bottom"===n;if(i&&o.canInsertDraggedBlocksAsChild&&(o.innerBlockCount>0||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;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},ab.apply(this,arguments)};Object.create;Object.create;var cb=n(7970),ub=n.n(cb);function db(e,t,n,o,r,l){void 0===l&&(l=0);var i=Eb(e,t,l),s=i.width,a=i.height,c=Math.min(s,n),u=Math.min(a,o);return c>u*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;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).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: <mark>%s</mark>"),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=>`<img src="${(0,Vp.createBlobURL)(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=/.*<!--StartFragment-->/s,n=/<!--EndFragment-->.*/s;return e.replace(t,"").replace(n,"")}(b),b=function(e){const t="<meta charset='utf-8'>";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}></${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<t?n:t};return(e=>{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<d?i=l:c?o.scrollBy(0,s):a.scrollTop+=s}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){m()&&(i=(0,rr.computeCaretRect)(o))}function m(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",s,!0),o.addEventListener("resize",s,!0),t.addEventListener("keydown",a),t.addEventListener("keyup",c),t.addEventListener("mousedown",u),t.addEventListener("touchstart",u),()=>{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<r||((0,rr.placeCaretAtHorizontalEdge)(o,!0),t.preventDefault())}return e.addEventListener("mousedown",t),()=>{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.length<e.length&&(e=t)}return e}function X_(e){if(void 0===e)e=v.gradients;else{const t=e.filter((e=>e.gradient));0===t.length?e=v.gradients:t.length<e.length&&(e=t)}return e}function Q_(e){const t=null==e?void 0:e.trim().match(/^(0?[-.]?\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/);return isNaN(e)||isNaN(parseFloat(e))?t?{value:parseFloat(t[1])||t[1],unit:t[2]}:{value:e,unit:void 0}:{value:parseFloat(e),unit:"px"}}function Z_(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>Q_(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[0]?o[0]+"px":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;t<e.length;t++)if(["+","-","/","*"].includes(e[t]))return!0;return!1}function ty(e){let t=!1;const n=e.split(/[+-/*/]/g).filter(Boolean);for(const o of n){const n=Q_(oy(o));if(!parseFloat(n.value)){t=!0;break}e=e.replace(o,n.value)}return t?null:(o=e,Function(`'use strict'; return (${o})`)()).toFixed(0)+"px";var o}function ny(e,t){const n=96,o=.01,r=Object.assign({},{fontSize:16,lineHeight:16,width:375,height:812,type:"font"},t),l={em:r.fontSize,rem:r.fontSize,vh:r.height*o,vw:r.width*o,vmin:(r.width<r.height?r.width:r.height)*o,vmax:(r.width>r.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");
-/******/ })
-/************************************************************************/
-/******/ ({
-
-/***/ "+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":
-/***/ (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);
-
-
-/***/ }),
+/******/ (function() { // webpackBootstrap
+/******/ var __webpack_modules__ = ({
-/***/ "1ZqX":
+/***/ 3827:
/***/ (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__) {
-
-"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);
-
-
-/***/ }),
-
-/***/ "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__);
-
+/***/ 4403:
+/***/ (function(module, exports) {
-/**
- * WordPress dependencies
- */
+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 */
-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);
+(function () {
+ 'use strict';
+ var hasOwn = {}.hasOwnProperty;
-/***/ }),
+ function classNames() {
+ var classes = [];
-/***/ "Civd":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ for (var i = 0; i < arguments.length; i++) {
+ var arg = arguments[i];
+ if (!arg) continue;
-"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__);
+ var argType = typeof arg;
+ 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());
+ }
+ }
+ }
-/**
- * WordPress dependencies
- */
+ return classes.join(' ');
+ }
-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);
+ 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 {}
+}());
/***/ }),
-/***/ "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"]; }());
-
-/***/ }),
+/***/ 9756:
+/***/ (function(module) {
-/***/ "G8mJ":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/**
+ * Memize options object.
+ *
+ * @typedef MemizeOptions
+ *
+ * @property {number} [maxSize] Maximum size of the cache.
+ */
-"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__);
+/**
+ * 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.
+ */
/**
- * WordPress dependencies
+ * 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;
-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);
+ /** @type {?MemizeCacheNode|undefined} */
+ var head;
+ /** @type {?MemizeCacheNode|undefined} */
+ var tail;
-/***/ }),
+ options = options || {};
-/***/ "GRId":
-/***/ (function(module, exports) {
+ function memoized( /* ...args */ ) {
+ var node = head,
+ len = arguments.length,
+ args, i;
-(function() { module.exports = window["wp"]["element"]; }());
+ 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;
+ }
-/***/ "HSyU":
-/***/ (function(module, exports) {
+ // Check whether node arguments match arguments values
+ for ( i = 0; i < len; i++ ) {
+ if ( node.args[ i ] !== arguments[ i ] ) {
+ node = node.next;
+ continue searchCache;
+ }
+ }
-(function() { module.exports = window["wp"]["blocks"]; }());
+ // 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;
+ }
-/***/ "JREk":
-/***/ (function(module, exports) {
+ // 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;
+ }
-(function() { module.exports = window["wp"]["serverSideRender"]; }());
+ node.next = head;
+ node.prev = null;
+ /** @type {MemizeCacheNode} */ ( head ).prev = node;
+ head = node;
+ }
-/***/ }),
+ // Return immediately
+ return node.val;
+ }
-/***/ "K51g":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ // No cached value found. Continue to insertion phase:
-"use strict";
-// ESM COMPAT FLAG
-__webpack_require__.r(__webpack_exports__);
+ // Create a copy of arguments (avoid leaking deoptimization)
+ args = new Array( len );
+ for ( i = 0; i < len; i++ ) {
+ args[ i ] = arguments[ i ];
+ }
-// 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; });
+ node = {
+ args: args,
-// 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; });
+ // Generate the result from original function
+ val: fn.apply( null, args ),
+ };
-// 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; });
+ // Don't need to check whether node is already head, since it would
+ // have been returned above already if it was
-// 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; });
+ // 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;
+ }
-// 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; });
+ // 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++;
+ }
-// 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; });
+ 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;
+
+
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/ // 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; },
+ "__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 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; },
+ "name": function() { return audio_name; },
+ "settings": function() { return audio_settings; }
+});
+
+// NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/button/index.js
+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; },
+ "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; },
+ "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; });
-
-// 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");
+__webpack_require__.d(build_module_video_namespaceObject, {
+ "metadata": function() { return video_metadata; },
+ "name": function() { return video_name; },
+ "settings": function() { return video_settings; }
+});
-// 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
-// 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");
+/**
+ * WordPress dependencies
+ */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/clean-empty-object.js
+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__(4403);
+var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
+;// 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];
+ }
+ }
+ }
+
+ return target;
+ };
+
+ 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
-// 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");
+/**
+ * WordPress dependencies
+ */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/button/edit.js
+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<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.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");
-
-// EXTERNAL MODULE: ./node_modules/colord/plugins/names.mjs
-var names = __webpack_require__("abaT");
+;// 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<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/cover/edit.js
@@ -7442,22 +7393,22 @@ var names = __webpack_require__("abaT");
*/
-Object(colord["b" /* extend */])([names["a" /* default */]]);
+k([names]);
const {
__Visualizer: BoxControlVisualizer
-} = external_wp_components_["__experimentalBoxControl"];
+} = external_wp_components_namespaceObject.__experimentalBoxControl;
function getInnerBlocksTemplate(attributes) {
return [['core/paragraph', {
align: 'center',
- placeholder: Object(external_wp_i18n_["__"])('Write title…'),
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…'),
...attributes
}]];
}
function retrieveFastAverageColor() {
if (!retrieveFastAverageColor.fastAverageColor) {
- retrieveFastAverageColor.fastAverageColor = new dist_default.a();
+ retrieveFastAverageColor.fastAverageColor = new (dist_default())();
}
return retrieveFastAverageColor.fastAverageColor;
@@ -7470,12 +7421,12 @@ function CoverHeightInput(_ref) {
unit = 'px',
value = ''
} = _ref;
- const [temporaryInput, setTemporaryInput] = Object(external_wp_element_["useState"])(null);
- const instanceId = Object(external_wp_compose_["useInstanceId"])(external_wp_blockEditor_["__experimentalUnitControl"]);
+ const [temporaryInput, setTemporaryInput] = (0,external_wp_element_namespaceObject.useState)(null);
+ const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_blockEditor_namespaceObject.__experimentalUnitControl);
const inputId = `block-cover-height-input-${instanceId}`;
const isPx = unit === 'px';
- const units = Object(external_wp_components_["__experimentalUseCustomUnits"])({
- availableUnits: Object(external_wp_blockEditor_["useSetting"])('spacing.units') || ['px', 'em', 'rem', 'vw', 'vh'],
+ const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
+ availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || ['px', 'em', 'rem', 'vw', 'vh'],
defaultValues: {
px: '430',
em: '20',
@@ -7509,10 +7460,10 @@ function CoverHeightInput(_ref) {
const inputValue = temporaryInput !== null ? temporaryInput : value;
const min = isPx ? COVER_MIN_HEIGHT : 0;
- return Object(external_wp_element_["createElement"])(external_wp_components_["BaseControl"], {
- label: Object(external_wp_i18n_["__"])('Minimum height of cover'),
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Minimum height of cover'),
id: inputId
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalUnitControl"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalUnitControl, {
id: inputId,
isResetValueOnUnitChange: true,
min: min,
@@ -7547,8 +7498,8 @@ function ResizableCover(_ref2) {
onResizeStop,
...props
} = _ref2;
- const [isResizing, setIsResizing] = Object(external_wp_element_["useState"])(false);
- return Object(external_wp_element_["createElement"])(external_wp_components_["ResizableBox"], Object(esm_extends["a" /* default */])({
+ const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, _extends({
className: classnames_default()(className, {
'is-resizing': isResizing
}),
@@ -7590,8 +7541,8 @@ function useCoverIsDark(url) {
let dimRatio = arguments.length > 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_["__"])('<strong>Snow Patrol</strong>'),
+ content: (0,external_wp_i18n_namespaceObject.__)('<strong>Snow Patrol</strong>'),
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
+
+
+/**
+ * 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
+;// 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 += `<br />${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
+
+
+/**
+ * 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-right.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
+ */
+
+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
+;// 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
+
+
+/**
+ * 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
+;// 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 <header> element should represent introductory content, typically a group of introductory or navigational aids.'),
- main: Object(external_wp_i18n_["__"])('The <main> element should be used for the primary content of your document only. '),
- section: Object(external_wp_i18n_["__"])("The <section> element should represent a standalone portion of the document that can't be better represented by another element."),
- article: Object(external_wp_i18n_["__"])('The <article> element should represent a self contained, syndicatable portion of the document.'),
- aside: Object(external_wp_i18n_["__"])("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),
- footer: Object(external_wp_i18n_["__"])('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).')
+ header: (0,external_wp_i18n_namespaceObject.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'),
+ main: (0,external_wp_i18n_namespaceObject.__)('The <main> element should be used for the primary content of your document only. '),
+ section: (0,external_wp_i18n_namespaceObject.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element."),
+ article: (0,external_wp_i18n_namespaceObject.__)('The <article> element should represent a self contained, syndicatable portion of the document.'),
+ aside: (0,external_wp_i18n_namespaceObject.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),
+ footer: (0,external_wp_i18n_namespaceObject.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).')
};
function GroupEdit(_ref) {
@@ -14409,20 +14423,20 @@ function GroupEdit(_ref) {
const {
hasInnerBlocks,
themeSupportsLayout
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getSettings;
const {
getBlock,
getSettings
- } = select(external_wp_blockEditor_["store"]);
+ } = select(external_wp_blockEditor_namespaceObject.store);
const block = getBlock(clientId);
return {
hasInnerBlocks: !!(block && block.innerBlocks.length),
themeSupportsLayout: (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout
};
}, [clientId]);
- const defaultLayout = Object(external_wp_blockEditor_["useSetting"])('layout') || {};
+ const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
const {
tagName: TagName = 'div',
templateLock,
@@ -14433,20 +14447,20 @@ function GroupEdit(_ref) {
type = 'default'
} = usedLayout;
const layoutSupportEnabled = themeSupportsLayout || type !== 'default';
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])();
- const innerBlocksProps = Object(external_wp_blockEditor_["useInnerBlocksProps"])(layoutSupportEnabled ? blockProps : {
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
+ const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(layoutSupportEnabled ? blockProps : {
className: 'wp-block-group__inner-container'
}, {
templateLock,
- renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_["InnerBlocks"].ButtonBlockAppender,
+ renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender,
__experimentalLayout: layoutSupportEnabled ? usedLayout : undefined
});
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
__experimentalGroup: "advanced"
- }, Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], {
- label: Object(external_wp_i18n_["__"])('HTML element'),
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
options: [{
- label: Object(external_wp_i18n_["__"])('Default (<div>)'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'),
value: 'div'
}, {
label: '<header>',
@@ -14472,12 +14486,12 @@ function GroupEdit(_ref) {
tagName: value
}),
help: htmlElementMessages[TagName]
- })), layoutSupportEnabled && Object(external_wp_element_["createElement"])(TagName, innerBlocksProps), !layoutSupportEnabled && Object(external_wp_element_["createElement"])(TagName, blockProps, Object(external_wp_element_["createElement"])("div", innerBlocksProps)));
+ })), layoutSupportEnabled && (0,external_wp_element_namespaceObject.createElement)(TagName, innerBlocksProps), !layoutSupportEnabled && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
}
/* harmony default export */ var group_edit = (GroupEdit);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/save.js
/**
@@ -14490,18 +14504,18 @@ function group_save_save(_ref) {
tagName: Tag
}
} = _ref;
- return Object(external_wp_element_["createElement"])(Tag, external_wp_blockEditor_["useInnerBlocksProps"].save(external_wp_blockEditor_["useBlockProps"].save()));
+ return (0,external_wp_element_namespaceObject.createElement)(Tag, external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save()));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/variations.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/variations.js
/**
* WordPress dependencies
*/
const group_variations_variations = [{
name: 'group-row',
- title: Object(external_wp_i18n_["__"])('Row'),
- description: Object(external_wp_i18n_["__"])('Blocks shown in a row.'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Row'),
+ description: (0,external_wp_i18n_namespaceObject.__)('Blocks shown in a row.'),
attributes: {
layout: {
type: 'flex',
@@ -14517,7 +14531,7 @@ const group_variations_variations = [{
}];
/* harmony default export */ var group_variations = (group_variations_variations);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/group/index.js
/**
* WordPress dependencies
*/
@@ -14582,7 +14596,7 @@ const {
} = group_metadata;
const group_settings = {
- icon: library_group["a" /* default */],
+ icon: library_group,
example: {
attributes: {
style: {
@@ -14597,42 +14611,42 @@ const group_settings = {
attributes: {
customTextColor: '#cf2e2e',
fontSize: 'large',
- content: Object(external_wp_i18n_["__"])('One.')
+ content: (0,external_wp_i18n_namespaceObject.__)('One.')
}
}, {
name: 'core/paragraph',
attributes: {
customTextColor: '#ff6900',
fontSize: 'large',
- content: Object(external_wp_i18n_["__"])('Two.')
+ content: (0,external_wp_i18n_namespaceObject.__)('Two.')
}
}, {
name: 'core/paragraph',
attributes: {
customTextColor: '#fcb900',
fontSize: 'large',
- content: Object(external_wp_i18n_["__"])('Three.')
+ content: (0,external_wp_i18n_namespaceObject.__)('Three.')
}
}, {
name: 'core/paragraph',
attributes: {
customTextColor: '#00d084',
fontSize: 'large',
- content: Object(external_wp_i18n_["__"])('Four.')
+ content: (0,external_wp_i18n_namespaceObject.__)('Four.')
}
}, {
name: 'core/paragraph',
attributes: {
customTextColor: '#0693e3',
fontSize: 'large',
- content: Object(external_wp_i18n_["__"])('Five.')
+ content: (0,external_wp_i18n_namespaceObject.__)('Five.')
}
}, {
name: 'core/paragraph',
attributes: {
customTextColor: '#9b51e0',
fontSize: 'large',
- content: Object(external_wp_i18n_["__"])('Six.')
+ content: (0,external_wp_i18n_namespaceObject.__)('Six.')
}
}]
},
@@ -14662,9 +14676,9 @@ const group_settings = {
// new group block.
const groupInnerBlocks = blocks.map(block => {
- return Object(external_wp_blocks_["createBlock"])(block.name, block.attributes, block.innerBlocks);
+ return (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, block.innerBlocks);
});
- return Object(external_wp_blocks_["createBlock"])('core/group', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', {
align: widestAlignment
}, groupInnerBlocks);
}
@@ -14677,22 +14691,22 @@ const group_settings = {
variations: group_variations
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/heading.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/heading.js
/**
* WordPress dependencies
*/
-const heading = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const heading = (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: "M6.2 5.2v13.4l5.8-4.8 5.8 4.8V5.2z"
}));
/* harmony default export */ var library_heading = (heading);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/deprecated.js
/**
@@ -14738,7 +14752,7 @@ const deprecated_migrateCustomColors = attributes => {
text: attributes.customTextColor
}
};
- return { ...Object(external_lodash_["omit"])(attributes, ['customTextColor']),
+ return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor']),
style
};
};
@@ -14797,9 +14811,9 @@ const heading_deprecated_deprecated = [{
const className = classnames_default()({
[`has-text-align-${align}`]: align
});
- return Object(external_wp_element_["createElement"])(TagName, external_wp_blockEditor_["useBlockProps"].save({
+ return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
className
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: content
}));
}
@@ -14828,13 +14842,13 @@ const heading_deprecated_deprecated = [{
textColor
} = attributes;
const tagName = 'h' + level;
- const textClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor);
+ const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
const className = classnames_default()({
[textClass]: textClass,
'has-text-color': textColor || customTextColor,
[`has-text-align-${align}`]: align
});
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
className: className ? className : undefined,
tagName: tagName,
style: {
@@ -14867,12 +14881,12 @@ const heading_deprecated_deprecated = [{
textColor
} = attributes;
const tagName = 'h' + level;
- const textClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor);
+ const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
const className = classnames_default()({
[textClass]: textClass,
[`has-text-align-${align}`]: align
});
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
className: className ? className : undefined,
tagName: tagName,
style: {
@@ -14907,11 +14921,11 @@ const heading_deprecated_deprecated = [{
customTextColor
} = attributes;
const tagName = 'h' + level;
- const textClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor);
+ const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
const className = classnames_default()({
[textClass]: textClass
});
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
className: className ? className : undefined,
tagName: tagName,
style: {
@@ -14925,7 +14939,7 @@ const heading_deprecated_deprecated = [{
}];
/* harmony default export */ var heading_deprecated = (heading_deprecated_deprecated);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-icon.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-icon.js
/**
@@ -14969,18 +14983,18 @@ function HeadingLevelIcon(_ref) {
return null;
}
- return Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 20 20",
xmlns: "http://www.w3.org/2000/svg",
isPressed: isPressed
- }, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: levelToPath[level]
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-dropdown.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/heading-level-dropdown.js
/**
@@ -14994,7 +15008,7 @@ function HeadingLevelIcon(_ref) {
const HEADING_LEVELS = [1, 2, 3, 4, 5, 6];
-const heading_level_dropdown_POPOVER_PROPS = {
+const POPOVER_PROPS = {
className: 'block-library-heading-level-dropdown'
};
/** @typedef {import('@wordpress/element').WPComponent} WPComponent */
@@ -15022,22 +15036,22 @@ function HeadingLevelDropdown(_ref) {
selectedLevel,
onChange
} = _ref;
- return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarDropdownMenu"], {
- popoverProps: heading_level_dropdown_POPOVER_PROPS,
- icon: Object(external_wp_element_["createElement"])(HeadingLevelIcon, {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
+ popoverProps: POPOVER_PROPS,
+ icon: (0,external_wp_element_namespaceObject.createElement)(HeadingLevelIcon, {
level: selectedLevel
}),
- label: Object(external_wp_i18n_["__"])('Change heading level'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Change heading level'),
controls: HEADING_LEVELS.map(targetLevel => {
{
const isActive = targetLevel === selectedLevel;
return {
- icon: Object(external_wp_element_["createElement"])(HeadingLevelIcon, {
+ icon: (0,external_wp_element_namespaceObject.createElement)(HeadingLevelIcon, {
level: targetLevel,
isPressed: isActive
}),
- label: Object(external_wp_i18n_["sprintf"])( // translators: %s: heading level e.g: "1", "2", "3"
- Object(external_wp_i18n_["__"])('Heading %d'), targetLevel),
+ label: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: heading level e.g: "1", "2", "3"
+ (0,external_wp_i18n_namespaceObject.__)('Heading %d'), targetLevel),
isActive,
onClick() {
@@ -15050,7 +15064,7 @@ function HeadingLevelDropdown(_ref) {
});
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/autogenerate-anchors.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/autogenerate-anchors.js
/**
* External dependencies
*/
@@ -15086,7 +15100,7 @@ const getTextWithoutMarkup = text => {
const getSlug = content => {
// Get the slug.
- return Object(external_lodash_["trim"])(Object(external_lodash_["deburr"])(getTextWithoutMarkup(content)).replace(/[^\p{L}\p{N}]+/gu, '-').toLowerCase(), '-');
+ return (0,external_lodash_namespaceObject.trim)((0,external_lodash_namespaceObject.deburr)(getTextWithoutMarkup(content)).replace(/[^\p{L}\p{N}]+/gu, '-').toLowerCase(), '-');
};
/**
* Generate the anchor for a heading.
@@ -15128,7 +15142,7 @@ const setAnchor = (clientId, anchor) => {
autogenerate_anchors_anchors[clientId] = anchor;
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/edit.js
@@ -15169,7 +15183,7 @@ function HeadingEdit(_ref) {
anchor
} = attributes;
const tagName = 'h' + level;
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
}),
@@ -15177,18 +15191,18 @@ function HeadingEdit(_ref) {
});
const {
canGenerateAnchors
- } = 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 {
canGenerateAnchors: !!settings.__experimentalGenerateAnchors
};
}, []);
const {
__unstableMarkNextChangeAsNotPersistent
- } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]); // Initially set anchor for headings that have content but no anchor set.
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); // Initially set anchor for headings that have content but no anchor set.
// This is used when transforming a block to heading, or for legacy anchors.
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (!canGenerateAnchors) {
return;
}
@@ -15219,21 +15233,21 @@ function HeadingEdit(_ref) {
setAttributes(newAttrs);
};
- 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: "block"
- }, Object(external_wp_element_["createElement"])(HeadingLevelDropdown, {
+ }, (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
selectedLevel: level,
onChange: newLevel => setAttributes({
level: newLevel
})
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["AlignmentControl"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
textAlign: nextAlign
});
}
- })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], Object(esm_extends["a" /* default */])({
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
identifier: "content",
tagName: tagName,
value: content,
@@ -15243,13 +15257,13 @@ function HeadingEdit(_ref) {
let block;
if (isOriginal || value) {
- block = Object(external_wp_blocks_["createBlock"])('core/heading', { ...attributes,
+ block = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { ...attributes,
content: value
});
} else {
var _getDefaultBlockName;
- block = Object(external_wp_blocks_["createBlock"])((_getDefaultBlockName = Object(external_wp_blocks_["getDefaultBlockName"])()) !== null && _getDefaultBlockName !== void 0 ? _getDefaultBlockName : 'core/heading');
+ block = (0,external_wp_blocks_namespaceObject.createBlock)((_getDefaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)()) !== null && _getDefaultBlockName !== void 0 ? _getDefaultBlockName : 'core/heading');
}
if (isOriginal) {
@@ -15260,15 +15274,15 @@ function HeadingEdit(_ref) {
},
onReplace: onReplace,
onRemove: () => onReplace([]),
- "aria-label": Object(external_wp_i18n_["__"])('Heading text'),
- placeholder: placeholder || Object(external_wp_i18n_["__"])('Heading'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Heading text'),
+ placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Heading'),
textAlign: textAlign
}, blockProps)));
}
/* harmony default export */ var heading_edit = (HeadingEdit);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/save.js
/**
@@ -15293,14 +15307,14 @@ function heading_save_save(_ref) {
const className = classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
});
- return Object(external_wp_element_["createElement"])(TagName, external_wp_blockEditor_["useBlockProps"].save({
+ return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
className
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: content
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/shared.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/shared.js
/**
* Given a node name string for a heading node, returns its numeric level.
*
@@ -15312,7 +15326,7 @@ function getLevelFromHeadingNodeName(nodeName) {
return Number(nodeName.substr(1));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/transforms.js
/**
* WordPress dependencies
*/
@@ -15391,7 +15405,7 @@ const heading_transforms_transforms = {
content,
anchor
} = _ref;
- return Object(external_wp_blocks_["createBlock"])(heading_transforms_name, {
+ return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, {
content,
anchor
});
@@ -15419,7 +15433,7 @@ const heading_transforms_transforms = {
},
transform(node) {
- const attributes = Object(external_wp_blocks_["getBlockAttributes"])(heading_transforms_name, node.outerHTML);
+ const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(heading_transforms_name, node.outerHTML);
const {
textAlign
} = node.style || {};
@@ -15429,7 +15443,7 @@ const heading_transforms_transforms = {
attributes.align = textAlign;
}
- return Object(external_wp_blocks_["createBlock"])(heading_transforms_name, attributes);
+ return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, attributes);
}
}, ...[1, 2, 3, 4, 5, 6].map(level => ({
@@ -15437,7 +15451,7 @@ const heading_transforms_transforms = {
prefix: Array(level + 1).join('#'),
transform(content) {
- return Object(external_wp_blocks_["createBlock"])(heading_transforms_name, {
+ return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, {
level,
content
});
@@ -15448,7 +15462,7 @@ const heading_transforms_transforms = {
regExp: new RegExp(`^/(h|H)${level}$`),
transform(content) {
- return Object(external_wp_blocks_["createBlock"])(heading_transforms_name, {
+ return (0,external_wp_blocks_namespaceObject.createBlock)(heading_transforms_name, {
level,
content
});
@@ -15464,7 +15478,7 @@ const heading_transforms_transforms = {
content,
anchor
} = _ref3;
- return Object(external_wp_blocks_["createBlock"])('core/paragraph', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content,
anchor
});
@@ -15473,7 +15487,7 @@ const heading_transforms_transforms = {
};
/* harmony default export */ var heading_transforms = (heading_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/heading/index.js
/**
* External dependencies
*/
@@ -15557,7 +15571,7 @@ const heading_settings = {
icon: library_heading,
example: {
attributes: {
- content: Object(external_wp_i18n_["__"])('Code is Poetry'),
+ content: (0,external_wp_i18n_namespaceObject.__)('Code is Poetry'),
level: 2
}
},
@@ -15572,11 +15586,11 @@ const heading_settings = {
content,
level
} = attributes;
- return Object(external_lodash_["isEmpty"])(content) ? Object(external_wp_i18n_["sprintf"])(
+ return (0,external_lodash_namespaceObject.isEmpty)(content) ? (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: accessibility text. %s: heading level. */
- Object(external_wp_i18n_["__"])('Level %s. Empty.'), level) : Object(external_wp_i18n_["sprintf"])(
+ (0,external_wp_i18n_namespaceObject.__)('Level %s. Empty.'), level) : (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: accessibility text. 1: heading level. 2: heading content. */
- Object(external_wp_i18n_["__"])('Level %1$s. %2$s'), level, content);
+ (0,external_wp_i18n_namespaceObject.__)('Level %1$s. %2$s'), level, content);
}
},
@@ -15593,22 +15607,22 @@ const heading_settings = {
save: heading_save_save
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/html.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/html.js
/**
* WordPress dependencies
*/
-const html_html = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const html = (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: "M4.8 11.4H2.1V9H1v6h1.1v-2.6h2.7V15h1.1V9H4.8v2.4zm1.9-1.3h1.7V15h1.1v-4.9h1.7V9H6.7v1.1zM16.2 9l-1.5 2.7L13.3 9h-.9l-.8 6h1.1l.5-4 1.5 2.8 1.5-2.8.5 4h1.1L17 9h-.8zm3.8 5V9h-1.1v6h3.6v-1H20z"
}));
-/* harmony default export */ var library_html = (html_html);
+/* harmony default export */ var library_html = (html);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/edit.js
/**
@@ -15625,8 +15639,8 @@ function HTMLEdit(_ref) {
setAttributes,
isSelected
} = _ref;
- const [isPreview, setIsPreview] = Object(external_wp_element_["useState"])();
- const styles = Object(external_wp_data_["useSelect"])(select => {
+ const [isPreview, setIsPreview] = (0,external_wp_element_namespaceObject.useState)();
+ const styles = (0,external_wp_data_namespaceObject.useSelect)(select => {
// Default styles used to unset some of the styles
// that might be inherited from the editor style.
const defaultStyles = `
@@ -15637,7 +15651,7 @@ function HTMLEdit(_ref) {
min-height: auto !important;
}
`;
- return [defaultStyles, ...Object(external_wp_blockEditor_["transformStyles"])(select(external_wp_blockEditor_["store"]).getSettings().styles)];
+ return [defaultStyles, ...(0,external_wp_blockEditor_namespaceObject.transformStyles)(select(external_wp_blockEditor_namespaceObject.store).getSettings().styles)];
}, []);
function switchToPreview() {
@@ -15648,32 +15662,32 @@ function HTMLEdit(_ref) {
setIsPreview(false);
}
- return Object(external_wp_element_["createElement"])("div", Object(external_wp_blockEditor_["useBlockProps"])({
+ return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: 'block-library-html__edit'
- }), 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"])(external_wp_components_["ToolbarButton"], {
+ }), (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)(external_wp_components_namespaceObject.ToolbarButton, {
className: "components-tab-button",
isPressed: !isPreview,
onClick: switchToHTML
- }, Object(external_wp_element_["createElement"])("span", null, "HTML")), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
+ }, (0,external_wp_element_namespaceObject.createElement)("span", null, "HTML")), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
className: "components-tab-button",
isPressed: isPreview,
onClick: switchToPreview
- }, Object(external_wp_element_["createElement"])("span", null, Object(external_wp_i18n_["__"])('Preview'))))), Object(external_wp_element_["createElement"])(external_wp_components_["Disabled"].Consumer, null, isDisabled => isPreview || isDisabled ? Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["SandBox"], {
+ }, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Preview'))))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled.Consumer, null, isDisabled => isPreview || isDisabled ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SandBox, {
html: attributes.content,
styles: styles
- }), !isSelected && Object(external_wp_element_["createElement"])("div", {
+ }), !isSelected && (0,external_wp_element_namespaceObject.createElement)("div", {
className: "block-library-html__preview-overlay"
- })) : Object(external_wp_element_["createElement"])(external_wp_blockEditor_["PlainText"], {
+ })) : (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
value: attributes.content,
onChange: content => setAttributes({
content
}),
- placeholder: Object(external_wp_i18n_["__"])('Write HTML…'),
- "aria-label": Object(external_wp_i18n_["__"])('HTML')
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('Write HTML…'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('HTML')
})));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/save.js
/**
@@ -15684,10 +15698,10 @@ function html_save_save(_ref) {
let {
attributes
} = _ref;
- return Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, attributes.content);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.content);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/transforms.js
/**
* WordPress dependencies
*/
@@ -15700,7 +15714,7 @@ const html_transforms_transforms = {
let {
content
} = _ref;
- return Object(external_wp_blocks_["createBlock"])('core/html', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/html', {
content
});
}
@@ -15708,7 +15722,7 @@ const html_transforms_transforms = {
};
/* harmony default export */ var html_transforms = (html_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/html/index.js
/**
* WordPress dependencies
*/
@@ -15750,7 +15764,7 @@ const html_settings = {
icon: library_html,
example: {
attributes: {
- content: '<marquee>' + Object(external_wp_i18n_["__"])('Welcome to the wonderful world of blocks…') + '</marquee>'
+ content: '<marquee>' + (0,external_wp_i18n_namespaceObject.__)('Welcome to the wonderful world of blocks…') + '</marquee>'
}
},
edit: HTMLEdit,
@@ -15758,7 +15772,7 @@ const html_settings = {
transforms: html_transforms
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/deprecated.js
@@ -15851,18 +15865,18 @@ const image_deprecated_deprecated = [{
[`align${align}`]: align,
'is-resized': width || height
});
- const image = Object(external_wp_element_["createElement"])("img", {
+ const image = (0,external_wp_element_namespaceObject.createElement)("img", {
src: url,
alt: alt,
className: id ? `wp-image-${id}` : null,
width: width,
height: height
});
- return Object(external_wp_element_["createElement"])("figure", {
+ return (0,external_wp_element_namespaceObject.createElement)("figure", {
className: classes
- }, href ? Object(external_wp_element_["createElement"])("a", {
+ }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
href: href
- }, image) : image, !external_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "figcaption",
value: caption
}));
@@ -15885,18 +15899,18 @@ const image_deprecated_deprecated = [{
height,
id
} = attributes;
- const image = Object(external_wp_element_["createElement"])("img", {
+ const image = (0,external_wp_element_namespaceObject.createElement)("img", {
src: url,
alt: alt,
className: id ? `wp-image-${id}` : null,
width: width,
height: height
});
- return Object(external_wp_element_["createElement"])("figure", {
+ return (0,external_wp_element_namespaceObject.createElement)("figure", {
className: align ? `align${align}` : null
- }, href ? Object(external_wp_element_["createElement"])("a", {
+ }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
href: href
- }, image) : image, !external_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "figcaption",
value: caption
}));
@@ -15922,7 +15936,7 @@ const image_deprecated_deprecated = [{
width,
height
} : {};
- const image = Object(external_wp_element_["createElement"])("img", Object(esm_extends["a" /* default */])({
+ const image = (0,external_wp_element_namespaceObject.createElement)("img", _extends({
src: url,
alt: alt
}, extraImageProps));
@@ -15938,12 +15952,12 @@ const image_deprecated_deprecated = [{
};
}
- return Object(external_wp_element_["createElement"])("figure", {
+ return (0,external_wp_element_namespaceObject.createElement)("figure", {
className: align ? `align${align}` : null,
style: figureStyle
- }, href ? Object(external_wp_element_["createElement"])("a", {
+ }, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
href: href
- }, image) : image, !external_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "figcaption",
value: caption
}));
@@ -15952,53 +15966,65 @@ const image_deprecated_deprecated = [{
}];
/* harmony default export */ var image_deprecated = (image_deprecated_deprecated);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/crop.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/crop.js
/**
* WordPress dependencies
*/
-const crop = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const crop = (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: "M16.5 7.8v7H18v-7c0-1-.8-1.8-1.8-1.8h-7v1.5h7c.2 0 .3.1.3.3zm-8.7 8.7c-.1 0-.2-.1-.2-.2V2H6v4H2v1.5h4v8.8c0 1 .8 1.8 1.8 1.8h8.8v4H18v-4h4v-1.5H7.8z"
}));
/* harmony default export */ var library_crop = (crop);
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/upload.js
-var upload = __webpack_require__("NTP4");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/upload.js
+
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/overlay-text.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/icons/build-module/library/overlay-text.js
/**
* WordPress dependencies
*/
-const overlayText = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const overlayText = (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 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12-9.8c.4 0 .8-.3.9-.7l1.1-3h3.6l.5 1.7h1.9L13 9h-2.2l-3.4 9.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12H20V6c0-1.1-.9-2-2-2zm-6 7l1.4 3.9h-2.7L12 11z"
}));
/* harmony default export */ var overlay_text = (overlayText);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/use-client-width.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/use-client-width.js
/**
* WordPress dependencies
*/
function useClientWidth(ref, dependencies) {
- const [clientWidth, setClientWidth] = Object(external_wp_element_["useState"])();
+ const [clientWidth, setClientWidth] = (0,external_wp_element_namespaceObject.useState)();
function calculateClientWidth() {
setClientWidth(ref.current.clientWidth);
}
- Object(external_wp_element_["useEffect"])(calculateClientWidth, dependencies);
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(calculateClientWidth, dependencies);
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
const {
defaultView
} = ref.current.ownerDocument;
@@ -16010,7 +16036,7 @@ function useClientWidth(ref, dependencies) {
return clientWidth;
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/image.js
/**
@@ -16077,26 +16103,26 @@ function Image(_ref) {
context,
clientId
} = _ref;
- const imageRef = Object(external_wp_element_["useRef"])();
- const captionRef = Object(external_wp_element_["useRef"])();
- const prevUrl = Object(external_wp_compose_["usePrevious"])(url);
+ const imageRef = (0,external_wp_element_namespaceObject.useRef)();
+ const captionRef = (0,external_wp_element_namespaceObject.useRef)();
+ const prevUrl = (0,external_wp_compose_namespaceObject.usePrevious)(url);
const {
allowResize = true
} = context;
const {
getBlock
- } = Object(external_wp_data_["useSelect"])(external_wp_blockEditor_["store"]);
+ } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
const {
image,
multiImageSelection
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getMedia
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
const {
getMultiSelectedBlockClientIds,
getBlockName
- } = select(external_wp_blockEditor_["store"]);
+ } = select(external_wp_blockEditor_namespaceObject.store);
const multiSelectedClientIds = getMultiSelectedBlockClientIds();
return {
image: id && isSelected ? getMedia(id) : null,
@@ -16109,14 +16135,14 @@ function Image(_ref) {
imageSizes,
maxWidth,
mediaUpload
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getBlockRootClientId,
getSettings,
canInsertBlockType
- } = select(external_wp_blockEditor_["store"]);
+ } = select(external_wp_blockEditor_namespaceObject.store);
const rootClientId = getBlockRootClientId(clientId);
- const settings = Object(external_lodash_["pick"])(getSettings(), ['imageEditing', 'imageSizes', 'maxWidth', 'mediaUpload']);
+ const settings = (0,external_lodash_namespaceObject.pick)(getSettings(), ['imageEditing', 'imageSizes', 'maxWidth', 'mediaUpload']);
return { ...settings,
canInsertCover: canInsertBlockType('core/cover', rootClientId)
};
@@ -16124,26 +16150,26 @@ function Image(_ref) {
const {
replaceBlocks,
toggleSelection
- } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const {
createErrorNotice,
createSuccessNotice
- } = Object(external_wp_data_["useDispatch"])(external_wp_notices_["store"]);
- const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('medium');
- const isWideAligned = Object(external_lodash_["includes"])(['wide', 'full'], align);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
+ const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
+ const isWideAligned = (0,external_lodash_namespaceObject.includes)(['wide', 'full'], align);
const [{
loadedNaturalWidth,
loadedNaturalHeight
- }, setLoadedNaturalSize] = Object(external_wp_element_["useState"])({});
- const [isEditingImage, setIsEditingImage] = Object(external_wp_element_["useState"])(false);
- const [externalBlob, setExternalBlob] = Object(external_wp_element_["useState"])();
+ }, setLoadedNaturalSize] = (0,external_wp_element_namespaceObject.useState)({});
+ const [isEditingImage, setIsEditingImage] = (0,external_wp_element_namespaceObject.useState)(false);
+ const [externalBlob, setExternalBlob] = (0,external_wp_element_namespaceObject.useState)();
const clientWidth = useClientWidth(containerRef, [align]);
const isResizable = allowResize && !(isWideAligned && isLargeViewport);
- const imageSizeOptions = Object(external_lodash_["map"])(Object(external_lodash_["filter"])(imageSizes, _ref2 => {
+ const imageSizeOptions = (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(imageSizes, _ref2 => {
let {
slug
} = _ref2;
- return Object(external_lodash_["get"])(image, ['media_details', 'sizes', slug, 'source_url']);
+ return (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', slug, 'source_url']);
}), _ref3 => {
let {
name,
@@ -16157,7 +16183,7 @@ function Image(_ref) {
// fail if the image host doesn't allow CORS with the domain. If it works,
// we can enable a button in the toolbar to upload the image.
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isExternalImage(id, url) || !isSelected || externalBlob) {
return;
}
@@ -16169,7 +16195,7 @@ function Image(_ref) {
// when a block is mounted. Previously, the image block would remount when
// the placeholder is removed. Maybe this behaviour could be removed.
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (url && !prevUrl && isSelected) {
captionRef.current.focus();
}
@@ -16181,7 +16207,7 @@ function Image(_ref) {
const {
naturalWidth,
naturalHeight
- } = Object(external_wp_element_["useMemo"])(() => {
+ } = (0,external_wp_element_namespaceObject.useMemo)(() => {
var _imageRef$current, _imageRef$current2;
return {
@@ -16230,7 +16256,7 @@ function Image(_ref) {
}
function updateImage(newSizeSlug) {
- const newUrl = Object(external_lodash_["get"])(image, ['media_details', 'sizes', newSizeSlug, 'source_url']);
+ const newUrl = (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', newSizeSlug, 'source_url']);
if (!newUrl) {
return null;
@@ -16252,12 +16278,12 @@ function Image(_ref) {
let [img] = _ref4;
onSelectImage(img);
- if (Object(external_wp_blob_["isBlobURL"])(img.url)) {
+ if ((0,external_wp_blob_namespaceObject.isBlobURL)(img.url)) {
return;
}
setExternalBlob();
- createSuccessNotice(Object(external_wp_i18n_["__"])('Image uploaded.'), {
+ createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Image uploaded.'), {
type: 'snackbar'
});
},
@@ -16283,7 +16309,7 @@ function Image(_ref) {
});
}
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isSelected) {
setIsEditingImage(false);
}
@@ -16292,15 +16318,15 @@ function Image(_ref) {
const allowCrop = !multiImageSelection && canEditImage && !isEditingImage;
function switchToCover() {
- replaceBlocks(clientId, Object(external_wp_blocks_["switchToBlockType"])(getBlock(clientId), 'core/cover'));
+ replaceBlocks(clientId, (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(clientId), 'core/cover'));
}
- const controls = Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], {
+ 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_["BlockAlignmentControl"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentControl, {
value: align,
onChange: updateAlignment
- }), !multiImageSelection && !isEditingImage && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalImageURLInputUI"], {
+ }), !multiImageSelection && !isEditingImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageURLInputUI, {
url: href || '',
onChangeUrl: onSetHref,
linkDestination: linkDestination,
@@ -16309,21 +16335,21 @@ function Image(_ref) {
linkTarget: linkTarget,
linkClass: linkClass,
rel: rel
- }), allowCrop && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
+ }), allowCrop && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
onClick: () => setIsEditingImage(true),
icon: library_crop,
- label: Object(external_wp_i18n_["__"])('Crop')
- }), externalBlob && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
+ label: (0,external_wp_i18n_namespaceObject.__)('Crop')
+ }), externalBlob && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
onClick: uploadExternal,
- icon: upload["a" /* default */],
- label: Object(external_wp_i18n_["__"])('Upload external image')
- }), !multiImageSelection && canInsertCover && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
+ icon: library_upload,
+ label: (0,external_wp_i18n_namespaceObject.__)('Upload external image')
+ }), !multiImageSelection && canInsertCover && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
icon: overlay_text,
- label: Object(external_wp_i18n_["__"])('Add text over image'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Add text over image'),
onClick: switchToCover
- })), !multiImageSelection && !isEditingImage && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], {
+ })), !multiImageSelection && !isEditingImage && (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: constants_ALLOWED_MEDIA_TYPES,
@@ -16331,16 +16357,16 @@ function Image(_ref) {
onSelect: onSelectImage,
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_["__"])('Image settings')
- }, !multiImageSelection && Object(external_wp_element_["createElement"])(external_wp_components_["TextareaControl"], {
- label: Object(external_wp_i18n_["__"])('Alt text (alternative text)'),
+ })), (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.__)('Image settings')
+ }, !multiImageSelection && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Alt text (alternative text)'),
value: alt,
onChange: updateAlt,
- 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_blockEditor_["__experimentalImageSizeControl"], {
+ }, (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_blockEditor_namespaceObject.__experimentalImageSizeControl, {
onChangeImage: updateImage,
onChange: value => setAttributes(value),
slug: sizeSlug,
@@ -16350,34 +16376,34 @@ function Image(_ref) {
isResizable: isResizable,
imageWidth: naturalWidth,
imageHeight: naturalHeight
- }))), 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_["__"])('Title attribute'),
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'),
value: title || '',
onChange: onSetTitle,
- help: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_i18n_["__"])('Describe the role of this image on the page.'), 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_i18n_namespaceObject.__)('Describe the role of this image on the page.'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute"
- }, Object(external_wp_i18n_["__"])('(Note: many devices and browsers do not display this text.)')))
+ }, (0,external_wp_i18n_namespaceObject.__)('(Note: many devices and browsers do not display this text.)')))
})));
- const filename = Object(external_wp_url_["getFilename"])(url);
+ const filename = (0,external_wp_url_namespaceObject.getFilename)(url);
let defaultedAlt;
if (alt) {
defaultedAlt = alt;
} else if (filename) {
- defaultedAlt = Object(external_wp_i18n_["sprintf"])(
+ defaultedAlt = (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: file name */
- Object(external_wp_i18n_["__"])('This image has an empty alt attribute; its file name is %s'), filename);
+ (0,external_wp_i18n_namespaceObject.__)('This image has an empty alt attribute; its file name is %s'), filename);
} else {
- defaultedAlt = Object(external_wp_i18n_["__"])('This image has an empty alt attribute');
+ defaultedAlt = (0,external_wp_i18n_namespaceObject.__)('This image has an empty alt attribute');
}
let img = // Disable reason: Image itself is not meant to be interactive, but
// should direct focus to block.
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
- 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: temporaryURL || url,
alt: defaultedAlt,
onError: () => onImageError(),
@@ -16390,7 +16416,7 @@ function Image(_ref) {
});
},
ref: imageRef
- }), temporaryURL && Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null))
+ }), temporaryURL && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))
/* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
;
let imageWidthWithinContainer;
@@ -16404,7 +16430,7 @@ function Image(_ref) {
}
if (canEditImage && isEditingImage) {
- img = Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalImageEditor"], {
+ img = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, {
url: url,
width: width,
height: height,
@@ -16413,7 +16439,7 @@ function Image(_ref) {
naturalWidth: naturalWidth
});
} else if (!isResizable || !imageWidthWithinContainer) {
- img = Object(external_wp_element_["createElement"])("div", {
+ img = (0,external_wp_element_namespaceObject.createElement)("div", {
style: {
width,
height
@@ -16444,7 +16470,7 @@ function Image(_ref) {
// When the image is centered, show both handles.
showRightHandle = true;
showLeftHandle = true;
- } else if (Object(external_wp_i18n_["isRTL"])()) {
+ } else if ((0,external_wp_i18n_namespaceObject.isRTL)()) {
// In RTL mode the image is on the right by default.
// Show the right handle and hide the left handle only when it is
// aligned left. Otherwise always show the left handle.
@@ -16465,7 +16491,7 @@ function Image(_ref) {
/* eslint-enable no-lonely-if */
- img = Object(external_wp_element_["createElement"])(external_wp_components_["ResizableBox"], {
+ img = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
size: {
width: width !== null && width !== void 0 ? width : 'auto',
height: height !== null && height !== void 0 ? height : 'auto'
@@ -16493,7 +16519,7 @@ function Image(_ref) {
}, img);
}
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalImageEditingProvider"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditingProvider, {
id: id,
url: url,
naturalWidth: naturalWidth,
@@ -16502,21 +16528,21 @@ function Image(_ref) {
onSaveImage: imageAttributes => setAttributes(imageAttributes),
isEditing: isEditingImage,
onFinishEditing: () => setIsEditingImage(false)
- }, !temporaryURL && controls, img, (!external_wp_blockEditor_["RichText"].isEmpty(caption) || isSelected) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ }, !temporaryURL && controls, img, (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
ref: captionRef,
tagName: "figcaption",
- "aria-label": Object(external_wp_i18n_["__"])('Image caption text'),
- placeholder: Object(external_wp_i18n_["__"])('Add caption'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Image 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'))
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/edit.js
/**
@@ -16548,8 +16574,8 @@ function Image(_ref) {
const edit_pickRelevantMediaFiles = (image, size) => {
- const imageProps = Object(external_lodash_["pick"])(image, ['alt', 'id', 'link', 'caption']);
- imageProps.url = Object(external_lodash_["get"])(image, ['sizes', size, 'url']) || Object(external_lodash_["get"])(image, ['media_details', 'sizes', size, 'source_url']) || image.url;
+ const imageProps = (0,external_lodash_namespaceObject.pick)(image, ['alt', 'id', 'link', 'caption']);
+ imageProps.url = (0,external_lodash_namespaceObject.get)(image, ['sizes', size, 'url']) || (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', size, 'source_url']) || image.url;
return imageProps;
};
/**
@@ -16562,7 +16588,7 @@ const edit_pickRelevantMediaFiles = (image, size) => {
* @return {boolean} Is the URL a Blob URL
*/
-const edit_isTemporaryImage = (id, url) => !id && Object(external_wp_blob_["isBlobURL"])(url);
+const edit_isTemporaryImage = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url);
/**
* Is the url for the image hosted externally. An externally hosted image has no
* id and is not a blob url.
@@ -16574,7 +16600,7 @@ const edit_isTemporaryImage = (id, url) => !id && Object(external_wp_blob_["isBl
*/
-const isExternalImage = (id, url) => url && !id && !Object(external_wp_blob_["isBlobURL"])(url);
+const isExternalImage = (id, url) => url && !id && !(0,external_wp_blob_namespaceObject.isBlobURL)(url);
/**
* Checks if WP generated default image size. Size generation is skipped
* when the image is smaller than the said size.
@@ -16586,7 +16612,7 @@ const isExternalImage = (id, url) => url && !id && !Object(external_wp_blob_["is
*/
function hasDefaultSize(image, defaultSize) {
- return Object(external_lodash_["has"])(image, ['sizes', defaultSize, 'url']) || Object(external_lodash_["has"])(image, ['media_details', 'sizes', defaultSize, 'source_url']);
+ return (0,external_lodash_namespaceObject.has)(image, ['sizes', defaultSize, 'url']) || (0,external_lodash_namespaceObject.has)(image, ['media_details', 'sizes', defaultSize, 'source_url']);
}
function ImageEdit(_ref) {
@@ -16612,24 +16638,24 @@ function ImageEdit(_ref) {
height,
sizeSlug
} = attributes;
- const [temporaryURL, setTemporaryURL] = Object(external_wp_element_["useState"])();
- const altRef = Object(external_wp_element_["useRef"])();
- Object(external_wp_element_["useEffect"])(() => {
+ const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)();
+ const altRef = (0,external_wp_element_namespaceObject.useRef)();
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
altRef.current = alt;
}, [alt]);
- const captionRef = Object(external_wp_element_["useRef"])();
- Object(external_wp_element_["useEffect"])(() => {
+ const captionRef = (0,external_wp_element_namespaceObject.useRef)();
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
captionRef.current = caption;
}, [caption]);
- const ref = Object(external_wp_element_["useRef"])();
+ const ref = (0,external_wp_element_namespaceObject.useRef)();
const {
imageDefaultSize,
mediaUpload
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getSettings
- } = select(external_wp_blockEditor_["store"]);
- return Object(external_lodash_["pick"])(getSettings(), ['imageDefaultSize', 'mediaUpload']);
+ } = select(external_wp_blockEditor_namespaceObject.store);
+ return (0,external_lodash_namespaceObject.pick)(getSettings(), ['imageDefaultSize', 'mediaUpload']);
}, []);
function onUploadError(message) {
@@ -16651,7 +16677,7 @@ function ImageEdit(_ref) {
return;
}
- if (Object(external_wp_blob_["isBlobURL"])(media.url)) {
+ if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) {
setTemporaryURL(media.url);
return;
}
@@ -16660,8 +16686,8 @@ function ImageEdit(_ref) {
let mediaAttributes = edit_pickRelevantMediaFiles(media, imageDefaultSize); // If a caption text was meanwhile written by the user,
// make sure the text is not overwritten by empty captions.
- if (captionRef.current && !Object(external_lodash_["get"])(mediaAttributes, ['caption'])) {
- mediaAttributes = Object(external_lodash_["omit"])(mediaAttributes, ['caption']);
+ if (captionRef.current && !(0,external_lodash_namespaceObject.get)(mediaAttributes, ['caption'])) {
+ mediaAttributes = (0,external_lodash_namespaceObject.omit)(mediaAttributes, ['caption']);
}
let additionalAttributes; // Reset the dimension attributes if changing to a different image.
@@ -16754,12 +16780,12 @@ function ImageEdit(_ref) {
let isTemp = edit_isTemporaryImage(id, url); // Upload a temporary image on mount.
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isTemp) {
return;
}
- const file = Object(external_wp_blob_["getBlobByURL"])(url);
+ const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(url);
if (file) {
mediaUpload({
@@ -16783,19 +16809,19 @@ function ImageEdit(_ref) {
}, []); // If an image is temporary, revoke the Blob url when it is uploaded (and is
// no longer temporary).
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (isTemp) {
setTemporaryURL(url);
return;
}
- Object(external_wp_blob_["revokeBlobURL"])(temporaryURL);
+ (0,external_wp_blob_namespaceObject.revokeBlobURL)(temporaryURL);
}, [isTemp, url]);
const isExternal = isExternalImage(id, url);
const src = isExternal ? url : undefined;
- const mediaPreview = !!url && Object(external_wp_element_["createElement"])("img", {
- alt: Object(external_wp_i18n_["__"])('Edit image'),
- title: Object(external_wp_i18n_["__"])('Edit image'),
+ const mediaPreview = !!url && (0,external_wp_element_namespaceObject.createElement)("img", {
+ alt: (0,external_wp_i18n_namespaceObject.__)('Edit image'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Edit image'),
className: 'edit-image-preview',
src: url
});
@@ -16804,11 +16830,11 @@ function ImageEdit(_ref) {
'is-resized': !!width || !!height,
[`size-${sizeSlug}`]: sizeSlug
});
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
ref,
className: classes
});
- return Object(external_wp_element_["createElement"])("figure", blockProps, (temporaryURL || url) && Object(external_wp_element_["createElement"])(Image, {
+ return (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, (temporaryURL || url) && (0,external_wp_element_namespaceObject.createElement)(Image, {
temporaryURL: temporaryURL,
attributes: attributes,
setAttributes: setAttributes,
@@ -16821,13 +16847,13 @@ function ImageEdit(_ref) {
containerRef: ref,
context: context,
clientId: clientId
- }), !url && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], {
+ }), !url && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "block"
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockAlignmentControl"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentControl, {
value: align,
onChange: updateAlignment
- })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaPlaceholder"], {
- icon: Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockIcon"], {
+ })), (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_image
}),
onSelect: onSelectImage,
@@ -16844,9 +16870,9 @@ function ImageEdit(_ref) {
disableMediaButtons: temporaryURL || url
}));
}
-/* harmony default export */ var image_edit = (Object(external_wp_components_["withNotices"])(ImageEdit));
+/* harmony default export */ var image_edit = ((0,external_wp_components_namespaceObject.withNotices)(ImageEdit));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/save.js
/**
@@ -16878,13 +16904,13 @@ function image_save_save(_ref) {
sizeSlug,
title
} = attributes;
- const newRel = Object(external_lodash_["isEmpty"])(rel) ? undefined : rel;
+ const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
const classes = classnames_default()({
[`align${align}`]: align,
[`size-${sizeSlug}`]: sizeSlug,
'is-resized': width || height
});
- const image = Object(external_wp_element_["createElement"])("img", {
+ const image = (0,external_wp_element_namespaceObject.createElement)("img", {
src: url,
alt: alt,
className: id ? `wp-image-${id}` : null,
@@ -16892,28 +16918,28 @@ function image_save_save(_ref) {
height: height,
title: title
});
- const figure = Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, href ? Object(external_wp_element_["createElement"])("a", {
+ const figure = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, href ? (0,external_wp_element_namespaceObject.createElement)("a", {
className: linkClass,
href: href,
target: linkTarget,
rel: newRel
- }, image) : image, !external_wp_blockEditor_["RichText"].isEmpty(caption) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }, image) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "figcaption",
value: caption
}));
if ('left' === align || 'right' === align || 'center' === align) {
- return Object(external_wp_element_["createElement"])("div", external_wp_blockEditor_["useBlockProps"].save(), Object(external_wp_element_["createElement"])("figure", {
+ return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("figure", {
className: classes
}, figure));
}
- 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: classes
}), figure);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/transforms.js
/**
* External dependencies
*/
@@ -17008,7 +17034,7 @@ const image_transforms_transforms = {
const href = anchorElement && anchorElement.href ? anchorElement.href : undefined;
const rel = anchorElement && anchorElement.rel ? anchorElement.rel : undefined;
const linkClass = anchorElement && anchorElement.className ? anchorElement.className : undefined;
- const attributes = Object(external_wp_blocks_["getBlockAttributes"])('core/image', node.outerHTML, {
+ const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)('core/image', node.outerHTML, {
align,
id,
linkDestination,
@@ -17017,7 +17043,7 @@ const image_transforms_transforms = {
linkClass,
anchor
});
- return Object(external_wp_blocks_["createBlock"])('core/image', attributes);
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', attributes);
}
}, {
// Note: when dragging and dropping multiple files onto a gallery this overrides the
@@ -17030,19 +17056,19 @@ const image_transforms_transforms = {
if (files.some(file => file.type.indexOf('image/') === 0) && files.some(file => file.type.indexOf('image/') !== 0)) {
const {
createErrorNotice
- } = Object(external_wp_data_["dispatch"])(external_wp_notices_["store"]);
- createErrorNotice(Object(external_wp_i18n_["__"])('If uploading to a gallery all files need to be image formats'), {
+ } = (0,external_wp_data_namespaceObject.dispatch)(external_wp_notices_namespaceObject.store);
+ createErrorNotice((0,external_wp_i18n_namespaceObject.__)('If uploading to a gallery all files need to be image formats'), {
id: 'gallery-transform-invalid-file'
});
}
- return Object(external_lodash_["every"])(files, file => file.type.indexOf('image/') === 0);
+ return (0,external_lodash_namespaceObject.every)(files, file => file.type.indexOf('image/') === 0);
},
transform(files) {
const blocks = files.map(file => {
- return Object(external_wp_blocks_["createBlock"])('core/image', {
- url: Object(external_wp_blob_["createBlobURL"])(file)
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
+ url: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
});
});
return blocks;
@@ -17123,7 +17149,7 @@ const image_transforms_transforms = {
};
/* harmony default export */ var image_transforms = (image_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/index.js
/**
* WordPress dependencies
*/
@@ -17247,7 +17273,7 @@ const image_settings = {
sizeSlug: 'large',
url: 'https://s.w.org/images/core/5.3/MtBlanc1.jpg',
// translators: Caption accompanying an image of the Mont Blanc, which serves as an example for the Image block.
- caption: Object(external_wp_i18n_["__"])('Mont Blanc appears—still, snowy, and serene.')
+ caption: (0,external_wp_i18n_namespaceObject.__)('Mont Blanc appears—still, snowy, and serene.')
}
},
@@ -17264,7 +17290,7 @@ const image_settings = {
} = attributes;
if (!url) {
- return Object(external_wp_i18n_["__"])('Empty');
+ return (0,external_wp_i18n_namespaceObject.__)('Empty');
}
if (!alt) {
@@ -17289,22 +17315,22 @@ const image_settings = {
deprecated: image_deprecated
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/comment.js
/**
* WordPress dependencies
*/
-const comment_comment = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const comment = (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: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"
}));
-/* harmony default export */ var library_comment = (comment_comment);
+/* harmony default export */ var library_comment = (comment);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-comments/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-comments/edit.js
/**
@@ -17339,28 +17365,28 @@ function LatestComments(_ref) {
displayDate,
displayExcerpt
} = attributes;
- 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_["__"])('Latest comments settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Display avatar'),
+ 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.__)('Latest comments settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Display avatar'),
checked: displayAvatar,
onChange: () => setAttributes({
displayAvatar: !displayAvatar
})
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Display date'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Display date'),
checked: displayDate,
onChange: () => setAttributes({
displayDate: !displayDate
})
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Display excerpt'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'),
checked: displayExcerpt,
onChange: () => setAttributes({
displayExcerpt: !displayExcerpt
})
- }), Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], {
- label: Object(external_wp_i18n_["__"])('Number of comments'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Number of comments'),
value: commentsToShow,
onChange: value => setAttributes({
commentsToShow: value
@@ -17368,7 +17394,7 @@ function LatestComments(_ref) {
min: MIN_COMMENTS,
max: MAX_COMMENTS,
required: true
- }))), 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)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
block: "core/latest-comments",
attributes: attributes // The preview uses the site's locale to make it more true to how
// the block appears on the frontend. Setting the locale
@@ -17380,7 +17406,7 @@ function LatestComments(_ref) {
})));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js
/**
* WordPress dependencies
*/
@@ -17435,22 +17461,22 @@ const latest_comments_settings = {
edit: LatestComments
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-list.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-list.js
/**
* WordPress dependencies
*/
-const postList = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const postList = (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: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"
}));
/* harmony default export */ var post_list = (postList);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/deprecated.js
/**
* Internal dependencies
*/
@@ -17545,10 +17571,10 @@ const latest_posts_deprecated_metadata = {
style: "wp-block-latest-posts"
};
const {
- attributes: deprecated_attributes
+ attributes
} = latest_posts_deprecated_metadata;
/* harmony default export */ var latest_posts_deprecated = ([{
- attributes: { ...deprecated_attributes,
+ attributes: { ...attributes,
categories: {
type: 'string'
}
@@ -17574,33 +17600,46 @@ const {
save: () => null
}]);
-// EXTERNAL MODULE: external ["wp","date"]
-var external_wp_date_ = __webpack_require__("FqII");
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list.js
+;// CONCATENATED MODULE: external ["wp","date"]
+var external_wp_date_namespaceObject = window["wp"]["date"];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list.js
/**
* WordPress dependencies
*/
-const list = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const list = (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: "M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"
}));
/* harmony default export */ var library_list = (list);
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/grid.js
-var grid = __webpack_require__("b2RC");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/grid.js
+
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/constants.js
+/**
+ * WordPress dependencies
+ */
+
+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);
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/constants.js
const MIN_EXCERPT_LENGTH = 10;
const MAX_EXCERPT_LENGTH = 100;
const MAX_POSTS_COLUMNS = 6;
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/edit.js
/**
@@ -17672,31 +17711,31 @@ function LatestPostsEdit(_ref) {
defaultImageHeight,
categoriesList,
authorList
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getEntityRecords,
getMedia,
getUsers
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
const {
getSettings
- } = select(external_wp_blockEditor_["store"]);
+ } = select(external_wp_blockEditor_namespaceObject.store);
const {
imageSizes,
imageDimensions
} = getSettings();
const catIds = categories && categories.length > 0 ? categories.map(cat => cat.id) : [];
- const latestPostsQuery = Object(external_lodash_["pickBy"])({
+ const latestPostsQuery = (0,external_lodash_namespaceObject.pickBy)({
categories: catIds,
author: selectedAuthor,
order,
orderby: orderBy,
per_page: postsToShow
- }, value => !Object(external_lodash_["isUndefined"])(value));
+ }, value => !(0,external_lodash_namespaceObject.isUndefined)(value));
const posts = getEntityRecords('postType', 'post', latestPostsQuery);
return {
- defaultImageWidth: Object(external_lodash_["get"])(imageDimensions, [featuredImageSizeSlug, 'width'], 0),
- defaultImageHeight: Object(external_lodash_["get"])(imageDimensions, [featuredImageSizeSlug, 'height'], 0),
+ defaultImageWidth: (0,external_lodash_namespaceObject.get)(imageDimensions, [featuredImageSizeSlug, 'width'], 0),
+ defaultImageHeight: (0,external_lodash_namespaceObject.get)(imageDimensions, [featuredImageSizeSlug, 'height'], 0),
imageSizeOptions: imageSizes.filter(_ref2 => {
let {
slug
@@ -17715,10 +17754,10 @@ function LatestPostsEdit(_ref) {
latestPosts: !Array.isArray(posts) ? posts : posts.map(post => {
if (!post.featured_media) return post;
const image = getMedia(post.featured_media);
- let url = Object(external_lodash_["get"])(image, ['media_details', 'sizes', featuredImageSizeSlug, 'source_url'], null);
+ let url = (0,external_lodash_namespaceObject.get)(image, ['media_details', 'sizes', featuredImageSizeSlug, 'source_url'], null);
if (!url) {
- url = Object(external_lodash_["get"])(image, 'source_url', null);
+ url = (0,external_lodash_namespaceObject.get)(image, 'source_url', null);
}
const featuredImageInfo = {
@@ -17752,7 +17791,7 @@ function LatestPostsEdit(_ref) {
}); // We do nothing if the category is not selected
// from suggestions.
- if (Object(external_lodash_["includes"])(allCategories, null)) {
+ if ((0,external_lodash_namespaceObject.includes)(allCategories, null)) {
return false;
}
@@ -17762,58 +17801,58 @@ function LatestPostsEdit(_ref) {
};
const hasPosts = !!(latestPosts !== null && latestPosts !== void 0 && latestPosts.length);
- const inspectorControls = Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Post content settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Post content'),
+ const inspectorControls = (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.__)('Post content settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Post content'),
checked: displayPostContent,
onChange: value => setAttributes({
displayPostContent: value
})
- }), displayPostContent && Object(external_wp_element_["createElement"])(external_wp_components_["RadioControl"], {
- label: Object(external_wp_i18n_["__"])('Show:'),
+ }), displayPostContent && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RadioControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Show:'),
selected: displayPostContentRadio,
options: [{
- label: Object(external_wp_i18n_["__"])('Excerpt'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Excerpt'),
value: 'excerpt'
}, {
- label: Object(external_wp_i18n_["__"])('Full post'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Full post'),
value: 'full_post'
}],
onChange: value => setAttributes({
displayPostContentRadio: value
})
- }), displayPostContent && displayPostContentRadio === 'excerpt' && Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], {
- label: Object(external_wp_i18n_["__"])('Max number of words in excerpt'),
+ }), displayPostContent && displayPostContentRadio === 'excerpt' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Max number of words in excerpt'),
value: excerptLength,
onChange: value => setAttributes({
excerptLength: value
}),
min: MIN_EXCERPT_LENGTH,
max: MAX_EXCERPT_LENGTH
- })), Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Post meta settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Display author name'),
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
+ title: (0,external_wp_i18n_namespaceObject.__)('Post meta settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Display author name'),
checked: displayAuthor,
onChange: value => setAttributes({
displayAuthor: value
})
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Display post date'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Display post date'),
checked: displayPostDate,
onChange: value => setAttributes({
displayPostDate: value
})
- })), Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Featured image settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Display featured image'),
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
+ title: (0,external_wp_i18n_namespaceObject.__)('Featured image settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Display featured image'),
checked: displayFeaturedImage,
onChange: value => setAttributes({
displayFeaturedImage: value
})
- }), displayFeaturedImage && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalImageSizeControl"], {
+ }), displayFeaturedImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, {
onChange: value => {
const newAttrs = {};
@@ -17838,24 +17877,24 @@ function LatestPostsEdit(_ref) {
featuredImageSizeWidth: undefined,
featuredImageSizeHeight: undefined
})
- }), Object(external_wp_element_["createElement"])(external_wp_components_["BaseControl"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
className: "block-editor-image-alignment-control__row"
- }, Object(external_wp_element_["createElement"])(external_wp_components_["BaseControl"].VisualLabel, null, Object(external_wp_i18n_["__"])('Image alignment')), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockAlignmentToolbar"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Image alignment')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockAlignmentToolbar, {
value: featuredImageAlign,
onChange: value => setAttributes({
featuredImageAlign: value
}),
controls: ['left', 'center', 'right'],
isCollapsed: false
- })), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Add link to featured image'),
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Add link to featured image'),
checked: addLinkToFeaturedImage,
onChange: value => setAttributes({
addLinkToFeaturedImage: value
})
- }))), Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Sorting and filtering')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["QueryControls"], {
+ }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
+ title: (0,external_wp_i18n_namespaceObject.__)('Sorting and filtering')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.QueryControls, {
order,
orderBy,
numberOfItems: postsToShow,
@@ -17876,8 +17915,8 @@ function LatestPostsEdit(_ref) {
}),
authorList: authorList !== null && authorList !== void 0 ? authorList : [],
selectedAuthorId: selectedAuthor
- }), postLayout === 'grid' && Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], {
- label: Object(external_wp_i18n_["__"])('Columns'),
+ }), postLayout === 'grid' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
value: columns,
onChange: value => setAttributes({
columns: value
@@ -17886,7 +17925,7 @@ function LatestPostsEdit(_ref) {
max: !hasPosts ? MAX_POSTS_COLUMNS : Math.min(MAX_POSTS_COLUMNS, latestPosts.length),
required: true
})));
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
'wp-block-latest-posts__list': true,
'is-grid': postLayout === 'grid',
@@ -17897,36 +17936,36 @@ function LatestPostsEdit(_ref) {
});
if (!hasPosts) {
- return Object(external_wp_element_["createElement"])("div", blockProps, inspectorControls, Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], {
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
icon: library_pin,
- label: Object(external_wp_i18n_["__"])('Latest Posts')
- }, !Array.isArray(latestPosts) ? Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null) : Object(external_wp_i18n_["__"])('No posts found.')));
+ label: (0,external_wp_i18n_namespaceObject.__)('Latest Posts')
+ }, !Array.isArray(latestPosts) ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null) : (0,external_wp_i18n_namespaceObject.__)('No posts found.')));
} // Removing posts from display should be instant.
const displayPosts = latestPosts.length > postsToShow ? latestPosts.slice(0, postsToShow) : latestPosts;
const layoutControls = [{
icon: library_list,
- title: Object(external_wp_i18n_["__"])('List view'),
+ title: (0,external_wp_i18n_namespaceObject.__)('List view'),
onClick: () => setAttributes({
postLayout: 'list'
}),
isActive: postLayout === 'list'
}, {
- icon: grid["a" /* default */],
- title: Object(external_wp_i18n_["__"])('Grid view'),
+ icon: library_grid,
+ title: (0,external_wp_i18n_namespaceObject.__)('Grid view'),
onClick: () => setAttributes({
postLayout: 'grid'
}),
isActive: postLayout === 'grid'
}];
- const dateFormat = Object(external_wp_date_["__experimentalGetSettings"])().formats.date;
+ const dateFormat = (0,external_wp_date_namespaceObject.__experimentalGetSettings)().formats.date;
- return Object(external_wp_element_["createElement"])("div", null, inspectorControls, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], {
+ return (0,external_wp_element_namespaceObject.createElement)("div", null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
controls: layoutControls
- })), Object(external_wp_element_["createElement"])("ul", blockProps, displayPosts.map((post, i) => {
- const titleTrimmed = Object(external_lodash_["invoke"])(post, ['title', 'rendered', 'trim']);
+ })), (0,external_wp_element_namespaceObject.createElement)("ul", blockProps, displayPosts.map((post, i) => {
+ const titleTrimmed = (0,external_lodash_namespaceObject.invoke)(post, ['title', 'rendered', 'trim']);
let excerpt = post.excerpt.rendered;
const currentAuthor = authorList === null || authorList === void 0 ? void 0 : authorList.find(author => author.id === post.author);
const excerptElement = document.createElement('div');
@@ -17943,7 +17982,7 @@ function LatestPostsEdit(_ref) {
[`align${featuredImageAlign}`]: !!featuredImageAlign
});
const renderFeaturedImage = displayFeaturedImage && imageSourceUrl;
- const featuredImage = renderFeaturedImage && Object(external_wp_element_["createElement"])("img", {
+ const featuredImage = renderFeaturedImage && (0,external_wp_element_namespaceObject.createElement)("img", {
src: imageSourceUrl,
alt: featuredImageAlt,
style: {
@@ -17952,38 +17991,38 @@ function LatestPostsEdit(_ref) {
}
});
const needsReadMore = excerptLength < excerpt.trim().split(' ').length && post.excerpt.raw === '';
- const postExcerpt = needsReadMore ? Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, excerpt.trim().split(' ', excerptLength).join(' '), Object(external_wp_i18n_["__"])(' … '), Object(external_wp_element_["createElement"])("a", {
+ const postExcerpt = needsReadMore ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, excerpt.trim().split(' ', excerptLength).join(' '), (0,external_wp_i18n_namespaceObject.__)(' … '), (0,external_wp_element_namespaceObject.createElement)("a", {
href: post.link,
rel: "noopener noreferrer"
- }, Object(external_wp_i18n_["__"])('Read more'))) : excerpt;
- return Object(external_wp_element_["createElement"])("li", {
+ }, (0,external_wp_i18n_namespaceObject.__)('Read more'))) : excerpt;
+ return (0,external_wp_element_namespaceObject.createElement)("li", {
key: i
- }, renderFeaturedImage && Object(external_wp_element_["createElement"])("div", {
+ }, renderFeaturedImage && (0,external_wp_element_namespaceObject.createElement)("div", {
className: imageClasses
- }, addLinkToFeaturedImage ? Object(external_wp_element_["createElement"])("a", {
+ }, addLinkToFeaturedImage ? (0,external_wp_element_namespaceObject.createElement)("a", {
href: post.link,
rel: "noreferrer noopener"
- }, featuredImage) : featuredImage), Object(external_wp_element_["createElement"])("a", {
+ }, featuredImage) : featuredImage), (0,external_wp_element_namespaceObject.createElement)("a", {
href: post.link,
rel: "noreferrer noopener"
- }, titleTrimmed ? Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, titleTrimmed) : Object(external_wp_i18n_["__"])('(no title)')), displayAuthor && currentAuthor && Object(external_wp_element_["createElement"])("div", {
+ }, titleTrimmed ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, titleTrimmed) : (0,external_wp_i18n_namespaceObject.__)('(no title)')), displayAuthor && currentAuthor && (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-latest-posts__post-author"
- }, Object(external_wp_i18n_["sprintf"])(
+ }, (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: byline. %s: current author. */
- Object(external_wp_i18n_["__"])('by %s'), currentAuthor.name)), displayPostDate && post.date_gmt && Object(external_wp_element_["createElement"])("time", {
- dateTime: Object(external_wp_date_["format"])('c', post.date_gmt),
+ (0,external_wp_i18n_namespaceObject.__)('by %s'), currentAuthor.name)), displayPostDate && post.date_gmt && (0,external_wp_element_namespaceObject.createElement)("time", {
+ dateTime: (0,external_wp_date_namespaceObject.format)('c', post.date_gmt),
className: "wp-block-latest-posts__post-date"
- }, Object(external_wp_date_["dateI18n"])(dateFormat, post.date_gmt)), displayPostContent && displayPostContentRadio === 'excerpt' && Object(external_wp_element_["createElement"])("div", {
+ }, (0,external_wp_date_namespaceObject.dateI18n)(dateFormat, post.date_gmt)), displayPostContent && displayPostContentRadio === 'excerpt' && (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-latest-posts__post-excerpt"
- }, postExcerpt), displayPostContent && displayPostContentRadio === 'full_post' && Object(external_wp_element_["createElement"])("div", {
+ }, postExcerpt), displayPostContent && displayPostContentRadio === 'full_post' && (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-latest-posts__post-full-content"
- }, Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, {
key: "html"
}, post.content.raw.trim())));
})));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js
/**
* WordPress dependencies
*/
@@ -18095,7 +18134,7 @@ const latest_posts_settings = {
deprecated: latest_posts_deprecated
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/deprecated.js
/**
@@ -18164,11 +18203,11 @@ const list_deprecated_v1 = {
start
} = attributes;
const TagName = ordered ? 'ol' : 'ul';
- return Object(external_wp_element_["createElement"])(TagName, external_wp_blockEditor_["useBlockProps"].save({
+ return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
type,
reversed,
start
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: values,
multiline: "li"
}));
@@ -18197,127 +18236,127 @@ const list_deprecated_v1 = {
/* harmony default export */ var list_deprecated = ([list_deprecated_v1]);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js
/**
* WordPress dependencies
*/
-const formatListBulletsRTL = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const formatListBulletsRTL = (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: "M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"
}));
/* harmony default export */ var format_list_bullets_rtl = (formatListBulletsRTL);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js
/**
* WordPress dependencies
*/
-const formatListBullets = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const formatListBullets = (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.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
}));
/* harmony default export */ var format_list_bullets = (formatListBullets);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-numbered-rtl.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-numbered-rtl.js
/**
* WordPress dependencies
*/
-const formatListNumberedRTL = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const formatListNumberedRTL = (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: "M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z"
}));
/* harmony default export */ var format_list_numbered_rtl = (formatListNumberedRTL);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-numbered.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-list-numbered.js
/**
* WordPress dependencies
*/
-const formatListNumbered = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const formatListNumbered = (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.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"
}));
/* harmony default export */ var format_list_numbered = (formatListNumbered);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-outdent-rtl.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-outdent-rtl.js
/**
* WordPress dependencies
*/
-const formatOutdentRTL = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const formatOutdentRTL = (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: "M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z"
}));
/* harmony default export */ var format_outdent_rtl = (formatOutdentRTL);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-outdent.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-outdent.js
/**
* WordPress dependencies
*/
-const formatOutdent = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const formatOutdent = (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: "M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z"
}));
/* harmony default export */ var format_outdent = (formatOutdent);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-indent-rtl.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-indent-rtl.js
/**
* WordPress dependencies
*/
-const formatIndentRTL = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const formatIndentRTL = (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: "M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z"
}));
/* harmony default export */ var format_indent_rtl = (formatIndentRTL);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-indent.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-indent.js
/**
* WordPress dependencies
*/
-const formatIndent = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const formatIndent = (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: "M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z"
}));
/* harmony default export */ var format_indent = (formatIndent);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/ordered-list-settings.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/ordered-list-settings.js
/**
@@ -18333,10 +18372,10 @@ const OrderedListSettings = _ref => {
reversed,
start
} = _ref;
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Ordered list settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
- label: Object(external_wp_i18n_["__"])('Start value'),
+ return (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.__)('Ordered list settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Start value'),
type: "number",
onChange: value => {
const int = parseInt(value, 10);
@@ -18348,8 +18387,8 @@ const OrderedListSettings = _ref => {
},
value: Number.isInteger(start) ? start.toString(10) : '',
step: "1"
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Reverse list numbering'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Reverse list numbering'),
checked: reversed || false,
onChange: value => {
setAttributes({
@@ -18362,7 +18401,7 @@ const OrderedListSettings = _ref => {
/* harmony default export */ var ordered_list_settings = (OrderedListSettings);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/edit.js
@@ -18405,88 +18444,88 @@ function ListEdit(_ref) {
onChange,
onFocus
} = _ref2;
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichTextShortcut"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
type: "primary",
character: "[",
onUse: () => {
- onChange(Object(external_wp_richText_["__unstableOutdentListItems"])(value));
+ onChange((0,external_wp_richText_namespaceObject.__unstableOutdentListItems)(value));
}
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichTextShortcut"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
type: "primary",
character: "]",
onUse: () => {
- onChange(Object(external_wp_richText_["__unstableIndentListItems"])(value, {
+ onChange((0,external_wp_richText_namespaceObject.__unstableIndentListItems)(value, {
type: tagName
}));
}
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichTextShortcut"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
type: "primary",
character: "m",
onUse: () => {
- onChange(Object(external_wp_richText_["__unstableIndentListItems"])(value, {
+ onChange((0,external_wp_richText_namespaceObject.__unstableIndentListItems)(value, {
type: tagName
}));
}
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichTextShortcut"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichTextShortcut, {
type: "primaryShift",
character: "m",
onUse: () => {
- onChange(Object(external_wp_richText_["__unstableOutdentListItems"])(value));
+ onChange((0,external_wp_richText_namespaceObject.__unstableOutdentListItems)(value));
}
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "block"
- }, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
- icon: Object(external_wp_i18n_["isRTL"])() ? format_list_bullets_rtl : format_list_bullets,
- title: Object(external_wp_i18n_["__"])('Unordered'),
- describedBy: Object(external_wp_i18n_["__"])('Convert to unordered list'),
- isActive: Object(external_wp_richText_["__unstableIsActiveListType"])(value, 'ul', tagName),
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
+ icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_bullets_rtl : format_list_bullets,
+ title: (0,external_wp_i18n_namespaceObject.__)('Unordered'),
+ describedBy: (0,external_wp_i18n_namespaceObject.__)('Convert to unordered list'),
+ isActive: (0,external_wp_richText_namespaceObject.__unstableIsActiveListType)(value, 'ul', tagName),
onClick: () => {
- onChange(Object(external_wp_richText_["__unstableChangeListType"])(value, {
+ onChange((0,external_wp_richText_namespaceObject.__unstableChangeListType)(value, {
type: 'ul'
}));
onFocus();
- if (Object(external_wp_richText_["__unstableIsListRootSelected"])(value)) {
+ if ((0,external_wp_richText_namespaceObject.__unstableIsListRootSelected)(value)) {
setAttributes({
ordered: false
});
}
}
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
- icon: Object(external_wp_i18n_["isRTL"])() ? format_list_numbered_rtl : format_list_numbered,
- title: Object(external_wp_i18n_["__"])('Ordered'),
- describedBy: Object(external_wp_i18n_["__"])('Convert to ordered list'),
- isActive: Object(external_wp_richText_["__unstableIsActiveListType"])(value, 'ol', tagName),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
+ icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_numbered_rtl : format_list_numbered,
+ title: (0,external_wp_i18n_namespaceObject.__)('Ordered'),
+ describedBy: (0,external_wp_i18n_namespaceObject.__)('Convert to ordered list'),
+ isActive: (0,external_wp_richText_namespaceObject.__unstableIsActiveListType)(value, 'ol', tagName),
onClick: () => {
- onChange(Object(external_wp_richText_["__unstableChangeListType"])(value, {
+ onChange((0,external_wp_richText_namespaceObject.__unstableChangeListType)(value, {
type: 'ol'
}));
onFocus();
- if (Object(external_wp_richText_["__unstableIsListRootSelected"])(value)) {
+ if ((0,external_wp_richText_namespaceObject.__unstableIsListRootSelected)(value)) {
setAttributes({
ordered: true
});
}
}
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
- icon: Object(external_wp_i18n_["isRTL"])() ? format_outdent_rtl : format_outdent,
- title: Object(external_wp_i18n_["__"])('Outdent'),
- describedBy: Object(external_wp_i18n_["__"])('Outdent list item'),
- shortcut: Object(external_wp_i18n_["_x"])('Backspace', 'keyboard key'),
- isDisabled: !Object(external_wp_richText_["__unstableCanOutdentListItems"])(value),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
+ icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_outdent_rtl : format_outdent,
+ title: (0,external_wp_i18n_namespaceObject.__)('Outdent'),
+ describedBy: (0,external_wp_i18n_namespaceObject.__)('Outdent list item'),
+ shortcut: (0,external_wp_i18n_namespaceObject._x)('Backspace', 'keyboard key'),
+ isDisabled: !(0,external_wp_richText_namespaceObject.__unstableCanOutdentListItems)(value),
onClick: () => {
- onChange(Object(external_wp_richText_["__unstableOutdentListItems"])(value));
+ onChange((0,external_wp_richText_namespaceObject.__unstableOutdentListItems)(value));
onFocus();
}
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
- icon: Object(external_wp_i18n_["isRTL"])() ? format_indent_rtl : format_indent,
- title: Object(external_wp_i18n_["__"])('Indent'),
- describedBy: Object(external_wp_i18n_["__"])('Indent list item'),
- shortcut: Object(external_wp_i18n_["_x"])('Space', 'keyboard key'),
- isDisabled: !Object(external_wp_richText_["__unstableCanIndentListItems"])(value),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
+ icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_indent_rtl : format_indent,
+ title: (0,external_wp_i18n_namespaceObject.__)('Indent'),
+ describedBy: (0,external_wp_i18n_namespaceObject.__)('Indent list item'),
+ shortcut: (0,external_wp_i18n_namespaceObject._x)('Space', 'keyboard key'),
+ isDisabled: !(0,external_wp_richText_namespaceObject.__unstableCanIndentListItems)(value),
onClick: () => {
- onChange(Object(external_wp_richText_["__unstableIndentListItems"])(value, {
+ onChange((0,external_wp_richText_namespaceObject.__unstableIndentListItems)(value, {
type: tagName
}));
onFocus();
@@ -18494,10 +18533,10 @@ function ListEdit(_ref) {
})));
};
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
style
});
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], Object(esm_extends["a" /* default */])({
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
identifier: "values",
multiline: "li",
tagName: tagName,
@@ -18505,19 +18544,19 @@ function ListEdit(_ref) {
values: nextValues
}),
value: values,
- "aria-label": Object(external_wp_i18n_["__"])('List text'),
- placeholder: placeholder || Object(external_wp_i18n_["__"])('List'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('List text'),
+ placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('List'),
onMerge: mergeBlocks,
- onSplit: value => Object(external_wp_blocks_["createBlock"])(list_name, { ...attributes,
+ onSplit: value => (0,external_wp_blocks_namespaceObject.createBlock)(list_name, { ...attributes,
values: value
}),
- __unstableOnSplitMiddle: () => Object(external_wp_blocks_["createBlock"])('core/paragraph'),
+ __unstableOnSplitMiddle: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'),
onReplace: onReplace,
onRemove: () => onReplace([]),
start: start,
reversed: reversed,
type: type
- }, blockProps), controls), ordered && Object(external_wp_element_["createElement"])(ordered_list_settings, {
+ }, blockProps), controls), ordered && (0,external_wp_element_namespaceObject.createElement)(ordered_list_settings, {
setAttributes: setAttributes,
ordered: ordered,
reversed: reversed,
@@ -18526,7 +18565,7 @@ function ListEdit(_ref) {
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/save.js
/**
@@ -18545,17 +18584,17 @@ function list_save_save(_ref) {
start
} = attributes;
const TagName = ordered ? 'ol' : 'ul';
- return Object(external_wp_element_["createElement"])(TagName, external_wp_blockEditor_["useBlockProps"].save({
+ return (0,external_wp_element_namespaceObject.createElement)(TagName, external_wp_blockEditor_namespaceObject.useBlockProps.save({
type,
reversed,
start
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: values,
multiline: "li"
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/transforms.js
/**
* WordPress dependencies
*/
@@ -18591,13 +18630,13 @@ const list_transforms_transforms = {
isMultiBlock: true,
blocks: ['core/paragraph', 'core/heading'],
transform: blockAttributes => {
- return Object(external_wp_blocks_["createBlock"])('core/list', {
- values: Object(external_wp_richText_["toHTMLString"])({
- value: Object(external_wp_richText_["join"])(blockAttributes.map(_ref2 => {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
+ values: (0,external_wp_richText_namespaceObject.toHTMLString)({
+ value: (0,external_wp_richText_namespaceObject.join)(blockAttributes.map(_ref2 => {
let {
content
} = _ref2;
- const value = Object(external_wp_richText_["create"])({
+ const value = (0,external_wp_richText_namespaceObject.create)({
html: content
});
@@ -18607,8 +18646,8 @@ const list_transforms_transforms = {
// every line to a list item.
- return Object(external_wp_richText_["replace"])(value, /\n/g, external_wp_richText_["__UNSTABLE_LINE_SEPARATOR"]);
- }), external_wp_richText_["__UNSTABLE_LINE_SEPARATOR"]),
+ return (0,external_wp_richText_namespaceObject.replace)(value, /\n/g, external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR);
+ }), external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR),
multilineTag: 'li'
}),
anchor: blockAttributes.anchor
@@ -18622,9 +18661,9 @@ const list_transforms_transforms = {
value,
anchor
} = _ref3;
- return Object(external_wp_blocks_["createBlock"])('core/list', {
- values: Object(external_wp_richText_["toHTMLString"])({
- value: Object(external_wp_richText_["create"])({
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
+ values: (0,external_wp_richText_namespaceObject.toHTMLString)({
+ value: (0,external_wp_richText_namespaceObject.create)({
html: value,
multilineTag: 'p'
}),
@@ -18666,7 +18705,7 @@ const list_transforms_transforms = {
}
}
- return Object(external_wp_blocks_["createBlock"])('core/list', { ...Object(external_wp_blocks_["getBlockAttributes"])('core/list', node.outerHTML),
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', { ...(0,external_wp_blocks_namespaceObject.getBlockAttributes)('core/list', node.outerHTML),
...attributes
});
}
@@ -18676,7 +18715,7 @@ const list_transforms_transforms = {
prefix,
transform(content) {
- return Object(external_wp_blocks_["createBlock"])('core/list', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
values: `<li>${content}</li>`
});
}
@@ -18686,7 +18725,7 @@ const list_transforms_transforms = {
prefix,
transform(content) {
- return Object(external_wp_blocks_["createBlock"])('core/list', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {
ordered: true,
values: `<li>${content}</li>`
});
@@ -18700,12 +18739,12 @@ const list_transforms_transforms = {
let {
values
} = _ref4;
- return Object(external_wp_richText_["split"])(Object(external_wp_richText_["create"])({
+ return (0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
html: values,
multilineTag: 'li',
multilineWrapperTags: ['ul', 'ol']
- }), external_wp_richText_["__UNSTABLE_LINE_SEPARATOR"]).map(piece => Object(external_wp_blocks_["createBlock"])('core/paragraph', {
- content: Object(external_wp_richText_["toHTMLString"])({
+ }), external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR).map(piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
+ content: (0,external_wp_richText_namespaceObject.toHTMLString)({
value: piece
})
}));
@@ -18717,12 +18756,12 @@ const list_transforms_transforms = {
let {
values
} = _ref5;
- return Object(external_wp_richText_["split"])(Object(external_wp_richText_["create"])({
+ return (0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
html: values,
multilineTag: 'li',
multilineWrapperTags: ['ul', 'ol']
- }), external_wp_richText_["__UNSTABLE_LINE_SEPARATOR"]).map(piece => Object(external_wp_blocks_["createBlock"])('core/heading', {
- content: Object(external_wp_richText_["toHTMLString"])({
+ }), external_wp_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR).map(piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
+ content: (0,external_wp_richText_namespaceObject.toHTMLString)({
value: piece
})
}));
@@ -18735,9 +18774,9 @@ const list_transforms_transforms = {
values,
anchor
} = _ref6;
- return Object(external_wp_blocks_["createBlock"])('core/quote', {
- value: Object(external_wp_richText_["toHTMLString"])({
- value: Object(external_wp_richText_["create"])({
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
+ value: (0,external_wp_richText_namespaceObject.toHTMLString)({
+ value: (0,external_wp_richText_namespaceObject.create)({
html: values,
multilineTag: 'li',
multilineWrapperTags: ['ul', 'ol']
@@ -18755,9 +18794,9 @@ const list_transforms_transforms = {
values,
anchor
} = _ref7;
- return Object(external_wp_blocks_["createBlock"])('core/pullquote', {
- value: Object(external_wp_richText_["toHTMLString"])({
- value: Object(external_wp_richText_["create"])({
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
+ value: (0,external_wp_richText_namespaceObject.toHTMLString)({
+ value: (0,external_wp_richText_namespaceObject.create)({
html: values,
multilineTag: 'li',
multilineWrapperTags: ['ul', 'ol']
@@ -18771,7 +18810,7 @@ const list_transforms_transforms = {
};
/* harmony default export */ var list_transforms = (list_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/list/index.js
/**
* WordPress dependencies
*/
@@ -18878,22 +18917,22 @@ const list_settings = {
deprecated: list_deprecated
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/login.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/login.js
/**
* WordPress dependencies
*/
-const login = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const login = (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 14.5l1.1 1.1 3-3 .5-.5-.6-.6-3-3-1 1 1.7 1.7H5v1.5h7.7L11 14.5zM16.8 5h-7c-1.1 0-2 .9-2 2v1.5h1.5V7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v10c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-1.5H7.8V17c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z"
}));
/* harmony default export */ var library_login = (login);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/loginout/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/loginout/edit.js
/**
@@ -18911,28 +18950,28 @@ function LoginOutEdit(_ref) {
displayLoginAsForm,
redirectToCurrent
} = 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_["__"])('Login/out settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Display login as form'),
+ 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.__)('Login/out settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Display login as form'),
checked: displayLoginAsForm,
onChange: () => setAttributes({
displayLoginAsForm: !displayLoginAsForm
})
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Redirect to current URL'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Redirect to current URL'),
checked: redirectToCurrent,
onChange: () => setAttributes({
redirectToCurrent: !redirectToCurrent
})
- }))), Object(external_wp_element_["createElement"])("div", Object(external_wp_blockEditor_["useBlockProps"])({
+ }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: 'logged-in'
- }), Object(external_wp_element_["createElement"])("a", {
+ }), (0,external_wp_element_namespaceObject.createElement)("a", {
href: "#login-pseudo-link"
- }, Object(external_wp_i18n_["__"])('Log out'))));
+ }, (0,external_wp_i18n_namespaceObject.__)('Log out'))));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/loginout/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/loginout/index.js
/**
* WordPress dependencies
*/
@@ -18976,40 +19015,40 @@ const loginout_settings = {
edit: LoginOutEdit
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media-and-text.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media-and-text.js
/**
* WordPress dependencies
*/
-const mediaAndText = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const mediaAndText = (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: "M3 18h8V6H3v12zM14 7.5V9h7V7.5h-7zm0 5.3h7v-1.5h-7v1.5zm0 3.7h7V15h-7v1.5z"
}));
/* harmony default export */ var media_and_text = (mediaAndText);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/media-container-icon.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/media-container-icon.js
/**
* WordPress dependencies
*/
-/* harmony default export */ var media_container_icon = (Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], {
+/* harmony default export */ var media_container_icon = ((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_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M18 2l2 4h-2l-2-4h-3l2 4h-2l-2-4h-1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V2zm2 12H10V4.4L11.8 8H20z"
-}), Object(external_wp_element_["createElement"])(external_wp_components_["Path"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M14 20H4V10h3V8H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3h-2z"
-}), Object(external_wp_element_["createElement"])(external_wp_components_["Path"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M5 19h8l-1.59-2H9.24l-.84 1.1L7 16.3 5 19z"
})));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/media-container.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/media-container.js
@@ -19045,14 +19084,14 @@ function imageFillStyles(url, focalPoint) {
backgroundPosition: focalPoint ? `${focalPoint.x * 100}% ${focalPoint.y * 100}%` : `50% 50%`
} : {};
}
-const ResizableBoxContainer = Object(external_wp_element_["forwardRef"])((_ref, ref) => {
+const ResizableBoxContainer = (0,external_wp_element_namespaceObject.forwardRef)((_ref, ref) => {
let {
isSelected,
isStackedOnMobile,
...props
} = _ref;
- const isMobile = Object(external_wp_compose_["useViewportMatch"])('small', '<');
- return Object(external_wp_element_["createElement"])(external_wp_components_["ResizableBox"], Object(esm_extends["a" /* default */])({
+ const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('small', '<');
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, _extends({
ref: ref,
showHandle: isSelected && (!isMobile || !isStackedOnMobile)
}, props));
@@ -19064,9 +19103,9 @@ function ToolbarEditButton(_ref2) {
mediaUrl,
onSelectMedia
} = _ref2;
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], {
+ return (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: mediaId,
mediaURL: mediaUrl,
allowedTypes: media_container_ALLOWED_MEDIA_TYPES,
@@ -19089,12 +19128,12 @@ function PlaceholderContainer(_ref3) {
noticeOperations.createErrorNotice(message);
};
- 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: media_container_icon
}),
labels: {
- title: Object(external_wp_i18n_["__"])('Media area')
+ title: (0,external_wp_i18n_namespaceObject.__)('Media area')
},
className: className,
onSelect: onSelectMedia,
@@ -19123,10 +19162,10 @@ function MediaContainer(props, ref) {
onSelectMedia,
onWidthChange
} = props;
- const isTemporaryMedia = !mediaId && Object(external_wp_blob_["isBlobURL"])(mediaUrl);
+ const isTemporaryMedia = !mediaId && (0,external_wp_blob_namespaceObject.isBlobURL)(mediaUrl);
const {
toggleSelection
- } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
if (mediaUrl) {
const onResizeStart = () => {
@@ -19148,16 +19187,16 @@ function MediaContainer(props, ref) {
};
const backgroundStyles = mediaType === 'image' && imageFill ? imageFillStyles(mediaUrl, focalPoint) : {};
const mediaTypeRenderers = {
- image: () => Object(external_wp_element_["createElement"])("img", {
+ image: () => (0,external_wp_element_namespaceObject.createElement)("img", {
src: mediaUrl,
alt: mediaAlt
}),
- video: () => Object(external_wp_element_["createElement"])("video", {
+ video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
controls: true,
src: mediaUrl
})
};
- return Object(external_wp_element_["createElement"])(ResizableBoxContainer, {
+ return (0,external_wp_element_namespaceObject.createElement)(ResizableBoxContainer, {
as: "figure",
className: classnames_default()(className, 'editor-media-container__resizer', {
'is-transient': isTemporaryMedia
@@ -19176,19 +19215,19 @@ function MediaContainer(props, ref) {
isSelected: isSelected,
isStackedOnMobile: isStackedOnMobile,
ref: ref
- }, Object(external_wp_element_["createElement"])(ToolbarEditButton, {
+ }, (0,external_wp_element_namespaceObject.createElement)(ToolbarEditButton, {
onSelectMedia: onSelectMedia,
mediaUrl: mediaUrl,
mediaId: mediaId
- }), (mediaTypeRenderers[mediaType] || external_lodash_["noop"])(), isTemporaryMedia && Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null), Object(external_wp_element_["createElement"])(PlaceholderContainer, props));
+ }), (mediaTypeRenderers[mediaType] || external_lodash_namespaceObject.noop)(), isTemporaryMedia && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (0,external_wp_element_namespaceObject.createElement)(PlaceholderContainer, props));
}
- return Object(external_wp_element_["createElement"])(PlaceholderContainer, props);
+ return (0,external_wp_element_namespaceObject.createElement)(PlaceholderContainer, props);
}
-/* harmony default export */ var media_container = (Object(external_wp_components_["withNotices"])(Object(external_wp_element_["forwardRef"])(MediaContainer)));
+/* harmony default export */ var media_container = ((0,external_wp_components_namespaceObject.withNotices)((0,external_wp_element_namespaceObject.forwardRef)(MediaContainer)));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/deprecated.js
/**
@@ -19218,7 +19257,7 @@ const media_text_deprecated_migrateCustomColors = attributes => {
background: attributes.customBackgroundColor
}
};
- return { ...Object(external_lodash_["omit"])(attributes, ['customBackgroundColor']),
+ return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customBackgroundColor']),
style
};
};
@@ -19326,15 +19365,15 @@ const baseAttributes = {
linkTarget,
rel
} = attributes;
- const newRel = Object(external_lodash_["isEmpty"])(rel) ? undefined : rel;
- let image = Object(external_wp_element_["createElement"])("img", {
+ const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
+ let image = (0,external_wp_element_namespaceObject.createElement)("img", {
src: mediaUrl,
alt: mediaAlt,
className: mediaId && mediaType === 'image' ? `wp-image-${mediaId}` : null
});
if (href) {
- image = Object(external_wp_element_["createElement"])("a", {
+ image = (0,external_wp_element_namespaceObject.createElement)("a", {
className: linkClass,
href: href,
target: linkTarget,
@@ -19344,12 +19383,12 @@ const baseAttributes = {
const mediaTypeRenders = {
image: () => image,
- video: () => Object(external_wp_element_["createElement"])("video", {
+ video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
controls: true,
src: mediaUrl
})
};
- 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()({
'has-media-on-the-right': 'right' === mediaPosition,
'has-background': backgroundClass || customBackgroundColor,
@@ -19369,15 +19408,15 @@ const baseAttributes = {
backgroundColor: backgroundClass ? undefined : customBackgroundColor,
gridTemplateColumns
};
- return Object(external_wp_element_["createElement"])("div", {
+ return (0,external_wp_element_namespaceObject.createElement)("div", {
className: className,
style: style
- }, Object(external_wp_element_["createElement"])("figure", {
+ }, (0,external_wp_element_namespaceObject.createElement)("figure", {
className: "wp-block-media-text__media",
style: backgroundStyles
- }, (mediaTypeRenders[mediaType] || external_lodash_["noop"])()), Object(external_wp_element_["createElement"])("div", {
+ }, (mediaTypeRenders[mediaType] || external_lodash_namespaceObject.noop)()), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-media-text__content"
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null)));
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
}
}, {
@@ -19422,17 +19461,17 @@ const baseAttributes = {
focalPoint
} = attributes;
const mediaTypeRenders = {
- image: () => Object(external_wp_element_["createElement"])("img", {
+ image: () => (0,external_wp_element_namespaceObject.createElement)("img", {
src: mediaUrl,
alt: mediaAlt,
className: mediaId && mediaType === 'image' ? `wp-image-${mediaId}` : null
}),
- video: () => Object(external_wp_element_["createElement"])("video", {
+ video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
controls: true,
src: mediaUrl
})
};
- 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()({
'has-media-on-the-right': 'right' === mediaPosition,
[backgroundClass]: backgroundClass,
@@ -19451,15 +19490,15 @@ const baseAttributes = {
backgroundColor: backgroundClass ? undefined : customBackgroundColor,
gridTemplateColumns
};
- return Object(external_wp_element_["createElement"])("div", {
+ return (0,external_wp_element_namespaceObject.createElement)("div", {
className: className,
style: style
- }, Object(external_wp_element_["createElement"])("figure", {
+ }, (0,external_wp_element_namespaceObject.createElement)("figure", {
className: "wp-block-media-text__media",
style: backgroundStyles
- }, (mediaTypeRenders[mediaType] || external_lodash_["noop"])()), Object(external_wp_element_["createElement"])("div", {
+ }, (mediaTypeRenders[mediaType] || external_lodash_namespaceObject.noop)()), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-media-text__content"
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null)));
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null)));
}
}, {
@@ -19490,16 +19529,16 @@ const baseAttributes = {
mediaWidth
} = attributes;
const mediaTypeRenders = {
- image: () => Object(external_wp_element_["createElement"])("img", {
+ image: () => (0,external_wp_element_namespaceObject.createElement)("img", {
src: mediaUrl,
alt: mediaAlt
}),
- video: () => Object(external_wp_element_["createElement"])("video", {
+ video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
controls: true,
src: mediaUrl
})
};
- 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()({
'has-media-on-the-right': 'right' === mediaPosition,
[backgroundClass]: backgroundClass,
@@ -19515,52 +19554,52 @@ const baseAttributes = {
backgroundColor: backgroundClass ? undefined : customBackgroundColor,
gridTemplateColumns
};
- return Object(external_wp_element_["createElement"])("div", {
+ return (0,external_wp_element_namespaceObject.createElement)("div", {
className: className,
style: style
- }, Object(external_wp_element_["createElement"])("figure", {
+ }, (0,external_wp_element_namespaceObject.createElement)("figure", {
className: "wp-block-media-text__media"
- }, (mediaTypeRenders[mediaType] || external_lodash_["noop"])()), Object(external_wp_element_["createElement"])("div", {
+ }, (mediaTypeRenders[mediaType] || external_lodash_namespaceObject.noop)()), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-media-text__content"
- }, 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/icons/build-module/library/pull-left.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pull-left.js
/**
* WordPress dependencies
*/
-const pullLeft = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const pullLeft = (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: "M4 18h6V6H4v12zm9-9.5V10h7V8.5h-7zm0 7h7V14h-7v1.5z"
}));
/* harmony default export */ var pull_left = (pullLeft);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pull-right.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pull-right.js
/**
* WordPress dependencies
*/
-const pullRight = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const pullRight = (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: "M14 6v12h6V6h-6zM4 10h7V8.5H4V10zm0 5.5h7V14H4v1.5z"
}));
/* harmony default export */ var pull_right = (pullRight);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/constants.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/constants.js
const DEFAULT_MEDIA_SIZE_SLUG = 'full';
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/edit.js
/**
@@ -19591,7 +19630,7 @@ const DEFAULT_MEDIA_SIZE_SLUG = 'full';
const TEMPLATE = [['core/paragraph', {
fontSize: 'large',
- placeholder: Object(external_wp_i18n_["_x"])('Content…', 'content placeholder')
+ placeholder: (0,external_wp_i18n_namespaceObject._x)('Content…', 'content placeholder')
}]]; // this limits the resize to a safe zone to avoid making broken layouts
const WIDTH_CONSTRAINT_PERCENTAGE = 15;
@@ -19690,8 +19729,8 @@ function MediaTextEdit(_ref2) {
verticalAlignment
} = attributes;
const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
- const image = Object(external_wp_data_["useSelect"])(select => mediaId && isSelected ? select(external_wp_coreData_["store"]).getMedia(mediaId) : null, [isSelected, mediaId]);
- const refMediaContainer = Object(external_wp_element_["useRef"])();
+ const image = (0,external_wp_data_namespaceObject.useSelect)(select => mediaId && isSelected ? select(external_wp_coreData_namespaceObject.store).getMedia(mediaId) : null, [isSelected, mediaId]);
+ const refMediaContainer = (0,external_wp_element_namespaceObject.useRef)();
const imperativeFocalPointPreview = value => {
const {
@@ -19704,7 +19743,7 @@ function MediaTextEdit(_ref2) {
style.backgroundPosition = `${x * 100}% ${y * 100}%`;
};
- const [temporaryMediaWidth, setTemporaryMediaWidth] = Object(external_wp_element_["useState"])(null);
+ const [temporaryMediaWidth, setTemporaryMediaWidth] = (0,external_wp_element_namespaceObject.useState)(null);
const onSelectMedia = edit_attributesFromMedia({
attributes,
setAttributes
@@ -19751,11 +19790,11 @@ function MediaTextEdit(_ref2) {
});
};
- const imageSizes = Object(external_wp_data_["useSelect"])(select => {
- const settings = select(external_wp_blockEditor_["store"]).getSettings();
+ const imageSizes = (0,external_wp_data_namespaceObject.useSelect)(select => {
+ const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings();
return settings === null || settings === void 0 ? void 0 : settings.imageSizes;
}, []);
- const imageSizeOptions = Object(external_lodash_["map"])(Object(external_lodash_["filter"])(imageSizes, _ref3 => {
+ const imageSizeOptions = (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(imageSizes, _ref3 => {
let {
slug
} = _ref3;
@@ -19784,22 +19823,22 @@ function MediaTextEdit(_ref2) {
});
};
- const mediaTextGeneralSettings = Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Media & Text settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Stack on mobile'),
+ const mediaTextGeneralSettings = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
+ title: (0,external_wp_i18n_namespaceObject.__)('Media & Text settings')
+ }, (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
})
- }), mediaType === 'image' && Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Crop image to fill entire column'),
+ }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Crop image to fill entire column'),
checked: imageFill,
onChange: () => setAttributes({
imageFill: !imageFill
})
- }), imageFill && mediaUrl && mediaType === 'image' && Object(external_wp_element_["createElement"])(external_wp_components_["FocalPointPicker"], {
- label: Object(external_wp_i18n_["__"])('Focal point picker'),
+ }), imageFill && mediaUrl && mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FocalPointPicker, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Focal point picker'),
url: mediaUrl,
value: focalPoint,
onChange: value => setAttributes({
@@ -19807,54 +19846,54 @@ function MediaTextEdit(_ref2) {
}),
onDragStart: imperativeFocalPointPreview,
onDrag: imperativeFocalPointPreview
- }), mediaType === 'image' && Object(external_wp_element_["createElement"])(external_wp_components_["TextareaControl"], {
- label: Object(external_wp_i18n_["__"])('Alt text (alternative text)'),
+ }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Alt text (alternative text)'),
value: mediaAlt,
onChange: onMediaAltChange,
- 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.'))
- }), mediaType === 'image' && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalImageSizeControl"], {
+ }, (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image')), (0,external_wp_i18n_namespaceObject.__)('Leave empty if the image is purely decorative.'))
+ }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, {
onChangeImage: updateImage,
slug: mediaSizeSlug,
imageSizeOptions: imageSizeOptions,
isResizable: false
- }), mediaUrl && Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], {
- label: Object(external_wp_i18n_["__"])('Media width'),
+ }), mediaUrl && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Media width'),
value: temporaryMediaWidth || mediaWidth,
onChange: commitWidthChange,
min: WIDTH_CONSTRAINT_PERCENTAGE,
max: 100 - WIDTH_CONSTRAINT_PERCENTAGE
}));
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classNames,
style
});
- const innerBlocksProps = Object(external_wp_blockEditor_["useInnerBlocksProps"])({
+ const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
className: 'wp-block-media-text__content'
}, {
template: TEMPLATE
});
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, mediaTextGeneralSettings), 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.InspectorControls, null, mediaTextGeneralSettings), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "block"
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockVerticalAlignmentControl"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentControl, {
onChange: onVerticalAlignmentChange,
value: verticalAlignment
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
icon: pull_left,
- title: Object(external_wp_i18n_["__"])('Show media on left'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Show media on left'),
isActive: mediaPosition === 'left',
onClick: () => setAttributes({
mediaPosition: 'left'
})
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
icon: pull_right,
- title: Object(external_wp_i18n_["__"])('Show media on right'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Show media on right'),
isActive: mediaPosition === 'right',
onClick: () => setAttributes({
mediaPosition: 'right'
})
- }), mediaType === 'image' && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalImageURLInputUI"], {
+ }), mediaType === 'image' && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageURLInputUI, {
url: href || '',
onChangeUrl: onSetHref,
linkDestination: linkDestination,
@@ -19864,7 +19903,7 @@ function MediaTextEdit(_ref2) {
linkTarget: linkTarget,
linkClass: linkClass,
rel: rel
- })), Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(media_container, {
+ })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(media_container, {
className: "wp-block-media-text__media",
onSelectMedia: onSelectMedia,
onWidthChange: onWidthChange,
@@ -19880,12 +19919,12 @@ function MediaTextEdit(_ref2) {
mediaType,
mediaUrl,
mediaWidth
- }), Object(external_wp_element_["createElement"])("div", innerBlocksProps)));
+ }), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
}
/* harmony default export */ var media_text_edit = (MediaTextEdit);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/save.js
/**
@@ -19926,19 +19965,19 @@ function media_text_save_save(_ref) {
rel
} = attributes;
const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
- const newRel = Object(external_lodash_["isEmpty"])(rel) ? undefined : rel;
+ const newRel = (0,external_lodash_namespaceObject.isEmpty)(rel) ? undefined : rel;
const imageClasses = classnames_default()({
[`wp-image-${mediaId}`]: mediaId && mediaType === 'image',
[`size-${mediaSizeSlug}`]: mediaId && mediaType === 'image'
});
- let image = Object(external_wp_element_["createElement"])("img", {
+ let image = (0,external_wp_element_namespaceObject.createElement)("img", {
src: mediaUrl,
alt: mediaAlt,
className: imageClasses || null
});
if (href) {
- image = Object(external_wp_element_["createElement"])("a", {
+ image = (0,external_wp_element_namespaceObject.createElement)("a", {
className: linkClass,
href: href,
target: linkTarget,
@@ -19948,7 +19987,7 @@ function media_text_save_save(_ref) {
const mediaTypeRenders = {
image: () => image,
- video: () => Object(external_wp_element_["createElement"])("video", {
+ video: () => (0,external_wp_element_namespaceObject.createElement)("video", {
controls: true,
src: mediaUrl
})
@@ -19969,18 +20008,18 @@ function media_text_save_save(_ref) {
const style = {
gridTemplateColumns
};
- 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,
style
- }), Object(external_wp_element_["createElement"])("figure", {
+ }), (0,external_wp_element_namespaceObject.createElement)("figure", {
className: "wp-block-media-text__media",
style: backgroundStyles
- }, (mediaTypeRenders[mediaType] || external_lodash_["noop"])()), Object(external_wp_element_["createElement"])("div", external_wp_blockEditor_["useInnerBlocksProps"].save({
+ }, (mediaTypeRenders[mediaType] || external_lodash_namespaceObject.noop)()), (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({
className: 'wp-block-media-text__content'
})));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/transforms.js
/**
* WordPress dependencies
*/
@@ -19996,7 +20035,7 @@ const media_text_transforms_transforms = {
id,
anchor
} = _ref;
- return Object(external_wp_blocks_["createBlock"])('core/media-text', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', {
mediaAlt: alt,
mediaId: id,
mediaUrl: url,
@@ -20013,7 +20052,7 @@ const media_text_transforms_transforms = {
id,
anchor
} = _ref2;
- return Object(external_wp_blocks_["createBlock"])('core/media-text', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', {
mediaId: id,
mediaUrl: src,
mediaType: 'video',
@@ -20038,7 +20077,7 @@ const media_text_transforms_transforms = {
mediaUrl,
anchor
} = _ref4;
- return Object(external_wp_blocks_["createBlock"])('core/image', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', {
alt: mediaAlt,
id: mediaId,
url: mediaUrl,
@@ -20061,7 +20100,7 @@ const media_text_transforms_transforms = {
mediaUrl,
anchor
} = _ref6;
- return Object(external_wp_blocks_["createBlock"])('core/video', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
id: mediaId,
src: mediaUrl,
anchor
@@ -20071,7 +20110,7 @@ const media_text_transforms_transforms = {
};
/* harmony default export */ var media_text_transforms = (media_text_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/media-text/index.js
/**
* WordPress dependencies
*/
@@ -20200,12 +20239,12 @@ const media_text_settings = {
innerBlocks: [{
name: 'core/paragraph',
attributes: {
- content: Object(external_wp_i18n_["__"])('The wren<br>Earns his living<br>Noiselessly.')
+ content: (0,external_wp_i18n_namespaceObject.__)('The wren<br>Earns his living<br>Noiselessly.')
}
}, {
name: 'core/paragraph',
attributes: {
- content: Object(external_wp_i18n_["__"])('— Kobayashi Issa (一茶)')
+ content: (0,external_wp_i18n_namespaceObject.__)('— Kobayashi Issa (一茶)')
}
}]
},
@@ -20215,10 +20254,9 @@ const media_text_settings = {
deprecated: media_text_deprecated
};
-// EXTERNAL MODULE: external ["wp","dom"]
-var external_wp_dom_ = __webpack_require__("1CF3");
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/edit.js
+;// CONCATENATED MODULE: external ["wp","dom"]
+var external_wp_dom_namespaceObject = window["wp"]["dom"];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/edit.js
/**
@@ -20242,43 +20280,43 @@ function MissingBlockWarning(_ref) {
originalUndelimitedContent
} = attributes;
const hasContent = !!originalUndelimitedContent;
- const hasHTMLBlock = Object(external_wp_blocks_["getBlockType"])('core/html');
+ const hasHTMLBlock = (0,external_wp_blocks_namespaceObject.getBlockType)('core/html');
const actions = [];
let messageHTML;
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 leave this block intact, convert its content to a Custom HTML block, or remove it entirely.'), 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 leave this block intact, convert its content to a Custom HTML block, or remove it entirely.'), originalName);
+ actions.push((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
key: "convert",
onClick: convertToHTML,
variant: "primary"
- }, Object(external_wp_i18n_["__"])('Keep as HTML')));
+ }, (0,external_wp_i18n_namespaceObject.__)('Keep as HTML')));
} else {
- 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 leave this block intact or remove it entirely.'), originalName);
+ (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact or remove it entirely.'), originalName);
}
- return Object(external_wp_element_["createElement"])("div", Object(external_wp_blockEditor_["useBlockProps"])({
+ return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: 'has-warning'
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, {
actions: actions
- }, messageHTML), Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, Object(external_wp_dom_["safeHTML"])(originalUndelimitedContent)));
+ }, messageHTML), (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, (0,external_wp_dom_namespaceObject.safeHTML)(originalUndelimitedContent)));
}
-const MissingEdit = Object(external_wp_data_["withDispatch"])((dispatch, _ref2) => {
+const MissingEdit = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, _ref2) => {
let {
clientId,
attributes
} = _ref2;
const {
replaceBlock
- } = dispatch(external_wp_blockEditor_["store"]);
+ } = dispatch(external_wp_blockEditor_namespaceObject.store);
return {
convertToHTML() {
- replaceBlock(clientId, Object(external_wp_blocks_["createBlock"])('core/html', {
+ replaceBlock(clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/html', {
content: attributes.originalUndelimitedContent
}));
}
@@ -20287,7 +20325,7 @@ const MissingEdit = Object(external_wp_data_["withDispatch"])((dispatch, _ref2)
})(MissingBlockWarning);
/* harmony default export */ var missing_edit = (MissingEdit);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/save.js
/**
@@ -20299,10 +20337,10 @@ function missing_save_save(_ref) {
attributes
} = _ref;
// Preserve the missing block's content.
- return Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, attributes.originalContent);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.originalContent);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/missing/index.js
/**
* WordPress dependencies
*/
@@ -20356,7 +20394,7 @@ const missing_settings = {
const {
originalName
} = attributes;
- const originalBlockType = originalName ? Object(external_wp_blocks_["getBlockType"])(originalName) : undefined;
+ const originalBlockType = originalName ? (0,external_wp_blocks_namespaceObject.getBlockType)(originalName) : undefined;
if (originalBlockType) {
return originalBlockType.settings.title || originalName;
@@ -20370,22 +20408,22 @@ const missing_settings = {
save: missing_save_save
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/more.js
/**
* WordPress dependencies
*/
-const more = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const more = (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: "M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z"
}));
/* harmony default export */ var library_more = (more);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/edit.js
/**
@@ -20397,7 +20435,7 @@ const more = Object(external_wp_element_["createElement"])(external_wp_primitive
-const DEFAULT_TEXT = Object(external_wp_i18n_["__"])('Read more');
+const DEFAULT_TEXT = (0,external_wp_i18n_namespaceObject.__)('Read more');
function MoreEdit(_ref) {
let {
@@ -20420,12 +20458,12 @@ function MoreEdit(_ref) {
keyCode
} = _ref2;
- if (keyCode === external_wp_keycodes_["ENTER"]) {
- insertBlocksAfter([Object(external_wp_blocks_["createBlock"])(Object(external_wp_blocks_["getDefaultBlockName"])())]);
+ if (keyCode === external_wp_keycodes_namespaceObject.ENTER) {
+ insertBlocksAfter([(0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())]);
}
};
- const getHideExcerptHelp = checked => checked ? Object(external_wp_i18n_["__"])('The excerpt is hidden.') : Object(external_wp_i18n_["__"])('The excerpt is visible.');
+ const getHideExcerptHelp = checked => checked ? (0,external_wp_i18n_namespaceObject.__)('The excerpt is hidden.') : (0,external_wp_i18n_namespaceObject.__)('The excerpt is visible.');
const toggleHideExcerpt = () => setAttributes({
noTeaser: !noTeaser
@@ -20434,15 +20472,15 @@ function MoreEdit(_ref) {
const style = {
width: `${(customText ? customText : DEFAULT_TEXT).length + 1.2}em`
};
- 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"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Hide the excerpt on the full content page'),
+ 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, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Hide the excerpt on the full content page'),
checked: !!noTeaser,
onChange: toggleHideExcerpt,
help: getHideExcerptHelp
- }))), 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", {
className: "wp-block-more"
- }, Object(external_wp_element_["createElement"])("input", {
- "aria-label": Object(external_wp_i18n_["__"])('Read more link text'),
+ }, (0,external_wp_element_namespaceObject.createElement)("input", {
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Read more link text'),
type: "text",
value: customText,
placeholder: DEFAULT_TEXT,
@@ -20452,7 +20490,7 @@ function MoreEdit(_ref) {
}))));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/save.js
/**
@@ -20473,10 +20511,10 @@ function more_save_save(_ref) {
} = _ref;
const moreTag = customText ? `<!--more ${customText}-->` : '<!--more-->';
const noTeaserTag = noTeaser ? '<!--noteaser-->' : '';
- return Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, Object(external_lodash_["compact"])([moreTag, noTeaserTag]).join('\n'));
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, (0,external_lodash_namespaceObject.compact)([moreTag, noTeaserTag]).join('\n'));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/transforms.js
/**
* WordPress dependencies
*/
@@ -20507,14 +20545,14 @@ const more_transforms_transforms = {
attrs.noTeaser = true;
}
- return Object(external_wp_blocks_["createBlock"])('core/more', attrs);
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/more', attrs);
}
}]
};
/* harmony default export */ var more_transforms = (more_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/more/index.js
/**
* WordPress dependencies
*/
@@ -20574,25 +20612,37 @@ const more_settings = {
save: more_save_save
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/navigation.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/navigation.js
/**
* WordPress dependencies
*/
-const navigation = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const navigation = (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: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"
}));
/* harmony default export */ var library_navigation = (navigation);
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js
-var list_view = __webpack_require__("OzlF");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/list-view.js
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-list-view-modal.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-library/build-module/navigation/edit/use-list-view-modal.js
/**
@@ -20610,19 +20660,19 @@ function NavigationBlockListView(_ref) {
clientId,
__experimentalFeatures
} = _ref;
- const blocks = Object(external_wp_data_["useSelect"])(select => select(external_wp_blockEditor_["store"]).__unstableGetClientIdsTree(clientId), [clientId]);
- const listViewRef = Object(external_wp_element_["useRef"])();
- const [minHeight, setMinHeight] = Object(external_wp_element_["useState"])(300);
- Object(external_wp_element_["useEffect"])(() => {
+ const blocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).__unstableGetClientIdsTree(clientId), [clientId]);
+ const listViewRef = (0,external_wp_element_namespaceObject.useRef)();
+ const [minHeight, setMinHeight] = (0,external_wp_element_namespaceObject.useState)(300);
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
var _listViewRef$current$, _listViewRef$current;
setMinHeight((_listViewRef$current$ = listViewRef === null || listViewRef === void 0 ? void 0 : (_listViewRef$current = listViewRef.current) === null || _listViewRef$current === void 0 ? void 0 : _listViewRef$current.clientHeight) !== null && _listViewRef$current$ !== void 0 ? _listViewRef$current$ : 300);
}, []);
- return Object(external_wp_element_["createElement"])("div", {
+ return (0,external_wp_element_namespaceObject.createElement)("div", {
style: {
minHeight
}
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalListView"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalListView, {
ref: listViewRef,
blocks: blocks,
showBlockMovers: true,
@@ -20632,21 +20682,21 @@ function NavigationBlockListView(_ref) {
}
function useListViewModal(clientId, __experimentalFeatures) {
- const [isModalOpen, setIsModalOpen] = Object(external_wp_element_["useState"])(false);
- const listViewToolbarButton = Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
+ const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
+ const listViewToolbarButton = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
className: "components-toolbar__control",
- label: Object(external_wp_i18n_["__"])('Open list view'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Open list view'),
onClick: () => setIsModalOpen(true),
- icon: list_view["a" /* default */]
+ icon: list_view
});
- const listViewModal = isModalOpen && Object(external_wp_element_["createElement"])(external_wp_components_["Modal"], {
- title: Object(external_wp_i18n_["__"])('List View'),
- closeLabel: Object(external_wp_i18n_["__"])('Close'),
+ const listViewModal = isModalOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
+ title: (0,external_wp_i18n_namespaceObject.__)('List View'),
+ closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close'),
onRequestClose: () => {
setIsModalOpen(false);
},
shouldCloseOnClickOutside: false
- }, Object(external_wp_element_["createElement"])(NavigationBlockListView, {
+ }, (0,external_wp_element_namespaceObject.createElement)(NavigationBlockListView, {
clientId: clientId,
__experimentalFeatures: __experimentalFeatures
}));
@@ -20656,14 +20706,14 @@ function useListViewModal(clientId, __experimentalFeatures) {
};
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-menu.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-menu.js
/**
* WordPress dependencies
*/
function useNavigationMenu(ref) {
- return Object(external_wp_data_["useSelect"])(select => {
+ return (0,external_wp_data_namespaceObject.useSelect)(select => {
var _navigationMenu;
const {
@@ -20672,7 +20722,7 @@ function useNavigationMenu(ref) {
getEntityRecords,
hasFinishedResolution,
canUser
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
const navigationMenuSingleArgs = ['postType', 'wp_navigation', ref];
const rawNavigationMenu = ref ? getEntityRecord(...navigationMenuSingleArgs) : null;
let navigationMenu = ref ? getEditedEntityRecord(...navigationMenuSingleArgs) : null; // getEditedEntityRecord will return the post regardless of status.
@@ -20706,7 +20756,7 @@ function useNavigationMenu(ref) {
}, [ref]);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-entities.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-entities.js
/**
* WordPress dependencies
*/
@@ -20746,12 +20796,12 @@ function useMenuEntities() {
menus,
isResolvingMenus,
hasResolvedMenus
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getMenus,
isResolving,
hasFinishedResolution
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
const menusParameters = [{
per_page: -1
}];
@@ -20773,11 +20823,11 @@ function useMenuItemEntities(menuId) {
const {
menuItems,
hasResolvedMenuItems
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getMenuItems,
hasFinishedResolution
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
const hasSelectedMenu = menuId !== undefined;
const menuItemsParameters = hasSelectedMenu ? [{
menus: menuId,
@@ -20799,12 +20849,12 @@ function usePageEntities() {
pages,
isResolvingPages,
hasResolvedPages
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getEntityRecords,
isResolving,
hasFinishedResolution
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
const pagesParameters = ['postType', 'page', {
parent: 0,
order: 'asc',
@@ -20825,16 +20875,56 @@ function usePageEntities() {
};
}
-// 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/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 icon = (Icon);
+
+;// CONCATENATED MODULE: external ["wp","htmlEntities"]
+var external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js
-// EXTERNAL MODULE: external ["wp","htmlEntities"]
-var external_wp_htmlEntities_ = __webpack_require__("rmEH");
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js
-var library_search = __webpack_require__("cGtP");
+/**
+ * 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-library/build-module/navigation/edit/placeholder/placeholder-preview.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/placeholder/placeholder-preview.js
/**
@@ -20851,26 +20941,26 @@ const PlaceholderPreview = _ref => {
let {
isLoading
} = _ref;
- return Object(external_wp_element_["createElement"])("ul", {
+ return (0,external_wp_element_namespaceObject.createElement)("ul", {
className: classnames_default()('wp-block-navigation-placeholder__preview', 'wp-block-navigation__container', {
'is-loading': isLoading
})
- }, Object(external_wp_element_["createElement"])("li", {
+ }, (0,external_wp_element_namespaceObject.createElement)("li", {
className: "wp-block-navigation-item"
- }, "\u200B"), Object(external_wp_element_["createElement"])("li", {
+ }, "\u200B"), (0,external_wp_element_namespaceObject.createElement)("li", {
className: "wp-block-navigation-item"
- }, "\u200B"), Object(external_wp_element_["createElement"])("li", {
+ }, "\u200B"), (0,external_wp_element_namespaceObject.createElement)("li", {
className: "wp-block-navigation-item"
- }, "\u200B"), Object(external_wp_element_["createElement"])("li", {
+ }, "\u200B"), (0,external_wp_element_namespaceObject.createElement)("li", {
className: "wp-block-navigation-placeholder__preview-search-icon"
- }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
- icon: library_search["a" /* default */]
+ }, (0,external_wp_element_namespaceObject.createElement)(icon, {
+ icon: library_search
})));
};
/* harmony default export */ var placeholder_preview = (PlaceholderPreview);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/create-template-part-id.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/create-template-part-id.js
/**
* Generates a template part Id based on slug and theme inputs.
*
@@ -20882,7 +20972,7 @@ function createTemplatePartId(theme, slug) {
return theme && slug ? theme + '//' + slug : null;
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-template-part-area-label.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-template-part-area-label.js
/**
* WordPress dependencies
*/
@@ -20896,7 +20986,7 @@ function createTemplatePartId(theme, slug) {
function useTemplatePartAreaLabel(clientId) {
- return Object(external_wp_data_["useSelect"])(select => {
+ return (0,external_wp_data_namespaceObject.useSelect)(select => {
// Use the lack of a clientId as an opportunity to bypass the rest
// of this hook.
if (!clientId) {
@@ -20906,7 +20996,7 @@ function useTemplatePartAreaLabel(clientId) {
const {
getBlock,
getBlockParentsByBlockName
- } = select(external_wp_blockEditor_["store"]);
+ } = select(external_wp_blockEditor_namespaceObject.store);
const withAscendingResults = true;
const parentTemplatePartClientIds = getBlockParentsByBlockName(clientId, 'core/template-part', withAscendingResults);
@@ -20923,7 +21013,7 @@ function useTemplatePartAreaLabel(clientId) {
const {
getEditedEntityRecord
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
for (const templatePartClientId of parentTemplatePartClientIds) {
const templatePartBlock = getBlock(templatePartClientId); // The 'area' usually isn't stored on the block, but instead
@@ -20946,7 +21036,7 @@ function useTemplatePartAreaLabel(clientId) {
}, [clientId]);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-generate-default-navigation-title.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-generate-default-navigation-title.js
/**
* WordPress dependencies
*/
@@ -20971,13 +21061,13 @@ const PUBLISHED_MENU_PARAMS = ['postType', 'wp_navigation', {
function useGenerateDefaultNavigationTitle(clientId) {
// The block will be disabled in a block preview, use this as a way of
// avoiding the side-effects of this component for block previews.
- const isDisabled = Object(external_wp_element_["useContext"])(external_wp_components_["Disabled"].Context); // Because we can't conditionally call hooks, pass an undefined client id
+ const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context); // Because we can't conditionally call hooks, pass an undefined client id
// arg to bypass the expensive `useTemplateArea` code. The hook will return
// early.
const area = useTemplatePartAreaLabel(isDisabled ? undefined : clientId);
- const registry = Object(external_wp_data_["useRegistry"])();
- return Object(external_wp_element_["useCallback"])(async () => {
+ const registry = (0,external_wp_data_namespaceObject.useRegistry)();
+ return (0,external_wp_element_namespaceObject.useCallback)(async () => {
// Ensure other navigation menus have loaded so an
// accurate name can be created.
if (isDisabled) {
@@ -20986,11 +21076,11 @@ function useGenerateDefaultNavigationTitle(clientId) {
const {
getEntityRecords
- } = registry.resolveSelect(external_wp_coreData_["store"]);
+ } = registry.resolveSelect(external_wp_coreData_namespaceObject.store);
const [draftNavigationMenus, navigationMenus] = await Promise.all([getEntityRecords(...DRAFT_MENU_PARAMS), getEntityRecords(...PUBLISHED_MENU_PARAMS)]);
- const title = area ? Object(external_wp_i18n_["sprintf"])( // translators: %s: the name of a menu (e.g. Header navigation).
- Object(external_wp_i18n_["__"])('%s navigation'), area) : // translators: 'navigation' as in website navigation.
- Object(external_wp_i18n_["__"])('Navigation'); // Determine how many menus start with the automatic title.
+ const title = area ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
+ (0,external_wp_i18n_namespaceObject.__)('%s navigation'), area) : // translators: 'navigation' as in website navigation.
+ (0,external_wp_i18n_namespaceObject.__)('Navigation'); // Determine how many menus start with the automatic title.
const matchingMenuTitleCount = [...draftNavigationMenus, ...navigationMenus].reduce((count, menu) => {
var _menu$title, _menu$title$raw;
@@ -21004,7 +21094,7 @@ function useGenerateDefaultNavigationTitle(clientId) {
}, [isDisabled, area]);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-create-navigation-menu.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-create-navigation-menu.js
/**
* WordPress dependencies
*/
@@ -21020,11 +21110,11 @@ function useGenerateDefaultNavigationTitle(clientId) {
function useCreateNavigationMenu(clientId) {
const {
saveEntityRecord
- } = Object(external_wp_data_["useDispatch"])(external_wp_coreData_["store"]);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const generateDefaultTitle = useGenerateDefaultNavigationTitle(clientId); // This callback uses data from the two placeholder steps and only creates
// a new navigation menu when the user completes the final step.
- return Object(external_wp_element_["useCallback"])(async function () {
+ return (0,external_wp_element_namespaceObject.useCallback)(async function () {
let title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
let blocks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
@@ -21034,14 +21124,14 @@ function useCreateNavigationMenu(clientId) {
const record = {
title,
- content: Object(external_wp_blocks_["serialize"])(blocks),
+ content: (0,external_wp_blocks_namespaceObject.serialize)(blocks),
status: 'publish'
};
return await saveEntityRecord('postType', 'wp_navigation', record);
- }, [external_wp_blocks_["serialize"], saveEntityRecord]);
+ }, [external_wp_blocks_namespaceObject.serialize, saveEntityRecord]);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/menu-items-to-blocks.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/menu-items-to-blocks.js
/**
* External dependencies
*/
@@ -21067,7 +21157,7 @@ function menuItemsToBlocks(menuItems) {
const menuTree = createDataTree(menuItems);
const blocks = mapMenuItemsToBlocks(menuTree);
- return Object(external_wp_hooks_["applyFilters"])('blocks.navigation.__unstableMenuItemsToBlocks', blocks, menuItems);
+ return (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.navigation.__unstableMenuItemsToBlocks', blocks, menuItems);
}
/**
* A recursive function that maps menu item nodes to blocks.
@@ -21079,15 +21169,15 @@ function menuItemsToBlocks(menuItems) {
function mapMenuItemsToBlocks(menuItems) {
let mapping = {}; // The menuItem should be in menu_order sort order.
- const sortedItems = Object(external_lodash_["sortBy"])(menuItems, 'menu_order');
+ const sortedItems = (0,external_lodash_namespaceObject.sortBy)(menuItems, 'menu_order');
const innerBlocks = sortedItems.map(menuItem => {
var _menuItem$children, _menuItem$children2;
if (menuItem.type === 'block') {
- const [block] = Object(external_wp_blocks_["parse"])(menuItem.content.raw);
+ const [block] = (0,external_wp_blocks_namespaceObject.parse)(menuItem.content.raw);
if (!block) {
- return Object(external_wp_blocks_["createBlock"])('core/freeform', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/freeform', {
content: menuItem.content
});
}
@@ -21109,7 +21199,7 @@ function mapMenuItemsToBlocks(menuItems) {
};
const blockType = (_menuItem$children2 = menuItem.children) !== null && _menuItem$children2 !== void 0 && _menuItem$children2.length ? 'core/navigation-submenu' : 'core/navigation-link'; // Create block with nested "innerBlocks".
- const block = Object(external_wp_blocks_["createBlock"])(blockType, attributes, nestedBlocks); // Create mapping for menuItem -> block
+ const block = (0,external_wp_blocks_namespaceObject.createBlock)(blockType, attributes, nestedBlocks); // Create mapping for menuItem -> block
mapping[menuItem.id] = block.clientId;
return block;
@@ -21242,7 +21332,7 @@ function createDataTree(dataset) {
return dataTree;
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-convert-classic-menu.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/use-convert-classic-menu.js
/**
* WordPress dependencies
*/
@@ -21254,20 +21344,20 @@ function createDataTree(dataset) {
function useConvertClassicMenu(onFinish) {
- const [selectedMenu, setSelectedMenu] = Object(external_wp_element_["useState"])();
- const [isAwaitingMenuItemResolution, setIsAwaitingMenuItemResolution] = Object(external_wp_element_["useState"])(false);
- const [menuName, setMenuName] = Object(external_wp_element_["useState"])('');
+ const [selectedMenu, setSelectedMenu] = (0,external_wp_element_namespaceObject.useState)();
+ const [isAwaitingMenuItemResolution, setIsAwaitingMenuItemResolution] = (0,external_wp_element_namespaceObject.useState)(false);
+ const [menuName, setMenuName] = (0,external_wp_element_namespaceObject.useState)('');
const {
menuItems,
hasResolvedMenuItems
} = useNavigationEntities(selectedMenu);
- const createFromMenu = Object(external_wp_element_["useCallback"])(name => {
+ const createFromMenu = (0,external_wp_element_namespaceObject.useCallback)(name => {
const {
innerBlocks: blocks
} = menuItemsToBlocks(menuItems);
onFinish(blocks, name);
}, [menuItems, menuItemsToBlocks, onFinish]);
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
// If the user selected a menu but we had to wait for menu items to
// finish resolving, then create the block once resolution finishes.
if (isAwaitingMenuItemResolution && hasResolvedMenuItems) {
@@ -21275,7 +21365,7 @@ function useConvertClassicMenu(onFinish) {
setIsAwaitingMenuItemResolution(false);
}
}, [isAwaitingMenuItemResolution, hasResolvedMenuItems, menuName]);
- return Object(external_wp_element_["useCallback"])((id, name) => {
+ return (0,external_wp_element_namespaceObject.useCallback)((id, name) => {
setSelectedMenu(id); // If we have menu items, create the block right away.
if (hasResolvedMenuItems) {
@@ -21290,7 +21380,7 @@ function useConvertClassicMenu(onFinish) {
}, [hasResolvedMenuItems, createFromMenu]);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/placeholder/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/placeholder/index.js
/**
@@ -21325,8 +21415,8 @@ const ExistingMenusDropdown = _ref => {
iconPosition: 'right',
className: 'wp-block-navigation-placeholder__actions__dropdown'
};
- return Object(external_wp_element_["createElement"])(external_wp_components_["DropdownMenu"], {
- text: Object(external_wp_i18n_["__"])('Select menu'),
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
+ text: (0,external_wp_i18n_namespaceObject.__)('Select menu'),
icon: null,
toggleProps: toggleProps,
popoverProps: {
@@ -21336,26 +21426,26 @@ const ExistingMenusDropdown = _ref => {
let {
onClose
} = _ref2;
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], {
- label: Object(external_wp_i18n_["__"])('Menus')
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Menus')
}, canSwitchNavigationMenu && (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.map(menu => {
- return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
onClick: () => {
onFinish(menu);
},
onClose: onClose,
key: menu.id
- }, Object(external_wp_htmlEntities_["decodeEntities"])(menu.title.rendered));
- }))), showClassicMenus && Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], {
- label: Object(external_wp_i18n_["__"])('Classic Menus')
+ }, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menu.title.rendered));
+ }))), showClassicMenus && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Classic Menus')
}, menus === null || menus === void 0 ? void 0 : menus.map(menu => {
- return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
onClick: () => {
onCreateFromMenu(menu.id, menu.name);
},
onClose: onClose,
key: menu.id
- }, Object(external_wp_htmlEntities_["decodeEntities"])(menu.name));
+ }, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menu.name));
})));
});
};
@@ -21396,45 +21486,57 @@ function NavigationPlaceholder(_ref3) {
};
const onCreateAllPages = () => {
- const block = [Object(external_wp_blocks_["createBlock"])('core/page-list')];
+ const block = [(0,external_wp_blocks_namespaceObject.createBlock)('core/page-list')];
onFinishMenuCreation(block);
};
const {
navigationMenus
} = useNavigationMenu();
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, (!hasResolvedNavigationMenus || isStillLoading) && Object(external_wp_element_["createElement"])(placeholder_preview, {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (!hasResolvedNavigationMenus || isStillLoading) && (0,external_wp_element_namespaceObject.createElement)(placeholder_preview, {
isLoading: true
- }), hasResolvedNavigationMenus && !isStillLoading && Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], {
+ }), hasResolvedNavigationMenus && !isStillLoading && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
className: "wp-block-navigation-placeholder"
- }, Object(external_wp_element_["createElement"])(placeholder_preview, null), Object(external_wp_element_["createElement"])("div", {
+ }, (0,external_wp_element_namespaceObject.createElement)(placeholder_preview, null), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-navigation-placeholder__controls"
- }, Object(external_wp_element_["createElement"])("div", {
+ }, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-navigation-placeholder__actions"
- }, Object(external_wp_element_["createElement"])("div", {
+ }, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-navigation-placeholder__actions__indicator"
- }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
+ }, (0,external_wp_element_namespaceObject.createElement)(icon, {
icon: library_navigation
- }), ' ', Object(external_wp_i18n_["__"])('Navigation')), Object(external_wp_element_["createElement"])("hr", null), hasMenus || navigationMenus !== null && navigationMenus !== void 0 && navigationMenus.length ? Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(ExistingMenusDropdown, {
+ }), ' ', (0,external_wp_i18n_namespaceObject.__)('Navigation')), (0,external_wp_element_namespaceObject.createElement)("hr", null), hasMenus || navigationMenus !== null && navigationMenus !== void 0 && navigationMenus.length ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(ExistingMenusDropdown, {
canSwitchNavigationMenu: canSwitchNavigationMenu,
navigationMenus: navigationMenus,
onFinish: onFinish,
menus: menus,
onCreateFromMenu: convertClassicMenu,
showClassicMenus: canUserCreateNavigation
- }), Object(external_wp_element_["createElement"])("hr", null)) : undefined, canUserCreateNavigation && hasPages ? Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ }), (0,external_wp_element_namespaceObject.createElement)("hr", null)) : undefined, canUserCreateNavigation && hasPages ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "tertiary",
onClick: onCreateAllPages
- }, Object(external_wp_i18n_["__"])('Add all pages')), Object(external_wp_element_["createElement"])("hr", null)) : undefined, canUserCreateNavigation && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ }, (0,external_wp_i18n_namespaceObject.__)('Add all pages')), (0,external_wp_element_namespaceObject.createElement)("hr", null)) : undefined, canUserCreateNavigation && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "tertiary",
onClick: onCreateEmptyMenu
- }, Object(external_wp_i18n_["__"])('Start empty'))))));
+ }, (0,external_wp_i18n_namespaceObject.__)('Start empty'))))));
}
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
-var library_close = __webpack_require__("w95h");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/responsive-wrapper.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-library/build-module/navigation/edit/responsive-wrapper.js
/**
@@ -21478,15 +21580,15 @@ function ResponsiveWrapper(_ref) {
...(isOpen && {
role: 'dialog',
'aria-modal': true,
- 'aria-label': Object(external_wp_i18n_["__"])('Menu')
+ 'aria-label': (0,external_wp_i18n_namespaceObject.__)('Menu')
})
};
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, !isOpen && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !isOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
"aria-haspopup": "true",
- "aria-label": Object(external_wp_i18n_["__"])('Open menu'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Open menu'),
className: openButtonClasses,
onClick: () => onToggle(true)
- }, Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 24 24",
width: "24",
@@ -21494,36 +21596,36 @@ function ResponsiveWrapper(_ref) {
role: "img",
"aria-hidden": "true",
focusable: "false"
- }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Rect"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
x: "4",
y: "7.5",
width: "16",
height: "1.5"
- }), Object(external_wp_element_["createElement"])(external_wp_primitives_["Rect"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
x: "4",
y: "15",
width: "16",
height: "1.5"
- }))), Object(external_wp_element_["createElement"])("div", {
+ }))), (0,external_wp_element_namespaceObject.createElement)("div", {
className: responsiveContainerClasses,
style: styles,
id: modalId
- }, Object(external_wp_element_["createElement"])("div", {
+ }, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-navigation__responsive-close",
tabIndex: "-1"
- }, Object(external_wp_element_["createElement"])("div", dialogProps, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ }, (0,external_wp_element_namespaceObject.createElement)("div", dialogProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
className: "wp-block-navigation__responsive-container-close",
- "aria-label": Object(external_wp_i18n_["__"])('Close menu'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Close menu'),
onClick: () => onToggle(false)
- }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
- icon: library_close["a" /* default */]
- })), Object(external_wp_element_["createElement"])("div", {
+ }, (0,external_wp_element_namespaceObject.createElement)(icon, {
+ icon: library_close
+ })), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-navigation__responsive-container-content",
id: `${modalId}-content`
}, children)))));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/inner-blocks.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/inner-blocks.js
/**
@@ -21556,14 +21658,14 @@ function NavigationInnerBlocks(_ref) {
isImmediateParentOfSelectedBlock,
selectedBlockHasDescendants,
isSelected
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getClientIdsOfDescen;
const {
getClientIdsOfDescendants,
hasSelectedInnerBlock,
getSelectedBlockClientId
- } = select(external_wp_blockEditor_["store"]);
+ } = select(external_wp_blockEditor_namespaceObject.store);
const selectedBlockId = getSelectedBlockClientId();
return {
isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false),
@@ -21573,8 +21675,8 @@ function NavigationInnerBlocks(_ref) {
isSelected: selectedBlockId === clientId
};
}, [clientId]);
- const [blocks, onInput, onChange] = Object(external_wp_coreData_["useEntityBlockEditor"])('postType', 'wp_navigation');
- const shouldDirectInsert = Object(external_wp_element_["useMemo"])(() => blocks.every(_ref2 => {
+ const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_navigation');
+ const shouldDirectInsert = (0,external_wp_element_namespaceObject.useMemo)(() => blocks.every(_ref2 => {
let {
name
} = _ref2;
@@ -21585,8 +21687,8 @@ function NavigationInnerBlocks(_ref) {
const parentOrChildHasSelection = isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasDescendants;
const appender = isVisible && parentOrChildHasSelection ? undefined : false;
- const placeholder = Object(external_wp_element_["useMemo"])(() => Object(external_wp_element_["createElement"])(placeholder_preview, null), []);
- const innerBlocksProps = Object(external_wp_blockEditor_["useInnerBlocksProps"])({
+ const placeholder = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_element_namespaceObject.createElement)(placeholder_preview, null), []);
+ const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
className: 'wp-block-navigation__container'
}, {
value: blocks,
@@ -21604,14 +21706,14 @@ function NavigationInnerBlocks(_ref) {
__experimentalLayout: LAYOUT,
placeholder: !isVisible || hasCustomPlaceholder ? undefined : placeholder
});
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalBlockContentOverlay"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockContentOverlay, {
clientId: clientId,
tagName: 'div',
wrapperProps: innerBlocksProps
});
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-selector.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-selector.js
/**
@@ -21644,7 +21746,7 @@ function NavigationMenuSelector(_ref) {
const {
navigationMenus
} = useNavigationMenu();
- const ref = Object(external_wp_coreData_["useEntityId"])('postType', 'wp_navigation');
+ const ref = (0,external_wp_coreData_namespaceObject.useEntityId)('postType', 'wp_navigation');
const createNavigationMenu = useCreateNavigationMenu(clientId);
const onFinishMenuCreation = async function (blocks) {
@@ -21659,9 +21761,9 @@ function NavigationMenuSelector(_ref) {
};
const convertClassicMenuToBlocks = useConvertClassicMenu(onFinishMenuCreation);
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], {
- label: Object(external_wp_i18n_["__"])('Menus')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["MenuItemsChoice"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Menus')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItemsChoice, {
value: ref,
onSelect: selectedId => onSelect(navigationMenus.find(post => post.id === selectedId)),
choices: navigationMenus.map(_ref2 => {
@@ -21669,36 +21771,36 @@ function NavigationMenuSelector(_ref) {
id,
title
} = _ref2;
- const label = Object(external_wp_htmlEntities_["decodeEntities"])(title.rendered);
+ const label = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title.rendered);
return {
value: id,
label,
- 'aria-label': Object(external_wp_i18n_["sprintf"])(
+ 'aria-label': (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: The name of a menu. */
- Object(external_wp_i18n_["__"])("Switch to '%s'"), label)
+ (0,external_wp_i18n_namespaceObject.__)("Switch to '%s'"), label)
};
})
- })), canUserCreateNavigation && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, hasClassicMenus && Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], {
- label: Object(external_wp_i18n_["__"])('Classic Menus')
+ })), canUserCreateNavigation && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, hasClassicMenus && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Classic Menus')
}, classicMenus.map(menu => {
- return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
onClick: () => {
convertClassicMenuToBlocks(menu.id, menu.name);
},
key: menu.id
- }, Object(external_wp_htmlEntities_["decodeEntities"])(menu.name));
- })), Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], {
- label: Object(external_wp_i18n_["__"])('Tools')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
+ }, (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menu.name));
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Tools')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
onClick: onCreateNew
- }, Object(external_wp_i18n_["__"])('Create new menu')), Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
- href: Object(external_wp_url_["addQueryArgs"])('edit.php', {
+ }, (0,external_wp_i18n_namespaceObject.__)('Create new menu')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
+ href: (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
post_type: 'wp_navigation'
})
- }, Object(external_wp_i18n_["__"])('Manage menus')))));
+ }, (0,external_wp_i18n_namespaceObject.__)('Manage menus')))));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-name-control.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-name-control.js
/**
@@ -21708,15 +21810,15 @@ function NavigationMenuSelector(_ref) {
function NavigationMenuNameControl() {
- const [title, updateTitle] = Object(external_wp_coreData_["useEntityProp"])('postType', 'wp_navigation', 'title');
- return Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
- label: Object(external_wp_i18n_["__"])('Menu name'),
+ const [title, updateTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title');
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Menu name'),
value: title,
onChange: updateTitle
});
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/unsaved-inner-blocks.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/unsaved-inner-blocks.js
/**
@@ -21754,16 +21856,16 @@ function UnsavedInnerBlocks(_ref) {
} = _ref;
// The block will be disabled in a block preview, use this as a way of
// avoiding the side-effects of this component for block previews.
- const isDisabled = Object(external_wp_element_["useContext"])(external_wp_components_["Disabled"].Context);
- const savingLock = Object(external_wp_element_["useRef"])(false);
- const innerBlocksProps = Object(external_wp_blockEditor_["useInnerBlocksProps"])(blockProps, {
+ const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context);
+ const savingLock = (0,external_wp_element_namespaceObject.useRef)(false);
+ const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
renderAppender: hasSelection ? undefined : false
});
const {
isSaving,
draftNavigationMenus,
hasResolvedDraftNavigationMenus
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
if (isDisabled) {
return EMPTY_OBJECT;
}
@@ -21772,7 +21874,7 @@ function UnsavedInnerBlocks(_ref) {
getEntityRecords,
hasFinishedResolution,
isSavingEntityRecord
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
return {
isSaving: isSavingEntityRecord('postType', 'wp_navigation'),
draftNavigationMenus: getEntityRecords(...unsaved_inner_blocks_DRAFT_MENU_PARAMS),
@@ -21785,7 +21887,7 @@ function UnsavedInnerBlocks(_ref) {
} = useNavigationMenu();
const createNavigationMenu = useCreateNavigationMenu(clientId); // Automatically save the uncontrolled blocks.
- Object(external_wp_element_["useEffect"])(async () => {
+ (0,external_wp_element_namespaceObject.useEffect)(async () => {
// The block will be disabled when used in a BlockPreview.
// In this case avoid automatic creation of a wp_navigation post.
// Otherwise the user will be spammed with lots of menus!
@@ -21807,16 +21909,16 @@ function UnsavedInnerBlocks(_ref) {
onSave(menu);
savingLock.current = false;
}, [isDisabled, isSaving, hasResolvedDraftNavigationMenus, hasResolvedNavigationMenus, draftNavigationMenus, navigationMenus, hasSelection, createNavigationMenu, blocks]);
- return Object(external_wp_element_["createElement"])("div", {
+ return (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-navigation__unsaved-changes"
- }, Object(external_wp_element_["createElement"])(external_wp_components_["Disabled"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, {
className: classnames_default()('wp-block-navigation__unsaved-changes-overlay', {
'is-saving': hasSelection
})
- }, Object(external_wp_element_["createElement"])("div", innerBlocksProps)), hasSelection && Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null));
+ }, (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)), hasSelection && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-delete-control.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-delete-control.js
/**
@@ -21831,33 +21933,33 @@ function NavigationMenuDeleteControl(_ref) {
let {
onDelete
} = _ref;
- const [isConfirmModalVisible, setIsConfirmModalVisible] = Object(external_wp_element_["useState"])(false);
- const id = Object(external_wp_coreData_["useEntityId"])('postType', 'wp_navigation');
- const [title] = Object(external_wp_coreData_["useEntityProp"])('postType', 'wp_navigation', 'title');
+ const [isConfirmModalVisible, setIsConfirmModalVisible] = (0,external_wp_element_namespaceObject.useState)(false);
+ const id = (0,external_wp_coreData_namespaceObject.useEntityId)('postType', 'wp_navigation');
+ const [title] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title');
const {
deleteEntityRecord
- } = Object(external_wp_data_["useDispatch"])(external_wp_coreData_["store"]);
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
+ 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: "wp-block-navigation-delete-menu-button",
variant: "secondary",
isDestructive: true,
onClick: () => {
setIsConfirmModalVisible(true);
}
- }, Object(external_wp_i18n_["__"])('Delete menu')), isConfirmModalVisible && Object(external_wp_element_["createElement"])(external_wp_components_["Modal"], {
- title: Object(external_wp_i18n_["sprintf"])(
+ }, (0,external_wp_i18n_namespaceObject.__)('Delete menu')), isConfirmModalVisible && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
+ title: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: the name of a menu to delete */
- Object(external_wp_i18n_["__"])('Delete %s'), title),
- closeLabel: Object(external_wp_i18n_["__"])('Cancel'),
+ (0,external_wp_i18n_namespaceObject.__)('Delete %s'), title),
+ closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
onRequestClose: () => setIsConfirmModalVisible(false)
- }, Object(external_wp_element_["createElement"])("p", null, Object(external_wp_i18n_["__"])('Are you sure you want to delete this navigation menu?')), Object(external_wp_element_["createElement"])(external_wp_components_["Flex"], {
+ }, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete this navigation menu?')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
justify: "flex-end"
- }, Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ }, (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",
onClick: () => {
setIsConfirmModalVisible(false);
}
- }, Object(external_wp_i18n_["__"])('Cancel'))), Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ }, (0,external_wp_i18n_namespaceObject.__)('Cancel'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "primary",
onClick: () => {
deleteEntityRecord('postType', 'wp_navigation', id, {
@@ -21865,10 +21967,10 @@ function NavigationMenuDeleteControl(_ref) {
});
onDelete();
}
- }, Object(external_wp_i18n_["__"])('Confirm'))))));
+ }, (0,external_wp_i18n_namespaceObject.__)('Confirm'))))));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-navigation-notice.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-navigation-notice.js
/**
* WordPress dependencies
*/
@@ -21881,11 +21983,11 @@ function useNavigationNotice() {
name,
message
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- const noticeRef = Object(external_wp_element_["useRef"])();
+ const noticeRef = (0,external_wp_element_namespaceObject.useRef)();
const {
createWarningNotice,
removeNotice
- } = Object(external_wp_data_["useDispatch"])(external_wp_notices_["store"]);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const showNotice = () => {
if (noticeRef.current) {
@@ -21913,7 +22015,7 @@ function useNavigationNotice() {
/* harmony default export */ var use_navigation_notice = (useNavigationNotice);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/edit/index.js
/**
@@ -22006,15 +22108,15 @@ function Navigation(_ref) {
} = {}
} = attributes;
let areaMenu,
- setAreaMenu = external_lodash_["noop"]; // Navigation areas are deprecated and on their way out. Let's not perform
+ setAreaMenu = external_lodash_namespaceObject.noop; // Navigation areas are deprecated and on their way out. Let's not perform
// the request unless we're in an environment where the endpoint exists.
if (false) {}
const navigationAreaMenu = areaMenu === 0 ? undefined : areaMenu;
const ref = navigationArea ? navigationAreaMenu : attributes.ref;
- const registry = Object(external_wp_data_["useRegistry"])();
- const setRef = Object(external_wp_element_["useCallback"])(postId => {
+ const registry = (0,external_wp_data_namespaceObject.useRegistry)();
+ const setRef = (0,external_wp_element_namespaceObject.useCallback)(postId => {
setAttributes({
ref: postId
});
@@ -22023,7 +22125,7 @@ function Navigation(_ref) {
setAreaMenu(postId);
}
}, [navigationArea]);
- const [hasAlreadyRendered, RecursionProvider] = Object(external_wp_blockEditor_["__experimentalUseNoRecursiveRenders"])(`navigationMenu/${ref}`); // Preload classic menus, so that they don't suddenly pop-in when viewing
+ const [hasAlreadyRendered, RecursionProvider] = (0,external_wp_blockEditor_namespaceObject.__experimentalUseNoRecursiveRenders)(`navigationMenu/${ref}`); // Preload classic menus, so that they don't suddenly pop-in when viewing
// the Select Menu dropdown.
useNavigationEntities();
@@ -22031,12 +22133,12 @@ function Navigation(_ref) {
hasUncontrolledInnerBlocks,
uncontrolledInnerBlocks,
isInnerBlockSelected
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getBlock,
getBlocks,
hasSelectedInnerBlock
- } = select(external_wp_blockEditor_["store"]); // This relies on the fact that `getBlock` won't return controlled
+ } = select(external_wp_blockEditor_namespaceObject.store); // This relies on the fact that `getBlock` won't return controlled
// inner blocks, while `getBlocks` does. It might be more stable to
// introduce a selector like `getUncontrolledInnerBlocks`, just in
// case `getBlock` is fixed.
@@ -22059,11 +22161,11 @@ function Navigation(_ref) {
replaceInnerBlocks,
selectBlock,
__unstableMarkNextChangeAsNotPersistent
- } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]);
- const [hasSavedUnsavedInnerBlocks, setHasSavedUnsavedInnerBlocks] = Object(external_wp_element_["useState"])(false);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
+ const [hasSavedUnsavedInnerBlocks, setHasSavedUnsavedInnerBlocks] = (0,external_wp_element_namespaceObject.useState)(false);
const isWithinUnassignedArea = !!navigationArea && !ref;
- const [isPlaceholderShown, setIsPlaceholderShown] = Object(external_wp_element_["useState"])(!hasUncontrolledInnerBlocks || isWithinUnassignedArea);
- const [isResponsiveMenuOpen, setResponsiveMenuVisibility] = Object(external_wp_element_["useState"])(false);
+ const [isPlaceholderShown, setIsPlaceholderShown] = (0,external_wp_element_namespaceObject.useState)(!hasUncontrolledInnerBlocks || isWithinUnassignedArea);
+ const [isResponsiveMenuOpen, setResponsiveMenuVisibility] = (0,external_wp_element_namespaceObject.useState)(false);
const {
isNavigationMenuResolved,
isNavigationMenuMissing,
@@ -22078,14 +22180,14 @@ function Navigation(_ref) {
canUserCreateNavigation,
hasResolvedCanUserCreateNavigation
} = useNavigationMenu(ref);
- const navRef = Object(external_wp_element_["useRef"])();
+ const navRef = (0,external_wp_element_namespaceObject.useRef)();
const isDraftNavigationMenu = (navigationMenu === null || navigationMenu === void 0 ? void 0 : navigationMenu.status) === 'draft';
const {
listViewToolbarButton,
listViewModal
} = useListViewModal(clientId);
const isEntityAvailable = !isNavigationMenuMissing && isNavigationMenuResolved;
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
ref: navRef,
className: classnames_default()(className, {
'items-justified-right': justifyContent === 'right',
@@ -22096,9 +22198,9 @@ function Navigation(_ref) {
'no-wrap': flexWrap === 'nowrap',
'is-responsive': 'never' !== overlayMenu,
'has-text-color': !!textColor.color || !!(textColor !== null && textColor !== void 0 && textColor.class),
- [Object(external_wp_blockEditor_["getColorClassName"])('color', textColor === null || textColor === void 0 ? void 0 : textColor.slug)]: !!(textColor !== null && textColor !== void 0 && textColor.slug),
+ [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor === null || textColor === void 0 ? void 0 : textColor.slug)]: !!(textColor !== null && textColor !== void 0 && textColor.slug),
'has-background': !!backgroundColor.color || backgroundColor.class,
- [Object(external_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor === null || backgroundColor === void 0 ? void 0 : backgroundColor.slug)]: !!(backgroundColor !== null && backgroundColor !== void 0 && backgroundColor.slug)
+ [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor === null || backgroundColor === void 0 ? void 0 : backgroundColor.slug)]: !!(backgroundColor !== null && backgroundColor !== void 0 && backgroundColor.slug)
}),
style: {
color: !(textColor !== null && textColor !== void 0 && textColor.slug) && (textColor === null || textColor === void 0 ? void 0 : textColor.color),
@@ -22107,23 +22209,23 @@ function Navigation(_ref) {
});
const overlayClassnames = classnames_default()({
'has-text-color': !!overlayTextColor.color || !!(overlayTextColor !== null && overlayTextColor !== void 0 && overlayTextColor.class),
- [Object(external_wp_blockEditor_["getColorClassName"])('color', overlayTextColor === null || overlayTextColor === void 0 ? void 0 : overlayTextColor.slug)]: !!(overlayTextColor !== null && overlayTextColor !== void 0 && overlayTextColor.slug),
+ [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', overlayTextColor === null || overlayTextColor === void 0 ? void 0 : overlayTextColor.slug)]: !!(overlayTextColor !== null && overlayTextColor !== void 0 && overlayTextColor.slug),
'has-background': !!overlayBackgroundColor.color || (overlayBackgroundColor === null || overlayBackgroundColor === void 0 ? void 0 : overlayBackgroundColor.class),
- [Object(external_wp_blockEditor_["getColorClassName"])('background-color', overlayBackgroundColor === null || overlayBackgroundColor === void 0 ? void 0 : overlayBackgroundColor.slug)]: !!(overlayBackgroundColor !== null && overlayBackgroundColor !== void 0 && overlayBackgroundColor.slug)
+ [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayBackgroundColor === null || overlayBackgroundColor === void 0 ? void 0 : overlayBackgroundColor.slug)]: !!(overlayBackgroundColor !== null && overlayBackgroundColor !== void 0 && overlayBackgroundColor.slug)
});
const overlayStyles = {
color: !(overlayTextColor !== null && overlayTextColor !== void 0 && overlayTextColor.slug) && (overlayTextColor === null || overlayTextColor === void 0 ? void 0 : overlayTextColor.color),
backgroundColor: !(overlayBackgroundColor !== null && overlayBackgroundColor !== void 0 && overlayBackgroundColor.slug) && (overlayBackgroundColor === null || overlayBackgroundColor === void 0 ? void 0 : overlayBackgroundColor.color) && overlayBackgroundColor.color
}; // Turn on contrast checker for web only since it's not supported on mobile yet.
- const enableContrastChecking = external_wp_element_["Platform"].OS === 'web';
- const [detectedBackgroundColor, setDetectedBackgroundColor] = Object(external_wp_element_["useState"])();
- const [detectedColor, setDetectedColor] = Object(external_wp_element_["useState"])();
- const [detectedOverlayBackgroundColor, setDetectedOverlayBackgroundColor] = Object(external_wp_element_["useState"])();
- const [detectedOverlayColor, setDetectedOverlayColor] = Object(external_wp_element_["useState"])(); // Spacer block needs orientation from context. This is a patch until
+ const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web';
+ const [detectedBackgroundColor, setDetectedBackgroundColor] = (0,external_wp_element_namespaceObject.useState)();
+ const [detectedColor, setDetectedColor] = (0,external_wp_element_namespaceObject.useState)();
+ const [detectedOverlayBackgroundColor, setDetectedOverlayBackgroundColor] = (0,external_wp_element_namespaceObject.useState)();
+ const [detectedOverlayColor, setDetectedOverlayColor] = (0,external_wp_element_namespaceObject.useState)(); // Spacer block needs orientation from context. This is a patch until
// https://github.com/WordPress/gutenberg/issues/36197 is addressed.
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (orientation) {
__unstableMarkNextChangeAsNotPersistent();
@@ -22132,7 +22234,7 @@ function Navigation(_ref) {
});
}
}, [orientation]);
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
var _navRef$current;
if (!enableContrastChecking) {
@@ -22147,18 +22249,18 @@ function Navigation(_ref) {
}
}); // Hide the placeholder if an navigation menu entity has loaded.
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
setIsPlaceholderShown(!isEntityAvailable);
}, [isEntityAvailable]);
const [showCantEditNotice, hideCantEditNotice] = use_navigation_notice({
name: 'block-library/core/navigation/permissions/update',
- message: Object(external_wp_i18n_["__"])('You do not have permission to edit this Menu. Any changes made will not be saved.')
+ message: (0,external_wp_i18n_namespaceObject.__)('You do not have permission to edit this Menu. Any changes made will not be saved.')
});
const [showCantCreateNotice, hideCantCreateNotice] = use_navigation_notice({
name: 'block-library/core/navigation/permissions/create',
- message: Object(external_wp_i18n_["__"])('You do not have permission to create Navigation Menus.')
+ message: (0,external_wp_i18n_namespaceObject.__)('You do not have permission to create Navigation Menus.')
});
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isSelected && !isInnerBlockSelected) {
hideCantEditNotice();
hideCantCreateNotice();
@@ -22174,7 +22276,7 @@ function Navigation(_ref) {
}
}
}, [isSelected, isInnerBlockSelected, canUserUpdateNavigationEntity, hasResolvedCanUserUpdateNavigationEntity, canUserCreateNavigation, hasResolvedCanUserCreateNavigation, ref]);
- const startWithEmptyMenu = Object(external_wp_element_["useCallback"])(() => {
+ const startWithEmptyMenu = (0,external_wp_element_namespaceObject.useCallback)(() => {
registry.batch(() => {
if (navigationArea) {
setAreaMenu(0);
@@ -22199,7 +22301,7 @@ function Navigation(_ref) {
const hasUnsavedBlocks = hasUncontrolledInnerBlocks && !isEntityAvailable;
if (hasUnsavedBlocks) {
- return Object(external_wp_element_["createElement"])("nav", blockProps, Object(external_wp_element_["createElement"])(ResponsiveWrapper, {
+ return (0,external_wp_element_namespaceObject.createElement)("nav", blockProps, (0,external_wp_element_namespaceObject.createElement)(ResponsiveWrapper, {
id: clientId,
onToggle: setResponsiveMenuVisibility,
isOpen: isResponsiveMenuOpen,
@@ -22207,7 +22309,7 @@ function Navigation(_ref) {
isHiddenByDefault: 'always' === overlayMenu,
classNames: overlayClassnames,
styles: overlayStyles
- }, Object(external_wp_element_["createElement"])(UnsavedInnerBlocks, {
+ }, (0,external_wp_element_namespaceObject.createElement)(UnsavedInnerBlocks, {
blockProps: blockProps,
blocks: uncontrolledInnerBlocks,
clientId: clientId,
@@ -22226,30 +22328,30 @@ function Navigation(_ref) {
if (ref && isNavigationMenuMissing) {
- return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], null, Object(external_wp_i18n_["__"])('Navigation menu has been deleted or is unavailable. '), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Navigation menu has been deleted or is unavailable. '), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
onClick: startWithEmptyMenu,
variant: "link"
- }, Object(external_wp_i18n_["__"])('Create a new menu?'))));
+ }, (0,external_wp_i18n_namespaceObject.__)('Create a new menu?'))));
}
if (isEntityAvailable && hasAlreadyRendered) {
- return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], null, Object(external_wp_i18n_["__"])('Block cannot be rendered inside itself.')));
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
}
const PlaceholderComponent = CustomPlaceholder ? CustomPlaceholder : NavigationPlaceholder;
- return Object(external_wp_element_["createElement"])(external_wp_coreData_["EntityProvider"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_coreData_namespaceObject.EntityProvider, {
kind: "postType",
type: "wp_navigation",
id: ref
- }, Object(external_wp_element_["createElement"])(RecursionProvider, null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], null, !isDraftNavigationMenu && isEntityAvailable && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarDropdownMenu"], {
- label: Object(external_wp_i18n_["__"])('Select Menu'),
- text: Object(external_wp_i18n_["__"])('Select Menu'),
+ }, (0,external_wp_element_namespaceObject.createElement)(RecursionProvider, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, !isDraftNavigationMenu && isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Select Menu'),
+ text: (0,external_wp_i18n_namespaceObject.__)('Select Menu'),
icon: null
}, _ref2 => {
let {
onClose
} = _ref2;
- return Object(external_wp_element_["createElement"])(NavigationMenuSelector, {
+ return (0,external_wp_element_namespaceObject.createElement)(NavigationMenuSelector, {
clientId: clientId,
onSelect: _ref3 => {
let {
@@ -22261,75 +22363,75 @@ function Navigation(_ref) {
onCreateNew: startWithEmptyMenu,
canUserCreateNavigation: canUserCreateNavigation
});
- })), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, listViewToolbarButton)), listViewModal, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, hasSubmenuIndicatorSetting && Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Display')
- }, Object(external_wp_element_["createElement"])("h3", null, Object(external_wp_i18n_["__"])('Overlay Menu')), Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToggleGroupControl"], {
- label: Object(external_wp_i18n_["__"])('Configure overlay menu'),
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, listViewToolbarButton)), listViewModal, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, hasSubmenuIndicatorSetting && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
+ title: (0,external_wp_i18n_namespaceObject.__)('Display')
+ }, (0,external_wp_element_namespaceObject.createElement)("h3", null, (0,external_wp_i18n_namespaceObject.__)('Overlay Menu')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Configure overlay menu'),
value: overlayMenu,
- help: Object(external_wp_i18n_["__"])('Collapses the navigation options in a menu icon opening an overlay.'),
+ help: (0,external_wp_i18n_namespaceObject.__)('Collapses the navigation options in a menu icon opening an overlay.'),
onChange: value => setAttributes({
overlayMenu: value
}),
isBlock: true,
hideLabelFromVision: true
- }, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToggleGroupControlOption"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "never",
- label: Object(external_wp_i18n_["__"])('Off')
- }), Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToggleGroupControlOption"], {
+ label: (0,external_wp_i18n_namespaceObject.__)('Off')
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "mobile",
- label: Object(external_wp_i18n_["__"])('Mobile')
- }), Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToggleGroupControlOption"], {
+ label: (0,external_wp_i18n_namespaceObject.__)('Mobile')
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "always",
- label: Object(external_wp_i18n_["__"])('Always')
- })), Object(external_wp_element_["createElement"])("h3", null, Object(external_wp_i18n_["__"])('Submenus')), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
+ label: (0,external_wp_i18n_namespaceObject.__)('Always')
+ })), (0,external_wp_element_namespaceObject.createElement)("h3", null, (0,external_wp_i18n_namespaceObject.__)('Submenus')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
checked: openSubmenusOnClick,
onChange: value => {
setAttributes({
openSubmenusOnClick: value
});
},
- label: Object(external_wp_i18n_["__"])('Open on click')
- }), !attributes.openSubmenusOnClick && Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
+ label: (0,external_wp_i18n_namespaceObject.__)('Open on click')
+ }), !attributes.openSubmenusOnClick && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
checked: showSubmenuIcon,
onChange: value => {
setAttributes({
showSubmenuIcon: value
});
},
- label: Object(external_wp_i18n_["__"])('Show icons')
- })), hasColorSettings && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["PanelColorSettings"], {
+ label: (0,external_wp_i18n_namespaceObject.__)('Show icons')
+ })), hasColorSettings && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PanelColorSettings, {
__experimentalHasMultipleOrigins: true,
__experimentalIsRenderedInSidebar: true,
- title: Object(external_wp_i18n_["__"])('Color'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Color'),
initialOpen: false,
colorSettings: [{
value: textColor.color,
onChange: setTextColor,
- label: Object(external_wp_i18n_["__"])('Text')
+ label: (0,external_wp_i18n_namespaceObject.__)('Text')
}, {
value: backgroundColor.color,
onChange: setBackgroundColor,
- label: Object(external_wp_i18n_["__"])('Background')
+ label: (0,external_wp_i18n_namespaceObject.__)('Background')
}, {
value: overlayTextColor.color,
onChange: setOverlayTextColor,
- label: Object(external_wp_i18n_["__"])('Submenu & overlay text')
+ label: (0,external_wp_i18n_namespaceObject.__)('Submenu & overlay text')
}, {
value: overlayBackgroundColor.color,
onChange: setOverlayBackgroundColor,
- label: Object(external_wp_i18n_["__"])('Submenu & overlay background')
+ label: (0,external_wp_i18n_namespaceObject.__)('Submenu & overlay background')
}]
- }, enableContrastChecking && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["ContrastChecker"], {
+ }, enableContrastChecking && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, {
backgroundColor: detectedBackgroundColor,
textColor: detectedColor
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["ContrastChecker"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, {
backgroundColor: detectedOverlayBackgroundColor,
textColor: detectedOverlayColor
- })))), isEntityAvailable && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], {
+ })))), isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
__experimentalGroup: "advanced"
- }, hasResolvedCanUserUpdateNavigationEntity && canUserUpdateNavigationEntity && Object(external_wp_element_["createElement"])(NavigationMenuNameControl, null), hasResolvedCanUserDeleteNavigationEntity && canUserDeleteNavigationEntity && Object(external_wp_element_["createElement"])(NavigationMenuDeleteControl, {
+ }, hasResolvedCanUserUpdateNavigationEntity && canUserUpdateNavigationEntity && (0,external_wp_element_namespaceObject.createElement)(NavigationMenuNameControl, null), hasResolvedCanUserDeleteNavigationEntity && canUserDeleteNavigationEntity && (0,external_wp_element_namespaceObject.createElement)(NavigationMenuDeleteControl, {
onDelete: startWithEmptyMenu
- })), Object(external_wp_element_["createElement"])("nav", blockProps, isPlaceholderShown && Object(external_wp_element_["createElement"])(PlaceholderComponent, {
+ })), (0,external_wp_element_namespaceObject.createElement)("nav", blockProps, isPlaceholderShown && (0,external_wp_element_namespaceObject.createElement)(PlaceholderComponent, {
onFinish: post => {
setIsPlaceholderShown(false);
@@ -22343,9 +22445,9 @@ function Navigation(_ref) {
hasResolvedNavigationMenus: hasResolvedNavigationMenus,
clientId: clientId,
canUserCreateNavigation: canUserCreateNavigation
- }), !hasResolvedCanUserCreateNavigation || !isEntityAvailable && !isPlaceholderShown && Object(external_wp_element_["createElement"])(placeholder_preview, {
+ }), !hasResolvedCanUserCreateNavigation || !isEntityAvailable && !isPlaceholderShown && (0,external_wp_element_namespaceObject.createElement)(placeholder_preview, {
isLoading: true
- }), !isPlaceholderShown && Object(external_wp_element_["createElement"])(ResponsiveWrapper, {
+ }), !isPlaceholderShown && (0,external_wp_element_namespaceObject.createElement)(ResponsiveWrapper, {
id: clientId,
onToggle: setResponsiveMenuVisibility,
isOpen: isResponsiveMenuOpen,
@@ -22353,7 +22455,7 @@ function Navigation(_ref) {
isHiddenByDefault: 'always' === overlayMenu,
classNames: overlayClassnames,
styles: overlayStyles
- }, isEntityAvailable && Object(external_wp_element_["createElement"])(NavigationInnerBlocks, {
+ }, isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(NavigationInnerBlocks, {
isVisible: !isPlaceholderShown,
clientId: clientId,
appender: CustomAppender,
@@ -22362,7 +22464,7 @@ function Navigation(_ref) {
})))));
}
-/* harmony default export */ var navigation_edit = (Object(external_wp_blockEditor_["withColors"])({
+/* harmony default export */ var navigation_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)({
textColor: 'color'
}, {
backgroundColor: 'color'
@@ -22372,7 +22474,7 @@ function Navigation(_ref) {
overlayTextColor: 'color'
})(Navigation));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/save.js
/**
@@ -22391,10 +22493,10 @@ function navigation_save_save(_ref) {
return;
}
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/deprecated.js
/**
@@ -22542,7 +22644,7 @@ const navigation_deprecated_v6 = {
},
save() {
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
},
isEligible: _ref2 => {
@@ -22638,7 +22740,7 @@ const navigation_deprecated_v5 = {
},
save() {
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
},
isEligible: _ref3 => {
@@ -22648,7 +22750,7 @@ const navigation_deprecated_v5 = {
} = _ref3;
return !!itemsJustification || !!orientation;
},
- migrate: Object(external_wp_compose_["compose"])(migrateIdToRef, deprecated_migrateWithLayout)
+ migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout)
};
const navigation_deprecated_v4 = {
attributes: {
@@ -22729,10 +22831,10 @@ const navigation_deprecated_v4 = {
},
save() {
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
},
- migrate: Object(external_wp_compose_["compose"])(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family),
+ migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family),
isEligible(_ref4) {
var _style$typography;
@@ -22755,7 +22857,7 @@ const migrateIsResponsive = function (attributes) {
const migrateTypographyPresets = function (attributes) {
return { ...attributes,
style: { ...attributes.style,
- typography: Object(external_lodash_["mapValues"])(attributes.style.typography, (value, key) => {
+ typography: (0,external_lodash_namespaceObject.mapValues)(attributes.style.typography, (value, key) => {
const prefix = TYPOGRAPHY_PRESET_DEPRECATION_MAP[key];
if (prefix && value.startsWith(prefix)) {
@@ -22850,10 +22952,10 @@ const navigation_deprecated_deprecated = [navigation_deprecated_v6, navigation_d
return attributes.isResponsive;
},
- migrate: Object(external_wp_compose_["compose"])(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateIsResponsive),
+ migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateIsResponsive),
save() {
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
}
}, {
@@ -22902,7 +23004,7 @@ const navigation_deprecated_deprecated = [navigation_deprecated_v6, navigation_d
},
save() {
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
},
isEligible(attributes) {
@@ -22921,7 +23023,7 @@ const navigation_deprecated_deprecated = [navigation_deprecated_v6, navigation_d
return false;
},
- migrate: Object(external_wp_compose_["compose"])(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateTypographyPresets)
+ migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateTypographyPresets)
}, {
attributes: {
className: {
@@ -22963,21 +23065,21 @@ const navigation_deprecated_deprecated = [navigation_deprecated_v6, navigation_d
html: false,
inserter: true
},
- migrate: Object(external_wp_compose_["compose"])(migrateIdToRef, attributes => {
- return { ...Object(external_lodash_["omit"])(attributes, ['rgbTextColor', 'rgbBackgroundColor']),
+ migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, attributes => {
+ return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['rgbTextColor', 'rgbBackgroundColor']),
customTextColor: attributes.textColor ? undefined : attributes.rgbTextColor,
customBackgroundColor: attributes.backgroundColor ? undefined : attributes.rgbBackgroundColor
};
}),
save() {
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
}
}];
/* harmony default export */ var navigation_deprecated = (navigation_deprecated_deprecated);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/index.js
/**
* WordPress dependencies
*/
@@ -23107,21 +23209,21 @@ const navigation_settings = {
name: 'core/navigation-link',
attributes: {
// translators: 'Home' as in a website's home page.
- label: Object(external_wp_i18n_["__"])('Home'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Home'),
url: 'https://make.wordpress.org/'
}
}, {
name: 'core/navigation-link',
attributes: {
// translators: 'About' as in a website's about page.
- label: Object(external_wp_i18n_["__"])('About'),
+ label: (0,external_wp_i18n_namespaceObject.__)('About'),
url: 'https://make.wordpress.org/'
}
}, {
name: 'core/navigation-link',
attributes: {
// translators: 'Contact' as in a website's contact page.
- label: Object(external_wp_i18n_["__"])('Contact'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Contact'),
url: 'https://make.wordpress.org/'
}
}]
@@ -23131,37 +23233,37 @@ const navigation_settings = {
deprecated: navigation_deprecated
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/custom-link.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/custom-link.js
/**
* WordPress dependencies
*/
-const customLink = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const customLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "https://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: "M12.5 14.5h-1V16h1c2.2 0 4-1.8 4-4s-1.8-4-4-4h-1v1.5h1c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5zm-4 1.5v-1.5h-1C6.1 14.5 5 13.4 5 12s1.1-2.5 2.5-2.5h1V8h-1c-2.2 0-4 1.8-4 4s1.8 4 4 4h1zm-1-3.2h5v-1.5h-5v1.5zM18 4H9c-1.1 0-2 .9-2 2v.5h1.5V6c0-.3.2-.5.5-.5h9c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5v-.5H7v.5c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z"
}));
/* harmony default export */ var custom_link = (customLink);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/add-submenu.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/add-submenu.js
/**
* WordPress dependencies
*/
-const addSubmenu = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const addSubmenu = (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: "M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z"
}));
/* harmony default export */ var add_submenu = (addSubmenu);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/edit.js
/**
@@ -23252,8 +23354,8 @@ const MAX_NESTING = 5;
*/
const useIsDraggingWithin = elementRef => {
- const [isDraggingWithin, setIsDraggingWithin] = Object(external_wp_element_["useState"])(false);
- Object(external_wp_element_["useEffect"])(() => {
+ const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false);
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
const {
ownerDocument
} = elementRef.current;
@@ -23452,7 +23554,7 @@ const updateNavigationLinkBlockAttributes = function () {
const normalizedTitle = title.replace(/http(s?):\/\//gi, '');
const normalizedURL = url.replace(/http(s?):\/\//gi, '');
const escapeTitle = title !== '' && normalizedTitle !== normalizedURL && originalLabel !== title;
- const label = escapeTitle ? Object(external_lodash_["escape"])(title) : originalLabel || Object(external_lodash_["escape"])(normalizedURL); // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
+ const label = escapeTitle ? (0,external_lodash_namespaceObject.escape)(title) : originalLabel || (0,external_lodash_namespaceObject.escape)(normalizedURL); // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
const type = newType === 'post_tag' ? 'tag' : newType.replace('-', '_');
const isBuiltInType = ['post', 'page', 'tag', 'category'].indexOf(type) > -1;
@@ -23460,7 +23562,7 @@ const updateNavigationLinkBlockAttributes = function () {
const kind = isCustomLink ? 'custom' : newKind;
setAttributes({ // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.
...(url && {
- url: encodeURI(Object(external_wp_url_["safeDecodeURI"])(url))
+ url: encodeURI((0,external_wp_url_namespaceObject.safeDecodeURI)(url))
}),
...(label && {
label
@@ -23506,18 +23608,18 @@ function LinkControlTransforms(_ref) {
transforms,
replace
} = _ref;
- return Object(external_wp_element_["createElement"])("div", {
+ return (0,external_wp_element_namespaceObject.createElement)("div", {
className: "link-control-transform"
- }, Object(external_wp_element_["createElement"])("h3", {
+ }, (0,external_wp_element_namespaceObject.createElement)("h3", {
className: "link-control-transform__subheading"
- }, Object(external_wp_i18n_["__"])('Transform')), Object(external_wp_element_["createElement"])("div", {
+ }, (0,external_wp_i18n_namespaceObject.__)('Transform')), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "link-control-transform__items"
}, transforms.map((item, index) => {
- return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
key: `transform-${index}`,
- onClick: () => replace(block.clientId, Object(external_wp_blocks_["switchToBlockType"])(block, item.name)),
+ onClick: () => replace(block.clientId, (0,external_wp_blocks_namespaceObject.switchToBlockType)(block, item.name)),
className: "link-control-transform__item"
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockIcon"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
icon: item.icon
}), item.title);
})));
@@ -23552,18 +23654,18 @@ function NavigationLinkEdit(_ref2) {
};
const {
saveEntityRecord
- } = Object(external_wp_data_["useDispatch"])(external_wp_coreData_["store"]);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const {
replaceBlock,
__unstableMarkNextChangeAsNotPersistent
- } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]);
- const [isLinkOpen, setIsLinkOpen] = Object(external_wp_element_["useState"])(false);
- const listItemRef = Object(external_wp_element_["useRef"])(null);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
+ const [isLinkOpen, setIsLinkOpen] = (0,external_wp_element_namespaceObject.useState)(false);
+ const listItemRef = (0,external_wp_element_namespaceObject.useRef)(null);
const isDraggingWithin = useIsDraggingWithin(listItemRef);
- const itemLabelPlaceholder = Object(external_wp_i18n_["__"])('Add link…');
+ const itemLabelPlaceholder = (0,external_wp_i18n_namespaceObject.__)('Add link…');
- const ref = Object(external_wp_element_["useRef"])();
+ const ref = (0,external_wp_element_namespaceObject.useRef)();
const {
innerBlocks,
isAtMaxNesting,
@@ -23574,7 +23676,7 @@ function NavigationLinkEdit(_ref2) {
userCanCreatePosts,
thisBlock,
blockTransforms
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getClientIdsOfDescen;
const {
@@ -23587,7 +23689,7 @@ function NavigationLinkEdit(_ref2) {
getSelectedBlockClientId,
getBlockParentsByBlockName,
getBlockTransformItems
- } = select(external_wp_blockEditor_["store"]);
+ } = select(external_wp_blockEditor_namespaceObject.store);
const selectedBlockId = getSelectedBlockClientId();
const descendants = getClientIdsOfDescendants([clientId]).length;
return {
@@ -23598,13 +23700,13 @@ function NavigationLinkEdit(_ref2) {
isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false),
hasDescendants: !!descendants,
selectedBlockHasDescendants: !!((_getClientIdsOfDescen = getClientIdsOfDescendants([selectedBlockId])) !== null && _getClientIdsOfDescen !== void 0 && _getClientIdsOfDescen.length),
- userCanCreatePages: select(external_wp_coreData_["store"]).canUser('create', 'pages'),
- userCanCreatePosts: select(external_wp_coreData_["store"]).canUser('create', 'posts'),
+ userCanCreatePages: select(external_wp_coreData_namespaceObject.store).canUser('create', 'pages'),
+ userCanCreatePosts: select(external_wp_coreData_namespaceObject.store).canUser('create', 'posts'),
thisBlock: getBlock(clientId),
blockTransforms: getBlockTransformItems([getBlock(clientId)], getBlockRootClientId(clientId))
};
}, [clientId]);
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
// This side-effect should not create an undo level as those should
// only be created via user interactions. Mark this change as
// not persistent to avoid undo level creation.
@@ -23620,7 +23722,7 @@ function NavigationLinkEdit(_ref2) {
*/
function transformToSubmenu() {
- const newSubmenu = Object(external_wp_blocks_["createBlock"])('core/navigation-submenu', attributes, innerBlocks);
+ const newSubmenu = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks);
replaceBlock(clientId, newSubmenu);
}
@@ -23628,7 +23730,7 @@ function NavigationLinkEdit(_ref2) {
const featuredTransforms = blockTransforms.filter(item => {
return featuredBlocks.includes(item.name);
});
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
// Show the LinkControl on mount if the URL is empty
// ( When adding a new menu item)
// This can't be done in the useState call because it conflicts
@@ -23647,21 +23749,21 @@ function NavigationLinkEdit(_ref2) {
* when selecting a suggestion in the link popover, we force close on block unselection.
*/
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isSelected) {
setIsLinkOpen(false);
}
}, [isSelected]); // If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (isLinkOpen && url) {
// Does this look like a URL and have something TLD-ish?
- if (Object(external_wp_url_["isURL"])(Object(external_wp_url_["prependHTTP"])(label)) && /^.+\.[a-z]+/.test(label)) {
+ if ((0,external_wp_url_namespaceObject.isURL)((0,external_wp_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) {
// Focus and select the label text.
selectLabelText();
} else {
// Focus it (but do not select).
- Object(external_wp_dom_["placeCaretAtHorizontalEdge"])(ref.current, true);
+ (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(ref.current, true);
}
}
}, [url]);
@@ -23733,12 +23835,12 @@ function NavigationLinkEdit(_ref2) {
} = getColors(context, !isTopLevelLink);
function onKeyDown(event) {
- if (external_wp_keycodes_["isKeyboardEvent"].primary(event, 'k') || !url && event.keyCode === external_wp_keycodes_["ENTER"]) {
+ if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k') || !url && event.keyCode === external_wp_keycodes_namespaceObject.ENTER) {
setIsLinkOpen(true);
}
}
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
ref: listItemRef,
className: classnames_default()('wp-block-navigation-item', {
'is-editing': isSelected || isParentOfSelectedBlock,
@@ -23746,9 +23848,9 @@ function NavigationLinkEdit(_ref2) {
'has-link': !!url,
'has-child': hasDescendants,
'has-text-color': !!textColor || !!customTextColor,
- [Object(external_wp_blockEditor_["getColorClassName"])('color', textColor)]: !!textColor,
+ [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor,
'has-background': !!backgroundColor || customBackgroundColor,
- [Object(external_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor)]: !!backgroundColor
+ [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor)]: !!backgroundColor
}),
style: {
color: !textColor && customTextColor,
@@ -23769,77 +23871,77 @@ function NavigationLinkEdit(_ref2) {
switch (type) {
case 'post':
/* translators: label for missing post in navigation link block */
- missingText = Object(external_wp_i18n_["__"])('Select post');
+ missingText = (0,external_wp_i18n_namespaceObject.__)('Select post');
break;
case 'page':
/* translators: label for missing page in navigation link block */
- missingText = Object(external_wp_i18n_["__"])('Select page');
+ missingText = (0,external_wp_i18n_namespaceObject.__)('Select page');
break;
case 'category':
/* translators: label for missing category in navigation link block */
- missingText = Object(external_wp_i18n_["__"])('Select category');
+ missingText = (0,external_wp_i18n_namespaceObject.__)('Select category');
break;
case 'tag':
/* translators: label for missing tag in navigation link block */
- missingText = Object(external_wp_i18n_["__"])('Select tag');
+ missingText = (0,external_wp_i18n_namespaceObject.__)('Select tag');
break;
default:
/* translators: label for missing values in navigation link block */
- missingText = Object(external_wp_i18n_["__"])('Add link');
+ missingText = (0,external_wp_i18n_namespaceObject.__)('Add link');
}
- 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"])(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, (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: () => setIsLinkOpen(true)
- }), !isAtMaxNesting && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
+ }), !isAtMaxNesting && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
name: "submenu",
icon: add_submenu,
- title: Object(external_wp_i18n_["__"])('Add submenu'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Add submenu'),
onClick: transformToSubmenu
- }))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Link settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["TextareaControl"], {
+ }))), (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.__)('Link settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
value: description || '',
onChange: descriptionValue => {
setAttributes({
description: descriptionValue
});
},
- label: Object(external_wp_i18n_["__"])('Description'),
- help: Object(external_wp_i18n_["__"])('The description will be displayed in the menu if the current theme supports it.')
- }), Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
+ label: (0,external_wp_i18n_namespaceObject.__)('Description'),
+ help: (0,external_wp_i18n_namespaceObject.__)('The description will be displayed in the menu if the current theme supports it.')
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
value: title || '',
onChange: titleValue => {
setAttributes({
title: titleValue
});
},
- label: Object(external_wp_i18n_["__"])('Link title'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Link title'),
autoComplete: "off"
- }), Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
value: rel || '',
onChange: relValue => {
setAttributes({
rel: relValue
});
},
- label: Object(external_wp_i18n_["__"])('Link rel'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
autoComplete: "off"
- }))), Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])("a", {
+ }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
className: classes
- }, !url ? Object(external_wp_element_["createElement"])("div", {
+ }, !url ? (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-navigation-link__placeholder-text"
- }, Object(external_wp_element_["createElement"])(external_wp_components_["Tooltip"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
position: "top center",
- text: Object(external_wp_i18n_["__"])('This item is missing a link')
- }, Object(external_wp_element_["createElement"])("span", null, missingText))) : Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ text: (0,external_wp_i18n_namespaceObject.__)('This item is missing a link')
+ }, (0,external_wp_element_namespaceObject.createElement)("span", null, missingText))) : (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
ref: ref,
identifier: "label",
className: "wp-block-navigation-item__label",
@@ -23849,8 +23951,8 @@ function NavigationLinkEdit(_ref2) {
}),
onMerge: mergeBlocks,
onReplace: onReplace,
- __unstableOnSplitAtEnd: () => insertBlocksAfter(Object(external_wp_blocks_["createBlock"])('core/navigation-link')),
- "aria-label": Object(external_wp_i18n_["__"])('Navigation link text'),
+ __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link')),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text'),
placeholder: itemLabelPlaceholder,
withoutInteractiveFormatting: true,
allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough'],
@@ -23859,11 +23961,11 @@ function NavigationLinkEdit(_ref2) {
setIsLinkOpen(true);
}
}
- }), isLinkOpen && Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], {
+ }), isLinkOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
position: "bottom center",
onClose: () => setIsLinkOpen(false),
anchorRef: listItemRef.current
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalLinkControl"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalLinkControl, {
hasTextControl: true,
className: "wp-block-navigation-link__inline-link-input",
value: link,
@@ -23875,14 +23977,14 @@ function NavigationLinkEdit(_ref2) {
if (type === 'post') {
/* translators: %s: search term. */
- format = Object(external_wp_i18n_["__"])('Create draft post: <mark>%s</mark>');
+ format = (0,external_wp_i18n_namespaceObject.__)('Create draft post: <mark>%s</mark>');
} else {
/* translators: %s: search term. */
- format = Object(external_wp_i18n_["__"])('Create draft page: <mark>%s</mark>');
+ format = (0,external_wp_i18n_namespaceObject.__)('Create draft page: <mark>%s</mark>');
}
- return Object(external_wp_element_["createInterpolateElement"])(Object(external_wp_i18n_["sprintf"])(format, searchTerm), {
- mark: Object(external_wp_element_["createElement"])("mark", null)
+ return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(format, searchTerm), {
+ mark: (0,external_wp_element_namespaceObject.createElement)("mark", null)
});
},
noDirectEntry: !!type,
@@ -23890,7 +23992,7 @@ function NavigationLinkEdit(_ref2) {
suggestionsQuery: getSuggestionsQuery(type, kind),
onChange: updatedValue => updateNavigationLinkBlockAttributes(updatedValue, setAttributes, attributes),
onRemove: removeLink,
- renderControlBottom: !url ? () => Object(external_wp_element_["createElement"])(LinkControlTransforms, {
+ renderControlBottom: !url ? () => (0,external_wp_element_namespaceObject.createElement)(LinkControlTransforms, {
block: thisBlock,
transforms: featuredTransforms,
replace: replaceBlock
@@ -23898,7 +24000,7 @@ function NavigationLinkEdit(_ref2) {
})))));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/save.js
/**
@@ -23906,70 +24008,70 @@ function NavigationLinkEdit(_ref2) {
*/
function navigation_link_save_save() {
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-title.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-title.js
/**
* WordPress dependencies
*/
-const postTitle = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const postTitle = (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: "M4 14.5h16V16H4zM4 18.5h9V20H4zM4 4h3c2 0 3 .86 3 2.583 0 .891-.253 1.554-.76 1.988-.505.435-1.24.652-2.204.652H5.542V12H4V4zm2.855 4c.53 0 .924-.114 1.18-.343.266-.228.398-.579.398-1.051 0-.473-.132-.82-.397-1.04-.265-.229-.67-.343-1.217-.343H5.542V8h1.313z"
}));
/* harmony default export */ var post_title = (postTitle);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page.js
/**
* WordPress dependencies
*/
-const page_page = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const page = (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: "M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"
}));
-/* harmony default export */ var library_page = (page_page);
+/* harmony default export */ var library_page = (page);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/tag.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/tag.js
/**
* WordPress dependencies
*/
-const tag_tag = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const tag = (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: "M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"
}));
-/* harmony default export */ var library_tag = (tag_tag);
+/* harmony default export */ var library_tag = (tag);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/custom-post-type.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/custom-post-type.js
/**
* WordPress dependencies
*/
-const customPostType = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const customPostType = (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: "M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z"
}));
/* harmony default export */ var custom_post_type = (customPostType);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/fallback-variations.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/fallback-variations.js
/**
* WordPress dependencies
*/
@@ -23982,14 +24084,14 @@ const customPostType = Object(external_wp_element_["createElement"])(external_wp
const fallbackVariations = [{
name: 'link',
isDefault: true,
- title: Object(external_wp_i18n_["__"])('Custom Link'),
- description: Object(external_wp_i18n_["__"])('A link to a custom URL.'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Custom Link'),
+ description: (0,external_wp_i18n_namespaceObject.__)('A link to a custom URL.'),
attributes: {}
}, {
name: 'post',
icon: post_title,
- title: Object(external_wp_i18n_["__"])('Post Link'),
- description: Object(external_wp_i18n_["__"])('A link to a post.'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Post Link'),
+ description: (0,external_wp_i18n_namespaceObject.__)('A link to a post.'),
attributes: {
type: 'post',
kind: 'post-type'
@@ -23997,8 +24099,8 @@ const fallbackVariations = [{
}, {
name: 'page',
icon: library_page,
- title: Object(external_wp_i18n_["__"])('Page Link'),
- description: Object(external_wp_i18n_["__"])('A link to a page.'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Page Link'),
+ description: (0,external_wp_i18n_namespaceObject.__)('A link to a page.'),
attributes: {
type: 'page',
kind: 'post-type'
@@ -24006,8 +24108,8 @@ const fallbackVariations = [{
}, {
name: 'category',
icon: library_category,
- title: Object(external_wp_i18n_["__"])('Category Link'),
- description: Object(external_wp_i18n_["__"])('A link to a category.'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Category Link'),
+ description: (0,external_wp_i18n_namespaceObject.__)('A link to a category.'),
attributes: {
type: 'category',
kind: 'taxonomy'
@@ -24015,8 +24117,8 @@ const fallbackVariations = [{
}, {
name: 'tag',
icon: library_tag,
- title: Object(external_wp_i18n_["__"])('Tag Link'),
- description: Object(external_wp_i18n_["__"])('A link to a tag.'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Tag Link'),
+ description: (0,external_wp_i18n_namespaceObject.__)('A link to a tag.'),
attributes: {
type: 'tag',
kind: 'taxonomy'
@@ -24035,7 +24137,7 @@ fallbackVariations.forEach(variation => {
});
/* harmony default export */ var fallback_variations = (fallbackVariations);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/hooks.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/hooks.js
/**
* WordPress dependencies
*/
@@ -24102,7 +24204,7 @@ function enhanceNavigationLinkVariations(settings, name) {
return settings;
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/transforms.js
/**
* WordPress dependencies
*/
@@ -24112,66 +24214,66 @@ const navigation_link_transforms_transforms = {
type: 'block',
blocks: ['core/site-logo'],
transform: () => {
- return Object(external_wp_blocks_["createBlock"])('core/navigation-link');
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
}
}, {
type: 'block',
blocks: ['core/spacer'],
transform: () => {
- return Object(external_wp_blocks_["createBlock"])('core/navigation-link');
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
}
}, {
type: 'block',
blocks: ['core/home-link'],
transform: () => {
- return Object(external_wp_blocks_["createBlock"])('core/navigation-link');
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
}
}, {
type: 'block',
blocks: ['core/social-links'],
transform: () => {
- return Object(external_wp_blocks_["createBlock"])('core/navigation-link');
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
}
}, {
type: 'block',
blocks: ['core/search'],
transform: () => {
- return Object(external_wp_blocks_["createBlock"])('core/navigation-link');
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link');
}
}],
to: [{
type: 'block',
blocks: ['core/navigation-submenu'],
- transform: (attributes, innerBlocks) => Object(external_wp_blocks_["createBlock"])('core/navigation-submenu', attributes, innerBlocks)
+ transform: (attributes, innerBlocks) => (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks)
}, {
type: 'block',
blocks: ['core/spacer'],
transform: () => {
- return Object(external_wp_blocks_["createBlock"])('core/spacer');
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer');
}
}, {
type: 'block',
blocks: ['core/site-logo'],
transform: () => {
- return Object(external_wp_blocks_["createBlock"])('core/site-logo');
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo');
}
}, {
type: 'block',
blocks: ['core/home-link'],
transform: () => {
- return Object(external_wp_blocks_["createBlock"])('core/home-link');
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/home-link');
}
}, {
type: 'block',
blocks: ['core/social-links'],
transform: () => {
- return Object(external_wp_blocks_["createBlock"])('core/social-links');
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/social-links');
}
}, {
type: 'block',
blocks: ['core/search'],
transform: () => {
- return Object(external_wp_blocks_["createBlock"])('core/search', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/search', {
showLabel: false,
buttonUseIcon: true,
buttonPosition: 'button-inside'
@@ -24181,7 +24283,7 @@ const navigation_link_transforms_transforms = {
};
/* harmony default export */ var navigation_link_transforms = (navigation_link_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js
/**
@@ -24275,7 +24377,7 @@ const navigation_link_settings = {
save: navigation_link_save_save,
example: {
attributes: {
- label: Object(external_wp_i18n_["_x"])('Example Link', 'navigation link preview example'),
+ label: (0,external_wp_i18n_namespaceObject._x)('Example Link', 'navigation link preview example'),
url: 'https://example.com'
}
},
@@ -24321,37 +24423,36 @@ const navigation_link_settings = {
},
save() {
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
}
}],
transforms: navigation_link_transforms
}; // importing this file includes side effects. This is whitelisted in block-library/package.json under sideEffects
-Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/navigation-link', enhanceNavigationLinkVariations);
+(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/navigation-link', enhanceNavigationLinkVariations);
-// EXTERNAL MODULE: external ["wp","a11y"]
-var external_wp_a11y_ = __webpack_require__("gdqT");
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/icons.js
+;// CONCATENATED MODULE: external ["wp","a11y"]
+var external_wp_a11y_namespaceObject = window["wp"]["a11y"];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/icons.js
/**
* WordPress dependencies
*/
-const ItemSubmenuIcon = () => Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], {
+const ItemSubmenuIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
width: "12",
height: "12",
viewBox: "0 0 12 12",
fill: "none"
-}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M1.50002 4L6.00002 8L10.5 4",
strokeWidth: "1.5"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/edit.js
/**
@@ -24444,8 +24545,8 @@ const edit_MAX_NESTING = 5;
*/
const edit_useIsDraggingWithin = elementRef => {
- const [isDraggingWithin, setIsDraggingWithin] = Object(external_wp_element_["useState"])(false);
- Object(external_wp_element_["useEffect"])(() => {
+ const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false);
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
const {
ownerDocument
} = elementRef.current;
@@ -24643,7 +24744,7 @@ const edit_updateNavigationLinkBlockAttributes = function () {
const normalizedTitle = title.replace(/http(s?):\/\//gi, '');
const normalizedURL = url.replace(/http(s?):\/\//gi, '');
const escapeTitle = title !== '' && normalizedTitle !== normalizedURL && originalLabel !== title;
- const label = escapeTitle ? Object(external_lodash_["escape"])(title) : originalLabel || Object(external_lodash_["escape"])(normalizedURL); // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
+ const label = escapeTitle ? (0,external_lodash_namespaceObject.escape)(title) : originalLabel || (0,external_lodash_namespaceObject.escape)(normalizedURL); // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
const type = newType === 'post_tag' ? 'tag' : newType.replace('-', '_');
const isBuiltInType = ['post', 'page', 'tag', 'category'].indexOf(type) > -1;
@@ -24651,7 +24752,7 @@ const edit_updateNavigationLinkBlockAttributes = function () {
const kind = isCustomLink ? 'custom' : newKind;
setAttributes({ // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.
...(url && {
- url: encodeURI(Object(external_wp_url_["safeDecodeURI"])(url))
+ url: encodeURI((0,external_wp_url_namespaceObject.safeDecodeURI)(url))
}),
...(label && {
label
@@ -24700,17 +24801,17 @@ function NavigationSubmenuEdit(_ref) {
} = context;
const {
saveEntityRecord
- } = Object(external_wp_data_["useDispatch"])(external_wp_coreData_["store"]);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const {
__unstableMarkNextChangeAsNotPersistent
- } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]);
- const [isLinkOpen, setIsLinkOpen] = Object(external_wp_element_["useState"])(false);
- const listItemRef = Object(external_wp_element_["useRef"])(null);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
+ const [isLinkOpen, setIsLinkOpen] = (0,external_wp_element_namespaceObject.useState)(false);
+ const listItemRef = (0,external_wp_element_namespaceObject.useRef)(null);
const isDraggingWithin = edit_useIsDraggingWithin(listItemRef);
- const itemLabelPlaceholder = Object(external_wp_i18n_["__"])('Add text…');
+ const itemLabelPlaceholder = (0,external_wp_i18n_namespaceObject.__)('Add text…');
- const ref = Object(external_wp_element_["useRef"])();
+ const ref = (0,external_wp_element_namespaceObject.useRef)();
const {
isAtMaxNesting,
isTopLevelItem,
@@ -24720,7 +24821,7 @@ function NavigationSubmenuEdit(_ref) {
selectedBlockHasDescendants,
userCanCreatePages,
userCanCreatePosts
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getClientIdsOfDescen;
const {
@@ -24728,7 +24829,7 @@ function NavigationSubmenuEdit(_ref) {
hasSelectedInnerBlock,
getSelectedBlockClientId,
getBlockParentsByBlockName
- } = select(external_wp_blockEditor_["store"]);
+ } = select(external_wp_blockEditor_namespaceObject.store);
const selectedBlockId = getSelectedBlockClientId();
const descendants = getClientIdsOfDescendants([clientId]).length;
return {
@@ -24738,21 +24839,21 @@ function NavigationSubmenuEdit(_ref) {
isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false),
hasDescendants: !!descendants,
selectedBlockHasDescendants: !!((_getClientIdsOfDescen = getClientIdsOfDescendants([selectedBlockId])) !== null && _getClientIdsOfDescen !== void 0 && _getClientIdsOfDescen.length),
- userCanCreatePages: select(external_wp_coreData_["store"]).canUser('create', 'pages'),
- userCanCreatePosts: select(external_wp_coreData_["store"]).canUser('create', 'posts')
+ userCanCreatePages: select(external_wp_coreData_namespaceObject.store).canUser('create', 'pages'),
+ userCanCreatePosts: select(external_wp_coreData_namespaceObject.store).canUser('create', 'posts')
};
}, [clientId]); // Show the LinkControl on mount if the URL is empty
// ( When adding a new menu item)
// This can't be done in the useState call because it conflicts
// with the autofocus behavior of the BlockListBlock component.
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (!openSubmenusOnClick && !url) {
setIsLinkOpen(true);
}
}, []); // Store the colors from context as attributes for rendering
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
// This side-effect should not create an undo level as those should
// only be created via user interactions. Mark this change as
// not persistent to avoid undo level creation.
@@ -24768,21 +24869,21 @@ function NavigationSubmenuEdit(_ref) {
* when selecting a suggestion in the link popover, we force close on block unselection.
*/
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isSelected) {
setIsLinkOpen(false);
}
}, [isSelected]); // If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (isLinkOpen && url) {
// Does this look like a URL and have something TLD-ish?
- if (Object(external_wp_url_["isURL"])(Object(external_wp_url_["prependHTTP"])(label)) && /^.+\.[a-z]+/.test(label)) {
+ if ((0,external_wp_url_namespaceObject.isURL)((0,external_wp_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) {
// Focus and select the label text.
selectLabelText();
} else {
// Focus it (but do not select).
- Object(external_wp_dom_["placeCaretAtHorizontalEdge"])(ref.current, true);
+ (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(ref.current, true);
}
}
}, [url]);
@@ -24837,12 +24938,12 @@ function NavigationSubmenuEdit(_ref) {
} = edit_getColors(context, !isTopLevelItem);
function onKeyDown(event) {
- if (external_wp_keycodes_["isKeyboardEvent"].primary(event, 'k')) {
+ if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) {
setIsLinkOpen(true);
}
}
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
ref: listItemRef,
className: classnames_default()('wp-block-navigation-item', {
'is-editing': isSelected || isParentOfSelectedBlock,
@@ -24850,9 +24951,9 @@ function NavigationSubmenuEdit(_ref) {
'has-link': !!url,
'has-child': hasDescendants,
'has-text-color': !!textColor || !!customTextColor,
- [Object(external_wp_blockEditor_["getColorClassName"])('color', textColor)]: !!textColor,
+ [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor,
'has-background': !!backgroundColor || customBackgroundColor,
- [Object(external_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor)]: !!backgroundColor,
+ [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor)]: !!backgroundColor,
'open-on-click': openSubmenusOnClick
}),
style: {
@@ -24865,10 +24966,10 @@ function NavigationSubmenuEdit(_ref) {
const innerBlocksColors = edit_getColors(context, true);
if (isAtMaxNesting) {
- Object(external_lodash_["pull"])(navigation_submenu_edit_ALLOWED_BLOCKS, 'core/navigation-submenu');
+ (0,external_lodash_namespaceObject.pull)(navigation_submenu_edit_ALLOWED_BLOCKS, 'core/navigation-submenu');
}
- const innerBlocksProps = Object(external_wp_blockEditor_["useInnerBlocksProps"])({
+ const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({
className: classnames_default()('wp-block-navigation__submenu-container', {
'is-parent-of-selected-block': isParentOfSelectedBlock,
'has-text-color': !!(innerBlocksColors.textColor || innerBlocksColors.customTextColor),
@@ -24889,47 +24990,47 @@ function NavigationSubmenuEdit(_ref) {
// see: https://github.com/WordPress/gutenberg/pull/34615.
__experimentalCaptureToolbars: true,
renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasDescendants || // Show the appender while dragging to allow inserting element between item and the appender.
- hasDescendants ? external_wp_blockEditor_["InnerBlocks"].ButtonBlockAppender : false
+ hasDescendants ? external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false
});
const ParentElement = openSubmenusOnClick ? 'button' : 'a';
- 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, !openSubmenusOnClick && 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, !openSubmenusOnClick && (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: () => setIsLinkOpen(true)
- }))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Link settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["TextareaControl"], {
+ }))), (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.__)('Link settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextareaControl, {
value: description || '',
onChange: descriptionValue => {
setAttributes({
description: descriptionValue
});
},
- label: Object(external_wp_i18n_["__"])('Description'),
- help: Object(external_wp_i18n_["__"])('The description will be displayed in the menu if the current theme supports it.')
- }), Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
+ label: (0,external_wp_i18n_namespaceObject.__)('Description'),
+ help: (0,external_wp_i18n_namespaceObject.__)('The description will be displayed in the menu if the current theme supports it.')
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
value: title || '',
onChange: titleValue => {
setAttributes({
title: titleValue
});
},
- label: Object(external_wp_i18n_["__"])('Link title'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Link title'),
autoComplete: "off"
- }), Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
value: rel || '',
onChange: relValue => {
setAttributes({
rel: relValue
});
},
- label: Object(external_wp_i18n_["__"])('Link rel'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Link rel'),
autoComplete: "off"
- }))), Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(ParentElement, {
+ }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(ParentElement, {
className: "wp-block-navigation-item__content"
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
ref: ref,
identifier: "label",
className: "wp-block-navigation-item__label",
@@ -24939,7 +25040,7 @@ function NavigationSubmenuEdit(_ref) {
}),
onMerge: mergeBlocks,
onReplace: onReplace,
- "aria-label": Object(external_wp_i18n_["__"])('Navigation link text'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text'),
placeholder: itemLabelPlaceholder,
withoutInteractiveFormatting: true,
allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough'],
@@ -24948,11 +25049,11 @@ function NavigationSubmenuEdit(_ref) {
setIsLinkOpen(true);
}
}
- }), !openSubmenusOnClick && isLinkOpen && Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], {
+ }), !openSubmenusOnClick && isLinkOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
position: "bottom center",
onClose: () => setIsLinkOpen(false),
anchorRef: listItemRef.current
- }, 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: link,
showInitialSuggestions: true,
@@ -24963,14 +25064,14 @@ function NavigationSubmenuEdit(_ref) {
if (type === 'post') {
/* translators: %s: search term. */
- format = Object(external_wp_i18n_["__"])('Create draft post: <mark>%s</mark>');
+ format = (0,external_wp_i18n_namespaceObject.__)('Create draft post: <mark>%s</mark>');
} else {
/* translators: %s: search term. */
- format = Object(external_wp_i18n_["__"])('Create draft page: <mark>%s</mark>');
+ format = (0,external_wp_i18n_namespaceObject.__)('Create draft page: <mark>%s</mark>');
}
- return Object(external_wp_element_["createInterpolateElement"])(Object(external_wp_i18n_["sprintf"])(format, searchTerm), {
- mark: Object(external_wp_element_["createElement"])("mark", null)
+ return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(format, searchTerm), {
+ mark: (0,external_wp_element_namespaceObject.createElement)("mark", null)
});
},
noDirectEntry: !!type,
@@ -24981,14 +25082,14 @@ function NavigationSubmenuEdit(_ref) {
setAttributes({
url: ''
});
- Object(external_wp_a11y_["speak"])(Object(external_wp_i18n_["__"])('Link removed.'), 'assertive');
+ (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Link removed.'), 'assertive');
}
- })), (showSubmenuIcon || openSubmenusOnClick) && Object(external_wp_element_["createElement"])("span", {
+ })), (showSubmenuIcon || openSubmenusOnClick) && (0,external_wp_element_namespaceObject.createElement)("span", {
className: "wp-block-navigation__submenu-icon"
- }, Object(external_wp_element_["createElement"])(ItemSubmenuIcon, null))), Object(external_wp_element_["createElement"])("div", innerBlocksProps)));
+ }, (0,external_wp_element_namespaceObject.createElement)(ItemSubmenuIcon, null))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps)));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/save.js
/**
@@ -24996,10 +25097,10 @@ function NavigationSubmenuEdit(_ref) {
*/
function navigation_submenu_save_save() {
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/transforms.js
/**
* WordPress dependencies
*/
@@ -25013,7 +25114,7 @@ const navigation_submenu_transforms_transforms = {
return (block === null || block === void 0 ? void 0 : (_block$innerBlocks = block.innerBlocks) === null || _block$innerBlocks === void 0 ? void 0 : _block$innerBlocks.length) === 0;
},
- transform: attributes => Object(external_wp_blocks_["createBlock"])('core/navigation-link', attributes)
+ transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', attributes)
}, {
type: 'block',
blocks: ['core/spacer'],
@@ -25023,7 +25124,7 @@ const navigation_submenu_transforms_transforms = {
return (block === null || block === void 0 ? void 0 : (_block$innerBlocks2 = block.innerBlocks) === null || _block$innerBlocks2 === void 0 ? void 0 : _block$innerBlocks2.length) === 0;
},
transform: () => {
- return Object(external_wp_blocks_["createBlock"])('core/spacer');
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer');
}
}, {
type: 'block',
@@ -25034,7 +25135,7 @@ const navigation_submenu_transforms_transforms = {
return (block === null || block === void 0 ? void 0 : (_block$innerBlocks3 = block.innerBlocks) === null || _block$innerBlocks3 === void 0 ? void 0 : _block$innerBlocks3.length) === 0;
},
transform: () => {
- return Object(external_wp_blocks_["createBlock"])('core/site-logo');
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo');
}
}, {
type: 'block',
@@ -25045,7 +25146,7 @@ const navigation_submenu_transforms_transforms = {
return (block === null || block === void 0 ? void 0 : (_block$innerBlocks4 = block.innerBlocks) === null || _block$innerBlocks4 === void 0 ? void 0 : _block$innerBlocks4.length) === 0;
},
transform: () => {
- return Object(external_wp_blocks_["createBlock"])('core/home-link');
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/home-link');
}
}, {
type: 'block',
@@ -25056,7 +25157,7 @@ const navigation_submenu_transforms_transforms = {
return (block === null || block === void 0 ? void 0 : (_block$innerBlocks5 = block.innerBlocks) === null || _block$innerBlocks5 === void 0 ? void 0 : _block$innerBlocks5.length) === 0;
},
transform: () => {
- return Object(external_wp_blocks_["createBlock"])('core/social-links');
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/social-links');
}
}, {
type: 'block',
@@ -25067,13 +25168,13 @@ const navigation_submenu_transforms_transforms = {
return (block === null || block === void 0 ? void 0 : (_block$innerBlocks6 = block.innerBlocks) === null || _block$innerBlocks6 === void 0 ? void 0 : _block$innerBlocks6.length) === 0;
},
transform: () => {
- return Object(external_wp_blocks_["createBlock"])('core/search');
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/search');
}
}]
};
/* harmony default export */ var navigation_submenu_transforms = (navigation_submenu_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js
/**
* WordPress dependencies
*/
@@ -25151,22 +25252,22 @@ const navigation_submenu_settings = {
transforms: navigation_submenu_transforms
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page-break.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/page-break.js
/**
* WordPress dependencies
*/
-const pageBreak = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const pageBreak = (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: "M7.8 6c0-.7.6-1.2 1.2-1.2h6c.7 0 1.2.6 1.2 1.2v3h1.5V6c0-1.5-1.2-2.8-2.8-2.8H9C7.5 3.2 6.2 4.5 6.2 6v3h1.5V6zm8.4 11c0 .7-.6 1.2-1.2 1.2H9c-.7 0-1.2-.6-1.2-1.2v-3H6.2v3c0 1.5 1.2 2.8 2.8 2.8h6c1.5 0 2.8-1.2 2.8-2.8v-3h-1.5v3zM4 11v1h16v-1H4z"
}));
/* harmony default export */ var page_break = (pageBreak);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/edit.js
/**
@@ -25175,12 +25276,12 @@ const pageBreak = Object(external_wp_element_["createElement"])(external_wp_prim
function NextPageEdit() {
- return Object(external_wp_element_["createElement"])("div", Object(external_wp_blockEditor_["useBlockProps"])(), Object(external_wp_element_["createElement"])("div", {
+ return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-nextpage"
- }, Object(external_wp_element_["createElement"])("span", null, Object(external_wp_i18n_["__"])('Page break'))));
+ }, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Page break'))));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/save.js
/**
@@ -25188,10 +25289,10 @@ function NextPageEdit() {
*/
function nextpage_save_save() {
- return Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, '<!--nextpage-->');
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, '<!--nextpage-->');
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/transforms.js
/**
* WordPress dependencies
*/
@@ -25207,14 +25308,14 @@ const nextpage_transforms_transforms = {
isMatch: node => node.dataset && node.dataset.block === 'core/nextpage',
transform() {
- return Object(external_wp_blocks_["createBlock"])('core/nextpage', {});
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/nextpage', {});
}
}]
};
/* harmony default export */ var nextpage_transforms = (nextpage_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js
/**
* WordPress dependencies
*/
@@ -25254,7 +25355,7 @@ const nextpage_settings = {
save: nextpage_save_save
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pattern/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pattern/edit.js
/**
@@ -25269,29 +25370,29 @@ const PatternEdit = _ref => {
attributes,
clientId
} = _ref;
- const selectedPattern = Object(external_wp_data_["useSelect"])(select => select(external_wp_blockEditor_["store"]).__experimentalGetParsedPattern(attributes.slug), [attributes.slug]);
+ const selectedPattern = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).__experimentalGetParsedPattern(attributes.slug), [attributes.slug]);
const {
replaceBlocks,
__unstableMarkNextChangeAsNotPersistent
- } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]); // Run this effect when the component loads.
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); // Run this effect when the component loads.
// This adds the Pattern's contents to the post.
// This change won't be saved.
// It will continue to pull from the pattern file unless changes are made to its respective template part.
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (selectedPattern !== null && selectedPattern !== void 0 && selectedPattern.blocks) {
__unstableMarkNextChangeAsNotPersistent();
replaceBlocks(clientId, selectedPattern.blocks);
}
}, [selectedPattern === null || selectedPattern === void 0 ? void 0 : selectedPattern.blocks]);
- const props = Object(external_wp_blockEditor_["useBlockProps"])();
- return Object(external_wp_element_["createElement"])("div", props);
+ const props = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
+ return (0,external_wp_element_namespaceObject.createElement)("div", props);
};
/* harmony default export */ var pattern_edit = (PatternEdit);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pattern/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pattern/index.js
/**
* Internal dependencies
*/
@@ -25321,22 +25422,22 @@ const pattern_settings = {
edit: pattern_edit
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pages.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pages.js
/**
* WordPress dependencies
*/
-const pages_pages = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const pages = (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: "M7 13.8h6v-1.5H7v1.5zM18 16V4c0-1.1-.9-2-2-2H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2zM5.5 16V4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5zM7 10.5h8V9H7v1.5zm0-3.3h8V5.8H7v1.4zM20.2 6v13c0 .7-.6 1.2-1.2 1.2H8v1.5h11c1.5 0 2.7-1.2 2.7-2.8V6h-1.5z"
}));
-/* harmony default export */ var library_pages = (pages_pages);
+/* harmony default export */ var library_pages = (pages);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/convert-to-links-modal.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/convert-to-links-modal.js
/**
@@ -25427,11 +25528,11 @@ function ConvertToLinksModal(_ref3) {
const {
pages,
pagesFinished
- } = 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 query = ['postType', 'page', {
per_page: MAX_PAGE_COUNT,
_fields: PAGE_FIELDS,
@@ -25448,53 +25549,53 @@ function ConvertToLinksModal(_ref3) {
}, [clientId]);
const {
replaceBlock
- } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]);
- return Object(external_wp_element_["createElement"])(external_wp_components_["Modal"], {
- closeLabel: Object(external_wp_i18n_["__"])('Close'),
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
+ closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close'),
onRequestClose: onClose,
- title: Object(external_wp_i18n_["__"])('Convert to links'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Convert to links'),
className: 'wp-block-page-list-modal',
aria: {
describedby: 'wp-block-page-list-modal__description'
}
- }, Object(external_wp_element_["createElement"])("p", {
+ }, (0,external_wp_element_namespaceObject.createElement)("p", {
id: 'wp-block-page-list-modal__description'
- }, Object(external_wp_i18n_["__"])('To edit this navigation menu, convert it to single page links. This allows you to add, re-order, remove items, or edit their labels.')), Object(external_wp_element_["createElement"])("p", null, Object(external_wp_i18n_["__"])("Note: if you add new pages to your site, you'll need to add them to your navigation menu.")), Object(external_wp_element_["createElement"])("div", {
+ }, (0,external_wp_i18n_namespaceObject.__)('To edit this navigation menu, convert it to single page links. This allows you to add, re-order, remove items, or edit their labels.')), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)("Note: if you add new pages to your site, you'll need to add them to your navigation menu.")), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-page-list-modal-buttons"
- }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "tertiary",
onClick: onClose
- }, Object(external_wp_i18n_["__"])('Cancel')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ }, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "primary",
disabled: !pagesFinished,
onClick: convertSelectedBlockToNavigationLinks({
pages,
replaceBlock,
clientId,
- createBlock: external_wp_blocks_["createBlock"]
+ createBlock: external_wp_blocks_namespaceObject.createBlock
})
- }, Object(external_wp_i18n_["__"])('Convert'))));
+ }, (0,external_wp_i18n_namespaceObject.__)('Convert'))));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/icons.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation-link/icons.js
/**
* WordPress dependencies
*/
-const icons_ItemSubmenuIcon = () => Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], {
+const icons_ItemSubmenuIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
width: "12",
height: "12",
viewBox: "0 0 12 12",
fill: "none"
-}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M1.50002 4L6.00002 8L10.5 4",
strokeWidth: "1.5"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/edit.js
/**
@@ -25535,45 +25636,45 @@ function PageListEdit(_ref) {
} = usePageData();
const isNavigationChild = ('showSubmenuIcon' in context);
const allowConvertToLinks = isNavigationChild && totalPages <= edit_MAX_PAGE_COUNT;
- const [isOpen, setOpen] = Object(external_wp_element_["useState"])(false);
+ const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false);
const openModal = () => setOpen(true);
const closeModal = () => setOpen(false);
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()('wp-block-page-list', {
'has-text-color': !!context.textColor,
- [Object(external_wp_blockEditor_["getColorClassName"])('color', context.textColor)]: !!context.textColor,
+ [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', context.textColor)]: !!context.textColor,
'has-background': !!context.backgroundColor,
- [Object(external_wp_blockEditor_["getColorClassName"])('background-color', context.backgroundColor)]: !!context.backgroundColor
+ [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', context.backgroundColor)]: !!context.backgroundColor
}),
style: { ...((_context$style = context.style) === null || _context$style === void 0 ? void 0 : _context$style.color)
}
});
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, allowConvertToLinks && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, allowConvertToLinks && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "other"
- }, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
- title: Object(external_wp_i18n_["__"])('Edit'),
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
+ title: (0,external_wp_i18n_namespaceObject.__)('Edit'),
onClick: openModal
- }, Object(external_wp_i18n_["__"])('Edit'))), allowConvertToLinks && isOpen && Object(external_wp_element_["createElement"])(ConvertToLinksModal, {
+ }, (0,external_wp_i18n_namespaceObject.__)('Edit'))), allowConvertToLinks && isOpen && (0,external_wp_element_namespaceObject.createElement)(ConvertToLinksModal, {
onClose: closeModal,
clientId: clientId
- }), !hasResolvedPages && Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null))), hasResolvedPages && totalPages === null && Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_components_["Notice"], {
+ }), !hasResolvedPages && (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))), hasResolvedPages && totalPages === null && (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
status: 'warning',
isDismissible: false
- }, Object(external_wp_i18n_["__"])('Page List: Cannot retrieve Pages.')))), totalPages === 0 && Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_components_["Notice"], {
+ }, (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.')))), totalPages === 0 && (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
status: 'info',
isDismissible: false
- }, Object(external_wp_i18n_["__"])('Page List: Cannot retrieve Pages.'))), totalPages > 0 && Object(external_wp_element_["createElement"])("ul", blockProps, Object(external_wp_element_["createElement"])(edit_PageItems, {
+ }, (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.'))), totalPages > 0 && (0,external_wp_element_namespaceObject.createElement)("ul", blockProps, (0,external_wp_element_namespaceObject.createElement)(PageItems, {
context: context,
pagesByParentId: pagesByParentId
})));
}
function useFrontPageId() {
- return Object(external_wp_data_["useSelect"])(select => {
- const site = select(external_wp_coreData_["store"]).getEntityRecord('root', 'site');
+ return (0,external_wp_data_namespaceObject.useSelect)(select => {
+ const site = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', 'site');
return (site === null || site === void 0 ? void 0 : site.show_on_front) === 'page' && (site === null || site === void 0 ? void 0 : site.page_on_front);
}, []);
}
@@ -25582,11 +25683,11 @@ function usePageData() {
const {
pages,
hasResolvedPages
- } = 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);
return {
pages: getEntityRecords('postType', 'page', {
orderby: 'menu_order',
@@ -25602,13 +25703,13 @@ function usePageData() {
}])
};
}, []);
- return Object(external_wp_element_["useMemo"])(() => {
+ return (0,external_wp_element_namespaceObject.useMemo)(() => {
var _pages$length;
// TODO: Once the REST API supports passing multiple values to
// 'orderby', this can be removed.
// https://core.trac.wordpress.org/ticket/39037
- const sortedPages = Object(external_lodash_["sortBy"])(pages, ['menu_order', 'title.rendered']);
+ const sortedPages = (0,external_lodash_namespaceObject.sortBy)(pages, ['menu_order', 'title.rendered']);
const pagesByParentId = sortedPages.reduce((accumulator, page) => {
const {
parent
@@ -25630,7 +25731,7 @@ function usePageData() {
}, [pages, hasResolvedPages]);
}
-const edit_PageItems = Object(external_wp_element_["memo"])(function PageItems(_ref2) {
+const PageItems = (0,external_wp_element_namespaceObject.memo)(function PageItems(_ref2) {
let {
context,
pagesByParentId,
@@ -25649,7 +25750,7 @@ const edit_PageItems = Object(external_wp_element_["memo"])(function PageItems(_
const hasChildren = pagesByParentId.has(page.id);
const isNavigationChild = ('showSubmenuIcon' in context);
- return Object(external_wp_element_["createElement"])("li", {
+ return (0,external_wp_element_namespaceObject.createElement)("li", {
key: page.id,
className: classnames_default()('wp-block-pages-list__item', {
'has-child': hasChildren,
@@ -25658,18 +25759,18 @@ const edit_PageItems = Object(external_wp_element_["memo"])(function PageItems(_
'open-on-hover-click': !context.openSubmenusOnClick && context.showSubmenuIcon,
'menu-item-home': page.id === frontPageId
})
- }, hasChildren && context.openSubmenusOnClick ? Object(external_wp_element_["createElement"])(ItemSubmenuToggle, {
+ }, hasChildren && context.openSubmenusOnClick ? (0,external_wp_element_namespaceObject.createElement)(ItemSubmenuToggle, {
title: (_page$title = page.title) === null || _page$title === void 0 ? void 0 : _page$title.rendered
- }) : Object(external_wp_element_["createElement"])("a", {
+ }) : (0,external_wp_element_namespaceObject.createElement)("a", {
className: classnames_default()('wp-block-pages-list__item__link', {
'wp-block-navigation-item__content': isNavigationChild
}),
href: page.link
- }, (_page$title2 = page.title) === null || _page$title2 === void 0 ? void 0 : _page$title2.rendered), hasChildren && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, !context.openSubmenusOnClick && context.showSubmenuIcon && Object(external_wp_element_["createElement"])(ItemSubmenuToggle, null), Object(external_wp_element_["createElement"])("ul", {
+ }, (_page$title2 = page.title) === null || _page$title2 === void 0 ? void 0 : _page$title2.rendered), hasChildren && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !context.openSubmenusOnClick && context.showSubmenuIcon && (0,external_wp_element_namespaceObject.createElement)(ItemSubmenuToggle, null), (0,external_wp_element_namespaceObject.createElement)("ul", {
className: classnames_default()('submenu-container', {
'wp-block-navigation__submenu-container': isNavigationChild
})
- }, Object(external_wp_element_["createElement"])(PageItems, {
+ }, (0,external_wp_element_namespaceObject.createElement)(PageItems, {
context: context,
pagesByParentId: pagesByParentId,
parentId: page.id,
@@ -25682,15 +25783,15 @@ function ItemSubmenuToggle(_ref3) {
let {
title
} = _ref3;
- return Object(external_wp_element_["createElement"])("button", {
+ return (0,external_wp_element_namespaceObject.createElement)("button", {
className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle",
"aria-expanded": "false"
- }, title, Object(external_wp_element_["createElement"])("span", {
+ }, title, (0,external_wp_element_namespaceObject.createElement)("span", {
className: "wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"
- }, Object(external_wp_element_["createElement"])(icons_ItemSubmenuIcon, null)));
+ }, (0,external_wp_element_namespaceObject.createElement)(icons_ItemSubmenuIcon, null)));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/page-list/index.js
/**
* WordPress dependencies
*/
@@ -25727,22 +25828,22 @@ const page_list_settings = {
edit: PageListEdit
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/paragraph.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/paragraph.js
/**
* WordPress dependencies
*/
-const paragraph = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const paragraph = (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.3 4H9.9v-.1l-.9.2c-2.3.4-4 2.4-4 4.8s1.7 4.4 4 4.8l.7.1V20h1.5V5.5h2.9V20h1.5V5.5h2.7V4z"
}));
/* harmony default export */ var library_paragraph = (paragraph);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/deprecated.js
/**
@@ -25819,14 +25920,14 @@ const migrateCustomColorsAndFontSizes = attributes => {
};
}
- return { ...Object(external_lodash_["omit"])(attributes, ['customTextColor', 'customBackgroundColor', 'customFontSize']),
+ return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['customTextColor', 'customBackgroundColor', 'customFontSize']),
style
};
};
const paragraph_deprecated_deprecated = [{
supports,
- attributes: { ...Object(external_lodash_["omit"])(paragraph_deprecated_blockAttributes, ['style']),
+ attributes: { ...(0,external_lodash_namespaceObject.omit)(paragraph_deprecated_blockAttributes, ['style']),
customTextColor: {
type: 'string'
},
@@ -25855,9 +25956,9 @@ const paragraph_deprecated_deprecated = [{
customFontSize,
direction
} = attributes;
- const textClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor);
- const backgroundClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor);
- const fontSizeClass = Object(external_wp_blockEditor_["getFontSizeClass"])(fontSize);
+ const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
+ const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
+ const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize);
const className = classnames_default()({
'has-text-color': textColor || customTextColor,
'has-background': backgroundColor || customBackgroundColor,
@@ -25872,7 +25973,7 @@ const paragraph_deprecated_deprecated = [{
color: textClass ? undefined : customTextColor,
fontSize: fontSizeClass ? undefined : customFontSize
};
- 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: "p",
style: styles,
className: className ? className : undefined,
@@ -25883,7 +25984,7 @@ const paragraph_deprecated_deprecated = [{
}, {
supports,
- attributes: { ...Object(external_lodash_["omit"])(paragraph_deprecated_blockAttributes, ['style']),
+ attributes: { ...(0,external_lodash_namespaceObject.omit)(paragraph_deprecated_blockAttributes, ['style']),
customTextColor: {
type: 'string'
},
@@ -25912,9 +26013,9 @@ const paragraph_deprecated_deprecated = [{
customFontSize,
direction
} = attributes;
- const textClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor);
- const backgroundClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor);
- const fontSizeClass = Object(external_wp_blockEditor_["getFontSizeClass"])(fontSize);
+ const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
+ const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
+ const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize);
const className = classnames_default()({
'has-text-color': textColor || customTextColor,
'has-background': backgroundColor || customBackgroundColor,
@@ -25929,7 +26030,7 @@ const paragraph_deprecated_deprecated = [{
fontSize: fontSizeClass ? undefined : customFontSize,
textAlign: align
};
- 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: "p",
style: styles,
className: className ? className : undefined,
@@ -25940,7 +26041,7 @@ const paragraph_deprecated_deprecated = [{
}, {
supports,
- attributes: { ...Object(external_lodash_["omit"])(paragraph_deprecated_blockAttributes, ['style']),
+ attributes: { ...(0,external_lodash_namespaceObject.omit)(paragraph_deprecated_blockAttributes, ['style']),
customTextColor: {
type: 'string'
},
@@ -25972,8 +26073,8 @@ const paragraph_deprecated_deprecated = [{
fontSize,
customFontSize
} = 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 fontSizeClass = fontSize && `is-${fontSize}-text`;
const className = classnames_default()({
[`align${width}`]: width,
@@ -25989,7 +26090,7 @@ const paragraph_deprecated_deprecated = [{
fontSize: fontSizeClass ? undefined : customFontSize,
textAlign: align
};
- 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: "p",
style: styles,
className: className ? className : undefined,
@@ -25999,7 +26100,7 @@ const paragraph_deprecated_deprecated = [{
}, {
supports,
- attributes: Object(external_lodash_["omit"])({ ...paragraph_deprecated_blockAttributes,
+ attributes: (0,external_lodash_namespaceObject.omit)({ ...paragraph_deprecated_blockAttributes,
fontSize: {
type: 'number'
}
@@ -26029,15 +26130,15 @@ const paragraph_deprecated_deprecated = [{
fontSize,
textAlign: align
};
- return Object(external_wp_element_["createElement"])("p", {
+ return (0,external_wp_element_namespaceObject.createElement)("p", {
style: styles,
className: className ? className : undefined
}, content);
},
migrate(attributes) {
- return migrateCustomColorsAndFontSizes(Object(external_lodash_["omit"])({ ...attributes,
- customFontSize: Object(external_lodash_["isFinite"])(attributes.fontSize) ? attributes.fontSize : undefined,
+ return migrateCustomColorsAndFontSizes((0,external_lodash_namespaceObject.omit)({ ...attributes,
+ customFontSize: (0,external_lodash_namespaceObject.isFinite)(attributes.fontSize) ? attributes.fontSize : undefined,
customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined,
customBackgroundColor: attributes.backgroundColor && '#' === attributes.backgroundColor[0] ? attributes.backgroundColor : undefined
}), ['fontSize', 'textColor', 'backgroundColor', 'style']);
@@ -26057,7 +26158,7 @@ const paragraph_deprecated_deprecated = [{
let {
attributes
} = _ref5;
- return Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, attributes.content);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.content);
},
migrate(attributes) {
@@ -26067,22 +26168,22 @@ const paragraph_deprecated_deprecated = [{
}];
/* harmony default export */ var paragraph_deprecated = (paragraph_deprecated_deprecated);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-ltr.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/format-ltr.js
/**
* WordPress dependencies
*/
-const formatLtr = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const formatLtr = (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: "M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z"
}));
/* harmony default export */ var format_ltr = (formatLtr);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/edit.js
@@ -26106,10 +26207,10 @@ function ParagraphRTLControl(_ref) {
direction,
setDirection
} = _ref;
- return Object(external_wp_i18n_["isRTL"])() && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarDropdownMenu"], {
+ return (0,external_wp_i18n_namespaceObject.isRTL)() && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
controls: [{
icon: format_ltr,
- title: Object(external_wp_i18n_["_x"])('Left to right', 'editor button'),
+ title: (0,external_wp_i18n_namespaceObject._x)('Left to right', 'editor button'),
isActive: direction === 'ltr',
onClick() {
@@ -26136,8 +26237,8 @@ function ParagraphBlock(_ref2) {
dropCap,
placeholder
} = attributes;
- const isDropCapFeatureEnabled = Object(external_wp_blockEditor_["useSetting"])('typography.dropCap');
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const isDropCapFeatureEnabled = (0,external_wp_blockEditor_namespaceObject.useSetting)('typography.dropCap');
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
'has-drop-cap': dropCap,
[`has-text-align-${align}`]: align
@@ -26146,28 +26247,28 @@ function ParagraphBlock(_ref2) {
direction
}
});
- 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: "block"
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["AlignmentControl"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: align,
onChange: newAlign => setAttributes({
align: newAlign
})
- }), Object(external_wp_element_["createElement"])(ParagraphRTLControl, {
+ }), (0,external_wp_element_namespaceObject.createElement)(ParagraphRTLControl, {
direction: direction,
setDirection: newDirection => setAttributes({
direction: newDirection
})
- })), isDropCapFeatureEnabled && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Text settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Drop cap'),
+ })), isDropCapFeatureEnabled && (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.__)('Text settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Drop cap'),
checked: !!dropCap,
onChange: () => setAttributes({
dropCap: !dropCap
}),
- help: dropCap ? Object(external_wp_i18n_["__"])('Showing large initial letter.') : Object(external_wp_i18n_["__"])('Toggle to show a large initial letter.')
- }))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], Object(esm_extends["a" /* default */])({
+ help: dropCap ? (0,external_wp_i18n_namespaceObject.__)('Showing large initial letter.') : (0,external_wp_i18n_namespaceObject.__)('Toggle to show a large initial letter.')
+ }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
identifier: "content",
tagName: "p"
}, blockProps, {
@@ -26184,7 +26285,7 @@ function ParagraphBlock(_ref2) {
};
}
- const block = Object(external_wp_blocks_["createBlock"])(paragraph_edit_name, newAttributes);
+ const block = (0,external_wp_blocks_namespaceObject.createBlock)(paragraph_edit_name, newAttributes);
if (isOriginal) {
block.clientId = clientId;
@@ -26195,9 +26296,9 @@ function ParagraphBlock(_ref2) {
onMerge: mergeBlocks,
onReplace: onReplace,
onRemove: onRemove,
- "aria-label": content ? Object(external_wp_i18n_["__"])('Paragraph block') : Object(external_wp_i18n_["__"])('Empty block; start writing or type forward slash to choose a block'),
+ "aria-label": content ? (0,external_wp_i18n_namespaceObject.__)('Paragraph block') : (0,external_wp_i18n_namespaceObject.__)('Empty block; start writing or type forward slash to choose a block'),
"data-empty": content ? false : true,
- placeholder: placeholder || Object(external_wp_i18n_["__"])('Type / to choose a block'),
+ placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Type / to choose a block'),
__unstableEmbedURLOnPaste: true,
__unstableAllowPrefixTransformations: true
})));
@@ -26205,7 +26306,7 @@ function ParagraphBlock(_ref2) {
/* harmony default export */ var paragraph_edit = (ParagraphBlock);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/save.js
/**
@@ -26231,15 +26332,15 @@ function paragraph_save_save(_ref) {
'has-drop-cap': dropCap,
[`has-text-align-${align}`]: align
});
- return Object(external_wp_element_["createElement"])("p", external_wp_blockEditor_["useBlockProps"].save({
+ return (0,external_wp_element_namespaceObject.createElement)("p", external_wp_blockEditor_namespaceObject.useBlockProps.save({
className,
dir: direction
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: content
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/transforms.js
/**
* WordPress dependencies
*/
@@ -26324,7 +26425,7 @@ const paragraph_transforms_transforms = {
},
transform(node) {
- const attributes = Object(external_wp_blocks_["getBlockAttributes"])(paragraph_transforms_name, node.outerHTML);
+ const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(paragraph_transforms_name, node.outerHTML);
const {
textAlign
} = node.style || {};
@@ -26333,14 +26434,14 @@ const paragraph_transforms_transforms = {
attributes.align = textAlign;
}
- return Object(external_wp_blocks_["createBlock"])(paragraph_transforms_name, attributes);
+ return (0,external_wp_blocks_namespaceObject.createBlock)(paragraph_transforms_name, attributes);
}
}]
};
/* harmony default export */ var paragraph_transforms = (paragraph_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js
/**
* External dependencies
*/
@@ -26421,7 +26522,7 @@ const paragraph_settings = {
icon: library_paragraph,
example: {
attributes: {
- content: Object(external_wp_i18n_["__"])('In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'),
+ content: (0,external_wp_i18n_namespaceObject.__)('In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'),
style: {
typography: {
fontSize: 28
@@ -26440,7 +26541,7 @@ const paragraph_settings = {
const {
content
} = attributes;
- return Object(external_lodash_["isEmpty"])(content) ? Object(external_wp_i18n_["__"])('Empty') : content;
+ return (0,external_lodash_namespaceObject.isEmpty)(content) ? (0,external_wp_i18n_namespaceObject.__)('Empty') : content;
}
},
@@ -26457,7 +26558,7 @@ const paragraph_settings = {
save: paragraph_save_save
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author/edit.js
/**
@@ -26491,14 +26592,14 @@ function PostAuthorEdit(_ref) {
authorId,
authorDetails,
authors
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getEditedEntityRecor;
const {
getEditedEntityRecord,
getUser,
getUsers
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
const _authorId = (_getEditedEntityRecor = getEditedEntityRecord('postType', postType, postId)) === null || _getEditedEntityRecor === void 0 ? void 0 : _getEditedEntityRecor.author;
@@ -26512,7 +26613,7 @@ function PostAuthorEdit(_ref) {
}, [postType, postId]);
const {
editEntityRecord
- } = Object(external_wp_data_["useDispatch"])(external_wp_coreData_["store"]);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const {
textAlign,
showAvatar,
@@ -26522,7 +26623,7 @@ function PostAuthorEdit(_ref) {
const avatarSizes = [];
if (authorDetails) {
- Object(external_lodash_["forEach"])(authorDetails.avatar_urls, (url, size) => {
+ (0,external_lodash_namespaceObject.forEach)(authorDetails.avatar_urls, (url, size) => {
avatarSizes.push({
value: size,
label: `${size} x ${size}`
@@ -26530,15 +26631,15 @@ function PostAuthorEdit(_ref) {
});
}
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
})
});
- 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_["__"])('Author Settings')
- }, !isDescendentOfQueryLoop && !!(authors !== null && authors !== void 0 && authors.length) && Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], {
- label: Object(external_wp_i18n_["__"])('Author'),
+ 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.__)('Author Settings')
+ }, !isDescendentOfQueryLoop && !!(authors !== null && authors !== void 0 && authors.length) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Author'),
value: authorId,
options: authors.map(_ref2 => {
let {
@@ -26555,14 +26656,14 @@ function PostAuthorEdit(_ref) {
author: nextAuthorId
});
}
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Show avatar'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Show avatar'),
checked: showAvatar,
onChange: () => setAttributes({
showAvatar: !showAvatar
})
- }), showAvatar && Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], {
- label: Object(external_wp_i18n_["__"])('Avatar size'),
+ }), showAvatar && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Avatar size'),
value: attributes.avatarSize,
options: avatarSizes,
onChange: size => {
@@ -26570,65 +26671,65 @@ function PostAuthorEdit(_ref) {
avatarSize: Number(size)
});
}
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Show bio'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Show bio'),
checked: showBio,
onChange: () => setAttributes({
showBio: !showBio
})
- }))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], {
+ }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "block"
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["AlignmentControl"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
textAlign: nextAlign
});
}
- })), Object(external_wp_element_["createElement"])("div", blockProps, showAvatar && authorDetails && Object(external_wp_element_["createElement"])("div", {
+ })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, showAvatar && authorDetails && (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-post-author__avatar"
- }, Object(external_wp_element_["createElement"])("img", {
+ }, (0,external_wp_element_namespaceObject.createElement)("img", {
width: attributes.avatarSize,
src: authorDetails.avatar_urls[attributes.avatarSize],
alt: authorDetails.name
- })), Object(external_wp_element_["createElement"])("div", {
+ })), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-post-author__content"
- }, (!external_wp_blockEditor_["RichText"].isEmpty(byline) || isSelected) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ }, (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(byline) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
className: "wp-block-post-author__byline",
multiline: false,
- "aria-label": Object(external_wp_i18n_["__"])('Post author byline text'),
- placeholder: Object(external_wp_i18n_["__"])('Write byline…'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Post author byline text'),
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('Write byline…'),
value: byline,
onChange: value => setAttributes({
byline: value
})
- }), Object(external_wp_element_["createElement"])("p", {
+ }), (0,external_wp_element_namespaceObject.createElement)("p", {
className: "wp-block-post-author__name"
- }, (authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.name) || Object(external_wp_i18n_["__"])('Post Author')), showBio && Object(external_wp_element_["createElement"])("p", {
+ }, (authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.name) || (0,external_wp_i18n_namespaceObject.__)('Post Author')), showBio && (0,external_wp_element_namespaceObject.createElement)("p", {
className: "wp-block-post-author__bio"
}, authorDetails === null || authorDetails === void 0 ? void 0 : authorDetails.description))));
}
/* harmony default export */ var post_author_edit = (PostAuthorEdit);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-author.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-author.js
/**
* WordPress dependencies
*/
-const postAuthor = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const postAuthor = (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: "M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z",
fillRule: "evenodd",
clipRule: "evenodd"
}));
/* harmony default export */ var post_author = (postAuthor);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-author/index.js
/**
* Internal dependencies
*/
@@ -26700,22 +26801,22 @@ const post_author_settings = {
edit: post_author_edit
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-comments.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-comments.js
/**
* WordPress dependencies
*/
-const postComments = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const postComments = (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: "M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z"
}));
/* harmony default export */ var post_comments = (postComments);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments/edit.js
/**
@@ -26736,15 +26837,15 @@ function PostCommentsDisplay(_ref) {
let {
postId
} = _ref;
- return Object(external_wp_data_["useSelect"])(select => {
- const comments = select(external_wp_coreData_["store"]).getEntityRecords('root', 'comment', {
+ return (0,external_wp_data_namespaceObject.useSelect)(select => {
+ const comments = select(external_wp_coreData_namespaceObject.store).getEntityRecords('root', 'comment', {
post: postId
}); // TODO: "No Comments" placeholder should be editable.
- return comments && comments.length ? comments.map(comment => Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], {
+ return comments && comments.length ? comments.map(comment => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, {
className: "wp-block-post-comments__comment",
key: comment.id
- }, comment.content.rendered)) : Object(external_wp_i18n_["__"])('No comments.');
+ }, comment.content.rendered)) : (0,external_wp_i18n_namespaceObject.__)('No comments.');
}, [postId]);
}
@@ -26761,31 +26862,31 @@ function PostCommentsEdit(_ref2) {
const {
textAlign
} = attributes;
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
})
});
if (!postType || !postId) {
- return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], null, Object(external_wp_i18n_["__"])('Post comments block: no post found.')));
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Post comments block: no post found.')));
}
- 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: "block"
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["AlignmentControl"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
textAlign: nextAlign
});
}
- })), Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(PostCommentsDisplay, {
+ })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(PostCommentsDisplay, {
postId: postId
})));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-comments/index.js
/**
* WordPress dependencies
*/
@@ -26838,22 +26939,22 @@ const post_comments_settings = {
edit: PostCommentsEdit
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-content.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-content.js
/**
* WordPress dependencies
*/
-const postContent = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const postContent = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "https://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: "M4 20h16v-1.5H4V20zm0-4.8h16v-1.5H4v1.5zm0-6.4v1.5h16V8.8H4zM16 4H4v1.5h12V4z"
}));
/* harmony default export */ var post_content = (postContent);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/hooks.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/utils/hooks.js
/**
* WordPress dependencies
*/
@@ -26868,13 +26969,13 @@ const postContent = Object(external_wp_element_["createElement"])(external_wp_pr
*/
function useCanEditEntity(kind, name, recordId) {
- return Object(external_wp_data_["useSelect"])(select => select(external_wp_coreData_["store"]).canUserEditEntityRecord(kind, name, recordId), [kind, name, recordId]);
+ return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).canUserEditEntityRecord(kind, name, recordId), [kind, name, recordId]);
}
/* harmony default export */ var hooks = ({
useCanEditEntity
});
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-content/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-content/edit.js
/**
@@ -26897,9 +26998,9 @@ function ReadOnlyContent(_ref) {
postType,
postId
} = _ref;
- const [,, content] = Object(external_wp_coreData_["useEntityProp"])('postType', postType, 'content', postId);
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])();
- return content !== null && content !== void 0 && content.protected && !userCanEdit ? Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], null, Object(external_wp_i18n_["__"])('This content is password protected.'))) : Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], {
+ const [,, content] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'content', postId);
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
+ return content !== null && content !== void 0 && content.protected && !userCanEdit ? (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('This content is password protected.'))) : (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, {
key: "html"
}, content === null || content === void 0 ? void 0 : content.rendered));
}
@@ -26913,20 +27014,20 @@ function EditableContent(_ref2) {
postType,
postId
} = context;
- const themeSupportsLayout = Object(external_wp_data_["useSelect"])(select => {
+ const themeSupportsLayout = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getSettings;
const {
getSettings
- } = select(external_wp_blockEditor_["store"]);
+ } = select(external_wp_blockEditor_namespaceObject.store);
return (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout;
}, []);
- const defaultLayout = Object(external_wp_blockEditor_["useSetting"])('layout') || {};
+ const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
- const [blocks, onInput, onChange] = Object(external_wp_coreData_["useEntityBlockEditor"])('postType', postType, {
+ const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType, {
id: postId
});
- const props = Object(external_wp_blockEditor_["useInnerBlocksProps"])(Object(external_wp_blockEditor_["useBlockProps"])({
+ const props = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)((0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: 'entry-content'
}), {
value: blocks,
@@ -26934,7 +27035,7 @@ function EditableContent(_ref2) {
onChange,
__experimentalLayout: themeSupportsLayout ? usedLayout : undefined
});
- return Object(external_wp_element_["createElement"])("div", props);
+ return (0,external_wp_element_namespaceObject.createElement)("div", props);
}
function Content(props) {
@@ -26948,7 +27049,7 @@ function Content(props) {
const isDescendentOfQueryLoop = Number.isFinite(queryId);
const userCanEdit = useCanEditEntity('postType', postType, postId);
const isEditable = userCanEdit && !isDescendentOfQueryLoop;
- return isEditable ? Object(external_wp_element_["createElement"])(EditableContent, props) : Object(external_wp_element_["createElement"])(ReadOnlyContent, {
+ return isEditable ? (0,external_wp_element_namespaceObject.createElement)(EditableContent, props) : (0,external_wp_element_namespaceObject.createElement)(ReadOnlyContent, {
userCanEdit: userCanEdit,
postType: postType,
postId: postId
@@ -26956,13 +27057,13 @@ function Content(props) {
}
function edit_Placeholder() {
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])();
- return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])("p", null, Object(external_wp_i18n_["__"])('Post Content')));
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_i18n_namespaceObject.__)('Post Content')));
}
function RecursionError() {
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])();
- return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], null, Object(external_wp_i18n_["__"])('Block cannot be rendered inside itself.')));
+ 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.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
}
function PostContentEdit(_ref3) {
@@ -26977,19 +27078,19 @@ function PostContentEdit(_ref3) {
const {
layout = {}
} = attributes;
- const [hasAlreadyRendered, RecursionProvider] = Object(external_wp_blockEditor_["__experimentalUseNoRecursiveRenders"])(contextPostId);
+ const [hasAlreadyRendered, RecursionProvider] = (0,external_wp_blockEditor_namespaceObject.__experimentalUseNoRecursiveRenders)(contextPostId);
if (contextPostId && contextPostType && hasAlreadyRendered) {
- return Object(external_wp_element_["createElement"])(RecursionError, null);
+ return (0,external_wp_element_namespaceObject.createElement)(RecursionError, null);
}
- return Object(external_wp_element_["createElement"])(RecursionProvider, null, contextPostId && contextPostType ? Object(external_wp_element_["createElement"])(Content, {
+ return (0,external_wp_element_namespaceObject.createElement)(RecursionProvider, null, contextPostId && contextPostType ? (0,external_wp_element_namespaceObject.createElement)(Content, {
context: context,
layout: layout
- }) : Object(external_wp_element_["createElement"])(edit_Placeholder, null));
+ }) : (0,external_wp_element_namespaceObject.createElement)(edit_Placeholder, null));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-content/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-content/index.js
/**
* WordPress dependencies
*/
@@ -27023,24 +27124,24 @@ const post_content_settings = {
edit: PostContentEdit
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-date.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-date.js
/**
* WordPress dependencies
*/
-const post_date_postDate = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const postDate = (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.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"
-}), Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"
}));
-/* harmony default export */ var post_date = (post_date_postDate);
+/* harmony default export */ var post_date = (postDate);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/edit.js
/**
@@ -27074,10 +27175,10 @@ function PostDateEdit(_ref) {
setAttributes
} = _ref;
const isDescendentOfQueryLoop = Number.isFinite(queryId);
- const [siteFormat] = Object(external_wp_coreData_["useEntityProp"])('root', 'site', 'date_format');
- const [date, setDate] = Object(external_wp_coreData_["useEntityProp"])('postType', postType, 'date', postId);
+ const [siteFormat] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format');
+ const [date, setDate] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'date', postId);
- const settings = Object(external_wp_date_["__experimentalGetSettings"])(); // To know if the current time format is a 12 hour time, look for "a".
+ const settings = (0,external_wp_date_namespaceObject.__experimentalGetSettings)(); // To know if the current time format is a 12 hour time, look for "a".
// Also make sure this "a" is not escaped by a "/".
@@ -27087,41 +27188,41 @@ function PostDateEdit(_ref) {
);
const formatOptions = Object.values(settings.formats).map(formatOption => ({
key: formatOption,
- name: Object(external_wp_date_["dateI18n"])(formatOption, date)
+ name: (0,external_wp_date_namespaceObject.dateI18n)(formatOption, date)
}));
const resolvedFormat = format || siteFormat || settings.formats.date;
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
})
});
- const timeRef = Object(external_wp_element_["useRef"])();
- let postDate = date ? Object(external_wp_element_["createElement"])("time", {
- dateTime: Object(external_wp_date_["dateI18n"])('c', date),
+ const timeRef = (0,external_wp_element_namespaceObject.useRef)();
+ let postDate = date ? (0,external_wp_element_namespaceObject.createElement)("time", {
+ dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date),
ref: timeRef
- }, Object(external_wp_date_["dateI18n"])(resolvedFormat, date)) : Object(external_wp_i18n_["__"])('Post Date');
+ }, (0,external_wp_date_namespaceObject.dateI18n)(resolvedFormat, date)) : (0,external_wp_i18n_namespaceObject.__)('Post Date');
if (isLink && date) {
- postDate = Object(external_wp_element_["createElement"])("a", {
+ postDate = (0,external_wp_element_namespaceObject.createElement)("a", {
href: "#post-date-pseudo-link",
onClick: event => event.preventDefault()
}, postDate);
}
- 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: "block"
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["AlignmentControl"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
textAlign: nextAlign
});
}
- }), date && !isDescendentOfQueryLoop && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], {
+ }), date && !isDescendentOfQueryLoop && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
popoverProps: {
anchorRef: timeRef.current
},
- renderContent: () => Object(external_wp_element_["createElement"])(external_wp_components_["DateTimePicker"], {
+ renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DateTimePicker, {
currentDate: date,
onChange: setDate,
is12Hour: is12Hour
@@ -27133,25 +27234,25 @@ function PostDateEdit(_ref) {
} = _ref2;
const openOnArrowDown = event => {
- if (!isOpen && event.keyCode === external_wp_keycodes_["DOWN"]) {
+ if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) {
event.preventDefault();
onToggle();
}
};
- return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
"aria-expanded": isOpen,
- icon: library_edit["a" /* default */],
- title: Object(external_wp_i18n_["__"])('Change Date'),
+ icon: library_edit,
+ title: (0,external_wp_i18n_namespaceObject.__)('Change Date'),
onClick: onToggle,
onKeyDown: openOnArrowDown
});
}
- }))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Format settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["CustomSelectControl"], {
+ }))), (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.__)('Format settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CustomSelectControl, {
hideLabelFromVision: true,
- label: Object(external_wp_i18n_["__"])('Date Format'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Date Format'),
options: formatOptions,
onChange: _ref3 => {
let {
@@ -27162,19 +27263,19 @@ function PostDateEdit(_ref) {
});
},
value: formatOptions.find(option => option.key === resolvedFormat)
- })), Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Link settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["sprintf"])( // translators: %s: Name of the post type e.g: "post".
- Object(external_wp_i18n_["__"])('Link to %s'), postType),
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
+ title: (0,external_wp_i18n_namespaceObject.__)('Link settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "post".
+ (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType),
onChange: () => setAttributes({
isLink: !isLink
}),
checked: isLink
- }))), Object(external_wp_element_["createElement"])("div", blockProps, postDate));
+ }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, postDate));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/deprecated.js
/**
* Internal dependencies
*/
@@ -27236,7 +27337,7 @@ const post_date_deprecated_v1 = {
/* harmony default export */ var post_date_deprecated = ([post_date_deprecated_v1]);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-date/index.js
/**
* WordPress dependencies
*/
@@ -27297,22 +27398,22 @@ const post_date_settings = {
deprecated: post_date_deprecated
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-excerpt.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-excerpt.js
/**
* WordPress dependencies
*/
-const post_excerpt_postExcerpt = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const postExcerpt = (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: "M12.75 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.395.395 0 00.199-.166c.05-.083.114-.253.114-.584V7.2H8.8V4h3.95v5.333zM7.95 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.394.394 0 00.198-.166c.05-.083.115-.253.115-.584V7.2H4V4h3.95v5.333zM13 20H4v-1.5h9V20zM20 16H4v-1.5h16V16z"
}));
-/* harmony default export */ var post_excerpt = (post_excerpt_postExcerpt);
+/* harmony default export */ var post_excerpt = (postExcerpt);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/edit.js
/**
@@ -27354,8 +27455,8 @@ function PostExcerptEditor(_ref) {
const [rawExcerpt, setExcerpt, {
rendered: renderedExcerpt,
protected: isProtected
- } = {}] = Object(external_wp_coreData_["useEntityProp"])('postType', postType, 'excerpt', postId);
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ } = {}] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'excerpt', postId);
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
})
@@ -27366,58 +27467,58 @@ function PostExcerptEditor(_ref) {
* excerpt has been produced from the content.
*/
- const strippedRenderedExcerpt = Object(external_wp_element_["useMemo"])(() => {
+ const strippedRenderedExcerpt = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!renderedExcerpt) return '';
const document = new window.DOMParser().parseFromString(renderedExcerpt, 'text/html');
return document.body.textContent || document.body.innerText || '';
}, [renderedExcerpt]);
if (!postType || !postId) {
- return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_i18n_["__"])('Post Excerpt'));
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_i18n_namespaceObject.__)('Post Excerpt'));
}
if (isProtected && !userCanEdit) {
- return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], null, Object(external_wp_i18n_["__"])('There is no excerpt because this is a protected post.')));
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('There is no excerpt because this is a protected post.')));
}
- const readMoreLink = Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ const readMoreLink = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
className: "wp-block-post-excerpt__more-link",
tagName: "a",
- "aria-label": Object(external_wp_i18n_["__"])('"Read more" link text'),
- placeholder: Object(external_wp_i18n_["__"])('Add "read more" link text'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('"Read more" link text'),
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('Add "read more" link text'),
value: moreText,
onChange: newMoreText => setAttributes({
moreText: newMoreText
}),
withoutInteractiveFormatting: true
});
- const excerptContent = isEditable ? Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ const excerptContent = isEditable ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
className: !showMoreOnNewLine && 'wp-block-post-excerpt__excerpt is-inline',
- "aria-label": Object(external_wp_i18n_["__"])('Post excerpt text'),
- value: rawExcerpt || strippedRenderedExcerpt || (isSelected ? '' : Object(external_wp_i18n_["__"])('No post excerpt found')),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Post excerpt text'),
+ value: rawExcerpt || strippedRenderedExcerpt || (isSelected ? '' : (0,external_wp_i18n_namespaceObject.__)('No post excerpt found')),
onChange: setExcerpt
- }) : renderedExcerpt && Object(external_wp_element_["createElement"])(external_wp_components_["Disabled"], null, Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], {
+ }) : renderedExcerpt && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Disabled, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, {
key: "html"
- }, renderedExcerpt)) || Object(external_wp_i18n_["__"])('No post excerpt found');
- 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_["AlignmentToolbar"], {
+ }, renderedExcerpt)) || (0,external_wp_i18n_namespaceObject.__)('No post excerpt found');
+ 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.AlignmentToolbar, {
value: textAlign,
onChange: newAlign => setAttributes({
textAlign: newAlign
})
- })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Post Excerpt Settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Show link on new line'),
+ })), (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.__)('Post Excerpt Settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Show link on new line'),
checked: showMoreOnNewLine,
onChange: newShowMoreOnNewLine => setAttributes({
showMoreOnNewLine: newShowMoreOnNewLine
})
- }))), Object(external_wp_element_["createElement"])("div", blockProps, excerptContent, !showMoreOnNewLine && ' ', showMoreOnNewLine ? Object(external_wp_element_["createElement"])("p", {
+ }))), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, excerptContent, !showMoreOnNewLine && ' ', showMoreOnNewLine ? (0,external_wp_element_namespaceObject.createElement)("p", {
className: "wp-block-post-excerpt__more-text"
}, readMoreLink) : readMoreLink));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js
/**
* WordPress dependencies
*/
@@ -27481,22 +27582,22 @@ const post_excerpt_settings = {
edit: PostExcerptEditor
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-featured-image.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-featured-image.js
/**
* WordPress dependencies
*/
-const postFeaturedImage = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const postFeaturedImage = (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 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"
}));
/* harmony default export */ var post_featured_image = (postFeaturedImage);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/dimension-controls.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/dimension-controls.js
/**
@@ -27505,21 +27606,21 @@ const postFeaturedImage = Object(external_wp_element_["createElement"])(external
-const SCALE_OPTIONS = Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToggleGroupControlOption"], {
+const SCALE_OPTIONS = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "cover",
- label: Object(external_wp_i18n_["_x"])('Cover', 'Scale option for Image dimension control')
-}), Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToggleGroupControlOption"], {
+ label: (0,external_wp_i18n_namespaceObject._x)('Cover', 'Scale option for Image dimension control')
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "contain",
- label: Object(external_wp_i18n_["_x"])('Contain', 'Scale option for Image dimension control')
-}), Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToggleGroupControlOption"], {
+ label: (0,external_wp_i18n_namespaceObject._x)('Contain', 'Scale option for Image dimension control')
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "fill",
- label: Object(external_wp_i18n_["_x"])('Fill', 'Scale option for Image dimension control')
+ label: (0,external_wp_i18n_namespaceObject._x)('Fill', 'Scale option for Image dimension control')
}));
const DEFAULT_SCALE = 'cover';
const scaleHelp = {
- cover: Object(external_wp_i18n_["__"])('Image is scaled and cropped to fill the entire space without being distorted.'),
- contain: Object(external_wp_i18n_["__"])('Image is scaled to fill the space without clipping nor distorting.'),
- fill: Object(external_wp_i18n_["__"])('Image will be stretched and distorted to completely fill the space.')
+ cover: (0,external_wp_i18n_namespaceObject.__)('Image is scaled and cropped to fill the entire space without being distorted.'),
+ contain: (0,external_wp_i18n_namespaceObject.__)('Image is scaled to fill the space without clipping nor distorting.'),
+ fill: (0,external_wp_i18n_namespaceObject.__)('Image will be stretched and distorted to completely fill the space.')
};
const DimensionControls = _ref => {
@@ -27533,8 +27634,8 @@ const DimensionControls = _ref => {
setAttributes
} = _ref;
const defaultUnits = ['px', '%', 'vw', 'em', 'rem'];
- const units = Object(external_wp_components_["__experimentalUseCustomUnits"])({
- availableUnits: Object(external_wp_blockEditor_["useSetting"])('spacing.units') || defaultUnits
+ const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
+ availableUnits: (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || defaultUnits
});
const onDimensionChange = (dimension, nextValue) => {
@@ -27551,14 +27652,14 @@ const DimensionControls = _ref => {
});
};
- const scaleLabel = Object(external_wp_i18n_["_x"])('Scale', 'Image scaling options');
+ const scaleLabel = (0,external_wp_i18n_namespaceObject._x)('Scale', 'Image scaling options');
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], {
+ return (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, {
className: "single-column",
hasValue: () => !!height,
- label: Object(external_wp_i18n_["__"])('Height'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Height'),
onDeselect: () => setAttributes({
height: undefined
}),
@@ -27567,17 +27668,17 @@ const DimensionControls = _ref => {
}),
isShownByDefault: true,
panelId: clientId
- }, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalUnitControl"], {
- label: Object(external_wp_i18n_["__"])('Height'),
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Height'),
labelPosition: "top",
value: height || '',
min: 0,
onChange: nextHeight => onDimensionChange('height', nextHeight),
units: units
- })), Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToolsPanelItem"], {
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
className: "single-column",
hasValue: () => !!width,
- label: Object(external_wp_i18n_["__"])('Width'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Width'),
onDeselect: () => setAttributes({
width: undefined
}),
@@ -27586,14 +27687,14 @@ const DimensionControls = _ref => {
}),
isShownByDefault: true,
panelId: clientId
- }, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalUnitControl"], {
- label: Object(external_wp_i18n_["__"])('Width'),
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Width'),
labelPosition: "top",
value: width || '',
min: 0,
onChange: nextWidth => onDimensionChange('width', nextWidth),
units: units
- })), !!height && Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToolsPanelItem"], {
+ })), !!height && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
hasValue: () => !!scale && scale !== DEFAULT_SCALE,
label: scaleLabel,
onDeselect: () => setAttributes({
@@ -27604,7 +27705,7 @@ const DimensionControls = _ref => {
}),
isShownByDefault: true,
panelId: clientId
- }, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToggleGroupControl"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
label: scaleLabel,
value: scale,
help: scaleHelp[scale],
@@ -27617,7 +27718,7 @@ const DimensionControls = _ref => {
/* harmony default export */ var dimension_controls = (DimensionControls);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/edit.js
/**
@@ -27636,18 +27737,18 @@ const DimensionControls = _ref => {
*/
-const placeholderIllustration = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const placeholderIllustration = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
className: "components-placeholder__illustration",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 60 60",
preserveAspectRatio: "none"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
vectorEffect: "non-scaling-stroke",
d: "M60 60 0 0"
}));
const post_featured_image_edit_ALLOWED_MEDIA_TYPES = ['image'];
-const placeholderChip = Object(external_wp_element_["createElement"])("div", {
+const placeholderChip = (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-post-featured-image__placeholder"
}, placeholderIllustration);
@@ -27669,11 +27770,11 @@ function PostFeaturedImageDisplay(_ref) {
width,
scale
} = attributes;
- const [featuredImage, setFeaturedImage] = Object(external_wp_coreData_["useEntityProp"])('postType', postType, 'featured_media', postId);
- const media = Object(external_wp_data_["useSelect"])(select => featuredImage && select(external_wp_coreData_["store"]).getMedia(featuredImage, {
+ const [featuredImage, setFeaturedImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'featured_media', postId);
+ const media = (0,external_wp_data_namespaceObject.useSelect)(select => featuredImage && select(external_wp_coreData_namespaceObject.store).getMedia(featuredImage, {
context: 'view'
}), [featuredImage]);
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
style: {
width,
height
@@ -27681,7 +27782,7 @@ function PostFeaturedImageDisplay(_ref) {
});
const placeholder = content => {
- return Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
className: "block-editor-media-placeholder"
}, placeholderIllustration, content);
};
@@ -27694,7 +27795,7 @@ function PostFeaturedImageDisplay(_ref) {
const {
createErrorNotice
- } = Object(external_wp_data_["useDispatch"])(external_wp_notices_["store"]);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const onUploadError = message => {
createErrorNotice(message[2], {
@@ -27705,13 +27806,13 @@ function PostFeaturedImageDisplay(_ref) {
let image;
if (!featuredImage && isDescendentOfQueryLoop) {
- return Object(external_wp_element_["createElement"])("div", blockProps, placeholderChip);
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, placeholderChip);
}
- const label = Object(external_wp_i18n_["__"])('Add a featured image');
+ const label = (0,external_wp_i18n_namespaceObject.__)('Add a featured image');
if (!featuredImage) {
- image = Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaPlaceholder"], {
+ image = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
onSelect: onSelectImage,
accept: "image/*",
allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES,
@@ -27721,8 +27822,8 @@ function PostFeaturedImageDisplay(_ref) {
let {
open
} = _ref2;
- return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
- icon: upload["a" /* default */],
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
+ icon: library_upload,
variant: "primary",
label: label,
showTooltip: true,
@@ -27735,9 +27836,9 @@ function PostFeaturedImageDisplay(_ref) {
});
} else {
// We have a Featured image so show a Placeholder if is loading.
- image = !media ? placeholderChip : Object(external_wp_element_["createElement"])("img", {
+ image = !media ? placeholderChip : (0,external_wp_element_namespaceObject.createElement)("img", {
src: media.source_url,
- alt: media.alt_text || Object(external_wp_i18n_["__"])('Featured image'),
+ alt: media.alt_text || (0,external_wp_i18n_namespaceObject.__)('Featured image'),
style: {
height,
objectFit: height && scale
@@ -27745,44 +27846,44 @@ function PostFeaturedImageDisplay(_ref) {
});
}
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(dimension_controls, {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(dimension_controls, {
clientId: clientId,
attributes: attributes,
setAttributes: setAttributes
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Link settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["sprintf"])( // translators: %s: Name of the post type e.g: "post".
- Object(external_wp_i18n_["__"])('Link to %s'), postType),
+ }), (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.__)('Link settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "post".
+ (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType),
onChange: () => setAttributes({
isLink: !isLink
}),
checked: isLink
- }))), !!media && !isDescendentOfQueryLoop && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], {
+ }))), !!media && !isDescendentOfQueryLoop && (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: featuredImage,
mediaURL: media.source_url,
allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES,
accept: "image/*",
onSelect: onSelectImage,
onError: onUploadError
- })), Object(external_wp_element_["createElement"])("figure", blockProps, image));
+ })), (0,external_wp_element_namespaceObject.createElement)("figure", blockProps, image));
}
function PostFeaturedImageEdit(props) {
var _props$context;
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])();
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
if (!((_props$context = props.context) !== null && _props$context !== void 0 && _props$context.postId)) {
- return Object(external_wp_element_["createElement"])("div", blockProps, placeholderChip);
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, placeholderChip);
}
- return Object(external_wp_element_["createElement"])(PostFeaturedImageDisplay, props);
+ return (0,external_wp_element_namespaceObject.createElement)(PostFeaturedImageDisplay, props);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js
/**
* WordPress dependencies
*/
@@ -27841,7 +27942,7 @@ const post_featured_image_settings = {
edit: PostFeaturedImageEdit
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/edit.js
/**
@@ -27867,40 +27968,40 @@ function PostNavigationLinkEdit(_ref) {
setAttributes
} = _ref;
const isNext = type === 'next';
- let placeholder = isNext ? Object(external_wp_i18n_["__"])('Next') : Object(external_wp_i18n_["__"])('Previous');
+ let placeholder = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next') : (0,external_wp_i18n_namespaceObject.__)('Previous');
if (showTitle) {
/* translators: Label before for next and previous post. There is a space after the colon. */
- placeholder = isNext ? Object(external_wp_i18n_["__"])('Next: ') : Object(external_wp_i18n_["__"])('Previous: ');
+ placeholder = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next: ') : (0,external_wp_i18n_namespaceObject.__)('Previous: ');
}
- const ariaLabel = isNext ? Object(external_wp_i18n_["__"])('Next post') : Object(external_wp_i18n_["__"])('Previous post');
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const ariaLabel = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next post') : (0,external_wp_i18n_namespaceObject.__)('Previous post');
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
})
});
- 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"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Display the title as a link'),
- help: Object(external_wp_i18n_["__"])('If you have entered a custom label, it will be prepended before the title.'),
+ 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, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Display the title as a link'),
+ help: (0,external_wp_i18n_namespaceObject.__)('If you have entered a custom label, it will be prepended before the title.'),
checked: !!showTitle,
onChange: () => setAttributes({
showTitle: !showTitle
})
- }), showTitle && Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Include the label as part of the link'),
+ }), showTitle && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Include the label as part of the link'),
checked: !!linkLabel,
onChange: () => setAttributes({
linkLabel: !linkLabel
})
- }))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["AlignmentToolbar"], {
+ }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
textAlign: nextAlign
});
}
- })), Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
tagName: "a",
"aria-label": ariaLabel,
placeholder: placeholder,
@@ -27909,43 +28010,43 @@ function PostNavigationLinkEdit(_ref) {
onChange: newLabel => setAttributes({
label: newLabel
})
- }), showTitle && Object(external_wp_element_["createElement"])("a", {
+ }), showTitle && (0,external_wp_element_namespaceObject.createElement)("a", {
href: "#post-navigation-pseudo-link",
onClick: event => event.preventDefault()
- }, Object(external_wp_i18n_["__"])('An example title'))));
+ }, (0,external_wp_i18n_namespaceObject.__)('An example title'))));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/next.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/next.js
/**
* WordPress dependencies
*/
-const next = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const next = (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: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"
}));
/* harmony default export */ var library_next = (next);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/previous.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/previous.js
/**
* WordPress dependencies
*/
-const previous = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const previous = (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.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"
}));
/* harmony default export */ var library_previous = (previous);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/variations.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/variations.js
/**
* WordPress dependencies
*/
@@ -27954,8 +28055,8 @@ const previous = Object(external_wp_element_["createElement"])(external_wp_primi
const post_navigation_link_variations_variations = [{
isDefault: true,
name: 'post-next',
- title: Object(external_wp_i18n_["__"])('Next post'),
- description: Object(external_wp_i18n_["__"])('Displays the post link that follows the current post.'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Next post'),
+ description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that follows the current post.'),
icon: library_next,
attributes: {
type: 'next'
@@ -27963,8 +28064,8 @@ const post_navigation_link_variations_variations = [{
scope: ['inserter', 'transform']
}, {
name: 'post-previous',
- title: Object(external_wp_i18n_["__"])('Previous post'),
- description: Object(external_wp_i18n_["__"])('Displays the post link that precedes the current post.'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Previous post'),
+ description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that precedes the current post.'),
icon: library_previous,
attributes: {
type: 'previous'
@@ -27984,7 +28085,7 @@ post_navigation_link_variations_variations.forEach(variation => {
});
/* harmony default export */ var post_navigation_link_variations = (post_navigation_link_variations_variations);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js
/**
* Internal dependencies
*/
@@ -28042,10 +28143,22 @@ const post_navigation_link_settings = {
variations: post_navigation_link_variations
};
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js
-var library_layout = __webpack_require__("Civd");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/layout.js
+
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/edit.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"
+}, (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 */ var library_layout = (layout);
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/edit.js
@@ -28066,10 +28179,10 @@ var library_layout = __webpack_require__("Civd");
const edit_TEMPLATE = [['core/post-title'], ['core/post-date'], ['core/post-excerpt']];
function PostTemplateInnerBlocks() {
- const innerBlocksProps = Object(external_wp_blockEditor_["useInnerBlocksProps"])({}, {
+ const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({}, {
template: edit_TEMPLATE
});
- return Object(external_wp_element_["createElement"])("li", innerBlocksProps);
+ return (0,external_wp_element_namespaceObject.createElement)("li", innerBlocksProps);
}
function PostTemplateBlockPreview(_ref) {
@@ -28079,7 +28192,7 @@ function PostTemplateBlockPreview(_ref) {
isHidden,
setActiveBlockContextId
} = _ref;
- const blockPreviewProps = Object(external_wp_blockEditor_["__experimentalUseBlockPreview"])({
+ const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({
blocks
});
@@ -28090,7 +28203,7 @@ function PostTemplateBlockPreview(_ref) {
const style = {
display: isHidden ? 'none' : undefined
};
- return Object(external_wp_element_["createElement"])("li", Object(esm_extends["a" /* default */])({}, blockPreviewProps, {
+ return (0,external_wp_element_namespaceObject.createElement)("li", _extends({}, blockPreviewProps, {
tabIndex: 0 // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
,
role: "button",
@@ -28100,7 +28213,7 @@ function PostTemplateBlockPreview(_ref) {
}));
}
-const MemoizedPostTemplateBlockPreview = Object(external_wp_element_["memo"])(PostTemplateBlockPreview);
+const MemoizedPostTemplateBlockPreview = (0,external_wp_element_namespaceObject.memo)(PostTemplateBlockPreview);
function PostTemplateEdit(_ref2) {
let {
clientId,
@@ -28132,17 +28245,17 @@ function PostTemplateEdit(_ref2) {
const [{
page
}] = queryContext;
- const [activeBlockContextId, setActiveBlockContextId] = Object(external_wp_element_["useState"])();
+ const [activeBlockContextId, setActiveBlockContextId] = (0,external_wp_element_namespaceObject.useState)();
const {
posts,
blocks
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getEntityRecords
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
const {
getBlocks
- } = select(external_wp_blockEditor_["store"]);
+ } = select(external_wp_blockEditor_namespaceObject.store);
const query = {
offset: perPage ? perPage * (page - 1) + offset : 0,
categories: categoryIds,
@@ -28188,12 +28301,12 @@ function PostTemplateEdit(_ref2) {
blocks: getBlocks(clientId)
};
}, [perPage, page, offset, categoryIds, tagIds, order, orderBy, clientId, author, search, postType, exclude, sticky, inherit, templateSlug]);
- const blockContexts = Object(external_wp_element_["useMemo"])(() => posts === null || posts === void 0 ? void 0 : posts.map(post => ({
+ const blockContexts = (0,external_wp_element_namespaceObject.useMemo)(() => posts === null || posts === void 0 ? void 0 : posts.map(post => ({
postType: post.type,
postId: post.id
})), [posts]);
const hasLayoutFlex = layoutType === 'flex' && columns > 1;
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
'is-flex-container': hasLayoutFlex,
[`columns-${columns}`]: hasLayoutFlex
@@ -28201,24 +28314,24 @@ function PostTemplateEdit(_ref2) {
});
if (!posts) {
- return Object(external_wp_element_["createElement"])("p", blockProps, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null));
+ return (0,external_wp_element_namespaceObject.createElement)("p", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
}
if (!posts.length) {
- return Object(external_wp_element_["createElement"])("p", blockProps, " ", Object(external_wp_i18n_["__"])('No results found.'));
+ return (0,external_wp_element_namespaceObject.createElement)("p", blockProps, " ", (0,external_wp_i18n_namespaceObject.__)('No results found.'));
} // To avoid flicker when switching active block contexts, a preview is rendered
// for each block context, but the preview for the active block context is hidden.
// This ensures that when it is displayed again, the cached rendering of the
// block preview is used, instead of having to re-render the preview from scratch.
- return Object(external_wp_element_["createElement"])("ul", blockProps, blockContexts && blockContexts.map(blockContext => {
+ return (0,external_wp_element_namespaceObject.createElement)("ul", blockProps, blockContexts && blockContexts.map(blockContext => {
var _blockContexts$, _blockContexts$2;
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockContextProvider"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockContextProvider, {
key: blockContext.postId,
value: blockContext
- }, blockContext.postId === (activeBlockContextId || ((_blockContexts$ = blockContexts[0]) === null || _blockContexts$ === void 0 ? void 0 : _blockContexts$.postId)) ? Object(external_wp_element_["createElement"])(PostTemplateInnerBlocks, null) : null, Object(external_wp_element_["createElement"])(MemoizedPostTemplateBlockPreview, {
+ }, blockContext.postId === (activeBlockContextId || ((_blockContexts$ = blockContexts[0]) === null || _blockContexts$ === void 0 ? void 0 : _blockContexts$.postId)) ? (0,external_wp_element_namespaceObject.createElement)(PostTemplateInnerBlocks, null) : null, (0,external_wp_element_namespaceObject.createElement)(MemoizedPostTemplateBlockPreview, {
blocks: blocks,
blockContextId: blockContext.postId,
setActiveBlockContextId: setActiveBlockContextId,
@@ -28227,7 +28340,7 @@ function PostTemplateEdit(_ref2) {
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/save.js
/**
@@ -28235,10 +28348,10 @@ function PostTemplateEdit(_ref2) {
*/
function PostTemplateSave() {
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-template/index.js
/**
* WordPress dependencies
*/
@@ -28274,12 +28387,12 @@ const {
} = post_template_metadata;
const post_template_settings = {
- icon: library_layout["a" /* default */],
+ icon: library_layout,
edit: PostTemplateEdit,
save: PostTemplateSave
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/use-post-terms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/use-post-terms.js
/**
* WordPress dependencies
*/
@@ -28297,8 +28410,8 @@ function usePostTerms(_ref) {
rest_base: restBase,
slug
} = term;
- const [termIds] = Object(external_wp_coreData_["useEntityProp"])('postType', postType, restBase, postId);
- return Object(external_wp_data_["useSelect"])(select => {
+ const [termIds] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, restBase, postId);
+ return (0,external_wp_data_namespaceObject.useSelect)(select => {
var _term$visibility;
const visible = term === null || term === void 0 ? void 0 : (_term$visibility = term.visibility) === null || _term$visibility === void 0 ? void 0 : _term$visibility.publicly_queryable;
@@ -28329,7 +28442,7 @@ function usePostTerms(_ref) {
const {
getEntityRecords,
isResolving
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
const taxonomyArgs = ['taxonomy', slug, {
include: termIds,
context: 'view'
@@ -28346,7 +28459,7 @@ function usePostTerms(_ref) {
}, [termIds, term === null || term === void 0 ? void 0 : (_term$visibility2 = term.visibility) === null || _term$visibility2 === void 0 ? void 0 : _term$visibility2.publicly_queryable]);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/edit.js
/**
@@ -28384,13 +28497,13 @@ function PostTermsEdit(_ref) {
postId,
postType
} = context;
- const selectedTerm = Object(external_wp_data_["useSelect"])(select => {
+ const selectedTerm = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _taxonomy$visibility;
if (!term) return {};
const {
getTaxonomy
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
const taxonomy = getTaxonomy(term);
return taxonomy !== null && taxonomy !== void 0 && (_taxonomy$visibility = taxonomy.visibility) !== null && _taxonomy$visibility !== void 0 && _taxonomy$visibility.publicly_queryable ? taxonomy : {};
}, [term]);
@@ -28404,7 +28517,7 @@ function PostTermsEdit(_ref) {
term: selectedTerm
});
const hasPost = postId && postType;
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign,
[`taxonomy-${term}`]: term
@@ -28412,55 +28525,55 @@ function PostTermsEdit(_ref) {
});
if (!hasPost || !term) {
- return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_i18n_["__"])('Post Terms'));
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_i18n_namespaceObject.__)('Post Terms'));
}
- 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_["AlignmentToolbar"], {
+ 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.AlignmentToolbar, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
textAlign: nextAlign
});
}
- })), 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"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
autoComplete: "off",
- label: Object(external_wp_i18n_["__"])('Separator'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Separator'),
value: separator || '',
onChange: nextValue => {
setAttributes({
separator: nextValue
});
},
- help: Object(external_wp_i18n_["__"])('Enter character(s) used to separate terms.')
- })), Object(external_wp_element_["createElement"])("div", blockProps, isLoading && Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null), !isLoading && hasPostTerms && postTerms.map(postTerm => Object(external_wp_element_["createElement"])("a", {
+ help: (0,external_wp_i18n_namespaceObject.__)('Enter character(s) used to separate terms.')
+ })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, isLoading && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), !isLoading && hasPostTerms && postTerms.map(postTerm => (0,external_wp_element_namespaceObject.createElement)("a", {
key: postTerm.id,
href: postTerm.link,
onClick: event => event.preventDefault()
- }, postTerm.name)).reduce((prev, curr) => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, prev, Object(external_wp_element_["createElement"])("span", {
+ }, postTerm.name)).reduce((prev, curr) => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, prev, (0,external_wp_element_namespaceObject.createElement)("span", {
className: "wp-block-post-terms__separator"
- }, separator || ' '), curr)), !isLoading && !hasPostTerms && ((selectedTerm === null || selectedTerm === void 0 ? void 0 : (_selectedTerm$labels = selectedTerm.labels) === null || _selectedTerm$labels === void 0 ? void 0 : _selectedTerm$labels.no_terms) || Object(external_wp_i18n_["__"])('Term items not found.'))));
+ }, separator || ' '), curr)), !isLoading && !hasPostTerms && ((selectedTerm === null || selectedTerm === void 0 ? void 0 : (_selectedTerm$labels = selectedTerm.labels) === null || _selectedTerm$labels === void 0 ? void 0 : _selectedTerm$labels.no_terms) || (0,external_wp_i18n_namespaceObject.__)('Term items not found.'))));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-categories.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/post-categories.js
/**
* WordPress dependencies
*/
-const postCategories = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const postCategories = (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 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z",
fillRule: "evenodd",
clipRule: "evenodd"
}));
/* harmony default export */ var post_categories = (postCategories);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/variations.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/variations.js
/**
* WordPress dependencies
*/
@@ -28468,8 +28581,8 @@ const postCategories = Object(external_wp_element_["createElement"])(external_wp
const post_terms_variations_variations = [{
name: 'category',
- title: Object(external_wp_i18n_["__"])('Post Categories'),
- description: Object(external_wp_i18n_["__"])("Display a post's categories."),
+ title: (0,external_wp_i18n_namespaceObject.__)('Post Categories'),
+ description: (0,external_wp_i18n_namespaceObject.__)("Display a post's categories."),
icon: post_categories,
isDefault: true,
attributes: {
@@ -28478,8 +28591,8 @@ const post_terms_variations_variations = [{
isActive: blockAttributes => blockAttributes.term === 'category'
}, {
name: 'post_tag',
- title: Object(external_wp_i18n_["__"])('Post Tags'),
- description: Object(external_wp_i18n_["__"])("Display a post's tags."),
+ title: (0,external_wp_i18n_namespaceObject.__)('Post Tags'),
+ description: (0,external_wp_i18n_namespaceObject.__)("Display a post's tags."),
icon: post_categories,
attributes: {
term: 'post_tag'
@@ -28488,7 +28601,7 @@ const post_terms_variations_variations = [{
}];
/* harmony default export */ var post_terms_variations = (post_terms_variations_variations);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-terms/index.js
/**
* Internal dependencies
*/
@@ -28543,7 +28656,7 @@ const post_terms_settings = {
edit: PostTermsEdit
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/edit.js
@@ -28585,77 +28698,77 @@ function PostTitleEdit(_ref) {
const TagName = 0 === level ? 'p' : 'h' + level;
const isDescendentOfQueryLoop = Number.isFinite(queryId);
const userCanEdit = useCanEditEntity('postType', postType, postId);
- const [rawTitle = '', setTitle, fullTitle] = Object(external_wp_coreData_["useEntityProp"])('postType', postType, 'title', postId);
- const [link] = Object(external_wp_coreData_["useEntityProp"])('postType', postType, 'link', postId);
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const [rawTitle = '', setTitle, fullTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
+ const [link] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'link', postId);
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
})
});
- let titleElement = Object(external_wp_element_["createElement"])(TagName, blockProps, Object(external_wp_i18n_["__"])('Post Title'));
+ let titleElement = (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_i18n_namespaceObject.__)('Post Title'));
if (postType && postId) {
- titleElement = userCanEdit && !isDescendentOfQueryLoop ? Object(external_wp_element_["createElement"])(external_wp_blockEditor_["PlainText"], Object(esm_extends["a" /* default */])({
+ titleElement = userCanEdit && !isDescendentOfQueryLoop ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, _extends({
tagName: TagName,
- placeholder: Object(external_wp_i18n_["__"])('No Title'),
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('No Title'),
value: rawTitle,
onChange: setTitle,
__experimentalVersion: 2
- }, blockProps)) : Object(external_wp_element_["createElement"])(TagName, blockProps, Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], {
+ }, blockProps)) : (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, {
key: "html"
}, fullTitle === null || fullTitle === void 0 ? void 0 : fullTitle.rendered));
}
if (isLink && postType && postId) {
- titleElement = userCanEdit && !isDescendentOfQueryLoop ? Object(external_wp_element_["createElement"])(TagName, blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["PlainText"], {
+ titleElement = userCanEdit && !isDescendentOfQueryLoop ? (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
tagName: "a",
href: link,
target: linkTarget,
rel: rel,
- placeholder: !rawTitle.length ? Object(external_wp_i18n_["__"])('No Title') : null,
+ placeholder: !rawTitle.length ? (0,external_wp_i18n_namespaceObject.__)('No Title') : null,
value: rawTitle,
onChange: setTitle,
__experimentalVersion: 2
- })) : Object(external_wp_element_["createElement"])(TagName, blockProps, Object(external_wp_element_["createElement"])("a", {
+ })) : (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)("a", {
href: link,
target: linkTarget,
rel: rel,
onClick: event => event.preventDefault()
- }, Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, {
key: "html"
}, fullTitle === null || fullTitle === void 0 ? void 0 : fullTitle.rendered)));
}
- 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: "block"
- }, Object(external_wp_element_["createElement"])(HeadingLevelDropdown, {
+ }, (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
selectedLevel: level,
onChange: newLevel => setAttributes({
level: newLevel
})
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["AlignmentControl"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
textAlign: nextAlign
});
}
- })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Link settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Make title a link'),
+ })), (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.__)('Link settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Make title a link'),
onChange: () => setAttributes({
isLink: !isLink
}),
checked: isLink
- }), isLink && 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'),
+ }), isLink && (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: value => setAttributes({
linkTarget: value ? '_blank' : '_self'
}),
checked: linkTarget === '_blank'
- }), 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: newRel => setAttributes({
rel: newRel
@@ -28663,7 +28776,7 @@ function PostTitleEdit(_ref) {
})))), titleElement);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/deprecated.js
/**
* Internal dependencies
*/
@@ -28738,7 +28851,7 @@ const post_title_deprecated_v1 = {
/* harmony default export */ var post_title_deprecated = ([post_title_deprecated_v1]);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/post-title/index.js
/**
* WordPress dependencies
*/
@@ -28816,22 +28929,22 @@ const post_title_settings = {
deprecated: post_title_deprecated
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/preformatted.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/preformatted.js
/**
* WordPress dependencies
*/
-const preformatted = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const preformatted = (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: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z"
}));
/* harmony default export */ var library_preformatted = (preformatted);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/edit.js
@@ -28851,10 +28964,10 @@ function PreformattedEdit(_ref) {
const {
content
} = attributes;
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
style
});
- 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({
tagName: "pre",
identifier: "content",
preserveWhiteSpace: true,
@@ -28865,15 +28978,15 @@ function PreformattedEdit(_ref) {
});
},
onRemove: onRemove,
- "aria-label": Object(external_wp_i18n_["__"])('Preformatted text'),
- placeholder: Object(external_wp_i18n_["__"])('Write preformatted text…'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Preformatted text'),
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('Write preformatted text…'),
onMerge: mergeBlocks
}, blockProps, {
__unstablePastePlainText: true
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/save.js
/**
@@ -28887,12 +29000,12 @@ function preformatted_save_save(_ref) {
const {
content
} = attributes;
- 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, {
value: content
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/transforms.js
/**
* WordPress dependencies
*/
@@ -28906,7 +29019,7 @@ const preformatted_transforms_transforms = {
content,
anchor
} = _ref;
- return Object(external_wp_blocks_["createBlock"])('core/preformatted', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/preformatted', {
content,
anchor
});
@@ -28928,16 +29041,16 @@ const preformatted_transforms_transforms = {
to: [{
type: 'block',
blocks: ['core/paragraph'],
- transform: attributes => Object(external_wp_blocks_["createBlock"])('core/paragraph', attributes)
+ transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes)
}, {
type: 'block',
blocks: ['core/code'],
- transform: attributes => Object(external_wp_blocks_["createBlock"])('core/code', attributes)
+ transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/code', attributes)
}]
};
/* harmony default export */ var preformatted_transforms = (preformatted_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js
/**
* WordPress dependencies
*/
@@ -28996,7 +29109,7 @@ const preformatted_settings = {
attributes: {
/* eslint-disable @wordpress/i18n-no-collapsible-whitespace */
// translators: Sample content for the Preformatted block. Can be replaced with a more locale-adequate work.
- content: Object(external_wp_i18n_["__"])('EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\nWindow, very small in the distance, illuminated.\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;')
+ content: (0,external_wp_i18n_namespaceObject.__)('EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\nWindow, very small in the distance, illuminated.\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;')
/* eslint-enable @wordpress/i18n-no-collapsible-whitespace */
}
@@ -29013,25 +29126,25 @@ const preformatted_settings = {
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pullquote.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/pullquote.js
/**
* WordPress dependencies
*/
-const pullquote = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const pullquote = (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: "M18 8H6c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v4zM4 4v1.5h16V4H4zm0 16h16v-1.5H4V20z"
}));
/* harmony default export */ var library_pullquote = (pullquote);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/shared.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/shared.js
const SOLID_COLOR_CLASS = `is-style-solid-color`;
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/deprecated.js
/**
@@ -29107,11 +29220,11 @@ const pullquote_deprecated_deprecated = [{
citation,
className
} = attributes;
- const isSolidColorStyle = Object(external_lodash_["includes"])(className, SOLID_COLOR_CLASS);
+ const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
let figureClasses, figureStyles; // Is solid color style
if (isSolidColorStyle) {
- const backgroundClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', mainColor);
+ const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
figureClasses = classnames_default()({
'has-background': backgroundClass || customMainColor,
[backgroundClass]: backgroundClass
@@ -29125,7 +29238,7 @@ const pullquote_deprecated_deprecated = [{
};
}
- const blockquoteTextColorClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor);
+ const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
const blockquoteClasses = classnames_default()({
'has-text-color': textColor || customTextColor,
[blockquoteTextColorClass]: blockquoteTextColorClass
@@ -29133,16 +29246,16 @@ const pullquote_deprecated_deprecated = [{
const blockquoteStyles = blockquoteTextColorClass ? undefined : {
color: customTextColor
};
- 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: figureClasses,
style: figureStyles
- }), Object(external_wp_element_["createElement"])("blockquote", {
+ }), (0,external_wp_element_namespaceObject.createElement)("blockquote", {
className: blockquoteClasses,
style: blockquoteStyles
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: value,
multiline: true
- }), !external_wp_blockEditor_["RichText"].isEmpty(citation) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
})));
@@ -29156,7 +29269,7 @@ const pullquote_deprecated_deprecated = [{
customTextColor,
...attributes
} = _ref2;
- const isSolidColorStyle = Object(external_lodash_["includes"])(className, SOLID_COLOR_CLASS);
+ const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
let style;
if (customMainColor) {
@@ -29219,11 +29332,11 @@ const pullquote_deprecated_deprecated = [{
className,
figureStyle
} = attributes;
- const isSolidColorStyle = Object(external_lodash_["includes"])(className, SOLID_COLOR_CLASS);
+ const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
let figureClasses, figureStyles; // Is solid color style
if (isSolidColorStyle) {
- const backgroundClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', mainColor);
+ const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
figureClasses = classnames_default()({
'has-background': backgroundClass || customMainColor,
[backgroundClass]: backgroundClass
@@ -29248,23 +29361,23 @@ const pullquote_deprecated_deprecated = [{
};
}
- const blockquoteTextColorClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor);
+ const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
const blockquoteClasses = (textColor || customTextColor) && classnames_default()('has-text-color', {
[blockquoteTextColorClass]: blockquoteTextColorClass
});
const blockquoteStyles = blockquoteTextColorClass ? undefined : {
color: customTextColor
};
- return Object(external_wp_element_["createElement"])("figure", {
+ return (0,external_wp_element_namespaceObject.createElement)("figure", {
className: figureClasses,
style: figureStyles
- }, Object(external_wp_element_["createElement"])("blockquote", {
+ }, (0,external_wp_element_namespaceObject.createElement)("blockquote", {
className: blockquoteClasses,
style: blockquoteStyles
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: value,
multiline: true
- }), !external_wp_blockEditor_["RichText"].isEmpty(citation) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
})));
@@ -29279,7 +29392,7 @@ const pullquote_deprecated_deprecated = [{
customTextColor,
...attributes
} = _ref4;
- const isSolidColorStyle = Object(external_lodash_["includes"])(className, SOLID_COLOR_CLASS);
+ const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
let style;
if (customMainColor) {
@@ -29352,11 +29465,11 @@ const pullquote_deprecated_deprecated = [{
citation,
className
} = attributes;
- const isSolidColorStyle = Object(external_lodash_["includes"])(className, SOLID_COLOR_CLASS);
+ const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
let figureClass, figureStyles; // Is solid color style
if (isSolidColorStyle) {
- figureClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', mainColor);
+ figureClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
if (!figureClass) {
figureStyles = {
@@ -29370,30 +29483,30 @@ const pullquote_deprecated_deprecated = [{
}; // Is normal style and a named color is being used, we need to retrieve the color value to set the style,
// as there is no expectation that themes create classes that set border colors.
} else if (mainColor) {
- const colors = Object(external_lodash_["get"])(Object(external_wp_data_["select"])(external_wp_blockEditor_["store"]).getSettings(), ['colors'], []);
- const colorObject = Object(external_wp_blockEditor_["getColorObjectByAttributeValues"])(colors, mainColor);
+ const colors = (0,external_lodash_namespaceObject.get)((0,external_wp_data_namespaceObject.select)(external_wp_blockEditor_namespaceObject.store).getSettings(), ['colors'], []);
+ const colorObject = (0,external_wp_blockEditor_namespaceObject.getColorObjectByAttributeValues)(colors, mainColor);
figureStyles = {
borderColor: colorObject.color
};
}
- const blockquoteTextColorClass = Object(external_wp_blockEditor_["getColorClassName"])('color', textColor);
+ const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor);
const blockquoteClasses = textColor || customTextColor ? classnames_default()('has-text-color', {
[blockquoteTextColorClass]: blockquoteTextColorClass
}) : undefined;
const blockquoteStyle = blockquoteTextColorClass ? undefined : {
color: customTextColor
};
- return Object(external_wp_element_["createElement"])("figure", {
+ return (0,external_wp_element_namespaceObject.createElement)("figure", {
className: figureClass,
style: figureStyles
- }, Object(external_wp_element_["createElement"])("blockquote", {
+ }, (0,external_wp_element_namespaceObject.createElement)("blockquote", {
className: blockquoteClasses,
style: blockquoteStyle
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: value,
multiline: true
- }), !external_wp_blockEditor_["RichText"].isEmpty(citation) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
})));
@@ -29407,7 +29520,7 @@ const pullquote_deprecated_deprecated = [{
customTextColor,
...attributes
} = _ref6;
- const isSolidColorStyle = Object(external_lodash_["includes"])(className, SOLID_COLOR_CLASS);
+ const isSolidColorStyle = (0,external_lodash_namespaceObject.includes)(className, SOLID_COLOR_CLASS);
let style = {};
if (customMainColor) {
@@ -29457,10 +29570,10 @@ const pullquote_deprecated_deprecated = [{
value,
citation
} = attributes;
- return Object(external_wp_element_["createElement"])("blockquote", null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ return (0,external_wp_element_namespaceObject.createElement)("blockquote", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: value,
multiline: true
- }), !external_wp_blockEditor_["RichText"].isEmpty(citation) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
}));
@@ -29488,12 +29601,12 @@ const pullquote_deprecated_deprecated = [{
citation,
align
} = attributes;
- return Object(external_wp_element_["createElement"])("blockquote", {
+ return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
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, {
value: value,
multiline: true
- }), !external_wp_blockEditor_["RichText"].isEmpty(citation) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "footer",
value: citation
}));
@@ -29502,13 +29615,13 @@ const pullquote_deprecated_deprecated = [{
}];
/* harmony default export */ var pullquote_deprecated = (pullquote_deprecated_deprecated);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/figure.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/figure.js
const Figure = 'figure';
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/blockquote.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/blockquote.js
const BlockQuote = 'blockquote';
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/edit.js
/**
@@ -29544,51 +29657,51 @@ function PullQuoteEdit(_ref) {
citation,
value
} = attributes;
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
})
});
- const shouldShowCitation = !external_wp_blockEditor_["RichText"].isEmpty(citation) || isSelected;
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], {
+ const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) || isSelected;
+ 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: "block"
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["AlignmentControl"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
textAlign: nextAlign
});
}
- })), Object(external_wp_element_["createElement"])(Figure, blockProps, Object(external_wp_element_["createElement"])(BlockQuote, null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ })), (0,external_wp_element_namespaceObject.createElement)(Figure, blockProps, (0,external_wp_element_namespaceObject.createElement)(BlockQuote, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
identifier: "value",
multiline: true,
value: value,
onChange: nextValue => setAttributes({
value: nextValue
}),
- "aria-label": Object(external_wp_i18n_["__"])('Pullquote text'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote text'),
placeholder: // translators: placeholder text used for the quote
- Object(external_wp_i18n_["__"])('Add quote'),
+ (0,external_wp_i18n_namespaceObject.__)('Add quote'),
textAlign: "center"
- }), shouldShowCitation && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ }), shouldShowCitation && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
identifier: "citation",
value: citation,
- "aria-label": Object(external_wp_i18n_["__"])('Pullquote citation text'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote citation text'),
placeholder: // translators: placeholder text used for the citation
- Object(external_wp_i18n_["__"])('Add citation'),
+ (0,external_wp_i18n_namespaceObject.__)('Add citation'),
onChange: nextCitation => setAttributes({
citation: nextCitation
}),
className: "wp-block-pullquote__citation",
__unstableMobileNoFocusOnMount: true,
textAlign: "center",
- __unstableOnSplitAtEnd: () => insertBlocksAfter(Object(external_wp_blocks_["createBlock"])('core/paragraph'))
+ __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
}))));
}
/* harmony default export */ var pullquote_edit = (PullQuoteEdit);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/save.js
/**
@@ -29609,21 +29722,21 @@ function pullquote_save_save(_ref) {
citation,
value
} = attributes;
- const shouldShowCitation = !external_wp_blockEditor_["RichText"].isEmpty(citation);
- return Object(external_wp_element_["createElement"])("figure", external_wp_blockEditor_["useBlockProps"].save({
+ const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation);
+ return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
})
- }), Object(external_wp_element_["createElement"])("blockquote", null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), (0,external_wp_element_namespaceObject.createElement)("blockquote", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: value,
multiline: true
- }), shouldShowCitation && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), shouldShowCitation && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
})));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/transforms.js
/**
* WordPress dependencies
*/
@@ -29635,13 +29748,13 @@ const pullquote_transforms_transforms = {
isMultiBlock: true,
blocks: ['core/paragraph'],
transform: attributes => {
- return Object(external_wp_blocks_["createBlock"])('core/pullquote', {
- value: Object(external_wp_richText_["toHTMLString"])({
- value: Object(external_wp_richText_["join"])(attributes.map(_ref => {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
+ value: (0,external_wp_richText_namespaceObject.toHTMLString)({
+ value: (0,external_wp_richText_namespaceObject.join)(attributes.map(_ref => {
let {
content
} = _ref;
- return Object(external_wp_richText_["create"])({
+ return (0,external_wp_richText_namespaceObject.create)({
html: content
});
}), '\u2028'),
@@ -29658,7 +29771,7 @@ const pullquote_transforms_transforms = {
content,
anchor
} = _ref2;
- return Object(external_wp_blocks_["createBlock"])('core/pullquote', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
value: `<p>${content}</p>`,
anchor
});
@@ -29675,24 +29788,24 @@ const pullquote_transforms_transforms = {
const paragraphs = [];
if (value && value !== '<p></p>') {
- paragraphs.push(...Object(external_wp_richText_["split"])(Object(external_wp_richText_["create"])({
+ paragraphs.push(...(0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
html: value,
multilineTag: 'p'
- }), '\u2028').map(piece => Object(external_wp_blocks_["createBlock"])('core/paragraph', {
- content: Object(external_wp_richText_["toHTMLString"])({
+ }), '\u2028').map(piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
+ content: (0,external_wp_richText_namespaceObject.toHTMLString)({
value: piece
})
})));
}
if (citation && citation !== '<p></p>') {
- paragraphs.push(Object(external_wp_blocks_["createBlock"])('core/paragraph', {
+ paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: citation
}));
}
if (paragraphs.length === 0) {
- return Object(external_wp_blocks_["createBlock"])('core/paragraph', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: ''
});
}
@@ -29713,17 +29826,17 @@ const pullquote_transforms_transforms = {
// content of the resulting heading. A nonexistent citation
// will result in an empty heading.
if (value === '<p></p>') {
- return Object(external_wp_blocks_["createBlock"])('core/heading', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
content: citation
});
}
- const pieces = Object(external_wp_richText_["split"])(Object(external_wp_richText_["create"])({
+ const pieces = (0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
html: value,
multilineTag: 'p'
}), '\u2028');
- const headingBlock = Object(external_wp_blocks_["createBlock"])('core/heading', {
- content: Object(external_wp_richText_["toHTMLString"])({
+ const headingBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
+ content: (0,external_wp_richText_namespaceObject.toHTMLString)({
value: pieces[0]
})
});
@@ -29733,10 +29846,10 @@ const pullquote_transforms_transforms = {
}
const quotePieces = pieces.slice(1);
- const pullquoteBlock = Object(external_wp_blocks_["createBlock"])('core/pullquote', { ...attrs,
+ const pullquoteBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', { ...attrs,
citation,
- value: Object(external_wp_richText_["toHTMLString"])({
- value: quotePieces.length ? Object(external_wp_richText_["join"])(pieces.slice(1), '\u2028') : Object(external_wp_richText_["create"])(),
+ value: (0,external_wp_richText_namespaceObject.toHTMLString)({
+ value: quotePieces.length ? (0,external_wp_richText_namespaceObject.join)(pieces.slice(1), '\u2028') : (0,external_wp_richText_namespaceObject.create)(),
multilineTag: 'p'
})
});
@@ -29746,7 +29859,7 @@ const pullquote_transforms_transforms = {
};
/* harmony default export */ var pullquote_transforms = (pullquote_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js
/**
* WordPress dependencies
*/
@@ -29825,8 +29938,8 @@ const pullquote_settings = {
example: {
attributes: {
value: '<p>' + // translators: Quote serving as example for the Pullquote block. Attributed to Matt Mullenweg.
- Object(external_wp_i18n_["__"])('One of the hardest things to do in technology is disrupt yourself.') + '</p>',
- citation: Object(external_wp_i18n_["__"])('Matt Mullenweg')
+ (0,external_wp_i18n_namespaceObject.__)('One of the hardest things to do in technology is disrupt yourself.') + '</p>',
+ citation: (0,external_wp_i18n_namespaceObject.__)('Matt Mullenweg')
}
},
transforms: pullquote_transforms,
@@ -29835,25 +29948,37 @@ const pullquote_settings = {
deprecated: pullquote_deprecated
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/loop.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/loop.js
/**
* WordPress dependencies
*/
-const loop_loop = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const loop = (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: "M18.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z"
}));
-/* harmony default export */ var library_loop = (loop_loop);
+/* harmony default export */ var library_loop = (loop);
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/settings.js
+
+
+/**
+ * WordPress dependencies
+ */
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/settings.js
-var library_settings = __webpack_require__("mi6C");
+const settings_settings = (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.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"
+}));
+/* harmony default export */ var library_settings = (settings_settings);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-toolbar.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-toolbar.js
/**
@@ -29872,38 +29997,38 @@ function QueryToolbar(_ref) {
setQuery,
setDisplayLayout
} = _ref;
- const maxPageInputId = Object(external_wp_compose_["useInstanceId"])(QueryToolbar, 'blocks-query-pagination-max-page-input');
+ const maxPageInputId = (0,external_wp_compose_namespaceObject.useInstanceId)(QueryToolbar, 'blocks-query-pagination-max-page-input');
const displayLayoutControls = [{
icon: library_list,
- title: Object(external_wp_i18n_["__"])('List view'),
+ title: (0,external_wp_i18n_namespaceObject.__)('List view'),
onClick: () => setDisplayLayout({
type: 'list'
}),
isActive: (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.type) === 'list'
}, {
- icon: grid["a" /* default */],
- title: Object(external_wp_i18n_["__"])('Grid view'),
+ icon: library_grid,
+ title: (0,external_wp_i18n_namespaceObject.__)('Grid view'),
onClick: () => setDisplayLayout({
type: 'flex',
columns: (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.columns) || 3
}),
isActive: (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.type) === 'flex'
}];
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, !query.inherit && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !query.inherit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
contentClassName: "block-library-query-toolbar__popover",
renderToggle: _ref2 => {
let {
onToggle
} = _ref2;
- return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
- icon: library_settings["a" /* default */],
- label: Object(external_wp_i18n_["__"])('Display settings'),
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
+ icon: library_settings,
+ label: (0,external_wp_i18n_namespaceObject.__)('Display settings'),
onClick: onToggle
});
},
- renderContent: () => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["BaseControl"], null, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalNumberControl"], {
+ renderContent: () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, {
__unstableInputWidth: "60px",
- label: Object(external_wp_i18n_["__"])('Items per Page'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Items per Page'),
labelPosition: "edge",
min: 1,
max: 100,
@@ -29919,9 +30044,9 @@ function QueryToolbar(_ref) {
step: "1",
value: query.perPage,
isDragEnabled: false
- })), Object(external_wp_element_["createElement"])(external_wp_components_["BaseControl"], null, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalNumberControl"], {
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, {
__unstableInputWidth: "60px",
- label: Object(external_wp_i18n_["__"])('Offset'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Offset'),
labelPosition: "edge",
min: 0,
max: 100,
@@ -29937,13 +30062,13 @@ function QueryToolbar(_ref) {
step: "1",
value: query.offset,
isDragEnabled: false
- })), Object(external_wp_element_["createElement"])(external_wp_components_["BaseControl"], {
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
id: maxPageInputId,
- help: Object(external_wp_i18n_["__"])('Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalNumberControl"], {
+ help: (0,external_wp_i18n_namespaceObject.__)('Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNumberControl, {
id: maxPageInputId,
__unstableInputWidth: "60px",
- label: Object(external_wp_i18n_["__"])('Max page to show'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Max page to show'),
labelPosition: "edge",
min: 0,
onChange: value => {
@@ -29959,12 +30084,12 @@ function QueryToolbar(_ref) {
value: query.pages,
isDragEnabled: false
})))
- })), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], {
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
controls: displayLayoutControls
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/utils.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/utils.js
/**
* WordPress dependencies
*/
@@ -30038,12 +30163,12 @@ const getTermsInfo = terms => {
const usePostTypes = () => {
const {
postTypes
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getPostTypes;
const {
getPostTypes
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
const excludedPostTypes = ['attachment'];
const filteredPostTypes = (_getPostTypes = getPostTypes({
per_page: -1
@@ -30058,14 +30183,14 @@ const usePostTypes = () => {
postTypes: filteredPostTypes
};
}, []);
- const postTypesTaxonomiesMap = Object(external_wp_element_["useMemo"])(() => {
+ const postTypesTaxonomiesMap = (0,external_wp_element_namespaceObject.useMemo)(() => {
if (!(postTypes !== null && postTypes !== void 0 && postTypes.length)) return;
return postTypes.reduce((accumulator, type) => {
accumulator[type.slug] = type.taxonomies;
return accumulator;
}, {});
}, [postTypes]);
- const postTypesSelectOptions = Object(external_wp_element_["useMemo"])(() => (postTypes || []).map(_ref2 => {
+ const postTypesSelectOptions = (0,external_wp_element_namespaceObject.useMemo)(() => (postTypes || []).map(_ref2 => {
let {
labels,
slug
@@ -30106,7 +30231,7 @@ const getFirstQueryClientIdFromBlocks = blocks => {
}
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/constants.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/constants.js
const MAX_FETCHED_TERMS = 100;
const DEFAULTS_POSTS_PER_PAGE = 3;
/* harmony default export */ var constants = ({
@@ -30114,7 +30239,7 @@ const DEFAULTS_POSTS_PER_PAGE = 3;
DEFAULTS_POSTS_PER_PAGE
});
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-inspector-controls.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-inspector-controls.js
/**
@@ -30138,13 +30263,13 @@ const DEFAULTS_POSTS_PER_PAGE = 3;
const stickyOptions = [{
- label: Object(external_wp_i18n_["__"])('Include'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Include'),
value: ''
}, {
- label: Object(external_wp_i18n_["__"])('Exclude'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Exclude'),
value: 'exclude'
}, {
- label: Object(external_wp_i18n_["__"])('Only'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Only'),
value: 'only'
}]; // Helper function to get the term id based on user input in terms `FormTokenField`.
@@ -30192,9 +30317,9 @@ function QueryInspectorControls(_ref) {
sticky,
inherit
} = query;
- const [showCategories, setShowCategories] = Object(external_wp_element_["useState"])(true);
- const [showTags, setShowTags] = Object(external_wp_element_["useState"])(true);
- const [showSticky, setShowSticky] = Object(external_wp_element_["useState"])(postType === 'post');
+ const [showCategories, setShowCategories] = (0,external_wp_element_namespaceObject.useState)(true);
+ const [showTags, setShowTags] = (0,external_wp_element_namespaceObject.useState)(true);
+ const [showSticky, setShowSticky] = (0,external_wp_element_namespaceObject.useState)(postType === 'post');
const {
postTypesTaxonomiesMap,
postTypesSelectOptions
@@ -30203,10 +30328,10 @@ function QueryInspectorControls(_ref) {
authorList,
categories,
tags
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getEntityRecords
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
const termsQuery = {
per_page: MAX_FETCHED_TERMS
};
@@ -30223,13 +30348,13 @@ function QueryInspectorControls(_ref) {
})
};
}, []);
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (!postTypesTaxonomiesMap) return;
const postTypeTaxonomies = postTypesTaxonomiesMap[postType];
setShowCategories(postTypeTaxonomies.includes('category'));
setShowTags(postTypeTaxonomies.includes('post_tag'));
}, [postType, postTypesTaxonomiesMap]);
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
setShowSticky(postType === 'post');
}, [postType]);
@@ -30267,15 +30392,15 @@ function QueryInspectorControls(_ref) {
const onCategoriesChange = onTermsChange(categories, 'categoryIds');
const onTagsChange = onTermsChange(tags, 'tagIds');
- const [querySearch, setQuerySearch] = Object(external_wp_element_["useState"])(query.search);
- const onChangeDebounced = Object(external_wp_element_["useCallback"])(Object(external_lodash_["debounce"])(() => {
+ const [querySearch, setQuerySearch] = (0,external_wp_element_namespaceObject.useState)(query.search);
+ const onChangeDebounced = (0,external_wp_element_namespaceObject.useCallback)((0,external_lodash_namespaceObject.debounce)(() => {
if (query.search !== querySearch) {
setQuery({
search: querySearch
});
}
}, 250), [querySearch, query.search]);
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
onChangeDebounced();
return onChangeDebounced.cancel;
}, [querySearch, onChangeDebounced]); // Returns only the existing term ids (categories/tags) in proper
@@ -30308,33 +30433,33 @@ function QueryInspectorControls(_ref) {
}, []);
};
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Inherit query from template'),
- help: Object(external_wp_i18n_["__"])('Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.'),
+ return (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.__)('Settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Inherit query from template'),
+ help: (0,external_wp_i18n_namespaceObject.__)('Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.'),
checked: !!inherit,
onChange: value => setQuery({
inherit: !!value
})
- }), !inherit && Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], {
+ }), !inherit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
options: postTypesSelectOptions,
value: postType,
- label: Object(external_wp_i18n_["__"])('Post Type'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Post Type'),
onChange: onPostTypeChange,
- help: Object(external_wp_i18n_["__"])('WordPress contains different types of content and they are divided into collections called "Post Types". By default there are a few different ones such as blog posts and pages, but plugins could add more.')
- }), (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.type) === 'flex' && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], {
- label: Object(external_wp_i18n_["__"])('Columns'),
+ help: (0,external_wp_i18n_namespaceObject.__)('WordPress contains different types of content and they are divided into collections called "Post Types". By default there are a few different ones such as blog posts and pages, but plugins could add more.')
+ }), (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.type) === 'flex' && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
value: displayLayout.columns,
onChange: value => setDisplayLayout({
columns: value
}),
min: 2,
max: Math.max(6, displayLayout.columns)
- }), displayLayout.columns > 6 && Object(external_wp_element_["createElement"])(external_wp_components_["Notice"], {
+ }), displayLayout.columns > 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.'))), !inherit && Object(external_wp_element_["createElement"])(external_wp_components_["QueryControls"], {
+ }, (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.'))), !inherit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.QueryControls, {
order,
orderBy,
onOrderChange: value => setQuery({
@@ -30343,40 +30468,40 @@ function QueryInspectorControls(_ref) {
onOrderByChange: value => setQuery({
orderBy: value
})
- }), showSticky && Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], {
- label: Object(external_wp_i18n_["__"])('Sticky posts'),
+ }), showSticky && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Sticky posts'),
options: stickyOptions,
value: sticky,
onChange: value => setQuery({
sticky: value
}),
- help: Object(external_wp_i18n_["__"])('Blog posts can be "stickied", a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.')
- })), !inherit && Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Filters')
- }, showCategories && (categories === null || categories === void 0 ? void 0 : (_categories$terms = categories.terms) === null || _categories$terms === void 0 ? void 0 : _categories$terms.length) > 0 && Object(external_wp_element_["createElement"])(external_wp_components_["FormTokenField"], {
- label: Object(external_wp_i18n_["__"])('Categories'),
+ help: (0,external_wp_i18n_namespaceObject.__)('Blog posts can be "stickied", a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.')
+ })), !inherit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
+ title: (0,external_wp_i18n_namespaceObject.__)('Filters')
+ }, showCategories && (categories === null || categories === void 0 ? void 0 : (_categories$terms = categories.terms) === null || _categories$terms === void 0 ? void 0 : _categories$terms.length) > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormTokenField, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Categories'),
value: getExistingTermsFormTokenValue('category'),
suggestions: categories.names,
onChange: onCategoriesChange
- }), showTags && (tags === null || tags === void 0 ? void 0 : (_tags$terms = tags.terms) === null || _tags$terms === void 0 ? void 0 : _tags$terms.length) > 0 && Object(external_wp_element_["createElement"])(external_wp_components_["FormTokenField"], {
- label: Object(external_wp_i18n_["__"])('Tags'),
+ }), showTags && (tags === null || tags === void 0 ? void 0 : (_tags$terms = tags.terms) === null || _tags$terms === void 0 ? void 0 : _tags$terms.length) > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormTokenField, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Tags'),
value: getExistingTermsFormTokenValue('post_tag'),
suggestions: tags.names,
onChange: onTagsChange
- }), Object(external_wp_element_["createElement"])(external_wp_components_["QueryControls"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.QueryControls, {
selectedAuthorId,
authorList,
onAuthorChange: value => setQuery({
author: value !== '' ? +value : undefined
})
- }), Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
- label: Object(external_wp_i18n_["__"])('Keyword'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Keyword'),
value: querySearch,
onChange: setQuerySearch
})));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-placeholder.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/query-placeholder.js
/**
@@ -30400,12 +30525,12 @@ const QueryPlaceholder = _ref => {
defaultVariation,
scopeVariations,
allVariations
- } = 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'),
@@ -30415,12 +30540,12 @@ const QueryPlaceholder = _ref => {
}, [name]);
const {
replaceInnerBlocks
- } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]);
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])();
- const matchingVariation = Object(external_wp_blockEditor_["__experimentalGetMatchingVariation"])(attributes, allVariations);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
+ const matchingVariation = (0,external_wp_blockEditor_namespaceObject.__experimentalGetMatchingVariation)(attributes, allVariations);
const icon = (matchingVariation === null || matchingVariation === void 0 ? void 0 : matchingVariation.icon) || (blockType === null || blockType === void 0 ? void 0 : (_blockType$icon = blockType.icon) === null || _blockType$icon === void 0 ? void 0 : _blockType$icon.src);
const label = (matchingVariation === null || matchingVariation === void 0 ? void 0 : matchingVariation.title) || (blockType === null || blockType === void 0 ? void 0 : blockType.title);
- return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalBlockVariationPicker"], {
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, {
icon: icon,
label: label,
variations: scopeVariations,
@@ -30432,7 +30557,7 @@ const QueryPlaceholder = _ref => {
}
if (nextVariation.innerBlocks) {
- replaceInnerBlocks(clientId, Object(external_wp_blocks_["createBlocksFromInnerBlocksTemplate"])(nextVariation.innerBlocks), false);
+ replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(nextVariation.innerBlocks), false);
}
}
}));
@@ -30440,7 +30565,7 @@ const QueryPlaceholder = _ref => {
/* harmony default export */ var query_placeholder = (QueryPlaceholder);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/edit/index.js
/**
@@ -30477,33 +30602,33 @@ function QueryContent(_ref) {
} = attributes;
const {
__unstableMarkNextChangeAsNotPersistent
- } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]);
- const instanceId = Object(external_wp_compose_["useInstanceId"])(QueryContent);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
+ const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(QueryContent);
const {
themeSupportsLayout
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getSettings;
const {
getSettings
- } = select(external_wp_blockEditor_["store"]);
+ } = select(external_wp_blockEditor_namespaceObject.store);
return {
themeSupportsLayout: (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout
};
}, []);
- const defaultLayout = Object(external_wp_blockEditor_["useSetting"])('layout') || {};
+ const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])();
- const innerBlocksProps = Object(external_wp_blockEditor_["useInnerBlocksProps"])(blockProps, {
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
+ const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
template: query_edit_TEMPLATE,
__experimentalLayout: themeSupportsLayout ? usedLayout : undefined
});
const {
postsPerPage
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getSettings
- } = select(external_wp_blockEditor_["store"]);
+ } = select(external_wp_blockEditor_namespaceObject.store);
return {
postsPerPage: +getSettings().postsPerPage || DEFAULTS_POSTS_PER_PAGE
};
@@ -30516,7 +30641,7 @@ function QueryContent(_ref) {
// because updates are batched after the render and changes in different query properties
// would cause to overide previous wanted changes.
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
const newQuery = {};
if (!query.perPage && postsPerPage) {
@@ -30531,7 +30656,7 @@ function QueryContent(_ref) {
}, [query.perPage]); // We need this for multi-query block pagination.
// Query parameters for each block are scoped to their ID.
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (!queryId) {
__unstableMarkNextChangeAsNotPersistent();
@@ -30553,20 +30678,20 @@ function QueryContent(_ref) {
}
});
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(QueryInspectorControls, {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(QueryInspectorControls, {
attributes: attributes,
setQuery: updateQuery,
setDisplayLayout: updateDisplayLayout
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], null, Object(external_wp_element_["createElement"])(QueryToolbar, {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(QueryToolbar, {
attributes: attributes,
setQuery: updateQuery,
setDisplayLayout: updateDisplayLayout
- })), 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_["SelectControl"], {
- label: Object(external_wp_i18n_["__"])('HTML element'),
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
options: [{
- label: Object(external_wp_i18n_["__"])('Default (<div>)'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'),
value: 'div'
}, {
label: '<main>',
@@ -30582,7 +30707,7 @@ function QueryContent(_ref) {
onChange: value => setAttributes({
tagName: value
})
- })), Object(external_wp_element_["createElement"])(TagName, innerBlocksProps));
+ })), (0,external_wp_element_namespaceObject.createElement)(TagName, innerBlocksProps));
}
function QueryPatternSetup(props) {
@@ -30590,14 +30715,14 @@ function QueryPatternSetup(props) {
clientId,
name: blockName
} = props;
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])();
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const {
replaceBlock,
selectBlock
- } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const onBlockPatternSelect = blocks => {
- const clonedBlocks = blocks.map(block => Object(external_wp_blocks_["cloneBlock"])(block));
+ const clonedBlocks = blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block));
const firstQueryClientId = getFirstQueryClientIdFromBlocks(clonedBlocks);
replaceBlock(clientId, clonedBlocks);
@@ -30608,10 +30733,10 @@ function QueryPatternSetup(props) {
// or if no matched patterns are found.
- return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalBlockPatternSetup"], {
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternSetup, {
blockName: blockName,
clientId: clientId,
- startBlankComponent: Object(external_wp_element_["createElement"])(query_placeholder, props),
+ startBlankComponent: (0,external_wp_element_namespaceObject.createElement)(query_placeholder, props),
onBlockPatternSelect: onBlockPatternSelect
}));
}
@@ -30620,14 +30745,14 @@ const QueryEdit = props => {
const {
clientId
} = props;
- const hasInnerBlocks = Object(external_wp_data_["useSelect"])(select => !!select(external_wp_blockEditor_["store"]).getBlocks(clientId).length, [clientId]);
+ const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length, [clientId]);
const Component = hasInnerBlocks ? QueryContent : QueryPatternSetup;
- return Object(external_wp_element_["createElement"])(Component, props);
+ return (0,external_wp_element_namespaceObject.createElement)(Component, props);
};
/* harmony default export */ var query_edit = (QueryEdit);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/save.js
/**
@@ -30640,44 +30765,44 @@ function QuerySave(_ref) {
tagName: Tag = 'div'
}
} = _ref;
- const blockProps = external_wp_blockEditor_["useBlockProps"].save();
- const innerBlocksProps = external_wp_blockEditor_["useInnerBlocksProps"].save(blockProps);
- return Object(external_wp_element_["createElement"])(Tag, innerBlocksProps);
+ const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save();
+ const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
+ return (0,external_wp_element_namespaceObject.createElement)(Tag, innerBlocksProps);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/icons.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/icons.js
/**
* WordPress dependencies
*/
-const titleDate = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], {
+const titleDate = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 48 48"
-}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zM7 26h12v1H7v-1zm34-5H7v3h34v-3zM7 38h12v1H7v-1zm34-5H7v3h34v-3z"
}));
-const titleExcerpt = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], {
+const titleExcerpt = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 48 48"
-}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M41 9H7v3h34V9zm-4 5H7v1h30v-1zm4 3H7v1h34v-1zM7 20h30v1H7v-1zm0 12h30v1H7v-1zm34 3H7v1h34v-1zM7 38h30v1H7v-1zm34-11H7v3h34v-3z"
}));
-const titleDateExcerpt = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], {
+const titleDateExcerpt = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 48 48"
-}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zm22 3H7v1h34v-1zM7 20h34v1H7v-1zm0 12h12v1H7v-1zm34 3H7v1h34v-1zM7 38h34v1H7v-1zm34-11H7v3h34v-3z"
}));
-const imageDateTitle = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], {
+const imageDateTitle = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 48 48"
-}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M7 9h34v6H7V9zm12 8H7v1h12v-1zm18 3H7v1h30v-1zm0 18H7v1h30v-1zM7 35h12v1H7v-1zm34-8H7v6h34v-6z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/variations.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/variations.js
/**
* WordPress dependencies
*/
@@ -30707,8 +30832,8 @@ const QUERY_DEFAULT_ATTRIBUTES = {
};
const query_variations_variations = [{
name: 'posts-list',
- title: Object(external_wp_i18n_["__"])('Posts List'),
- description: Object(external_wp_i18n_["__"])('Display a list of your most recent posts, excluding sticky posts.'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Posts List'),
+ description: (0,external_wp_i18n_namespaceObject.__)('Display a list of your most recent posts, excluding sticky posts.'),
icon: post_list,
attributes: {
query: {
@@ -30729,7 +30854,7 @@ const query_variations_variations = [{
scope: ['inserter']
}, {
name: 'title-date',
- title: Object(external_wp_i18n_["__"])('Title & Date'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Title & Date'),
icon: titleDate,
attributes: { ...QUERY_DEFAULT_ATTRIBUTES
},
@@ -30737,7 +30862,7 @@ const query_variations_variations = [{
scope: ['block']
}, {
name: 'title-excerpt',
- title: Object(external_wp_i18n_["__"])('Title & Excerpt'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Title & Excerpt'),
icon: titleExcerpt,
attributes: { ...QUERY_DEFAULT_ATTRIBUTES
},
@@ -30745,7 +30870,7 @@ const query_variations_variations = [{
scope: ['block']
}, {
name: 'title-date-excerpt',
- title: Object(external_wp_i18n_["__"])('Title, Date, & Excerpt'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Title, Date, & Excerpt'),
icon: titleDateExcerpt,
attributes: { ...QUERY_DEFAULT_ATTRIBUTES
},
@@ -30753,7 +30878,7 @@ const query_variations_variations = [{
scope: ['block']
}, {
name: 'image-date-title',
- title: Object(external_wp_i18n_["__"])('Image, Date, & Title'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Image, Date, & Title'),
icon: imageDateTitle,
attributes: { ...QUERY_DEFAULT_ATTRIBUTES
},
@@ -30762,7 +30887,7 @@ const query_variations_variations = [{
}];
/* harmony default export */ var query_variations = (query_variations_variations);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/deprecated.js
/**
@@ -30810,19 +30935,19 @@ const query_deprecated_deprecated = [// Version with NO wrapper `div` element.
},
migrate(attributes) {
- return { ...Object(external_lodash_["omit"])(attributes, ['layout']),
+ return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['layout']),
displayLayout: attributes.layout
};
},
save() {
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
}
}];
/* harmony default export */ var query_deprecated = (query_deprecated_deprecated);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/hooks.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/hooks.js
@@ -30844,14 +30969,14 @@ const CreateNewPostLink = _ref => {
} = {}
} = _ref;
if (!postType) return null;
- const newPostUrl = Object(external_wp_url_["addQueryArgs"])('post-new.php', {
+ const newPostUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('post-new.php', {
post_type: postType
});
- return Object(external_wp_element_["createElement"])("div", {
+ return (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-query__create-new-link"
- }, Object(external_wp_element_["createInterpolateElement"])(Object(external_wp_i18n_["__"])('<a>Create a new post</a> for this feed.'), // eslint-disable-next-line jsx-a11y/anchor-has-content
+ }, (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('<a>Create a new post</a> for this feed.'), // eslint-disable-next-line jsx-a11y/anchor-has-content
{
- a: Object(external_wp_element_["createElement"])("a", {
+ a: (0,external_wp_element_namespaceObject.createElement)("a", {
href: newPostUrl
})
}));
@@ -30864,25 +30989,25 @@ const CreateNewPostLink = _ref => {
*/
-const queryTopInspectorControls = Object(external_wp_compose_["createHigherOrderComponent"])(BlockEdit => props => {
+const queryTopInspectorControls = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => {
const {
name,
isSelected
} = props;
if (name !== 'core/query' || !isSelected) {
- return Object(external_wp_element_["createElement"])(BlockEdit, Object(esm_extends["a" /* default */])({
+ return (0,external_wp_element_namespaceObject.createElement)(BlockEdit, _extends({
key: "edit"
}, props));
}
- 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"])(CreateNewPostLink, props)), Object(external_wp_element_["createElement"])(BlockEdit, Object(esm_extends["a" /* default */])({
+ 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)(CreateNewPostLink, props)), (0,external_wp_element_namespaceObject.createElement)(BlockEdit, _extends({
key: "edit"
}, props)));
}, 'withInspectorControls');
/* harmony default export */ var query_hooks = (queryTopInspectorControls);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/index.js
/**
* WordPress dependencies
*/
@@ -30966,33 +31091,33 @@ const query_settings = {
}; // Importing this file includes side effects and is whitelisted
// in block-library/package.json under `sideEffects`.
-Object(external_wp_hooks_["addFilter"])('editor.BlockEdit', 'core/query', query_hooks);
+(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/query', query_hooks);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination.js
/**
* WordPress dependencies
*/
-const queryPagination = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const queryPagination = (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_["Rect"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
x: "4",
y: "10.5",
width: "6",
height: "3",
rx: "1.5",
fill: "#000"
-}), Object(external_wp_element_["createElement"])(external_wp_primitives_["Rect"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
x: "12",
y: "10.5",
width: "3",
height: "3",
rx: "1.5",
fill: "#000"
-}), Object(external_wp_element_["createElement"])(external_wp_primitives_["Rect"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
x: "17",
y: "10.5",
width: "3",
@@ -31002,7 +31127,7 @@ const queryPagination = Object(external_wp_element_["createElement"])(external_w
}));
/* harmony default export */ var query_pagination = (queryPagination);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/query-pagination-arrow-controls.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/query-pagination-arrow-controls.js
/**
@@ -31015,25 +31140,25 @@ function QueryPaginationArrowControls(_ref) {
value,
onChange
} = _ref;
- return Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToggleGroupControl"], {
- label: Object(external_wp_i18n_["__"])('Arrow'),
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Arrow'),
value: value,
onChange: onChange,
- help: Object(external_wp_i18n_["__"])('A decorative arrow appended to the next and previous page link.'),
+ help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous page link.'),
isBlock: true
- }, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToggleGroupControlOption"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "none",
- label: Object(external_wp_i18n_["_x"])('None', 'Arrow option for Query Pagination Next/Previous blocks')
- }), Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToggleGroupControlOption"], {
+ label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Query Pagination Next/Previous blocks')
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "arrow",
- label: Object(external_wp_i18n_["_x"])('Arrow', 'Arrow option for Query Pagination Next/Previous blocks')
- }), Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalToggleGroupControlOption"], {
+ label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Query Pagination Next/Previous blocks')
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, {
value: "chevron",
- label: Object(external_wp_i18n_["_x"])('Chevron', 'Arrow option for Query Pagination Next/Previous blocks')
+ label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Query Pagination Next/Previous blocks')
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/edit.js
/**
@@ -31052,7 +31177,7 @@ function QueryPaginationArrowControls(_ref) {
const query_pagination_edit_TEMPLATE = [['core/query-pagination-previous'], ['core/query-pagination-numbers'], ['core/query-pagination-next']];
const getDefaultBlockLayout = blockTypeOrName => {
- const layoutBlockSupportConfig = Object(external_wp_blocks_["getBlockSupport"])(blockTypeOrName, '__experimentalLayout');
+ const layoutBlockSupportConfig = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockTypeOrName, '__experimentalLayout');
return layoutBlockSupportConfig === null || layoutBlockSupportConfig === void 0 ? void 0 : layoutBlockSupportConfig.default;
};
@@ -31067,10 +31192,10 @@ function QueryPaginationEdit(_ref) {
name
} = _ref;
const usedLayout = layout || getDefaultBlockLayout(name);
- const hasNextPreviousBlocks = Object(external_wp_data_["useSelect"])(select => {
+ const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getBlocks
- } = select(external_wp_blockEditor_["store"]);
+ } = select(external_wp_blockEditor_namespaceObject.store);
const innerBlocks = getBlocks(clientId);
/**
* Show the `paginationArrow` control only if a
@@ -31081,25 +31206,25 @@ function QueryPaginationEdit(_ref) {
return ['core/query-pagination-next', 'core/query-pagination-previous'].includes(innerBlock.name);
});
}, []);
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])();
- const innerBlocksProps = Object(external_wp_blockEditor_["useInnerBlocksProps"])(blockProps, {
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
+ const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
template: query_pagination_edit_TEMPLATE,
allowedBlocks: ['core/query-pagination-previous', 'core/query-pagination-numbers', 'core/query-pagination-next'],
__experimentalLayout: usedLayout
});
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, hasNextPreviousBlocks && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Settings')
- }, Object(external_wp_element_["createElement"])(QueryPaginationArrowControls, {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, hasNextPreviousBlocks && (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.__)('Settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(QueryPaginationArrowControls, {
value: paginationArrow,
onChange: value => {
setAttributes({
paginationArrow: value
});
}
- }))), Object(external_wp_element_["createElement"])("div", innerBlocksProps));
+ }))), (0,external_wp_element_namespaceObject.createElement)("div", innerBlocksProps));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/save.js
/**
@@ -31107,10 +31232,10 @@ function QueryPaginationEdit(_ref) {
*/
function query_pagination_save_save() {
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/deprecated.js
/**
@@ -31120,13 +31245,13 @@ function query_pagination_save_save() {
const query_pagination_deprecated_deprecated = [// Version with wrapper `div` element.
{
save() {
- return Object(external_wp_element_["createElement"])("div", external_wp_blockEditor_["useBlockProps"].save(), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InnerBlocks"].Content, null));
+ return (0,external_wp_element_namespaceObject.createElement)("div", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, null));
}
}];
/* harmony default export */ var query_pagination_deprecated = (query_pagination_deprecated_deprecated);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js
/**
* WordPress dependencies
*/
@@ -31186,38 +31311,38 @@ const query_pagination_settings = {
deprecated: query_pagination_deprecated
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-next.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-next.js
/**
* WordPress dependencies
*/
-const queryPaginationNext = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const queryPaginationNext = (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_["Rect"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
x: "6",
y: "10.5",
width: "3",
height: "3",
rx: "1.5",
fill: "#000"
-}), Object(external_wp_element_["createElement"])(external_wp_primitives_["Rect"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
x: "11",
y: "10.5",
width: "3",
height: "3",
rx: "1.5",
fill: "#000"
-}), Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M16.5 9.5L19 12l-2.5 2.5",
stroke: "#1E1E1E",
strokeWidth: "1.5"
}));
/* harmony default export */ var query_pagination_next = (queryPaginationNext);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/edit.js
@@ -31242,24 +31367,24 @@ function QueryPaginationNextEdit(_ref) {
}
} = _ref;
const displayArrow = arrowMap[paginationArrow];
- return Object(external_wp_element_["createElement"])("a", Object(esm_extends["a" /* default */])({
+ return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
href: "#pagination-next-pseudo-link",
onClick: event => event.preventDefault()
- }, Object(external_wp_blockEditor_["useBlockProps"])()), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["PlainText"], {
+ }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
__experimentalVersion: 2,
tagName: "span",
- "aria-label": Object(external_wp_i18n_["__"])('Next page link'),
- placeholder: Object(external_wp_i18n_["__"])('Next Page'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Next page link'),
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('Next Page'),
value: label,
onChange: newLabel => setAttributes({
label: newLabel
})
- }), displayArrow && Object(external_wp_element_["createElement"])("span", {
+ }), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
className: `wp-block-query-pagination-next-arrow is-arrow-${paginationArrow}`
}, displayArrow));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js
/**
* WordPress dependencies
*/
@@ -31312,33 +31437,33 @@ const query_pagination_next_settings = {
edit: QueryPaginationNextEdit
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-numbers.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-numbers.js
/**
* WordPress dependencies
*/
-const queryPaginationNumbers = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const queryPaginationNumbers = (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_["Rect"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
x: "4",
y: "10.5",
width: "6",
height: "3",
rx: "1.5",
fill: "#000"
-}), Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M13.5 14v-4l-1.5.5",
stroke: "#1E1E1E"
-}), Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M19.266 9.805c-.473-.611-1.22-.51-1.702-.367a3.854 3.854 0 00-.718.307l.13 1.082c.192-.17.47-.422.782-.515.34-.1.578.025.668.141.21.27-.034.835-.16 1.055-.49.85-.93 1.594-1.45 2.492H19.5v-1h-.914c.277-.574.814-1.443.914-2.106.052-.343.02-.762-.234-1.09z",
fill: "#1E1E1E"
}));
/* harmony default export */ var query_pagination_numbers = (queryPaginationNumbers);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/edit.js
/**
@@ -31349,19 +31474,19 @@ const queryPaginationNumbers = Object(external_wp_element_["createElement"])(ext
const createPaginationItem = function (content) {
let Tag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'a';
let extraClass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
- return Object(external_wp_element_["createElement"])(Tag, {
+ return (0,external_wp_element_namespaceObject.createElement)(Tag, {
className: `page-numbers ${extraClass}`
}, content);
};
-const previewPaginationNumbers = () => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, createPaginationItem(1), createPaginationItem(2), createPaginationItem(3, 'span', 'current'), createPaginationItem(4), createPaginationItem(5), createPaginationItem('...', 'span', 'dots'), createPaginationItem(8));
+const previewPaginationNumbers = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, createPaginationItem(1), createPaginationItem(2), createPaginationItem(3, 'span', 'current'), createPaginationItem(4), createPaginationItem(5), createPaginationItem('...', 'span', 'dots'), createPaginationItem(8));
function QueryPaginationNumbersEdit() {
const paginationNumbers = previewPaginationNumbers();
- return Object(external_wp_element_["createElement"])("div", Object(external_wp_blockEditor_["useBlockProps"])(), paginationNumbers);
+ return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), paginationNumbers);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js
/**
* WordPress dependencies
*/
@@ -31395,17 +31520,17 @@ const query_pagination_numbers_settings = {
edit: QueryPaginationNumbersEdit
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-previous.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/query-pagination-previous.js
/**
* WordPress dependencies
*/
-const queryPaginationPrevious = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const queryPaginationPrevious = (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_["Rect"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
x: "18",
y: "13.5",
width: "3",
@@ -31413,7 +31538,7 @@ const queryPaginationPrevious = Object(external_wp_element_["createElement"])(ex
rx: "1.5",
transform: "rotate(-180 18 13.5)",
fill: "#000"
-}), Object(external_wp_element_["createElement"])(external_wp_primitives_["Rect"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
x: "13",
y: "13.5",
width: "3",
@@ -31421,14 +31546,14 @@ const queryPaginationPrevious = Object(external_wp_element_["createElement"])(ex
rx: "1.5",
transform: "rotate(-180 13 13.5)",
fill: "#000"
-}), Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M7.5 14.5L5 12l2.5-2.5",
stroke: "#1E1E1E",
strokeWidth: "1.5"
}));
/* harmony default export */ var query_pagination_previous = (queryPaginationPrevious);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/edit.js
@@ -31453,16 +31578,16 @@ function QueryPaginationPreviousEdit(_ref) {
}
} = _ref;
const displayArrow = edit_arrowMap[paginationArrow];
- return Object(external_wp_element_["createElement"])("a", Object(esm_extends["a" /* default */])({
+ return (0,external_wp_element_namespaceObject.createElement)("a", _extends({
href: "#pagination-previous-pseudo-link",
onClick: event => event.preventDefault()
- }, Object(external_wp_blockEditor_["useBlockProps"])()), displayArrow && Object(external_wp_element_["createElement"])("span", {
+ }, (0,external_wp_blockEditor_namespaceObject.useBlockProps)()), displayArrow && (0,external_wp_element_namespaceObject.createElement)("span", {
className: `wp-block-query-pagination-previous-arrow is-arrow-${paginationArrow}`
- }, displayArrow), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["PlainText"], {
+ }, displayArrow), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
__experimentalVersion: 2,
tagName: "span",
- "aria-label": Object(external_wp_i18n_["__"])('Previous page link'),
- placeholder: Object(external_wp_i18n_["__"])('Previous Page'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Previous page link'),
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('Previous Page'),
value: label,
onChange: newLabel => setAttributes({
label: newLabel
@@ -31470,7 +31595,7 @@ function QueryPaginationPreviousEdit(_ref) {
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js
/**
* WordPress dependencies
*/
@@ -31523,7 +31648,7 @@ const query_pagination_previous_settings = {
edit: QueryPaginationPreviousEdit
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/edit.js
/**
@@ -31553,7 +31678,7 @@ function QueryTitleEdit(_ref) {
setAttributes
} = _ref;
const TagName = `h${level}`;
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign,
'wp-block-query-title__placeholder': type === 'archive'
@@ -31562,23 +31687,23 @@ function QueryTitleEdit(_ref) {
// block variations like `Search Title`.
if (!SUPPORTED_TYPES.includes(type)) {
- return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], null, Object(external_wp_i18n_["__"])('Provided type is not supported.')));
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Provided type is not supported.')));
}
let titleElement;
if (type === 'archive') {
- titleElement = Object(external_wp_element_["createElement"])(TagName, blockProps, Object(external_wp_i18n_["__"])('Archive title'));
+ titleElement = (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_i18n_namespaceObject.__)('Archive title'));
}
- 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: "block"
- }, Object(external_wp_element_["createElement"])(HeadingLevelDropdown, {
+ }, (0,external_wp_element_namespaceObject.createElement)(HeadingLevelDropdown, {
selectedLevel: level,
onChange: newLevel => setAttributes({
level: newLevel
})
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["AlignmentControl"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
@@ -31588,27 +31713,27 @@ function QueryTitleEdit(_ref) {
})), titleElement);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/archive-title.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/archive-title.js
/**
* WordPress dependencies
*/
-const archiveTitle = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const archiveTitle = (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, {
stroke: "#1E1E1E",
strokeWidth: "1.5",
d: "M4 19.25h9M4 15.25h16"
-}), Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M8.994 10.103H6.08L5.417 12H4l2.846-8h1.383l2.845 8H9.657l-.663-1.897zm-.457-1.28l-.994-2.857-1.006 2.857h2z",
fill: "#1E1E1E"
}));
/* harmony default export */ var archive_title = (archiveTitle);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/variations.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/variations.js
/**
* WordPress dependencies
*/
@@ -31617,8 +31742,8 @@ const archiveTitle = Object(external_wp_element_["createElement"])(external_wp_p
const query_title_variations_variations = [{
isDefault: true,
name: 'archive-title',
- title: Object(external_wp_i18n_["__"])('Archive Title'),
- description: Object(external_wp_i18n_["__"])('Display the archive title based on the queried object.'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Archive Title'),
+ description: (0,external_wp_i18n_namespaceObject.__)('Display the archive title based on the queried object.'),
icon: archive_title,
attributes: {
type: 'archive'
@@ -31638,7 +31763,7 @@ query_title_variations_variations.forEach(variation => {
});
/* harmony default export */ var query_title_variations = (query_title_variations_variations);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/deprecated.js
/**
* Internal dependencies
*/
@@ -31699,7 +31824,7 @@ const query_title_deprecated_v1 = {
/* harmony default export */ var query_title_deprecated = ([query_title_deprecated_v1]);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query-title/index.js
/**
* Internal dependencies
*/
@@ -31761,22 +31886,22 @@ const query_title_settings = {
deprecated: query_title_deprecated
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/quote.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/quote.js
/**
* WordPress dependencies
*/
-const quote = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const quote = (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: "M13 6v6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H13zm-9 6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H4v6z"
}));
/* harmony default export */ var library_quote = (quote);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/deprecated.js
/**
@@ -31818,14 +31943,14 @@ const quote_deprecated_deprecated = [{
value,
citation
} = attributes;
- return Object(external_wp_element_["createElement"])("blockquote", {
+ return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
style: {
textAlign: align ? align : null
}
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
multiline: true,
value: value
- }), !external_wp_blockEditor_["RichText"].isEmpty(citation) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
}));
@@ -31841,7 +31966,7 @@ const quote_deprecated_deprecated = [{
migrate(attributes) {
if (attributes.style === 2) {
- return { ...Object(external_lodash_["omit"])(attributes, ['style']),
+ return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['style']),
className: attributes.className ? attributes.className + ' is-style-large' : 'is-style-large'
};
}
@@ -31859,15 +31984,15 @@ const quote_deprecated_deprecated = [{
citation,
style
} = attributes;
- return Object(external_wp_element_["createElement"])("blockquote", {
+ return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
className: style === 2 ? 'is-large' : '',
style: {
textAlign: align ? align : null
}
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
multiline: true,
value: value
- }), !external_wp_blockEditor_["RichText"].isEmpty(citation) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
}));
@@ -31889,7 +32014,7 @@ const quote_deprecated_deprecated = [{
migrate(attributes) {
if (!isNaN(parseInt(attributes.style))) {
- return { ...Object(external_lodash_["omit"])(attributes, ['style'])
+ return { ...(0,external_lodash_namespaceObject.omit)(attributes, ['style'])
};
}
@@ -31906,15 +32031,15 @@ const quote_deprecated_deprecated = [{
citation,
style
} = attributes;
- return Object(external_wp_element_["createElement"])("blockquote", {
+ return (0,external_wp_element_namespaceObject.createElement)("blockquote", {
className: `blocks-quote-style-${style}`,
style: {
textAlign: align ? align : null
}
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
multiline: true,
value: value
- }), !external_wp_blockEditor_["RichText"].isEmpty(citation) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "footer",
value: citation
}));
@@ -31923,7 +32048,7 @@ const quote_deprecated_deprecated = [{
}];
/* harmony default export */ var quote_deprecated = (quote_deprecated_deprecated);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/edit.js
/**
@@ -31939,7 +32064,7 @@ const quote_deprecated_deprecated = [{
-const isWebPlatform = external_wp_element_["Platform"].OS === 'web';
+const isWebPlatform = external_wp_element_namespaceObject.Platform.OS === 'web';
function QuoteEdit(_ref) {
let {
attributes,
@@ -31956,22 +32081,22 @@ function QuoteEdit(_ref) {
value,
citation
} = attributes;
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()(className, {
[`has-text-align-${align}`]: align
}),
style
});
- 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: "block"
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["AlignmentControl"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: align,
onChange: nextAlign => {
setAttributes({
align: nextAlign
});
}
- })), Object(external_wp_element_["createElement"])(external_wp_components_["BlockQuotation"], blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BlockQuotation, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
identifier: "value",
multiline: true,
value: value,
@@ -31986,16 +32111,16 @@ function QuoteEdit(_ref) {
onReplace([]);
}
},
- "aria-label": Object(external_wp_i18n_["__"])('Quote text'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Quote text'),
placeholder: // translators: placeholder text used for the quote
- Object(external_wp_i18n_["__"])('Add quote'),
+ (0,external_wp_i18n_namespaceObject.__)('Add quote'),
onReplace: onReplace,
- onSplit: piece => Object(external_wp_blocks_["createBlock"])('core/quote', { ...attributes,
+ onSplit: piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', { ...attributes,
value: piece
}),
- __unstableOnSplitMiddle: () => Object(external_wp_blocks_["createBlock"])('core/paragraph'),
+ __unstableOnSplitMiddle: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'),
textAlign: align
- }), (!external_wp_blockEditor_["RichText"].isEmpty(citation) || isSelected) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ }), (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
identifier: "citation",
tagName: isWebPlatform ? 'cite' : undefined,
style: {
@@ -32006,16 +32131,16 @@ function QuoteEdit(_ref) {
citation: nextCitation
}),
__unstableMobileNoFocusOnMount: true,
- "aria-label": Object(external_wp_i18n_["__"])('Quote citation text'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Quote citation text'),
placeholder: // translators: placeholder text used for the citation
- Object(external_wp_i18n_["__"])('Add citation'),
+ (0,external_wp_i18n_namespaceObject.__)('Add citation'),
className: "wp-block-quote__citation",
textAlign: align,
- __unstableOnSplitAtEnd: () => insertBlocksAfter(Object(external_wp_blocks_["createBlock"])('core/paragraph'))
+ __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
})));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/save.js
/**
@@ -32039,18 +32164,18 @@ function quote_save_save(_ref) {
const className = classnames_default()({
[`has-text-align-${align}`]: align
});
- return Object(external_wp_element_["createElement"])("blockquote", external_wp_blockEditor_["useBlockProps"].save({
+ return (0,external_wp_element_namespaceObject.createElement)("blockquote", external_wp_blockEditor_namespaceObject.useBlockProps.save({
className
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
multiline: true,
value: value
- }), !external_wp_blockEditor_["RichText"].isEmpty(citation) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "cite",
value: citation
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/transforms.js
/**
* WordPress dependencies
*/
@@ -32062,13 +32187,13 @@ const quote_transforms_transforms = {
isMultiBlock: true,
blocks: ['core/paragraph'],
transform: attributes => {
- return Object(external_wp_blocks_["createBlock"])('core/quote', {
- value: Object(external_wp_richText_["toHTMLString"])({
- value: Object(external_wp_richText_["join"])(attributes.map(_ref => {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
+ value: (0,external_wp_richText_namespaceObject.toHTMLString)({
+ value: (0,external_wp_richText_namespaceObject.join)(attributes.map(_ref => {
let {
content
} = _ref;
- return Object(external_wp_richText_["create"])({
+ return (0,external_wp_richText_namespaceObject.create)({
html: content
});
}), '\u2028'),
@@ -32085,7 +32210,7 @@ const quote_transforms_transforms = {
content,
anchor
} = _ref2;
- return Object(external_wp_blocks_["createBlock"])('core/quote', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
value: `<p>${content}</p>`,
anchor
});
@@ -32099,7 +32224,7 @@ const quote_transforms_transforms = {
citation,
anchor
} = _ref3;
- return Object(external_wp_blocks_["createBlock"])('core/quote', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
value,
citation,
anchor
@@ -32109,7 +32234,7 @@ const quote_transforms_transforms = {
type: 'prefix',
prefix: '>',
transform: content => {
- return Object(external_wp_blocks_["createBlock"])('core/quote', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {
value: `<p>${content}</p>`
});
}
@@ -32165,24 +32290,24 @@ const quote_transforms_transforms = {
const paragraphs = [];
if (value && value !== '<p></p>') {
- paragraphs.push(...Object(external_wp_richText_["split"])(Object(external_wp_richText_["create"])({
+ paragraphs.push(...(0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
html: value,
multilineTag: 'p'
- }), '\u2028').map(piece => Object(external_wp_blocks_["createBlock"])('core/paragraph', {
- content: Object(external_wp_richText_["toHTMLString"])({
+ }), '\u2028').map(piece => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
+ content: (0,external_wp_richText_namespaceObject.toHTMLString)({
value: piece
})
})));
}
if (citation && citation !== '<p></p>') {
- paragraphs.push(Object(external_wp_blocks_["createBlock"])('core/paragraph', {
+ paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: citation
}));
}
if (paragraphs.length === 0) {
- return Object(external_wp_blocks_["createBlock"])('core/paragraph', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: ''
});
}
@@ -32203,17 +32328,17 @@ const quote_transforms_transforms = {
// content of the resulting heading. A nonexistent citation
// will result in an empty heading.
if (value === '<p></p>') {
- return Object(external_wp_blocks_["createBlock"])('core/heading', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
content: citation
});
}
- const pieces = Object(external_wp_richText_["split"])(Object(external_wp_richText_["create"])({
+ const pieces = (0,external_wp_richText_namespaceObject.split)((0,external_wp_richText_namespaceObject.create)({
html: value,
multilineTag: 'p'
}), '\u2028');
- const headingBlock = Object(external_wp_blocks_["createBlock"])('core/heading', {
- content: Object(external_wp_richText_["toHTMLString"])({
+ const headingBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', {
+ content: (0,external_wp_richText_namespaceObject.toHTMLString)({
value: pieces[0]
})
});
@@ -32223,10 +32348,10 @@ const quote_transforms_transforms = {
}
const quotePieces = pieces.slice(1);
- const quoteBlock = Object(external_wp_blocks_["createBlock"])('core/quote', { ...attrs,
+ const quoteBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', { ...attrs,
citation,
- value: Object(external_wp_richText_["toHTMLString"])({
- value: quotePieces.length ? Object(external_wp_richText_["join"])(pieces.slice(1), '\u2028') : Object(external_wp_richText_["create"])(),
+ value: (0,external_wp_richText_namespaceObject.toHTMLString)({
+ value: quotePieces.length ? (0,external_wp_richText_namespaceObject.join)(pieces.slice(1), '\u2028') : (0,external_wp_richText_namespaceObject.create)(),
multilineTag: 'p'
})
});
@@ -32241,7 +32366,7 @@ const quote_transforms_transforms = {
citation,
anchor
} = _ref7;
- return Object(external_wp_blocks_["createBlock"])('core/pullquote', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', {
value,
citation,
anchor
@@ -32251,7 +32376,7 @@ const quote_transforms_transforms = {
};
/* harmony default export */ var quote_transforms = (quote_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/quote/index.js
/**
* WordPress dependencies
*/
@@ -32331,7 +32456,7 @@ const quote_settings = {
icon: library_quote,
example: {
attributes: {
- value: '<p>' + Object(external_wp_i18n_["__"])('In quoting others, we cite ourselves.') + '</p>',
+ value: '<p>' + (0,external_wp_i18n_namespaceObject.__)('In quoting others, we cite ourselves.') + '</p>',
citation: 'Julio Cortázar',
className: 'is-style-large'
}
@@ -32367,28 +32492,39 @@ const quote_settings = {
deprecated: quote_deprecated
};
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js
-var symbol = __webpack_require__("+WrK");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol.js
-// EXTERNAL MODULE: external ["wp","reusableBlocks"]
-var external_wp_reusableBlocks_ = __webpack_require__("diJD");
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/ungroup.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: external ["wp","reusableBlocks"]
+var external_wp_reusableBlocks_namespaceObject = window["wp"]["reusableBlocks"];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/ungroup.js
/**
* WordPress dependencies
*/
-const ungroup = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const ungroup = (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 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z"
}));
/* harmony default export */ var library_ungroup = (ungroup);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/block/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/block/edit.js
/**
@@ -32408,13 +32544,13 @@ function ReusableBlockEdit(_ref) {
},
clientId
} = _ref;
- const [hasAlreadyRendered, RecursionProvider] = Object(external_wp_blockEditor_["__experimentalUseNoRecursiveRenders"])(ref);
+ const [hasAlreadyRendered, RecursionProvider] = (0,external_wp_blockEditor_namespaceObject.__experimentalUseNoRecursiveRenders)(ref);
const {
isMissing,
hasResolved
- } = Object(external_wp_data_["useSelect"])(select => {
- const persistedBlock = select(external_wp_coreData_["store"]).getEntityRecord('postType', 'wp_block', ref);
- const hasResolvedBlock = select(external_wp_coreData_["store"]).hasFinishedResolution('getEntityRecord', ['postType', 'wp_block', ref]);
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
+ const persistedBlock = select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_block', ref);
+ const hasResolvedBlock = select(external_wp_coreData_namespaceObject.store).hasFinishedResolution('getEntityRecord', ['postType', 'wp_block', ref]);
return {
hasResolved: hasResolvedBlock,
isMissing: hasResolvedBlock && !persistedBlock
@@ -32422,48 +32558,48 @@ function ReusableBlockEdit(_ref) {
}, [ref, clientId]);
const {
__experimentalConvertBlockToStatic: convertBlockToStatic
- } = Object(external_wp_data_["useDispatch"])(external_wp_reusableBlocks_["store"]);
- const [blocks, onInput, onChange] = Object(external_wp_coreData_["useEntityBlockEditor"])('postType', 'wp_block', {
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_reusableBlocks_namespaceObject.store);
+ const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_block', {
id: ref
});
- const [title, setTitle] = Object(external_wp_coreData_["useEntityProp"])('postType', 'wp_block', 'title', ref);
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])();
- const innerBlocksProps = Object(external_wp_blockEditor_["useInnerBlocksProps"])({}, {
+ const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_block', 'title', ref);
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
+ const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({}, {
value: blocks,
onInput,
onChange,
- renderAppender: blocks !== null && blocks !== void 0 && blocks.length ? undefined : external_wp_blockEditor_["InnerBlocks"].ButtonBlockAppender
+ renderAppender: blocks !== null && blocks !== void 0 && blocks.length ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender
});
if (hasAlreadyRendered) {
- return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], null, Object(external_wp_i18n_["__"])('Block cannot be rendered inside itself.')));
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
}
if (isMissing) {
- return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], null, Object(external_wp_i18n_["__"])('Block has been deleted or is unavailable.')));
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block has been deleted or is unavailable.')));
}
if (!hasResolved) {
- return Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null)));
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)));
}
- return Object(external_wp_element_["createElement"])(RecursionProvider, null, Object(external_wp_element_["createElement"])("div", blockProps, 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"])(external_wp_components_["ToolbarButton"], {
+ return (0,external_wp_element_namespaceObject.createElement)(RecursionProvider, null, (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (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)(external_wp_components_namespaceObject.ToolbarButton, {
onClick: () => convertBlockToStatic(clientId),
- label: Object(external_wp_i18n_["__"])('Convert to regular blocks'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Convert to regular blocks'),
icon: library_ungroup,
showTooltip: true
- }))), 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_["TextControl"], {
- label: Object(external_wp_i18n_["__"])('Name'),
+ }))), (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.TextControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Name'),
value: title,
onChange: setTitle
- }))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalBlockContentOverlay"], {
+ }))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockContentOverlay, {
clientId: clientId,
wrapperProps: innerBlocksProps,
className: "block-library-block__reusable-block-container"
})));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/block/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/block/index.js
/**
* WordPress dependencies
*/
@@ -32498,25 +32634,25 @@ const {
const block_settings = {
edit: ReusableBlockEdit,
- icon: symbol["a" /* default */]
+ icon: library_symbol
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/rss.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/rss.js
/**
* WordPress dependencies
*/
-const rss = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const rss = (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: "M5 10.2h-.8v1.5H5c1.9 0 3.8.8 5.1 2.1 1.4 1.4 2.1 3.2 2.1 5.1v.8h1.5V19c0-2.3-.9-4.5-2.6-6.2-1.6-1.6-3.8-2.6-6.1-2.6zm10.4-1.6C12.6 5.8 8.9 4.2 5 4.2h-.8v1.5H5c3.5 0 6.9 1.4 9.4 3.9s3.9 5.8 3.9 9.4v.8h1.5V19c0-3.9-1.6-7.6-4.4-10.4zM4 20h3v-3H4v3z"
}));
/* harmony default export */ var library_rss = (rss);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/rss/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/rss/edit.js
/**
@@ -32535,7 +32671,7 @@ function RSSEdit(_ref) {
attributes,
setAttributes
} = _ref;
- const [isEditing, setIsEditing] = Object(external_wp_element_["useState"])(!attributes.feedURL);
+ const [isEditing, setIsEditing] = (0,external_wp_element_namespaceObject.useState)(!attributes.feedURL);
const {
blockLayout,
columns,
@@ -32564,53 +32700,53 @@ function RSSEdit(_ref) {
}
}
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])();
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
if (isEditing) {
- 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_rss,
label: "RSS"
- }, Object(external_wp_element_["createElement"])("form", {
+ }, (0,external_wp_element_namespaceObject.createElement)("form", {
onSubmit: onSubmitURL,
className: "wp-block-rss__placeholder-form"
- }, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
- placeholder: Object(external_wp_i18n_["__"])('Enter URL here…'),
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL here…'),
value: feedURL,
onChange: value => setAttributes({
feedURL: value
}),
className: "wp-block-rss__placeholder-input"
- }), 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_["__"])('Use URL')))));
+ }, (0,external_wp_i18n_namespaceObject.__)('Use URL')))));
}
const toolbarControls = [{
- icon: library_edit["a" /* default */],
- title: Object(external_wp_i18n_["__"])('Edit RSS URL'),
+ icon: library_edit,
+ title: (0,external_wp_i18n_namespaceObject.__)('Edit RSS URL'),
onClick: () => setIsEditing(true)
}, {
icon: library_list,
- title: Object(external_wp_i18n_["__"])('List view'),
+ title: (0,external_wp_i18n_namespaceObject.__)('List view'),
onClick: () => setAttributes({
blockLayout: 'list'
}),
isActive: blockLayout === 'list'
}, {
- icon: grid["a" /* default */],
- title: Object(external_wp_i18n_["__"])('Grid view'),
+ icon: library_grid,
+ title: (0,external_wp_i18n_namespaceObject.__)('Grid view'),
onClick: () => setAttributes({
blockLayout: 'grid'
}),
isActive: blockLayout === 'grid'
}];
- 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"], {
+ 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, {
controls: toolbarControls
- })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('RSS settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], {
- label: Object(external_wp_i18n_["__"])('Number of items'),
+ })), (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.__)('RSS settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Number of items'),
value: itemsToShow,
onChange: value => setAttributes({
itemsToShow: value
@@ -32618,20 +32754,20 @@ function RSSEdit(_ref) {
min: DEFAULT_MIN_ITEMS,
max: DEFAULT_MAX_ITEMS,
required: true
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Display author'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Display author'),
checked: displayAuthor,
onChange: toggleAttribute('displayAuthor')
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Display date'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Display date'),
checked: displayDate,
onChange: toggleAttribute('displayDate')
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Display excerpt'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'),
checked: displayExcerpt,
onChange: toggleAttribute('displayExcerpt')
- }), displayExcerpt && Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], {
- label: Object(external_wp_i18n_["__"])('Max number of words in excerpt'),
+ }), displayExcerpt && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Max number of words in excerpt'),
value: excerptLength,
onChange: value => setAttributes({
excerptLength: value
@@ -32639,8 +32775,8 @@ function RSSEdit(_ref) {
min: 10,
max: 100,
required: true
- }), blockLayout === 'grid' && Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], {
- label: Object(external_wp_i18n_["__"])('Columns'),
+ }), blockLayout === 'grid' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Columns'),
value: columns,
onChange: value => setAttributes({
columns: value
@@ -32648,13 +32784,13 @@ function RSSEdit(_ref) {
min: 2,
max: 6,
required: true
- }))), 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, {
+ }))), (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/rss",
attributes: attributes
}))));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/rss/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/rss/index.js
/**
* WordPress dependencies
*/
@@ -32727,17 +32863,17 @@ const rss_settings = {
edit: RSSEdit
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/icons.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/icons.js
/**
* WordPress dependencies
*/
-const buttonOnly = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], {
+const buttonOnly = (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_["Rect"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
x: "7",
y: "10",
width: "10",
@@ -32745,10 +32881,10 @@ const buttonOnly = Object(external_wp_element_["createElement"])(external_wp_com
rx: "1",
fill: "currentColor"
}));
-const buttonOutside = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], {
+const buttonOutside = (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_["Rect"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
x: "4.75",
y: "15.25",
width: "6.5",
@@ -32757,7 +32893,7 @@ const buttonOutside = Object(external_wp_element_["createElement"])(external_wp_
stroke: "currentColor",
strokeWidth: "1.5",
fill: "none"
-}), Object(external_wp_element_["createElement"])(external_wp_components_["Rect"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
x: "16",
y: "10",
width: "4",
@@ -32765,10 +32901,10 @@ const buttonOutside = Object(external_wp_element_["createElement"])(external_wp_
rx: "1",
fill: "currentColor"
}));
-const buttonInside = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], {
+const buttonInside = (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_["Rect"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
x: "4.75",
y: "15.25",
width: "6.5",
@@ -32777,7 +32913,7 @@ const buttonInside = Object(external_wp_element_["createElement"])(external_wp_c
stroke: "currentColor",
strokeWidth: "1.5",
fill: "none"
-}), Object(external_wp_element_["createElement"])(external_wp_components_["Rect"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
x: "14",
y: "10",
width: "4",
@@ -32785,10 +32921,10 @@ const buttonInside = Object(external_wp_element_["createElement"])(external_wp_c
rx: "1",
fill: "currentColor"
}));
-const noButton = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], {
+const noButton = (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_["Rect"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
x: "4.75",
y: "15.25",
width: "6.5",
@@ -32798,10 +32934,10 @@ const noButton = Object(external_wp_element_["createElement"])(external_wp_compo
fill: "none",
strokeWidth: "1.5"
}));
-const buttonWithIcon = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], {
+const buttonWithIcon = (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_["Rect"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
x: "4.75",
y: "7.75",
width: "14.5",
@@ -32810,17 +32946,17 @@ const buttonWithIcon = Object(external_wp_element_["createElement"])(external_wp
stroke: "currentColor",
fill: "none",
strokeWidth: "1.5"
-}), Object(external_wp_element_["createElement"])(external_wp_components_["Rect"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
x: "8",
y: "11",
width: "8",
height: "2",
fill: "currentColor"
}));
-const toggleLabel = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], {
+const toggleLabel = (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_["Rect"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
x: "4.75",
y: "17.25",
width: "5.5",
@@ -32829,7 +32965,7 @@ const toggleLabel = Object(external_wp_element_["createElement"])(external_wp_co
stroke: "currentColor",
fill: "none",
strokeWidth: "1.5"
-}), Object(external_wp_element_["createElement"])(external_wp_components_["Rect"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
x: "4",
y: "7",
width: "10",
@@ -32837,7 +32973,7 @@ const toggleLabel = Object(external_wp_element_["createElement"])(external_wp_co
fill: "currentColor"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/utils.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/utils.js
/**
* Constants
*/
@@ -32857,7 +32993,7 @@ function utils_isPercentageUnit(unit) {
return unit === '%';
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/edit.js
/**
@@ -32907,19 +33043,19 @@ function SearchEdit(_ref) {
buttonUseIcon,
style
} = attributes;
- const insertedInNavigationBlock = Object(external_wp_data_["useSelect"])(select => {
+ const insertedInNavigationBlock = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getBlockParentsByBlo;
const {
getBlockParentsByBlockName,
wasBlockJustInserted
- } = select(external_wp_blockEditor_["store"]);
+ } = select(external_wp_blockEditor_namespaceObject.store);
return !!((_getBlockParentsByBlo = getBlockParentsByBlockName(clientId, 'core/navigation')) !== null && _getBlockParentsByBlo !== void 0 && _getBlockParentsByBlo.length) && wasBlockJustInserted(clientId);
}, [clientId]);
const {
__unstableMarkNextChangeAsNotPersistent
- } = 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)(() => {
if (!insertedInNavigationBlock) return; // This side-effect should not create an undo level.
__unstableMarkNextChangeAsNotPersistent();
@@ -32932,7 +33068,7 @@ function SearchEdit(_ref) {
}, [insertedInNavigationBlock]);
const borderRadius = style === null || style === void 0 ? void 0 : (_style$border = style.border) === null || _style$border === void 0 ? void 0 : _style$border.radius;
const borderColor = style === null || style === void 0 ? void 0 : (_style$border2 = style.border) === null || _style$border2 === void 0 ? void 0 : _style$border2.color;
- const borderProps = Object(external_wp_blockEditor_["__experimentalUseBorderProps"])(attributes); // Check for old deprecated numerical border radius. Done as a separate
+ const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); // Check for old deprecated numerical border radius. Done as a separate
// check so that a borderRadius style won't overwrite the longhand
// per-corner styles.
@@ -32940,14 +33076,14 @@ function SearchEdit(_ref) {
borderProps.style.borderRadius = `${borderRadius}px`;
}
- const colorProps = Object(external_wp_blockEditor_["__experimentalUseColorProps"])(attributes);
- const unitControlInstanceId = Object(external_wp_compose_["useInstanceId"])(external_wp_blockEditor_["__experimentalUnitControl"]);
+ const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
+ const unitControlInstanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_blockEditor_namespaceObject.__experimentalUnitControl);
const unitControlInputId = `wp-block-search__width-${unitControlInstanceId}`;
const isButtonPositionInside = 'button-inside' === buttonPosition;
const isButtonPositionOutside = 'button-outside' === buttonPosition;
const hasNoButton = 'no-button' === buttonPosition;
const hasOnlyButton = 'button-only' === buttonPosition;
- const units = Object(external_wp_components_["__experimentalUseCustomUnits"])({
+ const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits: ['%', 'px'],
defaultValues: {
'%': PC_WIDTH_DEFAULT,
@@ -32961,7 +33097,7 @@ function SearchEdit(_ref) {
const buttonPositionControls = [{
role: 'menuitemradio',
- title: Object(external_wp_i18n_["__"])('Button outside'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Button outside'),
isActive: buttonPosition === 'button-outside',
icon: buttonOutside,
onClick: () => {
@@ -32971,7 +33107,7 @@ function SearchEdit(_ref) {
}
}, {
role: 'menuitemradio',
- title: Object(external_wp_i18n_["__"])('Button inside'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Button inside'),
isActive: buttonPosition === 'button-inside',
icon: buttonInside,
onClick: () => {
@@ -32981,7 +33117,7 @@ function SearchEdit(_ref) {
}
}, {
role: 'menuitemradio',
- title: Object(external_wp_i18n_["__"])('No button'),
+ title: (0,external_wp_i18n_namespaceObject.__)('No button'),
isActive: buttonPosition === 'no-button',
icon: noButton,
onClick: () => {
@@ -33024,14 +33160,14 @@ function SearchEdit(_ref) {
const textFieldStyles = isButtonPositionInside ? {
borderRadius
} : borderProps.style;
- return Object(external_wp_element_["createElement"])("input", {
+ return (0,external_wp_element_namespaceObject.createElement)("input", {
className: textFieldClasses,
style: textFieldStyles,
- "aria-label": Object(external_wp_i18n_["__"])('Optional placeholder text') // We hide the placeholder field's placeholder when there is a value. This
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Optional placeholder text') // We hide the placeholder field's placeholder when there is a value. This
// stops screen readers from reading the placeholder field's placeholder
// which is confusing.
,
- placeholder: placeholder ? undefined : Object(external_wp_i18n_["__"])('Optional placeholder…'),
+ placeholder: placeholder ? undefined : (0,external_wp_i18n_namespaceObject.__)('Optional placeholder…'),
value: placeholder,
onChange: event => setAttributes({
placeholder: event.target.value
@@ -33047,17 +33183,17 @@ function SearchEdit(_ref) {
borderRadius
} : borderProps.style)
};
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, buttonUseIcon && Object(external_wp_element_["createElement"])("button", {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, buttonUseIcon && (0,external_wp_element_namespaceObject.createElement)("button", {
type: "button",
className: buttonClasses,
style: buttonStyles
- }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
- icon: library_search["a" /* default */]
- })), !buttonUseIcon && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(icon, {
+ icon: library_search
+ })), !buttonUseIcon && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
className: buttonClasses,
style: buttonStyles,
- "aria-label": Object(external_wp_i18n_["__"])('Button text'),
- placeholder: Object(external_wp_i18n_["__"])('Add button text…'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'),
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('Add button text…'),
withoutInteractiveFormatting: true,
value: buttonText,
onChange: html => setAttributes({
@@ -33066,8 +33202,8 @@ function SearchEdit(_ref) {
}));
};
- const controls = 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"])(external_wp_components_["ToolbarButton"], {
- title: Object(external_wp_i18n_["__"])('Toggle search label'),
+ 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, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
+ title: (0,external_wp_i18n_namespaceObject.__)('Toggle search label'),
icon: toggleLabel,
onClick: () => {
setAttributes({
@@ -33075,12 +33211,12 @@ function SearchEdit(_ref) {
});
},
className: showLabel ? 'is-pressed' : undefined
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarDropdownMenu"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
icon: getButtonPositionIcon(),
- label: Object(external_wp_i18n_["__"])('Change button position'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Change button position'),
controls: buttonPositionControls
- }), !hasNoButton && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
- title: Object(external_wp_i18n_["__"])('Use button with icon'),
+ }), !hasNoButton && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
+ title: (0,external_wp_i18n_namespaceObject.__)('Use button with icon'),
icon: buttonWithIcon,
onClick: () => {
setAttributes({
@@ -33088,12 +33224,12 @@ function SearchEdit(_ref) {
});
},
className: buttonUseIcon ? 'is-pressed' : undefined
- }))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Display Settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["BaseControl"], {
- 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.__)('Display Settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Width'),
id: unitControlInputId
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalUnitControl"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalUnitControl, {
id: unitControlInputId,
min: `${MIN_WIDTH}${MIN_WIDTH_UNIT}`,
onChange: newWidth => {
@@ -33114,14 +33250,14 @@ function SearchEdit(_ref) {
value: `${width}${widthUnit}`,
unit: widthUnit,
units: units
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ButtonGroup"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ButtonGroup, {
className: "wp-block-search__components-button-group",
- "aria-label": Object(external_wp_i18n_["__"])('Percentage Width')
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Percentage 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}%` === `${width}${widthUnit}` ? 'primary' : undefined,
+ variant: `${widthValue}%` === `${width}${widthUnit}` ? 0 : undefined,
onClick: () => setAttributes({
width: widthValue,
widthUnit: '%'
@@ -33170,19 +33306,19 @@ function SearchEdit(_ref) {
return styles;
};
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: getBlockClassNames()
});
- return Object(external_wp_element_["createElement"])("div", blockProps, controls, showLabel && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, controls, showLabel && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
className: "wp-block-search__label",
- "aria-label": Object(external_wp_i18n_["__"])('Label text'),
- placeholder: Object(external_wp_i18n_["__"])('Add label…'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Label text'),
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('Add label…'),
withoutInteractiveFormatting: true,
value: label,
onChange: html => setAttributes({
label: html
})
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ResizableBox"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
size: {
width: `${width}${widthUnit}`
},
@@ -33204,10 +33340,10 @@ function SearchEdit(_ref) {
toggleSelection(true);
},
showHandle: isSelected
- }, (isButtonPositionInside || isButtonPositionOutside) && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, renderTextField(), renderButton()), hasOnlyButton && renderButton(), hasNoButton && renderTextField()));
+ }, (isButtonPositionInside || isButtonPositionOutside) && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, renderTextField(), renderButton()), hasOnlyButton && renderButton(), hasNoButton && renderTextField()));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/variations.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/variations.js
/**
* WordPress dependencies
*/
@@ -33216,13 +33352,13 @@ const search_variations_variations = [{
name: 'default',
isDefault: true,
attributes: {
- buttonText: Object(external_wp_i18n_["__"])('Search'),
- label: Object(external_wp_i18n_["__"])('Search')
+ buttonText: (0,external_wp_i18n_namespaceObject.__)('Search'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Search')
}
}];
/* harmony default export */ var search_variations = (search_variations_variations);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/index.js
/**
* WordPress dependencies
*/
@@ -33295,28 +33431,28 @@ const {
} = search_metadata;
const search_settings = {
- icon: library_search["a" /* default */],
+ icon: library_search,
example: {},
variations: search_variations,
edit: SearchEdit
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/separator.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/separator.js
/**
* WordPress dependencies
*/
-const separator_separator = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const separator = (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 7v4H3.8V7H2.2v9h1.6v-3.5h16.4V16h1.6V7z"
}));
-/* harmony default export */ var library_separator = (separator_separator);
+/* harmony default export */ var library_separator = (separator);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/separator-settings.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/separator-settings.js
/**
@@ -33330,21 +33466,21 @@ const SeparatorSettings = _ref => {
color,
setColor
} = _ref;
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["PanelColorSettings"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PanelColorSettings, {
__experimentalHasMultipleOrigins: true,
__experimentalIsRenderedInSidebar: true,
- title: Object(external_wp_i18n_["__"])('Color'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Color'),
colorSettings: [{
value: color.color,
onChange: setColor,
- label: Object(external_wp_i18n_["__"])('Color')
+ label: (0,external_wp_i18n_namespaceObject.__)('Color')
}]
}));
};
/* harmony default export */ var separator_settings = (SeparatorSettings);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/edit.js
/**
@@ -33369,7 +33505,7 @@ function SeparatorEdit(_ref) {
setColor,
className
} = _ref;
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["HorizontalRule"], Object(external_wp_blockEditor_["useBlockProps"])({
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.HorizontalRule, (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()(className, {
'has-background': color.color,
[color.class]: color.class
@@ -33378,17 +33514,17 @@ function SeparatorEdit(_ref) {
backgroundColor: color.color,
color: color.color
}
- })), Object(external_wp_element_["createElement"])(separator_settings, {
+ })), (0,external_wp_element_namespaceObject.createElement)(separator_settings, {
color: color,
setColor: setColor
}));
}
-/* harmony default export */ var separator_edit = (Object(external_wp_blockEditor_["withColors"])('color', {
+/* harmony default export */ var separator_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)('color', {
textColor: 'color'
})(SeparatorEdit));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/save.js
/**
@@ -33410,10 +33546,10 @@ function separatorSave(_ref) {
} = attributes; // the hr support changing color using border-color, since border-color
// is not yet supported in the color palette, we use background-color
- const backgroundClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', color); // the dots styles uses text for the dots, to change those dots color is
+ const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', color); // the dots styles uses text for the dots, to change those dots color is
// using color, not backgroundColor
- const colorClass = Object(external_wp_blockEditor_["getColorClassName"])('color', color);
+ const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', color);
const className = classnames_default()({
'has-text-color has-background': color || customColor,
[backgroundClass]: backgroundClass,
@@ -33423,13 +33559,13 @@ function separatorSave(_ref) {
backgroundColor: backgroundClass ? undefined : customColor,
color: colorClass ? undefined : customColor
};
- return Object(external_wp_element_["createElement"])("hr", external_wp_blockEditor_["useBlockProps"].save({
+ return (0,external_wp_element_namespaceObject.createElement)("hr", external_wp_blockEditor_namespaceObject.useBlockProps.save({
className,
style
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/transforms.js
/**
* WordPress dependencies
*/
@@ -33438,7 +33574,7 @@ const separator_transforms_transforms = {
from: [{
type: 'enter',
regExp: /^-{3,}$/,
- transform: () => Object(external_wp_blocks_["createBlock"])('core/separator')
+ transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/separator')
}, {
type: 'raw',
selector: 'hr',
@@ -33449,7 +33585,7 @@ const separator_transforms_transforms = {
};
/* harmony default export */ var separator_transforms = (separator_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/separator/index.js
/**
* WordPress dependencies
*/
@@ -33512,22 +33648,22 @@ const build_module_separator_settings = {
save: separatorSave
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/shortcode.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/shortcode.js
/**
* WordPress dependencies
*/
-const shortcode = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const shortcode = (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: "M16 4.2v1.5h2.5v12.5H16v1.5h4V4.2h-4zM4.2 19.8h4v-1.5H5.8V5.8h2.5V4.2h-4l-.1 15.6zm5.1-3.1l1.4.6 4-10-1.4-.6-4 10z"
}));
/* harmony default export */ var library_shortcode = (shortcode);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/edit.js
/**
@@ -33542,28 +33678,28 @@ function ShortcodeEdit(_ref) {
attributes,
setAttributes
} = _ref;
- const instanceId = Object(external_wp_compose_["useInstanceId"])(ShortcodeEdit);
+ const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ShortcodeEdit);
const inputId = `blocks-shortcode-input-${instanceId}`;
- return Object(external_wp_element_["createElement"])("div", Object(external_wp_blockEditor_["useBlockProps"])({
+ return (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: 'components-placeholder'
- }), Object(external_wp_element_["createElement"])("label", {
+ }), (0,external_wp_element_namespaceObject.createElement)("label", {
htmlFor: inputId,
className: "components-placeholder__label"
- }, Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], {
+ }, (0,external_wp_element_namespaceObject.createElement)(icon, {
icon: library_shortcode
- }), Object(external_wp_i18n_["__"])('Shortcode')), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["PlainText"], {
+ }), (0,external_wp_i18n_namespaceObject.__)('Shortcode')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PlainText, {
className: "blocks-shortcode__textarea",
id: inputId,
value: attributes.text,
- "aria-label": Object(external_wp_i18n_["__"])('Shortcode text'),
- placeholder: Object(external_wp_i18n_["__"])('Write shortcode here…'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Shortcode text'),
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('Write shortcode here…'),
onChange: text => setAttributes({
text
})
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/save.js
/**
@@ -33574,13 +33710,12 @@ function shortcode_save_save(_ref) {
let {
attributes
} = _ref;
- return Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, attributes.text);
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, attributes.text);
}
-// EXTERNAL MODULE: external ["wp","autop"]
-var external_wp_autop_ = __webpack_require__("UuzZ");
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/transforms.js
+;// CONCATENATED MODULE: external ["wp","autop"]
+var external_wp_autop_namespaceObject = window["wp"]["autop"];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/transforms.js
/**
* WordPress dependencies
*/
@@ -33603,7 +33738,7 @@ const shortcode_transforms_transforms = {
let {
content
} = _ref;
- return Object(external_wp_autop_["removep"])(Object(external_wp_autop_["autop"])(content));
+ return (0,external_wp_autop_namespaceObject.removep)((0,external_wp_autop_namespaceObject.autop)(content));
}
}
},
@@ -33612,7 +33747,7 @@ const shortcode_transforms_transforms = {
};
/* harmony default export */ var shortcode_transforms = (shortcode_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js
/**
* WordPress dependencies
*/
@@ -33655,22 +33790,22 @@ const shortcode_settings = {
save: shortcode_save_save
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/site-logo.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/site-logo.js
/**
* WordPress dependencies
*/
-const siteLogo = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const siteLogo = (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: "M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 1.5c4.1 0 7.5 3.4 7.5 7.5v.1c-1.4-.8-3.3-1.7-3.4-1.8-.2-.1-.5-.1-.8.1l-2.9 2.1L9 11.3c-.2-.1-.4 0-.6.1l-3.7 2.2c-.1-.5-.2-1-.2-1.5 0-4.2 3.4-7.6 7.5-7.6zm0 15c-3.1 0-5.7-1.9-6.9-4.5l3.7-2.2 3.5 1.2c.2.1.5 0 .7-.1l2.9-2.1c.8.4 2.5 1.2 3.5 1.9-.9 3.3-3.9 5.8-7.4 5.8z"
}));
/* harmony default export */ var site_logo = (siteLogo);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/edit.js
/**
@@ -33729,35 +33864,35 @@ const SiteLogo = _ref => {
canUserEdit
} = _ref;
const clientWidth = useClientWidth(containerRef, [align]);
- const isLargeViewport = Object(external_wp_compose_["useViewportMatch"])('medium');
- const isWideAligned = Object(external_lodash_["includes"])(['wide', 'full'], align);
+ const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium');
+ const isWideAligned = (0,external_lodash_namespaceObject.includes)(['wide', 'full'], align);
const isResizable = !isWideAligned && isLargeViewport;
const [{
naturalWidth,
naturalHeight
- }, setNaturalSize] = Object(external_wp_element_["useState"])({});
- const [isEditingImage, setIsEditingImage] = Object(external_wp_element_["useState"])(false);
+ }, setNaturalSize] = (0,external_wp_element_namespaceObject.useState)({});
+ const [isEditingImage, setIsEditingImage] = (0,external_wp_element_namespaceObject.useState)(false);
const {
toggleSelection
- } = Object(external_wp_data_["useDispatch"])(external_wp_blockEditor_["store"]);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
const classes = classnames_default()('custom-logo-link', {
- 'is-transient': Object(external_wp_blob_["isBlobURL"])(logoUrl)
+ 'is-transient': (0,external_wp_blob_namespaceObject.isBlobURL)(logoUrl)
});
const {
imageEditing,
maxWidth,
title
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getSettings
- } = select(external_wp_blockEditor_["store"]);
- const siteEntities = select(external_wp_coreData_["store"]).getEditedEntityRecord('root', 'site');
+ } = select(external_wp_blockEditor_namespaceObject.store);
+ const siteEntities = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('root', 'site');
return {
title: siteEntities.title,
- ...Object(external_lodash_["pick"])(getSettings(), ['imageEditing', 'maxWidth'])
+ ...(0,external_lodash_namespaceObject.pick)(getSettings(), ['imageEditing', 'maxWidth'])
};
}, []);
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
// Turn the `Use as site icon` toggle off if it is on but the logo and icon have
// fallen out of sync. This can happen if the toggle is saved in the `on` position,
// but changes are later made to the site icon in the Customizer.
@@ -33767,7 +33902,7 @@ const SiteLogo = _ref => {
});
}
}, []);
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isSelected) {
setIsEditingImage(false);
}
@@ -33781,12 +33916,12 @@ const SiteLogo = _ref => {
toggleSelection(true);
}
- const img = Object(external_wp_element_["createElement"])("img", {
+ const img = (0,external_wp_element_namespaceObject.createElement)("img", {
className: "custom-logo",
src: logoUrl,
alt: alt,
onLoad: event => {
- setNaturalSize(Object(external_lodash_["pick"])(event.target, ['naturalWidth', 'naturalHeight']));
+ setNaturalSize((0,external_lodash_namespaceObject.pick)(event.target, ['naturalWidth', 'naturalHeight']));
}
});
let imgWrapper = img; // Disable reason: Image itself is not meant to be interactive, but
@@ -33795,7 +33930,7 @@ const SiteLogo = _ref => {
if (isLink) {
imgWrapper =
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
- Object(external_wp_element_["createElement"])("a", {
+ (0,external_wp_element_namespaceObject.createElement)("a", {
href: siteUrl,
className: classes,
rel: "home",
@@ -33814,7 +33949,7 @@ const SiteLogo = _ref => {
}
if (!isResizable || !imageWidthWithinContainer) {
- return Object(external_wp_element_["createElement"])("div", {
+ return (0,external_wp_element_namespaceObject.createElement)("div", {
style: {
width,
height
@@ -33849,7 +33984,7 @@ const SiteLogo = _ref => {
// When the image is centered, show both handles.
showRightHandle = true;
showLeftHandle = true;
- } else if (Object(external_wp_i18n_["isRTL"])()) {
+ } else if ((0,external_wp_i18n_namespaceObject.isRTL)()) {
// In RTL mode the image is on the right by default.
// Show the right handle and hide the left handle only when it is
// aligned left. Otherwise always show the left handle.
@@ -33871,7 +34006,7 @@ const SiteLogo = _ref => {
const canEditImage = logoId && naturalWidth && naturalHeight && imageEditing;
- const imgEdit = canEditImage && isEditingImage ? Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalImageEditingProvider"], {
+ const imgEdit = canEditImage && isEditingImage ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditingProvider, {
id: logoId,
url: logoUrl,
naturalWidth: naturalWidth,
@@ -33882,14 +34017,14 @@ const SiteLogo = _ref => {
},
isEditing: isEditingImage,
onFinishEditing: () => setIsEditingImage(false)
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalImageEditor"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, {
url: logoUrl,
width: currentWidth,
height: currentHeight,
clientWidth: clientWidth,
naturalHeight: naturalHeight,
naturalWidth: naturalWidth
- })) : Object(external_wp_element_["createElement"])(external_wp_components_["ResizableBox"], {
+ })) : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, {
size: {
width: currentWidth,
height: currentHeight
@@ -33915,18 +34050,18 @@ const SiteLogo = _ref => {
});
}
}, imgWrapper);
- const syncSiteIconHelpText = Object(external_wp_element_["createInterpolateElement"])(Object(external_wp_i18n_["__"])('Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the <a>Site Icon settings</a>.'), {
+ const syncSiteIconHelpText = (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the <a>Site Icon settings</a>.'), {
a: // eslint-disable-next-line jsx-a11y/anchor-has-content
- Object(external_wp_element_["createElement"])("a", {
+ (0,external_wp_element_namespaceObject.createElement)("a", {
href: siteUrl + '/wp-admin/customize.php?autofocus[section]=title_tagline',
target: "_blank",
rel: "noopener noreferrer"
})
});
- 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_["__"])('Settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], {
- label: Object(external_wp_i18n_["__"])('Image width'),
+ 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.__)('Settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Image width'),
onChange: newWidth => setAttributes({
width: newWidth
}),
@@ -33935,20 +34070,20 @@ const SiteLogo = _ref => {
initialPosition: Math.min(defaultWidth, maxWidthBuffer),
value: width || '',
disabled: !isResizable
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Link image to home'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Link image to home'),
onChange: () => setAttributes({
isLink: !isLink
}),
checked: isLink
- }), isLink && 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'),
+ }), isLink && (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: value => setAttributes({
linkTarget: value ? '_blank' : '_self'
}),
checked: linkTarget === '_blank'
- })), canUserEdit && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Use as site icon'),
+ })), canUserEdit && (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.__)('Use as site icon'),
onChange: value => {
setAttributes({
shouldSyncIcon: value
@@ -33957,12 +34092,12 @@ const SiteLogo = _ref => {
},
checked: !!shouldSyncIcon,
help: syncSiteIconHelpText
- })))), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], {
+ })))), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, {
group: "block"
- }, canEditImage && !isEditingImage && Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
+ }, canEditImage && !isEditingImage && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
onClick: () => setIsEditingImage(true),
icon: library_crop,
- label: Object(external_wp_i18n_["__"])('Crop')
+ label: (0,external_wp_i18n_namespaceObject.__)('Crop')
})), imgEdit);
};
@@ -33977,8 +34112,8 @@ function LogoEdit(_ref2) {
width,
shouldSyncIcon
} = attributes;
- const [logoUrl, setLogoUrl] = Object(external_wp_element_["useState"])();
- const ref = Object(external_wp_element_["useRef"])();
+ const [logoUrl, setLogoUrl] = (0,external_wp_element_namespaceObject.useState)();
+ const ref = (0,external_wp_element_namespaceObject.useRef)();
const {
siteLogoId,
canUserEdit,
@@ -33986,12 +34121,12 @@ function LogoEdit(_ref2) {
siteIconId,
mediaItemData,
isRequestingMediaItem
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
canUser,
getEntityRecord,
getEditedEntityRecord
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
const siteSettings = getEditedEntityRecord('root', 'site');
const siteData = getEntityRecord('root', '__unstableBase');
@@ -34005,11 +34140,11 @@ function LogoEdit(_ref2) {
const _siteIconId = siteSettings === null || siteSettings === void 0 ? void 0 : siteSettings.site_icon;
- const mediaItem = _siteLogoId && select(external_wp_coreData_["store"]).getMedia(_siteLogoId, {
+ const mediaItem = _siteLogoId && select(external_wp_coreData_namespaceObject.store).getMedia(_siteLogoId, {
context: 'view'
});
- const _isRequestingMediaItem = _siteLogoId && !select(external_wp_coreData_["store"]).hasFinishedResolution('getMedia', [_siteLogoId, {
+ const _isRequestingMediaItem = _siteLogoId && !select(external_wp_coreData_namespaceObject.store).hasFinishedResolution('getMedia', [_siteLogoId, {
context: 'view'
}]);
@@ -34028,7 +34163,7 @@ function LogoEdit(_ref2) {
}, []);
const {
editEntityRecord
- } = Object(external_wp_data_["useDispatch"])(external_wp_coreData_["store"]);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const setLogo = function (newValue) {
let shouldForceSync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
@@ -34102,7 +34237,7 @@ function LogoEdit(_ref2) {
const {
createErrorNotice
- } = Object(external_wp_data_["useDispatch"])(external_wp_notices_["store"]);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const onUploadError = message => {
createErrorNotice(message[2], {
@@ -34110,26 +34245,26 @@ function LogoEdit(_ref2) {
});
};
- const controls = canUserEdit && logoUrl && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], {
+ const controls = canUserEdit && logoUrl && (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, {
mediaURL: logoUrl,
allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES,
accept: ACCEPT_MEDIA_STRING,
onSelect: onSelectLogo,
onError: onUploadError
- }, Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
onClick: onRemoveLogo
- }, Object(external_wp_i18n_["__"])('Reset'))));
+ }, (0,external_wp_i18n_namespaceObject.__)('Reset'))));
let logoImage;
const isLoading = siteLogoId === undefined || isRequestingMediaItem;
if (isLoading) {
- logoImage = Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null);
+ logoImage = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null);
}
if (!!logoUrl) {
- logoImage = Object(external_wp_element_["createElement"])(SiteLogo, {
+ logoImage = (0,external_wp_element_namespaceObject.createElement)(SiteLogo, {
alt: alt,
attributes: attributes,
className: className,
@@ -34148,15 +34283,15 @@ function LogoEdit(_ref2) {
const placeholder = content => {
const placeholderClassName = classnames_default()('block-editor-media-placeholder', className);
- return Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
className: placeholderClassName,
preview: logoImage
- }, Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
className: "components-placeholder__illustration",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 60 60"
- }, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
vectorEffect: "non-scaling-stroke",
d: "m61 32.622-13.555-9.137-15.888 9.859a5 5 0 0 1-5.386-.073l-9.095-5.989L1 37.5"
})), content);
@@ -34165,18 +34300,18 @@ function LogoEdit(_ref2) {
const classes = classnames_default()(className, {
'is-default-size': !width
});
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
ref,
className: classes
});
- const label = Object(external_wp_i18n_["__"])('Add a site logo');
+ const label = (0,external_wp_i18n_namespaceObject.__)('Add a site logo');
- return Object(external_wp_element_["createElement"])("div", blockProps, controls, !!logoUrl && logoImage, !logoUrl && !canUserEdit && Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], {
+ return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, controls, !!logoUrl && logoImage, !logoUrl && !canUserEdit && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
className: "site-logo_placeholder"
- }, isLoading && Object(external_wp_element_["createElement"])("span", {
+ }, isLoading && (0,external_wp_element_namespaceObject.createElement)("span", {
className: "components-placeholder__preview"
- }, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null))), !logoUrl && canUserEdit && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaPlaceholder"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null))), !logoUrl && canUserEdit && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, {
onSelect: onInitialSelectLogo,
accept: ACCEPT_MEDIA_STRING,
allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES,
@@ -34186,8 +34321,8 @@ function LogoEdit(_ref2) {
let {
open
} = _ref3;
- return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
- icon: upload["a" /* default */],
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
+ icon: library_upload,
variant: "primary",
label: label,
showTooltip: true,
@@ -34200,7 +34335,7 @@ function LogoEdit(_ref2) {
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-logo/index.js
/**
* WordPress dependencies
*/
@@ -34270,7 +34405,7 @@ const site_logo_settings = {
edit: LogoEdit
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/edit.js
@@ -34294,38 +34429,38 @@ function SiteTaglineEdit(_ref) {
const {
textAlign
} = attributes;
- const [siteTagline, setSiteTagline] = Object(external_wp_coreData_["useEntityProp"])('root', 'site', 'description');
+ const [siteTagline, setSiteTagline] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'description');
const {
canUserEdit,
readOnlySiteTagLine
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
canUser,
getEntityRecord
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
const siteData = getEntityRecord('root', '__unstableBase');
return {
canUserEdit: canUser('update', 'settings'),
readOnlySiteTagLine: siteData === null || siteData === void 0 ? void 0 : siteData.description
};
}, []);
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign,
'wp-block-site-tagline__placeholder': !canUserEdit && !readOnlySiteTagLine
})
});
- const siteTaglineContent = canUserEdit ? Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], Object(esm_extends["a" /* default */])({
+ const siteTaglineContent = canUserEdit ? (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
allowedFormats: [],
onChange: setSiteTagline,
- "aria-label": Object(external_wp_i18n_["__"])('Site tagline text'),
- placeholder: Object(external_wp_i18n_["__"])('Write site tagline…'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Site tagline text'),
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site tagline…'),
tagName: "p",
value: siteTagline
- }, blockProps)) : Object(external_wp_element_["createElement"])("p", blockProps, readOnlySiteTagLine || Object(external_wp_i18n_["__"])('Site Tagline placeholder'));
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], {
+ }, blockProps)) : (0,external_wp_element_namespaceObject.createElement)("p", blockProps, readOnlySiteTagLine || (0,external_wp_i18n_namespaceObject.__)('Site Tagline placeholder'));
+ 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: "block"
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["AlignmentControl"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
onChange: newAlign => setAttributes({
textAlign: newAlign
}),
@@ -34333,25 +34468,25 @@ function SiteTaglineEdit(_ref) {
})), siteTaglineContent);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/icon.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/icon.js
/**
* WordPress dependencies
*/
-/* harmony default export */ var site_tagline_icon = (Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], {
+/* harmony default export */ var site_tagline_icon = ((0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
width: "24",
height: "24"
-}, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
fill: "none",
d: "M0 0h24v24H0z"
-}), Object(external_wp_element_["createElement"])(external_wp_components_["Path"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M4 9h16v2H4V9zm0 4h10v2H4v-2z"
})));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/deprecated.js
/**
* Internal dependencies
*/
@@ -34410,7 +34545,7 @@ const site_tagline_deprecated_v1 = {
/* harmony default export */ var site_tagline_deprecated = ([site_tagline_deprecated_v1]);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js
/**
* Internal dependencies
*/
@@ -34465,22 +34600,22 @@ const site_tagline_settings = {
deprecated: site_tagline_deprecated
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/map-marker.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/map-marker.js
/**
* WordPress dependencies
*/
-const mapMarker = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const mapMarker = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "https://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: "M12 9c-.8 0-1.5.7-1.5 1.5S11.2 12 12 12s1.5-.7 1.5-1.5S12.8 9 12 9zm0-5c-3.6 0-6.5 2.8-6.5 6.2 0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C18.5 6.8 15.6 4 12 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4z"
}));
/* harmony default export */ var map_marker = (mapMarker);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/level-icon.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/level-icon.js
/**
@@ -34502,18 +34637,18 @@ function LevelIcon(_ref) {
5: 'M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z',
6: 'M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z'
};
- return Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
width: "20",
height: "20",
viewBox: "0 0 20 20",
xmlns: "http://www.w3.org/2000/svg",
isPressed: isPressed
- }, Object(external_wp_element_["createElement"])(external_wp_components_["Path"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: levelToPath[level]
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/level-toolbar.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/level-toolbar.js
/**
@@ -34534,26 +34669,26 @@ function LevelControl(_ref) {
const allControls = [1, 2, 3, 4, 5, 6, 0].map(currentLevel => {
const isActive = currentLevel === level;
return {
- icon: Object(external_wp_element_["createElement"])(LevelIcon, {
+ icon: (0,external_wp_element_namespaceObject.createElement)(LevelIcon, {
level: currentLevel,
isPressed: isActive
}),
- title: currentLevel === 0 ? Object(external_wp_i18n_["__"])('Paragraph') : // translators: %s: heading level e.g: "1", "2", "3"
- Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Heading %d'), currentLevel),
+ title: currentLevel === 0 ? (0,external_wp_i18n_namespaceObject.__)('Paragraph') : // translators: %s: heading level e.g: "1", "2", "3"
+ (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Heading %d'), currentLevel),
isActive,
onClick: () => onChange(currentLevel)
};
});
- return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarDropdownMenu"], {
- label: Object(external_wp_i18n_["__"])('Change heading level'),
- icon: Object(external_wp_element_["createElement"])(LevelIcon, {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Change heading level'),
+ icon: (0,external_wp_element_namespaceObject.createElement)(LevelIcon, {
level: level
}),
controls: allControls
});
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/edit/index.js
/**
@@ -34588,66 +34723,66 @@ function SiteTitleEdit(_ref) {
isLink,
linkTarget
} = attributes;
- const [title, setTitle] = Object(external_wp_coreData_["useEntityProp"])('root', 'site', 'title');
+ const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'title');
const {
canUserEdit,
readOnlyTitle
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
canUser,
getEntityRecord
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
const siteData = getEntityRecord('root', '__unstableBase');
return {
canUserEdit: canUser('update', 'settings'),
- readOnlyTitle: Object(external_wp_htmlEntities_["decodeEntities"])(siteData === null || siteData === void 0 ? void 0 : siteData.name)
+ readOnlyTitle: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteData === null || siteData === void 0 ? void 0 : siteData.name)
};
}, []);
const TagName = level === 0 ? 'p' : `h${level}`;
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign,
'wp-block-site-title__placeholder': !canUserEdit && !readOnlyTitle
})
});
- const siteTitleContent = canUserEdit ? Object(external_wp_element_["createElement"])(TagName, blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ const siteTitleContent = canUserEdit ? (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
tagName: isLink ? 'a' : 'span',
href: isLink ? '#site-title-pseudo-link' : undefined,
- "aria-label": Object(external_wp_i18n_["__"])('Site title text'),
- placeholder: Object(external_wp_i18n_["__"])('Write site title…'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Site title text'),
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site title…'),
value: title,
onChange: setTitle,
allowedFormats: [],
disableLineBreaks: true,
- __unstableOnSplitAtEnd: () => insertBlocksAfter(Object(external_wp_blocks_["createBlock"])(Object(external_wp_blocks_["getDefaultBlockName"])()))
- })) : Object(external_wp_element_["createElement"])(TagName, blockProps, isLink ? Object(external_wp_element_["createElement"])("a", {
+ __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()))
+ })) : (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, isLink ? (0,external_wp_element_namespaceObject.createElement)("a", {
href: "#site-title-pseudo-link",
onClick: event => event.preventDefault()
- }, readOnlyTitle || Object(external_wp_i18n_["__"])('Site Title placeholder')) : Object(external_wp_element_["createElement"])("span", null, title || readOnlyTitle));
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], {
+ }, readOnlyTitle || (0,external_wp_i18n_namespaceObject.__)('Site Title placeholder')) : (0,external_wp_element_namespaceObject.createElement)("span", null, title || readOnlyTitle));
+ 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: "block"
- }, Object(external_wp_element_["createElement"])(LevelControl, {
+ }, (0,external_wp_element_namespaceObject.createElement)(LevelControl, {
level: level,
onChange: newLevel => setAttributes({
level: newLevel
})
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["AlignmentControl"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
textAlign: nextAlign
});
}
- })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Link settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Make title link to home'),
+ })), (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.__)('Link settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Make title link to home'),
onChange: () => setAttributes({
isLink: !isLink
}),
checked: isLink
- }), isLink && Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Open in new tab'),
+ }), isLink && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'),
onChange: value => setAttributes({
linkTarget: value ? '_blank' : '_self'
}),
@@ -34655,7 +34790,7 @@ function SiteTitleEdit(_ref) {
}))), siteTitleContent);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/deprecated.js
/**
* Internal dependencies
*/
@@ -34727,7 +34862,7 @@ const site_title_deprecated_v1 = {
/* harmony default export */ var site_title_deprecated = ([site_title_deprecated_v1]);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/site-title/index.js
/**
* WordPress dependencies
*/
@@ -34805,705 +34940,717 @@ const site_title_settings = {
deprecated: site_title_deprecated
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/share.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/share.js
/**
* WordPress dependencies
*/
-const share = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const share = (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: "M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"
}));
/* harmony default export */ var library_share = (share);
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js
-var keyboard_return = __webpack_require__("btIw");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/wordpress.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-library/build-module/social-link/icons/wordpress.js
/**
* WordPress dependencies
*/
-const WordPressIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const WordPressIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1",
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: "M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/fivehundredpx.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/fivehundredpx.js
/**
* WordPress dependencies
*/
-const FivehundredpxIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const FivehundredpxIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/amazon.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/amazon.js
/**
* WordPress dependencies
*/
-const AmazonIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const AmazonIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M13.582,8.182C11.934,8.367,9.78,8.49,8.238,9.166c-1.781,0.769-3.03,2.337-3.03,4.644 c0,2.953,1.86,4.429,4.253,4.429c2.02,0,3.125-0.477,4.685-2.065c0.516,0.747,0.685,1.109,1.629,1.894 c0.212,0.114,0.483,0.103,0.672-0.066l0.006,0.006c0.567-0.505,1.599-1.401,2.18-1.888c0.231-0.188,0.19-0.496,0.009-0.754 c-0.52-0.718-1.072-1.303-1.072-2.634V8.305c0-1.876,0.133-3.599-1.249-4.891C15.23,2.369,13.422,2,12.04,2 C9.336,2,6.318,3.01,5.686,6.351C5.618,6.706,5.877,6.893,6.109,6.945l2.754,0.298C9.121,7.23,9.308,6.977,9.357,6.72 c0.236-1.151,1.2-1.706,2.284-1.706c0.584,0,1.249,0.215,1.595,0.738c0.398,0.584,0.346,1.384,0.346,2.061V8.182z M13.049,14.088 c-0.451,0.8-1.169,1.291-1.967,1.291c-1.09,0-1.728-0.83-1.728-2.061c0-2.42,2.171-2.86,4.227-2.86v0.615 C13.582,12.181,13.608,13.104,13.049,14.088z M20.683,19.339C18.329,21.076,14.917,22,11.979,22c-4.118,0-7.826-1.522-10.632-4.057 c-0.22-0.199-0.024-0.471,0.241-0.317c3.027,1.762,6.771,2.823,10.639,2.823c2.608,0,5.476-0.541,8.115-1.66 C20.739,18.62,21.072,19.051,20.683,19.339z M21.336,21.043c-0.194,0.163-0.379,0.076-0.293-0.139 c0.284-0.71,0.92-2.298,0.619-2.684c-0.301-0.386-1.99-0.183-2.749-0.092c-0.23,0.027-0.266-0.173-0.059-0.319 c1.348-0.946,3.555-0.673,3.811-0.356C22.925,17.773,22.599,19.986,21.336,21.043z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/bandcamp.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/bandcamp.js
/**
* WordPress dependencies
*/
-const BandcampIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const BandcampIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/behance.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/behance.js
/**
* WordPress dependencies
*/
-const BehanceIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const BehanceIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M7.799,5.698c0.589,0,1.12,0.051,1.606,0.156c0.482,0.102,0.894,0.273,1.241,0.507c0.344,0.235,0.612,0.546,0.804,0.938 c0.188,0.387,0.281,0.871,0.281,1.443c0,0.619-0.141,1.137-0.421,1.551c-0.284,0.413-0.7,0.751-1.255,1.014 c0.756,0.218,1.317,0.601,1.689,1.146c0.374,0.549,0.557,1.205,0.557,1.975c0,0.623-0.12,1.161-0.359,1.612 c-0.241,0.457-0.569,0.828-0.973,1.114c-0.408,0.288-0.876,0.5-1.399,0.637C9.052,17.931,8.514,18,7.963,18H2V5.698H7.799 M7.449,10.668c0.481,0,0.878-0.114,1.192-0.345c0.311-0.228,0.463-0.603,0.463-1.119c0-0.286-0.051-0.523-0.152-0.707 C8.848,8.315,8.711,8.171,8.536,8.07C8.362,7.966,8.166,7.894,7.94,7.854c-0.224-0.044-0.457-0.06-0.697-0.06H4.709v2.874H7.449z M7.6,15.905c0.267,0,0.521-0.024,0.759-0.077c0.243-0.053,0.457-0.137,0.637-0.261c0.182-0.12,0.332-0.283,0.441-0.491 C9.547,14.87,9.6,14.602,9.6,14.278c0-0.633-0.18-1.084-0.533-1.357c-0.356-0.27-0.83-0.404-1.413-0.404H4.709v3.388L7.6,15.905z M16.162,15.864c0.367,0.358,0.897,0.538,1.583,0.538c0.493,0,0.92-0.125,1.277-0.374c0.354-0.248,0.571-0.514,0.654-0.79h2.155 c-0.347,1.072-0.872,1.838-1.589,2.299C19.534,18,18.67,18.23,17.662,18.23c-0.701,0-1.332-0.113-1.899-0.337 c-0.567-0.227-1.041-0.544-1.439-0.958c-0.389-0.415-0.689-0.907-0.904-1.484c-0.213-0.574-0.32-1.21-0.32-1.899 c0-0.666,0.11-1.288,0.329-1.863c0.222-0.577,0.529-1.075,0.933-1.492c0.406-0.42,0.885-0.751,1.444-0.994 c0.558-0.241,1.175-0.363,1.857-0.363c0.754,0,1.414,0.145,1.98,0.44c0.563,0.291,1.026,0.686,1.389,1.181 c0.363,0.493,0.622,1.057,0.783,1.69c0.16,0.632,0.217,1.292,0.171,1.983h-6.428C15.557,14.84,15.795,15.506,16.162,15.864 M18.973,11.184c-0.291-0.321-0.783-0.496-1.384-0.496c-0.39,0-0.714,0.066-0.973,0.2c-0.254,0.132-0.461,0.297-0.621,0.491 c-0.157,0.197-0.265,0.405-0.328,0.628c-0.063,0.217-0.101,0.413-0.111,0.587h3.98C19.478,11.969,19.265,11.509,18.973,11.184z M15.057,7.738h4.985V6.524h-4.985L15.057,7.738z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/chain.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/chain.js
/**
* WordPress dependencies
*/
-const ChainIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const ChainIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M19.647,16.706a1.134,1.134,0,0,0-.343-.833l-2.549-2.549a1.134,1.134,0,0,0-.833-.343,1.168,1.168,0,0,0-.883.392l.233.226q.2.189.264.264a2.922,2.922,0,0,1,.184.233.986.986,0,0,1,.159.312,1.242,1.242,0,0,1,.043.337,1.172,1.172,0,0,1-1.176,1.176,1.237,1.237,0,0,1-.337-.043,1,1,0,0,1-.312-.159,2.76,2.76,0,0,1-.233-.184q-.073-.068-.264-.264l-.226-.233a1.19,1.19,0,0,0-.4.895,1.134,1.134,0,0,0,.343.833L15.837,19.3a1.13,1.13,0,0,0,.833.331,1.18,1.18,0,0,0,.833-.318l1.8-1.789a1.12,1.12,0,0,0,.343-.821Zm-8.615-8.64a1.134,1.134,0,0,0-.343-.833L8.163,4.7a1.134,1.134,0,0,0-.833-.343,1.184,1.184,0,0,0-.833.331L4.7,6.473a1.12,1.12,0,0,0-.343.821,1.134,1.134,0,0,0,.343.833l2.549,2.549a1.13,1.13,0,0,0,.833.331,1.184,1.184,0,0,0,.883-.38L8.728,10.4q-.2-.189-.264-.264A2.922,2.922,0,0,1,8.28,9.9a.986.986,0,0,1-.159-.312,1.242,1.242,0,0,1-.043-.337A1.172,1.172,0,0,1,9.254,8.079a1.237,1.237,0,0,1,.337.043,1,1,0,0,1,.312.159,2.761,2.761,0,0,1,.233.184q.073.068.264.264l.226.233a1.19,1.19,0,0,0,.4-.895ZM22,16.706a3.343,3.343,0,0,1-1.042,2.488l-1.8,1.789a3.536,3.536,0,0,1-4.988-.025l-2.525-2.537a3.384,3.384,0,0,1-1.017-2.488,3.448,3.448,0,0,1,1.078-2.561l-1.078-1.078a3.434,3.434,0,0,1-2.549,1.078,3.4,3.4,0,0,1-2.5-1.029L3.029,9.794A3.4,3.4,0,0,1,2,7.294,3.343,3.343,0,0,1,3.042,4.806l1.8-1.789A3.384,3.384,0,0,1,7.331,2a3.357,3.357,0,0,1,2.5,1.042l2.525,2.537a3.384,3.384,0,0,1,1.017,2.488,3.448,3.448,0,0,1-1.078,2.561l1.078,1.078a3.551,3.551,0,0,1,5.049-.049l2.549,2.549A3.4,3.4,0,0,1,22,16.706Z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/codepen.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/codepen.js
/**
* WordPress dependencies
*/
-const CodepenIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const CodepenIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M22.016,8.84c-0.002-0.013-0.005-0.025-0.007-0.037c-0.005-0.025-0.008-0.048-0.015-0.072 c-0.003-0.015-0.01-0.028-0.013-0.042c-0.008-0.02-0.015-0.04-0.023-0.062c-0.007-0.015-0.013-0.028-0.02-0.042 c-0.008-0.02-0.018-0.037-0.03-0.057c-0.007-0.013-0.017-0.027-0.025-0.038c-0.012-0.018-0.023-0.035-0.035-0.052 c-0.01-0.013-0.02-0.025-0.03-0.037c-0.015-0.017-0.028-0.032-0.043-0.045c-0.01-0.012-0.022-0.023-0.035-0.035 c-0.015-0.015-0.032-0.028-0.048-0.04c-0.012-0.01-0.025-0.02-0.037-0.03c-0.005-0.003-0.01-0.008-0.015-0.012l-9.161-6.096 c-0.289-0.192-0.666-0.192-0.955,0L2.359,8.237C2.354,8.24,2.349,8.245,2.344,8.249L2.306,8.277 c-0.017,0.013-0.033,0.027-0.048,0.04C2.246,8.331,2.234,8.342,2.222,8.352c-0.015,0.015-0.028,0.03-0.042,0.047 c-0.012,0.013-0.022,0.023-0.03,0.037C2.139,8.453,2.125,8.471,2.115,8.488C2.107,8.501,2.099,8.514,2.09,8.526 C2.079,8.548,2.069,8.565,2.06,8.585C2.054,8.6,2.047,8.613,2.04,8.626C2.032,8.648,2.025,8.67,2.019,8.69 c-0.005,0.013-0.01,0.027-0.013,0.042C1.999,8.755,1.995,8.778,1.99,8.803C1.989,8.817,1.985,8.828,1.984,8.84 C1.978,8.879,1.975,8.915,1.975,8.954v6.093c0,0.037,0.003,0.075,0.008,0.112c0.002,0.012,0.005,0.025,0.007,0.038 c0.005,0.023,0.008,0.047,0.015,0.072c0.003,0.015,0.008,0.028,0.013,0.04c0.007,0.022,0.013,0.042,0.022,0.063 c0.007,0.015,0.013,0.028,0.02,0.04c0.008,0.02,0.018,0.038,0.03,0.058c0.007,0.013,0.015,0.027,0.025,0.038 c0.012,0.018,0.023,0.035,0.035,0.052c0.01,0.013,0.02,0.025,0.03,0.037c0.013,0.015,0.028,0.032,0.042,0.045 c0.012,0.012,0.023,0.023,0.035,0.035c0.015,0.013,0.032,0.028,0.048,0.04l0.038,0.03c0.005,0.003,0.01,0.007,0.013,0.01 l9.163,6.095C11.668,21.953,11.833,22,12,22c0.167,0,0.332-0.047,0.478-0.144l9.163-6.095l0.015-0.01 c0.013-0.01,0.027-0.02,0.037-0.03c0.018-0.013,0.035-0.028,0.048-0.04c0.013-0.012,0.025-0.023,0.035-0.035 c0.017-0.015,0.03-0.032,0.043-0.045c0.01-0.013,0.02-0.025,0.03-0.037c0.013-0.018,0.025-0.035,0.035-0.052 c0.008-0.013,0.018-0.027,0.025-0.038c0.012-0.02,0.022-0.038,0.03-0.058c0.007-0.013,0.013-0.027,0.02-0.04 c0.008-0.022,0.015-0.042,0.023-0.063c0.003-0.013,0.01-0.027,0.013-0.04c0.007-0.025,0.01-0.048,0.015-0.072 c0.002-0.013,0.005-0.027,0.007-0.037c0.003-0.042,0.007-0.079,0.007-0.117V8.954C22.025,8.915,22.022,8.879,22.016,8.84z M12.862,4.464l6.751,4.49l-3.016,2.013l-3.735-2.492V4.464z M11.138,4.464v4.009l-3.735,2.494L4.389,8.954L11.138,4.464z M3.699,10.562L5.853,12l-2.155,1.438V10.562z M11.138,19.536l-6.749-4.491l3.015-2.011l3.735,2.492V19.536z M12,14.035L8.953,12 L12,9.966L15.047,12L12,14.035z M12.862,19.536v-4.009l3.735-2.492l3.016,2.011L12.862,19.536z M20.303,13.438L18.147,12 l2.156-1.438L20.303,13.438z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/deviantart.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/deviantart.js
/**
* WordPress dependencies
*/
-const DeviantArtIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const DeviantArtIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/dribbble.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/dribbble.js
/**
* WordPress dependencies
*/
-const DribbbleIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const DribbbleIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/dropbox.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/dropbox.js
/**
* WordPress dependencies
*/
-const DropboxIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const DropboxIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M12,6.134L6.069,9.797L2,6.54l5.883-3.843L12,6.134z M2,13.054l5.883,3.843L12,13.459L6.069,9.797L2,13.054z M12,13.459 l4.116,3.439L22,13.054l-4.069-3.257L12,13.459z M22,6.54l-5.884-3.843L12,6.134l5.931,3.663L22,6.54z M12.011,14.2l-4.129,3.426 l-1.767-1.153v1.291l5.896,3.539l5.897-3.539v-1.291l-1.769,1.153L12.011,14.2z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/etsy.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/etsy.js
/**
* WordPress dependencies
*/
-const EtsyIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const EtsyIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M9.16033,4.038c0-.27174.02717-.43478.48913-.43478h6.22283c1.087,0,1.68478.92391,2.11957,2.663l.35326,1.38587h1.05978C19.59511,3.712,19.75815,2,19.75815,2s-2.663.29891-4.23913.29891h-7.962L3.29076,2.163v1.1413L4.731,3.57609c1.00543.19022,1.25.40761,1.33152,1.33152,0,0,.08152,2.71739.08152,7.20109s-.08152,7.17391-.08152,7.17391c0,.81522-.32609,1.11413-1.33152,1.30435l-1.44022.27174V22l4.2663-.13587h7.11957c1.60326,0,5.32609.13587,5.32609.13587.08152-.97826.625-5.40761.70652-5.89674H19.7038L18.644,18.52174c-.84239,1.90217-2.06522,2.038-3.42391,2.038H11.1712c-1.3587,0-2.01087-.54348-2.01087-1.712V12.65217s3.0163,0,3.99457.08152c.76087.05435,1.22283.27174,1.46739,1.33152l.32609,1.413h1.16848l-.08152-3.55978.163-3.587H15.02989l-.38043,1.57609c-.24457,1.03261-.40761,1.22283-1.46739,1.33152-1.38587.13587-4.02174.1087-4.02174.1087Z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/facebook.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/facebook.js
/**
* WordPress dependencies
*/
-const FacebookIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const FacebookIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/feed.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/feed.js
/**
* WordPress dependencies
*/
-const FeedIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const FeedIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M2,8.667V12c5.515,0,10,4.485,10,10h3.333C15.333,14.637,9.363,8.667,2,8.667z M2,2v3.333 c9.19,0,16.667,7.477,16.667,16.667H22C22,10.955,13.045,2,2,2z M4.5,17C3.118,17,2,18.12,2,19.5S3.118,22,4.5,22S7,20.88,7,19.5 S5.882,17,4.5,17z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/flickr.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/flickr.js
/**
* WordPress dependencies
*/
-const FlickrIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const FlickrIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M6.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5S9.25,7,6.5,7z M17.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5 S20.25,7,17.5,7z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/foursquare.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/foursquare.js
/**
* WordPress dependencies
*/
-const FoursquareIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const FoursquareIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M17.573,2c0,0-9.197,0-10.668,0S5,3.107,5,3.805s0,16.948,0,16.948c0,0.785,0.422,1.077,0.66,1.172 c0.238,0.097,0.892,0.177,1.285-0.275c0,0,5.035-5.843,5.122-5.93c0.132-0.132,0.132-0.132,0.262-0.132h3.26 c1.368,0,1.588-0.977,1.732-1.552c0.078-0.318,0.692-3.428,1.225-6.122l0.675-3.368C19.56,2.893,19.14,2,17.573,2z M16.495,7.22 c-0.053,0.252-0.372,0.518-0.665,0.518c-0.293,0-4.157,0-4.157,0c-0.467,0-0.802,0.318-0.802,0.787v0.508 c0,0.467,0.337,0.798,0.805,0.798c0,0,3.197,0,3.528,0s0.655,0.362,0.583,0.715c-0.072,0.353-0.407,2.102-0.448,2.295 c-0.04,0.193-0.262,0.523-0.655,0.523c-0.33,0-2.88,0-2.88,0c-0.523,0-0.683,0.068-1.033,0.503 c-0.35,0.437-3.505,4.223-3.505,4.223c-0.032,0.035-0.063,0.027-0.063-0.015V4.852c0-0.298,0.26-0.648,0.648-0.648 c0,0,8.228,0,8.562,0c0.315,0,0.61,0.297,0.528,0.683L16.495,7.22z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/goodreads.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/goodreads.js
/**
* WordPress dependencies
*/
-const GoodreadsIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const GoodreadsIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M17.3,17.5c-0.2,0.8-0.5,1.4-1,1.9c-0.4,0.5-1,0.9-1.7,1.2C13.9,20.9,13.1,21,12,21c-0.6,0-1.3-0.1-1.9-0.2 c-0.6-0.1-1.1-0.4-1.6-0.7c-0.5-0.3-0.9-0.7-1.2-1.2c-0.3-0.5-0.5-1.1-0.5-1.7h1.5c0.1,0.5,0.2,0.9,0.5,1.2 c0.2,0.3,0.5,0.6,0.9,0.8c0.3,0.2,0.7,0.3,1.1,0.4c0.4,0.1,0.8,0.1,1.2,0.1c1.4,0,2.5-0.4,3.1-1.2c0.6-0.8,1-2,1-3.5v-1.7h0 c-0.4,0.8-0.9,1.4-1.6,1.9c-0.7,0.5-1.5,0.7-2.4,0.7c-1,0-1.9-0.2-2.6-0.5C8.7,15,8.1,14.5,7.7,14c-0.5-0.6-0.8-1.3-1-2.1 c-0.2-0.8-0.3-1.6-0.3-2.5c0-0.9,0.1-1.7,0.4-2.5c0.3-0.8,0.6-1.5,1.1-2c0.5-0.6,1.1-1,1.8-1.4C10.3,3.2,11.1,3,12,3 c0.5,0,0.9,0.1,1.3,0.2c0.4,0.1,0.8,0.3,1.1,0.5c0.3,0.2,0.6,0.5,0.9,0.8c0.3,0.3,0.5,0.6,0.6,1h0V3.4h1.5V15 C17.6,15.9,17.5,16.7,17.3,17.5z M13.8,14.1c0.5-0.3,0.9-0.7,1.3-1.1c0.3-0.5,0.6-1,0.8-1.6c0.2-0.6,0.3-1.2,0.3-1.9 c0-0.6-0.1-1.2-0.2-1.9c-0.1-0.6-0.4-1.2-0.7-1.7c-0.3-0.5-0.7-0.9-1.3-1.2c-0.5-0.3-1.1-0.5-1.9-0.5s-1.4,0.2-1.9,0.5 c-0.5,0.3-1,0.7-1.3,1.2C8.5,6.4,8.3,7,8.1,7.6C8,8.2,7.9,8.9,7.9,9.5c0,0.6,0.1,1.3,0.2,1.9C8.3,12,8.6,12.5,8.9,13 c0.3,0.5,0.8,0.8,1.3,1.1c0.5,0.3,1.1,0.4,1.9,0.4C12.7,14.5,13.3,14.4,13.8,14.1z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/google.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/google.js
/**
* WordPress dependencies
*/
-const GoogleIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const GoogleIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M12.02,10.18v3.72v0.01h5.51c-0.26,1.57-1.67,4.22-5.5,4.22c-3.31,0-6.01-2.75-6.01-6.12s2.7-6.12,6.01-6.12 c1.87,0,3.13,0.8,3.85,1.48l2.84-2.76C16.99,2.99,14.73,2,12.03,2c-5.52,0-10,4.48-10,10s4.48,10,10,10c5.77,0,9.6-4.06,9.6-9.77 c0-0.83-0.11-1.42-0.25-2.05H12.02z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/github.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/github.js
/**
* WordPress dependencies
*/
-const GitHubIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const GitHubIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/instagram.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/instagram.js
/**
* WordPress dependencies
*/
-const InstagramIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const InstagramIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/lastfm.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/lastfm.js
/**
* WordPress dependencies
*/
-const LastfmIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const LastfmIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M 12.0002 1.5 C 6.2006 1.5 1.5 6.2011 1.5 11.9998 C 1.5 17.799 6.2006 22.5 12.0002 22.5 C 17.799 22.5 22.5 17.799 22.5 11.9998 C 22.5 6.2011 17.799 1.5 12.0002 1.5 Z M 16.1974 16.2204 C 14.8164 16.2152 13.9346 15.587 13.3345 14.1859 L 13.1816 13.8451 L 11.8541 10.8101 C 11.4271 9.7688 10.3526 9.0712 9.1801 9.0712 C 7.5695 9.0712 6.2593 10.3851 6.2593 12.001 C 6.2593 13.6165 7.5695 14.9303 9.1801 14.9303 C 10.272 14.9303 11.2651 14.3275 11.772 13.3567 C 11.7893 13.3235 11.8239 13.302 11.863 13.3038 C 11.9007 13.3054 11.9353 13.3288 11.9504 13.3632 L 12.4865 14.6046 C 12.5016 14.639 12.4956 14.6778 12.4723 14.7069 C 11.6605 15.6995 10.4602 16.2683 9.1801 16.2683 C 6.8331 16.2683 4.9234 14.3536 4.9234 12.001 C 4.9234 9.6468 6.833 7.732 9.1801 7.732 C 10.9572 7.732 12.3909 8.6907 13.1138 10.3636 C 13.1206 10.3802 13.8412 12.0708 14.4744 13.5191 C 14.8486 14.374 15.1462 14.896 16.1288 14.9292 C 17.0663 14.9613 17.7538 14.4122 17.7538 13.6485 C 17.7538 12.9691 17.3321 12.8004 16.3803 12.4822 C 14.7365 11.9398 13.845 11.3861 13.845 10.0182 C 13.845 8.6809 14.7667 7.8162 16.192 7.8162 C 17.1288 7.8162 17.8155 8.2287 18.2921 9.0768 C 18.305 9.1006 18.3079 9.1281 18.3004 9.1542 C 18.2929 9.1803 18.2748 9.2021 18.2507 9.2138 L 17.3614 9.669 C 17.3178 9.692 17.2643 9.6781 17.2356 9.6385 C 16.9329 9.2135 16.5956 9.0251 16.1423 9.0251 C 15.5512 9.0251 15.122 9.429 15.122 9.9865 C 15.122 10.6738 15.6529 10.8414 16.5339 11.1192 C 16.6491 11.1558 16.7696 11.194 16.8939 11.2343 C 18.2763 11.6865 19.0768 12.2311 19.0768 13.6836 C 19.0769 15.1297 17.8389 16.2204 16.1974 16.2204 Z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/linkedin.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/linkedin.js
/**
* WordPress dependencies
*/
-const LinkedInIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const LinkedInIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/mail.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/mail.js
/**
* WordPress dependencies
*/
-const MailIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const MailIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M20,4H4C2.895,4,2,4.895,2,6v12c0,1.105,0.895,2,2,2h16c1.105,0,2-0.895,2-2V6C22,4.895,21.105,4,20,4z M20,8.236l-8,4.882 L4,8.236V6h16V8.236z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/mastodon.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/mastodon.js
/**
* WordPress dependencies
*/
-const MastodonIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const MastodonIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M23.193 7.879c0-5.206-3.411-6.732-3.411-6.732C18.062.357 15.108.025 12.041 0h-.076c-3.068.025-6.02.357-7.74 1.147 0 0-3.411 1.526-3.411 6.732 0 1.192-.023 2.618.015 4.129.124 5.092.934 10.109 5.641 11.355 2.17.574 4.034.695 5.535.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.129.539c-2.165-.074-4.449-.233-4.799-2.891a5.499 5.499 0 0 1-.048-.745s2.125.52 4.817.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.507.475-6.507zm-4.024 6.709h-2.497V8.469c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.312v3.349h-2.483v-3.35c0-1.536-.602-2.312-1.802-2.312-1.085 0-1.628.655-1.628 1.944v6.119H4.832V8.284c0-1.289.328-2.313.987-3.07.68-.758 1.569-1.146 2.674-1.146 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.304z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/meetup.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/meetup.js
/**
* WordPress dependencies
*/
-const MeetupIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const MeetupIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M19.24775,14.722a3.57032,3.57032,0,0,1-2.94457,3.52073,3.61886,3.61886,0,0,1-.64652.05634c-.07314-.0008-.10187.02846-.12507.09547A2.38881,2.38881,0,0,1,13.49453,20.094a2.33092,2.33092,0,0,1-1.827-.50716.13635.13635,0,0,0-.19878-.00408,3.191,3.191,0,0,1-2.104.60248,3.26309,3.26309,0,0,1-3.00324-2.71993,2.19076,2.19076,0,0,1-.03512-.30865c-.00156-.08579-.03413-.1189-.11608-.13493a2.86421,2.86421,0,0,1-1.23189-.56111,2.945,2.945,0,0,1-1.166-2.05749,2.97484,2.97484,0,0,1,.87524-2.50774.112.112,0,0,0,.02091-.16107,2.7213,2.7213,0,0,1-.36648-1.48A2.81256,2.81256,0,0,1,6.57673,7.58838a.35764.35764,0,0,0,.28869-.22819,4.2208,4.2208,0,0,1,6.02892-1.90111.25161.25161,0,0,0,.22023.0243,3.65608,3.65608,0,0,1,3.76031.90678A3.57244,3.57244,0,0,1,17.95918,8.626a2.97339,2.97339,0,0,1,.01829.57356.10637.10637,0,0,0,.0853.12792,1.97669,1.97669,0,0,1,1.27939,1.33733,2.00266,2.00266,0,0,1-.57112,2.12652c-.05284.05166-.04168.08328-.01173.13489A3.51189,3.51189,0,0,1,19.24775,14.722Zm-6.35959-.27836a1.6984,1.6984,0,0,0,1.14556,1.61113,3.82039,3.82039,0,0,0,1.036.17935,1.46888,1.46888,0,0,0,.73509-.12255.44082.44082,0,0,0,.26057-.44274.45312.45312,0,0,0-.29211-.43375.97191.97191,0,0,0-.20678-.063c-.21326-.03806-.42754-.0701-.63973-.11215a.54787.54787,0,0,1-.50172-.60926,2.75864,2.75864,0,0,1,.1773-.901c.1763-.535.414-1.045.64183-1.55913A12.686,12.686,0,0,0,15.85,10.47863a1.58461,1.58461,0,0,0,.04861-.87208,1.04531,1.04531,0,0,0-.85432-.83981,1.60658,1.60658,0,0,0-1.23654.16594.27593.27593,0,0,1-.36286-.03413c-.085-.0747-.16594-.15379-.24918-.23055a.98682.98682,0,0,0-1.33577-.04933,6.1468,6.1468,0,0,1-.4989.41615.47762.47762,0,0,1-.51535.03566c-.17448-.09307-.35512-.175-.53531-.25665a1.74949,1.74949,0,0,0-.56476-.2016,1.69943,1.69943,0,0,0-1.61654.91787,8.05815,8.05815,0,0,0-.32952.80126c-.45471,1.2557-.82507,2.53825-1.20838,3.81639a1.24151,1.24151,0,0,0,.51532,1.44389,1.42659,1.42659,0,0,0,1.22008.17166,1.09728,1.09728,0,0,0,.66994-.69764c.44145-1.04111.839-2.09989,1.25981-3.14926.11581-.28876.22792-.57874.35078-.86438a.44548.44548,0,0,1,.69189-.19539.50521.50521,0,0,1,.15044.43836,1.75625,1.75625,0,0,1-.14731.50453c-.27379.69219-.55265,1.38236-.82766,2.074a2.0836,2.0836,0,0,0-.14038.42876.50719.50719,0,0,0,.27082.57722.87236.87236,0,0,0,.66145.02739.99137.99137,0,0,0,.53406-.532q.61571-1.20914,1.228-2.42031.28423-.55863.57585-1.1133a.87189.87189,0,0,1,.29055-.35253.34987.34987,0,0,1,.37634-.01265.30291.30291,0,0,1,.12434.31459.56716.56716,0,0,1-.04655.1915c-.05318.12739-.10286.25669-.16183.38156-.34118.71775-.68754,1.43273-1.02568,2.152A2.00213,2.00213,0,0,0,12.88816,14.44366Zm4.78568,5.28972a.88573.88573,0,0,0-1.77139.00465.8857.8857,0,0,0,1.77139-.00465Zm-14.83838-7.296a.84329.84329,0,1,0,.00827-1.68655.8433.8433,0,0,0-.00827,1.68655Zm10.366-9.43673a.83506.83506,0,1,0-.0091,1.67.83505.83505,0,0,0,.0091-1.67Zm6.85014,5.22a.71651.71651,0,0,0-1.433.0093.71656.71656,0,0,0,1.433-.0093ZM5.37528,6.17908A.63823.63823,0,1,0,6.015,5.54483.62292.62292,0,0,0,5.37528,6.17908Zm6.68214,14.80843a.54949.54949,0,1,0-.55052.541A.54556.54556,0,0,0,12.05742,20.98752Zm8.53235-8.49689a.54777.54777,0,0,0-.54027.54023.53327.53327,0,0,0,.532.52293.51548.51548,0,0,0,.53272-.5237A.53187.53187,0,0,0,20.58977,12.49063ZM7.82846,2.4715a.44927.44927,0,1,0,.44484.44766A.43821.43821,0,0,0,7.82846,2.4715Zm13.775,7.60492a.41186.41186,0,0,0-.40065.39623.40178.40178,0,0,0,.40168.40168A.38994.38994,0,0,0,22,10.48172.39946.39946,0,0,0,21.60349,10.07642ZM5.79193,17.96207a.40469.40469,0,0,0-.397-.39646.399.399,0,0,0-.396.405.39234.39234,0,0,0,.39939.389A.39857.39857,0,0,0,5.79193,17.96207Z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/medium.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/medium.js
/**
* WordPress dependencies
*/
-const MediumIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const MediumIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M20.962,7.257l-5.457,8.867l-3.923-6.375l3.126-5.08c0.112-0.182,0.319-0.286,0.527-0.286c0.05,0,0.1,0.008,0.149,0.02 c0.039,0.01,0.078,0.023,0.114,0.041l5.43,2.715l0.006,0.003c0.004,0.002,0.007,0.006,0.011,0.008 C20.971,7.191,20.98,7.227,20.962,7.257z M9.86,8.592v5.783l5.14,2.57L9.86,8.592z M15.772,17.331l4.231,2.115 C20.554,19.721,21,19.529,21,19.016V8.835L15.772,17.331z M8.968,7.178L3.665,4.527C3.569,4.479,3.478,4.456,3.395,4.456 C3.163,4.456,3,4.636,3,4.938v11.45c0,0.306,0.224,0.669,0.498,0.806l4.671,2.335c0.12,0.06,0.234,0.088,0.337,0.088 c0.29,0,0.494-0.225,0.494-0.602V7.231C9,7.208,8.988,7.188,8.968,7.178z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/patreon.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/patreon.js
/**
* WordPress dependencies
*/
-const PatreonIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const PatreonIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 569 546",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Circle"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Circle, {
cx: "363",
cy: "205",
r: "205"
-}), Object(external_wp_element_["createElement"])(external_wp_primitives_["Rect"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Rect, {
width: "100",
height: "546",
x: "0",
y: "0"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/pinterest.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/pinterest.js
/**
* WordPress dependencies
*/
-const PinterestIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const PinterestIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_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"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/pocket.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/pocket.js
/**
* WordPress dependencies
*/
-const PocketIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const PocketIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M21.927,4.194C21.667,3.48,20.982,3,20.222,3h-0.01h-1.721H3.839C3.092,3,2.411,3.47,2.145,4.17 C2.066,4.378,2.026,4.594,2.026,4.814v6.035l0.069,1.2c0.29,2.73,1.707,5.115,3.899,6.778c0.039,0.03,0.079,0.059,0.119,0.089 l0.025,0.018c1.175,0.859,2.491,1.441,3.91,1.727c0.655,0.132,1.325,0.2,1.991,0.2c0.615,0,1.232-0.057,1.839-0.17 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.297,2.621-0.864,3.753-1.691l0.025-0.018 c0.04-0.029,0.08-0.058,0.119-0.089c2.192-1.664,3.609-4.049,3.898-6.778l0.069-1.2V4.814C22.026,4.605,22,4.398,21.927,4.194z M17.692,10.481l-4.704,4.512c-0.266,0.254-0.608,0.382-0.949,0.382c-0.342,0-0.684-0.128-0.949-0.382l-4.705-4.512 C5.838,9.957,5.82,9.089,6.344,8.542c0.524-0.547,1.392-0.565,1.939-0.04l3.756,3.601l3.755-3.601 c0.547-0.524,1.415-0.506,1.939,0.04C18.256,9.089,18.238,9.956,17.692,10.481z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/reddit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/reddit.js
/**
* WordPress dependencies
*/
-const RedditIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const RedditIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M22,11.816c0-1.256-1.021-2.277-2.277-2.277c-0.593,0-1.122,0.24-1.526,0.614c-1.481-0.965-3.455-1.594-5.647-1.69 l1.171-3.702l3.18,0.748c0.008,1.028,0.846,1.862,1.876,1.862c1.035,0,1.877-0.842,1.877-1.878c0-1.035-0.842-1.877-1.877-1.877 c-0.769,0-1.431,0.466-1.72,1.13l-3.508-0.826c-0.203-0.047-0.399,0.067-0.46,0.261l-1.35,4.268 c-2.316,0.038-4.411,0.67-5.97,1.671C5.368,9.765,4.853,9.539,4.277,9.539C3.021,9.539,2,10.56,2,11.816 c0,0.814,0.433,1.523,1.078,1.925c-0.037,0.221-0.061,0.444-0.061,0.672c0,3.292,4.011,5.97,8.941,5.97s8.941-2.678,8.941-5.97 c0-0.214-0.02-0.424-0.053-0.632C21.533,13.39,22,12.661,22,11.816z M18.776,4.394c0.606,0,1.1,0.493,1.1,1.1s-0.493,1.1-1.1,1.1 s-1.1-0.494-1.1-1.1S18.169,4.394,18.776,4.394z M2.777,11.816c0-0.827,0.672-1.5,1.499-1.5c0.313,0,0.598,0.103,0.838,0.269 c-0.851,0.676-1.477,1.479-1.812,2.36C2.983,12.672,2.777,12.27,2.777,11.816z M11.959,19.606c-4.501,0-8.164-2.329-8.164-5.193 S7.457,9.22,11.959,9.22s8.164,2.329,8.164,5.193S16.46,19.606,11.959,19.606z M20.636,13.001c-0.326-0.89-0.948-1.701-1.797-2.384 c0.248-0.186,0.55-0.301,0.883-0.301c0.827,0,1.5,0.673,1.5,1.5C21.223,12.299,20.992,12.727,20.636,13.001z M8.996,14.704 c-0.76,0-1.397-0.616-1.397-1.376c0-0.76,0.637-1.397,1.397-1.397c0.76,0,1.376,0.637,1.376,1.397 C10.372,14.088,9.756,14.704,8.996,14.704z M16.401,13.328c0,0.76-0.616,1.376-1.376,1.376c-0.76,0-1.399-0.616-1.399-1.376 c0-0.76,0.639-1.397,1.399-1.397C15.785,11.931,16.401,12.568,16.401,13.328z M15.229,16.708c0.152,0.152,0.152,0.398,0,0.55 c-0.674,0.674-1.727,1.002-3.219,1.002c-0.004,0-0.007-0.002-0.011-0.002c-0.004,0-0.007,0.002-0.011,0.002 c-1.492,0-2.544-0.328-3.218-1.002c-0.152-0.152-0.152-0.398,0-0.55c0.152-0.152,0.399-0.151,0.55,0 c0.521,0.521,1.394,0.775,2.669,0.775c0.004,0,0.007,0.002,0.011,0.002c0.004,0,0.007-0.002,0.011-0.002 c1.275,0,2.148-0.253,2.669-0.775C14.831,16.556,15.078,16.556,15.229,16.708z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/skype.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/skype.js
/**
* WordPress dependencies
*/
-const SkypeIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const SkypeIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M10.113,2.699c0.033-0.006,0.067-0.013,0.1-0.02c0.033,0.017,0.066,0.033,0.098,0.051L10.113,2.699z M2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223z M21.275,13.771 c0.007-0.035,0.011-0.071,0.018-0.106c-0.018-0.031-0.033-0.064-0.052-0.095L21.275,13.771z M13.563,21.199 c0.032,0.019,0.065,0.035,0.096,0.053c0.036-0.006,0.071-0.011,0.105-0.017L13.563,21.199z M22,16.386 c0,1.494-0.581,2.898-1.637,3.953c-1.056,1.057-2.459,1.637-3.953,1.637c-0.967,0-1.914-0.251-2.75-0.725 c0.036-0.006,0.071-0.011,0.105-0.017l-0.202-0.035c0.032,0.019,0.065,0.035,0.096,0.053c-0.543,0.096-1.099,0.147-1.654,0.147 c-1.275,0-2.512-0.25-3.676-0.743c-1.125-0.474-2.135-1.156-3.002-2.023c-0.867-0.867-1.548-1.877-2.023-3.002 c-0.493-1.164-0.743-2.401-0.743-3.676c0-0.546,0.049-1.093,0.142-1.628c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103C2.244,9.5,2,8.566,2,7.615c0-1.493,0.582-2.898,1.637-3.953 c1.056-1.056,2.46-1.638,3.953-1.638c0.915,0,1.818,0.228,2.622,0.655c-0.033,0.007-0.067,0.013-0.1,0.02l0.199,0.031 c-0.032-0.018-0.066-0.034-0.098-0.051c0.002,0,0.003-0.001,0.004-0.001c0.586-0.112,1.187-0.169,1.788-0.169 c1.275,0,2.512,0.249,3.676,0.742c1.124,0.476,2.135,1.156,3.002,2.024c0.868,0.867,1.548,1.877,2.024,3.002 c0.493,1.164,0.743,2.401,0.743,3.676c0,0.575-0.054,1.15-0.157,1.712c-0.018-0.031-0.033-0.064-0.052-0.095l0.034,0.201 c0.007-0.035,0.011-0.071,0.018-0.106C21.754,14.494,22,15.432,22,16.386z M16.817,14.138c0-1.331-0.613-2.743-3.033-3.282 l-2.209-0.49c-0.84-0.192-1.807-0.444-1.807-1.237c0-0.794,0.679-1.348,1.903-1.348c2.468,0,2.243,1.696,3.468,1.696 c0.645,0,1.209-0.379,1.209-1.031c0-1.521-2.435-2.663-4.5-2.663c-2.242,0-4.63,0.952-4.63,3.488c0,1.221,0.436,2.521,2.839,3.123 l2.984,0.745c0.903,0.223,1.129,0.731,1.129,1.189c0,0.762-0.758,1.507-2.129,1.507c-2.679,0-2.307-2.062-3.743-2.062 c-0.645,0-1.113,0.444-1.113,1.078c0,1.236,1.501,2.886,4.856,2.886C15.236,17.737,16.817,16.199,16.817,14.138z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/snapchat.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/snapchat.js
/**
* WordPress dependencies
*/
-const SnapchatIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const SnapchatIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M12.065,2a5.526,5.526,0,0,1,3.132.892A5.854,5.854,0,0,1,17.326,5.4a5.821,5.821,0,0,1,.351,2.33q0,.612-.117,2.487a.809.809,0,0,0,.365.091,1.93,1.93,0,0,0,.664-.176,1.93,1.93,0,0,1,.664-.176,1.3,1.3,0,0,1,.729.234.7.7,0,0,1,.351.6.839.839,0,0,1-.41.7,2.732,2.732,0,0,1-.9.41,3.192,3.192,0,0,0-.9.378.728.728,0,0,0-.41.618,1.575,1.575,0,0,0,.156.56,6.9,6.9,0,0,0,1.334,1.953,5.6,5.6,0,0,0,1.881,1.315,5.875,5.875,0,0,0,1.042.3.42.42,0,0,1,.365.456q0,.911-2.852,1.341a1.379,1.379,0,0,0-.143.507,1.8,1.8,0,0,1-.182.605.451.451,0,0,1-.429.241,5.878,5.878,0,0,1-.807-.085,5.917,5.917,0,0,0-.833-.085,4.217,4.217,0,0,0-.807.065,2.42,2.42,0,0,0-.82.293,6.682,6.682,0,0,0-.755.5q-.351.267-.755.527a3.886,3.886,0,0,1-.989.436A4.471,4.471,0,0,1,11.831,22a4.307,4.307,0,0,1-1.256-.176,3.784,3.784,0,0,1-.976-.436q-.4-.26-.749-.527a6.682,6.682,0,0,0-.755-.5,2.422,2.422,0,0,0-.807-.293,4.432,4.432,0,0,0-.82-.065,5.089,5.089,0,0,0-.853.1,5,5,0,0,1-.762.1.474.474,0,0,1-.456-.241,1.819,1.819,0,0,1-.182-.618,1.411,1.411,0,0,0-.143-.521q-2.852-.429-2.852-1.341a.42.42,0,0,1,.365-.456,5.793,5.793,0,0,0,1.042-.3,5.524,5.524,0,0,0,1.881-1.315,6.789,6.789,0,0,0,1.334-1.953A1.575,1.575,0,0,0,6,12.9a.728.728,0,0,0-.41-.618,3.323,3.323,0,0,0-.9-.384,2.912,2.912,0,0,1-.9-.41.814.814,0,0,1-.41-.684.71.71,0,0,1,.338-.593,1.208,1.208,0,0,1,.716-.241,1.976,1.976,0,0,1,.625.169,2.008,2.008,0,0,0,.69.169.919.919,0,0,0,.416-.091q-.117-1.849-.117-2.474A5.861,5.861,0,0,1,6.385,5.4,5.516,5.516,0,0,1,8.625,2.819,7.075,7.075,0,0,1,12.062,2Z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/soundcloud.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/soundcloud.js
/**
* WordPress dependencies
*/
-const SoundCloudIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const SoundCloudIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M8.9,16.1L9,14L8.9,9.5c0-0.1,0-0.1-0.1-0.1c0,0-0.1-0.1-0.1-0.1c-0.1,0-0.1,0-0.1,0.1c0,0-0.1,0.1-0.1,0.1L8.3,14l0.1,2.1 c0,0.1,0,0.1,0.1,0.1c0,0,0.1,0.1,0.1,0.1C8.8,16.3,8.9,16.3,8.9,16.1z M11.4,15.9l0.1-1.8L11.4,9c0-0.1,0-0.2-0.1-0.2 c0,0-0.1,0-0.1,0s-0.1,0-0.1,0c-0.1,0-0.1,0.1-0.1,0.2l0,0.1l-0.1,5c0,0,0,0.7,0.1,2v0c0,0.1,0,0.1,0.1,0.1c0.1,0.1,0.1,0.1,0.2,0.1 c0.1,0,0.1,0,0.2-0.1c0.1,0,0.1-0.1,0.1-0.2L11.4,15.9z M2.4,12.9L2.5,14l-0.2,1.1c0,0.1,0,0.1-0.1,0.1c0,0-0.1,0-0.1-0.1L2.1,14 l0.1-1.1C2.2,12.9,2.3,12.9,2.4,12.9C2.3,12.9,2.4,12.9,2.4,12.9z M3.1,12.2L3.3,14l-0.2,1.8c0,0.1,0,0.1-0.1,0.1 c-0.1,0-0.1,0-0.1-0.1L2.8,14L3,12.2C3,12.2,3,12.2,3.1,12.2C3.1,12.2,3.1,12.2,3.1,12.2z M3.9,11.9L4.1,14l-0.2,2.1 c0,0.1,0,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L3.5,14l0.2-2.1c0-0.1,0-0.1,0.1-0.1C3.9,11.8,3.9,11.8,3.9,11.9z M4.7,11.9L4.9,14 l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L4.3,14l0.2-2.2c0-0.1,0-0.1,0.1-0.1C4.7,11.7,4.7,11.8,4.7,11.9z M5.6,12 l0.2,2l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c0,0-0.1,0-0.1,0c0,0,0-0.1,0-0.1L5.1,14l0.2-2c0,0,0-0.1,0-0.1s0.1,0,0.1,0 C5.5,11.9,5.5,11.9,5.6,12L5.6,12z M6.4,10.7L6.6,14l-0.2,2.1c0,0,0,0.1,0,0.1c0,0-0.1,0-0.1,0c-0.1,0-0.1-0.1-0.2-0.2L5.9,14 l0.2-3.3c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0C6.4,10.7,6.4,10.7,6.4,10.7z M7.2,10l0.2,4.1l-0.2,2.1c0,0,0,0.1,0,0.1 c0,0-0.1,0-0.1,0c-0.1,0-0.2-0.1-0.2-0.2l-0.1-2.1L6.8,10c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0S7.2,9.9,7.2,10z M8,9.6L8.2,14 L8,16.1c0,0.1-0.1,0.2-0.2,0.2c-0.1,0-0.2-0.1-0.2-0.2L7.5,14l0.1-4.4c0-0.1,0-0.1,0.1-0.1c0,0,0.1-0.1,0.1-0.1c0.1,0,0.1,0,0.1,0.1 C8,9.6,8,9.6,8,9.6z M11.4,16.1L11.4,16.1L11.4,16.1z M9.7,9.6L9.8,14l-0.1,2.1c0,0.1,0,0.1-0.1,0.2s-0.1,0.1-0.2,0.1 c-0.1,0-0.1,0-0.1-0.1s-0.1-0.1-0.1-0.2L9.2,14l0.1-4.4c0-0.1,0-0.1,0.1-0.2s0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S9.7,9.5,9.7,9.6 L9.7,9.6z M10.6,9.8l0.1,4.3l-0.1,2c0,0.1,0,0.1-0.1,0.2c0,0-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c0,0-0.1-0.1-0.1-0.2L10,14 l0.1-4.3c0-0.1,0-0.1,0.1-0.2c0,0,0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S10.6,9.7,10.6,9.8z M12.4,14l-0.1,2c0,0.1,0,0.1-0.1,0.2 c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2l-0.1-1l-0.1-1l0.1-5.5v0c0-0.1,0-0.2,0.1-0.2 c0.1,0,0.1-0.1,0.2-0.1c0,0,0.1,0,0.1,0c0.1,0,0.1,0.1,0.1,0.2L12.4,14z M22.1,13.9c0,0.7-0.2,1.3-0.7,1.7c-0.5,0.5-1.1,0.7-1.7,0.7 h-6.8c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2V8.2c0-0.1,0.1-0.2,0.2-0.3c0.5-0.2,1-0.3,1.6-0.3c1.1,0,2.1,0.4,2.9,1.1 c0.8,0.8,1.3,1.7,1.4,2.8c0.3-0.1,0.6-0.2,1-0.2c0.7,0,1.3,0.2,1.7,0.7C21.8,12.6,22.1,13.2,22.1,13.9L22.1,13.9z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/spotify.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/spotify.js
/**
* WordPress dependencies
*/
-const SpotifyIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const SpotifyIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2 M16.586,16.424 c-0.18,0.295-0.563,0.387-0.857,0.207c-2.348-1.435-5.304-1.76-8.785-0.964c-0.335,0.077-0.67-0.133-0.746-0.469 c-0.077-0.335,0.132-0.67,0.469-0.746c3.809-0.871,7.077-0.496,9.713,1.115C16.673,15.746,16.766,16.13,16.586,16.424 M17.81,13.7 c-0.226,0.367-0.706,0.482-1.072,0.257c-2.687-1.652-6.785-2.131-9.965-1.166C6.36,12.917,5.925,12.684,5.8,12.273 C5.675,11.86,5.908,11.425,6.32,11.3c3.632-1.102,8.147-0.568,11.234,1.328C17.92,12.854,18.035,13.335,17.81,13.7 M17.915,10.865 c-3.223-1.914-8.54-2.09-11.618-1.156C5.804,9.859,5.281,9.58,5.131,9.086C4.982,8.591,5.26,8.069,5.755,7.919 c3.532-1.072,9.404-0.865,13.115,1.338c0.445,0.264,0.59,0.838,0.327,1.282C18.933,10.983,18.359,11.129,17.915,10.865"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/telegram.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/telegram.js
/**
* WordPress dependencies
*/
-const TelegramIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const TelegramIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 128 128",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M28.9700376,63.3244248 C47.6273373,55.1957357 60.0684594,49.8368063 66.2934036,47.2476366 C84.0668845,39.855031 87.7600616,38.5708563 90.1672227,38.528 C90.6966555,38.5191258 91.8804274,38.6503351 92.6472251,39.2725385 C93.294694,39.7979149 93.4728387,40.5076237 93.5580865,41.0057381 C93.6433345,41.5038525 93.7494885,42.63857 93.6651041,43.5252052 C92.7019529,53.6451182 88.5344133,78.2034783 86.4142057,89.5379542 C85.5170662,94.3339958 83.750571,95.9420841 82.0403991,96.0994568 C78.3237996,96.4414641 75.5015827,93.6432685 71.9018743,91.2836143 C66.2690414,87.5912212 63.0868492,85.2926952 57.6192095,81.6896017 C51.3004058,77.5256038 55.3966232,75.2369981 58.9976911,71.4967761 C59.9401076,70.5179421 76.3155302,55.6232293 76.6324771,54.2720454 C76.6721165,54.1030573 76.7089039,53.4731496 76.3346867,53.1405352 C75.9604695,52.8079208 75.4081573,52.921662 75.0095933,53.0121213 C74.444641,53.1403447 65.4461175,59.0880351 48.0140228,70.8551922 C45.4598218,72.6091037 43.1463059,73.4636682 41.0734751,73.4188859 C38.7883453,73.3695169 34.3926725,72.1268388 31.1249416,71.0646282 C27.1169366,69.7617838 23.931454,69.0729605 24.208838,66.8603276 C24.3533167,65.7078514 25.9403832,64.5292172 28.9700376,63.3244248 Z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/tiktok.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/tiktok.js
/**
* WordPress dependencies
*/
-const TiktokIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const TiktokIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 32 32",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M16.708 0.027c1.745-0.027 3.48-0.011 5.213-0.027 0.105 2.041 0.839 4.12 2.333 5.563 1.491 1.479 3.6 2.156 5.652 2.385v5.369c-1.923-0.063-3.855-0.463-5.6-1.291-0.76-0.344-1.468-0.787-2.161-1.24-0.009 3.896 0.016 7.787-0.025 11.667-0.104 1.864-0.719 3.719-1.803 5.255-1.744 2.557-4.771 4.224-7.88 4.276-1.907 0.109-3.812-0.411-5.437-1.369-2.693-1.588-4.588-4.495-4.864-7.615-0.032-0.667-0.043-1.333-0.016-1.984 0.24-2.537 1.495-4.964 3.443-6.615 2.208-1.923 5.301-2.839 8.197-2.297 0.027 1.975-0.052 3.948-0.052 5.923-1.323-0.428-2.869-0.308-4.025 0.495-0.844 0.547-1.485 1.385-1.819 2.333-0.276 0.676-0.197 1.427-0.181 2.145 0.317 2.188 2.421 4.027 4.667 3.828 1.489-0.016 2.916-0.88 3.692-2.145 0.251-0.443 0.532-0.896 0.547-1.417 0.131-2.385 0.079-4.76 0.095-7.145 0.011-5.375-0.016-10.735 0.025-16.093z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/tumblr.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/tumblr.js
/**
* WordPress dependencies
*/
-const TumblrIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const TumblrIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M17.04 21.28h-3.28c-2.84 0-4.94-1.37-4.94-5.02v-5.67H6.08V7.5c2.93-.73 4.11-3.3 4.3-5.48h3.01v4.93h3.47v3.65H13.4v4.93c0 1.47.73 2.01 1.92 2.01h1.73v3.75z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitch.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitch.js
/**
* WordPress dependencies
*/
-const TwitchIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const TwitchIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M16.499,8.089h-1.636v4.91h1.636V8.089z M12,8.089h-1.637v4.91H12V8.089z M4.228,3.178L3,6.451v13.092h4.499V22h2.456 l2.454-2.456h3.681L21,14.636V3.178H4.228z M19.364,13.816l-2.864,2.865H12l-2.453,2.453V16.68H5.863V4.814h13.501V13.816z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitter.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitter.js
/**
* WordPress dependencies
*/
-const TwitterIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const TwitterIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/vimeo.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/vimeo.js
/**
* WordPress dependencies
*/
-const VimeoIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const VimeoIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/vk.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/vk.js
/**
* WordPress dependencies
*/
-const VkIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const VkIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M22,7.1c0.2,0.4-0.4,1.5-1.6,3.1c-0.2,0.2-0.4,0.5-0.7,0.9c-0.5,0.7-0.9,1.1-0.9,1.4c-0.1,0.3-0.1,0.6,0.1,0.8 c0.1,0.1,0.4,0.4,0.8,0.9h0l0,0c1,0.9,1.6,1.7,2,2.3c0,0,0,0.1,0.1,0.1c0,0.1,0,0.1,0.1,0.3c0,0.1,0,0.2,0,0.4 c0,0.1-0.1,0.2-0.3,0.3c-0.1,0.1-0.4,0.1-0.6,0.1l-2.7,0c-0.2,0-0.4,0-0.6-0.1c-0.2-0.1-0.4-0.1-0.5-0.2l-0.2-0.1 c-0.2-0.1-0.5-0.4-0.7-0.7s-0.5-0.6-0.7-0.8c-0.2-0.2-0.4-0.4-0.6-0.6C14.8,15,14.6,15,14.4,15c0,0,0,0-0.1,0c0,0-0.1,0.1-0.2,0.2 c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.1-0.1,0.3-0.2,0.5c-0.1,0.2-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.1-0.1,0.2-0.1,0.2l0,0.1 c-0.1,0.1-0.3,0.2-0.6,0.2h-1.2c-0.5,0-1,0-1.5-0.2c-0.5-0.1-1-0.3-1.4-0.6s-0.7-0.5-1.1-0.7s-0.6-0.4-0.7-0.6l-0.3-0.3 c-0.1-0.1-0.2-0.2-0.3-0.3s-0.4-0.5-0.7-0.9s-0.7-1-1.1-1.6c-0.4-0.6-0.8-1.3-1.3-2.2C2.9,9.4,2.5,8.5,2.1,7.5C2,7.4,2,7.3,2,7.2 c0-0.1,0-0.1,0-0.2l0-0.1c0.1-0.1,0.3-0.2,0.6-0.2l2.9,0c0.1,0,0.2,0,0.2,0.1S5.9,6.9,5.9,7L6,7c0.1,0.1,0.2,0.2,0.3,0.3 C6.4,7.7,6.5,8,6.7,8.4C6.9,8.8,7,9,7.1,9.2l0.2,0.3c0.2,0.4,0.4,0.8,0.6,1.1c0.2,0.3,0.4,0.5,0.5,0.7s0.3,0.3,0.4,0.4 c0.1,0.1,0.3,0.1,0.4,0.1c0.1,0,0.2,0,0.3-0.1c0,0,0,0,0.1-0.1c0,0,0.1-0.1,0.1-0.2c0.1-0.1,0.1-0.3,0.1-0.5c0-0.2,0.1-0.5,0.1-0.8 c0-0.4,0-0.8,0-1.3c0-0.3,0-0.5-0.1-0.8c0-0.2-0.1-0.4-0.1-0.5L9.6,7.6C9.4,7.3,9.1,7.2,8.7,7.1C8.6,7.1,8.6,7,8.7,6.9 C8.9,6.7,9,6.6,9.1,6.5c0.4-0.2,1.2-0.3,2.5-0.3c0.6,0,1,0.1,1.4,0.1c0.1,0,0.3,0.1,0.3,0.1c0.1,0.1,0.2,0.1,0.2,0.3 c0,0.1,0.1,0.2,0.1,0.3s0,0.3,0,0.5c0,0.2,0,0.4,0,0.6c0,0.2,0,0.4,0,0.7c0,0.3,0,0.6,0,0.9c0,0.1,0,0.2,0,0.4c0,0.2,0,0.4,0,0.5 c0,0.1,0,0.3,0,0.4s0.1,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.3-0.1c0.1-0.1,0.2-0.2,0.4-0.4 s0.3-0.4,0.5-0.7c0.2-0.3,0.5-0.7,0.7-1.1c0.4-0.7,0.8-1.5,1.1-2.3c0-0.1,0.1-0.1,0.1-0.2c0-0.1,0.1-0.1,0.1-0.1l0,0l0.1,0 c0,0,0,0,0.1,0s0.2,0,0.2,0l3,0c0.3,0,0.5,0,0.7,0S21.9,7,21.9,7L22,7.1z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/yelp.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/yelp.js
/**
* WordPress dependencies
*/
-const YelpIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const YelpIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/youtube.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/icons/youtube.js
/**
* WordPress dependencies
*/
-const YouTubeIcon = () => Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const YouTubeIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
width: "24",
height: "24",
viewBox: "0 0 24 24",
version: "1.1"
-}, Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"
}));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/variations.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/variations.js
/**
* Internal dependencies
*/
@@ -35818,7 +35965,7 @@ social_link_variations_variations.forEach(variation => {
});
/* harmony default export */ var social_link_variations = (social_link_variations_variations);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/social-list.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/social-list.js
/**
* External dependencies
*/
@@ -35843,7 +35990,7 @@ social_link_variations_variations.forEach(variation => {
*/
const getIconBySite = name => {
- const variation = Object(external_lodash_["find"])(social_link_variations, {
+ const variation = (0,external_lodash_namespaceObject.find)(social_link_variations, {
name
});
return variation ? variation.icon : ChainIcon;
@@ -35857,13 +36004,13 @@ const getIconBySite = name => {
*/
const getNameBySite = name => {
- const variation = Object(external_lodash_["find"])(social_link_variations, {
+ const variation = (0,external_lodash_namespaceObject.find)(social_link_variations, {
name
});
- return variation ? variation.title : Object(external_wp_i18n_["__"])('Social Icon');
+ return variation ? variation.title : (0,external_wp_i18n_namespaceObject.__)('Social Icon');
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/edit.js
/**
@@ -35892,27 +36039,27 @@ const SocialLinkURLPopover = _ref => {
setPopover,
anchorRef
} = _ref;
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["URLPopover"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.URLPopover, {
anchorRef: anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current,
onClose: () => setPopover(false)
- }, Object(external_wp_element_["createElement"])("form", {
+ }, (0,external_wp_element_namespaceObject.createElement)("form", {
className: "block-editor-url-popover__link-editor",
onSubmit: event => {
event.preventDefault();
setPopover(false);
}
- }, Object(external_wp_element_["createElement"])("div", {
+ }, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "block-editor-url-input"
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["URLInput"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.URLInput, {
value: url,
onChange: nextURL => setAttributes({
url: nextURL
}),
- placeholder: Object(external_wp_i18n_["__"])('Enter address'),
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter address'),
disableSuggestions: true
- })), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
- icon: keyboard_return["a" /* default */],
- label: Object(external_wp_i18n_["__"])('Apply'),
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
+ icon: keyboard_return,
+ label: (0,external_wp_i18n_namespaceObject.__)('Apply'),
type: "submit"
})));
};
@@ -35933,36 +36080,36 @@ const SocialLinkEdit = _ref2 => {
iconColorValue,
iconBackgroundColorValue
} = context;
- const [showURLPopover, setPopover] = Object(external_wp_element_["useState"])(false);
+ const [showURLPopover, setPopover] = (0,external_wp_element_namespaceObject.useState)(false);
const classes = classnames_default()('wp-social-link', 'wp-social-link-' + service, {
'wp-social-link__is-incomplete': !url
});
- const ref = Object(external_wp_element_["useRef"])();
+ const ref = (0,external_wp_element_namespaceObject.useRef)();
const IconComponent = getIconBySite(service);
const socialLinkName = getNameBySite(service);
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classes,
style: {
color: iconColorValue,
backgroundColor: iconBackgroundColorValue
}
});
- 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_["sprintf"])(
+ 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.sprintf)(
/* translators: %s: name of the social service. */
- Object(external_wp_i18n_["__"])('%s label'), socialLinkName),
+ (0,external_wp_i18n_namespaceObject.__)('%s label'), socialLinkName),
initialOpen: false
- }, Object(external_wp_element_["createElement"])(external_wp_components_["PanelRow"], null, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
- label: Object(external_wp_i18n_["__"])('Link label'),
- help: Object(external_wp_i18n_["__"])('Briefly describe the link to help screen reader users.'),
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelRow, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Link label'),
+ help: (0,external_wp_i18n_namespaceObject.__)('Briefly describe the link to help screen reader users.'),
value: label,
onChange: value => setAttributes({
label: value
})
- })))), Object(external_wp_element_["createElement"])("li", blockProps, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ })))), (0,external_wp_element_namespaceObject.createElement)("li", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
ref: ref,
onClick: () => setPopover(true)
- }, Object(external_wp_element_["createElement"])(IconComponent, null), isSelected && showURLPopover && Object(external_wp_element_["createElement"])(SocialLinkURLPopover, {
+ }, (0,external_wp_element_namespaceObject.createElement)(IconComponent, null), isSelected && showURLPopover && (0,external_wp_element_namespaceObject.createElement)(SocialLinkURLPopover, {
url: url,
setAttributes: setAttributes,
setPopover: setPopover,
@@ -35972,7 +36119,7 @@ const SocialLinkEdit = _ref2 => {
/* harmony default export */ var social_link_edit = (SocialLinkEdit);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-link/index.js
/**
* WordPress dependencies
*/
@@ -36019,7 +36166,7 @@ const social_link_settings = {
variations: social_link_variations
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/deprecated.js
/**
@@ -36132,18 +36279,30 @@ const social_links_deprecated_deprecated = [// V1. Remove CSS variable use for c
'--wp--social-links--icon-color': iconColorValue,
'--wp--social-links--icon-background-color': iconBackgroundColorValue
};
- return Object(external_wp_element_["createElement"])("ul", external_wp_blockEditor_["useBlockProps"].save({
+ return (0,external_wp_element_namespaceObject.createElement)("ul", external_wp_blockEditor_namespaceObject.useBlockProps.save({
className,
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 social_links_deprecated = (social_links_deprecated_deprecated);
-// 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/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/block-library/build-module/social-links/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/edit.js
/**
@@ -36162,21 +36321,21 @@ var check = __webpack_require__("RMJe");
const social_links_edit_ALLOWED_BLOCKS = ['core/social-link'];
const sizeOptions = [{
- name: Object(external_wp_i18n_["__"])('Small'),
+ name: (0,external_wp_i18n_namespaceObject.__)('Small'),
value: 'has-small-icon-size'
}, {
- name: Object(external_wp_i18n_["__"])('Normal'),
+ name: (0,external_wp_i18n_namespaceObject.__)('Normal'),
value: 'has-normal-icon-size'
}, {
- name: Object(external_wp_i18n_["__"])('Large'),
+ name: (0,external_wp_i18n_namespaceObject.__)('Large'),
value: 'has-large-icon-size'
}, {
- name: Object(external_wp_i18n_["__"])('Huge'),
+ name: (0,external_wp_i18n_namespaceObject.__)('Huge'),
value: 'has-huge-icon-size'
}];
const edit_getDefaultBlockLayout = blockTypeOrName => {
- const layoutBlockSupportConfig = Object(external_wp_blocks_["getBlockSupport"])(blockTypeOrName, '__experimentalLayout');
+ const layoutBlockSupportConfig = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockTypeOrName, '__experimentalLayout');
return layoutBlockSupportConfig === null || layoutBlockSupportConfig === void 0 ? void 0 : layoutBlockSupportConfig.default;
};
@@ -36203,7 +36362,7 @@ function SocialLinksEdit(props) {
const usedLayout = layout || edit_getDefaultBlockLayout(name); // Remove icon background color if logos only style selected.
const logosOnly = ((_attributes$className = attributes.className) === null || _attributes$className === void 0 ? void 0 : _attributes$className.indexOf('is-style-logos-only')) >= 0;
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (logosOnly) {
setAttributes({
iconBackgroundColor: undefined,
@@ -36212,32 +36371,32 @@ function SocialLinksEdit(props) {
});
}
}, [logosOnly, setAttributes]);
- const SocialPlaceholder = Object(external_wp_element_["createElement"])("li", {
+ const SocialPlaceholder = (0,external_wp_element_namespaceObject.createElement)("li", {
className: "wp-block-social-links__social-placeholder"
- }, Object(external_wp_element_["createElement"])("div", {
+ }, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-social-link"
- }), Object(external_wp_element_["createElement"])("div", {
+ }), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-social-links__social-placeholder-icons"
- }, Object(external_wp_element_["createElement"])("div", {
+ }, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-social-link wp-social-link-twitter"
- }), Object(external_wp_element_["createElement"])("div", {
+ }), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-social-link wp-social-link-facebook"
- }), Object(external_wp_element_["createElement"])("div", {
+ }), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-social-link wp-social-link-instagram"
})));
- const SelectedSocialPlaceholder = Object(external_wp_element_["createElement"])("li", {
+ const SelectedSocialPlaceholder = (0,external_wp_element_namespaceObject.createElement)("li", {
className: "wp-block-social-links__social-prompt"
- }, Object(external_wp_i18n_["__"])('Click plus to add')); // Fallback color values are used maintain selections in case switching
+ }, (0,external_wp_i18n_namespaceObject.__)('Click plus to add')); // Fallback color values are used maintain selections in case switching
// themes and named colors in palette do not match.
const className = classnames_default()(size, {
'has-icon-color': iconColor.color || iconColorValue,
'has-icon-background-color': iconBackgroundColor.color || iconBackgroundColorValue
});
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className
});
- const innerBlocksProps = Object(external_wp_blockEditor_["useInnerBlocksProps"])(blockProps, {
+ const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
allowedBlocks: social_links_edit_ALLOWED_BLOCKS,
placeholder: isSelected ? SelectedSocialPlaceholder : SocialPlaceholder,
templateLock: false,
@@ -36247,20 +36406,20 @@ function SocialLinksEdit(props) {
const POPOVER_PROPS = {
position: 'bottom right'
};
- 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_components_["ToolbarDropdownMenu"], {
- label: Object(external_wp_i18n_["__"])('Size'),
- text: Object(external_wp_i18n_["__"])('Size'),
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Size'),
+ text: (0,external_wp_i18n_namespaceObject.__)('Size'),
icon: null,
popoverProps: POPOVER_PROPS
}, _ref => {
let {
onClose
} = _ref;
- return Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], null, sizeOptions.map(entry => {
- return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
- icon: (size === entry.value || !size && entry.value === 'has-normal-icon-size') && check["a" /* default */],
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, sizeOptions.map(entry => {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
+ icon: (size === entry.value || !size && entry.value === 'has-normal-icon-size') && library_check,
isSelected: size === entry.value,
key: entry.value,
onClick: () => {
@@ -36272,18 +36431,18 @@ function SocialLinksEdit(props) {
role: "menuitemradio"
}, entry.name);
}));
- })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Link settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Open links in new tab'),
+ })), (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.__)('Link settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Open links in new tab'),
checked: openInNewTab,
onChange: () => setAttributes({
openInNewTab: !openInNewTab
})
- })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["PanelColorSettings"], {
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.PanelColorSettings, {
__experimentalHasMultipleOrigins: true,
__experimentalIsRenderedInSidebar: true,
- title: Object(external_wp_i18n_["__"])('Color'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Color'),
colorSettings: [{
// Use custom attribute as fallback to prevent loss of named color selection when
// switching themes to a new theme that does not have a matching named color.
@@ -36294,7 +36453,7 @@ function SocialLinksEdit(props) {
iconColorValue: colorValue
});
},
- label: Object(external_wp_i18n_["__"])('Icon color')
+ label: (0,external_wp_i18n_namespaceObject.__)('Icon color')
}, !logosOnly && {
// Use custom attribute as fallback to prevent loss of named color selection when
// switching themes to a new theme that does not have a matching named color.
@@ -36305,21 +36464,21 @@ function SocialLinksEdit(props) {
iconBackgroundColorValue: colorValue
});
},
- label: Object(external_wp_i18n_["__"])('Icon background')
+ label: (0,external_wp_i18n_namespaceObject.__)('Icon background')
}]
- }), !logosOnly && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["ContrastChecker"], {
+ }), !logosOnly && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ContrastChecker, {
textColor: iconColorValue,
backgroundColor: iconBackgroundColorValue,
isLargeText: false
- })), Object(external_wp_element_["createElement"])("ul", innerBlocksProps));
+ })), (0,external_wp_element_namespaceObject.createElement)("ul", innerBlocksProps));
}
const iconColorAttributes = {
iconColor: 'icon-color',
iconBackgroundColor: 'icon-background-color'
};
-/* harmony default export */ var social_links_edit = (Object(external_wp_blockEditor_["withColors"])(iconColorAttributes)(SocialLinksEdit));
+/* harmony default export */ var social_links_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)(iconColorAttributes)(SocialLinksEdit));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/save.js
/**
@@ -36343,14 +36502,14 @@ function social_links_save_save(props) {
'has-icon-color': iconColorValue,
'has-icon-background-color': iconBackgroundColorValue
});
- 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"])("ul", innerBlocksProps);
+ const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
+ return (0,external_wp_element_namespaceObject.createElement)("ul", innerBlocksProps);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/social-links/index.js
/**
* WordPress dependencies
*/
@@ -36468,22 +36627,22 @@ const social_links_settings = {
deprecated: social_links_deprecated
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/resize-corner-n-e.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/resize-corner-n-e.js
/**
* WordPress dependencies
*/
-const resizeCornerNE = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const resizeCornerNE = (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: "M12.5 4.2v1.6h4.7L5.8 17.2V12H4.2v7.8H12v-1.6H6.8L18.2 6.8v4.7h1.6V4.2z"
}));
/* harmony default export */ var resize_corner_n_e = (resizeCornerNE);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/deprecated.js
/**
@@ -36516,7 +36675,7 @@ const spacer_deprecated_deprecated = [{
let {
attributes
} = _ref;
- 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({
style: {
height: attributes.height,
width: attributes.width
@@ -36528,7 +36687,7 @@ const spacer_deprecated_deprecated = [{
}];
/* harmony default export */ var spacer_deprecated = (spacer_deprecated_deprecated);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/controls.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/controls.js
/**
@@ -36554,13 +36713,13 @@ function DimensionInput(_ref) {
isResizing,
value = ''
} = _ref;
- const [temporaryInput, setTemporaryInput] = Object(external_wp_element_["useState"])(null);
- const inputId = Object(external_wp_compose_["useInstanceId"])(external_wp_components_["__experimentalUnitControl"], 'block-spacer-height-input'); // In most contexts the spacer size cannot meaningfully be set to a
+ const [temporaryInput, setTemporaryInput] = (0,external_wp_element_namespaceObject.useState)(null);
+ const inputId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl, 'block-spacer-height-input'); // In most contexts the spacer size cannot meaningfully be set to a
// percentage, since this is relative to the parent container. This
// unit is disabled from the UI.
- const availableUnitSettings = (_ref2 = Object(external_wp_blockEditor_["useSetting"])('spacing.units') || undefined) === null || _ref2 === void 0 ? void 0 : _ref2.filter(availableUnit => availableUnit !== '%');
- const units = Object(external_wp_components_["__experimentalUseCustomUnits"])({
+ const availableUnitSettings = (_ref2 = (0,external_wp_blockEditor_namespaceObject.useSetting)('spacing.units') || undefined) === null || _ref2 === void 0 ? void 0 : _ref2.filter(availableUnit => availableUnit !== '%');
+ const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
availableUnits: availableUnitSettings || ['px', 'em', 'rem', 'vw', 'vh'],
defaultValues: {
px: '100',
@@ -36583,10 +36742,10 @@ function DimensionInput(_ref) {
};
const inputValue = temporaryInput !== null ? temporaryInput : value;
- return Object(external_wp_element_["createElement"])(external_wp_components_["BaseControl"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
label: label,
id: inputId
- }, Object(external_wp_element_["createElement"])(external_wp_components_["__experimentalUnitControl"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
id: inputId,
isResetValueOnUnitChange: true,
min: 0,
@@ -36611,17 +36770,17 @@ function SpacerControls(_ref3) {
width,
isResizing
} = _ref3;
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Spacer settings')
- }, orientation === 'horizontal' && Object(external_wp_element_["createElement"])(DimensionInput, {
- label: Object(external_wp_i18n_["__"])('Width'),
+ return (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.__)('Spacer settings')
+ }, orientation === 'horizontal' && (0,external_wp_element_namespaceObject.createElement)(DimensionInput, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Width'),
value: width,
onChange: nextWidth => setAttributes({
width: nextWidth
}),
isResizing: isResizing
- }), orientation !== 'horizontal' && Object(external_wp_element_["createElement"])(DimensionInput, {
- label: Object(external_wp_i18n_["__"])('Height'),
+ }), orientation !== 'horizontal' && (0,external_wp_element_namespaceObject.createElement)(DimensionInput, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Height'),
value: height,
onChange: nextHeight => setAttributes({
height: nextHeight
@@ -36630,7 +36789,7 @@ function SpacerControls(_ref3) {
})));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/edit.js
@@ -36676,7 +36835,7 @@ const ResizableSpacer = _ref => {
return `${getCurrentSize(elt)}px`;
};
- return Object(external_wp_element_["createElement"])(external_wp_components_["ResizableBox"], Object(esm_extends["a" /* default */])({
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ResizableBox, _extends({
className: classnames_default()('block-library-spacer__resize-container', {
'resize-horizontal': orientation === 'horizontal',
'is-resizing': isResizing,
@@ -36725,9 +36884,9 @@ const SpacerEdit = _ref2 => {
height,
width
} = attributes;
- const [isResizing, setIsResizing] = Object(external_wp_element_["useState"])(false);
- const [temporaryHeight, setTemporaryHeight] = Object(external_wp_element_["useState"])(null);
- const [temporaryWidth, setTemporaryWidth] = Object(external_wp_element_["useState"])(null);
+ const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false);
+ const [temporaryHeight, setTemporaryHeight] = (0,external_wp_element_namespaceObject.useState)(null);
+ const [temporaryWidth, setTemporaryWidth] = (0,external_wp_element_namespaceObject.useState)(null);
const handleOnVerticalResizeStop = newHeight => {
onResizeStop();
@@ -36752,7 +36911,7 @@ const SpacerEdit = _ref2 => {
const resizableBoxWithOrientation = blockOrientation => {
if (blockOrientation === 'horizontal') {
- return Object(external_wp_element_["createElement"])(ResizableSpacer, {
+ return (0,external_wp_element_namespaceObject.createElement)(ResizableSpacer, {
minWidth: MIN_SPACER_SIZE,
enable: {
top: false,
@@ -36774,7 +36933,7 @@ const SpacerEdit = _ref2 => {
});
}
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(ResizableSpacer, {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(ResizableSpacer, {
enable: {
top: false,
right: false,
@@ -36795,7 +36954,7 @@ const SpacerEdit = _ref2 => {
}));
};
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (orientation === 'horizontal' && !width) {
setAttributes({
height: '0px',
@@ -36803,9 +36962,9 @@ const SpacerEdit = _ref2 => {
});
}
}, []);
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_primitives_["View"], Object(external_wp_blockEditor_["useBlockProps"])({
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.View, (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
style
- }), resizableBoxWithOrientation(orientation)), Object(external_wp_element_["createElement"])(SpacerControls, {
+ }), resizableBoxWithOrientation(orientation)), (0,external_wp_element_namespaceObject.createElement)(SpacerControls, {
setAttributes: setAttributes,
height: temporaryHeight || height,
width: temporaryWidth || width,
@@ -36814,17 +36973,17 @@ const SpacerEdit = _ref2 => {
}));
};
-/* harmony default export */ var spacer_edit = (Object(external_wp_compose_["compose"])([Object(external_wp_data_["withDispatch"])(dispatch => {
+/* harmony default export */ var spacer_edit = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withDispatch)(dispatch => {
const {
toggleSelection
- } = dispatch(external_wp_blockEditor_["store"]);
+ } = dispatch(external_wp_blockEditor_namespaceObject.store);
return {
onResizeStart: () => toggleSelection(false),
onResizeStop: () => toggleSelection(true)
};
-}), external_wp_compose_["withInstanceId"]])(SpacerEdit));
+}), external_wp_compose_namespaceObject.withInstanceId])(SpacerEdit));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/save.js
/**
@@ -36838,7 +36997,7 @@ function spacer_save_save(_ref) {
width
}
} = _ref;
- 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({
style: {
height,
width
@@ -36847,7 +37006,7 @@ function spacer_save_save(_ref) {
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/spacer/index.js
/**
* WordPress dependencies
*/
@@ -36893,22 +37052,22 @@ const spacer_settings = {
deprecated: spacer_deprecated
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-table.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/block-table.js
/**
* WordPress dependencies
*/
-const blockTable = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const blockTable = (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.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z"
}));
/* harmony default export */ var block_table = (blockTable);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/deprecated.js
/**
@@ -37077,12 +37236,12 @@ const table_deprecated_deprecated = [// Deprecation migrating table block to use
return null;
}
- const backgroundClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor);
+ const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
const classes = classnames_default()(backgroundClass, {
'has-fixed-layout': hasFixedLayout,
'has-background': !!backgroundClass
});
- const hasCaption = !external_wp_blockEditor_["RichText"].isEmpty(caption);
+ const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption);
const Section = _ref2 => {
let {
@@ -37095,11 +37254,11 @@ const table_deprecated_deprecated = [// Deprecation migrating table block to use
}
const Tag = `t${type}`;
- return Object(external_wp_element_["createElement"])(Tag, null, rows.map((_ref3, rowIndex) => {
+ return (0,external_wp_element_namespaceObject.createElement)(Tag, null, rows.map((_ref3, rowIndex) => {
let {
cells
} = _ref3;
- return Object(external_wp_element_["createElement"])("tr", {
+ return (0,external_wp_element_namespaceObject.createElement)("tr", {
key: rowIndex
}, cells.map((_ref4, cellIndex) => {
let {
@@ -37111,7 +37270,7 @@ const table_deprecated_deprecated = [// Deprecation migrating table block to use
const cellClasses = classnames_default()({
[`has-text-align-${align}`]: align
});
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
className: cellClasses ? cellClasses : undefined,
"data-align": align,
tagName: tag,
@@ -37123,18 +37282,18 @@ const table_deprecated_deprecated = [// Deprecation migrating table block to use
}));
};
- return Object(external_wp_element_["createElement"])("figure", external_wp_blockEditor_["useBlockProps"].save(), Object(external_wp_element_["createElement"])("table", {
+ return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("table", {
className: classes === '' ? undefined : classes
- }, Object(external_wp_element_["createElement"])(Section, {
+ }, (0,external_wp_element_namespaceObject.createElement)(Section, {
type: "head",
rows: head
- }), Object(external_wp_element_["createElement"])(Section, {
+ }), (0,external_wp_element_namespaceObject.createElement)(Section, {
type: "body",
rows: body
- }), Object(external_wp_element_["createElement"])(Section, {
+ }), (0,external_wp_element_namespaceObject.createElement)(Section, {
type: "foot",
rows: foot
- })), hasCaption && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ })), hasCaption && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "figcaption",
value: caption
}));
@@ -37273,7 +37432,7 @@ const table_deprecated_deprecated = [// Deprecation migrating table block to use
return null;
}
- const backgroundClass = Object(external_wp_blockEditor_["getColorClassName"])('background-color', backgroundColor);
+ const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
const classes = classnames_default()(backgroundClass, {
'has-fixed-layout': hasFixedLayout,
'has-background': !!backgroundClass
@@ -37290,11 +37449,11 @@ const table_deprecated_deprecated = [// Deprecation migrating table block to use
}
const Tag = `t${type}`;
- return Object(external_wp_element_["createElement"])(Tag, null, rows.map((_ref7, rowIndex) => {
+ return (0,external_wp_element_namespaceObject.createElement)(Tag, null, rows.map((_ref7, rowIndex) => {
let {
cells
} = _ref7;
- return Object(external_wp_element_["createElement"])("tr", {
+ return (0,external_wp_element_namespaceObject.createElement)("tr", {
key: rowIndex
}, cells.map((_ref8, cellIndex) => {
let {
@@ -37302,7 +37461,7 @@ const table_deprecated_deprecated = [// Deprecation migrating table block to use
tag,
scope
} = _ref8;
- 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: tag,
value: content,
key: cellIndex,
@@ -37312,15 +37471,15 @@ const table_deprecated_deprecated = [// Deprecation migrating table block to use
}));
};
- return Object(external_wp_element_["createElement"])("table", {
+ return (0,external_wp_element_namespaceObject.createElement)("table", {
className: classes
- }, Object(external_wp_element_["createElement"])(Section, {
+ }, (0,external_wp_element_namespaceObject.createElement)(Section, {
type: "head",
rows: head
- }), Object(external_wp_element_["createElement"])(Section, {
+ }), (0,external_wp_element_namespaceObject.createElement)(Section, {
type: "body",
rows: body
- }), Object(external_wp_element_["createElement"])(Section, {
+ }), (0,external_wp_element_namespaceObject.createElement)(Section, {
type: "foot",
rows: foot
}));
@@ -37329,121 +37488,157 @@ const table_deprecated_deprecated = [// Deprecation migrating table block to use
}];
/* harmony default export */ var table_deprecated = (table_deprecated_deprecated);
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/align-left.js
-var align_left = __webpack_require__("fPbg");
+;// 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
+
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/align-center.js
-var align_center = __webpack_require__("plpT");
+/**
+ * WordPress dependencies
+ */
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/align-right.js
-var align_right = __webpack_require__("ziDm");
+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/table-row-before.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/align-right.js
/**
* WordPress dependencies
*/
-const tableRowBefore = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+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/icons/build-module/library/table-row-before.js
+
+
+/**
+ * WordPress dependencies
+ */
+
+const tableRowBefore = (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: "M6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84zM6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84z"
}));
/* harmony default export */ var table_row_before = (tableRowBefore);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-after.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-after.js
/**
* WordPress dependencies
*/
-const tableRowAfter = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const tableRowAfter = (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: "M13.824 10.176h-2.88v-2.88H9.536v2.88h-2.88v1.344h2.88v2.88h1.408v-2.88h2.88zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm6.4 0H7.68v3.84h5.12V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.056H1.28v9.024H19.2V6.336z"
}));
/* harmony default export */ var table_row_after = (tableRowAfter);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-delete.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-row-delete.js
/**
* WordPress dependencies
*/
-const tableRowDelete = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const tableRowDelete = (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: "M17.728 11.456L14.592 8.32l3.2-3.2-1.536-1.536-3.2 3.2L9.92 3.648 8.384 5.12l3.2 3.2-3.264 3.264 1.536 1.536 3.264-3.264 3.136 3.136 1.472-1.536zM0 17.92V0h20.48v17.92H0zm19.2-6.4h-.448l-1.28-1.28H19.2V6.4h-1.792l1.28-1.28h.512V1.28H1.28v3.84h6.208l1.28 1.28H1.28v3.84h7.424l-1.28 1.28H1.28v3.84H19.2v-3.84z"
}));
/* harmony default export */ var table_row_delete = (tableRowDelete);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-before.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-before.js
/**
* WordPress dependencies
*/
-const tableColumnBefore = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const tableColumnBefore = (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: "M6.4 3.776v3.648H2.752v1.792H6.4v3.648h1.728V9.216h3.712V7.424H8.128V3.776zM0 17.92V0h20.48v17.92H0zM12.8 1.28H1.28v14.08H12.8V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.12h-5.12v3.84h5.12V6.4zm0 5.12h-5.12v3.84h5.12v-3.84z"
}));
/* harmony default export */ var table_column_before = (tableColumnBefore);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-after.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-after.js
/**
* WordPress dependencies
*/
-const tableColumnAfter = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const tableColumnAfter = (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: "M14.08 12.864V9.216h3.648V7.424H14.08V3.776h-1.728v3.648H8.64v1.792h3.712v3.648zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm0 5.12H1.28v3.84H6.4V6.4zm0 5.12H1.28v3.84H6.4v-3.84zM19.2 1.28H7.68v14.08H19.2V1.28z"
}));
/* harmony default export */ var table_column_after = (tableColumnAfter);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-delete.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table-column-delete.js
/**
* WordPress dependencies
*/
-const tableColumnDelete = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const tableColumnDelete = (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: "M6.4 9.98L7.68 8.7v-.256L6.4 7.164V9.98zm6.4-1.532l1.28-1.28V9.92L12.8 8.64v-.192zm7.68 9.472V0H0v17.92h20.48zm-1.28-2.56h-5.12v-1.024l-.256.256-1.024-1.024v1.792H7.68v-1.792l-1.024 1.024-.256-.256v1.024H1.28V1.28H6.4v2.368l.704-.704.576.576V1.216h5.12V3.52l.96-.96.32.32V1.216h5.12V15.36zm-5.76-2.112l-3.136-3.136-3.264 3.264-1.536-1.536 3.264-3.264L5.632 5.44l1.536-1.536 3.136 3.136 3.2-3.2 1.536 1.536-3.2 3.2 3.136 3.136-1.536 1.536z"
}));
/* harmony default export */ var table_column_delete = (tableColumnDelete);
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/table.js
/**
* WordPress dependencies
*/
-const table = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const table = (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: "M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z"
}));
/* harmony default export */ var library_table = (table);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/state.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/state.js
/**
* External dependencies
*/
@@ -37465,8 +37660,8 @@ function createTable(_ref) {
columnCount
} = _ref;
return {
- body: Object(external_lodash_["times"])(rowCount, () => ({
- cells: Object(external_lodash_["times"])(columnCount, () => ({
+ body: (0,external_lodash_namespaceObject.times)(rowCount, () => ({
+ cells: (0,external_lodash_namespaceObject.times)(columnCount, () => ({
content: '',
tag: 'td'
}))
@@ -37510,7 +37705,7 @@ function getCellAttribute(state, cellLocation, attributeName) {
rowIndex,
columnIndex
} = cellLocation;
- return Object(external_lodash_["get"])(state, [sectionName, rowIndex, 'cells', columnIndex, attributeName]);
+ return (0,external_lodash_namespaceObject.get)(state, [sectionName, rowIndex, 'cells', columnIndex, attributeName]);
}
/**
* Returns updated cell attributes after applying the `updateCell` function to the selection.
@@ -37527,12 +37722,12 @@ function updateSelectedCell(state, selection, updateCell) {
return state;
}
- const tableSections = Object(external_lodash_["pick"])(state, ['head', 'body', 'foot']);
+ const tableSections = (0,external_lodash_namespaceObject.pick)(state, ['head', 'body', 'foot']);
const {
sectionName: selectionSectionName,
rowIndex: selectionRowIndex
} = selection;
- return Object(external_lodash_["mapValues"])(tableSections, (section, sectionName) => {
+ return (0,external_lodash_namespaceObject.mapValues)(tableSections, (section, sectionName) => {
if (selectionSectionName && selectionSectionName !== sectionName) {
return section;
}
@@ -37601,7 +37796,7 @@ function insertRow(state, _ref2) {
columnCount
} = _ref2;
const firstRow = getFirstRow(state);
- const cellCount = columnCount === undefined ? Object(external_lodash_["get"])(firstRow, ['cells', 'length']) : columnCount; // Bail early if the function cannot determine how many cells to add.
+ const cellCount = columnCount === undefined ? (0,external_lodash_namespaceObject.get)(firstRow, ['cells', 'length']) : columnCount; // Bail early if the function cannot determine how many cells to add.
if (!cellCount) {
return state;
@@ -37609,9 +37804,9 @@ function insertRow(state, _ref2) {
return {
[sectionName]: [...state[sectionName].slice(0, rowIndex), {
- cells: Object(external_lodash_["times"])(cellCount, index => {
- const firstCellInColumn = Object(external_lodash_["get"])(firstRow, ['cells', index], {});
- const inheritedAttributes = Object(external_lodash_["pick"])(firstCellInColumn, INHERITED_COLUMN_ATTRIBUTES);
+ cells: (0,external_lodash_namespaceObject.times)(cellCount, index => {
+ const firstCellInColumn = (0,external_lodash_namespaceObject.get)(firstRow, ['cells', index], {});
+ const inheritedAttributes = (0,external_lodash_namespaceObject.pick)(firstCellInColumn, INHERITED_COLUMN_ATTRIBUTES);
return { ...inheritedAttributes,
content: '',
tag: sectionName === 'head' ? 'th' : 'td'
@@ -37654,8 +37849,8 @@ function insertColumn(state, _ref4) {
let {
columnIndex
} = _ref4;
- const tableSections = Object(external_lodash_["pick"])(state, ['head', 'body', 'foot']);
- return Object(external_lodash_["mapValues"])(tableSections, (section, sectionName) => {
+ const tableSections = (0,external_lodash_namespaceObject.pick)(state, ['head', 'body', 'foot']);
+ return (0,external_lodash_namespaceObject.mapValues)(tableSections, (section, sectionName) => {
// Bail early if the table section is empty.
if (isEmptyTableSection(section)) {
return section;
@@ -37691,8 +37886,8 @@ function deleteColumn(state, _ref5) {
let {
columnIndex
} = _ref5;
- const tableSections = Object(external_lodash_["pick"])(state, ['head', 'body', 'foot']);
- return Object(external_lodash_["mapValues"])(tableSections, section => {
+ const tableSections = (0,external_lodash_namespaceObject.pick)(state, ['head', 'body', 'foot']);
+ return (0,external_lodash_namespaceObject.mapValues)(tableSections, section => {
// Bail early if the table section is empty.
if (isEmptyTableSection(section)) {
return section;
@@ -37721,7 +37916,7 @@ function toggleSection(state, sectionName) {
} // Get the length of the first row of the body to use when creating the header.
- const columnCount = Object(external_lodash_["get"])(state, ['body', 0, 'cells', 'length'], 1); // Section doesn't exist, insert an empty row to create the section.
+ const columnCount = (0,external_lodash_namespaceObject.get)(state, ['body', 0, 'cells', 'length'], 1); // Section doesn't exist, insert an empty row to create the section.
return insertRow(state, {
sectionName,
@@ -37738,7 +37933,7 @@ function toggleSection(state, sectionName) {
*/
function isEmptyTableSection(section) {
- return !section || !section.length || Object(external_lodash_["every"])(section, isEmptyRow);
+ return !section || !section.length || (0,external_lodash_namespaceObject.every)(section, isEmptyRow);
}
/**
* Determines whether a table row is empty.
@@ -37752,7 +37947,7 @@ function isEmptyRow(row) {
return !(row.cells && row.cells.length);
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/edit.js
/**
@@ -37775,26 +37970,26 @@ function isEmptyRow(row) {
const ALIGNMENT_CONTROLS = [{
- icon: align_left["a" /* default */],
- title: Object(external_wp_i18n_["__"])('Align column left'),
+ icon: align_left,
+ title: (0,external_wp_i18n_namespaceObject.__)('Align column left'),
align: 'left'
}, {
- icon: align_center["a" /* default */],
- title: Object(external_wp_i18n_["__"])('Align column center'),
+ icon: align_center,
+ title: (0,external_wp_i18n_namespaceObject.__)('Align column center'),
align: 'center'
}, {
- icon: align_right["a" /* default */],
- title: Object(external_wp_i18n_["__"])('Align column right'),
+ icon: align_right,
+ title: (0,external_wp_i18n_namespaceObject.__)('Align column right'),
align: 'right'
}];
const cellAriaLabel = {
- head: Object(external_wp_i18n_["__"])('Header cell text'),
- body: Object(external_wp_i18n_["__"])('Body cell text'),
- foot: Object(external_wp_i18n_["__"])('Footer cell text')
+ head: (0,external_wp_i18n_namespaceObject.__)('Header cell text'),
+ body: (0,external_wp_i18n_namespaceObject.__)('Body cell text'),
+ foot: (0,external_wp_i18n_namespaceObject.__)('Footer cell text')
};
-const edit_placeholder = {
- head: Object(external_wp_i18n_["__"])('Header label'),
- foot: Object(external_wp_i18n_["__"])('Footer label')
+const placeholder = {
+ head: (0,external_wp_i18n_namespaceObject.__)('Header label'),
+ foot: (0,external_wp_i18n_namespaceObject.__)('Footer label')
};
function TSection(_ref) {
@@ -37803,7 +37998,7 @@ function TSection(_ref) {
...props
} = _ref;
const TagName = `t${name}`;
- return Object(external_wp_element_["createElement"])(TagName, props);
+ return (0,external_wp_element_namespaceObject.createElement)(TagName, props);
}
function TableEdit(_ref2) {
@@ -37819,11 +38014,11 @@ function TableEdit(_ref2) {
head,
foot
} = attributes;
- const [initialRowCount, setInitialRowCount] = Object(external_wp_element_["useState"])(2);
- const [initialColumnCount, setInitialColumnCount] = Object(external_wp_element_["useState"])(2);
- const [selectedCell, setSelectedCell] = Object(external_wp_element_["useState"])();
- const colorProps = Object(external_wp_blockEditor_["__experimentalUseColorProps"])(attributes);
- const borderProps = Object(external_wp_blockEditor_["__experimentalUseBorderProps"])(attributes);
+ const [initialRowCount, setInitialRowCount] = (0,external_wp_element_namespaceObject.useState)(2);
+ const [initialColumnCount, setInitialColumnCount] = (0,external_wp_element_namespaceObject.useState)(2);
+ const [selectedCell, setSelectedCell] = (0,external_wp_element_namespaceObject.useState)();
+ const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
+ const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
/**
* Updates the initial column count used for table creation.
*
@@ -38066,7 +38261,7 @@ function TableEdit(_ref2) {
}));
}
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isSelected) {
setSelectedCell();
}
@@ -38074,43 +38269,43 @@ function TableEdit(_ref2) {
const sections = ['head', 'body', 'foot'].filter(name => !isEmptyTableSection(attributes[name]));
const tableControls = [{
icon: table_row_before,
- title: Object(external_wp_i18n_["__"])('Insert row before'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Insert row before'),
isDisabled: !selectedCell,
onClick: onInsertRowBefore
}, {
icon: table_row_after,
- title: Object(external_wp_i18n_["__"])('Insert row after'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Insert row after'),
isDisabled: !selectedCell,
onClick: onInsertRowAfter
}, {
icon: table_row_delete,
- title: Object(external_wp_i18n_["__"])('Delete row'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Delete row'),
isDisabled: !selectedCell,
onClick: onDeleteRow
}, {
icon: table_column_before,
- title: Object(external_wp_i18n_["__"])('Insert column before'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Insert column before'),
isDisabled: !selectedCell,
onClick: onInsertColumnBefore
}, {
icon: table_column_after,
- title: Object(external_wp_i18n_["__"])('Insert column after'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Insert column after'),
isDisabled: !selectedCell,
onClick: onInsertColumnAfter
}, {
icon: table_column_delete,
- title: Object(external_wp_i18n_["__"])('Delete column'),
+ title: (0,external_wp_i18n_namespaceObject.__)('Delete column'),
isDisabled: !selectedCell,
onClick: onDeleteColumn
}];
- const renderedSections = ['head', 'body', 'foot'].map(name => Object(external_wp_element_["createElement"])(TSection, {
+ const renderedSections = ['head', 'body', 'foot'].map(name => (0,external_wp_element_namespaceObject.createElement)(TSection, {
name: name,
key: name
}, attributes[name].map((_ref3, rowIndex) => {
let {
cells
} = _ref3;
- return Object(external_wp_element_["createElement"])("tr", {
+ return (0,external_wp_element_namespaceObject.createElement)("tr", {
key: rowIndex
}, cells.map((_ref4, columnIndex) => {
let {
@@ -38119,7 +38314,7 @@ function TableEdit(_ref2) {
scope,
align
} = _ref4;
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
tagName: CellTag,
key: columnIndex,
className: classnames_default()({
@@ -38137,92 +38332,92 @@ function TableEdit(_ref2) {
});
},
"aria-label": cellAriaLabel[name],
- placeholder: edit_placeholder[name]
+ placeholder: placeholder[name]
});
}));
})));
const isEmpty = !sections.length;
- return Object(external_wp_element_["createElement"])("figure", Object(external_wp_blockEditor_["useBlockProps"])(), !isEmpty && 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)("figure", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), !isEmpty && (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_["AlignmentControl"], {
- label: Object(external_wp_i18n_["__"])('Change column alignment'),
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Change column alignment'),
alignmentControls: ALIGNMENT_CONTROLS,
value: getCellAlignment(),
onChange: nextAlign => onChangeColumnAlignment(nextAlign)
- })), 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_components_["ToolbarDropdownMenu"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarDropdownMenu, {
hasArrowIndicator: true,
icon: library_table,
- label: Object(external_wp_i18n_["__"])('Edit table'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Edit table'),
controls: tableControls
- }))), !isEmpty && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Table settings'),
+ }))), !isEmpty && (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.__)('Table settings'),
className: "blocks-table-settings"
- }, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Fixed width table cells'),
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Fixed width table cells'),
checked: !!hasFixedLayout,
onChange: onChangeFixedLayout
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Header section'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Header section'),
checked: !!(head && head.length),
onChange: onToggleHeaderSection
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Footer section'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Footer section'),
checked: !!(foot && foot.length),
onChange: onToggleFooterSection
- }))), !isEmpty && Object(external_wp_element_["createElement"])("table", {
+ }))), !isEmpty && (0,external_wp_element_namespaceObject.createElement)("table", {
className: classnames_default()(colorProps.className, borderProps.className, {
'has-fixed-layout': hasFixedLayout
}),
style: { ...colorProps.style,
...borderProps.style
}
- }, renderedSections), !isEmpty && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ }, renderedSections), !isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
tagName: "figcaption",
- "aria-label": Object(external_wp_i18n_["__"])('Table caption text'),
- placeholder: Object(external_wp_i18n_["__"])('Add caption'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Table caption text'),
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('Add caption'),
value: caption,
onChange: value => setAttributes({
caption: value
}) // Deselect the selected table cell when the caption is focused.
,
unstableOnFocus: () => setSelectedCell(),
- __unstableOnSplitAtEnd: () => insertBlocksAfter(Object(external_wp_blocks_["createBlock"])('core/paragraph'))
- }), isEmpty && Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], {
- label: Object(external_wp_i18n_["__"])('Table'),
- icon: Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockIcon"], {
+ __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph'))
+ }), isEmpty && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Table'),
+ icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockIcon, {
icon: block_table,
showColors: true
}),
- instructions: Object(external_wp_i18n_["__"])('Insert a table for sharing data.')
- }, Object(external_wp_element_["createElement"])("form", {
+ instructions: (0,external_wp_i18n_namespaceObject.__)('Insert a table for sharing data.')
+ }, (0,external_wp_element_namespaceObject.createElement)("form", {
className: "blocks-table__placeholder-form",
onSubmit: onCreateTable
- }, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
type: "number",
- label: Object(external_wp_i18n_["__"])('Column count'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Column count'),
value: initialColumnCount,
onChange: onChangeInitialColumnCount,
min: "1",
className: "blocks-table__placeholder-input"
- }), Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
type: "number",
- label: Object(external_wp_i18n_["__"])('Row count'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Row count'),
value: initialRowCount,
onChange: onChangeInitialRowCount,
min: "1",
className: "blocks-table__placeholder-input"
- }), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
className: "blocks-table__placeholder-button",
variant: "primary",
type: "submit"
- }, Object(external_wp_i18n_["__"])('Create Table')))));
+ }, (0,external_wp_i18n_namespaceObject.__)('Create Table')))));
}
/* harmony default export */ var table_edit = (TableEdit);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/save.js
/**
@@ -38251,12 +38446,12 @@ function table_save_save(_ref) {
return null;
}
- const colorProps = Object(external_wp_blockEditor_["__experimentalGetColorClassesAndStyles"])(attributes);
- const borderProps = Object(external_wp_blockEditor_["__experimentalGetBorderClassesAndStyles"])(attributes);
+ const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
+ const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
const classes = classnames_default()(colorProps.className, borderProps.className, {
'has-fixed-layout': hasFixedLayout
});
- const hasCaption = !external_wp_blockEditor_["RichText"].isEmpty(caption);
+ const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption);
const Section = _ref2 => {
let {
@@ -38269,11 +38464,11 @@ function table_save_save(_ref) {
}
const Tag = `t${type}`;
- return Object(external_wp_element_["createElement"])(Tag, null, rows.map((_ref3, rowIndex) => {
+ return (0,external_wp_element_namespaceObject.createElement)(Tag, null, rows.map((_ref3, rowIndex) => {
let {
cells
} = _ref3;
- return Object(external_wp_element_["createElement"])("tr", {
+ return (0,external_wp_element_namespaceObject.createElement)("tr", {
key: rowIndex
}, cells.map((_ref4, cellIndex) => {
let {
@@ -38285,7 +38480,7 @@ function table_save_save(_ref) {
const cellClasses = classnames_default()({
[`has-text-align-${align}`]: align
});
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
className: cellClasses ? cellClasses : undefined,
"data-align": align,
tagName: tag,
@@ -38297,27 +38492,27 @@ function table_save_save(_ref) {
}));
};
- return Object(external_wp_element_["createElement"])("figure", external_wp_blockEditor_["useBlockProps"].save(), Object(external_wp_element_["createElement"])("table", {
+ return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), (0,external_wp_element_namespaceObject.createElement)("table", {
className: classes === '' ? undefined : classes,
style: { ...colorProps.style,
...borderProps.style
}
- }, Object(external_wp_element_["createElement"])(Section, {
+ }, (0,external_wp_element_namespaceObject.createElement)(Section, {
type: "head",
rows: head
- }), Object(external_wp_element_["createElement"])(Section, {
+ }), (0,external_wp_element_namespaceObject.createElement)(Section, {
type: "body",
rows: body
- }), Object(external_wp_element_["createElement"])(Section, {
+ }), (0,external_wp_element_namespaceObject.createElement)(Section, {
type: "foot",
rows: foot
- })), hasCaption && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ })), hasCaption && (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/table/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/transforms.js
const tableContentPasteSchema = _ref => {
let {
phrasingContentSchema
@@ -38368,7 +38563,7 @@ const table_transforms_transforms = {
};
/* harmony default export */ var table_transforms = (table_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/table/index.js
/**
* WordPress dependencies
*/
@@ -38553,13 +38748,13 @@ const table_settings = {
attributes: {
head: [{
cells: [{
- content: Object(external_wp_i18n_["__"])('Version'),
+ content: (0,external_wp_i18n_namespaceObject.__)('Version'),
tag: 'th'
}, {
- content: Object(external_wp_i18n_["__"])('Jazz Musician'),
+ content: (0,external_wp_i18n_namespaceObject.__)('Jazz Musician'),
tag: 'th'
}, {
- content: Object(external_wp_i18n_["__"])('Release Date'),
+ content: (0,external_wp_i18n_namespaceObject.__)('Release Date'),
tag: 'th'
}]
}],
@@ -38571,7 +38766,7 @@ const table_settings = {
content: 'Jaco Pastorius',
tag: 'td'
}, {
- content: Object(external_wp_i18n_["__"])('May 7, 2019'),
+ content: (0,external_wp_i18n_namespaceObject.__)('May 7, 2019'),
tag: 'td'
}]
}, {
@@ -38582,7 +38777,7 @@ const table_settings = {
content: 'Betty Carter',
tag: 'td'
}, {
- content: Object(external_wp_i18n_["__"])('February 21, 2019'),
+ content: (0,external_wp_i18n_namespaceObject.__)('February 21, 2019'),
tag: 'td'
}]
}, {
@@ -38593,7 +38788,7 @@ const table_settings = {
content: 'Bebo Valdés',
tag: 'td'
}, {
- content: Object(external_wp_i18n_["__"])('December 6, 2018'),
+ content: (0,external_wp_i18n_namespaceObject.__)('December 6, 2018'),
tag: 'td'
}]
}]
@@ -38605,7 +38800,7 @@ const table_settings = {
deprecated: table_deprecated
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/edit.js
/**
@@ -38651,11 +38846,11 @@ function TagCloudEdit(_ref) {
const getTaxonomyOptions = () => {
const selectOption = {
- label: Object(external_wp_i18n_["__"])('- Select -'),
+ label: (0,external_wp_i18n_namespaceObject.__)('- Select -'),
value: '',
disabled: true
};
- const taxonomyOptions = Object(external_lodash_["map"])(Object(external_lodash_["filter"])(taxonomies, 'show_cloud'), item => {
+ const taxonomyOptions = (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(taxonomies, 'show_cloud'), item => {
return {
value: item.slug,
label: item.name
@@ -38664,23 +38859,23 @@ function TagCloudEdit(_ref) {
return [selectOption, ...taxonomyOptions];
};
- const inspectorControls = Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["PanelBody"], {
- title: Object(external_wp_i18n_["__"])('Tag Cloud settings')
- }, Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], {
- label: Object(external_wp_i18n_["__"])('Taxonomy'),
+ const inspectorControls = (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.__)('Tag Cloud settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'),
options: getTaxonomyOptions(),
value: taxonomy,
onChange: selectedTaxonomy => setAttributes({
taxonomy: selectedTaxonomy
})
- }), 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: showTagCounts,
onChange: () => setAttributes({
showTagCounts: !showTagCounts
})
- }), Object(external_wp_element_["createElement"])(external_wp_components_["RangeControl"], {
- label: Object(external_wp_i18n_["__"])('Number of tags'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Number of tags'),
value: numberOfTags,
onChange: value => setAttributes({
numberOfTags: value
@@ -38689,22 +38884,22 @@ function TagCloudEdit(_ref) {
max: MAX_TAGS,
required: true
})));
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, inspectorControls, Object(external_wp_element_["createElement"])("div", Object(external_wp_blockEditor_["useBlockProps"])(), Object(external_wp_element_["createElement"])(external_wp_serverSideRender_default.a, {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, inspectorControls, (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)(), (0,external_wp_element_namespaceObject.createElement)((external_wp_serverSideRender_default()), {
key: "tag-cloud",
block: "core/tag-cloud",
attributes: attributes
})));
}
-/* harmony default export */ var tag_cloud_edit = (Object(external_wp_data_["withSelect"])(select => {
+/* harmony default export */ var tag_cloud_edit = ((0,external_wp_data_namespaceObject.withSelect)(select => {
return {
- taxonomies: select(external_wp_coreData_["store"]).getTaxonomies({
+ taxonomies: select(external_wp_coreData_namespaceObject.store).getTaxonomies({
per_page: -1
})
};
})(TagCloudEdit));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js
/**
* WordPress dependencies
*/
@@ -38753,10 +38948,22 @@ const tag_cloud_settings = {
edit: tag_cloud_edit
};
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js
-var symbol_filled = __webpack_require__("OE6V");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/selection/template-part-previews.js
+
+/**
+ * WordPress dependencies
+ */
+
+const symbolFilled = (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-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"
+}));
+/* harmony default export */ var symbol_filled = (symbolFilled);
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/selection/template-part-previews.js
@@ -38785,12 +38992,12 @@ var symbol_filled = __webpack_require__("OE6V");
function getAreaGroupTitle(areaLabel) {
- return Object(external_wp_i18n_["sprintf"])( // Translators: %s for the area the template part is assigned to (Header, Footer, General, etc.)
- Object(external_wp_i18n_["__"])('Area: %s'), areaLabel);
+ return (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s for the area the template part is assigned to (Header, Footer, General, etc.)
+ (0,external_wp_i18n_namespaceObject.__)('Area: %s'), areaLabel);
}
function PreviewPlaceholder() {
- return Object(external_wp_element_["createElement"])("div", {
+ return (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-template-part__selection-preview-item is-placeholder",
tabIndex: 0
});
@@ -38813,38 +39020,38 @@ function TemplatePartItem(_ref) {
// The fallback prevents an error in the parse function while saving.
const content = templatePart.content.raw || '';
- const blocks = Object(external_wp_element_["useMemo"])(() => Object(external_wp_blocks_["parse"])(content), [content]);
+ const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_blocks_namespaceObject.parse)(content), [content]);
const {
createSuccessNotice
- } = Object(external_wp_data_["useDispatch"])(external_wp_notices_["store"]);
- const onClick = Object(external_wp_element_["useCallback"])(() => {
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
+ const onClick = (0,external_wp_element_namespaceObject.useCallback)(() => {
setAttributes({
slug,
theme,
area: undefined
});
- createSuccessNotice(Object(external_wp_i18n_["sprintf"])(
+ createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: template part title. */
- Object(external_wp_i18n_["__"])('Template Part "%s" inserted.'), title || slug), {
+ (0,external_wp_i18n_namespaceObject.__)('Template Part "%s" inserted.'), title || slug), {
type: 'snackbar'
});
onClose();
}, [slug, theme]);
- 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({
as: "div",
className: "wp-block-template-part__selection-preview-item",
role: "option",
onClick: onClick,
onKeyDown: event => {
- if (external_wp_keycodes_["ENTER"] === event.keyCode || external_wp_keycodes_["SPACE"] === event.keyCode) {
+ if (external_wp_keycodes_namespaceObject.ENTER === event.keyCode || external_wp_keycodes_namespaceObject.SPACE === event.keyCode) {
onClick();
}
},
tabIndex: 0,
"aria-label": title || slug
- }, composite), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockPreview"], {
+ }, composite), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockPreview, {
blocks: blocks
- }), Object(external_wp_element_["createElement"])("div", {
+ }), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-template-part__selection-preview-item-title"
}, title || slug));
}
@@ -38855,13 +39062,13 @@ function PanelGroup(_ref2) {
icon,
children
} = _ref2;
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-template-part__selection-panel-group-header"
- }, Object(external_wp_element_["createElement"])("span", {
+ }, (0,external_wp_element_namespaceObject.createElement)("span", {
className: "wp-block-template-part__selection-panel-group-title"
- }, title), Object(external_wp_element_["createElement"])(external_wp_components_["Icon"], {
+ }, title), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
icon: icon
- })), Object(external_wp_element_["createElement"])("div", {
+ })), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-template-part__selection-panel-group-content"
}, children));
}
@@ -38878,38 +39085,38 @@ function TemplatePartsByArea(_ref3) {
const {
templatePartsByArea,
templatePartsToShow
- } = Object(external_wp_element_["useMemo"])(() => {
+ } = (0,external_wp_element_namespaceObject.useMemo)(() => {
const _templatePartsToShow = templateParts.filter(templatePart => 'uncategorized' === area || templatePart.area === area) || [];
- const _templatePartsByArea = Object.values(Object(external_lodash_["groupBy"])(_templatePartsToShow, 'area'));
+ const _templatePartsByArea = Object.values((0,external_lodash_namespaceObject.groupBy)(_templatePartsToShow, 'area'));
- const orderedTemplatePartsToShow = Object(external_lodash_["flatten"])(_templatePartsToShow);
+ const orderedTemplatePartsToShow = (0,external_lodash_namespaceObject.flatten)(_templatePartsToShow);
return {
templatePartsByArea: _templatePartsByArea,
templatePartsToShow: orderedTemplatePartsToShow
};
}, [templateParts, area]);
- const currentShownTPs = Object(external_wp_compose_["useAsyncList"])(templatePartsToShow);
+ const currentShownTPs = (0,external_wp_compose_namespaceObject.useAsyncList)(templatePartsToShow);
if (!templatePartsToShow.length) {
- return Object(external_wp_element_["createElement"])(PanelGroup, {
+ return (0,external_wp_element_namespaceObject.createElement)(PanelGroup, {
title: getAreaGroupTitle(labelsByArea[area] || labelsByArea.uncategorized)
- }, Object(external_wp_i18n_["sprintf"])( // Translators: %s for the template part variation ("Header", "Footer", "Template Part").
- Object(external_wp_i18n_["__"])('There is no other %s available. If you are looking for another type of template part, try searching for it using the input above.'), area && area !== 'uncategorized' ? labelsByArea[area] || area : Object(external_wp_i18n_["__"])('Template Part')));
+ }, (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s for the template part variation ("Header", "Footer", "Template Part").
+ (0,external_wp_i18n_namespaceObject.__)('There is no other %s available. If you are looking for another type of template part, try searching for it using the input above.'), area && area !== 'uncategorized' ? labelsByArea[area] || area : (0,external_wp_i18n_namespaceObject.__)('Template Part')));
}
return templatePartsByArea.map(templatePartList => {
- return Object(external_wp_element_["createElement"])(PanelGroup, {
+ return (0,external_wp_element_namespaceObject.createElement)(PanelGroup, {
key: templatePartList[0].area,
title: getAreaGroupTitle(labelsByArea[templatePartList[0].area] || labelsByArea.uncategorized)
}, templatePartList.map(templatePart => {
- return currentShownTPs.includes(templatePart) ? Object(external_wp_element_["createElement"])(TemplatePartItem, {
+ return currentShownTPs.includes(templatePart) ? (0,external_wp_element_namespaceObject.createElement)(TemplatePartItem, {
key: templatePart.id,
templatePart: templatePart,
setAttributes: setAttributes,
onClose: onClose,
composite: composite
- }) : Object(external_wp_element_["createElement"])(PreviewPlaceholder, {
+ }) : (0,external_wp_element_namespaceObject.createElement)(PreviewPlaceholder, {
key: templatePart.id
});
}));
@@ -38928,10 +39135,10 @@ function TemplatePartSearchResults(_ref4) {
const {
filteredTPs,
groupedResults
- } = Object(external_wp_element_["useMemo"])(() => {
+ } = (0,external_wp_element_namespaceObject.useMemo)(() => {
// Filter based on value.
// Remove diacritics and convert to lowercase to normalize.
- const normalizedFilterValue = Object(external_lodash_["deburr"])(filterValue).toLowerCase();
+ const normalizedFilterValue = (0,external_lodash_namespaceObject.deburr)(filterValue).toLowerCase();
const searchResults = templateParts.filter(_ref5 => {
let {
title: {
@@ -38939,15 +39146,15 @@ function TemplatePartSearchResults(_ref4) {
},
area
} = _ref5;
- return Object(external_lodash_["deburr"])(title).toLowerCase().includes(normalizedFilterValue) || // Since diacritics can be used in theme names, remove them for the comparison.
- Object(external_lodash_["deburr"])(labelsByArea[area]).toLowerCase().includes(normalizedFilterValue);
+ return (0,external_lodash_namespaceObject.deburr)(title).toLowerCase().includes(normalizedFilterValue) || // Since diacritics can be used in theme names, remove them for the comparison.
+ (0,external_lodash_namespaceObject.deburr)(labelsByArea[area]).toLowerCase().includes(normalizedFilterValue);
}); // Order based on value location.
searchResults.sort((a, b) => {
// First prioritize index found in title.
// Deburr for diacritics.
- const indexInTitleA = Object(external_lodash_["deburr"])(a.title.rendered).toLowerCase().indexOf(normalizedFilterValue);
- const indexInTitleB = Object(external_lodash_["deburr"])(b.title.rendered).toLowerCase().indexOf(normalizedFilterValue);
+ const indexInTitleA = (0,external_lodash_namespaceObject.deburr)(a.title.rendered).toLowerCase().indexOf(normalizedFilterValue);
+ const indexInTitleB = (0,external_lodash_namespaceObject.deburr)(b.title.rendered).toLowerCase().indexOf(normalizedFilterValue);
if (indexInTitleA !== -1 && indexInTitleB !== -1) {
return indexInTitleA - indexInTitleB;
@@ -38958,7 +39165,7 @@ function TemplatePartSearchResults(_ref4) {
} // Second prioritize index found in area.
- return Object(external_lodash_["deburr"])(labelsByArea[a.area]).toLowerCase().indexOf(normalizedFilterValue) - Object(external_lodash_["deburr"])(labelsByArea[b.area]).toLowerCase().indexOf(normalizedFilterValue);
+ return (0,external_lodash_namespaceObject.deburr)(labelsByArea[a.area]).toLowerCase().indexOf(normalizedFilterValue) - (0,external_lodash_namespaceObject.deburr)(labelsByArea[b.area]).toLowerCase().indexOf(normalizedFilterValue);
}); // Group filtered results together if their neighbors share the same area.
// This helps not show redundant panel groups side by side in the results.
@@ -38977,17 +39184,17 @@ function TemplatePartSearchResults(_ref4) {
groupedResults: _groupedResults
};
}, [filterValue, templateParts]);
- const currentShownTPs = Object(external_wp_compose_["useAsyncList"])(filteredTPs);
- return groupedResults.map(group => Object(external_wp_element_["createElement"])(PanelGroup, {
+ const currentShownTPs = (0,external_wp_compose_namespaceObject.useAsyncList)(filteredTPs);
+ return groupedResults.map(group => (0,external_wp_element_namespaceObject.createElement)(PanelGroup, {
key: group[0].id,
title: getAreaGroupTitle(labelsByArea[group[0].area] || labelsByArea.uncategorized)
- }, group.map(templatePart => currentShownTPs.includes(templatePart) ? Object(external_wp_element_["createElement"])(TemplatePartItem, {
+ }, group.map(templatePart => currentShownTPs.includes(templatePart) ? (0,external_wp_element_namespaceObject.createElement)(TemplatePartItem, {
key: templatePart.id,
templatePart: templatePart,
setAttributes: setAttributes,
onClose: onClose,
composite: composite
- }) : Object(external_wp_element_["createElement"])(PreviewPlaceholder, {
+ }) : (0,external_wp_element_namespaceObject.createElement)(PreviewPlaceholder, {
key: templatePart.id
}))));
}
@@ -39000,12 +39207,12 @@ function TemplatePartPreviews(_ref6) {
area,
templatePartId
} = _ref6;
- const composite = Object(external_wp_components_["__unstableUseCompositeState"])();
+ const composite = (0,external_wp_components_namespaceObject.__unstableUseCompositeState)();
const {
templateParts,
labelsByArea
- } = Object(external_wp_data_["useSelect"])(select => {
- const _templateParts = (select(external_wp_coreData_["store"]).getEntityRecords('postType', 'wp_template_part', {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
+ const _templateParts = (select(external_wp_coreData_namespaceObject.store).getEntityRecords('postType', 'wp_template_part', {
per_page: -1
}) || []).filter(templatePart => createTemplatePartId(templatePart.theme, templatePart.slug) !== templatePartId); // FIXME: @wordpress/block-library should not depend on @wordpress/editor.
// Blocks can be loaded into a *non-post* block editor.
@@ -39025,14 +39232,14 @@ function TemplatePartPreviews(_ref6) {
}, []);
if (!templateParts || !templateParts.length) {
- return Object(external_wp_element_["createElement"])(PanelGroup, null, Object(external_wp_i18n_["__"])('There are no existing template parts to select.'));
+ return (0,external_wp_element_namespaceObject.createElement)(PanelGroup, null, (0,external_wp_i18n_namespaceObject.__)('There are no existing template parts to select.'));
}
if (filterValue) {
- 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",
- "aria-label": Object(external_wp_i18n_["__"])('List of template parts')
- }), Object(external_wp_element_["createElement"])(TemplatePartSearchResults, {
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('List of template parts')
+ }), (0,external_wp_element_namespaceObject.createElement)(TemplatePartSearchResults, {
templateParts: templateParts,
setAttributes: setAttributes,
filterValue: filterValue,
@@ -39042,10 +39249,10 @@ function TemplatePartPreviews(_ref6) {
}));
}
- 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",
- "aria-label": Object(external_wp_i18n_["__"])('List of template parts')
- }), Object(external_wp_element_["createElement"])(TemplatePartsByArea, {
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('List of template parts')
+ }), (0,external_wp_element_namespaceObject.createElement)(TemplatePartsByArea, {
templateParts: templateParts,
setAttributes: setAttributes,
onClose: onClose,
@@ -39055,7 +39262,7 @@ function TemplatePartPreviews(_ref6) {
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/selection/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/selection/index.js
/**
@@ -39075,14 +39282,14 @@ function TemplatePartSelection(_ref) {
area,
templatePartId = null
} = _ref;
- const [filterValue, setFilterValue] = Object(external_wp_element_["useState"])('');
- return Object(external_wp_element_["createElement"])("div", null, Object(external_wp_element_["createElement"])(external_wp_components_["SearchControl"], {
+ const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)('');
+ return (0,external_wp_element_namespaceObject.createElement)("div", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SearchControl, {
value: filterValue,
onChange: setFilterValue,
className: "wp-block-template-part__selection-preview-search-form"
- }), Object(external_wp_element_["createElement"])("div", {
+ }), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-template-part__selection-preview-container"
- }, Object(external_wp_element_["createElement"])(TemplatePartPreviews, {
+ }, (0,external_wp_element_namespaceObject.createElement)(TemplatePartPreviews, {
setAttributes: setAttributes,
filterValue: filterValue,
onClose: onClose,
@@ -39091,7 +39298,7 @@ function TemplatePartSelection(_ref) {
})));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/placeholder/patterns-setup.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/placeholder/patterns-setup.js
/**
@@ -39113,9 +39320,9 @@ function PatternsSetup(_ref) {
const blockNameWithArea = area ? `core/template-part/${area}` : 'core/template-part'; // Restructure onCreate to set the blocks on local state.
// Add modal to confirm title and trigger onCreate.
- const [title, setTitle] = Object(external_wp_element_["useState"])(Object(external_wp_i18n_["__"])('Untitled Template Part'));
- const [startingBlocks, setStartingBlocks] = Object(external_wp_element_["useState"])([]);
- const [isTitleStep, setIsTitleStep] = Object(external_wp_element_["useState"])(false);
+ const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)((0,external_wp_i18n_namespaceObject.__)('Untitled Template Part'));
+ const [startingBlocks, setStartingBlocks] = (0,external_wp_element_namespaceObject.useState)([]);
+ const [isTitleStep, setIsTitleStep] = (0,external_wp_element_namespaceObject.useState)(false);
const selectPattern = selectedPattern => {
setStartingBlocks(selectedPattern);
@@ -39127,9 +39334,9 @@ function PatternsSetup(_ref) {
onCreate(startingBlocks, title);
};
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalBlockPatternSetup"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternSetup, {
clientId: clientId,
- startBlankComponent: Object(external_wp_element_["createElement"])(StartBlankComponent, {
+ startBlankComponent: (0,external_wp_element_namespaceObject.createElement)(StartBlankComponent, {
setTitleStep: setIsTitleStep,
areaLabel: areaLabel,
areaIcon: areaIcon
@@ -39140,30 +39347,30 @@ function PatternsSetup(_ref) {
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, blockType => blockType === blockNameWithArea);
}
- }), isTitleStep && Object(external_wp_element_["createElement"])(external_wp_components_["Modal"], {
- title: Object(external_wp_i18n_["sprintf"])( // Translators: %s as template part area title ("Header", "Footer", etc.).
- Object(external_wp_i18n_["__"])('Name and create your new %s'), areaLabel.toLowerCase()),
- closeLabel: Object(external_wp_i18n_["__"])('Cancel'),
+ }), isTitleStep && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
+ title: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
+ (0,external_wp_i18n_namespaceObject.__)('Name and create your new %s'), areaLabel.toLowerCase()),
+ closeLabel: (0,external_wp_i18n_namespaceObject.__)('Cancel'),
onRequestClose: resetPlaceholder,
overlayClassName: "wp-block-template-part__placeholder-create-new__title-form"
- }, Object(external_wp_element_["createElement"])("form", {
+ }, (0,external_wp_element_namespaceObject.createElement)("form", {
onSubmit: submitForCreation
- }, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
- label: Object(external_wp_i18n_["__"])('Name'),
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Name'),
value: title,
onChange: setTitle
- }), Object(external_wp_element_["createElement"])(external_wp_components_["Flex"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Flex, {
className: "wp-block-template-part__placeholder-create-new__title-form-actions",
justify: "flex-end"
- }, Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ }, (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",
onClick: resetPlaceholder
- }, Object(external_wp_i18n_["__"])('Cancel'))), Object(external_wp_element_["createElement"])(external_wp_components_["FlexItem"], null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ }, (0,external_wp_i18n_namespaceObject.__)('Cancel'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "primary",
type: "submit",
disabled: !title.length,
"aria-disabled": !title.length
- }, Object(external_wp_i18n_["__"])('Create')))))));
+ }, (0,external_wp_i18n_namespaceObject.__)('Create')))))));
}
function StartBlankComponent(_ref2) {
@@ -39172,18 +39379,18 @@ function StartBlankComponent(_ref2) {
areaLabel,
areaIcon
} = _ref2;
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
setTitleStep(true);
}, []);
- return Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
label: areaLabel,
icon: areaIcon,
- instructions: Object(external_wp_i18n_["sprintf"])( // Translators: %s as template part area title ("Header", "Footer", "Template Part", etc.).
- Object(external_wp_i18n_["__"])('Creating your new %s…'), areaLabel.toLowerCase())
+ instructions: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", "Template Part", etc.).
+ (0,external_wp_i18n_namespaceObject.__)('Creating your new %s…'), areaLabel.toLowerCase())
});
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/placeholder/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/placeholder/index.js
/**
@@ -39220,39 +39427,39 @@ function TemplatePartPlaceholder(_ref) {
} = _ref;
const {
saveEntityRecord
- } = Object(external_wp_data_["useDispatch"])(external_wp_coreData_["store"]);
- const [step, setStep] = Object(external_wp_element_["useState"])(PLACEHOLDER_STEPS.initial);
+ } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
+ const [step, setStep] = (0,external_wp_element_namespaceObject.useState)(PLACEHOLDER_STEPS.initial);
const {
areaIcon,
areaLabel
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
// FIXME: @wordpress/block-library should not depend on @wordpress/editor.
// Blocks can be loaded into a *non-post* block editor.
// eslint-disable-next-line @wordpress/data-no-store-string-literals
const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
- const selectedArea = Object(external_lodash_["find"])(definedAreas, {
+ const selectedArea = (0,external_lodash_namespaceObject.find)(definedAreas, {
area
});
- const defaultArea = Object(external_lodash_["find"])(definedAreas, {
+ const defaultArea = (0,external_lodash_namespaceObject.find)(definedAreas, {
area: 'uncategorized'
});
return {
areaIcon: (selectedArea === null || selectedArea === void 0 ? void 0 : selectedArea.icon) || (defaultArea === null || defaultArea === void 0 ? void 0 : defaultArea.icon),
- areaLabel: (selectedArea === null || selectedArea === void 0 ? void 0 : selectedArea.label) || Object(external_wp_i18n_["__"])('Template Part')
+ areaLabel: (selectedArea === null || selectedArea === void 0 ? void 0 : selectedArea.label) || (0,external_wp_i18n_namespaceObject.__)('Template Part')
};
}, [area]);
- const onCreate = Object(external_wp_element_["useCallback"])(async function () {
+ const onCreate = (0,external_wp_element_namespaceObject.useCallback)(async function () {
let startingBlocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- let title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Object(external_wp_i18n_["__"])('Untitled Template Part');
+ let title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0,external_wp_i18n_namespaceObject.__)('Untitled Template Part');
// If we have `area` set from block attributes, means an exposed
// block variation was inserted. So add this prop to the template
// part entity on creation. Afterwards remove `area` value from
// block attributes.
const record = {
title,
- slug: Object(external_lodash_["kebabCase"])(title),
- content: Object(external_wp_blocks_["serialize"])(startingBlocks),
+ slug: (0,external_lodash_namespaceObject.kebabCase)(title),
+ content: (0,external_wp_blocks_namespaceObject.serialize)(startingBlocks),
// `area` is filterable on the server and defaults to `UNCATEGORIZED`
// if provided value is not allowed.
area
@@ -39264,13 +39471,13 @@ function TemplatePartPlaceholder(_ref) {
area: undefined
});
}, [setAttributes, area]);
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, step === PLACEHOLDER_STEPS.initial && Object(external_wp_element_["createElement"])(external_wp_components_["Placeholder"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, step === PLACEHOLDER_STEPS.initial && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Placeholder, {
icon: areaIcon,
label: areaLabel,
- instructions: enableSelection ? Object(external_wp_i18n_["sprintf"])( // Translators: %s as template part area title ("Header", "Footer", etc.).
- Object(external_wp_i18n_["__"])('Choose an existing %s or create a new one.'), areaLabel.toLowerCase()) : Object(external_wp_i18n_["sprintf"])( // Translators: %s as template part area title ("Header", "Footer", etc.).
- Object(external_wp_i18n_["__"])('Create a new %s.'), areaLabel.toLowerCase())
- }, !hasResolvedReplacements ? Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null) : Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], {
+ instructions: enableSelection ? (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
+ (0,external_wp_i18n_namespaceObject.__)('Choose an existing %s or create a new one.'), areaLabel.toLowerCase()) : (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
+ (0,external_wp_i18n_namespaceObject.__)('Create a new %s.'), areaLabel.toLowerCase())
+ }, !hasResolvedReplacements ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null) : (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
contentClassName: "wp-block-template-part__placeholder-preview-dropdown-content",
position: "bottom right left",
renderToggle: _ref2 => {
@@ -39278,27 +39485,27 @@ function TemplatePartPlaceholder(_ref) {
isOpen,
onToggle
} = _ref2;
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, enableSelection && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, enableSelection && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "primary",
onClick: onToggle,
"aria-expanded": isOpen
- }, Object(external_wp_i18n_["__"])('Choose existing')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ }, (0,external_wp_i18n_namespaceObject.__)('Choose existing')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: enableSelection ? 'tertiary' : 'primary',
onClick: () => setStep(PLACEHOLDER_STEPS.patterns)
- }, Object(external_wp_i18n_["sprintf"])( // Translators: %s as template part area title ("Header", "Footer", etc.).
- Object(external_wp_i18n_["__"])('New %s'), areaLabel.toLowerCase())));
+ }, (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
+ (0,external_wp_i18n_namespaceObject.__)('New %s'), areaLabel.toLowerCase())));
},
renderContent: _ref3 => {
let {
onClose
} = _ref3;
- return Object(external_wp_element_["createElement"])(TemplatePartSelection, {
+ return (0,external_wp_element_namespaceObject.createElement)(TemplatePartSelection, {
setAttributes: setAttributes,
onClose: onClose,
area: area
});
}
- })), step === PLACEHOLDER_STEPS.patterns && Object(external_wp_element_["createElement"])(PatternsSetup, {
+ })), step === PLACEHOLDER_STEPS.patterns && (0,external_wp_element_namespaceObject.createElement)(PatternsSetup, {
area: area,
areaLabel: areaLabel,
areaIcon: areaIcon,
@@ -39308,7 +39515,7 @@ function TemplatePartPlaceholder(_ref) {
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/advanced-controls.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/advanced-controls.js
/**
@@ -39327,11 +39534,11 @@ function TemplatePartAdvancedControls(_ref) {
templatePartId,
defaultWrapper
} = _ref;
- const [area, setArea] = Object(external_wp_coreData_["useEntityProp"])('postType', 'wp_template_part', 'area', templatePartId);
- const [title, setTitle] = Object(external_wp_coreData_["useEntityProp"])('postType', 'wp_template_part', 'title', templatePartId);
+ const [area, setArea] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'area', templatePartId);
+ const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'title', templatePartId);
const {
areaOptions
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
// FIXME: @wordpress/block-library should not depend on @wordpress/editor.
// Blocks can be loaded into a *non-post* block editor.
// eslint-disable-next-line @wordpress/data-no-store-string-literals
@@ -39350,27 +39557,27 @@ function TemplatePartAdvancedControls(_ref) {
})
};
}, []);
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["InspectorControls"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
__experimentalGroup: "advanced"
- }, isEntityAvailable && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
- label: Object(external_wp_i18n_["__"])('Title'),
+ }, isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Title'),
value: title,
onChange: value => {
setTitle(value);
},
onFocus: event => event.target.select()
- }), Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], {
- label: Object(external_wp_i18n_["__"])('Area'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Area'),
labelPosition: "top",
options: areaOptions,
value: area,
onChange: setArea
- })), Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], {
- label: Object(external_wp_i18n_["__"])('HTML element'),
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('HTML element'),
options: [{
- label: Object(external_wp_i18n_["sprintf"])(
+ label: (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: HTML tag based on area. */
- Object(external_wp_i18n_["__"])('Default based on area (%s)'), `<${defaultWrapper}>`),
+ (0,external_wp_i18n_namespaceObject.__)('Default based on area (%s)'), `<${defaultWrapper}>`),
value: ''
}, {
label: '<header>',
@@ -39401,7 +39608,7 @@ function TemplatePartAdvancedControls(_ref) {
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/inner-blocks.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/inner-blocks.js
/**
@@ -39419,34 +39626,34 @@ function TemplatePartInnerBlocks(_ref) {
blockProps,
clientId
} = _ref;
- const themeSupportsLayout = Object(external_wp_data_["useSelect"])(select => {
+ const themeSupportsLayout = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getSettings;
const {
getSettings
- } = select(external_wp_blockEditor_["store"]);
+ } = select(external_wp_blockEditor_namespaceObject.store);
return (_getSettings = getSettings()) === null || _getSettings === void 0 ? void 0 : _getSettings.supportsLayout;
}, []);
- const defaultLayout = Object(external_wp_blockEditor_["useSetting"])('layout') || {};
+ const defaultLayout = (0,external_wp_blockEditor_namespaceObject.useSetting)('layout') || {};
const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
- const [blocks, onInput, onChange] = Object(external_wp_coreData_["useEntityBlockEditor"])('postType', 'wp_template_part', {
+ const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_template_part', {
id
});
- const innerBlocksProps = Object(external_wp_blockEditor_["useInnerBlocksProps"])(blockProps, {
+ const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
value: blocks,
onInput,
onChange,
- renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_["InnerBlocks"].ButtonBlockAppender,
+ renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender,
__experimentalLayout: themeSupportsLayout ? usedLayout : undefined
});
- return Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalBlockContentOverlay"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalBlockContentOverlay, {
clientId: clientId,
tagName: tagName,
wrapperProps: innerBlocksProps
});
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/index.js
/**
@@ -39484,7 +39691,7 @@ function TemplatePartEdit(_ref) {
layout = {}
} = attributes;
const templatePartId = createTemplatePartId(theme, slug);
- const [hasAlreadyRendered, RecursionProvider] = Object(external_wp_blockEditor_["__experimentalUseNoRecursiveRenders"])(templatePartId); // Set the postId block attribute if it did not exist,
+ const [hasAlreadyRendered, RecursionProvider] = (0,external_wp_blockEditor_namespaceObject.__experimentalUseNoRecursiveRenders)(templatePartId); // Set the postId block attribute if it did not exist,
// but wait until the inner blocks have loaded to allow
// new edits to trigger this.
@@ -39496,17 +39703,17 @@ function TemplatePartEdit(_ref) {
area,
enableSelection,
hasResolvedReplacements
- } = Object(external_wp_data_["useSelect"])(select => {
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _select$__experimenta;
const {
getEditedEntityRecord,
getEntityRecords,
hasFinishedResolution
- } = select(external_wp_coreData_["store"]);
+ } = select(external_wp_coreData_namespaceObject.store);
const {
getBlocks
- } = select(external_wp_blockEditor_["store"]);
+ } = select(external_wp_blockEditor_namespaceObject.store);
const getEntityArgs = ['postType', 'wp_template_part', templatePartId];
const entityRecord = templatePartId ? getEditedEntityRecord(...getEntityArgs) : null;
@@ -39533,44 +39740,44 @@ function TemplatePartEdit(_ref) {
return {
innerBlocks: getBlocks(clientId),
isResolved: hasResolvedEntity,
- isMissing: hasResolvedEntity && Object(external_lodash_["isEmpty"])(entityRecord),
+ isMissing: hasResolvedEntity && (0,external_lodash_namespaceObject.isEmpty)(entityRecord),
defaultWrapper: defaultWrapperElement || 'div',
area: _area,
enableSelection: _enableSelection,
hasResolvedReplacements: hasFinishedResolution('getEntityRecords', availableReplacementArgs)
};
}, [templatePartId, clientId]);
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])();
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
const isPlaceholder = !slug;
const isEntityAvailable = !isPlaceholder && !isMissing && isResolved;
const TagName = tagName || defaultWrapper; // We don't want to render a missing state if we have any inner blocks.
// A new template part is automatically created if we have any inner blocks but no entity.
if (innerBlocks.length === 0 && (slug && !theme || slug && isMissing)) {
- return Object(external_wp_element_["createElement"])(TagName, blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], null, Object(external_wp_i18n_["sprintf"])(
+ return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Template part slug */
- Object(external_wp_i18n_["__"])('Template part has been deleted or is unavailable: %s'), slug)));
+ (0,external_wp_i18n_namespaceObject.__)('Template part has been deleted or is unavailable: %s'), slug)));
}
if (isEntityAvailable && hasAlreadyRendered) {
- return Object(external_wp_element_["createElement"])(TagName, blockProps, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["Warning"], null, Object(external_wp_i18n_["__"])('Block cannot be rendered inside itself.')));
+ return (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.Warning, null, (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.')));
}
- return Object(external_wp_element_["createElement"])(RecursionProvider, null, Object(external_wp_element_["createElement"])(TemplatePartAdvancedControls, {
+ return (0,external_wp_element_namespaceObject.createElement)(RecursionProvider, null, (0,external_wp_element_namespaceObject.createElement)(TemplatePartAdvancedControls, {
tagName: tagName,
setAttributes: setAttributes,
isEntityAvailable: isEntityAvailable,
templatePartId: templatePartId,
defaultWrapper: defaultWrapper
- }), isPlaceholder && Object(external_wp_element_["createElement"])(TagName, blockProps, Object(external_wp_element_["createElement"])(TemplatePartPlaceholder, {
+ }), isPlaceholder && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(TemplatePartPlaceholder, {
area: attributes.area,
clientId: clientId,
setAttributes: setAttributes,
enableSelection: enableSelection,
hasResolvedReplacements: hasResolvedReplacements
- })), isEntityAvailable && enableSelection && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarGroup"], {
+ })), isEntityAvailable && enableSelection && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, {
className: "wp-block-template-part__block-control-group"
- }, Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
className: "wp-block-template-part__preview-dropdown-button",
contentClassName: "wp-block-template-part__preview-dropdown-content",
position: "bottom right left",
@@ -39579,42 +39786,79 @@ function TemplatePartEdit(_ref) {
isOpen,
onToggle
} = _ref3;
- return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
"aria-expanded": isOpen,
onClick: onToggle
- }, Object(external_wp_i18n_["__"])('Replace'));
+ }, (0,external_wp_i18n_namespaceObject.__)('Replace'));
},
renderContent: _ref4 => {
let {
onClose
} = _ref4;
- return Object(external_wp_element_["createElement"])(TemplatePartSelection, {
+ return (0,external_wp_element_namespaceObject.createElement)(TemplatePartSelection, {
setAttributes: setAttributes,
onClose: onClose,
area: area,
templatePartId: templatePartId
});
}
- }))), isEntityAvailable && Object(external_wp_element_["createElement"])(TemplatePartInnerBlocks, {
+ }))), isEntityAvailable && (0,external_wp_element_namespaceObject.createElement)(TemplatePartInnerBlocks, {
clientId: clientId,
tagName: TagName,
blockProps: blockProps,
postId: templatePartId,
hasInnerBlocks: innerBlocks.length > 0,
layout: layout
- }), !isPlaceholder && !isResolved && Object(external_wp_element_["createElement"])(TagName, blockProps, Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null)));
+ }), !isPlaceholder && !isResolved && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null)));
}
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/header.js
-var header = __webpack_require__("G8mJ");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/header.js
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/footer.js
-var footer = __webpack_require__("//kF");
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/sidebar.js
-var sidebar = __webpack_require__("rvQu");
+/**
+ * WordPress dependencies
+ */
+
+const header = (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 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 */ var library_header = (header);
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/footer.js
+
+
+/**
+ * WordPress dependencies
+ */
+
+const footer = (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: "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 */ var library_footer = (footer);
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/sidebar.js
+
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/fallback-variations.js
+/**
+ * WordPress dependencies
+ */
+
+const sidebar = (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.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
+}));
+/* harmony default export */ var library_sidebar = (sidebar);
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/fallback-variations.js
/**
* WordPress dependencies
*/
@@ -39624,18 +39868,18 @@ var sidebar = __webpack_require__("rvQu");
const fallback_variations_fallbackVariations = [{
name: 'header',
- icon: header["a" /* default */],
- title: Object(external_wp_i18n_["__"])('Header'),
- description: Object(external_wp_i18n_["__"])('The Header template defines a page area that typically contains a title, logo, and main navigation.'),
+ icon: library_header,
+ title: (0,external_wp_i18n_namespaceObject.__)('Header'),
+ description: (0,external_wp_i18n_namespaceObject.__)('The Header template defines a page area that typically contains a title, logo, and main navigation.'),
attributes: {
area: 'header'
},
scope: ['inserter']
}, {
name: 'footer',
- icon: footer["a" /* default */],
- title: Object(external_wp_i18n_["__"])('Footer'),
- description: Object(external_wp_i18n_["__"])('The Footer template defines a page area that typically contains site credits, social links, or any other combination of blocks.'),
+ icon: library_footer,
+ title: (0,external_wp_i18n_namespaceObject.__)('Footer'),
+ description: (0,external_wp_i18n_namespaceObject.__)('The Footer template defines a page area that typically contains site credits, social links, or any other combination of blocks.'),
attributes: {
area: 'footer'
},
@@ -39656,13 +39900,13 @@ fallback_variations_fallbackVariations.forEach(variation => {
// by checking the entity's `area` property.
if (!slug) return false;
- const entity = Object(external_wp_data_["select"])(external_wp_coreData_["store"]).getEntityRecord('postType', 'wp_template_part', `${theme}//${slug}`);
+ const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template_part', `${theme}//${slug}`);
return (entity === null || entity === void 0 ? void 0 : entity.area) === variationAttributes.area;
};
});
/* harmony default export */ var template_part_fallback_variations = (fallback_variations_fallbackVariations);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/variations.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/variations.js
/**
* WordPress dependencies
*/
@@ -39677,14 +39921,14 @@ fallback_variations_fallbackVariations.forEach(variation => {
function getTemplatePartIcon(iconName) {
if ('header' === iconName) {
- return header["a" /* default */];
+ return library_header;
} else if ('footer' === iconName) {
- return footer["a" /* default */];
+ return library_footer;
} else if ('sidebar' === iconName) {
- return sidebar["a" /* default */];
+ return library_sidebar;
}
- return symbol_filled["a" /* default */];
+ return symbol_filled;
}
function enhanceTemplatePartVariations(settings, name) {
@@ -39713,7 +39957,7 @@ function enhanceTemplatePartVariations(settings, name) {
// by checking the entity's `area` property.
if (!slug) return false;
- const entity = Object(external_wp_data_["select"])(external_wp_coreData_["store"]).getEntityRecord('postType', 'wp_template_part', `${theme}//${slug}`);
+ const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template_part', `${theme}//${slug}`);
return (entity === null || entity === void 0 ? void 0 : entity.area) === variationAttributes.area;
};
@@ -39735,7 +39979,7 @@ function enhanceTemplatePartVariations(settings, name) {
return settings;
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/index.js
/**
* External dependencies
*/
@@ -39787,7 +40031,7 @@ const {
} = template_part_metadata;
const template_part_settings = {
- icon: symbol_filled["a" /* default */],
+ icon: symbol_filled,
__experimentalLabel: _ref => {
var _entity$title;
@@ -39802,21 +40046,21 @@ const template_part_settings = {
return;
}
- const entity = Object(external_wp_data_["select"])(external_wp_coreData_["store"]).getEntityRecord('postType', 'wp_template_part', theme + '//' + slug);
+ const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', 'wp_template_part', theme + '//' + slug);
if (!entity) {
return;
}
- return Object(external_lodash_["startCase"])(((_entity$title = entity.title) === null || _entity$title === void 0 ? void 0 : _entity$title.rendered) || entity.slug);
+ return (0,external_lodash_namespaceObject.startCase)(((_entity$title = entity.title) === null || _entity$title === void 0 ? void 0 : _entity$title.rendered) || entity.slug);
},
edit: TemplatePartEdit
}; // Importing this file includes side effects. This is whitelisted in block-library/package.json under sideEffects
-Object(external_wp_hooks_["addFilter"])('blocks.registerBlockType', 'core/template-part', enhanceTemplatePartVariations); // Prevent adding template parts inside post templates.
+(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/template-part', enhanceTemplatePartVariations); // Prevent adding template parts inside post templates.
const DISALLOWED_PARENTS = ['core/post-template', 'core/post-content'];
-Object(external_wp_hooks_["addFilter"])('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromPostTemplates', (can, blockType, rootClientId, _ref2) => {
+(0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromPostTemplates', (can, blockType, rootClientId, _ref2) => {
let {
getBlock,
getBlockParentsByBlockName
@@ -39839,27 +40083,27 @@ Object(external_wp_hooks_["addFilter"])('blockEditor.__unstableCanInsertBlockTyp
return true;
});
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/term-description.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/term-description.js
/**
* WordPress dependencies
*/
-const term_description_tag = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const term_description_tag = (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, {
stroke: "#1E1E1E",
strokeWidth: "1.5",
d: "M9 19.25h6M4 19.25h4M12 15.25h8M4 15.25h7"
-}), Object(external_wp_element_["createElement"])(external_wp_primitives_["Path"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
d: "M8.994 10.103H6.08L5.417 12H4l2.846-8h1.383l2.845 8H9.657l-.663-1.897zm-.457-1.28l-.994-2.857-1.006 2.857h2z",
fill: "#1E1E1E"
}));
/* harmony default export */ var term_description = (term_description_tag);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/term-description/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/term-description/edit.js
/**
@@ -39881,27 +40125,27 @@ function TermDescriptionEdit(_ref) {
const {
textAlign
} = attributes;
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
}),
style: mergedStyle
});
- 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: "block"
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["AlignmentControl"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.AlignmentControl, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
textAlign: nextAlign
});
}
- })), Object(external_wp_element_["createElement"])("div", blockProps, Object(external_wp_element_["createElement"])("div", {
+ })), (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-term-description__placeholder"
- }, Object(external_wp_element_["createElement"])("span", null, Object(external_wp_i18n_["__"])('Term Description')))));
+ }, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('Term Description')))));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/term-description/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/term-description/index.js
/**
* WordPress dependencies
*/
@@ -39948,11 +40192,10 @@ const term_description_settings = {
edit: TermDescriptionEdit
};
-// 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-library/build-module/text-columns/edit.js
+;// 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-library/build-module/text-columns/edit.js
/**
@@ -39981,14 +40224,14 @@ function TextColumnsEdit(_ref) {
since: '5.3',
alternative: 'the Columns block'
});
- 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_["BlockAlignmentToolbar"], {
+ 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.BlockAlignmentToolbar, {
value: width,
onChange: nextWidth => setAttributes({
width: nextWidth
}),
controls: ['center', 'wide', 'full']
- })), 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: columns,
onChange: value => setAttributes({
columns: value
@@ -39996,15 +40239,15 @@ function TextColumnsEdit(_ref) {
min: 2,
max: 4,
required: true
- }))), Object(external_wp_element_["createElement"])("div", Object(external_wp_blockEditor_["useBlockProps"])({
+ }))), (0,external_wp_element_namespaceObject.createElement)("div", (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: `align${width} columns-${columns}`
- }), Object(external_lodash_["times"])(columns, index => {
- return Object(external_wp_element_["createElement"])("div", {
+ }), (0,external_lodash_namespaceObject.times)(columns, index => {
+ return (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-column",
key: `column-${index}`
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
tagName: "p",
- value: Object(external_lodash_["get"])(content, [index, 'children']),
+ value: (0,external_lodash_namespaceObject.get)(content, [index, 'children']),
onChange: nextContent => {
setAttributes({
content: [...content.slice(0, index), {
@@ -40012,14 +40255,14 @@ function TextColumnsEdit(_ref) {
}, ...content.slice(index + 1)]
});
},
- "aria-label": Object(external_wp_i18n_["sprintf"])( // translators: %d: column index (starting with 1)
- Object(external_wp_i18n_["__"])('Column %d text'), index + 1),
- placeholder: Object(external_wp_i18n_["__"])('New Column')
+ "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %d: column index (starting with 1)
+ (0,external_wp_i18n_namespaceObject.__)('Column %d text'), index + 1),
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('New Column')
}));
})));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/save.js
/**
@@ -40040,18 +40283,18 @@ function text_columns_save_save(_ref) {
content,
columns
} = attributes;
- 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: `align${width} columns-${columns}`
- }), Object(external_lodash_["times"])(columns, index => Object(external_wp_element_["createElement"])("div", {
+ }), (0,external_lodash_namespaceObject.times)(columns, index => (0,external_wp_element_namespaceObject.createElement)("div", {
className: "wp-block-column",
key: `column-${index}`
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
tagName: "p",
- value: Object(external_lodash_["get"])(content, [index, 'children'])
+ value: (0,external_lodash_namespaceObject.get)(content, [index, 'children'])
}))));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/transforms.js
/**
* WordPress dependencies
*/
@@ -40067,7 +40310,7 @@ const text_columns_transforms_transforms = {
content,
width
} = _ref;
- return Object(external_wp_blocks_["createBlock"])('core/columns', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {
align: 'wide' === width || 'full' === width ? width : undefined,
className,
columns
@@ -40075,7 +40318,7 @@ const text_columns_transforms_transforms = {
let {
children
} = _ref2;
- return Object(external_wp_blocks_["createBlock"])('core/column', {}, [Object(external_wp_blocks_["createBlock"])('core/paragraph', {
+ return (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {
content: children
})]);
}));
@@ -40084,7 +40327,7 @@ const text_columns_transforms_transforms = {
};
/* harmony default export */ var text_columns_transforms = (text_columns_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js
/**
* Internal dependencies
*/
@@ -40149,22 +40392,22 @@ const text_columns_settings = {
save: text_columns_save_save
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/verse.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/verse.js
/**
* WordPress dependencies
*/
-const verse = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const verse = (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.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"
}));
/* harmony default export */ var library_verse = (verse);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/deprecated.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/deprecated.js
/**
@@ -40202,7 +40445,7 @@ const verse_deprecated_v1 = {
textAlign,
content
} = attributes;
- 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: "pre",
style: {
textAlign
@@ -40252,9 +40495,9 @@ const verse_deprecated_v2 = {
const className = classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
});
- return Object(external_wp_element_["createElement"])("pre", external_wp_blockEditor_["useBlockProps"].save({
+ return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save({
className
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: content
}));
},
@@ -40282,7 +40525,7 @@ const verse_deprecated_v2 = {
/* harmony default export */ var verse_deprecated = ([verse_deprecated_v2, verse_deprecated_v1]);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/edit.js
@@ -40308,20 +40551,20 @@ function VerseEdit(_ref) {
textAlign,
content
} = attributes;
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
}),
style
});
- 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_["AlignmentToolbar"], {
+ 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.AlignmentToolbar, {
value: textAlign,
onChange: nextAlign => {
setAttributes({
textAlign: nextAlign
});
}
- })), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], Object(esm_extends["a" /* default */])({
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, _extends({
tagName: "pre",
identifier: "content",
preserveWhiteSpace: true,
@@ -40331,8 +40574,8 @@ function VerseEdit(_ref) {
content: nextContent
});
},
- "aria-label": Object(external_wp_i18n_["__"])('Verse text'),
- placeholder: Object(external_wp_i18n_["__"])('Write verse…'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Verse text'),
+ placeholder: (0,external_wp_i18n_namespaceObject.__)('Write verse…'),
onRemove: onRemove,
onMerge: mergeBlocks,
textAlign: textAlign
@@ -40341,7 +40584,7 @@ function VerseEdit(_ref) {
})));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/save.js
/**
@@ -40364,14 +40607,14 @@ function verse_save_save(_ref) {
const className = classnames_default()({
[`has-text-align-${textAlign}`]: textAlign
});
- return Object(external_wp_element_["createElement"])("pre", external_wp_blockEditor_["useBlockProps"].save({
+ return (0,external_wp_element_namespaceObject.createElement)("pre", external_wp_blockEditor_namespaceObject.useBlockProps.save({
className
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"].Content, {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText.Content, {
value: content
}));
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/transforms.js
/**
* WordPress dependencies
*/
@@ -40380,17 +40623,17 @@ const verse_transforms_transforms = {
from: [{
type: 'block',
blocks: ['core/paragraph'],
- transform: attributes => Object(external_wp_blocks_["createBlock"])('core/verse', attributes)
+ transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/verse', attributes)
}],
to: [{
type: 'block',
blocks: ['core/paragraph'],
- transform: attributes => Object(external_wp_blocks_["createBlock"])('core/paragraph', attributes)
+ transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes)
}]
};
/* harmony default export */ var verse_transforms = (verse_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/verse/index.js
/**
* WordPress dependencies
*/
@@ -40461,7 +40704,7 @@ const verse_settings = {
attributes: {
/* eslint-disable @wordpress/i18n-no-collapsible-whitespace */
// translators: Sample content for the Verse block. Can be replaced with a more locale-adequate work.
- content: Object(external_wp_i18n_["__"])('WHAT was he doing, the great god Pan,\n Down in the reeds by the river?\nSpreading ruin and scattering ban,\nSplashing and paddling with hoofs of a goat,\nAnd breaking the golden lilies afloat\n With the dragon-fly on the river.')
+ content: (0,external_wp_i18n_namespaceObject.__)('WHAT was he doing, the great god Pan,\n Down in the reeds by the river?\nSpreading ruin and scattering ban,\nSplashing and paddling with hoofs of a goat,\nAnd breaking the golden lilies afloat\n With the dragon-fly on the river.')
/* eslint-enable @wordpress/i18n-no-collapsible-whitespace */
}
@@ -40479,22 +40722,22 @@ const verse_settings = {
save: verse_save_save
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/video.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/video.js
/**
* WordPress dependencies
*/
-const video = Object(external_wp_element_["createElement"])(external_wp_primitives_["SVG"], {
+const video = (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: "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_video = (video);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/edit-common-settings.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/edit-common-settings.js
/**
@@ -40505,13 +40748,13 @@ const video = Object(external_wp_element_["createElement"])(external_wp_primitiv
const options = [{
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')
}];
const VideoSettings = _ref => {
@@ -40528,15 +40771,15 @@ const VideoSettings = _ref => {
preload
} = attributes;
- const autoPlayHelpText = Object(external_wp_i18n_["__"])('Autoplay may cause usability issues for some users.');
+ const autoPlayHelpText = (0,external_wp_i18n_namespaceObject.__)('Autoplay may cause usability issues for some users.');
- const getAutoplayHelp = external_wp_element_["Platform"].select({
- web: Object(external_wp_element_["useCallback"])(checked => {
+ const getAutoplayHelp = external_wp_element_namespaceObject.Platform.select({
+ web: (0,external_wp_element_namespaceObject.useCallback)(checked => {
return checked ? autoPlayHelpText : null;
}, []),
native: autoPlayHelpText
});
- const toggleFactory = Object(external_wp_element_["useMemo"])(() => {
+ const toggleFactory = (0,external_wp_element_namespaceObject.useMemo)(() => {
const toggleAttribute = attribute => {
return newValue => {
setAttributes({
@@ -40553,34 +40796,34 @@ const VideoSettings = _ref => {
playsInline: toggleAttribute('playsInline')
};
}, []);
- const onChangePreload = Object(external_wp_element_["useCallback"])(value => {
+ const onChangePreload = (0,external_wp_element_namespaceObject.useCallback)(value => {
setAttributes({
preload: value
});
}, []);
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Autoplay'),
+ return (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.__)('Autoplay'),
onChange: toggleFactory.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: toggleFactory.loop,
checked: loop
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Muted'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Muted'),
onChange: toggleFactory.muted,
checked: muted
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Playback controls'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Playback controls'),
onChange: toggleFactory.controls,
checked: controls
- }), Object(external_wp_element_["createElement"])(external_wp_components_["ToggleControl"], {
- label: Object(external_wp_i18n_["__"])('Play inline'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Play inline'),
onChange: toggleFactory.playsInline,
checked: playsInline
- }), Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], {
- label: Object(external_wp_i18n_["__"])('Preload'),
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Preload'),
value: preload,
onChange: onChangePreload,
options: options,
@@ -40590,10 +40833,22 @@ const VideoSettings = _ref => {
/* harmony default export */ var edit_common_settings = (VideoSettings);
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/media.js
-var library_media = __webpack_require__("rH4q");
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/media.js
+
+
+/**
+ * WordPress dependencies
+ */
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/tracks-editor.js
+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/block-library/build-module/video/tracks-editor.js
/**
@@ -40609,28 +40864,28 @@ var library_media = __webpack_require__("rH4q");
const ALLOWED_TYPES = ['text/vtt'];
const DEFAULT_KIND = 'subtitles';
const KIND_OPTIONS = [{
- label: Object(external_wp_i18n_["__"])('Subtitles'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Subtitles'),
value: 'subtitles'
}, {
- label: Object(external_wp_i18n_["__"])('Captions'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Captions'),
value: 'captions'
}, {
- label: Object(external_wp_i18n_["__"])('Descriptions'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Descriptions'),
value: 'descriptions'
}, {
- label: Object(external_wp_i18n_["__"])('Chapters'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Chapters'),
value: 'chapters'
}, {
- label: Object(external_wp_i18n_["__"])('Metadata'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Metadata'),
value: 'metadata'
}];
-const captionIcon = Object(external_wp_element_["createElement"])(external_wp_components_["SVG"], {
+const captionIcon = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
width: "18",
height: "14",
viewBox: "0 0 18 14",
role: "img",
fill: "none"
-}, Object(external_wp_element_["createElement"])(external_wp_components_["Rect"], {
+}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Rect, {
x: "0.75",
y: "0.75",
width: "16.5",
@@ -40639,11 +40894,11 @@ const captionIcon = Object(external_wp_element_["createElement"])(external_wp_co
stroke: "black",
strokeWidth: "1.5",
fill: "none"
-}), Object(external_wp_element_["createElement"])(external_wp_components_["Path"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M3 7H15",
stroke: "black",
strokeWidth: "1.5"
-}), Object(external_wp_element_["createElement"])(external_wp_components_["Path"], {
+}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
d: "M3 10L15 10",
stroke: "black",
strokeWidth: "1.5"
@@ -40657,26 +40912,26 @@ function TrackList(_ref) {
let content;
if (tracks.length === 0) {
- content = Object(external_wp_element_["createElement"])("p", {
+ content = (0,external_wp_element_namespaceObject.createElement)("p", {
className: "block-library-video-tracks-editor__tracks-informative-message"
- }, Object(external_wp_i18n_["__"])('Tracks can be subtitles, captions, chapters, or descriptions. They help make your content more accessible to a wider range of users.'));
+ }, (0,external_wp_i18n_namespaceObject.__)('Tracks can be subtitles, captions, chapters, or descriptions. They help make your content more accessible to a wider range of users.'));
} else {
content = tracks.map((track, index) => {
- return Object(external_wp_element_["createElement"])("div", {
+ return (0,external_wp_element_namespaceObject.createElement)("div", {
key: index,
className: "block-library-video-tracks-editor__track-list-track"
- }, Object(external_wp_element_["createElement"])("span", null, track.label, " "), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ }, (0,external_wp_element_namespaceObject.createElement)("span", null, track.label, " "), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "tertiary",
onClick: () => onEditPress(index),
- "aria-label": Object(external_wp_i18n_["sprintf"])(
+ "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: Label of the video text track e.g: "French subtitles" */
- Object(external_wp_i18n_["__"])('Edit %s'), track.label)
- }, Object(external_wp_i18n_["__"])('Edit')));
+ (0,external_wp_i18n_namespaceObject.__)('Edit %s'), track.label)
+ }, (0,external_wp_i18n_namespaceObject.__)('Edit')));
});
}
- return Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], {
- label: Object(external_wp_i18n_["__"])('Text tracks'),
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Text tracks'),
className: "block-library-video-tracks-editor__track-list"
}, content);
}
@@ -40694,14 +40949,14 @@ function SingleTrackEditor(_ref2) {
srcLang = '',
kind = DEFAULT_KIND
} = track;
- const fileName = src.startsWith('blob:') ? '' : Object(external_wp_url_["getFilename"])(src) || '';
- return Object(external_wp_element_["createElement"])(external_wp_components_["NavigableMenu"], null, Object(external_wp_element_["createElement"])("div", {
+ const fileName = src.startsWith('blob:') ? '' : (0,external_wp_url_namespaceObject.getFilename)(src) || '';
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, null, (0,external_wp_element_namespaceObject.createElement)("div", {
className: "block-library-video-tracks-editor__single-track-editor"
- }, Object(external_wp_element_["createElement"])("span", {
+ }, (0,external_wp_element_namespaceObject.createElement)("span", {
className: "block-library-video-tracks-editor__single-track-editor-edit-track-label"
- }, Object(external_wp_i18n_["__"])('Edit track')), Object(external_wp_element_["createElement"])("span", null, Object(external_wp_i18n_["__"])('File'), ": ", Object(external_wp_element_["createElement"])("b", null, fileName)), Object(external_wp_element_["createElement"])("div", {
+ }, (0,external_wp_i18n_namespaceObject.__)('Edit track')), (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.__)('File'), ": ", (0,external_wp_element_namespaceObject.createElement)("b", null, fileName)), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "block-library-video-tracks-editor__single-track-editor-label-language"
- }, Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"]
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl
/* eslint-disable jsx-a11y/no-autofocus */
, {
autoFocus: true
@@ -40710,36 +40965,36 @@ function SingleTrackEditor(_ref2) {
onChange: newLabel => onChange({ ...track,
label: newLabel
}),
- label: Object(external_wp_i18n_["__"])('Label'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Label'),
value: label,
- help: Object(external_wp_i18n_["__"])('Title of track')
- }), Object(external_wp_element_["createElement"])(external_wp_components_["TextControl"], {
+ help: (0,external_wp_i18n_namespaceObject.__)('Title of track')
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
onChange: newSrcLang => onChange({ ...track,
srcLang: newSrcLang
}),
- label: Object(external_wp_i18n_["__"])('Source language'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Source language'),
value: srcLang,
- help: Object(external_wp_i18n_["__"])('Language tag (en, fr, etc.)')
- })), Object(external_wp_element_["createElement"])(external_wp_components_["SelectControl"], {
+ help: (0,external_wp_i18n_namespaceObject.__)('Language tag (en, fr, etc.)')
+ })), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
className: "block-library-video-tracks-editor__single-track-editor-kind-select",
options: KIND_OPTIONS,
value: kind,
- label: Object(external_wp_i18n_["__"])('Kind'),
+ label: (0,external_wp_i18n_namespaceObject.__)('Kind'),
onChange: newKind => {
onChange({ ...track,
kind: newKind
});
}
- }), Object(external_wp_element_["createElement"])("div", {
+ }), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "block-library-video-tracks-editor__single-track-editor-buttons-container"
- }, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "secondary",
onClick: () => {
const changes = {};
let hasChanges = false;
if (label === '') {
- changes.label = Object(external_wp_i18n_["__"])('English');
+ changes.label = (0,external_wp_i18n_namespaceObject.__)('English');
hasChanges = true;
}
@@ -40761,11 +41016,11 @@ function SingleTrackEditor(_ref2) {
onClose();
}
- }, Object(external_wp_i18n_["__"])('Close')), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ }, (0,external_wp_i18n_namespaceObject.__)('Close')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
isDestructive: true,
variant: "link",
onClick: onRemove
- }, Object(external_wp_i18n_["__"])('Remove track')))));
+ }, (0,external_wp_i18n_namespaceObject.__)('Remove track')))));
}
function TracksEditor(_ref3) {
@@ -40773,24 +41028,24 @@ function TracksEditor(_ref3) {
tracks = [],
onChange
} = _ref3;
- const mediaUpload = Object(external_wp_data_["useSelect"])(select => {
- return select(external_wp_blockEditor_["store"]).getSettings().mediaUpload;
+ const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => {
+ return select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload;
}, []);
- const [trackBeingEdited, setTrackBeingEdited] = Object(external_wp_element_["useState"])(null);
+ const [trackBeingEdited, setTrackBeingEdited] = (0,external_wp_element_namespaceObject.useState)(null);
if (!mediaUpload) {
return null;
}
- return Object(external_wp_element_["createElement"])(external_wp_components_["Dropdown"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
contentClassName: "block-library-video-tracks-editor",
renderToggle: _ref4 => {
let {
isOpen,
onToggle
} = _ref4;
- return Object(external_wp_element_["createElement"])(external_wp_components_["ToolbarButton"], {
- label: Object(external_wp_i18n_["__"])('Text tracks'),
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
+ label: (0,external_wp_i18n_namespaceObject.__)('Text tracks'),
showTooltip: true,
"aria-expanded": isOpen,
"aria-haspopup": "true",
@@ -40802,7 +41057,7 @@ function TracksEditor(_ref3) {
let {} = _ref5;
if (trackBeingEdited !== null) {
- return Object(external_wp_element_["createElement"])(SingleTrackEditor, {
+ return (0,external_wp_element_namespaceObject.createElement)(SingleTrackEditor, {
track: tracks[trackBeingEdited],
onChange: newTrack => {
const newTracks = [...tracks];
@@ -40817,13 +41072,13 @@ function TracksEditor(_ref3) {
});
}
- return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["NavigableMenu"], null, Object(external_wp_element_["createElement"])(TrackList, {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.NavigableMenu, null, (0,external_wp_element_namespaceObject.createElement)(TrackList, {
tracks: tracks,
onEditPress: setTrackBeingEdited
- }), Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, {
className: "block-library-video-tracks-editor__add-tracks-container",
- label: Object(external_wp_i18n_["__"])('Add tracks')
- }, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaUpload"], {
+ label: (0,external_wp_i18n_namespaceObject.__)('Add tracks')
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUpload, {
onSelect: _ref6 => {
let {
url
@@ -40839,12 +41094,12 @@ function TracksEditor(_ref3) {
let {
open
} = _ref7;
- return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
- icon: library_media["a" /* default */],
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
+ icon: library_media,
onClick: open
- }, Object(external_wp_i18n_["__"])('Open Media Library'));
+ }, (0,external_wp_i18n_namespaceObject.__)('Open Media Library'));
}
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaUploadCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["FormFileUpload"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FormFileUpload, {
onChange: event => {
const files = event.target.files;
const trackIndex = tracks.length;
@@ -40874,19 +41129,19 @@ function TracksEditor(_ref3) {
let {
openFileDialog
} = _ref9;
- return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
- icon: upload["a" /* default */],
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
+ icon: library_upload,
onClick: () => {
openFileDialog();
}
- }, Object(external_wp_i18n_["__"])('Upload'));
+ }, (0,external_wp_i18n_namespaceObject.__)('Upload'));
}
})))));
}
});
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/tracks.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/tracks.js
function Tracks(_ref) {
@@ -40894,13 +41149,13 @@ function Tracks(_ref) {
tracks = []
} = _ref;
return tracks.map(track => {
- return Object(external_wp_element_["createElement"])("track", Object(esm_extends["a" /* default */])({
+ return (0,external_wp_element_namespaceObject.createElement)("track", _extends({
key: track.src
}, track));
});
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/edit.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/edit.js
/**
@@ -40942,9 +41197,9 @@ function VideoEdit(_ref) {
onReplace,
noticeOperations
} = _ref;
- const instanceId = Object(external_wp_compose_["useInstanceId"])(VideoEdit);
- const videoPlayer = Object(external_wp_element_["useRef"])();
- const posterImageButton = Object(external_wp_element_["useRef"])();
+ const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(VideoEdit);
+ const videoPlayer = (0,external_wp_element_namespaceObject.useRef)();
+ const posterImageButton = (0,external_wp_element_namespaceObject.useRef)();
const {
id,
caption,
@@ -40953,11 +41208,11 @@ function VideoEdit(_ref) {
src,
tracks
} = attributes;
- const isTemporaryVideo = !id && Object(external_wp_blob_["isBlobURL"])(src);
- const mediaUpload = Object(external_wp_data_["useSelect"])(select => select(external_wp_blockEditor_["store"]).getSettings().mediaUpload);
- Object(external_wp_element_["useEffect"])(() => {
- if (!id && Object(external_wp_blob_["isBlobURL"])(src)) {
- const file = Object(external_wp_blob_["getBlobByURL"])(src);
+ const isTemporaryVideo = !id && (0,external_wp_blob_namespaceObject.isBlobURL)(src);
+ const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().mediaUpload);
+ (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({
@@ -40978,7 +41233,7 @@ function VideoEdit(_ref) {
}
}
}, []);
- Object(external_wp_element_["useEffect"])(() => {
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
// Placeholder may be rendered.
if (videoPlayer.current) {
videoPlayer.current.load();
@@ -41039,13 +41294,13 @@ function VideoEdit(_ref) {
const classes = classnames_default()(className, {
'is-transient': isTemporaryVideo
});
- const blockProps = Object(external_wp_blockEditor_["useBlockProps"])({
+ const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({
className: classes
});
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_video
}),
onSelect: onSelectVideo,
@@ -41073,18 +41328,18 @@ function VideoEdit(_ref) {
}
const videoPosterDescription = `video-block__poster-image-description-${instanceId}`;
- 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: "block"
- }, Object(external_wp_element_["createElement"])(TracksEditor, {
+ }, (0,external_wp_element_namespaceObject.createElement)(TracksEditor, {
tracks: tracks,
onChange: newTracks => {
setAttributes({
tracks: newTracks
});
}
- })), 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: src,
allowedTypes: video_edit_ALLOWED_MEDIA_TYPES,
@@ -41092,61 +41347,61 @@ function VideoEdit(_ref) {
onSelect: onSelectVideo,
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_["__"])('Video settings')
- }, Object(external_wp_element_["createElement"])(edit_common_settings, {
+ })), (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.__)('Video settings')
+ }, (0,external_wp_element_namespaceObject.createElement)(edit_common_settings, {
setAttributes: setAttributes,
attributes: attributes
- }), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaUploadCheck"], null, Object(external_wp_element_["createElement"])(external_wp_components_["BaseControl"], {
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
className: "editor-video-poster-control"
- }, Object(external_wp_element_["createElement"])(external_wp_components_["BaseControl"].VisualLabel, null, Object(external_wp_i18n_["__"])('Poster image')), Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaUpload"], {
- title: Object(external_wp_i18n_["__"])('Select poster image'),
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_wp_i18n_namespaceObject.__)('Poster image')), (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.MediaUpload, {
+ title: (0,external_wp_i18n_namespaceObject.__)('Select poster image'),
onSelect: onSelectPoster,
allowedTypes: VIDEO_POSTER_ALLOWED_MEDIA_TYPES,
render: _ref3 => {
let {
open
} = _ref3;
- return Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "primary",
onClick: open,
ref: posterImageButton,
"aria-describedby": videoPosterDescription
- }, !poster ? Object(external_wp_i18n_["__"])('Select') : Object(external_wp_i18n_["__"])('Replace'));
+ }, !poster ? (0,external_wp_i18n_namespaceObject.__)('Select') : (0,external_wp_i18n_namespaceObject.__)('Replace'));
}
- }), Object(external_wp_element_["createElement"])("p", {
+ }), (0,external_wp_element_namespaceObject.createElement)("p", {
id: videoPosterDescription,
hidden: true
- }, poster ? Object(external_wp_i18n_["sprintf"])(
+ }, poster ? (0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: %s: poster image URL. */
- Object(external_wp_i18n_["__"])('The current poster image url is %s'), poster) : Object(external_wp_i18n_["__"])('There is no poster image currently selected')), !!poster && Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ (0,external_wp_i18n_namespaceObject.__)('The current poster image url is %s'), poster) : (0,external_wp_i18n_namespaceObject.__)('There is no poster image currently selected')), !!poster && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
onClick: onRemovePoster,
variant: "tertiary"
- }, Object(external_wp_i18n_["__"])('Remove')))))), Object(external_wp_element_["createElement"])("figure", blockProps, Object(external_wp_element_["createElement"])(external_wp_components_["Disabled"], {
+ }, (0,external_wp_i18n_namespaceObject.__)('Remove')))))), (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"])("video", {
+ }, (0,external_wp_element_namespaceObject.createElement)("video", {
controls: controls,
poster: poster,
src: src,
ref: videoPlayer
- }, Object(external_wp_element_["createElement"])(Tracks, {
+ }, (0,external_wp_element_namespaceObject.createElement)(Tracks, {
tracks: tracks
- }))), isTemporaryVideo && Object(external_wp_element_["createElement"])(external_wp_components_["Spinner"], null), (!external_wp_blockEditor_["RichText"].isEmpty(caption) || isSelected) && Object(external_wp_element_["createElement"])(external_wp_blockEditor_["RichText"], {
+ }))), isTemporaryVideo && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null), (!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_["__"])('Video caption text'),
- placeholder: Object(external_wp_i18n_["__"])('Add caption'),
+ "aria-label": (0,external_wp_i18n_namespaceObject.__)('Video 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 video_edit = (Object(external_wp_components_["withNotices"])(VideoEdit));
+/* harmony default export */ var video_edit = ((0,external_wp_components_namespaceObject.withNotices)(VideoEdit));
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/save.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/save.js
/**
@@ -41174,7 +41429,7 @@ function video_save_save(_ref) {
playsInline,
tracks
} = attributes;
- return Object(external_wp_element_["createElement"])("figure", external_wp_blockEditor_["useBlockProps"].save(), src && Object(external_wp_element_["createElement"])("video", {
+ return (0,external_wp_element_namespaceObject.createElement)("figure", external_wp_blockEditor_namespaceObject.useBlockProps.save(), src && (0,external_wp_element_namespaceObject.createElement)("video", {
autoPlay: autoplay,
controls: controls,
loop: loop,
@@ -41183,15 +41438,15 @@ function video_save_save(_ref) {
preload: preload !== 'metadata' ? preload : undefined,
src: src,
playsInline: playsInline
- }, Object(external_wp_element_["createElement"])(Tracks, {
+ }, (0,external_wp_element_namespaceObject.createElement)(Tracks, {
tracks: tracks
- })), !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/video/transforms.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/transforms.js
/**
* WordPress dependencies
*/
@@ -41210,8 +41465,8 @@ const video_transforms_transforms = {
// It's already done as part of the `componentDidMount`
// in the video block
- const block = Object(external_wp_blocks_["createBlock"])('core/video', {
- src: Object(external_wp_blob_["createBlobURL"])(file)
+ const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/video', {
+ src: (0,external_wp_blob_namespaceObject.createBlobURL)(file)
});
return block;
}
@@ -41285,7 +41540,7 @@ const video_transforms_transforms = {
};
/* harmony default export */ var video_transforms = (video_transforms_transforms);
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/video/index.js
/**
* WordPress dependencies
*/
@@ -41390,7 +41645,7 @@ const video_settings = {
attributes: {
src: 'https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm',
// translators: Caption accompanying a video of the wood thrush singing, which serves as an example for the Video block.
- caption: Object(external_wp_i18n_["__"])('Wood thrush singing in Central Park, NYC.')
+ caption: (0,external_wp_i18n_namespaceObject.__)('Wood thrush singing in Central Park, NYC.')
}
},
transforms: video_transforms,
@@ -41398,7 +41653,7 @@ const video_settings = {
save: video_save_save
};
-// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/index.js
+;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/index.js
/**
* WordPress dependencies
*/
@@ -41508,7 +41763,7 @@ const registerBlock = block => {
settings,
name
} = block;
- Object(external_wp_blocks_["registerBlockType"])({
+ (0,external_wp_blocks_namespaceObject.registerBlockType)({
name,
...metadata
}, settings);
@@ -41528,8 +41783,8 @@ const registerBlock = block => {
const __experimentalGetCoreBlocks = () => [// Common blocks are grouped at the top to prioritize their display
// in various contexts — like the inserter and auto-complete components.
build_module_paragraph_namespaceObject, build_module_image_namespaceObject, build_module_heading_namespaceObject, build_module_gallery_namespaceObject, build_module_list_namespaceObject, build_module_quote_namespaceObject, // Register all remaining core blocks.
-archives_namespaceObject, build_module_audio_namespaceObject, button_namespaceObject, build_module_buttons_namespaceObject, build_module_calendar_namespaceObject, categories_namespaceObject, window.wp && window.wp.oldEditor ? freeform_namespaceObject : null, // Only add the classic block in WP Context
-code_namespaceObject, build_module_column_namespaceObject, build_module_columns_namespaceObject, build_module_cover_namespaceObject, embed_namespaceObject, build_module_file_namespaceObject, group_namespaceObject, build_module_html_namespaceObject, latest_comments_namespaceObject, latest_posts_namespaceObject, media_text_namespaceObject, missing_namespaceObject, build_module_more_namespaceObject, nextpage_namespaceObject, page_list_namespaceObject, pattern_namespaceObject, build_module_preformatted_namespaceObject, build_module_pullquote_namespaceObject, block_namespaceObject, build_module_rss_namespaceObject, search_namespaceObject, build_module_separator_namespaceObject, build_module_shortcode_namespaceObject, social_link_namespaceObject, social_links_namespaceObject, spacer_namespaceObject, build_module_table_namespaceObject, // tableOfContents,
+archives_namespaceObject, build_module_audio_namespaceObject, build_module_button_namespaceObject, build_module_buttons_namespaceObject, build_module_calendar_namespaceObject, categories_namespaceObject, window.wp && window.wp.oldEditor ? freeform_namespaceObject : null, // Only add the classic block in WP Context
+build_module_code_namespaceObject, build_module_column_namespaceObject, build_module_columns_namespaceObject, build_module_cover_namespaceObject, embed_namespaceObject, build_module_file_namespaceObject, build_module_group_namespaceObject, build_module_html_namespaceObject, latest_comments_namespaceObject, latest_posts_namespaceObject, media_text_namespaceObject, missing_namespaceObject, build_module_more_namespaceObject, nextpage_namespaceObject, page_list_namespaceObject, pattern_namespaceObject, build_module_preformatted_namespaceObject, build_module_pullquote_namespaceObject, block_namespaceObject, build_module_rss_namespaceObject, build_module_search_namespaceObject, build_module_separator_namespaceObject, build_module_shortcode_namespaceObject, social_link_namespaceObject, social_links_namespaceObject, spacer_namespaceObject, build_module_table_namespaceObject, // tableOfContents,
tag_cloud_namespaceObject, text_columns_namespaceObject, build_module_verse_namespaceObject, build_module_video_namespaceObject, // theme blocks
build_module_navigation_namespaceObject, navigation_link_namespaceObject, navigation_submenu_namespaceObject, build_module_site_logo_namespaceObject, site_title_namespaceObject, site_tagline_namespaceObject, query_namespaceObject, template_part_namespaceObject, build_module_post_title_namespaceObject, build_module_post_excerpt_namespaceObject, build_module_post_featured_image_namespaceObject, build_module_post_content_namespaceObject, build_module_post_author_namespaceObject, build_module_post_date_namespaceObject, post_terms_namespaceObject, post_navigation_link_namespaceObject, post_template_namespaceObject, build_module_query_pagination_namespaceObject, build_module_query_pagination_next_namespaceObject, build_module_query_pagination_numbers_namespaceObject, build_module_query_pagination_previous_namespaceObject, build_module_post_comments_namespaceObject, loginout_namespaceObject, build_module_term_description_namespaceObject, query_title_namespaceObject];
/**
@@ -41548,14 +41803,14 @@ build_module_navigation_namespaceObject, navigation_link_namespaceObject, naviga
const registerCoreBlocks = function () {
let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : __experimentalGetCoreBlocks();
blocks.forEach(registerBlock);
- Object(external_wp_blocks_["setDefaultBlockName"])(paragraph_name);
+ (0,external_wp_blocks_namespaceObject.setDefaultBlockName)(paragraph_name);
if (window.wp && window.wp.oldEditor) {
- Object(external_wp_blocks_["setFreeformContentHandlerName"])(freeform_name);
+ (0,external_wp_blocks_namespaceObject.setFreeformContentHandlerName)(freeform_name);
}
- Object(external_wp_blocks_["setUnregisteredTypeHandlerName"])(missing_name);
- Object(external_wp_blocks_["setGroupingBlockName"])(group_name);
+ (0,external_wp_blocks_namespaceObject.setUnregisteredTypeHandlerName)(missing_name);
+ (0,external_wp_blocks_namespaceObject.setGroupingBlockName)(group_name);
};
/**
* Function to register experimental core blocks depending on editor settings.
@@ -41569,753 +41824,9 @@ const registerCoreBlocks = function () {
* ```
*/
-const __experimentalRegisterExperimentalCoreBlocks = false ? undefined : undefined;
-
-
-/***/ }),
-
-/***/ "K9lf":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["compose"]; }());
-
-/***/ }),
-
-/***/ "KEfo":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["viewport"]; }());
-
-/***/ }),
-
-/***/ "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);
-
-
-/***/ }),
+const __experimentalRegisterExperimentalCoreBlocks = false ? 0 : undefined;
-/***/ "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);
-
-
-/***/ }),
-
-/***/ "OE6V":
-/***/ (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 symbolFilled = 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-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"
-}));
-/* harmony default export */ __webpack_exports__["a"] = (symbolFilled);
-
-
-/***/ }),
-
-/***/ "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);
-
-
-/***/ }),
-
-/***/ "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);
-
-
-/***/ }),
-
-/***/ "RxS6":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["keycodes"]; }());
-
-/***/ }),
-
-/***/ "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
- http://jedwatson.github.io/classnames
-*/
-/* global define */
-
-(function () {
- 'use strict';
-
- var hasOwn = {}.hasOwnProperty;
-
- function classNames() {
- var classes = [];
-
- for (var i = 0; i < arguments.length; i++) {
- var arg = arguments[i];
- if (!arg) continue;
-
- var argType = typeof arg;
-
- 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());
- }
- }
- }
-
- return classes.join(' ');
- }
-
- 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 {}
-}());
-
-
-/***/ }),
-
-/***/ "Tqx9":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["primitives"]; }());
-
-/***/ }),
-
-/***/ "UuzZ":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["autop"]; }());
-
-/***/ }),
-
-/***/ "YLtl":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["lodash"]; }());
-
-/***/ }),
-
-/***/ "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<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])});
-
-
-/***/ }),
-
-/***/ "axFQ":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["blockEditor"]; }());
-
-/***/ }),
-
-/***/ "b2RC":
-/***/ (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 grid = 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 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 */ __webpack_exports__["a"] = (grid);
-
-
-/***/ }),
-
-/***/ "bWcr":
-/***/ (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 closeSmall = 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 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 */ __webpack_exports__["a"] = (closeSmall);
-
-
-/***/ }),
-
-/***/ "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);
-
-
-/***/ }),
-
-/***/ "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);
-
-
-/***/ }),
-
-/***/ "diJD":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["reusableBlocks"]; }());
-
-/***/ }),
-
-/***/ "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<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.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()})};
-
-
-/***/ }),
-
-/***/ "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);
-
-
-/***/ }),
-
-/***/ "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);
-
-
-/***/ }),
-
-/***/ "jZUy":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["coreData"]; }());
-
-/***/ }),
-
-/***/ "l3Sj":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["i18n"]; }());
-
-/***/ }),
-
-/***/ "mi6C":
-/***/ (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 settings = 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.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"
-}));
-/* harmony default export */ __webpack_exports__["a"] = (settings);
-
-
-/***/ }),
-
-/***/ "oMoS":
-/***/ (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 button = 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: "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 */ __webpack_exports__["a"] = (button);
-
-
-/***/ }),
-
-/***/ "onLe":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["notices"]; }());
-
-/***/ }),
-
-/***/ "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);
-
-
-/***/ }),
-
-/***/ "qRz9":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["richText"]; }());
-
-/***/ }),
-
-/***/ "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);
-
-
-/***/ }),
-
-/***/ "rmEH":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["htmlEntities"]; }());
-
-/***/ }),
-
-/***/ "rvQu":
-/***/ (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 sidebar = 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.5zM6 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"] = (sidebar);
-
-
-/***/ }),
-
-/***/ "tI+e":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["components"]; }());
-
-/***/ }),
-
-/***/ "u6za":
-/***/ (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 group = 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: "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 */ __webpack_exports__["a"] = (group);
-
-
-/***/ }),
-
-/***/ "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);
-
-
-/***/ }),
-
-/***/ "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);
-}
-
-/***/ }),
-
-/***/ "wy2R":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["moment"]; }());
-
-/***/ }),
-
-/***/ "xTGt":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["blob"]; }());
-
-/***/ }),
-
-/***/ "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__);
-
-
-/**
- * WordPress dependencies
- */
-
-const alignRight = 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.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"
-}));
-/* harmony default export */ __webpack_exports__["a"] = (alignRight);
-
-
-/***/ })
-
-/******/ });
\ No newline at end of file
+}();
+(window.wp = window.wp || {}).blockLibrary = __webpack_exports__;
+/******/ })()
+;
\ No newline at end of file
diff --git a/wp-includes/js/dist/block-library.min.js b/wp-includes/js/dist/block-library.min.js
index 650922a8d1..f012f70b52 100644
--- a/wp-includes/js/dist/block-library.min.js
+++ b/wp-includes/js/dist/block-library.min.js
@@ -1,14 +1,14 @@
/*! This file is auto-generated */
-this.wp=this.wp||{},this.wp.blockLibrary=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="K51g")}({"+WrK":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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=a},"//kF":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=a},"1CF3":function(e,t){e.exports=window.wp.dom},"1Yn1":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=Object(o.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(r.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"}));t.a=a},"1ZqX":function(e,t){e.exports=window.wp.data},"1iEr":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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=a},"2gm7":function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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=a},"4eJC":function(e,t,n){e.exports=function(e,t){var n,o,r=0;function a(){var a,l,c=n,i=arguments.length;e:for(;c;){if(c.args.length===arguments.length){for(l=0;l<i;l++)if(c.args[l]!==arguments[l]){c=c.next;continue e}return c!==n&&(c===o&&(o=c.prev),c.prev.next=c.next,c.next&&(c.next.prev=c.prev),c.next=n,c.prev=null,n.prev=c,n=c),c.val}c=c.next}for(a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return c={args:a,val:e.apply(null,a)},n?(n.prev=c,c.next=n):o=c,r===t.maxSize?(o=o.prev).next=null:r++,n=c,c.val}return t=t||{},a.clear=function(){n=null,o=null,r=0},a}},"A/WM":function(e,t,n){var o;
+!function(){var e={3827:function(e,t){var n;
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
-*/!function(){"use strict";var n=function(){function e(){}function t(e,t){for(var n=t.length,o=0;o<n;++o)r(e,t[o])}e.prototype=Object.create(null);var n={}.hasOwnProperty;var o=/\s+/;function r(e,r){if(r){var a=typeof r;"string"===a?function(e,t){for(var n=t.split(o),r=n.length,a=0;a<r;++a)e[n[a]]=!0}(e,r):Array.isArray(r)?t(e,r):"object"===a?function(e,t){if(t.toString===Object.prototype.toString)for(var o in t)n.call(t,o)&&(e[o]=!!t[o]);else e[t.toString()]=!0}(e,r):"number"===a&&function(e,t){e[t]=!0}(e,r)}}return function(){for(var n=arguments.length,o=Array(n),r=0;r<n;r++)o[r]=arguments[r];var a=new e;t(a,o);var l=[];for(var c in a)a[c]&&l.push(c);return l.join(" ")}}();e.exports?(n.default=n,e.exports=n):void 0===(o=function(){return n}.apply(t,[]))||(e.exports=o)}()},B9Az:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");var a=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=a},Bpkj:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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=a},Civd:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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.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"}));t.a=a},FEKF:function(e,t,n){
-/*! Fast Average Color | © 2019 Denis Seleznev | MIT License | https://github.com/hcodes/fast-average-color/ */
-e.exports=function(){"use strict";function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],o=!0,r=!1,a=void 0;try{for(var l,c=e[Symbol.iterator]();!(o=(l=c.next()).done)&&(n.push(l.value),!t||n.length!==t);o=!0);}catch(e){r=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(r)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}return function(){function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n)}var o,r,a;return o=n,(r=[{key:"getColorAsync",value:function(e,t,n){e.complete?t.call(e,this.getColor(e,n),n&&n.data):this._bindImageEvents(e,t,n)}},{key:"getColor",value:function(e,t){t=t||{};var n=this._getDefaultColor(t),o=this._getOriginalSize(e),r=this._prepareSizeAndPosition(o,t),a=null,l=n;if(!(r.srcWidth&&r.srcHeight&&r.destWidth&&r.destHeight))return this._prepareResult(n,new Error("FastAverageColor: Incorrect sizes."));if(!this._ctx&&(this._canvas=this._makeCanvas(),this._ctx=this._canvas.getContext&&this._canvas.getContext("2d"),!this._ctx))return this._prepareResult(n,new Error("FastAverageColor: Canvas Context 2D is not supported in this browser."));this._canvas.width=r.destWidth,this._canvas.height=r.destHeight;try{this._ctx.clearRect(0,0,r.destWidth,r.destHeight),this._ctx.drawImage(e,r.srcLeft,r.srcTop,r.srcWidth,r.srcHeight,0,0,r.destWidth,r.destHeight);var c=this._ctx.getImageData(0,0,r.destWidth,r.destHeight).data;l=this.getColorFromArray4(c,t)}catch(e){a=e}return this._prepareResult(l,a)}},{key:"getColorFromArray4",value:function(e,t){t=t||{};var n=e.length;if(n<4)return this._getDefaultColor(t);var o=n-n%4,r=4*(t.step||1),a="_"+(t.algorithm||"sqrt")+"Algorithm";if("function"!=typeof this[a])throw new Error("FastAverageColor: ".concat(t.algorithm," is unknown algorithm."));return this[a](e,o,r)}},{key:"destroy",value:function(){delete this._canvas,delete this._ctx}},{key:"_getDefaultColor",value:function(e){return this._getOption(e,"defaultColor",[255,255,255,255])}},{key:"_getOption",value:function(e,t,n){return void 0===e[t]?n:e[t]}},{key:"_prepareSizeAndPosition",value:function(e,t){var n,o=this._getOption(t,"left",0),r=this._getOption(t,"top",0),a=this._getOption(t,"width",e.width),l=this._getOption(t,"height",e.height),c=a,i=l;return"precision"===t.mode||(a>l?(n=a/l,c=100,i=Math.round(c/n)):(n=l/a,i=100,c=Math.round(i/n)),(c>a||i>l||c<10||i<10)&&(c=a,i=l)),{srcLeft:o,srcTop:r,srcWidth:a,srcHeight:l,destWidth:c,destHeight:i}}},{key:"_simpleAlgorithm",value:function(e,t,n){for(var o=0,r=0,a=0,l=0,c=0,i=0;i<t;i+=n){var s=e[i+3];o+=e[i]*s,r+=e[i+1]*s,a+=e[i+2]*s,l+=s,c++}return l?[Math.round(o/l),Math.round(r/l),Math.round(a/l),Math.round(l/c)]:[0,0,0,0]}},{key:"_sqrtAlgorithm",value:function(e,t,n){for(var o=0,r=0,a=0,l=0,c=0,i=0;i<t;i+=n){var s=e[i],u=e[i+1],m=e[i+2],d=e[i+3];o+=s*s*d,r+=u*u*d,a+=m*m*d,l+=d,c++}return l?[Math.round(Math.sqrt(o/l)),Math.round(Math.sqrt(r/l)),Math.round(Math.sqrt(a/l)),Math.round(l/c)]:[0,0,0,0]}},{key:"_dominantAlgorithm",value:function(e,n,o){for(var r={},a=0;a<n;a+=o){var l=e[a],c=e[a+1],i=e[a+2],s=e[a+3],u=Math.round(l/24)+","+Math.round(c/24)+","+Math.round(i/24);r[u]?r[u]=[r[u][0]+l*s,r[u][1]+c*s,r[u][2]+i*s,r[u][3]+s,r[u][4]+1]:r[u]=[l*s,c*s,i*s,s,1]}var m=t(Object.keys(r).map((function(e){return r[e]})).sort((function(e,t){var n=e[4],o=t[4];return n>o?-1:n===o?0:1}))[0],5),d=m[0],b=m[1],p=m[2],g=m[3],h=m[4];return g?[Math.round(d/g),Math.round(b/g),Math.round(p/g),Math.round(g/h)]:[0,0,0,0]}},{key:"_bindImageEvents",value:function(e,t,n){var o=this,r=(n=n||{})&&n.data,a=this._getDefaultColor(n),l=function(){s(),t.call(e,o.getColor(e,n),r)},c=function(){s(),t.call(e,o._prepareResult(a,new Error("Image error")),r)},i=function(){s(),t.call(e,o._prepareResult(a,new Error("Image abort")),r)},s=function(){e.removeEventListener("load",l),e.removeEventListener("error",c),e.removeEventListener("abort",i)};e.addEventListener("load",l),e.addEventListener("error",c),e.addEventListener("abort",i)}},{key:"_prepareResult",value:function(e,t){var n=e.slice(0,3),o=[].concat(n,e[3]/255),r=this._isDark(e);return{error:t,value:e,rgb:"rgb("+n.join(",")+")",rgba:"rgba("+o.join(",")+")",hex:this._arrayToHex(n),hexa:this._arrayToHex(e),isDark:r,isLight:!r}}},{key:"_getOriginalSize",value:function(e){return e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.width,height:e.height}}},{key:"_toHex",value:function(e){var t=e.toString(16);return 1===t.length?"0"+t:t}},{key:"_arrayToHex",value:function(e){return"#"+e.map(this._toHex).join("")}},{key:"_isDark",value:function(e){return(299*e[0]+587*e[1]+114*e[2])/1e3<128}},{key:"_makeCanvas",value:function(){return"undefined"==typeof window?new OffscreenCanvas(1,1):document.createElement("canvas")}}])&&e(o.prototype,r),a&&e(o,a),n}()}()},FqII:function(e,t){e.exports=window.wp.date},G8mJ:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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 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"}));t.a=a},GRId:function(e,t){e.exports=window.wp.element},HSyU:function(e,t){e.exports=window.wp.blocks},JREk:function(e,t){e.exports=window.wp.serverSideRender},K51g:function(e,t,n){"use strict";n.r(t),n.d(t,"__experimentalGetCoreBlocks",(function(){return Lp})),n.d(t,"registerCoreBlocks",(function(){return Vp})),n.d(t,"__experimentalRegisterExperimentalCoreBlocks",(function(){return Hp}));var o={};n.r(o),n.d(o,"metadata",(function(){return xe})),n.d(o,"name",(function(){return Se})),n.d(o,"settings",(function(){return Be}));var r={};n.r(r),n.d(r,"metadata",(function(){return Je})),n.d(r,"name",(function(){return Qe})),n.d(r,"settings",(function(){return Ye}));var a={};n.r(a),n.d(a,"metadata",(function(){return vt})),n.d(a,"name",(function(){return Ot})),n.d(a,"settings",(function(){return jt}));var l={};n.r(l),n.d(l,"metadata",(function(){return St})),n.d(l,"name",(function(){return Bt})),n.d(l,"settings",(function(){return Tt}));var c={};n.r(c),n.d(c,"metadata",(function(){return Rt})),n.d(c,"name",(function(){return Lt})),n.d(c,"settings",(function(){return Vt}));var i={};n.r(i),n.d(i,"metadata",(function(){return Ft})),n.d(i,"name",(function(){return Dt})),n.d(i,"settings",(function(){return Gt}));var s={};n.r(s),n.d(s,"metadata",(function(){return $t})),n.d(s,"name",(function(){return Zt})),n.d(s,"settings",(function(){return Kt}));var u={};n.r(u),n.d(u,"metadata",(function(){return en})),n.d(u,"name",(function(){return tn})),n.d(u,"settings",(function(){return nn}));var m={};n.r(m),n.d(m,"metadata",(function(){return ln})),n.d(m,"name",(function(){return cn})),n.d(m,"settings",(function(){return sn}));var d={};n.r(d),n.d(d,"metadata",(function(){return En})),n.d(d,"name",(function(){return Cn})),n.d(d,"settings",(function(){return xn}));var b={};n.r(b),n.d(b,"metadata",(function(){return Yn})),n.d(b,"name",(function(){return Xn})),n.d(b,"settings",(function(){return eo}));var p={};n.r(p),n.d(p,"metadata",(function(){return Lo})),n.d(p,"name",(function(){return Vo})),n.d(p,"settings",(function(){return Ho}));var g={};n.r(g),n.d(g,"metadata",(function(){return Yo})),n.d(g,"name",(function(){return Xo})),n.d(g,"settings",(function(){return er}));var h={};n.r(h),n.d(h,"metadata",(function(){return Ar})),n.d(h,"name",(function(){return Fr})),n.d(h,"settings",(function(){return Dr}));var v={};n.r(v),n.d(v,"metadata",(function(){return Kr})),n.d(v,"name",(function(){return Jr})),n.d(v,"settings",(function(){return Qr}));var O={};n.r(O),n.d(O,"metadata",(function(){return ha})),n.d(O,"name",(function(){return va})),n.d(O,"settings",(function(){return Oa}));var j={};n.r(j),n.d(j,"metadata",(function(){return fa})),n.d(j,"name",(function(){return _a})),n.d(j,"settings",(function(){return ka}));var y={};n.r(y),n.d(y,"metadata",(function(){return Ra})),n.d(y,"name",(function(){return La})),n.d(y,"settings",(function(){return Va}));var f={};n.r(f),n.d(f,"metadata",(function(){return Aa})),n.d(f,"name",(function(){return Fa})),n.d(f,"settings",(function(){return Da}));var _={};n.r(_),n.d(_,"metadata",(function(){return Qa})),n.d(_,"name",(function(){return Ya})),n.d(_,"settings",(function(){return Xa}));var k={};n.r(k),n.d(k,"metadata",(function(){return dl})),n.d(k,"name",(function(){return bl})),n.d(k,"settings",(function(){return pl}));var w={};n.r(w),n.d(w,"metadata",(function(){return hl})),n.d(w,"name",(function(){return vl})),n.d(w,"settings",(function(){return Ol}));var E={};n.r(E),n.d(E,"metadata",(function(){return Ll})),n.d(E,"name",(function(){return Vl})),n.d(E,"settings",(function(){return Hl}));var C={};n.r(C),n.d(C,"metadata",(function(){return Dl})),n.d(C,"name",(function(){return Gl})),n.d(C,"settings",(function(){return Ul}));var x={};n.r(x),n.d(x,"metadata",(function(){return Zl})),n.d(x,"name",(function(){return Kl})),n.d(x,"settings",(function(){return Jl}));var S={};n.r(S),n.d(S,"metadata",(function(){return Hc})),n.d(S,"name",(function(){return Ac})),n.d(S,"settings",(function(){return Fc}));var B={};n.r(B),n.d(B,"metadata",(function(){return ni})),n.d(B,"name",(function(){return oi})),n.d(B,"settings",(function(){return ri}));var T={};n.r(T),n.d(T,"metadata",(function(){return bi})),n.d(T,"name",(function(){return pi})),n.d(T,"settings",(function(){return gi}));var N={};n.r(N),n.d(N,"metadata",(function(){return Oi})),n.d(N,"name",(function(){return ji})),n.d(N,"settings",(function(){return yi}));var z={};n.r(z),n.d(z,"metadata",(function(){return _i})),n.d(z,"name",(function(){return ki})),n.d(z,"settings",(function(){return wi}));var P={};n.r(P),n.d(P,"metadata",(function(){return zi})),n.d(P,"name",(function(){return Pi})),n.d(P,"settings",(function(){return Ii}));var I={};n.r(I),n.d(I,"metadata",(function(){return qi})),n.d(I,"name",(function(){return Wi})),n.d(I,"settings",(function(){return $i}));var M={};n.r(M),n.d(M,"metadata",(function(){return Ji})),n.d(M,"name",(function(){return Qi})),n.d(M,"settings",(function(){return Yi}));var R={};n.r(R),n.d(R,"metadata",(function(){return ts})),n.d(R,"name",(function(){return ns})),n.d(R,"settings",(function(){return os}));var L={};n.r(L),n.d(L,"metadata",(function(){return ms})),n.d(L,"name",(function(){return ds})),n.d(L,"settings",(function(){return bs}));var V={};n.r(V),n.d(V,"metadata",(function(){return hs})),n.d(V,"name",(function(){return vs})),n.d(V,"settings",(function(){return Os}));var H={};n.r(H),n.d(H,"metadata",(function(){return ys})),n.d(H,"name",(function(){return fs})),n.d(H,"settings",(function(){return _s}));var A={};n.r(A),n.d(A,"metadata",(function(){return Ns})),n.d(A,"name",(function(){return zs})),n.d(A,"settings",(function(){return Ps}));var F={};n.r(F),n.d(F,"metadata",(function(){return Vs})),n.d(F,"name",(function(){return Hs})),n.d(F,"settings",(function(){return As}));var D={};n.r(D),n.d(D,"metadata",(function(){return qs})),n.d(D,"name",(function(){return Ws})),n.d(D,"settings",(function(){return $s}));var G={};n.r(G),n.d(G,"metadata",(function(){return Js})),n.d(G,"name",(function(){return Qs})),n.d(G,"settings",(function(){return Ys}));var U={};n.r(U),n.d(U,"metadata",(function(){return eu})),n.d(U,"name",(function(){return tu})),n.d(U,"settings",(function(){return nu}));var q={};n.r(q),n.d(q,"metadata",(function(){return au})),n.d(q,"name",(function(){return lu})),n.d(q,"settings",(function(){return cu}));var W={};n.r(W),n.d(W,"metadata",(function(){return pu})),n.d(W,"name",(function(){return gu})),n.d(W,"settings",(function(){return hu}));var $={};n.r($),n.d($,"metadata",(function(){return Lu})),n.d($,"name",(function(){return Vu})),n.d($,"settings",(function(){return Hu}));var Z={};n.r(Z),n.d(Z,"metadata",(function(){return Uu})),n.d(Z,"name",(function(){return qu})),n.d(Z,"settings",(function(){return Wu}));var K={};n.r(K),n.d(K,"metadata",(function(){return Ku})),n.d(K,"name",(function(){return Ju})),n.d(K,"settings",(function(){return Qu}));var J={};n.r(J),n.d(J,"metadata",(function(){return em})),n.d(J,"name",(function(){return tm})),n.d(J,"settings",(function(){return nm}));var Q={};n.r(Q),n.d(Q,"metadata",(function(){return am})),n.d(Q,"name",(function(){return lm})),n.d(Q,"settings",(function(){return cm}));var Y={};n.r(Y),n.d(Y,"metadata",(function(){return bm})),n.d(Y,"name",(function(){return pm})),n.d(Y,"settings",(function(){return gm}));var X={};n.r(X),n.d(X,"metadata",(function(){return fm})),n.d(X,"name",(function(){return _m})),n.d(X,"settings",(function(){return km}));var ee={};n.r(ee),n.d(ee,"metadata",(function(){return xm})),n.d(ee,"name",(function(){return Sm})),n.d(ee,"settings",(function(){return Bm}));var te={};n.r(te),n.d(te,"metadata",(function(){return Nm})),n.d(te,"name",(function(){return zm})),n.d(te,"settings",(function(){return Pm}));var ne={};n.r(ne),n.d(ne,"metadata",(function(){return Fm})),n.d(ne,"name",(function(){return Dm})),n.d(ne,"settings",(function(){return Gm}));var oe={};n.r(oe),n.d(oe,"metadata",(function(){return Zm})),n.d(oe,"name",(function(){return Km})),n.d(oe,"settings",(function(){return Jm}));var re={};n.r(re),n.d(re,"metadata",(function(){return ed})),n.d(re,"name",(function(){return td})),n.d(re,"settings",(function(){return nd}));var ae={};n.r(ae),n.d(ae,"metadata",(function(){return ld})),n.d(ae,"name",(function(){return cd})),n.d(ae,"settings",(function(){return id}));var le={};n.r(le),n.d(le,"metadata",(function(){return md})),n.d(le,"name",(function(){return dd})),n.d(le,"settings",(function(){return bd}));var ce={};n.r(ce),n.d(ce,"metadata",(function(){return Od})),n.d(ce,"name",(function(){return jd})),n.d(ce,"settings",(function(){return yd}));var ie={};n.r(ie),n.d(ie,"metadata",(function(){return Sd})),n.d(ie,"name",(function(){return Bd})),n.d(ie,"settings",(function(){return Td}));var se={};n.r(se),n.d(se,"metadata",(function(){return Rd})),n.d(se,"name",(function(){return Ld})),n.d(se,"settings",(function(){return Vd}));var ue={};n.r(ue),n.d(ue,"metadata",(function(){return Wd})),n.d(ue,"name",(function(){return $d})),n.d(ue,"settings",(function(){return Zd}));var me={};n.r(me),n.d(me,"metadata",(function(){return _b})),n.d(me,"name",(function(){return kb})),n.d(me,"settings",(function(){return wb}));var de={};n.r(de),n.d(de,"metadata",(function(){return Cb})),n.d(de,"name",(function(){return xb})),n.d(de,"settings",(function(){return Sb}));var be={};n.r(be),n.d(be,"metadata",(function(){return Jb})),n.d(be,"name",(function(){return Qb})),n.d(be,"settings",(function(){return Yb}));var pe={};n.r(pe),n.d(pe,"metadata",(function(){return tp})),n.d(pe,"name",(function(){return np})),n.d(pe,"settings",(function(){return op}));var ge={};n.r(ge),n.d(ge,"metadata",(function(){return cp})),n.d(ge,"name",(function(){return ip})),n.d(ge,"settings",(function(){return sp}));var he={};n.r(he),n.d(he,"metadata",(function(){return bp})),n.d(he,"name",(function(){return pp})),n.d(he,"settings",(function(){return gp}));var ve={};n.r(ve),n.d(ve,"metadata",(function(){return Pp})),n.d(ve,"name",(function(){return Ip})),n.d(ve,"settings",(function(){return Mp}));var Oe=n("HSyU"),je=n("GRId"),ye=n("Tqx9");var fe=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.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"})),_e=n("tI+e"),ke=n("l3Sj"),we=n("axFQ"),Ee=n("JREk"),Ce=n.n(Ee);const xe={apiVersion:2,name:"core/archives",title:"Archives",category:"widgets",description:"Display a monthly archive of your posts.",textdomain:"default",attributes:{displayAsDropdown:{type:"boolean",default:!1},showPostCounts:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-archives-editor"},{name:Se}=xe,Be={icon:fe,example:{},edit:function(e){let{attributes:t,setAttributes:n}=e;const{showPostCounts:o,displayAsDropdown:r}=t;return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Archives settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Display as dropdown"),checked:r,onChange:()=>n({displayAsDropdown:!r})}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Show post counts"),checked:o,onChange:()=>n({showPostCounts:!o})}))),Object(je.createElement)("div",Object(we.useBlockProps)(),Object(je.createElement)(_e.Disabled,null,Object(je.createElement)(Ce.a,{block:"core/archives",attributes:t}))))}};var Te=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.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"})),Ne=[{attributes:{src:{type:"string",source:"attribute",selector:"audio",attribute:"src"},caption:{type:"string",source:"html",selector:"figcaption"},id:{type:"number"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{align:!0},save(e){let{attributes:t}=e;const{autoplay:n,caption:o,loop:r,preload:a,src:l}=t;return Object(je.createElement)("figure",null,Object(je.createElement)("audio",{controls:"controls",src:l,autoPlay:n,loop:r,preload:a}),!we.RichText.isEmpty(o)&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",value:o}))}}],ze=n("xTGt"),Pe=n("1ZqX");const Ie=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.78",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}];var Me=n("YLtl"),Re=n("A/WM"),Le=n.n(Re),Ve=n("4eJC"),He=n.n(Ve);const{name:Ae}={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},Fe=e=>{var t;return null===(t=Object(Oe.getBlockVariations)(Ae))||void 0===t?void 0:t.find(t=>{let{patterns:n}=t;return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.some(t=>e.match(t))}(e,n)})},De=e=>e&&e.includes('class="wp-embedded-content"'),Ge=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{preview:o,attributes:r={}}=e,{url:a,providerNameSlug:l,type:c,...i}=r;if(!a||!Object(Oe.getBlockType)(Ae))return;const s=Fe(a),u="wordpress"===l||"wp-embed"===c,m=!u&&s&&(s.attributes.providerNameSlug!==l||!l);if(m)return Object(Oe.createBlock)(Ae,{url:a,...i,...s.attributes});const d=null===(t=Object(Oe.getBlockVariations)(Ae))||void 0===t?void 0:t.find(e=>{let{name:t}=e;return"wordpress"===t});return d&&o&&De(o.html)&&!u?Object(Oe.createBlock)(Ae,{url:a,...d.attributes,...n}):void 0},Ue=e=>{if(!e)return e;const t=Ie.reduce((e,t)=>{let{className:n}=t;return e[n]=!1,e},{"wp-has-aspect-ratio":!1});return Le()(e,t)};function qe(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!n)return Ue(t);const o=document.implementation.createHTMLDocument("");o.body.innerHTML=e;const r=o.body.querySelector("iframe");if(r&&r.height&&r.width){const e=(r.width/r.height).toFixed(2);for(let n=0;n<Ie.length;n++){const o=Ie[n];if(e>=o.ratio){return e-o.ratio>.1?Ue(t):Le()(Ue(t),o.className,"wp-has-aspect-ratio")}}}return t}const We=He()((function(e,t,n,o){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(!e)return{};const a={};let{type:l="rich"}=e;const{html:c,provider_name:i}=e,s=Object(Me.kebabCase)((i||t).toLowerCase());return De(c)&&(l="wp-embed"),(c||"photo"===l)&&(a.type=l,a.providerNameSlug=s),a.className=qe(c,n,o&&r),a})),$e=["audio"];var Ze=Object(_e.withNotices)((function(e){let{attributes:t,noticeOperations:n,setAttributes:o,onReplace:r,isSelected:a,noticeUI:l,insertBlocksAfter:c}=e;const{id:i,autoplay:s,caption:u,loop:m,preload:d,src:b}=t,p=Object(we.useBlockProps)(),g=Object(Pe.useSelect)(e=>{const{getSettings:t}=e(we.store);return t().mediaUpload},[]);function h(e){return t=>{o({[e]:t})}}function v(e){if(e!==b){const t=Ge({attributes:{url:e}});if(void 0!==t)return void r(t);o({src:e,id:void 0})}}function O(e){n.removeAllNotices(),n.createErrorNotice(e)}function j(e){e&&e.url?o({src:e.url,id:e.id}):o({src:void 0,id:void 0})}return Object(je.useEffect)(()=>{if(!i&&Object(ze.isBlobURL)(b)){const e=Object(ze.getBlobByURL)(b);e&&g({filesList:[e],onFileChange:e=>{let[{id:t,url:n}]=e;o({id:t,src:n})},onError:e=>{o({src:void 0,id:void 0}),n.createErrorNotice(e)},allowedTypes:$e})}},[]),b?Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,{group:"other"},Object(je.createElement)(we.MediaReplaceFlow,{mediaId:i,mediaURL:b,allowedTypes:$e,accept:"audio/*",onSelect:j,onSelectURL:v,onError:O})),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Audio settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Autoplay"),onChange:h("autoplay"),checked:s,help:function(e){return e?Object(ke.__)("Autoplay may cause usability issues for some users."):null}}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Loop"),onChange:h("loop"),checked:m}),Object(je.createElement)(_e.SelectControl,{label:Object(ke._x)("Preload","noun; Audio block parameter"),value:d||"",onChange:e=>o({preload:e||void 0}),options:[{value:"",label:Object(ke.__)("Browser default")},{value:"auto",label:Object(ke.__)("Auto")},{value:"metadata",label:Object(ke.__)("Metadata")},{value:"none",label:Object(ke._x)("None",'"Preload" value')}]}))),Object(je.createElement)("figure",p,Object(je.createElement)(_e.Disabled,{isDisabled:!a},Object(je.createElement)("audio",{controls:"controls",src:b})),(!we.RichText.isEmpty(u)||a)&&Object(je.createElement)(we.RichText,{tagName:"figcaption","aria-label":Object(ke.__)("Audio caption text"),placeholder:Object(ke.__)("Add caption"),value:u,onChange:e=>o({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>c(Object(Oe.createBlock)("core/paragraph"))}))):Object(je.createElement)("div",p,Object(je.createElement)(we.MediaPlaceholder,{icon:Object(je.createElement)(we.BlockIcon,{icon:Te}),onSelect:j,onSelectURL:v,accept:"audio/*",allowedTypes:$e,value:t,notices:l,onError:O}))}));var Ke={from:[{type:"files",isMatch:e=>1===e.length&&0===e[0].type.indexOf("audio/"),transform(e){const t=e[0];return Object(Oe.createBlock)("core/audio",{src:Object(ze.createBlobURL)(t)})}},{type:"shortcode",tag:"audio",attributes:{src:{type:"string",shortcode:e=>{let{named:{src:t,mp3:n,m4a:o,ogg:r,wav:a,wma:l}}=e;return t||n||o||r||a||l}},loop:{type:"string",shortcode:e=>{let{named:{loop:t}}=e;return t}},autoplay:{type:"string",shortcode:e=>{let{named:{autoplay:t}}=e;return t}},preload:{type:"string",shortcode:e=>{let{named:{preload:t}}=e;return t}}}}]};const Je={apiVersion:2,name:"core/audio",title:"Audio",category:"media",description:"Embed a simple audio player.",keywords:["music","sound","podcast","recording"],textdomain:"default",attributes:{src:{type:"string",source:"attribute",selector:"audio",attribute:"src"},caption:{type:"string",source:"html",selector:"figcaption"},id:{type:"number"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{anchor:!0,align:!0},editorStyle:"wp-block-audio-editor",style:"wp-block-audio"},{name:Qe}=Je,Ye={icon:Te,example:{attributes:{src:"https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg"}},transforms:Ke,deprecated:Ne,edit:Ze,save:function(e){let{attributes:t}=e;const{autoplay:n,caption:o,loop:r,preload:a,src:l}=t;return l&&Object(je.createElement)("figure",we.useBlockProps.save(),Object(je.createElement)("audio",{controls:"controls",src:l,autoPlay:n,loop:r,preload:a}),!we.RichText.isEmpty(o)&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",value:o}))}};var Xe=n("oMoS"),et=n("TSYQ"),tt=n.n(et),nt=n("K9lf");const ot=e=>{if(!Object(Me.isObject)(e)||Array.isArray(e))return e;const t=Object(Me.pickBy)(Object(Me.mapValues)(e,ot),Me.identity);return Object(Me.isEmpty)(t)?void 0:t};var rt=ot,at=function(e){var t,n;if(null==e||null===(t=e.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.fontFamily)return e;const o=Object(Me.cloneDeep)(e),r=o.style.typography.fontFamily.split("|").pop();return delete o.style.typography.fontFamily,o.style=rt(o.style),{...o,fontFamily:r}};const lt=e=>{var t,n,o;const{borderRadius:r,...a}=e,l=[r,null===(t=a.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius].find(e=>"number"==typeof e&&0!==e);return l?{...a,style:{...a.style,border:{...null===(o=a.style)||void 0===o?void 0:o.border,radius:l+"px"}}}:a},ct=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customGradient)return e;const t={color:{}};return e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customGradient&&(t.color.gradient=e.customGradient),{...Object(Me.omit)(e,["customTextColor","customBackgroundColor","customGradient"]),style:t}},it=e=>ct(Object(Me.omit)({...e,customTextColor:e.textColor&&"#"===e.textColor[0]?e.textColor:void 0,customBackgroundColor:e.color&&"#"===e.color[0]?e.color:void 0},["color","textColor"])),st={url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"}};var ut=[{attributes:{url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},reusable:!1,spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wp-block-button__link"},save(e){var t,n;let{attributes:o,className:r}=e;const{fontSize:a,linkTarget:l,rel:c,style:i,text:s,title:u,url:m,width:d}=o;if(!s)return null;const b=Object(we.__experimentalGetBorderClassesAndStyles)(o),p=Object(we.__experimentalGetColorClassesAndStyles)(o),g=Object(we.__experimentalGetSpacingClassesAndStyles)(o),h=tt()("wp-block-button__link",p.className,b.className,{"no-border-radius":0===(null==i||null===(t=i.border)||void 0===t?void 0:t.radius)}),v={...b.style,...p.style,...g.style},O=tt()(r,{["has-custom-width wp-block-button__width-"+d]:d,"has-custom-font-size":a||(null==i||null===(n=i.typography)||void 0===n?void 0:n.fontSize)});return Object(je.createElement)("div",we.useBlockProps.save({className:O}),Object(je.createElement)(we.RichText.Content,{tagName:"a",className:h,href:m,title:u,style:v,value:s,target:l,rel:c}))},migrate:at,isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}},{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...st,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},isEligible(e){var t;let{style:n}=e;return"number"==typeof(null==n||null===(t=n.border)||void 0===t?void 0:t.radius)},save(e){var t,n,o;let{attributes:r,className:a}=e;const{fontSize:l,linkTarget:c,rel:i,style:s,text:u,title:m,url:d,width:b}=r;if(!u)return null;const p=null==s||null===(t=s.border)||void 0===t?void 0:t.radius,g=Object(we.__experimentalGetColorClassesAndStyles)(r),h=tt()("wp-block-button__link",g.className,{"no-border-radius":0===(null==s||null===(n=s.border)||void 0===n?void 0:n.radius)}),v={borderRadius:p||void 0,...g.style},O=tt()(a,{["has-custom-width wp-block-button__width-"+b]:b,"has-custom-font-size":l||(null==s||null===(o=s.typography)||void 0===o?void 0:o.fontSize)});return Object(je.createElement)("div",we.useBlockProps.save({className:O}),Object(je.createElement)(we.RichText.Content,{tagName:"a",className:h,href:d,title:m,style:v,value:u,target:c,rel:i}))},migrate:Object(nt.compose)(at,lt)},{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...st,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save(e){let{attributes:t,className:n}=e;const{borderRadius:o,linkTarget:r,rel:a,text:l,title:c,url:i,width:s}=t,u=Object(we.__experimentalGetColorClassesAndStyles)(t),m=tt()("wp-block-button__link",u.className,{"no-border-radius":0===o}),d={borderRadius:o?o+"px":void 0,...u.style},b=tt()(n,{["has-custom-width wp-block-button__width-"+s]:s});return Object(je.createElement)("div",we.useBlockProps.save({className:b}),Object(je.createElement)(we.RichText.Content,{tagName:"a",className:m,href:i,title:c,style:d,value:l,target:r,rel:a}))},migrate:Object(nt.compose)(at,lt)},{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...st,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save(e){let{attributes:t,className:n}=e;const{borderRadius:o,linkTarget:r,rel:a,text:l,title:c,url:i,width:s}=t,u=Object(we.__experimentalGetColorClassesAndStyles)(t),m=tt()("wp-block-button__link",u.className,{"no-border-radius":0===o}),d={borderRadius:o?o+"px":void 0,...u.style},b=tt()(n,{["has-custom-width wp-block-button__width-"+s]:s});return Object(je.createElement)("div",we.useBlockProps.save({className:b}),Object(je.createElement)(we.RichText.Content,{tagName:"a",className:m,href:i,title:c,style:d,value:l,target:r,rel:a}))},migrate:Object(nt.compose)(at,lt)},{supports:{align:!0,alignWide:!1,color:{gradients:!0}},attributes:{...st,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"}},save(e){let{attributes:t}=e;const{borderRadius:n,linkTarget:o,rel:r,text:a,title:l,url:c}=t,i=tt()("wp-block-button__link",{"no-border-radius":0===n}),s={borderRadius:n?n+"px":void 0};return Object(je.createElement)(we.RichText.Content,{tagName:"a",className:i,href:c,title:l,style:s,value:a,target:o,rel:r})},migrate:lt},{supports:{align:!0,alignWide:!1},attributes:{...st,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},customGradient:{type:"string"},gradient:{type:"string"}},isEligible:e=>!!e.customTextColor||!!e.customBackgroundColor||!!e.customGradient,migrate:Object(nt.compose)(lt,ct),save(e){let{attributes:t}=e;const{backgroundColor:n,borderRadius:o,customBackgroundColor:r,customTextColor:a,customGradient:l,linkTarget:c,gradient:i,rel:s,text:u,textColor:m,title:d,url:b}=t,p=Object(we.getColorClassName)("color",m),g=!l&&Object(we.getColorClassName)("background-color",n),h=Object(we.__experimentalGetGradientClass)(i),v=tt()("wp-block-button__link",{"has-text-color":m||a,[p]:p,"has-background":n||r||l||i,[g]:g,"no-border-radius":0===o,[h]:h}),O={background:l||void 0,backgroundColor:g||l||i?void 0:r,color:p?void 0:a,borderRadius:o?o+"px":void 0};return Object(je.createElement)("div",null,Object(je.createElement)(we.RichText.Content,{tagName:"a",className:v,href:b,title:d,style:O,value:u,target:c,rel:s}))}},{attributes:{...st,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"}},isEligible:e=>e.className&&e.className.includes("is-style-squared"),migrate(e){let t=e.className;return t&&(t=t.replace(/is-style-squared[\s]?/,"").trim()),lt(ct({...e,className:t||void 0,borderRadius:0}))},save(e){let{attributes:t}=e;const{backgroundColor:n,customBackgroundColor:o,customTextColor:r,linkTarget:a,rel:l,text:c,textColor:i,title:s,url:u}=t,m=Object(we.getColorClassName)("color",i),d=Object(we.getColorClassName)("background-color",n),b=tt()("wp-block-button__link",{"has-text-color":i||r,[m]:m,"has-background":n||o,[d]:d}),p={backgroundColor:d?void 0:o,color:m?void 0:r};return Object(je.createElement)("div",null,Object(je.createElement)(we.RichText.Content,{tagName:"a",className:b,href:u,title:s,style:p,value:c,target:a,rel:l}))}},{attributes:{...st,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"}},migrate:it,save(e){let{attributes:t}=e;const{url:n,text:o,title:r,backgroundColor:a,textColor:l,customBackgroundColor:c,customTextColor:i}=t,s=Object(we.getColorClassName)("color",l),u=Object(we.getColorClassName)("background-color",a),m=tt()("wp-block-button__link",{"has-text-color":l||i,[s]:s,"has-background":a||c,[u]:u}),d={backgroundColor:u?void 0:c,color:s?void 0:i};return Object(je.createElement)("div",null,Object(je.createElement)(we.RichText.Content,{tagName:"a",className:m,href:n,title:r,style:d,value:o}))}},{attributes:{...st,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save(e){let{attributes:t}=e;const{url:n,text:o,title:r,align:a,color:l,textColor:c}=t,i={backgroundColor:l,color:c};return Object(je.createElement)("div",{className:"align"+a},Object(je.createElement)(we.RichText.Content,{tagName:"a",className:"wp-block-button__link",href:n,title:r,style:i,value:o}))},migrate:it},{attributes:{...st,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save(e){let{attributes:t}=e;const{url:n,text:o,title:r,align:a,color:l,textColor:c}=t;return Object(je.createElement)("div",{className:"align"+a,style:{backgroundColor:l}},Object(je.createElement)(we.RichText.Content,{tagName:"a",href:n,title:r,style:{color:c},value:o}))},migrate:it}],mt=n("wx14"),dt=n("RxS6"),bt=n("Bpkj"),pt=n("Mp0b");function gt(e){let{selectedWidth:t,setAttributes:n}=e;return Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Width settings")},Object(je.createElement)(_e.ButtonGroup,{"aria-label":Object(ke.__)("Button width")},[25,50,75,100].map(e=>Object(je.createElement)(_e.Button,{key:e,isSmall:!0,variant:e===t?"primary":void 0,onClick:()=>{var o;n({width:t===(o=e)?void 0:o})}},e,"%"))))}var ht=function(e){var t;const{attributes:n,setAttributes:o,className:r,isSelected:a,onReplace:l,mergeBlocks:c}=e,{linkTarget:i,placeholder:s,rel:u,style:m,text:d,url:b,width:p}=n,g=Object(je.useCallback)(e=>{o({rel:e})},[o]),h=Object(we.__experimentalUseBorderProps)(n),v=Object(we.__experimentalUseColorProps)(n),O=Object(we.__experimentalGetSpacingClassesAndStyles)(n),j=Object(je.useRef)(),y=Object(je.useRef)(),f=Object(we.useBlockProps)({ref:j,onKeyDown:function(e){if(dt.isKeyboardEvent.primary(e,"k"))C(e);else if(dt.isKeyboardEvent.primaryShift(e,"k")){var t;x(),null===(t=y.current)||void 0===t||t.focus()}}}),[_,k]=Object(je.useState)(!1),w=!!b,E="_blank"===i;function C(e){e.preventDefault(),k(!0)}function x(){o({url:void 0,linkTarget:void 0,rel:void 0}),k(!1)}return Object(je.useEffect)(()=>{a||k(!1)},[a]),Object(je.createElement)(je.Fragment,null,Object(je.createElement)("div",Object(mt.a)({},f,{className:tt()(f.className,{["has-custom-width wp-block-button__width-"+p]:p,"has-custom-font-size":f.style.fontSize})}),Object(je.createElement)(we.RichText,{ref:y,"aria-label":Object(ke.__)("Button text"),placeholder:s||Object(ke.__)("Add text…"),value:d,onChange:e=>{o({text:e.replace(/<\/?a[^>]*>/g,"")})},withoutInteractiveFormatting:!0,className:tt()(r,"wp-block-button__link",v.className,h.className,{"no-border-radius":0===(null==m||null===(t=m.border)||void 0===t?void 0:t.radius)}),style:{...h.style,...v.style,...O.style},onSplit:e=>Object(Oe.createBlock)("core/button",{...n,text:e}),onReplace:l,onMerge:c,identifier:"text"})),Object(je.createElement)(we.BlockControls,{group:"block"},!w&&Object(je.createElement)(_e.ToolbarButton,{name:"link",icon:bt.a,title:Object(ke.__)("Link"),shortcut:dt.displayShortcut.primary("k"),onClick:C}),w&&Object(je.createElement)(_e.ToolbarButton,{name:"link",icon:pt.a,title:Object(ke.__)("Unlink"),shortcut:dt.displayShortcut.primaryShift("k"),onClick:x,isActive:!0})),a&&(_||w)&&Object(je.createElement)(_e.Popover,{position:"bottom center",onClose:()=>{var e;k(!1),null===(e=y.current)||void 0===e||e.focus()},anchorRef:null==j?void 0:j.current,focusOnMount:!!_&&"firstElement"},Object(je.createElement)(we.__experimentalLinkControl,{className:"wp-block-navigation-link__inline-link-input",value:{url:b,opensInNewTab:E},onChange:e=>{let{url:t="",opensInNewTab:n}=e;o({url:t}),E!==n&&function(e){const t=e?"_blank":void 0;let n=u;t&&!u?n="noreferrer noopener":t||"noreferrer noopener"!==u||(n=void 0),o({linkTarget:t,rel:n})}(n)},onRemove:()=>{var e;x(),null===(e=y.current)||void 0===e||e.focus()},forceIsEditingLink:_})),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(gt,{selectedWidth:p,setAttributes:o})),Object(je.createElement)(we.InspectorControls,{__experimentalGroup:"advanced"},Object(je.createElement)(_e.TextControl,{label:Object(ke.__)("Link rel"),value:u||"",onChange:g})))};const vt={apiVersion:2,name:"core/button",title:"Button",category:"design",parent:["core/buttons"],description:"Prompt visitors to take action with a button-style link.",keywords:["link"],textdomain:"default",attributes:{url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,__experimentalFontFamily:!0,__experimentalDefaultControls:{fontSize:!0}},reusable:!1,spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wp-block-button__link"},styles:[{name:"fill",label:"Fill",isDefault:!0},{name:"outline",label:"Outline"}],editorStyle:"wp-block-button-editor",style:"wp-block-button"},{name:Ot}=vt,jt={icon:Xe.a,example:{attributes:{className:"is-style-fill",text:Object(ke.__)("Call to Action")}},edit:ht,save:function(e){var t,n;let{attributes:o,className:r}=e;const{fontSize:a,linkTarget:l,rel:c,style:i,text:s,title:u,url:m,width:d}=o;if(!s)return null;const b=Object(we.__experimentalGetBorderClassesAndStyles)(o),p=Object(we.__experimentalGetColorClassesAndStyles)(o),g=Object(we.__experimentalGetSpacingClassesAndStyles)(o),h=tt()("wp-block-button__link",p.className,b.className,{"no-border-radius":0===(null==i||null===(t=i.border)||void 0===t?void 0:t.radius)}),v={...b.style,...p.style,...g.style},O=tt()(r,{["has-custom-width wp-block-button__width-"+d]:d,"has-custom-font-size":a||(null==i||null===(n=i.typography)||void 0===n?void 0:n.fontSize)});return Object(je.createElement)("div",we.useBlockProps.save({className:O}),Object(je.createElement)(we.RichText.Content,{tagName:"a",className:h,href:m,title:u,style:v,value:s,target:l,rel:c}))},deprecated:ut,merge:(e,t)=>{let{text:n=""}=t;return{...e,text:(e.text||"")+n}}};var yt=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.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"}));const ft=e=>{if(e.layout)return e;const{contentJustification:t,orientation:n,...o}=e;return(t||n)&&Object.assign(o,{layout:{type:"flex",...t&&{justifyContent:t},...n&&{orientation:n}}}),o};var _t=[{attributes:{contentJustification:{type:"string"},orientation:{type:"string",default:"horizontal"}},supports:{anchor:!0,align:["wide","full"],__experimentalExposeControlsToChildren:!0,spacing:{blockGap:!0,margin:["top","bottom"],__experimentalDefaultControls:{blockGap:!0}}},isEligible:e=>{let{contentJustification:t,orientation:n}=e;return!!t||!!n},migrate:ft,save(e){let{attributes:{contentJustification:t,orientation:n}}=e;return Object(je.createElement)("div",we.useBlockProps.save({className:tt()({["is-content-justification-"+t]:t,"is-vertical":"vertical"===n})}),Object(je.createElement)(we.InnerBlocks.Content,null))}},{supports:{align:["center","left","right"],anchor:!0},save:()=>Object(je.createElement)("div",null,Object(je.createElement)(we.InnerBlocks.Content,null)),isEligible(e){let{align:t}=e;return t&&["center","left","right"].includes(t)},migrate:e=>ft({...e,align:void 0,contentJustification:e.align})}],kt=n("qRz9");const{name:wt}={apiVersion:2,name:"core/buttons",title:"Buttons",category:"design",description:"Prompt visitors to take action with a group of button-style links.",keywords:["link"],textdomain:"default",supports:{anchor:!0,align:["wide","full"],__experimentalExposeControlsToChildren:!0,spacing:{blockGap:!0,margin:["top","bottom"],__experimentalDefaultControls:{blockGap:!0}},__experimentalLayout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}}},editorStyle:"wp-block-buttons-editor",style:"wp-block-buttons"};var Et={from:[{type:"block",isMultiBlock:!0,blocks:["core/button"],transform:e=>Object(Oe.createBlock)(wt,{},e.map(e=>Object(Oe.createBlock)("core/button",e)))},{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>Object(Oe.createBlock)(wt,{},e.map(e=>{const t=Object(kt.__unstableCreateElement)(document,e.content),n=t.innerText||"",o=t.querySelector("a"),r=null==o?void 0:o.getAttribute("href");return Object(Oe.createBlock)("core/button",{text:n,url:r})})),isMatch:e=>e.every(e=>{const t=Object(kt.__unstableCreateElement)(document,e.content),n=t.innerText||"",o=t.querySelectorAll("a");return n.length<=30&&o.length<=1})}]};const Ct=[Ot];var xt=function(e){let{attributes:{layout:t={}}}=e;const n=Object(we.useBlockProps)(),o=Object(Pe.useSelect)(e=>{var t;const n=e(we.store).getSettings().__experimentalPreferredStyleVariations;return null==n||null===(t=n.value)||void 0===t?void 0:t[Ot]},[]),r=Object(we.useInnerBlocksProps)(n,{allowedBlocks:Ct,template:[[Ot,{className:o&&"is-style-"+o}]],__experimentalLayout:t,templateInsertUpdatesSelection:!0});return Object(je.createElement)(je.Fragment,null,Object(je.createElement)("div",r))};const St={apiVersion:2,name:"core/buttons",title:"Buttons",category:"design",description:"Prompt visitors to take action with a group of button-style links.",keywords:["link"],textdomain:"default",supports:{anchor:!0,align:["wide","full"],__experimentalExposeControlsToChildren:!0,spacing:{blockGap:!0,margin:["top","bottom"],__experimentalDefaultControls:{blockGap:!0}},__experimentalLayout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}}},editorStyle:"wp-block-buttons-editor",style:"wp-block-buttons"},{name:Bt}=St,Tt={icon:yt,example:{innerBlocks:[{name:"core/button",attributes:{text:Object(ke.__)("Find out more")}},{name:"core/button",attributes:{text:Object(ke.__)("Contact us")}}]},deprecated:_t,transforms:Et,edit:xt,save:function(){const e=we.useInnerBlocksProps.save(we.useBlockProps.save());return Object(je.createElement)("div",e)}};var Nt=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.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"})),zt=n("wy2R"),Pt=n.n(zt),It=n("jZUy");const Mt=He()(e=>{if(!e)return{};const t=Pt()(e);return{year:t.year(),month:t.month()+1}});const Rt={apiVersion:2,name:"core/calendar",title:"Calendar",category:"widgets",description:"A calendar of your site’s posts.",keywords:["posts","archive"],textdomain:"default",attributes:{month:{type:"integer"},year:{type:"integer"}},supports:{align:!0},style:"wp-block-calendar"},{name:Lt}=Rt,Vt={icon:Nt,example:{},edit:function(e){let{attributes:t}=e;const n=Object(we.useBlockProps)(),{date:o,hasPosts:r,hasPostsResolved:a}=Object(Pe.useSelect)(e=>{const{getEntityRecords:t,hasFinishedResolution:n}=e(It.store),o={status:"publish",per_page:1},r=t("postType","post",o),a=n("getEntityRecords",["postType","post",o]);let l;const c=e("core/editor");if(c){"post"===c.getEditedPostAttribute("type")&&(l=c.getEditedPostAttribute("date"))}return{date:l,hasPostsResolved:a,hasPosts:a&&1===(null==r?void 0:r.length)}},[]);return r?Object(je.createElement)("div",n,Object(je.createElement)(_e.Disabled,null,Object(je.createElement)(Ce.a,{block:"core/calendar",attributes:{...t,...Mt(o)}}))):Object(je.createElement)("div",n,Object(je.createElement)(_e.Placeholder,{icon:Nt,label:Object(ke.__)("Calendar")},a?Object(ke.__)("No published posts found."):Object(je.createElement)(_e.Spinner,null)))}};var Ht=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.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"}));var At=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(je.createElement)(ye.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"}));const Ft={apiVersion:2,name:"core/categories",title:"Categories",category:"widgets",description:"Display a list of all categories.",textdomain:"default",attributes:{displayAsDropdown:{type:"boolean",default:!1},showHierarchy:{type:"boolean",default:!1},showPostCounts:{type:"boolean",default:!1},showOnlyTopLevel:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-categories-editor",style:"wp-block-categories"},{name:Dt}=Ft,Gt={icon:Ht,example:{},edit:function e(t){let{attributes:{displayAsDropdown:n,showHierarchy:o,showPostCounts:r,showOnlyTopLevel:a},setAttributes:l}=t;const c=Object(nt.useInstanceId)(e,"blocks-category-select"),{categories:i,isRequesting:s}=Object(Pe.useSelect)(e=>{const{getEntityRecords:t,isResolving:n}=e(It.store),o={per_page:-1,hide_empty:!0,context:"view"};return a&&(o.parent=0),{categories:t("taxonomy","category",o),isRequesting:n("getEntityRecords",["taxonomy","category",o])}},[a]),u=e=>null!=i&&i.length?null===e?i:i.filter(t=>{let{parent:n}=t;return n===e}):[],m=e=>"wp-block-categories__list wp-block-categories__list-level-"+e,d=e=>t=>l({[e]:t}),b=e=>e?Object(Me.unescape)(e).trim():Object(ke.__)("(Untitled)"),p=(e,t)=>{const n=u(e.id),{id:a,link:l,count:c,name:i}=e;return Object(je.createElement)("li",{key:a},Object(je.createElement)("a",{href:l,target:"_blank",rel:"noreferrer noopener"},b(i)),r&&Object(je.createElement)("span",{className:"wp-block-categories__post-count"},` (${c})`),o&&!!n.length&&Object(je.createElement)("ul",{className:m(t+1)},n.map(e=>p(e,t+1))))},g=(e,t)=>{const{id:n,count:a,name:l}=e,c=u(n);return[Object(je.createElement)("option",{key:n},Object(Me.times)(3*t,()=>" "),b(l),r&&` (${a})`),o&&!!c.length&&c.map(e=>g(e,t+1))]};return Object(je.createElement)("div",Object(we.useBlockProps)(),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Categories settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Display as dropdown"),checked:n,onChange:d("displayAsDropdown")}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Show post counts"),checked:r,onChange:d("showPostCounts")}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Show only top level categories"),checked:a,onChange:d("showOnlyTopLevel")}),!a&&Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Show hierarchy"),checked:o,onChange:d("showHierarchy")}))),s&&Object(je.createElement)(_e.Placeholder,{icon:At,label:Object(ke.__)("Categories")},Object(je.createElement)(_e.Spinner,null)),!s&&0===(null==i?void 0:i.length)&&Object(je.createElement)("p",null,Object(ke.__)("Your site does not have any posts, so there is nothing to display here at the moment.")),!s&&(null==i?void 0:i.length)>0&&(n?(()=>{const e=u(o?0:null);return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.VisuallyHidden,{as:"label",htmlFor:c},Object(ke.__)("Categories")),Object(je.createElement)("select",{id:c,className:"wp-block-categories__dropdown"},e.map(e=>g(e,0))))})():(()=>{const e=u(o?0:null);return Object(je.createElement)("ul",{className:m(0)},e.map(e=>p(e,0)))})()))}};var Ut=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.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"}));var qt=e=>{let{clientId:t}=e;const{replaceBlocks:n}=Object(Pe.useDispatch)(we.store),o=Object(Pe.useSelect)(e=>e(we.store).getBlock(t),[t]);return Object(je.createElement)(_e.ToolbarButton,{onClick:()=>n(o.clientId,Object(Oe.rawHandler)({HTML:Object(Oe.serialize)(o)}))},Object(ke.__)("Convert to blocks"))};const{wp:Wt}=window;const $t={apiVersion:2,name:"core/freeform",title:"Classic",category:"text",description:"Use the classic WordPress editor.",textdomain:"default",attributes:{content:{type:"string",source:"html"}},supports:{className:!1,customClassName:!1,reusable:!1},editorStyle:"wp-block-freeform-editor"},{name:Zt}=$t,Kt={icon:Ut,edit:function(e){let{clientId:t,attributes:{content:n},setAttributes:o,onReplace:r}=e;const{getMultiSelectedBlockClientIds:a}=Object(Pe.useSelect)(we.store),l=Object(je.useRef)(!1);return Object(je.useEffect)(()=>{if(!l.current)return;const e=window.tinymce.get("editor-"+t);(null==e?void 0:e.getContent())!==n&&e.setContent(n||"")},[n]),Object(je.useEffect)(()=>{const{baseURL:e,suffix:c}=window.wpEditorL10n.tinymce;function i(e){let t;n&&e.on("loadContent",()=>e.setContent(n)),e.on("blur",()=>{var n;t=e.selection.getBookmark(2,!0);const r=document.querySelector(".interface-interface-skeleton__content"),l=r.scrollTop;return null!==(n=a())&&void 0!==n&&n.length||o({content:e.getContent()}),e.once("focus",()=>{t&&(e.selection.moveToBookmark(t),r.scrollTop!==l&&(r.scrollTop=l))}),!1}),e.on("mousedown touchstart",()=>{t=null});const l=Object(Me.debounce)(()=>{const t=e.getContent();t!==e._lastChange&&(e._lastChange=t,o({content:t}))},250);e.on("Paste Change input Undo Redo",l),e.on("remove",l.cancel),e.on("keydown",t=>{dt.isKeyboardEvent.primary(t,"z")&&t.stopPropagation(),t.keyCode!==dt.BACKSPACE&&t.keyCode!==dt.DELETE||!function(e){const t=e.getBody();return!(t.childNodes.length>1)&&(0===t.childNodes.length||!(t.childNodes[0].childNodes.length>1)&&/^\n?$/.test(t.innerText||t.textContent))}(e)||(r([]),t.preventDefault(),t.stopImmediatePropagation());const{altKey:n}=t;n&&t.keyCode===dt.F10&&t.stopPropagation()}),e.on("init",()=>{const t=e.getBody();t.ownerDocument.activeElement===t&&(t.blur(),e.focus())})}function s(){const{settings:e}=window.wpEditorL10n.tinymce;Wt.oldEditor.initialize("editor-"+t,{tinymce:{...e,inline:!0,content_css:!1,fixed_toolbar_container:"#toolbar-"+t,setup:i}})}function u(){"complete"===document.readyState&&s()}return l.current=!0,window.tinymce.EditorManager.overrideDefaults({base_url:e,suffix:c}),"complete"===document.readyState?s():document.addEventListener("readystatechange",u),()=>{document.removeEventListener("readystatechange",u),Wt.oldEditor.remove("editor-"+t)}},[]),Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(_e.ToolbarGroup,null,Object(je.createElement)(qt,{clientId:t}))),Object(je.createElement)("div",Object(we.useBlockProps)(),Object(je.createElement)("div",{key:"toolbar",id:"toolbar-"+t,className:"block-library-classic__toolbar",onClick:function(){const e=window.tinymce.get("editor-"+t);e&&e.focus()},"data-placeholder":Object(ke.__)("Classic"),onKeyDown:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}}),Object(je.createElement)("div",{key:"editor",id:"editor-"+t,className:"wp-block-freeform block-library-rich-text__tinymce"})))},save:function(e){let{attributes:t}=e;const{content:n}=t;return Object(je.createElement)(je.RawHTML,null,n)}};var Jt=n("1Yn1");function Qt(e){return e.replace(/\[/g,"[")}function Yt(e){return e.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m,"$1//$2")}var Xt={from:[{type:"enter",regExp:/^```$/,transform:()=>Object(Oe.createBlock)("core/code")},{type:"block",blocks:["core/html"],transform:e=>{let{content:t}=e;return Object(Oe.createBlock)("core/code",{content:t})}},{type:"raw",isMatch:e=>"PRE"===e.nodeName&&1===e.children.length&&"CODE"===e.firstChild.nodeName,schema:{pre:{children:{code:{children:{"#text":{}}}}}}}]};const en={apiVersion:2,name:"core/code",title:"Code",category:"text",description:"Display code snippets that respect your spacing and tabs.",textdomain:"default",attributes:{content:{type:"string",source:"html",selector:"code"}},supports:{anchor:!0,__experimentalSelector:".wp-block-code > code",typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{margin:["top","bottom"],padding:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},color:{text:!0,background:!0,gradients:!0}},style:"wp-block-code"},{name:tn}=en,nn={icon:Jt.a,example:{attributes:{content:Object(ke.__)('// 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 );')}},transforms:Xt,edit:function(e){let{attributes:t,setAttributes:n,onRemove:o}=e;const r=Object(we.useBlockProps)();return Object(je.createElement)("pre",r,Object(je.createElement)(we.RichText,{tagName:"code",value:t.content,onChange:e=>n({content:e}),onRemove:o,placeholder:Object(ke.__)("Write code…"),"aria-label":Object(ke.__)("Code"),preserveWhiteSpace:!0,__unstablePastePlainText:!0}))},save:function(e){let{attributes:t}=e;return Object(je.createElement)("pre",we.useBlockProps.save(),Object(je.createElement)(we.RichText.Content,{tagName:"code",value:(n=t.content,Object(Me.flow)(Qt,Yt)(n||""))}));var n}};var on=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.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"}));var rn=[{attributes:{verticalAlignment:{type:"string"},width:{type:"number",min:0,max:100}},isEligible(e){let{width:t}=e;return isFinite(t)},migrate:e=>({...e,width:e.width+"%"}),save(e){let{attributes:t}=e;const{verticalAlignment:n,width:o}=t,r=tt()({["is-vertically-aligned-"+n]:n}),a={flexBasis:o+"%"};return Object(je.createElement)("div",{className:r,style:a},Object(je.createElement)(we.InnerBlocks.Content,null))}}];var an=function(e){let{attributes:{verticalAlignment:t,width:n,templateLock:o=!1,allowedBlocks:r},setAttributes:a,clientId:l}=e;const c=tt()("block-core-columns",{["is-vertically-aligned-"+t]:t}),i=Object(_e.__experimentalUseCustomUnits)({availableUnits:Object(we.useSetting)("spacing.units")||["%","px","em","rem","vw"]}),{columnsIds:s,hasChildBlocks:u,rootClientId:m}=Object(Pe.useSelect)(e=>{const{getBlockOrder:t,getBlockRootClientId:n}=e(we.store),o=n(l);return{hasChildBlocks:t(l).length>0,rootClientId:o,columnsIds:t(o)}},[l]),{updateBlockAttributes:d}=Object(Pe.useDispatch)(we.store),b=Number.isFinite(n)?n+"%":n,p=Object(we.useBlockProps)({className:c,style:b?{flexBasis:b}:void 0}),g=s.length,h=s.indexOf(l)+1,v=Object(ke.sprintf)(Object(ke.__)("%1$s (%2$d of %3$d)"),p["aria-label"],h,g),O=Object(we.useInnerBlocksProps)({...p,"aria-label":v},{templateLock:o,allowedBlocks:r,renderAppender:u?void 0:we.InnerBlocks.ButtonBlockAppender});return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(we.BlockVerticalAlignmentToolbar,{onChange:e=>{a({verticalAlignment:e}),d(m,{verticalAlignment:null})},value:t})),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Column settings")},Object(je.createElement)(_e.__experimentalUnitControl,{label:Object(ke.__)("Width"),labelPosition:"edge",__unstableInputWidth:"80px",value:n||"",onChange:e=>{e=0>parseFloat(e)?"0":e,a({width:e})},units:i}))),Object(je.createElement)("div",O))};const ln={apiVersion:2,name:"core/column",title:"Column",category:"text",parent:["core/columns"],description:"A single column within a columns block.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},width:{type:"string"},allowedBlocks:{type:"array"},templateLock:{type:["string","boolean"],enum:["all","insert",!1]}},supports:{anchor:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0},spacing:{padding:!0,__experimentalDefaultControls:{padding:!0}}}},{name:cn}=ln,sn={icon:on,edit:an,save:function(e){let{attributes:t}=e;const{verticalAlignment:n,width:o}=t,r=tt()({["is-vertically-aligned-"+n]:n});let a;if(o&&/\d/.test(o)){let e=Number.isFinite(o)?o+"%":o;if(!Number.isFinite(o)&&null!=o&&o.endsWith("%")){const t=1e12;e=Math.round(Number.parseFloat(o)*t)/t+"%"}a={flexBasis:e}}const l=we.useBlockProps.save({className:r,style:a}),c=we.useInnerBlocksProps.save(l);return Object(je.createElement)("div",c)},deprecated:rn};var un=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.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"}));function mn(e){let t,{doc:n}=mn;n||(n=document.implementation.createHTMLDocument(""),mn.doc=n),n.body.innerHTML=e;for(const e of n.body.firstChild.classList)if(t=e.match(/^layout-column-(\d+)$/))return Number(t[1])-1}var dn=[{attributes:{verticalAlignment:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>{if(!e.customTextColor&&!e.customBackgroundColor)return e;const t={color:{}};return e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),{...Object(Me.omit)(e,["customTextColor","customBackgroundColor"]),style:t,isStackedOnMobile:!0}},save(e){let{attributes:t}=e;const{verticalAlignment:n,backgroundColor:o,customBackgroundColor:r,textColor:a,customTextColor:l}=t,c=Object(we.getColorClassName)("background-color",o),i=Object(we.getColorClassName)("color",a),s=tt()({"has-background":o||r,"has-text-color":a||l,[c]:c,[i]:i,["are-vertically-aligned-"+n]:n}),u={backgroundColor:c?void 0:r,color:i?void 0:l};return Object(je.createElement)("div",{className:s||void 0,style:u},Object(je.createElement)(we.InnerBlocks.Content,null))}},{attributes:{columns:{type:"number",default:2}},isEligible:(e,t)=>!!t.some(e=>/layout-column-\d+/.test(e.originalContent))&&t.some(e=>void 0!==mn(e.originalContent)),migrate(e,t){const n=t.reduce((e,t)=>{const{originalContent:n}=t;let o=mn(n);return void 0===o&&(o=0),e[o]||(e[o]=[]),e[o].push(t),e},[]).map(e=>Object(Oe.createBlock)("core/column",{},e));return[{...Object(Me.omit)(e,["columns"]),isStackedOnMobile:!0},n]},save(e){let{attributes:t}=e;const{columns:n}=t;return Object(je.createElement)("div",{className:`has-${n}-columns`},Object(je.createElement)(we.InnerBlocks.Content,null))}},{attributes:{columns:{type:"number",default:2}},migrate:(e,t)=>[e={...Object(Me.omit)(e,["columns"]),isStackedOnMobile:!0},t],save(e){let{attributes:t}=e;const{verticalAlignment:n,columns:o}=t,r=tt()(`has-${o}-columns`,{["are-vertically-aligned-"+n]:n});return Object(je.createElement)("div",{className:r},Object(je.createElement)(we.InnerBlocks.Content,null))}}];const bn=e=>{const t=parseFloat(e);return Number.isFinite(t)?parseFloat(t.toFixed(2)):void 0};function pn(e,t){const{width:n=100/t}=e.attributes;return bn(n)}function gn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;return Object(Me.sumBy)(e,e=>pn(e,t))}function hn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;return e.reduce((e,n)=>{const o=pn(n,t);return Object.assign(e,{[n.clientId]:o})},{})}function vn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;const o=gn(e,n);return Object(Me.mapValues)(hn(e,n),e=>bn(t*e/o))}function On(e,t){return e.map(e=>Object(Me.merge)({},e,{attributes:{width:t[e.clientId]+"%"}}))}const jn=["core/column"];const yn=Object(Pe.withDispatch)((e,t,n)=>({updateAlignment(o){const{clientId:r,setAttributes:a}=t,{updateBlockAttributes:l}=e(we.store),{getBlockOrder:c}=n.select(we.store);a({verticalAlignment:o});c(r).forEach(e=>{l(e,{verticalAlignment:o})})},updateColumns(o,r){const{clientId:a}=t,{replaceInnerBlocks:l}=e(we.store),{getBlocks:c}=n.select(we.store);let i=c(a);const s=i.every(e=>{var t;const n=e.attributes.width;return Number.isFinite(null!=n&&null!==(t=n.endsWith)&&void 0!==t&&t.call(n,"%")?parseFloat(n):n)});const u=r>o;if(u&&s){const e=bn(100/r);i=[...On(i,vn(i,100-e)),...Object(Me.times)(r-o,()=>Object(Oe.createBlock)("core/column",{width:e+"%"}))]}else if(u)i=[...i,...Object(Me.times)(r-o,()=>Object(Oe.createBlock)("core/column"))];else if(i=Object(Me.dropRight)(i,o-r),s){i=On(i,vn(i,100))}l(a,i)}}))((function(e){let{attributes:t,setAttributes:n,updateAlignment:o,updateColumns:r,clientId:a}=e;const{isStackedOnMobile:l,verticalAlignment:c}=t,{count:i}=Object(Pe.useSelect)(e=>({count:e(we.store).getBlockCount(a)}),[a]),s=tt()({["are-vertically-aligned-"+c]:c,"is-not-stacked-on-mobile":!l}),u=Object(we.useBlockProps)({className:s}),m=Object(we.useInnerBlocksProps)(u,{allowedBlocks:jn,orientation:"horizontal",renderAppender:!1});return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(we.BlockVerticalAlignmentToolbar,{onChange:o,value:c})),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,null,Object(je.createElement)(_e.RangeControl,{label:Object(ke.__)("Columns"),value:i,onChange:e=>r(i,e),min:1,max:Math.max(6,i)}),i>6&&Object(je.createElement)(_e.Notice,{status:"warning",isDismissible:!1},Object(ke.__)("This column count exceeds the recommended amount and may cause visual breakage.")),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Stack on mobile"),checked:l,onChange:()=>n({isStackedOnMobile:!l})}))),Object(je.createElement)("div",m))}));function fn(e){let{clientId:t,name:n,setAttributes:o}=e;const{blockType:r,defaultVariation:a,variations:l}=Object(Pe.useSelect)(e=>{const{getBlockVariations:t,getBlockType:o,getDefaultBlockVariation:r}=e(Oe.store);return{blockType:o(n),defaultVariation:r(n,"block"),variations:t(n,"block")}},[n]),{replaceInnerBlocks:c}=Object(Pe.useDispatch)(we.store),i=Object(we.useBlockProps)();return Object(je.createElement)("div",i,Object(je.createElement)(we.__experimentalBlockVariationPicker,{icon:Object(Me.get)(r,["icon","src"]),label:Object(Me.get)(r,["title"]),variations:l,onSelect:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;e.attributes&&o(e.attributes),e.innerBlocks&&c(t,Object(Oe.createBlocksFromInnerBlocksTemplate)(e.innerBlocks),!0)},allowSkip:!0}))}var _n=e=>{const{clientId:t}=e,n=Object(Pe.useSelect)(e=>e(we.store).getBlocks(t).length>0,[t])?yn:fn;return Object(je.createElement)(n,e)};var kn=[{name:"one-column-full",title:Object(ke.__)("100"),description:Object(ke.__)("One column"),icon:Object(je.createElement)(_e.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(_e.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"})),innerBlocks:[["core/column"]],scope:["block"]},{name:"two-columns-equal",title:Object(ke.__)("50 / 50"),description:Object(ke.__)("Two columns; equal split"),icon:Object(je.createElement)(_e.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(_e.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"})),isDefault:!0,innerBlocks:[["core/column"],["core/column"]],scope:["block"]},{name:"two-columns-one-third-two-thirds",title:Object(ke.__)("30 / 70"),description:Object(ke.__)("Two columns; one-third, two-thirds split"),icon:Object(je.createElement)(_e.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(_e.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"})),innerBlocks:[["core/column",{width:"33.33%"}],["core/column",{width:"66.66%"}]],scope:["block"]},{name:"two-columns-two-thirds-one-third",title:Object(ke.__)("70 / 30"),description:Object(ke.__)("Two columns; two-thirds, one-third split"),icon:Object(je.createElement)(_e.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(_e.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"})),innerBlocks:[["core/column",{width:"66.66%"}],["core/column",{width:"33.33%"}]],scope:["block"]},{name:"three-columns-equal",title:Object(ke.__)("33 / 33 / 33"),description:Object(ke.__)("Three columns; equal split"),icon:Object(je.createElement)(_e.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(_e.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"})),innerBlocks:[["core/column"],["core/column"],["core/column"]],scope:["block"]},{name:"three-columns-wider-center",title:Object(ke.__)("25 / 50 / 25"),description:Object(ke.__)("Three columns; wide center column"),icon:Object(je.createElement)(_e.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(_e.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"})),innerBlocks:[["core/column",{width:"25%"}],["core/column",{width:"50%"}],["core/column",{width:"25%"}]],scope:["block"]}];var wn={from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert:e=>{const t=+(100/e.length).toFixed(2),n=e.map(e=>{let{name:n,attributes:o,innerBlocks:r}=e;return["core/column",{width:t+"%"},[[n,{...o},r]]]});return Object(Oe.createBlock)("core/columns",{},Object(Oe.createBlocksFromInnerBlocksTemplate)(n))},isMatch:e=>{let{length:t}=e;return t&&t<=6}},{type:"block",blocks:["core/media-text"],priority:1,transform:(e,t)=>{const{align:n,backgroundColor:o,textColor:r,style:a,mediaAlt:l,mediaId:c,mediaPosition:i,mediaSizeSlug:s,mediaType:u,mediaUrl:m,mediaWidth:d,verticalAlignment:b}=e;let p;if("image"!==u&&u)p=["core/video",{id:c,src:m}];else{p=["core/image",{...{id:c,alt:l,url:m,sizeSlug:s},...{href:e.href,linkClass:e.linkClass,linkDestination:e.linkDestination,linkTarget:e.linkTarget,rel:e.rel}}]}const g=[["core/column",{width:d+"%"},[p]],["core/column",{width:100-d+"%"},t]];return"right"===i&&g.reverse(),Object(Oe.createBlock)("core/columns",{align:n,backgroundColor:o,textColor:r,style:a,verticalAlignment:b},Object(Oe.createBlocksFromInnerBlocksTemplate)(g))}}]};const En={apiVersion:2,name:"core/columns",title:"Columns",category:"design",description:"Display content in multiple columns, with blocks added to each column.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},isStackedOnMobile:{type:"boolean",default:!0}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0},spacing:{margin:["top","bottom"],padding:!0,__experimentalDefaultControls:{padding:!0}}},editorStyle:"wp-block-columns-editor",style:"wp-block-columns"},{name:Cn}=En,xn={icon:un,variations:kn,example:{viewportWidth:600,innerBlocks:[{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:Object(ke.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.")}},{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg"}},{name:"core/paragraph",attributes:{content:Object(ke.__)("Suspendisse commodo neque lacus, a dictum orci interdum et.")}}]},{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:Object(ke.__)("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:{content:Object(ke.__)("Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.")}}]}]},deprecated:dn,edit:_n,save:function(e){let{attributes:t}=e;const{isStackedOnMobile:n,verticalAlignment:o}=t,r=tt()({["are-vertically-aligned-"+o]:o,"is-not-stacked-on-mobile":!n}),a=we.useBlockProps.save({className:r}),l=we.useInnerBlocksProps.save(a);return Object(je.createElement)("div",l)},transforms:wn};var Sn=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.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"}));const Bn={"top left":"is-position-top-left","top center":"is-position-top-center","top right":"is-position-top-right","center left":"is-position-center-left","center center":"is-position-center-center",center:"is-position-center-center","center right":"is-position-center-right","bottom left":"is-position-bottom-left","bottom center":"is-position-bottom-center","bottom right":"is-position-bottom-right"};function Tn(e){return e?{backgroundImage:`url(${e})`}:{}}const Nn=["image","video"];function zn(e){return 50===e||void 0===!e?null:"has-background-dim-"+10*Math.round(e/10)}function Pn(e){return!e||"center center"===e||"center"===e}function In(e){return Pn(e)?"":Bn[e]}function Mn(e){return 0!==e&&50!==e&&e?"has-background-dim-"+10*Math.round(e/10):null}function Rn(e){return{...e,dimRatio:e.url?e.dimRatio:100}}const Ln={url:{type:"string"},id:{type:"number"},hasParallax:{type:"boolean",default:!1},dimRatio:{type:"number",default:50},overlayColor:{type:"string"},customOverlayColor:{type:"string"},backgroundType:{type:"string",default:"image"},focalPoint:{type:"object"}};var Vn=[{attributes:{...Ln,isRepeated:{type:"boolean",default:!1},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""}},supports:{anchor:!0,align:!0,html:!1,spacing:{padding:!0,__experimentalDefaultControls:{padding:!0}},color:{__experimentalDuotone:"> .wp-block-cover__image-background, > .wp-block-cover__video-background",text:!1,background:!1}},save(e){let{attributes:t}=e;const{backgroundType:n,gradient:o,contentPosition:r,customGradient:a,customOverlayColor:l,dimRatio:c,focalPoint:i,hasParallax:s,isRepeated:u,overlayColor:m,url:d,alt:b,id:p,minHeight:g,minHeightUnit:h}=t,v=Object(we.getColorClassName)("background-color",m),O=Object(we.__experimentalGetGradientClass)(o),j=h?`${g}${h}`:g,y="image"===n,f="video"===n,_=!(s||u),k={...y&&!_?Tn(d):{},backgroundColor:v?void 0:l,background:a&&!d?a:void 0,minHeight:j||void 0},w=i&&_?`${Math.round(100*i.x)}% ${Math.round(100*i.y)}%`:void 0,E=tt()(Mn(c),v,{"has-background-dim":0!==c,"has-parallax":s,"is-repeated":u,"has-background-gradient":o||a,[O]:!d&&O,"has-custom-content-position":!Pn(r)},In(r));return Object(je.createElement)("div",we.useBlockProps.save({className:E,style:k}),d&&(o||a)&&0!==c&&Object(je.createElement)("span",{"aria-hidden":"true",className:tt()("wp-block-cover__gradient-background",O),style:a?{background:a}:void 0}),y&&_&&d&&Object(je.createElement)("img",{className:tt()("wp-block-cover__image-background",p?"wp-image-"+p:null),alt:b,src:d,style:{objectPosition:w},"data-object-fit":"cover","data-object-position":w}),f&&d&&Object(je.createElement)("video",{className:tt()("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:d,style:{objectPosition:w},"data-object-fit":"cover","data-object-position":w}),Object(je.createElement)("div",{className:"wp-block-cover__inner-container"},Object(je.createElement)(we.InnerBlocks.Content,null)))},migrate:Rn},{attributes:{...Ln,isRepeated:{type:"boolean",default:!1},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"}},supports:{align:!0},save(e){let{attributes:t}=e;const{backgroundType:n,gradient:o,contentPosition:r,customGradient:a,customOverlayColor:l,dimRatio:c,focalPoint:i,hasParallax:s,isRepeated:u,overlayColor:m,url:d,minHeight:b,minHeightUnit:p}=t,g=Object(we.getColorClassName)("background-color",m),h=Object(we.__experimentalGetGradientClass)(o),v=p?`${b}${p}`:b,O="image"===n,j="video"===n,y=O?Tn(d):{},f={};let _;g||(y.backgroundColor=l),a&&!d&&(y.background=a),y.minHeight=v||void 0,i&&(_=`${Math.round(100*i.x)}% ${Math.round(100*i.y)}%`,O&&!s&&(y.backgroundPosition=_),j&&(f.objectPosition=_));const k=tt()(Mn(c),g,{"has-background-dim":0!==c,"has-parallax":s,"is-repeated":u,"has-background-gradient":o||a,[h]:!d&&h,"has-custom-content-position":!Pn(r)},In(r));return Object(je.createElement)("div",we.useBlockProps.save({className:k,style:y}),d&&(o||a)&&0!==c&&Object(je.createElement)("span",{"aria-hidden":"true",className:tt()("wp-block-cover__gradient-background",h),style:a?{background:a}:void 0}),j&&d&&Object(je.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:d,style:f}),Object(je.createElement)("div",{className:"wp-block-cover__inner-container"},Object(je.createElement)(we.InnerBlocks.Content,null)))},migrate:Rn},{attributes:{...Ln,minHeight:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"}},supports:{align:!0},save(e){let{attributes:t}=e;const{backgroundType:n,gradient:o,customGradient:r,customOverlayColor:a,dimRatio:l,focalPoint:c,hasParallax:i,overlayColor:s,url:u,minHeight:m}=t,d=Object(we.getColorClassName)("background-color",s),b=Object(we.__experimentalGetGradientClass)(o),p="image"===n?Tn(u):{};d||(p.backgroundColor=a),c&&!i&&(p.backgroundPosition=`${Math.round(100*c.x)}% ${Math.round(100*c.y)}%`),r&&!u&&(p.background=r),p.minHeight=m||void 0;const g=tt()(Mn(l),d,{"has-background-dim":0!==l,"has-parallax":i,"has-background-gradient":r,[b]:!u&&b});return Object(je.createElement)("div",{className:g,style:p},u&&(o||r)&&0!==l&&Object(je.createElement)("span",{"aria-hidden":"true",className:tt()("wp-block-cover__gradient-background",b),style:r?{background:r}:void 0}),"video"===n&&u&&Object(je.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:u}),Object(je.createElement)("div",{className:"wp-block-cover__inner-container"},Object(je.createElement)(we.InnerBlocks.Content,null)))},migrate:Rn},{attributes:{...Ln,minHeight:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"}},supports:{align:!0},save(e){let{attributes:t}=e;const{backgroundType:n,gradient:o,customGradient:r,customOverlayColor:a,dimRatio:l,focalPoint:c,hasParallax:i,overlayColor:s,url:u,minHeight:m}=t,d=Object(we.getColorClassName)("background-color",s),b=Object(we.__experimentalGetGradientClass)(o),p="image"===n?Tn(u):{};d||(p.backgroundColor=a),c&&!i&&(p.backgroundPosition=`${100*c.x}% ${100*c.y}%`),r&&!u&&(p.background=r),p.minHeight=m||void 0;const g=tt()(Mn(l),d,{"has-background-dim":0!==l,"has-parallax":i,"has-background-gradient":r,[b]:!u&&b});return Object(je.createElement)("div",{className:g,style:p},u&&(o||r)&&0!==l&&Object(je.createElement)("span",{"aria-hidden":"true",className:tt()("wp-block-cover__gradient-background",b),style:r?{background:r}:void 0}),"video"===n&&u&&Object(je.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:u}),Object(je.createElement)("div",{className:"wp-block-cover__inner-container"},Object(je.createElement)(we.InnerBlocks.Content,null)))},migrate:Rn},{attributes:{...Ln,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"}},supports:{align:!0},save(e){let{attributes:t}=e;const{backgroundType:n,contentAlign:o,customOverlayColor:r,dimRatio:a,focalPoint:l,hasParallax:c,overlayColor:i,title:s,url:u}=t,m=Object(we.getColorClassName)("background-color",i),d="image"===n?Tn(u):{};m||(d.backgroundColor=r),l&&!c&&(d.backgroundPosition=`${100*l.x}% ${100*l.y}%`);const b=tt()(Mn(a),m,{"has-background-dim":0!==a,"has-parallax":c,[`has-${o}-content`]:"center"!==o});return Object(je.createElement)("div",{className:b,style:d},"video"===n&&u&&Object(je.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:u}),!we.RichText.isEmpty(s)&&Object(je.createElement)(we.RichText.Content,{tagName:"p",className:"wp-block-cover-text",value:s}))},migrate(e){const t={...e,dimRatio:e.url?e.dimRatio:100};return[Object(Me.omit)(t,["title","contentAlign"]),[Object(Oe.createBlock)("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:Object(ke.__)("Write title…")})]]}},{attributes:{...Ln,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"},align:{type:"string"}},supports:{className:!1},save(e){let{attributes:t}=e;const{url:n,title:o,hasParallax:r,dimRatio:a,align:l,contentAlign:c,overlayColor:i,customOverlayColor:s}=t,u=Object(we.getColorClassName)("background-color",i),m=Tn(n);u||(m.backgroundColor=s);const d=tt()("wp-block-cover-image",Mn(a),u,{"has-background-dim":0!==a,"has-parallax":r,[`has-${c}-content`]:"center"!==c},l?"align"+l:null);return Object(je.createElement)("div",{className:d,style:m},!we.RichText.isEmpty(o)&&Object(je.createElement)(we.RichText.Content,{tagName:"p",className:"wp-block-cover-image-text",value:o}))},migrate(e){const t={...e,dimRatio:e.url?e.dimRatio:100};return[Object(Me.omit)(t,["title","contentAlign","align"]),[Object(Oe.createBlock)("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:Object(ke.__)("Write title…")})]]}},{attributes:{...Ln,title:{type:"string",source:"html",selector:"h2"},align:{type:"string"},contentAlign:{type:"string",default:"center"}},supports:{className:!1},save(e){let{attributes:t}=e;const{url:n,title:o,hasParallax:r,dimRatio:a,align:l}=t,c=Tn(n),i=tt()("wp-block-cover-image",Mn(a),{"has-background-dim":0!==a,"has-parallax":r},l?"align"+l:null);return Object(je.createElement)("section",{className:i,style:c},Object(je.createElement)(we.RichText.Content,{tagName:"h2",value:o}))},migrate(e){const t={...e,dimRatio:e.url?e.dimRatio:100};return[Object(Me.omit)(t,["title","contentAlign","align"]),[Object(Oe.createBlock)("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:Object(ke.__)("Write title…")})]]}}],Hn=n("FEKF"),An=n.n(Hn),Fn=n("fHnH"),Dn=n("abaT");Object(Fn.b)([Dn.a]);const{__Visualizer:Gn}=_e.__experimentalBoxControl;function Un(){return Un.fastAverageColor||(Un.fastAverageColor=new An.a),Un.fastAverageColor}function qn(e){let{onChange:t,onUnitChange:n,unit:o="px",value:r=""}=e;const[a,l]=Object(je.useState)(null),c="block-cover-height-input-"+Object(nt.useInstanceId)(we.__experimentalUnitControl),i="px"===o,s=Object(_e.__experimentalUseCustomUnits)({availableUnits:Object(we.useSetting)("spacing.units")||["px","em","rem","vw","vh"],defaultValues:{px:"430",em:"20",rem:"20",vw:"20",vh:"50"}}),u=null!==a?a:r,m=i?50:0;return Object(je.createElement)(_e.BaseControl,{label:Object(ke.__)("Minimum height of cover"),id:c},Object(je.createElement)(we.__experimentalUnitControl,{id:c,isResetValueOnUnitChange:!0,min:m,onBlur:()=>{null!==a&&l(null)},onChange:e=>{const o=""!==e?parseFloat(e):void 0;isNaN(o)&&void 0!==o?l(e):(l(null),t(o),void 0===o&&n())},onUnitChange:n,style:{maxWidth:80},unit:o,units:s,value:u}))}const Wn={top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1};function $n(e){let{className:t,onResizeStart:n,onResize:o,onResizeStop:r,...a}=e;const[l,c]=Object(je.useState)(!1);return Object(je.createElement)(_e.ResizableBox,Object(mt.a)({className:tt()(t,{"is-resizing":l}),enable:Wn,onResizeStart:(e,t,r)=>{n(r.clientHeight),o(r.clientHeight)},onResize:(e,t,n)=>{o(n.clientHeight),l||c(!0)},onResizeStop:(e,t,n)=>{r(n.clientHeight),c(!1)}},a))}function Zn(e){let{x:t,y:n}=e;return`${Math.round(100*t)}% ${Math.round(100*n)}%`}function Kn(e){let{disableMediaButtons:t=!1,children:n,noticeUI:o,noticeOperations:r,onSelectMedia:a,style:l}=e;const{removeAllNotices:c,createErrorNotice:i}=r;return Object(je.createElement)(we.MediaPlaceholder,{icon:Object(je.createElement)(we.BlockIcon,{icon:Sn}),labels:{title:Object(ke.__)("Cover"),instructions:Object(ke.__)("Drag and drop onto this block, upload, or select existing media from your library.")},onSelect:a,accept:"image/*,video/*",allowedTypes:Nn,notices:o,disableMediaButtons:t,onError:e=>{c(),i(e)},style:l},n)}var Jn=Object(nt.compose)([Object(Pe.withDispatch)(e=>{const{toggleSelection:t,__unstableMarkNextChangeAsNotPersistent:n}=e(we.store);return{toggleSelection:t,markNextChangeAsNotPersistent:n}}),Object(we.withColors)({overlayColor:"background-color"}),_e.withNotices,nt.withInstanceId])((function(e){var t,n,o;let{attributes:r,clientId:a,isSelected:l,noticeUI:c,noticeOperations:i,overlayColor:s,setAttributes:u,setOverlayColor:m,toggleSelection:d,markNextChangeAsNotPersistent:b}=e;const{contentPosition:p,id:g,backgroundType:h,dimRatio:v,focalPoint:O,hasParallax:j,isDark:y,isRepeated:f,minHeight:_,minHeightUnit:k,style:w,url:E,alt:C,allowedBlocks:x,templateLock:S}=r,{gradientClass:B,gradientValue:T,setGradient:N}=Object(we.__experimentalUseGradient)(),z=function(e,t){return n=>{if(!n||!n.url)return void e({url:void 0,id:void 0});let o;if(Object(ze.isBlobURL)(n.url)&&(n.type=Object(ze.getBlobTypeByURL)(n.url)),n.media_type)o="image"===n.media_type?"image":"video";else{if("image"!==n.type&&"video"!==n.type)return;o=n.type}e({dimRatio:100===t?50:t,url:n.url,id:n.id,alt:null==n?void 0:n.alt,backgroundType:o,..."video"===o?{focalPoint:void 0,hasParallax:void 0}:{}})}}(u,v),P=((e,t)=>!e&&Object(ze.isBlobURL)(t))(g,E),[I,M]=Object(je.useState)(_),[R,L]=Object(je.useState)(k),V="vh"===k&&100===_,H=Object(je.useRef)(),A=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;const[r,a]=Object(je.useState)(!1);return Object(je.useEffect)(()=>{e&&t<=50&&o.current&&Un().getColorAsync(o.current,e=>{a(e.isDark)})},[e,e&&t<=50&&o.current,a]),Object(je.useEffect)(()=>{if(t>50||!e){if(!n)return void a(!0);a(Object(Fn.a)(n).isDark())}},[n,t>50||!e,a]),Object(je.useEffect)(()=>{e||n||a(!1)},[!e&&!n,a]),r}(E,v,s.color,H);Object(je.useEffect)(()=>{b(),u({isDark:A})},[A]);const F="image"===h,D="video"===h,[G,U]=Object(je.useState)(null),q=k?`${_}${k}`:_,W=!(j||f),$={...F&&!W?Tn(E):void 0,minHeight:G||q||void 0},Z={backgroundColor:s.color},K={objectPosition:O&&W?Zn(O):void 0},J=!!(E||s.color||T),Q=D||F&&(!j||f),Y=e=>{const[t,n]=H.current?[H.current.style,"objectPosition"]:[te.current.style,"backgroundPosition"];t[n]=Zn(e)},X=Object(Pe.useSelect)(e=>e(we.store).getBlock(a).innerBlocks.length>0,[a]),ee=Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(we.__experimentalBlockAlignmentMatrixControl,{label:Object(ke.__)("Change content position"),value:p,onChange:e=>u({contentPosition:e}),isDisabled:!X}),Object(je.createElement)(we.__experimentalBlockFullHeightAligmentControl,{isActive:V,onToggle:()=>V?u("vh"===R&&100===I?{minHeight:void 0,minHeightUnit:void 0}:{minHeight:I,minHeightUnit:R}):(M(_),L(k),u({minHeight:100,minHeightUnit:"vh"})),isDisabled:!X})),Object(je.createElement)(we.BlockControls,{group:"other"},Object(je.createElement)(we.MediaReplaceFlow,{mediaId:g,mediaURL:E,allowedTypes:Nn,accept:"image/*,video/*",onSelect:z,name:E?Object(ke.__)("Replace"):Object(ke.__)("Add Media")})),Object(je.createElement)(we.InspectorControls,null,!!E&&Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Media settings")},F&&Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Fixed background"),checked:j,onChange:()=>{u({hasParallax:!j,...j?{}:{focalPoint:void 0}})}}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Repeated background"),checked:f,onChange:()=>{u({isRepeated:!f})}})),Q&&Object(je.createElement)(_e.FocalPointPicker,{label:Object(ke.__)("Focal point picker"),url:E,value:O,onDragStart:Y,onDrag:Y,onChange:e=>u({focalPoint:e})}),E&&F&&W&&Object(je.createElement)(_e.TextareaControl,{label:Object(ke.__)("Alt text (alternative text)"),value:C,onChange:e=>u({alt:e}),help:Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.ExternalLink,{href:"https://www.w3.org/WAI/tutorials/images/decision-tree"},Object(ke.__)("Describe the purpose of the image")),Object(ke.__)("Leave empty if the image is purely decorative."))}),Object(je.createElement)(_e.PanelRow,null,Object(je.createElement)(_e.Button,{variant:"secondary",isSmall:!0,className:"block-library-cover__reset-button",onClick:()=>u({url:void 0,id:void 0,backgroundType:void 0,focalPoint:void 0,hasParallax:void 0,isRepeated:void 0})},Object(ke.__)("Clear Media")))),Object(je.createElement)(we.__experimentalPanelColorGradientSettings,{__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,title:Object(ke.__)("Overlay"),initialOpen:!0,settings:[{colorValue:s.color,gradientValue:T,onColorChange:m,onGradientChange:N,label:Object(ke.__)("Color")}]},Object(je.createElement)(_e.RangeControl,{label:Object(ke.__)("Opacity"),value:v,onChange:e=>u({dimRatio:e}),min:0,max:100,step:10,required:!0}))),Object(je.createElement)(we.InspectorControls,{__experimentalGroup:"dimensions"},Object(je.createElement)(_e.__experimentalToolsPanelItem,{hasValue:()=>!!_,label:Object(ke.__)("Minimum height"),onDeselect:()=>u({minHeight:void 0,minHeightUnit:void 0}),resetAllFilter:()=>({minHeight:void 0,minHeightUnit:void 0}),isShownByDefault:!0,panelId:a},Object(je.createElement)(qn,{value:G||_,unit:k,onChange:e=>u({minHeight:e}),onUnitChange:e=>u({minHeightUnit:e})})))),te=Object(je.useRef)(),ne=Object(we.useBlockProps)({ref:te}),oe=function(e){return[["core/paragraph",{align:"center",placeholder:Object(ke.__)("Write title…"),...e}]]}({fontSize:!(null===(t=Object(we.useSetting)("typography.fontSizes"))||void 0===t||!t.length)?"large":void 0}),re=Object(we.useInnerBlocksProps)({className:"wp-block-cover__inner-container"},{template:oe,templateInsertUpdatesSelection:!0,allowedBlocks:x,templateLock:S});if(!X&&!J)return Object(je.createElement)(je.Fragment,null,ee,Object(je.createElement)("div",Object(mt.a)({},ne,{className:tt()("is-placeholder",ne.className)}),Object(je.createElement)(Kn,{noticeUI:c,onSelectMedia:z,noticeOperations:i,style:{minHeight:G||q||void 0}},Object(je.createElement)("div",{className:"wp-block-cover__placeholder-background-options"},Object(je.createElement)(we.ColorPalette,{disableCustomColors:!0,value:s.color,onChange:m,clearable:!1}))),Object(je.createElement)($n,{className:"block-library-cover__resize-container",onResizeStart:()=>{u({minHeightUnit:"px"}),d(!1)},onResize:U,onResizeStop:e=>{d(!0),u({minHeight:e}),U(null)},showHandle:l})));const ae=tt()({"is-dark-theme":y,"is-light":!y,"is-transient":P,"has-parallax":j,"is-repeated":f,"has-custom-content-position":!Pn(p)},In(p));return Object(je.createElement)(je.Fragment,null,ee,Object(je.createElement)("div",Object(mt.a)({},ne,{className:tt()(ae,ne.className),style:{...$,...ne.style},"data-url":E}),Object(je.createElement)(Gn,{values:null==w||null===(n=w.spacing)||void 0===n?void 0:n.padding,showValues:null==w||null===(o=w.visualizers)||void 0===o?void 0:o.padding}),Object(je.createElement)($n,{className:"block-library-cover__resize-container",onResizeStart:()=>{u({minHeightUnit:"px"}),d(!1)},onResize:U,onResizeStop:e=>{d(!0),u({minHeight:e}),U(null)},showHandle:l}),Object(je.createElement)("span",{"aria-hidden":"true",className:tt()(zn(v),{[s.class]:s.class},"wp-block-cover__gradient-background",B,{"has-background-dim":void 0!==v,"has-background-gradient":T,[B]:!E&&B}),style:{backgroundImage:T,...Z}}),E&&F&&W&&Object(je.createElement)("img",{ref:H,className:"wp-block-cover__image-background",alt:C,src:E,style:K}),E&&D&&Object(je.createElement)("video",{ref:H,className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:E,style:K}),P&&Object(je.createElement)(_e.Spinner,null),Object(je.createElement)(Kn,{disableMediaButtons:!0,noticeUI:c,onSelectMedia:z,noticeOperations:i}),Object(je.createElement)("div",re)))}));var Qn={from:[{type:"block",blocks:["core/image"],transform:e=>{var t;let{caption:n,url:o,alt:r,align:a,id:l,anchor:c,style:i}=e;return Object(Oe.createBlock)("core/cover",{dimRatio:50,url:o,alt:r,align:a,id:l,anchor:c,style:{color:{duotone:null==i||null===(t=i.color)||void 0===t?void 0:t.duotone}}},[Object(Oe.createBlock)("core/paragraph",{content:n,fontSize:"large"})])}},{type:"block",blocks:["core/video"],transform:e=>{let{caption:t,src:n,align:o,id:r,anchor:a}=e;return Object(Oe.createBlock)("core/cover",{dimRatio:50,url:n,align:o,id:r,backgroundType:"video",anchor:a},[Object(Oe.createBlock)("core/paragraph",{content:t,fontSize:"large"})])}},{type:"block",blocks:["core/group"],isMatch:e=>{var t,n;let{backgroundColor:o,gradient:r,style:a}=e;return o||(null==a||null===(t=a.color)||void 0===t?void 0:t.background)||(null==a||null===(n=a.color)||void 0===n?void 0:n.gradient)||r},transform:(e,t)=>{var n,o;let{align:r,anchor:a,backgroundColor:l,gradient:c,style:i}=e;return Object(Oe.createBlock)("core/cover",{align:r,anchor:a,overlayColor:l,customOverlayColor:null==i||null===(n=i.color)||void 0===n?void 0:n.background,gradient:c,customGradient:null==i||null===(o=i.color)||void 0===o?void 0:o.gradient},t)}}],to:[{type:"block",blocks:["core/image"],isMatch:e=>{let{backgroundType:t,url:n,overlayColor:o,customOverlayColor:r,gradient:a,customGradient:l}=e;return n?"image"===t:!(o||r||a||l)},transform:e=>{var t;let{title:n,url:o,alt:r,align:a,id:l,anchor:c,style:i}=e;return Object(Oe.createBlock)("core/image",{caption:n,url:o,alt:r,align:a,id:l,anchor:c,style:{color:{duotone:null==i||null===(t=i.color)||void 0===t?void 0:t.duotone}}})}},{type:"block",blocks:["core/video"],isMatch:e=>{let{backgroundType:t,url:n,overlayColor:o,customOverlayColor:r,gradient:a,customGradient:l}=e;return n?"video"===t:!(o||r||a||l)},transform:e=>{let{title:t,url:n,align:o,id:r,anchor:a}=e;return Object(Oe.createBlock)("core/video",{caption:t,src:n,id:r,align:o,anchor:a})}}]};const Yn={apiVersion:2,name:"core/cover",title:"Cover",category:"media",description:"Add an image or video with a text overlay — great for headers.",textdomain:"default",attributes:{url:{type:"string"},id:{type:"number"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},hasParallax:{type:"boolean",default:!1},isRepeated:{type:"boolean",default:!1},dimRatio:{type:"number",default:100},overlayColor:{type:"string"},customOverlayColor:{type:"string"},backgroundType:{type:"string",default:"image"},focalPoint:{type:"object"},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"},isDark:{type:"boolean",default:!0},allowedBlocks:{type:"array"},templateLock:{type:["string","boolean"],enum:["all","insert",!1]}},supports:{anchor:!0,align:!0,html:!1,spacing:{padding:!0,__experimentalDefaultControls:{padding:!0}},color:{__experimentalDuotone:"> .wp-block-cover__image-background, > .wp-block-cover__video-background",text:!1,background:!1}},editorStyle:"wp-block-cover-editor",style:"wp-block-cover"},{name:Xn}=Yn,eo={icon:Sn,example:{attributes:{customOverlayColor:"#065174",dimRatio:40,url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg"},innerBlocks:[{name:"core/paragraph",attributes:{customFontSize:48,content:Object(ke.__)("<strong>Snow Patrol</strong>"),align:"center"}}]},transforms:Qn,save:function(e){let{attributes:t}=e;const{backgroundType:n,gradient:o,contentPosition:r,customGradient:a,customOverlayColor:l,dimRatio:c,focalPoint:i,hasParallax:s,isDark:u,isRepeated:m,overlayColor:d,url:b,alt:p,id:g,minHeight:h,minHeightUnit:v}=t,O=Object(we.getColorClassName)("background-color",d),j=Object(we.__experimentalGetGradientClass)(o),y=v?`${h}${v}`:h,f="image"===n,_="video"===n,k=!(s||m),w={...f&&!k?Tn(b):{},minHeight:y||void 0},E={backgroundColor:O?void 0:l,background:a||void 0},C=i&&k?`${Math.round(100*i.x)}% ${Math.round(100*i.y)}%`:void 0,x=tt()({"is-light":!u,"has-parallax":s,"is-repeated":m,"has-custom-content-position":!Pn(r)},In(r));return Object(je.createElement)("div",we.useBlockProps.save({className:x,style:w}),Object(je.createElement)("span",{"aria-hidden":"true",className:tt()(O,zn(c),"wp-block-cover__gradient-background",j,{"has-background-dim":void 0!==c,"has-background-gradient":o||a,[j]:!b&&j}),style:E}),f&&k&&b&&Object(je.createElement)("img",{className:tt()("wp-block-cover__image-background",g?"wp-image-"+g:null),alt:p,src:b,style:{objectPosition:C},"data-object-fit":"cover","data-object-position":C}),_&&b&&Object(je.createElement)("video",{className:tt()("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:b,style:{objectPosition:C},"data-object-fit":"cover","data-object-position":C}),Object(je.createElement)("div",we.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})))},edit:Jn,deprecated:Vn};var to=n("B9Az");function no(e){return e?Object(ke.__)("This embed will preserve its aspect ratio when the browser is resized."):Object(ke.__)("This embed may not preserve its aspect ratio when the browser is resized.")}var oo=e=>{let{blockSupportsResponsive:t,showEditButton:n,themeSupportsResponsive:o,allowResponsive:r,toggleResponsive:a,switchBackToURLInput:l}=e;return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(_e.ToolbarGroup,null,n&&Object(je.createElement)(_e.ToolbarButton,{className:"components-toolbar__control",label:Object(ke.__)("Edit URL"),icon:to.a,onClick:l}))),o&&t&&Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Media settings"),className:"blocks-responsive"},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Resize for smaller devices"),checked:r,help:no,onChange:a}))))};const ro=Object(je.createElement)(_e.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(_e.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"})),ao=Object(je.createElement)(_e.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(_e.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"})),lo=Object(je.createElement)(_e.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(_e.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"})),co=Object(je.createElement)(_e.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(_e.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"})),io={foreground:"#1da1f2",src:Object(je.createElement)(_e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(_e.G,null,Object(je.createElement)(_e.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"})))},so={foreground:"#ff0000",src:Object(je.createElement)(_e.SVG,{viewBox:"0 0 24 24"},Object(je.createElement)(_e.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"}))},uo={foreground:"#3b5998",src:Object(je.createElement)(_e.SVG,{viewBox:"0 0 24 24"},Object(je.createElement)(_e.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"}))},mo=Object(je.createElement)(_e.SVG,{viewBox:"0 0 24 24"},Object(je.createElement)(_e.G,null,Object(je.createElement)(_e.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"}))),bo={foreground:"#0073AA",src:Object(je.createElement)(_e.SVG,{viewBox:"0 0 24 24"},Object(je.createElement)(_e.G,null,Object(je.createElement)(_e.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"})))},po={foreground:"#1db954",src:Object(je.createElement)(_e.SVG,{viewBox:"0 0 24 24"},Object(je.createElement)(_e.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"}))},go=Object(je.createElement)(_e.SVG,{viewBox:"0 0 24 24"},Object(je.createElement)(_e.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"})),ho={foreground:"#1ab7ea",src:Object(je.createElement)(_e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(_e.G,null,Object(je.createElement)(_e.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"})))},vo=Object(je.createElement)(_e.SVG,{viewBox:"0 0 24 24"},Object(je.createElement)(_e.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"})),Oo={foreground:"#35465c",src:Object(je.createElement)(_e.SVG,{viewBox:"0 0 24 24"},Object(je.createElement)(_e.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"}))},jo=Object(je.createElement)(_e.SVG,{viewBox:"0 0 24 24"},Object(je.createElement)(_e.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(je.createElement)(_e.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(je.createElement)(_e.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"})),yo=Object(je.createElement)(_e.SVG,{viewBox:"0 0 24 24"},Object(je.createElement)(_e.Path,{d:"m.0206909 21 19.8160091-13.07806 3.5831 6.20826z",fill:"#4bc7ee"}),Object(je.createElement)(_e.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(je.createElement)(_e.Path,{d:"m.0206909 21 15.2439091-16.38571 4.3029 7.32271z",fill:"#c3d82e"}),Object(je.createElement)(_e.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(je.createElement)(_e.Path,{d:"m.0206909 21 19.5468091-9.063 1.6621 2.8344z",fill:"#209dbd"}),Object(je.createElement)(_e.Path,{d:"m.0206909 21 17.9209091-11.82623 1.6259 2.76323z",fill:"#7cb3c9"})),fo=Object(je.createElement)(_e.SVG,{viewBox:"0 0 24 24"},Object(je.createElement)(_e.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"})),_o=Object(je.createElement)(_e.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(_e.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"})),ko=Object(je.createElement)(_e.SVG,{viewBox:"0 0 44 44"},Object(je.createElement)(_e.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"}));var wo=()=>Object(je.createElement)("div",{className:"wp-block-embed is-loading"},Object(je.createElement)(_e.Spinner,null),Object(je.createElement)("p",null,Object(ke.__)("Embedding…")));var Eo=e=>{let{icon:t,label:n,value:o,onSubmit:r,onChange:a,cannotEmbed:l,fallback:c,tryAgain:i}=e;return Object(je.createElement)(_e.Placeholder,{icon:Object(je.createElement)(we.BlockIcon,{icon:t,showColors:!0}),label:n,className:"wp-block-embed",instructions:Object(ke.__)("Paste a link to the content you want to display on your site.")},Object(je.createElement)("form",{onSubmit:r},Object(je.createElement)("input",{type:"url",value:o||"",className:"components-placeholder__input","aria-label":n,placeholder:Object(ke.__)("Enter URL to embed here…"),onChange:a}),Object(je.createElement)(_e.Button,{variant:"primary",type:"submit"},Object(ke._x)("Embed","button label"))),Object(je.createElement)("div",{className:"components-placeholder__learn-more"},Object(je.createElement)(_e.ExternalLink,{href:Object(ke.__)("https://wordpress.org/support/article/embeds/")},Object(ke.__)("Learn more about embeds"))),l&&Object(je.createElement)("div",{className:"components-placeholder__error"},Object(je.createElement)("div",{className:"components-placeholder__instructions"},Object(ke.__)("Sorry, this content could not be embedded.")),Object(je.createElement)(_e.Button,{variant:"secondary",onClick:i},Object(ke._x)("Try again","button label"))," ",Object(je.createElement)(_e.Button,{variant:"secondary",onClick:c},Object(ke._x)("Convert to link","button label"))))};const Co={class:"className",frameborder:"frameBorder",marginheight:"marginHeight",marginwidth:"marginWidth"};function xo(e){let{html:t}=e;const n=Object(je.useRef)(),o=Object(je.useMemo)(()=>{const e=(new window.DOMParser).parseFromString(t,"text/html").querySelector("iframe"),n={};return e?(Array.from(e.attributes).forEach(e=>{let{name:t,value:o}=e;"style"!==t&&(n[Co[t]||t]=o)}),n):n},[t]);return Object(je.useEffect)(()=>{const{ownerDocument:e}=n.current,{defaultView:t}=e;function r(e){let{data:{secret:t,message:r,value:a}={}}=e;"height"===r&&t===o["data-secret"]&&(n.current.height=a)}return t.addEventListener("message",r),()=>{t.removeEventListener("message",r)}},[]),Object(je.createElement)("div",{className:"wp-block-embed__wrapper"},Object(je.createElement)("iframe",Object(mt.a)({ref:Object(nt.useMergeRefs)([n,Object(nt.useFocusableIframe)()]),title:o.title},o)))}class So extends je.Component{constructor(){super(...arguments),this.hideOverlay=this.hideOverlay.bind(this),this.state={interactive:!1}}static getDerivedStateFromProps(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}hideOverlay(){this.setState({interactive:!0})}render(){const{preview:e,previewable:t,url:n,type:o,caption:r,onCaptionChange:a,isSelected:l,className:c,icon:i,label:s,insertBlocksAfter:u}=this.props,{scripts:m}=e,{interactive:d}=this.state,b="photo"===o?(e=>{const t=e.thumbnail_url||e.url,n=Object(je.createElement)("p",null,Object(je.createElement)("img",{src:t,alt:e.title,width:"100%"}));return Object(je.renderToString)(n)})(e):e.html,p=new URL(n).host.split("."),g=p.splice(p.length-2,p.length-1).join("."),h=Object(ke.sprintf)(Object(ke.__)("Embedded content from %s"),g),v=Le()(o,c,"wp-block-embed__wrapper"),O="wp-embed"===o?Object(je.createElement)(xo,{html:b}):Object(je.createElement)("div",{className:"wp-block-embed__wrapper"},Object(je.createElement)(_e.SandBox,{html:b,scripts:m,title:h,type:v,onFocus:this.hideOverlay}),!d&&Object(je.createElement)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}));return Object(je.createElement)("figure",{className:Le()(c,"wp-block-embed",{"is-type-video":"video"===o})},t?O:Object(je.createElement)(_e.Placeholder,{icon:Object(je.createElement)(we.BlockIcon,{icon:i,showColors:!0}),label:s},Object(je.createElement)("p",{className:"components-placeholder__error"},Object(je.createElement)("a",{href:n},n)),Object(je.createElement)("p",{className:"components-placeholder__error"},Object(ke.sprintf)(Object(ke.__)("Embedded content from %s can't be previewed in the editor."),g))),(!we.RichText.isEmpty(r)||l)&&Object(je.createElement)(we.RichText,{tagName:"figcaption",placeholder:Object(ke.__)("Add caption"),value:r,onChange:a,inlineToolbar:!0,__unstableOnSplitAtEnd:()=>u(Object(Oe.createBlock)("core/paragraph"))}))}}var Bo=So;var To=e=>{const{attributes:{providerNameSlug:t,previewable:n,responsive:o,url:r},attributes:a,isSelected:l,onReplace:c,setAttributes:i,insertBlocksAfter:s,onFocus:u}=e,m={title:Object(ke._x)("Embed","block title"),icon:ro},{icon:d,title:b}=(p=t,(null===(g=Object(Oe.getBlockVariations)(Ae))||void 0===g?void 0:g.find(e=>{let{name:t}=e;return t===p}))||m);var p,g;const[h,v]=Object(je.useState)(r),[O,j]=Object(je.useState)(!1),{invalidateResolution:y}=Object(Pe.useDispatch)(It.store),{preview:f,fetching:_,themeSupportsResponsive:k,cannotEmbed:w}=Object(Pe.useSelect)(e=>{var t;const{getEmbedPreview:n,isPreviewEmbedFallback:o,isRequestingEmbedPreview:a,getThemeSupports:l}=e(It.store);if(!r)return{fetching:!1,cannotEmbed:!1};const c=n(r),i=o(r),s=!1===(null==c?void 0:c.html)&&void 0===(null==c?void 0:c.type),u=404===(null==c||null===(t=c.data)||void 0===t?void 0:t.status),m=!!c&&!s&&!u;return{preview:m?c:void 0,fetching:a(r),themeSupportsResponsive:l()["responsive-embeds"],cannotEmbed:!m||i}},[r]),E=()=>{const{allowResponsive:e,className:t}=a;return{...a,...We(f,b,t,o,e)}};Object(je.useEffect)(()=>{if(null==f||!f.html||!w||_)return;const e=r.replace(/\/$/,"");v(e),j(!1),i({url:e})},[null==f?void 0:f.html,r]),Object(je.useEffect)(()=>{if(f&&!O&&(i(E()),c)){const t=Ge(e,E());t&&c(t)}},[f,O]);const C=Object(we.useBlockProps)();if(_)return Object(je.createElement)(ye.View,C,Object(je.createElement)(wo,null));const x=Object(ke.sprintf)(Object(ke.__)("%s URL"),b);if(!f||w||O)return Object(je.createElement)(ye.View,C,Object(je.createElement)(Eo,{icon:d,label:x,onFocus:u,onSubmit:e=>{e&&e.preventDefault(),j(!1),i({url:h})},value:h,cannotEmbed:w,onChange:e=>v(e.target.value),fallback:()=>function(e,t){const n=Object(je.createElement)("a",{href:e},e);t(Object(Oe.createBlock)("core/paragraph",{content:Object(je.renderToString)(n)}))}(h,c),tryAgain:()=>{y("getEmbedPreview",[h])}}));const{caption:S,type:B,allowResponsive:T,className:N}=E(),z=tt()(N,e.className);return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(oo,{showEditButton:f&&!w,themeSupportsResponsive:k,blockSupportsResponsive:o,allowResponsive:T,toggleResponsive:()=>{const{allowResponsive:e,className:t}=a,{html:n}=f,r=!e;i({allowResponsive:r,className:qe(n,t,o&&r)})},switchBackToURLInput:()=>j(!0)}),Object(je.createElement)(ye.View,C,Object(je.createElement)(Bo,{preview:f,previewable:n,className:z,url:h,type:B,caption:S,onCaptionChange:e=>i({caption:e}),isSelected:l,icon:d,label:x,insertBlocksAfter:s})))};const{name:No}={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"};var zo={from:[{type:"raw",isMatch:e=>{var t,n;return"P"===e.nodeName&&/^\s*(https?:\/\/\S+)\s*$/i.test(e.textContent)&&1===(null===(t=e.textContent)||void 0===t||null===(n=t.match(/https/gi))||void 0===n?void 0:n.length)},transform:e=>Object(Oe.createBlock)(No,{url:e.textContent.trim()})}],to:[{type:"block",blocks:["core/paragraph"],isMatch:e=>{let{url:t}=e;return!!t},transform:e=>{let{url:t,caption:n}=e,o=`<a href="${t}">${t}</a>`;return null!=n&&n.trim()&&(o+="<br />"+n),Object(Oe.createBlock)("core/paragraph",{content:o})}}]};const Po=[{name:"twitter",title:"Twitter",icon:io,keywords:["tweet",Object(ke.__)("social")],description:Object(ke.__)("Embed a tweet."),patterns:[/^https?:\/\/(www\.)?twitter\.com\/.+/i],attributes:{providerNameSlug:"twitter",responsive:!0}},{name:"youtube",title:"YouTube",icon:so,keywords:[Object(ke.__)("music"),Object(ke.__)("video")],description:Object(ke.__)("Embed a YouTube video."),patterns:[/^https?:\/\/((m|www)\.)?youtube\.com\/.+/i,/^https?:\/\/youtu\.be\/.+/i],attributes:{providerNameSlug:"youtube",responsive:!0}},{name:"facebook",title:"Facebook",icon:uo,keywords:[Object(ke.__)("social")],description:Object(ke.__)("Embed a Facebook post."),scope:["block"],patterns:[],attributes:{providerNameSlug:"facebook",previewable:!1,responsive:!0}},{name:"instagram",title:"Instagram",icon:mo,keywords:[Object(ke.__)("image"),Object(ke.__)("social")],description:Object(ke.__)("Embed an Instagram post."),scope:["block"],patterns:[],attributes:{providerNameSlug:"instagram",responsive:!0}},{name:"wordpress",title:"WordPress",icon:bo,keywords:[Object(ke.__)("post"),Object(ke.__)("blog")],description:Object(ke.__)("Embed a WordPress post."),attributes:{providerNameSlug:"wordpress"}},{name:"soundcloud",title:"SoundCloud",icon:ao,keywords:[Object(ke.__)("music"),Object(ke.__)("audio")],description:Object(ke.__)("Embed SoundCloud content."),patterns:[/^https?:\/\/(www\.)?soundcloud\.com\/.+/i],attributes:{providerNameSlug:"soundcloud",responsive:!0}},{name:"spotify",title:"Spotify",icon:po,keywords:[Object(ke.__)("music"),Object(ke.__)("audio")],description:Object(ke.__)("Embed Spotify content."),patterns:[/^https?:\/\/(open|play)\.spotify\.com\/.+/i],attributes:{providerNameSlug:"spotify",responsive:!0}},{name:"flickr",title:"Flickr",icon:go,keywords:[Object(ke.__)("image")],description:Object(ke.__)("Embed Flickr content."),patterns:[/^https?:\/\/(www\.)?flickr\.com\/.+/i,/^https?:\/\/flic\.kr\/.+/i],attributes:{providerNameSlug:"flickr",responsive:!0}},{name:"vimeo",title:"Vimeo",icon:ho,keywords:[Object(ke.__)("video")],description:Object(ke.__)("Embed a Vimeo video."),patterns:[/^https?:\/\/(www\.)?vimeo\.com\/.+/i],attributes:{providerNameSlug:"vimeo",responsive:!0}},{name:"animoto",title:"Animoto",icon:yo,description:Object(ke.__)("Embed an Animoto video."),patterns:[/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i],attributes:{providerNameSlug:"animoto",responsive:!0}},{name:"cloudup",title:"Cloudup",icon:ro,description:Object(ke.__)("Embed Cloudup content."),patterns:[/^https?:\/\/cloudup\.com\/.+/i],attributes:{providerNameSlug:"cloudup",responsive:!0}},{name:"collegehumor",title:"CollegeHumor",icon:co,description:Object(ke.__)("Embed CollegeHumor content."),scope:["block"],patterns:[],attributes:{providerNameSlug:"collegehumor",responsive:!0}},{name:"crowdsignal",title:"Crowdsignal",icon:ro,keywords:["polldaddy",Object(ke.__)("survey")],description:Object(ke.__)("Embed Crowdsignal (formerly Polldaddy) content."),patterns:[/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.survey\.fm)\/.+/i],attributes:{providerNameSlug:"crowdsignal",responsive:!0}},{name:"dailymotion",title:"Dailymotion",icon:fo,keywords:[Object(ke.__)("video")],description:Object(ke.__)("Embed a Dailymotion video."),patterns:[/^https?:\/\/(www\.)?dailymotion\.com\/.+/i],attributes:{providerNameSlug:"dailymotion",responsive:!0}},{name:"imgur",title:"Imgur",icon:lo,description:Object(ke.__)("Embed Imgur content."),patterns:[/^https?:\/\/(.+\.)?imgur\.com\/.+/i],attributes:{providerNameSlug:"imgur",responsive:!0}},{name:"issuu",title:"Issuu",icon:ro,description:Object(ke.__)("Embed Issuu content."),patterns:[/^https?:\/\/(www\.)?issuu\.com\/.+/i],attributes:{providerNameSlug:"issuu",responsive:!0}},{name:"kickstarter",title:"Kickstarter",icon:ro,description:Object(ke.__)("Embed Kickstarter content."),patterns:[/^https?:\/\/(www\.)?kickstarter\.com\/.+/i,/^https?:\/\/kck\.st\/.+/i],attributes:{providerNameSlug:"kickstarter",responsive:!0}},{name:"mixcloud",title:"Mixcloud",icon:ao,keywords:[Object(ke.__)("music"),Object(ke.__)("audio")],description:Object(ke.__)("Embed Mixcloud content."),patterns:[/^https?:\/\/(www\.)?mixcloud\.com\/.+/i],attributes:{providerNameSlug:"mixcloud",responsive:!0}},{name:"reddit",title:"Reddit",icon:vo,description:Object(ke.__)("Embed a Reddit thread."),patterns:[/^https?:\/\/(www\.)?reddit\.com\/.+/i],attributes:{providerNameSlug:"reddit",responsive:!0}},{name:"reverbnation",title:"ReverbNation",icon:ao,description:Object(ke.__)("Embed ReverbNation content."),patterns:[/^https?:\/\/(www\.)?reverbnation\.com\/.+/i],attributes:{providerNameSlug:"reverbnation",responsive:!0}},{name:"screencast",title:"Screencast",icon:co,description:Object(ke.__)("Embed Screencast content."),patterns:[/^https?:\/\/(www\.)?screencast\.com\/.+/i],attributes:{providerNameSlug:"screencast",responsive:!0}},{name:"scribd",title:"Scribd",icon:ro,description:Object(ke.__)("Embed Scribd content."),patterns:[/^https?:\/\/(www\.)?scribd\.com\/.+/i],attributes:{providerNameSlug:"scribd",responsive:!0}},{name:"slideshare",title:"Slideshare",icon:ro,description:Object(ke.__)("Embed Slideshare content."),patterns:[/^https?:\/\/(.+?\.)?slideshare\.net\/.+/i],attributes:{providerNameSlug:"slideshare",responsive:!0}},{name:"smugmug",title:"SmugMug",icon:lo,description:Object(ke.__)("Embed SmugMug content."),patterns:[/^https?:\/\/(.+\.)?smugmug\.com\/.*/i],attributes:{providerNameSlug:"smugmug",previewable:!1,responsive:!0}},{name:"speaker-deck",title:"Speaker Deck",icon:ro,description:Object(ke.__)("Embed Speaker Deck content."),patterns:[/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i],attributes:{providerNameSlug:"speaker-deck",responsive:!0}},{name:"tiktok",title:"TikTok",icon:co,keywords:[Object(ke.__)("video")],description:Object(ke.__)("Embed a TikTok video."),patterns:[/^https?:\/\/(www\.)?tiktok\.com\/.+/i],attributes:{providerNameSlug:"tiktok",responsive:!0}},{name:"ted",title:"TED",icon:co,description:Object(ke.__)("Embed a TED video."),patterns:[/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i],attributes:{providerNameSlug:"ted",responsive:!0}},{name:"tumblr",title:"Tumblr",icon:Oo,keywords:[Object(ke.__)("social")],description:Object(ke.__)("Embed a Tumblr post."),patterns:[/^https?:\/\/(www\.)?tumblr\.com\/.+/i],attributes:{providerNameSlug:"tumblr",responsive:!0}},{name:"videopress",title:"VideoPress",icon:co,keywords:[Object(ke.__)("video")],description:Object(ke.__)("Embed a VideoPress video."),patterns:[/^https?:\/\/videopress\.com\/.+/i],attributes:{providerNameSlug:"videopress",responsive:!0}},{name:"wordpress-tv",title:"WordPress.tv",icon:co,description:Object(ke.__)("Embed a WordPress.tv video."),patterns:[/^https?:\/\/wordpress\.tv\/.+/i],attributes:{providerNameSlug:"wordpress-tv",responsive:!0}},{name:"amazon-kindle",title:"Amazon Kindle",icon:jo,keywords:[Object(ke.__)("ebook")],description:Object(ke.__)("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"}},{name:"pinterest",title:"Pinterest",icon:_o,keywords:[Object(ke.__)("social"),Object(ke.__)("bookmark")],description:Object(ke.__)("Embed Pinterest pins, boards, and profiles."),patterns:[/^https?:\/\/([a-z]{2}|www)\.pinterest\.com(\.(au|mx))?\/.*/i],attributes:{providerNameSlug:"pinterest"}},{name:"wolfram-cloud",title:"Wolfram Cloud",icon:ko,description:Object(ke.__)("Embed Wolfram Cloud notebook content."),patterns:[/^https?:\/\/(www\.)?wolframcloud\.com\/obj\/.+/i],attributes:{providerNameSlug:"wolfram-cloud",responsive:!0}}];Po.forEach(e=>{e.isActive||(e.isActive=(e,t)=>e.providerNameSlug===t.providerNameSlug)});var Io=Po;const{attributes:Mo}={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"};var Ro=[{attributes:Mo,save(e){let{attributes:{url:t,caption:n,type:o,providerNameSlug:r}}=e;if(!t)return null;const a=tt()("wp-block-embed",{["is-type-"+o]:o,["is-provider-"+r]:r});return Object(je.createElement)("figure",{className:a},`\n${t}\n`,!we.RichText.isEmpty(n)&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",value:n}))}}];const Lo={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},{name:Vo}=Lo,Ho={icon:ro,edit:To,save:function(e){let{attributes:t}=e;const{url:n,caption:o,type:r,providerNameSlug:a}=t;if(!n)return null;const l=Le()("wp-block-embed",{["is-type-"+r]:r,["is-provider-"+a]:a,["wp-block-embed-"+a]:a});return Object(je.createElement)("figure",we.useBlockProps.save({className:l}),Object(je.createElement)("div",{className:"wp-block-embed__wrapper"},`\n${n}\n`),!we.RichText.isEmpty(o)&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",value:o}))},transforms:zo,variations:Io,deprecated:Ro};var Ao=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.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"}));var Fo=[{attributes:{id:{type:"number"},href:{type:"string"},fileName:{type:"string",source:"html",selector:"a:not([download])"},textLinkHref:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"href"},textLinkTarget:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"target"},showDownloadButton:{type:"boolean",default:!0},downloadButtonText:{type:"string",source:"html",selector:"a[download]"},displayPreview:{type:"boolean"},previewHeight:{type:"number",default:600}},supports:{anchor:!0,align:!0},save(e){let{attributes:t}=e;const{href:n,fileName:o,textLinkHref:r,textLinkTarget:a,showDownloadButton:l,downloadButtonText:c,displayPreview:i,previewHeight:s}=t,u=we.RichText.isEmpty(o)?Object(ke.__)("PDF embed"):Object(ke.sprintf)(Object(ke.__)("Embed of %s."),o);return n&&Object(je.createElement)("div",we.useBlockProps.save(),i&&Object(je.createElement)(je.Fragment,null,Object(je.createElement)("object",{className:"wp-block-file__embed",data:n,type:"application/pdf",style:{width:"100%",height:s+"px"},"aria-label":u})),!we.RichText.isEmpty(o)&&Object(je.createElement)("a",{href:r,target:a,rel:a?"noreferrer noopener":void 0},Object(je.createElement)(we.RichText.Content,{value:o})),l&&Object(je.createElement)("a",{href:n,className:"wp-block-file__button",download:!0},Object(je.createElement)(we.RichText.Content,{value:c})))}}],Do=n("onLe");function Go(e){let{hrefs:t,openInNewWindow:n,showDownloadButton:o,changeLinkDestinationOption:r,changeOpenInNewWindow:a,changeShowDownloadButton:l,displayPreview:c,changeDisplayPreview:i,previewHeight:s,changePreviewHeight:u}=e;const{href:m,textLinkHref:d,attachmentPage:b}=t;let p=[{value:m,label:Object(ke.__)("URL")}];return b&&(p=[{value:m,label:Object(ke.__)("Media file")},{value:b,label:Object(ke.__)("Attachment page")}]),Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.InspectorControls,null,m.endsWith(".pdf")&&Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("PDF settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Show inline embed"),help:c?Object(ke.__)("Note: Most phone and tablet browsers won't display embedded PDFs."):null,checked:!!c,onChange:i}),c&&Object(je.createElement)(_e.RangeControl,{label:Object(ke.__)("Height in pixels"),min:Wo,max:Math.max($o,s),value:s,onChange:u})),Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Text link settings")},Object(je.createElement)(_e.SelectControl,{label:Object(ke.__)("Link to"),value:d,options:p,onChange:r}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Open in new tab"),checked:n,onChange:a})),Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Download button settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Show download button"),checked:o,onChange:l}))))}const Uo=()=>!(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)&&!qo("AcroPDF.PDF")&&!qo("PDF.PdfCtrl")))),qo=e=>{let t;try{t=new window.ActiveXObject(e)}catch(e){t=void 0}return t},Wo=200,$o=2e3;function Zo(e){let{text:t,disabled:n}=e;const{createNotice:o}=Object(Pe.useDispatch)(Do.store),r=Object(nt.useCopyToClipboard)(t,()=>{o("info",Object(ke.__)("Copied URL to clipboard."),{isDismissible:!0,type:"snackbar"})});return Object(je.createElement)(_e.ToolbarButton,{className:"components-clipboard-toolbar-button",ref:r,disabled:n},Object(ke.__)("Copy URL"))}var Ko=Object(_e.withNotices)((function(e){let{attributes:t,isSelected:n,setAttributes:o,noticeUI:r,noticeOperations:a,clientId:l}=e;const{id:c,fileName:i,href:s,textLinkHref:u,textLinkTarget:m,showDownloadButton:d,downloadButtonText:b,displayPreview:p,previewHeight:g}=t,[h,v]=Object(je.useState)(!1),{media:O,mediaUpload:j}=Object(Pe.useSelect)(e=>({media:void 0===c?void 0:e(It.store).getMedia(c),mediaUpload:e(we.store).getSettings().mediaUpload}),[c]),{toggleSelection:y}=Object(Pe.useDispatch)(we.store);function f(e){if(e&&e.url){v(!1);const t=e.url.endsWith(".pdf");o({href:e.url,fileName:e.title,textLinkHref:e.url,id:e.id,displayPreview:!!t||void 0,previewHeight:t?600:void 0})}}function _(e){v(!0),a.removeAllNotices(),a.createErrorNotice(e)}function k(e){o({downloadButtonText:e.replace(/<\/?a[^>]*>/g,"")})}Object(je.useEffect)(()=>{if(Object(ze.isBlobURL)(s)){const e=Object(ze.getBlobByURL)(s);j({filesList:[e],onFileChange:e=>{let[t]=e;return f(t)},onError:e=>{v(!0),a.createErrorNotice(e)}}),Object(ze.revokeBlobURL)(s)}void 0===b&&k(Object(ke._x)("Download","button label"))},[]),Object(je.useEffect)(()=>{o({fileId:"wp-block-file--media-"+l})},[l]);const w=O&&O.link,E=Object(we.useBlockProps)({className:tt()(Object(ze.isBlobURL)(s)&&Object(_e.__unstableGetAnimateClassName)({type:"loading"}),{"is-transient":Object(ze.isBlobURL)(s)})}),C=Uo()&&p;return!s||h?Object(je.createElement)("div",E,Object(je.createElement)(we.MediaPlaceholder,{icon:Object(je.createElement)(we.BlockIcon,{icon:Ao}),labels:{title:Object(ke.__)("File"),instructions:Object(ke.__)("Upload a file or pick one from your media library.")},onSelect:f,notices:r,onError:_,accept:"*"})):Object(je.createElement)(je.Fragment,null,Object(je.createElement)(Go,{hrefs:{href:s,textLinkHref:u,attachmentPage:w},openInNewWindow:!!m,showDownloadButton:d,changeLinkDestinationOption:function(e){o({textLinkHref:e})},changeOpenInNewWindow:function(e){o({textLinkTarget:!!e&&"_blank"})},changeShowDownloadButton:function(e){o({showDownloadButton:e})},displayPreview:p,changeDisplayPreview:function(e){o({displayPreview:e})},previewHeight:g,changePreviewHeight:function(e){const t=Math.max(parseInt(e,10),Wo);o({previewHeight:t})}}),Object(je.createElement)(we.BlockControls,{group:"other"},Object(je.createElement)(we.MediaReplaceFlow,{mediaId:c,mediaURL:s,accept:"*",onSelect:f,onError:_}),Object(je.createElement)(Zo,{text:s,disabled:Object(ze.isBlobURL)(s)})),Object(je.createElement)("div",E,C&&Object(je.createElement)(_e.ResizableBox,{size:{height:g},minHeight:Wo,maxHeight:$o,minWidth:"100%",grid:[10,10],enable:{top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},onResizeStart:()=>y(!1),onResizeStop:function(e,t,n,r){y(!0);const a=parseInt(g+r.height,10);o({previewHeight:a})},showHandle:n},Object(je.createElement)("object",{className:"wp-block-file__preview",data:s,type:"application/pdf","aria-label":Object(ke.__)("Embed of the selected PDF file.")}),!n&&Object(je.createElement)("div",{className:"wp-block-file__preview-overlay"})),Object(je.createElement)("div",{className:"wp-block-file__content-wrapper"},Object(je.createElement)(we.RichText,{tagName:"a",value:i,placeholder:Object(ke.__)("Write file name…"),withoutInteractiveFormatting:!0,onChange:e=>o({fileName:e}),href:u}),d&&Object(je.createElement)("div",{className:"wp-block-file__button-richtext-wrapper"},Object(je.createElement)(we.RichText,{tagName:"div","aria-label":Object(ke.__)("Download button text"),className:"wp-block-file__button",value:b,withoutInteractiveFormatting:!0,placeholder:Object(ke.__)("Add text…"),onChange:e=>k(e)})))))}));var Jo=n("Mmq9");var Qo={from:[{type:"files",isMatch:e=>e.length>0,priority:15,transform:e=>{const t=[];return e.forEach(e=>{const n=Object(ze.createBlobURL)(e);t.push(Object(Oe.createBlock)("core/file",{href:n,fileName:e.name,textLinkHref:n}))}),t}},{type:"block",blocks:["core/audio"],transform:e=>Object(Oe.createBlock)("core/file",{href:e.src,fileName:e.caption,textLinkHref:e.src,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/video"],transform:e=>Object(Oe.createBlock)("core/file",{href:e.src,fileName:e.caption,textLinkHref:e.src,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/image"],transform:e=>Object(Oe.createBlock)("core/file",{href:e.url,fileName:e.caption||Object(Jo.getFilename)(e.url),textLinkHref:e.url,id:e.id,anchor:e.anchor})}],to:[{type:"block",blocks:["core/audio"],isMatch:e=>{let{id:t}=e;if(!t)return!1;const{getMedia:n}=Object(Pe.select)(It.store),o=n(t);return!!o&&Object(Me.includes)(o.mime_type,"audio")},transform:e=>Object(Oe.createBlock)("core/audio",{src:e.href,caption:e.fileName,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/video"],isMatch:e=>{let{id:t}=e;if(!t)return!1;const{getMedia:n}=Object(Pe.select)(It.store),o=n(t);return!!o&&Object(Me.includes)(o.mime_type,"video")},transform:e=>Object(Oe.createBlock)("core/video",{src:e.href,caption:e.fileName,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/image"],isMatch:e=>{let{id:t}=e;if(!t)return!1;const{getMedia:n}=Object(Pe.select)(It.store),o=n(t);return!!o&&Object(Me.includes)(o.mime_type,"image")},transform:e=>Object(Oe.createBlock)("core/image",{url:e.href,caption:e.fileName,id:e.id,anchor:e.anchor})}]};const Yo={apiVersion:2,name:"core/file",title:"File",category:"media",description:"Add a link to a downloadable file.",keywords:["document","pdf","download"],textdomain:"default",attributes:{id:{type:"number"},href:{type:"string"},fileId:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"id"},fileName:{type:"string",source:"html",selector:"a:not([download])"},textLinkHref:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"href"},textLinkTarget:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"target"},showDownloadButton:{type:"boolean",default:!0},downloadButtonText:{type:"string",source:"html",selector:"a[download]"},displayPreview:{type:"boolean"},previewHeight:{type:"number",default:600}},supports:{anchor:!0,align:!0},viewScript:"file:./view.min.js",editorStyle:"wp-block-file-editor",style:"wp-block-file"},{name:Xo}=Yo,er={icon:Ao,example:{attributes:{href:"https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg",fileName:Object(ke._x)("Armstrong_Small_Step","Name of the file")}},transforms:Qo,deprecated:Fo,edit:Ko,save:function(e){let{attributes:t}=e;const{href:n,fileId:o,fileName:r,textLinkHref:a,textLinkTarget:l,showDownloadButton:c,downloadButtonText:i,displayPreview:s,previewHeight:u}=t,m=we.RichText.isEmpty(r)?Object(ke.__)("PDF embed"):Object(ke.sprintf)(Object(ke.__)("Embed of %s."),r);return n&&Object(je.createElement)("div",we.useBlockProps.save(),s&&Object(je.createElement)(je.Fragment,null,Object(je.createElement)("object",{className:"wp-block-file__embed",data:n,type:"application/pdf",style:{width:"100%",height:u+"px"},"aria-label":m})),!we.RichText.isEmpty(r)&&Object(je.createElement)("a",{id:o,href:a,target:l,rel:l?"noreferrer noopener":void 0},Object(je.createElement)(we.RichText.Content,{value:r})),c&&Object(je.createElement)("a",{href:n,className:"wp-block-file__button",download:!0,"aria-describedby":o},Object(je.createElement)(we.RichText.Content,{value:i})))}};var tr=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.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"}));const nr=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"large";const n=Object(Me.pick)(e,["alt","id","link","caption"]);n.url=Object(Me.get)(e,["sizes",t,"url"])||Object(Me.get)(e,["media_details","sizes",t,"source_url"])||e.url;const o=Object(Me.get)(e,["sizes","full","url"])||Object(Me.get)(e,["media_details","sizes","full","source_url"]);return o&&(n.fullUrl=o),n};function or(e){var t;return Math.min(3,null==e||null===(t=e.images)||void 0===t?void 0:t.length)}function rr(e,t){switch(t){case"file":return{href:(null==e?void 0:e.source_url)||(null==e?void 0:e.url),linkDestination:"media"};case"post":return{href:null==e?void 0:e.link,linkDestination:"attachment"};case"media":return{href:(null==e?void 0:e.source_url)||(null==e?void 0:e.url),linkDestination:"media"};case"attachment":return{href:null==e?void 0:e.link,linkDestination:"attachment"};case"none":return{href:void 0,linkDestination:"none"}}return{}}function ar(e){let t=e.linkTo?e.linkTo:"none";"post"===t?t="attachment":"file"===t&&(t="media");const n=e.images.map(n=>function(e,t,n){return Object(Oe.createBlock)("core/image",{...e.id&&{id:parseInt(e.id)},url:e.url,alt:e.alt,caption:e.caption,sizeSlug:t,...rr(e,n)})}(n,e.sizeSlug,t));return[{...Object(Me.omit)(e,["images","ids"]),linkTo:t,allowResize:!1},n]}var lr=[{attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string"},sizeSlug:{type:"string",default:"large"}},supports:{anchor:!0,align:!0},save(e){let{attributes:t}=e;const{images:n,columns:o=or(t),imageCrop:r,caption:a,linkTo:l}=t,c=`columns-${o} ${r?"is-cropped":""}`;return Object(je.createElement)("figure",we.useBlockProps.save({className:c}),Object(je.createElement)("ul",{className:"blocks-gallery-grid"},n.map(e=>{let t;switch(l){case"file":t=e.fullUrl||e.url;break;case"post":t=e.link}const n=Object(je.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?"wp-image-"+e.id:null});return Object(je.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(je.createElement)("figure",null,t?Object(je.createElement)("a",{href:t},n):n,!we.RichText.isEmpty(e.caption)&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})))})),!we.RichText.isEmpty(a)&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:a}))},migrate:e=>ar(e)},{attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"},sizeSlug:{type:"string",default:"large"}},supports:{align:!0},isEligible(e){let{linkTo:t}=e;return!t||"attachment"===t||"media"===t},migrate:e=>ar(e),save(e){let{attributes:t}=e;const{images:n,columns:o=or(t),imageCrop:r,caption:a,linkTo:l}=t;return Object(je.createElement)("figure",{className:`columns-${o} ${r?"is-cropped":""}`},Object(je.createElement)("ul",{className:"blocks-gallery-grid"},n.map(e=>{let t;switch(l){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const n=Object(je.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?"wp-image-"+e.id:null});return Object(je.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(je.createElement)("figure",null,t?Object(je.createElement)("a",{href:t},n):n,!we.RichText.isEmpty(e.caption)&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})))})),!we.RichText.isEmpty(a)&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:a}))}},{attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},fullUrl:{source:"attribute",selector:"img",attribute:"data-full-url"},link:{source:"attribute",selector:"img",attribute:"data-link"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",default:[]},columns:{type:"number"},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},supports:{align:!0},isEligible(e){let{ids:t}=e;return t&&t.some(e=>"string"==typeof e)},migrate:e=>ar(e),save(e){let{attributes:t}=e;const{images:n,columns:o=or(t),imageCrop:r,caption:a,linkTo:l}=t;return Object(je.createElement)("figure",{className:`columns-${o} ${r?"is-cropped":""}`},Object(je.createElement)("ul",{className:"blocks-gallery-grid"},n.map(e=>{let t;switch(l){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const n=Object(je.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?"wp-image-"+e.id:null});return Object(je.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(je.createElement)("figure",null,t?Object(je.createElement)("a",{href:t},n):n,!we.RichText.isEmpty(e.caption)&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})))})),!we.RichText.isEmpty(a)&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:a}))}},{attributes:{images:{type:"array",default:[],source:"query",selector:"ul.wp-block-gallery .blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},fullUrl:{source:"attribute",selector:"img",attribute:"data-full-url"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},link:{source:"attribute",selector:"img",attribute:"data-link"},caption:{type:"array",source:"children",selector:"figcaption"}}},ids:{type:"array",default:[]},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},supports:{align:!0},save(e){let{attributes:t}=e;const{images:n,columns:o=or(t),imageCrop:r,linkTo:a}=t;return Object(je.createElement)("ul",{className:`columns-${o} ${r?"is-cropped":""}`},n.map(e=>{let t;switch(a){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const n=Object(je.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?"wp-image-"+e.id:null});return Object(je.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(je.createElement)("figure",null,t?Object(je.createElement)("a",{href:t},n):n,e.caption&&e.caption.length>0&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",value:e.caption})))}))},migrate:e=>ar(e)},{attributes:{images:{type:"array",default:[],source:"query",selector:"ul.wp-block-gallery .blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},link:{source:"attribute",selector:"img",attribute:"data-link"},caption:{type:"array",source:"children",selector:"figcaption"}}},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},isEligible(e){let{images:t,ids:n}=e;return t&&t.length>0&&(!n&&t||n&&t&&n.length!==t.length||Object(Me.some)(t,(e,t)=>!e&&null!==n[t]||parseInt(e,10)!==n[t]))},migrate:e=>ar(e),supports:{align:!0},save(e){let{attributes:t}=e;const{images:n,columns:o=or(t),imageCrop:r,linkTo:a}=t;return Object(je.createElement)("ul",{className:`columns-${o} ${r?"is-cropped":""}`},n.map(e=>{let t;switch(a){case"media":t=e.url;break;case"attachment":t=e.link}const n=Object(je.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-link":e.link,className:e.id?"wp-image-"+e.id:null});return Object(je.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},Object(je.createElement)("figure",null,t?Object(je.createElement)("a",{href:t},n):n,e.caption&&e.caption.length>0&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",value:e.caption})))}))}},{attributes:{images:{type:"array",default:[],source:"query",selector:"div.wp-block-gallery figure.blocks-gallery-image img",query:{url:{source:"attribute",attribute:"src"},alt:{source:"attribute",attribute:"alt",default:""},id:{source:"attribute",attribute:"data-id"}}},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"},align:{type:"string",default:"none"}},supports:{align:!0},save(e){let{attributes:t}=e;const{images:n,columns:o=or(t),align:r,imageCrop:a,linkTo:l}=t,c=tt()("columns-"+o,{alignnone:"none"===r,"is-cropped":a});return Object(je.createElement)("div",{className:c},n.map(e=>{let t;switch(l){case"media":t=e.url;break;case"attachment":t=e.link}const n=Object(je.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id});return Object(je.createElement)("figure",{key:e.id||e.url,className:"blocks-gallery-image"},t?Object(je.createElement)("a",{href:t},n):n)}))},migrate:e=>ar(e)}],cr=n("KEfo");const ir=Object(je.createElement)(we.BlockIcon,{icon:tr}),sr=["noreferrer","noopener"],ur=["image"];function mr(e,t){switch(t){case"file":case"media":return{href:(null==e?void 0:e.source_url)||(null==e?void 0:e.url),linkDestination:"media"};case"post":case"attachment":return{href:null==e?void 0:e.link,linkDestination:"attachment"};case"none":return{href:void 0,linkDestination:"none"}}return{}}function dr(e,t){let{rel:n}=t;const o=e?"_blank":void 0;let r;return r=o||n?function(e){let t=e;return void 0===e||Object(Me.isEmpty)(t)||Object(Me.isEmpty)(t)||(Object(Me.each)(sr,e=>{const n=new RegExp("\\b"+e+"\\b","gi");t=t.replace(n,"")}),t!==e&&(t=t.trim()),Object(Me.isEmpty)(t)&&(t=void 0)),t}(n):void 0,{linkTarget:o,rel:r}}const br=["core/image"];function pr(e){let{isHidden:t,captionFocused:n,onFocusCaption:o,className:r,value:a,placeholder:l,tagName:c,captionRef:i,...s}=e;return t?Object(je.createElement)(_e.VisuallyHidden,Object(mt.a)({as:we.RichText},s)):Object(je.createElement)(we.RichText,Object(mt.a)({ref:i,value:a,placeholder:l,className:r,tagName:c,isSelected:n,onClick:o},s))}var gr=e=>{const{attributes:t,isSelected:n,setAttributes:o,mediaPlaceholder:r,insertBlocksAfter:a,blockProps:l}=e,{align:c,columns:i,caption:s,imageCrop:u}=t,{children:m,...d}=Object(we.useInnerBlocksProps)(l,{allowedBlocks:br,orientation:"horizontal",renderAppender:!1,__experimentalLayout:{type:"default",alignments:[]}}),[b,p]=Object(je.useState)(!1);return Object(je.useEffect)(()=>{n||p(!1)},[n]),Object(je.createElement)("figure",Object(mt.a)({},d,{className:tt()(l.className,"blocks-gallery-grid",{["align"+c]:c,["columns-"+i]:void 0!==i,"columns-default":void 0===i,"is-cropped":u})}),m,Object(je.createElement)(ye.View,{className:"blocks-gallery-media-placeholder-wrapper",onClick:function(){b&&p(!1)}},r),Object(je.createElement)(pr,{isHidden:!n&&we.RichText.isEmpty(s),captionFocused:b,onFocusCaption:function(){b||p(!0)},tagName:"figcaption",className:"blocks-gallery-caption","aria-label":Object(ke.__)("Gallery caption text"),placeholder:Object(ke.__)("Write gallery caption…"),value:s,onChange:e=>o({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>a(Object(Oe.createBlock)("core/paragraph"))}))};function hr(e,t,n){return Object(je.useMemo)(()=>function(){if(!e||0===e.length)return;const{imageSizes:o}=n();let r={};t&&(r=e.reduce((e,t)=>{if(!t.id)return e;const n=o.reduce((e,n)=>{const o=Object(Me.get)(t,["sizes",n.slug,"url"]),r=Object(Me.get)(t,["media_details","sizes",n.slug,"source_url"]);return{...e,[n.slug]:o||r}},{});return{...e,[parseInt(t.id,10)]:n}},{}));return o.filter(e=>{let{slug:t}=e;return Object(Me.some)(r,e=>e[t])}).map(e=>{let{name:t,slug:n}=e;return{value:n,label:t}})}(),[e,t])}function vr(e,t){const[n,o]=Object(je.useState)([]);return Object(je.useMemo)(()=>function(){let r=!1;const a=n.filter(t=>e.find(e=>t.clientId===e.clientId));a.length<n.length&&(r=!0);e.forEach(e=>{e.fromSavedContent&&!a.find(t=>t.id===e.id)&&(r=!0,a.push(e))});const l=e.filter(e=>!a.find(t=>e.clientId&&t.clientId===e.clientId)&&(null==t?void 0:t.find(t=>t.id===e.id))&&!e.fromSavedConent);(r||(null==l?void 0:l.length)>0)&&o([...a,...l]);return l.length>0?l:null}(),[e,t])}const Or=[{value:"attachment",label:Object(ke.__)("Attachment Page")},{value:"media",label:Object(ke.__)("Media File")},{value:"none",label:Object(ke._x)("None","Media item link option")}],jr=["image"],yr=je.Platform.isNative?Object(ke.__)("ADD MEDIA"):Object(ke.__)("Drag images, upload new ones or select files from your library."),fr=je.Platform.isNative?{type:"stepper"}:{};var _r=Object(nt.compose)([_e.withNotices,Object(cr.withViewportMatch)({isNarrow:"< small"})])((function(e){const{setAttributes:t,attributes:n,className:o,clientId:r,noticeOperations:a,isSelected:l,noticeUI:c,insertBlocksAfter:i}=e,{columns:s,imageCrop:u,linkTarget:m,linkTo:d,shortCodeTransforms:b,sizeSlug:p}=n,{__unstableMarkNextChangeAsNotPersistent:g,replaceInnerBlocks:h,updateBlockAttributes:v}=Object(Pe.useDispatch)(we.store),{createSuccessNotice:O}=Object(Pe.useDispatch)(Do.store),{getBlock:j,getSettings:y,preferredStyle:f}=Object(Pe.useSelect)(e=>{var t;const n=e(we.store).getSettings().__experimentalPreferredStyleVariations;return{getBlock:e(we.store).getBlock,getSettings:e(we.store).getSettings,preferredStyle:null==n||null===(t=n.value)||void 0===t?void 0:t["core/image"]}},[]),_=Object(Pe.useSelect)(e=>{var t;return null===(t=e(we.store).getBlock(r))||void 0===t?void 0:t.innerBlocks},[r]),k=Object(je.useMemo)(()=>null==_?void 0:_.map(e=>({clientId:e.clientId,id:e.attributes.id,url:e.attributes.url,attributes:e.attributes,fromSavedContent:Boolean(e.originalContent)})),[_]),w=function(e){const[t,n]=Object(je.useState)([]),o=Object(Pe.useSelect)(n=>{if(null==e||!e.length)return t;const o=e.map(e=>e.attributes.id).filter(e=>void 0!==e);return 0===o.length?t:n(It.store).getMediaItems({include:o.join(","),per_page:-1})},[e]);return(null==o?void 0:o.length)!==(null==t?void 0:t.length)||null!=o&&o.some(e=>!t.find(t=>t.id===e.id))?(n(o),o):t}(_),E=vr(k,w);Object(je.useEffect)(()=>{null==E||E.forEach(e=>{v(e.clientId,{...S(e.attributes),id:e.id,align:void 0})})},[E]);const C=function(e){const t=Object(Pe.useSelect)(t=>{if(!e||0===e.length)return;const n=t(It.store).getMedia;return e.map(e=>{const t=n(e.id);if(t)return{id:t.id,type:"image",url:t.source_url,mime:t.mime_type,alt:t.alt_text,link:t.link}})},[e]);if(t)return Object(Me.every)(t,e=>e&&e.url)?t:void 0}(b);Object(je.useEffect)(()=>{b&&C&&(T(C),t({shortCodeTransforms:void 0}))},[b,C]);const x=hr(w,l,y);function S(e){const t=e.id?Object(Me.find)(w,{id:e.id}):null;let o;return o=e.className&&""!==e.className?e.className:f?"is-style-"+f:void 0,{...nr(e,p),...mr(t,d),...dr(m,n),className:o,sizeSlug:p}}function B(e){var t;return jr.some(t=>{var n;return 0===(null===(n=e.type)||void 0===n?void 0:n.indexOf(t))})||0===(null===(t=e.url)||void 0===t?void 0:t.indexOf("blob:"))}function T(e){const t="[object FileList]"===Object.prototype.toString.call(e),n=t?Array.from(e).map(e=>e.url?e:nr({url:Object(ze.createBlobURL)(e)})):e;n.every(B)||(a.removeAllNotices(),a.createErrorNotice(Object(ke.__)("If uploading to a gallery all files need to be image formats"),{id:"gallery-upload-invalid-file"}));const o=n.filter(e=>e.url||B(e)).map(e=>e.url?e:nr({url:Object(ze.createBlobURL)(e)})),l=o.reduce((e,t,n)=>(e[t.id]=n,e),{}),c=t?_:_.filter(e=>o.find(t=>t.id===e.attributes.id)),i=o.filter(e=>!c.find(t=>e.id===t.attributes.id)).map(e=>Object(Oe.createBlock)("core/image",{id:e.id,url:e.url,caption:e.caption,alt:e.alt}));h(r,Object(Me.concat)(c,i).sort((e,t)=>l[e.attributes.id]-l[t.attributes.id]))}Object(je.useEffect)(()=>{var e,n,o,r,a,l;d||(g(),t({linkTo:(null===(e=window)||void 0===e||null===(n=e.wp)||void 0===n||null===(o=n.media)||void 0===o||null===(r=o.view)||void 0===r||null===(a=r.settings)||void 0===a||null===(l=a.defaultProps)||void 0===l?void 0:l.link)||"none"}))},[d]);const N=!!k.length,z=N&&k.some(e=>!!e.id),P=k.some(e=>{var t;return!e.id&&0===(null===(t=e.url)||void 0===t?void 0:t.indexOf("blob:"))}),I=Object(je.createElement)(we.MediaPlaceholder,{addToGallery:z,handleUpload:!1,isAppender:N,disableMediaButtons:N&&!l||P,icon:!N&&ir,labels:{title:!N&&Object(ke.__)("Gallery"),instructions:!N&&yr},onSelect:T,accept:"image/*",allowedTypes:jr,multiple:!0,value:z?k:{},onError:function(e){a.removeAllNotices(),a.createErrorNotice(e)},notices:N?void 0:c}),M=Object(we.useBlockProps)({className:tt()(o,"has-nested-images")});if(!N)return Object(je.createElement)(ye.View,M,I);const R=d&&"none"!==d;return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Gallery settings")},k.length>1&&Object(je.createElement)(_e.RangeControl,Object(mt.a)({label:Object(ke.__)("Columns"),value:s||(L=k.length,L?Math.min(3,L):3),onChange:function(e){t({columns:e})},min:1,max:Math.min(8,k.length)},fr,{required:!0})),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Crop images"),checked:!!u,onChange:function(){t({imageCrop:!u})},help:function(e){return e?Object(ke.__)("Thumbnails are cropped to align."):Object(ke.__)("Thumbnails are not cropped.")}}),Object(je.createElement)(_e.SelectControl,{label:Object(ke.__)("Link to"),value:d,onChange:function(e){t({linkTo:e});const n={},o=[];j(r).innerBlocks.forEach(t=>{o.push(t.clientId);const r=t.attributes.id?Object(Me.find)(w,{id:t.attributes.id}):null;n[t.clientId]=mr(r,e)}),v(o,n,!0);const a=[...Or].find(t=>t.value===e);O(Object(ke.sprintf)(Object(ke.__)("All gallery image links updated to: %s"),a.label),{id:"gallery-attributes-linkTo",type:"snackbar"})},options:Or,hideCancelButton:!0}),R&&Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Open in new tab"),checked:"_blank"===m,onChange:function(e){const n=e?"_blank":void 0;t({linkTarget:n});const o={},a=[];j(r).innerBlocks.forEach(e=>{a.push(e.clientId),o[e.clientId]=dr(n,e.attributes)}),v(a,o,!0);const l=e?Object(ke.__)("All gallery images updated to open in new tab"):Object(ke.__)("All gallery images updated to not open in new tab");O(l,{id:"gallery-attributes-openInNewTab",type:"snackbar"})}}),(null==x?void 0:x.length)>0&&Object(je.createElement)(_e.SelectControl,{label:Object(ke.__)("Image size"),value:p,options:x,onChange:function(e){t({sizeSlug:e});const n={},o=[];j(r).innerBlocks.forEach(t=>{o.push(t.clientId);const r=t.attributes.id?Object(Me.find)(w,{id:t.attributes.id}):null;n[t.clientId]=function(e,t){const n=Object(Me.get)(e,["media_details","sizes",t,"source_url"]);return n?{url:n,width:void 0,height:void 0,sizeSlug:t}:{}}(r,e)}),v(o,n,!0);const a=x.find(t=>t.value===e);O(Object(ke.sprintf)(Object(ke.__)("All gallery image sizes updated to: %s"),a.label),{id:"gallery-attributes-sizeSlug",type:"snackbar"})},hideCancelButton:!0}),je.Platform.isWeb&&!x&&z&&Object(je.createElement)(_e.BaseControl,{className:"gallery-image-sizes"},Object(je.createElement)(_e.BaseControl.VisualLabel,null,Object(ke.__)("Image size")),Object(je.createElement)(ye.View,{className:"gallery-image-sizes__loading"},Object(je.createElement)(_e.Spinner,null),Object(ke.__)("Loading options…"))))),c,Object(je.createElement)(gr,Object(mt.a)({},e,{images:k,mediaPlaceholder:I,blockProps:M,insertBlocksAfter:i})));var L}));const kr=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"large";const n=Object(Me.pick)(e,["alt","id","link","caption"]);n.url=Object(Me.get)(e,["sizes",t,"url"])||Object(Me.get)(e,["media_details","sizes",t,"source_url"])||e.url;const o=Object(Me.get)(e,["sizes","full","url"])||Object(Me.get)(e,["media_details","sizes","full","source_url"]);return o&&(n.fullUrl=o),n};var wr=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.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"})),Er=n("2gm7"),Cr=n("1iEr"),xr=n("bWcr");class Sr extends je.Component{constructor(){super(...arguments),this.onSelectImage=this.onSelectImage.bind(this),this.onRemoveImage=this.onRemoveImage.bind(this),this.bindContainer=this.bindContainer.bind(this),this.onEdit=this.onEdit.bind(this),this.onSelectImageFromLibrary=this.onSelectImageFromLibrary.bind(this),this.onSelectCustomURL=this.onSelectCustomURL.bind(this),this.state={isEditing:!1}}bindContainer(e){this.container=e}onSelectImage(){this.props.isSelected||this.props.onSelect()}onRemoveImage(e){this.container===this.container.ownerDocument.activeElement&&this.props.isSelected&&-1!==[dt.BACKSPACE,dt.DELETE].indexOf(e.keyCode)&&(e.preventDefault(),this.props.onRemove())}onEdit(){this.setState({isEditing:!0})}componentDidUpdate(){const{image:e,url:t,__unstableMarkNextChangeAsNotPersistent:n}=this.props;e&&!t&&(n(),this.props.setAttributes({url:e.source_url,alt:e.alt_text}))}deselectOnBlur(){this.props.onDeselect()}onSelectImageFromLibrary(e){const{setAttributes:t,id:n,url:o,alt:r,caption:a,sizeSlug:l}=this.props;if(!e||!e.url)return;let c=kr(e,l);((e,t)=>!e&&Object(ze.isBlobURL)(t))(n,o)&&r&&(c=Object(Me.omit)(c,["alt"])),a&&!Object(Me.get)(c,["caption"])&&(c=Object(Me.omit)(c,["caption"])),t(c),this.setState({isEditing:!1})}onSelectCustomURL(e){const{setAttributes:t,url:n}=this.props;e!==n&&(t({url:e,id:void 0}),this.setState({isEditing:!1}))}render(){const{url:e,alt:t,id:n,linkTo:o,link:r,isFirstItem:a,isLastItem:l,isSelected:c,caption:i,onRemove:s,onMoveForward:u,onMoveBackward:m,setAttributes:d,"aria-label":b}=this.props,{isEditing:p}=this.state;let g;switch(o){case"file":g=e;break;case"post":g=r}const h=Object(je.createElement)(je.Fragment,null,Object(je.createElement)("img",{src:e,alt:t,"data-id":n,onKeyDown:this.onRemoveImage,tabIndex:"0","aria-label":b,ref:this.bindContainer}),Object(ze.isBlobURL)(e)&&Object(je.createElement)(_e.Spinner,null)),v=tt()({"is-selected":c,"is-transient":Object(ze.isBlobURL)(e)});return Object(je.createElement)("figure",{className:v,onClick:this.onSelectImage,onFocus:this.onSelectImage},!p&&(g?Object(je.createElement)("a",{href:g},h):h),p&&Object(je.createElement)(we.MediaPlaceholder,{labels:{title:Object(ke.__)("Edit gallery image")},icon:wr,onSelect:this.onSelectImageFromLibrary,onSelectURL:this.onSelectCustomURL,accept:"image/*",allowedTypes:["image"],value:{id:n,src:e}}),Object(je.createElement)(_e.ButtonGroup,{className:"block-library-gallery-item__inline-menu is-left"},Object(je.createElement)(_e.Button,{icon:Er.a,onClick:a?void 0:m,label:Object(ke.__)("Move image backward"),"aria-disabled":a,disabled:!c}),Object(je.createElement)(_e.Button,{icon:Cr.a,onClick:l?void 0:u,label:Object(ke.__)("Move image forward"),"aria-disabled":l,disabled:!c})),Object(je.createElement)(_e.ButtonGroup,{className:"block-library-gallery-item__inline-menu is-right"},Object(je.createElement)(_e.Button,{icon:to.a,onClick:this.onEdit,label:Object(ke.__)("Replace image"),disabled:!c}),Object(je.createElement)(_e.Button,{icon:xr.a,onClick:s,label:Object(ke.__)("Remove image"),disabled:!c})),!p&&(c||i)&&Object(je.createElement)(we.RichText,{tagName:"figcaption","aria-label":Object(ke.__)("Image caption text"),placeholder:c?Object(ke.__)("Add caption"):null,value:i,onChange:e=>d({caption:e}),inlineToolbar:!0}))}}var Br=Object(nt.compose)([Object(Pe.withSelect)((e,t)=>{const{getMedia:n}=e(It.store),{id:o}=t;return{image:o?n(parseInt(o,10)):null}}),Object(Pe.withDispatch)(e=>{const{__unstableMarkNextChangeAsNotPersistent:t}=e(we.store);return{__unstableMarkNextChangeAsNotPersistent:t}})])(Sr);function Tr(e){let{isHidden:t,...n}=e;return t?Object(je.createElement)(_e.VisuallyHidden,Object(mt.a)({as:we.RichText},n)):Object(je.createElement)(we.RichText,n)}var Nr=e=>{const{attributes:t,isSelected:n,setAttributes:o,selectedImage:r,mediaPlaceholder:a,onMoveBackward:l,onMoveForward:c,onRemoveImage:i,onSelectImage:s,onDeselectImage:u,onSetImageAttributes:m,insertBlocksAfter:d,blockProps:b}=e,{align:p,columns:g=or(t),caption:h,imageCrop:v,images:O}=t;return Object(je.createElement)("figure",Object(mt.a)({},b,{className:tt()(b.className,{["align"+p]:p,["columns-"+g]:g,"is-cropped":v})}),Object(je.createElement)("ul",{className:"blocks-gallery-grid"},O.map((e,o)=>{const a=Object(ke.sprintf)(Object(ke.__)("image %1$d of %2$d in gallery"),o+1,O.length);return Object(je.createElement)("li",{className:"blocks-gallery-item",key:e.id?`${e.id}-${o}`:e.url},Object(je.createElement)(Br,{url:e.url,alt:e.alt,id:e.id,isFirstItem:0===o,isLastItem:o+1===O.length,isSelected:n&&r===o,onMoveBackward:l(o),onMoveForward:c(o),onRemove:i(o),onSelect:s(o),onDeselect:u(o),setAttributes:e=>m(o,e),caption:e.caption,"aria-label":a,sizeSlug:t.sizeSlug}))})),a,Object(je.createElement)(Tr,{isHidden:!n&&we.RichText.isEmpty(h),tagName:"figcaption",className:"blocks-gallery-caption","aria-label":Object(ke.__)("Gallery caption text"),placeholder:Object(ke.__)("Write gallery caption…"),value:h,onChange:e=>o({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>d(Object(Oe.createBlock)("core/paragraph"))}))};const zr=[{value:"post",label:Object(ke.__)("Attachment Page")},{value:"file",label:Object(ke.__)("Media File")},{value:"none",label:Object(ke.__)("None")}],Pr=["image"],Ir=je.Platform.select({web:Object(ke.__)("Drag images, upload new ones or select files from your library."),native:Object(ke.__)("ADD MEDIA")}),Mr=je.Platform.select({web:{},native:{type:"stepper"}});Object(nt.compose)([_e.withNotices,Object(cr.withViewportMatch)({isNarrow:"< small"})])((function(e){const{attributes:t,clientId:n,isSelected:o,noticeUI:r,noticeOperations:a,onFocus:l}=e,{columns:c=or(t),imageCrop:i,images:s,linkTo:u,sizeSlug:m}=t,[d,b]=Object(je.useState)(),[p,g]=Object(je.useState)(),{__unstableMarkNextChangeAsNotPersistent:h}=Object(Pe.useDispatch)(we.store),{imageSizes:v,mediaUpload:O,getMedia:j,wasBlockJustInserted:y}=Object(Pe.useSelect)(e=>{const t=e(we.store).getSettings();return{imageSizes:t.imageSizes,mediaUpload:t.mediaUpload,getMedia:e(It.store).getMedia,wasBlockJustInserted:e(we.store).wasBlockJustInserted(n,"inserter_menu")}}),f=Object(je.useMemo)(()=>o?Object(Me.reduce)(t.ids,(e,t)=>{if(!t)return e;const n=j(t),o=Object(Me.reduce)(v,(e,t)=>{const o=Object(Me.get)(n,["sizes",t.slug,"url"]),r=Object(Me.get)(n,["media_details","sizes",t.slug,"source_url"]);return{...e,[t.slug]:o||r}},{});return{...e,[parseInt(t,10)]:o}},{}):{},[o,t.ids,v]);function _(t){if(t.ids)throw new Error('The "ids" attribute should not be changed directly. It is managed automatically when "images" attribute changes');t.images&&(t={...t,ids:Object(Me.map)(t.images,e=>{let{id:t}=e;return parseInt(t,10)})}),e.setAttributes(t)}function k(e,t){const n=[...s];n.splice(t,1,s[e]),n.splice(e,1,s[t]),b(t),_({images:n})}function w(e){const t=Object(Me.toString)(e.id),n=Object(Me.find)(s,{id:t}),o=n?n.caption:e.caption;if(!p)return o;const r=Object(Me.find)(p,{id:t});return r&&r.caption!==e.caption?e.caption:o}function E(e){g(e.map(e=>({id:Object(Me.toString)(e.id),caption:e.caption}))),_({images:e.map(e=>({...kr(e,m),caption:w(e),id:Object(Me.toString)(e.id)})),columns:t.columns?Math.min(e.length,t.columns):t.columns})}Object(je.useEffect)(()=>{if("web"===je.Platform.OS&&s&&s.length>0&&Object(Me.every)(s,e=>{let{url:t}=e;return Object(ze.isBlobURL)(t)})){const e=Object(Me.map)(s,e=>{let{url:t}=e;return Object(ze.getBlobByURL)(t)});Object(Me.forEach)(s,e=>{let{url:t}=e;return Object(ze.revokeBlobURL)(t)}),O({filesList:e,onFileChange:E,allowedTypes:["image"]})}},[]),Object(je.useEffect)(()=>{o||b()},[o]),Object(je.useEffect)(()=>{var e,t,n,o,r,a;u||(h(),_({linkTo:(null===(e=window)||void 0===e||null===(t=e.wp)||void 0===t||null===(n=t.media)||void 0===n||null===(o=n.view)||void 0===o||null===(r=o.settings)||void 0===r||null===(a=r.defaultProps)||void 0===a?void 0:a.link)||"none"}))},[u]);const C=!!s.length,x=C&&s.some(e=>!!e.id),S=Object(je.createElement)(we.MediaPlaceholder,{addToGallery:x,isAppender:C,disableMediaButtons:C&&!o,icon:!C&&ir,labels:{title:!C&&Object(ke.__)("Gallery"),instructions:!C&&Ir},onSelect:E,accept:"image/*",allowedTypes:Pr,multiple:!0,value:x?s:{},onError:function(e){a.removeAllNotices(),a.createErrorNotice(e)},notices:C?void 0:r,onFocus:l,autoOpenMediaUpload:!C&&o&&y}),B=Object(we.useBlockProps)();if(!C)return Object(je.createElement)(ye.View,B,S);const T=Object(Me.map)(Object(Me.filter)(v,e=>{let{slug:t}=e;return Object(Me.some)(f,e=>e[t])}),e=>{let{name:t,slug:n}=e;return{value:n,label:t}}),N=C&&!Object(Me.isEmpty)(T);return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Gallery settings")},s.length>1&&Object(je.createElement)(_e.RangeControl,Object(mt.a)({label:Object(ke.__)("Columns"),value:c,onChange:function(e){_({columns:e})},min:1,max:Math.min(8,s.length)},Mr,{required:!0})),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Crop images"),checked:!!i,onChange:function(){_({imageCrop:!i})},help:function(e){return e?Object(ke.__)("Thumbnails are cropped to align."):Object(ke.__)("Thumbnails are not cropped.")}}),Object(je.createElement)(_e.SelectControl,{label:Object(ke.__)("Link to"),value:u,onChange:function(e){_({linkTo:e})},options:zr,hideCancelButton:!0}),N&&Object(je.createElement)(_e.SelectControl,{label:Object(ke.__)("Image size"),value:m,options:T,onChange:function(e){_({images:Object(Me.map)(s,t=>{if(!t.id)return t;const n=Object(Me.get)(f,[parseInt(t.id,10),e]);return{...t,...n&&{url:n}}}),sizeSlug:e})},hideCancelButton:!0}))),r,Object(je.createElement)(Nr,Object(mt.a)({},e,{selectedImage:d,mediaPlaceholder:S,onMoveBackward:function(e){return()=>{0!==e&&k(e,e-1)}},onMoveForward:function(e){return()=>{e!==s.length-1&&k(e,e+1)}},onRemoveImage:function(e){return()=>{const n=Object(Me.filter)(s,(t,n)=>e!==n);b(),_({images:n,columns:t.columns?Math.min(n.length,t.columns):t.columns})}},onSelectImage:function(e){return()=>{b(e)}},onDeselectImage:function(){return()=>{b()}},onSetImageAttributes:function(e,t){s[e]&&_({images:[...s.slice(0,e),{...s[e],...t},...s.slice(e+1)]})},blockProps:B,onFocusGalleryCaption:function(){b()}})))}));var Rr=Object(nt.compose)([_e.withNotices])((function(e){return Object(je.createElement)(_r,e)}));var Lr=n("g56x");const Vr=e=>e?e.split(",").map(e=>parseInt(e,10)):[];Object(Lr.addFilter)("blocks.switchToBlockType.transformedBlock","core/gallery/update-third-party-transform-to",(function(e){var t;if("core/gallery"===e.name&&(null===(t=e.attributes)||void 0===t?void 0:t.images.length)>0){const t=e.attributes.images.map(t=>{let{url:n,id:o,alt:r}=t;return Object(Oe.createBlock)("core/image",{url:n,id:o?parseInt(o,10):null,alt:r,sizeSlug:e.attributes.sizeSlug,linkDestination:e.attributes.linkDestination})});delete e.attributes.ids,delete e.attributes.images,e.innerBlocks=t}return e})),Object(Lr.addFilter)("blocks.switchToBlockType.transformedBlock","core/gallery/update-third-party-transform-from",(function(e,t){const n=(Array.isArray(t)?t:[t]).find(t=>{var n;return"core/gallery"===t.name&&t.innerBlocks.length>0&&!(null!==(n=t.attributes.images)&&void 0!==n&&n.length)>0&&!e.name.includes("core/")});if(n){const e=n.innerBlocks.map(e=>{let{attributes:{url:t,id:n,alt:o}}=e;return{url:t,id:n?parseInt(n,10):null,alt:o}}),t=e.map(e=>{let{id:t}=e;return t});n.attributes.images=e,n.attributes.ids=t}return e}));var Hr={from:[{type:"block",isMultiBlock:!0,blocks:["core/image"],transform:e=>{let{align:t,sizeSlug:n}=e[0];t=Object(Me.every)(e,["align",t])?t:void 0,n=Object(Me.every)(e,["sizeSlug",n])?n:void 0;const o=Object(Me.filter)(e,e=>{let{url:t}=e;return t});{const e=o.map(e=>Object(Oe.createBlock)("core/image",e));return Object(Oe.createBlock)("core/gallery",{align:t,sizeSlug:n},e)}}},{type:"shortcode",tag:"gallery",attributes:{images:{type:"array",shortcode:e=>{let{named:{ids:t}}=e}},ids:{type:"array",shortcode:e=>{let{named:{ids:t}}=e}},shortCodeTransforms:{type:"array",shortcode:e=>{let{named:{ids:t}}=e;return Vr(t).map(e=>({id:parseInt(e)}))}},columns:{type:"number",shortcode:e=>{let{named:{columns:t="3"}}=e;return parseInt(t,10)}},linkTo:{type:"string",shortcode:e=>{let{named:{link:t}}=e;switch(t){case"post":return"attachment";case"file":return"media";default:return"none"}}}},isMatch(e){let{named:t}=e;return void 0!==t.ids}},{type:"files",priority:1,isMatch:e=>1!==e.length&&Object(Me.every)(e,e=>0===e.type.indexOf("image/")),transform(e){{const t=e.map(e=>Object(Oe.createBlock)("core/image",{url:Object(ze.createBlobURL)(e)}));return Object(Oe.createBlock)("core/gallery",{},t)}}}],to:[{type:"block",blocks:["core/image"],transform:(e,t)=>{let{align:n,images:o,ids:r,sizeSlug:a}=e;return t.length>0?t.map(e=>{let{attributes:{id:t,url:o,alt:r,caption:a,sizeSlug:l,linkDestination:c,href:i,linkTarget:s}}=e;return Object(Oe.createBlock)("core/image",{id:t,url:o,alt:r,caption:a,sizeSlug:l,align:n,linkDestination:c,href:i,linkTarget:s})}):Object(Oe.createBlock)("core/image",{align:n})}}]};const Ar={apiVersion:2,name:"core/gallery",title:"Gallery",category:"media",description:"Display multiple images in a rich gallery.",keywords:["images","photos"],textdomain:"default",attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},shortCodeTransforms:{type:"array",default:[],items:{type:"object"}},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},fixedHeight:{type:"boolean",default:!0},linkTarget:{type:"string"},linkTo:{type:"string"},sizeSlug:{type:"string",default:"large"},allowResize:{type:"boolean",default:!1}},providesContext:{allowResize:"allowResize",imageCrop:"imageCrop",fixedHeight:"fixedHeight"},supports:{anchor:!0,align:!0},editorStyle:"wp-block-gallery-editor",style:"wp-block-gallery"},{name:Fr}=Ar,Dr={icon:tr,example:{attributes:{columns:2},innerBlocks:[{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg"}},{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg"}}]},transforms:Hr,edit:Rr,save:function(e){let{attributes:t}=e;const{caption:n,columns:o,imageCrop:r}=t,a=tt()("has-nested-images",{["columns-"+o]:void 0!==o,"columns-default":void 0===o,"is-cropped":r}),l=we.useBlockProps.save({className:a}),c=we.useInnerBlocksProps.save(l);return Object(je.createElement)("figure",c,c.children,!we.RichText.isEmpty(n)&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:n}))},deprecated:lr};var Gr=n("u6za");const Ur=e=>{if(e.tagName||(e={...e,tagName:"div"}),!e.customTextColor&&!e.customBackgroundColor)return e;const t={color:{}};return e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),{...Object(Me.omit)(e,["customTextColor","customBackgroundColor"]),style:t}};var qr=[{attributes:{tagName:{type:"string",default:"div"},templateLock:{type:"string"}},supports:{align:["wide","full"],anchor:!0,color:{gradients:!0,link:!0},spacing:{padding:!0},__experimentalBorder:{radius:!0}},save(e){let{attributes:t}=e;const{tagName:n}=t;return Object(je.createElement)(n,we.useBlockProps.save(),Object(je.createElement)("div",{className:"wp-block-group__inner-container"},Object(je.createElement)(we.InnerBlocks.Content,null)))}},{attributes:{backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1},migrate:Ur,save(e){let{attributes:t}=e;const{backgroundColor:n,customBackgroundColor:o,textColor:r,customTextColor:a}=t,l=Object(we.getColorClassName)("background-color",n),c=Object(we.getColorClassName)("color",r),i=tt()(l,c,{"has-text-color":r||a,"has-background":n||o}),s={backgroundColor:l?void 0:o,color:c?void 0:a};return Object(je.createElement)("div",{className:i,style:s},Object(je.createElement)("div",{className:"wp-block-group__inner-container"},Object(je.createElement)(we.InnerBlocks.Content,null)))}},{attributes:{backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}},migrate:Ur,supports:{align:["wide","full"],anchor:!0,html:!1},save(e){let{attributes:t}=e;const{backgroundColor:n,customBackgroundColor:o,textColor:r,customTextColor:a}=t,l=Object(we.getColorClassName)("background-color",n),c=Object(we.getColorClassName)("color",r),i=tt()(l,{"has-text-color":r||a,"has-background":n||o}),s={backgroundColor:l?void 0:o,color:c?void 0:a};return Object(je.createElement)("div",{className:i,style:s},Object(je.createElement)("div",{className:"wp-block-group__inner-container"},Object(je.createElement)(we.InnerBlocks.Content,null)))}},{attributes:{backgroundColor:{type:"string"},customBackgroundColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1},migrate:Ur,save(e){let{attributes:t}=e;const{backgroundColor:n,customBackgroundColor:o}=t,r=Object(we.getColorClassName)("background-color",n),a=tt()(r,{"has-background":n||o}),l={backgroundColor:r?void 0:o};return Object(je.createElement)("div",{className:a,style:l},Object(je.createElement)(we.InnerBlocks.Content,null))}}];const Wr={header:Object(ke.__)("The <header> element should represent introductory content, typically a group of introductory or navigational aids."),main:Object(ke.__)("The <main> element should be used for the primary content of your document only. "),section:Object(ke.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element."),article:Object(ke.__)("The <article> element should represent a self contained, syndicatable portion of the document."),aside:Object(ke.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),footer:Object(ke.__)("The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).")};var $r=function(e){let{attributes:t,setAttributes:n,clientId:o}=e;const{hasInnerBlocks:r,themeSupportsLayout:a}=Object(Pe.useSelect)(e=>{var t;const{getBlock:n,getSettings:r}=e(we.store),a=n(o);return{hasInnerBlocks:!(!a||!a.innerBlocks.length),themeSupportsLayout:null===(t=r())||void 0===t?void 0:t.supportsLayout}},[o]),l=Object(we.useSetting)("layout")||{},{tagName:c="div",templateLock:i,layout:s={}}=t,u=s&&s.inherit?l:s,{type:m="default"}=u,d=a||"default"!==m,b=Object(we.useBlockProps)(),p=Object(we.useInnerBlocksProps)(d?b:{className:"wp-block-group__inner-container"},{templateLock:i,renderAppender:r?void 0:we.InnerBlocks.ButtonBlockAppender,__experimentalLayout:d?u:void 0});return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.InspectorControls,{__experimentalGroup:"advanced"},Object(je.createElement)(_e.SelectControl,{label:Object(ke.__)("HTML element"),options:[{label:Object(ke.__)("Default (<div>)"),value:"div"},{label:"<header>",value:"header"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<article>",value:"article"},{label:"<aside>",value:"aside"},{label:"<footer>",value:"footer"}],value:c,onChange:e=>n({tagName:e}),help:Wr[c]})),d&&Object(je.createElement)(c,p),!d&&Object(je.createElement)(c,b,Object(je.createElement)("div",p)))};var Zr=[{name:"group-row",title:Object(ke.__)("Row"),description:Object(ke.__)("Blocks shown in a row."),attributes:{layout:{type:"flex",allowOrientation:!1}},scope:["inserter"],isActive:e=>{var t;return"flex"===(null===(t=e.layout)||void 0===t?void 0:t.type)}}];const Kr={apiVersion:2,name:"core/group",title:"Group",category:"design",description:"Combine blocks into a group.",keywords:["container","wrapper","row","section"],textdomain:"default",attributes:{tagName:{type:"string",default:"div"},templateLock:{type:["string","boolean"],enum:["all","insert",!1]}},supports:{align:["wide","full"],anchor:!0,html:!1,color:{gradients:!0,link:!0},spacing:{padding:!0,blockGap:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0},__experimentalLayout:!0},editorStyle:"wp-block-group-editor",style:"wp-block-group"},{name:Jr}=Kr,Qr={icon:Gr.a,example:{attributes:{style:{color:{text:"#000000",background:"#ffffff"}}},innerBlocks:[{name:"core/paragraph",attributes:{customTextColor:"#cf2e2e",fontSize:"large",content:Object(ke.__)("One.")}},{name:"core/paragraph",attributes:{customTextColor:"#ff6900",fontSize:"large",content:Object(ke.__)("Two.")}},{name:"core/paragraph",attributes:{customTextColor:"#fcb900",fontSize:"large",content:Object(ke.__)("Three.")}},{name:"core/paragraph",attributes:{customTextColor:"#00d084",fontSize:"large",content:Object(ke.__)("Four.")}},{name:"core/paragraph",attributes:{customTextColor:"#0693e3",fontSize:"large",content:Object(ke.__)("Five.")}},{name:"core/paragraph",attributes:{customTextColor:"#9b51e0",fontSize:"large",content:Object(ke.__)("Six.")}}]},transforms:{from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert(e){if(1===e.length&&"core/group"===e[0].name)return;const t=["wide","full"],n=e.reduce((e,n)=>{const{align:o}=n.attributes;return t.indexOf(o)>t.indexOf(e)?o:e},void 0),o=e.map(e=>Object(Oe.createBlock)(e.name,e.attributes,e.innerBlocks));return Object(Oe.createBlock)("core/group",{align:n},o)}}]},edit:$r,save:function(e){let{attributes:{tagName:t}}=e;return Object(je.createElement)(t,we.useInnerBlocksProps.save(we.useBlockProps.save()))},deprecated:qr,variations:Zr};var Yr=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M6.2 5.2v13.4l5.8-4.8 5.8 4.8V5.2z"}));const Xr={className:!1,anchor:!0},ea={align:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:""},level:{type:"number",default:2},placeholder:{type:"string"}},ta=e=>{if(!e.customTextColor)return e;const t={color:{text:e.customTextColor}};return{...Object(Me.omit)(e,["customTextColor"]),style:t}},na=["left","right","center"],oa=e=>{const{align:t,...n}=e;return na.includes(t)?{...n,textAlign:t}:e};var ra=[{supports:{align:["wide","full"],anchor:!0,className:!1,color:{link:!0},fontSize:!0,lineHeight:!0,__experimentalSelector:{"core/heading/h1":"h1","core/heading/h2":"h2","core/heading/h3":"h3","core/heading/h4":"h4","core/heading/h5":"h5","core/heading/h6":"h6"},__unstablePasteTextInline:!0},attributes:ea,isEligible:e=>{let{align:t}=e;return na.includes(t)},migrate:oa,save(e){let{attributes:t}=e;const{align:n,content:o,level:r}=t,a="h"+r,l=tt()({["has-text-align-"+n]:n});return Object(je.createElement)(a,we.useBlockProps.save({className:l}),Object(je.createElement)(we.RichText.Content,{value:o}))}},{supports:Xr,attributes:{...ea,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>ta(oa(e)),save(e){let{attributes:t}=e;const{align:n,content:o,customTextColor:r,level:a,textColor:l}=t,c="h"+a,i=Object(we.getColorClassName)("color",l),s=tt()({[i]:i,"has-text-color":l||r,["has-text-align-"+n]:n});return Object(je.createElement)(we.RichText.Content,{className:s||void 0,tagName:c,style:{color:i?void 0:r},value:o})}},{attributes:{...ea,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>ta(oa(e)),save(e){let{attributes:t}=e;const{align:n,content:o,customTextColor:r,level:a,textColor:l}=t,c="h"+a,i=Object(we.getColorClassName)("color",l),s=tt()({[i]:i,["has-text-align-"+n]:n});return Object(je.createElement)(we.RichText.Content,{className:s||void 0,tagName:c,style:{color:i?void 0:r},value:o})},supports:Xr},{supports:Xr,attributes:{...ea,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>ta(oa(e)),save(e){let{attributes:t}=e;const{align:n,level:o,content:r,textColor:a,customTextColor:l}=t,c="h"+o,i=Object(we.getColorClassName)("color",a),s=tt()({[i]:i});return Object(je.createElement)(we.RichText.Content,{className:s||void 0,tagName:c,style:{textAlign:n,color:i?void 0:l},value:r})}}];function aa(e){let{level:t,isPressed:n=!1}=e;const o={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return o.hasOwnProperty(t)?Object(je.createElement)(_e.SVG,{width:"24",height:"24",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",isPressed:n},Object(je.createElement)(_e.Path,{d:o[t]})):null}const la=[1,2,3,4,5,6],ca={className:"block-library-heading-level-dropdown"};function ia(e){let{selectedLevel:t,onChange:n}=e;return Object(je.createElement)(_e.ToolbarDropdownMenu,{popoverProps:ca,icon:Object(je.createElement)(aa,{level:t}),label:Object(ke.__)("Change heading level"),controls:la.map(e=>{{const o=e===t;return{icon:Object(je.createElement)(aa,{level:e,isPressed:o}),label:Object(ke.sprintf)(Object(ke.__)("Heading %d"),e),isActive:o,onClick(){n(e)}}}})})}const sa={},ua=e=>Object(Me.trim)(Object(Me.deburr)((e=>{const t=document.createElement("div");return t.innerHTML=e,t.innerText})(e)).replace(/[^\p{L}\p{N}]+/gu,"-").toLowerCase(),"-"),ma=(e,t)=>{const n=ua(t);if(""===n)return null;delete sa[e];let o=n,r=0;for(;Object.values(sa).includes(o);)r+=1,o=n+"-"+r;return o},da=(e,t)=>{sa[e]=t};var ba=function(e){let{attributes:t,setAttributes:n,mergeBlocks:o,onReplace:r,style:a,clientId:l}=e;const{textAlign:c,content:i,level:s,placeholder:u,anchor:m}=t,d="h"+s,b=Object(we.useBlockProps)({className:tt()({["has-text-align-"+c]:c}),style:a}),{canGenerateAnchors:p}=Object(Pe.useSelect)(e=>({canGenerateAnchors:!!e(we.store).getSettings().__experimentalGenerateAnchors}),[]),{__unstableMarkNextChangeAsNotPersistent:g}=Object(Pe.useDispatch)(we.store);return Object(je.useEffect)(()=>{if(p)return!m&&i&&(g(),n({anchor:ma(l,i)})),da(l,m),()=>da(l,null)},[m,i,l,p]),Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(ia,{selectedLevel:s,onChange:e=>n({level:e})}),Object(je.createElement)(we.AlignmentControl,{value:c,onChange:e=>{n({textAlign:e})}})),Object(je.createElement)(we.RichText,Object(mt.a)({identifier:"content",tagName:d,value:i,onChange:e=>{const t={content:e};!p||m&&e&&ma(l,i)!==m||(t.anchor=ma(l,e)),n(t)},onMerge:o,onSplit:(e,n)=>{let o;var r;n||e?o=Object(Oe.createBlock)("core/heading",{...t,content:e}):o=Object(Oe.createBlock)(null!==(r=Object(Oe.getDefaultBlockName)())&&void 0!==r?r:"core/heading");return n&&(o.clientId=l),o},onReplace:r,onRemove:()=>r([]),"aria-label":Object(ke.__)("Heading text"),placeholder:u||Object(ke.__)("Heading"),textAlign:c},b)))};const{name:pa}={apiVersion:2,name:"core/heading",title:"Heading",category:"text",description:"Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",keywords:["title","subtitle"],textdomain:"default",attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",__experimentalRole:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},supports:{align:["wide","full"],anchor:!0,className:!1,color:{link:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}},__experimentalSelector:"h1,h2,h3,h4,h5,h6",__unstablePasteTextInline:!0,__experimentalSlashInserter:!0},editorStyle:"wp-block-heading-editor",style:"wp-block-heading"};var ga={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map(e=>{let{content:t,anchor:n}=e;return Object(Oe.createBlock)(pa,{content:t,anchor:n})})},{type:"raw",selector:"h1,h2,h3,h4,h5,h6",schema:e=>{let{phrasingContentSchema:t,isPaste:n}=e;const o={children:t,attributes:n?[]:["style","id"]};return{h1:o,h2:o,h3:o,h4:o,h5:o,h6:o}},transform(e){const t=Object(Oe.getBlockAttributes)(pa,e.outerHTML),{textAlign:n}=e.style||{};var o;return t.level=(o=e.nodeName,Number(o.substr(1))),"left"!==n&&"center"!==n&&"right"!==n||(t.align=n),Object(Oe.createBlock)(pa,t)}},...[1,2,3,4,5,6].map(e=>({type:"prefix",prefix:Array(e+1).join("#"),transform:t=>Object(Oe.createBlock)(pa,{level:e,content:t})})),...[1,2,3,4,5,6].map(e=>({type:"enter",regExp:new RegExp(`^/(h|H)${e}$`),transform:t=>Object(Oe.createBlock)(pa,{level:e,content:t})}))],to:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map(e=>{let{content:t,anchor:n}=e;return Object(Oe.createBlock)("core/paragraph",{content:t,anchor:n})})}]};const ha={apiVersion:2,name:"core/heading",title:"Heading",category:"text",description:"Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",keywords:["title","subtitle"],textdomain:"default",attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",__experimentalRole:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},supports:{align:["wide","full"],anchor:!0,className:!1,color:{link:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}},__experimentalSelector:"h1,h2,h3,h4,h5,h6",__unstablePasteTextInline:!0,__experimentalSlashInserter:!0},editorStyle:"wp-block-heading-editor",style:"wp-block-heading"},{name:va}=ha,Oa={icon:Yr,example:{attributes:{content:Object(ke.__)("Code is Poetry"),level:2}},__experimentalLabel(e,t){let{context:n}=t;if("accessibility"===n){const{content:t,level:n}=e;return Object(Me.isEmpty)(t)?Object(ke.sprintf)(Object(ke.__)("Level %s. Empty."),n):Object(ke.sprintf)(Object(ke.__)("Level %1$s. %2$s"),n,t)}},transforms:ga,deprecated:ra,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:ba,save:function(e){let{attributes:t}=e;const{textAlign:n,content:o,level:r}=t,a="h"+r,l=tt()({["has-text-align-"+n]:n});return Object(je.createElement)(a,we.useBlockProps.save({className:l}),Object(je.createElement)(we.RichText.Content,{value:o}))}};var ja=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M4.8 11.4H2.1V9H1v6h1.1v-2.6h2.7V15h1.1V9H4.8v2.4zm1.9-1.3h1.7V15h1.1v-4.9h1.7V9H6.7v1.1zM16.2 9l-1.5 2.7L13.3 9h-.9l-.8 6h1.1l.5-4 1.5 2.8 1.5-2.8.5 4h1.1L17 9h-.8zm3.8 5V9h-1.1v6h3.6v-1H20z"}));var ya={from:[{type:"block",blocks:["core/code"],transform:e=>{let{content:t}=e;return Object(Oe.createBlock)("core/html",{content:t})}}]};const fa={apiVersion:2,name:"core/html",title:"Custom HTML",category:"widgets",description:"Add custom HTML code and preview it as you edit.",keywords:["embed"],textdomain:"default",attributes:{content:{type:"string",source:"html"}},supports:{customClassName:!1,className:!1,html:!1},editorStyle:"wp-block-html-editor"},{name:_a}=fa,ka={icon:ja,example:{attributes:{content:"<marquee>"+Object(ke.__)("Welcome to the wonderful world of blocks…")+"</marquee>"}},edit:function(e){let{attributes:t,setAttributes:n,isSelected:o}=e;const[r,a]=Object(je.useState)(),l=Object(Pe.useSelect)(e=>["\n\t\t\thtml,body,:root {\n\t\t\t\tmargin: 0 !important;\n\t\t\t\tpadding: 0 !important;\n\t\t\t\toverflow: visible !important;\n\t\t\t\tmin-height: auto !important;\n\t\t\t}\n\t\t",...Object(we.transformStyles)(e(we.store).getSettings().styles)],[]);return Object(je.createElement)("div",Object(we.useBlockProps)({className:"block-library-html__edit"}),Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(_e.ToolbarGroup,null,Object(je.createElement)(_e.ToolbarButton,{className:"components-tab-button",isPressed:!r,onClick:function(){a(!1)}},Object(je.createElement)("span",null,"HTML")),Object(je.createElement)(_e.ToolbarButton,{className:"components-tab-button",isPressed:r,onClick:function(){a(!0)}},Object(je.createElement)("span",null,Object(ke.__)("Preview"))))),Object(je.createElement)(_e.Disabled.Consumer,null,e=>r||e?Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.SandBox,{html:t.content,styles:l}),!o&&Object(je.createElement)("div",{className:"block-library-html__preview-overlay"})):Object(je.createElement)(we.PlainText,{value:t.content,onChange:e=>n({content:e}),placeholder:Object(ke.__)("Write HTML…"),"aria-label":Object(ke.__)("HTML")})))},save:function(e){let{attributes:t}=e;return Object(je.createElement)(je.RawHTML,null,t.content)},transforms:ya},wa={align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number"},width:{type:"number"},height:{type:"number"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}};var Ea=[{attributes:wa,save(e){let{attributes:t}=e;const{url:n,alt:o,caption:r,align:a,href:l,width:c,height:i,id:s}=t,u=tt()({["align"+a]:a,"is-resized":c||i}),m=Object(je.createElement)("img",{src:n,alt:o,className:s?"wp-image-"+s:null,width:c,height:i});return Object(je.createElement)("figure",{className:u},l?Object(je.createElement)("a",{href:l},m):m,!we.RichText.isEmpty(r)&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",value:r}))}},{attributes:wa,save(e){let{attributes:t}=e;const{url:n,alt:o,caption:r,align:a,href:l,width:c,height:i,id:s}=t,u=Object(je.createElement)("img",{src:n,alt:o,className:s?"wp-image-"+s:null,width:c,height:i});return Object(je.createElement)("figure",{className:a?"align"+a:null},l?Object(je.createElement)("a",{href:l},u):u,!we.RichText.isEmpty(r)&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",value:r}))}},{attributes:wa,save(e){let{attributes:t}=e;const{url:n,alt:o,caption:r,align:a,href:l,width:c,height:i}=t,s=c||i?{width:c,height:i}:{},u=Object(je.createElement)("img",Object(mt.a)({src:n,alt:o},s));let m={};return c?m={width:c}:"left"!==a&&"right"!==a||(m={maxWidth:"50%"}),Object(je.createElement)("figure",{className:a?"align"+a:null,style:m},l?Object(je.createElement)("a",{href:l},u):u,!we.RichText.isEmpty(r)&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",value:r}))}}];var Ca=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M16.5 7.8v7H18v-7c0-1-.8-1.8-1.8-1.8h-7v1.5h7c.2 0 .3.1.3.3zm-8.7 8.7c-.1 0-.2-.1-.2-.2V2H6v4H2v1.5h4v8.8c0 1 .8 1.8 1.8 1.8h8.8v4H18v-4h4v-1.5H7.8z"})),xa=n("NTP4");var Sa=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12-9.8c.4 0 .8-.3.9-.7l1.1-3h3.6l.5 1.7h1.9L13 9h-2.2l-3.4 9.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12H20V6c0-1.1-.9-2-2-2zm-6 7l1.4 3.9h-2.7L12 11z"}));function Ba(e,t){const[n,o]=Object(je.useState)();function r(){o(e.current.clientWidth)}return Object(je.useEffect)(r,t),Object(je.useEffect)(()=>{const{defaultView:t}=e.current.ownerDocument;return t.addEventListener("resize",r),()=>{t.removeEventListener("resize",r)}},[]),n}function Ta(e){var t;let{temporaryURL:n,attributes:{url:o="",alt:r,caption:a,align:l,id:c,href:i,rel:s,linkClass:u,linkDestination:m,title:d,width:b,height:p,linkTarget:g,sizeSlug:h},setAttributes:v,isSelected:O,insertBlocksAfter:j,onReplace:y,onSelectImage:f,onSelectURL:_,onUploadError:k,containerRef:w,context:E,clientId:C}=e;const x=Object(je.useRef)(),S=Object(je.useRef)(),B=Object(nt.usePrevious)(o),{allowResize:T=!0}=E,{getBlock:N}=Object(Pe.useSelect)(we.store),{image:z,multiImageSelection:P}=Object(Pe.useSelect)(e=>{const{getMedia:t}=e(It.store),{getMultiSelectedBlockClientIds:n,getBlockName:o}=e(we.store),r=n();return{image:c&&O?t(c):null,multiImageSelection:r.length&&r.every(e=>"core/image"===o(e))}},[c,O]),{canInsertCover:I,imageEditing:M,imageSizes:R,maxWidth:L,mediaUpload:V}=Object(Pe.useSelect)(e=>{const{getBlockRootClientId:t,getSettings:n,canInsertBlockType:o}=e(we.store),r=t(C);return{...Object(Me.pick)(n(),["imageEditing","imageSizes","maxWidth","mediaUpload"]),canInsertCover:o("core/cover",r)}},[C]),{replaceBlocks:H,toggleSelection:A}=Object(Pe.useDispatch)(we.store),{createErrorNotice:F,createSuccessNotice:D}=Object(Pe.useDispatch)(Do.store),G=Object(nt.useViewportMatch)("medium"),U=Object(Me.includes)(["wide","full"],l),[{loadedNaturalWidth:q,loadedNaturalHeight:W},$]=Object(je.useState)({}),[Z,K]=Object(je.useState)(!1),[J,Q]=Object(je.useState)(),Y=Ba(w,[l]),X=T&&!(U&&G),ee=Object(Me.map)(Object(Me.filter)(R,e=>{let{slug:t}=e;return Object(Me.get)(z,["media_details","sizes",t,"source_url"])}),e=>{let{name:t,slug:n}=e;return{value:n,label:t}});Object(je.useEffect)(()=>{Na(c,o)&&O&&!J&&window.fetch(o).then(e=>e.blob()).then(e=>Q(e)).catch(()=>{})},[c,o,O,J]),Object(je.useEffect)(()=>{o&&!B&&O&&S.current.focus()},[o,B]);const{naturalWidth:te,naturalHeight:ne}=Object(je.useMemo)(()=>{var e,t;return{naturalWidth:(null===(e=x.current)||void 0===e?void 0:e.naturalWidth)||q||void 0,naturalHeight:(null===(t=x.current)||void 0===t?void 0:t.naturalHeight)||W||void 0}},[q,W,null===(t=x.current)||void 0===t?void 0:t.complete]);Object(je.useEffect)(()=>{O||K(!1)},[O]);const oe=c&&te&&ne&&M,re=!P&&oe&&!Z;const ae=Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(we.BlockAlignmentControl,{value:l,onChange:function(e){const t=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};v({...t,align:e})}}),!P&&!Z&&Object(je.createElement)(we.__experimentalImageURLInputUI,{url:i||"",onChangeUrl:function(e){v(e)},linkDestination:m,mediaUrl:z&&z.source_url||o,mediaLink:z&&z.link,linkTarget:g,linkClass:u,rel:s}),re&&Object(je.createElement)(_e.ToolbarButton,{onClick:()=>K(!0),icon:Ca,label:Object(ke.__)("Crop")}),J&&Object(je.createElement)(_e.ToolbarButton,{onClick:function(){V({filesList:[J],onFileChange(e){let[t]=e;f(t),Object(ze.isBlobURL)(t.url)||(Q(),D(Object(ke.__)("Image uploaded."),{type:"snackbar"}))},allowedTypes:ur,onError(e){F(e,{type:"snackbar"})}})},icon:xa.a,label:Object(ke.__)("Upload external image")}),!P&&I&&Object(je.createElement)(_e.ToolbarButton,{icon:Sa,label:Object(ke.__)("Add text over image"),onClick:function(){H(C,Object(Oe.switchToBlockType)(N(C),"core/cover"))}})),!P&&!Z&&Object(je.createElement)(we.BlockControls,{group:"other"},Object(je.createElement)(we.MediaReplaceFlow,{mediaId:c,mediaURL:o,allowedTypes:ur,accept:"image/*",onSelect:f,onSelectURL:_,onError:k})),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Image settings")},!P&&Object(je.createElement)(_e.TextareaControl,{label:Object(ke.__)("Alt text (alternative text)"),value:r,onChange:function(e){v({alt:e})},help:Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.ExternalLink,{href:"https://www.w3.org/WAI/tutorials/images/decision-tree"},Object(ke.__)("Describe the purpose of the image")),Object(ke.__)("Leave empty if the image is purely decorative."))}),Object(je.createElement)(we.__experimentalImageSizeControl,{onChangeImage:function(e){const t=Object(Me.get)(z,["media_details","sizes",e,"source_url"]);if(!t)return null;v({url:t,width:void 0,height:void 0,sizeSlug:e})},onChange:e=>v(e),slug:h,width:b,height:p,imageSizeOptions:ee,isResizable:X,imageWidth:te,imageHeight:ne}))),Object(je.createElement)(we.InspectorControls,{__experimentalGroup:"advanced"},Object(je.createElement)(_e.TextControl,{label:Object(ke.__)("Title attribute"),value:d||"",onChange:function(e){v({title:e})},help:Object(je.createElement)(je.Fragment,null,Object(ke.__)("Describe the role of this image on the page."),Object(je.createElement)(_e.ExternalLink,{href:"https://www.w3.org/TR/html52/dom.html#the-title-attribute"},Object(ke.__)("(Note: many devices and browsers do not display this text.)")))}))),le=Object(Jo.getFilename)(o);let ce;ce=r||(le?Object(ke.sprintf)(Object(ke.__)("This image has an empty alt attribute; its file name is %s"),le):Object(ke.__)("This image has an empty alt attribute"));let ie,se,ue=Object(je.createElement)(je.Fragment,null,Object(je.createElement)("img",{src:n||o,alt:ce,onError:()=>function(){const e=Ge({attributes:{url:o}});void 0!==e&&y(e)}(),onLoad:e=>{var t,n;$({loadedNaturalWidth:null===(t=e.target)||void 0===t?void 0:t.naturalWidth,loadedNaturalHeight:null===(n=e.target)||void 0===n?void 0:n.naturalHeight})},ref:x}),n&&Object(je.createElement)(_e.Spinner,null));if(Y&&te&&ne){const e=te>Y,t=ne/te;ie=e?Y:te,se=e?Y*t:ne}if(oe&&Z)ue=Object(je.createElement)(we.__experimentalImageEditor,{url:o,width:b,height:p,clientWidth:Y,naturalHeight:ne,naturalWidth:te});else if(X&&ie){const e=b||ie,t=p||se,n=te/ne,o=te<ne?20:20*n,r=ne<te?20:20/n,a=2.5*L;let c=!1,i=!1;"center"===l?(c=!0,i=!0):Object(ke.isRTL)()?"left"===l?c=!0:i=!0:"right"===l?i=!0:c=!0,ue=Object(je.createElement)(_e.ResizableBox,{size:{width:null!=b?b:"auto",height:null!=p?p:"auto"},showHandle:O,minWidth:o,maxWidth:a,minHeight:r,maxHeight:a/n,lockAspectRatio:!0,enable:{top:!1,right:c,bottom:!0,left:i},onResizeStart:function(){A(!1)},onResizeStop:(n,o,r,a)=>{A(!0),v({width:parseInt(e+a.width,10),height:parseInt(t+a.height,10)})}},ue)}else ue=Object(je.createElement)("div",{style:{width:b,height:p}},ue);return Object(je.createElement)(we.__experimentalImageEditingProvider,{id:c,url:o,naturalWidth:te,naturalHeight:ne,clientWidth:Y,onSaveImage:e=>v(e),isEditing:Z,onFinishEditing:()=>K(!1)},!n&&ae,ue,(!we.RichText.isEmpty(a)||O)&&Object(je.createElement)(we.RichText,{ref:S,tagName:"figcaption","aria-label":Object(ke.__)("Image caption text"),placeholder:Object(ke.__)("Add caption"),value:a,onChange:e=>v({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>j(Object(Oe.createBlock)("core/paragraph"))}))}const Na=(e,t)=>t&&!e&&!Object(ze.isBlobURL)(t);var za=Object(_e.withNotices)((function(e){let{attributes:t,setAttributes:n,isSelected:o,className:r,noticeUI:a,insertBlocksAfter:l,noticeOperations:c,onReplace:i,context:s,clientId:u}=e;const{url:m="",alt:d,caption:b,align:p,id:g,width:h,height:v,sizeSlug:O}=t,[j,y]=Object(je.useState)(),f=Object(je.useRef)();Object(je.useEffect)(()=>{f.current=d},[d]);const _=Object(je.useRef)();Object(je.useEffect)(()=>{_.current=b},[b]);const k=Object(je.useRef)(),{imageDefaultSize:w,mediaUpload:E}=Object(Pe.useSelect)(e=>{const{getSettings:t}=e(we.store);return Object(Me.pick)(t(),["imageDefaultSize","mediaUpload"])},[]);function C(e){c.removeAllNotices(),c.createErrorNotice(e)}function x(e){var o,r,a,l,c;if(!e||!e.url)return void n({url:void 0,alt:void 0,id:void 0,title:void 0,caption:void 0});if(Object(ze.isBlobURL)(e.url))return void y(e.url);y();let i,s=((e,t)=>{const n=Object(Me.pick)(e,["alt","id","link","caption"]);return n.url=Object(Me.get)(e,["sizes",t,"url"])||Object(Me.get)(e,["media_details","sizes",t,"source_url"])||e.url,n})(e,w);var u,d;_.current&&!Object(Me.get)(s,["caption"])&&(s=Object(Me.omit)(s,["caption"])),i=e.id&&e.id===g?{url:m}:{width:void 0,height:void 0,sizeSlug:(u=e,d=w,Object(Me.has)(u,["sizes",d,"url"])||Object(Me.has)(u,["media_details","sizes",d,"source_url"])?w:"full")};let b,p=t.linkDestination;if(!p)switch((null===(o=wp)||void 0===o||null===(r=o.media)||void 0===r||null===(a=r.view)||void 0===a||null===(l=a.settings)||void 0===l||null===(c=l.defaultProps)||void 0===c?void 0:c.link)||"none"){case"file":case"media":p="media";break;case"post":case"attachment":p="attachment";break;case"custom":p="custom";break;case"none":p="none"}switch(p){case"media":b=e.url;break;case"attachment":b=e.link}s.href=b,n({...s,...i,linkDestination:p})}function S(e){e!==m&&n({url:e,id:void 0,width:void 0,height:void 0,sizeSlug:w})}let B=((e,t)=>!e&&Object(ze.isBlobURL)(t))(g,m);Object(je.useEffect)(()=>{if(!B)return;const e=Object(ze.getBlobByURL)(m);e&&E({filesList:[e],onFileChange:e=>{let[t]=e;x(t)},allowedTypes:ur,onError:e=>{B=!1,c.createErrorNotice(e),n({src:void 0,id:void 0,url:void 0})}})},[]),Object(je.useEffect)(()=>{B?y(m):Object(ze.revokeBlobURL)(j)},[B,m]);const T=Na(g,m)?m:void 0,N=!!m&&Object(je.createElement)("img",{alt:Object(ke.__)("Edit image"),title:Object(ke.__)("Edit image"),className:"edit-image-preview",src:m}),z=tt()(r,{"is-transient":j,"is-resized":!!h||!!v,["size-"+O]:O}),P=Object(we.useBlockProps)({ref:k,className:z});return Object(je.createElement)("figure",P,(j||m)&&Object(je.createElement)(Ta,{temporaryURL:j,attributes:t,setAttributes:n,isSelected:o,insertBlocksAfter:l,onReplace:i,onSelectImage:x,onSelectURL:S,onUploadError:C,containerRef:k,context:s,clientId:u}),!m&&Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(we.BlockAlignmentControl,{value:p,onChange:function(e){const t=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};n({...t,align:e})}})),Object(je.createElement)(we.MediaPlaceholder,{icon:Object(je.createElement)(we.BlockIcon,{icon:wr}),onSelect:x,onSelectURL:S,notices:a,onError:C,accept:"image/*",allowedTypes:ur,value:{id:g,src:T},mediaPreview:N,disableMediaButtons:j||m}))}));function Pa(e,t){const{body:n}=document.implementation.createHTMLDocument("");n.innerHTML=e;const{firstElementChild:o}=n;if(o&&"A"===o.nodeName)return o.getAttribute(t)||void 0}const Ia={img:{attributes:["src","alt","title"],classes:["alignleft","aligncenter","alignright","alignnone",/^wp-image-\d+$/]}};var Ma={from:[{type:"raw",isMatch:e=>"FIGURE"===e.nodeName&&!!e.querySelector("img"),schema:e=>{let{phrasingContentSchema:t}=e;return{figure:{require:["img"],children:{...Ia,a:{attributes:["href","rel","target"],children:Ia},figcaption:{children:t}}}}},transform:e=>{const t=e.className+" "+e.querySelector("img").className,n=/(?:^|\s)align(left|center|right)(?:$|\s)/.exec(t),o=""===e.id?void 0:e.id,r=n?n[1]:void 0,a=/(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(t),l=a?Number(a[1]):void 0,c=e.querySelector("a"),i=c&&c.href?"custom":void 0,s=c&&c.href?c.href:void 0,u=c&&c.rel?c.rel:void 0,m=c&&c.className?c.className:void 0,d=Object(Oe.getBlockAttributes)("core/image",e.outerHTML,{align:r,id:l,linkDestination:i,href:s,rel:u,linkClass:m,anchor:o});return Object(Oe.createBlock)("core/image",d)}},{type:"files",isMatch(e){if(e.some(e=>0===e.type.indexOf("image/"))&&e.some(e=>0!==e.type.indexOf("image/"))){const{createErrorNotice:e}=Object(Pe.dispatch)(Do.store);e(Object(ke.__)("If uploading to a gallery all files need to be image formats"),{id:"gallery-transform-invalid-file"})}return Object(Me.every)(e,e=>0===e.type.indexOf("image/"))},transform:e=>e.map(e=>Object(Oe.createBlock)("core/image",{url:Object(ze.createBlobURL)(e)}))},{type:"shortcode",tag:"caption",attributes:{url:{type:"string",source:"attribute",attribute:"src",selector:"img"},alt:{type:"string",source:"attribute",attribute:"alt",selector:"img"},caption:{shortcode:function(e,t){let{shortcode:n}=t;const{body:o}=document.implementation.createHTMLDocument("");o.innerHTML=n.content;let r=o.querySelector("img");for(;r&&r.parentNode&&r.parentNode!==o;)r=r.parentNode;return r&&r.parentNode.removeChild(r),o.innerHTML.trim()}},href:{shortcode:(e,t)=>{let{shortcode:n}=t;return Pa(n.content,"href")}},rel:{shortcode:(e,t)=>{let{shortcode:n}=t;return Pa(n.content,"rel")}},linkClass:{shortcode:(e,t)=>{let{shortcode:n}=t;return Pa(n.content,"class")}},id:{type:"number",shortcode:e=>{let{named:{id:t}}=e;if(t)return parseInt(t.replace("attachment_",""),10)}},align:{type:"string",shortcode:e=>{let{named:{align:t="alignnone"}}=e;return t.replace("align","")}}}}]};const Ra={apiVersion:2,name:"core/image",title:"Image",category:"media",usesContext:["allowResize","imageCrop","fixedHeight"],description:"Insert an image to make a visual statement.",keywords:["img","photo","picture"],textdomain:"default",attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},title:{type:"string",source:"attribute",selector:"img",attribute:"title"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number"},width:{type:"number"},height:{type:"number"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{__experimentalDuotone:"img",text:!1,background:!1},__experimentalBorder:{radius:!0}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"rounded",label:"Rounded"}],editorStyle:"wp-block-image-editor",style:"wp-block-image"},{name:La}=Ra,Va={icon:wr,example:{attributes:{sizeSlug:"large",url:"https://s.w.org/images/core/5.3/MtBlanc1.jpg",caption:Object(ke.__)("Mont Blanc appears—still, snowy, and serene.")}},__experimentalLabel(e,t){let{context:n}=t;if("accessibility"===n){const{caption:t,alt:n,url:o}=e;return o?n?n+(t?". "+t:""):t||"":Object(ke.__)("Empty")}},getEditWrapperProps:e=>({"data-align":e.align}),transforms:Ma,edit:za,save:function(e){let{attributes:t}=e;const{url:n,alt:o,caption:r,align:a,href:l,rel:c,linkClass:i,width:s,height:u,id:m,linkTarget:d,sizeSlug:b,title:p}=t,g=Object(Me.isEmpty)(c)?void 0:c,h=tt()({["align"+a]:a,["size-"+b]:b,"is-resized":s||u}),v=Object(je.createElement)("img",{src:n,alt:o,className:m?"wp-image-"+m:null,width:s,height:u,title:p}),O=Object(je.createElement)(je.Fragment,null,l?Object(je.createElement)("a",{className:i,href:l,target:d,rel:g},v):v,!we.RichText.isEmpty(r)&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",value:r}));return"left"===a||"right"===a||"center"===a?Object(je.createElement)("div",we.useBlockProps.save(),Object(je.createElement)("figure",{className:h},O)):Object(je.createElement)("figure",we.useBlockProps.save({className:h}),O)},deprecated:Ea};var Ha=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"}));const Aa={apiVersion:2,name:"core/latest-comments",title:"Latest Comments",category:"widgets",description:"Display a list of your most recent comments.",keywords:["recent comments"],textdomain:"default",attributes:{commentsToShow:{type:"number",default:5,minimum:1,maximum:100},displayAvatar:{type:"boolean",default:!0},displayDate:{type:"boolean",default:!0},displayExcerpt:{type:"boolean",default:!0}},supports:{align:!0,html:!1},editorStyle:"wp-block-latest-comments-editor",style:"wp-block-latest-comments"},{name:Fa}=Aa,Da={icon:Ha,example:{},edit:function(e){let{attributes:t,setAttributes:n}=e;const{commentsToShow:o,displayAvatar:r,displayDate:a,displayExcerpt:l}=t;return Object(je.createElement)("div",Object(we.useBlockProps)(),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Latest comments settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Display avatar"),checked:r,onChange:()=>n({displayAvatar:!r})}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Display date"),checked:a,onChange:()=>n({displayDate:!a})}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Display excerpt"),checked:l,onChange:()=>n({displayExcerpt:!l})}),Object(je.createElement)(_e.RangeControl,{label:Object(ke.__)("Number of comments"),value:o,onChange:e=>n({commentsToShow:e}),min:1,max:100,required:!0}))),Object(je.createElement)(_e.Disabled,null,Object(je.createElement)(Ce.a,{block:"core/latest-comments",attributes:t,urlQueryArgs:{_locale:"site"}})))}};var Ga=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"}));const{attributes:Ua}={apiVersion:2,name:"core/latest-posts",title:"Latest Posts",category:"widgets",description:"Display a list of your most recent posts.",keywords:["recent posts"],textdomain:"default",attributes:{categories:{type:"array",items:{type:"object"}},selectedAuthor:{type:"number"},postsToShow:{type:"number",default:5},displayPostContent:{type:"boolean",default:!1},displayPostContentRadio:{type:"string",default:"excerpt"},excerptLength:{type:"number",default:55},displayAuthor:{type:"boolean",default:!1},displayPostDate:{type:"boolean",default:!1},postLayout:{type:"string",default:"list"},columns:{type:"number",default:3},order:{type:"string",default:"desc"},orderBy:{type:"string",default:"date"},displayFeaturedImage:{type:"boolean",default:!1},featuredImageAlign:{type:"string",enum:["left","center","right"]},featuredImageSizeSlug:{type:"string",default:"thumbnail"},featuredImageSizeWidth:{type:"number",default:null},featuredImageSizeHeight:{type:"number",default:null},addLinkToFeaturedImage:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-latest-posts-editor",style:"wp-block-latest-posts"};var qa=[{attributes:{...Ua,categories:{type:"string"}},supports:{align:!0,html:!1},migrate:e=>({...e,categories:[{id:Number(e.categories)}]}),isEligible:e=>{let{categories:t}=e;return t&&"string"==typeof t},save:()=>null}],Wa=n("FqII");var $a=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"})),Za=n("b2RC");const Ka={per_page:-1,context:"view"},Ja={per_page:-1,has_published_posts:["post"],context:"view"};const Qa={apiVersion:2,name:"core/latest-posts",title:"Latest Posts",category:"widgets",description:"Display a list of your most recent posts.",keywords:["recent posts"],textdomain:"default",attributes:{categories:{type:"array",items:{type:"object"}},selectedAuthor:{type:"number"},postsToShow:{type:"number",default:5},displayPostContent:{type:"boolean",default:!1},displayPostContentRadio:{type:"string",default:"excerpt"},excerptLength:{type:"number",default:55},displayAuthor:{type:"boolean",default:!1},displayPostDate:{type:"boolean",default:!1},postLayout:{type:"string",default:"list"},columns:{type:"number",default:3},order:{type:"string",default:"desc"},orderBy:{type:"string",default:"date"},displayFeaturedImage:{type:"boolean",default:!1},featuredImageAlign:{type:"string",enum:["left","center","right"]},featuredImageSizeSlug:{type:"string",default:"thumbnail"},featuredImageSizeWidth:{type:"number",default:null},featuredImageSizeHeight:{type:"number",default:null},addLinkToFeaturedImage:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-latest-posts-editor",style:"wp-block-latest-posts"},{name:Ya}=Qa,Xa={icon:Ga,example:{},edit:function(e){var t;let{attributes:n,setAttributes:o}=e;const{postsToShow:r,order:a,orderBy:l,categories:c,selectedAuthor:i,displayFeaturedImage:s,displayPostContentRadio:u,displayPostContent:m,displayPostDate:d,displayAuthor:b,postLayout:p,columns:g,excerptLength:h,featuredImageAlign:v,featuredImageSizeSlug:O,featuredImageSizeWidth:j,featuredImageSizeHeight:y,addLinkToFeaturedImage:f}=n,{imageSizeOptions:_,latestPosts:k,defaultImageWidth:w,defaultImageHeight:E,categoriesList:C,authorList:x}=Object(Pe.useSelect)(e=>{const{getEntityRecords:t,getMedia:n,getUsers:o}=e(It.store),{getSettings:s}=e(we.store),{imageSizes:u,imageDimensions:m}=s(),d=c&&c.length>0?c.map(e=>e.id):[],b=t("postType","post",Object(Me.pickBy)({categories:d,author:i,order:a,orderby:l,per_page:r},e=>!Object(Me.isUndefined)(e)));return{defaultImageWidth:Object(Me.get)(m,[O,"width"],0),defaultImageHeight:Object(Me.get)(m,[O,"height"],0),imageSizeOptions:u.filter(e=>{let{slug:t}=e;return"full"!==t}).map(e=>{let{name:t,slug:n}=e;return{value:n,label:t}}),latestPosts:Array.isArray(b)?b.map(e=>{if(!e.featured_media)return e;const t=n(e.featured_media);let o=Object(Me.get)(t,["media_details","sizes",O,"source_url"],null);o||(o=Object(Me.get)(t,"source_url",null));const r={url:o,alt:null==t?void 0:t.alt_text};return{...e,featuredImageInfo:r}}):b,categoriesList:t("taxonomy","category",Ka),authorList:o(Ja)}},[O,r,a,l,c,i]),S=null!==(t=null==C?void 0:C.reduce((e,t)=>({...e,[t.name]:t}),{}))&&void 0!==t?t:{},B=!(null==k||!k.length),T=Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Post content settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Post content"),checked:m,onChange:e=>o({displayPostContent:e})}),m&&Object(je.createElement)(_e.RadioControl,{label:Object(ke.__)("Show:"),selected:u,options:[{label:Object(ke.__)("Excerpt"),value:"excerpt"},{label:Object(ke.__)("Full post"),value:"full_post"}],onChange:e=>o({displayPostContentRadio:e})}),m&&"excerpt"===u&&Object(je.createElement)(_e.RangeControl,{label:Object(ke.__)("Max number of words in excerpt"),value:h,onChange:e=>o({excerptLength:e}),min:10,max:100})),Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Post meta settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Display author name"),checked:b,onChange:e=>o({displayAuthor:e})}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Display post date"),checked:d,onChange:e=>o({displayPostDate:e})})),Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Featured image settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Display featured image"),checked:s,onChange:e=>o({displayFeaturedImage:e})}),s&&Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.__experimentalImageSizeControl,{onChange:e=>{const t={};e.hasOwnProperty("width")&&(t.featuredImageSizeWidth=e.width),e.hasOwnProperty("height")&&(t.featuredImageSizeHeight=e.height),o(t)},slug:O,width:j,height:y,imageWidth:w,imageHeight:E,imageSizeOptions:_,onChangeImage:e=>o({featuredImageSizeSlug:e,featuredImageSizeWidth:void 0,featuredImageSizeHeight:void 0})}),Object(je.createElement)(_e.BaseControl,{className:"block-editor-image-alignment-control__row"},Object(je.createElement)(_e.BaseControl.VisualLabel,null,Object(ke.__)("Image alignment")),Object(je.createElement)(we.BlockAlignmentToolbar,{value:v,onChange:e=>o({featuredImageAlign:e}),controls:["left","center","right"],isCollapsed:!1})),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Add link to featured image"),checked:f,onChange:e=>o({addLinkToFeaturedImage:e})}))),Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Sorting and filtering")},Object(je.createElement)(_e.QueryControls,{order:a,orderBy:l,numberOfItems:r,onOrderChange:e=>o({order:e}),onOrderByChange:e=>o({orderBy:e}),onNumberOfItemsChange:e=>o({postsToShow:e}),categorySuggestions:S,onCategoryChange:e=>{if(e.some(e=>"string"==typeof e&&!S[e]))return;const t=e.map(e=>"string"==typeof e?S[e]:e);if(Object(Me.includes)(t,null))return!1;o({categories:t})},selectedCategories:c,onAuthorChange:e=>o({selectedAuthor:""!==e?Number(e):void 0}),authorList:null!=x?x:[],selectedAuthorId:i}),"grid"===p&&Object(je.createElement)(_e.RangeControl,{label:Object(ke.__)("Columns"),value:g,onChange:e=>o({columns:e}),min:2,max:B?Math.min(6,k.length):6,required:!0}))),N=Object(we.useBlockProps)({className:tt()({"wp-block-latest-posts__list":!0,"is-grid":"grid"===p,"has-dates":d,"has-author":b,["columns-"+g]:"grid"===p})});if(!B)return Object(je.createElement)("div",N,T,Object(je.createElement)(_e.Placeholder,{icon:At,label:Object(ke.__)("Latest Posts")},Array.isArray(k)?Object(ke.__)("No posts found."):Object(je.createElement)(_e.Spinner,null)));const z=k.length>r?k.slice(0,r):k,P=[{icon:$a,title:Object(ke.__)("List view"),onClick:()=>o({postLayout:"list"}),isActive:"list"===p},{icon:Za.a,title:Object(ke.__)("Grid view"),onClick:()=>o({postLayout:"grid"}),isActive:"grid"===p}],I=Object(Wa.__experimentalGetSettings)().formats.date;return Object(je.createElement)("div",null,T,Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(_e.ToolbarGroup,{controls:P})),Object(je.createElement)("ul",N,z.map((e,t)=>{const n=Object(Me.invoke)(e,["title","rendered","trim"]);let o=e.excerpt.rendered;const r=null==x?void 0:x.find(t=>t.id===e.author),a=document.createElement("div");a.innerHTML=o,o=a.textContent||a.innerText||"";const{featuredImageInfo:{url:l,alt:c}={}}=e,i=tt()({"wp-block-latest-posts__featured-image":!0,["align"+v]:!!v}),p=s&&l,g=p&&Object(je.createElement)("img",{src:l,alt:c,style:{maxWidth:j,maxHeight:y}}),O=h<o.trim().split(" ").length&&""===e.excerpt.raw?Object(je.createElement)(je.Fragment,null,o.trim().split(" ",h).join(" "),Object(ke.__)(" … "),Object(je.createElement)("a",{href:e.link,rel:"noopener noreferrer"},Object(ke.__)("Read more"))):o;return Object(je.createElement)("li",{key:t},p&&Object(je.createElement)("div",{className:i},f?Object(je.createElement)("a",{href:e.link,rel:"noreferrer noopener"},g):g),Object(je.createElement)("a",{href:e.link,rel:"noreferrer noopener"},n?Object(je.createElement)(je.RawHTML,null,n):Object(ke.__)("(no title)")),b&&r&&Object(je.createElement)("div",{className:"wp-block-latest-posts__post-author"},Object(ke.sprintf)(Object(ke.__)("by %s"),r.name)),d&&e.date_gmt&&Object(je.createElement)("time",{dateTime:Object(Wa.format)("c",e.date_gmt),className:"wp-block-latest-posts__post-date"},Object(Wa.dateI18n)(I,e.date_gmt)),m&&"excerpt"===u&&Object(je.createElement)("div",{className:"wp-block-latest-posts__post-excerpt"},O),m&&"full_post"===u&&Object(je.createElement)("div",{className:"wp-block-latest-posts__post-full-content"},Object(je.createElement)(je.RawHTML,{key:"html"},e.content.raw.trim())))})))},deprecated:qa};var el=[{attributes:{ordered:{type:"boolean",default:!1,__experimentalRole:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",__experimentalRole:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,__experimentalFontFamily:!0},color:{gradients:!0,link:!0},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalSlashInserter:!0},save(e){let{attributes:t}=e;const{ordered:n,values:o,type:r,reversed:a,start:l}=t,c=n?"ol":"ul";return Object(je.createElement)(c,we.useBlockProps.save({type:r,reversed:a,start:l}),Object(je.createElement)(we.RichText.Content,{value:o,multiline:"li"}))},migrate:at,isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}}];var tl=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}));var nl=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}));var ol=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z"}));var rl=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"}));var al=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z"}));var ll=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z"}));var cl=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z"}));var il=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z"}));var sl=e=>{let{setAttributes:t,reversed:n,start:o}=e;return Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Ordered list settings")},Object(je.createElement)(_e.TextControl,{label:Object(ke.__)("Start value"),type:"number",onChange:e=>{const n=parseInt(e,10);t({start:isNaN(n)?void 0:n})},value:Number.isInteger(o)?o.toString(10):"",step:"1"}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Reverse list numbering"),checked:n||!1,onChange:e=>{t({reversed:e||void 0})}})))};function ul(e){let{phrasingContentSchema:t}=e;const n={...t,ul:{},ol:{attributes:["type","start","reversed"]}};return["ul","ol"].forEach(e=>{n[e].children={li:{children:n}}}),n}var ml={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph","core/heading"],transform:e=>Object(Oe.createBlock)("core/list",{values:Object(kt.toHTMLString)({value:Object(kt.join)(e.map(t=>{let{content:n}=t;const o=Object(kt.create)({html:n});return e.length>1?o:Object(kt.replace)(o,/\n/g,kt.__UNSTABLE_LINE_SEPARATOR)}),kt.__UNSTABLE_LINE_SEPARATOR),multilineTag:"li"}),anchor:e.anchor})},{type:"block",blocks:["core/quote","core/pullquote"],transform:e=>{let{value:t,anchor:n}=e;return Object(Oe.createBlock)("core/list",{values:Object(kt.toHTMLString)({value:Object(kt.create)({html:t,multilineTag:"p"}),multilineTag:"li"}),anchor:n})}},{type:"raw",selector:"ol,ul",schema:e=>({ol:ul(e).ol,ul:ul(e).ul}),transform(e){const t={ordered:"OL"===e.nodeName,anchor:""===e.id?void 0:e.id};if(t.ordered){const n=e.getAttribute("type");n&&(t.type=n),null!==e.getAttribute("reversed")&&(t.reversed=!0);const o=parseInt(e.getAttribute("start"),10);isNaN(o)||1===o&&!t.reversed||(t.start=o)}return Object(Oe.createBlock)("core/list",{...Object(Oe.getBlockAttributes)("core/list",e.outerHTML),...t})}},...["*","-"].map(e=>({type:"prefix",prefix:e,transform:e=>Object(Oe.createBlock)("core/list",{values:`<li>${e}</li>`})})),...["1.","1)"].map(e=>({type:"prefix",prefix:e,transform:e=>Object(Oe.createBlock)("core/list",{ordered:!0,values:`<li>${e}</li>`})}))],to:[{type:"block",blocks:["core/paragraph"],transform:e=>{let{values:t}=e;return Object(kt.split)(Object(kt.create)({html:t,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),kt.__UNSTABLE_LINE_SEPARATOR).map(e=>Object(Oe.createBlock)("core/paragraph",{content:Object(kt.toHTMLString)({value:e})}))}},{type:"block",blocks:["core/heading"],transform:e=>{let{values:t}=e;return Object(kt.split)(Object(kt.create)({html:t,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),kt.__UNSTABLE_LINE_SEPARATOR).map(e=>Object(Oe.createBlock)("core/heading",{content:Object(kt.toHTMLString)({value:e})}))}},{type:"block",blocks:["core/quote"],transform:e=>{let{values:t,anchor:n}=e;return Object(Oe.createBlock)("core/quote",{value:Object(kt.toHTMLString)({value:Object(kt.create)({html:t,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),multilineTag:"p"}),anchor:n})}},{type:"block",blocks:["core/pullquote"],transform:e=>{let{values:t,anchor:n}=e;return Object(Oe.createBlock)("core/pullquote",{value:Object(kt.toHTMLString)({value:Object(kt.create)({html:t,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),multilineTag:"p"}),anchor:n})}}]};const dl={apiVersion:2,name:"core/list",title:"List",category:"text",description:"Create a bulleted or numbered list.",keywords:["bullet list","ordered list","numbered list"],textdomain:"default",attributes:{ordered:{type:"boolean",default:!1,__experimentalRole:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",__experimentalRole:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,__experimentalFontFamily:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalSlashInserter:!0},editorStyle:"wp-block-list-editor",style:"wp-block-list"},{name:bl}=dl,pl={icon:$a,example:{attributes:{values:"<li>Alice.</li><li>The White Rabbit.</li><li>The Cheshire Cat.</li><li>The Mad Hatter.</li><li>The Queen of Hearts.</li>"}},transforms:ml,merge(e,t){const{values:n}=t;return n&&"<li></li>"!==n?{...e,values:e.values+n}:e},edit:function(e){let{attributes:t,setAttributes:n,mergeBlocks:o,onReplace:r,style:a}=e;const{ordered:l,values:c,type:i,reversed:s,start:u,placeholder:m}=t,d=l?"ol":"ul",b=Object(we.useBlockProps)({style:a});return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.RichText,Object(mt.a)({identifier:"values",multiline:"li",tagName:d,onChange:e=>n({values:e}),value:c,"aria-label":Object(ke.__)("List text"),placeholder:m||Object(ke.__)("List"),onMerge:o,onSplit:e=>Object(Oe.createBlock)(bl,{...t,values:e}),__unstableOnSplitMiddle:()=>Object(Oe.createBlock)("core/paragraph"),onReplace:r,onRemove:()=>r([]),start:u,reversed:s,type:i},b),e=>{let{value:t,onChange:o,onFocus:r}=e;return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.RichTextShortcut,{type:"primary",character:"[",onUse:()=>{o(Object(kt.__unstableOutdentListItems)(t))}}),Object(je.createElement)(we.RichTextShortcut,{type:"primary",character:"]",onUse:()=>{o(Object(kt.__unstableIndentListItems)(t,{type:d}))}}),Object(je.createElement)(we.RichTextShortcut,{type:"primary",character:"m",onUse:()=>{o(Object(kt.__unstableIndentListItems)(t,{type:d}))}}),Object(je.createElement)(we.RichTextShortcut,{type:"primaryShift",character:"m",onUse:()=>{o(Object(kt.__unstableOutdentListItems)(t))}}),Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(_e.ToolbarButton,{icon:Object(ke.isRTL)()?tl:nl,title:Object(ke.__)("Unordered"),describedBy:Object(ke.__)("Convert to unordered list"),isActive:Object(kt.__unstableIsActiveListType)(t,"ul",d),onClick:()=>{o(Object(kt.__unstableChangeListType)(t,{type:"ul"})),r(),Object(kt.__unstableIsListRootSelected)(t)&&n({ordered:!1})}}),Object(je.createElement)(_e.ToolbarButton,{icon:Object(ke.isRTL)()?ol:rl,title:Object(ke.__)("Ordered"),describedBy:Object(ke.__)("Convert to ordered list"),isActive:Object(kt.__unstableIsActiveListType)(t,"ol",d),onClick:()=>{o(Object(kt.__unstableChangeListType)(t,{type:"ol"})),r(),Object(kt.__unstableIsListRootSelected)(t)&&n({ordered:!0})}}),Object(je.createElement)(_e.ToolbarButton,{icon:Object(ke.isRTL)()?al:ll,title:Object(ke.__)("Outdent"),describedBy:Object(ke.__)("Outdent list item"),shortcut:Object(ke._x)("Backspace","keyboard key"),isDisabled:!Object(kt.__unstableCanOutdentListItems)(t),onClick:()=>{o(Object(kt.__unstableOutdentListItems)(t)),r()}}),Object(je.createElement)(_e.ToolbarButton,{icon:Object(ke.isRTL)()?cl:il,title:Object(ke.__)("Indent"),describedBy:Object(ke.__)("Indent list item"),shortcut:Object(ke._x)("Space","keyboard key"),isDisabled:!Object(kt.__unstableCanIndentListItems)(t),onClick:()=>{o(Object(kt.__unstableIndentListItems)(t,{type:d})),r()}})))}),l&&Object(je.createElement)(sl,{setAttributes:n,ordered:l,reversed:s,start:u,placeholder:m}))},save:function(e){let{attributes:t}=e;const{ordered:n,values:o,type:r,reversed:a,start:l}=t,c=n?"ol":"ul";return Object(je.createElement)(c,we.useBlockProps.save({type:r,reversed:a,start:l}),Object(je.createElement)(we.RichText.Content,{value:o,multiline:"li"}))},deprecated:el};var gl=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M11 14.5l1.1 1.1 3-3 .5-.5-.6-.6-3-3-1 1 1.7 1.7H5v1.5h7.7L11 14.5zM16.8 5h-7c-1.1 0-2 .9-2 2v1.5h1.5V7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v10c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-1.5H7.8V17c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z"}));const hl={apiVersion:2,name:"core/loginout",title:"Login/out",category:"theme",description:"Show login & logout links.",keywords:["login","logout","form"],textdomain:"default",attributes:{displayLoginAsForm:{type:"boolean",default:!1},redirectToCurrent:{type:"boolean",default:!0}},supports:{className:!0,typography:{fontSize:!1}}},{name:vl}=hl,Ol={icon:gl,edit:function(e){let{attributes:t,setAttributes:n}=e;const{displayLoginAsForm:o,redirectToCurrent:r}=t;return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Login/out settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Display login as form"),checked:o,onChange:()=>n({displayLoginAsForm:!o})}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Redirect to current URL"),checked:r,onChange:()=>n({redirectToCurrent:!r})}))),Object(je.createElement)("div",Object(we.useBlockProps)({className:"logged-in"}),Object(je.createElement)("a",{href:"#login-pseudo-link"},Object(ke.__)("Log out"))))}};var jl=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M3 18h8V6H3v12zM14 7.5V9h7V7.5h-7zm0 5.3h7v-1.5h-7v1.5zm0 3.7h7V15h-7v1.5z"})),yl=Object(je.createElement)(_e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(_e.Path,{d:"M18 2l2 4h-2l-2-4h-3l2 4h-2l-2-4h-1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V2zm2 12H10V4.4L11.8 8H20z"}),Object(je.createElement)(_e.Path,{d:"M14 20H4V10h3V8H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3h-2z"}),Object(je.createElement)(_e.Path,{d:"M5 19h8l-1.59-2H9.24l-.84 1.1L7 16.3 5 19z"}));const fl=["image","video"];function _l(e,t){return e?{backgroundImage:`url(${e})`,backgroundPosition:t?`${100*t.x}% ${100*t.y}%`:"50% 50%"}:{}}const kl=Object(je.forwardRef)((e,t)=>{let{isSelected:n,isStackedOnMobile:o,...r}=e;const a=Object(nt.useViewportMatch)("small","<");return Object(je.createElement)(_e.ResizableBox,Object(mt.a)({ref:t,showHandle:n&&(!a||!o)},r))});function wl(e){let{mediaId:t,mediaUrl:n,onSelectMedia:o}=e;return Object(je.createElement)(we.BlockControls,{group:"other"},Object(je.createElement)(we.MediaReplaceFlow,{mediaId:t,mediaURL:n,allowedTypes:fl,accept:"image/*,video/*",onSelect:o}))}function El(e){let{className:t,noticeOperations:n,noticeUI:o,mediaUrl:r,onSelectMedia:a}=e;return Object(je.createElement)(we.MediaPlaceholder,{icon:Object(je.createElement)(we.BlockIcon,{icon:yl}),labels:{title:Object(ke.__)("Media area")},className:t,onSelect:a,accept:"image/*,video/*",allowedTypes:fl,notices:o,onError:e=>{n.removeAllNotices(),n.createErrorNotice(e)},disableMediaButtons:r})}var Cl=Object(_e.withNotices)(Object(je.forwardRef)((function(e,t){const{className:n,commitWidthChange:o,focalPoint:r,imageFill:a,isSelected:l,isStackedOnMobile:c,mediaAlt:i,mediaId:s,mediaPosition:u,mediaType:m,mediaUrl:d,mediaWidth:b,onSelectMedia:p,onWidthChange:g}=e,h=!s&&Object(ze.isBlobURL)(d),{toggleSelection:v}=Object(Pe.useDispatch)(we.store);if(d){const O=()=>{v(!1)},j=(e,t,n)=>{g(parseInt(n.style.width))},y=(e,t,n)=>{v(!0),o(parseInt(n.style.width))},f={right:"left"===u,left:"right"===u},_="image"===m&&a?_l(d,r):{},k={image:()=>Object(je.createElement)("img",{src:d,alt:i}),video:()=>Object(je.createElement)("video",{controls:!0,src:d})};return Object(je.createElement)(kl,{as:"figure",className:tt()(n,"editor-media-container__resizer",{"is-transient":h}),style:_,size:{width:b+"%"},minWidth:"10%",maxWidth:"100%",enable:f,onResizeStart:O,onResize:j,onResizeStop:y,axis:"x",isSelected:l,isStackedOnMobile:c,ref:t},Object(je.createElement)(wl,{onSelectMedia:p,mediaUrl:d,mediaId:s}),(k[m]||Me.noop)(),h&&Object(je.createElement)(_e.Spinner,null),Object(je.createElement)(El,e))}return Object(je.createElement)(El,e)})));const xl=e=>{if(!e.customBackgroundColor)return e;const t={color:{background:e.customBackgroundColor}};return{...Object(Me.omit)(e,["customBackgroundColor"]),style:t}},Sl={align:{type:"string",default:"wide"},backgroundColor:{type:"string"},mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:""},mediaPosition:{type:"string",default:"left"},mediaId:{type:"number"},mediaType:{type:"string"},mediaWidth:{type:"number",default:50},isStackedOnMobile:{type:"boolean",default:!0}};var Bl=[{attributes:{...Sl,customBackgroundColor:{type:"string"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},migrate:xl,save(e){let{attributes:t}=e;const{backgroundColor:n,customBackgroundColor:o,isStackedOnMobile:r,mediaAlt:a,mediaPosition:l,mediaType:c,mediaUrl:i,mediaWidth:s,mediaId:u,verticalAlignment:m,imageFill:d,focalPoint:b,linkClass:p,href:g,linkTarget:h,rel:v}=t,O=Object(Me.isEmpty)(v)?void 0:v;let j=Object(je.createElement)("img",{src:i,alt:a,className:u&&"image"===c?"wp-image-"+u:null});g&&(j=Object(je.createElement)("a",{className:p,href:g,target:h,rel:O},j));const y={image:()=>j,video:()=>Object(je.createElement)("video",{controls:!0,src:i})},f=Object(we.getColorClassName)("background-color",n),_=tt()({"has-media-on-the-right":"right"===l,"has-background":f||o,[f]:f,"is-stacked-on-mobile":r,["is-vertically-aligned-"+m]:m,"is-image-fill":d}),k=d?_l(i,b):{};let w;50!==s&&(w="right"===l?`auto ${s}%`:s+"% auto");const E={backgroundColor:f?void 0:o,gridTemplateColumns:w};return Object(je.createElement)("div",{className:_,style:E},Object(je.createElement)("figure",{className:"wp-block-media-text__media",style:k},(y[c]||Me.noop)()),Object(je.createElement)("div",{className:"wp-block-media-text__content"},Object(je.createElement)(we.InnerBlocks.Content,null)))}},{attributes:{...Sl,customBackgroundColor:{type:"string"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},migrate:xl,save(e){let{attributes:t}=e;const{backgroundColor:n,customBackgroundColor:o,isStackedOnMobile:r,mediaAlt:a,mediaPosition:l,mediaType:c,mediaUrl:i,mediaWidth:s,mediaId:u,verticalAlignment:m,imageFill:d,focalPoint:b}=t,p={image:()=>Object(je.createElement)("img",{src:i,alt:a,className:u&&"image"===c?"wp-image-"+u:null}),video:()=>Object(je.createElement)("video",{controls:!0,src:i})},g=Object(we.getColorClassName)("background-color",n),h=tt()({"has-media-on-the-right":"right"===l,[g]:g,"is-stacked-on-mobile":r,["is-vertically-aligned-"+m]:m,"is-image-fill":d}),v=d?_l(i,b):{};let O;50!==s&&(O="right"===l?`auto ${s}%`:s+"% auto");const j={backgroundColor:g?void 0:o,gridTemplateColumns:O};return Object(je.createElement)("div",{className:h,style:j},Object(je.createElement)("figure",{className:"wp-block-media-text__media",style:v},(p[c]||Me.noop)()),Object(je.createElement)("div",{className:"wp-block-media-text__content"},Object(je.createElement)(we.InnerBlocks.Content,null)))}},{attributes:{...Sl,customBackgroundColor:{type:"string"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"}},save(e){let{attributes:t}=e;const{backgroundColor:n,customBackgroundColor:o,isStackedOnMobile:r,mediaAlt:a,mediaPosition:l,mediaType:c,mediaUrl:i,mediaWidth:s}=t,u={image:()=>Object(je.createElement)("img",{src:i,alt:a}),video:()=>Object(je.createElement)("video",{controls:!0,src:i})},m=Object(we.getColorClassName)("background-color",n),d=tt()({"has-media-on-the-right":"right"===l,[m]:m,"is-stacked-on-mobile":r});let b;50!==s&&(b="right"===l?`auto ${s}%`:s+"% auto");const p={backgroundColor:m?void 0:o,gridTemplateColumns:b};return Object(je.createElement)("div",{className:d,style:p},Object(je.createElement)("figure",{className:"wp-block-media-text__media"},(u[c]||Me.noop)()),Object(je.createElement)("div",{className:"wp-block-media-text__content"},Object(je.createElement)(we.InnerBlocks.Content,null)))}}];var Tl=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M4 18h6V6H4v12zm9-9.5V10h7V8.5h-7zm0 7h7V14h-7v1.5z"}));var Nl=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M14 6v12h6V6h-6zM4 10h7V8.5H4V10zm0 5.5h7V14H4v1.5z"}));const zl=[["core/paragraph",{fontSize:"large",placeholder:Object(ke._x)("Content…","content placeholder")}]],Pl=e=>Math.max(15,Math.min(e,85));function Il(e,t){var n,o,r;return null==e||null===(n=e.media_details)||void 0===n||null===(o=n.sizes)||void 0===o||null===(r=o[t])||void 0===r?void 0:r.source_url}var Ml=function(e){let{attributes:t,isSelected:n,setAttributes:o}=e;const{focalPoint:r,href:a,imageFill:l,isStackedOnMobile:c,linkClass:i,linkDestination:s,linkTarget:u,mediaAlt:m,mediaId:d,mediaPosition:b,mediaType:p,mediaUrl:g,mediaWidth:h,rel:v,verticalAlignment:O}=t,j=t.mediaSizeSlug||"full",y=Object(Pe.useSelect)(e=>d&&n?e(It.store).getMedia(d):null,[n,d]),f=Object(je.useRef)(),_=e=>{const{style:t}=f.current.resizable,{x:n,y:o}=e;t.backgroundPosition=`${100*n}% ${100*o}%`},[k,w]=Object(je.useState)(null),E=function(e){let{attributes:{linkDestination:t,href:n},setAttributes:o}=e;return e=>{let r,a;var l,c,i,s,u;(r=e.media_type?"image"===e.media_type?"image":"video":e.type,"image"===r)&&(a=(null===(l=e.sizes)||void 0===l||null===(c=l.large)||void 0===c?void 0:c.url)||(null===(i=e.media_details)||void 0===i||null===(s=i.sizes)||void 0===s||null===(u=s.large)||void 0===u?void 0:u.source_url));let m=n;"media"===t&&(m=e.url),"attachment"===t&&(m=e.link),o({mediaAlt:e.alt,mediaId:e.id,mediaType:r,mediaUrl:a||e.url,mediaLink:e.link||void 0,href:m,focalPoint:void 0})}}({attributes:t,setAttributes:o}),C=e=>{o({mediaWidth:Pl(e)}),w(Pl(e))},x=tt()({"has-media-on-the-right":"right"===b,"is-selected":n,"is-stacked-on-mobile":c,["is-vertically-aligned-"+O]:O,"is-image-fill":l}),S=(k||h)+"%",B="right"===b?"1fr "+S:S+" 1fr",T={gridTemplateColumns:B,msGridColumns:B},N=Object(Pe.useSelect)(e=>{const t=e(we.store).getSettings();return null==t?void 0:t.imageSizes},[]),z=Object(Me.map)(Object(Me.filter)(N,e=>{let{slug:t}=e;return Il(y,t)}),e=>{let{name:t,slug:n}=e;return{value:n,label:t}}),P=Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Media & Text settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Stack on mobile"),checked:c,onChange:()=>o({isStackedOnMobile:!c})}),"image"===p&&Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Crop image to fill entire column"),checked:l,onChange:()=>o({imageFill:!l})}),l&&g&&"image"===p&&Object(je.createElement)(_e.FocalPointPicker,{label:Object(ke.__)("Focal point picker"),url:g,value:r,onChange:e=>o({focalPoint:e}),onDragStart:_,onDrag:_}),"image"===p&&Object(je.createElement)(_e.TextareaControl,{label:Object(ke.__)("Alt text (alternative text)"),value:m,onChange:e=>{o({mediaAlt:e})},help:Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.ExternalLink,{href:"https://www.w3.org/WAI/tutorials/images/decision-tree"},Object(ke.__)("Describe the purpose of the image")),Object(ke.__)("Leave empty if the image is purely decorative."))}),"image"===p&&Object(je.createElement)(we.__experimentalImageSizeControl,{onChangeImage:e=>{const t=Il(y,e);if(!t)return null;o({mediaUrl:t,mediaSizeSlug:e})},slug:j,imageSizeOptions:z,isResizable:!1}),g&&Object(je.createElement)(_e.RangeControl,{label:Object(ke.__)("Media width"),value:k||h,onChange:C,min:15,max:85})),I=Object(we.useBlockProps)({className:x,style:T}),M=Object(we.useInnerBlocksProps)({className:"wp-block-media-text__content"},{template:zl});return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.InspectorControls,null,P),Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(we.BlockVerticalAlignmentControl,{onChange:e=>{o({verticalAlignment:e})},value:O}),Object(je.createElement)(_e.ToolbarButton,{icon:Tl,title:Object(ke.__)("Show media on left"),isActive:"left"===b,onClick:()=>o({mediaPosition:"left"})}),Object(je.createElement)(_e.ToolbarButton,{icon:Nl,title:Object(ke.__)("Show media on right"),isActive:"right"===b,onClick:()=>o({mediaPosition:"right"})}),"image"===p&&Object(je.createElement)(we.__experimentalImageURLInputUI,{url:a||"",onChangeUrl:e=>{o(e)},linkDestination:s,mediaType:p,mediaUrl:y&&y.source_url,mediaLink:y&&y.link,linkTarget:u,linkClass:i,rel:v})),Object(je.createElement)("div",I,Object(je.createElement)(Cl,{className:"wp-block-media-text__media",onSelectMedia:E,onWidthChange:e=>{w(Pl(e))},commitWidthChange:C,ref:f,focalPoint:r,imageFill:l,isSelected:n,isStackedOnMobile:c,mediaAlt:m,mediaId:d,mediaPosition:b,mediaType:p,mediaUrl:g,mediaWidth:h}),Object(je.createElement)("div",M)))};var Rl={from:[{type:"block",blocks:["core/image"],transform:e=>{let{alt:t,url:n,id:o,anchor:r}=e;return Object(Oe.createBlock)("core/media-text",{mediaAlt:t,mediaId:o,mediaUrl:n,mediaType:"image",anchor:r})}},{type:"block",blocks:["core/video"],transform:e=>{let{src:t,id:n,anchor:o}=e;return Object(Oe.createBlock)("core/media-text",{mediaId:n,mediaUrl:t,mediaType:"video",anchor:o})}}],to:[{type:"block",blocks:["core/image"],isMatch:e=>{let{mediaType:t,mediaUrl:n}=e;return!n||"image"===t},transform:e=>{let{mediaAlt:t,mediaId:n,mediaUrl:o,anchor:r}=e;return Object(Oe.createBlock)("core/image",{alt:t,id:n,url:o,anchor:r})}},{type:"block",blocks:["core/video"],isMatch:e=>{let{mediaType:t,mediaUrl:n}=e;return!n||"video"===t},transform:e=>{let{mediaId:t,mediaUrl:n,anchor:o}=e;return Object(Oe.createBlock)("core/video",{id:t,src:n,anchor:o})}}]};const Ll={apiVersion:2,name:"core/media-text",title:"Media & Text",category:"media",description:"Set media and words side-by-side for a richer layout.",keywords:["image","video"],textdomain:"default",attributes:{align:{type:"string",default:"wide"},mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:""},mediaPosition:{type:"string",default:"left"},mediaId:{type:"number"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},mediaType:{type:"string"},mediaWidth:{type:"number",default:50},mediaSizeSlug:{type:"string"},isStackedOnMobile:{type:"boolean",default:!0},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0}},editorStyle:"wp-block-media-text-editor",style:"wp-block-media-text"},{name:Vl}=Ll,Hl={icon:jl,example:{viewportWidth:601,attributes:{mediaType:"image",mediaUrl:"https://s.w.org/images/core/5.3/Biologia_Centrali-Americana_-_Cantorchilus_semibadius_1902.jpg"},innerBlocks:[{name:"core/paragraph",attributes:{content:Object(ke.__)("The wren<br>Earns his living<br>Noiselessly.")}},{name:"core/paragraph",attributes:{content:Object(ke.__)("— Kobayashi Issa (一茶)")}}]},transforms:Rl,edit:Ml,save:function(e){let{attributes:t}=e;const{isStackedOnMobile:n,mediaAlt:o,mediaPosition:r,mediaType:a,mediaUrl:l,mediaWidth:c,mediaId:i,verticalAlignment:s,imageFill:u,focalPoint:m,linkClass:d,href:b,linkTarget:p,rel:g}=t,h=t.mediaSizeSlug||"full",v=Object(Me.isEmpty)(g)?void 0:g,O=tt()({["wp-image-"+i]:i&&"image"===a,["size-"+h]:i&&"image"===a});let j=Object(je.createElement)("img",{src:l,alt:o,className:O||null});b&&(j=Object(je.createElement)("a",{className:d,href:b,target:p,rel:v},j));const y={image:()=>j,video:()=>Object(je.createElement)("video",{controls:!0,src:l})},f=tt()({"has-media-on-the-right":"right"===r,"is-stacked-on-mobile":n,["is-vertically-aligned-"+s]:s,"is-image-fill":u}),_=u?_l(l,m):{};let k;50!==c&&(k="right"===r?`auto ${c}%`:c+"% auto");const w={gridTemplateColumns:k};return Object(je.createElement)("div",we.useBlockProps.save({className:f,style:w}),Object(je.createElement)("figure",{className:"wp-block-media-text__media",style:_},(y[a]||Me.noop)()),Object(je.createElement)("div",we.useInnerBlocksProps.save({className:"wp-block-media-text__content"})))},deprecated:Bl};var Al=n("1CF3");var Fl=Object(Pe.withDispatch)((e,t)=>{let{clientId:n,attributes:o}=t;const{replaceBlock:r}=e(we.store);return{convertToHTML(){r(n,Object(Oe.createBlock)("core/html",{content:o.originalUndelimitedContent}))}}})((function(e){let{attributes:t,convertToHTML:n}=e;const{originalName:o,originalUndelimitedContent:r}=t,a=!!r,l=Object(Oe.getBlockType)("core/html"),c=[];let i;return a&&l?(i=Object(ke.sprintf)(Object(ke.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely.'),o),c.push(Object(je.createElement)(_e.Button,{key:"convert",onClick:n,variant:"primary"},Object(ke.__)("Keep as HTML")))):i=Object(ke.sprintf)(Object(ke.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact or remove it entirely.'),o),Object(je.createElement)("div",Object(we.useBlockProps)({className:"has-warning"}),Object(je.createElement)(we.Warning,{actions:c},i),Object(je.createElement)(je.RawHTML,null,Object(Al.safeHTML)(r)))}));const Dl={apiVersion:2,name:"core/missing",title:"Unsupported",category:"text",description:"Your site doesn’t include support for this block.",textdomain:"default",attributes:{originalName:{type:"string"},originalUndelimitedContent:{type:"string"},originalContent:{type:"string",source:"html"}},supports:{className:!1,customClassName:!1,inserter:!1,html:!1,reusable:!1}},{name:Gl}=Dl,Ul={name:Gl,__experimentalLabel(e,t){let{context:n}=t;if("accessibility"===n){const{originalName:t}=e,n=t?Object(Oe.getBlockType)(t):void 0;return n?n.settings.title||t:""}},edit:Fl,save:function(e){let{attributes:t}=e;return Object(je.createElement)(je.RawHTML,null,t.originalContent)}};var ql=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z"}));const Wl=Object(ke.__)("Read more");var $l={from:[{type:"raw",schema:{"wp-block":{attributes:["data-block"]}},isMatch:e=>e.dataset&&"core/more"===e.dataset.block,transform(e){const{customText:t,noTeaser:n}=e.dataset,o={};return t&&(o.customText=t),""===n&&(o.noTeaser=!0),Object(Oe.createBlock)("core/more",o)}}]};const Zl={apiVersion:2,name:"core/more",title:"More",category:"design",description:"Content before this block will be shown in the excerpt on your archives page.",keywords:["read more"],textdomain:"default",attributes:{customText:{type:"string"},noTeaser:{type:"boolean",default:!1}},supports:{customClassName:!1,className:!1,html:!1,multiple:!1},editorStyle:"wp-block-more-editor"},{name:Kl}=Zl,Jl={icon:ql,example:{},__experimentalLabel(e,t){let{context:n}=t;if("accessibility"===n)return e.customText},transforms:$l,edit:function(e){let{attributes:{customText:t,noTeaser:n},insertBlocksAfter:o,setAttributes:r}=e;const a={width:(t||Wl).length+1.2+"em"};return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,null,Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Hide the excerpt on the full content page"),checked:!!n,onChange:()=>r({noTeaser:!n}),help:e=>e?Object(ke.__)("The excerpt is hidden."):Object(ke.__)("The excerpt is visible.")}))),Object(je.createElement)("div",Object(we.useBlockProps)(),Object(je.createElement)("div",{className:"wp-block-more"},Object(je.createElement)("input",{"aria-label":Object(ke.__)("Read more link text"),type:"text",value:t,placeholder:Wl,onChange:e=>{r({customText:""!==e.target.value?e.target.value:void 0})},onKeyDown:e=>{let{keyCode:t}=e;t===dt.ENTER&&o([Object(Oe.createBlock)(Object(Oe.getDefaultBlockName)())])},style:a}))))},save:function(e){let{attributes:{customText:t,noTeaser:n}}=e;const o=t?`\x3c!--more ${t}--\x3e`:"\x3c!--more--\x3e",r=n?"\x3c!--noteaser--\x3e":"";return Object(je.createElement)(je.RawHTML,null,Object(Me.compact)([o,r]).join("\n"))}};var Ql=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"})),Yl=n("OzlF");function Xl(e){let{clientId:t,__experimentalFeatures:n}=e;const o=Object(Pe.useSelect)(e=>e(we.store).__unstableGetClientIdsTree(t),[t]),r=Object(je.useRef)(),[a,l]=Object(je.useState)(300);return Object(je.useEffect)(()=>{var e,t;l(null!==(e=null==r||null===(t=r.current)||void 0===t?void 0:t.clientHeight)&&void 0!==e?e:300)},[]),Object(je.createElement)("div",{style:{minHeight:a}},Object(je.createElement)(we.__experimentalListView,{ref:r,blocks:o,showBlockMovers:!0,showNestedBlocks:!0,__experimentalFeatures:n}))}function ec(e){return Object(Pe.useSelect)(t=>{var n;const{getEntityRecord:o,getEditedEntityRecord:r,getEntityRecords:a,hasFinishedResolution:l,canUser:c}=t(It.store),i=["postType","wp_navigation",e],s=e?o(...i):null;let u=e?r(...i):null;"publish"!==(null===(n=u)||void 0===n?void 0:n.status)&&(u=null);const m=!!e&&l("getEditedEntityRecord",i),d=["postType","wp_navigation",{per_page:-1,status:"publish"}],b=a(...d),p=e?(null==b?void 0:b.length)>1:(null==b?void 0:b.length)>0;return{isNavigationMenuResolved:m,isNavigationMenuMissing:!e||m&&!s,canSwitchNavigationMenu:p,hasResolvedNavigationMenus:l("getEntityRecords",d),navigationMenu:u,navigationMenus:b,canUserUpdateNavigationEntity:e?c("update","navigation",e):void 0,hasResolvedCanUserUpdateNavigationEntity:l("canUser",["update","navigation",e]),canUserDeleteNavigationEntity:e?c("delete","navigation",e):void 0,hasResolvedCanUserDeleteNavigationEntity:l("canUser",["delete","navigation",e]),canUserCreateNavigation:c("create","navigation"),hasResolvedCanUserCreateNavigation:l("canUser",["create","navigation"])}},[e])}function tc(e){return{...rc(),...nc(),...oc(e)}}function nc(){const{menus:e,isResolvingMenus:t,hasResolvedMenus:n}=Object(Pe.useSelect)(e=>{const{getMenus:t,isResolving:n,hasFinishedResolution:o}=e(It.store),r=[{per_page:-1}];return{menus:t(...r),isResolvingMenus:n("getMenus",r),hasResolvedMenus:o("getMenus",r)}},[]);return{menus:e,isResolvingMenus:t,hasResolvedMenus:n,hasMenus:!(!n||null==e||!e.length)}}function oc(e){const{menuItems:t,hasResolvedMenuItems:n}=Object(Pe.useSelect)(t=>{const{getMenuItems:n,hasFinishedResolution:o}=t(It.store),r=void 0!==e,a=r?[{menus:e,per_page:-1}]:void 0;return{menuItems:r?n(...a):void 0,hasResolvedMenuItems:!!r&&o("getMenuItems",a)}},[e]);return{menuItems:t,hasResolvedMenuItems:n}}function rc(){const{pages:e,isResolvingPages:t,hasResolvedPages:n}=Object(Pe.useSelect)(e=>{const{getEntityRecords:t,isResolving:n,hasFinishedResolution:o}=e(It.store),r=["postType","page",{parent:0,order:"asc",orderby:"id",per_page:-1}];return{pages:t(...r)||null,isResolvingPages:n("getEntityRecords",r),hasResolvedPages:o("getEntityRecords",r)}},[]);return{pages:e,isResolvingPages:t,hasResolvedPages:n,hasPages:!(!n||null==e||!e.length)}}var ac=n("iClF"),lc=n("rmEH"),cc=n("cGtP");var ic=e=>{let{isLoading:t}=e;return Object(je.createElement)("ul",{className:tt()("wp-block-navigation-placeholder__preview","wp-block-navigation__container",{"is-loading":t})},Object(je.createElement)("li",{className:"wp-block-navigation-item"},""),Object(je.createElement)("li",{className:"wp-block-navigation-item"},""),Object(je.createElement)("li",{className:"wp-block-navigation-item"},""),Object(je.createElement)("li",{className:"wp-block-navigation-placeholder__preview-search-icon"},Object(je.createElement)(ac.a,{icon:cc.a})))};function sc(e,t){return e&&t?e+"//"+t:null}const uc=["postType","wp_navigation",{status:"draft",per_page:-1}],mc=["postType","wp_navigation",{per_page:-1,status:"publish"}];function dc(e){const t=Object(je.useContext)(_e.Disabled.Context),n=function(e){return Object(Pe.useSelect)(t=>{if(!e)return;const{getBlock:n,getBlockParentsByBlockName:o}=t(we.store),r=o(e,"core/template-part",!0);if(null==r||!r.length)return;const a=t("core/editor").__experimentalGetDefaultTemplatePartAreas(),{getEditedEntityRecord:l}=t(It.store);for(const e of r){const t=n(e),{theme:o,slug:r}=t.attributes,i=l("postType","wp_template_part",sc(o,r));var c;if(null!=i&&i.area)return null===(c=a.find(e=>"uncategorized"!==e.area&&e.area===i.area))||void 0===c?void 0:c.label}},[e])}(t?void 0:e),o=Object(Pe.useRegistry)();return Object(je.useCallback)(async()=>{if(t)return"";const{getEntityRecords:e}=o.resolveSelect(It.store),[r,a]=await Promise.all([e(...uc),e(...mc)]),l=n?Object(ke.sprintf)(Object(ke.__)("%s navigation"),n):Object(ke.__)("Navigation"),c=[...r,...a].reduce((e,t)=>{var n,o;return null!=t&&null!==(n=t.title)&&void 0!==n&&null!==(o=n.raw)&&void 0!==o&&o.startsWith(l)?e+1:e},0);return(c>0?`${l} ${c+1}`:l)||""},[t,n])}function bc(e){const{saveEntityRecord:t}=Object(Pe.useDispatch)(It.store),n=dc(e);return Object(je.useCallback)((async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e||(e=await n());const r={title:e,content:Object(Oe.serialize)(o),status:"publish"};return await t("postType","wp_navigation",r)}),[Oe.serialize,t])}function pc(e){if(!e)return null;const t=function e(t){let n={};const o=Object(Me.sortBy)(t,"menu_order");return{innerBlocks:o.map(t=>{var o,r;if("block"===t.type){const[e]=Object(Oe.parse)(t.content.raw);return e||Object(Oe.createBlock)("core/freeform",{content:t.content})}const a=function(e){var t;let{title:n,xfn:o,classes:r,attr_title:a,object:l,object_id:c,description:i,url:s,type:u,target:m}=e;l&&"post_tag"===l&&(l="tag");return{label:(null==n?void 0:n.rendered)||"",...(null===(t=l)||void 0===t?void 0:t.length)&&{type:l},kind:(null==u?void 0:u.replace("_","-"))||"custom",url:s||"",...(null==o?void 0:o.length)&&o.join(" ").trim()&&{rel:o.join(" ").trim()},...(null==r?void 0:r.length)&&r.join(" ").trim()&&{className:r.join(" ").trim()},...(null==a?void 0:a.length)&&{title:a},...c&&"custom"!==l&&{id:c},...(null==i?void 0:i.length)&&{description:i},..."_blank"===m&&{opensInNewTab:!0}}}(t),{innerBlocks:l=[],mapping:c={}}=null!==(o=t.children)&&void 0!==o&&o.length?e(t.children):{};n={...n,...c};const i=null!==(r=t.children)&&void 0!==r&&r.length?"core/navigation-submenu":"core/navigation-link",s=Object(Oe.createBlock)(i,a,l);return n[t.id]=s.clientId,s}),mapping:n}}(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"parent";const o=Object.create(null),r=[];for(const a of e)o[a[t]]={...a,children:[]},a[n]?(o[a[n]]=o[a[n]]||{},o[a[n]].children=o[a[n]].children||[],o[a[n]].children.push(o[a[t]])):r.push(o[a[t]]);return r}(e));return Object(Lr.applyFilters)("blocks.navigation.__unstableMenuItemsToBlocks",t,e)}function gc(e){const[t,n]=Object(je.useState)(),[o,r]=Object(je.useState)(!1),[a,l]=Object(je.useState)(""),{menuItems:c,hasResolvedMenuItems:i}=tc(t),s=Object(je.useCallback)(t=>{const{innerBlocks:n}=pc(c);e(n,t)},[c,pc,e]);return Object(je.useEffect)(()=>{o&&i&&(s(a),r(!1))},[o,i,a]),Object(je.useCallback)((e,t)=>{n(e),i?s(t):(r(!0),l(t))},[i,s])}const hc=e=>{let{canSwitchNavigationMenu:t,navigationMenus:n,onFinish:o,menus:r,onCreateFromMenu:a,showClassicMenus:l=!1}=e;return Object(je.createElement)(_e.DropdownMenu,{text:Object(ke.__)("Select menu"),icon:null,toggleProps:{variant:"tertiary",iconPosition:"right",className:"wp-block-navigation-placeholder__actions__dropdown"},popoverProps:{isAlternate:!0}},e=>{let{onClose:c}=e;return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.MenuGroup,{label:Object(ke.__)("Menus")},t&&(null==n?void 0:n.map(e=>Object(je.createElement)(_e.MenuItem,{onClick:()=>{o(e)},onClose:c,key:e.id},Object(lc.decodeEntities)(e.title.rendered))))),l&&Object(je.createElement)(_e.MenuGroup,{label:Object(ke.__)("Classic Menus")},null==r?void 0:r.map(e=>Object(je.createElement)(_e.MenuItem,{onClick:()=>{a(e.id,e.name)},onClose:c,key:e.id},Object(lc.decodeEntities)(e.name)))))})};function vc(e){let{clientId:t,onFinish:n,canSwitchNavigationMenu:o,hasResolvedNavigationMenus:r,canUserCreateNavigation:a=!1}=e;const l=bc(t),c=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!a)return;const o=await l(t,e);n(o,e)},i=gc(c),{isResolvingPages:s,menus:u,isResolvingMenus:m,hasPages:d,hasMenus:b}=tc(),p=s||m,{navigationMenus:g}=ec();return Object(je.createElement)(je.Fragment,null,(!r||p)&&Object(je.createElement)(ic,{isLoading:!0}),r&&!p&&Object(je.createElement)(_e.Placeholder,{className:"wp-block-navigation-placeholder"},Object(je.createElement)(ic,null),Object(je.createElement)("div",{className:"wp-block-navigation-placeholder__controls"},Object(je.createElement)("div",{className:"wp-block-navigation-placeholder__actions"},Object(je.createElement)("div",{className:"wp-block-navigation-placeholder__actions__indicator"},Object(je.createElement)(ac.a,{icon:Ql})," ",Object(ke.__)("Navigation")),Object(je.createElement)("hr",null),b||null!=g&&g.length?Object(je.createElement)(je.Fragment,null,Object(je.createElement)(hc,{canSwitchNavigationMenu:o,navigationMenus:g,onFinish:n,menus:u,onCreateFromMenu:i,showClassicMenus:a}),Object(je.createElement)("hr",null)):void 0,a&&d?Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.Button,{variant:"tertiary",onClick:()=>{const e=[Object(Oe.createBlock)("core/page-list")];c(e)}},Object(ke.__)("Add all pages")),Object(je.createElement)("hr",null)):void 0,a&&Object(je.createElement)(_e.Button,{variant:"tertiary",onClick:()=>{c([])}},Object(ke.__)("Start empty"))))))}var Oc=n("w95h");function jc(e){let{children:t,id:n,isOpen:o,isResponsive:r,onToggle:a,isHiddenByDefault:l,classNames:c,styles:i}=e;if(!r)return t;const s=tt()("wp-block-navigation__responsive-container",c,{"is-menu-open":o,"hidden-by-default":l}),u=tt()("wp-block-navigation__responsive-container-open",{"always-shown":l}),m=n+"-modal",d={className:"wp-block-navigation__responsive-dialog",...o&&{role:"dialog","aria-modal":!0,"aria-label":Object(ke.__)("Menu")}};return Object(je.createElement)(je.Fragment,null,!o&&Object(je.createElement)(_e.Button,{"aria-haspopup":"true","aria-label":Object(ke.__)("Open menu"),className:u,onClick:()=>a(!0)},Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",role:"img","aria-hidden":"true",focusable:"false"},Object(je.createElement)(ye.Rect,{x:"4",y:"7.5",width:"16",height:"1.5"}),Object(je.createElement)(ye.Rect,{x:"4",y:"15",width:"16",height:"1.5"}))),Object(je.createElement)("div",{className:s,style:i,id:m},Object(je.createElement)("div",{className:"wp-block-navigation__responsive-close",tabIndex:"-1"},Object(je.createElement)("div",d,Object(je.createElement)(_e.Button,{className:"wp-block-navigation__responsive-container-close","aria-label":Object(ke.__)("Close menu"),onClick:()=>a(!1)},Object(je.createElement)(ac.a,{icon:Oc.a})),Object(je.createElement)("div",{className:"wp-block-navigation__responsive-container-content",id:m+"-content"},t)))))}const yc=["core/navigation-link","core/search","core/social-links","core/page-list","core/spacer","core/home-link","core/site-title","core/site-logo","core/navigation-submenu"],fc=["core/navigation-link"],_c={type:"default",alignments:[]};function kc(e){let{isVisible:t,clientId:n,appender:o,hasCustomPlaceholder:r,orientation:a}=e;const{isImmediateParentOfSelectedBlock:l,selectedBlockHasDescendants:c,isSelected:i}=Object(Pe.useSelect)(e=>{var t;const{getClientIdsOfDescendants:o,hasSelectedInnerBlock:r,getSelectedBlockClientId:a}=e(we.store),l=a();return{isImmediateParentOfSelectedBlock:r(n,!1),selectedBlockHasDescendants:!(null===(t=o([l]))||void 0===t||!t.length),isSelected:l===n}},[n]),[s,u,m]=Object(It.useEntityBlockEditor)("postType","wp_navigation"),d=Object(je.useMemo)(()=>s.every(e=>{let{name:t}=e;return"core/navigation-link"===t||"core/navigation-submenu"===t||"core/page-list"===t}),[s]),b=!(!t||!(i||l&&!c))&&void 0,p=Object(je.useMemo)(()=>Object(je.createElement)(ic,null),[]),g=Object(we.useInnerBlocksProps)({className:"wp-block-navigation__container"},{value:s,onInput:u,onChange:m,allowedBlocks:yc,__experimentalDefaultBlock:fc,__experimentalDirectInsert:d,orientation:a,renderAppender:o||b,templateLock:!1,__experimentalLayout:_c,placeholder:!t||r?void 0:p});return Object(je.createElement)(we.__experimentalBlockContentOverlay,{clientId:n,tagName:"div",wrapperProps:g})}function wc(e){let{clientId:t,onSelect:n,onCreateNew:o,canUserCreateNavigation:r=!1}=e;const{menus:a,hasMenus:l}=tc(),{navigationMenus:c}=ec(),i=Object(It.useEntityId)("postType","wp_navigation"),s=bc(t),u=gc((async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!r)return;const o=await s(t,e);n(o)}));return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.MenuGroup,{label:Object(ke.__)("Menus")},Object(je.createElement)(_e.MenuItemsChoice,{value:i,onSelect:e=>n(c.find(t=>t.id===e)),choices:c.map(e=>{let{id:t,title:n}=e;const o=Object(lc.decodeEntities)(n.rendered);return{value:t,label:o,"aria-label":Object(ke.sprintf)(Object(ke.__)("Switch to '%s'"),o)}})})),r&&Object(je.createElement)(je.Fragment,null,l&&Object(je.createElement)(_e.MenuGroup,{label:Object(ke.__)("Classic Menus")},a.map(e=>Object(je.createElement)(_e.MenuItem,{onClick:()=>{u(e.id,e.name)},key:e.id},Object(lc.decodeEntities)(e.name)))),Object(je.createElement)(_e.MenuGroup,{label:Object(ke.__)("Tools")},Object(je.createElement)(_e.MenuItem,{onClick:o},Object(ke.__)("Create new menu")),Object(je.createElement)(_e.MenuItem,{href:Object(Jo.addQueryArgs)("edit.php",{post_type:"wp_navigation"})},Object(ke.__)("Manage menus")))))}function Ec(){const[e,t]=Object(It.useEntityProp)("postType","wp_navigation","title");return Object(je.createElement)(_e.TextControl,{label:Object(ke.__)("Menu name"),value:e,onChange:t})}const Cc={},xc=["postType","wp_navigation",{status:"draft",per_page:-1}];function Sc(e){let{blockProps:t,blocks:n,clientId:o,hasSavedUnsavedInnerBlocks:r,onSave:a,hasSelection:l}=e;const c=Object(je.useContext)(_e.Disabled.Context),i=Object(je.useRef)(!1),s=Object(we.useInnerBlocksProps)(t,{renderAppender:!!l&&void 0}),{isSaving:u,draftNavigationMenus:m,hasResolvedDraftNavigationMenus:d}=Object(Pe.useSelect)(e=>{if(c)return Cc;const{getEntityRecords:t,hasFinishedResolution:n,isSavingEntityRecord:o}=e(It.store);return{isSaving:o("postType","wp_navigation"),draftNavigationMenus:t(...xc),hasResolvedDraftNavigationMenus:n("getEntityRecords",xc)}},[c]),{hasResolvedNavigationMenus:b,navigationMenus:p}=ec(),g=bc(o);return Object(je.useEffect)(async()=>{if(c||r||u||i.current||!d||!b||!l)return;i.current=!0;const e=await g(null,n);a(e),i.current=!1},[c,u,d,b,m,p,l,g,n]),Object(je.createElement)("div",{className:"wp-block-navigation__unsaved-changes"},Object(je.createElement)(_e.Disabled,{className:tt()("wp-block-navigation__unsaved-changes-overlay",{"is-saving":l})},Object(je.createElement)("div",s)),l&&Object(je.createElement)(_e.Spinner,null))}function Bc(e){let{onDelete:t}=e;const[n,o]=Object(je.useState)(!1),r=Object(It.useEntityId)("postType","wp_navigation"),[a]=Object(It.useEntityProp)("postType","wp_navigation","title"),{deleteEntityRecord:l}=Object(Pe.useDispatch)(It.store);return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.Button,{className:"wp-block-navigation-delete-menu-button",variant:"secondary",isDestructive:!0,onClick:()=>{o(!0)}},Object(ke.__)("Delete menu")),n&&Object(je.createElement)(_e.Modal,{title:Object(ke.sprintf)(Object(ke.__)("Delete %s"),a),closeLabel:Object(ke.__)("Cancel"),onRequestClose:()=>o(!1)},Object(je.createElement)("p",null,Object(ke.__)("Are you sure you want to delete this navigation menu?")),Object(je.createElement)(_e.Flex,{justify:"flex-end"},Object(je.createElement)(_e.FlexItem,null,Object(je.createElement)(_e.Button,{variant:"secondary",onClick:()=>{o(!1)}},Object(ke.__)("Cancel"))),Object(je.createElement)(_e.FlexItem,null,Object(je.createElement)(_e.Button,{variant:"primary",onClick:()=>{l("postType","wp_navigation",r,{force:!0}),t()}},Object(ke.__)("Confirm"))))))}var Tc=function(){let{name:e,message:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=Object(je.useRef)(),{createWarningNotice:o,removeNotice:r}=Object(Pe.useDispatch)(Do.store),a=()=>{n.current||(n.current=e,o(t,{id:n.current,type:"snackbar"}))},l=()=>{n.current&&(r(n.current),n.current=null)};return[a,l]};const Nc=[];function zc(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function Pc(e,t,n){if(!e)return;t(zc(e).color);let o=e,r=zc(o).backgroundColor;for(;"rgba(0, 0, 0, 0)"===r&&o.parentNode&&o.parentNode.nodeType===o.parentNode.ELEMENT_NODE;)o=o.parentNode,r=zc(o).backgroundColor;n(r)}var Ic=Object(we.withColors)({textColor:"color"},{backgroundColor:"color"},{overlayBackgroundColor:"color"},{overlayTextColor:"color"})((function(e){let{attributes:t,setAttributes:n,clientId:o,isSelected:r,className:a,backgroundColor:l,setBackgroundColor:c,textColor:i,setTextColor:s,overlayBackgroundColor:u,setOverlayBackgroundColor:m,overlayTextColor:d,setOverlayTextColor:b,context:{navigationArea:p},hasSubmenuIndicatorSetting:g=!0,hasColorSettings:h=!0,customPlaceholder:v=null,customAppender:O=null}=e;const{openSubmenusOnClick:j,overlayMenu:y,showSubmenuIcon:f,layout:{justifyContent:_,orientation:k="horizontal",flexWrap:w="wrap"}={}}=t;let E=Me.noop;const C=p?void 0:t.ref,x=Object(Pe.useRegistry)(),S=Object(je.useCallback)(e=>{n({ref:e}),p&&E(e)},[p]),[B,T]=Object(we.__experimentalUseNoRecursiveRenders)("navigationMenu/"+C);tc();const{hasUncontrolledInnerBlocks:N,uncontrolledInnerBlocks:z,isInnerBlockSelected:P}=Object(Pe.useSelect)(e=>{const{getBlock:t,getBlocks:n,hasSelectedInnerBlock:r}=e(we.store),a=t(o).innerBlocks,l=null==a?void 0:a.length,c=l?Nc:n(o);return{hasSubmenus:!!(l?a:c).find(e=>"core/navigation-submenu"===e.name),hasUncontrolledInnerBlocks:l,uncontrolledInnerBlocks:a,isInnerBlockSelected:r(o,!0)}},[o]),{replaceInnerBlocks:I,selectBlock:M,__unstableMarkNextChangeAsNotPersistent:R}=Object(Pe.useDispatch)(we.store),[L,V]=Object(je.useState)(!1),H=!!p&&!C,[A,F]=Object(je.useState)(!N||H),[D,G]=Object(je.useState)(!1),{isNavigationMenuResolved:U,isNavigationMenuMissing:q,canSwitchNavigationMenu:W,hasResolvedNavigationMenus:$,navigationMenus:Z,navigationMenu:K,canUserUpdateNavigationEntity:J,hasResolvedCanUserUpdateNavigationEntity:Q,canUserDeleteNavigationEntity:Y,hasResolvedCanUserDeleteNavigationEntity:X,canUserCreateNavigation:ee,hasResolvedCanUserCreateNavigation:te}=ec(C),ne=Object(je.useRef)(),oe="draft"===(null==K?void 0:K.status),{listViewToolbarButton:re,listViewModal:ae}=function(e,t){const[n,o]=Object(je.useState)(!1);return{listViewToolbarButton:Object(je.createElement)(_e.ToolbarButton,{className:"components-toolbar__control",label:Object(ke.__)("Open list view"),onClick:()=>o(!0),icon:Yl.a}),listViewModal:n&&Object(je.createElement)(_e.Modal,{title:Object(ke.__)("List View"),closeLabel:Object(ke.__)("Close"),onRequestClose:()=>{o(!1)},shouldCloseOnClickOutside:!1},Object(je.createElement)(Xl,{clientId:e,__experimentalFeatures:t}))}}(o),le=!q&&U,ce=Object(we.useBlockProps)({ref:ne,className:tt()(a,{"items-justified-right":"right"===_,"items-justified-space-between":"space-between"===_,"items-justified-left":"left"===_,"items-justified-center":"center"===_,"is-vertical":"vertical"===k,"no-wrap":"nowrap"===w,"is-responsive":"never"!==y,"has-text-color":!!i.color||!(null==i||!i.class),[Object(we.getColorClassName)("color",null==i?void 0:i.slug)]:!(null==i||!i.slug),"has-background":!!l.color||l.class,[Object(we.getColorClassName)("background-color",null==l?void 0:l.slug)]:!(null==l||!l.slug)}),style:{color:!(null!=i&&i.slug)&&(null==i?void 0:i.color),backgroundColor:!(null!=l&&l.slug)&&(null==l?void 0:l.color)}}),ie=tt()({"has-text-color":!!d.color||!(null==d||!d.class),[Object(we.getColorClassName)("color",null==d?void 0:d.slug)]:!(null==d||!d.slug),"has-background":!!u.color||(null==u?void 0:u.class),[Object(we.getColorClassName)("background-color",null==u?void 0:u.slug)]:!(null==u||!u.slug)}),se={color:!(null!=d&&d.slug)&&(null==d?void 0:d.color),backgroundColor:!(null!=u&&u.slug)&&(null==u?void 0:u.color)&&u.color},ue="web"===je.Platform.OS,[me,de]=Object(je.useState)(),[be,pe]=Object(je.useState)(),[ge,he]=Object(je.useState)(),[ve,Oe]=Object(je.useState)();Object(je.useEffect)(()=>{k&&(R(),n({orientation:k}))},[k]),Object(je.useEffect)(()=>{var e;if(!ue)return;Pc(ne.current,pe,de);const t=null===(e=ne.current)||void 0===e?void 0:e.querySelector('[data-type="core/navigation-link"] [data-type="core/navigation-link"]');t&&Pc(t,Oe,he)}),Object(je.useEffect)(()=>{F(!le)},[le]);const[ye,fe]=Tc({name:"block-library/core/navigation/permissions/update",message:Object(ke.__)("You do not have permission to edit this Menu. Any changes made will not be saved.")}),[Ee,Ce]=Tc({name:"block-library/core/navigation/permissions/create",message:Object(ke.__)("You do not have permission to create Navigation Menus.")});Object(je.useEffect)(()=>{r||P||(fe(),Ce()),(r||P)&&(Q&&!J&&ye(),C||!te||ee||Ee())},[r,P,J,Q,ee,te,C]);const xe=Object(je.useCallback)(()=>{x.batch(()=>{p&&E(0),n({ref:void 0}),C||I(o,[]),F(!0)})},[o,C]);if(N&&!le)return Object(je.createElement)("nav",ce,Object(je.createElement)(jc,{id:o,onToggle:G,isOpen:D,isResponsive:"never"!==y,isHiddenByDefault:"always"===y,classNames:ie,styles:se},Object(je.createElement)(Sc,{blockProps:ce,blocks:z,clientId:o,navigationMenus:Z,hasSelection:r||P,hasSavedUnsavedInnerBlocks:L,onSave:e=>{V(!0),S(e.id)}})));if(C&&q)return Object(je.createElement)("div",ce,Object(je.createElement)(we.Warning,null,Object(ke.__)("Navigation menu has been deleted or is unavailable. "),Object(je.createElement)(_e.Button,{onClick:xe,variant:"link"},Object(ke.__)("Create a new menu?"))));if(le&&B)return Object(je.createElement)("div",ce,Object(je.createElement)(we.Warning,null,Object(ke.__)("Block cannot be rendered inside itself.")));const Se=v||vc;return Object(je.createElement)(It.EntityProvider,{kind:"postType",type:"wp_navigation",id:C},Object(je.createElement)(T,null,Object(je.createElement)(we.BlockControls,null,!oe&&le&&Object(je.createElement)(_e.ToolbarGroup,null,Object(je.createElement)(_e.ToolbarDropdownMenu,{label:Object(ke.__)("Select Menu"),text:Object(ke.__)("Select Menu"),icon:null},e=>{let{onClose:t}=e;return Object(je.createElement)(wc,{clientId:o,onSelect:e=>{let{id:n}=e;S(n),t()},onCreateNew:xe,canUserCreateNavigation:ee})})),Object(je.createElement)(_e.ToolbarGroup,null,re)),ae,Object(je.createElement)(we.InspectorControls,null,g&&Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Display")},Object(je.createElement)("h3",null,Object(ke.__)("Overlay Menu")),Object(je.createElement)(_e.__experimentalToggleGroupControl,{label:Object(ke.__)("Configure overlay menu"),value:y,help:Object(ke.__)("Collapses the navigation options in a menu icon opening an overlay."),onChange:e=>n({overlayMenu:e}),isBlock:!0,hideLabelFromVision:!0},Object(je.createElement)(_e.__experimentalToggleGroupControlOption,{value:"never",label:Object(ke.__)("Off")}),Object(je.createElement)(_e.__experimentalToggleGroupControlOption,{value:"mobile",label:Object(ke.__)("Mobile")}),Object(je.createElement)(_e.__experimentalToggleGroupControlOption,{value:"always",label:Object(ke.__)("Always")})),Object(je.createElement)("h3",null,Object(ke.__)("Submenus")),Object(je.createElement)(_e.ToggleControl,{checked:j,onChange:e=>{n({openSubmenusOnClick:e})},label:Object(ke.__)("Open on click")}),!t.openSubmenusOnClick&&Object(je.createElement)(_e.ToggleControl,{checked:f,onChange:e=>{n({showSubmenuIcon:e})},label:Object(ke.__)("Show icons")})),h&&Object(je.createElement)(we.PanelColorSettings,{__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,title:Object(ke.__)("Color"),initialOpen:!1,colorSettings:[{value:i.color,onChange:s,label:Object(ke.__)("Text")},{value:l.color,onChange:c,label:Object(ke.__)("Background")},{value:d.color,onChange:b,label:Object(ke.__)("Submenu & overlay text")},{value:u.color,onChange:m,label:Object(ke.__)("Submenu & overlay background")}]},ue&&Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.ContrastChecker,{backgroundColor:me,textColor:be}),Object(je.createElement)(we.ContrastChecker,{backgroundColor:ge,textColor:ve})))),le&&Object(je.createElement)(we.InspectorControls,{__experimentalGroup:"advanced"},Q&&J&&Object(je.createElement)(Ec,null),X&&Y&&Object(je.createElement)(Bc,{onDelete:xe})),Object(je.createElement)("nav",ce,A&&Object(je.createElement)(Se,{onFinish:e=>{F(!1),e&&S(e.id),M(o)},canSwitchNavigationMenu:W,hasResolvedNavigationMenus:$,clientId:o,canUserCreateNavigation:ee}),!te||!le&&!A&&Object(je.createElement)(ic,{isLoading:!0}),!A&&Object(je.createElement)(jc,{id:o,onToggle:G,isOpen:D,isResponsive:"never"!==y,isHiddenByDefault:"always"===y,classNames:ie,styles:se},le&&Object(je.createElement)(kc,{isVisible:!A,clientId:o,appender:O,hasCustomPlaceholder:!!v,orientation:k})))))}));const Mc={fontStyle:"var:preset|font-style|",fontWeight:"var:preset|font-weight|",textDecoration:"var:preset|text-decoration|",textTransform:"var:preset|text-transform|"},Rc=e=>{let{navigationMenuId:t,...n}=e;return{...n,ref:t}},Lc=e=>{if(e.layout)return e;const{itemsJustification:t,orientation:n,...o}=e;return(t||n)&&Object.assign(o,{layout:{type:"flex",...t&&{justifyContent:t},...n&&{orientation:n}}}),o};var Vc=[{attributes:{navigationMenuId:{type:"number"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"mobile"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}},__experimentalLayout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}}},save:()=>Object(je.createElement)(we.InnerBlocks.Content,null),isEligible:e=>{let{navigationMenuId:t}=e;return!!t},migrate:Rc},{attributes:{navigationMenuId:{type:"number"},orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"never"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}}},save:()=>Object(je.createElement)(we.InnerBlocks.Content,null),isEligible:e=>{let{itemsJustification:t,orientation:n}=e;return!!t||!!n},migrate:Object(nt.compose)(Rc,Lc)},{attributes:{orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"never"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}}},save:()=>Object(je.createElement)(we.InnerBlocks.Content,null),migrate:Object(nt.compose)(Rc,Lc,at),isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}},{attributes:{orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},isResponsive:{type:"boolean",default:"false"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0}},isEligible:e=>e.isResponsive,migrate:Object(nt.compose)(Rc,Lc,at,(function(e){return delete e.isResponsive,{...e,overlayMenu:"mobile"}})),save:()=>Object(je.createElement)(we.InnerBlocks.Content,null)},{attributes:{orientation:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,fontSize:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,color:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0},save:()=>Object(je.createElement)(we.InnerBlocks.Content,null),isEligible(e){if(!e.style||!e.style.typography)return!1;for(const t in Mc){const n=e.style.typography[t];if(n&&n.startsWith(Mc[t]))return!0}return!1},migrate:Object(nt.compose)(Rc,Lc,at,(function(e){return{...e,style:{...e.style,typography:Object(Me.mapValues)(e.style.typography,(e,t)=>{const n=Mc[t];if(n&&e.startsWith(n)){const o=e.slice(n.length);return"textDecoration"===t&&"strikethrough"===o?"line-through":o}return e})}}}))},{attributes:{className:{type:"string"},textColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean"}},isEligible:e=>e.rgbTextColor||e.rgbBackgroundColor,supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0},migrate:Object(nt.compose)(Rc,e=>({...Object(Me.omit)(e,["rgbTextColor","rgbBackgroundColor"]),customTextColor:e.textColor?void 0:e.rgbTextColor,customBackgroundColor:e.backgroundColor?void 0:e.rgbBackgroundColor})),save:()=>Object(je.createElement)(we.InnerBlocks.Content,null)}];const Hc={apiVersion:2,name:"core/navigation",title:"Navigation",category:"theme",description:"A collection of blocks that allow visitors to get around your site.",keywords:["menu","navigation","links"],textdomain:"default",attributes:{ref:{type:"number"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"mobile"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},usesContext:["navigationArea"],providesContext:{textColor:"textColor",customTextColor:"customTextColor",backgroundColor:"backgroundColor",customBackgroundColor:"customBackgroundColor",overlayTextColor:"overlayTextColor",customOverlayTextColor:"customOverlayTextColor",overlayBackgroundColor:"overlayBackgroundColor",customOverlayBackgroundColor:"customOverlayBackgroundColor",fontSize:"fontSize",customFontSize:"customFontSize",showSubmenuIcon:"showSubmenuIcon",openSubmenusOnClick:"openSubmenusOnClick",style:"style",orientation:"orientation"},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{units:["px","em","rem","vh","vw"]},__experimentalLayout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}}},viewScript:"file:./view.min.js",editorStyle:"wp-block-navigation-editor",style:"wp-block-navigation"},{name:Ac}=Hc,Fc={icon:Ql,example:{innerBlocks:[{name:"core/navigation-link",attributes:{label:Object(ke.__)("Home"),url:"https://make.wordpress.org/"}},{name:"core/navigation-link",attributes:{label:Object(ke.__)("About"),url:"https://make.wordpress.org/"}},{name:"core/navigation-link",attributes:{label:Object(ke.__)("Contact"),url:"https://make.wordpress.org/"}}]},edit:Ic,save:function(e){let{attributes:t}=e;if(!t.ref)return Object(je.createElement)(we.InnerBlocks.Content,null)},deprecated:Vc};var Dc=Object(je.createElement)(ye.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M12.5 14.5h-1V16h1c2.2 0 4-1.8 4-4s-1.8-4-4-4h-1v1.5h1c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5zm-4 1.5v-1.5h-1C6.1 14.5 5 13.4 5 12s1.1-2.5 2.5-2.5h1V8h-1c-2.2 0-4 1.8-4 4s1.8 4 4 4h1zm-1-3.2h5v-1.5h-5v1.5zM18 4H9c-1.1 0-2 .9-2 2v.5h1.5V6c0-.3.2-.5.5-.5h9c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5v-.5H7v.5c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z"}));var Gc=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z"}));const{name:Uc}={apiVersion:2,name:"core/navigation-link",title:"Custom Link",category:"design",parent:["core/navigation"],description:"Add a page, link, or another item to your navigation.",textdomain:"default",attributes:{label:{type:"string"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"},title:{type:"string"},kind:{type:"string"},isTopLevelLink:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","style"],supports:{reusable:!1,html:!1,__experimentalSlashInserter:!0},editorStyle:"wp-block-navigation-link-editor",style:"wp-block-navigation-link"};function qc(e,t){switch(e){case"post":case"page":return{type:"post",subtype:e};case"category":return{type:"term",subtype:"category"};case"tag":return{type:"term",subtype:"post_tag"};case"post_format":return{type:"post-format"};default:return"taxonomy"===t?{type:"term",subtype:e}:"post-type"===t?{type:"post",subtype:e}:{}}}function Wc(e){const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body.textContent||""}function $c(e){let{block:t,transforms:n,replace:o}=e;return Object(je.createElement)("div",{className:"link-control-transform"},Object(je.createElement)("h3",{className:"link-control-transform__subheading"},Object(ke.__)("Transform")),Object(je.createElement)("div",{className:"link-control-transform__items"},n.map((e,n)=>Object(je.createElement)(_e.Button,{key:"transform-"+n,onClick:()=>o(t.clientId,Object(Oe.switchToBlockType)(t,e.name)),className:"link-control-transform__item"},Object(je.createElement)(we.BlockIcon,{icon:e.icon}),e.title))))}var Zc=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M4 14.5h16V16H4zM4 18.5h9V20H4zM4 4h3c2 0 3 .86 3 2.583 0 .891-.253 1.554-.76 1.988-.505.435-1.24.652-2.204.652H5.542V12H4V4zm2.855 4c.53 0 .924-.114 1.18-.343.266-.228.398-.579.398-1.051 0-.473-.132-.82-.397-1.04-.265-.229-.67-.343-1.217-.343H5.542V8h1.313z"}));var Kc=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"}));var Jc=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"}));var Qc=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z"}));const Yc=[{name:"link",isDefault:!0,title:Object(ke.__)("Custom Link"),description:Object(ke.__)("A link to a custom URL."),attributes:{}},{name:"post",icon:Zc,title:Object(ke.__)("Post Link"),description:Object(ke.__)("A link to a post."),attributes:{type:"post",kind:"post-type"}},{name:"page",icon:Kc,title:Object(ke.__)("Page Link"),description:Object(ke.__)("A link to a page."),attributes:{type:"page",kind:"post-type"}},{name:"category",icon:Ht,title:Object(ke.__)("Category Link"),description:Object(ke.__)("A link to a category."),attributes:{type:"category",kind:"taxonomy"}},{name:"tag",icon:Jc,title:Object(ke.__)("Tag Link"),description:Object(ke.__)("A link to a tag."),attributes:{type:"tag",kind:"taxonomy"}}];Yc.forEach(e=>{e.isActive||(e.isActive=(e,t)=>e.type===t.type)});var Xc=Yc;function ei(e){switch(e){case"post":return Zc;case"page":return Kc;case"tag":return Jc;case"category":return Ht;default:return Qc}}var ti={from:[{type:"block",blocks:["core/site-logo"],transform:()=>Object(Oe.createBlock)("core/navigation-link")},{type:"block",blocks:["core/spacer"],transform:()=>Object(Oe.createBlock)("core/navigation-link")},{type:"block",blocks:["core/home-link"],transform:()=>Object(Oe.createBlock)("core/navigation-link")},{type:"block",blocks:["core/social-links"],transform:()=>Object(Oe.createBlock)("core/navigation-link")},{type:"block",blocks:["core/search"],transform:()=>Object(Oe.createBlock)("core/navigation-link")}],to:[{type:"block",blocks:["core/navigation-submenu"],transform:(e,t)=>Object(Oe.createBlock)("core/navigation-submenu",e,t)},{type:"block",blocks:["core/spacer"],transform:()=>Object(Oe.createBlock)("core/spacer")},{type:"block",blocks:["core/site-logo"],transform:()=>Object(Oe.createBlock)("core/site-logo")},{type:"block",blocks:["core/home-link"],transform:()=>Object(Oe.createBlock)("core/home-link")},{type:"block",blocks:["core/social-links"],transform:()=>Object(Oe.createBlock)("core/social-links")},{type:"block",blocks:["core/search"],transform:()=>Object(Oe.createBlock)("core/search",{showLabel:!1,buttonUseIcon:!0,buttonPosition:"button-inside"})}]};const ni={apiVersion:2,name:"core/navigation-link",title:"Custom Link",category:"design",parent:["core/navigation"],description:"Add a page, link, or another item to your navigation.",textdomain:"default",attributes:{label:{type:"string"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"},title:{type:"string"},kind:{type:"string"},isTopLevelLink:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","style"],supports:{reusable:!1,html:!1,__experimentalSlashInserter:!0},editorStyle:"wp-block-navigation-link-editor",style:"wp-block-navigation-link"},{name:oi}=ni,ri={icon:Dc,__experimentalLabel:e=>{let{label:t}=e;return t},merge(e,t){let{label:n=""}=t;return{...e,label:e.label+n}},edit:function(e){let{attributes:t,isSelected:n,setAttributes:o,insertBlocksAfter:r,mergeBlocks:a,onReplace:l,context:c,clientId:i}=e;const{label:s,type:u,opensInNewTab:m,url:d,description:b,rel:p,title:g,kind:h}=t,v={url:d,opensInNewTab:m,title:s&&Wc(s)},{saveEntityRecord:O}=Object(Pe.useDispatch)(It.store),{replaceBlock:j,__unstableMarkNextChangeAsNotPersistent:y}=Object(Pe.useDispatch)(we.store),[f,_]=Object(je.useState)(!1),k=Object(je.useRef)(null),w=(e=>{const[t,n]=Object(je.useState)(!1);return Object(je.useEffect)(()=>{const{ownerDocument:t}=e.current;function o(e){a(e)}function r(){n(!1)}function a(t){e.current.contains(t.target)?n(!0):n(!1)}return t.addEventListener("dragstart",o),t.addEventListener("dragend",r),t.addEventListener("dragenter",a),()=>{t.removeEventListener("dragstart",o),t.removeEventListener("dragend",r),t.removeEventListener("dragenter",a)}},[]),t})(k),E=Object(ke.__)("Add link…"),C=Object(je.useRef)(),{innerBlocks:x,isAtMaxNesting:S,isTopLevelLink:B,isParentOfSelectedBlock:T,hasDescendants:N,userCanCreatePages:z,userCanCreatePosts:P,thisBlock:I,blockTransforms:M}=Object(Pe.useSelect)(e=>{var t;const{getBlock:n,getBlocks:o,getBlockName:r,getBlockRootClientId:a,getClientIdsOfDescendants:l,hasSelectedInnerBlock:c,getSelectedBlockClientId:s,getBlockParentsByBlockName:u,getBlockTransformItems:m}=e(we.store),d=s(),b=l([i]).length;return{innerBlocks:o(i),isAtMaxNesting:u(i,[Uc,"core/navigation-submenu"]).length>=5,isTopLevelLink:"core/navigation"===r(a(i)),isParentOfSelectedBlock:c(i,!0),isImmediateParentOfSelectedBlock:c(i,!1),hasDescendants:!!b,selectedBlockHasDescendants:!(null===(t=l([d]))||void 0===t||!t.length),userCanCreatePages:e(It.store).canUser("create","pages"),userCanCreatePosts:e(It.store).canUser("create","posts"),thisBlock:n(i),blockTransforms:m([n(i)],a(i))}},[i]);function R(){const e=Object(Oe.createBlock)("core/navigation-submenu",t,x);j(i,e)}Object(je.useEffect)(()=>{y(),o({isTopLevelLink:B})},[B]);const L=["core/site-logo","core/social-links","core/search"],V=M.filter(e=>L.includes(e.name));Object(je.useEffect)(()=>{d||_(!0),N&&R()},[]),Object(je.useEffect)(()=>{n||_(!1)},[n]),Object(je.useEffect)(()=>{f&&d&&(Object(Jo.isURL)(Object(Jo.prependHTTP)(s))&&/^.+\.[a-z]+/.test(s)?function(){C.current.focus();const{ownerDocument:e}=C.current,{defaultView:t}=e,n=t.getSelection(),o=e.createRange();o.selectNodeContents(C.current),n.removeAllRanges(),n.addRange(o)}():Object(Al.placeCaretAtHorizontalEdge)(C.current,!0))},[d]);let H=!1;u&&"page"!==u?"post"===u&&(H=P):H=z;const{textColor:A,customTextColor:F,backgroundColor:D,customBackgroundColor:G}=function(e,t){var n,o;const{textColor:r,customTextColor:a,backgroundColor:l,customBackgroundColor:c,overlayTextColor:i,customOverlayTextColor:s,overlayBackgroundColor:u,customOverlayBackgroundColor:m,style:d}=e,b={};return t&&s?b.customTextColor=s:t&&i?b.textColor=i:a?b.customTextColor=a:r?b.textColor=r:null!=d&&null!==(n=d.color)&&void 0!==n&&n.text&&(b.customTextColor=d.color.text),t&&m?b.customBackgroundColor=m:t&&u?b.backgroundColor=u:c?b.customBackgroundColor=c:l?b.backgroundColor=l:null!=d&&null!==(o=d.color)&&void 0!==o&&o.background&&(b.customTextColor=d.color.background),b}(c,!B),U=Object(we.useBlockProps)({ref:k,className:tt()("wp-block-navigation-item",{"is-editing":n||T,"is-dragging-within":w,"has-link":!!d,"has-child":N,"has-text-color":!!A||!!F,[Object(we.getColorClassName)("color",A)]:!!A,"has-background":!!D||G,[Object(we.getColorClassName)("background-color",D)]:!!D}),style:{color:!A&&F,backgroundColor:!D&&G},onKeyDown:function(e){(dt.isKeyboardEvent.primary(e,"k")||!d&&e.keyCode===dt.ENTER)&&_(!0)}});d||(U.onClick=()=>_(!0));const q=tt()("wp-block-navigation-item__content",{"wp-block-navigation-link__placeholder":!d});let W="";switch(u){case"post":W=Object(ke.__)("Select post");break;case"page":W=Object(ke.__)("Select page");break;case"category":W=Object(ke.__)("Select category");break;case"tag":W=Object(ke.__)("Select tag");break;default:W=Object(ke.__)("Add link")}return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(_e.ToolbarGroup,null,Object(je.createElement)(_e.ToolbarButton,{name:"link",icon:bt.a,title:Object(ke.__)("Link"),shortcut:dt.displayShortcut.primary("k"),onClick:()=>_(!0)}),!S&&Object(je.createElement)(_e.ToolbarButton,{name:"submenu",icon:Gc,title:Object(ke.__)("Add submenu"),onClick:R}))),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Link settings")},Object(je.createElement)(_e.TextareaControl,{value:b||"",onChange:e=>{o({description:e})},label:Object(ke.__)("Description"),help:Object(ke.__)("The description will be displayed in the menu if the current theme supports it.")}),Object(je.createElement)(_e.TextControl,{value:g||"",onChange:e=>{o({title:e})},label:Object(ke.__)("Link title"),autoComplete:"off"}),Object(je.createElement)(_e.TextControl,{value:p||"",onChange:e=>{o({rel:e})},label:Object(ke.__)("Link rel"),autoComplete:"off"}))),Object(je.createElement)("div",U,Object(je.createElement)("a",{className:q},d?Object(je.createElement)(we.RichText,{ref:C,identifier:"label",className:"wp-block-navigation-item__label",value:s,onChange:e=>o({label:e}),onMerge:a,onReplace:l,__unstableOnSplitAtEnd:()=>r(Object(Oe.createBlock)("core/navigation-link")),"aria-label":Object(ke.__)("Navigation link text"),placeholder:E,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/image","core/strikethrough"],onClick:()=>{d||_(!0)}}):Object(je.createElement)("div",{className:"wp-block-navigation-link__placeholder-text"},Object(je.createElement)(_e.Tooltip,{position:"top center",text:Object(ke.__)("This item is missing a link")},Object(je.createElement)("span",null,W))),f&&Object(je.createElement)(_e.Popover,{position:"bottom center",onClose:()=>_(!1),anchorRef:k.current},Object(je.createElement)(we.__experimentalLinkControl,{hasTextControl:!0,className:"wp-block-navigation-link__inline-link-input",value:v,showInitialSuggestions:!0,withCreateSuggestion:H,createSuggestion:async function(e){const t=u||"page",n=await O("postType",t,{title:e,status:"draft"});return{id:n.id,type:t,title:n.title.rendered,url:n.link,kind:"post-type"}},createSuggestionButtonText:e=>{let t;return t="post"===u?Object(ke.__)("Create draft post: <mark>%s</mark>"):Object(ke.__)("Create draft page: <mark>%s</mark>"),Object(je.createInterpolateElement)(Object(ke.sprintf)(t,e),{mark:Object(je.createElement)("mark",null)})},noDirectEntry:!!u,noURLSuggestion:!!u,suggestionsQuery:qc(u,h),onChange:e=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{label:o="",kind:r="",type:a=""}=n,{title:l="",url:c="",opensInNewTab:i,id:s,kind:u=r,type:m=a}=e,d=l.replace(/http(s?):\/\//gi,""),b=c.replace(/http(s?):\/\//gi,""),p=""!==l&&d!==b&&o!==l,g=p?Object(Me.escape)(l):o||Object(Me.escape)(b),h="post_tag"===m?"tag":m.replace("-","_"),v=["post","page","tag","category"].indexOf(h)>-1,O=!u&&!v||"custom"===u,j=O?"custom":u;t({...c&&{url:encodeURI(Object(Jo.safeDecodeURI)(c))},...g&&{label:g},...void 0!==i&&{opensInNewTab:i},...s&&Number.isInteger(s)&&{id:s},...j&&{kind:j},...h&&"URL"!==h&&{type:h}})}(e,o,t),onRemove:function(){o({url:"",label:"",id:"",kind:"",type:""}),_(!1)},renderControlBottom:d?null:()=>Object(je.createElement)($c,{block:I,transforms:V,replace:j})})))))},save:function(){return Object(je.createElement)(we.InnerBlocks.Content,null)},example:{attributes:{label:Object(ke._x)("Example Link","navigation link preview example"),url:"https://example.com"}},deprecated:[{isEligible:e=>e.nofollow,attributes:{label:{type:"string"},type:{type:"string"},nofollow:{type:"boolean"},description:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"}},migrate(e){let{nofollow:t,...n}=e;return{rel:t?"nofollow":"",...n}},save:()=>Object(je.createElement)(we.InnerBlocks.Content,null)}],transforms:ti};Object(Lr.addFilter)("blocks.registerBlockType","core/navigation-link",(function(e,t){if("core/navigation-link"!==t)return e;if(!e.variations)return{...e,variations:Xc};if(e.variations){const t=(e,t)=>e.type===t.type,n=e.variations.map(e=>({...e,...!e.icon&&{icon:ei(e.name)},...!e.isActive&&{isActive:t}}));return{...e,variations:n}}return e}));var ai=n("gdqT");const li=()=>Object(je.createElement)(_e.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Object(je.createElement)(_e.Path,{d:"M1.50002 4L6.00002 8L10.5 4",strokeWidth:"1.5"})),{name:ci}={apiVersion:2,name:"core/navigation-submenu",title:"Submenu",category:"design",parent:["core/navigation"],description:"Add a submenu to your navigation.",textdomain:"default",attributes:{label:{type:"string"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"},title:{type:"string"},kind:{type:"string"},isTopLevelItem:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","openSubmenusOnClick","style"],supports:{reusable:!1,html:!1},editorStyle:"wp-block-navigation-submenu-editor",style:"wp-block-navigation-submenu"},ii=["core/navigation-link","core/navigation-submenu"],si=["core/navigation-link"];function ui(e,t){switch(e){case"post":case"page":return{type:"post",subtype:e};case"category":return{type:"term",subtype:"category"};case"tag":return{type:"term",subtype:"post_tag"};case"post_format":return{type:"post-format"};default:return"taxonomy"===t?{type:"term",subtype:e}:"post-type"===t?{type:"post",subtype:e}:{}}}function mi(e,t){var n,o;const{textColor:r,customTextColor:a,backgroundColor:l,customBackgroundColor:c,overlayTextColor:i,customOverlayTextColor:s,overlayBackgroundColor:u,customOverlayBackgroundColor:m,style:d}=e,b={};return t&&s?b.customTextColor=s:t&&i?b.textColor=i:a?b.customTextColor=a:r?b.textColor=r:null!=d&&null!==(n=d.color)&&void 0!==n&&n.text&&(b.customTextColor=d.color.text),t&&m?b.customBackgroundColor=m:t&&u?b.backgroundColor=u:c?b.customBackgroundColor=c:l?b.backgroundColor=l:null!=d&&null!==(o=d.color)&&void 0!==o&&o.background&&(b.customTextColor=d.color.background),b}var di={to:[{type:"block",blocks:["core/navigation-link"],isMatch:(e,t)=>{var n;return 0===(null==t||null===(n=t.innerBlocks)||void 0===n?void 0:n.length)},transform:e=>Object(Oe.createBlock)("core/navigation-link",e)},{type:"block",blocks:["core/spacer"],isMatch:(e,t)=>{var n;return 0===(null==t||null===(n=t.innerBlocks)||void 0===n?void 0:n.length)},transform:()=>Object(Oe.createBlock)("core/spacer")},{type:"block",blocks:["core/site-logo"],isMatch:(e,t)=>{var n;return 0===(null==t||null===(n=t.innerBlocks)||void 0===n?void 0:n.length)},transform:()=>Object(Oe.createBlock)("core/site-logo")},{type:"block",blocks:["core/home-link"],isMatch:(e,t)=>{var n;return 0===(null==t||null===(n=t.innerBlocks)||void 0===n?void 0:n.length)},transform:()=>Object(Oe.createBlock)("core/home-link")},{type:"block",blocks:["core/social-links"],isMatch:(e,t)=>{var n;return 0===(null==t||null===(n=t.innerBlocks)||void 0===n?void 0:n.length)},transform:()=>Object(Oe.createBlock)("core/social-links")},{type:"block",blocks:["core/search"],isMatch:(e,t)=>{var n;return 0===(null==t||null===(n=t.innerBlocks)||void 0===n?void 0:n.length)},transform:()=>Object(Oe.createBlock)("core/search")}]};const bi={apiVersion:2,name:"core/navigation-submenu",title:"Submenu",category:"design",parent:["core/navigation"],description:"Add a submenu to your navigation.",textdomain:"default",attributes:{label:{type:"string"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"},title:{type:"string"},kind:{type:"string"},isTopLevelItem:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","openSubmenusOnClick","style"],supports:{reusable:!1,html:!1},editorStyle:"wp-block-navigation-submenu-editor",style:"wp-block-navigation-submenu"},{name:pi}=bi,gi={icon:Gc,__experimentalLabel:e=>{let{label:t}=e;return t},edit:function(e){let{attributes:t,isSelected:n,setAttributes:o,mergeBlocks:r,onReplace:a,context:l,clientId:c}=e;const{label:i,type:s,opensInNewTab:u,url:m,description:d,rel:b,title:p,kind:g}=t,h={url:m,opensInNewTab:u},{showSubmenuIcon:v,openSubmenusOnClick:O}=l,{saveEntityRecord:j}=Object(Pe.useDispatch)(It.store),{__unstableMarkNextChangeAsNotPersistent:y}=Object(Pe.useDispatch)(we.store),[f,_]=Object(je.useState)(!1),k=Object(je.useRef)(null),w=(e=>{const[t,n]=Object(je.useState)(!1);return Object(je.useEffect)(()=>{const{ownerDocument:t}=e.current;function o(e){a(e)}function r(){n(!1)}function a(t){e.current.contains(t.target)?n(!0):n(!1)}return t.addEventListener("dragstart",o),t.addEventListener("dragend",r),t.addEventListener("dragenter",a),()=>{t.removeEventListener("dragstart",o),t.removeEventListener("dragend",r),t.removeEventListener("dragenter",a)}},[]),t})(k),E=Object(ke.__)("Add text…"),C=Object(je.useRef)(),{isAtMaxNesting:x,isTopLevelItem:S,isParentOfSelectedBlock:B,isImmediateParentOfSelectedBlock:T,hasDescendants:N,selectedBlockHasDescendants:z,userCanCreatePages:P,userCanCreatePosts:I}=Object(Pe.useSelect)(e=>{var t;const{getClientIdsOfDescendants:n,hasSelectedInnerBlock:o,getSelectedBlockClientId:r,getBlockParentsByBlockName:a}=e(we.store),l=r(),i=n([c]).length;return{isAtMaxNesting:a(c,ci).length>=5,isTopLevelItem:0===a(c,ci).length,isParentOfSelectedBlock:o(c,!0),isImmediateParentOfSelectedBlock:o(c,!1),hasDescendants:!!i,selectedBlockHasDescendants:!(null===(t=n([l]))||void 0===t||!t.length),userCanCreatePages:e(It.store).canUser("create","pages"),userCanCreatePosts:e(It.store).canUser("create","posts")}},[c]);Object(je.useEffect)(()=>{O||m||_(!0)},[]),Object(je.useEffect)(()=>{y(),o({isTopLevelItem:S})},[S]),Object(je.useEffect)(()=>{n||_(!1)},[n]),Object(je.useEffect)(()=>{f&&m&&(Object(Jo.isURL)(Object(Jo.prependHTTP)(i))&&/^.+\.[a-z]+/.test(i)?function(){C.current.focus();const{ownerDocument:e}=C.current,{defaultView:t}=e,n=t.getSelection(),o=e.createRange();o.selectNodeContents(C.current),n.removeAllRanges(),n.addRange(o)}():Object(Al.placeCaretAtHorizontalEdge)(C.current,!0))},[m]);let M=!1;s&&"page"!==s?"post"===s&&(M=I):M=P;const{textColor:R,customTextColor:L,backgroundColor:V,customBackgroundColor:H}=mi(l,!S),A=Object(we.useBlockProps)({ref:k,className:tt()("wp-block-navigation-item",{"is-editing":n||B,"is-dragging-within":w,"has-link":!!m,"has-child":N,"has-text-color":!!R||!!L,[Object(we.getColorClassName)("color",R)]:!!R,"has-background":!!V||H,[Object(we.getColorClassName)("background-color",V)]:!!V,"open-on-click":O}),style:{color:!R&&L,backgroundColor:!V&&H},onKeyDown:function(e){dt.isKeyboardEvent.primary(e,"k")&&_(!0)}}),F=mi(l,!0);x&&Object(Me.pull)(ii,"core/navigation-submenu");const D=Object(we.useInnerBlocksProps)({className:tt()("wp-block-navigation__submenu-container",{"is-parent-of-selected-block":B,"has-text-color":!(!F.textColor&&!F.customTextColor),[`has-${F.textColor}-color`]:!!F.textColor,"has-background":!(!F.backgroundColor&&!F.customBackgroundColor),[`has-${F.backgroundColor}-background-color`]:!!F.backgroundColor}),style:{color:F.customTextColor,backgroundColor:F.customBackgroundColor}},{allowedBlocks:ii,__experimentalDefaultBlock:si,__experimentalDirectInsert:!0,__experimentalCaptureToolbars:!0,renderAppender:!!(n||T&&!z||N)&&we.InnerBlocks.ButtonBlockAppender}),G=O?"button":"a";return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(_e.ToolbarGroup,null,!O&&Object(je.createElement)(_e.ToolbarButton,{name:"link",icon:bt.a,title:Object(ke.__)("Link"),shortcut:dt.displayShortcut.primary("k"),onClick:()=>_(!0)}))),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Link settings")},Object(je.createElement)(_e.TextareaControl,{value:d||"",onChange:e=>{o({description:e})},label:Object(ke.__)("Description"),help:Object(ke.__)("The description will be displayed in the menu if the current theme supports it.")}),Object(je.createElement)(_e.TextControl,{value:p||"",onChange:e=>{o({title:e})},label:Object(ke.__)("Link title"),autoComplete:"off"}),Object(je.createElement)(_e.TextControl,{value:b||"",onChange:e=>{o({rel:e})},label:Object(ke.__)("Link rel"),autoComplete:"off"}))),Object(je.createElement)("div",A,Object(je.createElement)(G,{className:"wp-block-navigation-item__content"},Object(je.createElement)(we.RichText,{ref:C,identifier:"label",className:"wp-block-navigation-item__label",value:i,onChange:e=>o({label:e}),onMerge:r,onReplace:a,"aria-label":Object(ke.__)("Navigation link text"),placeholder:E,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/image","core/strikethrough"],onClick:()=>{O||m||_(!0)}}),!O&&f&&Object(je.createElement)(_e.Popover,{position:"bottom center",onClose:()=>_(!1),anchorRef:k.current},Object(je.createElement)(we.__experimentalLinkControl,{className:"wp-block-navigation-link__inline-link-input",value:h,showInitialSuggestions:!0,withCreateSuggestion:M,createSuggestion:async function(e){const t=s||"page",n=await j("postType",t,{title:e,status:"draft"});return{id:n.id,type:t,title:n.title.rendered,url:n.link,kind:"post-type"}},createSuggestionButtonText:e=>{let t;return t="post"===s?Object(ke.__)("Create draft post: <mark>%s</mark>"):Object(ke.__)("Create draft page: <mark>%s</mark>"),Object(je.createInterpolateElement)(Object(ke.sprintf)(t,e),{mark:Object(je.createElement)("mark",null)})},noDirectEntry:!!s,noURLSuggestion:!!s,suggestionsQuery:ui(s,g),onChange:e=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{label:o="",kind:r="",type:a=""}=n,{title:l="",url:c="",opensInNewTab:i,id:s,kind:u=r,type:m=a}=e,d=l.replace(/http(s?):\/\//gi,""),b=c.replace(/http(s?):\/\//gi,""),p=""!==l&&d!==b&&o!==l,g=p?Object(Me.escape)(l):o||Object(Me.escape)(b),h="post_tag"===m?"tag":m.replace("-","_"),v=["post","page","tag","category"].indexOf(h)>-1,O=!u&&!v||"custom"===u,j=O?"custom":u;t({...c&&{url:encodeURI(Object(Jo.safeDecodeURI)(c))},...g&&{label:g},...void 0!==i&&{opensInNewTab:i},...s&&Number.isInteger(s)&&{id:s},...j&&{kind:j},...h&&"URL"!==h&&{type:h}})}(e,o,t),onRemove:()=>{o({url:""}),Object(ai.speak)(Object(ke.__)("Link removed."),"assertive")}})),(v||O)&&Object(je.createElement)("span",{className:"wp-block-navigation__submenu-icon"},Object(je.createElement)(li,null))),Object(je.createElement)("div",D)))},save:function(){return Object(je.createElement)(we.InnerBlocks.Content,null)},transforms:di};var hi=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M7.8 6c0-.7.6-1.2 1.2-1.2h6c.7 0 1.2.6 1.2 1.2v3h1.5V6c0-1.5-1.2-2.8-2.8-2.8H9C7.5 3.2 6.2 4.5 6.2 6v3h1.5V6zm8.4 11c0 .7-.6 1.2-1.2 1.2H9c-.7 0-1.2-.6-1.2-1.2v-3H6.2v3c0 1.5 1.2 2.8 2.8 2.8h6c1.5 0 2.8-1.2 2.8-2.8v-3h-1.5v3zM4 11v1h16v-1H4z"}));var vi={from:[{type:"raw",schema:{"wp-block":{attributes:["data-block"]}},isMatch:e=>e.dataset&&"core/nextpage"===e.dataset.block,transform:()=>Object(Oe.createBlock)("core/nextpage",{})}]};const Oi={apiVersion:2,name:"core/nextpage",title:"Page Break",category:"design",description:"Separate your content into a multi-page experience.",keywords:["next page","pagination"],parent:["core/post-content"],textdomain:"default",supports:{customClassName:!1,className:!1,html:!1},editorStyle:"wp-block-nextpage-editor"},{name:ji}=Oi,yi={icon:hi,example:{},transforms:vi,edit:function(){return Object(je.createElement)("div",Object(we.useBlockProps)(),Object(je.createElement)("div",{className:"wp-block-nextpage"},Object(je.createElement)("span",null,Object(ke.__)("Page break"))))},save:function(){return Object(je.createElement)(je.RawHTML,null,"\x3c!--nextpage--\x3e")}};var fi=e=>{let{attributes:t,clientId:n}=e;const o=Object(Pe.useSelect)(e=>e(we.store).__experimentalGetParsedPattern(t.slug),[t.slug]),{replaceBlocks:r,__unstableMarkNextChangeAsNotPersistent:a}=Object(Pe.useDispatch)(we.store);Object(je.useEffect)(()=>{null!=o&&o.blocks&&(a(),r(n,o.blocks))},[null==o?void 0:o.blocks]);const l=Object(we.useBlockProps)();return Object(je.createElement)("div",l)};const _i={apiVersion:2,name:"core/pattern",title:"Pattern",category:"theme",description:"Show a block pattern.",supports:{html:!1,inserter:!1},textdomain:"default",attributes:{slug:{type:"string"}}},{name:ki}=_i,wi={edit:fi};var Ei=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M7 13.8h6v-1.5H7v1.5zM18 16V4c0-1.1-.9-2-2-2H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2zM5.5 16V4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5zM7 10.5h8V9H7v1.5zm0-3.3h8V5.8H7v1.4zM20.2 6v13c0 .7-.6 1.2-1.2 1.2H8v1.5h11c1.5 0 2.7-1.2 2.7-2.8V6h-1.5z"}));const Ci=["id","title","link","type","parent"],xi=e=>{let{pages:t,clientId:n,replaceBlock:o,createBlock:r}=e;return()=>{if(!t)return;const e={},a=[];t.forEach(t=>{var n,o;let{id:l,title:c,link:i,type:s,parent:u}=t;const m=null!==(n=null===(o=e[l])||void 0===o?void 0:o.innerBlocks)&&void 0!==n?n:[];if(e[l]=r("core/navigation-link",{id:l,label:c.rendered,url:i,type:s,kind:"post-type"},m),u){e[u]||(e[u]={innerBlocks:[]});e[u].innerBlocks.push(e[l])}else a.push(e[l])});const l=e=>{e.forEach((e,t,n)=>{const{attributes:o,innerBlocks:a}=e;if(0!==a.length){l(a);const e=r("core/navigation-submenu",o,a);n[t]=e}})};l(a),o(n,a)}};function Si(e){let{onClose:t,clientId:n}=e;const{pages:o,pagesFinished:r}=Object(Pe.useSelect)(e=>{const{getEntityRecords:t,hasFinishedResolution:n}=e(It.store),o=["postType","page",{per_page:100,_fields:Ci,orderby:"menu_order",order:"asc"}];return{pages:t(...o),pagesFinished:n("getEntityRecords",o)}},[n]),{replaceBlock:a}=Object(Pe.useDispatch)(we.store);return Object(je.createElement)(_e.Modal,{closeLabel:Object(ke.__)("Close"),onRequestClose:t,title:Object(ke.__)("Convert to links"),className:"wp-block-page-list-modal",aria:{describedby:"wp-block-page-list-modal__description"}},Object(je.createElement)("p",{id:"wp-block-page-list-modal__description"},Object(ke.__)("To edit this navigation menu, convert it to single page links. This allows you to add, re-order, remove items, or edit their labels.")),Object(je.createElement)("p",null,Object(ke.__)("Note: if you add new pages to your site, you'll need to add them to your navigation menu.")),Object(je.createElement)("div",{className:"wp-block-page-list-modal-buttons"},Object(je.createElement)(_e.Button,{variant:"tertiary",onClick:t},Object(ke.__)("Cancel")),Object(je.createElement)(_e.Button,{variant:"primary",disabled:!r,onClick:xi({pages:o,replaceBlock:a,clientId:n,createBlock:Oe.createBlock})},Object(ke.__)("Convert"))))}const Bi=()=>Object(je.createElement)(_e.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Object(je.createElement)(_e.Path,{d:"M1.50002 4L6.00002 8L10.5 4",strokeWidth:"1.5"}));const Ti=Object(je.memo)((function e(t){let{context:n,pagesByParentId:o,parentId:r=0,depth:a=0}=t;const l=o.get(r),c=Object(Pe.useSelect)(e=>{const t=e(It.store).getEntityRecord("root","site");return"page"===(null==t?void 0:t.show_on_front)&&(null==t?void 0:t.page_on_front)},[]);return null!=l&&l.length?l.map(t=>{var r,l;const i=o.has(t.id),s="showSubmenuIcon"in n;return Object(je.createElement)("li",{key:t.id,className:tt()("wp-block-pages-list__item",{"has-child":i,"wp-block-navigation-item":s,"open-on-click":n.openSubmenusOnClick,"open-on-hover-click":!n.openSubmenusOnClick&&n.showSubmenuIcon,"menu-item-home":t.id===c})},i&&n.openSubmenusOnClick?Object(je.createElement)(Ni,{title:null===(r=t.title)||void 0===r?void 0:r.rendered}):Object(je.createElement)("a",{className:tt()("wp-block-pages-list__item__link",{"wp-block-navigation-item__content":s}),href:t.link},null===(l=t.title)||void 0===l?void 0:l.rendered),i&&Object(je.createElement)(je.Fragment,null,!n.openSubmenusOnClick&&n.showSubmenuIcon&&Object(je.createElement)(Ni,null),Object(je.createElement)("ul",{className:tt()("submenu-container",{"wp-block-navigation__submenu-container":s})},Object(je.createElement)(e,{context:n,pagesByParentId:o,parentId:t.id,depth:a+1}))))}):[]}));function Ni(e){let{title:t}=e;return Object(je.createElement)("button",{className:"wp-block-navigation-item__content wp-block-navigation-submenu__toggle","aria-expanded":"false"},t,Object(je.createElement)("span",{className:"wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"},Object(je.createElement)(Bi,null)))}const zi={apiVersion:2,name:"core/page-list",title:"Page List",category:"widgets",description:"Display a list of all pages.",keywords:["menu","navigation"],textdomain:"default",attributes:{},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","style","openSubmenusOnClick"],supports:{reusable:!1,html:!1},editorStyle:"wp-block-page-list-editor",style:"wp-block-page-list"},{name:Pi}=zi,Ii={icon:Ei,example:{},edit:function(e){var t;let{context:n,clientId:o}=e;const{pagesByParentId:r,totalPages:a,hasResolvedPages:l}=function(){const{pages:e,hasResolvedPages:t}=Object(Pe.useSelect)(e=>{const{getEntityRecords:t,hasFinishedResolution:n}=e(It.store);return{pages:t("postType","page",{orderby:"menu_order",order:"asc",_fields:["id","link","parent","title","menu_order"],per_page:-1}),hasResolvedPages:n("getEntityRecords",["postType","page",{orderby:"menu_order",order:"asc",_fields:["id","link","parent","title","menu_order"],per_page:-1}])}},[]);return Object(je.useMemo)(()=>{var n;return{pagesByParentId:Object(Me.sortBy)(e,["menu_order","title.rendered"]).reduce((e,t)=>{const{parent:n}=t;return e.has(n)?e.get(n).push(t):e.set(n,[t]),e},new Map),hasResolvedPages:t,totalPages:null!==(n=null==e?void 0:e.length)&&void 0!==n?n:null}},[e,t])}(),c="showSubmenuIcon"in n&&a<=100,[i,s]=Object(je.useState)(!1),u=Object(we.useBlockProps)({className:tt()("wp-block-page-list",{"has-text-color":!!n.textColor,[Object(we.getColorClassName)("color",n.textColor)]:!!n.textColor,"has-background":!!n.backgroundColor,[Object(we.getColorClassName)("background-color",n.backgroundColor)]:!!n.backgroundColor}),style:{...null===(t=n.style)||void 0===t?void 0:t.color}});return Object(je.createElement)(je.Fragment,null,c&&Object(je.createElement)(we.BlockControls,{group:"other"},Object(je.createElement)(_e.ToolbarButton,{title:Object(ke.__)("Edit"),onClick:()=>s(!0)},Object(ke.__)("Edit"))),c&&i&&Object(je.createElement)(Si,{onClose:()=>s(!1),clientId:o}),!l&&Object(je.createElement)("div",u,Object(je.createElement)(_e.Placeholder,null,Object(je.createElement)(_e.Spinner,null))),l&&null===a&&Object(je.createElement)("div",u,Object(je.createElement)("div",u,Object(je.createElement)(_e.Notice,{status:"warning",isDismissible:!1},Object(ke.__)("Page List: Cannot retrieve Pages.")))),0===a&&Object(je.createElement)("div",u,Object(je.createElement)(_e.Notice,{status:"info",isDismissible:!1},Object(ke.__)("Page List: Cannot retrieve Pages."))),a>0&&Object(je.createElement)("ul",u,Object(je.createElement)(Ti,{context:n,pagesByParentId:r})))}};var Mi=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M18.3 4H9.9v-.1l-.9.2c-2.3.4-4 2.4-4 4.8s1.7 4.4 4 4.8l.7.1V20h1.5V5.5h2.9V20h1.5V5.5h2.7V4z"}));const Ri={className:!1},Li={align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:""},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},textColor:{type:"string"},backgroundColor:{type:"string"},fontSize:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]},style:{type:"object"}},Vi=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customFontSize)return e;const t={};return(e.customTextColor||e.customBackgroundColor)&&(t.color={}),e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customFontSize&&(t.typography={fontSize:e.customFontSize}),{...Object(Me.omit)(e,["customTextColor","customBackgroundColor","customFontSize"]),style:t}};var Hi=[{supports:Ri,attributes:{...Object(Me.omit)(Li,["style"]),customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:Vi,save(e){let{attributes:t}=e;const{align:n,content:o,dropCap:r,backgroundColor:a,textColor:l,customBackgroundColor:c,customTextColor:i,fontSize:s,customFontSize:u,direction:m}=t,d=Object(we.getColorClassName)("color",l),b=Object(we.getColorClassName)("background-color",a),p=Object(we.getFontSizeClass)(s),g=tt()({"has-text-color":l||i,"has-background":a||c,"has-drop-cap":r,["has-text-align-"+n]:n,[p]:p,[d]:d,[b]:b}),h={backgroundColor:b?void 0:c,color:d?void 0:i,fontSize:p?void 0:u};return Object(je.createElement)(we.RichText.Content,{tagName:"p",style:h,className:g||void 0,value:o,dir:m})}},{supports:Ri,attributes:{...Object(Me.omit)(Li,["style"]),customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:Vi,save(e){let{attributes:t}=e;const{align:n,content:o,dropCap:r,backgroundColor:a,textColor:l,customBackgroundColor:c,customTextColor:i,fontSize:s,customFontSize:u,direction:m}=t,d=Object(we.getColorClassName)("color",l),b=Object(we.getColorClassName)("background-color",a),p=Object(we.getFontSizeClass)(s),g=tt()({"has-text-color":l||i,"has-background":a||c,"has-drop-cap":r,[p]:p,[d]:d,[b]:b}),h={backgroundColor:b?void 0:c,color:d?void 0:i,fontSize:p?void 0:u,textAlign:n};return Object(je.createElement)(we.RichText.Content,{tagName:"p",style:h,className:g||void 0,value:o,dir:m})}},{supports:Ri,attributes:{...Object(Me.omit)(Li,["style"]),customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"},width:{type:"string"}},migrate:Vi,save(e){let{attributes:t}=e;const{width:n,align:o,content:r,dropCap:a,backgroundColor:l,textColor:c,customBackgroundColor:i,customTextColor:s,fontSize:u,customFontSize:m}=t,d=Object(we.getColorClassName)("color",c),b=Object(we.getColorClassName)("background-color",l),p=u&&`is-${u}-text`,g=tt()({["align"+n]:n,"has-background":l||i,"has-drop-cap":a,[p]:p,[d]:d,[b]:b}),h={backgroundColor:b?void 0:i,color:d?void 0:s,fontSize:p?void 0:m,textAlign:o};return Object(je.createElement)(we.RichText.Content,{tagName:"p",style:h,className:g||void 0,value:r})}},{supports:Ri,attributes:Object(Me.omit)({...Li,fontSize:{type:"number"}},["style"]),save(e){let{attributes:t}=e;const{width:n,align:o,content:r,dropCap:a,backgroundColor:l,textColor:c,fontSize:i}=t,s=tt()({["align"+n]:n,"has-background":l,"has-drop-cap":a}),u={backgroundColor:l,color:c,fontSize:i,textAlign:o};return Object(je.createElement)("p",{style:u,className:s||void 0},r)},migrate:e=>Vi(Object(Me.omit)({...e,customFontSize:Object(Me.isFinite)(e.fontSize)?e.fontSize:void 0,customTextColor:e.textColor&&"#"===e.textColor[0]?e.textColor:void 0,customBackgroundColor:e.backgroundColor&&"#"===e.backgroundColor[0]?e.backgroundColor:void 0}))},{supports:Ri,attributes:{...Li,content:{type:"string",source:"html",default:""}},save(e){let{attributes:t}=e;return Object(je.createElement)(je.RawHTML,null,t.content)},migrate:e=>e}];var Ai=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(je.createElement)(ye.Path,{d:"M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z"}));function Fi(e){let{direction:t,setDirection:n}=e;return Object(ke.isRTL)()&&Object(je.createElement)(_e.ToolbarDropdownMenu,{controls:[{icon:Ai,title:Object(ke._x)("Left to right","editor button"),isActive:"ltr"===t,onClick(){n("ltr"===t?void 0:"ltr")}}]})}var Di=function(e){let{attributes:t,mergeBlocks:n,onReplace:o,onRemove:r,setAttributes:a,clientId:l}=e;const{align:c,content:i,direction:s,dropCap:u,placeholder:m}=t,d=Object(we.useSetting)("typography.dropCap"),b=Object(we.useBlockProps)({className:tt()({"has-drop-cap":u,["has-text-align-"+c]:c}),style:{direction:s}});return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(we.AlignmentControl,{value:c,onChange:e=>a({align:e})}),Object(je.createElement)(Fi,{direction:s,setDirection:e=>a({direction:e})})),d&&Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Text settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Drop cap"),checked:!!u,onChange:()=>a({dropCap:!u}),help:u?Object(ke.__)("Showing large initial letter."):Object(ke.__)("Toggle to show a large initial letter.")}))),Object(je.createElement)(we.RichText,Object(mt.a)({identifier:"content",tagName:"p"},b,{value:i,onChange:e=>a({content:e}),onSplit:(e,n)=>{let o;(n||e)&&(o={...t,content:e});const r=Object(Oe.createBlock)("core/paragraph",o);return n&&(r.clientId=l),r},onMerge:n,onReplace:o,onRemove:r,"aria-label":i?Object(ke.__)("Paragraph block"):Object(ke.__)("Empty block; start writing or type forward slash to choose a block"),"data-empty":!i,placeholder:m||Object(ke.__)("Type / to choose a block"),__unstableEmbedURLOnPaste:!0,__unstableAllowPrefixTransformations:!0})))};const{name:Gi}={apiVersion:2,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the building block of all narrative.",keywords:["text"],textdomain:"default",attributes:{align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:"",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{anchor:!0,className:!1,color:{link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"};var Ui={from:[{type:"raw",priority:20,selector:"p",schema:e=>{let{phrasingContentSchema:t,isPaste:n}=e;return{p:{children:t,attributes:n?[]:["style","id"]}}},transform(e){const t=Object(Oe.getBlockAttributes)(Gi,e.outerHTML),{textAlign:n}=e.style||{};return"left"!==n&&"center"!==n&&"right"!==n||(t.align=n),Object(Oe.createBlock)(Gi,t)}}]};const qi={apiVersion:2,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the building block of all narrative.",keywords:["text"],textdomain:"default",attributes:{align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:"",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{anchor:!0,className:!1,color:{link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},{name:Wi}=qi,$i={icon:Mi,example:{attributes:{content:Object(ke.__)("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing."),style:{typography:{fontSize:28}},dropCap:!0}},__experimentalLabel(e,t){let{context:n}=t;if("accessibility"===n){const{content:t}=e;return Object(Me.isEmpty)(t)?Object(ke.__)("Empty"):t}},transforms:Ui,deprecated:Hi,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:Di,save:function(e){let{attributes:t}=e;const{align:n,content:o,dropCap:r,direction:a}=t,l=tt()({"has-drop-cap":r,["has-text-align-"+n]:n});return Object(je.createElement)("p",we.useBlockProps.save({className:l,dir:a}),Object(je.createElement)(we.RichText.Content,{value:o}))}};var Zi=function(e){let{isSelected:t,context:{postType:n,postId:o,queryId:r},attributes:a,setAttributes:l}=e;const c=Number.isFinite(r),{authorId:i,authorDetails:s,authors:u}=Object(Pe.useSelect)(e=>{var t;const{getEditedEntityRecord:r,getUser:a,getUsers:l}=e(It.store),c=null===(t=r("postType",n,o))||void 0===t?void 0:t.author;return{authorId:c,authorDetails:c?a(c):null,authors:l({who:"authors"})}},[n,o]),{editEntityRecord:m}=Object(Pe.useDispatch)(It.store),{textAlign:d,showAvatar:b,showBio:p,byline:g}=a,h=[];s&&Object(Me.forEach)(s.avatar_urls,(e,t)=>{h.push({value:t,label:`${t} x ${t}`})});const v=Object(we.useBlockProps)({className:tt()({["has-text-align-"+d]:d})});return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Author Settings")},!c&&!(null==u||!u.length)&&Object(je.createElement)(_e.SelectControl,{label:Object(ke.__)("Author"),value:i,options:u.map(e=>{let{id:t,name:n}=e;return{value:t,label:n}}),onChange:e=>{m("postType",n,o,{author:e})}}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Show avatar"),checked:b,onChange:()=>l({showAvatar:!b})}),b&&Object(je.createElement)(_e.SelectControl,{label:Object(ke.__)("Avatar size"),value:a.avatarSize,options:h,onChange:e=>{l({avatarSize:Number(e)})}}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Show bio"),checked:p,onChange:()=>l({showBio:!p})}))),Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(we.AlignmentControl,{value:d,onChange:e=>{l({textAlign:e})}})),Object(je.createElement)("div",v,b&&s&&Object(je.createElement)("div",{className:"wp-block-post-author__avatar"},Object(je.createElement)("img",{width:a.avatarSize,src:s.avatar_urls[a.avatarSize],alt:s.name})),Object(je.createElement)("div",{className:"wp-block-post-author__content"},(!we.RichText.isEmpty(g)||t)&&Object(je.createElement)(we.RichText,{className:"wp-block-post-author__byline",multiline:!1,"aria-label":Object(ke.__)("Post author byline text"),placeholder:Object(ke.__)("Write byline…"),value:g,onChange:e=>l({byline:e})}),Object(je.createElement)("p",{className:"wp-block-post-author__name"},(null==s?void 0:s.name)||Object(ke.__)("Post Author")),p&&Object(je.createElement)("p",{className:"wp-block-post-author__bio"},null==s?void 0:s.description))))};var Ki=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z",fillRule:"evenodd",clipRule:"evenodd"}));const Ji={apiVersion:2,name:"core/post-author",title:"Post Author",category:"theme",description:"Add the author of this post.",textdomain:"default",attributes:{textAlign:{type:"string"},avatarSize:{type:"number",default:48},showAvatar:{type:"boolean",default:!0},showBio:{type:"boolean"},byline:{type:"string"}},usesContext:["postType","postId","queryId"],supports:{html:!1,spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDuotone:".wp-block-post-author__avatar img"}},editorStyle:"wp-block-post-author-editor",style:"wp-block-post-author"},{name:Qi}=Ji,Yi={icon:Ki,edit:Zi};var Xi=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z"}));function es(e){let{postId:t}=e;return Object(Pe.useSelect)(e=>{const n=e(It.store).getEntityRecords("root","comment",{post:t});return n&&n.length?n.map(e=>Object(je.createElement)(je.RawHTML,{className:"wp-block-post-comments__comment",key:e.id},e.content.rendered)):Object(ke.__)("No comments.")},[t])}const ts={apiVersion:2,name:"core/post-comments",title:"Post Comments",category:"theme",description:"Display a post's comments.",textdomain:"default",attributes:{textAlign:{type:"string"}},usesContext:["postId","postType"],supports:{html:!1,align:["wide","full"],typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0}},style:["wp-block-post-comments","wp-block-buttons","wp-block-button"]},{name:ns}=ts,os={icon:Xi,edit:function(e){let{attributes:t,setAttributes:n,context:o}=e;const{postType:r,postId:a}=o,{textAlign:l}=t,c=Object(we.useBlockProps)({className:tt()({["has-text-align-"+l]:l})});return r&&a?Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(we.AlignmentControl,{value:l,onChange:e=>{n({textAlign:e})}})),Object(je.createElement)("div",c,Object(je.createElement)(es,{postId:a}))):Object(je.createElement)("div",c,Object(je.createElement)(we.Warning,null,Object(ke.__)("Post comments block: no post found.")))}};var rs=Object(je.createElement)(ye.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M4 20h16v-1.5H4V20zm0-4.8h16v-1.5H4v1.5zm0-6.4v1.5h16V8.8H4zM16 4H4v1.5h12V4z"}));function as(e,t,n){return Object(Pe.useSelect)(o=>o(It.store).canUserEditEntityRecord(e,t,n),[e,t,n])}function ls(e){let{userCanEdit:t,postType:n,postId:o}=e;const[,,r]=Object(It.useEntityProp)("postType",n,"content",o),a=Object(we.useBlockProps)();return null!=r&&r.protected&&!t?Object(je.createElement)("div",a,Object(je.createElement)(we.Warning,null,Object(ke.__)("This content is password protected."))):Object(je.createElement)("div",a,Object(je.createElement)(je.RawHTML,{key:"html"},null==r?void 0:r.rendered))}function cs(e){let{layout:t,context:n={}}=e;const{postType:o,postId:r}=n,a=Object(Pe.useSelect)(e=>{var t;const{getSettings:n}=e(we.store);return null===(t=n())||void 0===t?void 0:t.supportsLayout},[]),l=Object(we.useSetting)("layout")||{},c=t&&t.inherit?l:t,[i,s,u]=Object(It.useEntityBlockEditor)("postType",o,{id:r}),m=Object(we.useInnerBlocksProps)(Object(we.useBlockProps)({className:"entry-content"}),{value:i,onInput:s,onChange:u,__experimentalLayout:a?c:void 0});return Object(je.createElement)("div",m)}function is(e){const{context:{queryId:t,postType:n,postId:o}={}}=e,r=Number.isFinite(t),a=as("postType",n,o);return a&&!r?Object(je.createElement)(cs,e):Object(je.createElement)(ls,{userCanEdit:a,postType:n,postId:o})}function ss(){const e=Object(we.useBlockProps)();return Object(je.createElement)("div",e,Object(je.createElement)("p",null,Object(ke.__)("Post Content")))}function us(){const e=Object(we.useBlockProps)();return Object(je.createElement)("div",e,Object(je.createElement)(we.Warning,null,Object(ke.__)("Block cannot be rendered inside itself.")))}const ms={apiVersion:2,name:"core/post-content",title:"Post Content",category:"theme",description:"Displays the contents of a post or page.",textdomain:"default",usesContext:["postId","postType","queryId"],supports:{align:["wide","full"],html:!1,__experimentalLayout:!0},editorStyle:"wp-block-post-content-editor"},{name:ds}=ms,bs={icon:rs,edit:function(e){let{context:t,attributes:n}=e;const{postId:o,postType:r}=t,{layout:a={}}=n,[l,c]=Object(we.__experimentalUseNoRecursiveRenders)(o);return o&&r&&l?Object(je.createElement)(us,null):Object(je.createElement)(c,null,o&&r?Object(je.createElement)(is,{context:t,layout:a}):Object(je.createElement)(ss,null))}};var ps=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"}),Object(je.createElement)(ye.Path,{d:"M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"}));var gs=[{attributes:{textAlign:{type:"string"},format:{type:"string"},isLink:{type:"boolean",default:!1}},supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0}},save:()=>null,migrate:at,isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}}];const hs={apiVersion:2,name:"core/post-date",title:"Post Date",category:"theme",description:"Add the date of this post.",textdomain:"default",attributes:{textAlign:{type:"string"},format:{type:"string"},isLink:{type:"boolean",default:!1}},usesContext:["postId","postType","queryId"],supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}}}},{name:vs}=hs,Os={icon:ps,edit:function(e){let{attributes:{textAlign:t,format:n,isLink:o},context:{postId:r,postType:a,queryId:l},setAttributes:c}=e;const i=Number.isFinite(l),[s]=Object(It.useEntityProp)("root","site","date_format"),[u,m]=Object(It.useEntityProp)("postType",a,"date",r),d=Object(Wa.__experimentalGetSettings)(),b=/a(?!\\)/i.test(d.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join("")),p=Object.values(d.formats).map(e=>({key:e,name:Object(Wa.dateI18n)(e,u)})),g=n||s||d.formats.date,h=Object(we.useBlockProps)({className:tt()({["has-text-align-"+t]:t})}),v=Object(je.useRef)();let O=u?Object(je.createElement)("time",{dateTime:Object(Wa.dateI18n)("c",u),ref:v},Object(Wa.dateI18n)(g,u)):Object(ke.__)("Post Date");return o&&u&&(O=Object(je.createElement)("a",{href:"#post-date-pseudo-link",onClick:e=>e.preventDefault()},O)),Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(we.AlignmentControl,{value:t,onChange:e=>{c({textAlign:e})}}),u&&!i&&Object(je.createElement)(_e.ToolbarGroup,null,Object(je.createElement)(_e.Dropdown,{popoverProps:{anchorRef:v.current},renderContent:()=>Object(je.createElement)(_e.DateTimePicker,{currentDate:u,onChange:m,is12Hour:b}),renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return Object(je.createElement)(_e.ToolbarButton,{"aria-expanded":t,icon:to.a,title:Object(ke.__)("Change Date"),onClick:n,onKeyDown:e=>{t||e.keyCode!==dt.DOWN||(e.preventDefault(),n())}})}}))),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Format settings")},Object(je.createElement)(_e.CustomSelectControl,{hideLabelFromVision:!0,label:Object(ke.__)("Date Format"),options:p,onChange:e=>{let{selectedItem:t}=e;return c({format:t.key})},value:p.find(e=>e.key===g)})),Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Link settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.sprintf)(Object(ke.__)("Link to %s"),a),onChange:()=>c({isLink:!o}),checked:o}))),Object(je.createElement)("div",h,O))},deprecated:gs};var js=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M12.75 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.395.395 0 00.199-.166c.05-.083.114-.253.114-.584V7.2H8.8V4h3.95v5.333zM7.95 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.394.394 0 00.198-.166c.05-.083.115-.253.115-.584V7.2H4V4h3.95v5.333zM13 20H4v-1.5h9V20zM20 16H4v-1.5h16V16z"}));const ys={apiVersion:2,name:"core/post-excerpt",title:"Post Excerpt",category:"theme",description:"Display a post's excerpt.",textdomain:"default",attributes:{textAlign:{type:"string"},moreText:{type:"string"},showMoreOnNewLine:{type:"boolean",default:!0}},usesContext:["postId","postType","queryId"],supports:{html:!1,color:{gradients:!0,link:!0},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}}},editorStyle:"wp-block-post-excerpt-editor",style:"wp-block-post-excerpt"},{name:fs}=ys,_s={icon:js,edit:function(e){let{attributes:{textAlign:t,moreText:n,showMoreOnNewLine:o},setAttributes:r,isSelected:a,context:{postId:l,postType:c,queryId:i}}=e;const s=Number.isFinite(i),u=as("postType",c,l),m=u&&!s,[d,b,{rendered:p,protected:g}={}]=Object(It.useEntityProp)("postType",c,"excerpt",l),h=Object(we.useBlockProps)({className:tt()({["has-text-align-"+t]:t})}),v=Object(je.useMemo)(()=>{if(!p)return"";const e=(new window.DOMParser).parseFromString(p,"text/html");return e.body.textContent||e.body.innerText||""},[p]);if(!c||!l)return Object(je.createElement)("div",h,Object(ke.__)("Post Excerpt"));if(g&&!u)return Object(je.createElement)("div",h,Object(je.createElement)(we.Warning,null,Object(ke.__)("There is no excerpt because this is a protected post.")));const O=Object(je.createElement)(we.RichText,{className:"wp-block-post-excerpt__more-link",tagName:"a","aria-label":Object(ke.__)('"Read more" link text'),placeholder:Object(ke.__)('Add "read more" link text'),value:n,onChange:e=>r({moreText:e}),withoutInteractiveFormatting:!0}),j=m?Object(je.createElement)(we.RichText,{className:!o&&"wp-block-post-excerpt__excerpt is-inline","aria-label":Object(ke.__)("Post excerpt text"),value:d||v||(a?"":Object(ke.__)("No post excerpt found")),onChange:b}):p&&Object(je.createElement)(_e.Disabled,null,Object(je.createElement)(je.RawHTML,{key:"html"},p))||Object(ke.__)("No post excerpt found");return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(we.AlignmentToolbar,{value:t,onChange:e=>r({textAlign:e})})),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Post Excerpt Settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Show link on new line"),checked:o,onChange:e=>r({showMoreOnNewLine:e})}))),Object(je.createElement)("div",h,j,!o&&" ",o?Object(je.createElement)("p",{className:"wp-block-post-excerpt__more-text"},O):O))}};var ks=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"}));const ws=Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.__experimentalToggleGroupControlOption,{value:"cover",label:Object(ke._x)("Cover","Scale option for Image dimension control")}),Object(je.createElement)(_e.__experimentalToggleGroupControlOption,{value:"contain",label:Object(ke._x)("Contain","Scale option for Image dimension control")}),Object(je.createElement)(_e.__experimentalToggleGroupControlOption,{value:"fill",label:Object(ke._x)("Fill","Scale option for Image dimension control")})),Es={cover:Object(ke.__)("Image is scaled and cropped to fill the entire space without being distorted."),contain:Object(ke.__)("Image is scaled to fill the space without clipping nor distorting."),fill:Object(ke.__)("Image will be stretched and distorted to completely fill the space.")};var Cs=e=>{let{clientId:t,attributes:{width:n,height:o,scale:r},setAttributes:a}=e;const l=Object(_e.__experimentalUseCustomUnits)({availableUnits:Object(we.useSetting)("spacing.units")||["px","%","vw","em","rem"]}),c=(e,t)=>{const n=parseFloat(t);isNaN(n)&&t||a({[e]:n<0?"0":t})},i=Object(ke._x)("Scale","Image scaling options");return Object(je.createElement)(we.InspectorControls,{__experimentalGroup:"dimensions"},Object(je.createElement)(_e.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>!!o,label:Object(ke.__)("Height"),onDeselect:()=>a({height:void 0}),resetAllFilter:()=>({height:void 0}),isShownByDefault:!0,panelId:t},Object(je.createElement)(_e.__experimentalUnitControl,{label:Object(ke.__)("Height"),labelPosition:"top",value:o||"",min:0,onChange:e=>c("height",e),units:l})),Object(je.createElement)(_e.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>!!n,label:Object(ke.__)("Width"),onDeselect:()=>a({width:void 0}),resetAllFilter:()=>({width:void 0}),isShownByDefault:!0,panelId:t},Object(je.createElement)(_e.__experimentalUnitControl,{label:Object(ke.__)("Width"),labelPosition:"top",value:n||"",min:0,onChange:e=>c("width",e),units:l})),!!o&&Object(je.createElement)(_e.__experimentalToolsPanelItem,{hasValue:()=>!!r&&"cover"!==r,label:i,onDeselect:()=>a({scale:"cover"}),resetAllFilter:()=>({scale:"cover"}),isShownByDefault:!0,panelId:t},Object(je.createElement)(_e.__experimentalToggleGroupControl,{label:i,value:r,help:Es[r],onChange:e=>a({scale:e}),isBlock:!0},ws)))};const xs=Object(je.createElement)(ye.SVG,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none"},Object(je.createElement)(ye.Path,{vectorEffect:"non-scaling-stroke",d:"M60 60 0 0"})),Ss=["image"],Bs=Object(je.createElement)("div",{className:"wp-block-post-featured-image__placeholder"},xs);function Ts(e){let{clientId:t,attributes:n,setAttributes:o,context:{postId:r,postType:a,queryId:l}}=e;const c=Number.isFinite(l),{isLink:i,height:s,width:u,scale:m}=n,[d,b]=Object(It.useEntityProp)("postType",a,"featured_media",r),p=Object(Pe.useSelect)(e=>d&&e(It.store).getMedia(d,{context:"view"}),[d]),g=Object(we.useBlockProps)({style:{width:u,height:s}}),h=e=>Object(je.createElement)(_e.Placeholder,{className:"block-editor-media-placeholder"},xs,e),v=e=>{null!=e&&e.id&&b(e.id)},{createErrorNotice:O}=Object(Pe.useDispatch)(Do.store),j=e=>{O(e[2],{type:"snackbar"})};let y;if(!d&&c)return Object(je.createElement)("div",g,Bs);const f=Object(ke.__)("Add a featured image");return y=d?p?Object(je.createElement)("img",{src:p.source_url,alt:p.alt_text||Object(ke.__)("Featured image"),style:{height:s,objectFit:s&&m}}):Bs:Object(je.createElement)(we.MediaPlaceholder,{onSelect:v,accept:"image/*",allowedTypes:Ss,onError:j,placeholder:h,mediaLibraryButton:e=>{let{open:t}=e;return Object(je.createElement)(_e.Button,{icon:xa.a,variant:"primary",label:f,showTooltip:!0,tooltipPosition:"top center",onClick:()=>{t()}})}}),Object(je.createElement)(je.Fragment,null,Object(je.createElement)(Cs,{clientId:t,attributes:n,setAttributes:o}),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Link settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.sprintf)(Object(ke.__)("Link to %s"),a),onChange:()=>o({isLink:!i}),checked:i}))),!!p&&!c&&Object(je.createElement)(we.BlockControls,{group:"other"},Object(je.createElement)(we.MediaReplaceFlow,{mediaId:d,mediaURL:p.source_url,allowedTypes:Ss,accept:"image/*",onSelect:v,onError:j})),Object(je.createElement)("figure",g,y))}const Ns={apiVersion:2,name:"core/post-featured-image",title:"Post Featured Image",category:"theme",description:"Display a post's featured image.",textdomain:"default",attributes:{isLink:{type:"boolean",default:!1},width:{type:"string"},height:{type:"string"},scale:{type:"string",default:"cover"}},usesContext:["postId","postType","queryId"],supports:{align:["left","right","center","wide","full"],color:{__experimentalDuotone:"img",text:!1,background:!1},html:!1,spacing:{margin:!0,padding:!0}},editorStyle:"wp-block-post-featured-image-editor",style:"wp-block-post-featured-image"},{name:zs}=Ns,Ps={icon:ks,edit:function(e){var t;const n=Object(we.useBlockProps)();return null!==(t=e.context)&&void 0!==t&&t.postId?Object(je.createElement)(Ts,e):Object(je.createElement)("div",n,Bs)}};var Is=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"}));var Ms=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"}));const Rs=[{isDefault:!0,name:"post-next",title:Object(ke.__)("Next post"),description:Object(ke.__)("Displays the post link that follows the current post."),icon:Is,attributes:{type:"next"},scope:["inserter","transform"]},{name:"post-previous",title:Object(ke.__)("Previous post"),description:Object(ke.__)("Displays the post link that precedes the current post."),icon:Ms,attributes:{type:"previous"},scope:["inserter","transform"]}];Rs.forEach(e=>{e.isActive||(e.isActive=(e,t)=>e.type===t.type)});var Ls=Rs;const Vs={apiVersion:2,name:"core/post-navigation-link",title:"Post Navigation Link",category:"theme",description:"Displays the next or previous post link that is adjacent to the current post.",textdomain:"default",attributes:{textAlign:{type:"string"},type:{type:"string",default:"next"},label:{type:"string"},showTitle:{type:"boolean",default:!1},linkLabel:{type:"boolean",default:!1}},supports:{reusable:!1,html:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}}}},{name:Hs}=Vs,As={edit:function(e){let{attributes:{type:t,label:n,showTitle:o,textAlign:r,linkLabel:a},setAttributes:l}=e;const c="next"===t;let i=c?Object(ke.__)("Next"):Object(ke.__)("Previous");o&&(i=c?Object(ke.__)("Next: "):Object(ke.__)("Previous: "));const s=c?Object(ke.__)("Next post"):Object(ke.__)("Previous post"),u=Object(we.useBlockProps)({className:tt()({["has-text-align-"+r]:r})});return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,null,Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Display the title as a link"),help:Object(ke.__)("If you have entered a custom label, it will be prepended before the title."),checked:!!o,onChange:()=>l({showTitle:!o})}),o&&Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Include the label as part of the link"),checked:!!a,onChange:()=>l({linkLabel:!a})}))),Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(we.AlignmentToolbar,{value:r,onChange:e=>{l({textAlign:e})}})),Object(je.createElement)("div",u,Object(je.createElement)(we.RichText,{tagName:"a","aria-label":s,placeholder:i,value:n,allowedFormats:["core/bold","core/italic"],onChange:e=>l({label:e})}),o&&Object(je.createElement)("a",{href:"#post-navigation-pseudo-link",onClick:e=>e.preventDefault()},Object(ke.__)("An example title"))))},variations:Ls};var Fs=n("Civd");const Ds=[["core/post-title"],["core/post-date"],["core/post-excerpt"]];function Gs(){const e=Object(we.useInnerBlocksProps)({},{template:Ds});return Object(je.createElement)("li",e)}const Us=Object(je.memo)((function(e){let{blocks:t,blockContextId:n,isHidden:o,setActiveBlockContextId:r}=e;const a=Object(we.__experimentalUseBlockPreview)({blocks:t}),l=()=>{r(n)},c={display:o?"none":void 0};return Object(je.createElement)("li",Object(mt.a)({},a,{tabIndex:0,role:"button",onClick:l,onKeyPress:l,style:c}))}));const qs={apiVersion:2,name:"core/post-template",title:"Post Template",category:"design",parent:["core/query"],description:"Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.",textdomain:"default",usesContext:["queryId","query","queryContext","displayLayout","templateSlug"],supports:{reusable:!1,html:!1,align:!0,__experimentalLayout:{allowEditing:!1}},style:"wp-block-post-template",editorStyle:"wp-block-post-template-editor"},{name:Ws}=qs,$s={icon:Fs.a,edit:function(e){let{clientId:t,context:{query:{perPage:n,offset:o,categoryIds:r=[],postType:a,tagIds:l=[],order:c,orderBy:i,author:s,search:u,exclude:m,sticky:d,inherit:b}={},queryContext:p=[{page:1}],templateSlug:g,displayLayout:{type:h="flex",columns:v=1}={}}}=e;const[{page:O}]=p,[j,y]=Object(je.useState)(),{posts:f,blocks:_}=Object(Pe.useSelect)(e=>{const{getEntityRecords:p}=e(It.store),{getBlocks:h}=e(we.store),v={offset:n?n*(O-1)+o:0,categories:r,tags:l,order:c,orderby:i};return n&&(v.per_page=n),s&&(v.author=s),u&&(v.search=u),null!=m&&m.length&&(v.exclude=m),d&&(v.sticky="only"===d),b&&null!=g&&g.startsWith("archive-")&&(v.postType=g.replace("archive-",""),a=v.postType),{posts:p("postType",a,v),blocks:h(t)}},[n,O,o,r,l,c,i,t,s,u,a,m,d,b,g]),k=Object(je.useMemo)(()=>null==f?void 0:f.map(e=>({postType:e.type,postId:e.id})),[f]),w="flex"===h&&v>1,E=Object(we.useBlockProps)({className:tt()({"is-flex-container":w,["columns-"+v]:w})});return f?f.length?Object(je.createElement)("ul",E,k&&k.map(e=>{var t,n;return Object(je.createElement)(we.BlockContextProvider,{key:e.postId,value:e},e.postId===(j||(null===(t=k[0])||void 0===t?void 0:t.postId))?Object(je.createElement)(Gs,null):null,Object(je.createElement)(Us,{blocks:_,blockContextId:e.postId,setActiveBlockContextId:y,isHidden:e.postId===(j||(null===(n=k[0])||void 0===n?void 0:n.postId))}))})):Object(je.createElement)("p",E," ",Object(ke.__)("No results found.")):Object(je.createElement)("p",E,Object(je.createElement)(_e.Spinner,null))},save:function(){return Object(je.createElement)(we.InnerBlocks.Content,null)}};var Zs=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M20 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z",fillRule:"evenodd",clipRule:"evenodd"}));var Ks=[{name:"category",title:Object(ke.__)("Post Categories"),description:Object(ke.__)("Display a post's categories."),icon:Zs,isDefault:!0,attributes:{term:"category"},isActive:e=>"category"===e.term},{name:"post_tag",title:Object(ke.__)("Post Tags"),description:Object(ke.__)("Display a post's tags."),icon:Zs,attributes:{term:"post_tag"},isActive:e=>"post_tag"===e.term}];const Js={apiVersion:2,name:"core/post-terms",title:"Post Terms",category:"theme",description:"Post terms.",textdomain:"default",attributes:{term:{type:"string"},textAlign:{type:"string"},separator:{type:"string",default:", "}},usesContext:["postId","postType"],supports:{html:!1,color:{gradients:!0,link:!0},typography:{lineHeight:!0,fontSize:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}}},style:"wp-block-post-terms"},{name:Qs}=Js,Ys={variations:Ks,edit:function(e){var t;let{attributes:n,context:o,setAttributes:r}=e;const{term:a,textAlign:l,separator:c}=n,{postId:i,postType:s}=o,u=Object(Pe.useSelect)(e=>{var t;if(!a)return{};const{getTaxonomy:n}=e(It.store),o=n(a);return null!=o&&null!==(t=o.visibility)&&void 0!==t&&t.publicly_queryable?o:{}},[a]),{postTerms:m,hasPostTerms:d,isLoading:b}=function(e){var t;let{postId:n,postType:o,term:r}=e;const{rest_base:a,slug:l}=r,[c]=Object(It.useEntityProp)("postType",o,a,n);return Object(Pe.useSelect)(e=>{var t;if(!(null==r||null===(t=r.visibility)||void 0===t?void 0:t.publicly_queryable))return{postTerms:[],_isLoading:!1,hasPostTerms:!1};var n;if(!c)return{isLoading:null==r||null===(n=r.postTerms)||void 0===n?void 0:n.includes(o)};if(!c.length)return{isLoading:!1};const{getEntityRecords:a,isResolving:i}=e(It.store),s=["taxonomy",l,{include:c,context:"view"}],u=a(...s);return{postTerms:u,isLoading:i("getEntityRecords",s),hasPostTerms:!(null==u||!u.length)}},[c,null==r||null===(t=r.visibility)||void 0===t?void 0:t.publicly_queryable])}({postId:i,postType:s,term:u}),p=i&&s,g=Object(we.useBlockProps)({className:tt()({["has-text-align-"+l]:l,["taxonomy-"+a]:a})});return p&&a?Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(we.AlignmentToolbar,{value:l,onChange:e=>{r({textAlign:e})}})),Object(je.createElement)(we.InspectorControls,{__experimentalGroup:"advanced"},Object(je.createElement)(_e.TextControl,{autoComplete:"off",label:Object(ke.__)("Separator"),value:c||"",onChange:e=>{r({separator:e})},help:Object(ke.__)("Enter character(s) used to separate terms.")})),Object(je.createElement)("div",g,b&&Object(je.createElement)(_e.Spinner,null),!b&&d&&m.map(e=>Object(je.createElement)("a",{key:e.id,href:e.link,onClick:e=>e.preventDefault()},e.name)).reduce((e,t)=>Object(je.createElement)(je.Fragment,null,e,Object(je.createElement)("span",{className:"wp-block-post-terms__separator"},c||" "),t)),!b&&!d&&((null==u||null===(t=u.labels)||void 0===t?void 0:t.no_terms)||Object(ke.__)("Term items not found.")))):Object(je.createElement)("div",g,Object(ke.__)("Post Terms"))}};var Xs=[{attributes:{textAlign:{type:"string"},level:{type:"number",default:2},isLink:{type:"boolean",default:!1},rel:{type:"string",attribute:"rel",default:""},linkTarget:{type:"string",default:"_self"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0}},save:()=>null,migrate:at,isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}}];const eu={apiVersion:2,name:"core/post-title",title:"Post Title",category:"theme",description:"Displays the title of a post, page, or any other content-type.",textdomain:"default",usesContext:["postId","postType","queryId"],attributes:{textAlign:{type:"string"},level:{type:"number",default:2},isLink:{type:"boolean",default:!1},rel:{type:"string",attribute:"rel",default:""},linkTarget:{type:"string",default:"_self"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}}},style:"wp-block-post-title"},{name:tu}=eu,nu={icon:Zc,edit:function(e){let{attributes:{level:t,textAlign:n,isLink:o,rel:r,linkTarget:a},setAttributes:l,context:{postType:c,postId:i,queryId:s}}=e;const u=0===t?"p":"h"+t,m=Number.isFinite(s),d=as("postType",c,i),[b="",p,g]=Object(It.useEntityProp)("postType",c,"title",i),[h]=Object(It.useEntityProp)("postType",c,"link",i),v=Object(we.useBlockProps)({className:tt()({["has-text-align-"+n]:n})});let O=Object(je.createElement)(u,v,Object(ke.__)("Post Title"));return c&&i&&(O=d&&!m?Object(je.createElement)(we.PlainText,Object(mt.a)({tagName:u,placeholder:Object(ke.__)("No Title"),value:b,onChange:p,__experimentalVersion:2},v)):Object(je.createElement)(u,v,Object(je.createElement)(je.RawHTML,{key:"html"},null==g?void 0:g.rendered))),o&&c&&i&&(O=d&&!m?Object(je.createElement)(u,v,Object(je.createElement)(we.PlainText,{tagName:"a",href:h,target:a,rel:r,placeholder:b.length?null:Object(ke.__)("No Title"),value:b,onChange:p,__experimentalVersion:2})):Object(je.createElement)(u,v,Object(je.createElement)("a",{href:h,target:a,rel:r,onClick:e=>e.preventDefault()},Object(je.createElement)(je.RawHTML,{key:"html"},null==g?void 0:g.rendered)))),Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(ia,{selectedLevel:t,onChange:e=>l({level:e})}),Object(je.createElement)(we.AlignmentControl,{value:n,onChange:e=>{l({textAlign:e})}})),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Link settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Make title a link"),onChange:()=>l({isLink:!o}),checked:o}),o&&Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Open in new tab"),onChange:e=>l({linkTarget:e?"_blank":"_self"}),checked:"_blank"===a}),Object(je.createElement)(_e.TextControl,{label:Object(ke.__)("Link rel"),value:r,onChange:e=>l({rel:e})})))),O)},deprecated:Xs};var ou=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z"}));var ru={from:[{type:"block",blocks:["core/code","core/paragraph"],transform:e=>{let{content:t,anchor:n}=e;return Object(Oe.createBlock)("core/preformatted",{content:t,anchor:n})}},{type:"raw",isMatch:e=>"PRE"===e.nodeName&&!(1===e.children.length&&"CODE"===e.firstChild.nodeName),schema:e=>{let{phrasingContentSchema:t}=e;return{pre:{children:t}}}}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>Object(Oe.createBlock)("core/paragraph",e)},{type:"block",blocks:["core/code"],transform:e=>Object(Oe.createBlock)("core/code",e)}]};const au={apiVersion:2,name:"core/preformatted",title:"Preformatted",category:"text",description:"Add text that respects your spacing and tabs, and also allows styling.",textdomain:"default",attributes:{content:{type:"string",source:"html",selector:"pre",default:"",__unstablePreserveWhiteSpace:!0,__experimentalRole:"content"}},supports:{anchor:!0,color:{gradients:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}}},style:"wp-block-preformatted"},{name:lu}=au,cu={icon:ou,example:{attributes:{content:Object(ke.__)("EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\nWindow, very small in the distance, illuminated.\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;")}},transforms:ru,edit:function(e){let{attributes:t,mergeBlocks:n,setAttributes:o,onRemove:r,style:a}=e;const{content:l}=t,c=Object(we.useBlockProps)({style:a});return Object(je.createElement)(we.RichText,Object(mt.a)({tagName:"pre",identifier:"content",preserveWhiteSpace:!0,value:l,onChange:e=>{o({content:e})},onRemove:r,"aria-label":Object(ke.__)("Preformatted text"),placeholder:Object(ke.__)("Write preformatted text…"),onMerge:n},c,{__unstablePastePlainText:!0}))},save:function(e){let{attributes:t}=e;const{content:n}=t;return Object(je.createElement)("pre",we.useBlockProps.save(),Object(je.createElement)(we.RichText.Content,{value:n}))},merge:(e,t)=>({content:e.content+t.content})};var iu=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M18 8H6c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v4zM4 4v1.5h16V4H4zm0 16h16v-1.5H4V20z"}));const su={value:{type:"string",source:"html",selector:"blockquote",multiline:"p"},citation:{type:"string",source:"html",selector:"cite",default:""},mainColor:{type:"string"},customMainColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}};function uu(e){if(!e)return;const t=e.match(/border-color:([^;]+)[;]?/);return t&&t[1]?t[1]:void 0}var mu=[{attributes:{...su},save(e){let{attributes:t}=e;const{mainColor:n,customMainColor:o,customTextColor:r,textColor:a,value:l,citation:c,className:i}=t;let s,u;if(Object(Me.includes)(i,"is-style-solid-color")){const e=Object(we.getColorClassName)("background-color",n);s=tt()({"has-background":e||o,[e]:e}),u={backgroundColor:e?void 0:o}}else o&&(u={borderColor:o});const m=Object(we.getColorClassName)("color",a),d=tt()({"has-text-color":a||r,[m]:m}),b=m?void 0:{color:r};return Object(je.createElement)("figure",we.useBlockProps.save({className:s,style:u}),Object(je.createElement)("blockquote",{className:d,style:b},Object(je.createElement)(we.RichText.Content,{value:l,multiline:!0}),!we.RichText.isEmpty(c)&&Object(je.createElement)(we.RichText.Content,{tagName:"cite",value:c})))},migrate(e){let{className:t,mainColor:n,customMainColor:o,customTextColor:r,...a}=e;const l=Object(Me.includes)(t,"is-style-solid-color");let c;return o&&(c=l?{color:{background:o}}:{border:{color:o}}),r&&c&&(c.color={...c.color,text:r}),{className:t,backgroundColor:l?n:void 0,borderColor:l?void 0:n,textAlign:l?"left":void 0,style:c,...a}}},{attributes:{...su,figureStyle:{source:"attribute",selector:"figure",attribute:"style"}},save(e){let{attributes:t}=e;const{mainColor:n,customMainColor:o,textColor:r,customTextColor:a,value:l,citation:c,className:i,figureStyle:s}=t;let u,m;if(Object(Me.includes)(i,"is-style-solid-color")){const e=Object(we.getColorClassName)("background-color",n);u=tt()({"has-background":e||o,[e]:e}),m={backgroundColor:e?void 0:o}}else if(o)m={borderColor:o};else if(n){m={borderColor:uu(s)}}const d=Object(we.getColorClassName)("color",r),b=(r||a)&&tt()("has-text-color",{[d]:d}),p=d?void 0:{color:a};return Object(je.createElement)("figure",{className:u,style:m},Object(je.createElement)("blockquote",{className:b,style:p},Object(je.createElement)(we.RichText.Content,{value:l,multiline:!0}),!we.RichText.isEmpty(c)&&Object(je.createElement)(we.RichText.Content,{tagName:"cite",value:c})))},migrate(e){let{className:t,figureStyle:n,mainColor:o,customMainColor:r,customTextColor:a,...l}=e;const c=Object(Me.includes)(t,"is-style-solid-color");let i;if(r&&(i=c?{color:{background:r}}:{border:{color:r}}),a&&i&&(i.color={...i.color,text:a}),!c&&o&&n){const e=uu(n);if(e)return{...l,className:t,style:{border:{color:e}}}}return{className:t,backgroundColor:c?o:void 0,borderColor:c?void 0:o,textAlign:c?"left":void 0,style:i,...l}}},{attributes:su,save(e){let{attributes:t}=e;const{mainColor:n,customMainColor:o,textColor:r,customTextColor:a,value:l,citation:c,className:i}=t;let s,u;if(Object(Me.includes)(i,"is-style-solid-color"))s=Object(we.getColorClassName)("background-color",n),s||(u={backgroundColor:o});else if(o)u={borderColor:o};else if(n){const e=Object(Me.get)(Object(Pe.select)(we.store).getSettings(),["colors"],[]);u={borderColor:Object(we.getColorObjectByAttributeValues)(e,n).color}}const m=Object(we.getColorClassName)("color",r),d=r||a?tt()("has-text-color",{[m]:m}):void 0,b=m?void 0:{color:a};return Object(je.createElement)("figure",{className:s,style:u},Object(je.createElement)("blockquote",{className:d,style:b},Object(je.createElement)(we.RichText.Content,{value:l,multiline:!0}),!we.RichText.isEmpty(c)&&Object(je.createElement)(we.RichText.Content,{tagName:"cite",value:c})))},migrate(e){let{className:t,mainColor:n,customMainColor:o,customTextColor:r,...a}=e;const l=Object(Me.includes)(t,"is-style-solid-color");let c={};return o&&(c=l?{color:{background:o}}:{border:{color:o}}),r&&c&&(c.color={...c.color,text:r}),{className:t,backgroundColor:l?n:void 0,borderColor:l?void 0:n,textAlign:l?"left":void 0,style:c,...a}}},{attributes:{...su},save(e){let{attributes:t}=e;const{value:n,citation:o}=t;return Object(je.createElement)("blockquote",null,Object(je.createElement)(we.RichText.Content,{value:n,multiline:!0}),!we.RichText.isEmpty(o)&&Object(je.createElement)(we.RichText.Content,{tagName:"cite",value:o}))}},{attributes:{...su,citation:{type:"string",source:"html",selector:"footer"},align:{type:"string",default:"none"}},save(e){let{attributes:t}=e;const{value:n,citation:o,align:r}=t;return Object(je.createElement)("blockquote",{className:"align"+r},Object(je.createElement)(we.RichText.Content,{value:n,multiline:!0}),!we.RichText.isEmpty(o)&&Object(je.createElement)(we.RichText.Content,{tagName:"footer",value:o}))}}];var du=function(e){let{attributes:t,setAttributes:n,isSelected:o,insertBlocksAfter:r}=e;const{textAlign:a,citation:l,value:c}=t,i=Object(we.useBlockProps)({className:tt()({["has-text-align-"+a]:a})}),s=!we.RichText.isEmpty(l)||o;return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(we.AlignmentControl,{value:a,onChange:e=>{n({textAlign:e})}})),Object(je.createElement)("figure",i,Object(je.createElement)("blockquote",null,Object(je.createElement)(we.RichText,{identifier:"value",multiline:!0,value:c,onChange:e=>n({value:e}),"aria-label":Object(ke.__)("Pullquote text"),placeholder:Object(ke.__)("Add quote"),textAlign:"center"}),s&&Object(je.createElement)(we.RichText,{identifier:"citation",value:l,"aria-label":Object(ke.__)("Pullquote citation text"),placeholder:Object(ke.__)("Add citation"),onChange:e=>n({citation:e}),className:"wp-block-pullquote__citation",__unstableMobileNoFocusOnMount:!0,textAlign:"center",__unstableOnSplitAtEnd:()=>r(Object(Oe.createBlock)("core/paragraph"))}))))};var bu={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>Object(Oe.createBlock)("core/pullquote",{value:Object(kt.toHTMLString)({value:Object(kt.join)(e.map(e=>{let{content:t}=e;return Object(kt.create)({html:t})}),"\u2028"),multilineTag:"p"}),anchor:e.anchor})},{type:"block",blocks:["core/heading"],transform:e=>{let{content:t,anchor:n}=e;return Object(Oe.createBlock)("core/pullquote",{value:`<p>${t}</p>`,anchor:n})}}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>{let{value:t,citation:n}=e;const o=[];return t&&"<p></p>"!==t&&o.push(...Object(kt.split)(Object(kt.create)({html:t,multilineTag:"p"}),"\u2028").map(e=>Object(Oe.createBlock)("core/paragraph",{content:Object(kt.toHTMLString)({value:e})}))),n&&"<p></p>"!==n&&o.push(Object(Oe.createBlock)("core/paragraph",{content:n})),0===o.length?Object(Oe.createBlock)("core/paragraph",{content:""}):o}},{type:"block",blocks:["core/heading"],transform:e=>{let{value:t,citation:n,...o}=e;if("<p></p>"===t)return Object(Oe.createBlock)("core/heading",{content:n});const r=Object(kt.split)(Object(kt.create)({html:t,multilineTag:"p"}),"\u2028"),a=Object(Oe.createBlock)("core/heading",{content:Object(kt.toHTMLString)({value:r[0]})});if(!n&&1===r.length)return a;const l=r.slice(1);return[a,Object(Oe.createBlock)("core/pullquote",{...o,citation:n,value:Object(kt.toHTMLString)({value:l.length?Object(kt.join)(r.slice(1),"\u2028"):Object(kt.create)(),multilineTag:"p"})})]}}]};const pu={apiVersion:2,name:"core/pullquote",title:"Pullquote",category:"text",description:"Give special visual emphasis to a quote from your text.",textdomain:"default",attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",__experimentalRole:"content"},citation:{type:"string",source:"html",selector:"cite",default:"",__experimentalRole:"content"},textAlign:{type:"string"}},supports:{anchor:!0,align:["left","right","wide","full"],color:{gradients:!0,background:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0}},editorStyle:"wp-block-pullquote-editor",style:"wp-block-pullquote"},{name:gu}=pu,hu={icon:iu,example:{attributes:{value:"<p>"+Object(ke.__)("One of the hardest things to do in technology is disrupt yourself.")+"</p>",citation:Object(ke.__)("Matt Mullenweg")}},transforms:bu,edit:du,save:function(e){let{attributes:t}=e;const{textAlign:n,citation:o,value:r}=t,a=!we.RichText.isEmpty(o);return Object(je.createElement)("figure",we.useBlockProps.save({className:tt()({["has-text-align-"+n]:n})}),Object(je.createElement)("blockquote",null,Object(je.createElement)(we.RichText.Content,{value:r,multiline:!0}),a&&Object(je.createElement)(we.RichText.Content,{tagName:"cite",value:o})))},deprecated:mu};var vu=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M18.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z"})),Ou=n("mi6C");function ju(e){let{attributes:{query:t,displayLayout:n},setQuery:o,setDisplayLayout:r}=e;const a=Object(nt.useInstanceId)(ju,"blocks-query-pagination-max-page-input"),l=[{icon:$a,title:Object(ke.__)("List view"),onClick:()=>r({type:"list"}),isActive:"list"===(null==n?void 0:n.type)},{icon:Za.a,title:Object(ke.__)("Grid view"),onClick:()=>r({type:"flex",columns:(null==n?void 0:n.columns)||3}),isActive:"flex"===(null==n?void 0:n.type)}];return Object(je.createElement)(je.Fragment,null,!t.inherit&&Object(je.createElement)(_e.ToolbarGroup,null,Object(je.createElement)(_e.Dropdown,{contentClassName:"block-library-query-toolbar__popover",renderToggle:e=>{let{onToggle:t}=e;return Object(je.createElement)(_e.ToolbarButton,{icon:Ou.a,label:Object(ke.__)("Display settings"),onClick:t})},renderContent:()=>Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.BaseControl,null,Object(je.createElement)(_e.__experimentalNumberControl,{__unstableInputWidth:"60px",label:Object(ke.__)("Items per Page"),labelPosition:"edge",min:1,max:100,onChange:e=>{isNaN(e)||e<1||e>100||o({perPage:e})},step:"1",value:t.perPage,isDragEnabled:!1})),Object(je.createElement)(_e.BaseControl,null,Object(je.createElement)(_e.__experimentalNumberControl,{__unstableInputWidth:"60px",label:Object(ke.__)("Offset"),labelPosition:"edge",min:0,max:100,onChange:e=>{isNaN(e)||e<0||e>100||o({offset:e})},step:"1",value:t.offset,isDragEnabled:!1})),Object(je.createElement)(_e.BaseControl,{id:a,help:Object(ke.__)("Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).")},Object(je.createElement)(_e.__experimentalNumberControl,{id:a,__unstableInputWidth:"60px",label:Object(ke.__)("Max page to show"),labelPosition:"edge",min:0,onChange:e=>{isNaN(e)||e<0||o({pages:e})},step:"1",value:t.pages,isDragEnabled:!1})))})),Object(je.createElement)(_e.ToolbarGroup,{controls:l}))}const yu=e=>{const t=null==e?void 0:e.reduce((e,t)=>{const{mapById:n,mapByName:o,names:r}=e;return n[t.id]=t,o[t.name]=t,r.push(t.name),e},{mapById:{},mapByName:{},names:[]});return{terms:e,...t}};const fu=[{label:Object(ke.__)("Include"),value:""},{label:Object(ke.__)("Exclude"),value:"exclude"},{label:Object(ke.__)("Only"),value:"only"}];function _u(e){var t,n;let{attributes:{query:o,displayLayout:r},setQuery:a,setDisplayLayout:l}=e;const{order:c,orderBy:i,author:s,postType:u,sticky:m,inherit:d}=o,[b,p]=Object(je.useState)(!0),[g,h]=Object(je.useState)(!0),[v,O]=Object(je.useState)("post"===u),{postTypesTaxonomiesMap:j,postTypesSelectOptions:y}=(()=>{const{postTypes:e}=Object(Pe.useSelect)(e=>{var t;const{getPostTypes:n}=e(It.store),o=["attachment"];return{postTypes:null===(t=n({per_page:-1}))||void 0===t?void 0:t.filter(e=>{let{viewable:t,slug:n}=e;return t&&!o.includes(n)})}},[]);return{postTypesTaxonomiesMap:Object(je.useMemo)(()=>{if(null!=e&&e.length)return e.reduce((e,t)=>(e[t.slug]=t.taxonomies,e),{})},[e]),postTypesSelectOptions:Object(je.useMemo)(()=>(e||[]).map(e=>{let{labels:t,slug:n}=e;return{label:t.singular_name,value:n}}),[e])}})(),{authorList:f,categories:_,tags:k}=Object(Pe.useSelect)(e=>{const{getEntityRecords:t}=e(It.store),n={per_page:100},o=t("taxonomy","category",n),r=t("taxonomy","post_tag",n);return{categories:yu(o),tags:yu(r),authorList:t("root","user",{per_page:-1})}},[]);Object(je.useEffect)(()=>{if(!j)return;const e=j[u];p(e.includes("category")),h(e.includes("post_tag"))},[u,j]),Object(je.useEffect)(()=>{O("post"===u)},[u]);const w=(e,t)=>n=>{const o=Array.from(n.reduce((t,n)=>{const o=((e,t)=>{var n;const o=(null==t?void 0:t.id)||(null===(n=e[t])||void 0===n?void 0:n.id);if(o)return o;const r=t.toLocaleLowerCase();for(const t in e)if(t.toLocaleLowerCase()===r)return e[t].id})(e.mapByName,n);return o&&t.add(o),t},new Set));a({[t]:o})},E=w(_,"categoryIds"),C=w(k,"tagIds"),[x,S]=Object(je.useState)(o.search),B=Object(je.useCallback)(Object(Me.debounce)(()=>{o.search!==x&&a({search:x})},250),[x,o.search]);Object(je.useEffect)(()=>(B(),B.cancel),[x,B]);const T=e=>{const t={category:{queryProp:"categoryIds",terms:_},post_tag:{queryProp:"tagIds",terms:k}}[e];return(o[t.queryProp]||[]).reduce((e,n)=>{const o=t.terms.mapById[n];return o&&e.push({id:n,value:o.name}),e},[])};return Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Inherit query from template"),help:Object(ke.__)("Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently."),checked:!!d,onChange:e=>a({inherit:!!e})}),!d&&Object(je.createElement)(_e.SelectControl,{options:y,value:u,label:Object(ke.__)("Post Type"),onChange:e=>{const t={postType:e};j[e].includes("category")||(t.categoryIds=[]),j[e].includes("post_tag")||(t.tagIds=[]),"post"!==e&&(t.sticky=""),a(t)},help:Object(ke.__)('WordPress contains different types of content and they are divided into collections called "Post Types". By default there are a few different ones such as blog posts and pages, but plugins could add more.')}),"flex"===(null==r?void 0:r.type)&&Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.RangeControl,{label:Object(ke.__)("Columns"),value:r.columns,onChange:e=>l({columns:e}),min:2,max:Math.max(6,r.columns)}),r.columns>6&&Object(je.createElement)(_e.Notice,{status:"warning",isDismissible:!1},Object(ke.__)("This column count exceeds the recommended amount and may cause visual breakage."))),!d&&Object(je.createElement)(_e.QueryControls,{order:c,orderBy:i,onOrderChange:e=>a({order:e}),onOrderByChange:e=>a({orderBy:e})}),v&&Object(je.createElement)(_e.SelectControl,{label:Object(ke.__)("Sticky posts"),options:fu,value:m,onChange:e=>a({sticky:e}),help:Object(ke.__)('Blog posts can be "stickied", a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.')})),!d&&Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Filters")},b&&(null==_||null===(t=_.terms)||void 0===t?void 0:t.length)>0&&Object(je.createElement)(_e.FormTokenField,{label:Object(ke.__)("Categories"),value:T("category"),suggestions:_.names,onChange:E}),g&&(null==k||null===(n=k.terms)||void 0===n?void 0:n.length)>0&&Object(je.createElement)(_e.FormTokenField,{label:Object(ke.__)("Tags"),value:T("post_tag"),suggestions:k.names,onChange:C}),Object(je.createElement)(_e.QueryControls,{selectedAuthorId:s,authorList:f,onAuthorChange:e=>a({author:""!==e?+e:void 0})}),Object(je.createElement)(_e.TextControl,{label:Object(ke.__)("Keyword"),value:x,onChange:S})))}var ku=e=>{var t;let{clientId:n,name:o,attributes:r,setAttributes:a}=e;const{blockType:l,defaultVariation:c,scopeVariations:i,allVariations:s}=Object(Pe.useSelect)(e=>{const{getBlockVariations:t,getBlockType:n,getDefaultBlockVariation:r}=e(Oe.store);return{blockType:n(o),defaultVariation:r(o,"block"),scopeVariations:t(o,"block"),allVariations:t(o)}},[o]),{replaceInnerBlocks:u}=Object(Pe.useDispatch)(we.store),m=Object(we.useBlockProps)(),d=Object(we.__experimentalGetMatchingVariation)(r,s),b=(null==d?void 0:d.icon)||(null==l||null===(t=l.icon)||void 0===t?void 0:t.src),p=(null==d?void 0:d.title)||(null==l?void 0:l.title);return Object(je.createElement)("div",m,Object(je.createElement)(we.__experimentalBlockVariationPicker,{icon:b,label:p,variations:i,onSelect:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;e.attributes&&a(e.attributes),e.innerBlocks&&u(n,Object(Oe.createBlocksFromInnerBlocksTemplate)(e.innerBlocks),!1)}}))};const wu=[["core/post-template"]];function Eu(e){let{attributes:t,setAttributes:n}=e;const{queryId:o,query:r,displayLayout:a,tagName:l="div",layout:c={}}=t,{__unstableMarkNextChangeAsNotPersistent:i}=Object(Pe.useDispatch)(we.store),s=Object(nt.useInstanceId)(Eu),{themeSupportsLayout:u}=Object(Pe.useSelect)(e=>{var t;const{getSettings:n}=e(we.store);return{themeSupportsLayout:null===(t=n())||void 0===t?void 0:t.supportsLayout}},[]),m=Object(we.useSetting)("layout")||{},d=c&&c.inherit?m:c,b=Object(we.useBlockProps)(),p=Object(we.useInnerBlocksProps)(b,{template:wu,__experimentalLayout:u?d:void 0}),{postsPerPage:g}=Object(Pe.useSelect)(e=>{const{getSettings:t}=e(we.store);return{postsPerPage:+t().postsPerPage||3}},[]);Object(je.useEffect)(()=>{const e={};!r.perPage&&g&&(e.perPage=g),Object.keys(e).length&&(i(),h(e))},[r.perPage]),Object(je.useEffect)(()=>{o||(i(),n({queryId:s}))},[o,s]);const h=e=>n({query:{...r,...e}}),v=e=>n({displayLayout:{...a,...e}});return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_u,{attributes:t,setQuery:h,setDisplayLayout:v}),Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(ju,{attributes:t,setQuery:h,setDisplayLayout:v})),Object(je.createElement)(we.InspectorControls,{__experimentalGroup:"advanced"},Object(je.createElement)(_e.SelectControl,{label:Object(ke.__)("HTML element"),options:[{label:Object(ke.__)("Default (<div>)"),value:"div"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<aside>",value:"aside"}],value:l,onChange:e=>n({tagName:e})})),Object(je.createElement)(l,p))}function Cu(e){const{clientId:t,name:n}=e,o=Object(we.useBlockProps)(),{replaceBlock:r,selectBlock:a}=Object(Pe.useDispatch)(we.store);return Object(je.createElement)("div",o,Object(je.createElement)(we.__experimentalBlockPatternSetup,{blockName:n,clientId:t,startBlankComponent:Object(je.createElement)(ku,e),onBlockPatternSelect:e=>{const n=e.map(e=>Object(Oe.cloneBlock)(e)),o=(e=>{const t=[...e];for(;t.length>0;){var n;const e=t.shift();if("core/query"===e.name)return e.clientId;null===(n=e.innerBlocks)||void 0===n||n.forEach(e=>{t.push(e)})}})(n);r(t,n),o&&a(o)}}))}var xu=e=>{const{clientId:t}=e,n=Object(Pe.useSelect)(e=>!!e(we.store).getBlocks(t).length,[t])?Eu:Cu;return Object(je.createElement)(n,e)};const Su=Object(je.createElement)(_e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},Object(je.createElement)(_e.Path,{d:"M41 9H7v3h34V9zm-22 5H7v1h12v-1zM7 26h12v1H7v-1zm34-5H7v3h34v-3zM7 38h12v1H7v-1zm34-5H7v3h34v-3z"})),Bu=Object(je.createElement)(_e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},Object(je.createElement)(_e.Path,{d:"M41 9H7v3h34V9zm-4 5H7v1h30v-1zm4 3H7v1h34v-1zM7 20h30v1H7v-1zm0 12h30v1H7v-1zm34 3H7v1h34v-1zM7 38h30v1H7v-1zm34-11H7v3h34v-3z"})),Tu=Object(je.createElement)(_e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},Object(je.createElement)(_e.Path,{d:"M41 9H7v3h34V9zm-22 5H7v1h12v-1zm22 3H7v1h34v-1zM7 20h34v1H7v-1zm0 12h12v1H7v-1zm34 3H7v1h34v-1zM7 38h34v1H7v-1zm34-11H7v3h34v-3z"})),Nu=Object(je.createElement)(_e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},Object(je.createElement)(_e.Path,{d:"M7 9h34v6H7V9zm12 8H7v1h12v-1zm18 3H7v1h30v-1zm0 18H7v1h30v-1zM7 35h12v1H7v-1zm34-8H7v6h34v-6z"})),zu={query:{perPage:3,pages:0,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!1}};var Pu=[{name:"posts-list",title:Object(ke.__)("Posts List"),description:Object(ke.__)("Display a list of your most recent posts, excluding sticky posts."),icon:Ga,attributes:{query:{perPage:4,pages:1,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",sticky:"exclude",inherit:!1}},scope:["inserter"]},{name:"title-date",title:Object(ke.__)("Title & Date"),icon:Su,attributes:{...zu},innerBlocks:[["core/post-template",{},[["core/post-title"],["core/post-date"]]],["core/query-pagination"]],scope:["block"]},{name:"title-excerpt",title:Object(ke.__)("Title & Excerpt"),icon:Bu,attributes:{...zu},innerBlocks:[["core/post-template",{},[["core/post-title"],["core/post-excerpt"]]],["core/query-pagination"]],scope:["block"]},{name:"title-date-excerpt",title:Object(ke.__)("Title, Date, & Excerpt"),icon:Tu,attributes:{...zu},innerBlocks:[["core/post-template",{},[["core/post-title"],["core/post-date"],["core/post-excerpt"]]],["core/query-pagination"]],scope:["block"]},{name:"image-date-title",title:Object(ke.__)("Image, Date, & Title"),icon:Nu,attributes:{...zu},innerBlocks:[["core/post-template",{},[["core/post-featured-image"],["core/post-date"],["core/post-title"]]],["core/query-pagination"]],scope:["block"]}];var Iu=[{attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0}},layout:{type:"object",default:{type:"list"}}},supports:{html:!1},migrate:e=>({...Object(Me.omit)(e,["layout"]),displayLayout:e.layout}),save:()=>Object(je.createElement)(we.InnerBlocks.Content,null)}];const Mu=e=>{let{attributes:{query:{postType:t}={}}={}}=e;if(!t)return null;const n=Object(Jo.addQueryArgs)("post-new.php",{post_type:t});return Object(je.createElement)("div",{className:"wp-block-query__create-new-link"},Object(je.createInterpolateElement)(Object(ke.__)("<a>Create a new post</a> for this feed."),{a:Object(je.createElement)("a",{href:n})}))};var Ru=Object(nt.createHigherOrderComponent)(e=>t=>{const{name:n,isSelected:o}=t;return"core/query"===n&&o?Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(Mu,t)),Object(je.createElement)(e,Object(mt.a)({key:"edit"},t))):Object(je.createElement)(e,Object(mt.a)({key:"edit"},t))},"withInspectorControls");const Lu={apiVersion:2,name:"core/query",title:"Query Loop",category:"theme",description:"An advanced block that allows displaying post types based on different query parameters and visual configurations.",textdomain:"default",attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0}},tagName:{type:"string",default:"div"},displayLayout:{type:"object",default:{type:"list"}}},providesContext:{queryId:"queryId",query:"query",displayLayout:"displayLayout"},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},__experimentalLayout:!0},editorStyle:"wp-block-query-editor"},{name:Vu}=Lu,Hu={icon:vu,edit:xu,save:function(e){let{attributes:{tagName:t="div"}}=e;const n=we.useBlockProps.save(),o=we.useInnerBlocksProps.save(n);return Object(je.createElement)(t,o)},variations:Pu,deprecated:Iu};Object(Lr.addFilter)("editor.BlockEdit","core/query",Ru);var Au=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Rect,{x:"4",y:"10.5",width:"6",height:"3",rx:"1.5",fill:"#000"}),Object(je.createElement)(ye.Rect,{x:"12",y:"10.5",width:"3",height:"3",rx:"1.5",fill:"#000"}),Object(je.createElement)(ye.Rect,{x:"17",y:"10.5",width:"3",height:"3",rx:"1.5",fill:"#000"}));function Fu(e){let{value:t,onChange:n}=e;return Object(je.createElement)(_e.__experimentalToggleGroupControl,{label:Object(ke.__)("Arrow"),value:t,onChange:n,help:Object(ke.__)("A decorative arrow appended to the next and previous page link."),isBlock:!0},Object(je.createElement)(_e.__experimentalToggleGroupControlOption,{value:"none",label:Object(ke._x)("None","Arrow option for Query Pagination Next/Previous blocks")}),Object(je.createElement)(_e.__experimentalToggleGroupControlOption,{value:"arrow",label:Object(ke._x)("Arrow","Arrow option for Query Pagination Next/Previous blocks")}),Object(je.createElement)(_e.__experimentalToggleGroupControlOption,{value:"chevron",label:Object(ke._x)("Chevron","Arrow option for Query Pagination Next/Previous blocks")}))}const Du=[["core/query-pagination-previous"],["core/query-pagination-numbers"],["core/query-pagination-next"]];var Gu=[{save:()=>Object(je.createElement)("div",we.useBlockProps.save(),Object(je.createElement)(we.InnerBlocks.Content,null))}];const Uu={apiVersion:2,name:"core/query-pagination",title:"Pagination",category:"design",parent:["core/query"],description:"Displays a paginated navigation to next/previous set of posts, when applicable.",textdomain:"default",attributes:{paginationArrow:{type:"string",default:"none"}},usesContext:["queryId","query"],providesContext:{paginationArrow:"paginationArrow"},supports:{align:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0},__experimentalLayout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}}},editorStyle:"wp-block-query-pagination-editor",style:"wp-block-query-pagination"},{name:qu}=Uu,Wu={icon:Au,edit:function(e){let{attributes:{paginationArrow:t,layout:n},setAttributes:o,clientId:r,name:a}=e;const l=n||(e=>{const t=Object(Oe.getBlockSupport)(e,"__experimentalLayout");return null==t?void 0:t.default})(a),c=Object(Pe.useSelect)(e=>{const{getBlocks:t}=e(we.store),n=t(r);return null==n?void 0:n.find(e=>["core/query-pagination-next","core/query-pagination-previous"].includes(e.name))},[]),i=Object(we.useBlockProps)(),s=Object(we.useInnerBlocksProps)(i,{template:Du,allowedBlocks:["core/query-pagination-previous","core/query-pagination-numbers","core/query-pagination-next"],__experimentalLayout:l});return Object(je.createElement)(je.Fragment,null,c&&Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Settings")},Object(je.createElement)(Fu,{value:t,onChange:e=>{o({paginationArrow:e})}}))),Object(je.createElement)("div",s))},save:function(){return Object(je.createElement)(we.InnerBlocks.Content,null)},deprecated:Gu};var $u=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Rect,{x:"6",y:"10.5",width:"3",height:"3",rx:"1.5",fill:"#000"}),Object(je.createElement)(ye.Rect,{x:"11",y:"10.5",width:"3",height:"3",rx:"1.5",fill:"#000"}),Object(je.createElement)(ye.Path,{d:"M16.5 9.5L19 12l-2.5 2.5",stroke:"#1E1E1E",strokeWidth:"1.5"}));const Zu={none:"",arrow:"→",chevron:"»"};const Ku={apiVersion:2,name:"core/query-pagination-next",title:"Next Page",category:"design",parent:["core/query-pagination"],description:"Displays the next posts page link.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["queryId","query","paginationArrow"],supports:{reusable:!1,html:!1,color:{gradients:!0,text:!1},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}}}},{name:Ju}=Ku,Qu={icon:$u,edit:function(e){let{attributes:{label:t},setAttributes:n,context:{paginationArrow:o}}=e;const r=Zu[o];return Object(je.createElement)("a",Object(mt.a)({href:"#pagination-next-pseudo-link",onClick:e=>e.preventDefault()},Object(we.useBlockProps)()),Object(je.createElement)(we.PlainText,{__experimentalVersion:2,tagName:"span","aria-label":Object(ke.__)("Next page link"),placeholder:Object(ke.__)("Next Page"),value:t,onChange:e=>n({label:e})}),r&&Object(je.createElement)("span",{className:"wp-block-query-pagination-next-arrow is-arrow-"+o},r))}};var Yu=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Rect,{x:"4",y:"10.5",width:"6",height:"3",rx:"1.5",fill:"#000"}),Object(je.createElement)(ye.Path,{d:"M13.5 14v-4l-1.5.5",stroke:"#1E1E1E"}),Object(je.createElement)(ye.Path,{d:"M19.266 9.805c-.473-.611-1.22-.51-1.702-.367a3.854 3.854 0 00-.718.307l.13 1.082c.192-.17.47-.422.782-.515.34-.1.578.025.668.141.21.27-.034.835-.16 1.055-.49.85-.93 1.594-1.45 2.492H19.5v-1h-.914c.277-.574.814-1.443.914-2.106.052-.343.02-.762-.234-1.09z",fill:"#1E1E1E"}));const Xu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"a",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object(je.createElement)(t,{className:"page-numbers "+n},e)};const em={apiVersion:2,name:"core/query-pagination-numbers",title:"Page Numbers",category:"design",parent:["core/query-pagination"],description:"Displays a list of page numbers for pagination",textdomain:"default",usesContext:["queryId","query"],supports:{reusable:!1,html:!1},editorStyle:"query-pagination-numbers-editor"},{name:tm}=em,nm={icon:Yu,edit:function(){const e=Object(je.createElement)(je.Fragment,null,Xu(1),Xu(2),Xu(3,"span","current"),Xu(4),Xu(5),Xu("...","span","dots"),Xu(8));return Object(je.createElement)("div",Object(we.useBlockProps)(),e)}};var om=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Rect,{x:"18",y:"13.5",width:"3",height:"3",rx:"1.5",transform:"rotate(-180 18 13.5)",fill:"#000"}),Object(je.createElement)(ye.Rect,{x:"13",y:"13.5",width:"3",height:"3",rx:"1.5",transform:"rotate(-180 13 13.5)",fill:"#000"}),Object(je.createElement)(ye.Path,{d:"M7.5 14.5L5 12l2.5-2.5",stroke:"#1E1E1E",strokeWidth:"1.5"}));const rm={none:"",arrow:"←",chevron:"«"};const am={apiVersion:2,name:"core/query-pagination-previous",title:"Previous Page",category:"design",parent:["core/query-pagination"],description:"Displays the previous posts page link.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["queryId","query","paginationArrow"],supports:{reusable:!1,html:!1,color:{gradients:!0,text:!1},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}}}},{name:lm}=am,cm={icon:om,edit:function(e){let{attributes:{label:t},setAttributes:n,context:{paginationArrow:o}}=e;const r=rm[o];return Object(je.createElement)("a",Object(mt.a)({href:"#pagination-previous-pseudo-link",onClick:e=>e.preventDefault()},Object(we.useBlockProps)()),r&&Object(je.createElement)("span",{className:"wp-block-query-pagination-previous-arrow is-arrow-"+o},r),Object(je.createElement)(we.PlainText,{__experimentalVersion:2,tagName:"span","aria-label":Object(ke.__)("Previous page link"),placeholder:Object(ke.__)("Previous Page"),value:t,onChange:e=>n({label:e})}))}},im=["archive"];var sm=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{stroke:"#1E1E1E",strokeWidth:"1.5",d:"M4 19.25h9M4 15.25h16"}),Object(je.createElement)(ye.Path,{d:"M8.994 10.103H6.08L5.417 12H4l2.846-8h1.383l2.845 8H9.657l-.663-1.897zm-.457-1.28l-.994-2.857-1.006 2.857h2z",fill:"#1E1E1E"}));const um=[{isDefault:!0,name:"archive-title",title:Object(ke.__)("Archive Title"),description:Object(ke.__)("Display the archive title based on the queried object."),icon:sm,attributes:{type:"archive"},scope:["inserter"]}];um.forEach(e=>{e.isActive||(e.isActive=(e,t)=>e.type===t.type)});var mm=um;var dm=[{attributes:{type:{type:"string"},textAlign:{type:"string"},level:{type:"number",default:1}},supports:{align:["wide","full"],html:!1,color:{gradients:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0}},save:()=>null,migrate:at,isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}}];const bm={apiVersion:2,name:"core/query-title",title:"Query Title",category:"theme",description:"Display the query title.",textdomain:"default",attributes:{type:{type:"string"},textAlign:{type:"string"},level:{type:"number",default:1}},supports:{align:["wide","full"],html:!1,color:{gradients:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}}},editorStyle:"wp-block-query-title-editor"},{name:pm}=bm,gm={edit:function(e){let{attributes:{type:t,level:n,textAlign:o},setAttributes:r}=e;const a="h"+n,l=Object(we.useBlockProps)({className:tt()({["has-text-align-"+o]:o,"wp-block-query-title__placeholder":"archive"===t})});if(!im.includes(t))return Object(je.createElement)("div",l,Object(je.createElement)(we.Warning,null,Object(ke.__)("Provided type is not supported.")));let c;return"archive"===t&&(c=Object(je.createElement)(a,l,Object(ke.__)("Archive title"))),Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(ia,{selectedLevel:n,onChange:e=>r({level:e})}),Object(je.createElement)(we.AlignmentControl,{value:o,onChange:e=>{r({textAlign:e})}})),c)},variations:mm,deprecated:dm};var hm=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M13 6v6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H13zm-9 6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H4v6z"}));const vm={value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:""},citation:{type:"string",source:"html",selector:"cite",default:""},align:{type:"string"}};var Om=[{attributes:vm,save(e){let{attributes:t}=e;const{align:n,value:o,citation:r}=t;return Object(je.createElement)("blockquote",{style:{textAlign:n||null}},Object(je.createElement)(we.RichText.Content,{multiline:!0,value:o}),!we.RichText.isEmpty(r)&&Object(je.createElement)(we.RichText.Content,{tagName:"cite",value:r}))}},{attributes:{...vm,style:{type:"number",default:1}},migrate:e=>2===e.style?{...Object(Me.omit)(e,["style"]),className:e.className?e.className+" is-style-large":"is-style-large"}:e,save(e){let{attributes:t}=e;const{align:n,value:o,citation:r,style:a}=t;return Object(je.createElement)("blockquote",{className:2===a?"is-large":"",style:{textAlign:n||null}},Object(je.createElement)(we.RichText.Content,{multiline:!0,value:o}),!we.RichText.isEmpty(r)&&Object(je.createElement)(we.RichText.Content,{tagName:"cite",value:r}))}},{attributes:{...vm,citation:{type:"string",source:"html",selector:"footer",default:""},style:{type:"number",default:1}},migrate:e=>isNaN(parseInt(e.style))?e:{...Object(Me.omit)(e,["style"])},save(e){let{attributes:t}=e;const{align:n,value:o,citation:r,style:a}=t;return Object(je.createElement)("blockquote",{className:"blocks-quote-style-"+a,style:{textAlign:n||null}},Object(je.createElement)(we.RichText.Content,{multiline:!0,value:o}),!we.RichText.isEmpty(r)&&Object(je.createElement)(we.RichText.Content,{tagName:"footer",value:r}))}}];const jm="web"===je.Platform.OS;var ym={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>Object(Oe.createBlock)("core/quote",{value:Object(kt.toHTMLString)({value:Object(kt.join)(e.map(e=>{let{content:t}=e;return Object(kt.create)({html:t})}),"\u2028"),multilineTag:"p"}),anchor:e.anchor})},{type:"block",blocks:["core/heading"],transform:e=>{let{content:t,anchor:n}=e;return Object(Oe.createBlock)("core/quote",{value:`<p>${t}</p>`,anchor:n})}},{type:"block",blocks:["core/pullquote"],transform:e=>{let{value:t,citation:n,anchor:o}=e;return Object(Oe.createBlock)("core/quote",{value:t,citation:n,anchor:o})}},{type:"prefix",prefix:">",transform:e=>Object(Oe.createBlock)("core/quote",{value:`<p>${e}</p>`})},{type:"raw",isMatch:e=>{const t=(()=>{let e=!1;return t=>"P"===t.nodeName||(e||"CITE"!==t.nodeName?void 0:(e=!0,!0))})();return"BLOCKQUOTE"===e.nodeName&&Array.from(e.childNodes).every(t)},schema:e=>{let{phrasingContentSchema:t}=e;return{blockquote:{children:{p:{children:t},cite:{children:t}}}}}}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>{let{value:t,citation:n}=e;const o=[];return t&&"<p></p>"!==t&&o.push(...Object(kt.split)(Object(kt.create)({html:t,multilineTag:"p"}),"\u2028").map(e=>Object(Oe.createBlock)("core/paragraph",{content:Object(kt.toHTMLString)({value:e})}))),n&&"<p></p>"!==n&&o.push(Object(Oe.createBlock)("core/paragraph",{content:n})),0===o.length?Object(Oe.createBlock)("core/paragraph",{content:""}):o}},{type:"block",blocks:["core/heading"],transform:e=>{let{value:t,citation:n,...o}=e;if("<p></p>"===t)return Object(Oe.createBlock)("core/heading",{content:n});const r=Object(kt.split)(Object(kt.create)({html:t,multilineTag:"p"}),"\u2028"),a=Object(Oe.createBlock)("core/heading",{content:Object(kt.toHTMLString)({value:r[0]})});if(!n&&1===r.length)return a;const l=r.slice(1);return[a,Object(Oe.createBlock)("core/quote",{...o,citation:n,value:Object(kt.toHTMLString)({value:l.length?Object(kt.join)(r.slice(1),"\u2028"):Object(kt.create)(),multilineTag:"p"})})]}},{type:"block",blocks:["core/pullquote"],transform:e=>{let{value:t,citation:n,anchor:o}=e;return Object(Oe.createBlock)("core/pullquote",{value:t,citation:n,anchor:o})}}]};const fm={apiVersion:2,name:"core/quote",title:"Quote",category:"text",description:'Give quoted text visual emphasis. "In quoting others, we cite ourselves." — Julio Cortázar',keywords:["blockquote","cite"],textdomain:"default",attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:"",__experimentalRole:"content"},citation:{type:"string",source:"html",selector:"cite",default:"",__experimentalRole:"content"},align:{type:"string"}},supports:{anchor:!0,__experimentalSlashInserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0}}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"plain",label:"Plain"},{name:"large",label:"Large"}],editorStyle:"wp-block-quote-editor",style:"wp-block-quote"},{name:_m}=fm,km={icon:hm,example:{attributes:{value:"<p>"+Object(ke.__)("In quoting others, we cite ourselves.")+"</p>",citation:"Julio Cortázar",className:"is-style-large"}},transforms:ym,edit:function(e){let{attributes:t,setAttributes:n,isSelected:o,mergeBlocks:r,onReplace:a,className:l,insertBlocksAfter:c,style:i}=e;const{align:s,value:u,citation:m}=t,d=Object(we.useBlockProps)({className:tt()(l,{["has-text-align-"+s]:s}),style:i});return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(we.AlignmentControl,{value:s,onChange:e=>{n({align:e})}})),Object(je.createElement)(_e.BlockQuotation,d,Object(je.createElement)(we.RichText,{identifier:"value",multiline:!0,value:u,onChange:e=>n({value:e}),onMerge:r,onRemove:e=>{const t=!m||0===m.length;!e&&t&&a([])},"aria-label":Object(ke.__)("Quote text"),placeholder:Object(ke.__)("Add quote"),onReplace:a,onSplit:e=>Object(Oe.createBlock)("core/quote",{...t,value:e}),__unstableOnSplitMiddle:()=>Object(Oe.createBlock)("core/paragraph"),textAlign:s}),(!we.RichText.isEmpty(m)||o)&&Object(je.createElement)(we.RichText,{identifier:"citation",tagName:jm?"cite":void 0,style:{display:"block"},value:m,onChange:e=>n({citation:e}),__unstableMobileNoFocusOnMount:!0,"aria-label":Object(ke.__)("Quote citation text"),placeholder:Object(ke.__)("Add citation"),className:"wp-block-quote__citation",textAlign:s,__unstableOnSplitAtEnd:()=>c(Object(Oe.createBlock)("core/paragraph"))})))},save:function(e){let{attributes:t}=e;const{align:n,value:o,citation:r}=t,a=tt()({["has-text-align-"+n]:n});return Object(je.createElement)("blockquote",we.useBlockProps.save({className:a}),Object(je.createElement)(we.RichText.Content,{multiline:!0,value:o}),!we.RichText.isEmpty(r)&&Object(je.createElement)(we.RichText.Content,{tagName:"cite",value:r}))},merge(e,t){let{value:n,citation:o}=t;return o||(o=e.citation),n&&"<p></p>"!==n?{...e,value:e.value+n,citation:o}:{...e,citation:o}},deprecated:Om};var wm=n("+WrK"),Em=n("diJD");var Cm=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z"}));const xm={apiVersion:2,name:"core/block",title:"Reusable block",category:"reusable",description:"Create and save content to reuse across your site. Update the block, and the changes apply everywhere it’s used.",textdomain:"default",attributes:{ref:{type:"number"}},supports:{customClassName:!1,html:!1,inserter:!1},editorStyle:"wp-block-editor"},{name:Sm}=xm,Bm={edit:function(e){let{attributes:{ref:t},clientId:n}=e;const[o,r]=Object(we.__experimentalUseNoRecursiveRenders)(t),{isMissing:a,hasResolved:l}=Object(Pe.useSelect)(e=>{const n=e(It.store).getEntityRecord("postType","wp_block",t),o=e(It.store).hasFinishedResolution("getEntityRecord",["postType","wp_block",t]);return{hasResolved:o,isMissing:o&&!n}},[t,n]),{__experimentalConvertBlockToStatic:c}=Object(Pe.useDispatch)(Em.store),[i,s,u]=Object(It.useEntityBlockEditor)("postType","wp_block",{id:t}),[m,d]=Object(It.useEntityProp)("postType","wp_block","title",t),b=Object(we.useBlockProps)(),p=Object(we.useInnerBlocksProps)({},{value:i,onInput:s,onChange:u,renderAppender:null!=i&&i.length?void 0:we.InnerBlocks.ButtonBlockAppender});return o?Object(je.createElement)("div",b,Object(je.createElement)(we.Warning,null,Object(ke.__)("Block cannot be rendered inside itself."))):a?Object(je.createElement)("div",b,Object(je.createElement)(we.Warning,null,Object(ke.__)("Block has been deleted or is unavailable."))):l?Object(je.createElement)(r,null,Object(je.createElement)("div",b,Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(_e.ToolbarGroup,null,Object(je.createElement)(_e.ToolbarButton,{onClick:()=>c(n),label:Object(ke.__)("Convert to regular blocks"),icon:Cm,showTooltip:!0}))),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,null,Object(je.createElement)(_e.TextControl,{label:Object(ke.__)("Name"),value:m,onChange:d}))),Object(je.createElement)(we.__experimentalBlockContentOverlay,{clientId:n,wrapperProps:p,className:"block-library-block__reusable-block-container"}))):Object(je.createElement)("div",b,Object(je.createElement)(_e.Placeholder,null,Object(je.createElement)(_e.Spinner,null)))},icon:wm.a};var Tm=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M5 10.2h-.8v1.5H5c1.9 0 3.8.8 5.1 2.1 1.4 1.4 2.1 3.2 2.1 5.1v.8h1.5V19c0-2.3-.9-4.5-2.6-6.2-1.6-1.6-3.8-2.6-6.1-2.6zm10.4-1.6C12.6 5.8 8.9 4.2 5 4.2h-.8v1.5H5c3.5 0 6.9 1.4 9.4 3.9s3.9 5.8 3.9 9.4v.8h1.5V19c0-3.9-1.6-7.6-4.4-10.4zM4 20h3v-3H4v3z"}));const Nm={apiVersion:2,name:"core/rss",title:"RSS",category:"widgets",description:"Display entries from any RSS or Atom feed.",keywords:["atom","feed"],textdomain:"default",attributes:{columns:{type:"number",default:2},blockLayout:{type:"string",default:"list"},feedURL:{type:"string",default:""},itemsToShow:{type:"number",default:5},displayExcerpt:{type:"boolean",default:!1},displayAuthor:{type:"boolean",default:!1},displayDate:{type:"boolean",default:!1},excerptLength:{type:"number",default:55}},supports:{align:!0,html:!1},editorStyle:"wp-block-rss-editor",style:"wp-block-rss"},{name:zm}=Nm,Pm={icon:Tm,example:{attributes:{feedURL:"https://wordpress.org"}},edit:function(e){let{attributes:t,setAttributes:n}=e;const[o,r]=Object(je.useState)(!t.feedURL),{blockLayout:a,columns:l,displayAuthor:c,displayDate:i,displayExcerpt:s,excerptLength:u,feedURL:m,itemsToShow:d}=t;function b(e){return()=>{const o=t[e];n({[e]:!o})}}const p=Object(we.useBlockProps)();if(o)return Object(je.createElement)("div",p,Object(je.createElement)(_e.Placeholder,{icon:Tm,label:"RSS"},Object(je.createElement)("form",{onSubmit:function(e){e.preventDefault(),m&&r(!1)},className:"wp-block-rss__placeholder-form"},Object(je.createElement)(_e.TextControl,{placeholder:Object(ke.__)("Enter URL here…"),value:m,onChange:e=>n({feedURL:e}),className:"wp-block-rss__placeholder-input"}),Object(je.createElement)(_e.Button,{variant:"primary",type:"submit"},Object(ke.__)("Use URL")))));const g=[{icon:to.a,title:Object(ke.__)("Edit RSS URL"),onClick:()=>r(!0)},{icon:$a,title:Object(ke.__)("List view"),onClick:()=>n({blockLayout:"list"}),isActive:"list"===a},{icon:Za.a,title:Object(ke.__)("Grid view"),onClick:()=>n({blockLayout:"grid"}),isActive:"grid"===a}];return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(_e.ToolbarGroup,{controls:g})),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("RSS settings")},Object(je.createElement)(_e.RangeControl,{label:Object(ke.__)("Number of items"),value:d,onChange:e=>n({itemsToShow:e}),min:1,max:10,required:!0}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Display author"),checked:c,onChange:b("displayAuthor")}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Display date"),checked:i,onChange:b("displayDate")}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Display excerpt"),checked:s,onChange:b("displayExcerpt")}),s&&Object(je.createElement)(_e.RangeControl,{label:Object(ke.__)("Max number of words in excerpt"),value:u,onChange:e=>n({excerptLength:e}),min:10,max:100,required:!0}),"grid"===a&&Object(je.createElement)(_e.RangeControl,{label:Object(ke.__)("Columns"),value:l,onChange:e=>n({columns:e}),min:2,max:6,required:!0}))),Object(je.createElement)("div",p,Object(je.createElement)(_e.Disabled,null,Object(je.createElement)(Ce.a,{block:"core/rss",attributes:t}))))}},Im=Object(je.createElement)(_e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(_e.Rect,{x:"7",y:"10",width:"10",height:"4",rx:"1",fill:"currentColor"})),Mm=Object(je.createElement)(_e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(_e.Rect,{x:"4.75",y:"15.25",width:"6.5",height:"9.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),Object(je.createElement)(_e.Rect,{x:"16",y:"10",width:"4",height:"4",rx:"1",fill:"currentColor"})),Rm=Object(je.createElement)(_e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(_e.Rect,{x:"4.75",y:"15.25",width:"6.5",height:"14.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),Object(je.createElement)(_e.Rect,{x:"14",y:"10",width:"4",height:"4",rx:"1",fill:"currentColor"})),Lm=Object(je.createElement)(_e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(_e.Rect,{x:"4.75",y:"15.25",width:"6.5",height:"14.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",fill:"none",strokeWidth:"1.5"})),Vm=Object(je.createElement)(_e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(_e.Rect,{x:"4.75",y:"7.75",width:"14.5",height:"8.5",rx:"1.25",stroke:"currentColor",fill:"none",strokeWidth:"1.5"}),Object(je.createElement)(_e.Rect,{x:"8",y:"11",width:"8",height:"2",fill:"currentColor"})),Hm=Object(je.createElement)(_e.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(_e.Rect,{x:"4.75",y:"17.25",width:"5.5",height:"14.5",transform:"rotate(-90 4.75 17.25)",stroke:"currentColor",fill:"none",strokeWidth:"1.5"}),Object(je.createElement)(_e.Rect,{x:"4",y:"7",width:"10",height:"2",fill:"currentColor"}));var Am=[{name:"default",isDefault:!0,attributes:{buttonText:Object(ke.__)("Search"),label:Object(ke.__)("Search")}}];const Fm={apiVersion:2,name:"core/search",title:"Search",category:"widgets",description:"Help visitors find your content.",keywords:["find"],textdomain:"default",attributes:{label:{type:"string",__experimentalRole:"content"},showLabel:{type:"boolean",default:!0},placeholder:{type:"string",default:"",__experimentalRole:"content"},width:{type:"number"},widthUnit:{type:"string"},buttonText:{type:"string",__experimentalRole:"content"},buttonPosition:{type:"string",default:"button-outside"},buttonUseIcon:{type:"boolean",default:!1}},supports:{align:["left","center","right"],color:{gradients:!0,__experimentalSkipSerialization:!0},__experimentalBorder:{color:!0,radius:!0,__experimentalSkipSerialization:!0},html:!1},editorStyle:"wp-block-search-editor",style:"wp-block-search"},{name:Dm}=Fm,Gm={icon:cc.a,example:{},variations:Am,edit:function(e){var t,n;let{className:o,attributes:r,setAttributes:a,toggleSelection:l,isSelected:c,clientId:i}=e;const{label:s,showLabel:u,placeholder:m,width:d,widthUnit:b,align:p,buttonText:g,buttonPosition:h,buttonUseIcon:v,style:O}=r,j=Object(Pe.useSelect)(e=>{var t;const{getBlockParentsByBlockName:n,wasBlockJustInserted:o}=e(we.store);return!(null===(t=n(i,"core/navigation"))||void 0===t||!t.length)&&o(i)},[i]),{__unstableMarkNextChangeAsNotPersistent:y}=Object(Pe.useDispatch)(we.store);Object(je.useEffect)(()=>{j&&(y(),a({showLabel:!1,buttonUseIcon:!0,buttonPosition:"button-inside"}))},[j]);const f=null==O||null===(t=O.border)||void 0===t?void 0:t.radius,_=null==O||null===(n=O.border)||void 0===n?void 0:n.color,k=Object(we.__experimentalUseBorderProps)(r);"number"==typeof f&&(k.style.borderRadius=f+"px");const w=Object(we.__experimentalUseColorProps)(r),E="wp-block-search__width-"+Object(nt.useInstanceId)(we.__experimentalUnitControl),C="button-inside"===h,x="button-outside"===h,S="no-button"===h,B="button-only"===h,T=Object(_e.__experimentalUseCustomUnits)({availableUnits:["%","px"],defaultValues:{"%":50,px:350}}),N=[{role:"menuitemradio",title:Object(ke.__)("Button outside"),isActive:"button-outside"===h,icon:Mm,onClick:()=>{a({buttonPosition:"button-outside"})}},{role:"menuitemradio",title:Object(ke.__)("Button inside"),isActive:"button-inside"===h,icon:Rm,onClick:()=>{a({buttonPosition:"button-inside"})}},{role:"menuitemradio",title:Object(ke.__)("No button"),isActive:"no-button"===h,icon:Lm,onClick:()=>{a({buttonPosition:"no-button"})}}],z=()=>{const e=tt()("wp-block-search__input",C?void 0:k.className),t=C?{borderRadius:f}:k.style;return Object(je.createElement)("input",{className:e,style:t,"aria-label":Object(ke.__)("Optional placeholder text"),placeholder:m?void 0:Object(ke.__)("Optional placeholder…"),value:m,onChange:e=>a({placeholder:e.target.value})})},P=()=>{const e=tt()("wp-block-search__button",w.className,C?void 0:k.className,v?"has-icon":void 0),t={...w.style,...C?{borderRadius:f}:k.style};return Object(je.createElement)(je.Fragment,null,v&&Object(je.createElement)("button",{type:"button",className:e,style:t},Object(je.createElement)(ac.a,{icon:cc.a})),!v&&Object(je.createElement)(we.RichText,{className:e,style:t,"aria-label":Object(ke.__)("Button text"),placeholder:Object(ke.__)("Add button text…"),withoutInteractiveFormatting:!0,value:g,onChange:e=>a({buttonText:e})}))},I=Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(_e.ToolbarGroup,null,Object(je.createElement)(_e.ToolbarButton,{title:Object(ke.__)("Toggle search label"),icon:Hm,onClick:()=>{a({showLabel:!u})},className:u?"is-pressed":void 0}),Object(je.createElement)(_e.ToolbarDropdownMenu,{icon:(()=>{switch(h){case"button-inside":return Rm;case"button-outside":return Mm;case"no-button":return Lm;case"button-only":return Im}})(),label:Object(ke.__)("Change button position"),controls:N}),!S&&Object(je.createElement)(_e.ToolbarButton,{title:Object(ke.__)("Use button with icon"),icon:Vm,onClick:()=>{a({buttonUseIcon:!v})},className:v?"is-pressed":void 0}))),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Display Settings")},Object(je.createElement)(_e.BaseControl,{label:Object(ke.__)("Width"),id:E},Object(je.createElement)(we.__experimentalUnitControl,{id:E,min:"220px",onChange:e=>{const t="%"===b&&parseInt(e,10)>100?100:e;a({width:parseInt(t,10)})},onUnitChange:e=>{a({width:"%"===e?50:350,widthUnit:e})},style:{maxWidth:80},value:`${d}${b}`,unit:b,units:T}),Object(je.createElement)(_e.ButtonGroup,{className:"wp-block-search__components-button-group","aria-label":Object(ke.__)("Percentage Width")},[25,50,75,100].map(e=>Object(je.createElement)(_e.Button,{key:e,isSmall:!0,variant:e+"%"==`${d}${b}`?"primary":void 0,onClick:()=>a({width:e,widthUnit:"%"})},e,"%"))))))),M=e=>e?`calc(${e} + 4px)`:void 0,R=Object(we.useBlockProps)({className:tt()(o,C?void 0:k.className,C?"wp-block-search__button-inside":void 0,x?"wp-block-search__button-outside":void 0,S?"wp-block-search__no-button":void 0,B?"wp-block-search__button-only":void 0,v||S?void 0:"wp-block-search__text-button",v&&!S?"wp-block-search__icon-button":void 0)});return Object(je.createElement)("div",R,I,u&&Object(je.createElement)(we.RichText,{className:"wp-block-search__label","aria-label":Object(ke.__)("Label text"),placeholder:Object(ke.__)("Add label…"),withoutInteractiveFormatting:!0,value:s,onChange:e=>a({label:e})}),Object(je.createElement)(_e.ResizableBox,{size:{width:`${d}${b}`},className:tt()("wp-block-search__inside-wrapper",C?k.className:void 0),style:(()=>{const e={borderColor:_},t=0!==parseInt(f,10);if(C&&t){if("object"==typeof f){const{topLeft:t,topRight:n,bottomLeft:o,bottomRight:r}=f;return{borderTopLeftRadius:M(t),borderTopRightRadius:M(n),borderBottomLeftRadius:M(o),borderBottomRightRadius:M(r),...e}}const t=Number.isInteger(f)?f+"px":f;e.borderRadius=`calc(${t} + 4px)`}return e})(),minWidth:220,enable:B?{}:{right:"right"!==p,left:"right"===p},onResizeStart:(e,t,n)=>{a({width:parseInt(n.offsetWidth,10),widthUnit:"px"}),l(!1)},onResizeStop:(e,t,n,o)=>{a({width:parseInt(d+o.width,10)}),l(!0)},showHandle:c},(C||x)&&Object(je.createElement)(je.Fragment,null,z(),P()),B&&P(),S&&z()))}};var Um=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M20.2 7v4H3.8V7H2.2v9h1.6v-3.5h16.4V16h1.6V7z"}));var qm=e=>{let{color:t,setColor:n}=e;return Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(we.PanelColorSettings,{__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,title:Object(ke.__)("Color"),colorSettings:[{value:t.color,onChange:n,label:Object(ke.__)("Color")}]}))};var Wm=Object(we.withColors)("color",{textColor:"color"})((function(e){let{color:t,setColor:n,className:o}=e;return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.HorizontalRule,Object(we.useBlockProps)({className:tt()(o,{"has-background":t.color,[t.class]:t.class}),style:{backgroundColor:t.color,color:t.color}})),Object(je.createElement)(qm,{color:t,setColor:n}))}));var $m={from:[{type:"enter",regExp:/^-{3,}$/,transform:()=>Object(Oe.createBlock)("core/separator")},{type:"raw",selector:"hr",schema:{hr:{}}}]};const Zm={apiVersion:2,name:"core/separator",title:"Separator",category:"design",description:"Create a break between ideas or sections with a horizontal separator.",keywords:["horizontal-line","hr","divider"],textdomain:"default",attributes:{color:{type:"string"},customColor:{type:"string"}},supports:{anchor:!0,align:["center","wide","full"]},styles:[{name:"default",label:"Default",isDefault:!0},{name:"wide",label:"Wide Line"},{name:"dots",label:"Dots"}],editorStyle:"wp-block-separator-editor",style:"wp-block-separator"},{name:Km}=Zm,Jm={icon:Um,example:{attributes:{customColor:"#065174",className:"is-style-wide"}},transforms:$m,edit:Wm,save:function(e){let{attributes:t}=e;const{color:n,customColor:o}=t,r=Object(we.getColorClassName)("background-color",n),a=Object(we.getColorClassName)("color",n),l=tt()({"has-text-color has-background":n||o,[r]:r,[a]:a}),c={backgroundColor:r?void 0:o,color:a?void 0:o};return Object(je.createElement)("hr",we.useBlockProps.save({className:l,style:c}))}};var Qm=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M16 4.2v1.5h2.5v12.5H16v1.5h4V4.2h-4zM4.2 19.8h4v-1.5H5.8V5.8h2.5V4.2h-4l-.1 15.6zm5.1-3.1l1.4.6 4-10-1.4-.6-4 10z"}));var Ym=n("UuzZ");var Xm={from:[{type:"shortcode",tag:"[a-z][a-z0-9_-]*",attributes:{text:{type:"string",shortcode:(e,t)=>{let{content:n}=t;return Object(Ym.removep)(Object(Ym.autop)(n))}}},priority:20}]};const ed={apiVersion:2,name:"core/shortcode",title:"Shortcode",category:"widgets",description:"Insert additional custom elements with a WordPress shortcode.",textdomain:"default",attributes:{text:{type:"string",source:"html"}},supports:{className:!1,customClassName:!1,html:!1},editorStyle:"wp-block-shortcode-editor"},{name:td}=ed,nd={icon:Qm,transforms:Xm,edit:function e(t){let{attributes:n,setAttributes:o}=t;const r="blocks-shortcode-input-"+Object(nt.useInstanceId)(e);return Object(je.createElement)("div",Object(we.useBlockProps)({className:"components-placeholder"}),Object(je.createElement)("label",{htmlFor:r,className:"components-placeholder__label"},Object(je.createElement)(ac.a,{icon:Qm}),Object(ke.__)("Shortcode")),Object(je.createElement)(we.PlainText,{className:"blocks-shortcode__textarea",id:r,value:n.text,"aria-label":Object(ke.__)("Shortcode text"),placeholder:Object(ke.__)("Write shortcode here…"),onChange:e=>o({text:e})}))},save:function(e){let{attributes:t}=e;return Object(je.createElement)(je.RawHTML,null,t.text)}};var od=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 1.5c4.1 0 7.5 3.4 7.5 7.5v.1c-1.4-.8-3.3-1.7-3.4-1.8-.2-.1-.5-.1-.8.1l-2.9 2.1L9 11.3c-.2-.1-.4 0-.6.1l-3.7 2.2c-.1-.5-.2-1-.2-1.5 0-4.2 3.4-7.6 7.5-7.6zm0 15c-3.1 0-5.7-1.9-6.9-4.5l3.7-2.2 3.5 1.2c.2.1.5 0 .7-.1l2.9-2.1c.8.4 2.5 1.2 3.5 1.9-.9 3.3-3.9 5.8-7.4 5.8z"}));const rd=["image"],ad=e=>{let{alt:t,attributes:{align:n,width:o,height:r,isLink:a,linkTarget:l,shouldSyncIcon:c},containerRef:i,isSelected:s,setAttributes:u,setLogo:m,logoUrl:d,siteUrl:b,logoId:p,iconId:g,setIcon:h,canUserEdit:v}=e;const O=Ba(i,[n]),j=Object(nt.useViewportMatch)("medium"),y=!Object(Me.includes)(["wide","full"],n)&&j,[{naturalWidth:f,naturalHeight:_},k]=Object(je.useState)({}),[w,E]=Object(je.useState)(!1),{toggleSelection:C}=Object(Pe.useDispatch)(we.store),x=tt()("custom-logo-link",{"is-transient":Object(ze.isBlobURL)(d)}),{imageEditing:S,maxWidth:B,title:T}=Object(Pe.useSelect)(e=>{const{getSettings:t}=e(we.store);return{title:e(It.store).getEditedEntityRecord("root","site").title,...Object(Me.pick)(t(),["imageEditing","maxWidth"])}},[]);Object(je.useEffect)(()=>{c&&p!==g&&u({shouldSyncIcon:!1})},[]),Object(je.useEffect)(()=>{s||E(!1)},[s]);const N=Object(je.createElement)("img",{className:"custom-logo",src:d,alt:t,onLoad:e=>{k(Object(Me.pick)(e.target,["naturalWidth","naturalHeight"]))}});let z,P=N;if(a&&(P=Object(je.createElement)("a",{href:b,className:x,rel:"home",title:T,onClick:e=>e.preventDefault()},N)),O&&f&&_){z=f>O?O:f}if(!y||!z)return Object(je.createElement)("div",{style:{width:o,height:r}},P);const I=o||120,M=f/_,R=I/M,L=f<_?20:Math.ceil(20*M),V=_<f?20:Math.ceil(20/M),H=2.5*B;let A=!1,F=!1;"center"===n?(A=!0,F=!0):Object(ke.isRTL)()?"left"===n?A=!0:F=!0:"right"===n?F=!0:A=!0;const D=p&&f&&_&&S,G=D&&w?Object(je.createElement)(we.__experimentalImageEditingProvider,{id:p,url:d,naturalWidth:f,naturalHeight:_,clientWidth:O,onSaveImage:e=>{m(e.id)},isEditing:w,onFinishEditing:()=>E(!1)},Object(je.createElement)(we.__experimentalImageEditor,{url:d,width:I,height:R,clientWidth:O,naturalHeight:_,naturalWidth:f})):Object(je.createElement)(_e.ResizableBox,{size:{width:I,height:R},showHandle:s,minWidth:L,maxWidth:H,minHeight:V,maxHeight:H/M,lockAspectRatio:!0,enable:{top:!1,right:A,bottom:!0,left:F},onResizeStart:function(){C(!1)},onResizeStop:(e,t,n,o)=>{C(!0),u({width:parseInt(I+o.width,10),height:parseInt(R+o.height,10)})}},P),U=Object(je.createInterpolateElement)(Object(ke.__)("Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the <a>Site Icon settings</a>."),{a:Object(je.createElement)("a",{href:b+"/wp-admin/customize.php?autofocus[section]=title_tagline",target:"_blank",rel:"noopener noreferrer"})});return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Settings")},Object(je.createElement)(_e.RangeControl,{label:Object(ke.__)("Image width"),onChange:e=>u({width:e}),min:L,max:H,initialPosition:Math.min(120,H),value:o||"",disabled:!y}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Link image to home"),onChange:()=>u({isLink:!a}),checked:a}),a&&Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Open in new tab"),onChange:e=>u({linkTarget:e?"_blank":"_self"}),checked:"_blank"===l})),v&&Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Use as site icon"),onChange:e=>{u({shouldSyncIcon:e}),h(e?p:void 0)},checked:!!c,help:U})))),Object(je.createElement)(we.BlockControls,{group:"block"},D&&!w&&Object(je.createElement)(_e.ToolbarButton,{onClick:()=>E(!0),icon:Ca,label:Object(ke.__)("Crop")})),G)};const ld={apiVersion:2,name:"core/site-logo",title:"Site Logo",category:"theme",description:"Display a graphic to represent this site. Update the block, and the changes apply everywhere it’s used. This is different than the site icon, which is the smaller image visible in your dashboard, browser tabs, etc used to help others recognize this site.",textdomain:"default",attributes:{width:{type:"number"},isLink:{type:"boolean",default:!0},linkTarget:{type:"string",default:"_self"},shouldSyncIcon:{type:"boolean"}},example:{viewportWidth:500,attributes:{width:350,className:"block-editor-block-types-list__site-logo-example"}},supports:{html:!1,align:!0,alignWide:!1,color:{__experimentalDuotone:"img",text:!1,background:!1}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"rounded",label:"Rounded"}],editorStyle:"wp-block-site-logo-editor",style:"wp-block-site-logo"},{name:cd}=ld,id={icon:od,edit:function(e){let{attributes:t,className:n,setAttributes:o,isSelected:r}=e;const{width:a,shouldSyncIcon:l}=t,[c,i]=Object(je.useState)(),s=Object(je.useRef)(),{siteLogoId:u,canUserEdit:m,url:d,siteIconId:b,mediaItemData:p,isRequestingMediaItem:g}=Object(Pe.useSelect)(e=>{const{canUser:t,getEntityRecord:n,getEditedEntityRecord:o}=e(It.store),r=o("root","site"),a=n("root","__unstableBase"),l=null==r?void 0:r.site_logo,c=null==a?void 0:a.site_logo,i=t("update","settings"),s=i?l:c,u=null==r?void 0:r.site_icon,m=s&&e(It.store).getMedia(s,{context:"view"}),d=s&&!e(It.store).hasFinishedResolution("getMedia",[s,{context:"view"}]);return{siteLogoId:s,canUserEdit:i,url:null==a?void 0:a.url,mediaItemData:m&&{id:m.id,url:m.source_url,alt:m.alt_text},isRequestingMediaItem:d,siteIconId:u}},[]),{editEntityRecord:h}=Object(Pe.useDispatch)(It.store),v=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(l||t)&&O(e),h("root","site",void 0,{site_logo:e})},O=e=>h("root","site",void 0,{site_icon:e});let j=null;p&&(j=p.alt,c!==p.url&&i(p.url));const y=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return!e.id&&e.url?(v(void 0),void i(e.url)):void v(e.id,t)},{createErrorNotice:f}=Object(Pe.useDispatch)(Do.store),_=e=>{f(e[2],{type:"snackbar"})},k=m&&c&&Object(je.createElement)(we.BlockControls,{group:"other"},Object(je.createElement)(we.MediaReplaceFlow,{mediaURL:c,allowedTypes:rd,accept:"image/*",onSelect:y,onError:_},Object(je.createElement)(_e.MenuItem,{onClick:()=>{v(null),i(void 0),o({width:void 0})}},Object(ke.__)("Reset"))));let w;const E=void 0===u||g;E&&(w=Object(je.createElement)(_e.Spinner,null)),c&&(w=Object(je.createElement)(ad,{alt:j,attributes:t,className:n,containerRef:s,isSelected:r,setAttributes:o,logoUrl:c,setLogo:v,logoId:(null==p?void 0:p.id)||u,siteUrl:d,setIcon:O,iconId:b,canUserEdit:m}));const C=tt()(n,{"is-default-size":!a}),x=Object(we.useBlockProps)({ref:s,className:C}),S=Object(ke.__)("Add a site logo");return Object(je.createElement)("div",x,k,!!c&&w,!c&&!m&&Object(je.createElement)(_e.Placeholder,{className:"site-logo_placeholder"},E&&Object(je.createElement)("span",{className:"components-placeholder__preview"},Object(je.createElement)(_e.Spinner,null))),!c&&m&&Object(je.createElement)(we.MediaPlaceholder,{onSelect:e=>{if(void 0===l){const t=!b;return o({shouldSyncIcon:t}),void y(e,t)}y(e)},accept:"image/*",allowedTypes:rd,onError:_,placeholder:e=>{const t=tt()("block-editor-media-placeholder",n);return Object(je.createElement)(_e.Placeholder,{className:t,preview:w},Object(je.createElement)(ye.SVG,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60"},Object(je.createElement)(ye.Path,{vectorEffect:"non-scaling-stroke",d:"m61 32.622-13.555-9.137-15.888 9.859a5 5 0 0 1-5.386-.073l-9.095-5.989L1 37.5"})),e)},mediaLibraryButton:e=>{let{open:t}=e;return Object(je.createElement)(_e.Button,{icon:xa.a,variant:"primary",label:S,showTooltip:!0,tooltipPosition:"top center",onClick:()=>{t()}})}}))}};var sd=Object(je.createElement)(_e.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},Object(je.createElement)(_e.Path,{fill:"none",d:"M0 0h24v24H0z"}),Object(je.createElement)(_e.Path,{d:"M4 9h16v2H4V9zm0 4h10v2H4v-2z"}));var ud=[{attributes:{textAlign:{type:"string"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0}},save:()=>null,migrate:at,isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}}];const md={apiVersion:2,name:"core/site-tagline",title:"Site Tagline",category:"theme",description:"Describe in a few words what the website is about. The tagline can be used in search results or when sharing on social networks even if it's not displayed in the theme design.",keywords:["description"],textdomain:"default",attributes:{textAlign:{type:"string"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}}},editorStyle:"wp-block-site-tagline-editor"},{name:dd}=md,bd={icon:sd,edit:function(e){let{attributes:t,setAttributes:n}=e;const{textAlign:o}=t,[r,a]=Object(It.useEntityProp)("root","site","description"),{canUserEdit:l,readOnlySiteTagLine:c}=Object(Pe.useSelect)(e=>{const{canUser:t,getEntityRecord:n}=e(It.store),o=n("root","__unstableBase");return{canUserEdit:t("update","settings"),readOnlySiteTagLine:null==o?void 0:o.description}},[]),i=Object(we.useBlockProps)({className:tt()({["has-text-align-"+o]:o,"wp-block-site-tagline__placeholder":!l&&!c})}),s=l?Object(je.createElement)(we.RichText,Object(mt.a)({allowedFormats:[],onChange:a,"aria-label":Object(ke.__)("Site tagline text"),placeholder:Object(ke.__)("Write site tagline…"),tagName:"p",value:r},i)):Object(je.createElement)("p",i,c||Object(ke.__)("Site Tagline placeholder"));return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(we.AlignmentControl,{onChange:e=>n({textAlign:e}),value:o})),s)},deprecated:ud};var pd=Object(je.createElement)(ye.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M12 9c-.8 0-1.5.7-1.5 1.5S11.2 12 12 12s1.5-.7 1.5-1.5S12.8 9 12 9zm0-5c-3.6 0-6.5 2.8-6.5 6.2 0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C18.5 6.8 15.6 4 12 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4z"}));function gd(e){let{level:t,isPressed:n=!1}=e;if(0===t)return Mi;return Object(je.createElement)(_e.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",isPressed:n},Object(je.createElement)(_e.Path,{d:{1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"}[t]}))}function hd(e){let{level:t,onChange:n}=e;const o=[1,2,3,4,5,6,0].map(e=>{const o=e===t;return{icon:Object(je.createElement)(gd,{level:e,isPressed:o}),title:0===e?Object(ke.__)("Paragraph"):Object(ke.sprintf)(Object(ke.__)("Heading %d"),e),isActive:o,onClick:()=>n(e)}});return Object(je.createElement)(_e.ToolbarDropdownMenu,{label:Object(ke.__)("Change heading level"),icon:Object(je.createElement)(gd,{level:t}),controls:o})}var vd=[{attributes:{level:{type:"number",default:1},textAlign:{type:"string"},isLink:{type:"boolean",default:!0},linkTarget:{type:"string",default:"_self"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},spacing:{padding:!0,margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0}},save:()=>null,migrate:at,isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}}];const Od={apiVersion:2,name:"core/site-title",title:"Site Title",category:"theme",description:"Displays the name of this site. Update the block, and the changes apply everywhere it’s used. This will also appear in the browser title bar and in search results.",textdomain:"default",attributes:{level:{type:"number",default:1},textAlign:{type:"string"},isLink:{type:"boolean",default:!0},linkTarget:{type:"string",default:"_self"}},example:{viewportWidth:500},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},spacing:{padding:!0,margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0,lineHeight:!0,fontAppearance:!0,letterSpacing:!0,textTransform:!0}}},editorStyle:"wp-block-site-title-editor"},{name:jd}=Od,yd={icon:pd,edit:function(e){let{attributes:t,setAttributes:n,insertBlocksAfter:o}=e;const{level:r,textAlign:a,isLink:l,linkTarget:c}=t,[i,s]=Object(It.useEntityProp)("root","site","title"),{canUserEdit:u,readOnlyTitle:m}=Object(Pe.useSelect)(e=>{const{canUser:t,getEntityRecord:n}=e(It.store),o=n("root","__unstableBase");return{canUserEdit:t("update","settings"),readOnlyTitle:Object(lc.decodeEntities)(null==o?void 0:o.name)}},[]),d=0===r?"p":"h"+r,b=Object(we.useBlockProps)({className:tt()({["has-text-align-"+a]:a,"wp-block-site-title__placeholder":!u&&!m})}),p=u?Object(je.createElement)(d,b,Object(je.createElement)(we.RichText,{tagName:l?"a":"span",href:l?"#site-title-pseudo-link":void 0,"aria-label":Object(ke.__)("Site title text"),placeholder:Object(ke.__)("Write site title…"),value:i,onChange:s,allowedFormats:[],disableLineBreaks:!0,__unstableOnSplitAtEnd:()=>o(Object(Oe.createBlock)(Object(Oe.getDefaultBlockName)()))})):Object(je.createElement)(d,b,l?Object(je.createElement)("a",{href:"#site-title-pseudo-link",onClick:e=>e.preventDefault()},m||Object(ke.__)("Site Title placeholder")):Object(je.createElement)("span",null,i||m));return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(hd,{level:r,onChange:e=>n({level:e})}),Object(je.createElement)(we.AlignmentControl,{value:a,onChange:e=>{n({textAlign:e})}})),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Link settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Make title link to home"),onChange:()=>n({isLink:!l}),checked:l}),l&&Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Open in new tab"),onChange:e=>n({linkTarget:e?"_blank":"_self"}),checked:"_blank"===c}))),p)},deprecated:vd};var fd=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"})),_d=n("btIw");const kd=()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M19.647,16.706a1.134,1.134,0,0,0-.343-.833l-2.549-2.549a1.134,1.134,0,0,0-.833-.343,1.168,1.168,0,0,0-.883.392l.233.226q.2.189.264.264a2.922,2.922,0,0,1,.184.233.986.986,0,0,1,.159.312,1.242,1.242,0,0,1,.043.337,1.172,1.172,0,0,1-1.176,1.176,1.237,1.237,0,0,1-.337-.043,1,1,0,0,1-.312-.159,2.76,2.76,0,0,1-.233-.184q-.073-.068-.264-.264l-.226-.233a1.19,1.19,0,0,0-.4.895,1.134,1.134,0,0,0,.343.833L15.837,19.3a1.13,1.13,0,0,0,.833.331,1.18,1.18,0,0,0,.833-.318l1.8-1.789a1.12,1.12,0,0,0,.343-.821Zm-8.615-8.64a1.134,1.134,0,0,0-.343-.833L8.163,4.7a1.134,1.134,0,0,0-.833-.343,1.184,1.184,0,0,0-.833.331L4.7,6.473a1.12,1.12,0,0,0-.343.821,1.134,1.134,0,0,0,.343.833l2.549,2.549a1.13,1.13,0,0,0,.833.331,1.184,1.184,0,0,0,.883-.38L8.728,10.4q-.2-.189-.264-.264A2.922,2.922,0,0,1,8.28,9.9a.986.986,0,0,1-.159-.312,1.242,1.242,0,0,1-.043-.337A1.172,1.172,0,0,1,9.254,8.079a1.237,1.237,0,0,1,.337.043,1,1,0,0,1,.312.159,2.761,2.761,0,0,1,.233.184q.073.068.264.264l.226.233a1.19,1.19,0,0,0,.4-.895ZM22,16.706a3.343,3.343,0,0,1-1.042,2.488l-1.8,1.789a3.536,3.536,0,0,1-4.988-.025l-2.525-2.537a3.384,3.384,0,0,1-1.017-2.488,3.448,3.448,0,0,1,1.078-2.561l-1.078-1.078a3.434,3.434,0,0,1-2.549,1.078,3.4,3.4,0,0,1-2.5-1.029L3.029,9.794A3.4,3.4,0,0,1,2,7.294,3.343,3.343,0,0,1,3.042,4.806l1.8-1.789A3.384,3.384,0,0,1,7.331,2a3.357,3.357,0,0,1,2.5,1.042l2.525,2.537a3.384,3.384,0,0,1,1.017,2.488,3.448,3.448,0,0,1-1.078,2.561l1.078,1.078a3.551,3.551,0,0,1,5.049-.049l2.549,2.549A3.4,3.4,0,0,1,22,16.706Z"})),wd=[{isDefault:!0,name:"wordpress",attributes:{service:"wordpress"},title:"WordPress",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z"}))},{name:"fivehundredpx",attributes:{service:"fivehundredpx"},title:"500px",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z"}))},{name:"amazon",attributes:{service:"amazon"},title:"Amazon",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M13.582,8.182C11.934,8.367,9.78,8.49,8.238,9.166c-1.781,0.769-3.03,2.337-3.03,4.644 c0,2.953,1.86,4.429,4.253,4.429c2.02,0,3.125-0.477,4.685-2.065c0.516,0.747,0.685,1.109,1.629,1.894 c0.212,0.114,0.483,0.103,0.672-0.066l0.006,0.006c0.567-0.505,1.599-1.401,2.18-1.888c0.231-0.188,0.19-0.496,0.009-0.754 c-0.52-0.718-1.072-1.303-1.072-2.634V8.305c0-1.876,0.133-3.599-1.249-4.891C15.23,2.369,13.422,2,12.04,2 C9.336,2,6.318,3.01,5.686,6.351C5.618,6.706,5.877,6.893,6.109,6.945l2.754,0.298C9.121,7.23,9.308,6.977,9.357,6.72 c0.236-1.151,1.2-1.706,2.284-1.706c0.584,0,1.249,0.215,1.595,0.738c0.398,0.584,0.346,1.384,0.346,2.061V8.182z M13.049,14.088 c-0.451,0.8-1.169,1.291-1.967,1.291c-1.09,0-1.728-0.83-1.728-2.061c0-2.42,2.171-2.86,4.227-2.86v0.615 C13.582,12.181,13.608,13.104,13.049,14.088z M20.683,19.339C18.329,21.076,14.917,22,11.979,22c-4.118,0-7.826-1.522-10.632-4.057 c-0.22-0.199-0.024-0.471,0.241-0.317c3.027,1.762,6.771,2.823,10.639,2.823c2.608,0,5.476-0.541,8.115-1.66 C20.739,18.62,21.072,19.051,20.683,19.339z M21.336,21.043c-0.194,0.163-0.379,0.076-0.293-0.139 c0.284-0.71,0.92-2.298,0.619-2.684c-0.301-0.386-1.99-0.183-2.749-0.092c-0.23,0.027-0.266-0.173-0.059-0.319 c1.348-0.946,3.555-0.673,3.811-0.356C22.925,17.773,22.599,19.986,21.336,21.043z"}))},{name:"bandcamp",attributes:{service:"bandcamp"},title:"Bandcamp",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289"}))},{name:"behance",attributes:{service:"behance"},title:"Behance",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M7.799,5.698c0.589,0,1.12,0.051,1.606,0.156c0.482,0.102,0.894,0.273,1.241,0.507c0.344,0.235,0.612,0.546,0.804,0.938 c0.188,0.387,0.281,0.871,0.281,1.443c0,0.619-0.141,1.137-0.421,1.551c-0.284,0.413-0.7,0.751-1.255,1.014 c0.756,0.218,1.317,0.601,1.689,1.146c0.374,0.549,0.557,1.205,0.557,1.975c0,0.623-0.12,1.161-0.359,1.612 c-0.241,0.457-0.569,0.828-0.973,1.114c-0.408,0.288-0.876,0.5-1.399,0.637C9.052,17.931,8.514,18,7.963,18H2V5.698H7.799 M7.449,10.668c0.481,0,0.878-0.114,1.192-0.345c0.311-0.228,0.463-0.603,0.463-1.119c0-0.286-0.051-0.523-0.152-0.707 C8.848,8.315,8.711,8.171,8.536,8.07C8.362,7.966,8.166,7.894,7.94,7.854c-0.224-0.044-0.457-0.06-0.697-0.06H4.709v2.874H7.449z M7.6,15.905c0.267,0,0.521-0.024,0.759-0.077c0.243-0.053,0.457-0.137,0.637-0.261c0.182-0.12,0.332-0.283,0.441-0.491 C9.547,14.87,9.6,14.602,9.6,14.278c0-0.633-0.18-1.084-0.533-1.357c-0.356-0.27-0.83-0.404-1.413-0.404H4.709v3.388L7.6,15.905z M16.162,15.864c0.367,0.358,0.897,0.538,1.583,0.538c0.493,0,0.92-0.125,1.277-0.374c0.354-0.248,0.571-0.514,0.654-0.79h2.155 c-0.347,1.072-0.872,1.838-1.589,2.299C19.534,18,18.67,18.23,17.662,18.23c-0.701,0-1.332-0.113-1.899-0.337 c-0.567-0.227-1.041-0.544-1.439-0.958c-0.389-0.415-0.689-0.907-0.904-1.484c-0.213-0.574-0.32-1.21-0.32-1.899 c0-0.666,0.11-1.288,0.329-1.863c0.222-0.577,0.529-1.075,0.933-1.492c0.406-0.42,0.885-0.751,1.444-0.994 c0.558-0.241,1.175-0.363,1.857-0.363c0.754,0,1.414,0.145,1.98,0.44c0.563,0.291,1.026,0.686,1.389,1.181 c0.363,0.493,0.622,1.057,0.783,1.69c0.16,0.632,0.217,1.292,0.171,1.983h-6.428C15.557,14.84,15.795,15.506,16.162,15.864 M18.973,11.184c-0.291-0.321-0.783-0.496-1.384-0.496c-0.39,0-0.714,0.066-0.973,0.2c-0.254,0.132-0.461,0.297-0.621,0.491 c-0.157,0.197-0.265,0.405-0.328,0.628c-0.063,0.217-0.101,0.413-0.111,0.587h3.98C19.478,11.969,19.265,11.509,18.973,11.184z M15.057,7.738h4.985V6.524h-4.985L15.057,7.738z"}))},{name:"chain",attributes:{service:"chain"},title:"Link",icon:kd},{name:"codepen",attributes:{service:"codepen"},title:"CodePen",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M22.016,8.84c-0.002-0.013-0.005-0.025-0.007-0.037c-0.005-0.025-0.008-0.048-0.015-0.072 c-0.003-0.015-0.01-0.028-0.013-0.042c-0.008-0.02-0.015-0.04-0.023-0.062c-0.007-0.015-0.013-0.028-0.02-0.042 c-0.008-0.02-0.018-0.037-0.03-0.057c-0.007-0.013-0.017-0.027-0.025-0.038c-0.012-0.018-0.023-0.035-0.035-0.052 c-0.01-0.013-0.02-0.025-0.03-0.037c-0.015-0.017-0.028-0.032-0.043-0.045c-0.01-0.012-0.022-0.023-0.035-0.035 c-0.015-0.015-0.032-0.028-0.048-0.04c-0.012-0.01-0.025-0.02-0.037-0.03c-0.005-0.003-0.01-0.008-0.015-0.012l-9.161-6.096 c-0.289-0.192-0.666-0.192-0.955,0L2.359,8.237C2.354,8.24,2.349,8.245,2.344,8.249L2.306,8.277 c-0.017,0.013-0.033,0.027-0.048,0.04C2.246,8.331,2.234,8.342,2.222,8.352c-0.015,0.015-0.028,0.03-0.042,0.047 c-0.012,0.013-0.022,0.023-0.03,0.037C2.139,8.453,2.125,8.471,2.115,8.488C2.107,8.501,2.099,8.514,2.09,8.526 C2.079,8.548,2.069,8.565,2.06,8.585C2.054,8.6,2.047,8.613,2.04,8.626C2.032,8.648,2.025,8.67,2.019,8.69 c-0.005,0.013-0.01,0.027-0.013,0.042C1.999,8.755,1.995,8.778,1.99,8.803C1.989,8.817,1.985,8.828,1.984,8.84 C1.978,8.879,1.975,8.915,1.975,8.954v6.093c0,0.037,0.003,0.075,0.008,0.112c0.002,0.012,0.005,0.025,0.007,0.038 c0.005,0.023,0.008,0.047,0.015,0.072c0.003,0.015,0.008,0.028,0.013,0.04c0.007,0.022,0.013,0.042,0.022,0.063 c0.007,0.015,0.013,0.028,0.02,0.04c0.008,0.02,0.018,0.038,0.03,0.058c0.007,0.013,0.015,0.027,0.025,0.038 c0.012,0.018,0.023,0.035,0.035,0.052c0.01,0.013,0.02,0.025,0.03,0.037c0.013,0.015,0.028,0.032,0.042,0.045 c0.012,0.012,0.023,0.023,0.035,0.035c0.015,0.013,0.032,0.028,0.048,0.04l0.038,0.03c0.005,0.003,0.01,0.007,0.013,0.01 l9.163,6.095C11.668,21.953,11.833,22,12,22c0.167,0,0.332-0.047,0.478-0.144l9.163-6.095l0.015-0.01 c0.013-0.01,0.027-0.02,0.037-0.03c0.018-0.013,0.035-0.028,0.048-0.04c0.013-0.012,0.025-0.023,0.035-0.035 c0.017-0.015,0.03-0.032,0.043-0.045c0.01-0.013,0.02-0.025,0.03-0.037c0.013-0.018,0.025-0.035,0.035-0.052 c0.008-0.013,0.018-0.027,0.025-0.038c0.012-0.02,0.022-0.038,0.03-0.058c0.007-0.013,0.013-0.027,0.02-0.04 c0.008-0.022,0.015-0.042,0.023-0.063c0.003-0.013,0.01-0.027,0.013-0.04c0.007-0.025,0.01-0.048,0.015-0.072 c0.002-0.013,0.005-0.027,0.007-0.037c0.003-0.042,0.007-0.079,0.007-0.117V8.954C22.025,8.915,22.022,8.879,22.016,8.84z M12.862,4.464l6.751,4.49l-3.016,2.013l-3.735-2.492V4.464z M11.138,4.464v4.009l-3.735,2.494L4.389,8.954L11.138,4.464z M3.699,10.562L5.853,12l-2.155,1.438V10.562z M11.138,19.536l-6.749-4.491l3.015-2.011l3.735,2.492V19.536z M12,14.035L8.953,12 L12,9.966L15.047,12L12,14.035z M12.862,19.536v-4.009l3.735-2.492l3.016,2.011L12.862,19.536z M20.303,13.438L18.147,12 l2.156-1.438L20.303,13.438z"}))},{name:"deviantart",attributes:{service:"deviantart"},title:"DeviantArt",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z"}))},{name:"dribbble",attributes:{service:"dribbble"},title:"Dribbble",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z"}))},{name:"dropbox",attributes:{service:"dropbox"},title:"Dropbox",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M12,6.134L6.069,9.797L2,6.54l5.883-3.843L12,6.134z M2,13.054l5.883,3.843L12,13.459L6.069,9.797L2,13.054z M12,13.459 l4.116,3.439L22,13.054l-4.069-3.257L12,13.459z M22,6.54l-5.884-3.843L12,6.134l5.931,3.663L22,6.54z M12.011,14.2l-4.129,3.426 l-1.767-1.153v1.291l5.896,3.539l5.897-3.539v-1.291l-1.769,1.153L12.011,14.2z"}))},{name:"etsy",attributes:{service:"etsy"},title:"Etsy",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M9.16033,4.038c0-.27174.02717-.43478.48913-.43478h6.22283c1.087,0,1.68478.92391,2.11957,2.663l.35326,1.38587h1.05978C19.59511,3.712,19.75815,2,19.75815,2s-2.663.29891-4.23913.29891h-7.962L3.29076,2.163v1.1413L4.731,3.57609c1.00543.19022,1.25.40761,1.33152,1.33152,0,0,.08152,2.71739.08152,7.20109s-.08152,7.17391-.08152,7.17391c0,.81522-.32609,1.11413-1.33152,1.30435l-1.44022.27174V22l4.2663-.13587h7.11957c1.60326,0,5.32609.13587,5.32609.13587.08152-.97826.625-5.40761.70652-5.89674H19.7038L18.644,18.52174c-.84239,1.90217-2.06522,2.038-3.42391,2.038H11.1712c-1.3587,0-2.01087-.54348-2.01087-1.712V12.65217s3.0163,0,3.99457.08152c.76087.05435,1.22283.27174,1.46739,1.33152l.32609,1.413h1.16848l-.08152-3.55978.163-3.587H15.02989l-.38043,1.57609c-.24457,1.03261-.40761,1.22283-1.46739,1.33152-1.38587.13587-4.02174.1087-4.02174.1087Z"}))},{name:"facebook",attributes:{service:"facebook"},title:"Facebook",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"}))},{name:"feed",attributes:{service:"feed"},title:"RSS Feed",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M2,8.667V12c5.515,0,10,4.485,10,10h3.333C15.333,14.637,9.363,8.667,2,8.667z M2,2v3.333 c9.19,0,16.667,7.477,16.667,16.667H22C22,10.955,13.045,2,2,2z M4.5,17C3.118,17,2,18.12,2,19.5S3.118,22,4.5,22S7,20.88,7,19.5 S5.882,17,4.5,17z"}))},{name:"flickr",attributes:{service:"flickr"},title:"Flickr",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M6.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5S9.25,7,6.5,7z M17.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5 S20.25,7,17.5,7z"}))},{name:"foursquare",attributes:{service:"foursquare"},title:"Foursquare",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M17.573,2c0,0-9.197,0-10.668,0S5,3.107,5,3.805s0,16.948,0,16.948c0,0.785,0.422,1.077,0.66,1.172 c0.238,0.097,0.892,0.177,1.285-0.275c0,0,5.035-5.843,5.122-5.93c0.132-0.132,0.132-0.132,0.262-0.132h3.26 c1.368,0,1.588-0.977,1.732-1.552c0.078-0.318,0.692-3.428,1.225-6.122l0.675-3.368C19.56,2.893,19.14,2,17.573,2z M16.495,7.22 c-0.053,0.252-0.372,0.518-0.665,0.518c-0.293,0-4.157,0-4.157,0c-0.467,0-0.802,0.318-0.802,0.787v0.508 c0,0.467,0.337,0.798,0.805,0.798c0,0,3.197,0,3.528,0s0.655,0.362,0.583,0.715c-0.072,0.353-0.407,2.102-0.448,2.295 c-0.04,0.193-0.262,0.523-0.655,0.523c-0.33,0-2.88,0-2.88,0c-0.523,0-0.683,0.068-1.033,0.503 c-0.35,0.437-3.505,4.223-3.505,4.223c-0.032,0.035-0.063,0.027-0.063-0.015V4.852c0-0.298,0.26-0.648,0.648-0.648 c0,0,8.228,0,8.562,0c0.315,0,0.61,0.297,0.528,0.683L16.495,7.22z"}))},{name:"goodreads",attributes:{service:"goodreads"},title:"Goodreads",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M17.3,17.5c-0.2,0.8-0.5,1.4-1,1.9c-0.4,0.5-1,0.9-1.7,1.2C13.9,20.9,13.1,21,12,21c-0.6,0-1.3-0.1-1.9-0.2 c-0.6-0.1-1.1-0.4-1.6-0.7c-0.5-0.3-0.9-0.7-1.2-1.2c-0.3-0.5-0.5-1.1-0.5-1.7h1.5c0.1,0.5,0.2,0.9,0.5,1.2 c0.2,0.3,0.5,0.6,0.9,0.8c0.3,0.2,0.7,0.3,1.1,0.4c0.4,0.1,0.8,0.1,1.2,0.1c1.4,0,2.5-0.4,3.1-1.2c0.6-0.8,1-2,1-3.5v-1.7h0 c-0.4,0.8-0.9,1.4-1.6,1.9c-0.7,0.5-1.5,0.7-2.4,0.7c-1,0-1.9-0.2-2.6-0.5C8.7,15,8.1,14.5,7.7,14c-0.5-0.6-0.8-1.3-1-2.1 c-0.2-0.8-0.3-1.6-0.3-2.5c0-0.9,0.1-1.7,0.4-2.5c0.3-0.8,0.6-1.5,1.1-2c0.5-0.6,1.1-1,1.8-1.4C10.3,3.2,11.1,3,12,3 c0.5,0,0.9,0.1,1.3,0.2c0.4,0.1,0.8,0.3,1.1,0.5c0.3,0.2,0.6,0.5,0.9,0.8c0.3,0.3,0.5,0.6,0.6,1h0V3.4h1.5V15 C17.6,15.9,17.5,16.7,17.3,17.5z M13.8,14.1c0.5-0.3,0.9-0.7,1.3-1.1c0.3-0.5,0.6-1,0.8-1.6c0.2-0.6,0.3-1.2,0.3-1.9 c0-0.6-0.1-1.2-0.2-1.9c-0.1-0.6-0.4-1.2-0.7-1.7c-0.3-0.5-0.7-0.9-1.3-1.2c-0.5-0.3-1.1-0.5-1.9-0.5s-1.4,0.2-1.9,0.5 c-0.5,0.3-1,0.7-1.3,1.2C8.5,6.4,8.3,7,8.1,7.6C8,8.2,7.9,8.9,7.9,9.5c0,0.6,0.1,1.3,0.2,1.9C8.3,12,8.6,12.5,8.9,13 c0.3,0.5,0.8,0.8,1.3,1.1c0.5,0.3,1.1,0.4,1.9,0.4C12.7,14.5,13.3,14.4,13.8,14.1z"}))},{name:"google",attributes:{service:"google"},title:"Google",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M12.02,10.18v3.72v0.01h5.51c-0.26,1.57-1.67,4.22-5.5,4.22c-3.31,0-6.01-2.75-6.01-6.12s2.7-6.12,6.01-6.12 c1.87,0,3.13,0.8,3.85,1.48l2.84-2.76C16.99,2.99,14.73,2,12.03,2c-5.52,0-10,4.48-10,10s4.48,10,10,10c5.77,0,9.6-4.06,9.6-9.77 c0-0.83-0.11-1.42-0.25-2.05H12.02z"}))},{name:"github",attributes:{service:"github"},title:"GitHub",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"}))},{name:"instagram",attributes:{service:"instagram"},title:"Instagram",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z"}))},{name:"lastfm",attributes:{service:"lastfm"},title:"Last.fm",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M 12.0002 1.5 C 6.2006 1.5 1.5 6.2011 1.5 11.9998 C 1.5 17.799 6.2006 22.5 12.0002 22.5 C 17.799 22.5 22.5 17.799 22.5 11.9998 C 22.5 6.2011 17.799 1.5 12.0002 1.5 Z M 16.1974 16.2204 C 14.8164 16.2152 13.9346 15.587 13.3345 14.1859 L 13.1816 13.8451 L 11.8541 10.8101 C 11.4271 9.7688 10.3526 9.0712 9.1801 9.0712 C 7.5695 9.0712 6.2593 10.3851 6.2593 12.001 C 6.2593 13.6165 7.5695 14.9303 9.1801 14.9303 C 10.272 14.9303 11.2651 14.3275 11.772 13.3567 C 11.7893 13.3235 11.8239 13.302 11.863 13.3038 C 11.9007 13.3054 11.9353 13.3288 11.9504 13.3632 L 12.4865 14.6046 C 12.5016 14.639 12.4956 14.6778 12.4723 14.7069 C 11.6605 15.6995 10.4602 16.2683 9.1801 16.2683 C 6.8331 16.2683 4.9234 14.3536 4.9234 12.001 C 4.9234 9.6468 6.833 7.732 9.1801 7.732 C 10.9572 7.732 12.3909 8.6907 13.1138 10.3636 C 13.1206 10.3802 13.8412 12.0708 14.4744 13.5191 C 14.8486 14.374 15.1462 14.896 16.1288 14.9292 C 17.0663 14.9613 17.7538 14.4122 17.7538 13.6485 C 17.7538 12.9691 17.3321 12.8004 16.3803 12.4822 C 14.7365 11.9398 13.845 11.3861 13.845 10.0182 C 13.845 8.6809 14.7667 7.8162 16.192 7.8162 C 17.1288 7.8162 17.8155 8.2287 18.2921 9.0768 C 18.305 9.1006 18.3079 9.1281 18.3004 9.1542 C 18.2929 9.1803 18.2748 9.2021 18.2507 9.2138 L 17.3614 9.669 C 17.3178 9.692 17.2643 9.6781 17.2356 9.6385 C 16.9329 9.2135 16.5956 9.0251 16.1423 9.0251 C 15.5512 9.0251 15.122 9.429 15.122 9.9865 C 15.122 10.6738 15.6529 10.8414 16.5339 11.1192 C 16.6491 11.1558 16.7696 11.194 16.8939 11.2343 C 18.2763 11.6865 19.0768 12.2311 19.0768 13.6836 C 19.0769 15.1297 17.8389 16.2204 16.1974 16.2204 Z"}))},{name:"linkedin",attributes:{service:"linkedin"},title:"LinkedIn",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"}))},{name:"mail",attributes:{service:"mail"},title:"Mail",keywords:["email","e-mail"],icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M20,4H4C2.895,4,2,4.895,2,6v12c0,1.105,0.895,2,2,2h16c1.105,0,2-0.895,2-2V6C22,4.895,21.105,4,20,4z M20,8.236l-8,4.882 L4,8.236V6h16V8.236z"}))},{name:"mastodon",attributes:{service:"mastodon"},title:"Mastodon",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M23.193 7.879c0-5.206-3.411-6.732-3.411-6.732C18.062.357 15.108.025 12.041 0h-.076c-3.068.025-6.02.357-7.74 1.147 0 0-3.411 1.526-3.411 6.732 0 1.192-.023 2.618.015 4.129.124 5.092.934 10.109 5.641 11.355 2.17.574 4.034.695 5.535.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.129.539c-2.165-.074-4.449-.233-4.799-2.891a5.499 5.499 0 0 1-.048-.745s2.125.52 4.817.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.507.475-6.507zm-4.024 6.709h-2.497V8.469c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.312v3.349h-2.483v-3.35c0-1.536-.602-2.312-1.802-2.312-1.085 0-1.628.655-1.628 1.944v6.119H4.832V8.284c0-1.289.328-2.313.987-3.07.68-.758 1.569-1.146 2.674-1.146 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.304z"}))},{name:"meetup",attributes:{service:"meetup"},title:"Meetup",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M19.24775,14.722a3.57032,3.57032,0,0,1-2.94457,3.52073,3.61886,3.61886,0,0,1-.64652.05634c-.07314-.0008-.10187.02846-.12507.09547A2.38881,2.38881,0,0,1,13.49453,20.094a2.33092,2.33092,0,0,1-1.827-.50716.13635.13635,0,0,0-.19878-.00408,3.191,3.191,0,0,1-2.104.60248,3.26309,3.26309,0,0,1-3.00324-2.71993,2.19076,2.19076,0,0,1-.03512-.30865c-.00156-.08579-.03413-.1189-.11608-.13493a2.86421,2.86421,0,0,1-1.23189-.56111,2.945,2.945,0,0,1-1.166-2.05749,2.97484,2.97484,0,0,1,.87524-2.50774.112.112,0,0,0,.02091-.16107,2.7213,2.7213,0,0,1-.36648-1.48A2.81256,2.81256,0,0,1,6.57673,7.58838a.35764.35764,0,0,0,.28869-.22819,4.2208,4.2208,0,0,1,6.02892-1.90111.25161.25161,0,0,0,.22023.0243,3.65608,3.65608,0,0,1,3.76031.90678A3.57244,3.57244,0,0,1,17.95918,8.626a2.97339,2.97339,0,0,1,.01829.57356.10637.10637,0,0,0,.0853.12792,1.97669,1.97669,0,0,1,1.27939,1.33733,2.00266,2.00266,0,0,1-.57112,2.12652c-.05284.05166-.04168.08328-.01173.13489A3.51189,3.51189,0,0,1,19.24775,14.722Zm-6.35959-.27836a1.6984,1.6984,0,0,0,1.14556,1.61113,3.82039,3.82039,0,0,0,1.036.17935,1.46888,1.46888,0,0,0,.73509-.12255.44082.44082,0,0,0,.26057-.44274.45312.45312,0,0,0-.29211-.43375.97191.97191,0,0,0-.20678-.063c-.21326-.03806-.42754-.0701-.63973-.11215a.54787.54787,0,0,1-.50172-.60926,2.75864,2.75864,0,0,1,.1773-.901c.1763-.535.414-1.045.64183-1.55913A12.686,12.686,0,0,0,15.85,10.47863a1.58461,1.58461,0,0,0,.04861-.87208,1.04531,1.04531,0,0,0-.85432-.83981,1.60658,1.60658,0,0,0-1.23654.16594.27593.27593,0,0,1-.36286-.03413c-.085-.0747-.16594-.15379-.24918-.23055a.98682.98682,0,0,0-1.33577-.04933,6.1468,6.1468,0,0,1-.4989.41615.47762.47762,0,0,1-.51535.03566c-.17448-.09307-.35512-.175-.53531-.25665a1.74949,1.74949,0,0,0-.56476-.2016,1.69943,1.69943,0,0,0-1.61654.91787,8.05815,8.05815,0,0,0-.32952.80126c-.45471,1.2557-.82507,2.53825-1.20838,3.81639a1.24151,1.24151,0,0,0,.51532,1.44389,1.42659,1.42659,0,0,0,1.22008.17166,1.09728,1.09728,0,0,0,.66994-.69764c.44145-1.04111.839-2.09989,1.25981-3.14926.11581-.28876.22792-.57874.35078-.86438a.44548.44548,0,0,1,.69189-.19539.50521.50521,0,0,1,.15044.43836,1.75625,1.75625,0,0,1-.14731.50453c-.27379.69219-.55265,1.38236-.82766,2.074a2.0836,2.0836,0,0,0-.14038.42876.50719.50719,0,0,0,.27082.57722.87236.87236,0,0,0,.66145.02739.99137.99137,0,0,0,.53406-.532q.61571-1.20914,1.228-2.42031.28423-.55863.57585-1.1133a.87189.87189,0,0,1,.29055-.35253.34987.34987,0,0,1,.37634-.01265.30291.30291,0,0,1,.12434.31459.56716.56716,0,0,1-.04655.1915c-.05318.12739-.10286.25669-.16183.38156-.34118.71775-.68754,1.43273-1.02568,2.152A2.00213,2.00213,0,0,0,12.88816,14.44366Zm4.78568,5.28972a.88573.88573,0,0,0-1.77139.00465.8857.8857,0,0,0,1.77139-.00465Zm-14.83838-7.296a.84329.84329,0,1,0,.00827-1.68655.8433.8433,0,0,0-.00827,1.68655Zm10.366-9.43673a.83506.83506,0,1,0-.0091,1.67.83505.83505,0,0,0,.0091-1.67Zm6.85014,5.22a.71651.71651,0,0,0-1.433.0093.71656.71656,0,0,0,1.433-.0093ZM5.37528,6.17908A.63823.63823,0,1,0,6.015,5.54483.62292.62292,0,0,0,5.37528,6.17908Zm6.68214,14.80843a.54949.54949,0,1,0-.55052.541A.54556.54556,0,0,0,12.05742,20.98752Zm8.53235-8.49689a.54777.54777,0,0,0-.54027.54023.53327.53327,0,0,0,.532.52293.51548.51548,0,0,0,.53272-.5237A.53187.53187,0,0,0,20.58977,12.49063ZM7.82846,2.4715a.44927.44927,0,1,0,.44484.44766A.43821.43821,0,0,0,7.82846,2.4715Zm13.775,7.60492a.41186.41186,0,0,0-.40065.39623.40178.40178,0,0,0,.40168.40168A.38994.38994,0,0,0,22,10.48172.39946.39946,0,0,0,21.60349,10.07642ZM5.79193,17.96207a.40469.40469,0,0,0-.397-.39646.399.399,0,0,0-.396.405.39234.39234,0,0,0,.39939.389A.39857.39857,0,0,0,5.79193,17.96207Z"}))},{name:"medium",attributes:{service:"medium"},title:"Medium",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M20.962,7.257l-5.457,8.867l-3.923-6.375l3.126-5.08c0.112-0.182,0.319-0.286,0.527-0.286c0.05,0,0.1,0.008,0.149,0.02 c0.039,0.01,0.078,0.023,0.114,0.041l5.43,2.715l0.006,0.003c0.004,0.002,0.007,0.006,0.011,0.008 C20.971,7.191,20.98,7.227,20.962,7.257z M9.86,8.592v5.783l5.14,2.57L9.86,8.592z M15.772,17.331l4.231,2.115 C20.554,19.721,21,19.529,21,19.016V8.835L15.772,17.331z M8.968,7.178L3.665,4.527C3.569,4.479,3.478,4.456,3.395,4.456 C3.163,4.456,3,4.636,3,4.938v11.45c0,0.306,0.224,0.669,0.498,0.806l4.671,2.335c0.12,0.06,0.234,0.088,0.337,0.088 c0.29,0,0.494-0.225,0.494-0.602V7.231C9,7.208,8.988,7.188,8.968,7.178z"}))},{name:"patreon",attributes:{service:"patreon"},title:"Patreon",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 569 546",version:"1.1"},Object(je.createElement)(ye.Circle,{cx:"363",cy:"205",r:"205"}),Object(je.createElement)(ye.Rect,{width:"100",height:"546",x:"0",y:"0"}))},{name:"pinterest",attributes:{service:"pinterest"},title:"Pinterest",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.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"}))},{name:"pocket",attributes:{service:"pocket"},title:"Pocket",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M21.927,4.194C21.667,3.48,20.982,3,20.222,3h-0.01h-1.721H3.839C3.092,3,2.411,3.47,2.145,4.17 C2.066,4.378,2.026,4.594,2.026,4.814v6.035l0.069,1.2c0.29,2.73,1.707,5.115,3.899,6.778c0.039,0.03,0.079,0.059,0.119,0.089 l0.025,0.018c1.175,0.859,2.491,1.441,3.91,1.727c0.655,0.132,1.325,0.2,1.991,0.2c0.615,0,1.232-0.057,1.839-0.17 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.297,2.621-0.864,3.753-1.691l0.025-0.018 c0.04-0.029,0.08-0.058,0.119-0.089c2.192-1.664,3.609-4.049,3.898-6.778l0.069-1.2V4.814C22.026,4.605,22,4.398,21.927,4.194z M17.692,10.481l-4.704,4.512c-0.266,0.254-0.608,0.382-0.949,0.382c-0.342,0-0.684-0.128-0.949-0.382l-4.705-4.512 C5.838,9.957,5.82,9.089,6.344,8.542c0.524-0.547,1.392-0.565,1.939-0.04l3.756,3.601l3.755-3.601 c0.547-0.524,1.415-0.506,1.939,0.04C18.256,9.089,18.238,9.956,17.692,10.481z"}))},{name:"reddit",attributes:{service:"reddit"},title:"Reddit",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M22,11.816c0-1.256-1.021-2.277-2.277-2.277c-0.593,0-1.122,0.24-1.526,0.614c-1.481-0.965-3.455-1.594-5.647-1.69 l1.171-3.702l3.18,0.748c0.008,1.028,0.846,1.862,1.876,1.862c1.035,0,1.877-0.842,1.877-1.878c0-1.035-0.842-1.877-1.877-1.877 c-0.769,0-1.431,0.466-1.72,1.13l-3.508-0.826c-0.203-0.047-0.399,0.067-0.46,0.261l-1.35,4.268 c-2.316,0.038-4.411,0.67-5.97,1.671C5.368,9.765,4.853,9.539,4.277,9.539C3.021,9.539,2,10.56,2,11.816 c0,0.814,0.433,1.523,1.078,1.925c-0.037,0.221-0.061,0.444-0.061,0.672c0,3.292,4.011,5.97,8.941,5.97s8.941-2.678,8.941-5.97 c0-0.214-0.02-0.424-0.053-0.632C21.533,13.39,22,12.661,22,11.816z M18.776,4.394c0.606,0,1.1,0.493,1.1,1.1s-0.493,1.1-1.1,1.1 s-1.1-0.494-1.1-1.1S18.169,4.394,18.776,4.394z M2.777,11.816c0-0.827,0.672-1.5,1.499-1.5c0.313,0,0.598,0.103,0.838,0.269 c-0.851,0.676-1.477,1.479-1.812,2.36C2.983,12.672,2.777,12.27,2.777,11.816z M11.959,19.606c-4.501,0-8.164-2.329-8.164-5.193 S7.457,9.22,11.959,9.22s8.164,2.329,8.164,5.193S16.46,19.606,11.959,19.606z M20.636,13.001c-0.326-0.89-0.948-1.701-1.797-2.384 c0.248-0.186,0.55-0.301,0.883-0.301c0.827,0,1.5,0.673,1.5,1.5C21.223,12.299,20.992,12.727,20.636,13.001z M8.996,14.704 c-0.76,0-1.397-0.616-1.397-1.376c0-0.76,0.637-1.397,1.397-1.397c0.76,0,1.376,0.637,1.376,1.397 C10.372,14.088,9.756,14.704,8.996,14.704z M16.401,13.328c0,0.76-0.616,1.376-1.376,1.376c-0.76,0-1.399-0.616-1.399-1.376 c0-0.76,0.639-1.397,1.399-1.397C15.785,11.931,16.401,12.568,16.401,13.328z M15.229,16.708c0.152,0.152,0.152,0.398,0,0.55 c-0.674,0.674-1.727,1.002-3.219,1.002c-0.004,0-0.007-0.002-0.011-0.002c-0.004,0-0.007,0.002-0.011,0.002 c-1.492,0-2.544-0.328-3.218-1.002c-0.152-0.152-0.152-0.398,0-0.55c0.152-0.152,0.399-0.151,0.55,0 c0.521,0.521,1.394,0.775,2.669,0.775c0.004,0,0.007,0.002,0.011,0.002c0.004,0,0.007-0.002,0.011-0.002 c1.275,0,2.148-0.253,2.669-0.775C14.831,16.556,15.078,16.556,15.229,16.708z"}))},{name:"skype",attributes:{service:"skype"},title:"Skype",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M10.113,2.699c0.033-0.006,0.067-0.013,0.1-0.02c0.033,0.017,0.066,0.033,0.098,0.051L10.113,2.699z M2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223z M21.275,13.771 c0.007-0.035,0.011-0.071,0.018-0.106c-0.018-0.031-0.033-0.064-0.052-0.095L21.275,13.771z M13.563,21.199 c0.032,0.019,0.065,0.035,0.096,0.053c0.036-0.006,0.071-0.011,0.105-0.017L13.563,21.199z M22,16.386 c0,1.494-0.581,2.898-1.637,3.953c-1.056,1.057-2.459,1.637-3.953,1.637c-0.967,0-1.914-0.251-2.75-0.725 c0.036-0.006,0.071-0.011,0.105-0.017l-0.202-0.035c0.032,0.019,0.065,0.035,0.096,0.053c-0.543,0.096-1.099,0.147-1.654,0.147 c-1.275,0-2.512-0.25-3.676-0.743c-1.125-0.474-2.135-1.156-3.002-2.023c-0.867-0.867-1.548-1.877-2.023-3.002 c-0.493-1.164-0.743-2.401-0.743-3.676c0-0.546,0.049-1.093,0.142-1.628c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103C2.244,9.5,2,8.566,2,7.615c0-1.493,0.582-2.898,1.637-3.953 c1.056-1.056,2.46-1.638,3.953-1.638c0.915,0,1.818,0.228,2.622,0.655c-0.033,0.007-0.067,0.013-0.1,0.02l0.199,0.031 c-0.032-0.018-0.066-0.034-0.098-0.051c0.002,0,0.003-0.001,0.004-0.001c0.586-0.112,1.187-0.169,1.788-0.169 c1.275,0,2.512,0.249,3.676,0.742c1.124,0.476,2.135,1.156,3.002,2.024c0.868,0.867,1.548,1.877,2.024,3.002 c0.493,1.164,0.743,2.401,0.743,3.676c0,0.575-0.054,1.15-0.157,1.712c-0.018-0.031-0.033-0.064-0.052-0.095l0.034,0.201 c0.007-0.035,0.011-0.071,0.018-0.106C21.754,14.494,22,15.432,22,16.386z M16.817,14.138c0-1.331-0.613-2.743-3.033-3.282 l-2.209-0.49c-0.84-0.192-1.807-0.444-1.807-1.237c0-0.794,0.679-1.348,1.903-1.348c2.468,0,2.243,1.696,3.468,1.696 c0.645,0,1.209-0.379,1.209-1.031c0-1.521-2.435-2.663-4.5-2.663c-2.242,0-4.63,0.952-4.63,3.488c0,1.221,0.436,2.521,2.839,3.123 l2.984,0.745c0.903,0.223,1.129,0.731,1.129,1.189c0,0.762-0.758,1.507-2.129,1.507c-2.679,0-2.307-2.062-3.743-2.062 c-0.645,0-1.113,0.444-1.113,1.078c0,1.236,1.501,2.886,4.856,2.886C15.236,17.737,16.817,16.199,16.817,14.138z"}))},{name:"snapchat",attributes:{service:"snapchat"},title:"Snapchat",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M12.065,2a5.526,5.526,0,0,1,3.132.892A5.854,5.854,0,0,1,17.326,5.4a5.821,5.821,0,0,1,.351,2.33q0,.612-.117,2.487a.809.809,0,0,0,.365.091,1.93,1.93,0,0,0,.664-.176,1.93,1.93,0,0,1,.664-.176,1.3,1.3,0,0,1,.729.234.7.7,0,0,1,.351.6.839.839,0,0,1-.41.7,2.732,2.732,0,0,1-.9.41,3.192,3.192,0,0,0-.9.378.728.728,0,0,0-.41.618,1.575,1.575,0,0,0,.156.56,6.9,6.9,0,0,0,1.334,1.953,5.6,5.6,0,0,0,1.881,1.315,5.875,5.875,0,0,0,1.042.3.42.42,0,0,1,.365.456q0,.911-2.852,1.341a1.379,1.379,0,0,0-.143.507,1.8,1.8,0,0,1-.182.605.451.451,0,0,1-.429.241,5.878,5.878,0,0,1-.807-.085,5.917,5.917,0,0,0-.833-.085,4.217,4.217,0,0,0-.807.065,2.42,2.42,0,0,0-.82.293,6.682,6.682,0,0,0-.755.5q-.351.267-.755.527a3.886,3.886,0,0,1-.989.436A4.471,4.471,0,0,1,11.831,22a4.307,4.307,0,0,1-1.256-.176,3.784,3.784,0,0,1-.976-.436q-.4-.26-.749-.527a6.682,6.682,0,0,0-.755-.5,2.422,2.422,0,0,0-.807-.293,4.432,4.432,0,0,0-.82-.065,5.089,5.089,0,0,0-.853.1,5,5,0,0,1-.762.1.474.474,0,0,1-.456-.241,1.819,1.819,0,0,1-.182-.618,1.411,1.411,0,0,0-.143-.521q-2.852-.429-2.852-1.341a.42.42,0,0,1,.365-.456,5.793,5.793,0,0,0,1.042-.3,5.524,5.524,0,0,0,1.881-1.315,6.789,6.789,0,0,0,1.334-1.953A1.575,1.575,0,0,0,6,12.9a.728.728,0,0,0-.41-.618,3.323,3.323,0,0,0-.9-.384,2.912,2.912,0,0,1-.9-.41.814.814,0,0,1-.41-.684.71.71,0,0,1,.338-.593,1.208,1.208,0,0,1,.716-.241,1.976,1.976,0,0,1,.625.169,2.008,2.008,0,0,0,.69.169.919.919,0,0,0,.416-.091q-.117-1.849-.117-2.474A5.861,5.861,0,0,1,6.385,5.4,5.516,5.516,0,0,1,8.625,2.819,7.075,7.075,0,0,1,12.062,2Z"}))},{name:"soundcloud",attributes:{service:"soundcloud"},title:"SoundCloud",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M8.9,16.1L9,14L8.9,9.5c0-0.1,0-0.1-0.1-0.1c0,0-0.1-0.1-0.1-0.1c-0.1,0-0.1,0-0.1,0.1c0,0-0.1,0.1-0.1,0.1L8.3,14l0.1,2.1 c0,0.1,0,0.1,0.1,0.1c0,0,0.1,0.1,0.1,0.1C8.8,16.3,8.9,16.3,8.9,16.1z M11.4,15.9l0.1-1.8L11.4,9c0-0.1,0-0.2-0.1-0.2 c0,0-0.1,0-0.1,0s-0.1,0-0.1,0c-0.1,0-0.1,0.1-0.1,0.2l0,0.1l-0.1,5c0,0,0,0.7,0.1,2v0c0,0.1,0,0.1,0.1,0.1c0.1,0.1,0.1,0.1,0.2,0.1 c0.1,0,0.1,0,0.2-0.1c0.1,0,0.1-0.1,0.1-0.2L11.4,15.9z M2.4,12.9L2.5,14l-0.2,1.1c0,0.1,0,0.1-0.1,0.1c0,0-0.1,0-0.1-0.1L2.1,14 l0.1-1.1C2.2,12.9,2.3,12.9,2.4,12.9C2.3,12.9,2.4,12.9,2.4,12.9z M3.1,12.2L3.3,14l-0.2,1.8c0,0.1,0,0.1-0.1,0.1 c-0.1,0-0.1,0-0.1-0.1L2.8,14L3,12.2C3,12.2,3,12.2,3.1,12.2C3.1,12.2,3.1,12.2,3.1,12.2z M3.9,11.9L4.1,14l-0.2,2.1 c0,0.1,0,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L3.5,14l0.2-2.1c0-0.1,0-0.1,0.1-0.1C3.9,11.8,3.9,11.8,3.9,11.9z M4.7,11.9L4.9,14 l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L4.3,14l0.2-2.2c0-0.1,0-0.1,0.1-0.1C4.7,11.7,4.7,11.8,4.7,11.9z M5.6,12 l0.2,2l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c0,0-0.1,0-0.1,0c0,0,0-0.1,0-0.1L5.1,14l0.2-2c0,0,0-0.1,0-0.1s0.1,0,0.1,0 C5.5,11.9,5.5,11.9,5.6,12L5.6,12z M6.4,10.7L6.6,14l-0.2,2.1c0,0,0,0.1,0,0.1c0,0-0.1,0-0.1,0c-0.1,0-0.1-0.1-0.2-0.2L5.9,14 l0.2-3.3c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0C6.4,10.7,6.4,10.7,6.4,10.7z M7.2,10l0.2,4.1l-0.2,2.1c0,0,0,0.1,0,0.1 c0,0-0.1,0-0.1,0c-0.1,0-0.2-0.1-0.2-0.2l-0.1-2.1L6.8,10c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0S7.2,9.9,7.2,10z M8,9.6L8.2,14 L8,16.1c0,0.1-0.1,0.2-0.2,0.2c-0.1,0-0.2-0.1-0.2-0.2L7.5,14l0.1-4.4c0-0.1,0-0.1,0.1-0.1c0,0,0.1-0.1,0.1-0.1c0.1,0,0.1,0,0.1,0.1 C8,9.6,8,9.6,8,9.6z M11.4,16.1L11.4,16.1L11.4,16.1z M9.7,9.6L9.8,14l-0.1,2.1c0,0.1,0,0.1-0.1,0.2s-0.1,0.1-0.2,0.1 c-0.1,0-0.1,0-0.1-0.1s-0.1-0.1-0.1-0.2L9.2,14l0.1-4.4c0-0.1,0-0.1,0.1-0.2s0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S9.7,9.5,9.7,9.6 L9.7,9.6z M10.6,9.8l0.1,4.3l-0.1,2c0,0.1,0,0.1-0.1,0.2c0,0-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c0,0-0.1-0.1-0.1-0.2L10,14 l0.1-4.3c0-0.1,0-0.1,0.1-0.2c0,0,0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S10.6,9.7,10.6,9.8z M12.4,14l-0.1,2c0,0.1,0,0.1-0.1,0.2 c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2l-0.1-1l-0.1-1l0.1-5.5v0c0-0.1,0-0.2,0.1-0.2 c0.1,0,0.1-0.1,0.2-0.1c0,0,0.1,0,0.1,0c0.1,0,0.1,0.1,0.1,0.2L12.4,14z M22.1,13.9c0,0.7-0.2,1.3-0.7,1.7c-0.5,0.5-1.1,0.7-1.7,0.7 h-6.8c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2V8.2c0-0.1,0.1-0.2,0.2-0.3c0.5-0.2,1-0.3,1.6-0.3c1.1,0,2.1,0.4,2.9,1.1 c0.8,0.8,1.3,1.7,1.4,2.8c0.3-0.1,0.6-0.2,1-0.2c0.7,0,1.3,0.2,1.7,0.7C21.8,12.6,22.1,13.2,22.1,13.9L22.1,13.9z"}))},{name:"spotify",attributes:{service:"spotify"},title:"Spotify",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2 M16.586,16.424 c-0.18,0.295-0.563,0.387-0.857,0.207c-2.348-1.435-5.304-1.76-8.785-0.964c-0.335,0.077-0.67-0.133-0.746-0.469 c-0.077-0.335,0.132-0.67,0.469-0.746c3.809-0.871,7.077-0.496,9.713,1.115C16.673,15.746,16.766,16.13,16.586,16.424 M17.81,13.7 c-0.226,0.367-0.706,0.482-1.072,0.257c-2.687-1.652-6.785-2.131-9.965-1.166C6.36,12.917,5.925,12.684,5.8,12.273 C5.675,11.86,5.908,11.425,6.32,11.3c3.632-1.102,8.147-0.568,11.234,1.328C17.92,12.854,18.035,13.335,17.81,13.7 M17.915,10.865 c-3.223-1.914-8.54-2.09-11.618-1.156C5.804,9.859,5.281,9.58,5.131,9.086C4.982,8.591,5.26,8.069,5.755,7.919 c3.532-1.072,9.404-0.865,13.115,1.338c0.445,0.264,0.59,0.838,0.327,1.282C18.933,10.983,18.359,11.129,17.915,10.865"}))},{name:"telegram",attributes:{service:"telegram"},title:"Telegram",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 128 128",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M28.9700376,63.3244248 C47.6273373,55.1957357 60.0684594,49.8368063 66.2934036,47.2476366 C84.0668845,39.855031 87.7600616,38.5708563 90.1672227,38.528 C90.6966555,38.5191258 91.8804274,38.6503351 92.6472251,39.2725385 C93.294694,39.7979149 93.4728387,40.5076237 93.5580865,41.0057381 C93.6433345,41.5038525 93.7494885,42.63857 93.6651041,43.5252052 C92.7019529,53.6451182 88.5344133,78.2034783 86.4142057,89.5379542 C85.5170662,94.3339958 83.750571,95.9420841 82.0403991,96.0994568 C78.3237996,96.4414641 75.5015827,93.6432685 71.9018743,91.2836143 C66.2690414,87.5912212 63.0868492,85.2926952 57.6192095,81.6896017 C51.3004058,77.5256038 55.3966232,75.2369981 58.9976911,71.4967761 C59.9401076,70.5179421 76.3155302,55.6232293 76.6324771,54.2720454 C76.6721165,54.1030573 76.7089039,53.4731496 76.3346867,53.1405352 C75.9604695,52.8079208 75.4081573,52.921662 75.0095933,53.0121213 C74.444641,53.1403447 65.4461175,59.0880351 48.0140228,70.8551922 C45.4598218,72.6091037 43.1463059,73.4636682 41.0734751,73.4188859 C38.7883453,73.3695169 34.3926725,72.1268388 31.1249416,71.0646282 C27.1169366,69.7617838 23.931454,69.0729605 24.208838,66.8603276 C24.3533167,65.7078514 25.9403832,64.5292172 28.9700376,63.3244248 Z"}))},{name:"tiktok",attributes:{service:"tiktok"},title:"TikTok",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 32 32",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M16.708 0.027c1.745-0.027 3.48-0.011 5.213-0.027 0.105 2.041 0.839 4.12 2.333 5.563 1.491 1.479 3.6 2.156 5.652 2.385v5.369c-1.923-0.063-3.855-0.463-5.6-1.291-0.76-0.344-1.468-0.787-2.161-1.24-0.009 3.896 0.016 7.787-0.025 11.667-0.104 1.864-0.719 3.719-1.803 5.255-1.744 2.557-4.771 4.224-7.88 4.276-1.907 0.109-3.812-0.411-5.437-1.369-2.693-1.588-4.588-4.495-4.864-7.615-0.032-0.667-0.043-1.333-0.016-1.984 0.24-2.537 1.495-4.964 3.443-6.615 2.208-1.923 5.301-2.839 8.197-2.297 0.027 1.975-0.052 3.948-0.052 5.923-1.323-0.428-2.869-0.308-4.025 0.495-0.844 0.547-1.485 1.385-1.819 2.333-0.276 0.676-0.197 1.427-0.181 2.145 0.317 2.188 2.421 4.027 4.667 3.828 1.489-0.016 2.916-0.88 3.692-2.145 0.251-0.443 0.532-0.896 0.547-1.417 0.131-2.385 0.079-4.76 0.095-7.145 0.011-5.375-0.016-10.735 0.025-16.093z"}))},{name:"tumblr",attributes:{service:"tumblr"},title:"Tumblr",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M17.04 21.28h-3.28c-2.84 0-4.94-1.37-4.94-5.02v-5.67H6.08V7.5c2.93-.73 4.11-3.3 4.3-5.48h3.01v4.93h3.47v3.65H13.4v4.93c0 1.47.73 2.01 1.92 2.01h1.73v3.75z"}))},{name:"twitch",attributes:{service:"twitch"},title:"Twitch",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M16.499,8.089h-1.636v4.91h1.636V8.089z M12,8.089h-1.637v4.91H12V8.089z M4.228,3.178L3,6.451v13.092h4.499V22h2.456 l2.454-2.456h3.681L21,14.636V3.178H4.228z M19.364,13.816l-2.864,2.865H12l-2.453,2.453V16.68H5.863V4.814h13.501V13.816z"}))},{name:"twitter",attributes:{service:"twitter"},title:"Twitter",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z"}))},{name:"vimeo",attributes:{service:"vimeo"},title:"Vimeo",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z"}))},{name:"vk",attributes:{service:"vk"},title:"VK",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M22,7.1c0.2,0.4-0.4,1.5-1.6,3.1c-0.2,0.2-0.4,0.5-0.7,0.9c-0.5,0.7-0.9,1.1-0.9,1.4c-0.1,0.3-0.1,0.6,0.1,0.8 c0.1,0.1,0.4,0.4,0.8,0.9h0l0,0c1,0.9,1.6,1.7,2,2.3c0,0,0,0.1,0.1,0.1c0,0.1,0,0.1,0.1,0.3c0,0.1,0,0.2,0,0.4 c0,0.1-0.1,0.2-0.3,0.3c-0.1,0.1-0.4,0.1-0.6,0.1l-2.7,0c-0.2,0-0.4,0-0.6-0.1c-0.2-0.1-0.4-0.1-0.5-0.2l-0.2-0.1 c-0.2-0.1-0.5-0.4-0.7-0.7s-0.5-0.6-0.7-0.8c-0.2-0.2-0.4-0.4-0.6-0.6C14.8,15,14.6,15,14.4,15c0,0,0,0-0.1,0c0,0-0.1,0.1-0.2,0.2 c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.1-0.1,0.3-0.2,0.5c-0.1,0.2-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.1-0.1,0.2-0.1,0.2l0,0.1 c-0.1,0.1-0.3,0.2-0.6,0.2h-1.2c-0.5,0-1,0-1.5-0.2c-0.5-0.1-1-0.3-1.4-0.6s-0.7-0.5-1.1-0.7s-0.6-0.4-0.7-0.6l-0.3-0.3 c-0.1-0.1-0.2-0.2-0.3-0.3s-0.4-0.5-0.7-0.9s-0.7-1-1.1-1.6c-0.4-0.6-0.8-1.3-1.3-2.2C2.9,9.4,2.5,8.5,2.1,7.5C2,7.4,2,7.3,2,7.2 c0-0.1,0-0.1,0-0.2l0-0.1c0.1-0.1,0.3-0.2,0.6-0.2l2.9,0c0.1,0,0.2,0,0.2,0.1S5.9,6.9,5.9,7L6,7c0.1,0.1,0.2,0.2,0.3,0.3 C6.4,7.7,6.5,8,6.7,8.4C6.9,8.8,7,9,7.1,9.2l0.2,0.3c0.2,0.4,0.4,0.8,0.6,1.1c0.2,0.3,0.4,0.5,0.5,0.7s0.3,0.3,0.4,0.4 c0.1,0.1,0.3,0.1,0.4,0.1c0.1,0,0.2,0,0.3-0.1c0,0,0,0,0.1-0.1c0,0,0.1-0.1,0.1-0.2c0.1-0.1,0.1-0.3,0.1-0.5c0-0.2,0.1-0.5,0.1-0.8 c0-0.4,0-0.8,0-1.3c0-0.3,0-0.5-0.1-0.8c0-0.2-0.1-0.4-0.1-0.5L9.6,7.6C9.4,7.3,9.1,7.2,8.7,7.1C8.6,7.1,8.6,7,8.7,6.9 C8.9,6.7,9,6.6,9.1,6.5c0.4-0.2,1.2-0.3,2.5-0.3c0.6,0,1,0.1,1.4,0.1c0.1,0,0.3,0.1,0.3,0.1c0.1,0.1,0.2,0.1,0.2,0.3 c0,0.1,0.1,0.2,0.1,0.3s0,0.3,0,0.5c0,0.2,0,0.4,0,0.6c0,0.2,0,0.4,0,0.7c0,0.3,0,0.6,0,0.9c0,0.1,0,0.2,0,0.4c0,0.2,0,0.4,0,0.5 c0,0.1,0,0.3,0,0.4s0.1,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.3-0.1c0.1-0.1,0.2-0.2,0.4-0.4 s0.3-0.4,0.5-0.7c0.2-0.3,0.5-0.7,0.7-1.1c0.4-0.7,0.8-1.5,1.1-2.3c0-0.1,0.1-0.1,0.1-0.2c0-0.1,0.1-0.1,0.1-0.1l0,0l0.1,0 c0,0,0,0,0.1,0s0.2,0,0.2,0l3,0c0.3,0,0.5,0,0.7,0S21.9,7,21.9,7L22,7.1z"}))},{name:"yelp",attributes:{service:"yelp"},title:"Yelp",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z"}))},{name:"youtube",attributes:{service:"youtube"},title:"YouTube",icon:()=>Object(je.createElement)(ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},Object(je.createElement)(ye.Path,{d:"M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"}))}];wd.forEach(e=>{e.isActive||(e.isActive=(e,t)=>e.service===t.service)});var Ed=wd;const Cd=e=>{let{url:t,setAttributes:n,setPopover:o,anchorRef:r}=e;return Object(je.createElement)(we.URLPopover,{anchorRef:null==r?void 0:r.current,onClose:()=>o(!1)},Object(je.createElement)("form",{className:"block-editor-url-popover__link-editor",onSubmit:e=>{e.preventDefault(),o(!1)}},Object(je.createElement)("div",{className:"block-editor-url-input"},Object(je.createElement)(we.URLInput,{value:t,onChange:e=>n({url:e}),placeholder:Object(ke.__)("Enter address"),disableSuggestions:!0})),Object(je.createElement)(_e.Button,{icon:_d.a,label:Object(ke.__)("Apply"),type:"submit"})))};var xd=e=>{let{attributes:t,context:n,isSelected:o,setAttributes:r}=e;const{url:a,service:l,label:c}=t,{iconColorValue:i,iconBackgroundColorValue:s}=n,[u,m]=Object(je.useState)(!1),d=tt()("wp-social-link","wp-social-link-"+l,{"wp-social-link__is-incomplete":!a}),b=Object(je.useRef)(),p=(e=>{const t=Object(Me.find)(Ed,{name:e});return t?t.icon:kd})(l),g=(e=>{const t=Object(Me.find)(Ed,{name:e});return t?t.title:Object(ke.__)("Social Icon")})(l),h=Object(we.useBlockProps)({className:d,style:{color:i,backgroundColor:s}});return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.sprintf)(Object(ke.__)("%s label"),g),initialOpen:!1},Object(je.createElement)(_e.PanelRow,null,Object(je.createElement)(_e.TextControl,{label:Object(ke.__)("Link label"),help:Object(ke.__)("Briefly describe the link to help screen reader users."),value:c,onChange:e=>r({label:e})})))),Object(je.createElement)("li",h,Object(je.createElement)(_e.Button,{ref:b,onClick:()=>m(!0)},Object(je.createElement)(p,null),o&&u&&Object(je.createElement)(Cd,{url:a,setAttributes:r,setPopover:m,anchorRef:b}))))};const Sd={apiVersion:2,name:"core/social-link",title:"Social Icon",category:"widgets",parent:["core/social-links"],description:"Display an icon linking to a social media profile or website.",textdomain:"default",attributes:{url:{type:"string"},service:{type:"string"},label:{type:"string"}},usesContext:["openInNewTab","iconColorValue","iconBackgroundColorValue"],supports:{reusable:!1,html:!1},editorStyle:"wp-block-social-link-editor"},{name:Bd}=Sd,Td={icon:fd,edit:xd,variations:Ed};var Nd=[{attributes:{iconColor:{type:"string"},customIconColor:{type:"string"},iconColorValue:{type:"string"},iconBackgroundColor:{type:"string"},customIconBackgroundColor:{type:"string"},iconBackgroundColorValue:{type:"string"},openInNewTab:{type:"boolean",default:!1},size:{type:"string"}},providesContext:{openInNewTab:"openInNewTab"},supports:{align:["left","center","right"],anchor:!0},migrate:e=>{var t,n;if(e.layout)return e;const{className:o}=e,r=new RegExp("\\bitems-justified-[^ ]*[ ]?\\b","g"),a={...e,className:null==o?void 0:o.replace(r,"").trim()},l=null==o||null===(t=o.match(r))||void 0===t||null===(n=t[0])||void 0===n?void 0:n.trim();return l&&Object.assign(a,{layout:{type:"flex",justifyContent:l.slice("items-justified-".length)}}),a},save:e=>{const{attributes:{iconBackgroundColorValue:t,iconColorValue:n,itemsJustification:o,size:r}}=e,a=tt()(r,{"has-icon-color":n,"has-icon-background-color":t,["items-justified-"+o]:o}),l={"--wp--social-links--icon-color":n,"--wp--social-links--icon-background-color":t};return Object(je.createElement)("ul",we.useBlockProps.save({className:a,style:l}),Object(je.createElement)(we.InnerBlocks.Content,null))}}],zd=n("RMJe");const Pd=["core/social-link"],Id=[{name:Object(ke.__)("Small"),value:"has-small-icon-size"},{name:Object(ke.__)("Normal"),value:"has-normal-icon-size"},{name:Object(ke.__)("Large"),value:"has-large-icon-size"},{name:Object(ke.__)("Huge"),value:"has-huge-icon-size"}];var Md=Object(we.withColors)({iconColor:"icon-color",iconBackgroundColor:"icon-background-color"})((function(e){var t;const{name:n,attributes:o,iconBackgroundColor:r,iconColor:a,isSelected:l,setAttributes:c,setIconBackgroundColor:i,setIconColor:s}=e,{iconBackgroundColorValue:u,iconColorValue:m,openInNewTab:d,size:b,layout:p}=o,g=p||(e=>{const t=Object(Oe.getBlockSupport)(e,"__experimentalLayout");return null==t?void 0:t.default})(n),h=(null===(t=o.className)||void 0===t?void 0:t.indexOf("is-style-logos-only"))>=0;Object(je.useEffect)(()=>{h&&c({iconBackgroundColor:void 0,customIconBackgroundColor:void 0,iconBackgroundColorValue:void 0})},[h,c]);const v=Object(je.createElement)("li",{className:"wp-block-social-links__social-placeholder"},Object(je.createElement)("div",{className:"wp-social-link"}),Object(je.createElement)("div",{className:"wp-block-social-links__social-placeholder-icons"},Object(je.createElement)("div",{className:"wp-social-link wp-social-link-twitter"}),Object(je.createElement)("div",{className:"wp-social-link wp-social-link-facebook"}),Object(je.createElement)("div",{className:"wp-social-link wp-social-link-instagram"}))),O=Object(je.createElement)("li",{className:"wp-block-social-links__social-prompt"},Object(ke.__)("Click plus to add")),j=tt()(b,{"has-icon-color":a.color||m,"has-icon-background-color":r.color||u}),y=Object(we.useBlockProps)({className:j}),f=Object(we.useInnerBlocksProps)(y,{allowedBlocks:Pd,placeholder:l?O:v,templateLock:!1,__experimentalAppenderTagName:"li",__experimentalLayout:g});return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,{group:"other"},Object(je.createElement)(_e.ToolbarDropdownMenu,{label:Object(ke.__)("Size"),text:Object(ke.__)("Size"),icon:null,popoverProps:{position:"bottom right"}},e=>{let{onClose:t}=e;return Object(je.createElement)(_e.MenuGroup,null,Id.map(e=>Object(je.createElement)(_e.MenuItem,{icon:(b===e.value||!b&&"has-normal-icon-size"===e.value)&&zd.a,isSelected:b===e.value,key:e.value,onClick:()=>{c({size:e.value})},onClose:t,role:"menuitemradio"},e.name)))})),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Link settings")},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Open links in new tab"),checked:d,onChange:()=>c({openInNewTab:!d})})),Object(je.createElement)(we.PanelColorSettings,{__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,title:Object(ke.__)("Color"),colorSettings:[{value:a.color||m,onChange:e=>{s(e),c({iconColorValue:e})},label:Object(ke.__)("Icon color")},!h&&{value:r.color||u,onChange:e=>{i(e),c({iconBackgroundColorValue:e})},label:Object(ke.__)("Icon background")}]}),!h&&Object(je.createElement)(we.ContrastChecker,{textColor:m,backgroundColor:u,isLargeText:!1})),Object(je.createElement)("ul",f))}));const Rd={apiVersion:2,name:"core/social-links",title:"Social Icons",category:"widgets",description:"Display icons linking to your social media profiles or websites.",keywords:["links"],textdomain:"default",attributes:{iconColor:{type:"string"},customIconColor:{type:"string"},iconColorValue:{type:"string"},iconBackgroundColor:{type:"string"},customIconBackgroundColor:{type:"string"},iconBackgroundColorValue:{type:"string"},openInNewTab:{type:"boolean",default:!1},size:{type:"string"}},providesContext:{openInNewTab:"openInNewTab",iconColorValue:"iconColorValue",iconBackgroundColorValue:"iconBackgroundColorValue"},supports:{align:["left","center","right"],anchor:!0,__experimentalExposeControlsToChildren:!0,__experimentalLayout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}},spacing:{blockGap:!0,margin:["top","bottom"],units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"logos-only",label:"Logos Only"},{name:"pill-shape",label:"Pill Shape"}],editorStyle:"wp-block-social-links-editor",style:"wp-block-social-links"},{name:Ld}=Rd,Vd={example:{innerBlocks:[{name:"core/social-link",attributes:{service:"wordpress",url:"https://wordpress.org"}},{name:"core/social-link",attributes:{service:"facebook",url:"https://www.facebook.com/WordPress/"}},{name:"core/social-link",attributes:{service:"twitter",url:"https://twitter.com/WordPress"}}]},icon:fd,edit:Md,save:function(e){const{attributes:{iconBackgroundColorValue:t,iconColorValue:n,size:o}}=e,r=tt()(o,{"has-icon-color":n,"has-icon-background-color":t}),a=we.useBlockProps.save({className:r}),l=we.useInnerBlocksProps.save(a);return Object(je.createElement)("ul",l)},deprecated:Nd};var Hd=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M12.5 4.2v1.6h4.7L5.8 17.2V12H4.2v7.8H12v-1.6H6.8L18.2 6.8v4.7h1.6V4.2z"}));var Ad=[{attributes:{height:{type:"number",default:100},width:{type:"number"}},migrate(e){const{height:t,width:n}=e;return{...e,width:void 0!==n?n+"px":void 0,height:void 0!==t?t+"px":void 0}},save(e){let{attributes:t}=e;return Object(je.createElement)("div",we.useBlockProps.save({style:{height:t.height,width:t.width},"aria-hidden":!0}))}}];function Fd(e){var t;let{label:n,onChange:o,isResizing:r,value:a=""}=e;const[l,c]=Object(je.useState)(null),i=Object(nt.useInstanceId)(_e.__experimentalUnitControl,"block-spacer-height-input"),s=null===(t=Object(we.useSetting)("spacing.units")||void 0)||void 0===t?void 0:t.filter(e=>"%"!==e),u=Object(_e.__experimentalUseCustomUnits)({availableUnits:s||["px","em","rem","vw","vh"],defaultValues:{px:"100",em:"10",rem:"10",vw:"10",vh:"25"}}),m=null!==l?l:a;return Object(je.createElement)(_e.BaseControl,{label:n,id:i},Object(je.createElement)(_e.__experimentalUnitControl,{id:i,isResetValueOnUnitChange:!0,min:0,max:Gd,onBlur:()=>{null!==l&&c(null)},onChange:e=>{c(null),o(e)},style:{maxWidth:80},value:m,units:u,unit:r?"px":void 0}))}function Dd(e){let{setAttributes:t,orientation:n,height:o,width:r,isResizing:a}=e;return Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Spacer settings")},"horizontal"===n&&Object(je.createElement)(Fd,{label:Object(ke.__)("Width"),value:r,onChange:e=>t({width:e}),isResizing:a}),"horizontal"!==n&&Object(je.createElement)(Fd,{label:Object(ke.__)("Height"),value:o,onChange:e=>t({height:e}),isResizing:a})))}const Gd=500,Ud=e=>{let{orientation:t,onResizeStart:n,onResize:o,onResizeStop:r,isSelected:a,isResizing:l,setIsResizing:c,...i}=e;const s=e=>"horizontal"===t?e.clientWidth:e.clientHeight,u=e=>s(e)+"px";return Object(je.createElement)(_e.ResizableBox,Object(mt.a)({className:tt()("block-library-spacer__resize-container",{"resize-horizontal":"horizontal"===t,"is-resizing":l,"is-selected":a}),onResizeStart:(e,t,r)=>{const a=u(r);n(a),o(a)},onResize:(e,t,n)=>{o(u(n)),l||c(!0)},onResizeStop:(e,t,n)=>{const o=Math.min(Gd,s(n));r(o+"px"),c(!1)},__experimentalShowTooltip:!0,__experimentalTooltipProps:{axis:"horizontal"===t?"x":"y",position:"corner",isVisible:l},showHandle:a},i))};var qd=Object(nt.compose)([Object(Pe.withDispatch)(e=>{const{toggleSelection:t}=e(we.store);return{onResizeStart:()=>t(!1),onResizeStop:()=>t(!0)}}),nt.withInstanceId])(e=>{let{attributes:t,isSelected:n,setAttributes:o,onResizeStart:r,onResizeStop:a,context:l}=e;const{orientation:c}=l,{height:i,width:s}=t,[u,m]=Object(je.useState)(!1),[d,b]=Object(je.useState)(null),[p,g]=Object(je.useState)(null),h=e=>{a(),o({height:e}),b(null)},v=e=>{a(),o({width:e}),g(null)},O={height:"horizontal"===c?24:d||i||void 0,width:"horizontal"===c&&(p||s)||void 0};return Object(je.useEffect)(()=>{"horizontal"!==c||s||o({height:"0px",width:"72px"})},[]),Object(je.createElement)(je.Fragment,null,Object(je.createElement)(ye.View,Object(we.useBlockProps)({style:O}),"horizontal"===(j=c)?Object(je.createElement)(Ud,{minWidth:1,enable:{top:!1,right:!0,bottom:!1,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},orientation:j,onResizeStart:r,onResize:g,onResizeStop:v,isSelected:n,isResizing:u,setIsResizing:m}):Object(je.createElement)(je.Fragment,null,Object(je.createElement)(Ud,{enable:{top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},orientation:j,onResizeStart:r,onResize:b,onResizeStop:h,isSelected:n,isResizing:u,setIsResizing:m}))),Object(je.createElement)(Dd,{setAttributes:o,height:d||i,width:p||s,orientation:c,isResizing:u}));var j});const Wd={apiVersion:2,name:"core/spacer",title:"Spacer",category:"design",description:"Add white space between blocks and customize its height.",textdomain:"default",attributes:{height:{type:"string",default:"100px"},width:{type:"string"}},usesContext:["orientation"],supports:{anchor:!0},editorStyle:"wp-block-spacer-editor",style:"wp-block-spacer"},{name:$d}=Wd,Zd={icon:Hd,edit:qd,save:function(e){let{attributes:{height:t,width:n}}=e;return Object(je.createElement)("div",we.useBlockProps.save({style:{height:t,width:n},"aria-hidden":!0}))},deprecated:Ad};var Kd=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z"}));const Jd={"subtle-light-gray":"#f3f4f5","subtle-pale-green":"#e9fbe5","subtle-pale-blue":"#e7f5fe","subtle-pale-pink":"#fcf0ef"};var Qd=[{attributes:{hasFixedLayout:{type:"boolean",default:!1},backgroundColor:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption",default:""},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}}},supports:{anchor:!0,align:!0,__experimentalSelector:".wp-block-table > table"},save:e=>{let{attributes:t}=e;const{hasFixedLayout:n,head:o,body:r,foot:a,backgroundColor:l,caption:c}=t;if(!o.length&&!r.length&&!a.length)return null;const i=Object(we.getColorClassName)("background-color",l),s=tt()(i,{"has-fixed-layout":n,"has-background":!!i}),u=!we.RichText.isEmpty(c),m=e=>{let{type:t,rows:n}=e;if(!n.length)return null;const o="t"+t;return Object(je.createElement)(o,null,n.map((e,t)=>{let{cells:n}=e;return Object(je.createElement)("tr",{key:t},n.map((e,t)=>{let{content:n,tag:o,scope:r,align:a}=e;const l=tt()({["has-text-align-"+a]:a});return Object(je.createElement)(we.RichText.Content,{className:l||void 0,"data-align":a,tagName:o,value:n,key:t,scope:"th"===o?r:void 0})}))}))};return Object(je.createElement)("figure",we.useBlockProps.save(),Object(je.createElement)("table",{className:""===s?void 0:s},Object(je.createElement)(m,{type:"head",rows:o}),Object(je.createElement)(m,{type:"body",rows:r}),Object(je.createElement)(m,{type:"foot",rows:a})),u&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",value:c}))},isEligible:e=>e.backgroundColor&&!e.style,migrate:e=>({...e,backgroundColor:void 0,style:{color:{background:Jd[e.backgroundColor]}}})},{attributes:{hasFixedLayout:{type:"boolean",default:!1},backgroundColor:{type:"string"},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"}}}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"}}}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"}}}}}},supports:{align:!0},save(e){let{attributes:t}=e;const{hasFixedLayout:n,head:o,body:r,foot:a,backgroundColor:l}=t;if(!o.length&&!r.length&&!a.length)return null;const c=Object(we.getColorClassName)("background-color",l),i=tt()(c,{"has-fixed-layout":n,"has-background":!!c}),s=e=>{let{type:t,rows:n}=e;if(!n.length)return null;const o="t"+t;return Object(je.createElement)(o,null,n.map((e,t)=>{let{cells:n}=e;return Object(je.createElement)("tr",{key:t},n.map((e,t)=>{let{content:n,tag:o,scope:r}=e;return Object(je.createElement)(we.RichText.Content,{tagName:o,value:n,key:t,scope:"th"===o?r:void 0})}))}))};return Object(je.createElement)("table",{className:i},Object(je.createElement)(s,{type:"head",rows:o}),Object(je.createElement)(s,{type:"body",rows:r}),Object(je.createElement)(s,{type:"foot",rows:a}))}}],Yd=n("fPbg"),Xd=n("plpT"),eb=n("ziDm");var tb=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(je.createElement)(ye.Path,{d:"M6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84zM6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84z"}));var nb=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(je.createElement)(ye.Path,{d:"M13.824 10.176h-2.88v-2.88H9.536v2.88h-2.88v1.344h2.88v2.88h1.408v-2.88h2.88zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm6.4 0H7.68v3.84h5.12V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.056H1.28v9.024H19.2V6.336z"}));var ob=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(je.createElement)(ye.Path,{d:"M17.728 11.456L14.592 8.32l3.2-3.2-1.536-1.536-3.2 3.2L9.92 3.648 8.384 5.12l3.2 3.2-3.264 3.264 1.536 1.536 3.264-3.264 3.136 3.136 1.472-1.536zM0 17.92V0h20.48v17.92H0zm19.2-6.4h-.448l-1.28-1.28H19.2V6.4h-1.792l1.28-1.28h.512V1.28H1.28v3.84h6.208l1.28 1.28H1.28v3.84h7.424l-1.28 1.28H1.28v3.84H19.2v-3.84z"}));var rb=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(je.createElement)(ye.Path,{d:"M6.4 3.776v3.648H2.752v1.792H6.4v3.648h1.728V9.216h3.712V7.424H8.128V3.776zM0 17.92V0h20.48v17.92H0zM12.8 1.28H1.28v14.08H12.8V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.12h-5.12v3.84h5.12V6.4zm0 5.12h-5.12v3.84h5.12v-3.84z"}));var ab=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(je.createElement)(ye.Path,{d:"M14.08 12.864V9.216h3.648V7.424H14.08V3.776h-1.728v3.648H8.64v1.792h3.712v3.648zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm0 5.12H1.28v3.84H6.4V6.4zm0 5.12H1.28v3.84H6.4v-3.84zM19.2 1.28H7.68v14.08H19.2V1.28z"}));var lb=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(je.createElement)(ye.Path,{d:"M6.4 9.98L7.68 8.7v-.256L6.4 7.164V9.98zm6.4-1.532l1.28-1.28V9.92L12.8 8.64v-.192zm7.68 9.472V0H0v17.92h20.48zm-1.28-2.56h-5.12v-1.024l-.256.256-1.024-1.024v1.792H7.68v-1.792l-1.024 1.024-.256-.256v1.024H1.28V1.28H6.4v2.368l.704-.704.576.576V1.216h5.12V3.52l.96-.96.32.32V1.216h5.12V15.36zm-5.76-2.112l-3.136-3.136-3.264 3.264-1.536-1.536 3.264-3.264L5.632 5.44l1.536-1.536 3.136 3.136 3.2-3.2 1.536 1.536-3.2 3.2 3.136 3.136-1.536 1.536z"}));var cb=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{d:"M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z"}));const ib=["align"];function sb(e,t,n){if(!t)return e;const o=Object(Me.pick)(e,["head","body","foot"]),{sectionName:r,rowIndex:a}=t;return Object(Me.mapValues)(o,(e,o)=>r&&r!==o?e:e.map((e,r)=>a&&a!==r?e:{cells:e.cells.map((e,a)=>function(e,t){if(!e||!t)return!1;switch(t.type){case"column":return"column"===t.type&&e.columnIndex===t.columnIndex;case"cell":return"cell"===t.type&&e.sectionName===t.sectionName&&e.columnIndex===t.columnIndex&&e.rowIndex===t.rowIndex}}({sectionName:o,columnIndex:a,rowIndex:r},t)?n(e):e)}))}function ub(e,t){let{sectionName:n,rowIndex:o,columnCount:r}=t;const a=function(e){return bb(e.head)?bb(e.body)?bb(e.foot)?void 0:e.foot[0]:e.body[0]:e.head[0]}(e),l=void 0===r?Object(Me.get)(a,["cells","length"]):r;return l?{[n]:[...e[n].slice(0,o),{cells:Object(Me.times)(l,e=>{const t=Object(Me.get)(a,["cells",e],{});return{...Object(Me.pick)(t,ib),content:"",tag:"head"===n?"th":"td"}})},...e[n].slice(o)]}:e}function mb(e,t){let{columnIndex:n}=t;const o=Object(Me.pick)(e,["head","body","foot"]);return Object(Me.mapValues)(o,(e,t)=>bb(e)?e:e.map(e=>pb(e)||e.cells.length<n?e:{cells:[...e.cells.slice(0,n),{content:"",tag:"head"===t?"th":"td"},...e.cells.slice(n)]}))}function db(e,t){if(!bb(e[t]))return{[t]:[]};return ub(e,{sectionName:t,rowIndex:0,columnCount:Object(Me.get)(e,["body",0,"cells","length"],1)})}function bb(e){return!e||!e.length||Object(Me.every)(e,pb)}function pb(e){return!(e.cells&&e.cells.length)}const gb=[{icon:Yd.a,title:Object(ke.__)("Align column left"),align:"left"},{icon:Xd.a,title:Object(ke.__)("Align column center"),align:"center"},{icon:eb.a,title:Object(ke.__)("Align column right"),align:"right"}],hb={head:Object(ke.__)("Header cell text"),body:Object(ke.__)("Body cell text"),foot:Object(ke.__)("Footer cell text")},vb={head:Object(ke.__)("Header label"),foot:Object(ke.__)("Footer label")};function Ob(e){let{name:t,...n}=e;const o="t"+t;return Object(je.createElement)(o,n)}var jb=function(e){let{attributes:t,setAttributes:n,insertBlocksAfter:o,isSelected:r}=e;const{hasFixedLayout:a,caption:l,head:c,foot:i}=t,[s,u]=Object(je.useState)(2),[m,d]=Object(je.useState)(2),[b,p]=Object(je.useState)(),g=Object(we.__experimentalUseColorProps)(t),h=Object(we.__experimentalUseBorderProps)(t);function v(e){b&&n(sb(t,b,t=>({...t,content:e})))}function O(e){if(!b)return;const{sectionName:o,rowIndex:r}=b,a=r+e;n(ub(t,{sectionName:o,rowIndex:a})),p({sectionName:o,rowIndex:a,columnIndex:0,type:"cell"})}function j(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!b)return;const{columnIndex:o}=b,r=o+e;n(mb(t,{columnIndex:r})),p({rowIndex:0,columnIndex:r,type:"cell"})}Object(je.useEffect)(()=>{r||p()},[r]);const y=["head","body","foot"].filter(e=>!bb(t[e])),f=[{icon:tb,title:Object(ke.__)("Insert row before"),isDisabled:!b,onClick:function(){O(0)}},{icon:nb,title:Object(ke.__)("Insert row after"),isDisabled:!b,onClick:function(){O(1)}},{icon:ob,title:Object(ke.__)("Delete row"),isDisabled:!b,onClick:function(){if(!b)return;const{sectionName:e,rowIndex:o}=b;p(),n(function(e,t){let{sectionName:n,rowIndex:o}=t;return{[n]:e[n].filter((e,t)=>t!==o)}}(t,{sectionName:e,rowIndex:o}))}},{icon:rb,title:Object(ke.__)("Insert column before"),isDisabled:!b,onClick:function(){j(0)}},{icon:ab,title:Object(ke.__)("Insert column after"),isDisabled:!b,onClick:function(){j(1)}},{icon:lb,title:Object(ke.__)("Delete column"),isDisabled:!b,onClick:function(){if(!b)return;const{sectionName:e,columnIndex:o}=b;p(),n(function(e,t){let{columnIndex:n}=t;const o=Object(Me.pick)(e,["head","body","foot"]);return Object(Me.mapValues)(o,e=>bb(e)?e:e.map(e=>({cells:e.cells.length>=n?e.cells.filter((e,t)=>t!==n):e.cells})).filter(e=>e.cells.length))}(t,{sectionName:e,columnIndex:o}))}}],_=["head","body","foot"].map(e=>Object(je.createElement)(Ob,{name:e,key:e},t[e].map((t,n)=>{let{cells:o}=t;return Object(je.createElement)("tr",{key:n},o.map((t,o)=>{let{content:r,tag:a,scope:l,align:c}=t;return Object(je.createElement)(we.RichText,{tagName:a,key:o,className:tt()({["has-text-align-"+c]:c},"wp-block-table__cell-content"),scope:"th"===a?l:void 0,value:r,onChange:v,unstableOnFocus:()=>{p({sectionName:e,rowIndex:n,columnIndex:o,type:"cell"})},"aria-label":hb[e],placeholder:vb[e]})}))}))),k=!y.length;return Object(je.createElement)("figure",Object(we.useBlockProps)(),!k&&Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(we.AlignmentControl,{label:Object(ke.__)("Change column alignment"),alignmentControls:gb,value:function(){if(b)return function(e,t,n){const{sectionName:o,rowIndex:r,columnIndex:a}=t;return Object(Me.get)(e,[o,r,"cells",a,n])}(t,b,"align")}(),onChange:e=>function(e){if(!b)return;const o={type:"column",columnIndex:b.columnIndex},r=sb(t,o,t=>({...t,align:e}));n(r)}(e)})),Object(je.createElement)(we.BlockControls,{group:"other"},Object(je.createElement)(_e.ToolbarDropdownMenu,{hasArrowIndicator:!0,icon:cb,label:Object(ke.__)("Edit table"),controls:f}))),!k&&Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Table settings"),className:"blocks-table-settings"},Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Fixed width table cells"),checked:!!a,onChange:function(){n({hasFixedLayout:!a})}}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Header section"),checked:!(!c||!c.length),onChange:function(){n(db(t,"head"))}}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Footer section"),checked:!(!i||!i.length),onChange:function(){n(db(t,"foot"))}}))),!k&&Object(je.createElement)("table",{className:tt()(g.className,h.className,{"has-fixed-layout":a}),style:{...g.style,...h.style}},_),!k&&Object(je.createElement)(we.RichText,{tagName:"figcaption","aria-label":Object(ke.__)("Table caption text"),placeholder:Object(ke.__)("Add caption"),value:l,onChange:e=>n({caption:e}),unstableOnFocus:()=>p(),__unstableOnSplitAtEnd:()=>o(Object(Oe.createBlock)("core/paragraph"))}),k&&Object(je.createElement)(_e.Placeholder,{label:Object(ke.__)("Table"),icon:Object(je.createElement)(we.BlockIcon,{icon:Kd,showColors:!0}),instructions:Object(ke.__)("Insert a table for sharing data.")},Object(je.createElement)("form",{className:"blocks-table__placeholder-form",onSubmit:function(e){e.preventDefault(),n(function(e){let{rowCount:t,columnCount:n}=e;return{body:Object(Me.times)(t,()=>({cells:Object(Me.times)(n,()=>({content:"",tag:"td"}))}))}}({rowCount:parseInt(s,10)||2,columnCount:parseInt(m,10)||2}))}},Object(je.createElement)(_e.TextControl,{type:"number",label:Object(ke.__)("Column count"),value:m,onChange:function(e){d(e)},min:"1",className:"blocks-table__placeholder-input"}),Object(je.createElement)(_e.TextControl,{type:"number",label:Object(ke.__)("Row count"),value:s,onChange:function(e){u(e)},min:"1",className:"blocks-table__placeholder-input"}),Object(je.createElement)(_e.Button,{className:"blocks-table__placeholder-button",variant:"primary",type:"submit"},Object(ke.__)("Create Table")))))};const yb=e=>{let{phrasingContentSchema:t}=e;return{tr:{allowEmpty:!0,children:{th:{allowEmpty:!0,children:t,attributes:["scope"]},td:{allowEmpty:!0,children:t}}}}};var fb={from:[{type:"raw",selector:"table",schema:e=>({table:{children:{thead:{allowEmpty:!0,children:yb(e)},tfoot:{allowEmpty:!0,children:yb(e)},tbody:{allowEmpty:!0,children:yb(e)}}}})}]};const _b={apiVersion:2,name:"core/table",title:"Table",category:"text",description:"Create structured content in rows and columns to display information.",textdomain:"default",attributes:{hasFixedLayout:{type:"boolean",default:!1},caption:{type:"string",source:"html",selector:"figcaption",default:""},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}}},supports:{anchor:!0,align:!0,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{__experimentalSkipSerialization:!0,color:!0,style:!0,width:!0},__experimentalSelector:".wp-block-table > table"},styles:[{name:"regular",label:"Default",isDefault:!0},{name:"stripes",label:"Stripes"}],editorStyle:"wp-block-table-editor",style:"wp-block-table"},{name:kb}=_b,wb={icon:Kd,example:{attributes:{head:[{cells:[{content:Object(ke.__)("Version"),tag:"th"},{content:Object(ke.__)("Jazz Musician"),tag:"th"},{content:Object(ke.__)("Release Date"),tag:"th"}]}],body:[{cells:[{content:"5.2",tag:"td"},{content:"Jaco Pastorius",tag:"td"},{content:Object(ke.__)("May 7, 2019"),tag:"td"}]},{cells:[{content:"5.1",tag:"td"},{content:"Betty Carter",tag:"td"},{content:Object(ke.__)("February 21, 2019"),tag:"td"}]},{cells:[{content:"5.0",tag:"td"},{content:"Bebo Valdés",tag:"td"},{content:Object(ke.__)("December 6, 2018"),tag:"td"}]}]}},transforms:fb,edit:jb,save:function(e){let{attributes:t}=e;const{hasFixedLayout:n,head:o,body:r,foot:a,caption:l}=t;if(!o.length&&!r.length&&!a.length)return null;const c=Object(we.__experimentalGetColorClassesAndStyles)(t),i=Object(we.__experimentalGetBorderClassesAndStyles)(t),s=tt()(c.className,i.className,{"has-fixed-layout":n}),u=!we.RichText.isEmpty(l),m=e=>{let{type:t,rows:n}=e;if(!n.length)return null;const o="t"+t;return Object(je.createElement)(o,null,n.map((e,t)=>{let{cells:n}=e;return Object(je.createElement)("tr",{key:t},n.map((e,t)=>{let{content:n,tag:o,scope:r,align:a}=e;const l=tt()({["has-text-align-"+a]:a});return Object(je.createElement)(we.RichText.Content,{className:l||void 0,"data-align":a,tagName:o,value:n,key:t,scope:"th"===o?r:void 0})}))}))};return Object(je.createElement)("figure",we.useBlockProps.save(),Object(je.createElement)("table",{className:""===s?void 0:s,style:{...c.style,...i.style}},Object(je.createElement)(m,{type:"head",rows:o}),Object(je.createElement)(m,{type:"body",rows:r}),Object(je.createElement)(m,{type:"foot",rows:a})),u&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",value:l}))},deprecated:Qd};var Eb=Object(Pe.withSelect)(e=>({taxonomies:e(It.store).getTaxonomies({per_page:-1})}))((function(e){let{attributes:t,setAttributes:n,taxonomies:o}=e;const{taxonomy:r,showTagCounts:a,numberOfTags:l}=t,c=Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Tag Cloud settings")},Object(je.createElement)(_e.SelectControl,{label:Object(ke.__)("Taxonomy"),options:[{label:Object(ke.__)("- Select -"),value:"",disabled:!0},...Object(Me.map)(Object(Me.filter)(o,"show_cloud"),e=>({value:e.slug,label:e.name}))],value:r,onChange:e=>n({taxonomy:e})}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Show post counts"),checked:a,onChange:()=>n({showTagCounts:!a})}),Object(je.createElement)(_e.RangeControl,{label:Object(ke.__)("Number of tags"),value:l,onChange:e=>n({numberOfTags:e}),min:1,max:100,required:!0})));return Object(je.createElement)(je.Fragment,null,c,Object(je.createElement)("div",Object(we.useBlockProps)(),Object(je.createElement)(Ce.a,{key:"tag-cloud",block:"core/tag-cloud",attributes:t})))}));const Cb={apiVersion:2,name:"core/tag-cloud",title:"Tag Cloud",category:"widgets",description:"A cloud of your most used tags.",textdomain:"default",attributes:{numberOfTags:{type:"number",default:45,minimum:1,maximum:100},taxonomy:{type:"string",default:"post_tag"},showTagCounts:{type:"boolean",default:!1}},supports:{html:!1,align:!0},editorStyle:"wp-block-tag-cloud-editor"},{name:xb}=Cb,Sb={icon:Jc,example:{},edit:Eb};var Bb=n("OE6V");function Tb(e){return Object(ke.sprintf)(Object(ke.__)("Area: %s"),e)}function Nb(){return Object(je.createElement)("div",{className:"wp-block-template-part__selection-preview-item is-placeholder",tabIndex:0})}function zb(e){let{templatePart:t,setAttributes:n,onClose:o,composite:r}=e;const{slug:a,theme:l,title:{rendered:c}}=t,i=t.content.raw||"",s=Object(je.useMemo)(()=>Object(Oe.parse)(i),[i]),{createSuccessNotice:u}=Object(Pe.useDispatch)(Do.store),m=Object(je.useCallback)(()=>{n({slug:a,theme:l,area:void 0}),u(Object(ke.sprintf)(Object(ke.__)('Template Part "%s" inserted.'),c||a),{type:"snackbar"}),o()},[a,l]);return Object(je.createElement)(_e.__unstableCompositeItem,Object(mt.a)({as:"div",className:"wp-block-template-part__selection-preview-item",role:"option",onClick:m,onKeyDown:e=>{dt.ENTER!==e.keyCode&&dt.SPACE!==e.keyCode||m()},tabIndex:0,"aria-label":c||a},r),Object(je.createElement)(we.BlockPreview,{blocks:s}),Object(je.createElement)("div",{className:"wp-block-template-part__selection-preview-item-title"},c||a))}function Pb(e){let{title:t,icon:n,children:o}=e;return Object(je.createElement)(je.Fragment,null,Object(je.createElement)("div",{className:"wp-block-template-part__selection-panel-group-header"},Object(je.createElement)("span",{className:"wp-block-template-part__selection-panel-group-title"},t),Object(je.createElement)(_e.Icon,{icon:n})),Object(je.createElement)("div",{className:"wp-block-template-part__selection-panel-group-content"},o))}function Ib(e){let{templateParts:t,setAttributes:n,onClose:o,composite:r,area:a="uncategorized",labelsByArea:l}=e;const{templatePartsByArea:c,templatePartsToShow:i}=Object(je.useMemo)(()=>{const e=t.filter(e=>"uncategorized"===a||e.area===a)||[];return{templatePartsByArea:Object.values(Object(Me.groupBy)(e,"area")),templatePartsToShow:Object(Me.flatten)(e)}},[t,a]),s=Object(nt.useAsyncList)(i);return i.length?c.map(e=>Object(je.createElement)(Pb,{key:e[0].area,title:Tb(l[e[0].area]||l.uncategorized)},e.map(e=>s.includes(e)?Object(je.createElement)(zb,{key:e.id,templatePart:e,setAttributes:n,onClose:o,composite:r}):Object(je.createElement)(Nb,{key:e.id})))):Object(je.createElement)(Pb,{title:Tb(l[a]||l.uncategorized)},Object(ke.sprintf)(Object(ke.__)("There is no other %s available. If you are looking for another type of template part, try searching for it using the input above."),a&&"uncategorized"!==a?l[a]||a:Object(ke.__)("Template Part")))}function Mb(e){let{templateParts:t,setAttributes:n,filterValue:o,onClose:r,composite:a,labelsByArea:l}=e;const{filteredTPs:c,groupedResults:i}=Object(je.useMemo)(()=>{const e=Object(Me.deburr)(o).toLowerCase(),n=t.filter(t=>{let{title:{rendered:n},area:o}=t;return Object(Me.deburr)(n).toLowerCase().includes(e)||Object(Me.deburr)(l[o]).toLowerCase().includes(e)});n.sort((t,n)=>{const o=Object(Me.deburr)(t.title.rendered).toLowerCase().indexOf(e),r=Object(Me.deburr)(n.title.rendered).toLowerCase().indexOf(e);return-1!==o&&-1!==r?o-r:-1!==o?-1:-1!==r?1:Object(Me.deburr)(l[t.area]).toLowerCase().indexOf(e)-Object(Me.deburr)(l[n.area]).toLowerCase().indexOf(e)});const r=[];for(let e=0;e<n.length;e++)0!==e&&n[e].area===n[e-1].area?r[r.length-1].push(n[e]):r.push([n[e]]);return{filteredTPs:n,groupedResults:r}},[o,t]),s=Object(nt.useAsyncList)(c);return i.map(e=>Object(je.createElement)(Pb,{key:e[0].id,title:Tb(l[e[0].area]||l.uncategorized)},e.map(e=>s.includes(e)?Object(je.createElement)(zb,{key:e.id,templatePart:e,setAttributes:n,onClose:r,composite:a}):Object(je.createElement)(Nb,{key:e.id}))))}function Rb(e){let{setAttributes:t,filterValue:n,onClose:o,area:r,templatePartId:a}=e;const l=Object(_e.__unstableUseCompositeState)(),{templateParts:c,labelsByArea:i}=Object(Pe.useSelect)(e=>{const t=(e(It.store).getEntityRecords("postType","wp_template_part",{per_page:-1})||[]).filter(e=>sc(e.theme,e.slug)!==a),n=e("core/editor").__experimentalGetDefaultTemplatePartAreas(),o={};return n.forEach(e=>{o[e.area]=e.label}),{templateParts:t,labelsByArea:o}},[]);return c&&c.length?n?Object(je.createElement)(_e.__unstableComposite,Object(mt.a)({},l,{role:"listbox","aria-label":Object(ke.__)("List of template parts")}),Object(je.createElement)(Mb,{templateParts:c,setAttributes:t,filterValue:n,onClose:o,composite:l,labelsByArea:i})):Object(je.createElement)(_e.__unstableComposite,Object(mt.a)({},l,{role:"listbox","aria-label":Object(ke.__)("List of template parts")}),Object(je.createElement)(Ib,{templateParts:c,setAttributes:t,onClose:o,composite:l,area:r,labelsByArea:i})):Object(je.createElement)(Pb,null,Object(ke.__)("There are no existing template parts to select."))}function Lb(e){let{setAttributes:t,onClose:n,area:o,templatePartId:r=null}=e;const[a,l]=Object(je.useState)("");return Object(je.createElement)("div",null,Object(je.createElement)(_e.SearchControl,{value:a,onChange:l,className:"wp-block-template-part__selection-preview-search-form"}),Object(je.createElement)("div",{className:"wp-block-template-part__selection-preview-container"},Object(je.createElement)(Rb,{setAttributes:t,filterValue:a,onClose:n,area:o,templatePartId:r})))}function Vb(e){let{area:t,areaLabel:n,areaIcon:o,clientId:r,onCreate:a,resetPlaceholder:l}=e;const c=t?"core/template-part/"+t:"core/template-part",[i,s]=Object(je.useState)(Object(ke.__)("Untitled Template Part")),[u,m]=Object(je.useState)([]),[d,b]=Object(je.useState)(!1);return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.__experimentalBlockPatternSetup,{clientId:r,startBlankComponent:Object(je.createElement)(Hb,{setTitleStep:b,areaLabel:n,areaIcon:o}),onBlockPatternSelect:e=>{m(e),b(!0)},filterPatternsFn: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=>e===c)}}),d&&Object(je.createElement)(_e.Modal,{title:Object(ke.sprintf)(Object(ke.__)("Name and create your new %s"),n.toLowerCase()),closeLabel:Object(ke.__)("Cancel"),onRequestClose:l,overlayClassName:"wp-block-template-part__placeholder-create-new__title-form"},Object(je.createElement)("form",{onSubmit:e=>{e.preventDefault(),a(u,i)}},Object(je.createElement)(_e.TextControl,{label:Object(ke.__)("Name"),value:i,onChange:s}),Object(je.createElement)(_e.Flex,{className:"wp-block-template-part__placeholder-create-new__title-form-actions",justify:"flex-end"},Object(je.createElement)(_e.FlexItem,null,Object(je.createElement)(_e.Button,{variant:"secondary",onClick:l},Object(ke.__)("Cancel"))),Object(je.createElement)(_e.FlexItem,null,Object(je.createElement)(_e.Button,{variant:"primary",type:"submit",disabled:!i.length,"aria-disabled":!i.length},Object(ke.__)("Create")))))))}function Hb(e){let{setTitleStep:t,areaLabel:n,areaIcon:o}=e;return Object(je.useEffect)(()=>{t(!0)},[]),Object(je.createElement)(_e.Placeholder,{label:n,icon:o,instructions:Object(ke.sprintf)(Object(ke.__)("Creating your new %s…"),n.toLowerCase())})}const Ab=1,Fb=2;function Db(e){let{area:t,clientId:n,setAttributes:o,enableSelection:r,hasResolvedReplacements:a}=e;const{saveEntityRecord:l}=Object(Pe.useDispatch)(It.store),[c,i]=Object(je.useState)(Ab),{areaIcon:s,areaLabel:u}=Object(Pe.useSelect)(e=>{const n=e("core/editor").__experimentalGetDefaultTemplatePartAreas(),o=Object(Me.find)(n,{area:t}),r=Object(Me.find)(n,{area:"uncategorized"});return{areaIcon:(null==o?void 0:o.icon)||(null==r?void 0:r.icon),areaLabel:(null==o?void 0:o.label)||Object(ke.__)("Template Part")}},[t]),m=Object(je.useCallback)((async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(ke.__)("Untitled Template Part");const r={title:n,slug:Object(Me.kebabCase)(n),content:Object(Oe.serialize)(e),area:t},a=await l("postType","wp_template_part",r);o({slug:a.slug,theme:a.theme,area:void 0})}),[o,t]);return Object(je.createElement)(je.Fragment,null,c===Ab&&Object(je.createElement)(_e.Placeholder,{icon:s,label:u,instructions:r?Object(ke.sprintf)(Object(ke.__)("Choose an existing %s or create a new one."),u.toLowerCase()):Object(ke.sprintf)(Object(ke.__)("Create a new %s."),u.toLowerCase())},a?Object(je.createElement)(_e.Dropdown,{contentClassName:"wp-block-template-part__placeholder-preview-dropdown-content",position:"bottom right left",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return Object(je.createElement)(je.Fragment,null,r&&Object(je.createElement)(_e.Button,{variant:"primary",onClick:n,"aria-expanded":t},Object(ke.__)("Choose existing")),Object(je.createElement)(_e.Button,{variant:r?"tertiary":"primary",onClick:()=>i(Fb)},Object(ke.sprintf)(Object(ke.__)("New %s"),u.toLowerCase())))},renderContent:e=>{let{onClose:n}=e;return Object(je.createElement)(Lb,{setAttributes:o,onClose:n,area:t})}}):Object(je.createElement)(_e.Spinner,null)),c===Fb&&Object(je.createElement)(Vb,{area:t,areaLabel:u,areaIcon:s,onCreate:m,clientId:n,resetPlaceholder:()=>i(Ab)}))}function Gb(e){let{tagName:t,setAttributes:n,isEntityAvailable:o,templatePartId:r,defaultWrapper:a}=e;const[l,c]=Object(It.useEntityProp)("postType","wp_template_part","area",r),[i,s]=Object(It.useEntityProp)("postType","wp_template_part","title",r),{areaOptions:u}=Object(Pe.useSelect)(e=>({areaOptions:e("core/editor").__experimentalGetDefaultTemplatePartAreas().map(e=>{let{label:t,area:n}=e;return{label:t,value:n}})}),[]);return Object(je.createElement)(we.InspectorControls,{__experimentalGroup:"advanced"},o&&Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.TextControl,{label:Object(ke.__)("Title"),value:i,onChange:e=>{s(e)},onFocus:e=>e.target.select()}),Object(je.createElement)(_e.SelectControl,{label:Object(ke.__)("Area"),labelPosition:"top",options:u,value:l,onChange:c})),Object(je.createElement)(_e.SelectControl,{label:Object(ke.__)("HTML element"),options:[{label:Object(ke.sprintf)(Object(ke.__)("Default based on area (%s)"),`<${a}>`),value:""},{label:"<header>",value:"header"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<article>",value:"article"},{label:"<aside>",value:"aside"},{label:"<footer>",value:"footer"},{label:"<div>",value:"div"}],value:t||"",onChange:e=>n({tagName:e})}))}function Ub(e){let{postId:t,hasInnerBlocks:n,layout:o,tagName:r,blockProps:a,clientId:l}=e;const c=Object(Pe.useSelect)(e=>{var t;const{getSettings:n}=e(we.store);return null===(t=n())||void 0===t?void 0:t.supportsLayout},[]),i=Object(we.useSetting)("layout")||{},s=o&&o.inherit?i:o,[u,m,d]=Object(It.useEntityBlockEditor)("postType","wp_template_part",{id:t}),b=Object(we.useInnerBlocksProps)(a,{value:u,onInput:m,onChange:d,renderAppender:n?void 0:we.InnerBlocks.ButtonBlockAppender,__experimentalLayout:c?s:void 0});return Object(je.createElement)(we.__experimentalBlockContentOverlay,{clientId:l,tagName:r,wrapperProps:b})}var qb=n("G8mJ"),Wb=n("//kF"),$b=n("rvQu");const Zb=[{name:"header",icon:qb.a,title:Object(ke.__)("Header"),description:Object(ke.__)("The Header template defines a page area that typically contains a title, logo, and main navigation."),attributes:{area:"header"},scope:["inserter"]},{name:"footer",icon:Wb.a,title:Object(ke.__)("Footer"),description:Object(ke.__)("The Footer template defines a page area that typically contains site credits, social links, or any other combination of blocks."),attributes:{area:"footer"},scope:["inserter"]}];Zb.forEach(e=>{e.isActive||(e.isActive=(e,t)=>{const{area:n,theme:o,slug:r}=e;if(n)return n===t.area;if(!r)return!1;const a=Object(Pe.select)(It.store).getEntityRecord("postType","wp_template_part",`${o}//${r}`);return(null==a?void 0:a.area)===t.area})});var Kb=Zb;const Jb={apiVersion:2,name:"core/template-part",title:"Template Part",category:"theme",description:"Edit the different global regions of your site, like the header, footer, sidebar, or create your own.",textdomain:"default",attributes:{slug:{type:"string"},theme:{type:"string"},tagName:{type:"string"},area:{type:"string"}},supports:{align:!0,html:!1,reusable:!1},editorStyle:"wp-block-template-part-editor"},{name:Qb}=Jb,Yb={icon:Bb.a,__experimentalLabel:e=>{var t;let{slug:n,theme:o}=e;if(!n)return;const r=Object(Pe.select)(It.store).getEntityRecord("postType","wp_template_part",o+"//"+n);return r?Object(Me.startCase)((null===(t=r.title)||void 0===t?void 0:t.rendered)||r.slug):void 0},edit:function(e){let{attributes:t,setAttributes:n,clientId:o}=e;const{slug:r,theme:a,tagName:l,layout:c={}}=t,i=sc(a,r),[s,u]=Object(we.__experimentalUseNoRecursiveRenders)(i),{isResolved:m,innerBlocks:d,isMissing:b,defaultWrapper:p,area:g,enableSelection:h,hasResolvedReplacements:v}=Object(Pe.useSelect)(e=>{var n;const{getEditedEntityRecord:r,getEntityRecords:a,hasFinishedResolution:l}=e(It.store),{getBlocks:c}=e(we.store),s=["postType","wp_template_part",i],u=i?r(...s):null,m=(null==u?void 0:u.area)||t.area,d=["postType","wp_template_part",m&&"uncategorized"!==m&&{area:m}],b=a(...d),p=i?(null==b?void 0:b.length)>1:(null==b?void 0:b.length)>0,g=!!i&&l("getEditedEntityRecord",s),h=null===(n=e("core/editor").__experimentalGetDefaultTemplatePartAreas().find(e=>{let{area:t}=e;return t===m}))||void 0===n?void 0:n.area_tag;return{innerBlocks:c(o),isResolved:g,isMissing:g&&Object(Me.isEmpty)(u),defaultWrapper:h||"div",area:m,enableSelection:p,hasResolvedReplacements:l("getEntityRecords",d)}},[i,o]),O=Object(we.useBlockProps)(),j=!r,y=!j&&!b&&m,f=l||p;return 0===d.length&&(r&&!a||r&&b)?Object(je.createElement)(f,O,Object(je.createElement)(we.Warning,null,Object(ke.sprintf)(Object(ke.__)("Template part has been deleted or is unavailable: %s"),r))):y&&s?Object(je.createElement)(f,O,Object(je.createElement)(we.Warning,null,Object(ke.__)("Block cannot be rendered inside itself."))):Object(je.createElement)(u,null,Object(je.createElement)(Gb,{tagName:l,setAttributes:n,isEntityAvailable:y,templatePartId:i,defaultWrapper:p}),j&&Object(je.createElement)(f,O,Object(je.createElement)(Db,{area:t.area,clientId:o,setAttributes:n,enableSelection:h,hasResolvedReplacements:v})),y&&h&&Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(_e.ToolbarGroup,{className:"wp-block-template-part__block-control-group"},Object(je.createElement)(_e.Dropdown,{className:"wp-block-template-part__preview-dropdown-button",contentClassName:"wp-block-template-part__preview-dropdown-content",position:"bottom right left",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return Object(je.createElement)(_e.ToolbarButton,{"aria-expanded":t,onClick:n},Object(ke.__)("Replace"))},renderContent:e=>{let{onClose:t}=e;return Object(je.createElement)(Lb,{setAttributes:n,onClose:t,area:g,templatePartId:i})}}))),y&&Object(je.createElement)(Ub,{clientId:o,tagName:f,blockProps:O,postId:i,hasInnerBlocks:d.length>0,layout:c}),!j&&!m&&Object(je.createElement)(f,O,Object(je.createElement)(_e.Spinner,null)))}};Object(Lr.addFilter)("blocks.registerBlockType","core/template-part",(function(e,t){if("core/template-part"!==t)return e;if(!e.variations||!e.variations.length)return{...e,variations:Kb};if(e.variations){const t=(e,t)=>{const{area:n,theme:o,slug:r}=e;if(n)return n===t.area;if(!r)return!1;const a=Object(Pe.select)(It.store).getEntityRecord("postType","wp_template_part",`${o}//${r}`);return(null==a?void 0:a.area)===t.area},n=e.variations.map(e=>{return{...e,...!e.isActive&&{isActive:t},..."string"==typeof e.icon&&{icon:(n=e.icon,"header"===n?qb.a:"footer"===n?Wb.a:"sidebar"===n?$b.a:Bb.a)}};var n});return{...e,variations:n}}return e}));const Xb=["core/post-template","core/post-content"];Object(Lr.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromPostTemplates",(e,t,n,o)=>{let{getBlock:r,getBlockParentsByBlockName:a}=o;if("core/template-part"!==t.name)return e;for(const e of Xb){var l;if((null===(l=r(n))||void 0===l?void 0:l.name)===e||a(n,e).length)return!1}return!0});var ep=Object(je.createElement)(ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(je.createElement)(ye.Path,{stroke:"#1E1E1E",strokeWidth:"1.5",d:"M9 19.25h6M4 19.25h4M12 15.25h8M4 15.25h7"}),Object(je.createElement)(ye.Path,{d:"M8.994 10.103H6.08L5.417 12H4l2.846-8h1.383l2.845 8H9.657l-.663-1.897zm-.457-1.28l-.994-2.857-1.006 2.857h2z",fill:"#1E1E1E"}));const tp={apiVersion:2,name:"core/term-description",title:"Term Description",category:"theme",description:"Display the description of categories, tags and custom taxonomies when viewing an archive.",textdomain:"default",attributes:{textAlign:{type:"string"}},supports:{align:["wide","full"],html:!1,color:{link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalDefaultControls:{fontSize:!0}}},editorStyle:"wp-block-term-description-editor"},{name:np}=tp,op={icon:ep,edit:function(e){let{attributes:t,setAttributes:n,mergedStyle:o}=e;const{textAlign:r}=t,a=Object(we.useBlockProps)({className:tt()({["has-text-align-"+r]:r}),style:o});return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(we.AlignmentControl,{value:r,onChange:e=>{n({textAlign:e})}})),Object(je.createElement)("div",a,Object(je.createElement)("div",{className:"wp-block-term-description__placeholder"},Object(je.createElement)("span",null,Object(ke.__)("Term Description")))))}};var rp=n("NMb1"),ap=n.n(rp);var lp={to:[{type:"block",blocks:["core/columns"],transform:e=>{let{className:t,columns:n,content:o,width:r}=e;return Object(Oe.createBlock)("core/columns",{align:"wide"===r||"full"===r?r:void 0,className:t,columns:n},o.map(e=>{let{children:t}=e;return Object(Oe.createBlock)("core/column",{},[Object(Oe.createBlock)("core/paragraph",{content:t})])}))}}]};const cp={apiVersion:2,name:"core/text-columns",title:"Text Columns (deprecated)",icon:"columns",category:"design",description:"This block is deprecated. Please use the Columns block instead.",textdomain:"default",attributes:{content:{type:"array",source:"query",selector:"p",query:{children:{type:"string",source:"html"}},default:[{},{}]},columns:{type:"number",default:2},width:{type:"string"}},supports:{inserter:!1},editorStyle:"wp-block-text-columns-editor",style:"wp-block-text-columns"},{name:ip}=cp,sp={transforms:lp,getEditWrapperProps(e){const{width:t}=e;if("wide"===t||"full"===t)return{"data-align":t}},edit:function(e){let{attributes:t,setAttributes:n}=e;const{width:o,content:r,columns:a}=t;return ap()("The Text Columns block",{since:"5.3",alternative:"the Columns block"}),Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(we.BlockAlignmentToolbar,{value:o,onChange:e=>n({width:e}),controls:["center","wide","full"]})),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,null,Object(je.createElement)(_e.RangeControl,{label:Object(ke.__)("Columns"),value:a,onChange:e=>n({columns:e}),min:2,max:4,required:!0}))),Object(je.createElement)("div",Object(we.useBlockProps)({className:`align${o} columns-${a}`}),Object(Me.times)(a,e=>Object(je.createElement)("div",{className:"wp-block-column",key:"column-"+e},Object(je.createElement)(we.RichText,{tagName:"p",value:Object(Me.get)(r,[e,"children"]),onChange:t=>{n({content:[...r.slice(0,e),{children:t},...r.slice(e+1)]})},"aria-label":Object(ke.sprintf)(Object(ke.__)("Column %d text"),e+1),placeholder:Object(ke.__)("New Column")})))))},save:function(e){let{attributes:t}=e;const{width:n,content:o,columns:r}=t;return Object(je.createElement)("div",we.useBlockProps.save({className:`align${n} columns-${r}`}),Object(Me.times)(r,e=>Object(je.createElement)("div",{className:"wp-block-column",key:"column-"+e},Object(je.createElement)(we.RichText.Content,{tagName:"p",value:Object(Me.get)(o,[e,"children"])}))))}};var up=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"}));var mp=[{attributes:{content:{type:"string",source:"html",selector:"pre",default:"",__unstablePreserveWhiteSpace:!0,__experimentalRole:"content"},textAlign:{type:"string"}},supports:{anchor:!0,color:{gradients:!0,link:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},spacing:{padding:!0}},save(e){let{attributes:t}=e;const{textAlign:n,content:o}=t,r=tt()({["has-text-align-"+n]:n});return Object(je.createElement)("pre",we.useBlockProps.save({className:r}),Object(je.createElement)(we.RichText.Content,{value:o}))},migrate:at,isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}},{attributes:{content:{type:"string",source:"html",selector:"pre",default:""},textAlign:{type:"string"}},save(e){let{attributes:t}=e;const{textAlign:n,content:o}=t;return Object(je.createElement)(we.RichText.Content,{tagName:"pre",style:{textAlign:n},value:o})}}];var dp={from:[{type:"block",blocks:["core/paragraph"],transform:e=>Object(Oe.createBlock)("core/verse",e)}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>Object(Oe.createBlock)("core/paragraph",e)}]};const bp={apiVersion:2,name:"core/verse",title:"Verse",category:"text",description:"Insert poetry. Use special spacing formats. Or quote song lyrics.",keywords:["poetry","poem"],textdomain:"default",attributes:{content:{type:"string",source:"html",selector:"pre",default:"",__unstablePreserveWhiteSpace:!0,__experimentalRole:"content"},textAlign:{type:"string"}},supports:{anchor:!0,color:{gradients:!0,link:!0},typography:{fontSize:!0,__experimentalFontFamily:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0}},spacing:{padding:!0}},style:"wp-block-verse",editorStyle:"wp-block-verse-editor"},{name:pp}=bp,gp={icon:up,example:{attributes:{content:Object(ke.__)("WHAT was he doing, the great god Pan,\n\tDown in the reeds by the river?\nSpreading ruin and scattering ban,\nSplashing and paddling with hoofs of a goat,\nAnd breaking the golden lilies afloat\n With the dragon-fly on the river.")}},transforms:dp,deprecated:mp,merge:(e,t)=>({content:e.content+t.content}),edit:function(e){let{attributes:t,setAttributes:n,mergeBlocks:o,onRemove:r,style:a}=e;const{textAlign:l,content:c}=t,i=Object(we.useBlockProps)({className:tt()({["has-text-align-"+l]:l}),style:a});return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,null,Object(je.createElement)(we.AlignmentToolbar,{value:l,onChange:e=>{n({textAlign:e})}})),Object(je.createElement)(we.RichText,Object(mt.a)({tagName:"pre",identifier:"content",preserveWhiteSpace:!0,value:c,onChange:e=>{n({content:e})},"aria-label":Object(ke.__)("Verse text"),placeholder:Object(ke.__)("Write verse…"),onRemove:r,onMerge:o,textAlign:l},i,{__unstablePastePlainText:!0})))},save:function(e){let{attributes:t}=e;const{textAlign:n,content:o}=t,r=tt()({["has-text-align-"+n]:n});return Object(je.createElement)("pre",we.useBlockProps.save({className:r}),Object(je.createElement)(we.RichText.Content,{value:o}))}};var hp=Object(je.createElement)(ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(je.createElement)(ye.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"}));const vp=[{value:"auto",label:Object(ke.__)("Auto")},{value:"metadata",label:Object(ke.__)("Metadata")},{value:"none",label:Object(ke._x)("None","Preload value")}];var Op=e=>{let{setAttributes:t,attributes:n}=e;const{autoplay:o,controls:r,loop:a,muted:l,playsInline:c,preload:i}=n,s=Object(ke.__)("Autoplay may cause usability issues for some users."),u=je.Platform.select({web:Object(je.useCallback)(e=>e?s:null,[]),native:s}),m=Object(je.useMemo)(()=>{const e=e=>n=>{t({[e]:n})};return{autoplay:e("autoplay"),loop:e("loop"),muted:e("muted"),controls:e("controls"),playsInline:e("playsInline")}},[]),d=Object(je.useCallback)(e=>{t({preload:e})},[]);return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Autoplay"),onChange:m.autoplay,checked:o,help:u}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Loop"),onChange:m.loop,checked:a}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Muted"),onChange:m.muted,checked:l}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Playback controls"),onChange:m.controls,checked:r}),Object(je.createElement)(_e.ToggleControl,{label:Object(ke.__)("Play inline"),onChange:m.playsInline,checked:c}),Object(je.createElement)(_e.SelectControl,{label:Object(ke.__)("Preload"),value:i,onChange:d,options:vp,hideCancelButton:!0}))},jp=n("rH4q");const yp=["text/vtt"],fp="subtitles",_p=[{label:Object(ke.__)("Subtitles"),value:"subtitles"},{label:Object(ke.__)("Captions"),value:"captions"},{label:Object(ke.__)("Descriptions"),value:"descriptions"},{label:Object(ke.__)("Chapters"),value:"chapters"},{label:Object(ke.__)("Metadata"),value:"metadata"}],kp=Object(je.createElement)(_e.SVG,{width:"18",height:"14",viewBox:"0 0 18 14",role:"img",fill:"none"},Object(je.createElement)(_e.Rect,{x:"0.75",y:"0.75",width:"16.5",height:"12.5",rx:"1.25",stroke:"black",strokeWidth:"1.5",fill:"none"}),Object(je.createElement)(_e.Path,{d:"M3 7H15",stroke:"black",strokeWidth:"1.5"}),Object(je.createElement)(_e.Path,{d:"M3 10L15 10",stroke:"black",strokeWidth:"1.5"}));function Ep(e){let t,{tracks:n,onEditPress:o}=e;return t=0===n.length?Object(je.createElement)("p",{className:"block-library-video-tracks-editor__tracks-informative-message"},Object(ke.__)("Tracks can be subtitles, captions, chapters, or descriptions. They help make your content more accessible to a wider range of users.")):n.map((e,t)=>Object(je.createElement)("div",{key:t,className:"block-library-video-tracks-editor__track-list-track"},Object(je.createElement)("span",null,e.label," "),Object(je.createElement)(_e.Button,{variant:"tertiary",onClick:()=>o(t),"aria-label":Object(ke.sprintf)(Object(ke.__)("Edit %s"),e.label)},Object(ke.__)("Edit")))),Object(je.createElement)(_e.MenuGroup,{label:Object(ke.__)("Text tracks"),className:"block-library-video-tracks-editor__track-list"},t)}function Cp(e){let{track:t,onChange:n,onClose:o,onRemove:r}=e;const{src:a="",label:l="",srcLang:c="",kind:i=fp}=t,s=a.startsWith("blob:")?"":Object(Jo.getFilename)(a)||"";return Object(je.createElement)(_e.NavigableMenu,null,Object(je.createElement)("div",{className:"block-library-video-tracks-editor__single-track-editor"},Object(je.createElement)("span",{className:"block-library-video-tracks-editor__single-track-editor-edit-track-label"},Object(ke.__)("Edit track")),Object(je.createElement)("span",null,Object(ke.__)("File"),": ",Object(je.createElement)("b",null,s)),Object(je.createElement)("div",{className:"block-library-video-tracks-editor__single-track-editor-label-language"},Object(je.createElement)(_e.TextControl,{autoFocus:!0,onChange:e=>n({...t,label:e}),label:Object(ke.__)("Label"),value:l,help:Object(ke.__)("Title of track")}),Object(je.createElement)(_e.TextControl,{onChange:e=>n({...t,srcLang:e}),label:Object(ke.__)("Source language"),value:c,help:Object(ke.__)("Language tag (en, fr, etc.)")})),Object(je.createElement)(_e.SelectControl,{className:"block-library-video-tracks-editor__single-track-editor-kind-select",options:_p,value:i,label:Object(ke.__)("Kind"),onChange:e=>{n({...t,kind:e})}}),Object(je.createElement)("div",{className:"block-library-video-tracks-editor__single-track-editor-buttons-container"},Object(je.createElement)(_e.Button,{variant:"secondary",onClick:()=>{const e={};let r=!1;""===l&&(e.label=Object(ke.__)("English"),r=!0),""===c&&(e.srcLang="en",r=!0),void 0===t.kind&&(e.kind=fp,r=!0),r&&n({...t,...e}),o()}},Object(ke.__)("Close")),Object(je.createElement)(_e.Button,{isDestructive:!0,variant:"link",onClick:r},Object(ke.__)("Remove track")))))}function xp(e){let{tracks:t=[],onChange:n}=e;const o=Object(Pe.useSelect)(e=>e(we.store).getSettings().mediaUpload,[]),[r,a]=Object(je.useState)(null);return o?Object(je.createElement)(_e.Dropdown,{contentClassName:"block-library-video-tracks-editor",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return Object(je.createElement)(_e.ToolbarButton,{label:Object(ke.__)("Text tracks"),showTooltip:!0,"aria-expanded":t,"aria-haspopup":"true",onClick:n,icon:kp})},renderContent:e=>{let{}=e;return null!==r?Object(je.createElement)(Cp,{track:t[r],onChange:e=>{const o=[...t];o[r]=e,n(o)},onClose:()=>a(null),onRemove:()=>{n(t.filter((e,t)=>t!==r)),a(null)}}):Object(je.createElement)(je.Fragment,null,Object(je.createElement)(_e.NavigableMenu,null,Object(je.createElement)(Ep,{tracks:t,onEditPress:a}),Object(je.createElement)(_e.MenuGroup,{className:"block-library-video-tracks-editor__add-tracks-container",label:Object(ke.__)("Add tracks")},Object(je.createElement)(we.MediaUpload,{onSelect:e=>{let{url:o}=e;const r=t.length;n([...t,{src:o}]),a(r)},allowedTypes:yp,render:e=>{let{open:t}=e;return Object(je.createElement)(_e.MenuItem,{icon:jp.a,onClick:t},Object(ke.__)("Open Media Library"))}}),Object(je.createElement)(we.MediaUploadCheck,null,Object(je.createElement)(_e.FormFileUpload,{onChange:e=>{const r=e.target.files,l=t.length;o({allowedTypes:yp,filesList:r,onFileChange:e=>{let[{url:o}]=e;const r=[...t];r[l]||(r[l]={}),r[l]={...t[l],src:o},n(r),a(l)}})},accept:".vtt,text/vtt",render:e=>{let{openFileDialog:t}=e;return Object(je.createElement)(_e.MenuItem,{icon:xa.a,onClick:()=>{t()}},Object(ke.__)("Upload"))}})))))}}):null}function Sp(e){let{tracks:t=[]}=e;return t.map(e=>Object(je.createElement)("track",Object(mt.a)({key:e.src},e)))}const Bp=["video"],Tp=["image"];var Np=Object(_e.withNotices)((function e(t){let{isSelected:n,noticeUI:o,attributes:r,className:a,setAttributes:l,insertBlocksAfter:c,onReplace:i,noticeOperations:s}=t;const u=Object(nt.useInstanceId)(e),m=Object(je.useRef)(),d=Object(je.useRef)(),{id:b,caption:p,controls:g,poster:h,src:v,tracks:O}=r,j=!b&&Object(ze.isBlobURL)(v),y=Object(Pe.useSelect)(e=>e(we.store).getSettings().mediaUpload);function f(e){var t,n;e&&e.url?l({src:e.url,id:e.id,poster:(null===(t=e.image)||void 0===t?void 0:t.src)!==e.icon?null===(n=e.image)||void 0===n?void 0:n.src:void 0}):l({src:void 0,id:void 0,poster:void 0})}function _(e){if(e!==v){const t=Ge({attributes:{url:e}});if(void 0!==t)return void i(t);l({src:e,id:void 0,poster:void 0})}}function k(e){s.removeAllNotices(),s.createErrorNotice(e)}Object(je.useEffect)(()=>{if(!b&&Object(ze.isBlobURL)(v)){const e=Object(ze.getBlobByURL)(v);e&&y({filesList:[e],onFileChange:e=>{let[{url:t}]=e;l({src:t})},onError:e=>{s.createErrorNotice(e)},allowedTypes:Bp})}},[]),Object(je.useEffect)(()=>{m.current&&m.current.load()},[h]);const w=tt()(a,{"is-transient":j}),E=Object(we.useBlockProps)({className:w});if(!v)return Object(je.createElement)("div",E,Object(je.createElement)(we.MediaPlaceholder,{icon:Object(je.createElement)(we.BlockIcon,{icon:hp}),onSelect:f,onSelectURL:_,accept:"video/*",allowedTypes:Bp,value:r,notices:o,onError:k}));const C="video-block__poster-image-description-"+u;return Object(je.createElement)(je.Fragment,null,Object(je.createElement)(we.BlockControls,{group:"block"},Object(je.createElement)(xp,{tracks:O,onChange:e=>{l({tracks:e})}})),Object(je.createElement)(we.BlockControls,{group:"other"},Object(je.createElement)(we.MediaReplaceFlow,{mediaId:b,mediaURL:v,allowedTypes:Bp,accept:"video/*",onSelect:f,onSelectURL:_,onError:k})),Object(je.createElement)(we.InspectorControls,null,Object(je.createElement)(_e.PanelBody,{title:Object(ke.__)("Video settings")},Object(je.createElement)(Op,{setAttributes:l,attributes:r}),Object(je.createElement)(we.MediaUploadCheck,null,Object(je.createElement)(_e.BaseControl,{className:"editor-video-poster-control"},Object(je.createElement)(_e.BaseControl.VisualLabel,null,Object(ke.__)("Poster image")),Object(je.createElement)(we.MediaUpload,{title:Object(ke.__)("Select poster image"),onSelect:function(e){l({poster:e.url})},allowedTypes:Tp,render:e=>{let{open:t}=e;return Object(je.createElement)(_e.Button,{variant:"primary",onClick:t,ref:d,"aria-describedby":C},h?Object(ke.__)("Replace"):Object(ke.__)("Select"))}}),Object(je.createElement)("p",{id:C,hidden:!0},h?Object(ke.sprintf)(Object(ke.__)("The current poster image url is %s"),h):Object(ke.__)("There is no poster image currently selected")),!!h&&Object(je.createElement)(_e.Button,{onClick:function(){l({poster:void 0}),d.current.focus()},variant:"tertiary"},Object(ke.__)("Remove")))))),Object(je.createElement)("figure",E,Object(je.createElement)(_e.Disabled,{isDisabled:!n},Object(je.createElement)("video",{controls:g,poster:h,src:v,ref:m},Object(je.createElement)(Sp,{tracks:O}))),j&&Object(je.createElement)(_e.Spinner,null),(!we.RichText.isEmpty(p)||n)&&Object(je.createElement)(we.RichText,{tagName:"figcaption","aria-label":Object(ke.__)("Video caption text"),placeholder:Object(ke.__)("Add caption"),value:p,onChange:e=>l({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>c(Object(Oe.createBlock)("core/paragraph"))})))}));var zp={from:[{type:"files",isMatch:e=>1===e.length&&0===e[0].type.indexOf("video/"),transform(e){const t=e[0];return Object(Oe.createBlock)("core/video",{src:Object(ze.createBlobURL)(t)})}},{type:"shortcode",tag:"video",attributes:{src:{type:"string",shortcode:e=>{let{named:{src:t,mp4:n,m4v:o,webm:r,ogv:a,flv:l}}=e;return t||n||o||r||a||l}},poster:{type:"string",shortcode:e=>{let{named:{poster:t}}=e;return t}},loop:{type:"string",shortcode:e=>{let{named:{loop:t}}=e;return t}},autoplay:{type:"string",shortcode:e=>{let{named:{autoplay:t}}=e;return t}},preload:{type:"string",shortcode:e=>{let{named:{preload:t}}=e;return t}}}}]};const Pp={apiVersion:2,name:"core/video",title:"Video",category:"media",description:"Embed a video from your media library or upload a new one.",keywords:["movie"],textdomain:"default",attributes:{autoplay:{type:"boolean",source:"attribute",selector:"video",attribute:"autoplay"},caption:{type:"string",source:"html",selector:"figcaption"},controls:{type:"boolean",source:"attribute",selector:"video",attribute:"controls",default:!0},id:{type:"number"},loop:{type:"boolean",source:"attribute",selector:"video",attribute:"loop"},muted:{type:"boolean",source:"attribute",selector:"video",attribute:"muted"},poster:{type:"string",source:"attribute",selector:"video",attribute:"poster"},preload:{type:"string",source:"attribute",selector:"video",attribute:"preload",default:"metadata"},src:{type:"string",source:"attribute",selector:"video",attribute:"src"},playsInline:{type:"boolean",source:"attribute",selector:"video",attribute:"playsinline"},tracks:{type:"array",items:{type:"object"},default:[]}},supports:{anchor:!0,align:!0},editorStyle:"wp-block-video-editor",style:"wp-block-video"},{name:Ip}=Pp,Mp={icon:hp,example:{attributes:{src:"https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm",caption:Object(ke.__)("Wood thrush singing in Central Park, NYC.")}},transforms:zp,edit:Np,save:function(e){let{attributes:t}=e;const{autoplay:n,caption:o,controls:r,loop:a,muted:l,poster:c,preload:i,src:s,playsInline:u,tracks:m}=t;return Object(je.createElement)("figure",we.useBlockProps.save(),s&&Object(je.createElement)("video",{autoPlay:n,controls:r,loop:a,muted:l,poster:c,preload:"metadata"!==i?i:void 0,src:s,playsInline:u},Object(je.createElement)(Sp,{tracks:m})),!we.RichText.isEmpty(o)&&Object(je.createElement)(we.RichText.Content,{tagName:"figcaption",value:o}))}},Rp=e=>{if(!e)return;const{metadata:t,settings:n,name:o}=e;Object(Oe.registerBlockType)({name:o,...t},n)},Lp=()=>[I,y,O,h,k,X,o,r,a,l,c,i,window.wp&&window.wp.oldEditor?s:null,u,m,d,b,p,g,v,j,f,_,E,C,x,N,P,z,q,W,ee,te,ne,oe,re,ie,se,ue,me,de,ge,he,ve,S,B,T,ae,ce,le,$,be,U,H,A,L,M,V,G,F,D,Z,K,J,Q,R,w,pe,Y],Vp=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lp();e.forEach(Rp),Object(Oe.setDefaultBlockName)(Wi),window.wp&&window.wp.oldEditor&&Object(Oe.setFreeformContentHandlerName)(Zt),Object(Oe.setUnregisteredTypeHandlerName)(Gl),Object(Oe.setGroupingBlockName)(Jr)},Hp=void 0},K9lf:function(e,t){e.exports=window.wp.compose},KEfo:function(e,t){e.exports=window.wp.viewport},Mmq9:function(e,t){e.exports=window.wp.url},Mp0b:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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=a},NMb1:function(e,t){e.exports=window.wp.deprecated},NTP4:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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=a},OE6V:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"}));t.a=a},OzlF:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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=a},RMJe:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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=a},RxS6:function(e,t){e.exports=window.wp.keycodes},TSYQ:function(e,t,n){var o;
+*/!function(){"use strict";var o=function(){function e(){}function t(e,t){for(var n=t.length,o=0;o<n;++o)r(e,t[o])}e.prototype=Object.create(null);var n={}.hasOwnProperty;var o=/\s+/;function r(e,r){if(r){var a=typeof r;"string"===a?function(e,t){for(var n=t.split(o),r=n.length,a=0;a<r;++a)e[n[a]]=!0}(e,r):Array.isArray(r)?t(e,r):"object"===a?function(e,t){if(t.toString===Object.prototype.toString)for(var o in t)n.call(t,o)&&(e[o]=!!t[o]);else e[t.toString()]=!0}(e,r):"number"===a&&function(e,t){e[t]=!0}(e,r)}}return function(){for(var n=arguments.length,o=Array(n),r=0;r<n;r++)o[r]=arguments[r];var a=new e;t(a,o);var l=[];for(var i in a)a[i]&&l.push(i);return l.join(" ")}}();e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},4403:function(e,t){var n;
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
-*/!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var a=typeof o;if("string"===a||"number"===a)e.push(o);else if(Array.isArray(o)){if(o.length){var l=r.apply(null,o);l&&e.push(l)}}else if("object"===a)if(o.toString===Object.prototype.toString)for(var c in o)n.call(o,c)&&o[c]&&e.push(c);else e.push(o.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(o=function(){return r}.apply(t,[]))||(e.exports=o)}()},Tqx9:function(e,t){e.exports=window.wp.primitives},UuzZ:function(e,t){e.exports=window.wp.autop},YLtl:function(e,t){e.exports=window.lodash},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 a={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,l,c=o[this.toHex()];if(c)return c;if(null==t?void 0:t.closest){var i=this.toRgb(),s=1/0,u="black";if(!a.length)for(var m in n)a[m]=new e(n[m]).toRgb();for(var d in n){var b=(r=i,l=a[d],Math.pow(r.r-l.r,2)+Math.pow(r.g-l.g,2)+Math.pow(r.b-l.b,2));b<s&&(s=b,u=d)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}},axFQ:function(e,t){e.exports=window.wp.blockEditor},b2RC:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=a},bWcr:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.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"}));t.a=a},btIw:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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=a},cGtP:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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=a},diJD:function(e,t){e.exports=window.wp.reusableBlocks},fHnH:function(e,t,n){"use strict";n.d(t,"a",(function(){return B})),n.d(t,"b",(function(){return N}));var o={grad:.9,turn:360,rad:360/(2*Math.PI)},r=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},a=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},c=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},i=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:a(e.r),g:a(e.g),b:a(e.b),a:a(e.a,3)}},u=/^#([0-9a-f]{3,8})$/i,m=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},d=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,a=Math.max(t,n,o),l=a-Math.min(t,n,o),c=l?a===t?(n-o)/l:a===n?2+(o-t)/l:4+(t-n)/l:0;return{h:60*(c<0?c+6:c),s:a?l/a*100:0,v:a/255*100,a:r}},b=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var a=Math.floor(t),l=o*(1-n),c=o*(1-(t-a)*n),i=o*(1-(1-t+a)*n),s=a%6;return{r:255*[o,c,l,l,i,o][s],g:255*[i,o,o,c,l,l][s],b:255*[l,l,i,o,o,c][s],a:r}},p=function(e){return{h:c(e.h),s:l(e.s,0,100),l:l(e.l,0,100),a:l(e.a)}},g=function(e){return{h:a(e.h),s:a(e.s),l:a(e.l),a:a(e.a,3)}},h=function(e){return b((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},v=function(e){return{h:(t=d(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,j=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,f=/^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?a(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?a(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=y.exec(e)||f.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:i({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)||j.exec(e);if(!t)return null;var n,r,a=p({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(a)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,a=e.a,l=void 0===a?1:a;return r(t)&&r(n)&&r(o)?i({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,a=e.a,l=void 0===a?1:a;if(!r(t)||!r(n)||!r(o))return null;var c=p({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return h(c)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,a=e.a,i=void 0===a?1:a;if(!r(t)||!r(n)||!r(o))return null;var s=function(e){return{h:c(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(i)});return b(s)},"hsv"]]},k=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},w=function(e){return"string"==typeof e?k(e.trim(),_.string):"object"==typeof e&&null!==e?k(e,_.object):[null,void 0]},E=function(e,t){var n=v(e);return{h:n.h,s:l(n.s+100*t,0,100),l:n.l,a:n.a}},C=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},x=function(e,t){var n=v(e);return{h:n.h,s:n.s,l:l(n.l+100*t,0,100),a:n.a}},S=function(){function e(e){this.parsed=w(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return a(C(this.rgba),2)},e.prototype.isDark=function(){return C(this.rgba)<.5},e.prototype.isLight=function(){return C(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=s(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?m(a(255*r)):"","#"+m(t)+m(n)+m(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 g(v(this.rgba))},e.prototype.toHslString=function(){return t=(e=g(v(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=d(this.rgba),{h:a(e.h),s:a(e.s),v:a(e.v),a:a(e.a,3)};var e},e.prototype.invert=function(){return B({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),B(E(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),B(E(this.rgba,-e))},e.prototype.grayscale=function(){return B(E(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),B(x(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),B(x(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?B({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):a(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=v(this.rgba);return"number"==typeof e?B({h:e,s:t.s,l:t.l,a:t.a}):a(t.h)},e.prototype.isEqual=function(e){return this.toHex()===B(e).toHex()},e}(),B=function(e){return e instanceof S?e:new S(e)},T=[],N=function(e){e.forEach((function(e){T.indexOf(e)<0&&(e(S,_),T.push(e))}))}},fPbg:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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=a},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 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})}},jZUy:function(e,t){e.exports=window.wp.coreData},l3Sj:function(e,t){e.exports=window.wp.i18n},mi6C:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)(r.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"}));t.a=a},oMoS:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=Object(o.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(r.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"}));t.a=a},onLe:function(e,t){e.exports=window.wp.notices},plpT:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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=a},qRz9:function(e,t){e.exports=window.wp.richText},rH4q:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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=a},rmEH:function(e,t){e.exports=window.wp.htmlEntities},rvQu:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));t.a=a},"tI+e":function(e,t){e.exports=window.wp.components},u6za:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=Object(o.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(r.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"}));t.a=a},w95h:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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=a},wx14:function(e,t,n){"use strict";function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return o}))},wy2R:function(e,t){e.exports=window.moment},xTGt:function(e,t){e.exports=window.wp.blob},ziDm:function(e,t,n){"use strict";var o=n("GRId"),r=n("Tqx9");const a=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=a}});
\ No newline at end of file
+*/!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var l=r.apply(null,n);l&&e.push(l)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var i in n)o.call(n,i)&&n[i]&&e.push(i);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},5027:function(e){
+/*! Fast Average Color | © 2019 Denis Seleznev | MIT License | https://github.com/hcodes/fast-average-color/ */
+e.exports=function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function n(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}function o(e,t){return r(e)||a(e,t)||l()}function r(e){if(Array.isArray(e))return e}function a(e,t){var n=[],o=!0,r=!1,a=void 0;try{for(var l,i=e[Symbol.iterator]();!(o=(l=i.next()).done)&&(n.push(l.value),!t||n.length!==t);o=!0);}catch(e){r=!0,a=e}finally{try{o||null==i.return||i.return()}finally{if(r)throw a}}return n}function l(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}return function(){function t(){e(this,t)}return n(t,[{key:"getColorAsync",value:function(e,t,n){e.complete?t.call(e,this.getColor(e,n),n&&n.data):this._bindImageEvents(e,t,n)}},{key:"getColor",value:function(e,t){t=t||{};var n=this._getDefaultColor(t),o=this._getOriginalSize(e),r=this._prepareSizeAndPosition(o,t),a=null,l=n;if(!(r.srcWidth&&r.srcHeight&&r.destWidth&&r.destHeight))return this._prepareResult(n,new Error("FastAverageColor: Incorrect sizes."));if(!this._ctx&&(this._canvas=this._makeCanvas(),this._ctx=this._canvas.getContext&&this._canvas.getContext("2d"),!this._ctx))return this._prepareResult(n,new Error("FastAverageColor: Canvas Context 2D is not supported in this browser."));this._canvas.width=r.destWidth,this._canvas.height=r.destHeight;try{this._ctx.clearRect(0,0,r.destWidth,r.destHeight),this._ctx.drawImage(e,r.srcLeft,r.srcTop,r.srcWidth,r.srcHeight,0,0,r.destWidth,r.destHeight);var i=this._ctx.getImageData(0,0,r.destWidth,r.destHeight).data;l=this.getColorFromArray4(i,t)}catch(e){a=e}return this._prepareResult(l,a)}},{key:"getColorFromArray4",value:function(e,t){t=t||{};var n=4,o=e.length;if(o<n)return this._getDefaultColor(t);var r=o-o%n,a=(t.step||1)*n,l="_"+(t.algorithm||"sqrt")+"Algorithm";if("function"!=typeof this[l])throw new Error("FastAverageColor: ".concat(t.algorithm," is unknown algorithm."));return this[l](e,r,a)}},{key:"destroy",value:function(){delete this._canvas,delete this._ctx}},{key:"_getDefaultColor",value:function(e){return this._getOption(e,"defaultColor",[255,255,255,255])}},{key:"_getOption",value:function(e,t,n){return void 0===e[t]?n:e[t]}},{key:"_prepareSizeAndPosition",value:function(e,t){var n=this._getOption(t,"left",0),o=this._getOption(t,"top",0),r=this._getOption(t,"width",e.width),a=this._getOption(t,"height",e.height),l=r,i=a;if("precision"===t.mode)return{srcLeft:n,srcTop:o,srcWidth:r,srcHeight:a,destWidth:l,destHeight:i};var s,c=100,u=10;return r>a?(s=r/a,l=c,i=Math.round(l/s)):(s=a/r,i=c,l=Math.round(i/s)),(l>r||i>a||l<u||i<u)&&(l=r,i=a),{srcLeft:n,srcTop:o,srcWidth:r,srcHeight:a,destWidth:l,destHeight:i}}},{key:"_simpleAlgorithm",value:function(e,t,n){for(var o=0,r=0,a=0,l=0,i=0,s=0;s<t;s+=n){var c=e[s+3];o+=e[s]*c,r+=e[s+1]*c,a+=e[s+2]*c,l+=c,i++}return l?[Math.round(o/l),Math.round(r/l),Math.round(a/l),Math.round(l/i)]:[0,0,0,0]}},{key:"_sqrtAlgorithm",value:function(e,t,n){for(var o=0,r=0,a=0,l=0,i=0,s=0;s<t;s+=n){var c=e[s],u=e[s+1],m=e[s+2],d=e[s+3];o+=c*c*d,r+=u*u*d,a+=m*m*d,l+=d,i++}return l?[Math.round(Math.sqrt(o/l)),Math.round(Math.sqrt(r/l)),Math.round(Math.sqrt(a/l)),Math.round(l/i)]:[0,0,0,0]}},{key:"_dominantAlgorithm",value:function(e,t,n){for(var r={},a=24,l=0;l<t;l+=n){var i=e[l],s=e[l+1],c=e[l+2],u=e[l+3],m=Math.round(i/a)+","+Math.round(s/a)+","+Math.round(c/a);r[m]?r[m]=[r[m][0]+i*u,r[m][1]+s*u,r[m][2]+c*u,r[m][3]+u,r[m][4]+1]:r[m]=[i*u,s*u,c*u,u,1]}var d=Object.keys(r).map((function(e){return r[e]})).sort((function(e,t){var n=e[4],o=t[4];return n>o?-1:n===o?0:1})),p=o(d[0],5),g=p[0],h=p[1],v=p[2],b=p[3],y=p[4];return b?[Math.round(g/b),Math.round(h/b),Math.round(v/b),Math.round(b/y)]:[0,0,0,0]}},{key:"_bindImageEvents",value:function(e,t,n){var o=this,r=(n=n||{})&&n.data,a=this._getDefaultColor(n),l=function(){c(),t.call(e,o.getColor(e,n),r)},i=function(){c(),t.call(e,o._prepareResult(a,new Error("Image error")),r)},s=function(){c(),t.call(e,o._prepareResult(a,new Error("Image abort")),r)},c=function(){e.removeEventListener("load",l),e.removeEventListener("error",i),e.removeEventListener("abort",s)};e.addEventListener("load",l),e.addEventListener("error",i),e.addEventListener("abort",s)}},{key:"_prepareResult",value:function(e,t){var n=e.slice(0,3),o=[].concat(n,e[3]/255),r=this._isDark(e);return{error:t,value:e,rgb:"rgb("+n.join(",")+")",rgba:"rgba("+o.join(",")+")",hex:this._arrayToHex(n),hexa:this._arrayToHex(e),isDark:r,isLight:!r}}},{key:"_getOriginalSize",value:function(e){return e instanceof HTMLImageElement?{width:e.naturalWidth,height:e.naturalHeight}:e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:{width:e.width,height:e.height}}},{key:"_toHex",value:function(e){var t=e.toString(16);return 1===t.length?"0"+t:t}},{key:"_arrayToHex",value:function(e){return"#"+e.map(this._toHex).join("")}},{key:"_isDark",value:function(e){return(299*e[0]+587*e[1]+114*e[2])/1e3<128}},{key:"_makeCanvas",value:function(){return"undefined"==typeof window?new OffscreenCanvas(1,1):document.createElement("canvas")}}]),t}()}()},9756:function(e){e.exports=function(e,t){var n,o,r=0;function a(){var a,l,i=n,s=arguments.length;e:for(;i;){if(i.args.length===arguments.length){for(l=0;l<s;l++)if(i.args[l]!==arguments[l]){i=i.next;continue e}return i!==n&&(i===o&&(o=i.prev),i.prev.next=i.next,i.next&&(i.next.prev=i.prev),i.next=n,i.prev=null,n.prev=i,n=i),i.val}i=i.next}for(a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return i={args:a,val:e.apply(null,a)},n?(n.prev=i,i.next=n):o=i,r===t.maxSize?(o=o.prev).next=null:r++,n=i,i.val}return t=t||{},a.clear=function(){n=null,o=null,r=0},a}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var a=t[o]={exports:{}};return e[o].call(a.exports,a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{__experimentalGetCoreBlocks:function(){return Tv},__experimentalRegisterExperimentalCoreBlocks:function(){return zv},registerCoreBlocks:function(){return Nv}});var e={};n.r(e),n.d(e,{metadata:function(){return Se},name:function(){return Be},settings:function(){return Te}});var t={};n.r(t),n.d(t,{metadata:function(){return Je},name:function(){return Ye},settings:function(){return Xe}});var r={};n.r(r),n.d(r,{metadata:function(){return kt},name:function(){return wt},settings:function(){return Et}});var a={};n.r(a),n.d(a,{metadata:function(){return Rt},name:function(){return Lt},settings:function(){return Vt}});var l={};n.r(l),n.d(l,{metadata:function(){return Ut},name:function(){return Ot},settings:function(){return qt}});var i={};n.r(i),n.d(i,{metadata:function(){return jt},name:function(){return Zt},settings:function(){return Kt}});var s={};n.r(s),n.d(s,{metadata:function(){return Xt},name:function(){return en},settings:function(){return tn}});var c={};n.r(c),n.d(c,{metadata:function(){return ln},name:function(){return sn},settings:function(){return cn}});var u={};n.r(u),n.d(u,{metadata:function(){return gn},name:function(){return hn},settings:function(){return vn}});var m={};n.r(m),n.d(m,{metadata:function(){return Mn},name:function(){return Rn},settings:function(){return Ln}});var d={};n.r(d),n.d(d,{metadata:function(){return Uo},name:function(){return Oo},settings:function(){return qo}});var p={};n.r(p),n.d(p,{metadata:function(){return Sr},name:function(){return Br},settings:function(){return Tr}});var g={};n.r(g),n.d(g,{metadata:function(){return Or},name:function(){return qr},settings:function(){return $r}});var h={};n.r(h),n.d(h,{metadata:function(){return Ja},name:function(){return Ya},settings:function(){return Xa}});var v={};n.r(v),n.d(v,{metadata:function(){return sl},name:function(){return cl},settings:function(){return ul}});var b={};n.r(b),n.d(b,{metadata:function(){return Pl},name:function(){return Il},settings:function(){return Ml}});var y={};n.r(y),n.d(y,{metadata:function(){return Vl},name:function(){return Hl},settings:function(){return Al}});var f={};n.r(f),n.d(f,{metadata:function(){return Xl},name:function(){return ei},settings:function(){return ti}});var _={};n.r(_),n.d(_,{metadata:function(){return oi},name:function(){return ri},settings:function(){return ai}});var k={};n.r(k),n.d(k,{metadata:function(){return gi},name:function(){return hi},settings:function(){return vi}});var w={};n.r(w),n.d(w,{metadata:function(){return Pi},name:function(){return Ii},settings:function(){return Mi}});var E={};n.r(E),n.d(E,{metadata:function(){return Li},name:function(){return Vi},settings:function(){return Hi}});var C={};n.r(C),n.d(C,{metadata:function(){return os},name:function(){return rs},settings:function(){return as}});var x={};n.r(x),n.d(x,{metadata:function(){return cs},name:function(){return us},settings:function(){return ms}});var S={};n.r(S),n.d(S,{metadata:function(){return hs},name:function(){return vs},settings:function(){return bs}});var B={};n.r(B),n.d(B,{metadata:function(){return sc},name:function(){return cc},settings:function(){return uc}});var T={};n.r(T),n.d(T,{metadata:function(){return Sc},name:function(){return Bc},settings:function(){return Tc}});var N={};n.r(N),n.d(N,{metadata:function(){return Ac},name:function(){return Fc},settings:function(){return Dc}});var z={};n.r(z),n.d(z,{metadata:function(){return Oc},name:function(){return qc},settings:function(){return $c}});var P={};n.r(P),n.d(P,{metadata:function(){return jc},name:function(){return Zc},settings:function(){return Kc}});var I={};n.r(I),n.d(I,{metadata:function(){return ou},name:function(){return ru},settings:function(){return au}});var M={};n.r(M),n.d(M,{metadata:function(){return yu},name:function(){return fu},settings:function(){return _u}});var R={};n.r(R),n.d(R,{metadata:function(){return Eu},name:function(){return Cu},settings:function(){return xu}});var L={};n.r(L),n.d(L,{metadata:function(){return Tu},name:function(){return Nu},settings:function(){return zu}});var V={};n.r(V),n.d(V,{metadata:function(){return Au},name:function(){return Fu},settings:function(){return Du}});var H={};n.r(H),n.d(H,{metadata:function(){return Ou},name:function(){return qu},settings:function(){return $u}});var A={};n.r(A),n.d(A,{metadata:function(){return ju},name:function(){return Zu},settings:function(){return Ku}});var F={};n.r(F),n.d(F,{metadata:function(){return am},name:function(){return lm},settings:function(){return im}});var D={};n.r(D),n.d(D,{metadata:function(){return dm},name:function(){return pm},settings:function(){return gm}});var G={};n.r(G),n.d(G,{metadata:function(){return fm},name:function(){return _m},settings:function(){return km}});var U={};n.r(U),n.d(U,{metadata:function(){return xm},name:function(){return Sm},settings:function(){return Bm}});var O={};n.r(O),n.d(O,{metadata:function(){return Nm},name:function(){return zm},settings:function(){return Pm}});var q={};n.r(q),n.d(q,{metadata:function(){return Lm},name:function(){return Vm},settings:function(){return Hm}});var $={};n.r($),n.d($,{metadata:function(){return jm},name:function(){return Zm},settings:function(){return Km}});var W={};n.r(W),n.d(W,{metadata:function(){return bd},name:function(){return yd},settings:function(){return fd}});var j={};n.r(j),n.d(j,{metadata:function(){return Cd},name:function(){return xd},settings:function(){return Sd}});var Z={};n.r(Z),n.d(Z,{metadata:function(){return Nd},name:function(){return zd},settings:function(){return Pd}});var K={};n.r(K),n.d(K,{metadata:function(){return Rd},name:function(){return Ld},settings:function(){return Vd}});var Q={};n.r(Q),n.d(Q,{metadata:function(){return Fd},name:function(){return Dd},settings:function(){return Gd}});var J={};n.r(J),n.d(J,{metadata:function(){return jd},name:function(){return Zd},settings:function(){return Kd}});var Y={};n.r(Y),n.d(Y,{metadata:function(){return op},name:function(){return rp},settings:function(){return ap}});var X={};n.r(X),n.d(X,{metadata:function(){return cp},name:function(){return up},settings:function(){return mp}});var ee={};n.r(ee),n.d(ee,{metadata:function(){return pp},name:function(){return gp},settings:function(){return hp}});var te={};n.r(te),n.d(te,{metadata:function(){return Cp},name:function(){return xp},settings:function(){return Sp}});var ne={};n.r(ne),n.d(ne,{metadata:function(){return Pp},name:function(){return Ip},settings:function(){return Mp}});var oe={};n.r(oe),n.d(oe,{metadata:function(){return Hp},name:function(){return Ap},settings:function(){return Fp}});var re={};n.r(re),n.d(re,{metadata:function(){return qp},name:function(){return $p},settings:function(){return Wp}});var ae={};n.r(ae),n.d(ae,{metadata:function(){return Kp},name:function(){return Qp},settings:function(){return Jp}});var le={};n.r(le),n.d(le,{metadata:function(){return ng},name:function(){return og},settings:function(){return rg}});var ie={};n.r(ie),n.d(ie,{metadata:function(){return dg},name:function(){return pg},settings:function(){return gg}});var se={};n.r(se),n.d(se,{metadata:function(){return kg},name:function(){return wg},settings:function(){return Eg}});var ce={};n.r(ce),n.d(ce,{metadata:function(){return Ig},name:function(){return Mg},settings:function(){return Rg}});var ue={};n.r(ue),n.d(ue,{metadata:function(){return ch},name:function(){return uh},settings:function(){return mh}});var me={};n.r(me),n.d(me,{metadata:function(){return ph},name:function(){return gh},settings:function(){return hh}});var de={};n.r(de),n.d(de,{metadata:function(){return Hh},name:function(){return Ah},settings:function(){return Fh}});var pe={};n.r(pe),n.d(pe,{metadata:function(){return Uh},name:function(){return Oh},settings:function(){return qh}});var ge={};n.r(ge),n.d(ge,{metadata:function(){return Kh},name:function(){return Qh},settings:function(){return Jh}});var he={};n.r(he),n.d(he,{metadata:function(){return rv},name:function(){return av},settings:function(){return lv}});var ve={};n.r(ve),n.d(ve,{metadata:function(){return Cv},name:function(){return xv},settings:function(){return Sv}});var be=window.wp.blocks,ye=window.wp.element,fe=window.wp.primitives;var _e=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.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"})),ke=window.wp.components,we=window.wp.i18n,Ee=window.wp.blockEditor,Ce=window.wp.serverSideRender,xe=n.n(Ce);const Se={apiVersion:2,name:"core/archives",title:"Archives",category:"widgets",description:"Display a monthly archive of your posts.",textdomain:"default",attributes:{displayAsDropdown:{type:"boolean",default:!1},showPostCounts:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-archives-editor"},{name:Be}=Se,Te={icon:_e,example:{},edit:function(e){let{attributes:t,setAttributes:n}=e;const{showPostCounts:o,displayAsDropdown:r}=t;return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Archives settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Display as dropdown"),checked:r,onChange:()=>n({displayAsDropdown:!r})}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Show post counts"),checked:o,onChange:()=>n({showPostCounts:!o})}))),(0,ye.createElement)("div",(0,Ee.useBlockProps)(),(0,ye.createElement)(ke.Disabled,null,(0,ye.createElement)(xe(),{block:"core/archives",attributes:t}))))}};var Ne=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.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"})),ze=[{attributes:{src:{type:"string",source:"attribute",selector:"audio",attribute:"src"},caption:{type:"string",source:"html",selector:"figcaption"},id:{type:"number"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{align:!0},save(e){let{attributes:t}=e;const{autoplay:n,caption:o,loop:r,preload:a,src:l}=t;return(0,ye.createElement)("figure",null,(0,ye.createElement)("audio",{controls:"controls",src:l,autoPlay:n,loop:r,preload:a}),!Ee.RichText.isEmpty(o)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:o}))}}],Pe=window.wp.blob,Ie=window.wp.data;const Me=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.78",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}],Re="wp-embed";var Le=window.lodash,Ve=n(3827),He=n.n(Ve),Ae=n(9756),Fe=n.n(Ae);const{name:De}={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},Ge=e=>{var t;return null===(t=(0,be.getBlockVariations)(De))||void 0===t?void 0:t.find((t=>{let{patterns:n}=t;return function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).some((t=>e.match(t)))}(e,n)}))},Ue=e=>e&&e.includes('class="wp-embedded-content"'),Oe=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{preview:o,attributes:r={}}=e,{url:a,providerNameSlug:l,type:i,...s}=r;if(!a||!(0,be.getBlockType)(De))return;const c=Ge(a),u="wordpress"===l||i===Re,m=!u&&c&&(c.attributes.providerNameSlug!==l||!l);if(m)return(0,be.createBlock)(De,{url:a,...s,...c.attributes});const d=null===(t=(0,be.getBlockVariations)(De))||void 0===t?void 0:t.find((e=>{let{name:t}=e;return"wordpress"===t}));return d&&o&&Ue(o.html)&&!u?(0,be.createBlock)(De,{url:a,...d.attributes,...n}):void 0},qe=e=>{if(!e)return e;const t=Me.reduce(((e,t)=>{let{className:n}=t;return e[n]=!1,e}),{"wp-has-aspect-ratio":!1});return He()(e,t)};function $e(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!n)return qe(t);const o=document.implementation.createHTMLDocument("");o.body.innerHTML=e;const r=o.body.querySelector("iframe");if(r&&r.height&&r.width){const e=(r.width/r.height).toFixed(2);for(let n=0;n<Me.length;n++){const o=Me[n];if(e>=o.ratio){return e-o.ratio>.1?qe(t):He()(qe(t),o.className,"wp-has-aspect-ratio")}}}return t}const We=Fe()((function(e,t,n,o){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(!e)return{};const a={};let{type:l="rich"}=e;const{html:i,provider_name:s}=e,c=(0,Le.kebabCase)((s||t).toLowerCase());return Ue(i)&&(l=Re),(i||"photo"===l)&&(a.type=l,a.providerNameSlug=c),a.className=$e(i,n,o&&r),a})),je=["audio"];var Ze=(0,ke.withNotices)((function(e){let{attributes:t,noticeOperations:n,setAttributes:o,onReplace:r,isSelected:a,noticeUI:l,insertBlocksAfter:i}=e;const{id:s,autoplay:c,caption:u,loop:m,preload:d,src:p}=t,g=(0,Ee.useBlockProps)(),h=(0,Ie.useSelect)((e=>{const{getSettings:t}=e(Ee.store);return t().mediaUpload}),[]);function v(e){return t=>{o({[e]:t})}}function b(e){if(e!==p){const t=Oe({attributes:{url:e}});if(void 0!==t)return void r(t);o({src:e,id:void 0})}}function y(e){n.removeAllNotices(),n.createErrorNotice(e)}function f(e){e&&e.url?o({src:e.url,id:e.id}):o({src:void 0,id:void 0})}return(0,ye.useEffect)((()=>{if(!s&&(0,Pe.isBlobURL)(p)){const e=(0,Pe.getBlobByURL)(p);e&&h({filesList:[e],onFileChange:e=>{let[{id:t,url:n}]=e;o({id:t,src:n})},onError:e=>{o({src:void 0,id:void 0}),n.createErrorNotice(e)},allowedTypes:je})}}),[]),p?(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,{group:"other"},(0,ye.createElement)(Ee.MediaReplaceFlow,{mediaId:s,mediaURL:p,allowedTypes:je,accept:"audio/*",onSelect:f,onSelectURL:b,onError:y})),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Audio settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Autoplay"),onChange:v("autoplay"),checked:c,help:function(e){return e?(0,we.__)("Autoplay may cause usability issues for some users."):null}}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Loop"),onChange:v("loop"),checked:m}),(0,ye.createElement)(ke.SelectControl,{label:(0,we._x)("Preload","noun; Audio block parameter"),value:d||"",onChange:e=>o({preload:e||void 0}),options:[{value:"",label:(0,we.__)("Browser default")},{value:"auto",label:(0,we.__)("Auto")},{value:"metadata",label:(0,we.__)("Metadata")},{value:"none",label:(0,we._x)("None",'"Preload" value')}]}))),(0,ye.createElement)("figure",g,(0,ye.createElement)(ke.Disabled,{isDisabled:!a},(0,ye.createElement)("audio",{controls:"controls",src:p})),(!Ee.RichText.isEmpty(u)||a)&&(0,ye.createElement)(Ee.RichText,{tagName:"figcaption","aria-label":(0,we.__)("Audio caption text"),placeholder:(0,we.__)("Add caption"),value:u,onChange:e=>o({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>i((0,be.createBlock)("core/paragraph"))}))):(0,ye.createElement)("div",g,(0,ye.createElement)(Ee.MediaPlaceholder,{icon:(0,ye.createElement)(Ee.BlockIcon,{icon:Ne}),onSelect:f,onSelectURL:b,accept:"audio/*",allowedTypes:je,value:t,notices:l,onError:y}))}));const Ke={from:[{type:"files",isMatch:e=>1===e.length&&0===e[0].type.indexOf("audio/"),transform(e){const t=e[0];return(0,be.createBlock)("core/audio",{src:(0,Pe.createBlobURL)(t)})}},{type:"shortcode",tag:"audio",attributes:{src:{type:"string",shortcode:e=>{let{named:{src:t,mp3:n,m4a:o,ogg:r,wav:a,wma:l}}=e;return t||n||o||r||a||l}},loop:{type:"string",shortcode:e=>{let{named:{loop:t}}=e;return t}},autoplay:{type:"string",shortcode:e=>{let{named:{autoplay:t}}=e;return t}},preload:{type:"string",shortcode:e=>{let{named:{preload:t}}=e;return t}}}}]};var Qe=Ke;const Je={apiVersion:2,name:"core/audio",title:"Audio",category:"media",description:"Embed a simple audio player.",keywords:["music","sound","podcast","recording"],textdomain:"default",attributes:{src:{type:"string",source:"attribute",selector:"audio",attribute:"src"},caption:{type:"string",source:"html",selector:"figcaption"},id:{type:"number"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{anchor:!0,align:!0},editorStyle:"wp-block-audio-editor",style:"wp-block-audio"},{name:Ye}=Je,Xe={icon:Ne,example:{attributes:{src:"https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg"}},transforms:Qe,deprecated:ze,edit:Ze,save:function(e){let{attributes:t}=e;const{autoplay:n,caption:o,loop:r,preload:a,src:l}=t;return l&&(0,ye.createElement)("figure",Ee.useBlockProps.save(),(0,ye.createElement)("audio",{controls:"controls",src:l,autoPlay:n,loop:r,preload:a}),!Ee.RichText.isEmpty(o)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:o}))}};var et=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.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"})),tt=n(4403),nt=n.n(tt),ot=window.wp.compose;const rt=e=>{if(!(0,Le.isObject)(e)||Array.isArray(e))return e;const t=(0,Le.pickBy)((0,Le.mapValues)(e,rt),Le.identity);return(0,Le.isEmpty)(t)?void 0:t};var at=rt;function lt(e){var t,n;if(null==e||null===(t=e.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.fontFamily)return e;const o=(0,Le.cloneDeep)(e),r=o.style.typography.fontFamily.split("|").pop();return delete o.style.typography.fontFamily,o.style=at(o.style),{...o,fontFamily:r}}const it=e=>{var t,n,o;const{borderRadius:r,...a}=e,l=[r,null===(t=a.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius].find((e=>"number"==typeof e&&0!==e));return l?{...a,style:{...a.style,border:{...null===(o=a.style)||void 0===o?void 0:o.border,radius:`${l}px`}}}:a},st=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customGradient)return e;const t={color:{}};return e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customGradient&&(t.color.gradient=e.customGradient),{...(0,Le.omit)(e,["customTextColor","customBackgroundColor","customGradient"]),style:t}},ct=e=>st((0,Le.omit)({...e,customTextColor:e.textColor&&"#"===e.textColor[0]?e.textColor:void 0,customBackgroundColor:e.color&&"#"===e.color[0]?e.color:void 0},["color","textColor"])),ut={url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"}},mt={attributes:{url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},reusable:!1,spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wp-block-button__link"},save(e){var t,n;let{attributes:o,className:r}=e;const{fontSize:a,linkTarget:l,rel:i,style:s,text:c,title:u,url:m,width:d}=o;if(!c)return null;const p=(0,Ee.__experimentalGetBorderClassesAndStyles)(o),g=(0,Ee.__experimentalGetColorClassesAndStyles)(o),h=(0,Ee.__experimentalGetSpacingClassesAndStyles)(o),v=nt()("wp-block-button__link",g.className,p.className,{"no-border-radius":0===(null==s||null===(t=s.border)||void 0===t?void 0:t.radius)}),b={...p.style,...g.style,...h.style},y=nt()(r,{[`has-custom-width wp-block-button__width-${d}`]:d,"has-custom-font-size":a||(null==s||null===(n=s.typography)||void 0===n?void 0:n.fontSize)});return(0,ye.createElement)("div",Ee.useBlockProps.save({className:y}),(0,ye.createElement)(Ee.RichText.Content,{tagName:"a",className:v,href:m,title:u,style:b,value:c,target:l,rel:i}))},migrate:lt,isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}},dt=[mt,{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...ut,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},isEligible(e){var t;let{style:n}=e;return"number"==typeof(null==n||null===(t=n.border)||void 0===t?void 0:t.radius)},save(e){var t,n,o;let{attributes:r,className:a}=e;const{fontSize:l,linkTarget:i,rel:s,style:c,text:u,title:m,url:d,width:p}=r;if(!u)return null;const g=null==c||null===(t=c.border)||void 0===t?void 0:t.radius,h=(0,Ee.__experimentalGetColorClassesAndStyles)(r),v=nt()("wp-block-button__link",h.className,{"no-border-radius":0===(null==c||null===(n=c.border)||void 0===n?void 0:n.radius)}),b={borderRadius:g||void 0,...h.style},y=nt()(a,{[`has-custom-width wp-block-button__width-${p}`]:p,"has-custom-font-size":l||(null==c||null===(o=c.typography)||void 0===o?void 0:o.fontSize)});return(0,ye.createElement)("div",Ee.useBlockProps.save({className:y}),(0,ye.createElement)(Ee.RichText.Content,{tagName:"a",className:v,href:d,title:m,style:b,value:u,target:i,rel:s}))},migrate:(0,ot.compose)(lt,it)},{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...ut,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save(e){let{attributes:t,className:n}=e;const{borderRadius:o,linkTarget:r,rel:a,text:l,title:i,url:s,width:c}=t,u=(0,Ee.__experimentalGetColorClassesAndStyles)(t),m=nt()("wp-block-button__link",u.className,{"no-border-radius":0===o}),d={borderRadius:o?o+"px":void 0,...u.style},p=nt()(n,{[`has-custom-width wp-block-button__width-${c}`]:c});return(0,ye.createElement)("div",Ee.useBlockProps.save({className:p}),(0,ye.createElement)(Ee.RichText.Content,{tagName:"a",className:m,href:s,title:i,style:d,value:l,target:r,rel:a}))},migrate:(0,ot.compose)(lt,it)},{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...ut,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save(e){let{attributes:t,className:n}=e;const{borderRadius:o,linkTarget:r,rel:a,text:l,title:i,url:s,width:c}=t,u=(0,Ee.__experimentalGetColorClassesAndStyles)(t),m=nt()("wp-block-button__link",u.className,{"no-border-radius":0===o}),d={borderRadius:o?o+"px":void 0,...u.style},p=nt()(n,{[`has-custom-width wp-block-button__width-${c}`]:c});return(0,ye.createElement)("div",Ee.useBlockProps.save({className:p}),(0,ye.createElement)(Ee.RichText.Content,{tagName:"a",className:m,href:s,title:i,style:d,value:l,target:r,rel:a}))},migrate:(0,ot.compose)(lt,it)},{supports:{align:!0,alignWide:!1,color:{gradients:!0}},attributes:{...ut,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"}},save(e){let{attributes:t}=e;const{borderRadius:n,linkTarget:o,rel:r,text:a,title:l,url:i}=t,s=nt()("wp-block-button__link",{"no-border-radius":0===n}),c={borderRadius:n?n+"px":void 0};return(0,ye.createElement)(Ee.RichText.Content,{tagName:"a",className:s,href:i,title:l,style:c,value:a,target:o,rel:r})},migrate:it},{supports:{align:!0,alignWide:!1},attributes:{...ut,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},customGradient:{type:"string"},gradient:{type:"string"}},isEligible:e=>!!e.customTextColor||!!e.customBackgroundColor||!!e.customGradient,migrate:(0,ot.compose)(it,st),save(e){let{attributes:t}=e;const{backgroundColor:n,borderRadius:o,customBackgroundColor:r,customTextColor:a,customGradient:l,linkTarget:i,gradient:s,rel:c,text:u,textColor:m,title:d,url:p}=t,g=(0,Ee.getColorClassName)("color",m),h=!l&&(0,Ee.getColorClassName)("background-color",n),v=(0,Ee.__experimentalGetGradientClass)(s),b=nt()("wp-block-button__link",{"has-text-color":m||a,[g]:g,"has-background":n||r||l||s,[h]:h,"no-border-radius":0===o,[v]:v}),y={background:l||void 0,backgroundColor:h||l||s?void 0:r,color:g?void 0:a,borderRadius:o?o+"px":void 0};return(0,ye.createElement)("div",null,(0,ye.createElement)(Ee.RichText.Content,{tagName:"a",className:b,href:p,title:d,style:y,value:u,target:i,rel:c}))}},{attributes:{...ut,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"}},isEligible:e=>e.className&&e.className.includes("is-style-squared"),migrate(e){let t=e.className;return t&&(t=t.replace(/is-style-squared[\s]?/,"").trim()),it(st({...e,className:t||void 0,borderRadius:0}))},save(e){let{attributes:t}=e;const{backgroundColor:n,customBackgroundColor:o,customTextColor:r,linkTarget:a,rel:l,text:i,textColor:s,title:c,url:u}=t,m=(0,Ee.getColorClassName)("color",s),d=(0,Ee.getColorClassName)("background-color",n),p=nt()("wp-block-button__link",{"has-text-color":s||r,[m]:m,"has-background":n||o,[d]:d}),g={backgroundColor:d?void 0:o,color:m?void 0:r};return(0,ye.createElement)("div",null,(0,ye.createElement)(Ee.RichText.Content,{tagName:"a",className:p,href:u,title:c,style:g,value:i,target:a,rel:l}))}},{attributes:{...ut,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"}},migrate:ct,save(e){let{attributes:t}=e;const{url:n,text:o,title:r,backgroundColor:a,textColor:l,customBackgroundColor:i,customTextColor:s}=t,c=(0,Ee.getColorClassName)("color",l),u=(0,Ee.getColorClassName)("background-color",a),m=nt()("wp-block-button__link",{"has-text-color":l||s,[c]:c,"has-background":a||i,[u]:u}),d={backgroundColor:u?void 0:i,color:c?void 0:s};return(0,ye.createElement)("div",null,(0,ye.createElement)(Ee.RichText.Content,{tagName:"a",className:m,href:n,title:r,style:d,value:o}))}},{attributes:{...ut,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save(e){let{attributes:t}=e;const{url:n,text:o,title:r,align:a,color:l,textColor:i}=t,s={backgroundColor:l,color:i};return(0,ye.createElement)("div",{className:`align${a}`},(0,ye.createElement)(Ee.RichText.Content,{tagName:"a",className:"wp-block-button__link",href:n,title:r,style:s,value:o}))},migrate:ct},{attributes:{...ut,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save(e){let{attributes:t}=e;const{url:n,text:o,title:r,align:a,color:l,textColor:i}=t;return(0,ye.createElement)("div",{className:`align${a}`,style:{backgroundColor:l}},(0,ye.createElement)(Ee.RichText.Content,{tagName:"a",href:n,title:r,style:{color:i},value:o}))},migrate:ct}];var pt=dt;function gt(){return gt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},gt.apply(this,arguments)}var ht=window.wp.keycodes;var vt=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.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 bt=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.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"}));const yt="noreferrer noopener";function ft(e){let{selectedWidth:t,setAttributes:n}=e;return(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Width settings")},(0,ye.createElement)(ke.ButtonGroup,{"aria-label":(0,we.__)("Button width")},[25,50,75,100].map((e=>(0,ye.createElement)(ke.Button,{key:e,isSmall:!0,variant:e===t?"primary":void 0,onClick:()=>{var o;n({width:t===(o=e)?void 0:o})}},e,"%")))))}var _t=function(e){var t;const{attributes:n,setAttributes:o,className:r,isSelected:a,onReplace:l,mergeBlocks:i}=e,{linkTarget:s,placeholder:c,rel:u,style:m,text:d,url:p,width:g}=n,h=(0,ye.useCallback)((e=>{o({rel:e})}),[o]),v=(0,Ee.__experimentalUseBorderProps)(n),b=(0,Ee.__experimentalUseColorProps)(n),y=(0,Ee.__experimentalGetSpacingClassesAndStyles)(n),f=(0,ye.useRef)(),_=(0,ye.useRef)(),k=(0,Ee.useBlockProps)({ref:f,onKeyDown:function(e){if(ht.isKeyboardEvent.primary(e,"k"))S(e);else if(ht.isKeyboardEvent.primaryShift(e,"k")){var t;B(),null===(t=_.current)||void 0===t||t.focus()}}}),[w,E]=(0,ye.useState)(!1),C=!!p,x="_blank"===s;function S(e){e.preventDefault(),E(!0)}function B(){o({url:void 0,linkTarget:void 0,rel:void 0}),E(!1)}return(0,ye.useEffect)((()=>{a||E(!1)}),[a]),(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)("div",gt({},k,{className:nt()(k.className,{[`has-custom-width wp-block-button__width-${g}`]:g,"has-custom-font-size":k.style.fontSize})}),(0,ye.createElement)(Ee.RichText,{ref:_,"aria-label":(0,we.__)("Button text"),placeholder:c||(0,we.__)("Add text…"),value:d,onChange:e=>{o({text:e.replace(/<\/?a[^>]*>/g,"")})},withoutInteractiveFormatting:!0,className:nt()(r,"wp-block-button__link",b.className,v.className,{"no-border-radius":0===(null==m||null===(t=m.border)||void 0===t?void 0:t.radius)}),style:{...v.style,...b.style,...y.style},onSplit:e=>(0,be.createBlock)("core/button",{...n,text:e}),onReplace:l,onMerge:i,identifier:"text"})),(0,ye.createElement)(Ee.BlockControls,{group:"block"},!C&&(0,ye.createElement)(ke.ToolbarButton,{name:"link",icon:vt,title:(0,we.__)("Link"),shortcut:ht.displayShortcut.primary("k"),onClick:S}),C&&(0,ye.createElement)(ke.ToolbarButton,{name:"link",icon:bt,title:(0,we.__)("Unlink"),shortcut:ht.displayShortcut.primaryShift("k"),onClick:B,isActive:!0})),a&&(w||C)&&(0,ye.createElement)(ke.Popover,{position:"bottom center",onClose:()=>{var e;E(!1),null===(e=_.current)||void 0===e||e.focus()},anchorRef:null==f?void 0:f.current,focusOnMount:!!w&&"firstElement"},(0,ye.createElement)(Ee.__experimentalLinkControl,{className:"wp-block-navigation-link__inline-link-input",value:{url:p,opensInNewTab:x},onChange:e=>{let{url:t="",opensInNewTab:n}=e;o({url:t}),x!==n&&function(e){const t=e?"_blank":void 0;let n=u;t&&!u?n=yt:t||u!==yt||(n=void 0),o({linkTarget:t,rel:n})}(n)},onRemove:()=>{var e;B(),null===(e=_.current)||void 0===e||e.focus()},forceIsEditingLink:w})),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ft,{selectedWidth:g,setAttributes:o})),(0,ye.createElement)(Ee.InspectorControls,{__experimentalGroup:"advanced"},(0,ye.createElement)(ke.TextControl,{label:(0,we.__)("Link rel"),value:u||"",onChange:h})))};const kt={apiVersion:2,name:"core/button",title:"Button",category:"design",parent:["core/buttons"],description:"Prompt visitors to take action with a button-style link.",keywords:["link"],textdomain:"default",attributes:{url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,__experimentalFontFamily:!0,__experimentalDefaultControls:{fontSize:!0}},reusable:!1,spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wp-block-button__link"},styles:[{name:"fill",label:"Fill",isDefault:!0},{name:"outline",label:"Outline"}],editorStyle:"wp-block-button-editor",style:"wp-block-button"},{name:wt}=kt,Et={icon:et,example:{attributes:{className:"is-style-fill",text:(0,we.__)("Call to Action")}},edit:_t,save:function(e){var t,n;let{attributes:o,className:r}=e;const{fontSize:a,linkTarget:l,rel:i,style:s,text:c,title:u,url:m,width:d}=o;if(!c)return null;const p=(0,Ee.__experimentalGetBorderClassesAndStyles)(o),g=(0,Ee.__experimentalGetColorClassesAndStyles)(o),h=(0,Ee.__experimentalGetSpacingClassesAndStyles)(o),v=nt()("wp-block-button__link",g.className,p.className,{"no-border-radius":0===(null==s||null===(t=s.border)||void 0===t?void 0:t.radius)}),b={...p.style,...g.style,...h.style},y=nt()(r,{[`has-custom-width wp-block-button__width-${d}`]:d,"has-custom-font-size":a||(null==s||null===(n=s.typography)||void 0===n?void 0:n.fontSize)});return(0,ye.createElement)("div",Ee.useBlockProps.save({className:y}),(0,ye.createElement)(Ee.RichText.Content,{tagName:"a",className:v,href:m,title:u,style:b,value:c,target:l,rel:i}))},deprecated:pt,merge:(e,t)=>{let{text:n=""}=t;return{...e,text:(e.text||"")+n}}};var Ct=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.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"}));const xt=e=>{if(e.layout)return e;const{contentJustification:t,orientation:n,...o}=e;return(t||n)&&Object.assign(o,{layout:{type:"flex",...t&&{justifyContent:t},...n&&{orientation:n}}}),o},St=[{attributes:{contentJustification:{type:"string"},orientation:{type:"string",default:"horizontal"}},supports:{anchor:!0,align:["wide","full"],__experimentalExposeControlsToChildren:!0,spacing:{blockGap:!0,margin:["top","bottom"],__experimentalDefaultControls:{blockGap:!0}}},isEligible:e=>{let{contentJustification:t,orientation:n}=e;return!!t||!!n},migrate:xt,save(e){let{attributes:{contentJustification:t,orientation:n}}=e;return(0,ye.createElement)("div",Ee.useBlockProps.save({className:nt()({[`is-content-justification-${t}`]:t,"is-vertical":"vertical"===n})}),(0,ye.createElement)(Ee.InnerBlocks.Content,null))}},{supports:{align:["center","left","right"],anchor:!0},save:()=>(0,ye.createElement)("div",null,(0,ye.createElement)(Ee.InnerBlocks.Content,null)),isEligible(e){let{align:t}=e;return t&&["center","left","right"].includes(t)},migrate:e=>xt({...e,align:void 0,contentJustification:e.align})}];var Bt=St,Tt=window.wp.richText;const{name:Nt}={apiVersion:2,name:"core/buttons",title:"Buttons",category:"design",description:"Prompt visitors to take action with a group of button-style links.",keywords:["link"],textdomain:"default",supports:{anchor:!0,align:["wide","full"],__experimentalExposeControlsToChildren:!0,spacing:{blockGap:!0,margin:["top","bottom"],__experimentalDefaultControls:{blockGap:!0}},__experimentalLayout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}}},editorStyle:"wp-block-buttons-editor",style:"wp-block-buttons"},zt={from:[{type:"block",isMultiBlock:!0,blocks:["core/button"],transform:e=>(0,be.createBlock)(Nt,{},e.map((e=>(0,be.createBlock)("core/button",e))))},{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>(0,be.createBlock)(Nt,{},e.map((e=>{const t=(0,Tt.__unstableCreateElement)(document,e.content),n=t.innerText||"",o=t.querySelector("a"),r=null==o?void 0:o.getAttribute("href");return(0,be.createBlock)("core/button",{text:n,url:r})}))),isMatch:e=>e.every((e=>{const t=(0,Tt.__unstableCreateElement)(document,e.content),n=t.innerText||"",o=t.querySelectorAll("a");return n.length<=30&&o.length<=1}))}]};var Pt=zt;const It=[wt];var Mt=function(e){let{attributes:{layout:t={}}}=e;const n=(0,Ee.useBlockProps)(),o=(0,Ie.useSelect)((e=>{var t;const n=e(Ee.store).getSettings().__experimentalPreferredStyleVariations;return null==n||null===(t=n.value)||void 0===t?void 0:t[wt]}),[]),r=(0,Ee.useInnerBlocksProps)(n,{allowedBlocks:It,template:[[wt,{className:o&&`is-style-${o}`}]],__experimentalLayout:t,templateInsertUpdatesSelection:!0});return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)("div",r))};const Rt={apiVersion:2,name:"core/buttons",title:"Buttons",category:"design",description:"Prompt visitors to take action with a group of button-style links.",keywords:["link"],textdomain:"default",supports:{anchor:!0,align:["wide","full"],__experimentalExposeControlsToChildren:!0,spacing:{blockGap:!0,margin:["top","bottom"],__experimentalDefaultControls:{blockGap:!0}},__experimentalLayout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}}},editorStyle:"wp-block-buttons-editor",style:"wp-block-buttons"},{name:Lt}=Rt,Vt={icon:Ct,example:{innerBlocks:[{name:"core/button",attributes:{text:(0,we.__)("Find out more")}},{name:"core/button",attributes:{text:(0,we.__)("Contact us")}}]},deprecated:Bt,transforms:Pt,edit:Mt,save:function(){const e=Ee.useInnerBlocksProps.save(Ee.useBlockProps.save());return(0,ye.createElement)("div",e)}};var Ht=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.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"})),At=window.moment,Ft=n.n(At),Dt=window.wp.coreData;const Gt=Fe()((e=>{if(!e)return{};const t=Ft()(e);return{year:t.year(),month:t.month()+1}}));const Ut={apiVersion:2,name:"core/calendar",title:"Calendar",category:"widgets",description:"A calendar of your site’s posts.",keywords:["posts","archive"],textdomain:"default",attributes:{month:{type:"integer"},year:{type:"integer"}},supports:{align:!0},style:"wp-block-calendar"},{name:Ot}=Ut,qt={icon:Ht,example:{},edit:function(e){let{attributes:t}=e;const n=(0,Ee.useBlockProps)(),{date:o,hasPosts:r,hasPostsResolved:a}=(0,Ie.useSelect)((e=>{const{getEntityRecords:t,hasFinishedResolution:n}=e(Dt.store),o={status:"publish",per_page:1},r=t("postType","post",o),a=n("getEntityRecords",["postType","post",o]);let l;const i=e("core/editor");if(i){"post"===i.getEditedPostAttribute("type")&&(l=i.getEditedPostAttribute("date"))}return{date:l,hasPostsResolved:a,hasPosts:a&&1===(null==r?void 0:r.length)}}),[]);return r?(0,ye.createElement)("div",n,(0,ye.createElement)(ke.Disabled,null,(0,ye.createElement)(xe(),{block:"core/calendar",attributes:{...t,...Gt(o)}}))):(0,ye.createElement)("div",n,(0,ye.createElement)(ke.Placeholder,{icon:Ht,label:(0,we.__)("Calendar")},a?(0,we.__)("No published posts found."):(0,ye.createElement)(ke.Spinner,null)))}};var $t=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.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"}));var Wt=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,ye.createElement)(fe.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"}));const jt={apiVersion:2,name:"core/categories",title:"Categories",category:"widgets",description:"Display a list of all categories.",textdomain:"default",attributes:{displayAsDropdown:{type:"boolean",default:!1},showHierarchy:{type:"boolean",default:!1},showPostCounts:{type:"boolean",default:!1},showOnlyTopLevel:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-categories-editor",style:"wp-block-categories"},{name:Zt}=jt,Kt={icon:$t,example:{},edit:function e(t){let{attributes:{displayAsDropdown:n,showHierarchy:o,showPostCounts:r,showOnlyTopLevel:a},setAttributes:l}=t;const i=(0,ot.useInstanceId)(e,"blocks-category-select"),{categories:s,isRequesting:c}=(0,Ie.useSelect)((e=>{const{getEntityRecords:t,isResolving:n}=e(Dt.store),o={per_page:-1,hide_empty:!0,context:"view"};return a&&(o.parent=0),{categories:t("taxonomy","category",o),isRequesting:n("getEntityRecords",["taxonomy","category",o])}}),[a]),u=e=>null!=s&&s.length?null===e?s:s.filter((t=>{let{parent:n}=t;return n===e})):[],m=e=>`wp-block-categories__list wp-block-categories__list-level-${e}`,d=e=>t=>l({[e]:t}),p=e=>e?(0,Le.unescape)(e).trim():(0,we.__)("(Untitled)"),g=(e,t)=>{const n=u(e.id),{id:a,link:l,count:i,name:s}=e;return(0,ye.createElement)("li",{key:a},(0,ye.createElement)("a",{href:l,target:"_blank",rel:"noreferrer noopener"},p(s)),r&&(0,ye.createElement)("span",{className:"wp-block-categories__post-count"},` (${i})`),o&&!!n.length&&(0,ye.createElement)("ul",{className:m(t+1)},n.map((e=>g(e,t+1)))))},h=(e,t)=>{const{id:n,count:a,name:l}=e,i=u(n);return[(0,ye.createElement)("option",{key:n},(0,Le.times)(3*t,(()=>" ")),p(l),r&&` (${a})`),o&&!!i.length&&i.map((e=>h(e,t+1)))]};return(0,ye.createElement)("div",(0,Ee.useBlockProps)(),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Categories settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Display as dropdown"),checked:n,onChange:d("displayAsDropdown")}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Show post counts"),checked:r,onChange:d("showPostCounts")}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Show only top level categories"),checked:a,onChange:d("showOnlyTopLevel")}),!a&&(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Show hierarchy"),checked:o,onChange:d("showHierarchy")}))),c&&(0,ye.createElement)(ke.Placeholder,{icon:Wt,label:(0,we.__)("Categories")},(0,ye.createElement)(ke.Spinner,null)),!c&&0===(null==s?void 0:s.length)&&(0,ye.createElement)("p",null,(0,we.__)("Your site does not have any posts, so there is nothing to display here at the moment.")),!c&&(null==s?void 0:s.length)>0&&(n?(()=>{const e=u(o?0:null);return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.VisuallyHidden,{as:"label",htmlFor:i},(0,we.__)("Categories")),(0,ye.createElement)("select",{id:i,className:"wp-block-categories__dropdown"},e.map((e=>h(e,0)))))})():(()=>{const e=u(o?0:null);return(0,ye.createElement)("ul",{className:m(0)},e.map((e=>g(e,0))))})()))}};var Qt=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.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"}));var Jt=e=>{let{clientId:t}=e;const{replaceBlocks:n}=(0,Ie.useDispatch)(Ee.store),o=(0,Ie.useSelect)((e=>e(Ee.store).getBlock(t)),[t]);return(0,ye.createElement)(ke.ToolbarButton,{onClick:()=>n(o.clientId,(0,be.rawHandler)({HTML:(0,be.serialize)(o)}))},(0,we.__)("Convert to blocks"))};const{wp:Yt}=window;const Xt={apiVersion:2,name:"core/freeform",title:"Classic",category:"text",description:"Use the classic WordPress editor.",textdomain:"default",attributes:{content:{type:"string",source:"html"}},supports:{className:!1,customClassName:!1,reusable:!1},editorStyle:"wp-block-freeform-editor"},{name:en}=Xt,tn={icon:Qt,edit:function(e){let{clientId:t,attributes:{content:n},setAttributes:o,onReplace:r}=e;const{getMultiSelectedBlockClientIds:a}=(0,Ie.useSelect)(Ee.store),l=(0,ye.useRef)(!1);return(0,ye.useEffect)((()=>{if(!l.current)return;const e=window.tinymce.get(`editor-${t}`);(null==e?void 0:e.getContent())!==n&&e.setContent(n||"")}),[n]),(0,ye.useEffect)((()=>{const{baseURL:e,suffix:i}=window.wpEditorL10n.tinymce;function s(e){let t;n&&e.on("loadContent",(()=>e.setContent(n))),e.on("blur",(()=>{var n;t=e.selection.getBookmark(2,!0);const r=document.querySelector(".interface-interface-skeleton__content"),l=r.scrollTop;return null!==(n=a())&&void 0!==n&&n.length||o({content:e.getContent()}),e.once("focus",(()=>{t&&(e.selection.moveToBookmark(t),r.scrollTop!==l&&(r.scrollTop=l))})),!1})),e.on("mousedown touchstart",(()=>{t=null}));const l=(0,Le.debounce)((()=>{const t=e.getContent();t!==e._lastChange&&(e._lastChange=t,o({content:t}))}),250);e.on("Paste Change input Undo Redo",l),e.on("remove",l.cancel),e.on("keydown",(t=>{ht.isKeyboardEvent.primary(t,"z")&&t.stopPropagation(),t.keyCode!==ht.BACKSPACE&&t.keyCode!==ht.DELETE||!function(e){const t=e.getBody();return!(t.childNodes.length>1)&&(0===t.childNodes.length||!(t.childNodes[0].childNodes.length>1)&&/^\n?$/.test(t.innerText||t.textContent))}(e)||(r([]),t.preventDefault(),t.stopImmediatePropagation());const{altKey:n}=t;n&&t.keyCode===ht.F10&&t.stopPropagation()})),e.on("init",(()=>{const t=e.getBody();t.ownerDocument.activeElement===t&&(t.blur(),e.focus())}))}function c(){const{settings:e}=window.wpEditorL10n.tinymce;Yt.oldEditor.initialize(`editor-${t}`,{tinymce:{...e,inline:!0,content_css:!1,fixed_toolbar_container:`#toolbar-${t}`,setup:s}})}function u(){"complete"===document.readyState&&c()}return l.current=!0,window.tinymce.EditorManager.overrideDefaults({base_url:e,suffix:i}),"complete"===document.readyState?c():document.addEventListener("readystatechange",u),()=>{document.removeEventListener("readystatechange",u),Yt.oldEditor.remove(`editor-${t}`)}}),[]),(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(ke.ToolbarGroup,null,(0,ye.createElement)(Jt,{clientId:t}))),(0,ye.createElement)("div",(0,Ee.useBlockProps)(),(0,ye.createElement)("div",{key:"toolbar",id:`toolbar-${t}`,className:"block-library-classic__toolbar",onClick:function(){const e=window.tinymce.get(`editor-${t}`);e&&e.focus()},"data-placeholder":(0,we.__)("Classic"),onKeyDown:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}}),(0,ye.createElement)("div",{key:"editor",id:`editor-${t}`,className:"wp-block-freeform block-library-rich-text__tinymce"})))},save:function(e){let{attributes:t}=e;const{content:n}=t;return(0,ye.createElement)(ye.RawHTML,null,n)}};var nn=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.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"}));function on(e){return e.replace(/\[/g,"[")}function rn(e){return e.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m,"$1//$2")}var an={from:[{type:"enter",regExp:/^```$/,transform:()=>(0,be.createBlock)("core/code")},{type:"block",blocks:["core/html"],transform:e=>{let{content:t}=e;return(0,be.createBlock)("core/code",{content:t})}},{type:"raw",isMatch:e=>"PRE"===e.nodeName&&1===e.children.length&&"CODE"===e.firstChild.nodeName,schema:{pre:{children:{code:{children:{"#text":{}}}}}}}]};const ln={apiVersion:2,name:"core/code",title:"Code",category:"text",description:"Display code snippets that respect your spacing and tabs.",textdomain:"default",attributes:{content:{type:"string",source:"html",selector:"code"}},supports:{anchor:!0,__experimentalSelector:".wp-block-code > code",typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{margin:["top","bottom"],padding:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},color:{text:!0,background:!0,gradients:!0}},style:"wp-block-code"},{name:sn}=ln,cn={icon:nn,example:{attributes:{content:(0,we.__)('// 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 );')}},transforms:an,edit:function(e){let{attributes:t,setAttributes:n,onRemove:o}=e;const r=(0,Ee.useBlockProps)();return(0,ye.createElement)("pre",r,(0,ye.createElement)(Ee.RichText,{tagName:"code",value:t.content,onChange:e=>n({content:e}),onRemove:o,placeholder:(0,we.__)("Write code…"),"aria-label":(0,we.__)("Code"),preserveWhiteSpace:!0,__unstablePastePlainText:!0}))},save:function(e){let{attributes:t}=e;return(0,ye.createElement)("pre",Ee.useBlockProps.save(),(0,ye.createElement)(Ee.RichText.Content,{tagName:"code",value:(n=t.content,(0,Le.flow)(on,rn)(n||""))}));var n}};var un=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.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"}));const mn=[{attributes:{verticalAlignment:{type:"string"},width:{type:"number",min:0,max:100}},isEligible(e){let{width:t}=e;return isFinite(t)},migrate:e=>({...e,width:`${e.width}%`}),save(e){let{attributes:t}=e;const{verticalAlignment:n,width:o}=t,r=nt()({[`is-vertically-aligned-${n}`]:n}),a={flexBasis:o+"%"};return(0,ye.createElement)("div",{className:r,style:a},(0,ye.createElement)(Ee.InnerBlocks.Content,null))}}];var dn=mn;var pn=function(e){let{attributes:{verticalAlignment:t,width:n,templateLock:o=!1,allowedBlocks:r},setAttributes:a,clientId:l}=e;const i=nt()("block-core-columns",{[`is-vertically-aligned-${t}`]:t}),s=(0,ke.__experimentalUseCustomUnits)({availableUnits:(0,Ee.useSetting)("spacing.units")||["%","px","em","rem","vw"]}),{columnsIds:c,hasChildBlocks:u,rootClientId:m}=(0,Ie.useSelect)((e=>{const{getBlockOrder:t,getBlockRootClientId:n}=e(Ee.store),o=n(l);return{hasChildBlocks:t(l).length>0,rootClientId:o,columnsIds:t(o)}}),[l]),{updateBlockAttributes:d}=(0,Ie.useDispatch)(Ee.store),p=Number.isFinite(n)?n+"%":n,g=(0,Ee.useBlockProps)({className:i,style:p?{flexBasis:p}:void 0}),h=c.length,v=c.indexOf(l)+1,b=(0,we.sprintf)((0,we.__)("%1$s (%2$d of %3$d)"),g["aria-label"],v,h),y=(0,Ee.useInnerBlocksProps)({...g,"aria-label":b},{templateLock:o,allowedBlocks:r,renderAppender:u?void 0:Ee.InnerBlocks.ButtonBlockAppender});return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(Ee.BlockVerticalAlignmentToolbar,{onChange:e=>{a({verticalAlignment:e}),d(m,{verticalAlignment:null})},value:t})),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Column settings")},(0,ye.createElement)(ke.__experimentalUnitControl,{label:(0,we.__)("Width"),labelPosition:"edge",__unstableInputWidth:"80px",value:n||"",onChange:e=>{e=0>parseFloat(e)?"0":e,a({width:e})},units:s}))),(0,ye.createElement)("div",y))};const gn={apiVersion:2,name:"core/column",title:"Column",category:"text",parent:["core/columns"],description:"A single column within a columns block.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},width:{type:"string"},allowedBlocks:{type:"array"},templateLock:{type:["string","boolean"],enum:["all","insert",!1]}},supports:{anchor:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0},spacing:{padding:!0,__experimentalDefaultControls:{padding:!0}}}},{name:hn}=gn,vn={icon:un,edit:pn,save:function(e){let{attributes:t}=e;const{verticalAlignment:n,width:o}=t,r=nt()({[`is-vertically-aligned-${n}`]:n});let a;if(o&&/\d/.test(o)){let e=Number.isFinite(o)?o+"%":o;if(!Number.isFinite(o)&&null!=o&&o.endsWith("%")){const t=1e12;e=Math.round(Number.parseFloat(o)*t)/t+"%"}a={flexBasis:e}}const l=Ee.useBlockProps.save({className:r,style:a}),i=Ee.useInnerBlocksProps.save(l);return(0,ye.createElement)("div",i)},deprecated:dn};var bn=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.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"}));function yn(e){let t,{doc:n}=yn;n||(n=document.implementation.createHTMLDocument(""),yn.doc=n),n.body.innerHTML=e;for(const e of n.body.firstChild.classList)if(t=e.match(/^layout-column-(\d+)$/))return Number(t[1])-1}var fn=[{attributes:{verticalAlignment:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>{if(!e.customTextColor&&!e.customBackgroundColor)return e;const t={color:{}};return e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),{...(0,Le.omit)(e,["customTextColor","customBackgroundColor"]),style:t,isStackedOnMobile:!0}},save(e){let{attributes:t}=e;const{verticalAlignment:n,backgroundColor:o,customBackgroundColor:r,textColor:a,customTextColor:l}=t,i=(0,Ee.getColorClassName)("background-color",o),s=(0,Ee.getColorClassName)("color",a),c=nt()({"has-background":o||r,"has-text-color":a||l,[i]:i,[s]:s,[`are-vertically-aligned-${n}`]:n}),u={backgroundColor:i?void 0:r,color:s?void 0:l};return(0,ye.createElement)("div",{className:c||void 0,style:u},(0,ye.createElement)(Ee.InnerBlocks.Content,null))}},{attributes:{columns:{type:"number",default:2}},isEligible:(e,t)=>!!t.some((e=>/layout-column-\d+/.test(e.originalContent)))&&t.some((e=>void 0!==yn(e.originalContent))),migrate(e,t){const n=t.reduce(((e,t)=>{const{originalContent:n}=t;let o=yn(n);return void 0===o&&(o=0),e[o]||(e[o]=[]),e[o].push(t),e}),[]).map((e=>(0,be.createBlock)("core/column",{},e)));return[{...(0,Le.omit)(e,["columns"]),isStackedOnMobile:!0},n]},save(e){let{attributes:t}=e;const{columns:n}=t;return(0,ye.createElement)("div",{className:`has-${n}-columns`},(0,ye.createElement)(Ee.InnerBlocks.Content,null))}},{attributes:{columns:{type:"number",default:2}},migrate:(e,t)=>[e={...(0,Le.omit)(e,["columns"]),isStackedOnMobile:!0},t],save(e){let{attributes:t}=e;const{verticalAlignment:n,columns:o}=t,r=nt()(`has-${o}-columns`,{[`are-vertically-aligned-${n}`]:n});return(0,ye.createElement)("div",{className:r},(0,ye.createElement)(Ee.InnerBlocks.Content,null))}}];const _n=e=>{const t=parseFloat(e);return Number.isFinite(t)?parseFloat(t.toFixed(2)):void 0};function kn(e,t){const{width:n=100/t}=e.attributes;return _n(n)}function wn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;return(0,Le.sumBy)(e,(e=>kn(e,t)))}function En(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.length;return e.reduce(((e,n)=>{const o=kn(n,t);return Object.assign(e,{[n.clientId]:o})}),{})}function Cn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length;const o=wn(e,n);return(0,Le.mapValues)(En(e,n),(e=>_n(t*e/o)))}function xn(e,t){return e.map((e=>(0,Le.merge)({},e,{attributes:{width:`${t[e.clientId]}%`}})))}const Sn=["core/column"];const Bn=(0,Ie.withDispatch)(((e,t,n)=>({updateAlignment(o){const{clientId:r,setAttributes:a}=t,{updateBlockAttributes:l}=e(Ee.store),{getBlockOrder:i}=n.select(Ee.store);a({verticalAlignment:o});i(r).forEach((e=>{l(e,{verticalAlignment:o})}))},updateColumns(o,r){const{clientId:a}=t,{replaceInnerBlocks:l}=e(Ee.store),{getBlocks:i}=n.select(Ee.store);let s=i(a);const c=s.every((e=>{var t;const n=e.attributes.width;return Number.isFinite(null!=n&&null!==(t=n.endsWith)&&void 0!==t&&t.call(n,"%")?parseFloat(n):n)}));const u=r>o;if(u&&c){const e=_n(100/r);s=[...xn(s,Cn(s,100-e)),...(0,Le.times)(r-o,(()=>(0,be.createBlock)("core/column",{width:`${e}%`})))]}else if(u)s=[...s,...(0,Le.times)(r-o,(()=>(0,be.createBlock)("core/column")))];else if(s=(0,Le.dropRight)(s,o-r),c){s=xn(s,Cn(s,100))}l(a,s)}})))((function(e){let{attributes:t,setAttributes:n,updateAlignment:o,updateColumns:r,clientId:a}=e;const{isStackedOnMobile:l,verticalAlignment:i}=t,{count:s}=(0,Ie.useSelect)((e=>({count:e(Ee.store).getBlockCount(a)})),[a]),c=nt()({[`are-vertically-aligned-${i}`]:i,"is-not-stacked-on-mobile":!l}),u=(0,Ee.useBlockProps)({className:c}),m=(0,Ee.useInnerBlocksProps)(u,{allowedBlocks:Sn,orientation:"horizontal",renderAppender:!1});return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(Ee.BlockVerticalAlignmentToolbar,{onChange:o,value:i})),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,null,(0,ye.createElement)(ke.RangeControl,{label:(0,we.__)("Columns"),value:s,onChange:e=>r(s,e),min:1,max:Math.max(6,s)}),s>6&&(0,ye.createElement)(ke.Notice,{status:"warning",isDismissible:!1},(0,we.__)("This column count exceeds the recommended amount and may cause visual breakage.")),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Stack on mobile"),checked:l,onChange:()=>n({isStackedOnMobile:!l})}))),(0,ye.createElement)("div",m))}));function Tn(e){let{clientId:t,name:n,setAttributes:o}=e;const{blockType:r,defaultVariation:a,variations:l}=(0,Ie.useSelect)((e=>{const{getBlockVariations:t,getBlockType:o,getDefaultBlockVariation:r}=e(be.store);return{blockType:o(n),defaultVariation:r(n,"block"),variations:t(n,"block")}}),[n]),{replaceInnerBlocks:i}=(0,Ie.useDispatch)(Ee.store),s=(0,Ee.useBlockProps)();return(0,ye.createElement)("div",s,(0,ye.createElement)(Ee.__experimentalBlockVariationPicker,{icon:(0,Le.get)(r,["icon","src"]),label:(0,Le.get)(r,["title"]),variations:l,onSelect:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;e.attributes&&o(e.attributes),e.innerBlocks&&i(t,(0,be.createBlocksFromInnerBlocksTemplate)(e.innerBlocks),!0)},allowSkip:!0}))}var Nn=e=>{const{clientId:t}=e,n=(0,Ie.useSelect)((e=>e(Ee.store).getBlocks(t).length>0),[t])?Bn:Tn;return(0,ye.createElement)(n,e)};var zn=[{name:"one-column-full",title:(0,we.__)("100"),description:(0,we.__)("One column"),icon:(0,ye.createElement)(ke.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(ke.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"})),innerBlocks:[["core/column"]],scope:["block"]},{name:"two-columns-equal",title:(0,we.__)("50 / 50"),description:(0,we.__)("Two columns; equal split"),icon:(0,ye.createElement)(ke.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(ke.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"})),isDefault:!0,innerBlocks:[["core/column"],["core/column"]],scope:["block"]},{name:"two-columns-one-third-two-thirds",title:(0,we.__)("30 / 70"),description:(0,we.__)("Two columns; one-third, two-thirds split"),icon:(0,ye.createElement)(ke.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(ke.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"})),innerBlocks:[["core/column",{width:"33.33%"}],["core/column",{width:"66.66%"}]],scope:["block"]},{name:"two-columns-two-thirds-one-third",title:(0,we.__)("70 / 30"),description:(0,we.__)("Two columns; two-thirds, one-third split"),icon:(0,ye.createElement)(ke.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(ke.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"})),innerBlocks:[["core/column",{width:"66.66%"}],["core/column",{width:"33.33%"}]],scope:["block"]},{name:"three-columns-equal",title:(0,we.__)("33 / 33 / 33"),description:(0,we.__)("Three columns; equal split"),icon:(0,ye.createElement)(ke.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(ke.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"})),innerBlocks:[["core/column"],["core/column"],["core/column"]],scope:["block"]},{name:"three-columns-wider-center",title:(0,we.__)("25 / 50 / 25"),description:(0,we.__)("Three columns; wide center column"),icon:(0,ye.createElement)(ke.SVG,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(ke.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"})),innerBlocks:[["core/column",{width:"25%"}],["core/column",{width:"50%"}],["core/column",{width:"25%"}]],scope:["block"]}];const Pn={from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert:e=>{const t=+(100/e.length).toFixed(2),n=e.map((e=>{let{name:n,attributes:o,innerBlocks:r}=e;return["core/column",{width:`${t}%`},[[n,{...o},r]]]}));return(0,be.createBlock)("core/columns",{},(0,be.createBlocksFromInnerBlocksTemplate)(n))},isMatch:e=>{let{length:t}=e;return t&&t<=6}},{type:"block",blocks:["core/media-text"],priority:1,transform:(e,t)=>{const{align:n,backgroundColor:o,textColor:r,style:a,mediaAlt:l,mediaId:i,mediaPosition:s,mediaSizeSlug:c,mediaType:u,mediaUrl:m,mediaWidth:d,verticalAlignment:p}=e;let g;if("image"!==u&&u)g=["core/video",{id:i,src:m}];else{g=["core/image",{...{id:i,alt:l,url:m,sizeSlug:c},...{href:e.href,linkClass:e.linkClass,linkDestination:e.linkDestination,linkTarget:e.linkTarget,rel:e.rel}}]}const h=[["core/column",{width:`${d}%`},[g]],["core/column",{width:100-d+"%"},t]];return"right"===s&&h.reverse(),(0,be.createBlock)("core/columns",{align:n,backgroundColor:o,textColor:r,style:a,verticalAlignment:p},(0,be.createBlocksFromInnerBlocksTemplate)(h))}}]};var In=Pn;const Mn={apiVersion:2,name:"core/columns",title:"Columns",category:"design",description:"Display content in multiple columns, with blocks added to each column.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},isStackedOnMobile:{type:"boolean",default:!0}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0},spacing:{margin:["top","bottom"],padding:!0,__experimentalDefaultControls:{padding:!0}}},editorStyle:"wp-block-columns-editor",style:"wp-block-columns"},{name:Rn}=Mn,Ln={icon:bn,variations:zn,example:{viewportWidth:600,innerBlocks:[{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,we.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.")}},{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg"}},{name:"core/paragraph",attributes:{content:(0,we.__)("Suspendisse commodo neque lacus, a dictum orci interdum et.")}}]},{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,we.__)("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:{content:(0,we.__)("Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.")}}]}]},deprecated:fn,edit:Nn,save:function(e){let{attributes:t}=e;const{isStackedOnMobile:n,verticalAlignment:o}=t,r=nt()({[`are-vertically-aligned-${o}`]:o,"is-not-stacked-on-mobile":!n}),a=Ee.useBlockProps.save({className:r}),l=Ee.useInnerBlocksProps.save(a);return(0,ye.createElement)("div",l)},transforms:In};var Vn=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.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"}));const Hn={"top left":"is-position-top-left","top center":"is-position-top-center","top right":"is-position-top-right","center left":"is-position-center-left","center center":"is-position-center-center",center:"is-position-center-center","center right":"is-position-center-right","bottom left":"is-position-bottom-left","bottom center":"is-position-bottom-center","bottom right":"is-position-bottom-right"},An="image",Fn="video";function Dn(e){return e?{backgroundImage:`url(${e})`}:{}}const Gn=["image","video"];function Un(e){return 50===e||void 0===!e?null:"has-background-dim-"+10*Math.round(e/10)}function On(e){return!e||"center center"===e||"center"===e}function qn(e){return On(e)?"":Hn[e]}function $n(e){return 0!==e&&50!==e&&e?"has-background-dim-"+10*Math.round(e/10):null}function Wn(e){return{...e,dimRatio:e.url?e.dimRatio:100}}const jn={url:{type:"string"},id:{type:"number"},hasParallax:{type:"boolean",default:!1},dimRatio:{type:"number",default:50},overlayColor:{type:"string"},customOverlayColor:{type:"string"},backgroundType:{type:"string",default:"image"},focalPoint:{type:"object"}},Zn={attributes:{...jn,isRepeated:{type:"boolean",default:!1},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""}},supports:{anchor:!0,align:!0,html:!1,spacing:{padding:!0,__experimentalDefaultControls:{padding:!0}},color:{__experimentalDuotone:"> .wp-block-cover__image-background, > .wp-block-cover__video-background",text:!1,background:!1}},save(e){let{attributes:t}=e;const{backgroundType:n,gradient:o,contentPosition:r,customGradient:a,customOverlayColor:l,dimRatio:i,focalPoint:s,hasParallax:c,isRepeated:u,overlayColor:m,url:d,alt:p,id:g,minHeight:h,minHeightUnit:v}=t,b=(0,Ee.getColorClassName)("background-color",m),y=(0,Ee.__experimentalGetGradientClass)(o),f=v?`${h}${v}`:h,_=An===n,k=Fn===n,w=!(c||u),E={..._&&!w?Dn(d):{},backgroundColor:b?void 0:l,background:a&&!d?a:void 0,minHeight:f||void 0},C=s&&w?`${Math.round(100*s.x)}% ${Math.round(100*s.y)}%`:void 0,x=nt()($n(i),b,{"has-background-dim":0!==i,"has-parallax":c,"is-repeated":u,"has-background-gradient":o||a,[y]:!d&&y,"has-custom-content-position":!On(r)},qn(r));return(0,ye.createElement)("div",Ee.useBlockProps.save({className:x,style:E}),d&&(o||a)&&0!==i&&(0,ye.createElement)("span",{"aria-hidden":"true",className:nt()("wp-block-cover__gradient-background",y),style:a?{background:a}:void 0}),_&&w&&d&&(0,ye.createElement)("img",{className:nt()("wp-block-cover__image-background",g?`wp-image-${g}`:null),alt:p,src:d,style:{objectPosition:C},"data-object-fit":"cover","data-object-position":C}),k&&d&&(0,ye.createElement)("video",{className:nt()("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:d,style:{objectPosition:C},"data-object-fit":"cover","data-object-position":C}),(0,ye.createElement)("div",{className:"wp-block-cover__inner-container"},(0,ye.createElement)(Ee.InnerBlocks.Content,null)))},migrate:Wn},Kn={attributes:{...jn,isRepeated:{type:"boolean",default:!1},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"}},supports:{align:!0},save(e){let{attributes:t}=e;const{backgroundType:n,gradient:o,contentPosition:r,customGradient:a,customOverlayColor:l,dimRatio:i,focalPoint:s,hasParallax:c,isRepeated:u,overlayColor:m,url:d,minHeight:p,minHeightUnit:g}=t,h=(0,Ee.getColorClassName)("background-color",m),v=(0,Ee.__experimentalGetGradientClass)(o),b=g?`${p}${g}`:p,y=An===n,f=Fn===n,_=y?Dn(d):{},k={};let w;h||(_.backgroundColor=l),a&&!d&&(_.background=a),_.minHeight=b||void 0,s&&(w=`${Math.round(100*s.x)}% ${Math.round(100*s.y)}%`,y&&!c&&(_.backgroundPosition=w),f&&(k.objectPosition=w));const E=nt()($n(i),h,{"has-background-dim":0!==i,"has-parallax":c,"is-repeated":u,"has-background-gradient":o||a,[v]:!d&&v,"has-custom-content-position":!On(r)},qn(r));return(0,ye.createElement)("div",Ee.useBlockProps.save({className:E,style:_}),d&&(o||a)&&0!==i&&(0,ye.createElement)("span",{"aria-hidden":"true",className:nt()("wp-block-cover__gradient-background",v),style:a?{background:a}:void 0}),f&&d&&(0,ye.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:d,style:k}),(0,ye.createElement)("div",{className:"wp-block-cover__inner-container"},(0,ye.createElement)(Ee.InnerBlocks.Content,null)))},migrate:Wn},Qn={attributes:{...jn,minHeight:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"}},supports:{align:!0},save(e){let{attributes:t}=e;const{backgroundType:n,gradient:o,customGradient:r,customOverlayColor:a,dimRatio:l,focalPoint:i,hasParallax:s,overlayColor:c,url:u,minHeight:m}=t,d=(0,Ee.getColorClassName)("background-color",c),p=(0,Ee.__experimentalGetGradientClass)(o),g=n===An?Dn(u):{};d||(g.backgroundColor=a),i&&!s&&(g.backgroundPosition=`${Math.round(100*i.x)}% ${Math.round(100*i.y)}%`),r&&!u&&(g.background=r),g.minHeight=m||void 0;const h=nt()($n(l),d,{"has-background-dim":0!==l,"has-parallax":s,"has-background-gradient":r,[p]:!u&&p});return(0,ye.createElement)("div",{className:h,style:g},u&&(o||r)&&0!==l&&(0,ye.createElement)("span",{"aria-hidden":"true",className:nt()("wp-block-cover__gradient-background",p),style:r?{background:r}:void 0}),Fn===n&&u&&(0,ye.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:u}),(0,ye.createElement)("div",{className:"wp-block-cover__inner-container"},(0,ye.createElement)(Ee.InnerBlocks.Content,null)))},migrate:Wn},Jn={attributes:{...jn,minHeight:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"}},supports:{align:!0},save(e){let{attributes:t}=e;const{backgroundType:n,gradient:o,customGradient:r,customOverlayColor:a,dimRatio:l,focalPoint:i,hasParallax:s,overlayColor:c,url:u,minHeight:m}=t,d=(0,Ee.getColorClassName)("background-color",c),p=(0,Ee.__experimentalGetGradientClass)(o),g=n===An?Dn(u):{};d||(g.backgroundColor=a),i&&!s&&(g.backgroundPosition=`${100*i.x}% ${100*i.y}%`),r&&!u&&(g.background=r),g.minHeight=m||void 0;const h=nt()($n(l),d,{"has-background-dim":0!==l,"has-parallax":s,"has-background-gradient":r,[p]:!u&&p});return(0,ye.createElement)("div",{className:h,style:g},u&&(o||r)&&0!==l&&(0,ye.createElement)("span",{"aria-hidden":"true",className:nt()("wp-block-cover__gradient-background",p),style:r?{background:r}:void 0}),Fn===n&&u&&(0,ye.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:u}),(0,ye.createElement)("div",{className:"wp-block-cover__inner-container"},(0,ye.createElement)(Ee.InnerBlocks.Content,null)))},migrate:Wn},Yn={attributes:{...jn,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"}},supports:{align:!0},save(e){let{attributes:t}=e;const{backgroundType:n,contentAlign:o,customOverlayColor:r,dimRatio:a,focalPoint:l,hasParallax:i,overlayColor:s,title:c,url:u}=t,m=(0,Ee.getColorClassName)("background-color",s),d=n===An?Dn(u):{};m||(d.backgroundColor=r),l&&!i&&(d.backgroundPosition=`${100*l.x}% ${100*l.y}%`);const p=nt()($n(a),m,{"has-background-dim":0!==a,"has-parallax":i,[`has-${o}-content`]:"center"!==o});return(0,ye.createElement)("div",{className:p,style:d},Fn===n&&u&&(0,ye.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:u}),!Ee.RichText.isEmpty(c)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"p",className:"wp-block-cover-text",value:c}))},migrate(e){const t={...e,dimRatio:e.url?e.dimRatio:100};return[(0,Le.omit)(t,["title","contentAlign"]),[(0,be.createBlock)("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:(0,we.__)("Write title…")})]]}},Xn={attributes:{...jn,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"},align:{type:"string"}},supports:{className:!1},save(e){let{attributes:t}=e;const{url:n,title:o,hasParallax:r,dimRatio:a,align:l,contentAlign:i,overlayColor:s,customOverlayColor:c}=t,u=(0,Ee.getColorClassName)("background-color",s),m=Dn(n);u||(m.backgroundColor=c);const d=nt()("wp-block-cover-image",$n(a),u,{"has-background-dim":0!==a,"has-parallax":r,[`has-${i}-content`]:"center"!==i},l?`align${l}`:null);return(0,ye.createElement)("div",{className:d,style:m},!Ee.RichText.isEmpty(o)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"p",className:"wp-block-cover-image-text",value:o}))},migrate(e){const t={...e,dimRatio:e.url?e.dimRatio:100};return[(0,Le.omit)(t,["title","contentAlign","align"]),[(0,be.createBlock)("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:(0,we.__)("Write title…")})]]}},eo={attributes:{...jn,title:{type:"string",source:"html",selector:"h2"},align:{type:"string"},contentAlign:{type:"string",default:"center"}},supports:{className:!1},save(e){let{attributes:t}=e;const{url:n,title:o,hasParallax:r,dimRatio:a,align:l}=t,i=Dn(n),s=nt()("wp-block-cover-image",$n(a),{"has-background-dim":0!==a,"has-parallax":r},l?`align${l}`:null);return(0,ye.createElement)("section",{className:s,style:i},(0,ye.createElement)(Ee.RichText.Content,{tagName:"h2",value:o}))},migrate(e){const t={...e,dimRatio:e.url?e.dimRatio:100};return[(0,Le.omit)(t,["title","contentAlign","align"]),[(0,be.createBlock)("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:(0,we.__)("Write title…")})]]}};var to=[Zn,Kn,Qn,Jn,Yn,Xn,eo],no=n(5027),oo=n.n(no),ro={grad:.9,turn:360,rad:360/(2*Math.PI)},ao=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},lo=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},io=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},so=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},co=function(e){return{r:io(e.r,0,255),g:io(e.g,0,255),b:io(e.b,0,255),a:io(e.a)}},uo=function(e){return{r:lo(e.r),g:lo(e.g),b:lo(e.b),a:lo(e.a,3)}},mo=/^#([0-9a-f]{3,8})$/i,po=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},go=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,a=Math.max(t,n,o),l=a-Math.min(t,n,o),i=l?a===t?(n-o)/l:a===n?2+(o-t)/l:4+(t-n)/l:0;return{h:60*(i<0?i+6:i),s:a?l/a*100:0,v:a/255*100,a:r}},ho=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var a=Math.floor(t),l=o*(1-n),i=o*(1-(t-a)*n),s=o*(1-(1-t+a)*n),c=a%6;return{r:255*[o,i,l,l,s,o][c],g:255*[s,o,o,i,l,l][c],b:255*[l,l,s,o,o,i][c],a:r}},vo=function(e){return{h:so(e.h),s:io(e.s,0,100),l:io(e.l,0,100),a:io(e.a)}},bo=function(e){return{h:lo(e.h),s:lo(e.s),l:lo(e.l),a:lo(e.a,3)}},yo=function(e){return ho((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},fo=function(e){return{h:(t=go(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,ko=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,wo=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Eo=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Co={string:[[function(e){var t=mo.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?lo(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?lo(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=wo.exec(e)||Eo.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:co({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)||ko.exec(e);if(!t)return null;var n,o,r=vo({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(ro[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return yo(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,a=void 0===r?1:r;return ao(t)&&ao(n)&&ao(o)?co({r:Number(t),g:Number(n),b:Number(o),a:Number(a)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,a=void 0===r?1:r;if(!ao(t)||!ao(n)||!ao(o))return null;var l=vo({h:Number(t),s:Number(n),l:Number(o),a:Number(a)});return yo(l)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,a=void 0===r?1:r;if(!ao(t)||!ao(n)||!ao(o))return null;var l=function(e){return{h:so(e.h),s:io(e.s,0,100),v:io(e.v,0,100),a:io(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(a)});return ho(l)},"hsv"]]},xo=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},So=function(e){return"string"==typeof e?xo(e.trim(),Co.string):"object"==typeof e&&null!==e?xo(e,Co.object):[null,void 0]},Bo=function(e,t){var n=fo(e);return{h:n.h,s:io(n.s+100*t,0,100),l:n.l,a:n.a}},To=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},No=function(e,t){var n=fo(e);return{h:n.h,s:n.s,l:io(n.l+100*t,0,100),a:n.a}},zo=function(){function e(e){this.parsed=So(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return lo(To(this.rgba),2)},e.prototype.isDark=function(){return To(this.rgba)<.5},e.prototype.isLight=function(){return To(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=uo(this.rgba)).r,n=e.g,o=e.b,a=(r=e.a)<1?po(lo(255*r)):"","#"+po(t)+po(n)+po(o)+a;var e,t,n,o,r,a},e.prototype.toRgb=function(){return uo(this.rgba)},e.prototype.toRgbString=function(){return t=(e=uo(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 bo(fo(this.rgba))},e.prototype.toHslString=function(){return t=(e=bo(fo(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=go(this.rgba),{h:lo(e.h),s:lo(e.s),v:lo(e.v),a:lo(e.a,3)};var e},e.prototype.invert=function(){return Po({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),Po(Bo(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Po(Bo(this.rgba,-e))},e.prototype.grayscale=function(){return Po(Bo(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Po(No(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Po(No(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?Po({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):lo(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=fo(this.rgba);return"number"==typeof e?Po({h:e,s:t.s,l:t.l,a:t.a}):lo(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Po(e).toHex()},e}(),Po=function(e){return e instanceof zo?e:new zo(e)},Io=[];!function(e){e.forEach((function(e){Io.indexOf(e)<0&&(e(zo,Co),Io.push(e))}))}([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 a={};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 s=this.toRgb(),c=1/0,u="black";if(!a.length)for(var m in n)a[m]=new e(n[m]).toRgb();for(var d in n){var p=(r=s,l=a[d],Math.pow(r.r-l.r,2)+Math.pow(r.g-l.g,2)+Math.pow(r.b-l.b,2));p<c&&(c=p,u=d)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}]);const{__Visualizer:Mo}=ke.__experimentalBoxControl;function Ro(){return Ro.fastAverageColor||(Ro.fastAverageColor=new(oo())),Ro.fastAverageColor}function Lo(e){let{onChange:t,onUnitChange:n,unit:o="px",value:r=""}=e;const[a,l]=(0,ye.useState)(null),i=`block-cover-height-input-${(0,ot.useInstanceId)(Ee.__experimentalUnitControl)}`,s="px"===o,c=(0,ke.__experimentalUseCustomUnits)({availableUnits:(0,Ee.useSetting)("spacing.units")||["px","em","rem","vw","vh"],defaultValues:{px:"430",em:"20",rem:"20",vw:"20",vh:"50"}}),u=null!==a?a:r,m=s?50:0;return(0,ye.createElement)(ke.BaseControl,{label:(0,we.__)("Minimum height of cover"),id:i},(0,ye.createElement)(Ee.__experimentalUnitControl,{id:i,isResetValueOnUnitChange:!0,min:m,onBlur:()=>{null!==a&&l(null)},onChange:e=>{const o=""!==e?parseFloat(e):void 0;isNaN(o)&&void 0!==o?l(e):(l(null),t(o),void 0===o&&n())},onUnitChange:n,style:{maxWidth:80},unit:o,units:c,value:u}))}const Vo={top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1};function Ho(e){let{className:t,onResizeStart:n,onResize:o,onResizeStop:r,...a}=e;const[l,i]=(0,ye.useState)(!1);return(0,ye.createElement)(ke.ResizableBox,gt({className:nt()(t,{"is-resizing":l}),enable:Vo,onResizeStart:(e,t,r)=>{n(r.clientHeight),o(r.clientHeight)},onResize:(e,t,n)=>{o(n.clientHeight),l||i(!0)},onResizeStop:(e,t,n)=>{r(n.clientHeight),i(!1)}},a))}function Ao(e){let{x:t,y:n}=e;return`${Math.round(100*t)}% ${Math.round(100*n)}%`}function Fo(e){let{disableMediaButtons:t=!1,children:n,noticeUI:o,noticeOperations:r,onSelectMedia:a,style:l}=e;const{removeAllNotices:i,createErrorNotice:s}=r;return(0,ye.createElement)(Ee.MediaPlaceholder,{icon:(0,ye.createElement)(Ee.BlockIcon,{icon:Vn}),labels:{title:(0,we.__)("Cover"),instructions:(0,we.__)("Drag and drop onto this block, upload, or select existing media from your library.")},onSelect:a,accept:"image/*,video/*",allowedTypes:Gn,notices:o,disableMediaButtons:t,onError:e=>{i(),s(e)},style:l},n)}var Do=(0,ot.compose)([(0,Ie.withDispatch)((e=>{const{toggleSelection:t,__unstableMarkNextChangeAsNotPersistent:n}=e(Ee.store);return{toggleSelection:t,markNextChangeAsNotPersistent:n}})),(0,Ee.withColors)({overlayColor:"background-color"}),ke.withNotices,ot.withInstanceId])((function(e){var t,n,o;let{attributes:r,clientId:a,isSelected:l,noticeUI:i,noticeOperations:s,overlayColor:c,setAttributes:u,setOverlayColor:m,toggleSelection:d,markNextChangeAsNotPersistent:p}=e;const{contentPosition:g,id:h,backgroundType:v,dimRatio:b,focalPoint:y,hasParallax:f,isDark:_,isRepeated:k,minHeight:w,minHeightUnit:E,style:C,url:x,alt:S,allowedBlocks:B,templateLock:T}=r,{gradientClass:N,gradientValue:z,setGradient:P}=(0,Ee.__experimentalUseGradient)(),I=function(e,t){return n=>{if(!n||!n.url)return void e({url:void 0,id:void 0});let o;if((0,Pe.isBlobURL)(n.url)&&(n.type=(0,Pe.getBlobTypeByURL)(n.url)),n.media_type)o=n.media_type===An?An:Fn;else{if(n.type!==An&&n.type!==Fn)return;o=n.type}e({dimRatio:100===t?50:t,url:n.url,id:n.id,alt:null==n?void 0:n.alt,backgroundType:o,...o===Fn?{focalPoint:void 0,hasParallax:void 0}:{}})}}(u,b),M=((e,t)=>!e&&(0,Pe.isBlobURL)(t))(h,x),[R,L]=(0,ye.useState)(w),[V,H]=(0,ye.useState)(E),A="vh"===E&&100===w,F=(0,ye.useRef)(),D=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;const[r,a]=(0,ye.useState)(!1);return(0,ye.useEffect)((()=>{e&&t<=50&&o.current&&Ro().getColorAsync(o.current,(e=>{a(e.isDark)}))}),[e,e&&t<=50&&o.current,a]),(0,ye.useEffect)((()=>{if(t>50||!e){if(!n)return void a(!0);a(Po(n).isDark())}}),[n,t>50||!e,a]),(0,ye.useEffect)((()=>{e||n||a(!1)}),[!e&&!n,a]),r}(x,b,c.color,F);(0,ye.useEffect)((()=>{p(),u({isDark:D})}),[D]);const G=An===v,U=Fn===v,[O,q]=(0,ye.useState)(null),$=E?`${w}${E}`:w,W=!(f||k),j={...G&&!W?Dn(x):void 0,minHeight:O||$||void 0},Z={backgroundColor:c.color},K={objectPosition:y&&W?Ao(y):void 0},Q=!!(x||c.color||z),J=U||G&&(!f||k),Y=e=>{const[t,n]=F.current?[F.current.style,"objectPosition"]:[te.current.style,"backgroundPosition"];t[n]=Ao(e)},X=(0,Ie.useSelect)((e=>e(Ee.store).getBlock(a).innerBlocks.length>0),[a]),ee=(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(Ee.__experimentalBlockAlignmentMatrixControl,{label:(0,we.__)("Change content position"),value:g,onChange:e=>u({contentPosition:e}),isDisabled:!X}),(0,ye.createElement)(Ee.__experimentalBlockFullHeightAligmentControl,{isActive:A,onToggle:()=>A?u("vh"===V&&100===R?{minHeight:void 0,minHeightUnit:void 0}:{minHeight:R,minHeightUnit:V}):(L(w),H(E),u({minHeight:100,minHeightUnit:"vh"})),isDisabled:!X})),(0,ye.createElement)(Ee.BlockControls,{group:"other"},(0,ye.createElement)(Ee.MediaReplaceFlow,{mediaId:h,mediaURL:x,allowedTypes:Gn,accept:"image/*,video/*",onSelect:I,name:x?(0,we.__)("Replace"):(0,we.__)("Add Media")})),(0,ye.createElement)(Ee.InspectorControls,null,!!x&&(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Media settings")},G&&(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Fixed background"),checked:f,onChange:()=>{u({hasParallax:!f,...f?{}:{focalPoint:void 0}})}}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Repeated background"),checked:k,onChange:()=>{u({isRepeated:!k})}})),J&&(0,ye.createElement)(ke.FocalPointPicker,{label:(0,we.__)("Focal point picker"),url:x,value:y,onDragStart:Y,onDrag:Y,onChange:e=>u({focalPoint:e})}),x&&G&&W&&(0,ye.createElement)(ke.TextareaControl,{label:(0,we.__)("Alt text (alternative text)"),value:S,onChange:e=>u({alt:e}),help:(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.ExternalLink,{href:"https://www.w3.org/WAI/tutorials/images/decision-tree"},(0,we.__)("Describe the purpose of the image")),(0,we.__)("Leave empty if the image is purely decorative."))}),(0,ye.createElement)(ke.PanelRow,null,(0,ye.createElement)(ke.Button,{variant:"secondary",isSmall:!0,className:"block-library-cover__reset-button",onClick:()=>u({url:void 0,id:void 0,backgroundType:void 0,focalPoint:void 0,hasParallax:void 0,isRepeated:void 0})},(0,we.__)("Clear Media")))),(0,ye.createElement)(Ee.__experimentalPanelColorGradientSettings,{__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,title:(0,we.__)("Overlay"),initialOpen:!0,settings:[{colorValue:c.color,gradientValue:z,onColorChange:m,onGradientChange:P,label:(0,we.__)("Color")}]},(0,ye.createElement)(ke.RangeControl,{label:(0,we.__)("Opacity"),value:b,onChange:e=>u({dimRatio:e}),min:0,max:100,step:10,required:!0}))),(0,ye.createElement)(Ee.InspectorControls,{__experimentalGroup:"dimensions"},(0,ye.createElement)(ke.__experimentalToolsPanelItem,{hasValue:()=>!!w,label:(0,we.__)("Minimum height"),onDeselect:()=>u({minHeight:void 0,minHeightUnit:void 0}),resetAllFilter:()=>({minHeight:void 0,minHeightUnit:void 0}),isShownByDefault:!0,panelId:a},(0,ye.createElement)(Lo,{value:O||w,unit:E,onChange:e=>u({minHeight:e}),onUnitChange:e=>u({minHeightUnit:e})})))),te=(0,ye.useRef)(),ne=(0,Ee.useBlockProps)({ref:te}),oe=function(e){return[["core/paragraph",{align:"center",placeholder:(0,we.__)("Write title…"),...e}]]}({fontSize:!(null===(t=(0,Ee.useSetting)("typography.fontSizes"))||void 0===t||!t.length)?"large":void 0}),re=(0,Ee.useInnerBlocksProps)({className:"wp-block-cover__inner-container"},{template:oe,templateInsertUpdatesSelection:!0,allowedBlocks:B,templateLock:T});if(!X&&!Q)return(0,ye.createElement)(ye.Fragment,null,ee,(0,ye.createElement)("div",gt({},ne,{className:nt()("is-placeholder",ne.className)}),(0,ye.createElement)(Fo,{noticeUI:i,onSelectMedia:I,noticeOperations:s,style:{minHeight:O||$||void 0}},(0,ye.createElement)("div",{className:"wp-block-cover__placeholder-background-options"},(0,ye.createElement)(Ee.ColorPalette,{disableCustomColors:!0,value:c.color,onChange:m,clearable:!1}))),(0,ye.createElement)(Ho,{className:"block-library-cover__resize-container",onResizeStart:()=>{u({minHeightUnit:"px"}),d(!1)},onResize:q,onResizeStop:e=>{d(!0),u({minHeight:e}),q(null)},showHandle:l})));const ae=nt()({"is-dark-theme":_,"is-light":!_,"is-transient":M,"has-parallax":f,"is-repeated":k,"has-custom-content-position":!On(g)},qn(g));return(0,ye.createElement)(ye.Fragment,null,ee,(0,ye.createElement)("div",gt({},ne,{className:nt()(ae,ne.className),style:{...j,...ne.style},"data-url":x}),(0,ye.createElement)(Mo,{values:null==C||null===(n=C.spacing)||void 0===n?void 0:n.padding,showValues:null==C||null===(o=C.visualizers)||void 0===o?void 0:o.padding}),(0,ye.createElement)(Ho,{className:"block-library-cover__resize-container",onResizeStart:()=>{u({minHeightUnit:"px"}),d(!1)},onResize:q,onResizeStop:e=>{d(!0),u({minHeight:e}),q(null)},showHandle:l}),(0,ye.createElement)("span",{"aria-hidden":"true",className:nt()(Un(b),{[c.class]:c.class},"wp-block-cover__gradient-background",N,{"has-background-dim":void 0!==b,"has-background-gradient":z,[N]:!x&&N}),style:{backgroundImage:z,...Z}}),x&&G&&W&&(0,ye.createElement)("img",{ref:F,className:"wp-block-cover__image-background",alt:S,src:x,style:K}),x&&U&&(0,ye.createElement)("video",{ref:F,className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:x,style:K}),M&&(0,ye.createElement)(ke.Spinner,null),(0,ye.createElement)(Fo,{disableMediaButtons:!0,noticeUI:i,onSelectMedia:I,noticeOperations:s}),(0,ye.createElement)("div",re)))}));var Go={from:[{type:"block",blocks:["core/image"],transform:e=>{var t;let{caption:n,url:o,alt:r,align:a,id:l,anchor:i,style:s}=e;return(0,be.createBlock)("core/cover",{dimRatio:50,url:o,alt:r,align:a,id:l,anchor:i,style:{color:{duotone:null==s||null===(t=s.color)||void 0===t?void 0:t.duotone}}},[(0,be.createBlock)("core/paragraph",{content:n,fontSize:"large"})])}},{type:"block",blocks:["core/video"],transform:e=>{let{caption:t,src:n,align:o,id:r,anchor:a}=e;return(0,be.createBlock)("core/cover",{dimRatio:50,url:n,align:o,id:r,backgroundType:Fn,anchor:a},[(0,be.createBlock)("core/paragraph",{content:t,fontSize:"large"})])}},{type:"block",blocks:["core/group"],isMatch:e=>{var t,n;let{backgroundColor:o,gradient:r,style:a}=e;return o||(null==a||null===(t=a.color)||void 0===t?void 0:t.background)||(null==a||null===(n=a.color)||void 0===n?void 0:n.gradient)||r},transform:(e,t)=>{var n,o;let{align:r,anchor:a,backgroundColor:l,gradient:i,style:s}=e;return(0,be.createBlock)("core/cover",{align:r,anchor:a,overlayColor:l,customOverlayColor:null==s||null===(n=s.color)||void 0===n?void 0:n.background,gradient:i,customGradient:null==s||null===(o=s.color)||void 0===o?void 0:o.gradient},t)}}],to:[{type:"block",blocks:["core/image"],isMatch:e=>{let{backgroundType:t,url:n,overlayColor:o,customOverlayColor:r,gradient:a,customGradient:l}=e;return n?t===An:!(o||r||a||l)},transform:e=>{var t;let{title:n,url:o,alt:r,align:a,id:l,anchor:i,style:s}=e;return(0,be.createBlock)("core/image",{caption:n,url:o,alt:r,align:a,id:l,anchor:i,style:{color:{duotone:null==s||null===(t=s.color)||void 0===t?void 0:t.duotone}}})}},{type:"block",blocks:["core/video"],isMatch:e=>{let{backgroundType:t,url:n,overlayColor:o,customOverlayColor:r,gradient:a,customGradient:l}=e;return n?t===Fn:!(o||r||a||l)},transform:e=>{let{title:t,url:n,align:o,id:r,anchor:a}=e;return(0,be.createBlock)("core/video",{caption:t,src:n,id:r,align:o,anchor:a})}}]};const Uo={apiVersion:2,name:"core/cover",title:"Cover",category:"media",description:"Add an image or video with a text overlay — great for headers.",textdomain:"default",attributes:{url:{type:"string"},id:{type:"number"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},hasParallax:{type:"boolean",default:!1},isRepeated:{type:"boolean",default:!1},dimRatio:{type:"number",default:100},overlayColor:{type:"string"},customOverlayColor:{type:"string"},backgroundType:{type:"string",default:"image"},focalPoint:{type:"object"},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"},isDark:{type:"boolean",default:!0},allowedBlocks:{type:"array"},templateLock:{type:["string","boolean"],enum:["all","insert",!1]}},supports:{anchor:!0,align:!0,html:!1,spacing:{padding:!0,__experimentalDefaultControls:{padding:!0}},color:{__experimentalDuotone:"> .wp-block-cover__image-background, > .wp-block-cover__video-background",text:!1,background:!1}},editorStyle:"wp-block-cover-editor",style:"wp-block-cover"},{name:Oo}=Uo,qo={icon:Vn,example:{attributes:{customOverlayColor:"#065174",dimRatio:40,url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg"},innerBlocks:[{name:"core/paragraph",attributes:{customFontSize:48,content:(0,we.__)("<strong>Snow Patrol</strong>"),align:"center"}}]},transforms:Go,save:function(e){let{attributes:t}=e;const{backgroundType:n,gradient:o,contentPosition:r,customGradient:a,customOverlayColor:l,dimRatio:i,focalPoint:s,hasParallax:c,isDark:u,isRepeated:m,overlayColor:d,url:p,alt:g,id:h,minHeight:v,minHeightUnit:b}=t,y=(0,Ee.getColorClassName)("background-color",d),f=(0,Ee.__experimentalGetGradientClass)(o),_=b?`${v}${b}`:v,k=An===n,w=Fn===n,E=!(c||m),C={...k&&!E?Dn(p):{},minHeight:_||void 0},x={backgroundColor:y?void 0:l,background:a||void 0},S=s&&E?`${Math.round(100*s.x)}% ${Math.round(100*s.y)}%`:void 0,B=nt()({"is-light":!u,"has-parallax":c,"is-repeated":m,"has-custom-content-position":!On(r)},qn(r));return(0,ye.createElement)("div",Ee.useBlockProps.save({className:B,style:C}),(0,ye.createElement)("span",{"aria-hidden":"true",className:nt()(y,Un(i),"wp-block-cover__gradient-background",f,{"has-background-dim":void 0!==i,"has-background-gradient":o||a,[f]:!p&&f}),style:x}),k&&E&&p&&(0,ye.createElement)("img",{className:nt()("wp-block-cover__image-background",h?`wp-image-${h}`:null),alt:g,src:p,style:{objectPosition:S},"data-object-fit":"cover","data-object-position":S}),w&&p&&(0,ye.createElement)("video",{className:nt()("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:p,style:{objectPosition:S},"data-object-fit":"cover","data-object-position":S}),(0,ye.createElement)("div",Ee.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})))},edit:Do,deprecated:to};var $o=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.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"}));function Wo(e){return e?(0,we.__)("This embed will preserve its aspect ratio when the browser is resized."):(0,we.__)("This embed may not preserve its aspect ratio when the browser is resized.")}var jo=e=>{let{blockSupportsResponsive:t,showEditButton:n,themeSupportsResponsive:o,allowResponsive:r,toggleResponsive:a,switchBackToURLInput:l}=e;return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(ke.ToolbarGroup,null,n&&(0,ye.createElement)(ke.ToolbarButton,{className:"components-toolbar__control",label:(0,we.__)("Edit URL"),icon:$o,onClick:l}))),o&&t&&(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Media settings"),className:"blocks-responsive"},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Resize for smaller devices"),checked:r,help:Wo,onChange:a}))))};const Zo=(0,ye.createElement)(ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(ke.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"})),Ko=(0,ye.createElement)(ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(ke.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"})),Qo=(0,ye.createElement)(ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(ke.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"})),Jo=(0,ye.createElement)(ke.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(ke.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"})),Yo={foreground:"#1da1f2",src:(0,ye.createElement)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(ke.G,null,(0,ye.createElement)(ke.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"})))},Xo={foreground:"#ff0000",src:(0,ye.createElement)(ke.SVG,{viewBox:"0 0 24 24"},(0,ye.createElement)(ke.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"}))},er={foreground:"#3b5998",src:(0,ye.createElement)(ke.SVG,{viewBox:"0 0 24 24"},(0,ye.createElement)(ke.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"}))},tr=(0,ye.createElement)(ke.SVG,{viewBox:"0 0 24 24"},(0,ye.createElement)(ke.G,null,(0,ye.createElement)(ke.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"}))),nr={foreground:"#0073AA",src:(0,ye.createElement)(ke.SVG,{viewBox:"0 0 24 24"},(0,ye.createElement)(ke.G,null,(0,ye.createElement)(ke.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"})))},or={foreground:"#1db954",src:(0,ye.createElement)(ke.SVG,{viewBox:"0 0 24 24"},(0,ye.createElement)(ke.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"}))},rr=(0,ye.createElement)(ke.SVG,{viewBox:"0 0 24 24"},(0,ye.createElement)(ke.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"})),ar={foreground:"#1ab7ea",src:(0,ye.createElement)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(ke.G,null,(0,ye.createElement)(ke.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"})))},lr=(0,ye.createElement)(ke.SVG,{viewBox:"0 0 24 24"},(0,ye.createElement)(ke.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"})),ir={foreground:"#35465c",src:(0,ye.createElement)(ke.SVG,{viewBox:"0 0 24 24"},(0,ye.createElement)(ke.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"}))},sr=(0,ye.createElement)(ke.SVG,{viewBox:"0 0 24 24"},(0,ye.createElement)(ke.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"}),(0,ye.createElement)(ke.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"}),(0,ye.createElement)(ke.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"})),cr=(0,ye.createElement)(ke.SVG,{viewBox:"0 0 24 24"},(0,ye.createElement)(ke.Path,{d:"m.0206909 21 19.8160091-13.07806 3.5831 6.20826z",fill:"#4bc7ee"}),(0,ye.createElement)(ke.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"}),(0,ye.createElement)(ke.Path,{d:"m.0206909 21 15.2439091-16.38571 4.3029 7.32271z",fill:"#c3d82e"}),(0,ye.createElement)(ke.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"}),(0,ye.createElement)(ke.Path,{d:"m.0206909 21 19.5468091-9.063 1.6621 2.8344z",fill:"#209dbd"}),(0,ye.createElement)(ke.Path,{d:"m.0206909 21 17.9209091-11.82623 1.6259 2.76323z",fill:"#7cb3c9"})),ur=(0,ye.createElement)(ke.SVG,{viewBox:"0 0 24 24"},(0,ye.createElement)(ke.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"})),mr=(0,ye.createElement)(ke.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(ke.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"})),dr=(0,ye.createElement)(ke.SVG,{viewBox:"0 0 44 44"},(0,ye.createElement)(ke.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"}));var pr=()=>(0,ye.createElement)("div",{className:"wp-block-embed is-loading"},(0,ye.createElement)(ke.Spinner,null),(0,ye.createElement)("p",null,(0,we.__)("Embedding…")));var gr=e=>{let{icon:t,label:n,value:o,onSubmit:r,onChange:a,cannotEmbed:l,fallback:i,tryAgain:s}=e;return(0,ye.createElement)(ke.Placeholder,{icon:(0,ye.createElement)(Ee.BlockIcon,{icon:t,showColors:!0}),label:n,className:"wp-block-embed",instructions:(0,we.__)("Paste a link to the content you want to display on your site.")},(0,ye.createElement)("form",{onSubmit:r},(0,ye.createElement)("input",{type:"url",value:o||"",className:"components-placeholder__input","aria-label":n,placeholder:(0,we.__)("Enter URL to embed here…"),onChange:a}),(0,ye.createElement)(ke.Button,{variant:"primary",type:"submit"},(0,we._x)("Embed","button label"))),(0,ye.createElement)("div",{className:"components-placeholder__learn-more"},(0,ye.createElement)(ke.ExternalLink,{href:(0,we.__)("https://wordpress.org/support/article/embeds/")},(0,we.__)("Learn more about embeds"))),l&&(0,ye.createElement)("div",{className:"components-placeholder__error"},(0,ye.createElement)("div",{className:"components-placeholder__instructions"},(0,we.__)("Sorry, this content could not be embedded.")),(0,ye.createElement)(ke.Button,{variant:"secondary",onClick:s},(0,we._x)("Try again","button label"))," ",(0,ye.createElement)(ke.Button,{variant:"secondary",onClick:i},(0,we._x)("Convert to link","button label"))))};const hr={class:"className",frameborder:"frameBorder",marginheight:"marginHeight",marginwidth:"marginWidth"};function vr(e){let{html:t}=e;const n=(0,ye.useRef)(),o=(0,ye.useMemo)((()=>{const e=(new window.DOMParser).parseFromString(t,"text/html").querySelector("iframe"),n={};return e?(Array.from(e.attributes).forEach((e=>{let{name:t,value:o}=e;"style"!==t&&(n[hr[t]||t]=o)})),n):n}),[t]);return(0,ye.useEffect)((()=>{const{ownerDocument:e}=n.current,{defaultView:t}=e;function r(e){let{data:{secret:t,message:r,value:a}={}}=e;"height"===r&&t===o["data-secret"]&&(n.current.height=a)}return t.addEventListener("message",r),()=>{t.removeEventListener("message",r)}}),[]),(0,ye.createElement)("div",{className:"wp-block-embed__wrapper"},(0,ye.createElement)("iframe",gt({ref:(0,ot.useMergeRefs)([n,(0,ot.useFocusableIframe)()]),title:o.title},o)))}class br extends ye.Component{constructor(){super(...arguments),this.hideOverlay=this.hideOverlay.bind(this),this.state={interactive:!1}}static getDerivedStateFromProps(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}hideOverlay(){this.setState({interactive:!0})}render(){const{preview:e,previewable:t,url:n,type:o,caption:r,onCaptionChange:a,isSelected:l,className:i,icon:s,label:c,insertBlocksAfter:u}=this.props,{scripts:m}=e,{interactive:d}=this.state,p="photo"===o?(e=>{const t=e.thumbnail_url||e.url,n=(0,ye.createElement)("p",null,(0,ye.createElement)("img",{src:t,alt:e.title,width:"100%"}));return(0,ye.renderToString)(n)})(e):e.html,g=new URL(n).host.split("."),h=g.splice(g.length-2,g.length-1).join("."),v=(0,we.sprintf)((0,we.__)("Embedded content from %s"),h),b=He()(o,i,"wp-block-embed__wrapper"),y="wp-embed"===o?(0,ye.createElement)(vr,{html:p}):(0,ye.createElement)("div",{className:"wp-block-embed__wrapper"},(0,ye.createElement)(ke.SandBox,{html:p,scripts:m,title:v,type:b,onFocus:this.hideOverlay}),!d&&(0,ye.createElement)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}));return(0,ye.createElement)("figure",{className:He()(i,"wp-block-embed",{"is-type-video":"video"===o})},t?y:(0,ye.createElement)(ke.Placeholder,{icon:(0,ye.createElement)(Ee.BlockIcon,{icon:s,showColors:!0}),label:c},(0,ye.createElement)("p",{className:"components-placeholder__error"},(0,ye.createElement)("a",{href:n},n)),(0,ye.createElement)("p",{className:"components-placeholder__error"},(0,we.sprintf)((0,we.__)("Embedded content from %s can't be previewed in the editor."),h))),(!Ee.RichText.isEmpty(r)||l)&&(0,ye.createElement)(Ee.RichText,{tagName:"figcaption",placeholder:(0,we.__)("Add caption"),value:r,onChange:a,inlineToolbar:!0,__unstableOnSplitAtEnd:()=>u((0,be.createBlock)("core/paragraph"))}))}}var yr=br;var fr=e=>{const{attributes:{providerNameSlug:t,previewable:n,responsive:o,url:r},attributes:a,isSelected:l,onReplace:i,setAttributes:s,insertBlocksAfter:c,onFocus:u}=e,m={title:(0,we._x)("Embed","block title"),icon:Zo},{icon:d,title:p}=(g=t,(null===(h=(0,be.getBlockVariations)(De))||void 0===h?void 0:h.find((e=>{let{name:t}=e;return t===g})))||m);var g,h;const[v,b]=(0,ye.useState)(r),[y,f]=(0,ye.useState)(!1),{invalidateResolution:_}=(0,Ie.useDispatch)(Dt.store),{preview:k,fetching:w,themeSupportsResponsive:E,cannotEmbed:C}=(0,Ie.useSelect)((e=>{var t;const{getEmbedPreview:n,isPreviewEmbedFallback:o,isRequestingEmbedPreview:a,getThemeSupports:l}=e(Dt.store);if(!r)return{fetching:!1,cannotEmbed:!1};const i=n(r),s=o(r),c=!1===(null==i?void 0:i.html)&&void 0===(null==i?void 0:i.type),u=404===(null==i||null===(t=i.data)||void 0===t?void 0:t.status),m=!!i&&!c&&!u;return{preview:m?i:void 0,fetching:a(r),themeSupportsResponsive:l()["responsive-embeds"],cannotEmbed:!m||s}}),[r]),x=()=>{const{allowResponsive:e,className:t}=a;return{...a,...We(k,p,t,o,e)}};(0,ye.useEffect)((()=>{if(null==k||!k.html||!C||w)return;const e=r.replace(/\/$/,"");b(e),f(!1),s({url:e})}),[null==k?void 0:k.html,r]),(0,ye.useEffect)((()=>{if(k&&!y&&(s(x()),i)){const t=Oe(e,x());t&&i(t)}}),[k,y]);const S=(0,Ee.useBlockProps)();if(w)return(0,ye.createElement)(fe.View,S,(0,ye.createElement)(pr,null));const B=(0,we.sprintf)((0,we.__)("%s URL"),p);if(!k||C||y)return(0,ye.createElement)(fe.View,S,(0,ye.createElement)(gr,{icon:d,label:B,onFocus:u,onSubmit:e=>{e&&e.preventDefault(),f(!1),s({url:v})},value:v,cannotEmbed:C,onChange:e=>b(e.target.value),fallback:()=>function(e,t){const n=(0,ye.createElement)("a",{href:e},e);t((0,be.createBlock)("core/paragraph",{content:(0,ye.renderToString)(n)}))}(v,i),tryAgain:()=>{_("getEmbedPreview",[v])}}));const{caption:T,type:N,allowResponsive:z,className:P}=x(),I=nt()(P,e.className);return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(jo,{showEditButton:k&&!C,themeSupportsResponsive:E,blockSupportsResponsive:o,allowResponsive:z,toggleResponsive:()=>{const{allowResponsive:e,className:t}=a,{html:n}=k,r=!e;s({allowResponsive:r,className:$e(n,t,o&&r)})},switchBackToURLInput:()=>f(!0)}),(0,ye.createElement)(fe.View,S,(0,ye.createElement)(yr,{preview:k,previewable:n,className:I,url:v,type:N,caption:T,onCaptionChange:e=>s({caption:e}),isSelected:l,icon:d,label:B,insertBlocksAfter:c})))};const{name:_r}={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"};var kr={from:[{type:"raw",isMatch:e=>{var t,n;return"P"===e.nodeName&&/^\s*(https?:\/\/\S+)\s*$/i.test(e.textContent)&&1===(null===(t=e.textContent)||void 0===t||null===(n=t.match(/https/gi))||void 0===n?void 0:n.length)},transform:e=>(0,be.createBlock)(_r,{url:e.textContent.trim()})}],to:[{type:"block",blocks:["core/paragraph"],isMatch:e=>{let{url:t}=e;return!!t},transform:e=>{let{url:t,caption:n}=e,o=`<a href="${t}">${t}</a>`;return null!=n&&n.trim()&&(o+=`<br />${n}`),(0,be.createBlock)("core/paragraph",{content:o})}}]};const wr=[{name:"twitter",title:"Twitter",icon:Yo,keywords:["tweet",(0,we.__)("social")],description:(0,we.__)("Embed a tweet."),patterns:[/^https?:\/\/(www\.)?twitter\.com\/.+/i],attributes:{providerNameSlug:"twitter",responsive:!0}},{name:"youtube",title:"YouTube",icon:Xo,keywords:[(0,we.__)("music"),(0,we.__)("video")],description:(0,we.__)("Embed a YouTube video."),patterns:[/^https?:\/\/((m|www)\.)?youtube\.com\/.+/i,/^https?:\/\/youtu\.be\/.+/i],attributes:{providerNameSlug:"youtube",responsive:!0}},{name:"facebook",title:"Facebook",icon:er,keywords:[(0,we.__)("social")],description:(0,we.__)("Embed a Facebook post."),scope:["block"],patterns:[],attributes:{providerNameSlug:"facebook",previewable:!1,responsive:!0}},{name:"instagram",title:"Instagram",icon:tr,keywords:[(0,we.__)("image"),(0,we.__)("social")],description:(0,we.__)("Embed an Instagram post."),scope:["block"],patterns:[],attributes:{providerNameSlug:"instagram",responsive:!0}},{name:"wordpress",title:"WordPress",icon:nr,keywords:[(0,we.__)("post"),(0,we.__)("blog")],description:(0,we.__)("Embed a WordPress post."),attributes:{providerNameSlug:"wordpress"}},{name:"soundcloud",title:"SoundCloud",icon:Ko,keywords:[(0,we.__)("music"),(0,we.__)("audio")],description:(0,we.__)("Embed SoundCloud content."),patterns:[/^https?:\/\/(www\.)?soundcloud\.com\/.+/i],attributes:{providerNameSlug:"soundcloud",responsive:!0}},{name:"spotify",title:"Spotify",icon:or,keywords:[(0,we.__)("music"),(0,we.__)("audio")],description:(0,we.__)("Embed Spotify content."),patterns:[/^https?:\/\/(open|play)\.spotify\.com\/.+/i],attributes:{providerNameSlug:"spotify",responsive:!0}},{name:"flickr",title:"Flickr",icon:rr,keywords:[(0,we.__)("image")],description:(0,we.__)("Embed Flickr content."),patterns:[/^https?:\/\/(www\.)?flickr\.com\/.+/i,/^https?:\/\/flic\.kr\/.+/i],attributes:{providerNameSlug:"flickr",responsive:!0}},{name:"vimeo",title:"Vimeo",icon:ar,keywords:[(0,we.__)("video")],description:(0,we.__)("Embed a Vimeo video."),patterns:[/^https?:\/\/(www\.)?vimeo\.com\/.+/i],attributes:{providerNameSlug:"vimeo",responsive:!0}},{name:"animoto",title:"Animoto",icon:cr,description:(0,we.__)("Embed an Animoto video."),patterns:[/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i],attributes:{providerNameSlug:"animoto",responsive:!0}},{name:"cloudup",title:"Cloudup",icon:Zo,description:(0,we.__)("Embed Cloudup content."),patterns:[/^https?:\/\/cloudup\.com\/.+/i],attributes:{providerNameSlug:"cloudup",responsive:!0}},{name:"collegehumor",title:"CollegeHumor",icon:Jo,description:(0,we.__)("Embed CollegeHumor content."),scope:["block"],patterns:[],attributes:{providerNameSlug:"collegehumor",responsive:!0}},{name:"crowdsignal",title:"Crowdsignal",icon:Zo,keywords:["polldaddy",(0,we.__)("survey")],description:(0,we.__)("Embed Crowdsignal (formerly Polldaddy) content."),patterns:[/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.survey\.fm)\/.+/i],attributes:{providerNameSlug:"crowdsignal",responsive:!0}},{name:"dailymotion",title:"Dailymotion",icon:ur,keywords:[(0,we.__)("video")],description:(0,we.__)("Embed a Dailymotion video."),patterns:[/^https?:\/\/(www\.)?dailymotion\.com\/.+/i],attributes:{providerNameSlug:"dailymotion",responsive:!0}},{name:"imgur",title:"Imgur",icon:Qo,description:(0,we.__)("Embed Imgur content."),patterns:[/^https?:\/\/(.+\.)?imgur\.com\/.+/i],attributes:{providerNameSlug:"imgur",responsive:!0}},{name:"issuu",title:"Issuu",icon:Zo,description:(0,we.__)("Embed Issuu content."),patterns:[/^https?:\/\/(www\.)?issuu\.com\/.+/i],attributes:{providerNameSlug:"issuu",responsive:!0}},{name:"kickstarter",title:"Kickstarter",icon:Zo,description:(0,we.__)("Embed Kickstarter content."),patterns:[/^https?:\/\/(www\.)?kickstarter\.com\/.+/i,/^https?:\/\/kck\.st\/.+/i],attributes:{providerNameSlug:"kickstarter",responsive:!0}},{name:"mixcloud",title:"Mixcloud",icon:Ko,keywords:[(0,we.__)("music"),(0,we.__)("audio")],description:(0,we.__)("Embed Mixcloud content."),patterns:[/^https?:\/\/(www\.)?mixcloud\.com\/.+/i],attributes:{providerNameSlug:"mixcloud",responsive:!0}},{name:"reddit",title:"Reddit",icon:lr,description:(0,we.__)("Embed a Reddit thread."),patterns:[/^https?:\/\/(www\.)?reddit\.com\/.+/i],attributes:{providerNameSlug:"reddit",responsive:!0}},{name:"reverbnation",title:"ReverbNation",icon:Ko,description:(0,we.__)("Embed ReverbNation content."),patterns:[/^https?:\/\/(www\.)?reverbnation\.com\/.+/i],attributes:{providerNameSlug:"reverbnation",responsive:!0}},{name:"screencast",title:"Screencast",icon:Jo,description:(0,we.__)("Embed Screencast content."),patterns:[/^https?:\/\/(www\.)?screencast\.com\/.+/i],attributes:{providerNameSlug:"screencast",responsive:!0}},{name:"scribd",title:"Scribd",icon:Zo,description:(0,we.__)("Embed Scribd content."),patterns:[/^https?:\/\/(www\.)?scribd\.com\/.+/i],attributes:{providerNameSlug:"scribd",responsive:!0}},{name:"slideshare",title:"Slideshare",icon:Zo,description:(0,we.__)("Embed Slideshare content."),patterns:[/^https?:\/\/(.+?\.)?slideshare\.net\/.+/i],attributes:{providerNameSlug:"slideshare",responsive:!0}},{name:"smugmug",title:"SmugMug",icon:Qo,description:(0,we.__)("Embed SmugMug content."),patterns:[/^https?:\/\/(.+\.)?smugmug\.com\/.*/i],attributes:{providerNameSlug:"smugmug",previewable:!1,responsive:!0}},{name:"speaker-deck",title:"Speaker Deck",icon:Zo,description:(0,we.__)("Embed Speaker Deck content."),patterns:[/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i],attributes:{providerNameSlug:"speaker-deck",responsive:!0}},{name:"tiktok",title:"TikTok",icon:Jo,keywords:[(0,we.__)("video")],description:(0,we.__)("Embed a TikTok video."),patterns:[/^https?:\/\/(www\.)?tiktok\.com\/.+/i],attributes:{providerNameSlug:"tiktok",responsive:!0}},{name:"ted",title:"TED",icon:Jo,description:(0,we.__)("Embed a TED video."),patterns:[/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i],attributes:{providerNameSlug:"ted",responsive:!0}},{name:"tumblr",title:"Tumblr",icon:ir,keywords:[(0,we.__)("social")],description:(0,we.__)("Embed a Tumblr post."),patterns:[/^https?:\/\/(www\.)?tumblr\.com\/.+/i],attributes:{providerNameSlug:"tumblr",responsive:!0}},{name:"videopress",title:"VideoPress",icon:Jo,keywords:[(0,we.__)("video")],description:(0,we.__)("Embed a VideoPress video."),patterns:[/^https?:\/\/videopress\.com\/.+/i],attributes:{providerNameSlug:"videopress",responsive:!0}},{name:"wordpress-tv",title:"WordPress.tv",icon:Jo,description:(0,we.__)("Embed a WordPress.tv video."),patterns:[/^https?:\/\/wordpress\.tv\/.+/i],attributes:{providerNameSlug:"wordpress-tv",responsive:!0}},{name:"amazon-kindle",title:"Amazon Kindle",icon:sr,keywords:[(0,we.__)("ebook")],description:(0,we.__)("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"}},{name:"pinterest",title:"Pinterest",icon:mr,keywords:[(0,we.__)("social"),(0,we.__)("bookmark")],description:(0,we.__)("Embed Pinterest pins, boards, and profiles."),patterns:[/^https?:\/\/([a-z]{2}|www)\.pinterest\.com(\.(au|mx))?\/.*/i],attributes:{providerNameSlug:"pinterest"}},{name:"wolfram-cloud",title:"Wolfram Cloud",icon:dr,description:(0,we.__)("Embed Wolfram Cloud notebook content."),patterns:[/^https?:\/\/(www\.)?wolframcloud\.com\/obj\/.+/i],attributes:{providerNameSlug:"wolfram-cloud",responsive:!0}}];wr.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.providerNameSlug===t.providerNameSlug)}));var Er=wr;const{attributes:Cr}={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"};var xr=[{attributes:Cr,save(e){let{attributes:{url:t,caption:n,type:o,providerNameSlug:r}}=e;if(!t)return null;const a=nt()("wp-block-embed",{[`is-type-${o}`]:o,[`is-provider-${r}`]:r});return(0,ye.createElement)("figure",{className:a},`\n${t}\n`,!Ee.RichText.isEmpty(n)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:n}))}}];const Sr={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},{name:Br}=Sr,Tr={icon:Zo,edit:fr,save:function(e){let{attributes:t}=e;const{url:n,caption:o,type:r,providerNameSlug:a}=t;if(!n)return null;const l=He()("wp-block-embed",{[`is-type-${r}`]:r,[`is-provider-${a}`]:a,[`wp-block-embed-${a}`]:a});return(0,ye.createElement)("figure",Ee.useBlockProps.save({className:l}),(0,ye.createElement)("div",{className:"wp-block-embed__wrapper"},`\n${n}\n`),!Ee.RichText.isEmpty(o)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:o}))},transforms:kr,variations:Er,deprecated:xr};var Nr=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.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"}));const zr=[{attributes:{id:{type:"number"},href:{type:"string"},fileName:{type:"string",source:"html",selector:"a:not([download])"},textLinkHref:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"href"},textLinkTarget:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"target"},showDownloadButton:{type:"boolean",default:!0},downloadButtonText:{type:"string",source:"html",selector:"a[download]"},displayPreview:{type:"boolean"},previewHeight:{type:"number",default:600}},supports:{anchor:!0,align:!0},save(e){let{attributes:t}=e;const{href:n,fileName:o,textLinkHref:r,textLinkTarget:a,showDownloadButton:l,downloadButtonText:i,displayPreview:s,previewHeight:c}=t,u=Ee.RichText.isEmpty(o)?(0,we.__)("PDF embed"):(0,we.sprintf)((0,we.__)("Embed of %s."),o);return n&&(0,ye.createElement)("div",Ee.useBlockProps.save(),s&&(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)("object",{className:"wp-block-file__embed",data:n,type:"application/pdf",style:{width:"100%",height:`${c}px`},"aria-label":u})),!Ee.RichText.isEmpty(o)&&(0,ye.createElement)("a",{href:r,target:a,rel:a?"noreferrer noopener":void 0},(0,ye.createElement)(Ee.RichText.Content,{value:o})),l&&(0,ye.createElement)("a",{href:n,className:"wp-block-file__button",download:!0},(0,ye.createElement)(Ee.RichText.Content,{value:i})))}}];var Pr=zr,Ir=window.wp.notices;function Mr(e){let{hrefs:t,openInNewWindow:n,showDownloadButton:o,changeLinkDestinationOption:r,changeOpenInNewWindow:a,changeShowDownloadButton:l,displayPreview:i,changeDisplayPreview:s,previewHeight:c,changePreviewHeight:u}=e;const{href:m,textLinkHref:d,attachmentPage:p}=t;let g=[{value:m,label:(0,we.__)("URL")}];return p&&(g=[{value:m,label:(0,we.__)("Media file")},{value:p,label:(0,we.__)("Attachment page")}]),(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.InspectorControls,null,m.endsWith(".pdf")&&(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("PDF settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Show inline embed"),help:i?(0,we.__)("Note: Most phone and tablet browsers won't display embedded PDFs."):null,checked:!!i,onChange:s}),i&&(0,ye.createElement)(ke.RangeControl,{label:(0,we.__)("Height in pixels"),min:Vr,max:Math.max(Hr,c),value:c,onChange:u})),(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Text link settings")},(0,ye.createElement)(ke.SelectControl,{label:(0,we.__)("Link to"),value:d,options:g,onChange:r}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Open in new tab"),checked:n,onChange:a})),(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Download button settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Show download button"),checked:o,onChange:l}))))}const Rr=()=>!(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)&&!Lr("AcroPDF.PDF")&&!Lr("PDF.PdfCtrl")))),Lr=e=>{let t;try{t=new window.ActiveXObject(e)}catch(e){t=void 0}return t},Vr=200,Hr=2e3;function Ar(e){let{text:t,disabled:n}=e;const{createNotice:o}=(0,Ie.useDispatch)(Ir.store),r=(0,ot.useCopyToClipboard)(t,(()=>{o("info",(0,we.__)("Copied URL to clipboard."),{isDismissible:!0,type:"snackbar"})}));return(0,ye.createElement)(ke.ToolbarButton,{className:"components-clipboard-toolbar-button",ref:r,disabled:n},(0,we.__)("Copy URL"))}var Fr=(0,ke.withNotices)((function(e){let{attributes:t,isSelected:n,setAttributes:o,noticeUI:r,noticeOperations:a,clientId:l}=e;const{id:i,fileName:s,href:c,textLinkHref:u,textLinkTarget:m,showDownloadButton:d,downloadButtonText:p,displayPreview:g,previewHeight:h}=t,[v,b]=(0,ye.useState)(!1),{media:y,mediaUpload:f}=(0,Ie.useSelect)((e=>({media:void 0===i?void 0:e(Dt.store).getMedia(i),mediaUpload:e(Ee.store).getSettings().mediaUpload})),[i]),{toggleSelection:_}=(0,Ie.useDispatch)(Ee.store);function k(e){if(e&&e.url){b(!1);const t=e.url.endsWith(".pdf");o({href:e.url,fileName:e.title,textLinkHref:e.url,id:e.id,displayPreview:!!t||void 0,previewHeight:t?600:void 0})}}function w(e){b(!0),a.removeAllNotices(),a.createErrorNotice(e)}function E(e){o({downloadButtonText:e.replace(/<\/?a[^>]*>/g,"")})}(0,ye.useEffect)((()=>{if((0,Pe.isBlobURL)(c)){const e=(0,Pe.getBlobByURL)(c);f({filesList:[e],onFileChange:e=>{let[t]=e;return k(t)},onError:e=>{b(!0),a.createErrorNotice(e)}}),(0,Pe.revokeBlobURL)(c)}void 0===p&&E((0,we._x)("Download","button label"))}),[]),(0,ye.useEffect)((()=>{o({fileId:`wp-block-file--media-${l}`})}),[l]);const C=y&&y.link,x=(0,Ee.useBlockProps)({className:nt()((0,Pe.isBlobURL)(c)&&(0,ke.__unstableGetAnimateClassName)({type:"loading"}),{"is-transient":(0,Pe.isBlobURL)(c)})}),S=Rr()&&g;return!c||v?(0,ye.createElement)("div",x,(0,ye.createElement)(Ee.MediaPlaceholder,{icon:(0,ye.createElement)(Ee.BlockIcon,{icon:Nr}),labels:{title:(0,we.__)("File"),instructions:(0,we.__)("Upload a file or pick one from your media library.")},onSelect:k,notices:r,onError:w,accept:"*"})):(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Mr,{hrefs:{href:c,textLinkHref:u,attachmentPage:C},openInNewWindow:!!m,showDownloadButton:d,changeLinkDestinationOption:function(e){o({textLinkHref:e})},changeOpenInNewWindow:function(e){o({textLinkTarget:!!e&&"_blank"})},changeShowDownloadButton:function(e){o({showDownloadButton:e})},displayPreview:g,changeDisplayPreview:function(e){o({displayPreview:e})},previewHeight:h,changePreviewHeight:function(e){const t=Math.max(parseInt(e,10),Vr);o({previewHeight:t})}}),(0,ye.createElement)(Ee.BlockControls,{group:"other"},(0,ye.createElement)(Ee.MediaReplaceFlow,{mediaId:i,mediaURL:c,accept:"*",onSelect:k,onError:w}),(0,ye.createElement)(Ar,{text:c,disabled:(0,Pe.isBlobURL)(c)})),(0,ye.createElement)("div",x,S&&(0,ye.createElement)(ke.ResizableBox,{size:{height:h},minHeight:Vr,maxHeight:Hr,minWidth:"100%",grid:[10,10],enable:{top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},onResizeStart:()=>_(!1),onResizeStop:function(e,t,n,r){_(!0);const a=parseInt(h+r.height,10);o({previewHeight:a})},showHandle:n},(0,ye.createElement)("object",{className:"wp-block-file__preview",data:c,type:"application/pdf","aria-label":(0,we.__)("Embed of the selected PDF file.")}),!n&&(0,ye.createElement)("div",{className:"wp-block-file__preview-overlay"})),(0,ye.createElement)("div",{className:"wp-block-file__content-wrapper"},(0,ye.createElement)(Ee.RichText,{tagName:"a",value:s,placeholder:(0,we.__)("Write file name…"),withoutInteractiveFormatting:!0,onChange:e=>o({fileName:e}),href:u}),d&&(0,ye.createElement)("div",{className:"wp-block-file__button-richtext-wrapper"},(0,ye.createElement)(Ee.RichText,{tagName:"div","aria-label":(0,we.__)("Download button text"),className:"wp-block-file__button",value:p,withoutInteractiveFormatting:!0,placeholder:(0,we.__)("Add text…"),onChange:e=>E(e)})))))}));var Dr=window.wp.url;const Gr={from:[{type:"files",isMatch:e=>e.length>0,priority:15,transform:e=>{const t=[];return e.forEach((e=>{const n=(0,Pe.createBlobURL)(e);t.push((0,be.createBlock)("core/file",{href:n,fileName:e.name,textLinkHref:n}))})),t}},{type:"block",blocks:["core/audio"],transform:e=>(0,be.createBlock)("core/file",{href:e.src,fileName:e.caption,textLinkHref:e.src,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/video"],transform:e=>(0,be.createBlock)("core/file",{href:e.src,fileName:e.caption,textLinkHref:e.src,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/image"],transform:e=>(0,be.createBlock)("core/file",{href:e.url,fileName:e.caption||(0,Dr.getFilename)(e.url),textLinkHref:e.url,id:e.id,anchor:e.anchor})}],to:[{type:"block",blocks:["core/audio"],isMatch:e=>{let{id:t}=e;if(!t)return!1;const{getMedia:n}=(0,Ie.select)(Dt.store),o=n(t);return!!o&&(0,Le.includes)(o.mime_type,"audio")},transform:e=>(0,be.createBlock)("core/audio",{src:e.href,caption:e.fileName,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/video"],isMatch:e=>{let{id:t}=e;if(!t)return!1;const{getMedia:n}=(0,Ie.select)(Dt.store),o=n(t);return!!o&&(0,Le.includes)(o.mime_type,"video")},transform:e=>(0,be.createBlock)("core/video",{src:e.href,caption:e.fileName,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/image"],isMatch:e=>{let{id:t}=e;if(!t)return!1;const{getMedia:n}=(0,Ie.select)(Dt.store),o=n(t);return!!o&&(0,Le.includes)(o.mime_type,"image")},transform:e=>(0,be.createBlock)("core/image",{url:e.href,caption:e.fileName,id:e.id,anchor:e.anchor})}]};var Ur=Gr;const Or={apiVersion:2,name:"core/file",title:"File",category:"media",description:"Add a link to a downloadable file.",keywords:["document","pdf","download"],textdomain:"default",attributes:{id:{type:"number"},href:{type:"string"},fileId:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"id"},fileName:{type:"string",source:"html",selector:"a:not([download])"},textLinkHref:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"href"},textLinkTarget:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"target"},showDownloadButton:{type:"boolean",default:!0},downloadButtonText:{type:"string",source:"html",selector:"a[download]"},displayPreview:{type:"boolean"},previewHeight:{type:"number",default:600}},supports:{anchor:!0,align:!0},viewScript:"file:./view.min.js",editorStyle:"wp-block-file-editor",style:"wp-block-file"},{name:qr}=Or,$r={icon:Nr,example:{attributes:{href:"https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg",fileName:(0,we._x)("Armstrong_Small_Step","Name of the file")}},transforms:Ur,deprecated:Pr,edit:Fr,save:function(e){let{attributes:t}=e;const{href:n,fileId:o,fileName:r,textLinkHref:a,textLinkTarget:l,showDownloadButton:i,downloadButtonText:s,displayPreview:c,previewHeight:u}=t,m=Ee.RichText.isEmpty(r)?(0,we.__)("PDF embed"):(0,we.sprintf)((0,we.__)("Embed of %s."),r);return n&&(0,ye.createElement)("div",Ee.useBlockProps.save(),c&&(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)("object",{className:"wp-block-file__embed",data:n,type:"application/pdf",style:{width:"100%",height:`${u}px`},"aria-label":m})),!Ee.RichText.isEmpty(r)&&(0,ye.createElement)("a",{id:o,href:a,target:l,rel:l?"noreferrer noopener":void 0},(0,ye.createElement)(Ee.RichText.Content,{value:r})),i&&(0,ye.createElement)("a",{href:n,className:"wp-block-file__button",download:!0,"aria-describedby":o},(0,ye.createElement)(Ee.RichText.Content,{value:s})))}};var Wr=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.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"}));const jr="none",Zr="media",Kr="attachment";const Qr=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"large";const n=(0,Le.pick)(e,["alt","id","link","caption"]);n.url=(0,Le.get)(e,["sizes",t,"url"])||(0,Le.get)(e,["media_details","sizes",t,"source_url"])||e.url;const o=(0,Le.get)(e,["sizes","full","url"])||(0,Le.get)(e,["media_details","sizes","full","source_url"]);return o&&(n.fullUrl=o),n};const Jr="file",Yr="post";function Xr(e){var t;return Math.min(3,null==e||null===(t=e.images)||void 0===t?void 0:t.length)}function ea(e,t){switch(t){case Jr:return{href:(null==e?void 0:e.source_url)||(null==e?void 0:e.url),linkDestination:Zr};case Yr:return{href:null==e?void 0:e.link,linkDestination:Kr};case Zr:return{href:(null==e?void 0:e.source_url)||(null==e?void 0:e.url),linkDestination:Zr};case Kr:return{href:null==e?void 0:e.link,linkDestination:Kr};case jr:return{href:void 0,linkDestination:jr}}return{}}function ta(e){let t=e.linkTo?e.linkTo:"none";"post"===t?t="attachment":"file"===t&&(t="media");const n=e.images.map((n=>function(e,t,n){return(0,be.createBlock)("core/image",{...e.id&&{id:parseInt(e.id)},url:e.url,alt:e.alt,caption:e.caption,sizeSlug:t,...ea(e,n)})}(n,e.sizeSlug,t)));return[{...(0,Le.omit)(e,["images","ids"]),linkTo:t,allowResize:!1},n]}const na={attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string"},sizeSlug:{type:"string",default:"large"}},supports:{anchor:!0,align:!0},save(e){let{attributes:t}=e;const{images:n,columns:o=Xr(t),imageCrop:r,caption:a,linkTo:l}=t,i=`columns-${o} ${r?"is-cropped":""}`;return(0,ye.createElement)("figure",Ee.useBlockProps.save({className:i}),(0,ye.createElement)("ul",{className:"blocks-gallery-grid"},n.map((e=>{let t;switch(l){case Jr:t=e.fullUrl||e.url;break;case Yr:t=e.link}const n=(0,ye.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?`wp-image-${e.id}`:null});return(0,ye.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},(0,ye.createElement)("figure",null,t?(0,ye.createElement)("a",{href:t},n):n,!Ee.RichText.isEmpty(e.caption)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})))}))),!Ee.RichText.isEmpty(a)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:a}))},migrate:e=>ta(e)},oa={attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"},sizeSlug:{type:"string",default:"large"}},supports:{align:!0},isEligible(e){let{linkTo:t}=e;return!t||"attachment"===t||"media"===t},migrate:e=>ta(e),save(e){let{attributes:t}=e;const{images:n,columns:o=Xr(t),imageCrop:r,caption:a,linkTo:l}=t;return(0,ye.createElement)("figure",{className:`columns-${o} ${r?"is-cropped":""}`},(0,ye.createElement)("ul",{className:"blocks-gallery-grid"},n.map((e=>{let t;switch(l){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const n=(0,ye.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?`wp-image-${e.id}`:null});return(0,ye.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},(0,ye.createElement)("figure",null,t?(0,ye.createElement)("a",{href:t},n):n,!Ee.RichText.isEmpty(e.caption)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})))}))),!Ee.RichText.isEmpty(a)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:a}))}},ra={attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},fullUrl:{source:"attribute",selector:"img",attribute:"data-full-url"},link:{source:"attribute",selector:"img",attribute:"data-link"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",default:[]},columns:{type:"number"},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},supports:{align:!0},isEligible(e){let{ids:t}=e;return t&&t.some((e=>"string"==typeof e))},migrate:e=>ta(e),save(e){let{attributes:t}=e;const{images:n,columns:o=Xr(t),imageCrop:r,caption:a,linkTo:l}=t;return(0,ye.createElement)("figure",{className:`columns-${o} ${r?"is-cropped":""}`},(0,ye.createElement)("ul",{className:"blocks-gallery-grid"},n.map((e=>{let t;switch(l){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const n=(0,ye.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?`wp-image-${e.id}`:null});return(0,ye.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},(0,ye.createElement)("figure",null,t?(0,ye.createElement)("a",{href:t},n):n,!Ee.RichText.isEmpty(e.caption)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})))}))),!Ee.RichText.isEmpty(a)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:a}))}},aa={attributes:{images:{type:"array",default:[],source:"query",selector:"ul.wp-block-gallery .blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},fullUrl:{source:"attribute",selector:"img",attribute:"data-full-url"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},link:{source:"attribute",selector:"img",attribute:"data-link"},caption:{type:"array",source:"children",selector:"figcaption"}}},ids:{type:"array",default:[]},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},supports:{align:!0},save(e){let{attributes:t}=e;const{images:n,columns:o=Xr(t),imageCrop:r,linkTo:a}=t;return(0,ye.createElement)("ul",{className:`columns-${o} ${r?"is-cropped":""}`},n.map((e=>{let t;switch(a){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const n=(0,ye.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?`wp-image-${e.id}`:null});return(0,ye.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},(0,ye.createElement)("figure",null,t?(0,ye.createElement)("a",{href:t},n):n,e.caption&&e.caption.length>0&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:e.caption})))})))},migrate:e=>ta(e)},la={attributes:{images:{type:"array",default:[],source:"query",selector:"ul.wp-block-gallery .blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},link:{source:"attribute",selector:"img",attribute:"data-link"},caption:{type:"array",source:"children",selector:"figcaption"}}},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},isEligible(e){let{images:t,ids:n}=e;return t&&t.length>0&&(!n&&t||n&&t&&n.length!==t.length||(0,Le.some)(t,((e,t)=>!e&&null!==n[t]||parseInt(e,10)!==n[t])))},migrate:e=>ta(e),supports:{align:!0},save(e){let{attributes:t}=e;const{images:n,columns:o=Xr(t),imageCrop:r,linkTo:a}=t;return(0,ye.createElement)("ul",{className:`columns-${o} ${r?"is-cropped":""}`},n.map((e=>{let t;switch(a){case"media":t=e.url;break;case"attachment":t=e.link}const n=(0,ye.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-link":e.link,className:e.id?`wp-image-${e.id}`:null});return(0,ye.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},(0,ye.createElement)("figure",null,t?(0,ye.createElement)("a",{href:t},n):n,e.caption&&e.caption.length>0&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:e.caption})))})))}},ia={attributes:{images:{type:"array",default:[],source:"query",selector:"div.wp-block-gallery figure.blocks-gallery-image img",query:{url:{source:"attribute",attribute:"src"},alt:{source:"attribute",attribute:"alt",default:""},id:{source:"attribute",attribute:"data-id"}}},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"},align:{type:"string",default:"none"}},supports:{align:!0},save(e){let{attributes:t}=e;const{images:n,columns:o=Xr(t),align:r,imageCrop:a,linkTo:l}=t,i=nt()(`columns-${o}`,{alignnone:"none"===r,"is-cropped":a});return(0,ye.createElement)("div",{className:i},n.map((e=>{let t;switch(l){case"media":t=e.url;break;case"attachment":t=e.link}const n=(0,ye.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id});return(0,ye.createElement)("figure",{key:e.id||e.url,className:"blocks-gallery-image"},t?(0,ye.createElement)("a",{href:t},n):n)})))},migrate:e=>ta(e)};var sa=[na,oa,ra,aa,la,ia],ca=window.wp.viewport;const ua=(0,ye.createElement)(Ee.BlockIcon,{icon:Wr}),ma=20,da="none",pa="media",ga="attachment",ha="custom",va=["noreferrer","noopener"],ba=["image"];function ya(e,t){switch(t){case"file":case Zr:return{href:(null==e?void 0:e.source_url)||(null==e?void 0:e.url),linkDestination:pa};case"post":case Kr:return{href:null==e?void 0:e.link,linkDestination:ga};case jr:return{href:void 0,linkDestination:da}}return{}}function fa(e,t){let{rel:n}=t;const o=e?"_blank":void 0;let r;return r=o||n?function(e){let t=e;return void 0===e||(0,Le.isEmpty)(t)||(0,Le.isEmpty)(t)||((0,Le.each)(va,(e=>{const n=new RegExp("\\b"+e+"\\b","gi");t=t.replace(n,"")})),t!==e&&(t=t.trim()),(0,Le.isEmpty)(t)&&(t=void 0)),t}(n):void 0,{linkTarget:o,rel:r}}const _a=["core/image"];function ka(e){let{isHidden:t,captionFocused:n,onFocusCaption:o,className:r,value:a,placeholder:l,tagName:i,captionRef:s,...c}=e;return t?(0,ye.createElement)(ke.VisuallyHidden,gt({as:Ee.RichText},c)):(0,ye.createElement)(Ee.RichText,gt({ref:s,value:a,placeholder:l,className:r,tagName:i,isSelected:n,onClick:o},c))}var wa=e=>{const{attributes:t,isSelected:n,setAttributes:o,mediaPlaceholder:r,insertBlocksAfter:a,blockProps:l}=e,{align:i,columns:s,caption:c,imageCrop:u}=t,{children:m,...d}=(0,Ee.useInnerBlocksProps)(l,{allowedBlocks:_a,orientation:"horizontal",renderAppender:!1,__experimentalLayout:{type:"default",alignments:[]}}),[p,g]=(0,ye.useState)(!1);return(0,ye.useEffect)((()=>{n||g(!1)}),[n]),(0,ye.createElement)("figure",gt({},d,{className:nt()(l.className,"blocks-gallery-grid",{[`align${i}`]:i,[`columns-${s}`]:void 0!==s,"columns-default":void 0===s,"is-cropped":u})}),m,(0,ye.createElement)(fe.View,{className:"blocks-gallery-media-placeholder-wrapper",onClick:function(){p&&g(!1)}},r),(0,ye.createElement)(ka,{isHidden:!n&&Ee.RichText.isEmpty(c),captionFocused:p,onFocusCaption:function(){p||g(!0)},tagName:"figcaption",className:"blocks-gallery-caption","aria-label":(0,we.__)("Gallery caption text"),placeholder:(0,we.__)("Write gallery caption…"),value:c,onChange:e=>o({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>a((0,be.createBlock)("core/paragraph"))}))};function Ea(e,t,n){return(0,ye.useMemo)((()=>function(){if(!e||0===e.length)return;const{imageSizes:o}=n();let r={};t&&(r=e.reduce(((e,t)=>{if(!t.id)return e;const n=o.reduce(((e,n)=>{const o=(0,Le.get)(t,["sizes",n.slug,"url"]),r=(0,Le.get)(t,["media_details","sizes",n.slug,"source_url"]);return{...e,[n.slug]:o||r}}),{});return{...e,[parseInt(t.id,10)]:n}}),{}));return o.filter((e=>{let{slug:t}=e;return(0,Le.some)(r,(e=>e[t]))})).map((e=>{let{name:t,slug:n}=e;return{value:n,label:t}}))}()),[e,t])}function Ca(e,t){const[n,o]=(0,ye.useState)([]);return(0,ye.useMemo)((()=>function(){let r=!1;const a=n.filter((t=>e.find((e=>t.clientId===e.clientId))));a.length<n.length&&(r=!0);e.forEach((e=>{e.fromSavedContent&&!a.find((t=>t.id===e.id))&&(r=!0,a.push(e))}));const l=e.filter((e=>!a.find((t=>e.clientId&&t.clientId===e.clientId))&&(null==t?void 0:t.find((t=>t.id===e.id)))&&!e.fromSavedConent));(r||(null==l?void 0:l.length)>0)&&o([...a,...l]);return l.length>0?l:null}()),[e,t])}const xa=[{value:Kr,label:(0,we.__)("Attachment Page")},{value:Zr,label:(0,we.__)("Media File")},{value:jr,label:(0,we._x)("None","Media item link option")}],Sa=["image"],Ba=ye.Platform.isNative?(0,we.__)("ADD MEDIA"):(0,we.__)("Drag images, upload new ones or select files from your library."),Ta=ye.Platform.isNative?{type:"stepper"}:{};var Na=(0,ot.compose)([ke.withNotices,(0,ca.withViewportMatch)({isNarrow:"< small"})])((function(e){const{setAttributes:t,attributes:n,className:o,clientId:r,noticeOperations:a,isSelected:l,noticeUI:i,insertBlocksAfter:s}=e,{columns:c,imageCrop:u,linkTarget:m,linkTo:d,shortCodeTransforms:p,sizeSlug:g}=n,{__unstableMarkNextChangeAsNotPersistent:h,replaceInnerBlocks:v,updateBlockAttributes:b}=(0,Ie.useDispatch)(Ee.store),{createSuccessNotice:y}=(0,Ie.useDispatch)(Ir.store),{getBlock:f,getSettings:_,preferredStyle:k}=(0,Ie.useSelect)((e=>{var t;const n=e(Ee.store).getSettings().__experimentalPreferredStyleVariations;return{getBlock:e(Ee.store).getBlock,getSettings:e(Ee.store).getSettings,preferredStyle:null==n||null===(t=n.value)||void 0===t?void 0:t["core/image"]}}),[]),w=(0,Ie.useSelect)((e=>{var t;return null===(t=e(Ee.store).getBlock(r))||void 0===t?void 0:t.innerBlocks}),[r]),E=(0,ye.useMemo)((()=>null==w?void 0:w.map((e=>({clientId:e.clientId,id:e.attributes.id,url:e.attributes.url,attributes:e.attributes,fromSavedContent:Boolean(e.originalContent)})))),[w]),C=function(e){const[t,n]=(0,ye.useState)([]),o=(0,Ie.useSelect)((n=>{if(null==e||!e.length)return t;const o=e.map((e=>e.attributes.id)).filter((e=>void 0!==e));return 0===o.length?t:n(Dt.store).getMediaItems({include:o.join(","),per_page:-1})}),[e]);return(null==o?void 0:o.length)!==(null==t?void 0:t.length)||null!=o&&o.some((e=>!t.find((t=>t.id===e.id))))?(n(o),o):t}(w),x=Ca(E,C);(0,ye.useEffect)((()=>{null==x||x.forEach((e=>{b(e.clientId,{...T(e.attributes),id:e.id,align:void 0})}))}),[x]);const S=function(e){const t=(0,Ie.useSelect)((t=>{if(!e||0===e.length)return;const n=t(Dt.store).getMedia;return e.map((e=>{const t=n(e.id);if(t)return{id:t.id,type:"image",url:t.source_url,mime:t.mime_type,alt:t.alt_text,link:t.link}}))}),[e]);if(t)return(0,Le.every)(t,(e=>e&&e.url))?t:void 0}(p);(0,ye.useEffect)((()=>{p&&S&&(z(S),t({shortCodeTransforms:void 0}))}),[p,S]);const B=Ea(C,l,_);function T(e){const t=e.id?(0,Le.find)(C,{id:e.id}):null;let o;return o=e.className&&""!==e.className?e.className:k?`is-style-${k}`:void 0,{...Qr(e,g),...ya(t,d),...fa(m,n),className:o,sizeSlug:g}}function N(e){var t;return Sa.some((t=>{var n;return 0===(null===(n=e.type)||void 0===n?void 0:n.indexOf(t))}))||0===(null===(t=e.url)||void 0===t?void 0:t.indexOf("blob:"))}function z(e){const t="[object FileList]"===Object.prototype.toString.call(e),n=t?Array.from(e).map((e=>e.url?e:Qr({url:(0,Pe.createBlobURL)(e)}))):e;n.every(N)||(a.removeAllNotices(),a.createErrorNotice((0,we.__)("If uploading to a gallery all files need to be image formats"),{id:"gallery-upload-invalid-file"}));const o=n.filter((e=>e.url||N(e))).map((e=>e.url?e:Qr({url:(0,Pe.createBlobURL)(e)}))),l=o.reduce(((e,t,n)=>(e[t.id]=n,e)),{}),i=t?w:w.filter((e=>o.find((t=>t.id===e.attributes.id)))),s=o.filter((e=>!i.find((t=>e.id===t.attributes.id)))).map((e=>(0,be.createBlock)("core/image",{id:e.id,url:e.url,caption:e.caption,alt:e.alt})));v(r,(0,Le.concat)(i,s).sort(((e,t)=>l[e.attributes.id]-l[t.attributes.id])))}(0,ye.useEffect)((()=>{var e,n,o,r,a,l;d||(h(),t({linkTo:(null===(e=window)||void 0===e||null===(n=e.wp)||void 0===n||null===(o=n.media)||void 0===o||null===(r=o.view)||void 0===r||null===(a=r.settings)||void 0===a||null===(l=a.defaultProps)||void 0===l?void 0:l.link)||jr}))}),[d]);const P=!!E.length,I=P&&E.some((e=>!!e.id)),M=E.some((e=>{var t;return!e.id&&0===(null===(t=e.url)||void 0===t?void 0:t.indexOf("blob:"))})),R=(0,ye.createElement)(Ee.MediaPlaceholder,{addToGallery:I,handleUpload:!1,isAppender:P,disableMediaButtons:P&&!l||M,icon:!P&&ua,labels:{title:!P&&(0,we.__)("Gallery"),instructions:!P&&Ba},onSelect:z,accept:"image/*",allowedTypes:Sa,multiple:!0,value:I?E:{},onError:function(e){a.removeAllNotices(),a.createErrorNotice(e)},notices:P?void 0:i}),L=(0,Ee.useBlockProps)({className:nt()(o,"has-nested-images")});if(!P)return(0,ye.createElement)(fe.View,L,R);const V=d&&"none"!==d;return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Gallery settings")},E.length>1&&(0,ye.createElement)(ke.RangeControl,gt({label:(0,we.__)("Columns"),value:c||(H=E.length,H?Math.min(3,H):3),onChange:function(e){t({columns:e})},min:1,max:Math.min(8,E.length)},Ta,{required:!0})),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Crop images"),checked:!!u,onChange:function(){t({imageCrop:!u})},help:function(e){return e?(0,we.__)("Thumbnails are cropped to align."):(0,we.__)("Thumbnails are not cropped.")}}),(0,ye.createElement)(ke.SelectControl,{label:(0,we.__)("Link to"),value:d,onChange:function(e){t({linkTo:e});const n={},o=[];f(r).innerBlocks.forEach((t=>{o.push(t.clientId);const r=t.attributes.id?(0,Le.find)(C,{id:t.attributes.id}):null;n[t.clientId]=ya(r,e)})),b(o,n,!0);const a=[...xa].find((t=>t.value===e));y((0,we.sprintf)((0,we.__)("All gallery image links updated to: %s"),a.label),{id:"gallery-attributes-linkTo",type:"snackbar"})},options:xa,hideCancelButton:!0}),V&&(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Open in new tab"),checked:"_blank"===m,onChange:function(e){const n=e?"_blank":void 0;t({linkTarget:n});const o={},a=[];f(r).innerBlocks.forEach((e=>{a.push(e.clientId),o[e.clientId]=fa(n,e.attributes)})),b(a,o,!0);const l=e?(0,we.__)("All gallery images updated to open in new tab"):(0,we.__)("All gallery images updated to not open in new tab");y(l,{id:"gallery-attributes-openInNewTab",type:"snackbar"})}}),(null==B?void 0:B.length)>0&&(0,ye.createElement)(ke.SelectControl,{label:(0,we.__)("Image size"),value:g,options:B,onChange:function(e){t({sizeSlug:e});const n={},o=[];f(r).innerBlocks.forEach((t=>{o.push(t.clientId);const r=t.attributes.id?(0,Le.find)(C,{id:t.attributes.id}):null;n[t.clientId]=function(e,t){const n=(0,Le.get)(e,["media_details","sizes",t,"source_url"]);return n?{url:n,width:void 0,height:void 0,sizeSlug:t}:{}}(r,e)})),b(o,n,!0);const a=B.find((t=>t.value===e));y((0,we.sprintf)((0,we.__)("All gallery image sizes updated to: %s"),a.label),{id:"gallery-attributes-sizeSlug",type:"snackbar"})},hideCancelButton:!0}),ye.Platform.isWeb&&!B&&I&&(0,ye.createElement)(ke.BaseControl,{className:"gallery-image-sizes"},(0,ye.createElement)(ke.BaseControl.VisualLabel,null,(0,we.__)("Image size")),(0,ye.createElement)(fe.View,{className:"gallery-image-sizes__loading"},(0,ye.createElement)(ke.Spinner,null),(0,we.__)("Loading options…"))))),i,(0,ye.createElement)(wa,gt({},e,{images:E,mediaPlaceholder:R,blockProps:L,insertBlocksAfter:s})));var H}));const za=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"large";const n=(0,Le.pick)(e,["alt","id","link","caption"]);n.url=(0,Le.get)(e,["sizes",t,"url"])||(0,Le.get)(e,["media_details","sizes",t,"source_url"])||e.url;const o=(0,Le.get)(e,["sizes","full","url"])||(0,Le.get)(e,["media_details","sizes","full","source_url"]);return o&&(n.fullUrl=o),n};var Pa=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.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"}));var Ia=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var Ma=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));var Ra=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.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"}));const La="none",Va="file",Ha="post";class Aa extends ye.Component{constructor(){super(...arguments),this.onSelectImage=this.onSelectImage.bind(this),this.onRemoveImage=this.onRemoveImage.bind(this),this.bindContainer=this.bindContainer.bind(this),this.onEdit=this.onEdit.bind(this),this.onSelectImageFromLibrary=this.onSelectImageFromLibrary.bind(this),this.onSelectCustomURL=this.onSelectCustomURL.bind(this),this.state={isEditing:!1}}bindContainer(e){this.container=e}onSelectImage(){this.props.isSelected||this.props.onSelect()}onRemoveImage(e){this.container===this.container.ownerDocument.activeElement&&this.props.isSelected&&-1!==[ht.BACKSPACE,ht.DELETE].indexOf(e.keyCode)&&(e.preventDefault(),this.props.onRemove())}onEdit(){this.setState({isEditing:!0})}componentDidUpdate(){const{image:e,url:t,__unstableMarkNextChangeAsNotPersistent:n}=this.props;e&&!t&&(n(),this.props.setAttributes({url:e.source_url,alt:e.alt_text}))}deselectOnBlur(){this.props.onDeselect()}onSelectImageFromLibrary(e){const{setAttributes:t,id:n,url:o,alt:r,caption:a,sizeSlug:l}=this.props;if(!e||!e.url)return;let i=za(e,l);((e,t)=>!e&&(0,Pe.isBlobURL)(t))(n,o)&&r&&(i=(0,Le.omit)(i,["alt"])),a&&!(0,Le.get)(i,["caption"])&&(i=(0,Le.omit)(i,["caption"])),t(i),this.setState({isEditing:!1})}onSelectCustomURL(e){const{setAttributes:t,url:n}=this.props;e!==n&&(t({url:e,id:void 0}),this.setState({isEditing:!1}))}render(){const{url:e,alt:t,id:n,linkTo:o,link:r,isFirstItem:a,isLastItem:l,isSelected:i,caption:s,onRemove:c,onMoveForward:u,onMoveBackward:m,setAttributes:d,"aria-label":p}=this.props,{isEditing:g}=this.state;let h;switch(o){case Va:h=e;break;case Ha:h=r}const v=(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)("img",{src:e,alt:t,"data-id":n,onKeyDown:this.onRemoveImage,tabIndex:"0","aria-label":p,ref:this.bindContainer}),(0,Pe.isBlobURL)(e)&&(0,ye.createElement)(ke.Spinner,null)),b=nt()({"is-selected":i,"is-transient":(0,Pe.isBlobURL)(e)});return(0,ye.createElement)("figure",{className:b,onClick:this.onSelectImage,onFocus:this.onSelectImage},!g&&(h?(0,ye.createElement)("a",{href:h},v):v),g&&(0,ye.createElement)(Ee.MediaPlaceholder,{labels:{title:(0,we.__)("Edit gallery image")},icon:Pa,onSelect:this.onSelectImageFromLibrary,onSelectURL:this.onSelectCustomURL,accept:"image/*",allowedTypes:["image"],value:{id:n,src:e}}),(0,ye.createElement)(ke.ButtonGroup,{className:"block-library-gallery-item__inline-menu is-left"},(0,ye.createElement)(ke.Button,{icon:Ia,onClick:a?void 0:m,label:(0,we.__)("Move image backward"),"aria-disabled":a,disabled:!i}),(0,ye.createElement)(ke.Button,{icon:Ma,onClick:l?void 0:u,label:(0,we.__)("Move image forward"),"aria-disabled":l,disabled:!i})),(0,ye.createElement)(ke.ButtonGroup,{className:"block-library-gallery-item__inline-menu is-right"},(0,ye.createElement)(ke.Button,{icon:$o,onClick:this.onEdit,label:(0,we.__)("Replace image"),disabled:!i}),(0,ye.createElement)(ke.Button,{icon:Ra,onClick:c,label:(0,we.__)("Remove image"),disabled:!i})),!g&&(i||s)&&(0,ye.createElement)(Ee.RichText,{tagName:"figcaption","aria-label":(0,we.__)("Image caption text"),placeholder:i?(0,we.__)("Add caption"):null,value:s,onChange:e=>d({caption:e}),inlineToolbar:!0}))}}var Fa=(0,ot.compose)([(0,Ie.withSelect)(((e,t)=>{const{getMedia:n}=e(Dt.store),{id:o}=t;return{image:o?n(parseInt(o,10)):null}})),(0,Ie.withDispatch)((e=>{const{__unstableMarkNextChangeAsNotPersistent:t}=e(Ee.store);return{__unstableMarkNextChangeAsNotPersistent:t}}))])(Aa);function Da(e){let{isHidden:t,...n}=e;return t?(0,ye.createElement)(ke.VisuallyHidden,gt({as:Ee.RichText},n)):(0,ye.createElement)(Ee.RichText,n)}var Ga=e=>{const{attributes:t,isSelected:n,setAttributes:o,selectedImage:r,mediaPlaceholder:a,onMoveBackward:l,onMoveForward:i,onRemoveImage:s,onSelectImage:c,onDeselectImage:u,onSetImageAttributes:m,insertBlocksAfter:d,blockProps:p}=e,{align:g,columns:h=Xr(t),caption:v,imageCrop:b,images:y}=t;return(0,ye.createElement)("figure",gt({},p,{className:nt()(p.className,{[`align${g}`]:g,[`columns-${h}`]:h,"is-cropped":b})}),(0,ye.createElement)("ul",{className:"blocks-gallery-grid"},y.map(((e,o)=>{const a=(0,we.sprintf)((0,we.__)("image %1$d of %2$d in gallery"),o+1,y.length);return(0,ye.createElement)("li",{className:"blocks-gallery-item",key:e.id?`${e.id}-${o}`:e.url},(0,ye.createElement)(Fa,{url:e.url,alt:e.alt,id:e.id,isFirstItem:0===o,isLastItem:o+1===y.length,isSelected:n&&r===o,onMoveBackward:l(o),onMoveForward:i(o),onRemove:s(o),onSelect:c(o),onDeselect:u(o),setAttributes:e=>m(o,e),caption:e.caption,"aria-label":a,sizeSlug:t.sizeSlug}))}))),a,(0,ye.createElement)(Da,{isHidden:!n&&Ee.RichText.isEmpty(v),tagName:"figcaption",className:"blocks-gallery-caption","aria-label":(0,we.__)("Gallery caption text"),placeholder:(0,we.__)("Write gallery caption…"),value:v,onChange:e=>o({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>d((0,be.createBlock)("core/paragraph"))}))};const Ua=[{value:Ha,label:(0,we.__)("Attachment Page")},{value:Va,label:(0,we.__)("Media File")},{value:La,label:(0,we.__)("None")}],Oa=["image"],qa=ye.Platform.select({web:(0,we.__)("Drag images, upload new ones or select files from your library."),native:(0,we.__)("ADD MEDIA")}),$a=ye.Platform.select({web:{},native:{type:"stepper"}});(0,ot.compose)([ke.withNotices,(0,ca.withViewportMatch)({isNarrow:"< small"})])((function(e){const{attributes:t,clientId:n,isSelected:o,noticeUI:r,noticeOperations:a,onFocus:l}=e,{columns:i=Xr(t),imageCrop:s,images:c,linkTo:u,sizeSlug:m}=t,[d,p]=(0,ye.useState)(),[g,h]=(0,ye.useState)(),{__unstableMarkNextChangeAsNotPersistent:v}=(0,Ie.useDispatch)(Ee.store),{imageSizes:b,mediaUpload:y,getMedia:f,wasBlockJustInserted:_}=(0,Ie.useSelect)((e=>{const t=e(Ee.store).getSettings();return{imageSizes:t.imageSizes,mediaUpload:t.mediaUpload,getMedia:e(Dt.store).getMedia,wasBlockJustInserted:e(Ee.store).wasBlockJustInserted(n,"inserter_menu")}})),k=(0,ye.useMemo)((()=>o?(0,Le.reduce)(t.ids,((e,t)=>{if(!t)return e;const n=f(t),o=(0,Le.reduce)(b,((e,t)=>{const o=(0,Le.get)(n,["sizes",t.slug,"url"]),r=(0,Le.get)(n,["media_details","sizes",t.slug,"source_url"]);return{...e,[t.slug]:o||r}}),{});return{...e,[parseInt(t,10)]:o}}),{}):{}),[o,t.ids,b]);function w(t){if(t.ids)throw new Error('The "ids" attribute should not be changed directly. It is managed automatically when "images" attribute changes');t.images&&(t={...t,ids:(0,Le.map)(t.images,(e=>{let{id:t}=e;return parseInt(t,10)}))}),e.setAttributes(t)}function E(e,t){const n=[...c];n.splice(t,1,c[e]),n.splice(e,1,c[t]),p(t),w({images:n})}function C(e){const t=(0,Le.toString)(e.id),n=(0,Le.find)(c,{id:t}),o=n?n.caption:e.caption;if(!g)return o;const r=(0,Le.find)(g,{id:t});return r&&r.caption!==e.caption?e.caption:o}function x(e){h(e.map((e=>({id:(0,Le.toString)(e.id),caption:e.caption})))),w({images:e.map((e=>({...za(e,m),caption:C(e),id:(0,Le.toString)(e.id)}))),columns:t.columns?Math.min(e.length,t.columns):t.columns})}(0,ye.useEffect)((()=>{if("web"===ye.Platform.OS&&c&&c.length>0&&(0,Le.every)(c,(e=>{let{url:t}=e;return(0,Pe.isBlobURL)(t)}))){const e=(0,Le.map)(c,(e=>{let{url:t}=e;return(0,Pe.getBlobByURL)(t)}));(0,Le.forEach)(c,(e=>{let{url:t}=e;return(0,Pe.revokeBlobURL)(t)})),y({filesList:e,onFileChange:x,allowedTypes:["image"]})}}),[]),(0,ye.useEffect)((()=>{o||p()}),[o]),(0,ye.useEffect)((()=>{var e,t,n,o,r,a;u||(v(),w({linkTo:(null===(e=window)||void 0===e||null===(t=e.wp)||void 0===t||null===(n=t.media)||void 0===n||null===(o=n.view)||void 0===o||null===(r=o.settings)||void 0===r||null===(a=r.defaultProps)||void 0===a?void 0:a.link)||La}))}),[u]);const S=!!c.length,B=S&&c.some((e=>!!e.id)),T=(0,ye.createElement)(Ee.MediaPlaceholder,{addToGallery:B,isAppender:S,disableMediaButtons:S&&!o,icon:!S&&ua,labels:{title:!S&&(0,we.__)("Gallery"),instructions:!S&&qa},onSelect:x,accept:"image/*",allowedTypes:Oa,multiple:!0,value:B?c:{},onError:function(e){a.removeAllNotices(),a.createErrorNotice(e)},notices:S?void 0:r,onFocus:l,autoOpenMediaUpload:!S&&o&&_}),N=(0,Ee.useBlockProps)();if(!S)return(0,ye.createElement)(fe.View,N,T);const z=(0,Le.map)((0,Le.filter)(b,(e=>{let{slug:t}=e;return(0,Le.some)(k,(e=>e[t]))})),(e=>{let{name:t,slug:n}=e;return{value:n,label:t}})),P=S&&!(0,Le.isEmpty)(z);return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Gallery settings")},c.length>1&&(0,ye.createElement)(ke.RangeControl,gt({label:(0,we.__)("Columns"),value:i,onChange:function(e){w({columns:e})},min:1,max:Math.min(8,c.length)},$a,{required:!0})),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Crop images"),checked:!!s,onChange:function(){w({imageCrop:!s})},help:function(e){return e?(0,we.__)("Thumbnails are cropped to align."):(0,we.__)("Thumbnails are not cropped.")}}),(0,ye.createElement)(ke.SelectControl,{label:(0,we.__)("Link to"),value:u,onChange:function(e){w({linkTo:e})},options:Ua,hideCancelButton:!0}),P&&(0,ye.createElement)(ke.SelectControl,{label:(0,we.__)("Image size"),value:m,options:z,onChange:function(e){w({images:(0,Le.map)(c,(t=>{if(!t.id)return t;const n=(0,Le.get)(k,[parseInt(t.id,10),e]);return{...t,...n&&{url:n}}})),sizeSlug:e})},hideCancelButton:!0}))),r,(0,ye.createElement)(Ga,gt({},e,{selectedImage:d,mediaPlaceholder:T,onMoveBackward:function(e){return()=>{0!==e&&E(e,e-1)}},onMoveForward:function(e){return()=>{e!==c.length-1&&E(e,e+1)}},onRemoveImage:function(e){return()=>{const n=(0,Le.filter)(c,((t,n)=>e!==n));p(),w({images:n,columns:t.columns?Math.min(n.length,t.columns):t.columns})}},onSelectImage:function(e){return()=>{p(e)}},onDeselectImage:function(){return()=>{p()}},onSetImageAttributes:function(e,t){c[e]&&w({images:[...c.slice(0,e),{...c[e],...t},...c.slice(e+1)]})},blockProps:N,onFocusGalleryCaption:function(){p()}})))}));var Wa=(0,ot.compose)([ke.withNotices])((function(e){return(0,ye.createElement)(Na,e)}));var ja=window.wp.hooks;const Za=e=>e?e.split(",").map((e=>parseInt(e,10))):[];(0,ja.addFilter)("blocks.switchToBlockType.transformedBlock","core/gallery/update-third-party-transform-to",(function(e){var t;if("core/gallery"===e.name&&(null===(t=e.attributes)||void 0===t?void 0:t.images.length)>0){const t=e.attributes.images.map((t=>{let{url:n,id:o,alt:r}=t;return(0,be.createBlock)("core/image",{url:n,id:o?parseInt(o,10):null,alt:r,sizeSlug:e.attributes.sizeSlug,linkDestination:e.attributes.linkDestination})}));delete e.attributes.ids,delete e.attributes.images,e.innerBlocks=t}return e})),(0,ja.addFilter)("blocks.switchToBlockType.transformedBlock","core/gallery/update-third-party-transform-from",(function(e,t){const n=(Array.isArray(t)?t:[t]).find((t=>{var n;return"core/gallery"===t.name&&t.innerBlocks.length>0&&!(null!==(n=t.attributes.images)&&void 0!==n&&n.length)>0&&!e.name.includes("core/")}));if(n){const e=n.innerBlocks.map((e=>{let{attributes:{url:t,id:n,alt:o}}=e;return{url:t,id:n?parseInt(n,10):null,alt:o}})),t=e.map((e=>{let{id:t}=e;return t}));n.attributes.images=e,n.attributes.ids=t}return e}));const Ka={from:[{type:"block",isMultiBlock:!0,blocks:["core/image"],transform:e=>{let{align:t,sizeSlug:n}=e[0];t=(0,Le.every)(e,["align",t])?t:void 0,n=(0,Le.every)(e,["sizeSlug",n])?n:void 0;const o=(0,Le.filter)(e,(e=>{let{url:t}=e;return t}));{const e=o.map((e=>(0,be.createBlock)("core/image",e)));return(0,be.createBlock)("core/gallery",{align:t,sizeSlug:n},e)}}},{type:"shortcode",tag:"gallery",attributes:{images:{type:"array",shortcode:e=>{let{named:{ids:t}}=e}},ids:{type:"array",shortcode:e=>{let{named:{ids:t}}=e}},shortCodeTransforms:{type:"array",shortcode:e=>{let{named:{ids:t}}=e;return Za(t).map((e=>({id:parseInt(e)})))}},columns:{type:"number",shortcode:e=>{let{named:{columns:t="3"}}=e;return parseInt(t,10)}},linkTo:{type:"string",shortcode:e=>{let{named:{link:t}}=e;switch(t){case"post":return Kr;case"file":return Zr;default:return jr}}}},isMatch(e){let{named:t}=e;return void 0!==t.ids}},{type:"files",priority:1,isMatch:e=>1!==e.length&&(0,Le.every)(e,(e=>0===e.type.indexOf("image/"))),transform(e){{const t=e.map((e=>(0,be.createBlock)("core/image",{url:(0,Pe.createBlobURL)(e)})));return(0,be.createBlock)("core/gallery",{},t)}}}],to:[{type:"block",blocks:["core/image"],transform:(e,t)=>{let{align:n,images:o,ids:r,sizeSlug:a}=e;return t.length>0?t.map((e=>{let{attributes:{id:t,url:o,alt:r,caption:a,sizeSlug:l,linkDestination:i,href:s,linkTarget:c}}=e;return(0,be.createBlock)("core/image",{id:t,url:o,alt:r,caption:a,sizeSlug:l,align:n,linkDestination:i,href:s,linkTarget:c})})):(0,be.createBlock)("core/image",{align:n})}}]};var Qa=Ka;const Ja={apiVersion:2,name:"core/gallery",title:"Gallery",category:"media",description:"Display multiple images in a rich gallery.",keywords:["images","photos"],textdomain:"default",attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},shortCodeTransforms:{type:"array",default:[],items:{type:"object"}},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},fixedHeight:{type:"boolean",default:!0},linkTarget:{type:"string"},linkTo:{type:"string"},sizeSlug:{type:"string",default:"large"},allowResize:{type:"boolean",default:!1}},providesContext:{allowResize:"allowResize",imageCrop:"imageCrop",fixedHeight:"fixedHeight"},supports:{anchor:!0,align:!0},editorStyle:"wp-block-gallery-editor",style:"wp-block-gallery"},{name:Ya}=Ja,Xa={icon:Wr,example:{attributes:{columns:2},innerBlocks:[{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg"}},{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg"}}]},transforms:Qa,edit:Wa,save:function(e){let{attributes:t}=e;const{caption:n,columns:o,imageCrop:r}=t,a=nt()("has-nested-images",{[`columns-${o}`]:void 0!==o,"columns-default":void 0===o,"is-cropped":r}),l=Ee.useBlockProps.save({className:a}),i=Ee.useInnerBlocksProps.save(l);return(0,ye.createElement)("figure",i,i.children,!Ee.RichText.isEmpty(n)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:n}))},deprecated:sa};var el=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.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"}));const tl=e=>{if(e.tagName||(e={...e,tagName:"div"}),!e.customTextColor&&!e.customBackgroundColor)return e;const t={color:{}};return e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),{...(0,Le.omit)(e,["customTextColor","customBackgroundColor"]),style:t}},nl=[{attributes:{tagName:{type:"string",default:"div"},templateLock:{type:"string"}},supports:{align:["wide","full"],anchor:!0,color:{gradients:!0,link:!0},spacing:{padding:!0},__experimentalBorder:{radius:!0}},save(e){let{attributes:t}=e;const{tagName:n}=t;return(0,ye.createElement)(n,Ee.useBlockProps.save(),(0,ye.createElement)("div",{className:"wp-block-group__inner-container"},(0,ye.createElement)(Ee.InnerBlocks.Content,null)))}},{attributes:{backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1},migrate:tl,save(e){let{attributes:t}=e;const{backgroundColor:n,customBackgroundColor:o,textColor:r,customTextColor:a}=t,l=(0,Ee.getColorClassName)("background-color",n),i=(0,Ee.getColorClassName)("color",r),s=nt()(l,i,{"has-text-color":r||a,"has-background":n||o}),c={backgroundColor:l?void 0:o,color:i?void 0:a};return(0,ye.createElement)("div",{className:s,style:c},(0,ye.createElement)("div",{className:"wp-block-group__inner-container"},(0,ye.createElement)(Ee.InnerBlocks.Content,null)))}},{attributes:{backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}},migrate:tl,supports:{align:["wide","full"],anchor:!0,html:!1},save(e){let{attributes:t}=e;const{backgroundColor:n,customBackgroundColor:o,textColor:r,customTextColor:a}=t,l=(0,Ee.getColorClassName)("background-color",n),i=(0,Ee.getColorClassName)("color",r),s=nt()(l,{"has-text-color":r||a,"has-background":n||o}),c={backgroundColor:l?void 0:o,color:i?void 0:a};return(0,ye.createElement)("div",{className:s,style:c},(0,ye.createElement)("div",{className:"wp-block-group__inner-container"},(0,ye.createElement)(Ee.InnerBlocks.Content,null)))}},{attributes:{backgroundColor:{type:"string"},customBackgroundColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1},migrate:tl,save(e){let{attributes:t}=e;const{backgroundColor:n,customBackgroundColor:o}=t,r=(0,Ee.getColorClassName)("background-color",n),a=nt()(r,{"has-background":n||o}),l={backgroundColor:r?void 0:o};return(0,ye.createElement)("div",{className:a,style:l},(0,ye.createElement)(Ee.InnerBlocks.Content,null))}}];var ol=nl;const rl={header:(0,we.__)("The <header> element should represent introductory content, typically a group of introductory or navigational aids."),main:(0,we.__)("The <main> element should be used for the primary content of your document only. "),section:(0,we.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element."),article:(0,we.__)("The <article> element should represent a self contained, syndicatable portion of the document."),aside:(0,we.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),footer:(0,we.__)("The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).")};var al=function(e){let{attributes:t,setAttributes:n,clientId:o}=e;const{hasInnerBlocks:r,themeSupportsLayout:a}=(0,Ie.useSelect)((e=>{var t;const{getBlock:n,getSettings:r}=e(Ee.store),a=n(o);return{hasInnerBlocks:!(!a||!a.innerBlocks.length),themeSupportsLayout:null===(t=r())||void 0===t?void 0:t.supportsLayout}}),[o]),l=(0,Ee.useSetting)("layout")||{},{tagName:i="div",templateLock:s,layout:c={}}=t,u=c&&c.inherit?l:c,{type:m="default"}=u,d=a||"default"!==m,p=(0,Ee.useBlockProps)(),g=(0,Ee.useInnerBlocksProps)(d?p:{className:"wp-block-group__inner-container"},{templateLock:s,renderAppender:r?void 0:Ee.InnerBlocks.ButtonBlockAppender,__experimentalLayout:d?u:void 0});return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.InspectorControls,{__experimentalGroup:"advanced"},(0,ye.createElement)(ke.SelectControl,{label:(0,we.__)("HTML element"),options:[{label:(0,we.__)("Default (<div>)"),value:"div"},{label:"<header>",value:"header"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<article>",value:"article"},{label:"<aside>",value:"aside"},{label:"<footer>",value:"footer"}],value:i,onChange:e=>n({tagName:e}),help:rl[i]})),d&&(0,ye.createElement)(i,g),!d&&(0,ye.createElement)(i,p,(0,ye.createElement)("div",g)))};const ll=[{name:"group-row",title:(0,we.__)("Row"),description:(0,we.__)("Blocks shown in a row."),attributes:{layout:{type:"flex",allowOrientation:!1}},scope:["inserter"],isActive:e=>{var t;return"flex"===(null===(t=e.layout)||void 0===t?void 0:t.type)}}];var il=ll;const sl={apiVersion:2,name:"core/group",title:"Group",category:"design",description:"Combine blocks into a group.",keywords:["container","wrapper","row","section"],textdomain:"default",attributes:{tagName:{type:"string",default:"div"},templateLock:{type:["string","boolean"],enum:["all","insert",!1]}},supports:{align:["wide","full"],anchor:!0,html:!1,color:{gradients:!0,link:!0},spacing:{padding:!0,blockGap:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0},__experimentalLayout:!0},editorStyle:"wp-block-group-editor",style:"wp-block-group"},{name:cl}=sl,ul={icon:el,example:{attributes:{style:{color:{text:"#000000",background:"#ffffff"}}},innerBlocks:[{name:"core/paragraph",attributes:{customTextColor:"#cf2e2e",fontSize:"large",content:(0,we.__)("One.")}},{name:"core/paragraph",attributes:{customTextColor:"#ff6900",fontSize:"large",content:(0,we.__)("Two.")}},{name:"core/paragraph",attributes:{customTextColor:"#fcb900",fontSize:"large",content:(0,we.__)("Three.")}},{name:"core/paragraph",attributes:{customTextColor:"#00d084",fontSize:"large",content:(0,we.__)("Four.")}},{name:"core/paragraph",attributes:{customTextColor:"#0693e3",fontSize:"large",content:(0,we.__)("Five.")}},{name:"core/paragraph",attributes:{customTextColor:"#9b51e0",fontSize:"large",content:(0,we.__)("Six.")}}]},transforms:{from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert(e){if(1===e.length&&"core/group"===e[0].name)return;const t=["wide","full"],n=e.reduce(((e,n)=>{const{align:o}=n.attributes;return t.indexOf(o)>t.indexOf(e)?o:e}),void 0),o=e.map((e=>(0,be.createBlock)(e.name,e.attributes,e.innerBlocks)));return(0,be.createBlock)("core/group",{align:n},o)}}]},edit:al,save:function(e){let{attributes:{tagName:t}}=e;return(0,ye.createElement)(t,Ee.useInnerBlocksProps.save(Ee.useBlockProps.save()))},deprecated:ol,variations:il};var ml=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M6.2 5.2v13.4l5.8-4.8 5.8 4.8V5.2z"}));const dl={className:!1,anchor:!0},pl={align:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:""},level:{type:"number",default:2},placeholder:{type:"string"}},gl=e=>{if(!e.customTextColor)return e;const t={color:{text:e.customTextColor}};return{...(0,Le.omit)(e,["customTextColor"]),style:t}},hl=["left","right","center"],vl=e=>{const{align:t,...n}=e;return hl.includes(t)?{...n,textAlign:t}:e},bl=[{supports:{align:["wide","full"],anchor:!0,className:!1,color:{link:!0},fontSize:!0,lineHeight:!0,__experimentalSelector:{"core/heading/h1":"h1","core/heading/h2":"h2","core/heading/h3":"h3","core/heading/h4":"h4","core/heading/h5":"h5","core/heading/h6":"h6"},__unstablePasteTextInline:!0},attributes:pl,isEligible:e=>{let{align:t}=e;return hl.includes(t)},migrate:vl,save(e){let{attributes:t}=e;const{align:n,content:o,level:r}=t,a="h"+r,l=nt()({[`has-text-align-${n}`]:n});return(0,ye.createElement)(a,Ee.useBlockProps.save({className:l}),(0,ye.createElement)(Ee.RichText.Content,{value:o}))}},{supports:dl,attributes:{...pl,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>gl(vl(e)),save(e){let{attributes:t}=e;const{align:n,content:o,customTextColor:r,level:a,textColor:l}=t,i="h"+a,s=(0,Ee.getColorClassName)("color",l),c=nt()({[s]:s,"has-text-color":l||r,[`has-text-align-${n}`]:n});return(0,ye.createElement)(Ee.RichText.Content,{className:c||void 0,tagName:i,style:{color:s?void 0:r},value:o})}},{attributes:{...pl,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>gl(vl(e)),save(e){let{attributes:t}=e;const{align:n,content:o,customTextColor:r,level:a,textColor:l}=t,i="h"+a,s=(0,Ee.getColorClassName)("color",l),c=nt()({[s]:s,[`has-text-align-${n}`]:n});return(0,ye.createElement)(Ee.RichText.Content,{className:c||void 0,tagName:i,style:{color:s?void 0:r},value:o})},supports:dl},{supports:dl,attributes:{...pl,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>gl(vl(e)),save(e){let{attributes:t}=e;const{align:n,level:o,content:r,textColor:a,customTextColor:l}=t,i="h"+o,s=(0,Ee.getColorClassName)("color",a),c=nt()({[s]:s});return(0,ye.createElement)(Ee.RichText.Content,{className:c||void 0,tagName:i,style:{textAlign:n,color:s?void 0:l},value:r})}}];var yl=bl;function fl(e){let{level:t,isPressed:n=!1}=e;const o={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return o.hasOwnProperty(t)?(0,ye.createElement)(ke.SVG,{width:"24",height:"24",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",isPressed:n},(0,ye.createElement)(ke.Path,{d:o[t]})):null}const _l=[1,2,3,4,5,6],kl={className:"block-library-heading-level-dropdown"};function wl(e){let{selectedLevel:t,onChange:n}=e;return(0,ye.createElement)(ke.ToolbarDropdownMenu,{popoverProps:kl,icon:(0,ye.createElement)(fl,{level:t}),label:(0,we.__)("Change heading level"),controls:_l.map((e=>{{const o=e===t;return{icon:(0,ye.createElement)(fl,{level:e,isPressed:o}),label:(0,we.sprintf)((0,we.__)("Heading %d"),e),isActive:o,onClick(){n(e)}}}}))})}const El={},Cl=e=>(0,Le.trim)((0,Le.deburr)((e=>{const t=document.createElement("div");return t.innerHTML=e,t.innerText})(e)).replace(/[^\p{L}\p{N}]+/gu,"-").toLowerCase(),"-"),xl=(e,t)=>{const n=Cl(t);if(""===n)return null;delete El[e];let o=n,r=0;for(;Object.values(El).includes(o);)r+=1,o=n+"-"+r;return o},Sl=(e,t)=>{El[e]=t};var Bl=function(e){let{attributes:t,setAttributes:n,mergeBlocks:o,onReplace:r,style:a,clientId:l}=e;const{textAlign:i,content:s,level:c,placeholder:u,anchor:m}=t,d="h"+c,p=(0,Ee.useBlockProps)({className:nt()({[`has-text-align-${i}`]:i}),style:a}),{canGenerateAnchors:g}=(0,Ie.useSelect)((e=>({canGenerateAnchors:!!e(Ee.store).getSettings().__experimentalGenerateAnchors})),[]),{__unstableMarkNextChangeAsNotPersistent:h}=(0,Ie.useDispatch)(Ee.store);return(0,ye.useEffect)((()=>{if(g)return!m&&s&&(h(),n({anchor:xl(l,s)})),Sl(l,m),()=>Sl(l,null)}),[m,s,l,g]),(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(wl,{selectedLevel:c,onChange:e=>n({level:e})}),(0,ye.createElement)(Ee.AlignmentControl,{value:i,onChange:e=>{n({textAlign:e})}})),(0,ye.createElement)(Ee.RichText,gt({identifier:"content",tagName:d,value:s,onChange:e=>{const t={content:e};!g||m&&e&&xl(l,s)!==m||(t.anchor=xl(l,e)),n(t)},onMerge:o,onSplit:(e,n)=>{let o;var r;n||e?o=(0,be.createBlock)("core/heading",{...t,content:e}):o=(0,be.createBlock)(null!==(r=(0,be.getDefaultBlockName)())&&void 0!==r?r:"core/heading");return n&&(o.clientId=l),o},onReplace:r,onRemove:()=>r([]),"aria-label":(0,we.__)("Heading text"),placeholder:u||(0,we.__)("Heading"),textAlign:i},p)))};const{name:Tl}={apiVersion:2,name:"core/heading",title:"Heading",category:"text",description:"Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",keywords:["title","subtitle"],textdomain:"default",attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",__experimentalRole:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},supports:{align:["wide","full"],anchor:!0,className:!1,color:{link:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}},__experimentalSelector:"h1,h2,h3,h4,h5,h6",__unstablePasteTextInline:!0,__experimentalSlashInserter:!0},editorStyle:"wp-block-heading-editor",style:"wp-block-heading"},Nl={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((e=>{let{content:t,anchor:n}=e;return(0,be.createBlock)(Tl,{content:t,anchor:n})}))},{type:"raw",selector:"h1,h2,h3,h4,h5,h6",schema:e=>{let{phrasingContentSchema:t,isPaste:n}=e;const o={children:t,attributes:n?[]:["style","id"]};return{h1:o,h2:o,h3:o,h4:o,h5:o,h6:o}},transform(e){const t=(0,be.getBlockAttributes)(Tl,e.outerHTML),{textAlign:n}=e.style||{};var o;return t.level=(o=e.nodeName,Number(o.substr(1))),"left"!==n&&"center"!==n&&"right"!==n||(t.align=n),(0,be.createBlock)(Tl,t)}},...[1,2,3,4,5,6].map((e=>({type:"prefix",prefix:Array(e+1).join("#"),transform:t=>(0,be.createBlock)(Tl,{level:e,content:t})}))),...[1,2,3,4,5,6].map((e=>({type:"enter",regExp:new RegExp(`^/(h|H)${e}$`),transform:t=>(0,be.createBlock)(Tl,{level:e,content:t})})))],to:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((e=>{let{content:t,anchor:n}=e;return(0,be.createBlock)("core/paragraph",{content:t,anchor:n})}))}]};var zl=Nl;const Pl={apiVersion:2,name:"core/heading",title:"Heading",category:"text",description:"Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",keywords:["title","subtitle"],textdomain:"default",attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",__experimentalRole:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},supports:{align:["wide","full"],anchor:!0,className:!1,color:{link:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}},__experimentalSelector:"h1,h2,h3,h4,h5,h6",__unstablePasteTextInline:!0,__experimentalSlashInserter:!0},editorStyle:"wp-block-heading-editor",style:"wp-block-heading"},{name:Il}=Pl,Ml={icon:ml,example:{attributes:{content:(0,we.__)("Code is Poetry"),level:2}},__experimentalLabel(e,t){let{context:n}=t;if("accessibility"===n){const{content:t,level:n}=e;return(0,Le.isEmpty)(t)?(0,we.sprintf)((0,we.__)("Level %s. Empty."),n):(0,we.sprintf)((0,we.__)("Level %1$s. %2$s"),n,t)}},transforms:zl,deprecated:yl,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:Bl,save:function(e){let{attributes:t}=e;const{textAlign:n,content:o,level:r}=t,a="h"+r,l=nt()({[`has-text-align-${n}`]:n});return(0,ye.createElement)(a,Ee.useBlockProps.save({className:l}),(0,ye.createElement)(Ee.RichText.Content,{value:o}))}};var Rl=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M4.8 11.4H2.1V9H1v6h1.1v-2.6h2.7V15h1.1V9H4.8v2.4zm1.9-1.3h1.7V15h1.1v-4.9h1.7V9H6.7v1.1zM16.2 9l-1.5 2.7L13.3 9h-.9l-.8 6h1.1l.5-4 1.5 2.8 1.5-2.8.5 4h1.1L17 9h-.8zm3.8 5V9h-1.1v6h3.6v-1H20z"}));var Ll={from:[{type:"block",blocks:["core/code"],transform:e=>{let{content:t}=e;return(0,be.createBlock)("core/html",{content:t})}}]};const Vl={apiVersion:2,name:"core/html",title:"Custom HTML",category:"widgets",description:"Add custom HTML code and preview it as you edit.",keywords:["embed"],textdomain:"default",attributes:{content:{type:"string",source:"html"}},supports:{customClassName:!1,className:!1,html:!1},editorStyle:"wp-block-html-editor"},{name:Hl}=Vl,Al={icon:Rl,example:{attributes:{content:"<marquee>"+(0,we.__)("Welcome to the wonderful world of blocks…")+"</marquee>"}},edit:function(e){let{attributes:t,setAttributes:n,isSelected:o}=e;const[r,a]=(0,ye.useState)(),l=(0,Ie.useSelect)((e=>["\n\t\t\thtml,body,:root {\n\t\t\t\tmargin: 0 !important;\n\t\t\t\tpadding: 0 !important;\n\t\t\t\toverflow: visible !important;\n\t\t\t\tmin-height: auto !important;\n\t\t\t}\n\t\t",...(0,Ee.transformStyles)(e(Ee.store).getSettings().styles)]),[]);return(0,ye.createElement)("div",(0,Ee.useBlockProps)({className:"block-library-html__edit"}),(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(ke.ToolbarGroup,null,(0,ye.createElement)(ke.ToolbarButton,{className:"components-tab-button",isPressed:!r,onClick:function(){a(!1)}},(0,ye.createElement)("span",null,"HTML")),(0,ye.createElement)(ke.ToolbarButton,{className:"components-tab-button",isPressed:r,onClick:function(){a(!0)}},(0,ye.createElement)("span",null,(0,we.__)("Preview"))))),(0,ye.createElement)(ke.Disabled.Consumer,null,(e=>r||e?(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.SandBox,{html:t.content,styles:l}),!o&&(0,ye.createElement)("div",{className:"block-library-html__preview-overlay"})):(0,ye.createElement)(Ee.PlainText,{value:t.content,onChange:e=>n({content:e}),placeholder:(0,we.__)("Write HTML…"),"aria-label":(0,we.__)("HTML")}))))},save:function(e){let{attributes:t}=e;return(0,ye.createElement)(ye.RawHTML,null,t.content)},transforms:Ll},Fl={align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number"},width:{type:"number"},height:{type:"number"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},Dl=[{attributes:Fl,save(e){let{attributes:t}=e;const{url:n,alt:o,caption:r,align:a,href:l,width:i,height:s,id:c}=t,u=nt()({[`align${a}`]:a,"is-resized":i||s}),m=(0,ye.createElement)("img",{src:n,alt:o,className:c?`wp-image-${c}`:null,width:i,height:s});return(0,ye.createElement)("figure",{className:u},l?(0,ye.createElement)("a",{href:l},m):m,!Ee.RichText.isEmpty(r)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:r}))}},{attributes:Fl,save(e){let{attributes:t}=e;const{url:n,alt:o,caption:r,align:a,href:l,width:i,height:s,id:c}=t,u=(0,ye.createElement)("img",{src:n,alt:o,className:c?`wp-image-${c}`:null,width:i,height:s});return(0,ye.createElement)("figure",{className:a?`align${a}`:null},l?(0,ye.createElement)("a",{href:l},u):u,!Ee.RichText.isEmpty(r)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:r}))}},{attributes:Fl,save(e){let{attributes:t}=e;const{url:n,alt:o,caption:r,align:a,href:l,width:i,height:s}=t,c=i||s?{width:i,height:s}:{},u=(0,ye.createElement)("img",gt({src:n,alt:o},c));let m={};return i?m={width:i}:"left"!==a&&"right"!==a||(m={maxWidth:"50%"}),(0,ye.createElement)("figure",{className:a?`align${a}`:null,style:m},l?(0,ye.createElement)("a",{href:l},u):u,!Ee.RichText.isEmpty(r)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:r}))}}];var Gl=Dl;var Ul=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M16.5 7.8v7H18v-7c0-1-.8-1.8-1.8-1.8h-7v1.5h7c.2 0 .3.1.3.3zm-8.7 8.7c-.1 0-.2-.1-.2-.2V2H6v4H2v1.5h4v8.8c0 1 .8 1.8 1.8 1.8h8.8v4H18v-4h4v-1.5H7.8z"}));var Ol=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.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 ql=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12-9.8c.4 0 .8-.3.9-.7l1.1-3h3.6l.5 1.7h1.9L13 9h-2.2l-3.4 9.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12H20V6c0-1.1-.9-2-2-2zm-6 7l1.4 3.9h-2.7L12 11z"}));function $l(e,t){const[n,o]=(0,ye.useState)();function r(){o(e.current.clientWidth)}return(0,ye.useEffect)(r,t),(0,ye.useEffect)((()=>{const{defaultView:t}=e.current.ownerDocument;return t.addEventListener("resize",r),()=>{t.removeEventListener("resize",r)}}),[]),n}function Wl(e){var t;let{temporaryURL:n,attributes:{url:o="",alt:r,caption:a,align:l,id:i,href:s,rel:c,linkClass:u,linkDestination:m,title:d,width:p,height:g,linkTarget:h,sizeSlug:v},setAttributes:b,isSelected:y,insertBlocksAfter:f,onReplace:_,onSelectImage:k,onSelectURL:w,onUploadError:E,containerRef:C,context:x,clientId:S}=e;const B=(0,ye.useRef)(),T=(0,ye.useRef)(),N=(0,ot.usePrevious)(o),{allowResize:z=!0}=x,{getBlock:P}=(0,Ie.useSelect)(Ee.store),{image:I,multiImageSelection:M}=(0,Ie.useSelect)((e=>{const{getMedia:t}=e(Dt.store),{getMultiSelectedBlockClientIds:n,getBlockName:o}=e(Ee.store),r=n();return{image:i&&y?t(i):null,multiImageSelection:r.length&&r.every((e=>"core/image"===o(e)))}}),[i,y]),{canInsertCover:R,imageEditing:L,imageSizes:V,maxWidth:H,mediaUpload:A}=(0,Ie.useSelect)((e=>{const{getBlockRootClientId:t,getSettings:n,canInsertBlockType:o}=e(Ee.store),r=t(S);return{...(0,Le.pick)(n(),["imageEditing","imageSizes","maxWidth","mediaUpload"]),canInsertCover:o("core/cover",r)}}),[S]),{replaceBlocks:F,toggleSelection:D}=(0,Ie.useDispatch)(Ee.store),{createErrorNotice:G,createSuccessNotice:U}=(0,Ie.useDispatch)(Ir.store),O=(0,ot.useViewportMatch)("medium"),q=(0,Le.includes)(["wide","full"],l),[{loadedNaturalWidth:$,loadedNaturalHeight:W},j]=(0,ye.useState)({}),[Z,K]=(0,ye.useState)(!1),[Q,J]=(0,ye.useState)(),Y=$l(C,[l]),X=z&&!(q&&O),ee=(0,Le.map)((0,Le.filter)(V,(e=>{let{slug:t}=e;return(0,Le.get)(I,["media_details","sizes",t,"source_url"])})),(e=>{let{name:t,slug:n}=e;return{value:n,label:t}}));(0,ye.useEffect)((()=>{jl(i,o)&&y&&!Q&&window.fetch(o).then((e=>e.blob())).then((e=>J(e))).catch((()=>{}))}),[i,o,y,Q]),(0,ye.useEffect)((()=>{o&&!N&&y&&T.current.focus()}),[o,N]);const{naturalWidth:te,naturalHeight:ne}=(0,ye.useMemo)((()=>{var e,t;return{naturalWidth:(null===(e=B.current)||void 0===e?void 0:e.naturalWidth)||$||void 0,naturalHeight:(null===(t=B.current)||void 0===t?void 0:t.naturalHeight)||W||void 0}}),[$,W,null===(t=B.current)||void 0===t?void 0:t.complete]);(0,ye.useEffect)((()=>{y||K(!1)}),[y]);const oe=i&&te&&ne&&L,re=!M&&oe&&!Z;const ae=(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(Ee.BlockAlignmentControl,{value:l,onChange:function(e){const t=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};b({...t,align:e})}}),!M&&!Z&&(0,ye.createElement)(Ee.__experimentalImageURLInputUI,{url:s||"",onChangeUrl:function(e){b(e)},linkDestination:m,mediaUrl:I&&I.source_url||o,mediaLink:I&&I.link,linkTarget:h,linkClass:u,rel:c}),re&&(0,ye.createElement)(ke.ToolbarButton,{onClick:()=>K(!0),icon:Ul,label:(0,we.__)("Crop")}),Q&&(0,ye.createElement)(ke.ToolbarButton,{onClick:function(){A({filesList:[Q],onFileChange(e){let[t]=e;k(t),(0,Pe.isBlobURL)(t.url)||(J(),U((0,we.__)("Image uploaded."),{type:"snackbar"}))},allowedTypes:ba,onError(e){G(e,{type:"snackbar"})}})},icon:Ol,label:(0,we.__)("Upload external image")}),!M&&R&&(0,ye.createElement)(ke.ToolbarButton,{icon:ql,label:(0,we.__)("Add text over image"),onClick:function(){F(S,(0,be.switchToBlockType)(P(S),"core/cover"))}})),!M&&!Z&&(0,ye.createElement)(Ee.BlockControls,{group:"other"},(0,ye.createElement)(Ee.MediaReplaceFlow,{mediaId:i,mediaURL:o,allowedTypes:ba,accept:"image/*",onSelect:k,onSelectURL:w,onError:E})),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Image settings")},!M&&(0,ye.createElement)(ke.TextareaControl,{label:(0,we.__)("Alt text (alternative text)"),value:r,onChange:function(e){b({alt:e})},help:(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.ExternalLink,{href:"https://www.w3.org/WAI/tutorials/images/decision-tree"},(0,we.__)("Describe the purpose of the image")),(0,we.__)("Leave empty if the image is purely decorative."))}),(0,ye.createElement)(Ee.__experimentalImageSizeControl,{onChangeImage:function(e){const t=(0,Le.get)(I,["media_details","sizes",e,"source_url"]);if(!t)return null;b({url:t,width:void 0,height:void 0,sizeSlug:e})},onChange:e=>b(e),slug:v,width:p,height:g,imageSizeOptions:ee,isResizable:X,imageWidth:te,imageHeight:ne}))),(0,ye.createElement)(Ee.InspectorControls,{__experimentalGroup:"advanced"},(0,ye.createElement)(ke.TextControl,{label:(0,we.__)("Title attribute"),value:d||"",onChange:function(e){b({title:e})},help:(0,ye.createElement)(ye.Fragment,null,(0,we.__)("Describe the role of this image on the page."),(0,ye.createElement)(ke.ExternalLink,{href:"https://www.w3.org/TR/html52/dom.html#the-title-attribute"},(0,we.__)("(Note: many devices and browsers do not display this text.)")))}))),le=(0,Dr.getFilename)(o);let ie;ie=r||(le?(0,we.sprintf)((0,we.__)("This image has an empty alt attribute; its file name is %s"),le):(0,we.__)("This image has an empty alt attribute"));let se,ce,ue=(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)("img",{src:n||o,alt:ie,onError:()=>function(){const e=Oe({attributes:{url:o}});void 0!==e&&_(e)}(),onLoad:e=>{var t,n;j({loadedNaturalWidth:null===(t=e.target)||void 0===t?void 0:t.naturalWidth,loadedNaturalHeight:null===(n=e.target)||void 0===n?void 0:n.naturalHeight})},ref:B}),n&&(0,ye.createElement)(ke.Spinner,null));if(Y&&te&&ne){const e=te>Y,t=ne/te;se=e?Y:te,ce=e?Y*t:ne}if(oe&&Z)ue=(0,ye.createElement)(Ee.__experimentalImageEditor,{url:o,width:p,height:g,clientWidth:Y,naturalHeight:ne,naturalWidth:te});else if(X&&se){const e=p||se,t=g||ce,n=te/ne,o=te<ne?ma:ma*n,r=ne<te?ma:ma/n,a=2.5*H;let i=!1,s=!1;"center"===l?(i=!0,s=!0):(0,we.isRTL)()?"left"===l?i=!0:s=!0:"right"===l?s=!0:i=!0,ue=(0,ye.createElement)(ke.ResizableBox,{size:{width:null!=p?p:"auto",height:null!=g?g:"auto"},showHandle:y,minWidth:o,maxWidth:a,minHeight:r,maxHeight:a/n,lockAspectRatio:!0,enable:{top:!1,right:i,bottom:!0,left:s},onResizeStart:function(){D(!1)},onResizeStop:(n,o,r,a)=>{D(!0),b({width:parseInt(e+a.width,10),height:parseInt(t+a.height,10)})}},ue)}else ue=(0,ye.createElement)("div",{style:{width:p,height:g}},ue);return(0,ye.createElement)(Ee.__experimentalImageEditingProvider,{id:i,url:o,naturalWidth:te,naturalHeight:ne,clientWidth:Y,onSaveImage:e=>b(e),isEditing:Z,onFinishEditing:()=>K(!1)},!n&&ae,ue,(!Ee.RichText.isEmpty(a)||y)&&(0,ye.createElement)(Ee.RichText,{ref:T,tagName:"figcaption","aria-label":(0,we.__)("Image caption text"),placeholder:(0,we.__)("Add caption"),value:a,onChange:e=>b({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>f((0,be.createBlock)("core/paragraph"))}))}const jl=(e,t)=>t&&!e&&!(0,Pe.isBlobURL)(t);var Zl=(0,ke.withNotices)((function(e){let{attributes:t,setAttributes:n,isSelected:o,className:r,noticeUI:a,insertBlocksAfter:l,noticeOperations:i,onReplace:s,context:c,clientId:u}=e;const{url:m="",alt:d,caption:p,align:g,id:h,width:v,height:b,sizeSlug:y}=t,[f,_]=(0,ye.useState)(),k=(0,ye.useRef)();(0,ye.useEffect)((()=>{k.current=d}),[d]);const w=(0,ye.useRef)();(0,ye.useEffect)((()=>{w.current=p}),[p]);const E=(0,ye.useRef)(),{imageDefaultSize:C,mediaUpload:x}=(0,Ie.useSelect)((e=>{const{getSettings:t}=e(Ee.store);return(0,Le.pick)(t(),["imageDefaultSize","mediaUpload"])}),[]);function S(e){i.removeAllNotices(),i.createErrorNotice(e)}function B(e){var o,r,a,l,i;if(!e||!e.url)return void n({url:void 0,alt:void 0,id:void 0,title:void 0,caption:void 0});if((0,Pe.isBlobURL)(e.url))return void _(e.url);_();let s,c=((e,t)=>{const n=(0,Le.pick)(e,["alt","id","link","caption"]);return n.url=(0,Le.get)(e,["sizes",t,"url"])||(0,Le.get)(e,["media_details","sizes",t,"source_url"])||e.url,n})(e,C);var u,d;w.current&&!(0,Le.get)(c,["caption"])&&(c=(0,Le.omit)(c,["caption"])),s=e.id&&e.id===h?{url:m}:{width:void 0,height:void 0,sizeSlug:(u=e,d=C,(0,Le.has)(u,["sizes",d,"url"])||(0,Le.has)(u,["media_details","sizes",d,"source_url"])?C:"full")};let p,g=t.linkDestination;if(!g)switch((null===(o=wp)||void 0===o||null===(r=o.media)||void 0===r||null===(a=r.view)||void 0===a||null===(l=a.settings)||void 0===l||null===(i=l.defaultProps)||void 0===i?void 0:i.link)||da){case"file":case pa:g=pa;break;case"post":case ga:g=ga;break;case ha:g=ha;break;case da:g=da}switch(g){case pa:p=e.url;break;case ga:p=e.link}c.href=p,n({...c,...s,linkDestination:g})}function T(e){e!==m&&n({url:e,id:void 0,width:void 0,height:void 0,sizeSlug:C})}let N=((e,t)=>!e&&(0,Pe.isBlobURL)(t))(h,m);(0,ye.useEffect)((()=>{if(!N)return;const e=(0,Pe.getBlobByURL)(m);e&&x({filesList:[e],onFileChange:e=>{let[t]=e;B(t)},allowedTypes:ba,onError:e=>{N=!1,i.createErrorNotice(e),n({src:void 0,id:void 0,url:void 0})}})}),[]),(0,ye.useEffect)((()=>{N?_(m):(0,Pe.revokeBlobURL)(f)}),[N,m]);const z=jl(h,m)?m:void 0,P=!!m&&(0,ye.createElement)("img",{alt:(0,we.__)("Edit image"),title:(0,we.__)("Edit image"),className:"edit-image-preview",src:m}),I=nt()(r,{"is-transient":f,"is-resized":!!v||!!b,[`size-${y}`]:y}),M=(0,Ee.useBlockProps)({ref:E,className:I});return(0,ye.createElement)("figure",M,(f||m)&&(0,ye.createElement)(Wl,{temporaryURL:f,attributes:t,setAttributes:n,isSelected:o,insertBlocksAfter:l,onReplace:s,onSelectImage:B,onSelectURL:T,onUploadError:S,containerRef:E,context:c,clientId:u}),!m&&(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(Ee.BlockAlignmentControl,{value:g,onChange:function(e){const t=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};n({...t,align:e})}})),(0,ye.createElement)(Ee.MediaPlaceholder,{icon:(0,ye.createElement)(Ee.BlockIcon,{icon:Pa}),onSelect:B,onSelectURL:T,notices:a,onError:S,accept:"image/*",allowedTypes:ba,value:{id:h,src:z},mediaPreview:P,disableMediaButtons:f||m}))}));function Kl(e,t){const{body:n}=document.implementation.createHTMLDocument("");n.innerHTML=e;const{firstElementChild:o}=n;if(o&&"A"===o.nodeName)return o.getAttribute(t)||void 0}const Ql={img:{attributes:["src","alt","title"],classes:["alignleft","aligncenter","alignright","alignnone",/^wp-image-\d+$/]}},Jl={from:[{type:"raw",isMatch:e=>"FIGURE"===e.nodeName&&!!e.querySelector("img"),schema:e=>{let{phrasingContentSchema:t}=e;return{figure:{require:["img"],children:{...Ql,a:{attributes:["href","rel","target"],children:Ql},figcaption:{children:t}}}}},transform:e=>{const t=e.className+" "+e.querySelector("img").className,n=/(?:^|\s)align(left|center|right)(?:$|\s)/.exec(t),o=""===e.id?void 0:e.id,r=n?n[1]:void 0,a=/(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(t),l=a?Number(a[1]):void 0,i=e.querySelector("a"),s=i&&i.href?"custom":void 0,c=i&&i.href?i.href:void 0,u=i&&i.rel?i.rel:void 0,m=i&&i.className?i.className:void 0,d=(0,be.getBlockAttributes)("core/image",e.outerHTML,{align:r,id:l,linkDestination:s,href:c,rel:u,linkClass:m,anchor:o});return(0,be.createBlock)("core/image",d)}},{type:"files",isMatch(e){if(e.some((e=>0===e.type.indexOf("image/")))&&e.some((e=>0!==e.type.indexOf("image/")))){const{createErrorNotice:e}=(0,Ie.dispatch)(Ir.store);e((0,we.__)("If uploading to a gallery all files need to be image formats"),{id:"gallery-transform-invalid-file"})}return(0,Le.every)(e,(e=>0===e.type.indexOf("image/")))},transform(e){const t=e.map((e=>(0,be.createBlock)("core/image",{url:(0,Pe.createBlobURL)(e)})));return t}},{type:"shortcode",tag:"caption",attributes:{url:{type:"string",source:"attribute",attribute:"src",selector:"img"},alt:{type:"string",source:"attribute",attribute:"alt",selector:"img"},caption:{shortcode:function(e,t){let{shortcode:n}=t;const{body:o}=document.implementation.createHTMLDocument("");o.innerHTML=n.content;let r=o.querySelector("img");for(;r&&r.parentNode&&r.parentNode!==o;)r=r.parentNode;return r&&r.parentNode.removeChild(r),o.innerHTML.trim()}},href:{shortcode:(e,t)=>{let{shortcode:n}=t;return Kl(n.content,"href")}},rel:{shortcode:(e,t)=>{let{shortcode:n}=t;return Kl(n.content,"rel")}},linkClass:{shortcode:(e,t)=>{let{shortcode:n}=t;return Kl(n.content,"class")}},id:{type:"number",shortcode:e=>{let{named:{id:t}}=e;if(t)return parseInt(t.replace("attachment_",""),10)}},align:{type:"string",shortcode:e=>{let{named:{align:t="alignnone"}}=e;return t.replace("align","")}}}}]};var Yl=Jl;const Xl={apiVersion:2,name:"core/image",title:"Image",category:"media",usesContext:["allowResize","imageCrop","fixedHeight"],description:"Insert an image to make a visual statement.",keywords:["img","photo","picture"],textdomain:"default",attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},title:{type:"string",source:"attribute",selector:"img",attribute:"title"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number"},width:{type:"number"},height:{type:"number"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{__experimentalDuotone:"img",text:!1,background:!1},__experimentalBorder:{radius:!0}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"rounded",label:"Rounded"}],editorStyle:"wp-block-image-editor",style:"wp-block-image"},{name:ei}=Xl,ti={icon:Pa,example:{attributes:{sizeSlug:"large",url:"https://s.w.org/images/core/5.3/MtBlanc1.jpg",caption:(0,we.__)("Mont Blanc appears—still, snowy, and serene.")}},__experimentalLabel(e,t){let{context:n}=t;if("accessibility"===n){const{caption:t,alt:n,url:o}=e;return o?n?n+(t?". "+t:""):t||"":(0,we.__)("Empty")}},getEditWrapperProps:e=>({"data-align":e.align}),transforms:Yl,edit:Zl,save:function(e){let{attributes:t}=e;const{url:n,alt:o,caption:r,align:a,href:l,rel:i,linkClass:s,width:c,height:u,id:m,linkTarget:d,sizeSlug:p,title:g}=t,h=(0,Le.isEmpty)(i)?void 0:i,v=nt()({[`align${a}`]:a,[`size-${p}`]:p,"is-resized":c||u}),b=(0,ye.createElement)("img",{src:n,alt:o,className:m?`wp-image-${m}`:null,width:c,height:u,title:g}),y=(0,ye.createElement)(ye.Fragment,null,l?(0,ye.createElement)("a",{className:s,href:l,target:d,rel:h},b):b,!Ee.RichText.isEmpty(r)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:r}));return"left"===a||"right"===a||"center"===a?(0,ye.createElement)("div",Ee.useBlockProps.save(),(0,ye.createElement)("figure",{className:v},y)):(0,ye.createElement)("figure",Ee.useBlockProps.save({className:v}),y)},deprecated:Gl};var ni=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"}));const oi={apiVersion:2,name:"core/latest-comments",title:"Latest Comments",category:"widgets",description:"Display a list of your most recent comments.",keywords:["recent comments"],textdomain:"default",attributes:{commentsToShow:{type:"number",default:5,minimum:1,maximum:100},displayAvatar:{type:"boolean",default:!0},displayDate:{type:"boolean",default:!0},displayExcerpt:{type:"boolean",default:!0}},supports:{align:!0,html:!1},editorStyle:"wp-block-latest-comments-editor",style:"wp-block-latest-comments"},{name:ri}=oi,ai={icon:ni,example:{},edit:function(e){let{attributes:t,setAttributes:n}=e;const{commentsToShow:o,displayAvatar:r,displayDate:a,displayExcerpt:l}=t;return(0,ye.createElement)("div",(0,Ee.useBlockProps)(),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Latest comments settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Display avatar"),checked:r,onChange:()=>n({displayAvatar:!r})}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Display date"),checked:a,onChange:()=>n({displayDate:!a})}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Display excerpt"),checked:l,onChange:()=>n({displayExcerpt:!l})}),(0,ye.createElement)(ke.RangeControl,{label:(0,we.__)("Number of comments"),value:o,onChange:e=>n({commentsToShow:e}),min:1,max:100,required:!0}))),(0,ye.createElement)(ke.Disabled,null,(0,ye.createElement)(xe(),{block:"core/latest-comments",attributes:t,urlQueryArgs:{_locale:"site"}})))}};var li=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"}));const{attributes:ii}={apiVersion:2,name:"core/latest-posts",title:"Latest Posts",category:"widgets",description:"Display a list of your most recent posts.",keywords:["recent posts"],textdomain:"default",attributes:{categories:{type:"array",items:{type:"object"}},selectedAuthor:{type:"number"},postsToShow:{type:"number",default:5},displayPostContent:{type:"boolean",default:!1},displayPostContentRadio:{type:"string",default:"excerpt"},excerptLength:{type:"number",default:55},displayAuthor:{type:"boolean",default:!1},displayPostDate:{type:"boolean",default:!1},postLayout:{type:"string",default:"list"},columns:{type:"number",default:3},order:{type:"string",default:"desc"},orderBy:{type:"string",default:"date"},displayFeaturedImage:{type:"boolean",default:!1},featuredImageAlign:{type:"string",enum:["left","center","right"]},featuredImageSizeSlug:{type:"string",default:"thumbnail"},featuredImageSizeWidth:{type:"number",default:null},featuredImageSizeHeight:{type:"number",default:null},addLinkToFeaturedImage:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-latest-posts-editor",style:"wp-block-latest-posts"};var si=[{attributes:{...ii,categories:{type:"string"}},supports:{align:!0,html:!1},migrate:e=>({...e,categories:[{id:Number(e.categories)}]}),isEligible:e=>{let{categories:t}=e;return t&&"string"==typeof t},save:()=>null}],ci=window.wp.date;var ui=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"}));var mi=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.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 di={per_page:-1,context:"view"},pi={per_page:-1,has_published_posts:["post"],context:"view"};const gi={apiVersion:2,name:"core/latest-posts",title:"Latest Posts",category:"widgets",description:"Display a list of your most recent posts.",keywords:["recent posts"],textdomain:"default",attributes:{categories:{type:"array",items:{type:"object"}},selectedAuthor:{type:"number"},postsToShow:{type:"number",default:5},displayPostContent:{type:"boolean",default:!1},displayPostContentRadio:{type:"string",default:"excerpt"},excerptLength:{type:"number",default:55},displayAuthor:{type:"boolean",default:!1},displayPostDate:{type:"boolean",default:!1},postLayout:{type:"string",default:"list"},columns:{type:"number",default:3},order:{type:"string",default:"desc"},orderBy:{type:"string",default:"date"},displayFeaturedImage:{type:"boolean",default:!1},featuredImageAlign:{type:"string",enum:["left","center","right"]},featuredImageSizeSlug:{type:"string",default:"thumbnail"},featuredImageSizeWidth:{type:"number",default:null},featuredImageSizeHeight:{type:"number",default:null},addLinkToFeaturedImage:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-latest-posts-editor",style:"wp-block-latest-posts"},{name:hi}=gi,vi={icon:li,example:{},edit:function(e){var t;let{attributes:n,setAttributes:o}=e;const{postsToShow:r,order:a,orderBy:l,categories:i,selectedAuthor:s,displayFeaturedImage:c,displayPostContentRadio:u,displayPostContent:m,displayPostDate:d,displayAuthor:p,postLayout:g,columns:h,excerptLength:v,featuredImageAlign:b,featuredImageSizeSlug:y,featuredImageSizeWidth:f,featuredImageSizeHeight:_,addLinkToFeaturedImage:k}=n,{imageSizeOptions:w,latestPosts:E,defaultImageWidth:C,defaultImageHeight:x,categoriesList:S,authorList:B}=(0,Ie.useSelect)((e=>{const{getEntityRecords:t,getMedia:n,getUsers:o}=e(Dt.store),{getSettings:c}=e(Ee.store),{imageSizes:u,imageDimensions:m}=c(),d=i&&i.length>0?i.map((e=>e.id)):[],p=t("postType","post",(0,Le.pickBy)({categories:d,author:s,order:a,orderby:l,per_page:r},(e=>!(0,Le.isUndefined)(e))));return{defaultImageWidth:(0,Le.get)(m,[y,"width"],0),defaultImageHeight:(0,Le.get)(m,[y,"height"],0),imageSizeOptions:u.filter((e=>{let{slug:t}=e;return"full"!==t})).map((e=>{let{name:t,slug:n}=e;return{value:n,label:t}})),latestPosts:Array.isArray(p)?p.map((e=>{if(!e.featured_media)return e;const t=n(e.featured_media);let o=(0,Le.get)(t,["media_details","sizes",y,"source_url"],null);o||(o=(0,Le.get)(t,"source_url",null));const r={url:o,alt:null==t?void 0:t.alt_text};return{...e,featuredImageInfo:r}})):p,categoriesList:t("taxonomy","category",di),authorList:o(pi)}}),[y,r,a,l,i,s]),T=null!==(t=null==S?void 0:S.reduce(((e,t)=>({...e,[t.name]:t})),{}))&&void 0!==t?t:{},N=!(null==E||!E.length),z=(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Post content settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Post content"),checked:m,onChange:e=>o({displayPostContent:e})}),m&&(0,ye.createElement)(ke.RadioControl,{label:(0,we.__)("Show:"),selected:u,options:[{label:(0,we.__)("Excerpt"),value:"excerpt"},{label:(0,we.__)("Full post"),value:"full_post"}],onChange:e=>o({displayPostContentRadio:e})}),m&&"excerpt"===u&&(0,ye.createElement)(ke.RangeControl,{label:(0,we.__)("Max number of words in excerpt"),value:v,onChange:e=>o({excerptLength:e}),min:10,max:100})),(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Post meta settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Display author name"),checked:p,onChange:e=>o({displayAuthor:e})}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Display post date"),checked:d,onChange:e=>o({displayPostDate:e})})),(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Featured image settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Display featured image"),checked:c,onChange:e=>o({displayFeaturedImage:e})}),c&&(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.__experimentalImageSizeControl,{onChange:e=>{const t={};e.hasOwnProperty("width")&&(t.featuredImageSizeWidth=e.width),e.hasOwnProperty("height")&&(t.featuredImageSizeHeight=e.height),o(t)},slug:y,width:f,height:_,imageWidth:C,imageHeight:x,imageSizeOptions:w,onChangeImage:e=>o({featuredImageSizeSlug:e,featuredImageSizeWidth:void 0,featuredImageSizeHeight:void 0})}),(0,ye.createElement)(ke.BaseControl,{className:"block-editor-image-alignment-control__row"},(0,ye.createElement)(ke.BaseControl.VisualLabel,null,(0,we.__)("Image alignment")),(0,ye.createElement)(Ee.BlockAlignmentToolbar,{value:b,onChange:e=>o({featuredImageAlign:e}),controls:["left","center","right"],isCollapsed:!1})),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Add link to featured image"),checked:k,onChange:e=>o({addLinkToFeaturedImage:e})}))),(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Sorting and filtering")},(0,ye.createElement)(ke.QueryControls,{order:a,orderBy:l,numberOfItems:r,onOrderChange:e=>o({order:e}),onOrderByChange:e=>o({orderBy:e}),onNumberOfItemsChange:e=>o({postsToShow:e}),categorySuggestions:T,onCategoryChange:e=>{if(e.some((e=>"string"==typeof e&&!T[e])))return;const t=e.map((e=>"string"==typeof e?T[e]:e));if((0,Le.includes)(t,null))return!1;o({categories:t})},selectedCategories:i,onAuthorChange:e=>o({selectedAuthor:""!==e?Number(e):void 0}),authorList:null!=B?B:[],selectedAuthorId:s}),"grid"===g&&(0,ye.createElement)(ke.RangeControl,{label:(0,we.__)("Columns"),value:h,onChange:e=>o({columns:e}),min:2,max:N?Math.min(6,E.length):6,required:!0}))),P=(0,Ee.useBlockProps)({className:nt()({"wp-block-latest-posts__list":!0,"is-grid":"grid"===g,"has-dates":d,"has-author":p,[`columns-${h}`]:"grid"===g})});if(!N)return(0,ye.createElement)("div",P,z,(0,ye.createElement)(ke.Placeholder,{icon:Wt,label:(0,we.__)("Latest Posts")},Array.isArray(E)?(0,we.__)("No posts found."):(0,ye.createElement)(ke.Spinner,null)));const I=E.length>r?E.slice(0,r):E,M=[{icon:ui,title:(0,we.__)("List view"),onClick:()=>o({postLayout:"list"}),isActive:"list"===g},{icon:mi,title:(0,we.__)("Grid view"),onClick:()=>o({postLayout:"grid"}),isActive:"grid"===g}],R=(0,ci.__experimentalGetSettings)().formats.date;return(0,ye.createElement)("div",null,z,(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(ke.ToolbarGroup,{controls:M})),(0,ye.createElement)("ul",P,I.map(((e,t)=>{const n=(0,Le.invoke)(e,["title","rendered","trim"]);let o=e.excerpt.rendered;const r=null==B?void 0:B.find((t=>t.id===e.author)),a=document.createElement("div");a.innerHTML=o,o=a.textContent||a.innerText||"";const{featuredImageInfo:{url:l,alt:i}={}}=e,s=nt()({"wp-block-latest-posts__featured-image":!0,[`align${b}`]:!!b}),g=c&&l,h=g&&(0,ye.createElement)("img",{src:l,alt:i,style:{maxWidth:f,maxHeight:_}}),y=v<o.trim().split(" ").length&&""===e.excerpt.raw?(0,ye.createElement)(ye.Fragment,null,o.trim().split(" ",v).join(" "),(0,we.__)(" … "),(0,ye.createElement)("a",{href:e.link,rel:"noopener noreferrer"},(0,we.__)("Read more"))):o;return(0,ye.createElement)("li",{key:t},g&&(0,ye.createElement)("div",{className:s},k?(0,ye.createElement)("a",{href:e.link,rel:"noreferrer noopener"},h):h),(0,ye.createElement)("a",{href:e.link,rel:"noreferrer noopener"},n?(0,ye.createElement)(ye.RawHTML,null,n):(0,we.__)("(no title)")),p&&r&&(0,ye.createElement)("div",{className:"wp-block-latest-posts__post-author"},(0,we.sprintf)((0,we.__)("by %s"),r.name)),d&&e.date_gmt&&(0,ye.createElement)("time",{dateTime:(0,ci.format)("c",e.date_gmt),className:"wp-block-latest-posts__post-date"},(0,ci.dateI18n)(R,e.date_gmt)),m&&"excerpt"===u&&(0,ye.createElement)("div",{className:"wp-block-latest-posts__post-excerpt"},y),m&&"full_post"===u&&(0,ye.createElement)("div",{className:"wp-block-latest-posts__post-full-content"},(0,ye.createElement)(ye.RawHTML,{key:"html"},e.content.raw.trim())))}))))},deprecated:si},bi={attributes:{ordered:{type:"boolean",default:!1,__experimentalRole:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",__experimentalRole:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,__experimentalFontFamily:!0},color:{gradients:!0,link:!0},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalSlashInserter:!0},save(e){let{attributes:t}=e;const{ordered:n,values:o,type:r,reversed:a,start:l}=t,i=n?"ol":"ul";return(0,ye.createElement)(i,Ee.useBlockProps.save({type:r,reversed:a,start:l}),(0,ye.createElement)(Ee.RichText.Content,{value:o,multiline:"li"}))},migrate:lt,isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}};var yi=[bi];var fi=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}));var _i=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}));var ki=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z"}));var wi=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"}));var Ei=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z"}));var Ci=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z"}));var xi=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z"}));var Si=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z"}));var Bi=e=>{let{setAttributes:t,reversed:n,start:o}=e;return(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Ordered list settings")},(0,ye.createElement)(ke.TextControl,{label:(0,we.__)("Start value"),type:"number",onChange:e=>{const n=parseInt(e,10);t({start:isNaN(n)?void 0:n})},value:Number.isInteger(o)?o.toString(10):"",step:"1"}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Reverse list numbering"),checked:n||!1,onChange:e=>{t({reversed:e||void 0})}})))};function Ti(e){let{phrasingContentSchema:t}=e;const n={...t,ul:{},ol:{attributes:["type","start","reversed"]}};return["ul","ol"].forEach((e=>{n[e].children={li:{children:n}}})),n}const Ni={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph","core/heading"],transform:e=>(0,be.createBlock)("core/list",{values:(0,Tt.toHTMLString)({value:(0,Tt.join)(e.map((t=>{let{content:n}=t;const o=(0,Tt.create)({html:n});return e.length>1?o:(0,Tt.replace)(o,/\n/g,Tt.__UNSTABLE_LINE_SEPARATOR)})),Tt.__UNSTABLE_LINE_SEPARATOR),multilineTag:"li"}),anchor:e.anchor})},{type:"block",blocks:["core/quote","core/pullquote"],transform:e=>{let{value:t,anchor:n}=e;return(0,be.createBlock)("core/list",{values:(0,Tt.toHTMLString)({value:(0,Tt.create)({html:t,multilineTag:"p"}),multilineTag:"li"}),anchor:n})}},{type:"raw",selector:"ol,ul",schema:e=>({ol:Ti(e).ol,ul:Ti(e).ul}),transform(e){const t={ordered:"OL"===e.nodeName,anchor:""===e.id?void 0:e.id};if(t.ordered){const n=e.getAttribute("type");n&&(t.type=n),null!==e.getAttribute("reversed")&&(t.reversed=!0);const o=parseInt(e.getAttribute("start"),10);isNaN(o)||1===o&&!t.reversed||(t.start=o)}return(0,be.createBlock)("core/list",{...(0,be.getBlockAttributes)("core/list",e.outerHTML),...t})}},...["*","-"].map((e=>({type:"prefix",prefix:e,transform:e=>(0,be.createBlock)("core/list",{values:`<li>${e}</li>`})}))),...["1.","1)"].map((e=>({type:"prefix",prefix:e,transform:e=>(0,be.createBlock)("core/list",{ordered:!0,values:`<li>${e}</li>`})})))],to:[{type:"block",blocks:["core/paragraph"],transform:e=>{let{values:t}=e;return(0,Tt.split)((0,Tt.create)({html:t,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),Tt.__UNSTABLE_LINE_SEPARATOR).map((e=>(0,be.createBlock)("core/paragraph",{content:(0,Tt.toHTMLString)({value:e})})))}},{type:"block",blocks:["core/heading"],transform:e=>{let{values:t}=e;return(0,Tt.split)((0,Tt.create)({html:t,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),Tt.__UNSTABLE_LINE_SEPARATOR).map((e=>(0,be.createBlock)("core/heading",{content:(0,Tt.toHTMLString)({value:e})})))}},{type:"block",blocks:["core/quote"],transform:e=>{let{values:t,anchor:n}=e;return(0,be.createBlock)("core/quote",{value:(0,Tt.toHTMLString)({value:(0,Tt.create)({html:t,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),multilineTag:"p"}),anchor:n})}},{type:"block",blocks:["core/pullquote"],transform:e=>{let{values:t,anchor:n}=e;return(0,be.createBlock)("core/pullquote",{value:(0,Tt.toHTMLString)({value:(0,Tt.create)({html:t,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),multilineTag:"p"}),anchor:n})}}]};var zi=Ni;const Pi={apiVersion:2,name:"core/list",title:"List",category:"text",description:"Create a bulleted or numbered list.",keywords:["bullet list","ordered list","numbered list"],textdomain:"default",attributes:{ordered:{type:"boolean",default:!1,__experimentalRole:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",__experimentalRole:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,__experimentalFontFamily:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalSlashInserter:!0},editorStyle:"wp-block-list-editor",style:"wp-block-list"},{name:Ii}=Pi,Mi={icon:ui,example:{attributes:{values:"<li>Alice.</li><li>The White Rabbit.</li><li>The Cheshire Cat.</li><li>The Mad Hatter.</li><li>The Queen of Hearts.</li>"}},transforms:zi,merge(e,t){const{values:n}=t;return n&&"<li></li>"!==n?{...e,values:e.values+n}:e},edit:function(e){let{attributes:t,setAttributes:n,mergeBlocks:o,onReplace:r,style:a}=e;const{ordered:l,values:i,type:s,reversed:c,start:u,placeholder:m}=t,d=l?"ol":"ul",p=(0,Ee.useBlockProps)({style:a});return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.RichText,gt({identifier:"values",multiline:"li",tagName:d,onChange:e=>n({values:e}),value:i,"aria-label":(0,we.__)("List text"),placeholder:m||(0,we.__)("List"),onMerge:o,onSplit:e=>(0,be.createBlock)(Ii,{...t,values:e}),__unstableOnSplitMiddle:()=>(0,be.createBlock)("core/paragraph"),onReplace:r,onRemove:()=>r([]),start:u,reversed:c,type:s},p),(e=>{let{value:t,onChange:o,onFocus:r}=e;return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.RichTextShortcut,{type:"primary",character:"[",onUse:()=>{o((0,Tt.__unstableOutdentListItems)(t))}}),(0,ye.createElement)(Ee.RichTextShortcut,{type:"primary",character:"]",onUse:()=>{o((0,Tt.__unstableIndentListItems)(t,{type:d}))}}),(0,ye.createElement)(Ee.RichTextShortcut,{type:"primary",character:"m",onUse:()=>{o((0,Tt.__unstableIndentListItems)(t,{type:d}))}}),(0,ye.createElement)(Ee.RichTextShortcut,{type:"primaryShift",character:"m",onUse:()=>{o((0,Tt.__unstableOutdentListItems)(t))}}),(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(ke.ToolbarButton,{icon:(0,we.isRTL)()?fi:_i,title:(0,we.__)("Unordered"),describedBy:(0,we.__)("Convert to unordered list"),isActive:(0,Tt.__unstableIsActiveListType)(t,"ul",d),onClick:()=>{o((0,Tt.__unstableChangeListType)(t,{type:"ul"})),r(),(0,Tt.__unstableIsListRootSelected)(t)&&n({ordered:!1})}}),(0,ye.createElement)(ke.ToolbarButton,{icon:(0,we.isRTL)()?ki:wi,title:(0,we.__)("Ordered"),describedBy:(0,we.__)("Convert to ordered list"),isActive:(0,Tt.__unstableIsActiveListType)(t,"ol",d),onClick:()=>{o((0,Tt.__unstableChangeListType)(t,{type:"ol"})),r(),(0,Tt.__unstableIsListRootSelected)(t)&&n({ordered:!0})}}),(0,ye.createElement)(ke.ToolbarButton,{icon:(0,we.isRTL)()?Ei:Ci,title:(0,we.__)("Outdent"),describedBy:(0,we.__)("Outdent list item"),shortcut:(0,we._x)("Backspace","keyboard key"),isDisabled:!(0,Tt.__unstableCanOutdentListItems)(t),onClick:()=>{o((0,Tt.__unstableOutdentListItems)(t)),r()}}),(0,ye.createElement)(ke.ToolbarButton,{icon:(0,we.isRTL)()?xi:Si,title:(0,we.__)("Indent"),describedBy:(0,we.__)("Indent list item"),shortcut:(0,we._x)("Space","keyboard key"),isDisabled:!(0,Tt.__unstableCanIndentListItems)(t),onClick:()=>{o((0,Tt.__unstableIndentListItems)(t,{type:d})),r()}})))})),l&&(0,ye.createElement)(Bi,{setAttributes:n,ordered:l,reversed:c,start:u,placeholder:m}))},save:function(e){let{attributes:t}=e;const{ordered:n,values:o,type:r,reversed:a,start:l}=t,i=n?"ol":"ul";return(0,ye.createElement)(i,Ee.useBlockProps.save({type:r,reversed:a,start:l}),(0,ye.createElement)(Ee.RichText.Content,{value:o,multiline:"li"}))},deprecated:yi};var Ri=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M11 14.5l1.1 1.1 3-3 .5-.5-.6-.6-3-3-1 1 1.7 1.7H5v1.5h7.7L11 14.5zM16.8 5h-7c-1.1 0-2 .9-2 2v1.5h1.5V7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v10c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-1.5H7.8V17c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z"}));const Li={apiVersion:2,name:"core/loginout",title:"Login/out",category:"theme",description:"Show login & logout links.",keywords:["login","logout","form"],textdomain:"default",attributes:{displayLoginAsForm:{type:"boolean",default:!1},redirectToCurrent:{type:"boolean",default:!0}},supports:{className:!0,typography:{fontSize:!1}}},{name:Vi}=Li,Hi={icon:Ri,edit:function(e){let{attributes:t,setAttributes:n}=e;const{displayLoginAsForm:o,redirectToCurrent:r}=t;return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Login/out settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Display login as form"),checked:o,onChange:()=>n({displayLoginAsForm:!o})}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Redirect to current URL"),checked:r,onChange:()=>n({redirectToCurrent:!r})}))),(0,ye.createElement)("div",(0,Ee.useBlockProps)({className:"logged-in"}),(0,ye.createElement)("a",{href:"#login-pseudo-link"},(0,we.__)("Log out"))))}};var Ai=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M3 18h8V6H3v12zM14 7.5V9h7V7.5h-7zm0 5.3h7v-1.5h-7v1.5zm0 3.7h7V15h-7v1.5z"})),Fi=(0,ye.createElement)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(ke.Path,{d:"M18 2l2 4h-2l-2-4h-3l2 4h-2l-2-4h-1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V2zm2 12H10V4.4L11.8 8H20z"}),(0,ye.createElement)(ke.Path,{d:"M14 20H4V10h3V8H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3h-2z"}),(0,ye.createElement)(ke.Path,{d:"M5 19h8l-1.59-2H9.24l-.84 1.1L7 16.3 5 19z"}));const Di=["image","video"];function Gi(e,t){return e?{backgroundImage:`url(${e})`,backgroundPosition:t?`${100*t.x}% ${100*t.y}%`:"50% 50%"}:{}}const Ui=(0,ye.forwardRef)(((e,t)=>{let{isSelected:n,isStackedOnMobile:o,...r}=e;const a=(0,ot.useViewportMatch)("small","<");return(0,ye.createElement)(ke.ResizableBox,gt({ref:t,showHandle:n&&(!a||!o)},r))}));function Oi(e){let{mediaId:t,mediaUrl:n,onSelectMedia:o}=e;return(0,ye.createElement)(Ee.BlockControls,{group:"other"},(0,ye.createElement)(Ee.MediaReplaceFlow,{mediaId:t,mediaURL:n,allowedTypes:Di,accept:"image/*,video/*",onSelect:o}))}function qi(e){let{className:t,noticeOperations:n,noticeUI:o,mediaUrl:r,onSelectMedia:a}=e;return(0,ye.createElement)(Ee.MediaPlaceholder,{icon:(0,ye.createElement)(Ee.BlockIcon,{icon:Fi}),labels:{title:(0,we.__)("Media area")},className:t,onSelect:a,accept:"image/*,video/*",allowedTypes:Di,notices:o,onError:e=>{n.removeAllNotices(),n.createErrorNotice(e)},disableMediaButtons:r})}var $i=(0,ke.withNotices)((0,ye.forwardRef)((function(e,t){const{className:n,commitWidthChange:o,focalPoint:r,imageFill:a,isSelected:l,isStackedOnMobile:i,mediaAlt:s,mediaId:c,mediaPosition:u,mediaType:m,mediaUrl:d,mediaWidth:p,onSelectMedia:g,onWidthChange:h}=e,v=!c&&(0,Pe.isBlobURL)(d),{toggleSelection:b}=(0,Ie.useDispatch)(Ee.store);if(d){const y=()=>{b(!1)},f=(e,t,n)=>{h(parseInt(n.style.width))},_=(e,t,n)=>{b(!0),o(parseInt(n.style.width))},k={right:"left"===u,left:"right"===u},w="image"===m&&a?Gi(d,r):{},E={image:()=>(0,ye.createElement)("img",{src:d,alt:s}),video:()=>(0,ye.createElement)("video",{controls:!0,src:d})};return(0,ye.createElement)(Ui,{as:"figure",className:nt()(n,"editor-media-container__resizer",{"is-transient":v}),style:w,size:{width:p+"%"},minWidth:"10%",maxWidth:"100%",enable:k,onResizeStart:y,onResize:f,onResizeStop:_,axis:"x",isSelected:l,isStackedOnMobile:i,ref:t},(0,ye.createElement)(Oi,{onSelectMedia:g,mediaUrl:d,mediaId:c}),(E[m]||Le.noop)(),v&&(0,ye.createElement)(ke.Spinner,null),(0,ye.createElement)(qi,e))}return(0,ye.createElement)(qi,e)})));const Wi=e=>{if(!e.customBackgroundColor)return e;const t={color:{background:e.customBackgroundColor}};return{...(0,Le.omit)(e,["customBackgroundColor"]),style:t}},ji={align:{type:"string",default:"wide"},backgroundColor:{type:"string"},mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:""},mediaPosition:{type:"string",default:"left"},mediaId:{type:"number"},mediaType:{type:"string"},mediaWidth:{type:"number",default:50},isStackedOnMobile:{type:"boolean",default:!0}};var Zi=[{attributes:{...ji,customBackgroundColor:{type:"string"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},migrate:Wi,save(e){let{attributes:t}=e;const{backgroundColor:n,customBackgroundColor:o,isStackedOnMobile:r,mediaAlt:a,mediaPosition:l,mediaType:i,mediaUrl:s,mediaWidth:c,mediaId:u,verticalAlignment:m,imageFill:d,focalPoint:p,linkClass:g,href:h,linkTarget:v,rel:b}=t,y=(0,Le.isEmpty)(b)?void 0:b;let f=(0,ye.createElement)("img",{src:s,alt:a,className:u&&"image"===i?`wp-image-${u}`:null});h&&(f=(0,ye.createElement)("a",{className:g,href:h,target:v,rel:y},f));const _={image:()=>f,video:()=>(0,ye.createElement)("video",{controls:!0,src:s})},k=(0,Ee.getColorClassName)("background-color",n),w=nt()({"has-media-on-the-right":"right"===l,"has-background":k||o,[k]:k,"is-stacked-on-mobile":r,[`is-vertically-aligned-${m}`]:m,"is-image-fill":d}),E=d?Gi(s,p):{};let C;50!==c&&(C="right"===l?`auto ${c}%`:`${c}% auto`);const x={backgroundColor:k?void 0:o,gridTemplateColumns:C};return(0,ye.createElement)("div",{className:w,style:x},(0,ye.createElement)("figure",{className:"wp-block-media-text__media",style:E},(_[i]||Le.noop)()),(0,ye.createElement)("div",{className:"wp-block-media-text__content"},(0,ye.createElement)(Ee.InnerBlocks.Content,null)))}},{attributes:{...ji,customBackgroundColor:{type:"string"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},migrate:Wi,save(e){let{attributes:t}=e;const{backgroundColor:n,customBackgroundColor:o,isStackedOnMobile:r,mediaAlt:a,mediaPosition:l,mediaType:i,mediaUrl:s,mediaWidth:c,mediaId:u,verticalAlignment:m,imageFill:d,focalPoint:p}=t,g={image:()=>(0,ye.createElement)("img",{src:s,alt:a,className:u&&"image"===i?`wp-image-${u}`:null}),video:()=>(0,ye.createElement)("video",{controls:!0,src:s})},h=(0,Ee.getColorClassName)("background-color",n),v=nt()({"has-media-on-the-right":"right"===l,[h]:h,"is-stacked-on-mobile":r,[`is-vertically-aligned-${m}`]:m,"is-image-fill":d}),b=d?Gi(s,p):{};let y;50!==c&&(y="right"===l?`auto ${c}%`:`${c}% auto`);const f={backgroundColor:h?void 0:o,gridTemplateColumns:y};return(0,ye.createElement)("div",{className:v,style:f},(0,ye.createElement)("figure",{className:"wp-block-media-text__media",style:b},(g[i]||Le.noop)()),(0,ye.createElement)("div",{className:"wp-block-media-text__content"},(0,ye.createElement)(Ee.InnerBlocks.Content,null)))}},{attributes:{...ji,customBackgroundColor:{type:"string"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"}},save(e){let{attributes:t}=e;const{backgroundColor:n,customBackgroundColor:o,isStackedOnMobile:r,mediaAlt:a,mediaPosition:l,mediaType:i,mediaUrl:s,mediaWidth:c}=t,u={image:()=>(0,ye.createElement)("img",{src:s,alt:a}),video:()=>(0,ye.createElement)("video",{controls:!0,src:s})},m=(0,Ee.getColorClassName)("background-color",n),d=nt()({"has-media-on-the-right":"right"===l,[m]:m,"is-stacked-on-mobile":r});let p;50!==c&&(p="right"===l?`auto ${c}%`:`${c}% auto`);const g={backgroundColor:m?void 0:o,gridTemplateColumns:p};return(0,ye.createElement)("div",{className:d,style:g},(0,ye.createElement)("figure",{className:"wp-block-media-text__media"},(u[i]||Le.noop)()),(0,ye.createElement)("div",{className:"wp-block-media-text__content"},(0,ye.createElement)(Ee.InnerBlocks.Content,null)))}}];var Ki=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M4 18h6V6H4v12zm9-9.5V10h7V8.5h-7zm0 7h7V14h-7v1.5z"}));var Qi=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M14 6v12h6V6h-6zM4 10h7V8.5H4V10zm0 5.5h7V14H4v1.5z"}));const Ji="full",Yi=[["core/paragraph",{fontSize:"large",placeholder:(0,we._x)("Content…","content placeholder")}]],Xi=e=>Math.max(15,Math.min(e,85));function es(e,t){var n,o,r;return null==e||null===(n=e.media_details)||void 0===n||null===(o=n.sizes)||void 0===o||null===(r=o[t])||void 0===r?void 0:r.source_url}var ts=function(e){let{attributes:t,isSelected:n,setAttributes:o}=e;const{focalPoint:r,href:a,imageFill:l,isStackedOnMobile:i,linkClass:s,linkDestination:c,linkTarget:u,mediaAlt:m,mediaId:d,mediaPosition:p,mediaType:g,mediaUrl:h,mediaWidth:v,rel:b,verticalAlignment:y}=t,f=t.mediaSizeSlug||Ji,_=(0,Ie.useSelect)((e=>d&&n?e(Dt.store).getMedia(d):null),[n,d]),k=(0,ye.useRef)(),w=e=>{const{style:t}=k.current.resizable,{x:n,y:o}=e;t.backgroundPosition=`${100*n}% ${100*o}%`},[E,C]=(0,ye.useState)(null),x=function(e){let{attributes:{linkDestination:t,href:n},setAttributes:o}=e;return e=>{let r,a;var l,i,s,c,u;r=e.media_type?"image"===e.media_type?"image":"video":e.type,"image"===r&&(a=(null===(l=e.sizes)||void 0===l||null===(i=l.large)||void 0===i?void 0:i.url)||(null===(s=e.media_details)||void 0===s||null===(c=s.sizes)||void 0===c||null===(u=c.large)||void 0===u?void 0:u.source_url));let m=n;"media"===t&&(m=e.url),"attachment"===t&&(m=e.link),o({mediaAlt:e.alt,mediaId:e.id,mediaType:r,mediaUrl:a||e.url,mediaLink:e.link||void 0,href:m,focalPoint:void 0})}}({attributes:t,setAttributes:o}),S=e=>{o({mediaWidth:Xi(e)}),C(Xi(e))},B=nt()({"has-media-on-the-right":"right"===p,"is-selected":n,"is-stacked-on-mobile":i,[`is-vertically-aligned-${y}`]:y,"is-image-fill":l}),T=`${E||v}%`,N="right"===p?`1fr ${T}`:`${T} 1fr`,z={gridTemplateColumns:N,msGridColumns:N},P=(0,Ie.useSelect)((e=>{const t=e(Ee.store).getSettings();return null==t?void 0:t.imageSizes}),[]),I=(0,Le.map)((0,Le.filter)(P,(e=>{let{slug:t}=e;return es(_,t)})),(e=>{let{name:t,slug:n}=e;return{value:n,label:t}})),M=(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Media & Text settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Stack on mobile"),checked:i,onChange:()=>o({isStackedOnMobile:!i})}),"image"===g&&(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Crop image to fill entire column"),checked:l,onChange:()=>o({imageFill:!l})}),l&&h&&"image"===g&&(0,ye.createElement)(ke.FocalPointPicker,{label:(0,we.__)("Focal point picker"),url:h,value:r,onChange:e=>o({focalPoint:e}),onDragStart:w,onDrag:w}),"image"===g&&(0,ye.createElement)(ke.TextareaControl,{label:(0,we.__)("Alt text (alternative text)"),value:m,onChange:e=>{o({mediaAlt:e})},help:(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.ExternalLink,{href:"https://www.w3.org/WAI/tutorials/images/decision-tree"},(0,we.__)("Describe the purpose of the image")),(0,we.__)("Leave empty if the image is purely decorative."))}),"image"===g&&(0,ye.createElement)(Ee.__experimentalImageSizeControl,{onChangeImage:e=>{const t=es(_,e);if(!t)return null;o({mediaUrl:t,mediaSizeSlug:e})},slug:f,imageSizeOptions:I,isResizable:!1}),h&&(0,ye.createElement)(ke.RangeControl,{label:(0,we.__)("Media width"),value:E||v,onChange:S,min:15,max:85})),R=(0,Ee.useBlockProps)({className:B,style:z}),L=(0,Ee.useInnerBlocksProps)({className:"wp-block-media-text__content"},{template:Yi});return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.InspectorControls,null,M),(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(Ee.BlockVerticalAlignmentControl,{onChange:e=>{o({verticalAlignment:e})},value:y}),(0,ye.createElement)(ke.ToolbarButton,{icon:Ki,title:(0,we.__)("Show media on left"),isActive:"left"===p,onClick:()=>o({mediaPosition:"left"})}),(0,ye.createElement)(ke.ToolbarButton,{icon:Qi,title:(0,we.__)("Show media on right"),isActive:"right"===p,onClick:()=>o({mediaPosition:"right"})}),"image"===g&&(0,ye.createElement)(Ee.__experimentalImageURLInputUI,{url:a||"",onChangeUrl:e=>{o(e)},linkDestination:c,mediaType:g,mediaUrl:_&&_.source_url,mediaLink:_&&_.link,linkTarget:u,linkClass:s,rel:b})),(0,ye.createElement)("div",R,(0,ye.createElement)($i,{className:"wp-block-media-text__media",onSelectMedia:x,onWidthChange:e=>{C(Xi(e))},commitWidthChange:S,ref:k,focalPoint:r,imageFill:l,isSelected:n,isStackedOnMobile:i,mediaAlt:m,mediaId:d,mediaPosition:p,mediaType:g,mediaUrl:h,mediaWidth:v}),(0,ye.createElement)("div",L)))};var ns={from:[{type:"block",blocks:["core/image"],transform:e=>{let{alt:t,url:n,id:o,anchor:r}=e;return(0,be.createBlock)("core/media-text",{mediaAlt:t,mediaId:o,mediaUrl:n,mediaType:"image",anchor:r})}},{type:"block",blocks:["core/video"],transform:e=>{let{src:t,id:n,anchor:o}=e;return(0,be.createBlock)("core/media-text",{mediaId:n,mediaUrl:t,mediaType:"video",anchor:o})}}],to:[{type:"block",blocks:["core/image"],isMatch:e=>{let{mediaType:t,mediaUrl:n}=e;return!n||"image"===t},transform:e=>{let{mediaAlt:t,mediaId:n,mediaUrl:o,anchor:r}=e;return(0,be.createBlock)("core/image",{alt:t,id:n,url:o,anchor:r})}},{type:"block",blocks:["core/video"],isMatch:e=>{let{mediaType:t,mediaUrl:n}=e;return!n||"video"===t},transform:e=>{let{mediaId:t,mediaUrl:n,anchor:o}=e;return(0,be.createBlock)("core/video",{id:t,src:n,anchor:o})}}]};const os={apiVersion:2,name:"core/media-text",title:"Media & Text",category:"media",description:"Set media and words side-by-side for a richer layout.",keywords:["image","video"],textdomain:"default",attributes:{align:{type:"string",default:"wide"},mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:""},mediaPosition:{type:"string",default:"left"},mediaId:{type:"number"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},mediaType:{type:"string"},mediaWidth:{type:"number",default:50},mediaSizeSlug:{type:"string"},isStackedOnMobile:{type:"boolean",default:!0},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0}},editorStyle:"wp-block-media-text-editor",style:"wp-block-media-text"},{name:rs}=os,as={icon:Ai,example:{viewportWidth:601,attributes:{mediaType:"image",mediaUrl:"https://s.w.org/images/core/5.3/Biologia_Centrali-Americana_-_Cantorchilus_semibadius_1902.jpg"},innerBlocks:[{name:"core/paragraph",attributes:{content:(0,we.__)("The wren<br>Earns his living<br>Noiselessly.")}},{name:"core/paragraph",attributes:{content:(0,we.__)("— Kobayashi Issa (一茶)")}}]},transforms:ns,edit:ts,save:function(e){let{attributes:t}=e;const{isStackedOnMobile:n,mediaAlt:o,mediaPosition:r,mediaType:a,mediaUrl:l,mediaWidth:i,mediaId:s,verticalAlignment:c,imageFill:u,focalPoint:m,linkClass:d,href:p,linkTarget:g,rel:h}=t,v=t.mediaSizeSlug||Ji,b=(0,Le.isEmpty)(h)?void 0:h,y=nt()({[`wp-image-${s}`]:s&&"image"===a,[`size-${v}`]:s&&"image"===a});let f=(0,ye.createElement)("img",{src:l,alt:o,className:y||null});p&&(f=(0,ye.createElement)("a",{className:d,href:p,target:g,rel:b},f));const _={image:()=>f,video:()=>(0,ye.createElement)("video",{controls:!0,src:l})},k=nt()({"has-media-on-the-right":"right"===r,"is-stacked-on-mobile":n,[`is-vertically-aligned-${c}`]:c,"is-image-fill":u}),w=u?Gi(l,m):{};let E;50!==i&&(E="right"===r?`auto ${i}%`:`${i}% auto`);const C={gridTemplateColumns:E};return(0,ye.createElement)("div",Ee.useBlockProps.save({className:k,style:C}),(0,ye.createElement)("figure",{className:"wp-block-media-text__media",style:w},(_[a]||Le.noop)()),(0,ye.createElement)("div",Ee.useInnerBlocksProps.save({className:"wp-block-media-text__content"})))},deprecated:Zi};var ls=window.wp.dom;const is=(0,Ie.withDispatch)(((e,t)=>{let{clientId:n,attributes:o}=t;const{replaceBlock:r}=e(Ee.store);return{convertToHTML(){r(n,(0,be.createBlock)("core/html",{content:o.originalUndelimitedContent}))}}}))((function(e){let{attributes:t,convertToHTML:n}=e;const{originalName:o,originalUndelimitedContent:r}=t,a=!!r,l=(0,be.getBlockType)("core/html"),i=[];let s;return a&&l?(s=(0,we.sprintf)((0,we.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely.'),o),i.push((0,ye.createElement)(ke.Button,{key:"convert",onClick:n,variant:"primary"},(0,we.__)("Keep as HTML")))):s=(0,we.sprintf)((0,we.__)('Your site doesn’t include support for the "%s" block. You can leave this block intact or remove it entirely.'),o),(0,ye.createElement)("div",(0,Ee.useBlockProps)({className:"has-warning"}),(0,ye.createElement)(Ee.Warning,{actions:i},s),(0,ye.createElement)(ye.RawHTML,null,(0,ls.safeHTML)(r)))}));var ss=is;const cs={apiVersion:2,name:"core/missing",title:"Unsupported",category:"text",description:"Your site doesn’t include support for this block.",textdomain:"default",attributes:{originalName:{type:"string"},originalUndelimitedContent:{type:"string"},originalContent:{type:"string",source:"html"}},supports:{className:!1,customClassName:!1,inserter:!1,html:!1,reusable:!1}},{name:us}=cs,ms={name:us,__experimentalLabel(e,t){let{context:n}=t;if("accessibility"===n){const{originalName:t}=e,n=t?(0,be.getBlockType)(t):void 0;return n?n.settings.title||t:""}},edit:ss,save:function(e){let{attributes:t}=e;return(0,ye.createElement)(ye.RawHTML,null,t.originalContent)}};var ds=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z"}));const ps=(0,we.__)("Read more");var gs={from:[{type:"raw",schema:{"wp-block":{attributes:["data-block"]}},isMatch:e=>e.dataset&&"core/more"===e.dataset.block,transform(e){const{customText:t,noTeaser:n}=e.dataset,o={};return t&&(o.customText=t),""===n&&(o.noTeaser=!0),(0,be.createBlock)("core/more",o)}}]};const hs={apiVersion:2,name:"core/more",title:"More",category:"design",description:"Content before this block will be shown in the excerpt on your archives page.",keywords:["read more"],textdomain:"default",attributes:{customText:{type:"string"},noTeaser:{type:"boolean",default:!1}},supports:{customClassName:!1,className:!1,html:!1,multiple:!1},editorStyle:"wp-block-more-editor"},{name:vs}=hs,bs={icon:ds,example:{},__experimentalLabel(e,t){let{context:n}=t;if("accessibility"===n)return e.customText},transforms:gs,edit:function(e){let{attributes:{customText:t,noTeaser:n},insertBlocksAfter:o,setAttributes:r}=e;const a={width:`${(t||ps).length+1.2}em`};return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,null,(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Hide the excerpt on the full content page"),checked:!!n,onChange:()=>r({noTeaser:!n}),help:e=>e?(0,we.__)("The excerpt is hidden."):(0,we.__)("The excerpt is visible.")}))),(0,ye.createElement)("div",(0,Ee.useBlockProps)(),(0,ye.createElement)("div",{className:"wp-block-more"},(0,ye.createElement)("input",{"aria-label":(0,we.__)("Read more link text"),type:"text",value:t,placeholder:ps,onChange:e=>{r({customText:""!==e.target.value?e.target.value:void 0})},onKeyDown:e=>{let{keyCode:t}=e;t===ht.ENTER&&o([(0,be.createBlock)((0,be.getDefaultBlockName)())])},style:a}))))},save:function(e){let{attributes:{customText:t,noTeaser:n}}=e;const o=t?`\x3c!--more ${t}--\x3e`:"\x3c!--more--\x3e",r=n?"\x3c!--noteaser--\x3e":"";return(0,ye.createElement)(ye.RawHTML,null,(0,Le.compact)([o,r]).join("\n"))}};var ys=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"}));var fs=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));function _s(e){let{clientId:t,__experimentalFeatures:n}=e;const o=(0,Ie.useSelect)((e=>e(Ee.store).__unstableGetClientIdsTree(t)),[t]),r=(0,ye.useRef)(),[a,l]=(0,ye.useState)(300);return(0,ye.useEffect)((()=>{var e,t;l(null!==(e=null==r||null===(t=r.current)||void 0===t?void 0:t.clientHeight)&&void 0!==e?e:300)}),[]),(0,ye.createElement)("div",{style:{minHeight:a}},(0,ye.createElement)(Ee.__experimentalListView,{ref:r,blocks:o,showBlockMovers:!0,showNestedBlocks:!0,__experimentalFeatures:n}))}function ks(e){return(0,Ie.useSelect)((t=>{var n;const{getEntityRecord:o,getEditedEntityRecord:r,getEntityRecords:a,hasFinishedResolution:l,canUser:i}=t(Dt.store),s=["postType","wp_navigation",e],c=e?o(...s):null;let u=e?r(...s):null;"publish"!==(null===(n=u)||void 0===n?void 0:n.status)&&(u=null);const m=!!e&&l("getEditedEntityRecord",s),d=["postType","wp_navigation",{per_page:-1,status:"publish"}],p=a(...d),g=e?(null==p?void 0:p.length)>1:(null==p?void 0:p.length)>0;return{isNavigationMenuResolved:m,isNavigationMenuMissing:!e||m&&!c,canSwitchNavigationMenu:g,hasResolvedNavigationMenus:l("getEntityRecords",d),navigationMenu:u,navigationMenus:p,canUserUpdateNavigationEntity:e?i("update","navigation",e):void 0,hasResolvedCanUserUpdateNavigationEntity:l("canUser",["update","navigation",e]),canUserDeleteNavigationEntity:e?i("delete","navigation",e):void 0,hasResolvedCanUserDeleteNavigationEntity:l("canUser",["delete","navigation",e]),canUserCreateNavigation:i("create","navigation"),hasResolvedCanUserCreateNavigation:l("canUser",["create","navigation"])}}),[e])}function ws(e){return{...xs(),...Es(),...Cs(e)}}function Es(){const{menus:e,isResolvingMenus:t,hasResolvedMenus:n}=(0,Ie.useSelect)((e=>{const{getMenus:t,isResolving:n,hasFinishedResolution:o}=e(Dt.store),r=[{per_page:-1}];return{menus:t(...r),isResolvingMenus:n("getMenus",r),hasResolvedMenus:o("getMenus",r)}}),[]);return{menus:e,isResolvingMenus:t,hasResolvedMenus:n,hasMenus:!(!n||null==e||!e.length)}}function Cs(e){const{menuItems:t,hasResolvedMenuItems:n}=(0,Ie.useSelect)((t=>{const{getMenuItems:n,hasFinishedResolution:o}=t(Dt.store),r=void 0!==e,a=r?[{menus:e,per_page:-1}]:void 0;return{menuItems:r?n(...a):void 0,hasResolvedMenuItems:!!r&&o("getMenuItems",a)}}),[e]);return{menuItems:t,hasResolvedMenuItems:n}}function xs(){const{pages:e,isResolvingPages:t,hasResolvedPages:n}=(0,Ie.useSelect)((e=>{const{getEntityRecords:t,isResolving:n,hasFinishedResolution:o}=e(Dt.store),r=["postType","page",{parent:0,order:"asc",orderby:"id",per_page:-1}];return{pages:t(...r)||null,isResolvingPages:n("getEntityRecords",r),hasResolvedPages:o("getEntityRecords",r)}}),[]);return{pages:e,isResolvingPages:t,hasResolvedPages:n,hasPages:!(!n||null==e||!e.length)}}var Ss=function(e){let{icon:t,size:n=24,...o}=e;return(0,ye.cloneElement)(t,{width:n,height:n,...o})},Bs=window.wp.htmlEntities;var Ts=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.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"}));var Ns=e=>{let{isLoading:t}=e;return(0,ye.createElement)("ul",{className:nt()("wp-block-navigation-placeholder__preview","wp-block-navigation__container",{"is-loading":t})},(0,ye.createElement)("li",{className:"wp-block-navigation-item"},""),(0,ye.createElement)("li",{className:"wp-block-navigation-item"},""),(0,ye.createElement)("li",{className:"wp-block-navigation-item"},""),(0,ye.createElement)("li",{className:"wp-block-navigation-placeholder__preview-search-icon"},(0,ye.createElement)(Ss,{icon:Ts})))};function zs(e,t){return e&&t?e+"//"+t:null}const Ps=["postType","wp_navigation",{status:"draft",per_page:-1}],Is=["postType","wp_navigation",{per_page:-1,status:"publish"}];function Ms(e){const t=(0,ye.useContext)(ke.Disabled.Context),n=function(e){return(0,Ie.useSelect)((t=>{if(!e)return;const{getBlock:n,getBlockParentsByBlockName:o}=t(Ee.store),r=o(e,"core/template-part",!0);if(null==r||!r.length)return;const a=t("core/editor").__experimentalGetDefaultTemplatePartAreas(),{getEditedEntityRecord:l}=t(Dt.store);for(const e of r){const t=n(e),{theme:o,slug:r}=t.attributes,s=l("postType","wp_template_part",zs(o,r));var i;if(null!=s&&s.area)return null===(i=a.find((e=>"uncategorized"!==e.area&&e.area===s.area)))||void 0===i?void 0:i.label}}),[e])}(t?void 0:e),o=(0,Ie.useRegistry)();return(0,ye.useCallback)((async()=>{if(t)return"";const{getEntityRecords:e}=o.resolveSelect(Dt.store),[r,a]=await Promise.all([e(...Ps),e(...Is)]),l=n?(0,we.sprintf)((0,we.__)("%s navigation"),n):(0,we.__)("Navigation"),i=[...r,...a].reduce(((e,t)=>{var n,o;return null!=t&&null!==(n=t.title)&&void 0!==n&&null!==(o=n.raw)&&void 0!==o&&o.startsWith(l)?e+1:e}),0);return(i>0?`${l} ${i+1}`:l)||""}),[t,n])}function Rs(e){const{saveEntityRecord:t}=(0,Ie.useDispatch)(Dt.store),n=Ms(e);return(0,ye.useCallback)((async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e||(e=await n());const r={title:e,content:(0,be.serialize)(o),status:"publish"};return await t("postType","wp_navigation",r)}),[be.serialize,t])}function Ls(e){if(!e)return null;const t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"parent";const o=Object.create(null),r=[];for(const a of e)o[a[t]]={...a,children:[]},a[n]?(o[a[n]]=o[a[n]]||{},o[a[n]].children=o[a[n]].children||[],o[a[n]].children.push(o[a[t]])):r.push(o[a[t]]);return r}(e),n=Vs(t);return(0,ja.applyFilters)("blocks.navigation.__unstableMenuItemsToBlocks",n,e)}function Vs(e){let t={};const n=(0,Le.sortBy)(e,"menu_order").map((e=>{var n,o;if("block"===e.type){const[t]=(0,be.parse)(e.content.raw);return t||(0,be.createBlock)("core/freeform",{content:e.content})}const r=function(e){var t;let{title:n,xfn:o,classes:r,attr_title:a,object:l,object_id:i,description:s,url:c,type:u,target:m}=e;l&&"post_tag"===l&&(l="tag");return{label:(null==n?void 0:n.rendered)||"",...(null===(t=l)||void 0===t?void 0:t.length)&&{type:l},kind:(null==u?void 0:u.replace("_","-"))||"custom",url:c||"",...(null==o?void 0:o.length)&&o.join(" ").trim()&&{rel:o.join(" ").trim()},...(null==r?void 0:r.length)&&r.join(" ").trim()&&{className:r.join(" ").trim()},...(null==a?void 0:a.length)&&{title:a},...i&&"custom"!==l&&{id:i},...(null==s?void 0:s.length)&&{description:s},..."_blank"===m&&{opensInNewTab:!0}}}(e),{innerBlocks:a=[],mapping:l={}}=null!==(n=e.children)&&void 0!==n&&n.length?Vs(e.children):{};t={...t,...l};const i=null!==(o=e.children)&&void 0!==o&&o.length?"core/navigation-submenu":"core/navigation-link",s=(0,be.createBlock)(i,r,a);return t[e.id]=s.clientId,s}));return{innerBlocks:n,mapping:t}}function Hs(e){const[t,n]=(0,ye.useState)(),[o,r]=(0,ye.useState)(!1),[a,l]=(0,ye.useState)(""),{menuItems:i,hasResolvedMenuItems:s}=ws(t),c=(0,ye.useCallback)((t=>{const{innerBlocks:n}=Ls(i);e(n,t)}),[i,Ls,e]);return(0,ye.useEffect)((()=>{o&&s&&(c(a),r(!1))}),[o,s,a]),(0,ye.useCallback)(((e,t)=>{n(e),s?c(t):(r(!0),l(t))}),[s,c])}const As=e=>{let{canSwitchNavigationMenu:t,navigationMenus:n,onFinish:o,menus:r,onCreateFromMenu:a,showClassicMenus:l=!1}=e;return(0,ye.createElement)(ke.DropdownMenu,{text:(0,we.__)("Select menu"),icon:null,toggleProps:{variant:"tertiary",iconPosition:"right",className:"wp-block-navigation-placeholder__actions__dropdown"},popoverProps:{isAlternate:!0}},(e=>{let{onClose:i}=e;return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.MenuGroup,{label:(0,we.__)("Menus")},t&&(null==n?void 0:n.map((e=>(0,ye.createElement)(ke.MenuItem,{onClick:()=>{o(e)},onClose:i,key:e.id},(0,Bs.decodeEntities)(e.title.rendered)))))),l&&(0,ye.createElement)(ke.MenuGroup,{label:(0,we.__)("Classic Menus")},null==r?void 0:r.map((e=>(0,ye.createElement)(ke.MenuItem,{onClick:()=>{a(e.id,e.name)},onClose:i,key:e.id},(0,Bs.decodeEntities)(e.name))))))}))};function Fs(e){let{clientId:t,onFinish:n,canSwitchNavigationMenu:o,hasResolvedNavigationMenus:r,canUserCreateNavigation:a=!1}=e;const l=Rs(t),i=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!a)return;const o=await l(t,e);n(o,e)},s=Hs(i),{isResolvingPages:c,menus:u,isResolvingMenus:m,hasPages:d,hasMenus:p}=ws(),g=c||m,{navigationMenus:h}=ks();return(0,ye.createElement)(ye.Fragment,null,(!r||g)&&(0,ye.createElement)(Ns,{isLoading:!0}),r&&!g&&(0,ye.createElement)(ke.Placeholder,{className:"wp-block-navigation-placeholder"},(0,ye.createElement)(Ns,null),(0,ye.createElement)("div",{className:"wp-block-navigation-placeholder__controls"},(0,ye.createElement)("div",{className:"wp-block-navigation-placeholder__actions"},(0,ye.createElement)("div",{className:"wp-block-navigation-placeholder__actions__indicator"},(0,ye.createElement)(Ss,{icon:ys})," ",(0,we.__)("Navigation")),(0,ye.createElement)("hr",null),p||null!=h&&h.length?(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(As,{canSwitchNavigationMenu:o,navigationMenus:h,onFinish:n,menus:u,onCreateFromMenu:s,showClassicMenus:a}),(0,ye.createElement)("hr",null)):void 0,a&&d?(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.Button,{variant:"tertiary",onClick:()=>{const e=[(0,be.createBlock)("core/page-list")];i(e)}},(0,we.__)("Add all pages")),(0,ye.createElement)("hr",null)):void 0,a&&(0,ye.createElement)(ke.Button,{variant:"tertiary",onClick:()=>{i([])}},(0,we.__)("Start empty"))))))}var Ds=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.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"}));function Gs(e){let{children:t,id:n,isOpen:o,isResponsive:r,onToggle:a,isHiddenByDefault:l,classNames:i,styles:s}=e;if(!r)return t;const c=nt()("wp-block-navigation__responsive-container",i,{"is-menu-open":o,"hidden-by-default":l}),u=nt()("wp-block-navigation__responsive-container-open",{"always-shown":l}),m=`${n}-modal`,d={className:"wp-block-navigation__responsive-dialog",...o&&{role:"dialog","aria-modal":!0,"aria-label":(0,we.__)("Menu")}};return(0,ye.createElement)(ye.Fragment,null,!o&&(0,ye.createElement)(ke.Button,{"aria-haspopup":"true","aria-label":(0,we.__)("Open menu"),className:u,onClick:()=>a(!0)},(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",role:"img","aria-hidden":"true",focusable:"false"},(0,ye.createElement)(fe.Rect,{x:"4",y:"7.5",width:"16",height:"1.5"}),(0,ye.createElement)(fe.Rect,{x:"4",y:"15",width:"16",height:"1.5"}))),(0,ye.createElement)("div",{className:c,style:s,id:m},(0,ye.createElement)("div",{className:"wp-block-navigation__responsive-close",tabIndex:"-1"},(0,ye.createElement)("div",d,(0,ye.createElement)(ke.Button,{className:"wp-block-navigation__responsive-container-close","aria-label":(0,we.__)("Close menu"),onClick:()=>a(!1)},(0,ye.createElement)(Ss,{icon:Ds})),(0,ye.createElement)("div",{className:"wp-block-navigation__responsive-container-content",id:`${m}-content`},t)))))}const Us=["core/navigation-link","core/search","core/social-links","core/page-list","core/spacer","core/home-link","core/site-title","core/site-logo","core/navigation-submenu"],Os=["core/navigation-link"],qs={type:"default",alignments:[]};function $s(e){let{isVisible:t,clientId:n,appender:o,hasCustomPlaceholder:r,orientation:a}=e;const{isImmediateParentOfSelectedBlock:l,selectedBlockHasDescendants:i,isSelected:s}=(0,Ie.useSelect)((e=>{var t;const{getClientIdsOfDescendants:o,hasSelectedInnerBlock:r,getSelectedBlockClientId:a}=e(Ee.store),l=a();return{isImmediateParentOfSelectedBlock:r(n,!1),selectedBlockHasDescendants:!(null===(t=o([l]))||void 0===t||!t.length),isSelected:l===n}}),[n]),[c,u,m]=(0,Dt.useEntityBlockEditor)("postType","wp_navigation"),d=(0,ye.useMemo)((()=>c.every((e=>{let{name:t}=e;return"core/navigation-link"===t||"core/navigation-submenu"===t||"core/page-list"===t}))),[c]),p=!(!t||!(s||l&&!i))&&void 0,g=(0,ye.useMemo)((()=>(0,ye.createElement)(Ns,null)),[]),h=(0,Ee.useInnerBlocksProps)({className:"wp-block-navigation__container"},{value:c,onInput:u,onChange:m,allowedBlocks:Us,__experimentalDefaultBlock:Os,__experimentalDirectInsert:d,orientation:a,renderAppender:o||p,templateLock:!1,__experimentalLayout:qs,placeholder:!t||r?void 0:g});return(0,ye.createElement)(Ee.__experimentalBlockContentOverlay,{clientId:n,tagName:"div",wrapperProps:h})}function Ws(e){let{clientId:t,onSelect:n,onCreateNew:o,canUserCreateNavigation:r=!1}=e;const{menus:a,hasMenus:l}=ws(),{navigationMenus:i}=ks(),s=(0,Dt.useEntityId)("postType","wp_navigation"),c=Rs(t),u=Hs((async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!r)return;const o=await c(t,e);n(o)}));return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.MenuGroup,{label:(0,we.__)("Menus")},(0,ye.createElement)(ke.MenuItemsChoice,{value:s,onSelect:e=>n(i.find((t=>t.id===e))),choices:i.map((e=>{let{id:t,title:n}=e;const o=(0,Bs.decodeEntities)(n.rendered);return{value:t,label:o,"aria-label":(0,we.sprintf)((0,we.__)("Switch to '%s'"),o)}}))})),r&&(0,ye.createElement)(ye.Fragment,null,l&&(0,ye.createElement)(ke.MenuGroup,{label:(0,we.__)("Classic Menus")},a.map((e=>(0,ye.createElement)(ke.MenuItem,{onClick:()=>{u(e.id,e.name)},key:e.id},(0,Bs.decodeEntities)(e.name))))),(0,ye.createElement)(ke.MenuGroup,{label:(0,we.__)("Tools")},(0,ye.createElement)(ke.MenuItem,{onClick:o},(0,we.__)("Create new menu")),(0,ye.createElement)(ke.MenuItem,{href:(0,Dr.addQueryArgs)("edit.php",{post_type:"wp_navigation"})},(0,we.__)("Manage menus")))))}function js(){const[e,t]=(0,Dt.useEntityProp)("postType","wp_navigation","title");return(0,ye.createElement)(ke.TextControl,{label:(0,we.__)("Menu name"),value:e,onChange:t})}const Zs={},Ks=["postType","wp_navigation",{status:"draft",per_page:-1}];function Qs(e){let{blockProps:t,blocks:n,clientId:o,hasSavedUnsavedInnerBlocks:r,onSave:a,hasSelection:l}=e;const i=(0,ye.useContext)(ke.Disabled.Context),s=(0,ye.useRef)(!1),c=(0,Ee.useInnerBlocksProps)(t,{renderAppender:!!l&&void 0}),{isSaving:u,draftNavigationMenus:m,hasResolvedDraftNavigationMenus:d}=(0,Ie.useSelect)((e=>{if(i)return Zs;const{getEntityRecords:t,hasFinishedResolution:n,isSavingEntityRecord:o}=e(Dt.store);return{isSaving:o("postType","wp_navigation"),draftNavigationMenus:t(...Ks),hasResolvedDraftNavigationMenus:n("getEntityRecords",Ks)}}),[i]),{hasResolvedNavigationMenus:p,navigationMenus:g}=ks(),h=Rs(o);return(0,ye.useEffect)((async()=>{if(i||r||u||s.current||!d||!p||!l)return;s.current=!0;const e=await h(null,n);a(e),s.current=!1}),[i,u,d,p,m,g,l,h,n]),(0,ye.createElement)("div",{className:"wp-block-navigation__unsaved-changes"},(0,ye.createElement)(ke.Disabled,{className:nt()("wp-block-navigation__unsaved-changes-overlay",{"is-saving":l})},(0,ye.createElement)("div",c)),l&&(0,ye.createElement)(ke.Spinner,null))}function Js(e){let{onDelete:t}=e;const[n,o]=(0,ye.useState)(!1),r=(0,Dt.useEntityId)("postType","wp_navigation"),[a]=(0,Dt.useEntityProp)("postType","wp_navigation","title"),{deleteEntityRecord:l}=(0,Ie.useDispatch)(Dt.store);return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.Button,{className:"wp-block-navigation-delete-menu-button",variant:"secondary",isDestructive:!0,onClick:()=>{o(!0)}},(0,we.__)("Delete menu")),n&&(0,ye.createElement)(ke.Modal,{title:(0,we.sprintf)((0,we.__)("Delete %s"),a),closeLabel:(0,we.__)("Cancel"),onRequestClose:()=>o(!1)},(0,ye.createElement)("p",null,(0,we.__)("Are you sure you want to delete this navigation menu?")),(0,ye.createElement)(ke.Flex,{justify:"flex-end"},(0,ye.createElement)(ke.FlexItem,null,(0,ye.createElement)(ke.Button,{variant:"secondary",onClick:()=>{o(!1)}},(0,we.__)("Cancel"))),(0,ye.createElement)(ke.FlexItem,null,(0,ye.createElement)(ke.Button,{variant:"primary",onClick:()=>{l("postType","wp_navigation",r,{force:!0}),t()}},(0,we.__)("Confirm"))))))}var Ys=function(){let{name:e,message:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=(0,ye.useRef)(),{createWarningNotice:o,removeNotice:r}=(0,Ie.useDispatch)(Ir.store),a=()=>{n.current||(n.current=e,o(t,{id:n.current,type:"snackbar"}))},l=()=>{n.current&&(r(n.current),n.current=null)};return[a,l]};const Xs=[];function ec(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function tc(e,t,n){if(!e)return;t(ec(e).color);let o=e,r=ec(o).backgroundColor;for(;"rgba(0, 0, 0, 0)"===r&&o.parentNode&&o.parentNode.nodeType===o.parentNode.ELEMENT_NODE;)o=o.parentNode,r=ec(o).backgroundColor;n(r)}var nc=(0,Ee.withColors)({textColor:"color"},{backgroundColor:"color"},{overlayBackgroundColor:"color"},{overlayTextColor:"color"})((function(e){let{attributes:t,setAttributes:n,clientId:o,isSelected:r,className:a,backgroundColor:l,setBackgroundColor:i,textColor:s,setTextColor:c,overlayBackgroundColor:u,setOverlayBackgroundColor:m,overlayTextColor:d,setOverlayTextColor:p,context:{navigationArea:g},hasSubmenuIndicatorSetting:h=!0,hasColorSettings:v=!0,customPlaceholder:b=null,customAppender:y=null}=e;const{openSubmenusOnClick:f,overlayMenu:_,showSubmenuIcon:k,layout:{justifyContent:w,orientation:E="horizontal",flexWrap:C="wrap"}={}}=t;let x=Le.noop;const S=g?undefined:t.ref,B=(0,Ie.useRegistry)(),T=(0,ye.useCallback)((e=>{n({ref:e}),g&&x(e)}),[g]),[N,z]=(0,Ee.__experimentalUseNoRecursiveRenders)(`navigationMenu/${S}`);ws();const{hasUncontrolledInnerBlocks:P,uncontrolledInnerBlocks:I,isInnerBlockSelected:M}=(0,Ie.useSelect)((e=>{const{getBlock:t,getBlocks:n,hasSelectedInnerBlock:r}=e(Ee.store),a=t(o).innerBlocks,l=null==a?void 0:a.length,i=l?Xs:n(o);return{hasSubmenus:!!(l?a:i).find((e=>"core/navigation-submenu"===e.name)),hasUncontrolledInnerBlocks:l,uncontrolledInnerBlocks:a,isInnerBlockSelected:r(o,!0)}}),[o]),{replaceInnerBlocks:R,selectBlock:L,__unstableMarkNextChangeAsNotPersistent:V}=(0,Ie.useDispatch)(Ee.store),[H,A]=(0,ye.useState)(!1),F=!!g&&!S,[D,G]=(0,ye.useState)(!P||F),[U,O]=(0,ye.useState)(!1),{isNavigationMenuResolved:q,isNavigationMenuMissing:$,canSwitchNavigationMenu:W,hasResolvedNavigationMenus:j,navigationMenus:Z,navigationMenu:K,canUserUpdateNavigationEntity:Q,hasResolvedCanUserUpdateNavigationEntity:J,canUserDeleteNavigationEntity:Y,hasResolvedCanUserDeleteNavigationEntity:X,canUserCreateNavigation:ee,hasResolvedCanUserCreateNavigation:te}=ks(S),ne=(0,ye.useRef)(),oe="draft"===(null==K?void 0:K.status),{listViewToolbarButton:re,listViewModal:ae}=function(e,t){const[n,o]=(0,ye.useState)(!1);return{listViewToolbarButton:(0,ye.createElement)(ke.ToolbarButton,{className:"components-toolbar__control",label:(0,we.__)("Open list view"),onClick:()=>o(!0),icon:fs}),listViewModal:n&&(0,ye.createElement)(ke.Modal,{title:(0,we.__)("List View"),closeLabel:(0,we.__)("Close"),onRequestClose:()=>{o(!1)},shouldCloseOnClickOutside:!1},(0,ye.createElement)(_s,{clientId:e,__experimentalFeatures:t}))}}(o),le=!$&&q,ie=(0,Ee.useBlockProps)({ref:ne,className:nt()(a,{"items-justified-right":"right"===w,"items-justified-space-between":"space-between"===w,"items-justified-left":"left"===w,"items-justified-center":"center"===w,"is-vertical":"vertical"===E,"no-wrap":"nowrap"===C,"is-responsive":"never"!==_,"has-text-color":!!s.color||!(null==s||!s.class),[(0,Ee.getColorClassName)("color",null==s?void 0:s.slug)]:!(null==s||!s.slug),"has-background":!!l.color||l.class,[(0,Ee.getColorClassName)("background-color",null==l?void 0:l.slug)]:!(null==l||!l.slug)}),style:{color:!(null!=s&&s.slug)&&(null==s?void 0:s.color),backgroundColor:!(null!=l&&l.slug)&&(null==l?void 0:l.color)}}),se=nt()({"has-text-color":!!d.color||!(null==d||!d.class),[(0,Ee.getColorClassName)("color",null==d?void 0:d.slug)]:!(null==d||!d.slug),"has-background":!!u.color||(null==u?void 0:u.class),[(0,Ee.getColorClassName)("background-color",null==u?void 0:u.slug)]:!(null==u||!u.slug)}),ce={color:!(null!=d&&d.slug)&&(null==d?void 0:d.color),backgroundColor:!(null!=u&&u.slug)&&(null==u?void 0:u.color)&&u.color},ue="web"===ye.Platform.OS,[me,de]=(0,ye.useState)(),[pe,ge]=(0,ye.useState)(),[he,ve]=(0,ye.useState)(),[be,fe]=(0,ye.useState)();(0,ye.useEffect)((()=>{E&&(V(),n({orientation:E}))}),[E]),(0,ye.useEffect)((()=>{var e;if(!ue)return;tc(ne.current,ge,de);const t=null===(e=ne.current)||void 0===e?void 0:e.querySelector('[data-type="core/navigation-link"] [data-type="core/navigation-link"]');t&&tc(t,fe,ve)})),(0,ye.useEffect)((()=>{G(!le)}),[le]);const[_e,Ce]=Ys({name:"block-library/core/navigation/permissions/update",message:(0,we.__)("You do not have permission to edit this Menu. Any changes made will not be saved.")}),[xe,Se]=Ys({name:"block-library/core/navigation/permissions/create",message:(0,we.__)("You do not have permission to create Navigation Menus.")});(0,ye.useEffect)((()=>{r||M||(Ce(),Se()),(r||M)&&(J&&!Q&&_e(),S||!te||ee||xe())}),[r,M,Q,J,ee,te,S]);const Be=(0,ye.useCallback)((()=>{B.batch((()=>{g&&x(0),n({ref:void 0}),S||R(o,[]),G(!0)}))}),[o,S]);if(P&&!le)return(0,ye.createElement)("nav",ie,(0,ye.createElement)(Gs,{id:o,onToggle:O,isOpen:U,isResponsive:"never"!==_,isHiddenByDefault:"always"===_,classNames:se,styles:ce},(0,ye.createElement)(Qs,{blockProps:ie,blocks:I,clientId:o,navigationMenus:Z,hasSelection:r||M,hasSavedUnsavedInnerBlocks:H,onSave:e=>{A(!0),T(e.id)}})));if(S&&$)return(0,ye.createElement)("div",ie,(0,ye.createElement)(Ee.Warning,null,(0,we.__)("Navigation menu has been deleted or is unavailable. "),(0,ye.createElement)(ke.Button,{onClick:Be,variant:"link"},(0,we.__)("Create a new menu?"))));if(le&&N)return(0,ye.createElement)("div",ie,(0,ye.createElement)(Ee.Warning,null,(0,we.__)("Block cannot be rendered inside itself.")));const Te=b||Fs;return(0,ye.createElement)(Dt.EntityProvider,{kind:"postType",type:"wp_navigation",id:S},(0,ye.createElement)(z,null,(0,ye.createElement)(Ee.BlockControls,null,!oe&&le&&(0,ye.createElement)(ke.ToolbarGroup,null,(0,ye.createElement)(ke.ToolbarDropdownMenu,{label:(0,we.__)("Select Menu"),text:(0,we.__)("Select Menu"),icon:null},(e=>{let{onClose:t}=e;return(0,ye.createElement)(Ws,{clientId:o,onSelect:e=>{let{id:n}=e;T(n),t()},onCreateNew:Be,canUserCreateNavigation:ee})}))),(0,ye.createElement)(ke.ToolbarGroup,null,re)),ae,(0,ye.createElement)(Ee.InspectorControls,null,h&&(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Display")},(0,ye.createElement)("h3",null,(0,we.__)("Overlay Menu")),(0,ye.createElement)(ke.__experimentalToggleGroupControl,{label:(0,we.__)("Configure overlay menu"),value:_,help:(0,we.__)("Collapses the navigation options in a menu icon opening an overlay."),onChange:e=>n({overlayMenu:e}),isBlock:!0,hideLabelFromVision:!0},(0,ye.createElement)(ke.__experimentalToggleGroupControlOption,{value:"never",label:(0,we.__)("Off")}),(0,ye.createElement)(ke.__experimentalToggleGroupControlOption,{value:"mobile",label:(0,we.__)("Mobile")}),(0,ye.createElement)(ke.__experimentalToggleGroupControlOption,{value:"always",label:(0,we.__)("Always")})),(0,ye.createElement)("h3",null,(0,we.__)("Submenus")),(0,ye.createElement)(ke.ToggleControl,{checked:f,onChange:e=>{n({openSubmenusOnClick:e})},label:(0,we.__)("Open on click")}),!t.openSubmenusOnClick&&(0,ye.createElement)(ke.ToggleControl,{checked:k,onChange:e=>{n({showSubmenuIcon:e})},label:(0,we.__)("Show icons")})),v&&(0,ye.createElement)(Ee.PanelColorSettings,{__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,title:(0,we.__)("Color"),initialOpen:!1,colorSettings:[{value:s.color,onChange:c,label:(0,we.__)("Text")},{value:l.color,onChange:i,label:(0,we.__)("Background")},{value:d.color,onChange:p,label:(0,we.__)("Submenu & overlay text")},{value:u.color,onChange:m,label:(0,we.__)("Submenu & overlay background")}]},ue&&(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.ContrastChecker,{backgroundColor:me,textColor:pe}),(0,ye.createElement)(Ee.ContrastChecker,{backgroundColor:he,textColor:be})))),le&&(0,ye.createElement)(Ee.InspectorControls,{__experimentalGroup:"advanced"},J&&Q&&(0,ye.createElement)(js,null),X&&Y&&(0,ye.createElement)(Js,{onDelete:Be})),(0,ye.createElement)("nav",ie,D&&(0,ye.createElement)(Te,{onFinish:e=>{G(!1),e&&T(e.id),L(o)},canSwitchNavigationMenu:W,hasResolvedNavigationMenus:j,clientId:o,canUserCreateNavigation:ee}),!te||!le&&!D&&(0,ye.createElement)(Ns,{isLoading:!0}),!D&&(0,ye.createElement)(Gs,{id:o,onToggle:O,isOpen:U,isResponsive:"never"!==_,isHiddenByDefault:"always"===_,classNames:se,styles:ce},le&&(0,ye.createElement)($s,{isVisible:!D,clientId:o,appender:y,hasCustomPlaceholder:!!b,orientation:E})))))}));const oc={fontStyle:"var:preset|font-style|",fontWeight:"var:preset|font-weight|",textDecoration:"var:preset|text-decoration|",textTransform:"var:preset|text-transform|"},rc=e=>{let{navigationMenuId:t,...n}=e;return{...n,ref:t}},ac=e=>{if(e.layout)return e;const{itemsJustification:t,orientation:n,...o}=e;return(t||n)&&Object.assign(o,{layout:{type:"flex",...t&&{justifyContent:t},...n&&{orientation:n}}}),o},lc=[{attributes:{navigationMenuId:{type:"number"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"mobile"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}},__experimentalLayout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}}},save:()=>(0,ye.createElement)(Ee.InnerBlocks.Content,null),isEligible:e=>{let{navigationMenuId:t}=e;return!!t},migrate:rc},{attributes:{navigationMenuId:{type:"number"},orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"never"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}}},save:()=>(0,ye.createElement)(Ee.InnerBlocks.Content,null),isEligible:e=>{let{itemsJustification:t,orientation:n}=e;return!!t||!!n},migrate:(0,ot.compose)(rc,ac)},{attributes:{orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"never"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}}},save:()=>(0,ye.createElement)(Ee.InnerBlocks.Content,null),migrate:(0,ot.compose)(rc,ac,lt),isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}},{attributes:{orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},isResponsive:{type:"boolean",default:"false"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0}},isEligible:e=>e.isResponsive,migrate:(0,ot.compose)(rc,ac,lt,(function(e){return delete e.isResponsive,{...e,overlayMenu:"mobile"}})),save:()=>(0,ye.createElement)(Ee.InnerBlocks.Content,null)},{attributes:{orientation:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,fontSize:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,color:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0},save:()=>(0,ye.createElement)(Ee.InnerBlocks.Content,null),isEligible(e){if(!e.style||!e.style.typography)return!1;for(const t in oc){const n=e.style.typography[t];if(n&&n.startsWith(oc[t]))return!0}return!1},migrate:(0,ot.compose)(rc,ac,lt,(function(e){return{...e,style:{...e.style,typography:(0,Le.mapValues)(e.style.typography,((e,t)=>{const n=oc[t];if(n&&e.startsWith(n)){const o=e.slice(n.length);return"textDecoration"===t&&"strikethrough"===o?"line-through":o}return e}))}}}))},{attributes:{className:{type:"string"},textColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean"}},isEligible:e=>e.rgbTextColor||e.rgbBackgroundColor,supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0},migrate:(0,ot.compose)(rc,(e=>({...(0,Le.omit)(e,["rgbTextColor","rgbBackgroundColor"]),customTextColor:e.textColor?void 0:e.rgbTextColor,customBackgroundColor:e.backgroundColor?void 0:e.rgbBackgroundColor}))),save:()=>(0,ye.createElement)(Ee.InnerBlocks.Content,null)}];var ic=lc;const sc={apiVersion:2,name:"core/navigation",title:"Navigation",category:"theme",description:"A collection of blocks that allow visitors to get around your site.",keywords:["menu","navigation","links"],textdomain:"default",attributes:{ref:{type:"number"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"mobile"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},usesContext:["navigationArea"],providesContext:{textColor:"textColor",customTextColor:"customTextColor",backgroundColor:"backgroundColor",customBackgroundColor:"customBackgroundColor",overlayTextColor:"overlayTextColor",customOverlayTextColor:"customOverlayTextColor",overlayBackgroundColor:"overlayBackgroundColor",customOverlayBackgroundColor:"customOverlayBackgroundColor",fontSize:"fontSize",customFontSize:"customFontSize",showSubmenuIcon:"showSubmenuIcon",openSubmenusOnClick:"openSubmenusOnClick",style:"style",orientation:"orientation"},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{units:["px","em","rem","vh","vw"]},__experimentalLayout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}}},viewScript:"file:./view.min.js",editorStyle:"wp-block-navigation-editor",style:"wp-block-navigation"},{name:cc}=sc,uc={icon:ys,example:{innerBlocks:[{name:"core/navigation-link",attributes:{label:(0,we.__)("Home"),url:"https://make.wordpress.org/"}},{name:"core/navigation-link",attributes:{label:(0,we.__)("About"),url:"https://make.wordpress.org/"}},{name:"core/navigation-link",attributes:{label:(0,we.__)("Contact"),url:"https://make.wordpress.org/"}}]},edit:nc,save:function(e){let{attributes:t}=e;if(!t.ref)return(0,ye.createElement)(Ee.InnerBlocks.Content,null)},deprecated:ic};var mc=(0,ye.createElement)(fe.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M12.5 14.5h-1V16h1c2.2 0 4-1.8 4-4s-1.8-4-4-4h-1v1.5h1c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5zm-4 1.5v-1.5h-1C6.1 14.5 5 13.4 5 12s1.1-2.5 2.5-2.5h1V8h-1c-2.2 0-4 1.8-4 4s1.8 4 4 4h1zm-1-3.2h5v-1.5h-5v1.5zM18 4H9c-1.1 0-2 .9-2 2v.5h1.5V6c0-.3.2-.5.5-.5h9c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5v-.5H7v.5c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z"}));var dc=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z"}));const{name:pc}={apiVersion:2,name:"core/navigation-link",title:"Custom Link",category:"design",parent:["core/navigation"],description:"Add a page, link, or another item to your navigation.",textdomain:"default",attributes:{label:{type:"string"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"},title:{type:"string"},kind:{type:"string"},isTopLevelLink:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","style"],supports:{reusable:!1,html:!1,__experimentalSlashInserter:!0},editorStyle:"wp-block-navigation-link-editor",style:"wp-block-navigation-link"};function gc(e,t){switch(e){case"post":case"page":return{type:"post",subtype:e};case"category":return{type:"term",subtype:"category"};case"tag":return{type:"term",subtype:"post_tag"};case"post_format":return{type:"post-format"};default:return"taxonomy"===t?{type:"term",subtype:e}:"post-type"===t?{type:"post",subtype:e}:{}}}function hc(e){const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body.textContent||""}function vc(e){let{block:t,transforms:n,replace:o}=e;return(0,ye.createElement)("div",{className:"link-control-transform"},(0,ye.createElement)("h3",{className:"link-control-transform__subheading"},(0,we.__)("Transform")),(0,ye.createElement)("div",{className:"link-control-transform__items"},n.map(((e,n)=>(0,ye.createElement)(ke.Button,{key:`transform-${n}`,onClick:()=>o(t.clientId,(0,be.switchToBlockType)(t,e.name)),className:"link-control-transform__item"},(0,ye.createElement)(Ee.BlockIcon,{icon:e.icon}),e.title)))))}var bc=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M4 14.5h16V16H4zM4 18.5h9V20H4zM4 4h3c2 0 3 .86 3 2.583 0 .891-.253 1.554-.76 1.988-.505.435-1.24.652-2.204.652H5.542V12H4V4zm2.855 4c.53 0 .924-.114 1.18-.343.266-.228.398-.579.398-1.051 0-.473-.132-.82-.397-1.04-.265-.229-.67-.343-1.217-.343H5.542V8h1.313z"}));var yc=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"}));var fc=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"}));var _c=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z"}));const kc=[{name:"link",isDefault:!0,title:(0,we.__)("Custom Link"),description:(0,we.__)("A link to a custom URL."),attributes:{}},{name:"post",icon:bc,title:(0,we.__)("Post Link"),description:(0,we.__)("A link to a post."),attributes:{type:"post",kind:"post-type"}},{name:"page",icon:yc,title:(0,we.__)("Page Link"),description:(0,we.__)("A link to a page."),attributes:{type:"page",kind:"post-type"}},{name:"category",icon:$t,title:(0,we.__)("Category Link"),description:(0,we.__)("A link to a category."),attributes:{type:"category",kind:"taxonomy"}},{name:"tag",icon:fc,title:(0,we.__)("Tag Link"),description:(0,we.__)("A link to a tag."),attributes:{type:"tag",kind:"taxonomy"}}];kc.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.type===t.type)}));var wc=kc;function Ec(e){switch(e){case"post":return bc;case"page":return yc;case"tag":return fc;case"category":return $t;default:return _c}}const Cc={from:[{type:"block",blocks:["core/site-logo"],transform:()=>(0,be.createBlock)("core/navigation-link")},{type:"block",blocks:["core/spacer"],transform:()=>(0,be.createBlock)("core/navigation-link")},{type:"block",blocks:["core/home-link"],transform:()=>(0,be.createBlock)("core/navigation-link")},{type:"block",blocks:["core/social-links"],transform:()=>(0,be.createBlock)("core/navigation-link")},{type:"block",blocks:["core/search"],transform:()=>(0,be.createBlock)("core/navigation-link")}],to:[{type:"block",blocks:["core/navigation-submenu"],transform:(e,t)=>(0,be.createBlock)("core/navigation-submenu",e,t)},{type:"block",blocks:["core/spacer"],transform:()=>(0,be.createBlock)("core/spacer")},{type:"block",blocks:["core/site-logo"],transform:()=>(0,be.createBlock)("core/site-logo")},{type:"block",blocks:["core/home-link"],transform:()=>(0,be.createBlock)("core/home-link")},{type:"block",blocks:["core/social-links"],transform:()=>(0,be.createBlock)("core/social-links")},{type:"block",blocks:["core/search"],transform:()=>(0,be.createBlock)("core/search",{showLabel:!1,buttonUseIcon:!0,buttonPosition:"button-inside"})}]};var xc=Cc;const Sc={apiVersion:2,name:"core/navigation-link",title:"Custom Link",category:"design",parent:["core/navigation"],description:"Add a page, link, or another item to your navigation.",textdomain:"default",attributes:{label:{type:"string"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"},title:{type:"string"},kind:{type:"string"},isTopLevelLink:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","style"],supports:{reusable:!1,html:!1,__experimentalSlashInserter:!0},editorStyle:"wp-block-navigation-link-editor",style:"wp-block-navigation-link"},{name:Bc}=Sc,Tc={icon:mc,__experimentalLabel:e=>{let{label:t}=e;return t},merge(e,t){let{label:n=""}=t;return{...e,label:e.label+n}},edit:function(e){let{attributes:t,isSelected:n,setAttributes:o,insertBlocksAfter:r,mergeBlocks:a,onReplace:l,context:i,clientId:s}=e;const{label:c,type:u,opensInNewTab:m,url:d,description:p,rel:g,title:h,kind:v}=t,b={url:d,opensInNewTab:m,title:c&&hc(c)},{saveEntityRecord:y}=(0,Ie.useDispatch)(Dt.store),{replaceBlock:f,__unstableMarkNextChangeAsNotPersistent:_}=(0,Ie.useDispatch)(Ee.store),[k,w]=(0,ye.useState)(!1),E=(0,ye.useRef)(null),C=(e=>{const[t,n]=(0,ye.useState)(!1);return(0,ye.useEffect)((()=>{const{ownerDocument:t}=e.current;function o(e){a(e)}function r(){n(!1)}function a(t){e.current.contains(t.target)?n(!0):n(!1)}return t.addEventListener("dragstart",o),t.addEventListener("dragend",r),t.addEventListener("dragenter",a),()=>{t.removeEventListener("dragstart",o),t.removeEventListener("dragend",r),t.removeEventListener("dragenter",a)}}),[]),t})(E),x=(0,we.__)("Add link…"),S=(0,ye.useRef)(),{innerBlocks:B,isAtMaxNesting:T,isTopLevelLink:N,isParentOfSelectedBlock:z,hasDescendants:P,userCanCreatePages:I,userCanCreatePosts:M,thisBlock:R,blockTransforms:L}=(0,Ie.useSelect)((e=>{var t;const{getBlock:n,getBlocks:o,getBlockName:r,getBlockRootClientId:a,getClientIdsOfDescendants:l,hasSelectedInnerBlock:i,getSelectedBlockClientId:c,getBlockParentsByBlockName:u,getBlockTransformItems:m}=e(Ee.store),d=c(),p=l([s]).length;return{innerBlocks:o(s),isAtMaxNesting:u(s,[pc,"core/navigation-submenu"]).length>=5,isTopLevelLink:"core/navigation"===r(a(s)),isParentOfSelectedBlock:i(s,!0),isImmediateParentOfSelectedBlock:i(s,!1),hasDescendants:!!p,selectedBlockHasDescendants:!(null===(t=l([d]))||void 0===t||!t.length),userCanCreatePages:e(Dt.store).canUser("create","pages"),userCanCreatePosts:e(Dt.store).canUser("create","posts"),thisBlock:n(s),blockTransforms:m([n(s)],a(s))}}),[s]);function V(){const e=(0,be.createBlock)("core/navigation-submenu",t,B);f(s,e)}(0,ye.useEffect)((()=>{_(),o({isTopLevelLink:N})}),[N]);const H=["core/site-logo","core/social-links","core/search"],A=L.filter((e=>H.includes(e.name)));(0,ye.useEffect)((()=>{d||w(!0),P&&V()}),[]),(0,ye.useEffect)((()=>{n||w(!1)}),[n]),(0,ye.useEffect)((()=>{k&&d&&((0,Dr.isURL)((0,Dr.prependHTTP)(c))&&/^.+\.[a-z]+/.test(c)?function(){S.current.focus();const{ownerDocument:e}=S.current,{defaultView:t}=e,n=t.getSelection(),o=e.createRange();o.selectNodeContents(S.current),n.removeAllRanges(),n.addRange(o)}():(0,ls.placeCaretAtHorizontalEdge)(S.current,!0))}),[d]);let F=!1;u&&"page"!==u?"post"===u&&(F=M):F=I;const{textColor:D,customTextColor:G,backgroundColor:U,customBackgroundColor:O}=function(e,t){var n,o;const{textColor:r,customTextColor:a,backgroundColor:l,customBackgroundColor:i,overlayTextColor:s,customOverlayTextColor:c,overlayBackgroundColor:u,customOverlayBackgroundColor:m,style:d}=e,p={};return t&&c?p.customTextColor=c:t&&s?p.textColor=s:a?p.customTextColor=a:r?p.textColor=r:null!=d&&null!==(n=d.color)&&void 0!==n&&n.text&&(p.customTextColor=d.color.text),t&&m?p.customBackgroundColor=m:t&&u?p.backgroundColor=u:i?p.customBackgroundColor=i:l?p.backgroundColor=l:null!=d&&null!==(o=d.color)&&void 0!==o&&o.background&&(p.customTextColor=d.color.background),p}(i,!N),q=(0,Ee.useBlockProps)({ref:E,className:nt()("wp-block-navigation-item",{"is-editing":n||z,"is-dragging-within":C,"has-link":!!d,"has-child":P,"has-text-color":!!D||!!G,[(0,Ee.getColorClassName)("color",D)]:!!D,"has-background":!!U||O,[(0,Ee.getColorClassName)("background-color",U)]:!!U}),style:{color:!D&&G,backgroundColor:!U&&O},onKeyDown:function(e){(ht.isKeyboardEvent.primary(e,"k")||!d&&e.keyCode===ht.ENTER)&&w(!0)}});d||(q.onClick=()=>w(!0));const $=nt()("wp-block-navigation-item__content",{"wp-block-navigation-link__placeholder":!d});let W="";switch(u){case"post":W=(0,we.__)("Select post");break;case"page":W=(0,we.__)("Select page");break;case"category":W=(0,we.__)("Select category");break;case"tag":W=(0,we.__)("Select tag");break;default:W=(0,we.__)("Add link")}return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(ke.ToolbarGroup,null,(0,ye.createElement)(ke.ToolbarButton,{name:"link",icon:vt,title:(0,we.__)("Link"),shortcut:ht.displayShortcut.primary("k"),onClick:()=>w(!0)}),!T&&(0,ye.createElement)(ke.ToolbarButton,{name:"submenu",icon:dc,title:(0,we.__)("Add submenu"),onClick:V}))),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Link settings")},(0,ye.createElement)(ke.TextareaControl,{value:p||"",onChange:e=>{o({description:e})},label:(0,we.__)("Description"),help:(0,we.__)("The description will be displayed in the menu if the current theme supports it.")}),(0,ye.createElement)(ke.TextControl,{value:h||"",onChange:e=>{o({title:e})},label:(0,we.__)("Link title"),autoComplete:"off"}),(0,ye.createElement)(ke.TextControl,{value:g||"",onChange:e=>{o({rel:e})},label:(0,we.__)("Link rel"),autoComplete:"off"}))),(0,ye.createElement)("div",q,(0,ye.createElement)("a",{className:$},d?(0,ye.createElement)(Ee.RichText,{ref:S,identifier:"label",className:"wp-block-navigation-item__label",value:c,onChange:e=>o({label:e}),onMerge:a,onReplace:l,__unstableOnSplitAtEnd:()=>r((0,be.createBlock)("core/navigation-link")),"aria-label":(0,we.__)("Navigation link text"),placeholder:x,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/image","core/strikethrough"],onClick:()=>{d||w(!0)}}):(0,ye.createElement)("div",{className:"wp-block-navigation-link__placeholder-text"},(0,ye.createElement)(ke.Tooltip,{position:"top center",text:(0,we.__)("This item is missing a link")},(0,ye.createElement)("span",null,W))),k&&(0,ye.createElement)(ke.Popover,{position:"bottom center",onClose:()=>w(!1),anchorRef:E.current},(0,ye.createElement)(Ee.__experimentalLinkControl,{hasTextControl:!0,className:"wp-block-navigation-link__inline-link-input",value:b,showInitialSuggestions:!0,withCreateSuggestion:F,createSuggestion:async function(e){const t=u||"page",n=await y("postType",t,{title:e,status:"draft"});return{id:n.id,type:t,title:n.title.rendered,url:n.link,kind:"post-type"}},createSuggestionButtonText:e=>{let t;return t="post"===u?(0,we.__)("Create draft post: <mark>%s</mark>"):(0,we.__)("Create draft page: <mark>%s</mark>"),(0,ye.createInterpolateElement)((0,we.sprintf)(t,e),{mark:(0,ye.createElement)("mark",null)})},noDirectEntry:!!u,noURLSuggestion:!!u,suggestionsQuery:gc(u,v),onChange:e=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{label:o="",kind:r="",type:a=""}=n,{title:l="",url:i="",opensInNewTab:s,id:c,kind:u=r,type:m=a}=e,d=l.replace(/http(s?):\/\//gi,""),p=i.replace(/http(s?):\/\//gi,""),g=""!==l&&d!==p&&o!==l?(0,Le.escape)(l):o||(0,Le.escape)(p),h="post_tag"===m?"tag":m.replace("-","_"),v=["post","page","tag","category"].indexOf(h)>-1,b=!u&&!v||"custom"===u?"custom":u;t({...i&&{url:encodeURI((0,Dr.safeDecodeURI)(i))},...g&&{label:g},...void 0!==s&&{opensInNewTab:s},...c&&Number.isInteger(c)&&{id:c},...b&&{kind:b},...h&&"URL"!==h&&{type:h}})}(e,o,t),onRemove:function(){o({url:"",label:"",id:"",kind:"",type:""}),w(!1)},renderControlBottom:d?null:()=>(0,ye.createElement)(vc,{block:R,transforms:A,replace:f})})))))},save:function(){return(0,ye.createElement)(Ee.InnerBlocks.Content,null)},example:{attributes:{label:(0,we._x)("Example Link","navigation link preview example"),url:"https://example.com"}},deprecated:[{isEligible:e=>e.nofollow,attributes:{label:{type:"string"},type:{type:"string"},nofollow:{type:"boolean"},description:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"}},migrate(e){let{nofollow:t,...n}=e;return{rel:t?"nofollow":"",...n}},save:()=>(0,ye.createElement)(Ee.InnerBlocks.Content,null)}],transforms:xc};(0,ja.addFilter)("blocks.registerBlockType","core/navigation-link",(function(e,t){if("core/navigation-link"!==t)return e;if(!e.variations)return{...e,variations:wc};if(e.variations){const t=(e,t)=>e.type===t.type,n=e.variations.map((e=>({...e,...!e.icon&&{icon:Ec(e.name)},...!e.isActive&&{isActive:t}})));return{...e,variations:n}}return e}));var Nc=window.wp.a11y;const zc=()=>(0,ye.createElement)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},(0,ye.createElement)(ke.Path,{d:"M1.50002 4L6.00002 8L10.5 4",strokeWidth:"1.5"})),{name:Pc}={apiVersion:2,name:"core/navigation-submenu",title:"Submenu",category:"design",parent:["core/navigation"],description:"Add a submenu to your navigation.",textdomain:"default",attributes:{label:{type:"string"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"},title:{type:"string"},kind:{type:"string"},isTopLevelItem:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","openSubmenusOnClick","style"],supports:{reusable:!1,html:!1},editorStyle:"wp-block-navigation-submenu-editor",style:"wp-block-navigation-submenu"},Ic=["core/navigation-link","core/navigation-submenu"],Mc=["core/navigation-link"];function Rc(e,t){switch(e){case"post":case"page":return{type:"post",subtype:e};case"category":return{type:"term",subtype:"category"};case"tag":return{type:"term",subtype:"post_tag"};case"post_format":return{type:"post-format"};default:return"taxonomy"===t?{type:"term",subtype:e}:"post-type"===t?{type:"post",subtype:e}:{}}}function Lc(e,t){var n,o;const{textColor:r,customTextColor:a,backgroundColor:l,customBackgroundColor:i,overlayTextColor:s,customOverlayTextColor:c,overlayBackgroundColor:u,customOverlayBackgroundColor:m,style:d}=e,p={};return t&&c?p.customTextColor=c:t&&s?p.textColor=s:a?p.customTextColor=a:r?p.textColor=r:null!=d&&null!==(n=d.color)&&void 0!==n&&n.text&&(p.customTextColor=d.color.text),t&&m?p.customBackgroundColor=m:t&&u?p.backgroundColor=u:i?p.customBackgroundColor=i:l?p.backgroundColor=l:null!=d&&null!==(o=d.color)&&void 0!==o&&o.background&&(p.customTextColor=d.color.background),p}const Vc={to:[{type:"block",blocks:["core/navigation-link"],isMatch:(e,t)=>{var n;return 0===(null==t||null===(n=t.innerBlocks)||void 0===n?void 0:n.length)},transform:e=>(0,be.createBlock)("core/navigation-link",e)},{type:"block",blocks:["core/spacer"],isMatch:(e,t)=>{var n;return 0===(null==t||null===(n=t.innerBlocks)||void 0===n?void 0:n.length)},transform:()=>(0,be.createBlock)("core/spacer")},{type:"block",blocks:["core/site-logo"],isMatch:(e,t)=>{var n;return 0===(null==t||null===(n=t.innerBlocks)||void 0===n?void 0:n.length)},transform:()=>(0,be.createBlock)("core/site-logo")},{type:"block",blocks:["core/home-link"],isMatch:(e,t)=>{var n;return 0===(null==t||null===(n=t.innerBlocks)||void 0===n?void 0:n.length)},transform:()=>(0,be.createBlock)("core/home-link")},{type:"block",blocks:["core/social-links"],isMatch:(e,t)=>{var n;return 0===(null==t||null===(n=t.innerBlocks)||void 0===n?void 0:n.length)},transform:()=>(0,be.createBlock)("core/social-links")},{type:"block",blocks:["core/search"],isMatch:(e,t)=>{var n;return 0===(null==t||null===(n=t.innerBlocks)||void 0===n?void 0:n.length)},transform:()=>(0,be.createBlock)("core/search")}]};var Hc=Vc;const Ac={apiVersion:2,name:"core/navigation-submenu",title:"Submenu",category:"design",parent:["core/navigation"],description:"Add a submenu to your navigation.",textdomain:"default",attributes:{label:{type:"string"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"},title:{type:"string"},kind:{type:"string"},isTopLevelItem:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","openSubmenusOnClick","style"],supports:{reusable:!1,html:!1},editorStyle:"wp-block-navigation-submenu-editor",style:"wp-block-navigation-submenu"},{name:Fc}=Ac,Dc={icon:dc,__experimentalLabel:e=>{let{label:t}=e;return t},edit:function(e){let{attributes:t,isSelected:n,setAttributes:o,mergeBlocks:r,onReplace:a,context:l,clientId:i}=e;const{label:s,type:c,opensInNewTab:u,url:m,description:d,rel:p,title:g,kind:h}=t,v={url:m,opensInNewTab:u},{showSubmenuIcon:b,openSubmenusOnClick:y}=l,{saveEntityRecord:f}=(0,Ie.useDispatch)(Dt.store),{__unstableMarkNextChangeAsNotPersistent:_}=(0,Ie.useDispatch)(Ee.store),[k,w]=(0,ye.useState)(!1),E=(0,ye.useRef)(null),C=(e=>{const[t,n]=(0,ye.useState)(!1);return(0,ye.useEffect)((()=>{const{ownerDocument:t}=e.current;function o(e){a(e)}function r(){n(!1)}function a(t){e.current.contains(t.target)?n(!0):n(!1)}return t.addEventListener("dragstart",o),t.addEventListener("dragend",r),t.addEventListener("dragenter",a),()=>{t.removeEventListener("dragstart",o),t.removeEventListener("dragend",r),t.removeEventListener("dragenter",a)}}),[]),t})(E),x=(0,we.__)("Add text…"),S=(0,ye.useRef)(),{isAtMaxNesting:B,isTopLevelItem:T,isParentOfSelectedBlock:N,isImmediateParentOfSelectedBlock:z,hasDescendants:P,selectedBlockHasDescendants:I,userCanCreatePages:M,userCanCreatePosts:R}=(0,Ie.useSelect)((e=>{var t;const{getClientIdsOfDescendants:n,hasSelectedInnerBlock:o,getSelectedBlockClientId:r,getBlockParentsByBlockName:a}=e(Ee.store),l=r(),s=n([i]).length;return{isAtMaxNesting:a(i,Pc).length>=5,isTopLevelItem:0===a(i,Pc).length,isParentOfSelectedBlock:o(i,!0),isImmediateParentOfSelectedBlock:o(i,!1),hasDescendants:!!s,selectedBlockHasDescendants:!(null===(t=n([l]))||void 0===t||!t.length),userCanCreatePages:e(Dt.store).canUser("create","pages"),userCanCreatePosts:e(Dt.store).canUser("create","posts")}}),[i]);(0,ye.useEffect)((()=>{y||m||w(!0)}),[]),(0,ye.useEffect)((()=>{_(),o({isTopLevelItem:T})}),[T]),(0,ye.useEffect)((()=>{n||w(!1)}),[n]),(0,ye.useEffect)((()=>{k&&m&&((0,Dr.isURL)((0,Dr.prependHTTP)(s))&&/^.+\.[a-z]+/.test(s)?function(){S.current.focus();const{ownerDocument:e}=S.current,{defaultView:t}=e,n=t.getSelection(),o=e.createRange();o.selectNodeContents(S.current),n.removeAllRanges(),n.addRange(o)}():(0,ls.placeCaretAtHorizontalEdge)(S.current,!0))}),[m]);let L=!1;c&&"page"!==c?"post"===c&&(L=R):L=M;const{textColor:V,customTextColor:H,backgroundColor:A,customBackgroundColor:F}=Lc(l,!T),D=(0,Ee.useBlockProps)({ref:E,className:nt()("wp-block-navigation-item",{"is-editing":n||N,"is-dragging-within":C,"has-link":!!m,"has-child":P,"has-text-color":!!V||!!H,[(0,Ee.getColorClassName)("color",V)]:!!V,"has-background":!!A||F,[(0,Ee.getColorClassName)("background-color",A)]:!!A,"open-on-click":y}),style:{color:!V&&H,backgroundColor:!A&&F},onKeyDown:function(e){ht.isKeyboardEvent.primary(e,"k")&&w(!0)}}),G=Lc(l,!0);B&&(0,Le.pull)(Ic,"core/navigation-submenu");const U=(0,Ee.useInnerBlocksProps)({className:nt()("wp-block-navigation__submenu-container",{"is-parent-of-selected-block":N,"has-text-color":!(!G.textColor&&!G.customTextColor),[`has-${G.textColor}-color`]:!!G.textColor,"has-background":!(!G.backgroundColor&&!G.customBackgroundColor),[`has-${G.backgroundColor}-background-color`]:!!G.backgroundColor}),style:{color:G.customTextColor,backgroundColor:G.customBackgroundColor}},{allowedBlocks:Ic,__experimentalDefaultBlock:Mc,__experimentalDirectInsert:!0,__experimentalCaptureToolbars:!0,renderAppender:!!(n||z&&!I||P)&&Ee.InnerBlocks.ButtonBlockAppender}),O=y?"button":"a";return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(ke.ToolbarGroup,null,!y&&(0,ye.createElement)(ke.ToolbarButton,{name:"link",icon:vt,title:(0,we.__)("Link"),shortcut:ht.displayShortcut.primary("k"),onClick:()=>w(!0)}))),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Link settings")},(0,ye.createElement)(ke.TextareaControl,{value:d||"",onChange:e=>{o({description:e})},label:(0,we.__)("Description"),help:(0,we.__)("The description will be displayed in the menu if the current theme supports it.")}),(0,ye.createElement)(ke.TextControl,{value:g||"",onChange:e=>{o({title:e})},label:(0,we.__)("Link title"),autoComplete:"off"}),(0,ye.createElement)(ke.TextControl,{value:p||"",onChange:e=>{o({rel:e})},label:(0,we.__)("Link rel"),autoComplete:"off"}))),(0,ye.createElement)("div",D,(0,ye.createElement)(O,{className:"wp-block-navigation-item__content"},(0,ye.createElement)(Ee.RichText,{ref:S,identifier:"label",className:"wp-block-navigation-item__label",value:s,onChange:e=>o({label:e}),onMerge:r,onReplace:a,"aria-label":(0,we.__)("Navigation link text"),placeholder:x,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/image","core/strikethrough"],onClick:()=>{y||m||w(!0)}}),!y&&k&&(0,ye.createElement)(ke.Popover,{position:"bottom center",onClose:()=>w(!1),anchorRef:E.current},(0,ye.createElement)(Ee.__experimentalLinkControl,{className:"wp-block-navigation-link__inline-link-input",value:v,showInitialSuggestions:!0,withCreateSuggestion:L,createSuggestion:async function(e){const t=c||"page",n=await f("postType",t,{title:e,status:"draft"});return{id:n.id,type:t,title:n.title.rendered,url:n.link,kind:"post-type"}},createSuggestionButtonText:e=>{let t;return t="post"===c?(0,we.__)("Create draft post: <mark>%s</mark>"):(0,we.__)("Create draft page: <mark>%s</mark>"),(0,ye.createInterpolateElement)((0,we.sprintf)(t,e),{mark:(0,ye.createElement)("mark",null)})},noDirectEntry:!!c,noURLSuggestion:!!c,suggestionsQuery:Rc(c,h),onChange:e=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{label:o="",kind:r="",type:a=""}=n,{title:l="",url:i="",opensInNewTab:s,id:c,kind:u=r,type:m=a}=e,d=l.replace(/http(s?):\/\//gi,""),p=i.replace(/http(s?):\/\//gi,""),g=""!==l&&d!==p&&o!==l?(0,Le.escape)(l):o||(0,Le.escape)(p),h="post_tag"===m?"tag":m.replace("-","_"),v=["post","page","tag","category"].indexOf(h)>-1,b=!u&&!v||"custom"===u?"custom":u;t({...i&&{url:encodeURI((0,Dr.safeDecodeURI)(i))},...g&&{label:g},...void 0!==s&&{opensInNewTab:s},...c&&Number.isInteger(c)&&{id:c},...b&&{kind:b},...h&&"URL"!==h&&{type:h}})}(e,o,t),onRemove:()=>{o({url:""}),(0,Nc.speak)((0,we.__)("Link removed."),"assertive")}})),(b||y)&&(0,ye.createElement)("span",{className:"wp-block-navigation__submenu-icon"},(0,ye.createElement)(zc,null))),(0,ye.createElement)("div",U)))},save:function(){return(0,ye.createElement)(Ee.InnerBlocks.Content,null)},transforms:Hc};var Gc=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M7.8 6c0-.7.6-1.2 1.2-1.2h6c.7 0 1.2.6 1.2 1.2v3h1.5V6c0-1.5-1.2-2.8-2.8-2.8H9C7.5 3.2 6.2 4.5 6.2 6v3h1.5V6zm8.4 11c0 .7-.6 1.2-1.2 1.2H9c-.7 0-1.2-.6-1.2-1.2v-3H6.2v3c0 1.5 1.2 2.8 2.8 2.8h6c1.5 0 2.8-1.2 2.8-2.8v-3h-1.5v3zM4 11v1h16v-1H4z"}));var Uc={from:[{type:"raw",schema:{"wp-block":{attributes:["data-block"]}},isMatch:e=>e.dataset&&"core/nextpage"===e.dataset.block,transform:()=>(0,be.createBlock)("core/nextpage",{})}]};const Oc={apiVersion:2,name:"core/nextpage",title:"Page Break",category:"design",description:"Separate your content into a multi-page experience.",keywords:["next page","pagination"],parent:["core/post-content"],textdomain:"default",supports:{customClassName:!1,className:!1,html:!1},editorStyle:"wp-block-nextpage-editor"},{name:qc}=Oc,$c={icon:Gc,example:{},transforms:Uc,edit:function(){return(0,ye.createElement)("div",(0,Ee.useBlockProps)(),(0,ye.createElement)("div",{className:"wp-block-nextpage"},(0,ye.createElement)("span",null,(0,we.__)("Page break"))))},save:function(){return(0,ye.createElement)(ye.RawHTML,null,"\x3c!--nextpage--\x3e")}};var Wc=e=>{let{attributes:t,clientId:n}=e;const o=(0,Ie.useSelect)((e=>e(Ee.store).__experimentalGetParsedPattern(t.slug)),[t.slug]),{replaceBlocks:r,__unstableMarkNextChangeAsNotPersistent:a}=(0,Ie.useDispatch)(Ee.store);(0,ye.useEffect)((()=>{null!=o&&o.blocks&&(a(),r(n,o.blocks))}),[null==o?void 0:o.blocks]);const l=(0,Ee.useBlockProps)();return(0,ye.createElement)("div",l)};const jc={apiVersion:2,name:"core/pattern",title:"Pattern",category:"theme",description:"Show a block pattern.",supports:{html:!1,inserter:!1},textdomain:"default",attributes:{slug:{type:"string"}}},{name:Zc}=jc,Kc={edit:Wc};var Qc=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M7 13.8h6v-1.5H7v1.5zM18 16V4c0-1.1-.9-2-2-2H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2zM5.5 16V4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5zM7 10.5h8V9H7v1.5zm0-3.3h8V5.8H7v1.4zM20.2 6v13c0 .7-.6 1.2-1.2 1.2H8v1.5h11c1.5 0 2.7-1.2 2.7-2.8V6h-1.5z"}));const Jc=["id","title","link","type","parent"],Yc=e=>{let{pages:t,clientId:n,replaceBlock:o,createBlock:r}=e;return()=>{if(!t)return;const e={},a=[];t.forEach((t=>{var n,o;let{id:l,title:i,link:s,type:c,parent:u}=t;const m=null!==(n=null===(o=e[l])||void 0===o?void 0:o.innerBlocks)&&void 0!==n?n:[];if(e[l]=r("core/navigation-link",{id:l,label:i.rendered,url:s,type:c,kind:"post-type"},m),u){e[u]||(e[u]={innerBlocks:[]});e[u].innerBlocks.push(e[l])}else a.push(e[l])}));const l=e=>{e.forEach(((e,t,n)=>{const{attributes:o,innerBlocks:a}=e;if(0!==a.length){l(a);const e=r("core/navigation-submenu",o,a);n[t]=e}}))};l(a),o(n,a)}};function Xc(e){let{onClose:t,clientId:n}=e;const{pages:o,pagesFinished:r}=(0,Ie.useSelect)((e=>{const{getEntityRecords:t,hasFinishedResolution:n}=e(Dt.store),o=["postType","page",{per_page:100,_fields:Jc,orderby:"menu_order",order:"asc"}];return{pages:t(...o),pagesFinished:n("getEntityRecords",o)}}),[n]),{replaceBlock:a}=(0,Ie.useDispatch)(Ee.store);return(0,ye.createElement)(ke.Modal,{closeLabel:(0,we.__)("Close"),onRequestClose:t,title:(0,we.__)("Convert to links"),className:"wp-block-page-list-modal",aria:{describedby:"wp-block-page-list-modal__description"}},(0,ye.createElement)("p",{id:"wp-block-page-list-modal__description"},(0,we.__)("To edit this navigation menu, convert it to single page links. This allows you to add, re-order, remove items, or edit their labels.")),(0,ye.createElement)("p",null,(0,we.__)("Note: if you add new pages to your site, you'll need to add them to your navigation menu.")),(0,ye.createElement)("div",{className:"wp-block-page-list-modal-buttons"},(0,ye.createElement)(ke.Button,{variant:"tertiary",onClick:t},(0,we.__)("Cancel")),(0,ye.createElement)(ke.Button,{variant:"primary",disabled:!r,onClick:Yc({pages:o,replaceBlock:a,clientId:n,createBlock:be.createBlock})},(0,we.__)("Convert"))))}const eu=()=>(0,ye.createElement)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},(0,ye.createElement)(ke.Path,{d:"M1.50002 4L6.00002 8L10.5 4",strokeWidth:"1.5"}));const tu=(0,ye.memo)((function e(t){let{context:n,pagesByParentId:o,parentId:r=0,depth:a=0}=t;const l=o.get(r),i=(0,Ie.useSelect)((e=>{const t=e(Dt.store).getEntityRecord("root","site");return"page"===(null==t?void 0:t.show_on_front)&&(null==t?void 0:t.page_on_front)}),[]);return null!=l&&l.length?l.map((t=>{var r,l;const s=o.has(t.id),c="showSubmenuIcon"in n;return(0,ye.createElement)("li",{key:t.id,className:nt()("wp-block-pages-list__item",{"has-child":s,"wp-block-navigation-item":c,"open-on-click":n.openSubmenusOnClick,"open-on-hover-click":!n.openSubmenusOnClick&&n.showSubmenuIcon,"menu-item-home":t.id===i})},s&&n.openSubmenusOnClick?(0,ye.createElement)(nu,{title:null===(r=t.title)||void 0===r?void 0:r.rendered}):(0,ye.createElement)("a",{className:nt()("wp-block-pages-list__item__link",{"wp-block-navigation-item__content":c}),href:t.link},null===(l=t.title)||void 0===l?void 0:l.rendered),s&&(0,ye.createElement)(ye.Fragment,null,!n.openSubmenusOnClick&&n.showSubmenuIcon&&(0,ye.createElement)(nu,null),(0,ye.createElement)("ul",{className:nt()("submenu-container",{"wp-block-navigation__submenu-container":c})},(0,ye.createElement)(e,{context:n,pagesByParentId:o,parentId:t.id,depth:a+1}))))})):[]}));function nu(e){let{title:t}=e;return(0,ye.createElement)("button",{className:"wp-block-navigation-item__content wp-block-navigation-submenu__toggle","aria-expanded":"false"},t,(0,ye.createElement)("span",{className:"wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"},(0,ye.createElement)(eu,null)))}const ou={apiVersion:2,name:"core/page-list",title:"Page List",category:"widgets",description:"Display a list of all pages.",keywords:["menu","navigation"],textdomain:"default",attributes:{},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","style","openSubmenusOnClick"],supports:{reusable:!1,html:!1},editorStyle:"wp-block-page-list-editor",style:"wp-block-page-list"},{name:ru}=ou,au={icon:Qc,example:{},edit:function(e){var t;let{context:n,clientId:o}=e;const{pagesByParentId:r,totalPages:a,hasResolvedPages:l}=function(){const{pages:e,hasResolvedPages:t}=(0,Ie.useSelect)((e=>{const{getEntityRecords:t,hasFinishedResolution:n}=e(Dt.store);return{pages:t("postType","page",{orderby:"menu_order",order:"asc",_fields:["id","link","parent","title","menu_order"],per_page:-1}),hasResolvedPages:n("getEntityRecords",["postType","page",{orderby:"menu_order",order:"asc",_fields:["id","link","parent","title","menu_order"],per_page:-1}])}}),[]);return(0,ye.useMemo)((()=>{var n;const o=(0,Le.sortBy)(e,["menu_order","title.rendered"]).reduce(((e,t)=>{const{parent:n}=t;return e.has(n)?e.get(n).push(t):e.set(n,[t]),e}),new Map);return{pagesByParentId:o,hasResolvedPages:t,totalPages:null!==(n=null==e?void 0:e.length)&&void 0!==n?n:null}}),[e,t])}(),i="showSubmenuIcon"in n&&a<=100,[s,c]=(0,ye.useState)(!1),u=(0,Ee.useBlockProps)({className:nt()("wp-block-page-list",{"has-text-color":!!n.textColor,[(0,Ee.getColorClassName)("color",n.textColor)]:!!n.textColor,"has-background":!!n.backgroundColor,[(0,Ee.getColorClassName)("background-color",n.backgroundColor)]:!!n.backgroundColor}),style:{...null===(t=n.style)||void 0===t?void 0:t.color}});return(0,ye.createElement)(ye.Fragment,null,i&&(0,ye.createElement)(Ee.BlockControls,{group:"other"},(0,ye.createElement)(ke.ToolbarButton,{title:(0,we.__)("Edit"),onClick:()=>c(!0)},(0,we.__)("Edit"))),i&&s&&(0,ye.createElement)(Xc,{onClose:()=>c(!1),clientId:o}),!l&&(0,ye.createElement)("div",u,(0,ye.createElement)(ke.Placeholder,null,(0,ye.createElement)(ke.Spinner,null))),l&&null===a&&(0,ye.createElement)("div",u,(0,ye.createElement)("div",u,(0,ye.createElement)(ke.Notice,{status:"warning",isDismissible:!1},(0,we.__)("Page List: Cannot retrieve Pages.")))),0===a&&(0,ye.createElement)("div",u,(0,ye.createElement)(ke.Notice,{status:"info",isDismissible:!1},(0,we.__)("Page List: Cannot retrieve Pages."))),a>0&&(0,ye.createElement)("ul",u,(0,ye.createElement)(tu,{context:n,pagesByParentId:r})))}};var lu=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M18.3 4H9.9v-.1l-.9.2c-2.3.4-4 2.4-4 4.8s1.7 4.4 4 4.8l.7.1V20h1.5V5.5h2.9V20h1.5V5.5h2.7V4z"}));const iu={className:!1},su={align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:""},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},textColor:{type:"string"},backgroundColor:{type:"string"},fontSize:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]},style:{type:"object"}},cu=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customFontSize)return e;const t={};return(e.customTextColor||e.customBackgroundColor)&&(t.color={}),e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customFontSize&&(t.typography={fontSize:e.customFontSize}),{...(0,Le.omit)(e,["customTextColor","customBackgroundColor","customFontSize"]),style:t}},uu=[{supports:iu,attributes:{...(0,Le.omit)(su,["style"]),customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:cu,save(e){let{attributes:t}=e;const{align:n,content:o,dropCap:r,backgroundColor:a,textColor:l,customBackgroundColor:i,customTextColor:s,fontSize:c,customFontSize:u,direction:m}=t,d=(0,Ee.getColorClassName)("color",l),p=(0,Ee.getColorClassName)("background-color",a),g=(0,Ee.getFontSizeClass)(c),h=nt()({"has-text-color":l||s,"has-background":a||i,"has-drop-cap":r,[`has-text-align-${n}`]:n,[g]:g,[d]:d,[p]:p}),v={backgroundColor:p?void 0:i,color:d?void 0:s,fontSize:g?void 0:u};return(0,ye.createElement)(Ee.RichText.Content,{tagName:"p",style:v,className:h||void 0,value:o,dir:m})}},{supports:iu,attributes:{...(0,Le.omit)(su,["style"]),customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:cu,save(e){let{attributes:t}=e;const{align:n,content:o,dropCap:r,backgroundColor:a,textColor:l,customBackgroundColor:i,customTextColor:s,fontSize:c,customFontSize:u,direction:m}=t,d=(0,Ee.getColorClassName)("color",l),p=(0,Ee.getColorClassName)("background-color",a),g=(0,Ee.getFontSizeClass)(c),h=nt()({"has-text-color":l||s,"has-background":a||i,"has-drop-cap":r,[g]:g,[d]:d,[p]:p}),v={backgroundColor:p?void 0:i,color:d?void 0:s,fontSize:g?void 0:u,textAlign:n};return(0,ye.createElement)(Ee.RichText.Content,{tagName:"p",style:v,className:h||void 0,value:o,dir:m})}},{supports:iu,attributes:{...(0,Le.omit)(su,["style"]),customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"},width:{type:"string"}},migrate:cu,save(e){let{attributes:t}=e;const{width:n,align:o,content:r,dropCap:a,backgroundColor:l,textColor:i,customBackgroundColor:s,customTextColor:c,fontSize:u,customFontSize:m}=t,d=(0,Ee.getColorClassName)("color",i),p=(0,Ee.getColorClassName)("background-color",l),g=u&&`is-${u}-text`,h=nt()({[`align${n}`]:n,"has-background":l||s,"has-drop-cap":a,[g]:g,[d]:d,[p]:p}),v={backgroundColor:p?void 0:s,color:d?void 0:c,fontSize:g?void 0:m,textAlign:o};return(0,ye.createElement)(Ee.RichText.Content,{tagName:"p",style:v,className:h||void 0,value:r})}},{supports:iu,attributes:(0,Le.omit)({...su,fontSize:{type:"number"}},["style"]),save(e){let{attributes:t}=e;const{width:n,align:o,content:r,dropCap:a,backgroundColor:l,textColor:i,fontSize:s}=t,c=nt()({[`align${n}`]:n,"has-background":l,"has-drop-cap":a}),u={backgroundColor:l,color:i,fontSize:s,textAlign:o};return(0,ye.createElement)("p",{style:u,className:c||void 0},r)},migrate:e=>cu((0,Le.omit)({...e,customFontSize:(0,Le.isFinite)(e.fontSize)?e.fontSize:void 0,customTextColor:e.textColor&&"#"===e.textColor[0]?e.textColor:void 0,customBackgroundColor:e.backgroundColor&&"#"===e.backgroundColor[0]?e.backgroundColor:void 0}))},{supports:iu,attributes:{...su,content:{type:"string",source:"html",default:""}},save(e){let{attributes:t}=e;return(0,ye.createElement)(ye.RawHTML,null,t.content)},migrate:e=>e}];var mu=uu;var du=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,ye.createElement)(fe.Path,{d:"M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z"}));function pu(e){let{direction:t,setDirection:n}=e;return(0,we.isRTL)()&&(0,ye.createElement)(ke.ToolbarDropdownMenu,{controls:[{icon:du,title:(0,we._x)("Left to right","editor button"),isActive:"ltr"===t,onClick(){n("ltr"===t?void 0:"ltr")}}]})}var gu=function(e){let{attributes:t,mergeBlocks:n,onReplace:o,onRemove:r,setAttributes:a,clientId:l}=e;const{align:i,content:s,direction:c,dropCap:u,placeholder:m}=t,d=(0,Ee.useSetting)("typography.dropCap"),p=(0,Ee.useBlockProps)({className:nt()({"has-drop-cap":u,[`has-text-align-${i}`]:i}),style:{direction:c}});return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(Ee.AlignmentControl,{value:i,onChange:e=>a({align:e})}),(0,ye.createElement)(pu,{direction:c,setDirection:e=>a({direction:e})})),d&&(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Text settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Drop cap"),checked:!!u,onChange:()=>a({dropCap:!u}),help:u?(0,we.__)("Showing large initial letter."):(0,we.__)("Toggle to show a large initial letter.")}))),(0,ye.createElement)(Ee.RichText,gt({identifier:"content",tagName:"p"},p,{value:s,onChange:e=>a({content:e}),onSplit:(e,n)=>{let o;(n||e)&&(o={...t,content:e});const r=(0,be.createBlock)("core/paragraph",o);return n&&(r.clientId=l),r},onMerge:n,onReplace:o,onRemove:r,"aria-label":s?(0,we.__)("Paragraph block"):(0,we.__)("Empty block; start writing or type forward slash to choose a block"),"data-empty":!s,placeholder:m||(0,we.__)("Type / to choose a block"),__unstableEmbedURLOnPaste:!0,__unstableAllowPrefixTransformations:!0})))};const{name:hu}={apiVersion:2,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the building block of all narrative.",keywords:["text"],textdomain:"default",attributes:{align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:"",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{anchor:!0,className:!1,color:{link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},vu={from:[{type:"raw",priority:20,selector:"p",schema:e=>{let{phrasingContentSchema:t,isPaste:n}=e;return{p:{children:t,attributes:n?[]:["style","id"]}}},transform(e){const t=(0,be.getBlockAttributes)(hu,e.outerHTML),{textAlign:n}=e.style||{};return"left"!==n&&"center"!==n&&"right"!==n||(t.align=n),(0,be.createBlock)(hu,t)}}]};var bu=vu;const yu={apiVersion:2,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the building block of all narrative.",keywords:["text"],textdomain:"default",attributes:{align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:"",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{anchor:!0,className:!1,color:{link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},{name:fu}=yu,_u={icon:lu,example:{attributes:{content:(0,we.__)("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing."),style:{typography:{fontSize:28}},dropCap:!0}},__experimentalLabel(e,t){let{context:n}=t;if("accessibility"===n){const{content:t}=e;return(0,Le.isEmpty)(t)?(0,we.__)("Empty"):t}},transforms:bu,deprecated:mu,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:gu,save:function(e){let{attributes:t}=e;const{align:n,content:o,dropCap:r,direction:a}=t,l=nt()({"has-drop-cap":r,[`has-text-align-${n}`]:n});return(0,ye.createElement)("p",Ee.useBlockProps.save({className:l,dir:a}),(0,ye.createElement)(Ee.RichText.Content,{value:o}))}};var ku=function(e){let{isSelected:t,context:{postType:n,postId:o,queryId:r},attributes:a,setAttributes:l}=e;const i=Number.isFinite(r),{authorId:s,authorDetails:c,authors:u}=(0,Ie.useSelect)((e=>{var t;const{getEditedEntityRecord:r,getUser:a,getUsers:l}=e(Dt.store),i=null===(t=r("postType",n,o))||void 0===t?void 0:t.author;return{authorId:i,authorDetails:i?a(i):null,authors:l({who:"authors"})}}),[n,o]),{editEntityRecord:m}=(0,Ie.useDispatch)(Dt.store),{textAlign:d,showAvatar:p,showBio:g,byline:h}=a,v=[];c&&(0,Le.forEach)(c.avatar_urls,((e,t)=>{v.push({value:t,label:`${t} x ${t}`})}));const b=(0,Ee.useBlockProps)({className:nt()({[`has-text-align-${d}`]:d})});return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Author Settings")},!i&&!(null==u||!u.length)&&(0,ye.createElement)(ke.SelectControl,{label:(0,we.__)("Author"),value:s,options:u.map((e=>{let{id:t,name:n}=e;return{value:t,label:n}})),onChange:e=>{m("postType",n,o,{author:e})}}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Show avatar"),checked:p,onChange:()=>l({showAvatar:!p})}),p&&(0,ye.createElement)(ke.SelectControl,{label:(0,we.__)("Avatar size"),value:a.avatarSize,options:v,onChange:e=>{l({avatarSize:Number(e)})}}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Show bio"),checked:g,onChange:()=>l({showBio:!g})}))),(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(Ee.AlignmentControl,{value:d,onChange:e=>{l({textAlign:e})}})),(0,ye.createElement)("div",b,p&&c&&(0,ye.createElement)("div",{className:"wp-block-post-author__avatar"},(0,ye.createElement)("img",{width:a.avatarSize,src:c.avatar_urls[a.avatarSize],alt:c.name})),(0,ye.createElement)("div",{className:"wp-block-post-author__content"},(!Ee.RichText.isEmpty(h)||t)&&(0,ye.createElement)(Ee.RichText,{className:"wp-block-post-author__byline",multiline:!1,"aria-label":(0,we.__)("Post author byline text"),placeholder:(0,we.__)("Write byline…"),value:h,onChange:e=>l({byline:e})}),(0,ye.createElement)("p",{className:"wp-block-post-author__name"},(null==c?void 0:c.name)||(0,we.__)("Post Author")),g&&(0,ye.createElement)("p",{className:"wp-block-post-author__bio"},null==c?void 0:c.description))))};var wu=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z",fillRule:"evenodd",clipRule:"evenodd"}));const Eu={apiVersion:2,name:"core/post-author",title:"Post Author",category:"theme",description:"Add the author of this post.",textdomain:"default",attributes:{textAlign:{type:"string"},avatarSize:{type:"number",default:48},showAvatar:{type:"boolean",default:!0},showBio:{type:"boolean"},byline:{type:"string"}},usesContext:["postType","postId","queryId"],supports:{html:!1,spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDuotone:".wp-block-post-author__avatar img"}},editorStyle:"wp-block-post-author-editor",style:"wp-block-post-author"},{name:Cu}=Eu,xu={icon:wu,edit:ku};var Su=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z"}));function Bu(e){let{postId:t}=e;return(0,Ie.useSelect)((e=>{const n=e(Dt.store).getEntityRecords("root","comment",{post:t});return n&&n.length?n.map((e=>(0,ye.createElement)(ye.RawHTML,{className:"wp-block-post-comments__comment",key:e.id},e.content.rendered))):(0,we.__)("No comments.")}),[t])}const Tu={apiVersion:2,name:"core/post-comments",title:"Post Comments",category:"theme",description:"Display a post's comments.",textdomain:"default",attributes:{textAlign:{type:"string"}},usesContext:["postId","postType"],supports:{html:!1,align:["wide","full"],typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0}},style:["wp-block-post-comments","wp-block-buttons","wp-block-button"]},{name:Nu}=Tu,zu={icon:Su,edit:function(e){let{attributes:t,setAttributes:n,context:o}=e;const{postType:r,postId:a}=o,{textAlign:l}=t,i=(0,Ee.useBlockProps)({className:nt()({[`has-text-align-${l}`]:l})});return r&&a?(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(Ee.AlignmentControl,{value:l,onChange:e=>{n({textAlign:e})}})),(0,ye.createElement)("div",i,(0,ye.createElement)(Bu,{postId:a}))):(0,ye.createElement)("div",i,(0,ye.createElement)(Ee.Warning,null,(0,we.__)("Post comments block: no post found.")))}};var Pu=(0,ye.createElement)(fe.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M4 20h16v-1.5H4V20zm0-4.8h16v-1.5H4v1.5zm0-6.4v1.5h16V8.8H4zM16 4H4v1.5h12V4z"}));function Iu(e,t,n){return(0,Ie.useSelect)((o=>o(Dt.store).canUserEditEntityRecord(e,t,n)),[e,t,n])}function Mu(e){let{userCanEdit:t,postType:n,postId:o}=e;const[,,r]=(0,Dt.useEntityProp)("postType",n,"content",o),a=(0,Ee.useBlockProps)();return null!=r&&r.protected&&!t?(0,ye.createElement)("div",a,(0,ye.createElement)(Ee.Warning,null,(0,we.__)("This content is password protected."))):(0,ye.createElement)("div",a,(0,ye.createElement)(ye.RawHTML,{key:"html"},null==r?void 0:r.rendered))}function Ru(e){let{layout:t,context:n={}}=e;const{postType:o,postId:r}=n,a=(0,Ie.useSelect)((e=>{var t;const{getSettings:n}=e(Ee.store);return null===(t=n())||void 0===t?void 0:t.supportsLayout}),[]),l=(0,Ee.useSetting)("layout")||{},i=t&&t.inherit?l:t,[s,c,u]=(0,Dt.useEntityBlockEditor)("postType",o,{id:r}),m=(0,Ee.useInnerBlocksProps)((0,Ee.useBlockProps)({className:"entry-content"}),{value:s,onInput:c,onChange:u,__experimentalLayout:a?i:void 0});return(0,ye.createElement)("div",m)}function Lu(e){const{context:{queryId:t,postType:n,postId:o}={}}=e,r=Number.isFinite(t),a=Iu("postType",n,o);return a&&!r?(0,ye.createElement)(Ru,e):(0,ye.createElement)(Mu,{userCanEdit:a,postType:n,postId:o})}function Vu(){const e=(0,Ee.useBlockProps)();return(0,ye.createElement)("div",e,(0,ye.createElement)("p",null,(0,we.__)("Post Content")))}function Hu(){const e=(0,Ee.useBlockProps)();return(0,ye.createElement)("div",e,(0,ye.createElement)(Ee.Warning,null,(0,we.__)("Block cannot be rendered inside itself.")))}const Au={apiVersion:2,name:"core/post-content",title:"Post Content",category:"theme",description:"Displays the contents of a post or page.",textdomain:"default",usesContext:["postId","postType","queryId"],supports:{align:["wide","full"],html:!1,__experimentalLayout:!0},editorStyle:"wp-block-post-content-editor"},{name:Fu}=Au,Du={icon:Pu,edit:function(e){let{context:t,attributes:n}=e;const{postId:o,postType:r}=t,{layout:a={}}=n,[l,i]=(0,Ee.__experimentalUseNoRecursiveRenders)(o);return o&&r&&l?(0,ye.createElement)(Hu,null):(0,ye.createElement)(i,null,o&&r?(0,ye.createElement)(Lu,{context:t,layout:a}):(0,ye.createElement)(Vu,null))}};var Gu=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"}),(0,ye.createElement)(fe.Path,{d:"M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"}));var Uu=[{attributes:{textAlign:{type:"string"},format:{type:"string"},isLink:{type:"boolean",default:!1}},supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0}},save:()=>null,migrate:lt,isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}}];const Ou={apiVersion:2,name:"core/post-date",title:"Post Date",category:"theme",description:"Add the date of this post.",textdomain:"default",attributes:{textAlign:{type:"string"},format:{type:"string"},isLink:{type:"boolean",default:!1}},usesContext:["postId","postType","queryId"],supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}}}},{name:qu}=Ou,$u={icon:Gu,edit:function(e){let{attributes:{textAlign:t,format:n,isLink:o},context:{postId:r,postType:a,queryId:l},setAttributes:i}=e;const s=Number.isFinite(l),[c]=(0,Dt.useEntityProp)("root","site","date_format"),[u,m]=(0,Dt.useEntityProp)("postType",a,"date",r),d=(0,ci.__experimentalGetSettings)(),p=/a(?!\\)/i.test(d.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join("")),g=Object.values(d.formats).map((e=>({key:e,name:(0,ci.dateI18n)(e,u)}))),h=n||c||d.formats.date,v=(0,Ee.useBlockProps)({className:nt()({[`has-text-align-${t}`]:t})}),b=(0,ye.useRef)();let y=u?(0,ye.createElement)("time",{dateTime:(0,ci.dateI18n)("c",u),ref:b},(0,ci.dateI18n)(h,u)):(0,we.__)("Post Date");return o&&u&&(y=(0,ye.createElement)("a",{href:"#post-date-pseudo-link",onClick:e=>e.preventDefault()},y)),(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(Ee.AlignmentControl,{value:t,onChange:e=>{i({textAlign:e})}}),u&&!s&&(0,ye.createElement)(ke.ToolbarGroup,null,(0,ye.createElement)(ke.Dropdown,{popoverProps:{anchorRef:b.current},renderContent:()=>(0,ye.createElement)(ke.DateTimePicker,{currentDate:u,onChange:m,is12Hour:p}),renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,ye.createElement)(ke.ToolbarButton,{"aria-expanded":t,icon:$o,title:(0,we.__)("Change Date"),onClick:n,onKeyDown:e=>{t||e.keyCode!==ht.DOWN||(e.preventDefault(),n())}})}}))),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Format settings")},(0,ye.createElement)(ke.CustomSelectControl,{hideLabelFromVision:!0,label:(0,we.__)("Date Format"),options:g,onChange:e=>{let{selectedItem:t}=e;return i({format:t.key})},value:g.find((e=>e.key===h))})),(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Link settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.sprintf)((0,we.__)("Link to %s"),a),onChange:()=>i({isLink:!o}),checked:o}))),(0,ye.createElement)("div",v,y))},deprecated:Uu};var Wu=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M12.75 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.395.395 0 00.199-.166c.05-.083.114-.253.114-.584V7.2H8.8V4h3.95v5.333zM7.95 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.394.394 0 00.198-.166c.05-.083.115-.253.115-.584V7.2H4V4h3.95v5.333zM13 20H4v-1.5h9V20zM20 16H4v-1.5h16V16z"}));const ju={apiVersion:2,name:"core/post-excerpt",title:"Post Excerpt",category:"theme",description:"Display a post's excerpt.",textdomain:"default",attributes:{textAlign:{type:"string"},moreText:{type:"string"},showMoreOnNewLine:{type:"boolean",default:!0}},usesContext:["postId","postType","queryId"],supports:{html:!1,color:{gradients:!0,link:!0},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}}},editorStyle:"wp-block-post-excerpt-editor",style:"wp-block-post-excerpt"},{name:Zu}=ju,Ku={icon:Wu,edit:function(e){let{attributes:{textAlign:t,moreText:n,showMoreOnNewLine:o},setAttributes:r,isSelected:a,context:{postId:l,postType:i,queryId:s}}=e;const c=Number.isFinite(s),u=Iu("postType",i,l),m=u&&!c,[d,p,{rendered:g,protected:h}={}]=(0,Dt.useEntityProp)("postType",i,"excerpt",l),v=(0,Ee.useBlockProps)({className:nt()({[`has-text-align-${t}`]:t})}),b=(0,ye.useMemo)((()=>{if(!g)return"";const e=(new window.DOMParser).parseFromString(g,"text/html");return e.body.textContent||e.body.innerText||""}),[g]);if(!i||!l)return(0,ye.createElement)("div",v,(0,we.__)("Post Excerpt"));if(h&&!u)return(0,ye.createElement)("div",v,(0,ye.createElement)(Ee.Warning,null,(0,we.__)("There is no excerpt because this is a protected post.")));const y=(0,ye.createElement)(Ee.RichText,{className:"wp-block-post-excerpt__more-link",tagName:"a","aria-label":(0,we.__)('"Read more" link text'),placeholder:(0,we.__)('Add "read more" link text'),value:n,onChange:e=>r({moreText:e}),withoutInteractiveFormatting:!0}),f=m?(0,ye.createElement)(Ee.RichText,{className:!o&&"wp-block-post-excerpt__excerpt is-inline","aria-label":(0,we.__)("Post excerpt text"),value:d||b||(a?"":(0,we.__)("No post excerpt found")),onChange:p}):g&&(0,ye.createElement)(ke.Disabled,null,(0,ye.createElement)(ye.RawHTML,{key:"html"},g))||(0,we.__)("No post excerpt found");return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(Ee.AlignmentToolbar,{value:t,onChange:e=>r({textAlign:e})})),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Post Excerpt Settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Show link on new line"),checked:o,onChange:e=>r({showMoreOnNewLine:e})}))),(0,ye.createElement)("div",v,f,!o&&" ",o?(0,ye.createElement)("p",{className:"wp-block-post-excerpt__more-text"},y):y))}};var Qu=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"}));const Ju=(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.__experimentalToggleGroupControlOption,{value:"cover",label:(0,we._x)("Cover","Scale option for Image dimension control")}),(0,ye.createElement)(ke.__experimentalToggleGroupControlOption,{value:"contain",label:(0,we._x)("Contain","Scale option for Image dimension control")}),(0,ye.createElement)(ke.__experimentalToggleGroupControlOption,{value:"fill",label:(0,we._x)("Fill","Scale option for Image dimension control")})),Yu="cover",Xu={cover:(0,we.__)("Image is scaled and cropped to fill the entire space without being distorted."),contain:(0,we.__)("Image is scaled to fill the space without clipping nor distorting."),fill:(0,we.__)("Image will be stretched and distorted to completely fill the space.")};var em=e=>{let{clientId:t,attributes:{width:n,height:o,scale:r},setAttributes:a}=e;const l=(0,ke.__experimentalUseCustomUnits)({availableUnits:(0,Ee.useSetting)("spacing.units")||["px","%","vw","em","rem"]}),i=(e,t)=>{const n=parseFloat(t);isNaN(n)&&t||a({[e]:n<0?"0":t})},s=(0,we._x)("Scale","Image scaling options");return(0,ye.createElement)(Ee.InspectorControls,{__experimentalGroup:"dimensions"},(0,ye.createElement)(ke.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>!!o,label:(0,we.__)("Height"),onDeselect:()=>a({height:void 0}),resetAllFilter:()=>({height:void 0}),isShownByDefault:!0,panelId:t},(0,ye.createElement)(ke.__experimentalUnitControl,{label:(0,we.__)("Height"),labelPosition:"top",value:o||"",min:0,onChange:e=>i("height",e),units:l})),(0,ye.createElement)(ke.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>!!n,label:(0,we.__)("Width"),onDeselect:()=>a({width:void 0}),resetAllFilter:()=>({width:void 0}),isShownByDefault:!0,panelId:t},(0,ye.createElement)(ke.__experimentalUnitControl,{label:(0,we.__)("Width"),labelPosition:"top",value:n||"",min:0,onChange:e=>i("width",e),units:l})),!!o&&(0,ye.createElement)(ke.__experimentalToolsPanelItem,{hasValue:()=>!!r&&r!==Yu,label:s,onDeselect:()=>a({scale:Yu}),resetAllFilter:()=>({scale:Yu}),isShownByDefault:!0,panelId:t},(0,ye.createElement)(ke.__experimentalToggleGroupControl,{label:s,value:r,help:Xu[r],onChange:e=>a({scale:e}),isBlock:!0},Ju)))};const tm=(0,ye.createElement)(fe.SVG,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none"},(0,ye.createElement)(fe.Path,{vectorEffect:"non-scaling-stroke",d:"M60 60 0 0"})),nm=["image"],om=(0,ye.createElement)("div",{className:"wp-block-post-featured-image__placeholder"},tm);function rm(e){let{clientId:t,attributes:n,setAttributes:o,context:{postId:r,postType:a,queryId:l}}=e;const i=Number.isFinite(l),{isLink:s,height:c,width:u,scale:m}=n,[d,p]=(0,Dt.useEntityProp)("postType",a,"featured_media",r),g=(0,Ie.useSelect)((e=>d&&e(Dt.store).getMedia(d,{context:"view"})),[d]),h=(0,Ee.useBlockProps)({style:{width:u,height:c}}),v=e=>(0,ye.createElement)(ke.Placeholder,{className:"block-editor-media-placeholder"},tm,e),b=e=>{null!=e&&e.id&&p(e.id)},{createErrorNotice:y}=(0,Ie.useDispatch)(Ir.store),f=e=>{y(e[2],{type:"snackbar"})};let _;if(!d&&i)return(0,ye.createElement)("div",h,om);const k=(0,we.__)("Add a featured image");return _=d?g?(0,ye.createElement)("img",{src:g.source_url,alt:g.alt_text||(0,we.__)("Featured image"),style:{height:c,objectFit:c&&m}}):om:(0,ye.createElement)(Ee.MediaPlaceholder,{onSelect:b,accept:"image/*",allowedTypes:nm,onError:f,placeholder:v,mediaLibraryButton:e=>{let{open:t}=e;return(0,ye.createElement)(ke.Button,{icon:Ol,variant:"primary",label:k,showTooltip:!0,tooltipPosition:"top center",onClick:()=>{t()}})}}),(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(em,{clientId:t,attributes:n,setAttributes:o}),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Link settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.sprintf)((0,we.__)("Link to %s"),a),onChange:()=>o({isLink:!s}),checked:s}))),!!g&&!i&&(0,ye.createElement)(Ee.BlockControls,{group:"other"},(0,ye.createElement)(Ee.MediaReplaceFlow,{mediaId:d,mediaURL:g.source_url,allowedTypes:nm,accept:"image/*",onSelect:b,onError:f})),(0,ye.createElement)("figure",h,_))}const am={apiVersion:2,name:"core/post-featured-image",title:"Post Featured Image",category:"theme",description:"Display a post's featured image.",textdomain:"default",attributes:{isLink:{type:"boolean",default:!1},width:{type:"string"},height:{type:"string"},scale:{type:"string",default:"cover"}},usesContext:["postId","postType","queryId"],supports:{align:["left","right","center","wide","full"],color:{__experimentalDuotone:"img",text:!1,background:!1},html:!1,spacing:{margin:!0,padding:!0}},editorStyle:"wp-block-post-featured-image-editor",style:"wp-block-post-featured-image"},{name:lm}=am,im={icon:Qu,edit:function(e){var t;const n=(0,Ee.useBlockProps)();return null!==(t=e.context)&&void 0!==t&&t.postId?(0,ye.createElement)(rm,e):(0,ye.createElement)("div",n,om)}};var sm=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"}));var cm=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"}));const um=[{isDefault:!0,name:"post-next",title:(0,we.__)("Next post"),description:(0,we.__)("Displays the post link that follows the current post."),icon:sm,attributes:{type:"next"},scope:["inserter","transform"]},{name:"post-previous",title:(0,we.__)("Previous post"),description:(0,we.__)("Displays the post link that precedes the current post."),icon:cm,attributes:{type:"previous"},scope:["inserter","transform"]}];um.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.type===t.type)}));var mm=um;const dm={apiVersion:2,name:"core/post-navigation-link",title:"Post Navigation Link",category:"theme",description:"Displays the next or previous post link that is adjacent to the current post.",textdomain:"default",attributes:{textAlign:{type:"string"},type:{type:"string",default:"next"},label:{type:"string"},showTitle:{type:"boolean",default:!1},linkLabel:{type:"boolean",default:!1}},supports:{reusable:!1,html:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}}}},{name:pm}=dm,gm={edit:function(e){let{attributes:{type:t,label:n,showTitle:o,textAlign:r,linkLabel:a},setAttributes:l}=e;const i="next"===t;let s=i?(0,we.__)("Next"):(0,we.__)("Previous");o&&(s=i?(0,we.__)("Next: "):(0,we.__)("Previous: "));const c=i?(0,we.__)("Next post"):(0,we.__)("Previous post"),u=(0,Ee.useBlockProps)({className:nt()({[`has-text-align-${r}`]:r})});return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,null,(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Display the title as a link"),help:(0,we.__)("If you have entered a custom label, it will be prepended before the title."),checked:!!o,onChange:()=>l({showTitle:!o})}),o&&(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Include the label as part of the link"),checked:!!a,onChange:()=>l({linkLabel:!a})}))),(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(Ee.AlignmentToolbar,{value:r,onChange:e=>{l({textAlign:e})}})),(0,ye.createElement)("div",u,(0,ye.createElement)(Ee.RichText,{tagName:"a","aria-label":c,placeholder:s,value:n,allowedFormats:["core/bold","core/italic"],onChange:e=>l({label:e})}),o&&(0,ye.createElement)("a",{href:"#post-navigation-pseudo-link",onClick:e=>e.preventDefault()},(0,we.__)("An example title"))))},variations:mm};var hm=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.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"}));const vm=[["core/post-title"],["core/post-date"],["core/post-excerpt"]];function bm(){const e=(0,Ee.useInnerBlocksProps)({},{template:vm});return(0,ye.createElement)("li",e)}const ym=(0,ye.memo)((function(e){let{blocks:t,blockContextId:n,isHidden:o,setActiveBlockContextId:r}=e;const a=(0,Ee.__experimentalUseBlockPreview)({blocks:t}),l=()=>{r(n)},i={display:o?"none":void 0};return(0,ye.createElement)("li",gt({},a,{tabIndex:0,role:"button",onClick:l,onKeyPress:l,style:i}))}));const fm={apiVersion:2,name:"core/post-template",title:"Post Template",category:"design",parent:["core/query"],description:"Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.",textdomain:"default",usesContext:["queryId","query","queryContext","displayLayout","templateSlug"],supports:{reusable:!1,html:!1,align:!0,__experimentalLayout:{allowEditing:!1}},style:"wp-block-post-template",editorStyle:"wp-block-post-template-editor"},{name:_m}=fm,km={icon:hm,edit:function(e){let{clientId:t,context:{query:{perPage:n,offset:o,categoryIds:r=[],postType:a,tagIds:l=[],order:i,orderBy:s,author:c,search:u,exclude:m,sticky:d,inherit:p}={},queryContext:g=[{page:1}],templateSlug:h,displayLayout:{type:v="flex",columns:b=1}={}}}=e;const[{page:y}]=g,[f,_]=(0,ye.useState)(),{posts:k,blocks:w}=(0,Ie.useSelect)((e=>{const{getEntityRecords:g}=e(Dt.store),{getBlocks:v}=e(Ee.store),b={offset:n?n*(y-1)+o:0,categories:r,tags:l,order:i,orderby:s};return n&&(b.per_page=n),c&&(b.author=c),u&&(b.search=u),null!=m&&m.length&&(b.exclude=m),d&&(b.sticky="only"===d),p&&null!=h&&h.startsWith("archive-")&&(b.postType=h.replace("archive-",""),a=b.postType),{posts:g("postType",a,b),blocks:v(t)}}),[n,y,o,r,l,i,s,t,c,u,a,m,d,p,h]),E=(0,ye.useMemo)((()=>null==k?void 0:k.map((e=>({postType:e.type,postId:e.id})))),[k]),C="flex"===v&&b>1,x=(0,Ee.useBlockProps)({className:nt()({"is-flex-container":C,[`columns-${b}`]:C})});return k?k.length?(0,ye.createElement)("ul",x,E&&E.map((e=>{var t,n;return(0,ye.createElement)(Ee.BlockContextProvider,{key:e.postId,value:e},e.postId===(f||(null===(t=E[0])||void 0===t?void 0:t.postId))?(0,ye.createElement)(bm,null):null,(0,ye.createElement)(ym,{blocks:w,blockContextId:e.postId,setActiveBlockContextId:_,isHidden:e.postId===(f||(null===(n=E[0])||void 0===n?void 0:n.postId))}))}))):(0,ye.createElement)("p",x," ",(0,we.__)("No results found.")):(0,ye.createElement)("p",x,(0,ye.createElement)(ke.Spinner,null))},save:function(){return(0,ye.createElement)(Ee.InnerBlocks.Content,null)}};var wm=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M20 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z",fillRule:"evenodd",clipRule:"evenodd"}));const Em=[{name:"category",title:(0,we.__)("Post Categories"),description:(0,we.__)("Display a post's categories."),icon:wm,isDefault:!0,attributes:{term:"category"},isActive:e=>"category"===e.term},{name:"post_tag",title:(0,we.__)("Post Tags"),description:(0,we.__)("Display a post's tags."),icon:wm,attributes:{term:"post_tag"},isActive:e=>"post_tag"===e.term}];var Cm=Em;const xm={apiVersion:2,name:"core/post-terms",title:"Post Terms",category:"theme",description:"Post terms.",textdomain:"default",attributes:{term:{type:"string"},textAlign:{type:"string"},separator:{type:"string",default:", "}},usesContext:["postId","postType"],supports:{html:!1,color:{gradients:!0,link:!0},typography:{lineHeight:!0,fontSize:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}}},style:"wp-block-post-terms"},{name:Sm}=xm,Bm={variations:Cm,edit:function(e){var t;let{attributes:n,context:o,setAttributes:r}=e;const{term:a,textAlign:l,separator:i}=n,{postId:s,postType:c}=o,u=(0,Ie.useSelect)((e=>{var t;if(!a)return{};const{getTaxonomy:n}=e(Dt.store),o=n(a);return null!=o&&null!==(t=o.visibility)&&void 0!==t&&t.publicly_queryable?o:{}}),[a]),{postTerms:m,hasPostTerms:d,isLoading:p}=function(e){var t;let{postId:n,postType:o,term:r}=e;const{rest_base:a,slug:l}=r,[i]=(0,Dt.useEntityProp)("postType",o,a,n);return(0,Ie.useSelect)((e=>{var t,n;if(!(null==r||null===(t=r.visibility)||void 0===t?void 0:t.publicly_queryable))return{postTerms:[],_isLoading:!1,hasPostTerms:!1};if(!i)return{isLoading:null==r||null===(n=r.postTerms)||void 0===n?void 0:n.includes(o)};if(!i.length)return{isLoading:!1};const{getEntityRecords:a,isResolving:s}=e(Dt.store),c=["taxonomy",l,{include:i,context:"view"}],u=a(...c);return{postTerms:u,isLoading:s("getEntityRecords",c),hasPostTerms:!(null==u||!u.length)}}),[i,null==r||null===(t=r.visibility)||void 0===t?void 0:t.publicly_queryable])}({postId:s,postType:c,term:u}),g=s&&c,h=(0,Ee.useBlockProps)({className:nt()({[`has-text-align-${l}`]:l,[`taxonomy-${a}`]:a})});return g&&a?(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(Ee.AlignmentToolbar,{value:l,onChange:e=>{r({textAlign:e})}})),(0,ye.createElement)(Ee.InspectorControls,{__experimentalGroup:"advanced"},(0,ye.createElement)(ke.TextControl,{autoComplete:"off",label:(0,we.__)("Separator"),value:i||"",onChange:e=>{r({separator:e})},help:(0,we.__)("Enter character(s) used to separate terms.")})),(0,ye.createElement)("div",h,p&&(0,ye.createElement)(ke.Spinner,null),!p&&d&&m.map((e=>(0,ye.createElement)("a",{key:e.id,href:e.link,onClick:e=>e.preventDefault()},e.name))).reduce(((e,t)=>(0,ye.createElement)(ye.Fragment,null,e,(0,ye.createElement)("span",{className:"wp-block-post-terms__separator"},i||" "),t))),!p&&!d&&((null==u||null===(t=u.labels)||void 0===t?void 0:t.no_terms)||(0,we.__)("Term items not found.")))):(0,ye.createElement)("div",h,(0,we.__)("Post Terms"))}};var Tm=[{attributes:{textAlign:{type:"string"},level:{type:"number",default:2},isLink:{type:"boolean",default:!1},rel:{type:"string",attribute:"rel",default:""},linkTarget:{type:"string",default:"_self"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0}},save:()=>null,migrate:lt,isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}}];const Nm={apiVersion:2,name:"core/post-title",title:"Post Title",category:"theme",description:"Displays the title of a post, page, or any other content-type.",textdomain:"default",usesContext:["postId","postType","queryId"],attributes:{textAlign:{type:"string"},level:{type:"number",default:2},isLink:{type:"boolean",default:!1},rel:{type:"string",attribute:"rel",default:""},linkTarget:{type:"string",default:"_self"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}}},style:"wp-block-post-title"},{name:zm}=Nm,Pm={icon:bc,edit:function(e){let{attributes:{level:t,textAlign:n,isLink:o,rel:r,linkTarget:a},setAttributes:l,context:{postType:i,postId:s,queryId:c}}=e;const u=0===t?"p":"h"+t,m=Number.isFinite(c),d=Iu("postType",i,s),[p="",g,h]=(0,Dt.useEntityProp)("postType",i,"title",s),[v]=(0,Dt.useEntityProp)("postType",i,"link",s),b=(0,Ee.useBlockProps)({className:nt()({[`has-text-align-${n}`]:n})});let y=(0,ye.createElement)(u,b,(0,we.__)("Post Title"));return i&&s&&(y=d&&!m?(0,ye.createElement)(Ee.PlainText,gt({tagName:u,placeholder:(0,we.__)("No Title"),value:p,onChange:g,__experimentalVersion:2},b)):(0,ye.createElement)(u,b,(0,ye.createElement)(ye.RawHTML,{key:"html"},null==h?void 0:h.rendered))),o&&i&&s&&(y=d&&!m?(0,ye.createElement)(u,b,(0,ye.createElement)(Ee.PlainText,{tagName:"a",href:v,target:a,rel:r,placeholder:p.length?null:(0,we.__)("No Title"),value:p,onChange:g,__experimentalVersion:2})):(0,ye.createElement)(u,b,(0,ye.createElement)("a",{href:v,target:a,rel:r,onClick:e=>e.preventDefault()},(0,ye.createElement)(ye.RawHTML,{key:"html"},null==h?void 0:h.rendered)))),(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(wl,{selectedLevel:t,onChange:e=>l({level:e})}),(0,ye.createElement)(Ee.AlignmentControl,{value:n,onChange:e=>{l({textAlign:e})}})),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Link settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Make title a link"),onChange:()=>l({isLink:!o}),checked:o}),o&&(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Open in new tab"),onChange:e=>l({linkTarget:e?"_blank":"_self"}),checked:"_blank"===a}),(0,ye.createElement)(ke.TextControl,{label:(0,we.__)("Link rel"),value:r,onChange:e=>l({rel:e})})))),y)},deprecated:Tm};var Im=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z"}));const Mm={from:[{type:"block",blocks:["core/code","core/paragraph"],transform:e=>{let{content:t,anchor:n}=e;return(0,be.createBlock)("core/preformatted",{content:t,anchor:n})}},{type:"raw",isMatch:e=>"PRE"===e.nodeName&&!(1===e.children.length&&"CODE"===e.firstChild.nodeName),schema:e=>{let{phrasingContentSchema:t}=e;return{pre:{children:t}}}}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>(0,be.createBlock)("core/paragraph",e)},{type:"block",blocks:["core/code"],transform:e=>(0,be.createBlock)("core/code",e)}]};var Rm=Mm;const Lm={apiVersion:2,name:"core/preformatted",title:"Preformatted",category:"text",description:"Add text that respects your spacing and tabs, and also allows styling.",textdomain:"default",attributes:{content:{type:"string",source:"html",selector:"pre",default:"",__unstablePreserveWhiteSpace:!0,__experimentalRole:"content"}},supports:{anchor:!0,color:{gradients:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}}},style:"wp-block-preformatted"},{name:Vm}=Lm,Hm={icon:Im,example:{attributes:{content:(0,we.__)("EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\nWindow, very small in the distance, illuminated.\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;")}},transforms:Rm,edit:function(e){let{attributes:t,mergeBlocks:n,setAttributes:o,onRemove:r,style:a}=e;const{content:l}=t,i=(0,Ee.useBlockProps)({style:a});return(0,ye.createElement)(Ee.RichText,gt({tagName:"pre",identifier:"content",preserveWhiteSpace:!0,value:l,onChange:e=>{o({content:e})},onRemove:r,"aria-label":(0,we.__)("Preformatted text"),placeholder:(0,we.__)("Write preformatted text…"),onMerge:n},i,{__unstablePastePlainText:!0}))},save:function(e){let{attributes:t}=e;const{content:n}=t;return(0,ye.createElement)("pre",Ee.useBlockProps.save(),(0,ye.createElement)(Ee.RichText.Content,{value:n}))},merge:(e,t)=>({content:e.content+t.content})};var Am=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M18 8H6c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v4zM4 4v1.5h16V4H4zm0 16h16v-1.5H4V20z"}));const Fm="is-style-solid-color",Dm={value:{type:"string",source:"html",selector:"blockquote",multiline:"p"},citation:{type:"string",source:"html",selector:"cite",default:""},mainColor:{type:"string"},customMainColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}};function Gm(e){if(!e)return;const t=e.match(/border-color:([^;]+)[;]?/);return t&&t[1]?t[1]:void 0}const Um=[{attributes:{...Dm},save(e){let{attributes:t}=e;const{mainColor:n,customMainColor:o,customTextColor:r,textColor:a,value:l,citation:i,className:s}=t;let c,u;if((0,Le.includes)(s,Fm)){const e=(0,Ee.getColorClassName)("background-color",n);c=nt()({"has-background":e||o,[e]:e}),u={backgroundColor:e?void 0:o}}else o&&(u={borderColor:o});const m=(0,Ee.getColorClassName)("color",a),d=nt()({"has-text-color":a||r,[m]:m}),p=m?void 0:{color:r};return(0,ye.createElement)("figure",Ee.useBlockProps.save({className:c,style:u}),(0,ye.createElement)("blockquote",{className:d,style:p},(0,ye.createElement)(Ee.RichText.Content,{value:l,multiline:!0}),!Ee.RichText.isEmpty(i)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"cite",value:i})))},migrate(e){let{className:t,mainColor:n,customMainColor:o,customTextColor:r,...a}=e;const l=(0,Le.includes)(t,Fm);let i;return o&&(i=l?{color:{background:o}}:{border:{color:o}}),r&&i&&(i.color={...i.color,text:r}),{className:t,backgroundColor:l?n:void 0,borderColor:l?void 0:n,textAlign:l?"left":void 0,style:i,...a}}},{attributes:{...Dm,figureStyle:{source:"attribute",selector:"figure",attribute:"style"}},save(e){let{attributes:t}=e;const{mainColor:n,customMainColor:o,textColor:r,customTextColor:a,value:l,citation:i,className:s,figureStyle:c}=t;let u,m;if((0,Le.includes)(s,Fm)){const e=(0,Ee.getColorClassName)("background-color",n);u=nt()({"has-background":e||o,[e]:e}),m={backgroundColor:e?void 0:o}}else if(o)m={borderColor:o};else if(n){m={borderColor:Gm(c)}}const d=(0,Ee.getColorClassName)("color",r),p=(r||a)&&nt()("has-text-color",{[d]:d}),g=d?void 0:{color:a};return(0,ye.createElement)("figure",{className:u,style:m},(0,ye.createElement)("blockquote",{className:p,style:g},(0,ye.createElement)(Ee.RichText.Content,{value:l,multiline:!0}),!Ee.RichText.isEmpty(i)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"cite",value:i})))},migrate(e){let{className:t,figureStyle:n,mainColor:o,customMainColor:r,customTextColor:a,...l}=e;const i=(0,Le.includes)(t,Fm);let s;if(r&&(s=i?{color:{background:r}}:{border:{color:r}}),a&&s&&(s.color={...s.color,text:a}),!i&&o&&n){const e=Gm(n);if(e)return{...l,className:t,style:{border:{color:e}}}}return{className:t,backgroundColor:i?o:void 0,borderColor:i?void 0:o,textAlign:i?"left":void 0,style:s,...l}}},{attributes:Dm,save(e){let{attributes:t}=e;const{mainColor:n,customMainColor:o,textColor:r,customTextColor:a,value:l,citation:i,className:s}=t;let c,u;if((0,Le.includes)(s,Fm))c=(0,Ee.getColorClassName)("background-color",n),c||(u={backgroundColor:o});else if(o)u={borderColor:o};else if(n){const e=(0,Le.get)((0,Ie.select)(Ee.store).getSettings(),["colors"],[]);u={borderColor:(0,Ee.getColorObjectByAttributeValues)(e,n).color}}const m=(0,Ee.getColorClassName)("color",r),d=r||a?nt()("has-text-color",{[m]:m}):void 0,p=m?void 0:{color:a};return(0,ye.createElement)("figure",{className:c,style:u},(0,ye.createElement)("blockquote",{className:d,style:p},(0,ye.createElement)(Ee.RichText.Content,{value:l,multiline:!0}),!Ee.RichText.isEmpty(i)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"cite",value:i})))},migrate(e){let{className:t,mainColor:n,customMainColor:o,customTextColor:r,...a}=e;const l=(0,Le.includes)(t,Fm);let i={};return o&&(i=l?{color:{background:o}}:{border:{color:o}}),r&&i&&(i.color={...i.color,text:r}),{className:t,backgroundColor:l?n:void 0,borderColor:l?void 0:n,textAlign:l?"left":void 0,style:i,...a}}},{attributes:{...Dm},save(e){let{attributes:t}=e;const{value:n,citation:o}=t;return(0,ye.createElement)("blockquote",null,(0,ye.createElement)(Ee.RichText.Content,{value:n,multiline:!0}),!Ee.RichText.isEmpty(o)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"cite",value:o}))}},{attributes:{...Dm,citation:{type:"string",source:"html",selector:"footer"},align:{type:"string",default:"none"}},save(e){let{attributes:t}=e;const{value:n,citation:o,align:r}=t;return(0,ye.createElement)("blockquote",{className:`align${r}`},(0,ye.createElement)(Ee.RichText.Content,{value:n,multiline:!0}),!Ee.RichText.isEmpty(o)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"footer",value:o}))}}];var Om=Um;var qm=function(e){let{attributes:t,setAttributes:n,isSelected:o,insertBlocksAfter:r}=e;const{textAlign:a,citation:l,value:i}=t,s=(0,Ee.useBlockProps)({className:nt()({[`has-text-align-${a}`]:a})}),c=!Ee.RichText.isEmpty(l)||o;return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(Ee.AlignmentControl,{value:a,onChange:e=>{n({textAlign:e})}})),(0,ye.createElement)("figure",s,(0,ye.createElement)("blockquote",null,(0,ye.createElement)(Ee.RichText,{identifier:"value",multiline:!0,value:i,onChange:e=>n({value:e}),"aria-label":(0,we.__)("Pullquote text"),placeholder:(0,we.__)("Add quote"),textAlign:"center"}),c&&(0,ye.createElement)(Ee.RichText,{identifier:"citation",value:l,"aria-label":(0,we.__)("Pullquote citation text"),placeholder:(0,we.__)("Add citation"),onChange:e=>n({citation:e}),className:"wp-block-pullquote__citation",__unstableMobileNoFocusOnMount:!0,textAlign:"center",__unstableOnSplitAtEnd:()=>r((0,be.createBlock)("core/paragraph"))}))))};const $m={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>(0,be.createBlock)("core/pullquote",{value:(0,Tt.toHTMLString)({value:(0,Tt.join)(e.map((e=>{let{content:t}=e;return(0,Tt.create)({html:t})})),"\u2028"),multilineTag:"p"}),anchor:e.anchor})},{type:"block",blocks:["core/heading"],transform:e=>{let{content:t,anchor:n}=e;return(0,be.createBlock)("core/pullquote",{value:`<p>${t}</p>`,anchor:n})}}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>{let{value:t,citation:n}=e;const o=[];return t&&"<p></p>"!==t&&o.push(...(0,Tt.split)((0,Tt.create)({html:t,multilineTag:"p"}),"\u2028").map((e=>(0,be.createBlock)("core/paragraph",{content:(0,Tt.toHTMLString)({value:e})})))),n&&"<p></p>"!==n&&o.push((0,be.createBlock)("core/paragraph",{content:n})),0===o.length?(0,be.createBlock)("core/paragraph",{content:""}):o}},{type:"block",blocks:["core/heading"],transform:e=>{let{value:t,citation:n,...o}=e;if("<p></p>"===t)return(0,be.createBlock)("core/heading",{content:n});const r=(0,Tt.split)((0,Tt.create)({html:t,multilineTag:"p"}),"\u2028"),a=(0,be.createBlock)("core/heading",{content:(0,Tt.toHTMLString)({value:r[0]})});if(!n&&1===r.length)return a;const l=r.slice(1);return[a,(0,be.createBlock)("core/pullquote",{...o,citation:n,value:(0,Tt.toHTMLString)({value:l.length?(0,Tt.join)(r.slice(1),"\u2028"):(0,Tt.create)(),multilineTag:"p"})})]}}]};var Wm=$m;const jm={apiVersion:2,name:"core/pullquote",title:"Pullquote",category:"text",description:"Give special visual emphasis to a quote from your text.",textdomain:"default",attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",__experimentalRole:"content"},citation:{type:"string",source:"html",selector:"cite",default:"",__experimentalRole:"content"},textAlign:{type:"string"}},supports:{anchor:!0,align:["left","right","wide","full"],color:{gradients:!0,background:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0}},editorStyle:"wp-block-pullquote-editor",style:"wp-block-pullquote"},{name:Zm}=jm,Km={icon:Am,example:{attributes:{value:"<p>"+(0,we.__)("One of the hardest things to do in technology is disrupt yourself.")+"</p>",citation:(0,we.__)("Matt Mullenweg")}},transforms:Wm,edit:qm,save:function(e){let{attributes:t}=e;const{textAlign:n,citation:o,value:r}=t,a=!Ee.RichText.isEmpty(o);return(0,ye.createElement)("figure",Ee.useBlockProps.save({className:nt()({[`has-text-align-${n}`]:n})}),(0,ye.createElement)("blockquote",null,(0,ye.createElement)(Ee.RichText.Content,{value:r,multiline:!0}),a&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"cite",value:o})))},deprecated:Om};var Qm=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M18.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z"}));var Jm=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"}));function Ym(e){let{attributes:{query:t,displayLayout:n},setQuery:o,setDisplayLayout:r}=e;const a=(0,ot.useInstanceId)(Ym,"blocks-query-pagination-max-page-input"),l=[{icon:ui,title:(0,we.__)("List view"),onClick:()=>r({type:"list"}),isActive:"list"===(null==n?void 0:n.type)},{icon:mi,title:(0,we.__)("Grid view"),onClick:()=>r({type:"flex",columns:(null==n?void 0:n.columns)||3}),isActive:"flex"===(null==n?void 0:n.type)}];return(0,ye.createElement)(ye.Fragment,null,!t.inherit&&(0,ye.createElement)(ke.ToolbarGroup,null,(0,ye.createElement)(ke.Dropdown,{contentClassName:"block-library-query-toolbar__popover",renderToggle:e=>{let{onToggle:t}=e;return(0,ye.createElement)(ke.ToolbarButton,{icon:Jm,label:(0,we.__)("Display settings"),onClick:t})},renderContent:()=>(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.BaseControl,null,(0,ye.createElement)(ke.__experimentalNumberControl,{__unstableInputWidth:"60px",label:(0,we.__)("Items per Page"),labelPosition:"edge",min:1,max:100,onChange:e=>{isNaN(e)||e<1||e>100||o({perPage:e})},step:"1",value:t.perPage,isDragEnabled:!1})),(0,ye.createElement)(ke.BaseControl,null,(0,ye.createElement)(ke.__experimentalNumberControl,{__unstableInputWidth:"60px",label:(0,we.__)("Offset"),labelPosition:"edge",min:0,max:100,onChange:e=>{isNaN(e)||e<0||e>100||o({offset:e})},step:"1",value:t.offset,isDragEnabled:!1})),(0,ye.createElement)(ke.BaseControl,{id:a,help:(0,we.__)("Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).")},(0,ye.createElement)(ke.__experimentalNumberControl,{id:a,__unstableInputWidth:"60px",label:(0,we.__)("Max page to show"),labelPosition:"edge",min:0,onChange:e=>{isNaN(e)||e<0||o({pages:e})},step:"1",value:t.pages,isDragEnabled:!1})))})),(0,ye.createElement)(ke.ToolbarGroup,{controls:l}))}const Xm=e=>{const t=null==e?void 0:e.reduce(((e,t)=>{const{mapById:n,mapByName:o,names:r}=e;return n[t.id]=t,o[t.name]=t,r.push(t.name),e}),{mapById:{},mapByName:{},names:[]});return{terms:e,...t}};const ed=[{label:(0,we.__)("Include"),value:""},{label:(0,we.__)("Exclude"),value:"exclude"},{label:(0,we.__)("Only"),value:"only"}];function td(e){var t,n;let{attributes:{query:o,displayLayout:r},setQuery:a,setDisplayLayout:l}=e;const{order:i,orderBy:s,author:c,postType:u,sticky:m,inherit:d}=o,[p,g]=(0,ye.useState)(!0),[h,v]=(0,ye.useState)(!0),[b,y]=(0,ye.useState)("post"===u),{postTypesTaxonomiesMap:f,postTypesSelectOptions:_}=(()=>{const{postTypes:e}=(0,Ie.useSelect)((e=>{var t;const{getPostTypes:n}=e(Dt.store),o=["attachment"];return{postTypes:null===(t=n({per_page:-1}))||void 0===t?void 0:t.filter((e=>{let{viewable:t,slug:n}=e;return t&&!o.includes(n)}))}}),[]);return{postTypesTaxonomiesMap:(0,ye.useMemo)((()=>{if(null!=e&&e.length)return e.reduce(((e,t)=>(e[t.slug]=t.taxonomies,e)),{})}),[e]),postTypesSelectOptions:(0,ye.useMemo)((()=>(e||[]).map((e=>{let{labels:t,slug:n}=e;return{label:t.singular_name,value:n}}))),[e])}})(),{authorList:k,categories:w,tags:E}=(0,Ie.useSelect)((e=>{const{getEntityRecords:t}=e(Dt.store),n={per_page:100},o=t("taxonomy","category",n),r=t("taxonomy","post_tag",n);return{categories:Xm(o),tags:Xm(r),authorList:t("root","user",{per_page:-1})}}),[]);(0,ye.useEffect)((()=>{if(!f)return;const e=f[u];g(e.includes("category")),v(e.includes("post_tag"))}),[u,f]),(0,ye.useEffect)((()=>{y("post"===u)}),[u]);const C=(e,t)=>n=>{const o=Array.from(n.reduce(((t,n)=>{const o=((e,t)=>{var n;const o=(null==t?void 0:t.id)||(null===(n=e[t])||void 0===n?void 0:n.id);if(o)return o;const r=t.toLocaleLowerCase();for(const t in e)if(t.toLocaleLowerCase()===r)return e[t].id})(e.mapByName,n);return o&&t.add(o),t}),new Set));a({[t]:o})},x=C(w,"categoryIds"),S=C(E,"tagIds"),[B,T]=(0,ye.useState)(o.search),N=(0,ye.useCallback)((0,Le.debounce)((()=>{o.search!==B&&a({search:B})}),250),[B,o.search]);(0,ye.useEffect)((()=>(N(),N.cancel)),[B,N]);const z=e=>{const t={category:{queryProp:"categoryIds",terms:w},post_tag:{queryProp:"tagIds",terms:E}}[e];return(o[t.queryProp]||[]).reduce(((e,n)=>{const o=t.terms.mapById[n];return o&&e.push({id:n,value:o.name}),e}),[])};return(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Inherit query from template"),help:(0,we.__)("Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently."),checked:!!d,onChange:e=>a({inherit:!!e})}),!d&&(0,ye.createElement)(ke.SelectControl,{options:_,value:u,label:(0,we.__)("Post Type"),onChange:e=>{const t={postType:e};f[e].includes("category")||(t.categoryIds=[]),f[e].includes("post_tag")||(t.tagIds=[]),"post"!==e&&(t.sticky=""),a(t)},help:(0,we.__)('WordPress contains different types of content and they are divided into collections called "Post Types". By default there are a few different ones such as blog posts and pages, but plugins could add more.')}),"flex"===(null==r?void 0:r.type)&&(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.RangeControl,{label:(0,we.__)("Columns"),value:r.columns,onChange:e=>l({columns:e}),min:2,max:Math.max(6,r.columns)}),r.columns>6&&(0,ye.createElement)(ke.Notice,{status:"warning",isDismissible:!1},(0,we.__)("This column count exceeds the recommended amount and may cause visual breakage."))),!d&&(0,ye.createElement)(ke.QueryControls,{order:i,orderBy:s,onOrderChange:e=>a({order:e}),onOrderByChange:e=>a({orderBy:e})}),b&&(0,ye.createElement)(ke.SelectControl,{label:(0,we.__)("Sticky posts"),options:ed,value:m,onChange:e=>a({sticky:e}),help:(0,we.__)('Blog posts can be "stickied", a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.')})),!d&&(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Filters")},p&&(null==w||null===(t=w.terms)||void 0===t?void 0:t.length)>0&&(0,ye.createElement)(ke.FormTokenField,{label:(0,we.__)("Categories"),value:z("category"),suggestions:w.names,onChange:x}),h&&(null==E||null===(n=E.terms)||void 0===n?void 0:n.length)>0&&(0,ye.createElement)(ke.FormTokenField,{label:(0,we.__)("Tags"),value:z("post_tag"),suggestions:E.names,onChange:S}),(0,ye.createElement)(ke.QueryControls,{selectedAuthorId:c,authorList:k,onAuthorChange:e=>a({author:""!==e?+e:void 0})}),(0,ye.createElement)(ke.TextControl,{label:(0,we.__)("Keyword"),value:B,onChange:T})))}var nd=e=>{var t;let{clientId:n,name:o,attributes:r,setAttributes:a}=e;const{blockType:l,defaultVariation:i,scopeVariations:s,allVariations:c}=(0,Ie.useSelect)((e=>{const{getBlockVariations:t,getBlockType:n,getDefaultBlockVariation:r}=e(be.store);return{blockType:n(o),defaultVariation:r(o,"block"),scopeVariations:t(o,"block"),allVariations:t(o)}}),[o]),{replaceInnerBlocks:u}=(0,Ie.useDispatch)(Ee.store),m=(0,Ee.useBlockProps)(),d=(0,Ee.__experimentalGetMatchingVariation)(r,c),p=(null==d?void 0:d.icon)||(null==l||null===(t=l.icon)||void 0===t?void 0:t.src),g=(null==d?void 0:d.title)||(null==l?void 0:l.title);return(0,ye.createElement)("div",m,(0,ye.createElement)(Ee.__experimentalBlockVariationPicker,{icon:p,label:g,variations:s,onSelect:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;e.attributes&&a(e.attributes),e.innerBlocks&&u(n,(0,be.createBlocksFromInnerBlocksTemplate)(e.innerBlocks),!1)}}))};const od=[["core/post-template"]];function rd(e){let{attributes:t,setAttributes:n}=e;const{queryId:o,query:r,displayLayout:a,tagName:l="div",layout:i={}}=t,{__unstableMarkNextChangeAsNotPersistent:s}=(0,Ie.useDispatch)(Ee.store),c=(0,ot.useInstanceId)(rd),{themeSupportsLayout:u}=(0,Ie.useSelect)((e=>{var t;const{getSettings:n}=e(Ee.store);return{themeSupportsLayout:null===(t=n())||void 0===t?void 0:t.supportsLayout}}),[]),m=(0,Ee.useSetting)("layout")||{},d=i&&i.inherit?m:i,p=(0,Ee.useBlockProps)(),g=(0,Ee.useInnerBlocksProps)(p,{template:od,__experimentalLayout:u?d:void 0}),{postsPerPage:h}=(0,Ie.useSelect)((e=>{const{getSettings:t}=e(Ee.store);return{postsPerPage:+t().postsPerPage||3}}),[]);(0,ye.useEffect)((()=>{const e={};!r.perPage&&h&&(e.perPage=h),Object.keys(e).length&&(s(),v(e))}),[r.perPage]),(0,ye.useEffect)((()=>{o||(s(),n({queryId:c}))}),[o,c]);const v=e=>n({query:{...r,...e}}),b=e=>n({displayLayout:{...a,...e}});return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(td,{attributes:t,setQuery:v,setDisplayLayout:b}),(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(Ym,{attributes:t,setQuery:v,setDisplayLayout:b})),(0,ye.createElement)(Ee.InspectorControls,{__experimentalGroup:"advanced"},(0,ye.createElement)(ke.SelectControl,{label:(0,we.__)("HTML element"),options:[{label:(0,we.__)("Default (<div>)"),value:"div"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<aside>",value:"aside"}],value:l,onChange:e=>n({tagName:e})})),(0,ye.createElement)(l,g))}function ad(e){const{clientId:t,name:n}=e,o=(0,Ee.useBlockProps)(),{replaceBlock:r,selectBlock:a}=(0,Ie.useDispatch)(Ee.store);return(0,ye.createElement)("div",o,(0,ye.createElement)(Ee.__experimentalBlockPatternSetup,{blockName:n,clientId:t,startBlankComponent:(0,ye.createElement)(nd,e),onBlockPatternSelect:e=>{const n=e.map((e=>(0,be.cloneBlock)(e))),o=(e=>{const t=[...e];for(;t.length>0;){var n;const e=t.shift();if("core/query"===e.name)return e.clientId;null===(n=e.innerBlocks)||void 0===n||n.forEach((e=>{t.push(e)}))}})(n);r(t,n),o&&a(o)}}))}var ld=e=>{const{clientId:t}=e,n=(0,Ie.useSelect)((e=>!!e(Ee.store).getBlocks(t).length),[t])?rd:ad;return(0,ye.createElement)(n,e)};const id=(0,ye.createElement)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},(0,ye.createElement)(ke.Path,{d:"M41 9H7v3h34V9zm-22 5H7v1h12v-1zM7 26h12v1H7v-1zm34-5H7v3h34v-3zM7 38h12v1H7v-1zm34-5H7v3h34v-3z"})),sd=(0,ye.createElement)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},(0,ye.createElement)(ke.Path,{d:"M41 9H7v3h34V9zm-4 5H7v1h30v-1zm4 3H7v1h34v-1zM7 20h30v1H7v-1zm0 12h30v1H7v-1zm34 3H7v1h34v-1zM7 38h30v1H7v-1zm34-11H7v3h34v-3z"})),cd=(0,ye.createElement)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},(0,ye.createElement)(ke.Path,{d:"M41 9H7v3h34V9zm-22 5H7v1h12v-1zm22 3H7v1h34v-1zM7 20h34v1H7v-1zm0 12h12v1H7v-1zm34 3H7v1h34v-1zM7 38h34v1H7v-1zm34-11H7v3h34v-3z"})),ud=(0,ye.createElement)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},(0,ye.createElement)(ke.Path,{d:"M7 9h34v6H7V9zm12 8H7v1h12v-1zm18 3H7v1h30v-1zm0 18H7v1h30v-1zM7 35h12v1H7v-1zm34-8H7v6h34v-6z"})),md={query:{perPage:3,pages:0,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!1}};var dd=[{name:"posts-list",title:(0,we.__)("Posts List"),description:(0,we.__)("Display a list of your most recent posts, excluding sticky posts."),icon:li,attributes:{query:{perPage:4,pages:1,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",sticky:"exclude",inherit:!1}},scope:["inserter"]},{name:"title-date",title:(0,we.__)("Title & Date"),icon:id,attributes:{...md},innerBlocks:[["core/post-template",{},[["core/post-title"],["core/post-date"]]],["core/query-pagination"]],scope:["block"]},{name:"title-excerpt",title:(0,we.__)("Title & Excerpt"),icon:sd,attributes:{...md},innerBlocks:[["core/post-template",{},[["core/post-title"],["core/post-excerpt"]]],["core/query-pagination"]],scope:["block"]},{name:"title-date-excerpt",title:(0,we.__)("Title, Date, & Excerpt"),icon:cd,attributes:{...md},innerBlocks:[["core/post-template",{},[["core/post-title"],["core/post-date"],["core/post-excerpt"]]],["core/query-pagination"]],scope:["block"]},{name:"image-date-title",title:(0,we.__)("Image, Date, & Title"),icon:ud,attributes:{...md},innerBlocks:[["core/post-template",{},[["core/post-featured-image"],["core/post-date"],["core/post-title"]]],["core/query-pagination"]],scope:["block"]}];const pd=[{attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0}},layout:{type:"object",default:{type:"list"}}},supports:{html:!1},migrate:e=>({...(0,Le.omit)(e,["layout"]),displayLayout:e.layout}),save:()=>(0,ye.createElement)(Ee.InnerBlocks.Content,null)}];var gd=pd;const hd=e=>{let{attributes:{query:{postType:t}={}}={}}=e;if(!t)return null;const n=(0,Dr.addQueryArgs)("post-new.php",{post_type:t});return(0,ye.createElement)("div",{className:"wp-block-query__create-new-link"},(0,ye.createInterpolateElement)((0,we.__)("<a>Create a new post</a> for this feed."),{a:(0,ye.createElement)("a",{href:n})}))};var vd=(0,ot.createHigherOrderComponent)((e=>t=>{const{name:n,isSelected:o}=t;return"core/query"===n&&o?(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(hd,t)),(0,ye.createElement)(e,gt({key:"edit"},t))):(0,ye.createElement)(e,gt({key:"edit"},t))}),"withInspectorControls");const bd={apiVersion:2,name:"core/query",title:"Query Loop",category:"theme",description:"An advanced block that allows displaying post types based on different query parameters and visual configurations.",textdomain:"default",attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0}},tagName:{type:"string",default:"div"},displayLayout:{type:"object",default:{type:"list"}}},providesContext:{queryId:"queryId",query:"query",displayLayout:"displayLayout"},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},__experimentalLayout:!0},editorStyle:"wp-block-query-editor"},{name:yd}=bd,fd={icon:Qm,edit:ld,save:function(e){let{attributes:{tagName:t="div"}}=e;const n=Ee.useBlockProps.save(),o=Ee.useInnerBlocksProps.save(n);return(0,ye.createElement)(t,o)},variations:dd,deprecated:gd};(0,ja.addFilter)("editor.BlockEdit","core/query",vd);var _d=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Rect,{x:"4",y:"10.5",width:"6",height:"3",rx:"1.5",fill:"#000"}),(0,ye.createElement)(fe.Rect,{x:"12",y:"10.5",width:"3",height:"3",rx:"1.5",fill:"#000"}),(0,ye.createElement)(fe.Rect,{x:"17",y:"10.5",width:"3",height:"3",rx:"1.5",fill:"#000"}));function kd(e){let{value:t,onChange:n}=e;return(0,ye.createElement)(ke.__experimentalToggleGroupControl,{label:(0,we.__)("Arrow"),value:t,onChange:n,help:(0,we.__)("A decorative arrow appended to the next and previous page link."),isBlock:!0},(0,ye.createElement)(ke.__experimentalToggleGroupControlOption,{value:"none",label:(0,we._x)("None","Arrow option for Query Pagination Next/Previous blocks")}),(0,ye.createElement)(ke.__experimentalToggleGroupControlOption,{value:"arrow",label:(0,we._x)("Arrow","Arrow option for Query Pagination Next/Previous blocks")}),(0,ye.createElement)(ke.__experimentalToggleGroupControlOption,{value:"chevron",label:(0,we._x)("Chevron","Arrow option for Query Pagination Next/Previous blocks")}))}const wd=[["core/query-pagination-previous"],["core/query-pagination-numbers"],["core/query-pagination-next"]];var Ed=[{save:()=>(0,ye.createElement)("div",Ee.useBlockProps.save(),(0,ye.createElement)(Ee.InnerBlocks.Content,null))}];const Cd={apiVersion:2,name:"core/query-pagination",title:"Pagination",category:"design",parent:["core/query"],description:"Displays a paginated navigation to next/previous set of posts, when applicable.",textdomain:"default",attributes:{paginationArrow:{type:"string",default:"none"}},usesContext:["queryId","query"],providesContext:{paginationArrow:"paginationArrow"},supports:{align:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0},__experimentalLayout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}}},editorStyle:"wp-block-query-pagination-editor",style:"wp-block-query-pagination"},{name:xd}=Cd,Sd={icon:_d,edit:function(e){let{attributes:{paginationArrow:t,layout:n},setAttributes:o,clientId:r,name:a}=e;const l=n||(e=>{const t=(0,be.getBlockSupport)(e,"__experimentalLayout");return null==t?void 0:t.default})(a),i=(0,Ie.useSelect)((e=>{const{getBlocks:t}=e(Ee.store),n=t(r);return null==n?void 0:n.find((e=>["core/query-pagination-next","core/query-pagination-previous"].includes(e.name)))}),[]),s=(0,Ee.useBlockProps)(),c=(0,Ee.useInnerBlocksProps)(s,{template:wd,allowedBlocks:["core/query-pagination-previous","core/query-pagination-numbers","core/query-pagination-next"],__experimentalLayout:l});return(0,ye.createElement)(ye.Fragment,null,i&&(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Settings")},(0,ye.createElement)(kd,{value:t,onChange:e=>{o({paginationArrow:e})}}))),(0,ye.createElement)("div",c))},save:function(){return(0,ye.createElement)(Ee.InnerBlocks.Content,null)},deprecated:Ed};var Bd=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Rect,{x:"6",y:"10.5",width:"3",height:"3",rx:"1.5",fill:"#000"}),(0,ye.createElement)(fe.Rect,{x:"11",y:"10.5",width:"3",height:"3",rx:"1.5",fill:"#000"}),(0,ye.createElement)(fe.Path,{d:"M16.5 9.5L19 12l-2.5 2.5",stroke:"#1E1E1E",strokeWidth:"1.5"}));const Td={none:"",arrow:"→",chevron:"»"};const Nd={apiVersion:2,name:"core/query-pagination-next",title:"Next Page",category:"design",parent:["core/query-pagination"],description:"Displays the next posts page link.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["queryId","query","paginationArrow"],supports:{reusable:!1,html:!1,color:{gradients:!0,text:!1},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}}}},{name:zd}=Nd,Pd={icon:Bd,edit:function(e){let{attributes:{label:t},setAttributes:n,context:{paginationArrow:o}}=e;const r=Td[o];return(0,ye.createElement)("a",gt({href:"#pagination-next-pseudo-link",onClick:e=>e.preventDefault()},(0,Ee.useBlockProps)()),(0,ye.createElement)(Ee.PlainText,{__experimentalVersion:2,tagName:"span","aria-label":(0,we.__)("Next page link"),placeholder:(0,we.__)("Next Page"),value:t,onChange:e=>n({label:e})}),r&&(0,ye.createElement)("span",{className:`wp-block-query-pagination-next-arrow is-arrow-${o}`},r))}};var Id=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Rect,{x:"4",y:"10.5",width:"6",height:"3",rx:"1.5",fill:"#000"}),(0,ye.createElement)(fe.Path,{d:"M13.5 14v-4l-1.5.5",stroke:"#1E1E1E"}),(0,ye.createElement)(fe.Path,{d:"M19.266 9.805c-.473-.611-1.22-.51-1.702-.367a3.854 3.854 0 00-.718.307l.13 1.082c.192-.17.47-.422.782-.515.34-.1.578.025.668.141.21.27-.034.835-.16 1.055-.49.85-.93 1.594-1.45 2.492H19.5v-1h-.914c.277-.574.814-1.443.914-2.106.052-.343.02-.762-.234-1.09z",fill:"#1E1E1E"}));const Md=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"a",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return(0,ye.createElement)(t,{className:`page-numbers ${n}`},e)};const Rd={apiVersion:2,name:"core/query-pagination-numbers",title:"Page Numbers",category:"design",parent:["core/query-pagination"],description:"Displays a list of page numbers for pagination",textdomain:"default",usesContext:["queryId","query"],supports:{reusable:!1,html:!1},editorStyle:"query-pagination-numbers-editor"},{name:Ld}=Rd,Vd={icon:Id,edit:function(){const e=(0,ye.createElement)(ye.Fragment,null,Md(1),Md(2),Md(3,"span","current"),Md(4),Md(5),Md("...","span","dots"),Md(8));return(0,ye.createElement)("div",(0,Ee.useBlockProps)(),e)}};var Hd=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Rect,{x:"18",y:"13.5",width:"3",height:"3",rx:"1.5",transform:"rotate(-180 18 13.5)",fill:"#000"}),(0,ye.createElement)(fe.Rect,{x:"13",y:"13.5",width:"3",height:"3",rx:"1.5",transform:"rotate(-180 13 13.5)",fill:"#000"}),(0,ye.createElement)(fe.Path,{d:"M7.5 14.5L5 12l2.5-2.5",stroke:"#1E1E1E",strokeWidth:"1.5"}));const Ad={none:"",arrow:"←",chevron:"«"};const Fd={apiVersion:2,name:"core/query-pagination-previous",title:"Previous Page",category:"design",parent:["core/query-pagination"],description:"Displays the previous posts page link.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["queryId","query","paginationArrow"],supports:{reusable:!1,html:!1,color:{gradients:!0,text:!1},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}}}},{name:Dd}=Fd,Gd={icon:Hd,edit:function(e){let{attributes:{label:t},setAttributes:n,context:{paginationArrow:o}}=e;const r=Ad[o];return(0,ye.createElement)("a",gt({href:"#pagination-previous-pseudo-link",onClick:e=>e.preventDefault()},(0,Ee.useBlockProps)()),r&&(0,ye.createElement)("span",{className:`wp-block-query-pagination-previous-arrow is-arrow-${o}`},r),(0,ye.createElement)(Ee.PlainText,{__experimentalVersion:2,tagName:"span","aria-label":(0,we.__)("Previous page link"),placeholder:(0,we.__)("Previous Page"),value:t,onChange:e=>n({label:e})}))}},Ud=["archive"];var Od=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{stroke:"#1E1E1E",strokeWidth:"1.5",d:"M4 19.25h9M4 15.25h16"}),(0,ye.createElement)(fe.Path,{d:"M8.994 10.103H6.08L5.417 12H4l2.846-8h1.383l2.845 8H9.657l-.663-1.897zm-.457-1.28l-.994-2.857-1.006 2.857h2z",fill:"#1E1E1E"}));const qd=[{isDefault:!0,name:"archive-title",title:(0,we.__)("Archive Title"),description:(0,we.__)("Display the archive title based on the queried object."),icon:Od,attributes:{type:"archive"},scope:["inserter"]}];qd.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.type===t.type)}));var $d=qd;var Wd=[{attributes:{type:{type:"string"},textAlign:{type:"string"},level:{type:"number",default:1}},supports:{align:["wide","full"],html:!1,color:{gradients:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0}},save:()=>null,migrate:lt,isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}}];const jd={apiVersion:2,name:"core/query-title",title:"Query Title",category:"theme",description:"Display the query title.",textdomain:"default",attributes:{type:{type:"string"},textAlign:{type:"string"},level:{type:"number",default:1}},supports:{align:["wide","full"],html:!1,color:{gradients:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}}},editorStyle:"wp-block-query-title-editor"},{name:Zd}=jd,Kd={edit:function(e){let{attributes:{type:t,level:n,textAlign:o},setAttributes:r}=e;const a=`h${n}`,l=(0,Ee.useBlockProps)({className:nt()({[`has-text-align-${o}`]:o,"wp-block-query-title__placeholder":"archive"===t})});if(!Ud.includes(t))return(0,ye.createElement)("div",l,(0,ye.createElement)(Ee.Warning,null,(0,we.__)("Provided type is not supported.")));let i;return"archive"===t&&(i=(0,ye.createElement)(a,l,(0,we.__)("Archive title"))),(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(wl,{selectedLevel:n,onChange:e=>r({level:e})}),(0,ye.createElement)(Ee.AlignmentControl,{value:o,onChange:e=>{r({textAlign:e})}})),i)},variations:$d,deprecated:Wd};var Qd=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M13 6v6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H13zm-9 6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H4v6z"}));const Jd={value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:""},citation:{type:"string",source:"html",selector:"cite",default:""},align:{type:"string"}},Yd=[{attributes:Jd,save(e){let{attributes:t}=e;const{align:n,value:o,citation:r}=t;return(0,ye.createElement)("blockquote",{style:{textAlign:n||null}},(0,ye.createElement)(Ee.RichText.Content,{multiline:!0,value:o}),!Ee.RichText.isEmpty(r)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"cite",value:r}))}},{attributes:{...Jd,style:{type:"number",default:1}},migrate:e=>2===e.style?{...(0,Le.omit)(e,["style"]),className:e.className?e.className+" is-style-large":"is-style-large"}:e,save(e){let{attributes:t}=e;const{align:n,value:o,citation:r,style:a}=t;return(0,ye.createElement)("blockquote",{className:2===a?"is-large":"",style:{textAlign:n||null}},(0,ye.createElement)(Ee.RichText.Content,{multiline:!0,value:o}),!Ee.RichText.isEmpty(r)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"cite",value:r}))}},{attributes:{...Jd,citation:{type:"string",source:"html",selector:"footer",default:""},style:{type:"number",default:1}},migrate:e=>isNaN(parseInt(e.style))?e:{...(0,Le.omit)(e,["style"])},save(e){let{attributes:t}=e;const{align:n,value:o,citation:r,style:a}=t;return(0,ye.createElement)("blockquote",{className:`blocks-quote-style-${a}`,style:{textAlign:n||null}},(0,ye.createElement)(Ee.RichText.Content,{multiline:!0,value:o}),!Ee.RichText.isEmpty(r)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"footer",value:r}))}}];var Xd=Yd;const ep="web"===ye.Platform.OS;const tp={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>(0,be.createBlock)("core/quote",{value:(0,Tt.toHTMLString)({value:(0,Tt.join)(e.map((e=>{let{content:t}=e;return(0,Tt.create)({html:t})})),"\u2028"),multilineTag:"p"}),anchor:e.anchor})},{type:"block",blocks:["core/heading"],transform:e=>{let{content:t,anchor:n}=e;return(0,be.createBlock)("core/quote",{value:`<p>${t}</p>`,anchor:n})}},{type:"block",blocks:["core/pullquote"],transform:e=>{let{value:t,citation:n,anchor:o}=e;return(0,be.createBlock)("core/quote",{value:t,citation:n,anchor:o})}},{type:"prefix",prefix:">",transform:e=>(0,be.createBlock)("core/quote",{value:`<p>${e}</p>`})},{type:"raw",isMatch:e=>{const t=(()=>{let e=!1;return t=>"P"===t.nodeName||(e||"CITE"!==t.nodeName?void 0:(e=!0,!0))})();return"BLOCKQUOTE"===e.nodeName&&Array.from(e.childNodes).every(t)},schema:e=>{let{phrasingContentSchema:t}=e;return{blockquote:{children:{p:{children:t},cite:{children:t}}}}}}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>{let{value:t,citation:n}=e;const o=[];return t&&"<p></p>"!==t&&o.push(...(0,Tt.split)((0,Tt.create)({html:t,multilineTag:"p"}),"\u2028").map((e=>(0,be.createBlock)("core/paragraph",{content:(0,Tt.toHTMLString)({value:e})})))),n&&"<p></p>"!==n&&o.push((0,be.createBlock)("core/paragraph",{content:n})),0===o.length?(0,be.createBlock)("core/paragraph",{content:""}):o}},{type:"block",blocks:["core/heading"],transform:e=>{let{value:t,citation:n,...o}=e;if("<p></p>"===t)return(0,be.createBlock)("core/heading",{content:n});const r=(0,Tt.split)((0,Tt.create)({html:t,multilineTag:"p"}),"\u2028"),a=(0,be.createBlock)("core/heading",{content:(0,Tt.toHTMLString)({value:r[0]})});if(!n&&1===r.length)return a;const l=r.slice(1);return[a,(0,be.createBlock)("core/quote",{...o,citation:n,value:(0,Tt.toHTMLString)({value:l.length?(0,Tt.join)(r.slice(1),"\u2028"):(0,Tt.create)(),multilineTag:"p"})})]}},{type:"block",blocks:["core/pullquote"],transform:e=>{let{value:t,citation:n,anchor:o}=e;return(0,be.createBlock)("core/pullquote",{value:t,citation:n,anchor:o})}}]};var np=tp;const op={apiVersion:2,name:"core/quote",title:"Quote",category:"text",description:'Give quoted text visual emphasis. "In quoting others, we cite ourselves." — Julio Cortázar',keywords:["blockquote","cite"],textdomain:"default",attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:"",__experimentalRole:"content"},citation:{type:"string",source:"html",selector:"cite",default:"",__experimentalRole:"content"},align:{type:"string"}},supports:{anchor:!0,__experimentalSlashInserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0}}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"plain",label:"Plain"},{name:"large",label:"Large"}],editorStyle:"wp-block-quote-editor",style:"wp-block-quote"},{name:rp}=op,ap={icon:Qd,example:{attributes:{value:"<p>"+(0,we.__)("In quoting others, we cite ourselves.")+"</p>",citation:"Julio Cortázar",className:"is-style-large"}},transforms:np,edit:function(e){let{attributes:t,setAttributes:n,isSelected:o,mergeBlocks:r,onReplace:a,className:l,insertBlocksAfter:i,style:s}=e;const{align:c,value:u,citation:m}=t,d=(0,Ee.useBlockProps)({className:nt()(l,{[`has-text-align-${c}`]:c}),style:s});return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(Ee.AlignmentControl,{value:c,onChange:e=>{n({align:e})}})),(0,ye.createElement)(ke.BlockQuotation,d,(0,ye.createElement)(Ee.RichText,{identifier:"value",multiline:!0,value:u,onChange:e=>n({value:e}),onMerge:r,onRemove:e=>{const t=!m||0===m.length;!e&&t&&a([])},"aria-label":(0,we.__)("Quote text"),placeholder:(0,we.__)("Add quote"),onReplace:a,onSplit:e=>(0,be.createBlock)("core/quote",{...t,value:e}),__unstableOnSplitMiddle:()=>(0,be.createBlock)("core/paragraph"),textAlign:c}),(!Ee.RichText.isEmpty(m)||o)&&(0,ye.createElement)(Ee.RichText,{identifier:"citation",tagName:ep?"cite":void 0,style:{display:"block"},value:m,onChange:e=>n({citation:e}),__unstableMobileNoFocusOnMount:!0,"aria-label":(0,we.__)("Quote citation text"),placeholder:(0,we.__)("Add citation"),className:"wp-block-quote__citation",textAlign:c,__unstableOnSplitAtEnd:()=>i((0,be.createBlock)("core/paragraph"))})))},save:function(e){let{attributes:t}=e;const{align:n,value:o,citation:r}=t,a=nt()({[`has-text-align-${n}`]:n});return(0,ye.createElement)("blockquote",Ee.useBlockProps.save({className:a}),(0,ye.createElement)(Ee.RichText.Content,{multiline:!0,value:o}),!Ee.RichText.isEmpty(r)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"cite",value:r}))},merge(e,t){let{value:n,citation:o}=t;return o||(o=e.citation),n&&"<p></p>"!==n?{...e,value:e.value+n,citation:o}:{...e,citation:o}},deprecated:Xd};var lp=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.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"})),ip=window.wp.reusableBlocks;var sp=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z"}));const cp={apiVersion:2,name:"core/block",title:"Reusable block",category:"reusable",description:"Create and save content to reuse across your site. Update the block, and the changes apply everywhere it’s used.",textdomain:"default",attributes:{ref:{type:"number"}},supports:{customClassName:!1,html:!1,inserter:!1},editorStyle:"wp-block-editor"},{name:up}=cp,mp={edit:function(e){let{attributes:{ref:t},clientId:n}=e;const[o,r]=(0,Ee.__experimentalUseNoRecursiveRenders)(t),{isMissing:a,hasResolved:l}=(0,Ie.useSelect)((e=>{const n=e(Dt.store).getEntityRecord("postType","wp_block",t),o=e(Dt.store).hasFinishedResolution("getEntityRecord",["postType","wp_block",t]);return{hasResolved:o,isMissing:o&&!n}}),[t,n]),{__experimentalConvertBlockToStatic:i}=(0,Ie.useDispatch)(ip.store),[s,c,u]=(0,Dt.useEntityBlockEditor)("postType","wp_block",{id:t}),[m,d]=(0,Dt.useEntityProp)("postType","wp_block","title",t),p=(0,Ee.useBlockProps)(),g=(0,Ee.useInnerBlocksProps)({},{value:s,onInput:c,onChange:u,renderAppender:null!=s&&s.length?void 0:Ee.InnerBlocks.ButtonBlockAppender});return o?(0,ye.createElement)("div",p,(0,ye.createElement)(Ee.Warning,null,(0,we.__)("Block cannot be rendered inside itself."))):a?(0,ye.createElement)("div",p,(0,ye.createElement)(Ee.Warning,null,(0,we.__)("Block has been deleted or is unavailable."))):l?(0,ye.createElement)(r,null,(0,ye.createElement)("div",p,(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(ke.ToolbarGroup,null,(0,ye.createElement)(ke.ToolbarButton,{onClick:()=>i(n),label:(0,we.__)("Convert to regular blocks"),icon:sp,showTooltip:!0}))),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,null,(0,ye.createElement)(ke.TextControl,{label:(0,we.__)("Name"),value:m,onChange:d}))),(0,ye.createElement)(Ee.__experimentalBlockContentOverlay,{clientId:n,wrapperProps:g,className:"block-library-block__reusable-block-container"}))):(0,ye.createElement)("div",p,(0,ye.createElement)(ke.Placeholder,null,(0,ye.createElement)(ke.Spinner,null)))},icon:lp};var dp=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M5 10.2h-.8v1.5H5c1.9 0 3.8.8 5.1 2.1 1.4 1.4 2.1 3.2 2.1 5.1v.8h1.5V19c0-2.3-.9-4.5-2.6-6.2-1.6-1.6-3.8-2.6-6.1-2.6zm10.4-1.6C12.6 5.8 8.9 4.2 5 4.2h-.8v1.5H5c3.5 0 6.9 1.4 9.4 3.9s3.9 5.8 3.9 9.4v.8h1.5V19c0-3.9-1.6-7.6-4.4-10.4zM4 20h3v-3H4v3z"}));const pp={apiVersion:2,name:"core/rss",title:"RSS",category:"widgets",description:"Display entries from any RSS or Atom feed.",keywords:["atom","feed"],textdomain:"default",attributes:{columns:{type:"number",default:2},blockLayout:{type:"string",default:"list"},feedURL:{type:"string",default:""},itemsToShow:{type:"number",default:5},displayExcerpt:{type:"boolean",default:!1},displayAuthor:{type:"boolean",default:!1},displayDate:{type:"boolean",default:!1},excerptLength:{type:"number",default:55}},supports:{align:!0,html:!1},editorStyle:"wp-block-rss-editor",style:"wp-block-rss"},{name:gp}=pp,hp={icon:dp,example:{attributes:{feedURL:"https://wordpress.org"}},edit:function(e){let{attributes:t,setAttributes:n}=e;const[o,r]=(0,ye.useState)(!t.feedURL),{blockLayout:a,columns:l,displayAuthor:i,displayDate:s,displayExcerpt:c,excerptLength:u,feedURL:m,itemsToShow:d}=t;function p(e){return()=>{const o=t[e];n({[e]:!o})}}const g=(0,Ee.useBlockProps)();if(o)return(0,ye.createElement)("div",g,(0,ye.createElement)(ke.Placeholder,{icon:dp,label:"RSS"},(0,ye.createElement)("form",{onSubmit:function(e){e.preventDefault(),m&&r(!1)},className:"wp-block-rss__placeholder-form"},(0,ye.createElement)(ke.TextControl,{placeholder:(0,we.__)("Enter URL here…"),value:m,onChange:e=>n({feedURL:e}),className:"wp-block-rss__placeholder-input"}),(0,ye.createElement)(ke.Button,{variant:"primary",type:"submit"},(0,we.__)("Use URL")))));const h=[{icon:$o,title:(0,we.__)("Edit RSS URL"),onClick:()=>r(!0)},{icon:ui,title:(0,we.__)("List view"),onClick:()=>n({blockLayout:"list"}),isActive:"list"===a},{icon:mi,title:(0,we.__)("Grid view"),onClick:()=>n({blockLayout:"grid"}),isActive:"grid"===a}];return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(ke.ToolbarGroup,{controls:h})),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("RSS settings")},(0,ye.createElement)(ke.RangeControl,{label:(0,we.__)("Number of items"),value:d,onChange:e=>n({itemsToShow:e}),min:1,max:10,required:!0}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Display author"),checked:i,onChange:p("displayAuthor")}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Display date"),checked:s,onChange:p("displayDate")}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Display excerpt"),checked:c,onChange:p("displayExcerpt")}),c&&(0,ye.createElement)(ke.RangeControl,{label:(0,we.__)("Max number of words in excerpt"),value:u,onChange:e=>n({excerptLength:e}),min:10,max:100,required:!0}),"grid"===a&&(0,ye.createElement)(ke.RangeControl,{label:(0,we.__)("Columns"),value:l,onChange:e=>n({columns:e}),min:2,max:6,required:!0}))),(0,ye.createElement)("div",g,(0,ye.createElement)(ke.Disabled,null,(0,ye.createElement)(xe(),{block:"core/rss",attributes:t}))))}},vp=(0,ye.createElement)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(ke.Rect,{x:"7",y:"10",width:"10",height:"4",rx:"1",fill:"currentColor"})),bp=(0,ye.createElement)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(ke.Rect,{x:"4.75",y:"15.25",width:"6.5",height:"9.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),(0,ye.createElement)(ke.Rect,{x:"16",y:"10",width:"4",height:"4",rx:"1",fill:"currentColor"})),yp=(0,ye.createElement)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(ke.Rect,{x:"4.75",y:"15.25",width:"6.5",height:"14.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),(0,ye.createElement)(ke.Rect,{x:"14",y:"10",width:"4",height:"4",rx:"1",fill:"currentColor"})),fp=(0,ye.createElement)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(ke.Rect,{x:"4.75",y:"15.25",width:"6.5",height:"14.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",fill:"none",strokeWidth:"1.5"})),_p=(0,ye.createElement)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(ke.Rect,{x:"4.75",y:"7.75",width:"14.5",height:"8.5",rx:"1.25",stroke:"currentColor",fill:"none",strokeWidth:"1.5"}),(0,ye.createElement)(ke.Rect,{x:"8",y:"11",width:"8",height:"2",fill:"currentColor"})),kp=(0,ye.createElement)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(ke.Rect,{x:"4.75",y:"17.25",width:"5.5",height:"14.5",transform:"rotate(-90 4.75 17.25)",stroke:"currentColor",fill:"none",strokeWidth:"1.5"}),(0,ye.createElement)(ke.Rect,{x:"4",y:"7",width:"10",height:"2",fill:"currentColor"}));var Ep=[{name:"default",isDefault:!0,attributes:{buttonText:(0,we.__)("Search"),label:(0,we.__)("Search")}}];const Cp={apiVersion:2,name:"core/search",title:"Search",category:"widgets",description:"Help visitors find your content.",keywords:["find"],textdomain:"default",attributes:{label:{type:"string",__experimentalRole:"content"},showLabel:{type:"boolean",default:!0},placeholder:{type:"string",default:"",__experimentalRole:"content"},width:{type:"number"},widthUnit:{type:"string"},buttonText:{type:"string",__experimentalRole:"content"},buttonPosition:{type:"string",default:"button-outside"},buttonUseIcon:{type:"boolean",default:!1}},supports:{align:["left","center","right"],color:{gradients:!0,__experimentalSkipSerialization:!0},__experimentalBorder:{color:!0,radius:!0,__experimentalSkipSerialization:!0},html:!1},editorStyle:"wp-block-search-editor",style:"wp-block-search"},{name:xp}=Cp,Sp={icon:Ts,example:{},variations:Ep,edit:function(e){var t,n;let{className:o,attributes:r,setAttributes:a,toggleSelection:l,isSelected:i,clientId:s}=e;const{label:c,showLabel:u,placeholder:m,width:d,widthUnit:p,align:g,buttonText:h,buttonPosition:v,buttonUseIcon:b,style:y}=r,f=(0,Ie.useSelect)((e=>{var t;const{getBlockParentsByBlockName:n,wasBlockJustInserted:o}=e(Ee.store);return!(null===(t=n(s,"core/navigation"))||void 0===t||!t.length)&&o(s)}),[s]),{__unstableMarkNextChangeAsNotPersistent:_}=(0,Ie.useDispatch)(Ee.store);(0,ye.useEffect)((()=>{f&&(_(),a({showLabel:!1,buttonUseIcon:!0,buttonPosition:"button-inside"}))}),[f]);const k=null==y||null===(t=y.border)||void 0===t?void 0:t.radius,w=null==y||null===(n=y.border)||void 0===n?void 0:n.color,E=(0,Ee.__experimentalUseBorderProps)(r);"number"==typeof k&&(E.style.borderRadius=`${k}px`);const C=(0,Ee.__experimentalUseColorProps)(r),x=`wp-block-search__width-${(0,ot.useInstanceId)(Ee.__experimentalUnitControl)}`,S="button-inside"===v,B="button-outside"===v,T="no-button"===v,N="button-only"===v,z=(0,ke.__experimentalUseCustomUnits)({availableUnits:["%","px"],defaultValues:{"%":50,px:350}}),P=[{role:"menuitemradio",title:(0,we.__)("Button outside"),isActive:"button-outside"===v,icon:bp,onClick:()=>{a({buttonPosition:"button-outside"})}},{role:"menuitemradio",title:(0,we.__)("Button inside"),isActive:"button-inside"===v,icon:yp,onClick:()=>{a({buttonPosition:"button-inside"})}},{role:"menuitemradio",title:(0,we.__)("No button"),isActive:"no-button"===v,icon:fp,onClick:()=>{a({buttonPosition:"no-button"})}}],I=()=>{const e=nt()("wp-block-search__input",S?void 0:E.className),t=S?{borderRadius:k}:E.style;return(0,ye.createElement)("input",{className:e,style:t,"aria-label":(0,we.__)("Optional placeholder text"),placeholder:m?void 0:(0,we.__)("Optional placeholder…"),value:m,onChange:e=>a({placeholder:e.target.value})})},M=()=>{const e=nt()("wp-block-search__button",C.className,S?void 0:E.className,b?"has-icon":void 0),t={...C.style,...S?{borderRadius:k}:E.style};return(0,ye.createElement)(ye.Fragment,null,b&&(0,ye.createElement)("button",{type:"button",className:e,style:t},(0,ye.createElement)(Ss,{icon:Ts})),!b&&(0,ye.createElement)(Ee.RichText,{className:e,style:t,"aria-label":(0,we.__)("Button text"),placeholder:(0,we.__)("Add button text…"),withoutInteractiveFormatting:!0,value:h,onChange:e=>a({buttonText:e})}))},R=(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(ke.ToolbarGroup,null,(0,ye.createElement)(ke.ToolbarButton,{title:(0,we.__)("Toggle search label"),icon:kp,onClick:()=>{a({showLabel:!u})},className:u?"is-pressed":void 0}),(0,ye.createElement)(ke.ToolbarDropdownMenu,{icon:(()=>{switch(v){case"button-inside":return yp;case"button-outside":return bp;case"no-button":return fp;case"button-only":return vp}})(),label:(0,we.__)("Change button position"),controls:P}),!T&&(0,ye.createElement)(ke.ToolbarButton,{title:(0,we.__)("Use button with icon"),icon:_p,onClick:()=>{a({buttonUseIcon:!b})},className:b?"is-pressed":void 0}))),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Display Settings")},(0,ye.createElement)(ke.BaseControl,{label:(0,we.__)("Width"),id:x},(0,ye.createElement)(Ee.__experimentalUnitControl,{id:x,min:"220px",onChange:e=>{const t="%"===p&&parseInt(e,10)>100?100:e;a({width:parseInt(t,10)})},onUnitChange:e=>{a({width:"%"===e?50:350,widthUnit:e})},style:{maxWidth:80},value:`${d}${p}`,unit:p,units:z}),(0,ye.createElement)(ke.ButtonGroup,{className:"wp-block-search__components-button-group","aria-label":(0,we.__)("Percentage Width")},[25,50,75,100].map((e=>(0,ye.createElement)(ke.Button,{key:e,isSmall:!0,variant:`${e}%`==`${d}${p}`?0:void 0,onClick:()=>a({width:e,widthUnit:"%"})},e,"%")))))))),L=e=>e?`calc(${e} + 4px)`:void 0,V=(0,Ee.useBlockProps)({className:nt()(o,S?void 0:E.className,S?"wp-block-search__button-inside":void 0,B?"wp-block-search__button-outside":void 0,T?"wp-block-search__no-button":void 0,N?"wp-block-search__button-only":void 0,b||T?void 0:"wp-block-search__text-button",b&&!T?"wp-block-search__icon-button":void 0)});return(0,ye.createElement)("div",V,R,u&&(0,ye.createElement)(Ee.RichText,{className:"wp-block-search__label","aria-label":(0,we.__)("Label text"),placeholder:(0,we.__)("Add label…"),withoutInteractiveFormatting:!0,value:c,onChange:e=>a({label:e})}),(0,ye.createElement)(ke.ResizableBox,{size:{width:`${d}${p}`},className:nt()("wp-block-search__inside-wrapper",S?E.className:void 0),style:(()=>{const e={borderColor:w},t=0!==parseInt(k,10);if(S&&t){if("object"==typeof k){const{topLeft:t,topRight:n,bottomLeft:o,bottomRight:r}=k;return{borderTopLeftRadius:L(t),borderTopRightRadius:L(n),borderBottomLeftRadius:L(o),borderBottomRightRadius:L(r),...e}}const t=Number.isInteger(k)?`${k}px`:k;e.borderRadius=`calc(${t} + 4px)`}return e})(),minWidth:220,enable:N?{}:{right:"right"!==g,left:"right"===g},onResizeStart:(e,t,n)=>{a({width:parseInt(n.offsetWidth,10),widthUnit:"px"}),l(!1)},onResizeStop:(e,t,n,o)=>{a({width:parseInt(d+o.width,10)}),l(!0)},showHandle:i},(S||B)&&(0,ye.createElement)(ye.Fragment,null,I(),M()),N&&M(),T&&I()))}};var Bp=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M20.2 7v4H3.8V7H2.2v9h1.6v-3.5h16.4V16h1.6V7z"}));var Tp=e=>{let{color:t,setColor:n}=e;return(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(Ee.PanelColorSettings,{__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,title:(0,we.__)("Color"),colorSettings:[{value:t.color,onChange:n,label:(0,we.__)("Color")}]}))};var Np=(0,Ee.withColors)("color",{textColor:"color"})((function(e){let{color:t,setColor:n,className:o}=e;return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.HorizontalRule,(0,Ee.useBlockProps)({className:nt()(o,{"has-background":t.color,[t.class]:t.class}),style:{backgroundColor:t.color,color:t.color}})),(0,ye.createElement)(Tp,{color:t,setColor:n}))}));var zp={from:[{type:"enter",regExp:/^-{3,}$/,transform:()=>(0,be.createBlock)("core/separator")},{type:"raw",selector:"hr",schema:{hr:{}}}]};const Pp={apiVersion:2,name:"core/separator",title:"Separator",category:"design",description:"Create a break between ideas or sections with a horizontal separator.",keywords:["horizontal-line","hr","divider"],textdomain:"default",attributes:{color:{type:"string"},customColor:{type:"string"}},supports:{anchor:!0,align:["center","wide","full"]},styles:[{name:"default",label:"Default",isDefault:!0},{name:"wide",label:"Wide Line"},{name:"dots",label:"Dots"}],editorStyle:"wp-block-separator-editor",style:"wp-block-separator"},{name:Ip}=Pp,Mp={icon:Bp,example:{attributes:{customColor:"#065174",className:"is-style-wide"}},transforms:zp,edit:Np,save:function(e){let{attributes:t}=e;const{color:n,customColor:o}=t,r=(0,Ee.getColorClassName)("background-color",n),a=(0,Ee.getColorClassName)("color",n),l=nt()({"has-text-color has-background":n||o,[r]:r,[a]:a}),i={backgroundColor:r?void 0:o,color:a?void 0:o};return(0,ye.createElement)("hr",Ee.useBlockProps.save({className:l,style:i}))}};var Rp=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M16 4.2v1.5h2.5v12.5H16v1.5h4V4.2h-4zM4.2 19.8h4v-1.5H5.8V5.8h2.5V4.2h-4l-.1 15.6zm5.1-3.1l1.4.6 4-10-1.4-.6-4 10z"}));var Lp=window.wp.autop;var Vp={from:[{type:"shortcode",tag:"[a-z][a-z0-9_-]*",attributes:{text:{type:"string",shortcode:(e,t)=>{let{content:n}=t;return(0,Lp.removep)((0,Lp.autop)(n))}}},priority:20}]};const Hp={apiVersion:2,name:"core/shortcode",title:"Shortcode",category:"widgets",description:"Insert additional custom elements with a WordPress shortcode.",textdomain:"default",attributes:{text:{type:"string",source:"html"}},supports:{className:!1,customClassName:!1,html:!1},editorStyle:"wp-block-shortcode-editor"},{name:Ap}=Hp,Fp={icon:Rp,transforms:Vp,edit:function e(t){let{attributes:n,setAttributes:o}=t;const r=`blocks-shortcode-input-${(0,ot.useInstanceId)(e)}`;return(0,ye.createElement)("div",(0,Ee.useBlockProps)({className:"components-placeholder"}),(0,ye.createElement)("label",{htmlFor:r,className:"components-placeholder__label"},(0,ye.createElement)(Ss,{icon:Rp}),(0,we.__)("Shortcode")),(0,ye.createElement)(Ee.PlainText,{className:"blocks-shortcode__textarea",id:r,value:n.text,"aria-label":(0,we.__)("Shortcode text"),placeholder:(0,we.__)("Write shortcode here…"),onChange:e=>o({text:e})}))},save:function(e){let{attributes:t}=e;return(0,ye.createElement)(ye.RawHTML,null,t.text)}};var Dp=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 1.5c4.1 0 7.5 3.4 7.5 7.5v.1c-1.4-.8-3.3-1.7-3.4-1.8-.2-.1-.5-.1-.8.1l-2.9 2.1L9 11.3c-.2-.1-.4 0-.6.1l-3.7 2.2c-.1-.5-.2-1-.2-1.5 0-4.2 3.4-7.6 7.5-7.6zm0 15c-3.1 0-5.7-1.9-6.9-4.5l3.7-2.2 3.5 1.2c.2.1.5 0 .7-.1l2.9-2.1c.8.4 2.5 1.2 3.5 1.9-.9 3.3-3.9 5.8-7.4 5.8z"}));const Gp=["image"],Up="image/*",Op=e=>{let{alt:t,attributes:{align:n,width:o,height:r,isLink:a,linkTarget:l,shouldSyncIcon:i},containerRef:s,isSelected:c,setAttributes:u,setLogo:m,logoUrl:d,siteUrl:p,logoId:g,iconId:h,setIcon:v,canUserEdit:b}=e;const y=$l(s,[n]),f=(0,ot.useViewportMatch)("medium"),_=!(0,Le.includes)(["wide","full"],n)&&f,[{naturalWidth:k,naturalHeight:w},E]=(0,ye.useState)({}),[C,x]=(0,ye.useState)(!1),{toggleSelection:S}=(0,Ie.useDispatch)(Ee.store),B=nt()("custom-logo-link",{"is-transient":(0,Pe.isBlobURL)(d)}),{imageEditing:T,maxWidth:N,title:z}=(0,Ie.useSelect)((e=>{const{getSettings:t}=e(Ee.store);return{title:e(Dt.store).getEditedEntityRecord("root","site").title,...(0,Le.pick)(t(),["imageEditing","maxWidth"])}}),[]);(0,ye.useEffect)((()=>{i&&g!==h&&u({shouldSyncIcon:!1})}),[]),(0,ye.useEffect)((()=>{c||x(!1)}),[c]);const P=(0,ye.createElement)("img",{className:"custom-logo",src:d,alt:t,onLoad:e=>{E((0,Le.pick)(e.target,["naturalWidth","naturalHeight"]))}});let I,M=P;if(a&&(M=(0,ye.createElement)("a",{href:p,className:B,rel:"home",title:z,onClick:e=>e.preventDefault()},P)),y&&k&&w){I=k>y?y:k}if(!_||!I)return(0,ye.createElement)("div",{style:{width:o,height:r}},M);const R=o||120,L=k/w,V=R/L,H=k<w?ma:Math.ceil(ma*L),A=w<k?ma:Math.ceil(ma/L),F=2.5*N;let D=!1,G=!1;"center"===n?(D=!0,G=!0):(0,we.isRTL)()?"left"===n?D=!0:G=!0:"right"===n?G=!0:D=!0;const U=g&&k&&w&&T,O=U&&C?(0,ye.createElement)(Ee.__experimentalImageEditingProvider,{id:g,url:d,naturalWidth:k,naturalHeight:w,clientWidth:y,onSaveImage:e=>{m(e.id)},isEditing:C,onFinishEditing:()=>x(!1)},(0,ye.createElement)(Ee.__experimentalImageEditor,{url:d,width:R,height:V,clientWidth:y,naturalHeight:w,naturalWidth:k})):(0,ye.createElement)(ke.ResizableBox,{size:{width:R,height:V},showHandle:c,minWidth:H,maxWidth:F,minHeight:A,maxHeight:F/L,lockAspectRatio:!0,enable:{top:!1,right:D,bottom:!0,left:G},onResizeStart:function(){S(!1)},onResizeStop:(e,t,n,o)=>{S(!0),u({width:parseInt(R+o.width,10),height:parseInt(V+o.height,10)})}},M),q=(0,ye.createInterpolateElement)((0,we.__)("Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the <a>Site Icon settings</a>."),{a:(0,ye.createElement)("a",{href:p+"/wp-admin/customize.php?autofocus[section]=title_tagline",target:"_blank",rel:"noopener noreferrer"})});return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Settings")},(0,ye.createElement)(ke.RangeControl,{label:(0,we.__)("Image width"),onChange:e=>u({width:e}),min:H,max:F,initialPosition:Math.min(120,F),value:o||"",disabled:!_}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Link image to home"),onChange:()=>u({isLink:!a}),checked:a}),a&&(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Open in new tab"),onChange:e=>u({linkTarget:e?"_blank":"_self"}),checked:"_blank"===l})),b&&(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Use as site icon"),onChange:e=>{u({shouldSyncIcon:e}),v(e?g:void 0)},checked:!!i,help:q})))),(0,ye.createElement)(Ee.BlockControls,{group:"block"},U&&!C&&(0,ye.createElement)(ke.ToolbarButton,{onClick:()=>x(!0),icon:Ul,label:(0,we.__)("Crop")})),O)};const qp={apiVersion:2,name:"core/site-logo",title:"Site Logo",category:"theme",description:"Display a graphic to represent this site. Update the block, and the changes apply everywhere it’s used. This is different than the site icon, which is the smaller image visible in your dashboard, browser tabs, etc used to help others recognize this site.",textdomain:"default",attributes:{width:{type:"number"},isLink:{type:"boolean",default:!0},linkTarget:{type:"string",default:"_self"},shouldSyncIcon:{type:"boolean"}},example:{viewportWidth:500,attributes:{width:350,className:"block-editor-block-types-list__site-logo-example"}},supports:{html:!1,align:!0,alignWide:!1,color:{__experimentalDuotone:"img",text:!1,background:!1}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"rounded",label:"Rounded"}],editorStyle:"wp-block-site-logo-editor",style:"wp-block-site-logo"},{name:$p}=qp,Wp={icon:Dp,edit:function(e){let{attributes:t,className:n,setAttributes:o,isSelected:r}=e;const{width:a,shouldSyncIcon:l}=t,[i,s]=(0,ye.useState)(),c=(0,ye.useRef)(),{siteLogoId:u,canUserEdit:m,url:d,siteIconId:p,mediaItemData:g,isRequestingMediaItem:h}=(0,Ie.useSelect)((e=>{const{canUser:t,getEntityRecord:n,getEditedEntityRecord:o}=e(Dt.store),r=o("root","site"),a=n("root","__unstableBase"),l=null==r?void 0:r.site_logo,i=null==a?void 0:a.site_logo,s=t("update","settings"),c=s?l:i,u=null==r?void 0:r.site_icon,m=c&&e(Dt.store).getMedia(c,{context:"view"}),d=c&&!e(Dt.store).hasFinishedResolution("getMedia",[c,{context:"view"}]);return{siteLogoId:c,canUserEdit:s,url:null==a?void 0:a.url,mediaItemData:m&&{id:m.id,url:m.source_url,alt:m.alt_text},isRequestingMediaItem:d,siteIconId:u}}),[]),{editEntityRecord:v}=(0,Ie.useDispatch)(Dt.store),b=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(l||t)&&y(e),v("root","site",void 0,{site_logo:e})},y=e=>v("root","site",void 0,{site_icon:e});let f=null;g&&(f=g.alt,i!==g.url&&s(g.url));const _=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return!e.id&&e.url?(b(void 0),void s(e.url)):void b(e.id,t)},{createErrorNotice:k}=(0,Ie.useDispatch)(Ir.store),w=e=>{k(e[2],{type:"snackbar"})},E=m&&i&&(0,ye.createElement)(Ee.BlockControls,{group:"other"},(0,ye.createElement)(Ee.MediaReplaceFlow,{mediaURL:i,allowedTypes:Gp,accept:Up,onSelect:_,onError:w},(0,ye.createElement)(ke.MenuItem,{onClick:()=>{b(null),s(void 0),o({width:void 0})}},(0,we.__)("Reset"))));let C;const x=void 0===u||h;x&&(C=(0,ye.createElement)(ke.Spinner,null)),i&&(C=(0,ye.createElement)(Op,{alt:f,attributes:t,className:n,containerRef:c,isSelected:r,setAttributes:o,logoUrl:i,setLogo:b,logoId:(null==g?void 0:g.id)||u,siteUrl:d,setIcon:y,iconId:p,canUserEdit:m}));const S=nt()(n,{"is-default-size":!a}),B=(0,Ee.useBlockProps)({ref:c,className:S}),T=(0,we.__)("Add a site logo");return(0,ye.createElement)("div",B,E,!!i&&C,!i&&!m&&(0,ye.createElement)(ke.Placeholder,{className:"site-logo_placeholder"},x&&(0,ye.createElement)("span",{className:"components-placeholder__preview"},(0,ye.createElement)(ke.Spinner,null))),!i&&m&&(0,ye.createElement)(Ee.MediaPlaceholder,{onSelect:e=>{if(void 0===l){const t=!p;return o({shouldSyncIcon:t}),void _(e,t)}_(e)},accept:Up,allowedTypes:Gp,onError:w,placeholder:e=>{const t=nt()("block-editor-media-placeholder",n);return(0,ye.createElement)(ke.Placeholder,{className:t,preview:C},(0,ye.createElement)(fe.SVG,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60"},(0,ye.createElement)(fe.Path,{vectorEffect:"non-scaling-stroke",d:"m61 32.622-13.555-9.137-15.888 9.859a5 5 0 0 1-5.386-.073l-9.095-5.989L1 37.5"})),e)},mediaLibraryButton:e=>{let{open:t}=e;return(0,ye.createElement)(ke.Button,{icon:Ol,variant:"primary",label:T,showTooltip:!0,tooltipPosition:"top center",onClick:()=>{t()}})}}))}};var jp=(0,ye.createElement)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},(0,ye.createElement)(ke.Path,{fill:"none",d:"M0 0h24v24H0z"}),(0,ye.createElement)(ke.Path,{d:"M4 9h16v2H4V9zm0 4h10v2H4v-2z"}));var Zp=[{attributes:{textAlign:{type:"string"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0}},save:()=>null,migrate:lt,isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}}];const Kp={apiVersion:2,name:"core/site-tagline",title:"Site Tagline",category:"theme",description:"Describe in a few words what the website is about. The tagline can be used in search results or when sharing on social networks even if it's not displayed in the theme design.",keywords:["description"],textdomain:"default",attributes:{textAlign:{type:"string"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}}},editorStyle:"wp-block-site-tagline-editor"},{name:Qp}=Kp,Jp={icon:jp,edit:function(e){let{attributes:t,setAttributes:n}=e;const{textAlign:o}=t,[r,a]=(0,Dt.useEntityProp)("root","site","description"),{canUserEdit:l,readOnlySiteTagLine:i}=(0,Ie.useSelect)((e=>{const{canUser:t,getEntityRecord:n}=e(Dt.store),o=n("root","__unstableBase");return{canUserEdit:t("update","settings"),readOnlySiteTagLine:null==o?void 0:o.description}}),[]),s=(0,Ee.useBlockProps)({className:nt()({[`has-text-align-${o}`]:o,"wp-block-site-tagline__placeholder":!l&&!i})}),c=l?(0,ye.createElement)(Ee.RichText,gt({allowedFormats:[],onChange:a,"aria-label":(0,we.__)("Site tagline text"),placeholder:(0,we.__)("Write site tagline…"),tagName:"p",value:r},s)):(0,ye.createElement)("p",s,i||(0,we.__)("Site Tagline placeholder"));return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(Ee.AlignmentControl,{onChange:e=>n({textAlign:e}),value:o})),c)},deprecated:Zp};var Yp=(0,ye.createElement)(fe.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M12 9c-.8 0-1.5.7-1.5 1.5S11.2 12 12 12s1.5-.7 1.5-1.5S12.8 9 12 9zm0-5c-3.6 0-6.5 2.8-6.5 6.2 0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C18.5 6.8 15.6 4 12 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4z"}));function Xp(e){let{level:t,isPressed:n=!1}=e;if(0===t)return lu;return(0,ye.createElement)(ke.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",isPressed:n},(0,ye.createElement)(ke.Path,{d:{1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"}[t]}))}function eg(e){let{level:t,onChange:n}=e;const o=[1,2,3,4,5,6,0].map((e=>{const o=e===t;return{icon:(0,ye.createElement)(Xp,{level:e,isPressed:o}),title:0===e?(0,we.__)("Paragraph"):(0,we.sprintf)((0,we.__)("Heading %d"),e),isActive:o,onClick:()=>n(e)}}));return(0,ye.createElement)(ke.ToolbarDropdownMenu,{label:(0,we.__)("Change heading level"),icon:(0,ye.createElement)(Xp,{level:t}),controls:o})}var tg=[{attributes:{level:{type:"number",default:1},textAlign:{type:"string"},isLink:{type:"boolean",default:!0},linkTarget:{type:"string",default:"_self"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},spacing:{padding:!0,margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0}},save:()=>null,migrate:lt,isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}}];const ng={apiVersion:2,name:"core/site-title",title:"Site Title",category:"theme",description:"Displays the name of this site. Update the block, and the changes apply everywhere it’s used. This will also appear in the browser title bar and in search results.",textdomain:"default",attributes:{level:{type:"number",default:1},textAlign:{type:"string"},isLink:{type:"boolean",default:!0},linkTarget:{type:"string",default:"_self"}},example:{viewportWidth:500},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},spacing:{padding:!0,margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0,lineHeight:!0,fontAppearance:!0,letterSpacing:!0,textTransform:!0}}},editorStyle:"wp-block-site-title-editor"},{name:og}=ng,rg={icon:Yp,edit:function(e){let{attributes:t,setAttributes:n,insertBlocksAfter:o}=e;const{level:r,textAlign:a,isLink:l,linkTarget:i}=t,[s,c]=(0,Dt.useEntityProp)("root","site","title"),{canUserEdit:u,readOnlyTitle:m}=(0,Ie.useSelect)((e=>{const{canUser:t,getEntityRecord:n}=e(Dt.store),o=n("root","__unstableBase");return{canUserEdit:t("update","settings"),readOnlyTitle:(0,Bs.decodeEntities)(null==o?void 0:o.name)}}),[]),d=0===r?"p":`h${r}`,p=(0,Ee.useBlockProps)({className:nt()({[`has-text-align-${a}`]:a,"wp-block-site-title__placeholder":!u&&!m})}),g=u?(0,ye.createElement)(d,p,(0,ye.createElement)(Ee.RichText,{tagName:l?"a":"span",href:l?"#site-title-pseudo-link":void 0,"aria-label":(0,we.__)("Site title text"),placeholder:(0,we.__)("Write site title…"),value:s,onChange:c,allowedFormats:[],disableLineBreaks:!0,__unstableOnSplitAtEnd:()=>o((0,be.createBlock)((0,be.getDefaultBlockName)()))})):(0,ye.createElement)(d,p,l?(0,ye.createElement)("a",{href:"#site-title-pseudo-link",onClick:e=>e.preventDefault()},m||(0,we.__)("Site Title placeholder")):(0,ye.createElement)("span",null,s||m));return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(eg,{level:r,onChange:e=>n({level:e})}),(0,ye.createElement)(Ee.AlignmentControl,{value:a,onChange:e=>{n({textAlign:e})}})),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Link settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Make title link to home"),onChange:()=>n({isLink:!l}),checked:l}),l&&(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Open in new tab"),onChange:e=>n({linkTarget:e?"_blank":"_self"}),checked:"_blank"===i}))),g)},deprecated:tg};var ag=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"}));var lg=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,ye.createElement)(fe.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"}));const ig=()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M19.647,16.706a1.134,1.134,0,0,0-.343-.833l-2.549-2.549a1.134,1.134,0,0,0-.833-.343,1.168,1.168,0,0,0-.883.392l.233.226q.2.189.264.264a2.922,2.922,0,0,1,.184.233.986.986,0,0,1,.159.312,1.242,1.242,0,0,1,.043.337,1.172,1.172,0,0,1-1.176,1.176,1.237,1.237,0,0,1-.337-.043,1,1,0,0,1-.312-.159,2.76,2.76,0,0,1-.233-.184q-.073-.068-.264-.264l-.226-.233a1.19,1.19,0,0,0-.4.895,1.134,1.134,0,0,0,.343.833L15.837,19.3a1.13,1.13,0,0,0,.833.331,1.18,1.18,0,0,0,.833-.318l1.8-1.789a1.12,1.12,0,0,0,.343-.821Zm-8.615-8.64a1.134,1.134,0,0,0-.343-.833L8.163,4.7a1.134,1.134,0,0,0-.833-.343,1.184,1.184,0,0,0-.833.331L4.7,6.473a1.12,1.12,0,0,0-.343.821,1.134,1.134,0,0,0,.343.833l2.549,2.549a1.13,1.13,0,0,0,.833.331,1.184,1.184,0,0,0,.883-.38L8.728,10.4q-.2-.189-.264-.264A2.922,2.922,0,0,1,8.28,9.9a.986.986,0,0,1-.159-.312,1.242,1.242,0,0,1-.043-.337A1.172,1.172,0,0,1,9.254,8.079a1.237,1.237,0,0,1,.337.043,1,1,0,0,1,.312.159,2.761,2.761,0,0,1,.233.184q.073.068.264.264l.226.233a1.19,1.19,0,0,0,.4-.895ZM22,16.706a3.343,3.343,0,0,1-1.042,2.488l-1.8,1.789a3.536,3.536,0,0,1-4.988-.025l-2.525-2.537a3.384,3.384,0,0,1-1.017-2.488,3.448,3.448,0,0,1,1.078-2.561l-1.078-1.078a3.434,3.434,0,0,1-2.549,1.078,3.4,3.4,0,0,1-2.5-1.029L3.029,9.794A3.4,3.4,0,0,1,2,7.294,3.343,3.343,0,0,1,3.042,4.806l1.8-1.789A3.384,3.384,0,0,1,7.331,2a3.357,3.357,0,0,1,2.5,1.042l2.525,2.537a3.384,3.384,0,0,1,1.017,2.488,3.448,3.448,0,0,1-1.078,2.561l1.078,1.078a3.551,3.551,0,0,1,5.049-.049l2.549,2.549A3.4,3.4,0,0,1,22,16.706Z"})),sg=[{isDefault:!0,name:"wordpress",attributes:{service:"wordpress"},title:"WordPress",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z"}))},{name:"fivehundredpx",attributes:{service:"fivehundredpx"},title:"500px",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z"}))},{name:"amazon",attributes:{service:"amazon"},title:"Amazon",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M13.582,8.182C11.934,8.367,9.78,8.49,8.238,9.166c-1.781,0.769-3.03,2.337-3.03,4.644 c0,2.953,1.86,4.429,4.253,4.429c2.02,0,3.125-0.477,4.685-2.065c0.516,0.747,0.685,1.109,1.629,1.894 c0.212,0.114,0.483,0.103,0.672-0.066l0.006,0.006c0.567-0.505,1.599-1.401,2.18-1.888c0.231-0.188,0.19-0.496,0.009-0.754 c-0.52-0.718-1.072-1.303-1.072-2.634V8.305c0-1.876,0.133-3.599-1.249-4.891C15.23,2.369,13.422,2,12.04,2 C9.336,2,6.318,3.01,5.686,6.351C5.618,6.706,5.877,6.893,6.109,6.945l2.754,0.298C9.121,7.23,9.308,6.977,9.357,6.72 c0.236-1.151,1.2-1.706,2.284-1.706c0.584,0,1.249,0.215,1.595,0.738c0.398,0.584,0.346,1.384,0.346,2.061V8.182z M13.049,14.088 c-0.451,0.8-1.169,1.291-1.967,1.291c-1.09,0-1.728-0.83-1.728-2.061c0-2.42,2.171-2.86,4.227-2.86v0.615 C13.582,12.181,13.608,13.104,13.049,14.088z M20.683,19.339C18.329,21.076,14.917,22,11.979,22c-4.118,0-7.826-1.522-10.632-4.057 c-0.22-0.199-0.024-0.471,0.241-0.317c3.027,1.762,6.771,2.823,10.639,2.823c2.608,0,5.476-0.541,8.115-1.66 C20.739,18.62,21.072,19.051,20.683,19.339z M21.336,21.043c-0.194,0.163-0.379,0.076-0.293-0.139 c0.284-0.71,0.92-2.298,0.619-2.684c-0.301-0.386-1.99-0.183-2.749-0.092c-0.23,0.027-0.266-0.173-0.059-0.319 c1.348-0.946,3.555-0.673,3.811-0.356C22.925,17.773,22.599,19.986,21.336,21.043z"}))},{name:"bandcamp",attributes:{service:"bandcamp"},title:"Bandcamp",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289"}))},{name:"behance",attributes:{service:"behance"},title:"Behance",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M7.799,5.698c0.589,0,1.12,0.051,1.606,0.156c0.482,0.102,0.894,0.273,1.241,0.507c0.344,0.235,0.612,0.546,0.804,0.938 c0.188,0.387,0.281,0.871,0.281,1.443c0,0.619-0.141,1.137-0.421,1.551c-0.284,0.413-0.7,0.751-1.255,1.014 c0.756,0.218,1.317,0.601,1.689,1.146c0.374,0.549,0.557,1.205,0.557,1.975c0,0.623-0.12,1.161-0.359,1.612 c-0.241,0.457-0.569,0.828-0.973,1.114c-0.408,0.288-0.876,0.5-1.399,0.637C9.052,17.931,8.514,18,7.963,18H2V5.698H7.799 M7.449,10.668c0.481,0,0.878-0.114,1.192-0.345c0.311-0.228,0.463-0.603,0.463-1.119c0-0.286-0.051-0.523-0.152-0.707 C8.848,8.315,8.711,8.171,8.536,8.07C8.362,7.966,8.166,7.894,7.94,7.854c-0.224-0.044-0.457-0.06-0.697-0.06H4.709v2.874H7.449z M7.6,15.905c0.267,0,0.521-0.024,0.759-0.077c0.243-0.053,0.457-0.137,0.637-0.261c0.182-0.12,0.332-0.283,0.441-0.491 C9.547,14.87,9.6,14.602,9.6,14.278c0-0.633-0.18-1.084-0.533-1.357c-0.356-0.27-0.83-0.404-1.413-0.404H4.709v3.388L7.6,15.905z M16.162,15.864c0.367,0.358,0.897,0.538,1.583,0.538c0.493,0,0.92-0.125,1.277-0.374c0.354-0.248,0.571-0.514,0.654-0.79h2.155 c-0.347,1.072-0.872,1.838-1.589,2.299C19.534,18,18.67,18.23,17.662,18.23c-0.701,0-1.332-0.113-1.899-0.337 c-0.567-0.227-1.041-0.544-1.439-0.958c-0.389-0.415-0.689-0.907-0.904-1.484c-0.213-0.574-0.32-1.21-0.32-1.899 c0-0.666,0.11-1.288,0.329-1.863c0.222-0.577,0.529-1.075,0.933-1.492c0.406-0.42,0.885-0.751,1.444-0.994 c0.558-0.241,1.175-0.363,1.857-0.363c0.754,0,1.414,0.145,1.98,0.44c0.563,0.291,1.026,0.686,1.389,1.181 c0.363,0.493,0.622,1.057,0.783,1.69c0.16,0.632,0.217,1.292,0.171,1.983h-6.428C15.557,14.84,15.795,15.506,16.162,15.864 M18.973,11.184c-0.291-0.321-0.783-0.496-1.384-0.496c-0.39,0-0.714,0.066-0.973,0.2c-0.254,0.132-0.461,0.297-0.621,0.491 c-0.157,0.197-0.265,0.405-0.328,0.628c-0.063,0.217-0.101,0.413-0.111,0.587h3.98C19.478,11.969,19.265,11.509,18.973,11.184z M15.057,7.738h4.985V6.524h-4.985L15.057,7.738z"}))},{name:"chain",attributes:{service:"chain"},title:"Link",icon:ig},{name:"codepen",attributes:{service:"codepen"},title:"CodePen",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M22.016,8.84c-0.002-0.013-0.005-0.025-0.007-0.037c-0.005-0.025-0.008-0.048-0.015-0.072 c-0.003-0.015-0.01-0.028-0.013-0.042c-0.008-0.02-0.015-0.04-0.023-0.062c-0.007-0.015-0.013-0.028-0.02-0.042 c-0.008-0.02-0.018-0.037-0.03-0.057c-0.007-0.013-0.017-0.027-0.025-0.038c-0.012-0.018-0.023-0.035-0.035-0.052 c-0.01-0.013-0.02-0.025-0.03-0.037c-0.015-0.017-0.028-0.032-0.043-0.045c-0.01-0.012-0.022-0.023-0.035-0.035 c-0.015-0.015-0.032-0.028-0.048-0.04c-0.012-0.01-0.025-0.02-0.037-0.03c-0.005-0.003-0.01-0.008-0.015-0.012l-9.161-6.096 c-0.289-0.192-0.666-0.192-0.955,0L2.359,8.237C2.354,8.24,2.349,8.245,2.344,8.249L2.306,8.277 c-0.017,0.013-0.033,0.027-0.048,0.04C2.246,8.331,2.234,8.342,2.222,8.352c-0.015,0.015-0.028,0.03-0.042,0.047 c-0.012,0.013-0.022,0.023-0.03,0.037C2.139,8.453,2.125,8.471,2.115,8.488C2.107,8.501,2.099,8.514,2.09,8.526 C2.079,8.548,2.069,8.565,2.06,8.585C2.054,8.6,2.047,8.613,2.04,8.626C2.032,8.648,2.025,8.67,2.019,8.69 c-0.005,0.013-0.01,0.027-0.013,0.042C1.999,8.755,1.995,8.778,1.99,8.803C1.989,8.817,1.985,8.828,1.984,8.84 C1.978,8.879,1.975,8.915,1.975,8.954v6.093c0,0.037,0.003,0.075,0.008,0.112c0.002,0.012,0.005,0.025,0.007,0.038 c0.005,0.023,0.008,0.047,0.015,0.072c0.003,0.015,0.008,0.028,0.013,0.04c0.007,0.022,0.013,0.042,0.022,0.063 c0.007,0.015,0.013,0.028,0.02,0.04c0.008,0.02,0.018,0.038,0.03,0.058c0.007,0.013,0.015,0.027,0.025,0.038 c0.012,0.018,0.023,0.035,0.035,0.052c0.01,0.013,0.02,0.025,0.03,0.037c0.013,0.015,0.028,0.032,0.042,0.045 c0.012,0.012,0.023,0.023,0.035,0.035c0.015,0.013,0.032,0.028,0.048,0.04l0.038,0.03c0.005,0.003,0.01,0.007,0.013,0.01 l9.163,6.095C11.668,21.953,11.833,22,12,22c0.167,0,0.332-0.047,0.478-0.144l9.163-6.095l0.015-0.01 c0.013-0.01,0.027-0.02,0.037-0.03c0.018-0.013,0.035-0.028,0.048-0.04c0.013-0.012,0.025-0.023,0.035-0.035 c0.017-0.015,0.03-0.032,0.043-0.045c0.01-0.013,0.02-0.025,0.03-0.037c0.013-0.018,0.025-0.035,0.035-0.052 c0.008-0.013,0.018-0.027,0.025-0.038c0.012-0.02,0.022-0.038,0.03-0.058c0.007-0.013,0.013-0.027,0.02-0.04 c0.008-0.022,0.015-0.042,0.023-0.063c0.003-0.013,0.01-0.027,0.013-0.04c0.007-0.025,0.01-0.048,0.015-0.072 c0.002-0.013,0.005-0.027,0.007-0.037c0.003-0.042,0.007-0.079,0.007-0.117V8.954C22.025,8.915,22.022,8.879,22.016,8.84z M12.862,4.464l6.751,4.49l-3.016,2.013l-3.735-2.492V4.464z M11.138,4.464v4.009l-3.735,2.494L4.389,8.954L11.138,4.464z M3.699,10.562L5.853,12l-2.155,1.438V10.562z M11.138,19.536l-6.749-4.491l3.015-2.011l3.735,2.492V19.536z M12,14.035L8.953,12 L12,9.966L15.047,12L12,14.035z M12.862,19.536v-4.009l3.735-2.492l3.016,2.011L12.862,19.536z M20.303,13.438L18.147,12 l2.156-1.438L20.303,13.438z"}))},{name:"deviantart",attributes:{service:"deviantart"},title:"DeviantArt",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z"}))},{name:"dribbble",attributes:{service:"dribbble"},title:"Dribbble",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z"}))},{name:"dropbox",attributes:{service:"dropbox"},title:"Dropbox",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M12,6.134L6.069,9.797L2,6.54l5.883-3.843L12,6.134z M2,13.054l5.883,3.843L12,13.459L6.069,9.797L2,13.054z M12,13.459 l4.116,3.439L22,13.054l-4.069-3.257L12,13.459z M22,6.54l-5.884-3.843L12,6.134l5.931,3.663L22,6.54z M12.011,14.2l-4.129,3.426 l-1.767-1.153v1.291l5.896,3.539l5.897-3.539v-1.291l-1.769,1.153L12.011,14.2z"}))},{name:"etsy",attributes:{service:"etsy"},title:"Etsy",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M9.16033,4.038c0-.27174.02717-.43478.48913-.43478h6.22283c1.087,0,1.68478.92391,2.11957,2.663l.35326,1.38587h1.05978C19.59511,3.712,19.75815,2,19.75815,2s-2.663.29891-4.23913.29891h-7.962L3.29076,2.163v1.1413L4.731,3.57609c1.00543.19022,1.25.40761,1.33152,1.33152,0,0,.08152,2.71739.08152,7.20109s-.08152,7.17391-.08152,7.17391c0,.81522-.32609,1.11413-1.33152,1.30435l-1.44022.27174V22l4.2663-.13587h7.11957c1.60326,0,5.32609.13587,5.32609.13587.08152-.97826.625-5.40761.70652-5.89674H19.7038L18.644,18.52174c-.84239,1.90217-2.06522,2.038-3.42391,2.038H11.1712c-1.3587,0-2.01087-.54348-2.01087-1.712V12.65217s3.0163,0,3.99457.08152c.76087.05435,1.22283.27174,1.46739,1.33152l.32609,1.413h1.16848l-.08152-3.55978.163-3.587H15.02989l-.38043,1.57609c-.24457,1.03261-.40761,1.22283-1.46739,1.33152-1.38587.13587-4.02174.1087-4.02174.1087Z"}))},{name:"facebook",attributes:{service:"facebook"},title:"Facebook",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"}))},{name:"feed",attributes:{service:"feed"},title:"RSS Feed",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M2,8.667V12c5.515,0,10,4.485,10,10h3.333C15.333,14.637,9.363,8.667,2,8.667z M2,2v3.333 c9.19,0,16.667,7.477,16.667,16.667H22C22,10.955,13.045,2,2,2z M4.5,17C3.118,17,2,18.12,2,19.5S3.118,22,4.5,22S7,20.88,7,19.5 S5.882,17,4.5,17z"}))},{name:"flickr",attributes:{service:"flickr"},title:"Flickr",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M6.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5S9.25,7,6.5,7z M17.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5 S20.25,7,17.5,7z"}))},{name:"foursquare",attributes:{service:"foursquare"},title:"Foursquare",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M17.573,2c0,0-9.197,0-10.668,0S5,3.107,5,3.805s0,16.948,0,16.948c0,0.785,0.422,1.077,0.66,1.172 c0.238,0.097,0.892,0.177,1.285-0.275c0,0,5.035-5.843,5.122-5.93c0.132-0.132,0.132-0.132,0.262-0.132h3.26 c1.368,0,1.588-0.977,1.732-1.552c0.078-0.318,0.692-3.428,1.225-6.122l0.675-3.368C19.56,2.893,19.14,2,17.573,2z M16.495,7.22 c-0.053,0.252-0.372,0.518-0.665,0.518c-0.293,0-4.157,0-4.157,0c-0.467,0-0.802,0.318-0.802,0.787v0.508 c0,0.467,0.337,0.798,0.805,0.798c0,0,3.197,0,3.528,0s0.655,0.362,0.583,0.715c-0.072,0.353-0.407,2.102-0.448,2.295 c-0.04,0.193-0.262,0.523-0.655,0.523c-0.33,0-2.88,0-2.88,0c-0.523,0-0.683,0.068-1.033,0.503 c-0.35,0.437-3.505,4.223-3.505,4.223c-0.032,0.035-0.063,0.027-0.063-0.015V4.852c0-0.298,0.26-0.648,0.648-0.648 c0,0,8.228,0,8.562,0c0.315,0,0.61,0.297,0.528,0.683L16.495,7.22z"}))},{name:"goodreads",attributes:{service:"goodreads"},title:"Goodreads",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M17.3,17.5c-0.2,0.8-0.5,1.4-1,1.9c-0.4,0.5-1,0.9-1.7,1.2C13.9,20.9,13.1,21,12,21c-0.6,0-1.3-0.1-1.9-0.2 c-0.6-0.1-1.1-0.4-1.6-0.7c-0.5-0.3-0.9-0.7-1.2-1.2c-0.3-0.5-0.5-1.1-0.5-1.7h1.5c0.1,0.5,0.2,0.9,0.5,1.2 c0.2,0.3,0.5,0.6,0.9,0.8c0.3,0.2,0.7,0.3,1.1,0.4c0.4,0.1,0.8,0.1,1.2,0.1c1.4,0,2.5-0.4,3.1-1.2c0.6-0.8,1-2,1-3.5v-1.7h0 c-0.4,0.8-0.9,1.4-1.6,1.9c-0.7,0.5-1.5,0.7-2.4,0.7c-1,0-1.9-0.2-2.6-0.5C8.7,15,8.1,14.5,7.7,14c-0.5-0.6-0.8-1.3-1-2.1 c-0.2-0.8-0.3-1.6-0.3-2.5c0-0.9,0.1-1.7,0.4-2.5c0.3-0.8,0.6-1.5,1.1-2c0.5-0.6,1.1-1,1.8-1.4C10.3,3.2,11.1,3,12,3 c0.5,0,0.9,0.1,1.3,0.2c0.4,0.1,0.8,0.3,1.1,0.5c0.3,0.2,0.6,0.5,0.9,0.8c0.3,0.3,0.5,0.6,0.6,1h0V3.4h1.5V15 C17.6,15.9,17.5,16.7,17.3,17.5z M13.8,14.1c0.5-0.3,0.9-0.7,1.3-1.1c0.3-0.5,0.6-1,0.8-1.6c0.2-0.6,0.3-1.2,0.3-1.9 c0-0.6-0.1-1.2-0.2-1.9c-0.1-0.6-0.4-1.2-0.7-1.7c-0.3-0.5-0.7-0.9-1.3-1.2c-0.5-0.3-1.1-0.5-1.9-0.5s-1.4,0.2-1.9,0.5 c-0.5,0.3-1,0.7-1.3,1.2C8.5,6.4,8.3,7,8.1,7.6C8,8.2,7.9,8.9,7.9,9.5c0,0.6,0.1,1.3,0.2,1.9C8.3,12,8.6,12.5,8.9,13 c0.3,0.5,0.8,0.8,1.3,1.1c0.5,0.3,1.1,0.4,1.9,0.4C12.7,14.5,13.3,14.4,13.8,14.1z"}))},{name:"google",attributes:{service:"google"},title:"Google",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M12.02,10.18v3.72v0.01h5.51c-0.26,1.57-1.67,4.22-5.5,4.22c-3.31,0-6.01-2.75-6.01-6.12s2.7-6.12,6.01-6.12 c1.87,0,3.13,0.8,3.85,1.48l2.84-2.76C16.99,2.99,14.73,2,12.03,2c-5.52,0-10,4.48-10,10s4.48,10,10,10c5.77,0,9.6-4.06,9.6-9.77 c0-0.83-0.11-1.42-0.25-2.05H12.02z"}))},{name:"github",attributes:{service:"github"},title:"GitHub",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"}))},{name:"instagram",attributes:{service:"instagram"},title:"Instagram",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z"}))},{name:"lastfm",attributes:{service:"lastfm"},title:"Last.fm",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M 12.0002 1.5 C 6.2006 1.5 1.5 6.2011 1.5 11.9998 C 1.5 17.799 6.2006 22.5 12.0002 22.5 C 17.799 22.5 22.5 17.799 22.5 11.9998 C 22.5 6.2011 17.799 1.5 12.0002 1.5 Z M 16.1974 16.2204 C 14.8164 16.2152 13.9346 15.587 13.3345 14.1859 L 13.1816 13.8451 L 11.8541 10.8101 C 11.4271 9.7688 10.3526 9.0712 9.1801 9.0712 C 7.5695 9.0712 6.2593 10.3851 6.2593 12.001 C 6.2593 13.6165 7.5695 14.9303 9.1801 14.9303 C 10.272 14.9303 11.2651 14.3275 11.772 13.3567 C 11.7893 13.3235 11.8239 13.302 11.863 13.3038 C 11.9007 13.3054 11.9353 13.3288 11.9504 13.3632 L 12.4865 14.6046 C 12.5016 14.639 12.4956 14.6778 12.4723 14.7069 C 11.6605 15.6995 10.4602 16.2683 9.1801 16.2683 C 6.8331 16.2683 4.9234 14.3536 4.9234 12.001 C 4.9234 9.6468 6.833 7.732 9.1801 7.732 C 10.9572 7.732 12.3909 8.6907 13.1138 10.3636 C 13.1206 10.3802 13.8412 12.0708 14.4744 13.5191 C 14.8486 14.374 15.1462 14.896 16.1288 14.9292 C 17.0663 14.9613 17.7538 14.4122 17.7538 13.6485 C 17.7538 12.9691 17.3321 12.8004 16.3803 12.4822 C 14.7365 11.9398 13.845 11.3861 13.845 10.0182 C 13.845 8.6809 14.7667 7.8162 16.192 7.8162 C 17.1288 7.8162 17.8155 8.2287 18.2921 9.0768 C 18.305 9.1006 18.3079 9.1281 18.3004 9.1542 C 18.2929 9.1803 18.2748 9.2021 18.2507 9.2138 L 17.3614 9.669 C 17.3178 9.692 17.2643 9.6781 17.2356 9.6385 C 16.9329 9.2135 16.5956 9.0251 16.1423 9.0251 C 15.5512 9.0251 15.122 9.429 15.122 9.9865 C 15.122 10.6738 15.6529 10.8414 16.5339 11.1192 C 16.6491 11.1558 16.7696 11.194 16.8939 11.2343 C 18.2763 11.6865 19.0768 12.2311 19.0768 13.6836 C 19.0769 15.1297 17.8389 16.2204 16.1974 16.2204 Z"}))},{name:"linkedin",attributes:{service:"linkedin"},title:"LinkedIn",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"}))},{name:"mail",attributes:{service:"mail"},title:"Mail",keywords:["email","e-mail"],icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M20,4H4C2.895,4,2,4.895,2,6v12c0,1.105,0.895,2,2,2h16c1.105,0,2-0.895,2-2V6C22,4.895,21.105,4,20,4z M20,8.236l-8,4.882 L4,8.236V6h16V8.236z"}))},{name:"mastodon",attributes:{service:"mastodon"},title:"Mastodon",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M23.193 7.879c0-5.206-3.411-6.732-3.411-6.732C18.062.357 15.108.025 12.041 0h-.076c-3.068.025-6.02.357-7.74 1.147 0 0-3.411 1.526-3.411 6.732 0 1.192-.023 2.618.015 4.129.124 5.092.934 10.109 5.641 11.355 2.17.574 4.034.695 5.535.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.129.539c-2.165-.074-4.449-.233-4.799-2.891a5.499 5.499 0 0 1-.048-.745s2.125.52 4.817.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.507.475-6.507zm-4.024 6.709h-2.497V8.469c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.312v3.349h-2.483v-3.35c0-1.536-.602-2.312-1.802-2.312-1.085 0-1.628.655-1.628 1.944v6.119H4.832V8.284c0-1.289.328-2.313.987-3.07.68-.758 1.569-1.146 2.674-1.146 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.304z"}))},{name:"meetup",attributes:{service:"meetup"},title:"Meetup",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M19.24775,14.722a3.57032,3.57032,0,0,1-2.94457,3.52073,3.61886,3.61886,0,0,1-.64652.05634c-.07314-.0008-.10187.02846-.12507.09547A2.38881,2.38881,0,0,1,13.49453,20.094a2.33092,2.33092,0,0,1-1.827-.50716.13635.13635,0,0,0-.19878-.00408,3.191,3.191,0,0,1-2.104.60248,3.26309,3.26309,0,0,1-3.00324-2.71993,2.19076,2.19076,0,0,1-.03512-.30865c-.00156-.08579-.03413-.1189-.11608-.13493a2.86421,2.86421,0,0,1-1.23189-.56111,2.945,2.945,0,0,1-1.166-2.05749,2.97484,2.97484,0,0,1,.87524-2.50774.112.112,0,0,0,.02091-.16107,2.7213,2.7213,0,0,1-.36648-1.48A2.81256,2.81256,0,0,1,6.57673,7.58838a.35764.35764,0,0,0,.28869-.22819,4.2208,4.2208,0,0,1,6.02892-1.90111.25161.25161,0,0,0,.22023.0243,3.65608,3.65608,0,0,1,3.76031.90678A3.57244,3.57244,0,0,1,17.95918,8.626a2.97339,2.97339,0,0,1,.01829.57356.10637.10637,0,0,0,.0853.12792,1.97669,1.97669,0,0,1,1.27939,1.33733,2.00266,2.00266,0,0,1-.57112,2.12652c-.05284.05166-.04168.08328-.01173.13489A3.51189,3.51189,0,0,1,19.24775,14.722Zm-6.35959-.27836a1.6984,1.6984,0,0,0,1.14556,1.61113,3.82039,3.82039,0,0,0,1.036.17935,1.46888,1.46888,0,0,0,.73509-.12255.44082.44082,0,0,0,.26057-.44274.45312.45312,0,0,0-.29211-.43375.97191.97191,0,0,0-.20678-.063c-.21326-.03806-.42754-.0701-.63973-.11215a.54787.54787,0,0,1-.50172-.60926,2.75864,2.75864,0,0,1,.1773-.901c.1763-.535.414-1.045.64183-1.55913A12.686,12.686,0,0,0,15.85,10.47863a1.58461,1.58461,0,0,0,.04861-.87208,1.04531,1.04531,0,0,0-.85432-.83981,1.60658,1.60658,0,0,0-1.23654.16594.27593.27593,0,0,1-.36286-.03413c-.085-.0747-.16594-.15379-.24918-.23055a.98682.98682,0,0,0-1.33577-.04933,6.1468,6.1468,0,0,1-.4989.41615.47762.47762,0,0,1-.51535.03566c-.17448-.09307-.35512-.175-.53531-.25665a1.74949,1.74949,0,0,0-.56476-.2016,1.69943,1.69943,0,0,0-1.61654.91787,8.05815,8.05815,0,0,0-.32952.80126c-.45471,1.2557-.82507,2.53825-1.20838,3.81639a1.24151,1.24151,0,0,0,.51532,1.44389,1.42659,1.42659,0,0,0,1.22008.17166,1.09728,1.09728,0,0,0,.66994-.69764c.44145-1.04111.839-2.09989,1.25981-3.14926.11581-.28876.22792-.57874.35078-.86438a.44548.44548,0,0,1,.69189-.19539.50521.50521,0,0,1,.15044.43836,1.75625,1.75625,0,0,1-.14731.50453c-.27379.69219-.55265,1.38236-.82766,2.074a2.0836,2.0836,0,0,0-.14038.42876.50719.50719,0,0,0,.27082.57722.87236.87236,0,0,0,.66145.02739.99137.99137,0,0,0,.53406-.532q.61571-1.20914,1.228-2.42031.28423-.55863.57585-1.1133a.87189.87189,0,0,1,.29055-.35253.34987.34987,0,0,1,.37634-.01265.30291.30291,0,0,1,.12434.31459.56716.56716,0,0,1-.04655.1915c-.05318.12739-.10286.25669-.16183.38156-.34118.71775-.68754,1.43273-1.02568,2.152A2.00213,2.00213,0,0,0,12.88816,14.44366Zm4.78568,5.28972a.88573.88573,0,0,0-1.77139.00465.8857.8857,0,0,0,1.77139-.00465Zm-14.83838-7.296a.84329.84329,0,1,0,.00827-1.68655.8433.8433,0,0,0-.00827,1.68655Zm10.366-9.43673a.83506.83506,0,1,0-.0091,1.67.83505.83505,0,0,0,.0091-1.67Zm6.85014,5.22a.71651.71651,0,0,0-1.433.0093.71656.71656,0,0,0,1.433-.0093ZM5.37528,6.17908A.63823.63823,0,1,0,6.015,5.54483.62292.62292,0,0,0,5.37528,6.17908Zm6.68214,14.80843a.54949.54949,0,1,0-.55052.541A.54556.54556,0,0,0,12.05742,20.98752Zm8.53235-8.49689a.54777.54777,0,0,0-.54027.54023.53327.53327,0,0,0,.532.52293.51548.51548,0,0,0,.53272-.5237A.53187.53187,0,0,0,20.58977,12.49063ZM7.82846,2.4715a.44927.44927,0,1,0,.44484.44766A.43821.43821,0,0,0,7.82846,2.4715Zm13.775,7.60492a.41186.41186,0,0,0-.40065.39623.40178.40178,0,0,0,.40168.40168A.38994.38994,0,0,0,22,10.48172.39946.39946,0,0,0,21.60349,10.07642ZM5.79193,17.96207a.40469.40469,0,0,0-.397-.39646.399.399,0,0,0-.396.405.39234.39234,0,0,0,.39939.389A.39857.39857,0,0,0,5.79193,17.96207Z"}))},{name:"medium",attributes:{service:"medium"},title:"Medium",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M20.962,7.257l-5.457,8.867l-3.923-6.375l3.126-5.08c0.112-0.182,0.319-0.286,0.527-0.286c0.05,0,0.1,0.008,0.149,0.02 c0.039,0.01,0.078,0.023,0.114,0.041l5.43,2.715l0.006,0.003c0.004,0.002,0.007,0.006,0.011,0.008 C20.971,7.191,20.98,7.227,20.962,7.257z M9.86,8.592v5.783l5.14,2.57L9.86,8.592z M15.772,17.331l4.231,2.115 C20.554,19.721,21,19.529,21,19.016V8.835L15.772,17.331z M8.968,7.178L3.665,4.527C3.569,4.479,3.478,4.456,3.395,4.456 C3.163,4.456,3,4.636,3,4.938v11.45c0,0.306,0.224,0.669,0.498,0.806l4.671,2.335c0.12,0.06,0.234,0.088,0.337,0.088 c0.29,0,0.494-0.225,0.494-0.602V7.231C9,7.208,8.988,7.188,8.968,7.178z"}))},{name:"patreon",attributes:{service:"patreon"},title:"Patreon",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 569 546",version:"1.1"},(0,ye.createElement)(fe.Circle,{cx:"363",cy:"205",r:"205"}),(0,ye.createElement)(fe.Rect,{width:"100",height:"546",x:"0",y:"0"}))},{name:"pinterest",attributes:{service:"pinterest"},title:"Pinterest",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.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"}))},{name:"pocket",attributes:{service:"pocket"},title:"Pocket",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M21.927,4.194C21.667,3.48,20.982,3,20.222,3h-0.01h-1.721H3.839C3.092,3,2.411,3.47,2.145,4.17 C2.066,4.378,2.026,4.594,2.026,4.814v6.035l0.069,1.2c0.29,2.73,1.707,5.115,3.899,6.778c0.039,0.03,0.079,0.059,0.119,0.089 l0.025,0.018c1.175,0.859,2.491,1.441,3.91,1.727c0.655,0.132,1.325,0.2,1.991,0.2c0.615,0,1.232-0.057,1.839-0.17 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.297,2.621-0.864,3.753-1.691l0.025-0.018 c0.04-0.029,0.08-0.058,0.119-0.089c2.192-1.664,3.609-4.049,3.898-6.778l0.069-1.2V4.814C22.026,4.605,22,4.398,21.927,4.194z M17.692,10.481l-4.704,4.512c-0.266,0.254-0.608,0.382-0.949,0.382c-0.342,0-0.684-0.128-0.949-0.382l-4.705-4.512 C5.838,9.957,5.82,9.089,6.344,8.542c0.524-0.547,1.392-0.565,1.939-0.04l3.756,3.601l3.755-3.601 c0.547-0.524,1.415-0.506,1.939,0.04C18.256,9.089,18.238,9.956,17.692,10.481z"}))},{name:"reddit",attributes:{service:"reddit"},title:"Reddit",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M22,11.816c0-1.256-1.021-2.277-2.277-2.277c-0.593,0-1.122,0.24-1.526,0.614c-1.481-0.965-3.455-1.594-5.647-1.69 l1.171-3.702l3.18,0.748c0.008,1.028,0.846,1.862,1.876,1.862c1.035,0,1.877-0.842,1.877-1.878c0-1.035-0.842-1.877-1.877-1.877 c-0.769,0-1.431,0.466-1.72,1.13l-3.508-0.826c-0.203-0.047-0.399,0.067-0.46,0.261l-1.35,4.268 c-2.316,0.038-4.411,0.67-5.97,1.671C5.368,9.765,4.853,9.539,4.277,9.539C3.021,9.539,2,10.56,2,11.816 c0,0.814,0.433,1.523,1.078,1.925c-0.037,0.221-0.061,0.444-0.061,0.672c0,3.292,4.011,5.97,8.941,5.97s8.941-2.678,8.941-5.97 c0-0.214-0.02-0.424-0.053-0.632C21.533,13.39,22,12.661,22,11.816z M18.776,4.394c0.606,0,1.1,0.493,1.1,1.1s-0.493,1.1-1.1,1.1 s-1.1-0.494-1.1-1.1S18.169,4.394,18.776,4.394z M2.777,11.816c0-0.827,0.672-1.5,1.499-1.5c0.313,0,0.598,0.103,0.838,0.269 c-0.851,0.676-1.477,1.479-1.812,2.36C2.983,12.672,2.777,12.27,2.777,11.816z M11.959,19.606c-4.501,0-8.164-2.329-8.164-5.193 S7.457,9.22,11.959,9.22s8.164,2.329,8.164,5.193S16.46,19.606,11.959,19.606z M20.636,13.001c-0.326-0.89-0.948-1.701-1.797-2.384 c0.248-0.186,0.55-0.301,0.883-0.301c0.827,0,1.5,0.673,1.5,1.5C21.223,12.299,20.992,12.727,20.636,13.001z M8.996,14.704 c-0.76,0-1.397-0.616-1.397-1.376c0-0.76,0.637-1.397,1.397-1.397c0.76,0,1.376,0.637,1.376,1.397 C10.372,14.088,9.756,14.704,8.996,14.704z M16.401,13.328c0,0.76-0.616,1.376-1.376,1.376c-0.76,0-1.399-0.616-1.399-1.376 c0-0.76,0.639-1.397,1.399-1.397C15.785,11.931,16.401,12.568,16.401,13.328z M15.229,16.708c0.152,0.152,0.152,0.398,0,0.55 c-0.674,0.674-1.727,1.002-3.219,1.002c-0.004,0-0.007-0.002-0.011-0.002c-0.004,0-0.007,0.002-0.011,0.002 c-1.492,0-2.544-0.328-3.218-1.002c-0.152-0.152-0.152-0.398,0-0.55c0.152-0.152,0.399-0.151,0.55,0 c0.521,0.521,1.394,0.775,2.669,0.775c0.004,0,0.007,0.002,0.011,0.002c0.004,0,0.007-0.002,0.011-0.002 c1.275,0,2.148-0.253,2.669-0.775C14.831,16.556,15.078,16.556,15.229,16.708z"}))},{name:"skype",attributes:{service:"skype"},title:"Skype",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M10.113,2.699c0.033-0.006,0.067-0.013,0.1-0.02c0.033,0.017,0.066,0.033,0.098,0.051L10.113,2.699z M2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223z M21.275,13.771 c0.007-0.035,0.011-0.071,0.018-0.106c-0.018-0.031-0.033-0.064-0.052-0.095L21.275,13.771z M13.563,21.199 c0.032,0.019,0.065,0.035,0.096,0.053c0.036-0.006,0.071-0.011,0.105-0.017L13.563,21.199z M22,16.386 c0,1.494-0.581,2.898-1.637,3.953c-1.056,1.057-2.459,1.637-3.953,1.637c-0.967,0-1.914-0.251-2.75-0.725 c0.036-0.006,0.071-0.011,0.105-0.017l-0.202-0.035c0.032,0.019,0.065,0.035,0.096,0.053c-0.543,0.096-1.099,0.147-1.654,0.147 c-1.275,0-2.512-0.25-3.676-0.743c-1.125-0.474-2.135-1.156-3.002-2.023c-0.867-0.867-1.548-1.877-2.023-3.002 c-0.493-1.164-0.743-2.401-0.743-3.676c0-0.546,0.049-1.093,0.142-1.628c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103C2.244,9.5,2,8.566,2,7.615c0-1.493,0.582-2.898,1.637-3.953 c1.056-1.056,2.46-1.638,3.953-1.638c0.915,0,1.818,0.228,2.622,0.655c-0.033,0.007-0.067,0.013-0.1,0.02l0.199,0.031 c-0.032-0.018-0.066-0.034-0.098-0.051c0.002,0,0.003-0.001,0.004-0.001c0.586-0.112,1.187-0.169,1.788-0.169 c1.275,0,2.512,0.249,3.676,0.742c1.124,0.476,2.135,1.156,3.002,2.024c0.868,0.867,1.548,1.877,2.024,3.002 c0.493,1.164,0.743,2.401,0.743,3.676c0,0.575-0.054,1.15-0.157,1.712c-0.018-0.031-0.033-0.064-0.052-0.095l0.034,0.201 c0.007-0.035,0.011-0.071,0.018-0.106C21.754,14.494,22,15.432,22,16.386z M16.817,14.138c0-1.331-0.613-2.743-3.033-3.282 l-2.209-0.49c-0.84-0.192-1.807-0.444-1.807-1.237c0-0.794,0.679-1.348,1.903-1.348c2.468,0,2.243,1.696,3.468,1.696 c0.645,0,1.209-0.379,1.209-1.031c0-1.521-2.435-2.663-4.5-2.663c-2.242,0-4.63,0.952-4.63,3.488c0,1.221,0.436,2.521,2.839,3.123 l2.984,0.745c0.903,0.223,1.129,0.731,1.129,1.189c0,0.762-0.758,1.507-2.129,1.507c-2.679,0-2.307-2.062-3.743-2.062 c-0.645,0-1.113,0.444-1.113,1.078c0,1.236,1.501,2.886,4.856,2.886C15.236,17.737,16.817,16.199,16.817,14.138z"}))},{name:"snapchat",attributes:{service:"snapchat"},title:"Snapchat",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M12.065,2a5.526,5.526,0,0,1,3.132.892A5.854,5.854,0,0,1,17.326,5.4a5.821,5.821,0,0,1,.351,2.33q0,.612-.117,2.487a.809.809,0,0,0,.365.091,1.93,1.93,0,0,0,.664-.176,1.93,1.93,0,0,1,.664-.176,1.3,1.3,0,0,1,.729.234.7.7,0,0,1,.351.6.839.839,0,0,1-.41.7,2.732,2.732,0,0,1-.9.41,3.192,3.192,0,0,0-.9.378.728.728,0,0,0-.41.618,1.575,1.575,0,0,0,.156.56,6.9,6.9,0,0,0,1.334,1.953,5.6,5.6,0,0,0,1.881,1.315,5.875,5.875,0,0,0,1.042.3.42.42,0,0,1,.365.456q0,.911-2.852,1.341a1.379,1.379,0,0,0-.143.507,1.8,1.8,0,0,1-.182.605.451.451,0,0,1-.429.241,5.878,5.878,0,0,1-.807-.085,5.917,5.917,0,0,0-.833-.085,4.217,4.217,0,0,0-.807.065,2.42,2.42,0,0,0-.82.293,6.682,6.682,0,0,0-.755.5q-.351.267-.755.527a3.886,3.886,0,0,1-.989.436A4.471,4.471,0,0,1,11.831,22a4.307,4.307,0,0,1-1.256-.176,3.784,3.784,0,0,1-.976-.436q-.4-.26-.749-.527a6.682,6.682,0,0,0-.755-.5,2.422,2.422,0,0,0-.807-.293,4.432,4.432,0,0,0-.82-.065,5.089,5.089,0,0,0-.853.1,5,5,0,0,1-.762.1.474.474,0,0,1-.456-.241,1.819,1.819,0,0,1-.182-.618,1.411,1.411,0,0,0-.143-.521q-2.852-.429-2.852-1.341a.42.42,0,0,1,.365-.456,5.793,5.793,0,0,0,1.042-.3,5.524,5.524,0,0,0,1.881-1.315,6.789,6.789,0,0,0,1.334-1.953A1.575,1.575,0,0,0,6,12.9a.728.728,0,0,0-.41-.618,3.323,3.323,0,0,0-.9-.384,2.912,2.912,0,0,1-.9-.41.814.814,0,0,1-.41-.684.71.71,0,0,1,.338-.593,1.208,1.208,0,0,1,.716-.241,1.976,1.976,0,0,1,.625.169,2.008,2.008,0,0,0,.69.169.919.919,0,0,0,.416-.091q-.117-1.849-.117-2.474A5.861,5.861,0,0,1,6.385,5.4,5.516,5.516,0,0,1,8.625,2.819,7.075,7.075,0,0,1,12.062,2Z"}))},{name:"soundcloud",attributes:{service:"soundcloud"},title:"SoundCloud",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M8.9,16.1L9,14L8.9,9.5c0-0.1,0-0.1-0.1-0.1c0,0-0.1-0.1-0.1-0.1c-0.1,0-0.1,0-0.1,0.1c0,0-0.1,0.1-0.1,0.1L8.3,14l0.1,2.1 c0,0.1,0,0.1,0.1,0.1c0,0,0.1,0.1,0.1,0.1C8.8,16.3,8.9,16.3,8.9,16.1z M11.4,15.9l0.1-1.8L11.4,9c0-0.1,0-0.2-0.1-0.2 c0,0-0.1,0-0.1,0s-0.1,0-0.1,0c-0.1,0-0.1,0.1-0.1,0.2l0,0.1l-0.1,5c0,0,0,0.7,0.1,2v0c0,0.1,0,0.1,0.1,0.1c0.1,0.1,0.1,0.1,0.2,0.1 c0.1,0,0.1,0,0.2-0.1c0.1,0,0.1-0.1,0.1-0.2L11.4,15.9z M2.4,12.9L2.5,14l-0.2,1.1c0,0.1,0,0.1-0.1,0.1c0,0-0.1,0-0.1-0.1L2.1,14 l0.1-1.1C2.2,12.9,2.3,12.9,2.4,12.9C2.3,12.9,2.4,12.9,2.4,12.9z M3.1,12.2L3.3,14l-0.2,1.8c0,0.1,0,0.1-0.1,0.1 c-0.1,0-0.1,0-0.1-0.1L2.8,14L3,12.2C3,12.2,3,12.2,3.1,12.2C3.1,12.2,3.1,12.2,3.1,12.2z M3.9,11.9L4.1,14l-0.2,2.1 c0,0.1,0,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L3.5,14l0.2-2.1c0-0.1,0-0.1,0.1-0.1C3.9,11.8,3.9,11.8,3.9,11.9z M4.7,11.9L4.9,14 l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L4.3,14l0.2-2.2c0-0.1,0-0.1,0.1-0.1C4.7,11.7,4.7,11.8,4.7,11.9z M5.6,12 l0.2,2l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c0,0-0.1,0-0.1,0c0,0,0-0.1,0-0.1L5.1,14l0.2-2c0,0,0-0.1,0-0.1s0.1,0,0.1,0 C5.5,11.9,5.5,11.9,5.6,12L5.6,12z M6.4,10.7L6.6,14l-0.2,2.1c0,0,0,0.1,0,0.1c0,0-0.1,0-0.1,0c-0.1,0-0.1-0.1-0.2-0.2L5.9,14 l0.2-3.3c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0C6.4,10.7,6.4,10.7,6.4,10.7z M7.2,10l0.2,4.1l-0.2,2.1c0,0,0,0.1,0,0.1 c0,0-0.1,0-0.1,0c-0.1,0-0.2-0.1-0.2-0.2l-0.1-2.1L6.8,10c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0S7.2,9.9,7.2,10z M8,9.6L8.2,14 L8,16.1c0,0.1-0.1,0.2-0.2,0.2c-0.1,0-0.2-0.1-0.2-0.2L7.5,14l0.1-4.4c0-0.1,0-0.1,0.1-0.1c0,0,0.1-0.1,0.1-0.1c0.1,0,0.1,0,0.1,0.1 C8,9.6,8,9.6,8,9.6z M11.4,16.1L11.4,16.1L11.4,16.1z M9.7,9.6L9.8,14l-0.1,2.1c0,0.1,0,0.1-0.1,0.2s-0.1,0.1-0.2,0.1 c-0.1,0-0.1,0-0.1-0.1s-0.1-0.1-0.1-0.2L9.2,14l0.1-4.4c0-0.1,0-0.1,0.1-0.2s0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S9.7,9.5,9.7,9.6 L9.7,9.6z M10.6,9.8l0.1,4.3l-0.1,2c0,0.1,0,0.1-0.1,0.2c0,0-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c0,0-0.1-0.1-0.1-0.2L10,14 l0.1-4.3c0-0.1,0-0.1,0.1-0.2c0,0,0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S10.6,9.7,10.6,9.8z M12.4,14l-0.1,2c0,0.1,0,0.1-0.1,0.2 c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2l-0.1-1l-0.1-1l0.1-5.5v0c0-0.1,0-0.2,0.1-0.2 c0.1,0,0.1-0.1,0.2-0.1c0,0,0.1,0,0.1,0c0.1,0,0.1,0.1,0.1,0.2L12.4,14z M22.1,13.9c0,0.7-0.2,1.3-0.7,1.7c-0.5,0.5-1.1,0.7-1.7,0.7 h-6.8c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2V8.2c0-0.1,0.1-0.2,0.2-0.3c0.5-0.2,1-0.3,1.6-0.3c1.1,0,2.1,0.4,2.9,1.1 c0.8,0.8,1.3,1.7,1.4,2.8c0.3-0.1,0.6-0.2,1-0.2c0.7,0,1.3,0.2,1.7,0.7C21.8,12.6,22.1,13.2,22.1,13.9L22.1,13.9z"}))},{name:"spotify",attributes:{service:"spotify"},title:"Spotify",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2 M16.586,16.424 c-0.18,0.295-0.563,0.387-0.857,0.207c-2.348-1.435-5.304-1.76-8.785-0.964c-0.335,0.077-0.67-0.133-0.746-0.469 c-0.077-0.335,0.132-0.67,0.469-0.746c3.809-0.871,7.077-0.496,9.713,1.115C16.673,15.746,16.766,16.13,16.586,16.424 M17.81,13.7 c-0.226,0.367-0.706,0.482-1.072,0.257c-2.687-1.652-6.785-2.131-9.965-1.166C6.36,12.917,5.925,12.684,5.8,12.273 C5.675,11.86,5.908,11.425,6.32,11.3c3.632-1.102,8.147-0.568,11.234,1.328C17.92,12.854,18.035,13.335,17.81,13.7 M17.915,10.865 c-3.223-1.914-8.54-2.09-11.618-1.156C5.804,9.859,5.281,9.58,5.131,9.086C4.982,8.591,5.26,8.069,5.755,7.919 c3.532-1.072,9.404-0.865,13.115,1.338c0.445,0.264,0.59,0.838,0.327,1.282C18.933,10.983,18.359,11.129,17.915,10.865"}))},{name:"telegram",attributes:{service:"telegram"},title:"Telegram",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 128 128",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M28.9700376,63.3244248 C47.6273373,55.1957357 60.0684594,49.8368063 66.2934036,47.2476366 C84.0668845,39.855031 87.7600616,38.5708563 90.1672227,38.528 C90.6966555,38.5191258 91.8804274,38.6503351 92.6472251,39.2725385 C93.294694,39.7979149 93.4728387,40.5076237 93.5580865,41.0057381 C93.6433345,41.5038525 93.7494885,42.63857 93.6651041,43.5252052 C92.7019529,53.6451182 88.5344133,78.2034783 86.4142057,89.5379542 C85.5170662,94.3339958 83.750571,95.9420841 82.0403991,96.0994568 C78.3237996,96.4414641 75.5015827,93.6432685 71.9018743,91.2836143 C66.2690414,87.5912212 63.0868492,85.2926952 57.6192095,81.6896017 C51.3004058,77.5256038 55.3966232,75.2369981 58.9976911,71.4967761 C59.9401076,70.5179421 76.3155302,55.6232293 76.6324771,54.2720454 C76.6721165,54.1030573 76.7089039,53.4731496 76.3346867,53.1405352 C75.9604695,52.8079208 75.4081573,52.921662 75.0095933,53.0121213 C74.444641,53.1403447 65.4461175,59.0880351 48.0140228,70.8551922 C45.4598218,72.6091037 43.1463059,73.4636682 41.0734751,73.4188859 C38.7883453,73.3695169 34.3926725,72.1268388 31.1249416,71.0646282 C27.1169366,69.7617838 23.931454,69.0729605 24.208838,66.8603276 C24.3533167,65.7078514 25.9403832,64.5292172 28.9700376,63.3244248 Z"}))},{name:"tiktok",attributes:{service:"tiktok"},title:"TikTok",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 32 32",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M16.708 0.027c1.745-0.027 3.48-0.011 5.213-0.027 0.105 2.041 0.839 4.12 2.333 5.563 1.491 1.479 3.6 2.156 5.652 2.385v5.369c-1.923-0.063-3.855-0.463-5.6-1.291-0.76-0.344-1.468-0.787-2.161-1.24-0.009 3.896 0.016 7.787-0.025 11.667-0.104 1.864-0.719 3.719-1.803 5.255-1.744 2.557-4.771 4.224-7.88 4.276-1.907 0.109-3.812-0.411-5.437-1.369-2.693-1.588-4.588-4.495-4.864-7.615-0.032-0.667-0.043-1.333-0.016-1.984 0.24-2.537 1.495-4.964 3.443-6.615 2.208-1.923 5.301-2.839 8.197-2.297 0.027 1.975-0.052 3.948-0.052 5.923-1.323-0.428-2.869-0.308-4.025 0.495-0.844 0.547-1.485 1.385-1.819 2.333-0.276 0.676-0.197 1.427-0.181 2.145 0.317 2.188 2.421 4.027 4.667 3.828 1.489-0.016 2.916-0.88 3.692-2.145 0.251-0.443 0.532-0.896 0.547-1.417 0.131-2.385 0.079-4.76 0.095-7.145 0.011-5.375-0.016-10.735 0.025-16.093z"}))},{name:"tumblr",attributes:{service:"tumblr"},title:"Tumblr",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M17.04 21.28h-3.28c-2.84 0-4.94-1.37-4.94-5.02v-5.67H6.08V7.5c2.93-.73 4.11-3.3 4.3-5.48h3.01v4.93h3.47v3.65H13.4v4.93c0 1.47.73 2.01 1.92 2.01h1.73v3.75z"}))},{name:"twitch",attributes:{service:"twitch"},title:"Twitch",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M16.499,8.089h-1.636v4.91h1.636V8.089z M12,8.089h-1.637v4.91H12V8.089z M4.228,3.178L3,6.451v13.092h4.499V22h2.456 l2.454-2.456h3.681L21,14.636V3.178H4.228z M19.364,13.816l-2.864,2.865H12l-2.453,2.453V16.68H5.863V4.814h13.501V13.816z"}))},{name:"twitter",attributes:{service:"twitter"},title:"Twitter",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z"}))},{name:"vimeo",attributes:{service:"vimeo"},title:"Vimeo",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z"}))},{name:"vk",attributes:{service:"vk"},title:"VK",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M22,7.1c0.2,0.4-0.4,1.5-1.6,3.1c-0.2,0.2-0.4,0.5-0.7,0.9c-0.5,0.7-0.9,1.1-0.9,1.4c-0.1,0.3-0.1,0.6,0.1,0.8 c0.1,0.1,0.4,0.4,0.8,0.9h0l0,0c1,0.9,1.6,1.7,2,2.3c0,0,0,0.1,0.1,0.1c0,0.1,0,0.1,0.1,0.3c0,0.1,0,0.2,0,0.4 c0,0.1-0.1,0.2-0.3,0.3c-0.1,0.1-0.4,0.1-0.6,0.1l-2.7,0c-0.2,0-0.4,0-0.6-0.1c-0.2-0.1-0.4-0.1-0.5-0.2l-0.2-0.1 c-0.2-0.1-0.5-0.4-0.7-0.7s-0.5-0.6-0.7-0.8c-0.2-0.2-0.4-0.4-0.6-0.6C14.8,15,14.6,15,14.4,15c0,0,0,0-0.1,0c0,0-0.1,0.1-0.2,0.2 c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.1-0.1,0.3-0.2,0.5c-0.1,0.2-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.1-0.1,0.2-0.1,0.2l0,0.1 c-0.1,0.1-0.3,0.2-0.6,0.2h-1.2c-0.5,0-1,0-1.5-0.2c-0.5-0.1-1-0.3-1.4-0.6s-0.7-0.5-1.1-0.7s-0.6-0.4-0.7-0.6l-0.3-0.3 c-0.1-0.1-0.2-0.2-0.3-0.3s-0.4-0.5-0.7-0.9s-0.7-1-1.1-1.6c-0.4-0.6-0.8-1.3-1.3-2.2C2.9,9.4,2.5,8.5,2.1,7.5C2,7.4,2,7.3,2,7.2 c0-0.1,0-0.1,0-0.2l0-0.1c0.1-0.1,0.3-0.2,0.6-0.2l2.9,0c0.1,0,0.2,0,0.2,0.1S5.9,6.9,5.9,7L6,7c0.1,0.1,0.2,0.2,0.3,0.3 C6.4,7.7,6.5,8,6.7,8.4C6.9,8.8,7,9,7.1,9.2l0.2,0.3c0.2,0.4,0.4,0.8,0.6,1.1c0.2,0.3,0.4,0.5,0.5,0.7s0.3,0.3,0.4,0.4 c0.1,0.1,0.3,0.1,0.4,0.1c0.1,0,0.2,0,0.3-0.1c0,0,0,0,0.1-0.1c0,0,0.1-0.1,0.1-0.2c0.1-0.1,0.1-0.3,0.1-0.5c0-0.2,0.1-0.5,0.1-0.8 c0-0.4,0-0.8,0-1.3c0-0.3,0-0.5-0.1-0.8c0-0.2-0.1-0.4-0.1-0.5L9.6,7.6C9.4,7.3,9.1,7.2,8.7,7.1C8.6,7.1,8.6,7,8.7,6.9 C8.9,6.7,9,6.6,9.1,6.5c0.4-0.2,1.2-0.3,2.5-0.3c0.6,0,1,0.1,1.4,0.1c0.1,0,0.3,0.1,0.3,0.1c0.1,0.1,0.2,0.1,0.2,0.3 c0,0.1,0.1,0.2,0.1,0.3s0,0.3,0,0.5c0,0.2,0,0.4,0,0.6c0,0.2,0,0.4,0,0.7c0,0.3,0,0.6,0,0.9c0,0.1,0,0.2,0,0.4c0,0.2,0,0.4,0,0.5 c0,0.1,0,0.3,0,0.4s0.1,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.3-0.1c0.1-0.1,0.2-0.2,0.4-0.4 s0.3-0.4,0.5-0.7c0.2-0.3,0.5-0.7,0.7-1.1c0.4-0.7,0.8-1.5,1.1-2.3c0-0.1,0.1-0.1,0.1-0.2c0-0.1,0.1-0.1,0.1-0.1l0,0l0.1,0 c0,0,0,0,0.1,0s0.2,0,0.2,0l3,0c0.3,0,0.5,0,0.7,0S21.9,7,21.9,7L22,7.1z"}))},{name:"yelp",attributes:{service:"yelp"},title:"Yelp",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z"}))},{name:"youtube",attributes:{service:"youtube"},title:"YouTube",icon:()=>(0,ye.createElement)(fe.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,ye.createElement)(fe.Path,{d:"M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"}))}];sg.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.service===t.service)}));var cg=sg;const ug=e=>{let{url:t,setAttributes:n,setPopover:o,anchorRef:r}=e;return(0,ye.createElement)(Ee.URLPopover,{anchorRef:null==r?void 0:r.current,onClose:()=>o(!1)},(0,ye.createElement)("form",{className:"block-editor-url-popover__link-editor",onSubmit:e=>{e.preventDefault(),o(!1)}},(0,ye.createElement)("div",{className:"block-editor-url-input"},(0,ye.createElement)(Ee.URLInput,{value:t,onChange:e=>n({url:e}),placeholder:(0,we.__)("Enter address"),disableSuggestions:!0})),(0,ye.createElement)(ke.Button,{icon:lg,label:(0,we.__)("Apply"),type:"submit"})))};var mg=e=>{let{attributes:t,context:n,isSelected:o,setAttributes:r}=e;const{url:a,service:l,label:i}=t,{iconColorValue:s,iconBackgroundColorValue:c}=n,[u,m]=(0,ye.useState)(!1),d=nt()("wp-social-link","wp-social-link-"+l,{"wp-social-link__is-incomplete":!a}),p=(0,ye.useRef)(),g=(e=>{const t=(0,Le.find)(cg,{name:e});return t?t.icon:ig})(l),h=(e=>{const t=(0,Le.find)(cg,{name:e});return t?t.title:(0,we.__)("Social Icon")})(l),v=(0,Ee.useBlockProps)({className:d,style:{color:s,backgroundColor:c}});return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.sprintf)((0,we.__)("%s label"),h),initialOpen:!1},(0,ye.createElement)(ke.PanelRow,null,(0,ye.createElement)(ke.TextControl,{label:(0,we.__)("Link label"),help:(0,we.__)("Briefly describe the link to help screen reader users."),value:i,onChange:e=>r({label:e})})))),(0,ye.createElement)("li",v,(0,ye.createElement)(ke.Button,{ref:p,onClick:()=>m(!0)},(0,ye.createElement)(g,null),o&&u&&(0,ye.createElement)(ug,{url:a,setAttributes:r,setPopover:m,anchorRef:p}))))};const dg={apiVersion:2,name:"core/social-link",title:"Social Icon",category:"widgets",parent:["core/social-links"],description:"Display an icon linking to a social media profile or website.",textdomain:"default",attributes:{url:{type:"string"},service:{type:"string"},label:{type:"string"}},usesContext:["openInNewTab","iconColorValue","iconBackgroundColorValue"],supports:{reusable:!1,html:!1},editorStyle:"wp-block-social-link-editor"},{name:pg}=dg,gg={icon:ag,edit:mg,variations:cg},hg=[{attributes:{iconColor:{type:"string"},customIconColor:{type:"string"},iconColorValue:{type:"string"},iconBackgroundColor:{type:"string"},customIconBackgroundColor:{type:"string"},iconBackgroundColorValue:{type:"string"},openInNewTab:{type:"boolean",default:!1},size:{type:"string"}},providesContext:{openInNewTab:"openInNewTab"},supports:{align:["left","center","right"],anchor:!0},migrate:e=>{var t,n;if(e.layout)return e;const{className:o}=e,r="items-justified-",a=new RegExp(`\\b${r}[^ ]*[ ]?\\b`,"g"),l={...e,className:null==o?void 0:o.replace(a,"").trim()},i=null==o||null===(t=o.match(a))||void 0===t||null===(n=t[0])||void 0===n?void 0:n.trim();return i&&Object.assign(l,{layout:{type:"flex",justifyContent:i.slice(r.length)}}),l},save:e=>{const{attributes:{iconBackgroundColorValue:t,iconColorValue:n,itemsJustification:o,size:r}}=e,a=nt()(r,{"has-icon-color":n,"has-icon-background-color":t,[`items-justified-${o}`]:o}),l={"--wp--social-links--icon-color":n,"--wp--social-links--icon-background-color":t};return(0,ye.createElement)("ul",Ee.useBlockProps.save({className:a,style:l}),(0,ye.createElement)(Ee.InnerBlocks.Content,null))}}];var vg=hg;var bg=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));const yg=["core/social-link"],fg=[{name:(0,we.__)("Small"),value:"has-small-icon-size"},{name:(0,we.__)("Normal"),value:"has-normal-icon-size"},{name:(0,we.__)("Large"),value:"has-large-icon-size"},{name:(0,we.__)("Huge"),value:"has-huge-icon-size"}];var _g=(0,Ee.withColors)({iconColor:"icon-color",iconBackgroundColor:"icon-background-color"})((function(e){var t;const{name:n,attributes:o,iconBackgroundColor:r,iconColor:a,isSelected:l,setAttributes:i,setIconBackgroundColor:s,setIconColor:c}=e,{iconBackgroundColorValue:u,iconColorValue:m,openInNewTab:d,size:p,layout:g}=o,h=g||(e=>{const t=(0,be.getBlockSupport)(e,"__experimentalLayout");return null==t?void 0:t.default})(n),v=(null===(t=o.className)||void 0===t?void 0:t.indexOf("is-style-logos-only"))>=0;(0,ye.useEffect)((()=>{v&&i({iconBackgroundColor:void 0,customIconBackgroundColor:void 0,iconBackgroundColorValue:void 0})}),[v,i]);const b=(0,ye.createElement)("li",{className:"wp-block-social-links__social-placeholder"},(0,ye.createElement)("div",{className:"wp-social-link"}),(0,ye.createElement)("div",{className:"wp-block-social-links__social-placeholder-icons"},(0,ye.createElement)("div",{className:"wp-social-link wp-social-link-twitter"}),(0,ye.createElement)("div",{className:"wp-social-link wp-social-link-facebook"}),(0,ye.createElement)("div",{className:"wp-social-link wp-social-link-instagram"}))),y=(0,ye.createElement)("li",{className:"wp-block-social-links__social-prompt"},(0,we.__)("Click plus to add")),f=nt()(p,{"has-icon-color":a.color||m,"has-icon-background-color":r.color||u}),_=(0,Ee.useBlockProps)({className:f}),k=(0,Ee.useInnerBlocksProps)(_,{allowedBlocks:yg,placeholder:l?y:b,templateLock:!1,__experimentalAppenderTagName:"li",__experimentalLayout:h});return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,{group:"other"},(0,ye.createElement)(ke.ToolbarDropdownMenu,{label:(0,we.__)("Size"),text:(0,we.__)("Size"),icon:null,popoverProps:{position:"bottom right"}},(e=>{let{onClose:t}=e;return(0,ye.createElement)(ke.MenuGroup,null,fg.map((e=>(0,ye.createElement)(ke.MenuItem,{icon:(p===e.value||!p&&"has-normal-icon-size"===e.value)&&bg,isSelected:p===e.value,key:e.value,onClick:()=>{i({size:e.value})},onClose:t,role:"menuitemradio"},e.name))))}))),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Link settings")},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Open links in new tab"),checked:d,onChange:()=>i({openInNewTab:!d})})),(0,ye.createElement)(Ee.PanelColorSettings,{__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,title:(0,we.__)("Color"),colorSettings:[{value:a.color||m,onChange:e=>{c(e),i({iconColorValue:e})},label:(0,we.__)("Icon color")},!v&&{value:r.color||u,onChange:e=>{s(e),i({iconBackgroundColorValue:e})},label:(0,we.__)("Icon background")}]}),!v&&(0,ye.createElement)(Ee.ContrastChecker,{textColor:m,backgroundColor:u,isLargeText:!1})),(0,ye.createElement)("ul",k))}));const kg={apiVersion:2,name:"core/social-links",title:"Social Icons",category:"widgets",description:"Display icons linking to your social media profiles or websites.",keywords:["links"],textdomain:"default",attributes:{iconColor:{type:"string"},customIconColor:{type:"string"},iconColorValue:{type:"string"},iconBackgroundColor:{type:"string"},customIconBackgroundColor:{type:"string"},iconBackgroundColorValue:{type:"string"},openInNewTab:{type:"boolean",default:!1},size:{type:"string"}},providesContext:{openInNewTab:"openInNewTab",iconColorValue:"iconColorValue",iconBackgroundColorValue:"iconBackgroundColorValue"},supports:{align:["left","center","right"],anchor:!0,__experimentalExposeControlsToChildren:!0,__experimentalLayout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}},spacing:{blockGap:!0,margin:["top","bottom"],units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"logos-only",label:"Logos Only"},{name:"pill-shape",label:"Pill Shape"}],editorStyle:"wp-block-social-links-editor",style:"wp-block-social-links"},{name:wg}=kg,Eg={example:{innerBlocks:[{name:"core/social-link",attributes:{service:"wordpress",url:"https://wordpress.org"}},{name:"core/social-link",attributes:{service:"facebook",url:"https://www.facebook.com/WordPress/"}},{name:"core/social-link",attributes:{service:"twitter",url:"https://twitter.com/WordPress"}}]},icon:ag,edit:_g,save:function(e){const{attributes:{iconBackgroundColorValue:t,iconColorValue:n,size:o}}=e,r=nt()(o,{"has-icon-color":n,"has-icon-background-color":t}),a=Ee.useBlockProps.save({className:r}),l=Ee.useInnerBlocksProps.save(a);return(0,ye.createElement)("ul",l)},deprecated:vg};var Cg=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M12.5 4.2v1.6h4.7L5.8 17.2V12H4.2v7.8H12v-1.6H6.8L18.2 6.8v4.7h1.6V4.2z"}));const xg=[{attributes:{height:{type:"number",default:100},width:{type:"number"}},migrate(e){const{height:t,width:n}=e;return{...e,width:void 0!==n?`${n}px`:void 0,height:void 0!==t?`${t}px`:void 0}},save(e){let{attributes:t}=e;return(0,ye.createElement)("div",Ee.useBlockProps.save({style:{height:t.height,width:t.width},"aria-hidden":!0}))}}];var Sg=xg;function Bg(e){var t;let{label:n,onChange:o,isResizing:r,value:a=""}=e;const[l,i]=(0,ye.useState)(null),s=(0,ot.useInstanceId)(ke.__experimentalUnitControl,"block-spacer-height-input"),c=null===(t=(0,Ee.useSetting)("spacing.units")||void 0)||void 0===t?void 0:t.filter((e=>"%"!==e)),u=(0,ke.__experimentalUseCustomUnits)({availableUnits:c||["px","em","rem","vw","vh"],defaultValues:{px:"100",em:"10",rem:"10",vw:"10",vh:"25"}}),m=null!==l?l:a;return(0,ye.createElement)(ke.BaseControl,{label:n,id:s},(0,ye.createElement)(ke.__experimentalUnitControl,{id:s,isResetValueOnUnitChange:!0,min:0,max:Ng,onBlur:()=>{null!==l&&i(null)},onChange:e=>{i(null),o(e)},style:{maxWidth:80},value:m,units:u,unit:r?"px":void 0}))}function Tg(e){let{setAttributes:t,orientation:n,height:o,width:r,isResizing:a}=e;return(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Spacer settings")},"horizontal"===n&&(0,ye.createElement)(Bg,{label:(0,we.__)("Width"),value:r,onChange:e=>t({width:e}),isResizing:a}),"horizontal"!==n&&(0,ye.createElement)(Bg,{label:(0,we.__)("Height"),value:o,onChange:e=>t({height:e}),isResizing:a})))}const Ng=500,zg=e=>{let{orientation:t,onResizeStart:n,onResize:o,onResizeStop:r,isSelected:a,isResizing:l,setIsResizing:i,...s}=e;const c=e=>"horizontal"===t?e.clientWidth:e.clientHeight,u=e=>`${c(e)}px`;return(0,ye.createElement)(ke.ResizableBox,gt({className:nt()("block-library-spacer__resize-container",{"resize-horizontal":"horizontal"===t,"is-resizing":l,"is-selected":a}),onResizeStart:(e,t,r)=>{const a=u(r);n(a),o(a)},onResize:(e,t,n)=>{o(u(n)),l||i(!0)},onResizeStop:(e,t,n)=>{const o=Math.min(Ng,c(n));r(`${o}px`),i(!1)},__experimentalShowTooltip:!0,__experimentalTooltipProps:{axis:"horizontal"===t?"x":"y",position:"corner",isVisible:l},showHandle:a},s))};var Pg=(0,ot.compose)([(0,Ie.withDispatch)((e=>{const{toggleSelection:t}=e(Ee.store);return{onResizeStart:()=>t(!1),onResizeStop:()=>t(!0)}})),ot.withInstanceId])((e=>{let{attributes:t,isSelected:n,setAttributes:o,onResizeStart:r,onResizeStop:a,context:l}=e;const{orientation:i}=l,{height:s,width:c}=t,[u,m]=(0,ye.useState)(!1),[d,p]=(0,ye.useState)(null),[g,h]=(0,ye.useState)(null),v=e=>{a(),o({height:e}),p(null)},b=e=>{a(),o({width:e}),h(null)},y={height:"horizontal"===i?24:d||s||void 0,width:"horizontal"===i&&(g||c)||void 0};return(0,ye.useEffect)((()=>{"horizontal"!==i||c||o({height:"0px",width:"72px"})}),[]),(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(fe.View,(0,Ee.useBlockProps)({style:y}),"horizontal"===(f=i)?(0,ye.createElement)(zg,{minWidth:1,enable:{top:!1,right:!0,bottom:!1,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},orientation:f,onResizeStart:r,onResize:h,onResizeStop:b,isSelected:n,isResizing:u,setIsResizing:m}):(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(zg,{enable:{top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},orientation:f,onResizeStart:r,onResize:p,onResizeStop:v,isSelected:n,isResizing:u,setIsResizing:m}))),(0,ye.createElement)(Tg,{setAttributes:o,height:d||s,width:g||c,orientation:i,isResizing:u}));var f}));const Ig={apiVersion:2,name:"core/spacer",title:"Spacer",category:"design",description:"Add white space between blocks and customize its height.",textdomain:"default",attributes:{height:{type:"string",default:"100px"},width:{type:"string"}},usesContext:["orientation"],supports:{anchor:!0},editorStyle:"wp-block-spacer-editor",style:"wp-block-spacer"},{name:Mg}=Ig,Rg={icon:Cg,edit:Pg,save:function(e){let{attributes:{height:t,width:n}}=e;return(0,ye.createElement)("div",Ee.useBlockProps.save({style:{height:t,width:n},"aria-hidden":!0}))},deprecated:Sg};var Lg=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z"}));const Vg={"subtle-light-gray":"#f3f4f5","subtle-pale-green":"#e9fbe5","subtle-pale-blue":"#e7f5fe","subtle-pale-pink":"#fcf0ef"},Hg=[{attributes:{hasFixedLayout:{type:"boolean",default:!1},backgroundColor:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption",default:""},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}}},supports:{anchor:!0,align:!0,__experimentalSelector:".wp-block-table > table"},save:e=>{let{attributes:t}=e;const{hasFixedLayout:n,head:o,body:r,foot:a,backgroundColor:l,caption:i}=t;if(!o.length&&!r.length&&!a.length)return null;const s=(0,Ee.getColorClassName)("background-color",l),c=nt()(s,{"has-fixed-layout":n,"has-background":!!s}),u=!Ee.RichText.isEmpty(i),m=e=>{let{type:t,rows:n}=e;if(!n.length)return null;const o=`t${t}`;return(0,ye.createElement)(o,null,n.map(((e,t)=>{let{cells:n}=e;return(0,ye.createElement)("tr",{key:t},n.map(((e,t)=>{let{content:n,tag:o,scope:r,align:a}=e;const l=nt()({[`has-text-align-${a}`]:a});return(0,ye.createElement)(Ee.RichText.Content,{className:l||void 0,"data-align":a,tagName:o,value:n,key:t,scope:"th"===o?r:void 0})})))})))};return(0,ye.createElement)("figure",Ee.useBlockProps.save(),(0,ye.createElement)("table",{className:""===c?void 0:c},(0,ye.createElement)(m,{type:"head",rows:o}),(0,ye.createElement)(m,{type:"body",rows:r}),(0,ye.createElement)(m,{type:"foot",rows:a})),u&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:i}))},isEligible:e=>e.backgroundColor&&!e.style,migrate:e=>({...e,backgroundColor:void 0,style:{color:{background:Vg[e.backgroundColor]}}})},{attributes:{hasFixedLayout:{type:"boolean",default:!1},backgroundColor:{type:"string"},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"}}}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"}}}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"}}}}}},supports:{align:!0},save(e){let{attributes:t}=e;const{hasFixedLayout:n,head:o,body:r,foot:a,backgroundColor:l}=t;if(!o.length&&!r.length&&!a.length)return null;const i=(0,Ee.getColorClassName)("background-color",l),s=nt()(i,{"has-fixed-layout":n,"has-background":!!i}),c=e=>{let{type:t,rows:n}=e;if(!n.length)return null;const o=`t${t}`;return(0,ye.createElement)(o,null,n.map(((e,t)=>{let{cells:n}=e;return(0,ye.createElement)("tr",{key:t},n.map(((e,t)=>{let{content:n,tag:o,scope:r}=e;return(0,ye.createElement)(Ee.RichText.Content,{tagName:o,value:n,key:t,scope:"th"===o?r:void 0})})))})))};return(0,ye.createElement)("table",{className:s},(0,ye.createElement)(c,{type:"head",rows:o}),(0,ye.createElement)(c,{type:"body",rows:r}),(0,ye.createElement)(c,{type:"foot",rows:a}))}}];var Ag=Hg;var Fg=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"}));var Dg=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"}));var Gg=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));var Ug=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,ye.createElement)(fe.Path,{d:"M6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84zM6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84z"}));var Og=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,ye.createElement)(fe.Path,{d:"M13.824 10.176h-2.88v-2.88H9.536v2.88h-2.88v1.344h2.88v2.88h1.408v-2.88h2.88zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm6.4 0H7.68v3.84h5.12V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.056H1.28v9.024H19.2V6.336z"}));var qg=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,ye.createElement)(fe.Path,{d:"M17.728 11.456L14.592 8.32l3.2-3.2-1.536-1.536-3.2 3.2L9.92 3.648 8.384 5.12l3.2 3.2-3.264 3.264 1.536 1.536 3.264-3.264 3.136 3.136 1.472-1.536zM0 17.92V0h20.48v17.92H0zm19.2-6.4h-.448l-1.28-1.28H19.2V6.4h-1.792l1.28-1.28h.512V1.28H1.28v3.84h6.208l1.28 1.28H1.28v3.84h7.424l-1.28 1.28H1.28v3.84H19.2v-3.84z"}));var $g=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,ye.createElement)(fe.Path,{d:"M6.4 3.776v3.648H2.752v1.792H6.4v3.648h1.728V9.216h3.712V7.424H8.128V3.776zM0 17.92V0h20.48v17.92H0zM12.8 1.28H1.28v14.08H12.8V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.12h-5.12v3.84h5.12V6.4zm0 5.12h-5.12v3.84h5.12v-3.84z"}));var Wg=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,ye.createElement)(fe.Path,{d:"M14.08 12.864V9.216h3.648V7.424H14.08V3.776h-1.728v3.648H8.64v1.792h3.712v3.648zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm0 5.12H1.28v3.84H6.4V6.4zm0 5.12H1.28v3.84H6.4v-3.84zM19.2 1.28H7.68v14.08H19.2V1.28z"}));var jg=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,ye.createElement)(fe.Path,{d:"M6.4 9.98L7.68 8.7v-.256L6.4 7.164V9.98zm6.4-1.532l1.28-1.28V9.92L12.8 8.64v-.192zm7.68 9.472V0H0v17.92h20.48zm-1.28-2.56h-5.12v-1.024l-.256.256-1.024-1.024v1.792H7.68v-1.792l-1.024 1.024-.256-.256v1.024H1.28V1.28H6.4v2.368l.704-.704.576.576V1.216h5.12V3.52l.96-.96.32.32V1.216h5.12V15.36zm-5.76-2.112l-3.136-3.136-3.264 3.264-1.536-1.536 3.264-3.264L5.632 5.44l1.536-1.536 3.136 3.136 3.2-3.2 1.536 1.536-3.2 3.2 3.136 3.136-1.536 1.536z"}));var Zg=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z"}));const Kg=["align"];function Qg(e,t,n){if(!t)return e;const o=(0,Le.pick)(e,["head","body","foot"]),{sectionName:r,rowIndex:a}=t;return(0,Le.mapValues)(o,((e,o)=>r&&r!==o?e:e.map(((e,r)=>a&&a!==r?e:{cells:e.cells.map(((e,a)=>function(e,t){if(!e||!t)return!1;switch(t.type){case"column":return"column"===t.type&&e.columnIndex===t.columnIndex;case"cell":return"cell"===t.type&&e.sectionName===t.sectionName&&e.columnIndex===t.columnIndex&&e.rowIndex===t.rowIndex}}({sectionName:o,columnIndex:a,rowIndex:r},t)?n(e):e))}))))}function Jg(e,t){let{sectionName:n,rowIndex:o,columnCount:r}=t;const a=function(e){return eh(e.head)?eh(e.body)?eh(e.foot)?void 0:e.foot[0]:e.body[0]:e.head[0]}(e),l=void 0===r?(0,Le.get)(a,["cells","length"]):r;return l?{[n]:[...e[n].slice(0,o),{cells:(0,Le.times)(l,(e=>{const t=(0,Le.get)(a,["cells",e],{});return{...(0,Le.pick)(t,Kg),content:"",tag:"head"===n?"th":"td"}}))},...e[n].slice(o)]}:e}function Yg(e,t){let{columnIndex:n}=t;const o=(0,Le.pick)(e,["head","body","foot"]);return(0,Le.mapValues)(o,((e,t)=>eh(e)?e:e.map((e=>th(e)||e.cells.length<n?e:{cells:[...e.cells.slice(0,n),{content:"",tag:"head"===t?"th":"td"},...e.cells.slice(n)]}))))}function Xg(e,t){if(!eh(e[t]))return{[t]:[]};return Jg(e,{sectionName:t,rowIndex:0,columnCount:(0,Le.get)(e,["body",0,"cells","length"],1)})}function eh(e){return!e||!e.length||(0,Le.every)(e,th)}function th(e){return!(e.cells&&e.cells.length)}const nh=[{icon:Fg,title:(0,we.__)("Align column left"),align:"left"},{icon:Dg,title:(0,we.__)("Align column center"),align:"center"},{icon:Gg,title:(0,we.__)("Align column right"),align:"right"}],oh={head:(0,we.__)("Header cell text"),body:(0,we.__)("Body cell text"),foot:(0,we.__)("Footer cell text")},rh={head:(0,we.__)("Header label"),foot:(0,we.__)("Footer label")};function ah(e){let{name:t,...n}=e;const o=`t${t}`;return(0,ye.createElement)(o,n)}var lh=function(e){let{attributes:t,setAttributes:n,insertBlocksAfter:o,isSelected:r}=e;const{hasFixedLayout:a,caption:l,head:i,foot:s}=t,[c,u]=(0,ye.useState)(2),[m,d]=(0,ye.useState)(2),[p,g]=(0,ye.useState)(),h=(0,Ee.__experimentalUseColorProps)(t),v=(0,Ee.__experimentalUseBorderProps)(t);function b(e){p&&n(Qg(t,p,(t=>({...t,content:e}))))}function y(e){if(!p)return;const{sectionName:o,rowIndex:r}=p,a=r+e;n(Jg(t,{sectionName:o,rowIndex:a})),g({sectionName:o,rowIndex:a,columnIndex:0,type:"cell"})}function f(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!p)return;const{columnIndex:o}=p,r=o+e;n(Yg(t,{columnIndex:r})),g({rowIndex:0,columnIndex:r,type:"cell"})}(0,ye.useEffect)((()=>{r||g()}),[r]);const _=["head","body","foot"].filter((e=>!eh(t[e]))),k=[{icon:Ug,title:(0,we.__)("Insert row before"),isDisabled:!p,onClick:function(){y(0)}},{icon:Og,title:(0,we.__)("Insert row after"),isDisabled:!p,onClick:function(){y(1)}},{icon:qg,title:(0,we.__)("Delete row"),isDisabled:!p,onClick:function(){if(!p)return;const{sectionName:e,rowIndex:o}=p;g(),n(function(e,t){let{sectionName:n,rowIndex:o}=t;return{[n]:e[n].filter(((e,t)=>t!==o))}}(t,{sectionName:e,rowIndex:o}))}},{icon:$g,title:(0,we.__)("Insert column before"),isDisabled:!p,onClick:function(){f(0)}},{icon:Wg,title:(0,we.__)("Insert column after"),isDisabled:!p,onClick:function(){f(1)}},{icon:jg,title:(0,we.__)("Delete column"),isDisabled:!p,onClick:function(){if(!p)return;const{sectionName:e,columnIndex:o}=p;g(),n(function(e,t){let{columnIndex:n}=t;const o=(0,Le.pick)(e,["head","body","foot"]);return(0,Le.mapValues)(o,(e=>eh(e)?e:e.map((e=>({cells:e.cells.length>=n?e.cells.filter(((e,t)=>t!==n)):e.cells}))).filter((e=>e.cells.length))))}(t,{sectionName:e,columnIndex:o}))}}],w=["head","body","foot"].map((e=>(0,ye.createElement)(ah,{name:e,key:e},t[e].map(((t,n)=>{let{cells:o}=t;return(0,ye.createElement)("tr",{key:n},o.map(((t,o)=>{let{content:r,tag:a,scope:l,align:i}=t;return(0,ye.createElement)(Ee.RichText,{tagName:a,key:o,className:nt()({[`has-text-align-${i}`]:i},"wp-block-table__cell-content"),scope:"th"===a?l:void 0,value:r,onChange:b,unstableOnFocus:()=>{g({sectionName:e,rowIndex:n,columnIndex:o,type:"cell"})},"aria-label":oh[e],placeholder:rh[e]})})))}))))),E=!_.length;return(0,ye.createElement)("figure",(0,Ee.useBlockProps)(),!E&&(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(Ee.AlignmentControl,{label:(0,we.__)("Change column alignment"),alignmentControls:nh,value:function(){if(p)return function(e,t,n){const{sectionName:o,rowIndex:r,columnIndex:a}=t;return(0,Le.get)(e,[o,r,"cells",a,n])}(t,p,"align")}(),onChange:e=>function(e){if(!p)return;const o={type:"column",columnIndex:p.columnIndex},r=Qg(t,o,(t=>({...t,align:e})));n(r)}(e)})),(0,ye.createElement)(Ee.BlockControls,{group:"other"},(0,ye.createElement)(ke.ToolbarDropdownMenu,{hasArrowIndicator:!0,icon:Zg,label:(0,we.__)("Edit table"),controls:k}))),!E&&(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Table settings"),className:"blocks-table-settings"},(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Fixed width table cells"),checked:!!a,onChange:function(){n({hasFixedLayout:!a})}}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Header section"),checked:!(!i||!i.length),onChange:function(){n(Xg(t,"head"))}}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Footer section"),checked:!(!s||!s.length),onChange:function(){n(Xg(t,"foot"))}}))),!E&&(0,ye.createElement)("table",{className:nt()(h.className,v.className,{"has-fixed-layout":a}),style:{...h.style,...v.style}},w),!E&&(0,ye.createElement)(Ee.RichText,{tagName:"figcaption","aria-label":(0,we.__)("Table caption text"),placeholder:(0,we.__)("Add caption"),value:l,onChange:e=>n({caption:e}),unstableOnFocus:()=>g(),__unstableOnSplitAtEnd:()=>o((0,be.createBlock)("core/paragraph"))}),E&&(0,ye.createElement)(ke.Placeholder,{label:(0,we.__)("Table"),icon:(0,ye.createElement)(Ee.BlockIcon,{icon:Lg,showColors:!0}),instructions:(0,we.__)("Insert a table for sharing data.")},(0,ye.createElement)("form",{className:"blocks-table__placeholder-form",onSubmit:function(e){e.preventDefault(),n(function(e){let{rowCount:t,columnCount:n}=e;return{body:(0,Le.times)(t,(()=>({cells:(0,Le.times)(n,(()=>({content:"",tag:"td"})))})))}}({rowCount:parseInt(c,10)||2,columnCount:parseInt(m,10)||2}))}},(0,ye.createElement)(ke.TextControl,{type:"number",label:(0,we.__)("Column count"),value:m,onChange:function(e){d(e)},min:"1",className:"blocks-table__placeholder-input"}),(0,ye.createElement)(ke.TextControl,{type:"number",label:(0,we.__)("Row count"),value:c,onChange:function(e){u(e)},min:"1",className:"blocks-table__placeholder-input"}),(0,ye.createElement)(ke.Button,{className:"blocks-table__placeholder-button",variant:"primary",type:"submit"},(0,we.__)("Create Table")))))};const ih=e=>{let{phrasingContentSchema:t}=e;return{tr:{allowEmpty:!0,children:{th:{allowEmpty:!0,children:t,attributes:["scope"]},td:{allowEmpty:!0,children:t}}}}};var sh={from:[{type:"raw",selector:"table",schema:e=>({table:{children:{thead:{allowEmpty:!0,children:ih(e)},tfoot:{allowEmpty:!0,children:ih(e)},tbody:{allowEmpty:!0,children:ih(e)}}}})}]};const ch={apiVersion:2,name:"core/table",title:"Table",category:"text",description:"Create structured content in rows and columns to display information.",textdomain:"default",attributes:{hasFixedLayout:{type:"boolean",default:!1},caption:{type:"string",source:"html",selector:"figcaption",default:""},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}}},supports:{anchor:!0,align:!0,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{__experimentalSkipSerialization:!0,color:!0,style:!0,width:!0},__experimentalSelector:".wp-block-table > table"},styles:[{name:"regular",label:"Default",isDefault:!0},{name:"stripes",label:"Stripes"}],editorStyle:"wp-block-table-editor",style:"wp-block-table"},{name:uh}=ch,mh={icon:Lg,example:{attributes:{head:[{cells:[{content:(0,we.__)("Version"),tag:"th"},{content:(0,we.__)("Jazz Musician"),tag:"th"},{content:(0,we.__)("Release Date"),tag:"th"}]}],body:[{cells:[{content:"5.2",tag:"td"},{content:"Jaco Pastorius",tag:"td"},{content:(0,we.__)("May 7, 2019"),tag:"td"}]},{cells:[{content:"5.1",tag:"td"},{content:"Betty Carter",tag:"td"},{content:(0,we.__)("February 21, 2019"),tag:"td"}]},{cells:[{content:"5.0",tag:"td"},{content:"Bebo Valdés",tag:"td"},{content:(0,we.__)("December 6, 2018"),tag:"td"}]}]}},transforms:sh,edit:lh,save:function(e){let{attributes:t}=e;const{hasFixedLayout:n,head:o,body:r,foot:a,caption:l}=t;if(!o.length&&!r.length&&!a.length)return null;const i=(0,Ee.__experimentalGetColorClassesAndStyles)(t),s=(0,Ee.__experimentalGetBorderClassesAndStyles)(t),c=nt()(i.className,s.className,{"has-fixed-layout":n}),u=!Ee.RichText.isEmpty(l),m=e=>{let{type:t,rows:n}=e;if(!n.length)return null;const o=`t${t}`;return(0,ye.createElement)(o,null,n.map(((e,t)=>{let{cells:n}=e;return(0,ye.createElement)("tr",{key:t},n.map(((e,t)=>{let{content:n,tag:o,scope:r,align:a}=e;const l=nt()({[`has-text-align-${a}`]:a});return(0,ye.createElement)(Ee.RichText.Content,{className:l||void 0,"data-align":a,tagName:o,value:n,key:t,scope:"th"===o?r:void 0})})))})))};return(0,ye.createElement)("figure",Ee.useBlockProps.save(),(0,ye.createElement)("table",{className:""===c?void 0:c,style:{...i.style,...s.style}},(0,ye.createElement)(m,{type:"head",rows:o}),(0,ye.createElement)(m,{type:"body",rows:r}),(0,ye.createElement)(m,{type:"foot",rows:a})),u&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:l}))},deprecated:Ag};var dh=(0,Ie.withSelect)((e=>({taxonomies:e(Dt.store).getTaxonomies({per_page:-1})})))((function(e){let{attributes:t,setAttributes:n,taxonomies:o}=e;const{taxonomy:r,showTagCounts:a,numberOfTags:l}=t,i=(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Tag Cloud settings")},(0,ye.createElement)(ke.SelectControl,{label:(0,we.__)("Taxonomy"),options:[{label:(0,we.__)("- Select -"),value:"",disabled:!0},...(0,Le.map)((0,Le.filter)(o,"show_cloud"),(e=>({value:e.slug,label:e.name})))],value:r,onChange:e=>n({taxonomy:e})}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Show post counts"),checked:a,onChange:()=>n({showTagCounts:!a})}),(0,ye.createElement)(ke.RangeControl,{label:(0,we.__)("Number of tags"),value:l,onChange:e=>n({numberOfTags:e}),min:1,max:100,required:!0})));return(0,ye.createElement)(ye.Fragment,null,i,(0,ye.createElement)("div",(0,Ee.useBlockProps)(),(0,ye.createElement)(xe(),{key:"tag-cloud",block:"core/tag-cloud",attributes:t})))}));const ph={apiVersion:2,name:"core/tag-cloud",title:"Tag Cloud",category:"widgets",description:"A cloud of your most used tags.",textdomain:"default",attributes:{numberOfTags:{type:"number",default:45,minimum:1,maximum:100},taxonomy:{type:"string",default:"post_tag"},showTagCounts:{type:"boolean",default:!1}},supports:{html:!1,align:!0},editorStyle:"wp-block-tag-cloud-editor"},{name:gh}=ph,hh={icon:fc,example:{},edit:dh};var vh=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"}));function bh(e){return(0,we.sprintf)((0,we.__)("Area: %s"),e)}function yh(){return(0,ye.createElement)("div",{className:"wp-block-template-part__selection-preview-item is-placeholder",tabIndex:0})}function fh(e){let{templatePart:t,setAttributes:n,onClose:o,composite:r}=e;const{slug:a,theme:l,title:{rendered:i}}=t,s=t.content.raw||"",c=(0,ye.useMemo)((()=>(0,be.parse)(s)),[s]),{createSuccessNotice:u}=(0,Ie.useDispatch)(Ir.store),m=(0,ye.useCallback)((()=>{n({slug:a,theme:l,area:void 0}),u((0,we.sprintf)((0,we.__)('Template Part "%s" inserted.'),i||a),{type:"snackbar"}),o()}),[a,l]);return(0,ye.createElement)(ke.__unstableCompositeItem,gt({as:"div",className:"wp-block-template-part__selection-preview-item",role:"option",onClick:m,onKeyDown:e=>{ht.ENTER!==e.keyCode&&ht.SPACE!==e.keyCode||m()},tabIndex:0,"aria-label":i||a},r),(0,ye.createElement)(Ee.BlockPreview,{blocks:c}),(0,ye.createElement)("div",{className:"wp-block-template-part__selection-preview-item-title"},i||a))}function _h(e){let{title:t,icon:n,children:o}=e;return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)("div",{className:"wp-block-template-part__selection-panel-group-header"},(0,ye.createElement)("span",{className:"wp-block-template-part__selection-panel-group-title"},t),(0,ye.createElement)(ke.Icon,{icon:n})),(0,ye.createElement)("div",{className:"wp-block-template-part__selection-panel-group-content"},o))}function kh(e){let{templateParts:t,setAttributes:n,onClose:o,composite:r,area:a="uncategorized",labelsByArea:l}=e;const{templatePartsByArea:i,templatePartsToShow:s}=(0,ye.useMemo)((()=>{const e=t.filter((e=>"uncategorized"===a||e.area===a))||[];return{templatePartsByArea:Object.values((0,Le.groupBy)(e,"area")),templatePartsToShow:(0,Le.flatten)(e)}}),[t,a]),c=(0,ot.useAsyncList)(s);return s.length?i.map((e=>(0,ye.createElement)(_h,{key:e[0].area,title:bh(l[e[0].area]||l.uncategorized)},e.map((e=>c.includes(e)?(0,ye.createElement)(fh,{key:e.id,templatePart:e,setAttributes:n,onClose:o,composite:r}):(0,ye.createElement)(yh,{key:e.id})))))):(0,ye.createElement)(_h,{title:bh(l[a]||l.uncategorized)},(0,we.sprintf)((0,we.__)("There is no other %s available. If you are looking for another type of template part, try searching for it using the input above."),a&&"uncategorized"!==a?l[a]||a:(0,we.__)("Template Part")))}function wh(e){let{templateParts:t,setAttributes:n,filterValue:o,onClose:r,composite:a,labelsByArea:l}=e;const{filteredTPs:i,groupedResults:s}=(0,ye.useMemo)((()=>{const e=(0,Le.deburr)(o).toLowerCase(),n=t.filter((t=>{let{title:{rendered:n},area:o}=t;return(0,Le.deburr)(n).toLowerCase().includes(e)||(0,Le.deburr)(l[o]).toLowerCase().includes(e)}));n.sort(((t,n)=>{const o=(0,Le.deburr)(t.title.rendered).toLowerCase().indexOf(e),r=(0,Le.deburr)(n.title.rendered).toLowerCase().indexOf(e);return-1!==o&&-1!==r?o-r:-1!==o?-1:-1!==r?1:(0,Le.deburr)(l[t.area]).toLowerCase().indexOf(e)-(0,Le.deburr)(l[n.area]).toLowerCase().indexOf(e)}));const r=[];for(let e=0;e<n.length;e++)0!==e&&n[e].area===n[e-1].area?r[r.length-1].push(n[e]):r.push([n[e]]);return{filteredTPs:n,groupedResults:r}}),[o,t]),c=(0,ot.useAsyncList)(i);return s.map((e=>(0,ye.createElement)(_h,{key:e[0].id,title:bh(l[e[0].area]||l.uncategorized)},e.map((e=>c.includes(e)?(0,ye.createElement)(fh,{key:e.id,templatePart:e,setAttributes:n,onClose:r,composite:a}):(0,ye.createElement)(yh,{key:e.id}))))))}function Eh(e){let{setAttributes:t,filterValue:n,onClose:o,area:r,templatePartId:a}=e;const l=(0,ke.__unstableUseCompositeState)(),{templateParts:i,labelsByArea:s}=(0,Ie.useSelect)((e=>{const t=(e(Dt.store).getEntityRecords("postType","wp_template_part",{per_page:-1})||[]).filter((e=>zs(e.theme,e.slug)!==a)),n=e("core/editor").__experimentalGetDefaultTemplatePartAreas(),o={};return n.forEach((e=>{o[e.area]=e.label})),{templateParts:t,labelsByArea:o}}),[]);return i&&i.length?n?(0,ye.createElement)(ke.__unstableComposite,gt({},l,{role:"listbox","aria-label":(0,we.__)("List of template parts")}),(0,ye.createElement)(wh,{templateParts:i,setAttributes:t,filterValue:n,onClose:o,composite:l,labelsByArea:s})):(0,ye.createElement)(ke.__unstableComposite,gt({},l,{role:"listbox","aria-label":(0,we.__)("List of template parts")}),(0,ye.createElement)(kh,{templateParts:i,setAttributes:t,onClose:o,composite:l,area:r,labelsByArea:s})):(0,ye.createElement)(_h,null,(0,we.__)("There are no existing template parts to select."))}function Ch(e){let{setAttributes:t,onClose:n,area:o,templatePartId:r=null}=e;const[a,l]=(0,ye.useState)("");return(0,ye.createElement)("div",null,(0,ye.createElement)(ke.SearchControl,{value:a,onChange:l,className:"wp-block-template-part__selection-preview-search-form"}),(0,ye.createElement)("div",{className:"wp-block-template-part__selection-preview-container"},(0,ye.createElement)(Eh,{setAttributes:t,filterValue:a,onClose:n,area:o,templatePartId:r})))}function xh(e){let{area:t,areaLabel:n,areaIcon:o,clientId:r,onCreate:a,resetPlaceholder:l}=e;const i=t?`core/template-part/${t}`:"core/template-part",[s,c]=(0,ye.useState)((0,we.__)("Untitled Template Part")),[u,m]=(0,ye.useState)([]),[d,p]=(0,ye.useState)(!1);return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.__experimentalBlockPatternSetup,{clientId:r,startBlankComponent:(0,ye.createElement)(Sh,{setTitleStep:p,areaLabel:n,areaIcon:o}),onBlockPatternSelect:e=>{m(e),p(!0)},filterPatternsFn: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=>e===i))}}),d&&(0,ye.createElement)(ke.Modal,{title:(0,we.sprintf)((0,we.__)("Name and create your new %s"),n.toLowerCase()),closeLabel:(0,we.__)("Cancel"),onRequestClose:l,overlayClassName:"wp-block-template-part__placeholder-create-new__title-form"},(0,ye.createElement)("form",{onSubmit:e=>{e.preventDefault(),a(u,s)}},(0,ye.createElement)(ke.TextControl,{label:(0,we.__)("Name"),value:s,onChange:c}),(0,ye.createElement)(ke.Flex,{className:"wp-block-template-part__placeholder-create-new__title-form-actions",justify:"flex-end"},(0,ye.createElement)(ke.FlexItem,null,(0,ye.createElement)(ke.Button,{variant:"secondary",onClick:l},(0,we.__)("Cancel"))),(0,ye.createElement)(ke.FlexItem,null,(0,ye.createElement)(ke.Button,{variant:"primary",type:"submit",disabled:!s.length,"aria-disabled":!s.length},(0,we.__)("Create")))))))}function Sh(e){let{setTitleStep:t,areaLabel:n,areaIcon:o}=e;return(0,ye.useEffect)((()=>{t(!0)}),[]),(0,ye.createElement)(ke.Placeholder,{label:n,icon:o,instructions:(0,we.sprintf)((0,we.__)("Creating your new %s…"),n.toLowerCase())})}const Bh=1,Th=2;function Nh(e){let{area:t,clientId:n,setAttributes:o,enableSelection:r,hasResolvedReplacements:a}=e;const{saveEntityRecord:l}=(0,Ie.useDispatch)(Dt.store),[i,s]=(0,ye.useState)(Bh),{areaIcon:c,areaLabel:u}=(0,Ie.useSelect)((e=>{const n=e("core/editor").__experimentalGetDefaultTemplatePartAreas(),o=(0,Le.find)(n,{area:t}),r=(0,Le.find)(n,{area:"uncategorized"});return{areaIcon:(null==o?void 0:o.icon)||(null==r?void 0:r.icon),areaLabel:(null==o?void 0:o.label)||(0,we.__)("Template Part")}}),[t]),m=(0,ye.useCallback)((async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,we.__)("Untitled Template Part");const r={title:n,slug:(0,Le.kebabCase)(n),content:(0,be.serialize)(e),area:t},a=await l("postType","wp_template_part",r);o({slug:a.slug,theme:a.theme,area:void 0})}),[o,t]);return(0,ye.createElement)(ye.Fragment,null,i===Bh&&(0,ye.createElement)(ke.Placeholder,{icon:c,label:u,instructions:r?(0,we.sprintf)((0,we.__)("Choose an existing %s or create a new one."),u.toLowerCase()):(0,we.sprintf)((0,we.__)("Create a new %s."),u.toLowerCase())},a?(0,ye.createElement)(ke.Dropdown,{contentClassName:"wp-block-template-part__placeholder-preview-dropdown-content",position:"bottom right left",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,ye.createElement)(ye.Fragment,null,r&&(0,ye.createElement)(ke.Button,{variant:"primary",onClick:n,"aria-expanded":t},(0,we.__)("Choose existing")),(0,ye.createElement)(ke.Button,{variant:r?"tertiary":"primary",onClick:()=>s(Th)},(0,we.sprintf)((0,we.__)("New %s"),u.toLowerCase())))},renderContent:e=>{let{onClose:n}=e;return(0,ye.createElement)(Ch,{setAttributes:o,onClose:n,area:t})}}):(0,ye.createElement)(ke.Spinner,null)),i===Th&&(0,ye.createElement)(xh,{area:t,areaLabel:u,areaIcon:c,onCreate:m,clientId:n,resetPlaceholder:()=>s(Bh)}))}function zh(e){let{tagName:t,setAttributes:n,isEntityAvailable:o,templatePartId:r,defaultWrapper:a}=e;const[l,i]=(0,Dt.useEntityProp)("postType","wp_template_part","area",r),[s,c]=(0,Dt.useEntityProp)("postType","wp_template_part","title",r),{areaOptions:u}=(0,Ie.useSelect)((e=>({areaOptions:e("core/editor").__experimentalGetDefaultTemplatePartAreas().map((e=>{let{label:t,area:n}=e;return{label:t,value:n}}))})),[]);return(0,ye.createElement)(Ee.InspectorControls,{__experimentalGroup:"advanced"},o&&(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.TextControl,{label:(0,we.__)("Title"),value:s,onChange:e=>{c(e)},onFocus:e=>e.target.select()}),(0,ye.createElement)(ke.SelectControl,{label:(0,we.__)("Area"),labelPosition:"top",options:u,value:l,onChange:i})),(0,ye.createElement)(ke.SelectControl,{label:(0,we.__)("HTML element"),options:[{label:(0,we.sprintf)((0,we.__)("Default based on area (%s)"),`<${a}>`),value:""},{label:"<header>",value:"header"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<article>",value:"article"},{label:"<aside>",value:"aside"},{label:"<footer>",value:"footer"},{label:"<div>",value:"div"}],value:t||"",onChange:e=>n({tagName:e})}))}function Ph(e){let{postId:t,hasInnerBlocks:n,layout:o,tagName:r,blockProps:a,clientId:l}=e;const i=(0,Ie.useSelect)((e=>{var t;const{getSettings:n}=e(Ee.store);return null===(t=n())||void 0===t?void 0:t.supportsLayout}),[]),s=(0,Ee.useSetting)("layout")||{},c=o&&o.inherit?s:o,[u,m,d]=(0,Dt.useEntityBlockEditor)("postType","wp_template_part",{id:t}),p=(0,Ee.useInnerBlocksProps)(a,{value:u,onInput:m,onChange:d,renderAppender:n?void 0:Ee.InnerBlocks.ButtonBlockAppender,__experimentalLayout:i?c:void 0});return(0,ye.createElement)(Ee.__experimentalBlockContentOverlay,{clientId:l,tagName:r,wrapperProps:p})}var Ih=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.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"}));var Mh=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.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"}));var Rh=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));const Lh=[{name:"header",icon:Ih,title:(0,we.__)("Header"),description:(0,we.__)("The Header template defines a page area that typically contains a title, logo, and main navigation."),attributes:{area:"header"},scope:["inserter"]},{name:"footer",icon:Mh,title:(0,we.__)("Footer"),description:(0,we.__)("The Footer template defines a page area that typically contains site credits, social links, or any other combination of blocks."),attributes:{area:"footer"},scope:["inserter"]}];Lh.forEach((e=>{e.isActive||(e.isActive=(e,t)=>{const{area:n,theme:o,slug:r}=e;if(n)return n===t.area;if(!r)return!1;const a=(0,Ie.select)(Dt.store).getEntityRecord("postType","wp_template_part",`${o}//${r}`);return(null==a?void 0:a.area)===t.area})}));var Vh=Lh;const Hh={apiVersion:2,name:"core/template-part",title:"Template Part",category:"theme",description:"Edit the different global regions of your site, like the header, footer, sidebar, or create your own.",textdomain:"default",attributes:{slug:{type:"string"},theme:{type:"string"},tagName:{type:"string"},area:{type:"string"}},supports:{align:!0,html:!1,reusable:!1},editorStyle:"wp-block-template-part-editor"},{name:Ah}=Hh,Fh={icon:vh,__experimentalLabel:e=>{var t;let{slug:n,theme:o}=e;if(!n)return;const r=(0,Ie.select)(Dt.store).getEntityRecord("postType","wp_template_part",o+"//"+n);return r?(0,Le.startCase)((null===(t=r.title)||void 0===t?void 0:t.rendered)||r.slug):void 0},edit:function(e){let{attributes:t,setAttributes:n,clientId:o}=e;const{slug:r,theme:a,tagName:l,layout:i={}}=t,s=zs(a,r),[c,u]=(0,Ee.__experimentalUseNoRecursiveRenders)(s),{isResolved:m,innerBlocks:d,isMissing:p,defaultWrapper:g,area:h,enableSelection:v,hasResolvedReplacements:b}=(0,Ie.useSelect)((e=>{var n;const{getEditedEntityRecord:r,getEntityRecords:a,hasFinishedResolution:l}=e(Dt.store),{getBlocks:i}=e(Ee.store),c=["postType","wp_template_part",s],u=s?r(...c):null,m=(null==u?void 0:u.area)||t.area,d=["postType","wp_template_part",m&&"uncategorized"!==m&&{area:m}],p=a(...d),g=s?(null==p?void 0:p.length)>1:(null==p?void 0:p.length)>0,h=!!s&&l("getEditedEntityRecord",c),v=null===(n=e("core/editor").__experimentalGetDefaultTemplatePartAreas().find((e=>{let{area:t}=e;return t===m})))||void 0===n?void 0:n.area_tag;return{innerBlocks:i(o),isResolved:h,isMissing:h&&(0,Le.isEmpty)(u),defaultWrapper:v||"div",area:m,enableSelection:g,hasResolvedReplacements:l("getEntityRecords",d)}}),[s,o]),y=(0,Ee.useBlockProps)(),f=!r,_=!f&&!p&&m,k=l||g;return 0===d.length&&(r&&!a||r&&p)?(0,ye.createElement)(k,y,(0,ye.createElement)(Ee.Warning,null,(0,we.sprintf)((0,we.__)("Template part has been deleted or is unavailable: %s"),r))):_&&c?(0,ye.createElement)(k,y,(0,ye.createElement)(Ee.Warning,null,(0,we.__)("Block cannot be rendered inside itself."))):(0,ye.createElement)(u,null,(0,ye.createElement)(zh,{tagName:l,setAttributes:n,isEntityAvailable:_,templatePartId:s,defaultWrapper:g}),f&&(0,ye.createElement)(k,y,(0,ye.createElement)(Nh,{area:t.area,clientId:o,setAttributes:n,enableSelection:v,hasResolvedReplacements:b})),_&&v&&(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(ke.ToolbarGroup,{className:"wp-block-template-part__block-control-group"},(0,ye.createElement)(ke.Dropdown,{className:"wp-block-template-part__preview-dropdown-button",contentClassName:"wp-block-template-part__preview-dropdown-content",position:"bottom right left",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,ye.createElement)(ke.ToolbarButton,{"aria-expanded":t,onClick:n},(0,we.__)("Replace"))},renderContent:e=>{let{onClose:t}=e;return(0,ye.createElement)(Ch,{setAttributes:n,onClose:t,area:h,templatePartId:s})}}))),_&&(0,ye.createElement)(Ph,{clientId:o,tagName:k,blockProps:y,postId:s,hasInnerBlocks:d.length>0,layout:i}),!f&&!m&&(0,ye.createElement)(k,y,(0,ye.createElement)(ke.Spinner,null)))}};(0,ja.addFilter)("blocks.registerBlockType","core/template-part",(function(e,t){if("core/template-part"!==t)return e;if(!e.variations||!e.variations.length)return{...e,variations:Vh};if(e.variations){const t=(e,t)=>{const{area:n,theme:o,slug:r}=e;if(n)return n===t.area;if(!r)return!1;const a=(0,Ie.select)(Dt.store).getEntityRecord("postType","wp_template_part",`${o}//${r}`);return(null==a?void 0:a.area)===t.area},n=e.variations.map((e=>{return{...e,...!e.isActive&&{isActive:t},..."string"==typeof e.icon&&{icon:(n=e.icon,"header"===n?Ih:"footer"===n?Mh:"sidebar"===n?Rh:vh)}};var n}));return{...e,variations:n}}return e}));const Dh=["core/post-template","core/post-content"];(0,ja.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromPostTemplates",((e,t,n,o)=>{let{getBlock:r,getBlockParentsByBlockName:a}=o;if("core/template-part"!==t.name)return e;for(const e of Dh){var l;if((null===(l=r(n))||void 0===l?void 0:l.name)===e||a(n,e).length)return!1}return!0}));var Gh=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.Path,{stroke:"#1E1E1E",strokeWidth:"1.5",d:"M9 19.25h6M4 19.25h4M12 15.25h8M4 15.25h7"}),(0,ye.createElement)(fe.Path,{d:"M8.994 10.103H6.08L5.417 12H4l2.846-8h1.383l2.845 8H9.657l-.663-1.897zm-.457-1.28l-.994-2.857-1.006 2.857h2z",fill:"#1E1E1E"}));const Uh={apiVersion:2,name:"core/term-description",title:"Term Description",category:"theme",description:"Display the description of categories, tags and custom taxonomies when viewing an archive.",textdomain:"default",attributes:{textAlign:{type:"string"}},supports:{align:["wide","full"],html:!1,color:{link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalDefaultControls:{fontSize:!0}}},editorStyle:"wp-block-term-description-editor"},{name:Oh}=Uh,qh={icon:Gh,edit:function(e){let{attributes:t,setAttributes:n,mergedStyle:o}=e;const{textAlign:r}=t,a=(0,Ee.useBlockProps)({className:nt()({[`has-text-align-${r}`]:r}),style:o});return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(Ee.AlignmentControl,{value:r,onChange:e=>{n({textAlign:e})}})),(0,ye.createElement)("div",a,(0,ye.createElement)("div",{className:"wp-block-term-description__placeholder"},(0,ye.createElement)("span",null,(0,we.__)("Term Description")))))}};var $h=window.wp.deprecated,Wh=n.n($h);const jh={to:[{type:"block",blocks:["core/columns"],transform:e=>{let{className:t,columns:n,content:o,width:r}=e;return(0,be.createBlock)("core/columns",{align:"wide"===r||"full"===r?r:void 0,className:t,columns:n},o.map((e=>{let{children:t}=e;return(0,be.createBlock)("core/column",{},[(0,be.createBlock)("core/paragraph",{content:t})])})))}}]};var Zh=jh;const Kh={apiVersion:2,name:"core/text-columns",title:"Text Columns (deprecated)",icon:"columns",category:"design",description:"This block is deprecated. Please use the Columns block instead.",textdomain:"default",attributes:{content:{type:"array",source:"query",selector:"p",query:{children:{type:"string",source:"html"}},default:[{},{}]},columns:{type:"number",default:2},width:{type:"string"}},supports:{inserter:!1},editorStyle:"wp-block-text-columns-editor",style:"wp-block-text-columns"},{name:Qh}=Kh,Jh={transforms:Zh,getEditWrapperProps(e){const{width:t}=e;if("wide"===t||"full"===t)return{"data-align":t}},edit:function(e){let{attributes:t,setAttributes:n}=e;const{width:o,content:r,columns:a}=t;return Wh()("The Text Columns block",{since:"5.3",alternative:"the Columns block"}),(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(Ee.BlockAlignmentToolbar,{value:o,onChange:e=>n({width:e}),controls:["center","wide","full"]})),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,null,(0,ye.createElement)(ke.RangeControl,{label:(0,we.__)("Columns"),value:a,onChange:e=>n({columns:e}),min:2,max:4,required:!0}))),(0,ye.createElement)("div",(0,Ee.useBlockProps)({className:`align${o} columns-${a}`}),(0,Le.times)(a,(e=>(0,ye.createElement)("div",{className:"wp-block-column",key:`column-${e}`},(0,ye.createElement)(Ee.RichText,{tagName:"p",value:(0,Le.get)(r,[e,"children"]),onChange:t=>{n({content:[...r.slice(0,e),{children:t},...r.slice(e+1)]})},"aria-label":(0,we.sprintf)((0,we.__)("Column %d text"),e+1),placeholder:(0,we.__)("New Column")}))))))},save:function(e){let{attributes:t}=e;const{width:n,content:o,columns:r}=t;return(0,ye.createElement)("div",Ee.useBlockProps.save({className:`align${n} columns-${r}`}),(0,Le.times)(r,(e=>(0,ye.createElement)("div",{className:"wp-block-column",key:`column-${e}`},(0,ye.createElement)(Ee.RichText.Content,{tagName:"p",value:(0,Le.get)(o,[e,"children"])})))))}};var Yh=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"}));const Xh={attributes:{content:{type:"string",source:"html",selector:"pre",default:""},textAlign:{type:"string"}},save(e){let{attributes:t}=e;const{textAlign:n,content:o}=t;return(0,ye.createElement)(Ee.RichText.Content,{tagName:"pre",style:{textAlign:n},value:o})}},ev={attributes:{content:{type:"string",source:"html",selector:"pre",default:"",__unstablePreserveWhiteSpace:!0,__experimentalRole:"content"},textAlign:{type:"string"}},supports:{anchor:!0,color:{gradients:!0,link:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},spacing:{padding:!0}},save(e){let{attributes:t}=e;const{textAlign:n,content:o}=t,r=nt()({[`has-text-align-${n}`]:n});return(0,ye.createElement)("pre",Ee.useBlockProps.save({className:r}),(0,ye.createElement)(Ee.RichText.Content,{value:o}))},migrate:lt,isEligible(e){var t;let{style:n}=e;return null==n||null===(t=n.typography)||void 0===t?void 0:t.fontFamily}};var tv=[ev,Xh];const nv={from:[{type:"block",blocks:["core/paragraph"],transform:e=>(0,be.createBlock)("core/verse",e)}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>(0,be.createBlock)("core/paragraph",e)}]};var ov=nv;const rv={apiVersion:2,name:"core/verse",title:"Verse",category:"text",description:"Insert poetry. Use special spacing formats. Or quote song lyrics.",keywords:["poetry","poem"],textdomain:"default",attributes:{content:{type:"string",source:"html",selector:"pre",default:"",__unstablePreserveWhiteSpace:!0,__experimentalRole:"content"},textAlign:{type:"string"}},supports:{anchor:!0,color:{gradients:!0,link:!0},typography:{fontSize:!0,__experimentalFontFamily:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0}},spacing:{padding:!0}},style:"wp-block-verse",editorStyle:"wp-block-verse-editor"},{name:av}=rv,lv={icon:Yh,example:{attributes:{content:(0,we.__)("WHAT was he doing, the great god Pan,\n\tDown in the reeds by the river?\nSpreading ruin and scattering ban,\nSplashing and paddling with hoofs of a goat,\nAnd breaking the golden lilies afloat\n With the dragon-fly on the river.")}},transforms:ov,deprecated:tv,merge:(e,t)=>({content:e.content+t.content}),edit:function(e){let{attributes:t,setAttributes:n,mergeBlocks:o,onRemove:r,style:a}=e;const{textAlign:l,content:i}=t,s=(0,Ee.useBlockProps)({className:nt()({[`has-text-align-${l}`]:l}),style:a});return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,null,(0,ye.createElement)(Ee.AlignmentToolbar,{value:l,onChange:e=>{n({textAlign:e})}})),(0,ye.createElement)(Ee.RichText,gt({tagName:"pre",identifier:"content",preserveWhiteSpace:!0,value:i,onChange:e=>{n({content:e})},"aria-label":(0,we.__)("Verse text"),placeholder:(0,we.__)("Write verse…"),onRemove:r,onMerge:o,textAlign:l},s,{__unstablePastePlainText:!0})))},save:function(e){let{attributes:t}=e;const{textAlign:n,content:o}=t,r=nt()({[`has-text-align-${n}`]:n});return(0,ye.createElement)("pre",Ee.useBlockProps.save({className:r}),(0,ye.createElement)(Ee.RichText.Content,{value:o}))}};var iv=(0,ye.createElement)(fe.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,ye.createElement)(fe.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"}));const sv=[{value:"auto",label:(0,we.__)("Auto")},{value:"metadata",label:(0,we.__)("Metadata")},{value:"none",label:(0,we._x)("None","Preload value")}];var cv=e=>{let{setAttributes:t,attributes:n}=e;const{autoplay:o,controls:r,loop:a,muted:l,playsInline:i,preload:s}=n,c=(0,we.__)("Autoplay may cause usability issues for some users."),u=ye.Platform.select({web:(0,ye.useCallback)((e=>e?c:null),[]),native:c}),m=(0,ye.useMemo)((()=>{const e=e=>n=>{t({[e]:n})};return{autoplay:e("autoplay"),loop:e("loop"),muted:e("muted"),controls:e("controls"),playsInline:e("playsInline")}}),[]),d=(0,ye.useCallback)((e=>{t({preload:e})}),[]);return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Autoplay"),onChange:m.autoplay,checked:o,help:u}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Loop"),onChange:m.loop,checked:a}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Muted"),onChange:m.muted,checked:l}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Playback controls"),onChange:m.controls,checked:r}),(0,ye.createElement)(ke.ToggleControl,{label:(0,we.__)("Play inline"),onChange:m.playsInline,checked:i}),(0,ye.createElement)(ke.SelectControl,{label:(0,we.__)("Preload"),value:s,onChange:d,options:sv,hideCancelButton:!0}))};var uv=(0,ye.createElement)(fe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,ye.createElement)(fe.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"}));const mv=["text/vtt"],dv="subtitles",pv=[{label:(0,we.__)("Subtitles"),value:"subtitles"},{label:(0,we.__)("Captions"),value:"captions"},{label:(0,we.__)("Descriptions"),value:"descriptions"},{label:(0,we.__)("Chapters"),value:"chapters"},{label:(0,we.__)("Metadata"),value:"metadata"}],gv=(0,ye.createElement)(ke.SVG,{width:"18",height:"14",viewBox:"0 0 18 14",role:"img",fill:"none"},(0,ye.createElement)(ke.Rect,{x:"0.75",y:"0.75",width:"16.5",height:"12.5",rx:"1.25",stroke:"black",strokeWidth:"1.5",fill:"none"}),(0,ye.createElement)(ke.Path,{d:"M3 7H15",stroke:"black",strokeWidth:"1.5"}),(0,ye.createElement)(ke.Path,{d:"M3 10L15 10",stroke:"black",strokeWidth:"1.5"}));function hv(e){let t,{tracks:n,onEditPress:o}=e;return t=0===n.length?(0,ye.createElement)("p",{className:"block-library-video-tracks-editor__tracks-informative-message"},(0,we.__)("Tracks can be subtitles, captions, chapters, or descriptions. They help make your content more accessible to a wider range of users.")):n.map(((e,t)=>(0,ye.createElement)("div",{key:t,className:"block-library-video-tracks-editor__track-list-track"},(0,ye.createElement)("span",null,e.label," "),(0,ye.createElement)(ke.Button,{variant:"tertiary",onClick:()=>o(t),"aria-label":(0,we.sprintf)((0,we.__)("Edit %s"),e.label)},(0,we.__)("Edit"))))),(0,ye.createElement)(ke.MenuGroup,{label:(0,we.__)("Text tracks"),className:"block-library-video-tracks-editor__track-list"},t)}function vv(e){let{track:t,onChange:n,onClose:o,onRemove:r}=e;const{src:a="",label:l="",srcLang:i="",kind:s=dv}=t,c=a.startsWith("blob:")?"":(0,Dr.getFilename)(a)||"";return(0,ye.createElement)(ke.NavigableMenu,null,(0,ye.createElement)("div",{className:"block-library-video-tracks-editor__single-track-editor"},(0,ye.createElement)("span",{className:"block-library-video-tracks-editor__single-track-editor-edit-track-label"},(0,we.__)("Edit track")),(0,ye.createElement)("span",null,(0,we.__)("File"),": ",(0,ye.createElement)("b",null,c)),(0,ye.createElement)("div",{className:"block-library-video-tracks-editor__single-track-editor-label-language"},(0,ye.createElement)(ke.TextControl,{autoFocus:!0,onChange:e=>n({...t,label:e}),label:(0,we.__)("Label"),value:l,help:(0,we.__)("Title of track")}),(0,ye.createElement)(ke.TextControl,{onChange:e=>n({...t,srcLang:e}),label:(0,we.__)("Source language"),value:i,help:(0,we.__)("Language tag (en, fr, etc.)")})),(0,ye.createElement)(ke.SelectControl,{className:"block-library-video-tracks-editor__single-track-editor-kind-select",options:pv,value:s,label:(0,we.__)("Kind"),onChange:e=>{n({...t,kind:e})}}),(0,ye.createElement)("div",{className:"block-library-video-tracks-editor__single-track-editor-buttons-container"},(0,ye.createElement)(ke.Button,{variant:"secondary",onClick:()=>{const e={};let r=!1;""===l&&(e.label=(0,we.__)("English"),r=!0),""===i&&(e.srcLang="en",r=!0),void 0===t.kind&&(e.kind=dv,r=!0),r&&n({...t,...e}),o()}},(0,we.__)("Close")),(0,ye.createElement)(ke.Button,{isDestructive:!0,variant:"link",onClick:r},(0,we.__)("Remove track")))))}function bv(e){let{tracks:t=[],onChange:n}=e;const o=(0,Ie.useSelect)((e=>e(Ee.store).getSettings().mediaUpload),[]),[r,a]=(0,ye.useState)(null);return o?(0,ye.createElement)(ke.Dropdown,{contentClassName:"block-library-video-tracks-editor",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,ye.createElement)(ke.ToolbarButton,{label:(0,we.__)("Text tracks"),showTooltip:!0,"aria-expanded":t,"aria-haspopup":"true",onClick:n,icon:gv})},renderContent:e=>{let{}=e;return null!==r?(0,ye.createElement)(vv,{track:t[r],onChange:e=>{const o=[...t];o[r]=e,n(o)},onClose:()=>a(null),onRemove:()=>{n(t.filter(((e,t)=>t!==r))),a(null)}}):(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(ke.NavigableMenu,null,(0,ye.createElement)(hv,{tracks:t,onEditPress:a}),(0,ye.createElement)(ke.MenuGroup,{className:"block-library-video-tracks-editor__add-tracks-container",label:(0,we.__)("Add tracks")},(0,ye.createElement)(Ee.MediaUpload,{onSelect:e=>{let{url:o}=e;const r=t.length;n([...t,{src:o}]),a(r)},allowedTypes:mv,render:e=>{let{open:t}=e;return(0,ye.createElement)(ke.MenuItem,{icon:uv,onClick:t},(0,we.__)("Open Media Library"))}}),(0,ye.createElement)(Ee.MediaUploadCheck,null,(0,ye.createElement)(ke.FormFileUpload,{onChange:e=>{const r=e.target.files,l=t.length;o({allowedTypes:mv,filesList:r,onFileChange:e=>{let[{url:o}]=e;const r=[...t];r[l]||(r[l]={}),r[l]={...t[l],src:o},n(r),a(l)}})},accept:".vtt,text/vtt",render:e=>{let{openFileDialog:t}=e;return(0,ye.createElement)(ke.MenuItem,{icon:Ol,onClick:()=>{t()}},(0,we.__)("Upload"))}})))))}}):null}function yv(e){let{tracks:t=[]}=e;return t.map((e=>(0,ye.createElement)("track",gt({key:e.src},e))))}const fv=["video"],_v=["image"];var kv=(0,ke.withNotices)((function e(t){let{isSelected:n,noticeUI:o,attributes:r,className:a,setAttributes:l,insertBlocksAfter:i,onReplace:s,noticeOperations:c}=t;const u=(0,ot.useInstanceId)(e),m=(0,ye.useRef)(),d=(0,ye.useRef)(),{id:p,caption:g,controls:h,poster:v,src:b,tracks:y}=r,f=!p&&(0,Pe.isBlobURL)(b),_=(0,Ie.useSelect)((e=>e(Ee.store).getSettings().mediaUpload));function k(e){var t,n;e&&e.url?l({src:e.url,id:e.id,poster:(null===(t=e.image)||void 0===t?void 0:t.src)!==e.icon?null===(n=e.image)||void 0===n?void 0:n.src:void 0}):l({src:void 0,id:void 0,poster:void 0})}function w(e){if(e!==b){const t=Oe({attributes:{url:e}});if(void 0!==t)return void s(t);l({src:e,id:void 0,poster:void 0})}}function E(e){c.removeAllNotices(),c.createErrorNotice(e)}(0,ye.useEffect)((()=>{if(!p&&(0,Pe.isBlobURL)(b)){const e=(0,Pe.getBlobByURL)(b);e&&_({filesList:[e],onFileChange:e=>{let[{url:t}]=e;l({src:t})},onError:e=>{c.createErrorNotice(e)},allowedTypes:fv})}}),[]),(0,ye.useEffect)((()=>{m.current&&m.current.load()}),[v]);const C=nt()(a,{"is-transient":f}),x=(0,Ee.useBlockProps)({className:C});if(!b)return(0,ye.createElement)("div",x,(0,ye.createElement)(Ee.MediaPlaceholder,{icon:(0,ye.createElement)(Ee.BlockIcon,{icon:iv}),onSelect:k,onSelectURL:w,accept:"video/*",allowedTypes:fv,value:r,notices:o,onError:E}));const S=`video-block__poster-image-description-${u}`;return(0,ye.createElement)(ye.Fragment,null,(0,ye.createElement)(Ee.BlockControls,{group:"block"},(0,ye.createElement)(bv,{tracks:y,onChange:e=>{l({tracks:e})}})),(0,ye.createElement)(Ee.BlockControls,{group:"other"},(0,ye.createElement)(Ee.MediaReplaceFlow,{mediaId:p,mediaURL:b,allowedTypes:fv,accept:"video/*",onSelect:k,onSelectURL:w,onError:E})),(0,ye.createElement)(Ee.InspectorControls,null,(0,ye.createElement)(ke.PanelBody,{title:(0,we.__)("Video settings")},(0,ye.createElement)(cv,{setAttributes:l,attributes:r}),(0,ye.createElement)(Ee.MediaUploadCheck,null,(0,ye.createElement)(ke.BaseControl,{className:"editor-video-poster-control"},(0,ye.createElement)(ke.BaseControl.VisualLabel,null,(0,we.__)("Poster image")),(0,ye.createElement)(Ee.MediaUpload,{title:(0,we.__)("Select poster image"),onSelect:function(e){l({poster:e.url})},allowedTypes:_v,render:e=>{let{open:t}=e;return(0,ye.createElement)(ke.Button,{variant:"primary",onClick:t,ref:d,"aria-describedby":S},v?(0,we.__)("Replace"):(0,we.__)("Select"))}}),(0,ye.createElement)("p",{id:S,hidden:!0},v?(0,we.sprintf)((0,we.__)("The current poster image url is %s"),v):(0,we.__)("There is no poster image currently selected")),!!v&&(0,ye.createElement)(ke.Button,{onClick:function(){l({poster:void 0}),d.current.focus()},variant:"tertiary"},(0,we.__)("Remove")))))),(0,ye.createElement)("figure",x,(0,ye.createElement)(ke.Disabled,{isDisabled:!n},(0,ye.createElement)("video",{controls:h,poster:v,src:b,ref:m},(0,ye.createElement)(yv,{tracks:y}))),f&&(0,ye.createElement)(ke.Spinner,null),(!Ee.RichText.isEmpty(g)||n)&&(0,ye.createElement)(Ee.RichText,{tagName:"figcaption","aria-label":(0,we.__)("Video caption text"),placeholder:(0,we.__)("Add caption"),value:g,onChange:e=>l({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>i((0,be.createBlock)("core/paragraph"))})))}));const wv={from:[{type:"files",isMatch:e=>1===e.length&&0===e[0].type.indexOf("video/"),transform(e){const t=e[0];return(0,be.createBlock)("core/video",{src:(0,Pe.createBlobURL)(t)})}},{type:"shortcode",tag:"video",attributes:{src:{type:"string",shortcode:e=>{let{named:{src:t,mp4:n,m4v:o,webm:r,ogv:a,flv:l}}=e;return t||n||o||r||a||l}},poster:{type:"string",shortcode:e=>{let{named:{poster:t}}=e;return t}},loop:{type:"string",shortcode:e=>{let{named:{loop:t}}=e;return t}},autoplay:{type:"string",shortcode:e=>{let{named:{autoplay:t}}=e;return t}},preload:{type:"string",shortcode:e=>{let{named:{preload:t}}=e;return t}}}}]};var Ev=wv;const Cv={apiVersion:2,name:"core/video",title:"Video",category:"media",description:"Embed a video from your media library or upload a new one.",keywords:["movie"],textdomain:"default",attributes:{autoplay:{type:"boolean",source:"attribute",selector:"video",attribute:"autoplay"},caption:{type:"string",source:"html",selector:"figcaption"},controls:{type:"boolean",source:"attribute",selector:"video",attribute:"controls",default:!0},id:{type:"number"},loop:{type:"boolean",source:"attribute",selector:"video",attribute:"loop"},muted:{type:"boolean",source:"attribute",selector:"video",attribute:"muted"},poster:{type:"string",source:"attribute",selector:"video",attribute:"poster"},preload:{type:"string",source:"attribute",selector:"video",attribute:"preload",default:"metadata"},src:{type:"string",source:"attribute",selector:"video",attribute:"src"},playsInline:{type:"boolean",source:"attribute",selector:"video",attribute:"playsinline"},tracks:{type:"array",items:{type:"object"},default:[]}},supports:{anchor:!0,align:!0},editorStyle:"wp-block-video-editor",style:"wp-block-video"},{name:xv}=Cv,Sv={icon:iv,example:{attributes:{src:"https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm",caption:(0,we.__)("Wood thrush singing in Central Park, NYC.")}},transforms:Ev,edit:kv,save:function(e){let{attributes:t}=e;const{autoplay:n,caption:o,controls:r,loop:a,muted:l,poster:i,preload:s,src:c,playsInline:u,tracks:m}=t;return(0,ye.createElement)("figure",Ee.useBlockProps.save(),c&&(0,ye.createElement)("video",{autoPlay:n,controls:r,loop:a,muted:l,poster:i,preload:"metadata"!==s?s:void 0,src:c,playsInline:u},(0,ye.createElement)(yv,{tracks:m})),!Ee.RichText.isEmpty(o)&&(0,ye.createElement)(Ee.RichText.Content,{tagName:"figcaption",value:o}))}},Bv=e=>{if(!e)return;const{metadata:t,settings:n,name:o}=e;(0,be.registerBlockType)({name:o,...t},n)},Tv=()=>[M,f,b,h,w,Y,e,t,r,a,l,i,window.wp&&window.wp.oldEditor?s:null,c,u,m,d,p,g,v,y,_,k,C,x,S,z,I,P,q,$,X,ee,te,ne,oe,ie,se,ce,ue,me,ge,he,ve,B,T,N,re,le,ae,W,de,O,A,F,V,R,H,U,D,G,j,Z,K,Q,L,E,pe,J],Nv=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Tv();e.forEach(Bv),(0,be.setDefaultBlockName)(fu),window.wp&&window.wp.oldEditor&&(0,be.setFreeformContentHandlerName)(en),(0,be.setUnregisteredTypeHandlerName)(us),(0,be.setGroupingBlockName)(cl)},zv=void 0}(),(window.wp=window.wp||{}).blockLibrary=o}();
\ No newline at end of file
diff --git a/wp-includes/js/dist/block-serialization-default-parser.js b/wp-includes/js/dist/block-serialization-default-parser.js
index 324c95f176..e0cfbab3f6 100644
--- a/wp-includes/js/dist/block-serialization-default-parser.js
+++ b/wp-includes/js/dist/block-serialization-default-parser.js
@@ -1,98 +1,43 @@
-this["wp"] = this["wp"] || {}; this["wp"]["blockSerializationDefaultParser"] =
-/******/ (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: {}
+/******/ (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); }
+/******/ }();
+/******/
+/******/ /* 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 });
/******/ };
-/******/
-/******/ // 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 = "SiJt");
-/******/ })
+/******/ }();
+/******/
/************************************************************************/
-/******/ ({
-
-/***/ "SiJt":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
+var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return parse; });
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "parse": function() { return /* binding */ parse; }
+/* harmony export */ });
let document;
let offset;
let output;
@@ -457,7 +402,6 @@ function addBlockFromStack(endOffset) {
output.push(block);
}
-
-/***/ })
-
-/******/ });
\ No newline at end of file
+(window.wp = window.wp || {}).blockSerializationDefaultParser = __webpack_exports__;
+/******/ })()
+;
\ No newline at end of file
diff --git a/wp-includes/js/dist/block-serialization-default-parser.min.js b/wp-includes/js/dist/block-serialization-default-parser.min.js
index 4b5e0e2557..fd9b3fd8db 100644
--- a/wp-includes/js/dist/block-serialization-default-parser.min.js
+++ b/wp-includes/js/dist/block-serialization-default-parser.min.js
@@ -1,2 +1,2 @@
/*! This file is auto-generated */
-this.wp=this.wp||{},this.wp.blockSerializationDefaultParser=function(n){var t={};function e(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=n,e.c=t,e.d=function(n,t,r){e.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:r})},e.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},e.t=function(n,t){if(1&t&&(n=e(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var o in n)e.d(r,o,function(t){return n[t]}.bind(null,o));return r},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},e.p="",e(e.s="SiJt")}({SiJt:function(n,t,e){"use strict";let r,o,u,s;e.r(t),e.d(t,"parse",(function(){return f}));const l=/<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function c(n,t,e,r,o){return{blockName:n,attrs:t,innerBlocks:e,innerHTML:r,innerContent:o}}function i(n){return c(null,{},[],n,[n])}const f=n=>{r=n,o=0,u=[],s=[],l.lastIndex=0;do{}while(p());return u};function p(){const n=function(){const n=l.exec(r);if(null===n)return["no-more-tokens"];const t=n.index,[e,o,u,s,c,,i]=n,f=e.length,p=!!o,a=!!i,b=(u||"core/")+s,k=!!c,d=k?function(n){try{return JSON.parse(n)}catch(n){return null}}(c):{};if(a)return["void-block",b,d,t,f];if(p)return["block-closer",b,null,t,f];return["block-opener",b,d,t,f]}(),[t,e,f,p,d]=n,h=s.length,v=p>o?o:null;switch(t){case"no-more-tokens":if(0===h)return a(),!1;if(1===h)return k(),!1;for(;0<s.length;)k();return!1;case"void-block":return 0===h?(null!==v&&u.push(i(r.substr(v,p-v))),u.push(c(e,f,[],"",[])),o=p+d,!0):(b(c(e,f,[],"",[]),p,d),o=p+d,!0);case"block-opener":return s.push(function(n,t,e,r,o){return{block:n,tokenStart:t,tokenLength:e,prevOffset:r||t+e,leadingHtmlStart:o}}(c(e,f,[],"",[]),p,d,p+d,v)),o=p+d,!0;case"block-closer":if(0===h)return a(),!1;if(1===h)return k(p),o=p+d,!0;const n=s.pop(),t=r.substr(n.prevOffset,p-n.prevOffset);return n.block.innerHTML+=t,n.block.innerContent.push(t),n.prevOffset=p+d,b(n.block,n.tokenStart,n.tokenLength,p+d),o=p+d,!0;default:return a(),!1}}function a(n){const t=n||r.length-o;0!==t&&u.push(i(r.substr(o,t)))}function b(n,t,e,o){const u=s[s.length-1];u.block.innerBlocks.push(n);const l=r.substr(u.prevOffset,t-u.prevOffset);l&&(u.block.innerHTML+=l,u.block.innerContent.push(l)),u.block.innerContent.push(null),u.prevOffset=o||t+e}function k(n){const{block:t,leadingHtmlStart:e,prevOffset:o,tokenStart:l}=s.pop(),c=n?r.substr(o,n-o):r.substr(o);c&&(t.innerHTML+=c,t.innerContent.push(c)),null!==e&&u.push(i(r.substr(e,l-e))),u.push(t)}}});
\ No newline at end of file
+!function(){"use strict";var n={d:function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},r:function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})}},t={};let e,r,o,u;n.r(t),n.d(t,{parse:function(){return i}});const s=/<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function l(n,t,e,r,o){return{blockName:n,attrs:t,innerBlocks:e,innerHTML:r,innerContent:o}}function c(n){return l(null,{},[],n,[n])}const i=n=>{e=n,r=0,o=[],u=[],s.lastIndex=0;do{}while(f());return o};function f(){const n=function(){const n=s.exec(e);if(null===n)return["no-more-tokens"];const t=n.index,[r,o,u,l,c,,i]=n,f=r.length,p=!!o,a=!!i,b=(u||"core/")+l,k=!!c,h=k?function(n){try{return JSON.parse(n)}catch(n){return null}}(c):{};if(a)return["void-block",b,h,t,f];if(p)return["block-closer",b,null,t,f];return["block-opener",b,h,t,f]}(),[t,i,f,k,h]=n,d=u.length,g=k>r?r:null;switch(t){case"no-more-tokens":if(0===d)return p(),!1;if(1===d)return b(),!1;for(;0<u.length;)b();return!1;case"void-block":return 0===d?(null!==g&&o.push(c(e.substr(g,k-g))),o.push(l(i,f,[],"",[])),r=k+h,!0):(a(l(i,f,[],"",[]),k,h),r=k+h,!0);case"block-opener":return u.push(function(n,t,e,r,o){return{block:n,tokenStart:t,tokenLength:e,prevOffset:r||t+e,leadingHtmlStart:o}}(l(i,f,[],"",[]),k,h,k+h,g)),r=k+h,!0;case"block-closer":if(0===d)return p(),!1;if(1===d)return b(k),r=k+h,!0;const n=u.pop(),t=e.substr(n.prevOffset,k-n.prevOffset);return n.block.innerHTML+=t,n.block.innerContent.push(t),n.prevOffset=k+h,a(n.block,n.tokenStart,n.tokenLength,k+h),r=k+h,!0;default:return p(),!1}}function p(n){const t=n||e.length-r;0!==t&&o.push(c(e.substr(r,t)))}function a(n,t,r,o){const s=u[u.length-1];s.block.innerBlocks.push(n);const l=e.substr(s.prevOffset,t-s.prevOffset);l&&(s.block.innerHTML+=l,s.block.innerContent.push(l)),s.block.innerContent.push(null),s.prevOffset=o||t+r}function b(n){const{block:t,leadingHtmlStart:r,prevOffset:s,tokenStart:l}=u.pop(),i=n?e.substr(s,n-s):e.substr(s);i&&(t.innerHTML+=i,t.innerContent.push(i)),null!==r&&o.push(c(e.substr(r,l-r))),o.push(t)}(window.wp=window.wp||{}).blockSerializationDefaultParser=t}();
\ No newline at end of file
diff --git a/wp-includes/js/dist/blocks.js b/wp-includes/js/dist/blocks.js
index 7dae7fb240..bdcf304d16 100644
--- a/wp-includes/js/dist/blocks.js
+++ b/wp-includes/js/dist/blocks.js
@@ -1,8805 +1,1008 @@
-this["wp"] = this["wp"] || {}; this["wp"]["blocks"] =
-/******/ (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 = "0ATp");
-/******/ })
-/************************************************************************/
-/******/ ({
-
-/***/ "0ATp":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/******/ (function() { // webpackBootstrap
+/******/ var __webpack_modules__ = ({
-"use strict";
-// ESM COMPAT FLAG
-__webpack_require__.r(__webpack_exports__);
-
-// EXPORTS
-__webpack_require__.d(__webpack_exports__, "store", function() { return /* reexport */ store; });
-__webpack_require__.d(__webpack_exports__, "createBlock", function() { return /* reexport */ createBlock; });
-__webpack_require__.d(__webpack_exports__, "createBlocksFromInnerBlocksTemplate", function() { return /* reexport */ createBlocksFromInnerBlocksTemplate; });
-__webpack_require__.d(__webpack_exports__, "cloneBlock", function() { return /* reexport */ cloneBlock; });
-__webpack_require__.d(__webpack_exports__, "__experimentalCloneSanitizedBlock", function() { return /* reexport */ __experimentalCloneSanitizedBlock; });
-__webpack_require__.d(__webpack_exports__, "getPossibleBlockTransformations", function() { return /* reexport */ getPossibleBlockTransformations; });
-__webpack_require__.d(__webpack_exports__, "switchToBlockType", function() { return /* reexport */ switchToBlockType; });
-__webpack_require__.d(__webpack_exports__, "getBlockTransforms", function() { return /* reexport */ getBlockTransforms; });
-__webpack_require__.d(__webpack_exports__, "findTransform", function() { return /* reexport */ findTransform; });
-__webpack_require__.d(__webpack_exports__, "getBlockFromExample", function() { return /* reexport */ getBlockFromExample; });
-__webpack_require__.d(__webpack_exports__, "parse", function() { return /* reexport */ parser_parse; });
-__webpack_require__.d(__webpack_exports__, "getBlockAttributes", function() { return /* reexport */ getBlockAttributes; });
-__webpack_require__.d(__webpack_exports__, "parseWithAttributeSchema", function() { return /* reexport */ parseWithAttributeSchema; });
-__webpack_require__.d(__webpack_exports__, "pasteHandler", function() { return /* reexport */ pasteHandler; });
-__webpack_require__.d(__webpack_exports__, "rawHandler", function() { return /* reexport */ rawHandler; });
-__webpack_require__.d(__webpack_exports__, "getPhrasingContentSchema", function() { return /* reexport */ deprecatedGetPhrasingContentSchema; });
-__webpack_require__.d(__webpack_exports__, "serialize", function() { return /* reexport */ serialize; });
-__webpack_require__.d(__webpack_exports__, "getBlockContent", function() { return /* reexport */ getBlockInnerHTML; });
-__webpack_require__.d(__webpack_exports__, "getBlockDefaultClassName", function() { return /* reexport */ getBlockDefaultClassName; });
-__webpack_require__.d(__webpack_exports__, "getBlockMenuDefaultClassName", function() { return /* reexport */ getBlockMenuDefaultClassName; });
-__webpack_require__.d(__webpack_exports__, "getSaveElement", function() { return /* reexport */ getSaveElement; });
-__webpack_require__.d(__webpack_exports__, "getSaveContent", function() { return /* reexport */ getSaveContent; });
-__webpack_require__.d(__webpack_exports__, "__unstableGetBlockProps", function() { return /* reexport */ getBlockProps; });
-__webpack_require__.d(__webpack_exports__, "__unstableGetInnerBlocksProps", function() { return /* reexport */ getInnerBlocksProps; });
-__webpack_require__.d(__webpack_exports__, "__unstableSerializeAndClean", function() { return /* reexport */ __unstableSerializeAndClean; });
-__webpack_require__.d(__webpack_exports__, "isValidBlockContent", function() { return /* reexport */ isValidBlockContent; });
-__webpack_require__.d(__webpack_exports__, "getCategories", function() { return /* reexport */ categories_getCategories; });
-__webpack_require__.d(__webpack_exports__, "setCategories", function() { return /* reexport */ categories_setCategories; });
-__webpack_require__.d(__webpack_exports__, "updateCategory", function() { return /* reexport */ categories_updateCategory; });
-__webpack_require__.d(__webpack_exports__, "registerBlockType", function() { return /* reexport */ registerBlockType; });
-__webpack_require__.d(__webpack_exports__, "registerBlockCollection", function() { return /* reexport */ registerBlockCollection; });
-__webpack_require__.d(__webpack_exports__, "unregisterBlockType", function() { return /* reexport */ unregisterBlockType; });
-__webpack_require__.d(__webpack_exports__, "setFreeformContentHandlerName", function() { return /* reexport */ setFreeformContentHandlerName; });
-__webpack_require__.d(__webpack_exports__, "getFreeformContentHandlerName", function() { return /* reexport */ getFreeformContentHandlerName; });
-__webpack_require__.d(__webpack_exports__, "setUnregisteredTypeHandlerName", function() { return /* reexport */ setUnregisteredTypeHandlerName; });
-__webpack_require__.d(__webpack_exports__, "getUnregisteredTypeHandlerName", function() { return /* reexport */ getUnregisteredTypeHandlerName; });
-__webpack_require__.d(__webpack_exports__, "setDefaultBlockName", function() { return /* reexport */ setDefaultBlockName; });
-__webpack_require__.d(__webpack_exports__, "getDefaultBlockName", function() { return /* reexport */ registration_getDefaultBlockName; });
-__webpack_require__.d(__webpack_exports__, "setGroupingBlockName", function() { return /* reexport */ setGroupingBlockName; });
-__webpack_require__.d(__webpack_exports__, "getGroupingBlockName", function() { return /* reexport */ registration_getGroupingBlockName; });
-__webpack_require__.d(__webpack_exports__, "getBlockType", function() { return /* reexport */ registration_getBlockType; });
-__webpack_require__.d(__webpack_exports__, "getBlockTypes", function() { return /* reexport */ registration_getBlockTypes; });
-__webpack_require__.d(__webpack_exports__, "getBlockSupport", function() { return /* reexport */ registration_getBlockSupport; });
-__webpack_require__.d(__webpack_exports__, "hasBlockSupport", function() { return /* reexport */ registration_hasBlockSupport; });
-__webpack_require__.d(__webpack_exports__, "getBlockVariations", function() { return /* reexport */ registration_getBlockVariations; });
-__webpack_require__.d(__webpack_exports__, "isReusableBlock", function() { return /* reexport */ isReusableBlock; });
-__webpack_require__.d(__webpack_exports__, "isTemplatePart", function() { return /* reexport */ isTemplatePart; });
-__webpack_require__.d(__webpack_exports__, "getChildBlockNames", function() { return /* reexport */ registration_getChildBlockNames; });
-__webpack_require__.d(__webpack_exports__, "hasChildBlocks", function() { return /* reexport */ registration_hasChildBlocks; });
-__webpack_require__.d(__webpack_exports__, "hasChildBlocksWithInserterSupport", function() { return /* reexport */ registration_hasChildBlocksWithInserterSupport; });
-__webpack_require__.d(__webpack_exports__, "unstable__bootstrapServerSideBlockDefinitions", function() { return /* reexport */ unstable__bootstrapServerSideBlockDefinitions; });
-__webpack_require__.d(__webpack_exports__, "registerBlockStyle", function() { return /* reexport */ registerBlockStyle; });
-__webpack_require__.d(__webpack_exports__, "unregisterBlockStyle", function() { return /* reexport */ unregisterBlockStyle; });
-__webpack_require__.d(__webpack_exports__, "registerBlockVariation", function() { return /* reexport */ registerBlockVariation; });
-__webpack_require__.d(__webpack_exports__, "unregisterBlockVariation", function() { return /* reexport */ unregisterBlockVariation; });
-__webpack_require__.d(__webpack_exports__, "isUnmodifiedDefaultBlock", function() { return /* reexport */ isUnmodifiedDefaultBlock; });
-__webpack_require__.d(__webpack_exports__, "normalizeIconObject", function() { return /* reexport */ normalizeIconObject; });
-__webpack_require__.d(__webpack_exports__, "isValidIcon", function() { return /* reexport */ isValidIcon; });
-__webpack_require__.d(__webpack_exports__, "__experimentalGetBlockLabel", function() { return /* reexport */ getBlockLabel; });
-__webpack_require__.d(__webpack_exports__, "__experimentalGetAccessibleBlockLabel", function() { return /* reexport */ getAccessibleBlockLabel; });
-__webpack_require__.d(__webpack_exports__, "__experimentalSanitizeBlockAttributes", function() { return /* reexport */ __experimentalSanitizeBlockAttributes; });
-__webpack_require__.d(__webpack_exports__, "__experimentalGetBlockAttributesNamesByRole", function() { return /* reexport */ __experimentalGetBlockAttributesNamesByRole; });
-__webpack_require__.d(__webpack_exports__, "doBlocksMatchTemplate", function() { return /* reexport */ doBlocksMatchTemplate; });
-__webpack_require__.d(__webpack_exports__, "synchronizeBlocksWithTemplate", function() { return /* reexport */ synchronizeBlocksWithTemplate; });
-__webpack_require__.d(__webpack_exports__, "children", function() { return /* reexport */ api_children; });
-__webpack_require__.d(__webpack_exports__, "node", function() { return /* reexport */ api_node; });
-__webpack_require__.d(__webpack_exports__, "__EXPERIMENTAL_STYLE_PROPERTY", function() { return /* reexport */ __EXPERIMENTAL_STYLE_PROPERTY; });
-__webpack_require__.d(__webpack_exports__, "__EXPERIMENTAL_ELEMENTS", function() { return /* reexport */ __EXPERIMENTAL_ELEMENTS; });
-__webpack_require__.d(__webpack_exports__, "__EXPERIMENTAL_PATHS_WITH_MERGE", function() { return /* reexport */ __EXPERIMENTAL_PATHS_WITH_MERGE; });
-__webpack_require__.d(__webpack_exports__, "withBlockContentContext", function() { return /* reexport */ withBlockContentContext; });
-
-// NAMESPACE OBJECT: ./node_modules/@wordpress/blocks/build-module/store/selectors.js
-var selectors_namespaceObject = {};
-__webpack_require__.r(selectors_namespaceObject);
-__webpack_require__.d(selectors_namespaceObject, "__experimentalGetUnprocessedBlockTypes", function() { return __experimentalGetUnprocessedBlockTypes; });
-__webpack_require__.d(selectors_namespaceObject, "getBlockTypes", function() { return getBlockTypes; });
-__webpack_require__.d(selectors_namespaceObject, "getBlockType", function() { return getBlockType; });
-__webpack_require__.d(selectors_namespaceObject, "getBlockStyles", function() { return getBlockStyles; });
-__webpack_require__.d(selectors_namespaceObject, "getBlockVariations", function() { return getBlockVariations; });
-__webpack_require__.d(selectors_namespaceObject, "getActiveBlockVariation", function() { return getActiveBlockVariation; });
-__webpack_require__.d(selectors_namespaceObject, "getDefaultBlockVariation", function() { return getDefaultBlockVariation; });
-__webpack_require__.d(selectors_namespaceObject, "getCategories", function() { return getCategories; });
-__webpack_require__.d(selectors_namespaceObject, "getCollections", function() { return getCollections; });
-__webpack_require__.d(selectors_namespaceObject, "getDefaultBlockName", function() { return getDefaultBlockName; });
-__webpack_require__.d(selectors_namespaceObject, "getFreeformFallbackBlockName", function() { return getFreeformFallbackBlockName; });
-__webpack_require__.d(selectors_namespaceObject, "getUnregisteredFallbackBlockName", function() { return getUnregisteredFallbackBlockName; });
-__webpack_require__.d(selectors_namespaceObject, "getGroupingBlockName", function() { return getGroupingBlockName; });
-__webpack_require__.d(selectors_namespaceObject, "getChildBlockNames", function() { return getChildBlockNames; });
-__webpack_require__.d(selectors_namespaceObject, "getBlockSupport", function() { return getBlockSupport; });
-__webpack_require__.d(selectors_namespaceObject, "hasBlockSupport", function() { return hasBlockSupport; });
-__webpack_require__.d(selectors_namespaceObject, "isMatchingSearchTerm", function() { return isMatchingSearchTerm; });
-__webpack_require__.d(selectors_namespaceObject, "hasChildBlocks", function() { return hasChildBlocks; });
-__webpack_require__.d(selectors_namespaceObject, "hasChildBlocksWithInserterSupport", function() { return hasChildBlocksWithInserterSupport; });
-
-// NAMESPACE OBJECT: ./node_modules/@wordpress/blocks/build-module/store/actions.js
-var actions_namespaceObject = {};
-__webpack_require__.r(actions_namespaceObject);
-__webpack_require__.d(actions_namespaceObject, "addBlockTypes", function() { return addBlockTypes; });
-__webpack_require__.d(actions_namespaceObject, "__experimentalRegisterBlockType", function() { return __experimentalRegisterBlockType; });
-__webpack_require__.d(actions_namespaceObject, "__experimentalReapplyBlockTypeFilters", function() { return __experimentalReapplyBlockTypeFilters; });
-__webpack_require__.d(actions_namespaceObject, "removeBlockTypes", function() { return removeBlockTypes; });
-__webpack_require__.d(actions_namespaceObject, "addBlockStyles", function() { return addBlockStyles; });
-__webpack_require__.d(actions_namespaceObject, "removeBlockStyles", function() { return removeBlockStyles; });
-__webpack_require__.d(actions_namespaceObject, "addBlockVariations", function() { return addBlockVariations; });
-__webpack_require__.d(actions_namespaceObject, "removeBlockVariations", function() { return removeBlockVariations; });
-__webpack_require__.d(actions_namespaceObject, "setDefaultBlockName", function() { return actions_setDefaultBlockName; });
-__webpack_require__.d(actions_namespaceObject, "setFreeformFallbackBlockName", function() { return setFreeformFallbackBlockName; });
-__webpack_require__.d(actions_namespaceObject, "setUnregisteredFallbackBlockName", function() { return setUnregisteredFallbackBlockName; });
-__webpack_require__.d(actions_namespaceObject, "setGroupingBlockName", function() { return actions_setGroupingBlockName; });
-__webpack_require__.d(actions_namespaceObject, "setCategories", function() { return setCategories; });
-__webpack_require__.d(actions_namespaceObject, "updateCategory", function() { return updateCategory; });
-__webpack_require__.d(actions_namespaceObject, "addBlockCollection", function() { return addBlockCollection; });
-__webpack_require__.d(actions_namespaceObject, "removeBlockCollection", function() { return removeBlockCollection; });
-
-// 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","i18n"]
-var external_wp_i18n_ = __webpack_require__("l3Sj");
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/reducer.js
-/**
- * External dependencies
- */
+/***/ 7308:
+/***/ (function(module, exports, __webpack_require__) {
+var __WEBPACK_AMD_DEFINE_RESULT__;;/*! showdown v 1.9.1 - 02-11-2019 */
+(function(){
/**
- * WordPress dependencies
+ * Created by Tivie on 13-07-2015.
*/
+function getDefaultOpts (simple) {
+ 'use strict';
+ var defaultOptions = {
+ omitExtraWLInCodeBlocks: {
+ defaultValue: false,
+ describe: 'Omit the default extra whiteline added to code blocks',
+ type: 'boolean'
+ },
+ noHeaderId: {
+ defaultValue: false,
+ describe: 'Turn on/off generated header id',
+ type: 'boolean'
+ },
+ prefixHeaderId: {
+ defaultValue: false,
+ describe: 'Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic \'section-\' prefix',
+ type: 'string'
+ },
+ rawPrefixHeaderId: {
+ defaultValue: false,
+ describe: 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',
+ type: 'boolean'
+ },
+ ghCompatibleHeaderId: {
+ defaultValue: false,
+ describe: 'Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)',
+ type: 'boolean'
+ },
+ rawHeaderId: {
+ defaultValue: false,
+ describe: 'Remove only spaces, \' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids',
+ type: 'boolean'
+ },
+ headerLevelStart: {
+ defaultValue: false,
+ describe: 'The header blocks level start',
+ type: 'integer'
+ },
+ parseImgDimensions: {
+ defaultValue: false,
+ describe: 'Turn on/off image dimension parsing',
+ type: 'boolean'
+ },
+ simplifiedAutoLink: {
+ defaultValue: false,
+ describe: 'Turn on/off GFM autolink style',
+ type: 'boolean'
+ },
+ excludeTrailingPunctuationFromURLs: {
+ defaultValue: false,
+ describe: 'Excludes trailing punctuation from links generated with autoLinking',
+ type: 'boolean'
+ },
+ literalMidWordUnderscores: {
+ defaultValue: false,
+ describe: 'Parse midword underscores as literal underscores',
+ type: 'boolean'
+ },
+ literalMidWordAsterisks: {
+ defaultValue: false,
+ describe: 'Parse midword asterisks as literal asterisks',
+ type: 'boolean'
+ },
+ strikethrough: {
+ defaultValue: false,
+ describe: 'Turn on/off strikethrough support',
+ type: 'boolean'
+ },
+ tables: {
+ defaultValue: false,
+ describe: 'Turn on/off tables support',
+ type: 'boolean'
+ },
+ tablesHeaderId: {
+ defaultValue: false,
+ describe: 'Add an id to table headers',
+ type: 'boolean'
+ },
+ ghCodeBlocks: {
+ defaultValue: true,
+ describe: 'Turn on/off GFM fenced code blocks support',
+ type: 'boolean'
+ },
+ tasklists: {
+ defaultValue: false,
+ describe: 'Turn on/off GFM tasklist support',
+ type: 'boolean'
+ },
+ smoothLivePreview: {
+ defaultValue: false,
+ describe: 'Prevents weird effects in live previews due to incomplete input',
+ type: 'boolean'
+ },
+ smartIndentationFix: {
+ defaultValue: false,
+ description: 'Tries to smartly fix indentation in es6 strings',
+ type: 'boolean'
+ },
+ disableForced4SpacesIndentedSublists: {
+ defaultValue: false,
+ description: 'Disables the requirement of indenting nested sublists by 4 spaces',
+ type: 'boolean'
+ },
+ simpleLineBreaks: {
+ defaultValue: false,
+ description: 'Parses simple line breaks as <br> (GFM Style)',
+ type: 'boolean'
+ },
+ requireSpaceBeforeHeadingText: {
+ defaultValue: false,
+ description: 'Makes adding a space between `#` and the header text mandatory (GFM Style)',
+ type: 'boolean'
+ },
+ ghMentions: {
+ defaultValue: false,
+ description: 'Enables github @mentions',
+ type: 'boolean'
+ },
+ ghMentionsLink: {
+ defaultValue: 'https://github.com/{u}',
+ description: 'Changes the link generated by @mentions. Only applies if ghMentions option is enabled.',
+ type: 'string'
+ },
+ encodeEmails: {
+ defaultValue: true,
+ description: 'Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities',
+ type: 'boolean'
+ },
+ openLinksInNewWindow: {
+ defaultValue: false,
+ description: 'Open all links in new windows',
+ type: 'boolean'
+ },
+ backslashEscapesHTMLTags: {
+ defaultValue: false,
+ description: 'Support for HTML Tag escaping. ex: \<div>foo\</div>',
+ type: 'boolean'
+ },
+ emoji: {
+ defaultValue: false,
+ description: 'Enable emoji support. Ex: `this is a :smile: emoji`',
+ type: 'boolean'
+ },
+ underline: {
+ defaultValue: false,
+ description: 'Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`',
+ type: 'boolean'
+ },
+ completeHTMLDocument: {
+ defaultValue: false,
+ description: 'Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags',
+ type: 'boolean'
+ },
+ metadata: {
+ defaultValue: false,
+ description: 'Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).',
+ type: 'boolean'
+ },
+ splitAdjacentBlockquotes: {
+ defaultValue: false,
+ description: 'Split adjacent blockquote blocks',
+ type: 'boolean'
+ }
+ };
+ if (simple === false) {
+ return JSON.parse(JSON.stringify(defaultOptions));
+ }
+ var ret = {};
+ for (var opt in defaultOptions) {
+ if (defaultOptions.hasOwnProperty(opt)) {
+ ret[opt] = defaultOptions[opt].defaultValue;
+ }
+ }
+ return ret;
+}
+function allOptionsOn () {
+ 'use strict';
+ var options = getDefaultOpts(true),
+ ret = {};
+ for (var opt in options) {
+ if (options.hasOwnProperty(opt)) {
+ ret[opt] = true;
+ }
+ }
+ return ret;
+}
+
/**
- * @typedef {Object} WPBlockCategory
- *
- * @property {string} slug Unique category slug.
- * @property {string} title Category label, for display in user interface.
- */
-
-/**
- * Default set of categories.
- *
- * @type {WPBlockCategory[]}
+ * Created by Tivie on 06-01-2015.
*/
-const DEFAULT_CATEGORIES = [{
- slug: 'text',
- title: Object(external_wp_i18n_["__"])('Text')
-}, {
- slug: 'media',
- title: Object(external_wp_i18n_["__"])('Media')
-}, {
- slug: 'design',
- title: Object(external_wp_i18n_["__"])('Design')
-}, {
- slug: 'widgets',
- title: Object(external_wp_i18n_["__"])('Widgets')
-}, {
- slug: 'theme',
- title: Object(external_wp_i18n_["__"])('Theme')
-}, {
- slug: 'embed',
- title: Object(external_wp_i18n_["__"])('Embeds')
-}, {
- slug: 'reusable',
- title: Object(external_wp_i18n_["__"])('Reusable blocks')
-}];
-/**
- * Reducer managing the unprocessed block types in a form passed when registering the by block.
- * It's for internal use only. It allows recomputing the processed block types on-demand after block type filters
- * get added or removed.
- *
- * @param {Object} state Current state.
- * @param {Object} action Dispatched action.
- *
- * @return {Object} Updated state.
- */
+// Private properties
+var showdown = {},
+ parsers = {},
+ extensions = {},
+ globalOptions = getDefaultOpts(true),
+ setFlavor = 'vanilla',
+ flavor = {
+ github: {
+ omitExtraWLInCodeBlocks: true,
+ simplifiedAutoLink: true,
+ excludeTrailingPunctuationFromURLs: true,
+ literalMidWordUnderscores: true,
+ strikethrough: true,
+ tables: true,
+ tablesHeaderId: true,
+ ghCodeBlocks: true,
+ tasklists: true,
+ disableForced4SpacesIndentedSublists: true,
+ simpleLineBreaks: true,
+ requireSpaceBeforeHeadingText: true,
+ ghCompatibleHeaderId: true,
+ ghMentions: true,
+ backslashEscapesHTMLTags: true,
+ emoji: true,
+ splitAdjacentBlockquotes: true
+ },
+ original: {
+ noHeaderId: true,
+ ghCodeBlocks: false
+ },
+ ghost: {
+ omitExtraWLInCodeBlocks: true,
+ parseImgDimensions: true,
+ simplifiedAutoLink: true,
+ excludeTrailingPunctuationFromURLs: true,
+ literalMidWordUnderscores: true,
+ strikethrough: true,
+ tables: true,
+ tablesHeaderId: true,
+ ghCodeBlocks: true,
+ tasklists: true,
+ smoothLivePreview: true,
+ simpleLineBreaks: true,
+ requireSpaceBeforeHeadingText: true,
+ ghMentions: false,
+ encodeEmails: true
+ },
+ vanilla: getDefaultOpts(true),
+ allOn: allOptionsOn()
+ };
-function reducer_unprocessedBlockTypes() {
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- let action = arguments.length > 1 ? arguments[1] : undefined;
+/**
+ * helper namespace
+ * @type {{}}
+ */
+showdown.helper = {};
- switch (action.type) {
- case 'ADD_UNPROCESSED_BLOCK_TYPE':
- return { ...state,
- [action.blockType.name]: action.blockType
- };
+/**
+ * TODO LEGACY SUPPORT CODE
+ * @type {{}}
+ */
+showdown.extensions = {};
- case 'REMOVE_BLOCK_TYPES':
- return Object(external_lodash_["omit"])(state, action.names);
- }
+/**
+ * Set a global option
+ * @static
+ * @param {string} key
+ * @param {*} value
+ * @returns {showdown}
+ */
+showdown.setOption = function (key, value) {
+ 'use strict';
+ globalOptions[key] = value;
+ return this;
+};
- return state;
-}
/**
- * Reducer managing the processed block types with all filters applied.
- * The state is derived from the `unprocessedBlockTypes` reducer.
- *
- * @param {Object} state Current state.
- * @param {Object} action Dispatched action.
- *
- * @return {Object} Updated state.
+ * Get a global option
+ * @static
+ * @param {string} key
+ * @returns {*}
*/
+showdown.getOption = function (key) {
+ 'use strict';
+ return globalOptions[key];
+};
-function reducer_blockTypes() {
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- let action = arguments.length > 1 ? arguments[1] : undefined;
+/**
+ * Get the global options
+ * @static
+ * @returns {{}}
+ */
+showdown.getOptions = function () {
+ 'use strict';
+ return globalOptions;
+};
- switch (action.type) {
- case 'ADD_BLOCK_TYPES':
- return { ...state,
- ...Object(external_lodash_["keyBy"])(action.blockTypes, 'name')
- };
+/**
+ * Reset global options to the default values
+ * @static
+ */
+showdown.resetOptions = function () {
+ 'use strict';
+ globalOptions = getDefaultOpts(true);
+};
- case 'REMOVE_BLOCK_TYPES':
- return Object(external_lodash_["omit"])(state, action.names);
+/**
+ * Set the flavor showdown should use as default
+ * @param {string} name
+ */
+showdown.setFlavor = function (name) {
+ 'use strict';
+ if (!flavor.hasOwnProperty(name)) {
+ throw Error(name + ' flavor was not found');
+ }
+ showdown.resetOptions();
+ var preset = flavor[name];
+ setFlavor = name;
+ for (var option in preset) {
+ if (preset.hasOwnProperty(option)) {
+ globalOptions[option] = preset[option];
+ }
}
+};
- return state;
-}
/**
- * Reducer managing the block style variations.
- *
- * @param {Object} state Current state.
- * @param {Object} action Dispatched action.
- *
- * @return {Object} Updated state.
+ * Get the currently set flavor
+ * @returns {string}
*/
+showdown.getFlavor = function () {
+ 'use strict';
+ return setFlavor;
+};
-function blockStyles() {
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- let action = arguments.length > 1 ? arguments[1] : undefined;
-
- switch (action.type) {
- case 'ADD_BLOCK_TYPES':
- return { ...state,
- ...Object(external_lodash_["mapValues"])(Object(external_lodash_["keyBy"])(action.blockTypes, 'name'), blockType => {
- return Object(external_lodash_["uniqBy"])([...Object(external_lodash_["get"])(blockType, ['styles'], []).map(style => ({ ...style,
- source: 'block'
- })), ...Object(external_lodash_["get"])(state, [blockType.name], []).filter(_ref => {
- let {
- source
- } = _ref;
- return 'block' !== source;
- })], style => style.name);
- })
- };
+/**
+ * Get the options of a specified flavor. Returns undefined if the flavor was not found
+ * @param {string} name Name of the flavor
+ * @returns {{}|undefined}
+ */
+showdown.getFlavorOptions = function (name) {
+ 'use strict';
+ if (flavor.hasOwnProperty(name)) {
+ return flavor[name];
+ }
+};
- case 'ADD_BLOCK_STYLES':
- return { ...state,
- [action.blockName]: Object(external_lodash_["uniqBy"])([...Object(external_lodash_["get"])(state, [action.blockName], []), ...action.styles], style => style.name)
- };
+/**
+ * Get the default options
+ * @static
+ * @param {boolean} [simple=true]
+ * @returns {{}}
+ */
+showdown.getDefaultOptions = function (simple) {
+ 'use strict';
+ return getDefaultOpts(simple);
+};
- case 'REMOVE_BLOCK_STYLES':
- return { ...state,
- [action.blockName]: Object(external_lodash_["filter"])(Object(external_lodash_["get"])(state, [action.blockName], []), style => action.styleNames.indexOf(style.name) === -1)
- };
+/**
+ * Get or set a subParser
+ *
+ * subParser(name) - Get a registered subParser
+ * subParser(name, func) - Register a subParser
+ * @static
+ * @param {string} name
+ * @param {function} [func]
+ * @returns {*}
+ */
+showdown.subParser = function (name, func) {
+ 'use strict';
+ if (showdown.helper.isString(name)) {
+ if (typeof func !== 'undefined') {
+ parsers[name] = func;
+ } else {
+ if (parsers.hasOwnProperty(name)) {
+ return parsers[name];
+ } else {
+ throw Error('SubParser named ' + name + ' not registered!');
+ }
+ }
}
+};
- return state;
-}
/**
- * Reducer managing the block variations.
- *
- * @param {Object} state Current state.
- * @param {Object} action Dispatched action.
- *
- * @return {Object} Updated state.
+ * Gets or registers an extension
+ * @static
+ * @param {string} name
+ * @param {object|function=} ext
+ * @returns {*}
*/
+showdown.extension = function (name, ext) {
+ 'use strict';
-function blockVariations() {
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- let action = arguments.length > 1 ? arguments[1] : undefined;
+ if (!showdown.helper.isString(name)) {
+ throw Error('Extension \'name\' must be a string');
+ }
- switch (action.type) {
- case 'ADD_BLOCK_TYPES':
- return { ...state,
- ...Object(external_lodash_["mapValues"])(Object(external_lodash_["keyBy"])(action.blockTypes, 'name'), blockType => {
- return Object(external_lodash_["uniqBy"])([...Object(external_lodash_["get"])(blockType, ['variations'], []).map(variation => ({ ...variation,
- source: 'block'
- })), ...Object(external_lodash_["get"])(state, [blockType.name], []).filter(_ref2 => {
- let {
- source
- } = _ref2;
- return 'block' !== source;
- })], variation => variation.name);
- })
- };
+ name = showdown.helper.stdExtName(name);
- case 'ADD_BLOCK_VARIATIONS':
- return { ...state,
- [action.blockName]: Object(external_lodash_["uniqBy"])([...Object(external_lodash_["get"])(state, [action.blockName], []), ...action.variations], variation => variation.name)
- };
+ // Getter
+ if (showdown.helper.isUndefined(ext)) {
+ if (!extensions.hasOwnProperty(name)) {
+ throw Error('Extension named ' + name + ' is not registered!');
+ }
+ return extensions[name];
- case 'REMOVE_BLOCK_VARIATIONS':
- return { ...state,
- [action.blockName]: Object(external_lodash_["filter"])(Object(external_lodash_["get"])(state, [action.blockName], []), variation => action.variationNames.indexOf(variation.name) === -1)
- };
+ // Setter
+ } else {
+ // Expand extension if it's wrapped in a function
+ if (typeof ext === 'function') {
+ ext = ext();
+ }
+
+ // Ensure extension is an array
+ if (!showdown.helper.isArray(ext)) {
+ ext = [ext];
+ }
+
+ var validExtension = validate(ext, name);
+
+ if (validExtension.valid) {
+ extensions[name] = ext;
+ } else {
+ throw Error(validExtension.error);
+ }
}
+};
- return state;
-}
/**
- * Higher-order Reducer creating a reducer keeping track of given block name.
- *
- * @param {string} setActionType Action type.
- *
- * @return {Function} Reducer.
+ * Gets all extensions registered
+ * @returns {{}}
*/
+showdown.getAllExtensions = function () {
+ 'use strict';
+ return extensions;
+};
-function createBlockNameSetterReducer(setActionType) {
- return function () {
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
- let action = arguments.length > 1 ? arguments[1] : undefined;
+/**
+ * Remove an extension
+ * @param {string} name
+ */
+showdown.removeExtension = function (name) {
+ 'use strict';
+ delete extensions[name];
+};
- switch (action.type) {
- case 'REMOVE_BLOCK_TYPES':
- if (action.names.indexOf(state) !== -1) {
- return null;
- }
+/**
+ * Removes all extensions
+ */
+showdown.resetExtensions = function () {
+ 'use strict';
+ extensions = {};
+};
- return state;
+/**
+ * Validate extension
+ * @param {array} extension
+ * @param {string} name
+ * @returns {{valid: boolean, error: string}}
+ */
+function validate (extension, name) {
+ 'use strict';
- case setActionType:
- return action.name || null;
+ var errMsg = (name) ? 'Error in ' + name + ' extension->' : 'Error in unnamed extension',
+ ret = {
+ valid: true,
+ error: ''
+ };
+
+ if (!showdown.helper.isArray(extension)) {
+ extension = [extension];
+ }
+
+ for (var i = 0; i < extension.length; ++i) {
+ var baseMsg = errMsg + ' sub-extension ' + i + ': ',
+ ext = extension[i];
+ if (typeof ext !== 'object') {
+ ret.valid = false;
+ ret.error = baseMsg + 'must be an object, but ' + typeof ext + ' given';
+ return ret;
}
- return state;
- };
-}
-const reducer_defaultBlockName = createBlockNameSetterReducer('SET_DEFAULT_BLOCK_NAME');
-const freeformFallbackBlockName = createBlockNameSetterReducer('SET_FREEFORM_FALLBACK_BLOCK_NAME');
-const unregisteredFallbackBlockName = createBlockNameSetterReducer('SET_UNREGISTERED_FALLBACK_BLOCK_NAME');
-const groupingBlockName = createBlockNameSetterReducer('SET_GROUPING_BLOCK_NAME');
-/**
- * Reducer managing the categories
- *
- * @param {WPBlockCategory[]} state Current state.
- * @param {Object} action Dispatched action.
- *
- * @return {WPBlockCategory[]} Updated state.
- */
+ if (!showdown.helper.isString(ext.type)) {
+ ret.valid = false;
+ ret.error = baseMsg + 'property "type" must be a string, but ' + typeof ext.type + ' given';
+ return ret;
+ }
-function reducer_categories() {
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_CATEGORIES;
- let action = arguments.length > 1 ? arguments[1] : undefined;
+ var type = ext.type = ext.type.toLowerCase();
- switch (action.type) {
- case 'SET_CATEGORIES':
- return action.categories || [];
+ // normalize extension type
+ if (type === 'language') {
+ type = ext.type = 'lang';
+ }
- case 'UPDATE_CATEGORY':
- {
- if (!action.category || Object(external_lodash_["isEmpty"])(action.category)) {
- return state;
- }
+ if (type === 'html') {
+ type = ext.type = 'output';
+ }
- const categoryToChange = Object(external_lodash_["find"])(state, ['slug', action.slug]);
+ if (type !== 'lang' && type !== 'output' && type !== 'listener') {
+ ret.valid = false;
+ ret.error = baseMsg + 'type ' + type + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"';
+ return ret;
+ }
- if (categoryToChange) {
- return Object(external_lodash_["map"])(state, category => {
- if (category.slug === action.slug) {
- return { ...category,
- ...action.category
- };
- }
+ if (type === 'listener') {
+ if (showdown.helper.isUndefined(ext.listeners)) {
+ ret.valid = false;
+ ret.error = baseMsg + '. Extensions of type "listener" must have a property called "listeners"';
+ return ret;
+ }
+ } else {
+ if (showdown.helper.isUndefined(ext.filter) && showdown.helper.isUndefined(ext.regex)) {
+ ret.valid = false;
+ ret.error = baseMsg + type + ' extensions must define either a "regex" property or a "filter" method';
+ return ret;
+ }
+ }
- return category;
- });
+ if (ext.listeners) {
+ if (typeof ext.listeners !== 'object') {
+ ret.valid = false;
+ ret.error = baseMsg + '"listeners" property must be an object but ' + typeof ext.listeners + ' given';
+ return ret;
+ }
+ for (var ln in ext.listeners) {
+ if (ext.listeners.hasOwnProperty(ln)) {
+ if (typeof ext.listeners[ln] !== 'function') {
+ ret.valid = false;
+ ret.error = baseMsg + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + ln +
+ ' must be a function but ' + typeof ext.listeners[ln] + ' given';
+ return ret;
+ }
}
}
- }
+ }
- return state;
+ if (ext.filter) {
+ if (typeof ext.filter !== 'function') {
+ ret.valid = false;
+ ret.error = baseMsg + '"filter" must be a function, but ' + typeof ext.filter + ' given';
+ return ret;
+ }
+ } else if (ext.regex) {
+ if (showdown.helper.isString(ext.regex)) {
+ ext.regex = new RegExp(ext.regex, 'g');
+ }
+ if (!(ext.regex instanceof RegExp)) {
+ ret.valid = false;
+ ret.error = baseMsg + '"regex" property must either be a string or a RegExp object, but ' + typeof ext.regex + ' given';
+ return ret;
+ }
+ if (showdown.helper.isUndefined(ext.replace)) {
+ ret.valid = false;
+ ret.error = baseMsg + '"regex" extensions must implement a replace string or function';
+ return ret;
+ }
+ }
+ }
+ return ret;
}
-function collections() {
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- let action = arguments.length > 1 ? arguments[1] : undefined;
- switch (action.type) {
- case 'ADD_BLOCK_COLLECTION':
- return { ...state,
- [action.namespace]: {
- title: action.title,
- icon: action.icon
- }
- };
+/**
+ * Validate extension
+ * @param {object} ext
+ * @returns {boolean}
+ */
+showdown.validateExtension = function (ext) {
+ 'use strict';
- case 'REMOVE_BLOCK_COLLECTION':
- return Object(external_lodash_["omit"])(state, action.namespace);
+ var validateExtension = validate(ext, null);
+ if (!validateExtension.valid) {
+ console.warn(validateExtension.error);
+ return false;
}
+ return true;
+};
+
+/**
+ * showdownjs helper functions
+ */
- return state;
+if (!showdown.hasOwnProperty('helper')) {
+ showdown.helper = {};
}
-/* harmony default export */ var reducer = (Object(external_wp_data_["combineReducers"])({
- unprocessedBlockTypes: reducer_unprocessedBlockTypes,
- blockTypes: reducer_blockTypes,
- blockStyles,
- blockVariations,
- defaultBlockName: reducer_defaultBlockName,
- freeformFallbackBlockName,
- unregisteredFallbackBlockName,
- groupingBlockName,
- categories: reducer_categories,
- collections
-}));
-
-// EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
-var rememo = __webpack_require__("pPDe");
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/selectors.js
/**
- * External dependencies
+ * Check if var is string
+ * @static
+ * @param {string} a
+ * @returns {boolean}
*/
-
-
-/** @typedef {import('../api/registration').WPBlockVariation} WPBlockVariation */
-
-/** @typedef {import('../api/registration').WPBlockVariationScope} WPBlockVariationScope */
-
-/** @typedef {import('./reducer').WPBlockCategory} WPBlockCategory */
+showdown.helper.isString = function (a) {
+ 'use strict';
+ return (typeof a === 'string' || a instanceof String);
+};
/**
- * Given a block name or block type object, returns the corresponding
- * normalized block type object.
- *
- * @param {Object} state Blocks state.
- * @param {(string|Object)} nameOrType Block name or type object
- *
- * @return {Object} Block type object.
+ * Check if var is a function
+ * @static
+ * @param {*} a
+ * @returns {boolean}
*/
+showdown.helper.isFunction = function (a) {
+ 'use strict';
+ var getType = {};
+ return a && getType.toString.call(a) === '[object Function]';
+};
-const getNormalizedBlockType = (state, nameOrType) => 'string' === typeof nameOrType ? getBlockType(state, nameOrType) : nameOrType;
/**
- * Returns all the unprocessed block types as passed during the registration.
- *
- * @param {Object} state Data state.
- *
- * @return {Array} Unprocessed block types.
+ * isArray helper function
+ * @static
+ * @param {*} a
+ * @returns {boolean}
*/
+showdown.helper.isArray = function (a) {
+ 'use strict';
+ return Array.isArray(a);
+};
-
-function __experimentalGetUnprocessedBlockTypes(state) {
- return state.unprocessedBlockTypes;
-}
/**
- * Returns all the available block types.
- *
- * @param {Object} state Data state.
- *
- * @return {Array} Block Types.
+ * Check if value is undefined
+ * @static
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
*/
+showdown.helper.isUndefined = function (value) {
+ 'use strict';
+ return typeof value === 'undefined';
+};
-const getBlockTypes = Object(rememo["a" /* default */])(state => Object.values(state.blockTypes), state => [state.blockTypes]);
/**
- * Returns a block type by name.
- *
- * @param {Object} state Data state.
- * @param {string} name Block type name.
- *
- * @return {Object?} Block Type.
+ * ForEach helper function
+ * Iterates over Arrays and Objects (own properties only)
+ * @static
+ * @param {*} obj
+ * @param {function} callback Accepts 3 params: 1. value, 2. key, 3. the original array/object
*/
+showdown.helper.forEach = function (obj, callback) {
+ 'use strict';
+ // check if obj is defined
+ if (showdown.helper.isUndefined(obj)) {
+ throw new Error('obj param is required');
+ }
+
+ if (showdown.helper.isUndefined(callback)) {
+ throw new Error('callback param is required');
+ }
+
+ if (!showdown.helper.isFunction(callback)) {
+ throw new Error('callback param must be a function/closure');
+ }
+
+ if (typeof obj.forEach === 'function') {
+ obj.forEach(callback);
+ } else if (showdown.helper.isArray(obj)) {
+ for (var i = 0; i < obj.length; i++) {
+ callback(obj[i], i, obj);
+ }
+ } else if (typeof (obj) === 'object') {
+ for (var prop in obj) {
+ if (obj.hasOwnProperty(prop)) {
+ callback(obj[prop], prop, obj);
+ }
+ }
+ } else {
+ throw new Error('obj does not seem to be an array or an iterable object');
+ }
+};
-function getBlockType(state, name) {
- return state.blockTypes[name];
-}
/**
- * Returns block styles by block name.
- *
- * @param {Object} state Data state.
- * @param {string} name Block type name.
- *
- * @return {Array?} Block Styles.
+ * Standardidize extension name
+ * @static
+ * @param {string} s extension name
+ * @returns {string}
*/
+showdown.helper.stdExtName = function (s) {
+ 'use strict';
+ return s.replace(/[_?*+\/\\.^-]/g, '').replace(/\s/g, '').toLowerCase();
+};
-function getBlockStyles(state, name) {
- return state.blockStyles[name];
+function escapeCharactersCallback (wholeMatch, m1) {
+ 'use strict';
+ var charCodeToEscape = m1.charCodeAt(0);
+ return '¨E' + charCodeToEscape + 'E';
}
+
/**
- * Returns block variations by block name.
- *
- * @param {Object} state Data state.
- * @param {string} blockName Block type name.
- * @param {WPBlockVariationScope} [scope] Block variation scope name.
- *
- * @return {(WPBlockVariation[]|void)} Block variations.
+ * Callback used to escape characters when passing through String.replace
+ * @static
+ * @param {string} wholeMatch
+ * @param {string} m1
+ * @returns {string}
*/
+showdown.helper.escapeCharactersCallback = escapeCharactersCallback;
-const getBlockVariations = Object(rememo["a" /* default */])((state, blockName, scope) => {
- const variations = state.blockVariations[blockName];
+/**
+ * Escape characters in a string
+ * @static
+ * @param {string} text
+ * @param {string} charsToEscape
+ * @param {boolean} afterBackslash
+ * @returns {XML|string|void|*}
+ */
+showdown.helper.escapeCharacters = function (text, charsToEscape, afterBackslash) {
+ 'use strict';
+ // First we have to escape the escape characters so that
+ // we can build a character class out of them
+ var regexString = '([' + charsToEscape.replace(/([\[\]\\])/g, '\\$1') + '])';
- if (!variations || !scope) {
- return variations;
+ if (afterBackslash) {
+ regexString = '\\\\' + regexString;
}
- return variations.filter(variation => {
- // For backward compatibility reasons, variation's scope defaults to
- // `block` and `inserter` when not set.
- return (variation.scope || ['block', 'inserter']).includes(scope);
- });
-}, (state, blockName) => [state.blockVariations[blockName]]);
+ var regex = new RegExp(regexString, 'g');
+ text = text.replace(regex, escapeCharactersCallback);
+
+ return text;
+};
+
/**
- * Returns the active block variation for a given block based on its attributes.
- * Variations are determined by their `isActive` property.
- * Which is either an array of block attribute keys or a function.
- *
- * In case of an array of block attribute keys, the `attributes` are compared
- * to the variation's attributes using strict equality check.
- *
- * In case of function type, the function should accept a block's attributes
- * and the variation's attributes and determines if a variation is active.
- * A function that accepts a block's attributes and the variation's attributes and determines if a variation is active.
- *
- * @param {Object} state Data state.
- * @param {string} blockName Name of block (example: “core/columns”).
- * @param {Object} attributes Block attributes used to determine active variation.
- * @param {WPBlockVariationScope} [scope] Block variation scope name.
- *
- * @return {(WPBlockVariation|undefined)} Active block variation.
+ * Unescape HTML entities
+ * @param txt
+ * @returns {string}
*/
+showdown.helper.unescapeHTMLEntities = function (txt) {
+ 'use strict';
-function getActiveBlockVariation(state, blockName, attributes, scope) {
- const variations = getBlockVariations(state, blockName, scope);
- const match = variations === null || variations === void 0 ? void 0 : variations.find(variation => {
- var _variation$isActive;
+ return txt
+ .replace(/"/g, '"')
+ .replace(/</g, '<')
+ .replace(/>/g, '>')
+ .replace(/&/g, '&');
+};
- if (Array.isArray(variation.isActive)) {
- const blockType = getBlockType(state, blockName);
- const attributeKeys = Object.keys((blockType === null || blockType === void 0 ? void 0 : blockType.attributes) || {});
- const definedAttributes = variation.isActive.filter(attribute => attributeKeys.includes(attribute));
+var rgxFindMatchPos = function (str, left, right, flags) {
+ 'use strict';
+ var f = flags || '',
+ g = f.indexOf('g') > -1,
+ x = new RegExp(left + '|' + right, 'g' + f.replace(/g/g, '')),
+ l = new RegExp(left, f.replace(/g/g, '')),
+ pos = [],
+ t, s, m, start, end;
- if (definedAttributes.length === 0) {
- return false;
+ do {
+ t = 0;
+ while ((m = x.exec(str))) {
+ if (l.test(m[0])) {
+ if (!(t++)) {
+ s = x.lastIndex;
+ start = s - m[0].length;
+ }
+ } else if (t) {
+ if (!--t) {
+ end = m.index + m[0].length;
+ var obj = {
+ left: {start: start, end: s},
+ match: {start: s, end: m.index},
+ right: {start: m.index, end: end},
+ wholeMatch: {start: start, end: end}
+ };
+ pos.push(obj);
+ if (!g) {
+ return pos;
+ }
+ }
}
-
- return definedAttributes.every(attribute => attributes[attribute] === variation.attributes[attribute]);
}
+ } while (t && (x.lastIndex = s));
- return (_variation$isActive = variation.isActive) === null || _variation$isActive === void 0 ? void 0 : _variation$isActive.call(variation, attributes, variation.attributes);
- });
- return match;
-}
-/**
- * Returns the default block variation for the given block type.
- * When there are multiple variations annotated as the default one,
- * the last added item is picked. This simplifies registering overrides.
- * When there is no default variation set, it returns the first item.
- *
- * @param {Object} state Data state.
- * @param {string} blockName Block type name.
- * @param {WPBlockVariationScope} [scope] Block variation scope name.
- *
- * @return {?WPBlockVariation} The default block variation.
- */
+ return pos;
+};
-function getDefaultBlockVariation(state, blockName, scope) {
- const variations = getBlockVariations(state, blockName, scope);
- return Object(external_lodash_["findLast"])(variations, 'isDefault') || Object(external_lodash_["first"])(variations);
-}
/**
- * Returns all the available categories.
+ * matchRecursiveRegExp
*
- * @param {Object} state Data state.
+ * (c) 2007 Steven Levithan <stevenlevithan.com>
+ * MIT License
*
- * @return {WPBlockCategory[]} Categories list.
- */
-
-function getCategories(state) {
- return state.categories;
-}
-/**
- * Returns all the available collections.
- *
- * @param {Object} state Data state.
+ * Accepts a string to search, a left and right format delimiter
+ * as regex patterns, and optional regex flags. Returns an array
+ * of matches, allowing nested instances of left/right delimiters.
+ * Use the "g" flag to return all matches, otherwise only the
+ * first is returned. Be careful to ensure that the left and
+ * right format delimiters produce mutually exclusive matches.
+ * Backreferences are not supported within the right delimiter
+ * due to how it is internally combined with the left delimiter.
+ * When matching strings whose format delimiters are unbalanced
+ * to the left or right, the output is intentionally as a
+ * conventional regex library with recursion support would
+ * produce, e.g. "<<x>" and "<x>>" both produce ["x"] when using
+ * "<" and ">" as the delimiters (both strings contain a single,
+ * balanced instance of "<x>").
*
- * @return {Object} Collections list.
+ * examples:
+ * matchRecursiveRegExp("test", "\\(", "\\)")
+ * returns: []
+ * matchRecursiveRegExp("<t<<e>><s>>t<>", "<", ">", "g")
+ * returns: ["t<<e>><s>", ""]
+ * matchRecursiveRegExp("<div id=\"x\">test</div>", "<div\\b[^>]*>", "</div>", "gi")
+ * returns: ["test"]
*/
+showdown.helper.matchRecursiveRegExp = function (str, left, right, flags) {
+ 'use strict';
-function getCollections(state) {
- return state.collections;
-}
-/**
- * Returns the name of the default block name.
- *
- * @param {Object} state Data state.
- *
- * @return {string?} Default block name.
- */
+ var matchPos = rgxFindMatchPos (str, left, right, flags),
+ results = [];
-function getDefaultBlockName(state) {
- return state.defaultBlockName;
-}
-/**
- * Returns the name of the block for handling non-block content.
- *
- * @param {Object} state Data state.
- *
- * @return {string?} Name of the block for handling non-block content.
- */
+ for (var i = 0; i < matchPos.length; ++i) {
+ results.push([
+ str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),
+ str.slice(matchPos[i].match.start, matchPos[i].match.end),
+ str.slice(matchPos[i].left.start, matchPos[i].left.end),
+ str.slice(matchPos[i].right.start, matchPos[i].right.end)
+ ]);
+ }
+ return results;
+};
-function getFreeformFallbackBlockName(state) {
- return state.freeformFallbackBlockName;
-}
/**
- * Returns the name of the block for handling unregistered blocks.
- *
- * @param {Object} state Data state.
*
- * @return {string?} Name of the block for handling unregistered blocks.
+ * @param {string} str
+ * @param {string|function} replacement
+ * @param {string} left
+ * @param {string} right
+ * @param {string} flags
+ * @returns {string}
*/
+showdown.helper.replaceRecursiveRegExp = function (str, replacement, left, right, flags) {
+ 'use strict';
+
+ if (!showdown.helper.isFunction(replacement)) {
+ var repStr = replacement;
+ replacement = function () {
+ return repStr;
+ };
+ }
+
+ var matchPos = rgxFindMatchPos(str, left, right, flags),
+ finalStr = str,
+ lng = matchPos.length;
+
+ if (lng > 0) {
+ var bits = [];
+ if (matchPos[0].wholeMatch.start !== 0) {
+ bits.push(str.slice(0, matchPos[0].wholeMatch.start));
+ }
+ for (var i = 0; i < lng; ++i) {
+ bits.push(
+ replacement(
+ str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),
+ str.slice(matchPos[i].match.start, matchPos[i].match.end),
+ str.slice(matchPos[i].left.start, matchPos[i].left.end),
+ str.slice(matchPos[i].right.start, matchPos[i].right.end)
+ )
+ );
+ if (i < lng - 1) {
+ bits.push(str.slice(matchPos[i].wholeMatch.end, matchPos[i + 1].wholeMatch.start));
+ }
+ }
+ if (matchPos[lng - 1].wholeMatch.end < str.length) {
+ bits.push(str.slice(matchPos[lng - 1].wholeMatch.end));
+ }
+ finalStr = bits.join('');
+ }
+ return finalStr;
+};
-function getUnregisteredFallbackBlockName(state) {
- return state.unregisteredFallbackBlockName;
-}
/**
- * Returns the name of the block for handling unregistered blocks.
- *
- * @param {Object} state Data state.
+ * Returns the index within the passed String object of the first occurrence of the specified regex,
+ * starting the search at fromIndex. Returns -1 if the value is not found.
*
- * @return {string?} Name of the block for handling unregistered blocks.
+ * @param {string} str string to search
+ * @param {RegExp} regex Regular expression to search
+ * @param {int} [fromIndex = 0] Index to start the search
+ * @returns {Number}
+ * @throws InvalidArgumentError
*/
+showdown.helper.regexIndexOf = function (str, regex, fromIndex) {
+ 'use strict';
+ if (!showdown.helper.isString(str)) {
+ throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string';
+ }
+ if (regex instanceof RegExp === false) {
+ throw 'InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp';
+ }
+ var indexOf = str.substring(fromIndex || 0).search(regex);
+ return (indexOf >= 0) ? (indexOf + (fromIndex || 0)) : indexOf;
+};
-function getGroupingBlockName(state) {
- return state.groupingBlockName;
-}
/**
- * Returns an array with the child blocks of a given block.
- *
- * @param {Object} state Data state.
- * @param {string} blockName Block type name.
- *
- * @return {Array} Array of child block names.
+ * Splits the passed string object at the defined index, and returns an array composed of the two substrings
+ * @param {string} str string to split
+ * @param {int} index index to split string at
+ * @returns {[string,string]}
+ * @throws InvalidArgumentError
*/
+showdown.helper.splitAtIndex = function (str, index) {
+ 'use strict';
+ if (!showdown.helper.isString(str)) {
+ throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string';
+ }
+ return [str.substring(0, index), str.substring(index)];
+};
-const getChildBlockNames = Object(rememo["a" /* default */])((state, blockName) => {
- return Object(external_lodash_["map"])(Object(external_lodash_["filter"])(state.blockTypes, blockType => {
- return Object(external_lodash_["includes"])(blockType.parent, blockName);
- }), _ref => {
- let {
- name
- } = _ref;
- return name;
- });
-}, state => [state.blockTypes]);
/**
- * Returns the block support value for a feature, if defined.
+ * Obfuscate an e-mail address through the use of Character Entities,
+ * transforming ASCII characters into their equivalent decimal or hex entities.
*
- * @param {Object} state Data state.
- * @param {(string|Object)} nameOrType Block name or type object
- * @param {Array|string} feature Feature to retrieve
- * @param {*} defaultSupports Default value to return if not
- * explicitly defined
+ * Since it has a random component, subsequent calls to this function produce different results
*
- * @return {?*} Block support value
+ * @param {string} mail
+ * @returns {string}
*/
+showdown.helper.encodeEmailAddress = function (mail) {
+ 'use strict';
+ var encode = [
+ function (ch) {
+ return '&#' + ch.charCodeAt(0) + ';';
+ },
+ function (ch) {
+ return '&#x' + ch.charCodeAt(0).toString(16) + ';';
+ },
+ function (ch) {
+ return ch;
+ }
+ ];
-const getBlockSupport = (state, nameOrType, feature, defaultSupports) => {
- const blockType = getNormalizedBlockType(state, nameOrType);
-
- if (!(blockType !== null && blockType !== void 0 && blockType.supports)) {
- return defaultSupports;
- }
+ mail = mail.replace(/./g, function (ch) {
+ if (ch === '@') {
+ // this *must* be encoded. I insist.
+ ch = encode[Math.floor(Math.random() * 2)](ch);
+ } else {
+ var r = Math.random();
+ // roughly 10% raw, 45% hex, 45% dec
+ ch = (
+ r > 0.9 ? encode[2](ch) : r > 0.45 ? encode[1](ch) : encode[0](ch)
+ );
+ }
+ return ch;
+ });
- return Object(external_lodash_["get"])(blockType.supports, feature, defaultSupports);
+ return mail;
};
+
/**
- * Returns true if the block defines support for a feature, or false otherwise.
- *
- * @param {Object} state Data state.
- * @param {(string|Object)} nameOrType Block name or type object.
- * @param {string} feature Feature to test.
- * @param {boolean} defaultSupports Whether feature is supported by
- * default if not explicitly defined.
*
- * @return {boolean} Whether block supports feature.
+ * @param str
+ * @param targetLength
+ * @param padString
+ * @returns {string}
*/
+showdown.helper.padEnd = function padEnd (str, targetLength, padString) {
+ 'use strict';
+ /*jshint bitwise: false*/
+ // eslint-disable-next-line space-infix-ops
+ targetLength = targetLength>>0; //floor if number or convert non-number to 0;
+ /*jshint bitwise: true*/
+ padString = String(padString || ' ');
+ if (str.length > targetLength) {
+ return String(str);
+ } else {
+ targetLength = targetLength - str.length;
+ if (targetLength > padString.length) {
+ padString += padString.repeat(targetLength / padString.length); //append to original to ensure we are longer than needed
+ }
+ return String(str) + padString.slice(0,targetLength);
+ }
+};
-function hasBlockSupport(state, nameOrType, feature, defaultSupports) {
- return !!getBlockSupport(state, nameOrType, feature, defaultSupports);
-}
/**
- * Returns true if the block type by the given name or object value matches a
- * search term, or false otherwise.
- *
- * @param {Object} state Blocks state.
- * @param {(string|Object)} nameOrType Block name or type object.
- * @param {string} searchTerm Search term by which to filter.
- *
- * @return {Object[]} Whether block type matches search term.
+ * POLYFILLS
*/
-
-function isMatchingSearchTerm(state, nameOrType, searchTerm) {
- const blockType = getNormalizedBlockType(state, nameOrType);
- const getNormalizedSearchTerm = Object(external_lodash_["flow"])([// Disregard diacritics.
- // Input: "média"
- external_lodash_["deburr"], // Lowercase.
- // Input: "MEDIA"
- term => term.toLowerCase(), // Strip leading and trailing whitespace.
- // Input: " media "
- term => term.trim()]);
- const normalizedSearchTerm = getNormalizedSearchTerm(searchTerm);
- const isSearchMatch = Object(external_lodash_["flow"])([getNormalizedSearchTerm, normalizedCandidate => Object(external_lodash_["includes"])(normalizedCandidate, normalizedSearchTerm)]);
- return isSearchMatch(blockType.title) || Object(external_lodash_["some"])(blockType.keywords, isSearchMatch) || isSearchMatch(blockType.category);
-}
-/**
- * Returns a boolean indicating if a block has child blocks or not.
- *
- * @param {Object} state Data state.
- * @param {string} blockName Block type name.
- *
- * @return {boolean} True if a block contains child blocks and false otherwise.
- */
-
-const hasChildBlocks = (state, blockName) => {
- return getChildBlockNames(state, blockName).length > 0;
-};
-/**
- * Returns a boolean indicating if a block has at least one child block with inserter support.
- *
- * @param {Object} state Data state.
- * @param {string} blockName Block type name.
- *
- * @return {boolean} True if a block contains at least one child blocks with inserter support
- * and false otherwise.
- */
-
-const hasChildBlocksWithInserterSupport = (state, blockName) => {
- return Object(external_lodash_["some"])(getChildBlockNames(state, blockName), childBlockName => {
- return hasBlockSupport(state, childBlockName, 'inserter', true);
- });
-};
-
-// EXTERNAL MODULE: external ["wp","hooks"]
-var external_wp_hooks_ = __webpack_require__("g56x");
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/constants.js
-const STORE_NAME = 'core/blocks';
-
-// EXTERNAL MODULE: ./node_modules/colord/index.mjs
-var colord = __webpack_require__("fHnH");
-
-// EXTERNAL MODULE: ./node_modules/colord/plugins/names.mjs
-var plugins_names = __webpack_require__("abaT");
-
-// EXTERNAL MODULE: ./node_modules/colord/plugins/a11y.mjs
-var a11y = __webpack_require__("7bKH");
-
-// EXTERNAL MODULE: external ["wp","element"]
-var external_wp_element_ = __webpack_require__("GRId");
-
-// EXTERNAL MODULE: external ["wp","dom"]
-var external_wp_dom_ = __webpack_require__("1CF3");
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/constants.js
-const BLOCK_ICON_DEFAULT = 'block-default';
-/**
- * Array of valid keys in a block type settings deprecation object.
- *
- * @type {string[]}
- */
-
-const DEPRECATED_ENTRY_KEYS = ['attributes', 'supports', 'save', 'migrate', 'isEligible', 'apiVersion'];
-const __EXPERIMENTAL_STYLE_PROPERTY = {
- //kept for back-compatibility purposes.
- '--wp--style--color--link': {
- value: ['color', 'link'],
- support: ['color', 'link']
- },
- background: {
- value: ['color', 'gradient'],
- support: ['color', 'gradients']
- },
- backgroundColor: {
- value: ['color', 'background'],
- support: ['color', 'background'],
- requiresOptOut: true
- },
- borderColor: {
- value: ['border', 'color'],
- support: ['__experimentalBorder', 'color']
- },
- borderRadius: {
- value: ['border', 'radius'],
- support: ['__experimentalBorder', 'radius'],
- properties: {
- borderTopLeftRadius: 'topLeft',
- borderTopRightRadius: 'topRight',
- borderBottomLeftRadius: 'bottomLeft',
- borderBottomRightRadius: 'bottomRight'
- }
- },
- borderStyle: {
- value: ['border', 'style'],
- support: ['__experimentalBorder', 'style']
- },
- borderWidth: {
- value: ['border', 'width'],
- support: ['__experimentalBorder', 'width']
- },
- color: {
- value: ['color', 'text'],
- support: ['color', 'text'],
- requiresOptOut: true
- },
- linkColor: {
- value: ['elements', 'link', 'color', 'text'],
- support: ['color', 'link']
- },
- fontFamily: {
- value: ['typography', 'fontFamily'],
- support: ['typography', '__experimentalFontFamily']
- },
- fontSize: {
- value: ['typography', 'fontSize'],
- support: ['typography', 'fontSize']
- },
- fontStyle: {
- value: ['typography', 'fontStyle'],
- support: ['typography', '__experimentalFontStyle']
- },
- fontWeight: {
- value: ['typography', 'fontWeight'],
- support: ['typography', '__experimentalFontWeight']
- },
- lineHeight: {
- value: ['typography', 'lineHeight'],
- support: ['typography', 'lineHeight']
- },
- margin: {
- value: ['spacing', 'margin'],
- support: ['spacing', 'margin'],
- properties: {
- marginTop: 'top',
- marginRight: 'right',
- marginBottom: 'bottom',
- marginLeft: 'left'
- }
- },
- padding: {
- value: ['spacing', 'padding'],
- support: ['spacing', 'padding'],
- properties: {
- paddingTop: 'top',
- paddingRight: 'right',
- paddingBottom: 'bottom',
- paddingLeft: 'left'
+// use this instead of builtin is undefined for IE8 compatibility
+if (typeof console === 'undefined') {
+ console = {
+ warn: function (msg) {
+ 'use strict';
+ alert(msg);
+ },
+ log: function (msg) {
+ 'use strict';
+ alert(msg);
+ },
+ error: function (msg) {
+ 'use strict';
+ throw msg;
}
- },
- textDecoration: {
- value: ['typography', 'textDecoration'],
- support: ['typography', '__experimentalTextDecoration']
- },
- textTransform: {
- value: ['typography', 'textTransform'],
- support: ['typography', '__experimentalTextTransform']
- },
- letterSpacing: {
- value: ['typography', 'letterSpacing'],
- support: ['typography', '__experimentalLetterSpacing']
- },
- '--wp--style--block-gap': {
- value: ['spacing', 'blockGap'],
- support: ['spacing', 'blockGap']
- }
-};
-const __EXPERIMENTAL_ELEMENTS = {
- link: 'a',
- h1: 'h1',
- h2: 'h2',
- h3: 'h3',
- h4: 'h4',
- h5: 'h5',
- h6: 'h6'
-};
-const __EXPERIMENTAL_PATHS_WITH_MERGE = {
- 'color.duotone': true,
- 'color.gradients': true,
- 'color.palette': true,
- 'typography.fontFamilies': true,
- 'typography.fontSizes': true
-};
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/registration.js
-/* eslint no-console: [ 'error', { allow: [ 'error', 'warn' ] } ] */
-
-/**
- * External dependencies
- */
-
-/**
- * WordPress dependencies
- */
-
-
+ };
+}
/**
- * Internal dependencies
+ * Common regexes.
+ * We declare some common regexes to improve performance
*/
-
-const i18nBlockSchema = {
- title: "block title",
- description: "block description",
- keywords: ["block keyword"],
- styles: [{
- label: "block style label"
- }],
- variations: [{
- title: "block variation title",
- description: "block variation description",
- keywords: ["block variation keyword"]
- }]
+showdown.helper.regexes = {
+ asteriskDashAndColon: /([*_:~])/g
};
-
-/**
- * An icon type definition. One of a Dashicon slug, an element,
- * or a component.
- *
- * @typedef {(string|WPElement|WPComponent)} WPIcon
- *
- * @see https://developer.wordpress.org/resource/dashicons/
- */
-
/**
- * Render behavior of a block type icon; one of a Dashicon slug, an element,
- * or a component.
- *
- * @typedef {WPIcon} WPBlockTypeIconRender
- */
-
-/**
- * An object describing a normalized block type icon.
- *
- * @typedef {Object} WPBlockTypeIconDescriptor
- *
- * @property {WPBlockTypeIconRender} src Render behavior of the icon,
- * one of a Dashicon slug, an
- * element, or a component.
- * @property {string} background Optimal background hex string
- * color when displaying icon.
- * @property {string} foreground Optimal foreground hex string
- * color when displaying icon.
- * @property {string} shadowColor Optimal shadow hex string
- * color when displaying icon.
- */
-
-/**
- * Value to use to render the icon for a block type in an editor interface,
- * either a Dashicon slug, an element, a component, or an object describing
- * the icon.
- *
- * @typedef {(WPBlockTypeIconDescriptor|WPBlockTypeIconRender)} WPBlockTypeIcon
- */
-
-/**
- * Named block variation scopes.
- *
- * @typedef {'block'|'inserter'|'transform'} WPBlockVariationScope
- */
-
-/**
- * An object describing a variation defined for the block type.
- *
- * @typedef {Object} WPBlockVariation
- *
- * @property {string} name The unique and machine-readable name.
- * @property {string} title A human-readable variation title.
- * @property {string} [description] A detailed variation description.
- * @property {string} [category] Block type category classification,
- * used in search interfaces to arrange
- * block types by category.
- * @property {WPIcon} [icon] An icon helping to visualize the variation.
- * @property {boolean} [isDefault] Indicates whether the current variation is
- * the default one. Defaults to `false`.
- * @property {Object} [attributes] Values which override block attributes.
- * @property {Array[]} [innerBlocks] Initial configuration of nested blocks.
- * @property {Object} [example] Example provides structured data for
- * the block preview. You can set to
- * `undefined` to disable the preview shown
- * for the block type.
- * @property {WPBlockVariationScope[]} [scope] The list of scopes where the variation
- * is applicable. When not provided, it
- * assumes all available scopes.
- * @property {string[]} [keywords] An array of terms (which can be translated)
- * that help users discover the variation
- * while searching.
- * @property {Function|string[]} [isActive] This can be a function or an array of block attributes.
- * Function that accepts a block's attributes and the
- * variation's attributes and determines if a variation is active.
- * This function doesn't try to find a match dynamically based
- * on all block's attributes, as in many cases some attributes are irrelevant.
- * An example would be for `embed` block where we only care
- * about `providerNameSlug` attribute's value.
- * We can also use a `string[]` to tell which attributes
- * should be compared as a shorthand. Each attributes will
- * be matched and the variation will be active if all of them are matching.
- */
-
-/**
- * Defined behavior of a block type.
- *
- * @typedef {Object} WPBlockType
- *
- * @property {string} name Block type's namespaced name.
- * @property {string} title Human-readable block type label.
- * @property {string} [description] A detailed block type description.
- * @property {string} [category] Block type category classification,
- * used in search interfaces to arrange
- * block types by category.
- * @property {WPBlockTypeIcon} [icon] Block type icon.
- * @property {string[]} [keywords] Additional keywords to produce block
- * type as result in search interfaces.
- * @property {Object} [attributes] Block type attributes.
- * @property {WPComponent} [save] Optional component describing
- * serialized markup structure of a
- * block type.
- * @property {WPComponent} edit Component rendering an element to
- * manipulate the attributes of a block
- * in the context of an editor.
- * @property {WPBlockVariation[]} [variations] The list of block variations.
- * @property {Object} [example] Example provides structured data for
- * the block preview. When not defined
- * then no preview is shown.
- */
-
-const serverSideBlockDefinitions = {};
-/**
- * Sets the server side block definition of blocks.
- *
- * @param {Object} definitions Server-side block definitions
- */
-// eslint-disable-next-line camelcase
-
-function unstable__bootstrapServerSideBlockDefinitions(definitions) {
- for (const blockName of Object.keys(definitions)) {
- // Don't overwrite if already set. It covers the case when metadata
- // was initialized from the server.
- if (serverSideBlockDefinitions[blockName]) {
- // We still need to polyfill `apiVersion` for WordPress version
- // lower than 5.7. If it isn't present in the definition shared
- // from the server, we try to fallback to the definition passed.
- // @see https://github.com/WordPress/gutenberg/pull/29279
- if (serverSideBlockDefinitions[blockName].apiVersion === undefined && definitions[blockName].apiVersion) {
- serverSideBlockDefinitions[blockName].apiVersion = definitions[blockName].apiVersion;
- }
-
- continue;
- }
-
- serverSideBlockDefinitions[blockName] = Object(external_lodash_["mapKeys"])(Object(external_lodash_["pickBy"])(definitions[blockName], value => !Object(external_lodash_["isNil"])(value)), (value, key) => Object(external_lodash_["camelCase"])(key));
- }
-}
-/**
- * Gets block settings from metadata loaded from `block.json` file.
- *
- * @param {Object} metadata Block metadata loaded from `block.json`.
- * @param {string} metadata.textdomain Textdomain to use with translations.
- *
- * @return {Object} Block settings.
- */
-
-function getBlockSettingsFromMetadata(_ref) {
- let {
- textdomain,
- ...metadata
- } = _ref;
- const allowedFields = ['apiVersion', 'title', 'category', 'parent', 'icon', 'description', 'keywords', 'attributes', 'providesContext', 'usesContext', 'supports', 'styles', 'example', 'variations'];
- const settings = Object(external_lodash_["pick"])(metadata, allowedFields);
-
- if (textdomain) {
- Object.keys(i18nBlockSchema).forEach(key => {
- if (!settings[key]) {
- return;
- }
-
- settings[key] = translateBlockSettingUsingI18nSchema(i18nBlockSchema[key], settings[key], textdomain);
- });
- }
-
- return settings;
-}
-/**
- * Registers a new block provided a unique name and an object defining its
- * behavior. Once registered, the block is made available as an option to any
- * editor interface where blocks are implemented.
- *
- * @param {string|Object} blockNameOrMetadata Block type name or its metadata.
- * @param {Object} settings Block settings.
- *
- * @return {?WPBlockType} The block, if it has been successfully registered;
- * otherwise `undefined`.
- */
-
-
-function registerBlockType(blockNameOrMetadata, settings) {
- const name = Object(external_lodash_["isObject"])(blockNameOrMetadata) ? blockNameOrMetadata.name : blockNameOrMetadata;
-
- if (typeof name !== 'string') {
- console.error('Block names must be strings.');
- return;
- }
-
- if (!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(name)) {
- console.error('Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block');
- return;
- }
-
- if (Object(external_wp_data_["select"])(store).getBlockType(name)) {
- console.error('Block "' + name + '" is already registered.');
- return;
- }
-
- if (Object(external_lodash_["isObject"])(blockNameOrMetadata)) {
- unstable__bootstrapServerSideBlockDefinitions({
- [name]: getBlockSettingsFromMetadata(blockNameOrMetadata)
- });
- }
-
- const blockType = {
- name,
- icon: BLOCK_ICON_DEFAULT,
- keywords: [],
- attributes: {},
- providesContext: {},
- usesContext: [],
- supports: {},
- styles: [],
- variations: [],
- save: () => null,
- ...(serverSideBlockDefinitions === null || serverSideBlockDefinitions === void 0 ? void 0 : serverSideBlockDefinitions[name]),
- ...settings
- };
-
- Object(external_wp_data_["dispatch"])(store).__experimentalRegisterBlockType(blockType);
-
- return Object(external_wp_data_["select"])(store).getBlockType(name);
-}
-/**
- * Translates block settings provided with metadata using the i18n schema.
- *
- * @param {string|string[]|Object[]} i18nSchema I18n schema for the block setting.
- * @param {string|string[]|Object[]} settingValue Value for the block setting.
- * @param {string} textdomain Textdomain to use with translations.
- *
- * @return {string|string[]|Object[]} Translated setting.
- */
-
-function translateBlockSettingUsingI18nSchema(i18nSchema, settingValue, textdomain) {
- if (Object(external_lodash_["isString"])(i18nSchema) && Object(external_lodash_["isString"])(settingValue)) {
- // eslint-disable-next-line @wordpress/i18n-no-variables, @wordpress/i18n-text-domain
- return Object(external_wp_i18n_["_x"])(settingValue, i18nSchema, textdomain);
- }
-
- if (Object(external_lodash_["isArray"])(i18nSchema) && !Object(external_lodash_["isEmpty"])(i18nSchema) && Object(external_lodash_["isArray"])(settingValue)) {
- return settingValue.map(value => translateBlockSettingUsingI18nSchema(i18nSchema[0], value, textdomain));
- }
-
- if (Object(external_lodash_["isObject"])(i18nSchema) && !Object(external_lodash_["isEmpty"])(i18nSchema) && Object(external_lodash_["isObject"])(settingValue)) {
- return Object.keys(settingValue).reduce((accumulator, key) => {
- if (!i18nSchema[key]) {
- accumulator[key] = settingValue[key];
- return accumulator;
- }
-
- accumulator[key] = translateBlockSettingUsingI18nSchema(i18nSchema[key], settingValue[key], textdomain);
- return accumulator;
- }, {});
- }
-
- return settingValue;
-}
-/**
- * Registers a new block collection to group blocks in the same namespace in the inserter.
- *
- * @param {string} namespace The namespace to group blocks by in the inserter; corresponds to the block namespace.
- * @param {Object} settings The block collection settings.
- * @param {string} settings.title The title to display in the block inserter.
- * @param {Object} [settings.icon] The icon to display in the block inserter.
- */
-
-
-function registerBlockCollection(namespace, _ref2) {
- let {
- title,
- icon
- } = _ref2;
- Object(external_wp_data_["dispatch"])(store).addBlockCollection(namespace, title, icon);
-}
-/**
- * Unregisters a block collection
- *
- * @param {string} namespace The namespace to group blocks by in the inserter; corresponds to the block namespace
- *
- */
-
-function unregisterBlockCollection(namespace) {
- Object(external_wp_data_["dispatch"])(store).removeBlockCollection(namespace);
-}
-/**
- * Unregisters a block.
- *
- * @param {string} name Block name.
- *
- * @return {?WPBlockType} The previous block value, if it has been successfully
- * unregistered; otherwise `undefined`.
- */
-
-function unregisterBlockType(name) {
- const oldBlock = Object(external_wp_data_["select"])(store).getBlockType(name);
-
- if (!oldBlock) {
- console.error('Block "' + name + '" is not registered.');
- return;
- }
-
- Object(external_wp_data_["dispatch"])(store).removeBlockTypes(name);
- return oldBlock;
-}
-/**
- * Assigns name of block for handling non-block content.
- *
- * @param {string} blockName Block name.
- */
-
-function setFreeformContentHandlerName(blockName) {
- Object(external_wp_data_["dispatch"])(store).setFreeformFallbackBlockName(blockName);
-}
-/**
- * Retrieves name of block handling non-block content, or undefined if no
- * handler has been defined.
- *
- * @return {?string} Block name.
- */
-
-function getFreeformContentHandlerName() {
- return Object(external_wp_data_["select"])(store).getFreeformFallbackBlockName();
-}
-/**
- * Retrieves name of block used for handling grouping interactions.
- *
- * @return {?string} Block name.
- */
-
-function registration_getGroupingBlockName() {
- return Object(external_wp_data_["select"])(store).getGroupingBlockName();
-}
-/**
- * Assigns name of block handling unregistered block types.
- *
- * @param {string} blockName Block name.
- */
-
-function setUnregisteredTypeHandlerName(blockName) {
- Object(external_wp_data_["dispatch"])(store).setUnregisteredFallbackBlockName(blockName);
-}
-/**
- * Retrieves name of block handling unregistered block types, or undefined if no
- * handler has been defined.
- *
- * @return {?string} Block name.
- */
-
-function getUnregisteredTypeHandlerName() {
- return Object(external_wp_data_["select"])(store).getUnregisteredFallbackBlockName();
-}
-/**
- * Assigns the default block name.
- *
- * @param {string} name Block name.
- */
-
-function setDefaultBlockName(name) {
- Object(external_wp_data_["dispatch"])(store).setDefaultBlockName(name);
-}
-/**
- * Assigns name of block for handling block grouping interactions.
- *
- * @param {string} name Block name.
- */
-
-function setGroupingBlockName(name) {
- Object(external_wp_data_["dispatch"])(store).setGroupingBlockName(name);
-}
-/**
- * Retrieves the default block name.
- *
- * @return {?string} Block name.
- */
-
-function registration_getDefaultBlockName() {
- return Object(external_wp_data_["select"])(store).getDefaultBlockName();
-}
-/**
- * Returns a registered block type.
- *
- * @param {string} name Block name.
- *
- * @return {?Object} Block type.
- */
-
-function registration_getBlockType(name) {
- var _select;
-
- return (_select = Object(external_wp_data_["select"])(store)) === null || _select === void 0 ? void 0 : _select.getBlockType(name);
-}
-/**
- * Returns all registered blocks.
- *
- * @return {Array} Block settings.
- */
-
-function registration_getBlockTypes() {
- return Object(external_wp_data_["select"])(store).getBlockTypes();
-}
-/**
- * Returns the block support value for a feature, if defined.
- *
- * @param {(string|Object)} nameOrType Block name or type object
- * @param {string} feature Feature to retrieve
- * @param {*} defaultSupports Default value to return if not
- * explicitly defined
- *
- * @return {?*} Block support value
- */
-
-function registration_getBlockSupport(nameOrType, feature, defaultSupports) {
- return Object(external_wp_data_["select"])(store).getBlockSupport(nameOrType, feature, defaultSupports);
-}
-/**
- * Returns true if the block defines support for a feature, or false otherwise.
- *
- * @param {(string|Object)} nameOrType Block name or type object.
- * @param {string} feature Feature to test.
- * @param {boolean} defaultSupports Whether feature is supported by
- * default if not explicitly defined.
- *
- * @return {boolean} Whether block supports feature.
- */
-
-function registration_hasBlockSupport(nameOrType, feature, defaultSupports) {
- return Object(external_wp_data_["select"])(store).hasBlockSupport(nameOrType, feature, defaultSupports);
-}
-/**
- * Determines whether or not the given block is a reusable block. This is a
- * special block type that is used to point to a global block stored via the
- * API.
- *
- * @param {Object} blockOrType Block or Block Type to test.
- *
- * @return {boolean} Whether the given block is a reusable block.
- */
-
-function isReusableBlock(blockOrType) {
- return (blockOrType === null || blockOrType === void 0 ? void 0 : blockOrType.name) === 'core/block';
-}
-/**
- * Determines whether or not the given block is a template part. This is a
- * special block type that allows composing a page template out of reusable
- * design elements.
- *
- * @param {Object} blockOrType Block or Block Type to test.
- *
- * @return {boolean} Whether the given block is a template part.
- */
-
-function isTemplatePart(blockOrType) {
- return blockOrType.name === 'core/template-part';
-}
-/**
- * Returns an array with the child blocks of a given block.
- *
- * @param {string} blockName Name of block (example: “latest-posts”).
- *
- * @return {Array} Array of child block names.
- */
-
-const registration_getChildBlockNames = blockName => {
- return Object(external_wp_data_["select"])(store).getChildBlockNames(blockName);
-};
-/**
- * Returns a boolean indicating if a block has child blocks or not.
- *
- * @param {string} blockName Name of block (example: “latest-posts”).
- *
- * @return {boolean} True if a block contains child blocks and false otherwise.
- */
-
-const registration_hasChildBlocks = blockName => {
- return Object(external_wp_data_["select"])(store).hasChildBlocks(blockName);
-};
-/**
- * Returns a boolean indicating if a block has at least one child block with inserter support.
- *
- * @param {string} blockName Block type name.
- *
- * @return {boolean} True if a block contains at least one child blocks with inserter support
- * and false otherwise.
- */
-
-const registration_hasChildBlocksWithInserterSupport = blockName => {
- return Object(external_wp_data_["select"])(store).hasChildBlocksWithInserterSupport(blockName);
-};
-/**
- * Registers a new block style variation for the given block.
- *
- * @param {string} blockName Name of block (example: “core/latest-posts”).
- * @param {Object} styleVariation Object containing `name` which is the class name applied to the block and `label` which identifies the variation to the user.
- */
-
-const registerBlockStyle = (blockName, styleVariation) => {
- Object(external_wp_data_["dispatch"])(store).addBlockStyles(blockName, styleVariation);
-};
-/**
- * Unregisters a block style variation for the given block.
- *
- * @param {string} blockName Name of block (example: “core/latest-posts”).
- * @param {string} styleVariationName Name of class applied to the block.
- */
-
-const unregisterBlockStyle = (blockName, styleVariationName) => {
- Object(external_wp_data_["dispatch"])(store).removeBlockStyles(blockName, styleVariationName);
-};
-/**
- * Returns an array with the variations of a given block type.
- *
- * @param {string} blockName Name of block (example: “core/columns”).
- * @param {WPBlockVariationScope} [scope] Block variation scope name.
- *
- * @return {(WPBlockVariation[]|void)} Block variations.
- */
-
-const registration_getBlockVariations = (blockName, scope) => {
- return Object(external_wp_data_["select"])(store).getBlockVariations(blockName, scope);
-};
-/**
- * Registers a new block variation for the given block type.
- *
- * @param {string} blockName Name of the block (example: “core/columns”).
- * @param {WPBlockVariation} variation Object describing a block variation.
- */
-
-const registerBlockVariation = (blockName, variation) => {
- Object(external_wp_data_["dispatch"])(store).addBlockVariations(blockName, variation);
-};
-/**
- * Unregisters a block variation defined for the given block type.
- *
- * @param {string} blockName Name of the block (example: “core/columns”).
- * @param {string} variationName Name of the variation defined for the block.
- */
-
-const unregisterBlockVariation = (blockName, variationName) => {
- Object(external_wp_data_["dispatch"])(store).removeBlockVariations(blockName, variationName);
-};
-
-// EXTERNAL MODULE: ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules
-var v4 = __webpack_require__("7Cbv");
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/factory.js
-/**
- * External dependencies
- */
-
-
-/**
- * WordPress dependencies
- */
-
-
-/**
- * Internal dependencies
- */
-
-
-
-/**
- * Returns a block object given its type and attributes.
- *
- * @param {string} name Block name.
- * @param {Object} attributes Block attributes.
- * @param {?Array} innerBlocks Nested blocks.
- *
- * @return {Object} Block object.
- */
-
-function createBlock(name) {
- let attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- let innerBlocks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
-
- const sanitizedAttributes = __experimentalSanitizeBlockAttributes(name, attributes);
-
- const clientId = Object(v4["a" /* default */])(); // Blocks are stored with a unique ID, the assigned type name, the block
- // attributes, and their inner blocks.
-
- return {
- clientId,
- name,
- isValid: true,
- attributes: sanitizedAttributes,
- innerBlocks
- };
-}
-/**
- * Given an array of InnerBlocks templates or Block Objects,
- * returns an array of created Blocks from them.
- * It handles the case of having InnerBlocks as Blocks by
- * converting them to the proper format to continue recursively.
- *
- * @param {Array} innerBlocksOrTemplate Nested blocks or InnerBlocks templates.
- *
- * @return {Object[]} Array of Block objects.
- */
-
-function createBlocksFromInnerBlocksTemplate() {
- let innerBlocksOrTemplate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- return innerBlocksOrTemplate.map(innerBlock => {
- const innerBlockTemplate = Array.isArray(innerBlock) ? innerBlock : [innerBlock.name, innerBlock.attributes, innerBlock.innerBlocks];
- const [name, attributes, innerBlocks = []] = innerBlockTemplate;
- return createBlock(name, attributes, createBlocksFromInnerBlocksTemplate(innerBlocks));
- });
-}
-/**
- * Given a block object, returns a copy of the block object while sanitizing its attributes,
- * optionally merging new attributes and/or replacing its inner blocks.
- *
- * @param {Object} block Block instance.
- * @param {Object} mergeAttributes Block attributes.
- * @param {?Array} newInnerBlocks Nested blocks.
- *
- * @return {Object} A cloned block.
- */
-
-function __experimentalCloneSanitizedBlock(block) {
- let mergeAttributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- let newInnerBlocks = arguments.length > 2 ? arguments[2] : undefined;
- const clientId = Object(v4["a" /* default */])();
-
- const sanitizedAttributes = __experimentalSanitizeBlockAttributes(block.name, { ...block.attributes,
- ...mergeAttributes
- });
-
- return { ...block,
- clientId,
- attributes: sanitizedAttributes,
- innerBlocks: newInnerBlocks || block.innerBlocks.map(innerBlock => __experimentalCloneSanitizedBlock(innerBlock))
- };
-}
-/**
- * Given a block object, returns a copy of the block object,
- * optionally merging new attributes and/or replacing its inner blocks.
- *
- * @param {Object} block Block instance.
- * @param {Object} mergeAttributes Block attributes.
- * @param {?Array} newInnerBlocks Nested blocks.
- *
- * @return {Object} A cloned block.
- */
-
-function cloneBlock(block) {
- let mergeAttributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- let newInnerBlocks = arguments.length > 2 ? arguments[2] : undefined;
- const clientId = Object(v4["a" /* default */])();
- return { ...block,
- clientId,
- attributes: { ...block.attributes,
- ...mergeAttributes
- },
- innerBlocks: newInnerBlocks || block.innerBlocks.map(innerBlock => cloneBlock(innerBlock))
- };
-}
-/**
- * Returns a boolean indicating whether a transform is possible based on
- * various bits of context.
- *
- * @param {Object} transform The transform object to validate.
- * @param {string} direction Is this a 'from' or 'to' transform.
- * @param {Array} blocks The blocks to transform from.
- *
- * @return {boolean} Is the transform possible?
- */
-
-const isPossibleTransformForSource = (transform, direction, blocks) => {
- if (Object(external_lodash_["isEmpty"])(blocks)) {
- return false;
- } // If multiple blocks are selected, only multi block transforms
- // or wildcard transforms are allowed.
-
-
- const isMultiBlock = blocks.length > 1;
- const firstBlockName = Object(external_lodash_["first"])(blocks).name;
- const isValidForMultiBlocks = isWildcardBlockTransform(transform) || !isMultiBlock || transform.isMultiBlock;
-
- if (!isValidForMultiBlocks) {
- return false;
- } // Check non-wildcard transforms to ensure that transform is valid
- // for a block selection of multiple blocks of different types
-
-
- if (!isWildcardBlockTransform(transform) && !Object(external_lodash_["every"])(blocks, {
- name: firstBlockName
- })) {
- return false;
- } // Only consider 'block' type transforms as valid.
-
-
- const isBlockType = transform.type === 'block';
-
- if (!isBlockType) {
- return false;
- } // Check if the transform's block name matches the source block (or is a wildcard)
- // only if this is a transform 'from'.
-
-
- const sourceBlock = Object(external_lodash_["first"])(blocks);
- const hasMatchingName = direction !== 'from' || transform.blocks.indexOf(sourceBlock.name) !== -1 || isWildcardBlockTransform(transform);
-
- if (!hasMatchingName) {
- return false;
- } // Don't allow single Grouping blocks to be transformed into
- // a Grouping block.
-
-
- if (!isMultiBlock && isContainerGroupBlock(sourceBlock.name) && isContainerGroupBlock(transform.blockName)) {
- return false;
- } // If the transform has a `isMatch` function specified, check that it returns true.
-
-
- if (Object(external_lodash_["isFunction"])(transform.isMatch)) {
- const attributes = transform.isMultiBlock ? blocks.map(block => block.attributes) : sourceBlock.attributes;
- const block = transform.isMultiBlock ? blocks : sourceBlock;
-
- if (!transform.isMatch(attributes, block)) {
- return false;
- }
- }
-
- if (transform.usingMobileTransformations && isWildcardBlockTransform(transform) && !isContainerGroupBlock(sourceBlock.name)) {
- return false;
- }
-
- return true;
-};
-/**
- * Returns block types that the 'blocks' can be transformed into, based on
- * 'from' transforms on other blocks.
- *
- * @param {Array} blocks The blocks to transform from.
- *
- * @return {Array} Block types that the blocks can be transformed into.
- */
-
-
-const getBlockTypesForPossibleFromTransforms = blocks => {
- if (Object(external_lodash_["isEmpty"])(blocks)) {
- return [];
- }
-
- const allBlockTypes = registration_getBlockTypes(); // filter all blocks to find those with a 'from' transform.
-
- const blockTypesWithPossibleFromTransforms = Object(external_lodash_["filter"])(allBlockTypes, blockType => {
- const fromTransforms = getBlockTransforms('from', blockType.name);
- return !!findTransform(fromTransforms, transform => {
- return isPossibleTransformForSource(transform, 'from', blocks);
- });
- });
- return blockTypesWithPossibleFromTransforms;
-};
-/**
- * Returns block types that the 'blocks' can be transformed into, based on
- * the source block's own 'to' transforms.
- *
- * @param {Array} blocks The blocks to transform from.
- *
- * @return {Array} Block types that the source can be transformed into.
- */
-
-
-const getBlockTypesForPossibleToTransforms = blocks => {
- if (Object(external_lodash_["isEmpty"])(blocks)) {
- return [];
- }
-
- const sourceBlock = Object(external_lodash_["first"])(blocks);
- const blockType = registration_getBlockType(sourceBlock.name);
- const transformsTo = blockType ? getBlockTransforms('to', blockType.name) : []; // filter all 'to' transforms to find those that are possible.
-
- const possibleTransforms = Object(external_lodash_["filter"])(transformsTo, transform => {
- return transform && isPossibleTransformForSource(transform, 'to', blocks);
- }); // Build a list of block names using the possible 'to' transforms.
-
- const blockNames = Object(external_lodash_["flatMap"])(possibleTransforms, transformation => transformation.blocks); // Map block names to block types.
-
- return blockNames.map(name => registration_getBlockType(name));
-};
-/**
- * Determines whether transform is a "block" type
- * and if so whether it is a "wildcard" transform
- * ie: targets "any" block type
- *
- * @param {Object} t the Block transform object
- *
- * @return {boolean} whether transform is a wildcard transform
- */
-
-
-const isWildcardBlockTransform = t => t && t.type === 'block' && Array.isArray(t.blocks) && t.blocks.includes('*');
-/**
- * Determines whether the given Block is the core Block which
- * acts as a container Block for other Blocks as part of the
- * Grouping mechanics
- *
- * @param {string} name the name of the Block to test against
- *
- * @return {boolean} whether or not the Block is the container Block type
- */
-
-const isContainerGroupBlock = name => name === registration_getGroupingBlockName();
-/**
- * Returns an array of block types that the set of blocks received as argument
- * can be transformed into.
- *
- * @param {Array} blocks Blocks array.
- *
- * @return {Array} Block types that the blocks argument can be transformed to.
- */
-
-function getPossibleBlockTransformations(blocks) {
- if (Object(external_lodash_["isEmpty"])(blocks)) {
- return [];
- }
-
- const blockTypesForFromTransforms = getBlockTypesForPossibleFromTransforms(blocks);
- const blockTypesForToTransforms = getBlockTypesForPossibleToTransforms(blocks);
- return Object(external_lodash_["uniq"])([...blockTypesForFromTransforms, ...blockTypesForToTransforms]);
-}
-/**
- * Given an array of transforms, returns the highest-priority transform where
- * the predicate function returns a truthy value. A higher-priority transform
- * is one with a lower priority value (i.e. first in priority order). Returns
- * null if the transforms set is empty or the predicate function returns a
- * falsey value for all entries.
- *
- * @param {Object[]} transforms Transforms to search.
- * @param {Function} predicate Function returning true on matching transform.
- *
- * @return {?Object} Highest-priority transform candidate.
- */
-
-function findTransform(transforms, predicate) {
- // The hooks library already has built-in mechanisms for managing priority
- // queue, so leverage via locally-defined instance.
- const hooks = Object(external_wp_hooks_["createHooks"])();
-
- for (let i = 0; i < transforms.length; i++) {
- const candidate = transforms[i];
-
- if (predicate(candidate)) {
- hooks.addFilter('transform', 'transform/' + i.toString(), result => result ? result : candidate, candidate.priority);
- }
- } // Filter name is arbitrarily chosen but consistent with above aggregation.
-
-
- return hooks.applyFilters('transform', null);
-}
-/**
- * Returns normal block transforms for a given transform direction, optionally
- * for a specific block by name, or an empty array if there are no transforms.
- * If no block name is provided, returns transforms for all blocks. A normal
- * transform object includes `blockName` as a property.
- *
- * @param {string} direction Transform direction ("to", "from").
- * @param {string|Object} blockTypeOrName Block type or name.
- *
- * @return {Array} Block transforms for direction.
- */
-
-function getBlockTransforms(direction, blockTypeOrName) {
- // When retrieving transforms for all block types, recurse into self.
- if (blockTypeOrName === undefined) {
- return Object(external_lodash_["flatMap"])(registration_getBlockTypes(), _ref => {
- let {
- name
- } = _ref;
- return getBlockTransforms(direction, name);
- });
- } // Validate that block type exists and has array of direction.
-
-
- const blockType = normalizeBlockType(blockTypeOrName);
- const {
- name: blockName,
- transforms
- } = blockType || {};
-
- if (!transforms || !Array.isArray(transforms[direction])) {
- return [];
- }
-
- const usingMobileTransformations = transforms.supportedMobileTransforms && Array.isArray(transforms.supportedMobileTransforms);
- const filteredTransforms = usingMobileTransformations ? Object(external_lodash_["filter"])(transforms[direction], t => {
- if (t.type === 'raw') {
- return true;
- }
-
- if (!t.blocks || !t.blocks.length) {
- return false;
- }
-
- if (isWildcardBlockTransform(t)) {
- return true;
- }
-
- return Object(external_lodash_["every"])(t.blocks, transformBlockName => transforms.supportedMobileTransforms.includes(transformBlockName));
- }) : transforms[direction]; // Map transforms to normal form.
-
- return filteredTransforms.map(transform => ({ ...transform,
- blockName,
- usingMobileTransformations
- }));
-}
-/**
- * Switch one or more blocks into one or more blocks of the new block type.
- *
- * @param {Array|Object} blocks Blocks array or block object.
- * @param {string} name Block name.
- *
- * @return {?Array} Array of blocks or null.
- */
-
-function switchToBlockType(blocks, name) {
- const blocksArray = Object(external_lodash_["castArray"])(blocks);
- const isMultiBlock = blocksArray.length > 1;
- const firstBlock = blocksArray[0];
- const sourceName = firstBlock.name; // Find the right transformation by giving priority to the "to"
- // transformation.
-
- const transformationsFrom = getBlockTransforms('from', name);
- const transformationsTo = getBlockTransforms('to', sourceName);
- const transformation = findTransform(transformationsTo, t => t.type === 'block' && (isWildcardBlockTransform(t) || t.blocks.indexOf(name) !== -1) && (!isMultiBlock || t.isMultiBlock)) || findTransform(transformationsFrom, t => t.type === 'block' && (isWildcardBlockTransform(t) || t.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || t.isMultiBlock)); // Stop if there is no valid transformation.
-
- if (!transformation) {
- return null;
- }
-
- let transformationResults;
-
- if (transformation.isMultiBlock) {
- if (Object(external_lodash_["has"])(transformation, '__experimentalConvert')) {
- transformationResults = transformation.__experimentalConvert(blocksArray);
- } else {
- transformationResults = transformation.transform(blocksArray.map(currentBlock => currentBlock.attributes), blocksArray.map(currentBlock => currentBlock.innerBlocks));
- }
- } else if (Object(external_lodash_["has"])(transformation, '__experimentalConvert')) {
- transformationResults = transformation.__experimentalConvert(firstBlock);
- } else {
- transformationResults = transformation.transform(firstBlock.attributes, firstBlock.innerBlocks);
- } // Ensure that the transformation function returned an object or an array
- // of objects.
-
-
- if (!Object(external_lodash_["isObjectLike"])(transformationResults)) {
- return null;
- } // If the transformation function returned a single object, we want to work
- // with an array instead.
-
-
- transformationResults = Object(external_lodash_["castArray"])(transformationResults); // Ensure that every block object returned by the transformation has a
- // valid block type.
-
- if (transformationResults.some(result => !registration_getBlockType(result.name))) {
- return null;
- }
-
- const hasSwitchedBlock = Object(external_lodash_["some"])(transformationResults, result => result.name === name); // Ensure that at least one block object returned by the transformation has
- // the expected "destination" block type.
-
- if (!hasSwitchedBlock) {
- return null;
- }
-
- const ret = transformationResults.map(result => {
- /**
- * Filters an individual transform result from block transformation.
- * All of the original blocks are passed, since transformations are
- * many-to-many, not one-to-one.
- *
- * @param {Object} transformedBlock The transformed block.
- * @param {Object[]} blocks Original blocks transformed.
- */
- return Object(external_wp_hooks_["applyFilters"])('blocks.switchToBlockType.transformedBlock', result, blocks);
- });
- return ret;
-}
-/**
- * Create a block object from the example API.
- *
- * @param {string} name
- * @param {Object} example
- *
- * @return {Object} block.
- */
-
-const getBlockFromExample = (name, example) => {
- return createBlock(name, example.attributes, Object(external_lodash_["map"])(example.innerBlocks, innerBlock => getBlockFromExample(innerBlock.name, innerBlock)));
-};
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/utils.js
-/**
- * External dependencies
- */
-
-
-
-
-/**
- * WordPress dependencies
- */
-
-
-
-
-/**
- * Internal dependencies
- */
-
-
-
-
-Object(colord["b" /* extend */])([plugins_names["a" /* default */], a11y["a" /* default */]]);
-/**
- * Array of icon colors containing a color to be used if the icon color
- * was not explicitly set but the icon background color was.
- *
- * @type {Object}
- */
-
-const ICON_COLORS = ['#191e23', '#f8f9f9'];
-/**
- * Determines whether the block is a default block
- * and its attributes are equal to the default attributes
- * which means the block is unmodified.
- *
- * @param {WPBlock} block Block Object
- *
- * @return {boolean} Whether the block is an unmodified default block
- */
-
-function isUnmodifiedDefaultBlock(block) {
- const defaultBlockName = registration_getDefaultBlockName();
-
- if (block.name !== defaultBlockName) {
- return false;
- } // Cache a created default block if no cache exists or the default block
- // name changed.
-
-
- if (!isUnmodifiedDefaultBlock.block || isUnmodifiedDefaultBlock.block.name !== defaultBlockName) {
- isUnmodifiedDefaultBlock.block = createBlock(defaultBlockName);
- }
-
- const newDefaultBlock = isUnmodifiedDefaultBlock.block;
- const blockType = registration_getBlockType(defaultBlockName);
- return Object(external_lodash_["every"])(blockType === null || blockType === void 0 ? void 0 : blockType.attributes, (value, key) => newDefaultBlock.attributes[key] === block.attributes[key]);
-}
-/**
- * Function that checks if the parameter is a valid icon.
- *
- * @param {*} icon Parameter to be checked.
- *
- * @return {boolean} True if the parameter is a valid icon and false otherwise.
- */
-
-function isValidIcon(icon) {
- return !!icon && (Object(external_lodash_["isString"])(icon) || Object(external_wp_element_["isValidElement"])(icon) || Object(external_lodash_["isFunction"])(icon) || icon instanceof external_wp_element_["Component"]);
-}
-/**
- * Function that receives an icon as set by the blocks during the registration
- * and returns a new icon object that is normalized so we can rely on just on possible icon structure
- * in the codebase.
- *
- * @param {WPBlockTypeIconRender} icon Render behavior of a block type icon;
- * one of a Dashicon slug, an element, or a
- * component.
- *
- * @return {WPBlockTypeIconDescriptor} Object describing the icon.
- */
-
-function normalizeIconObject(icon) {
- icon = icon || BLOCK_ICON_DEFAULT;
-
- if (isValidIcon(icon)) {
- return {
- src: icon
- };
- }
-
- if (Object(external_lodash_["has"])(icon, ['background'])) {
- const colordBgColor = Object(colord["a" /* colord */])(icon.background);
- return { ...icon,
- foreground: icon.foreground ? icon.foreground : Object(external_lodash_["maxBy"])(ICON_COLORS, iconColor => colordBgColor.contrast(iconColor)),
- shadowColor: colordBgColor.alpha(0.3).toRgbString()
- };
- }
-
- return icon;
-}
-/**
- * Normalizes block type passed as param. When string is passed then
- * it converts it to the matching block type object.
- * It passes the original object otherwise.
- *
- * @param {string|Object} blockTypeOrName Block type or name.
- *
- * @return {?Object} Block type.
- */
-
-function normalizeBlockType(blockTypeOrName) {
- if (Object(external_lodash_["isString"])(blockTypeOrName)) {
- return registration_getBlockType(blockTypeOrName);
- }
-
- return blockTypeOrName;
-}
-/**
- * Get the label for the block, usually this is either the block title,
- * or the value of the block's `label` function when that's specified.
- *
- * @param {Object} blockType The block type.
- * @param {Object} attributes The values of the block's attributes.
- * @param {Object} context The intended use for the label.
- *
- * @return {string} The block label.
- */
-
-function getBlockLabel(blockType, attributes) {
- let context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'visual';
- const {
- __experimentalLabel: getLabel,
- title
- } = blockType;
- const label = getLabel && getLabel(attributes, {
- context
- });
-
- if (!label) {
- return title;
- } // Strip any HTML (i.e. RichText formatting) before returning.
-
-
- return Object(external_wp_dom_["__unstableStripHTML"])(label);
-}
-/**
- * Get a label for the block for use by screenreaders, this is more descriptive
- * than the visual label and includes the block title and the value of the
- * `getLabel` function if it's specified.
- *
- * @param {Object} blockType The block type.
- * @param {Object} attributes The values of the block's attributes.
- * @param {?number} position The position of the block in the block list.
- * @param {string} [direction='vertical'] The direction of the block layout.
- *
- * @return {string} The block label.
- */
-
-function getAccessibleBlockLabel(blockType, attributes, position) {
- let direction = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'vertical';
- // `title` is already localized, `label` is a user-supplied value.
- const title = blockType === null || blockType === void 0 ? void 0 : blockType.title;
- const label = blockType ? getBlockLabel(blockType, attributes, 'accessibility') : '';
- const hasPosition = position !== undefined; // getBlockLabel returns the block title as a fallback when there's no label,
- // if it did return the title, this function needs to avoid adding the
- // title twice within the accessible label. Use this `hasLabel` boolean to
- // handle that.
-
- const hasLabel = label && label !== title;
-
- if (hasPosition && direction === 'vertical') {
- if (hasLabel) {
- return Object(external_wp_i18n_["sprintf"])(
- /* translators: accessibility text. 1: The block title. 2: The block row number. 3: The block label.. */
- Object(external_wp_i18n_["__"])('%1$s Block. Row %2$d. %3$s'), title, position, label);
- }
-
- return Object(external_wp_i18n_["sprintf"])(
- /* translators: accessibility text. 1: The block title. 2: The block row number. */
- Object(external_wp_i18n_["__"])('%1$s Block. Row %2$d'), title, position);
- } else if (hasPosition && direction === 'horizontal') {
- if (hasLabel) {
- return Object(external_wp_i18n_["sprintf"])(
- /* translators: accessibility text. 1: The block title. 2: The block column number. 3: The block label.. */
- Object(external_wp_i18n_["__"])('%1$s Block. Column %2$d. %3$s'), title, position, label);
- }
-
- return Object(external_wp_i18n_["sprintf"])(
- /* translators: accessibility text. 1: The block title. 2: The block column number. */
- Object(external_wp_i18n_["__"])('%1$s Block. Column %2$d'), title, position);
- }
-
- if (hasLabel) {
- return Object(external_wp_i18n_["sprintf"])(
- /* translators: accessibility text. %1: The block title. %2: The block label. */
- Object(external_wp_i18n_["__"])('%1$s Block. %2$s'), title, label);
- }
-
- return Object(external_wp_i18n_["sprintf"])(
- /* translators: accessibility text. %s: The block title. */
- Object(external_wp_i18n_["__"])('%s Block'), title);
-}
-/**
- * Ensure attributes contains only values defined by block type, and merge
- * default values for missing attributes.
- *
- * @param {string} name The block's name.
- * @param {Object} attributes The block's attributes.
- * @return {Object} The sanitized attributes.
- */
-
-function __experimentalSanitizeBlockAttributes(name, attributes) {
- // Get the type definition associated with a registered block.
- const blockType = registration_getBlockType(name);
-
- if (undefined === blockType) {
- throw new Error(`Block type '${name}' is not registered.`);
- }
-
- return Object(external_lodash_["reduce"])(blockType.attributes, (accumulator, schema, key) => {
- const value = attributes[key];
-
- if (undefined !== value) {
- accumulator[key] = value;
- } else if (schema.hasOwnProperty('default')) {
- accumulator[key] = schema.default;
- }
-
- if (['node', 'children'].indexOf(schema.source) !== -1) {
- // Ensure value passed is always an array, which we're expecting in
- // the RichText component to handle the deprecated value.
- if (typeof accumulator[key] === 'string') {
- accumulator[key] = [accumulator[key]];
- } else if (!Array.isArray(accumulator[key])) {
- accumulator[key] = [];
- }
- }
-
- return accumulator;
- }, {});
-}
-/**
- * Filter block attributes by `role` and return their names.
- *
- * @param {string} name Block attribute's name.
- * @param {string} role The role of a block attribute.
- *
- * @return {string[]} The attribute names that have the provided role.
- */
-
-function __experimentalGetBlockAttributesNamesByRole(name, role) {
- var _getBlockType;
-
- const attributes = (_getBlockType = registration_getBlockType(name)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.attributes;
- if (!attributes) return [];
- const attributesNames = Object.keys(attributes);
- if (!role) return attributesNames;
- return attributesNames.filter(attributeName => {
- var _attributes$attribute;
-
- return ((_attributes$attribute = attributes[attributeName]) === null || _attributes$attribute === void 0 ? void 0 : _attributes$attribute.__experimentalRole) === role;
- });
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/actions.js
-/**
- * External dependencies
- */
-
-/**
- * WordPress dependencies
- */
-
-
-
-/**
- * Internal dependencies
- */
-
-
-
-
-/** @typedef {import('../api/registration').WPBlockVariation} WPBlockVariation */
-
-const {
- error,
- warn
-} = window.console;
-/**
- * Mapping of legacy category slugs to their latest normal values, used to
- * accommodate updates of the default set of block categories.
- *
- * @type {Record<string,string>}
- */
-
-const LEGACY_CATEGORY_MAPPING = {
- common: 'text',
- formatting: 'text',
- layout: 'design'
-};
-/**
- * Takes the unprocessed block type data and applies all the existing filters for the registered block type.
- * Next, it validates all the settings and performs additional processing to the block type definition.
- *
- * @param {WPBlockType} blockType Unprocessed block type settings.
- *
- * @return {?WPBlockType} The block, if it has been successfully registered; otherwise `undefined`.
- */
-
-function processBlockType(blockType) {
- const {
- name
- } = blockType;
- const settings = Object(external_wp_hooks_["applyFilters"])('blocks.registerBlockType', { ...blockType
- }, name);
-
- if (settings.deprecated) {
- settings.deprecated = settings.deprecated.map(deprecation => Object(external_lodash_["pick"])( // Only keep valid deprecation keys.
- Object(external_wp_hooks_["applyFilters"])('blocks.registerBlockType', // Merge deprecation keys with pre-filter settings
- // so that filters that depend on specific keys being
- // present don't fail.
- { // Omit deprecation keys here so that deprecations
- // can opt out of specific keys like "supports".
- ...Object(external_lodash_["omit"])(blockType, DEPRECATED_ENTRY_KEYS),
- ...deprecation
- }, name), DEPRECATED_ENTRY_KEYS));
- }
-
- if (!Object(external_lodash_["isPlainObject"])(settings)) {
- error('Block settings must be a valid object.');
- return;
- }
-
- if (!Object(external_lodash_["isFunction"])(settings.save)) {
- error('The "save" property must be a valid function.');
- return;
- }
-
- if ('edit' in settings && !Object(external_lodash_["isFunction"])(settings.edit)) {
- error('The "edit" property must be a valid function.');
- return;
- } // Canonicalize legacy categories to equivalent fallback.
-
-
- if (LEGACY_CATEGORY_MAPPING.hasOwnProperty(settings.category)) {
- settings.category = LEGACY_CATEGORY_MAPPING[settings.category];
- }
-
- if ('category' in settings && !Object(external_lodash_["some"])(Object(external_wp_data_["select"])(STORE_NAME).getCategories(), {
- slug: settings.category
- })) {
- warn('The block "' + name + '" is registered with an invalid category "' + settings.category + '".');
- delete settings.category;
- }
-
- if (!('title' in settings) || settings.title === '') {
- error('The block "' + name + '" must have a title.');
- return;
- }
-
- if (typeof settings.title !== 'string') {
- error('Block titles must be strings.');
- return;
- }
-
- settings.icon = normalizeIconObject(settings.icon);
-
- if (!isValidIcon(settings.icon.src)) {
- error('The icon passed is invalid. ' + 'The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional');
- return;
- }
-
- return settings;
-}
-/**
- * Returns an action object used in signalling that block types have been added.
- *
- * @param {Array|Object} blockTypes Block types received.
- *
- * @return {Object} Action object.
- */
-
-
-function addBlockTypes(blockTypes) {
- return {
- type: 'ADD_BLOCK_TYPES',
- blockTypes: Object(external_lodash_["castArray"])(blockTypes)
- };
-}
-/**
- * Yields action objects signaling that the passed block type's settings should be stored in the state.
- *
- * @param {WPBlockType} blockType Unprocessed block type settings.
- *
- * @yield {Object} Action object.
- */
-
-function* __experimentalRegisterBlockType(blockType) {
- yield {
- type: 'ADD_UNPROCESSED_BLOCK_TYPE',
- blockType
- };
- const processedBlockType = processBlockType(blockType);
-
- if (!processedBlockType) {
- return;
- }
-
- yield addBlockTypes(processedBlockType);
-}
-/**
- * Yields an action object signaling that all block types should be computed again.
- * It uses stored unprocessed block types and all the most recent list of registered filters.
- *
- * It addresses the issue where third party block filters get registered after third party blocks. A sample sequence:
- * 1. Filter A.
- * 2. Block B.
- * 3. Block C.
- * 4. Filter D.
- * 5. Filter E.
- * 6. Block F.
- * 7. Filter G.
- * In this scenario some filters would not get applied for all blocks because they are registered too late.
- *
- * @yield {Object} Action object.
- */
-
-function* __experimentalReapplyBlockTypeFilters() {
- const unprocessedBlockTypes = Object(external_wp_data_["select"])(STORE_NAME).__experimentalGetUnprocessedBlockTypes();
-
- const processedBlockTypes = Object.keys(unprocessedBlockTypes).reduce((accumulator, blockName) => {
- const result = processBlockType(unprocessedBlockTypes[blockName]);
-
- if (result) {
- accumulator.push(result);
- }
-
- return accumulator;
- }, []);
-
- if (!processedBlockTypes.length) {
- return;
- }
-
- yield addBlockTypes(processedBlockTypes);
-}
-/**
- * Returns an action object used to remove a registered block type.
- *
- * @param {string|Array} names Block name.
- *
- * @return {Object} Action object.
- */
-
-function removeBlockTypes(names) {
- return {
- type: 'REMOVE_BLOCK_TYPES',
- names: Object(external_lodash_["castArray"])(names)
- };
-}
-/**
- * Returns an action object used in signalling that new block styles have been added.
- *
- * @param {string} blockName Block name.
- * @param {Array|Object} styles Block styles.
- *
- * @return {Object} Action object.
- */
-
-function addBlockStyles(blockName, styles) {
- return {
- type: 'ADD_BLOCK_STYLES',
- styles: Object(external_lodash_["castArray"])(styles),
- blockName
- };
-}
-/**
- * Returns an action object used in signalling that block styles have been removed.
- *
- * @param {string} blockName Block name.
- * @param {Array|string} styleNames Block style names.
- *
- * @return {Object} Action object.
- */
-
-function removeBlockStyles(blockName, styleNames) {
- return {
- type: 'REMOVE_BLOCK_STYLES',
- styleNames: Object(external_lodash_["castArray"])(styleNames),
- blockName
- };
-}
-/**
- * Returns an action object used in signalling that new block variations have been added.
- *
- * @param {string} blockName Block name.
- * @param {WPBlockVariation|WPBlockVariation[]} variations Block variations.
- *
- * @return {Object} Action object.
- */
-
-function addBlockVariations(blockName, variations) {
- return {
- type: 'ADD_BLOCK_VARIATIONS',
- variations: Object(external_lodash_["castArray"])(variations),
- blockName
- };
-}
-/**
- * Returns an action object used in signalling that block variations have been removed.
- *
- * @param {string} blockName Block name.
- * @param {string|string[]} variationNames Block variation names.
- *
- * @return {Object} Action object.
- */
-
-function removeBlockVariations(blockName, variationNames) {
- return {
- type: 'REMOVE_BLOCK_VARIATIONS',
- variationNames: Object(external_lodash_["castArray"])(variationNames),
- blockName
- };
-}
-/**
- * Returns an action object used to set the default block name.
- *
- * @param {string} name Block name.
- *
- * @return {Object} Action object.
- */
-
-function actions_setDefaultBlockName(name) {
- return {
- type: 'SET_DEFAULT_BLOCK_NAME',
- name
- };
-}
-/**
- * Returns an action object used to set the name of the block used as a fallback
- * for non-block content.
- *
- * @param {string} name Block name.
- *
- * @return {Object} Action object.
- */
-
-function setFreeformFallbackBlockName(name) {
- return {
- type: 'SET_FREEFORM_FALLBACK_BLOCK_NAME',
- name
- };
-}
-/**
- * Returns an action object used to set the name of the block used as a fallback
- * for unregistered blocks.
- *
- * @param {string} name Block name.
- *
- * @return {Object} Action object.
- */
-
-function setUnregisteredFallbackBlockName(name) {
- return {
- type: 'SET_UNREGISTERED_FALLBACK_BLOCK_NAME',
- name
- };
-}
-/**
- * Returns an action object used to set the name of the block used
- * when grouping other blocks
- * eg: in "Group/Ungroup" interactions
- *
- * @param {string} name Block name.
- *
- * @return {Object} Action object.
- */
-
-function actions_setGroupingBlockName(name) {
- return {
- type: 'SET_GROUPING_BLOCK_NAME',
- name
- };
-}
-/**
- * Returns an action object used to set block categories.
- *
- * @param {Object[]} categories Block categories.
- *
- * @return {Object} Action object.
- */
-
-function setCategories(categories) {
- return {
- type: 'SET_CATEGORIES',
- categories
- };
-}
-/**
- * Returns an action object used to update a category.
- *
- * @param {string} slug Block category slug.
- * @param {Object} category Object containing the category properties that should be updated.
- *
- * @return {Object} Action object.
- */
-
-function updateCategory(slug, category) {
- return {
- type: 'UPDATE_CATEGORY',
- slug,
- category
- };
-}
-/**
- * Returns an action object used to add block collections
- *
- * @param {string} namespace The namespace of the blocks to put in the collection
- * @param {string} title The title to display in the block inserter
- * @param {Object} icon (optional) The icon to display in the block inserter
- *
- * @return {Object} Action object.
- */
-
-function addBlockCollection(namespace, title, icon) {
- return {
- type: 'ADD_BLOCK_COLLECTION',
- namespace,
- title,
- icon
- };
-}
-/**
- * Returns an action object used to remove block collections
- *
- * @param {string} namespace The namespace of the blocks to put in the collection
- *
- * @return {Object} Action object.
- */
-
-function removeBlockCollection(namespace) {
- return {
- type: 'REMOVE_BLOCK_COLLECTION',
- namespace
- };
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/index.js
-/**
- * WordPress dependencies
- */
-
-/**
- * Internal dependencies
- */
-
-
-
-
-
-/**
- * Store definition for the blocks 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);
-
-// EXTERNAL MODULE: external ["wp","blockSerializationDefaultParser"]
-var external_wp_blockSerializationDefaultParser_ = __webpack_require__("ouCq");
-
-// EXTERNAL MODULE: external ["wp","autop"]
-var external_wp_autop_ = __webpack_require__("UuzZ");
-
-// EXTERNAL MODULE: external ["wp","isShallowEqual"]
-var external_wp_isShallowEqual_ = __webpack_require__("rl8x");
-var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_);
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/serializer.js
-
-
-/**
- * External dependencies
- */
-
-/**
- * WordPress dependencies
- */
-
-
-
-
-
-/**
- * Internal dependencies
- */
-
-
-
-/**
- * @typedef {Object} WPBlockSerializationOptions Serialization Options.
- *
- * @property {boolean} isInnerBlocks Whether we are serializing inner blocks.
- */
-
-/**
- * Returns the block's default classname from its name.
- *
- * @param {string} blockName The block name.
- *
- * @return {string} The block's default class.
- */
-
-function getBlockDefaultClassName(blockName) {
- // Generated HTML classes for blocks follow the `wp-block-{name}` nomenclature.
- // Blocks provided by WordPress drop the prefixes 'core/' or 'core-' (historically used in 'core-embed/').
- const className = 'wp-block-' + blockName.replace(/\//, '-').replace(/^core-/, '');
- return Object(external_wp_hooks_["applyFilters"])('blocks.getBlockDefaultClassName', className, blockName);
-}
-/**
- * Returns the block's default menu item classname from its name.
- *
- * @param {string} blockName The block name.
- *
- * @return {string} The block's default menu item class.
- */
-
-function getBlockMenuDefaultClassName(blockName) {
- // Generated HTML classes for blocks follow the `editor-block-list-item-{name}` nomenclature.
- // Blocks provided by WordPress drop the prefixes 'core/' or 'core-' (historically used in 'core-embed/').
- const className = 'editor-block-list-item-' + blockName.replace(/\//, '-').replace(/^core-/, '');
- return Object(external_wp_hooks_["applyFilters"])('blocks.getBlockMenuDefaultClassName', className, blockName);
-}
-const blockPropsProvider = {};
-const innerBlocksPropsProvider = {};
-/**
- * Call within a save function to get the props for the block wrapper.
- *
- * @param {Object} props Optional. Props to pass to the element.
- */
-
-function getBlockProps() {
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- const {
- blockType,
- attributes
- } = blockPropsProvider;
- return Object(external_wp_hooks_["applyFilters"])('blocks.getSaveContent.extraProps', { ...props
- }, blockType, attributes);
-}
-/**
- * Call within a save function to get the props for the inner blocks wrapper.
- *
- * @param {Object} props Optional. Props to pass to the element.
- */
-
-function getInnerBlocksProps() {
- let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- const {
- innerBlocks
- } = innerBlocksPropsProvider; // Value is an array of blocks, so defer to block serializer
-
- const html = serialize(innerBlocks, {
- isInnerBlocks: true
- }); // Use special-cased raw HTML tag to avoid default escaping.
-
- const children = Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, html);
- return { ...props,
- children
- };
-}
-/**
- * Given a block type containing a save render implementation and attributes, returns the
- * enhanced element to be saved or string when raw HTML expected.
- *
- * @param {string|Object} blockTypeOrName Block type or name.
- * @param {Object} attributes Block attributes.
- * @param {?Array} innerBlocks Nested blocks.
- *
- * @return {Object|string} Save element or raw HTML string.
- */
-
-function getSaveElement(blockTypeOrName, attributes) {
- let innerBlocks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
- const blockType = normalizeBlockType(blockTypeOrName);
- let {
- save
- } = blockType; // Component classes are unsupported for save since serialization must
- // occur synchronously. For improved interoperability with higher-order
- // components which often return component class, emulate basic support.
-
- if (save.prototype instanceof external_wp_element_["Component"]) {
- const instance = new save({
- attributes
- });
- save = instance.render.bind(instance);
- }
-
- blockPropsProvider.blockType = blockType;
- blockPropsProvider.attributes = attributes;
- innerBlocksPropsProvider.innerBlocks = innerBlocks;
- let element = save({
- attributes,
- innerBlocks
- });
-
- if (Object(external_lodash_["isObject"])(element) && Object(external_wp_hooks_["hasFilter"])('blocks.getSaveContent.extraProps') && !(blockType.apiVersion > 1)) {
- /**
- * Filters the props applied to the block save result element.
- *
- * @param {Object} props Props applied to save element.
- * @param {WPBlock} blockType Block type definition.
- * @param {Object} attributes Block attributes.
- */
- const props = Object(external_wp_hooks_["applyFilters"])('blocks.getSaveContent.extraProps', { ...element.props
- }, blockType, attributes);
-
- if (!external_wp_isShallowEqual_default()(props, element.props)) {
- element = Object(external_wp_element_["cloneElement"])(element, props);
- }
- }
- /**
- * Filters the save result of a block during serialization.
- *
- * @param {WPElement} element Block save result.
- * @param {WPBlock} blockType Block type definition.
- * @param {Object} attributes Block attributes.
- */
-
-
- return Object(external_wp_hooks_["applyFilters"])('blocks.getSaveElement', element, blockType, attributes);
-}
-/**
- * Given a block type containing a save render implementation and attributes, returns the
- * static markup to be saved.
- *
- * @param {string|Object} blockTypeOrName Block type or name.
- * @param {Object} attributes Block attributes.
- * @param {?Array} innerBlocks Nested blocks.
- *
- * @return {string} Save content.
- */
-
-function getSaveContent(blockTypeOrName, attributes, innerBlocks) {
- const blockType = normalizeBlockType(blockTypeOrName);
- return Object(external_wp_element_["renderToString"])(getSaveElement(blockType, attributes, innerBlocks));
-}
-/**
- * Returns attributes which are to be saved and serialized into the block
- * comment delimiter.
- *
- * When a block exists in memory it contains as its attributes both those
- * parsed the block comment delimiter _and_ those which matched from the
- * contents of the block.
- *
- * This function returns only those attributes which are needed to persist and
- * which cannot be matched from the block content.
- *
- * @param {Object<string,*>} blockType Block type.
- * @param {Object<string,*>} attributes Attributes from in-memory block data.
- *
- * @return {Object<string,*>} Subset of attributes for comment serialization.
- */
-
-function getCommentAttributes(blockType, attributes) {
- return Object(external_lodash_["reduce"])(blockType.attributes, (accumulator, attributeSchema, key) => {
- const value = attributes[key]; // Ignore undefined values.
-
- if (undefined === value) {
- return accumulator;
- } // Ignore all attributes but the ones with an "undefined" source
- // "undefined" source refers to attributes saved in the block comment.
-
-
- if (attributeSchema.source !== undefined) {
- return accumulator;
- } // Ignore default value.
-
-
- if ('default' in attributeSchema && attributeSchema.default === value) {
- return accumulator;
- } // Otherwise, include in comment set.
-
-
- accumulator[key] = value;
- return accumulator;
- }, {});
-}
-/**
- * Given an attributes object, returns a string in the serialized attributes
- * format prepared for post content.
- *
- * @param {Object} attributes Attributes object.
- *
- * @return {string} Serialized attributes.
- */
-
-function serializeAttributes(attributes) {
- return JSON.stringify(attributes) // Don't break HTML comments.
- .replace(/--/g, '\\u002d\\u002d') // Don't break non-standard-compliant tools.
- .replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026') // Bypass server stripslashes behavior which would unescape stringify's
- // escaping of quotation mark.
- //
- // See: https://developer.wordpress.org/reference/functions/wp_kses_stripslashes/
- .replace(/\\"/g, '\\u0022');
-}
-/**
- * Given a block object, returns the Block's Inner HTML markup.
- *
- * @param {Object} block Block instance.
- *
- * @return {string} HTML.
- */
-
-function getBlockInnerHTML(block) {
- // If block was parsed as invalid or encounters an error while generating
- // save content, use original content instead to avoid content loss. If a
- // block contains nested content, exempt it from this condition because we
- // otherwise have no access to its original content and content loss would
- // still occur.
- let saveContent = block.originalContent;
-
- if (block.isValid || block.innerBlocks.length) {
- try {
- saveContent = getSaveContent(block.name, block.attributes, block.innerBlocks);
- } catch (error) {}
- }
-
- return saveContent;
-}
-/**
- * Returns the content of a block, including comment delimiters.
- *
- * @param {string} rawBlockName Block name.
- * @param {Object} attributes Block attributes.
- * @param {string} content Block save content.
- *
- * @return {string} Comment-delimited block content.
- */
-
-function getCommentDelimitedContent(rawBlockName, attributes, content) {
- const serializedAttributes = !Object(external_lodash_["isEmpty"])(attributes) ? serializeAttributes(attributes) + ' ' : ''; // Strip core blocks of their namespace prefix.
-
- const blockName = Object(external_lodash_["startsWith"])(rawBlockName, 'core/') ? rawBlockName.slice(5) : rawBlockName; // @todo make the `wp:` prefix potentially configurable.
-
- if (!content) {
- return `<!-- wp:${blockName} ${serializedAttributes}/-->`;
- }
-
- return `<!-- wp:${blockName} ${serializedAttributes}-->\n` + content + `\n<!-- /wp:${blockName} -->`;
-}
-/**
- * Returns the content of a block, including comment delimiters, determining
- * serialized attributes and content form from the current state of the block.
- *
- * @param {Object} block Block instance.
- * @param {WPBlockSerializationOptions} options Serialization options.
- *
- * @return {string} Serialized block.
- */
-
-function serializeBlock(block) {
- let {
- isInnerBlocks = false
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- const blockName = block.name;
- const saveContent = getBlockInnerHTML(block);
-
- if (blockName === getUnregisteredTypeHandlerName() || !isInnerBlocks && blockName === getFreeformContentHandlerName()) {
- return saveContent;
- }
-
- const blockType = registration_getBlockType(blockName);
- const saveAttributes = getCommentAttributes(blockType, block.attributes);
- return getCommentDelimitedContent(blockName, saveAttributes, saveContent);
-}
-function __unstableSerializeAndClean(blocks) {
- // A single unmodified default block is assumed to
- // be equivalent to an empty post.
- if (blocks.length === 1 && isUnmodifiedDefaultBlock(blocks[0])) {
- blocks = [];
- }
-
- let content = serialize(blocks); // For compatibility, treat a post consisting of a
- // single freeform block as legacy content and apply
- // pre-block-editor removep'd content formatting.
-
- if (blocks.length === 1 && blocks[0].name === getFreeformContentHandlerName()) {
- content = Object(external_wp_autop_["removep"])(content);
- }
-
- return content;
-}
-/**
- * Takes a block or set of blocks and returns the serialized post content.
- *
- * @param {Array} blocks Block(s) to serialize.
- * @param {WPBlockSerializationOptions} options Serialization options.
- *
- * @return {string} The post content.
- */
-
-function serialize(blocks, options) {
- return Object(external_lodash_["castArray"])(blocks).map(block => serializeBlock(block, options)).join('\n\n');
-}
-
-// CONCATENATED MODULE: ./node_modules/simple-html-tokenizer/dist/es6/index.js
-/**
- * generated from https://raw.githubusercontent.com/w3c/html/26b5126f96f736f796b9e29718138919dd513744/entities.json
- * do not edit
- */
-var namedCharRefs = {
- Aacute: "Á", aacute: "á", Abreve: "Ă", abreve: "ă", ac: "∾", acd: "∿", acE: "∾̳", Acirc: "Â", acirc: "â", acute: "´", Acy: "А", acy: "а", AElig: "Æ", aelig: "æ", af: "\u2061", Afr: "𝔄", afr: "𝔞", Agrave: "À", agrave: "à", alefsym: "ℵ", aleph: "ℵ", Alpha: "Α", alpha: "α", Amacr: "Ā", amacr: "ā", amalg: "⨿", amp: "&", AMP: "&", andand: "⩕", And: "⩓", and: "∧", andd: "⩜", andslope: "⩘", andv: "⩚", ang: "∠", ange: "⦤", angle: "∠", angmsdaa: "⦨", angmsdab: "⦩", angmsdac: "⦪", angmsdad: "⦫", angmsdae: "⦬", angmsdaf: "⦭", angmsdag: "⦮", angmsdah: "⦯", angmsd: "∡", angrt: "∟", angrtvb: "⊾", angrtvbd: "⦝", angsph: "∢", angst: "Å", angzarr: "⍼", Aogon: "Ą", aogon: "ą", Aopf: "𝔸", aopf: "𝕒", apacir: "⩯", ap: "≈", apE: "⩰", ape: "≊", apid: "≋", apos: "'", ApplyFunction: "\u2061", approx: "≈", approxeq: "≊", Aring: "Å", aring: "å", Ascr: "𝒜", ascr: "𝒶", Assign: "≔", ast: "*", asymp: "≈", asympeq: "≍", Atilde: "Ã", atilde: "ã", Auml: "Ä", auml: "ä", awconint: "∳", awint: "⨑", backcong: "≌", backepsilon: "϶", backprime: "‵", backsim: "∽", backsimeq: "⋍", Backslash: "∖", Barv: "⫧", barvee: "⊽", barwed: "⌅", Barwed: "⌆", barwedge: "⌅", bbrk: "⎵", bbrktbrk: "⎶", bcong: "≌", Bcy: "Б", bcy: "б", bdquo: "„", becaus: "∵", because: "∵", Because: "∵", bemptyv: "⦰", bepsi: "϶", bernou: "ℬ", Bernoullis: "ℬ", Beta: "Β", beta: "β", beth: "ℶ", between: "≬", Bfr: "𝔅", bfr: "𝔟", bigcap: "⋂", bigcirc: "◯", bigcup: "⋃", bigodot: "⨀", bigoplus: "⨁", bigotimes: "⨂", bigsqcup: "⨆", bigstar: "★", bigtriangledown: "▽", bigtriangleup: "△", biguplus: "⨄", bigvee: "⋁", bigwedge: "⋀", bkarow: "⤍", blacklozenge: "⧫", blacksquare: "▪", blacktriangle: "▴", blacktriangledown: "▾", blacktriangleleft: "◂", blacktriangleright: "▸", blank: "␣", blk12: "▒", blk14: "░", blk34: "▓", block: "█", bne: "=⃥", bnequiv: "≡⃥", bNot: "⫭", bnot: "⌐", Bopf: "𝔹", bopf: "𝕓", bot: "⊥", bottom: "⊥", bowtie: "⋈", boxbox: "⧉", boxdl: "┐", boxdL: "╕", boxDl: "╖", boxDL: "╗", boxdr: "┌", boxdR: "╒", boxDr: "╓", boxDR: "╔", boxh: "─", boxH: "═", boxhd: "┬", boxHd: "╤", boxhD: "╥", boxHD: "╦", boxhu: "┴", boxHu: "╧", boxhU: "╨", boxHU: "╩", boxminus: "⊟", boxplus: "⊞", boxtimes: "⊠", boxul: "┘", boxuL: "╛", boxUl: "╜", boxUL: "╝", boxur: "└", boxuR: "╘", boxUr: "╙", boxUR: "╚", boxv: "│", boxV: "║", boxvh: "┼", boxvH: "╪", boxVh: "╫", boxVH: "╬", boxvl: "┤", boxvL: "╡", boxVl: "╢", boxVL: "╣", boxvr: "├", boxvR: "╞", boxVr: "╟", boxVR: "╠", bprime: "‵", breve: "˘", Breve: "˘", brvbar: "¦", bscr: "𝒷", Bscr: "ℬ", bsemi: "⁏", bsim: "∽", bsime: "⋍", bsolb: "⧅", bsol: "\\", bsolhsub: "⟈", bull: "•", bullet: "•", bump: "≎", bumpE: "⪮", bumpe: "≏", Bumpeq: "≎", bumpeq: "≏", Cacute: "Ć", cacute: "ć", capand: "⩄", capbrcup: "⩉", capcap: "⩋", cap: "∩", Cap: "⋒", capcup: "⩇", capdot: "⩀", CapitalDifferentialD: "ⅅ", caps: "∩︀", caret: "⁁", caron: "ˇ", Cayleys: "ℭ", ccaps: "⩍", Ccaron: "Č", ccaron: "č", Ccedil: "Ç", ccedil: "ç", Ccirc: "Ĉ", ccirc: "ĉ", Cconint: "∰", ccups: "⩌", ccupssm: "⩐", Cdot: "Ċ", cdot: "ċ", cedil: "¸", Cedilla: "¸", cemptyv: "⦲", cent: "¢", centerdot: "·", CenterDot: "·", cfr: "𝔠", Cfr: "ℭ", CHcy: "Ч", chcy: "ч", check: "✓", checkmark: "✓", Chi: "Χ", chi: "χ", circ: "ˆ", circeq: "≗", circlearrowleft: "↺", circlearrowright: "↻", circledast: "⊛", circledcirc: "⊚", circleddash: "⊝", CircleDot: "⊙", circledR: "®", circledS: "Ⓢ", CircleMinus: "⊖", CirclePlus: "⊕", CircleTimes: "⊗", cir: "○", cirE: "⧃", cire: "≗", cirfnint: "⨐", cirmid: "⫯", cirscir: "⧂", ClockwiseContourIntegral: "∲", CloseCurlyDoubleQuote: "”", CloseCurlyQuote: "’", clubs: "♣", clubsuit: "♣", colon: ":", Colon: "∷", Colone: "⩴", colone: "≔", coloneq: "≔", comma: ",", commat: "@", comp: "∁", compfn: "∘", complement: "∁", complexes: "ℂ", cong: "≅", congdot: "⩭", Congruent: "≡", conint: "∮", Conint: "∯", ContourIntegral: "∮", copf: "𝕔", Copf: "ℂ", coprod: "∐", Coproduct: "∐", copy: "©", COPY: "©", copysr: "℗", CounterClockwiseContourIntegral: "∳", crarr: "↵", cross: "✗", Cross: "⨯", Cscr: "𝒞", cscr: "𝒸", csub: "⫏", csube: "⫑", csup: "⫐", csupe: "⫒", ctdot: "⋯", cudarrl: "⤸", cudarrr: "⤵", cuepr: "⋞", cuesc: "⋟", cularr: "↶", cularrp: "⤽", cupbrcap: "⩈", cupcap: "⩆", CupCap: "≍", cup: "∪", Cup: "⋓", cupcup: "⩊", cupdot: "⊍", cupor: "⩅", cups: "∪︀", curarr: "↷", curarrm: "⤼", curlyeqprec: "⋞", curlyeqsucc: "⋟", curlyvee: "⋎", curlywedge: "⋏", curren: "¤", curvearrowleft: "↶", curvearrowright: "↷", cuvee: "⋎", cuwed: "⋏", cwconint: "∲", cwint: "∱", cylcty: "⌭", dagger: "†", Dagger: "‡", daleth: "ℸ", darr: "↓", Darr: "↡", dArr: "⇓", dash: "‐", Dashv: "⫤", dashv: "⊣", dbkarow: "⤏", dblac: "˝", Dcaron: "Ď", dcaron: "ď", Dcy: "Д", dcy: "д", ddagger: "‡", ddarr: "⇊", DD: "ⅅ", dd: "ⅆ", DDotrahd: "⤑", ddotseq: "⩷", deg: "°", Del: "∇", Delta: "Δ", delta: "δ", demptyv: "⦱", dfisht: "⥿", Dfr: "𝔇", dfr: "𝔡", dHar: "⥥", dharl: "⇃", dharr: "⇂", DiacriticalAcute: "´", DiacriticalDot: "˙", DiacriticalDoubleAcute: "˝", DiacriticalGrave: "`", DiacriticalTilde: "˜", diam: "⋄", diamond: "⋄", Diamond: "⋄", diamondsuit: "♦", diams: "♦", die: "¨", DifferentialD: "ⅆ", digamma: "ϝ", disin: "⋲", div: "÷", divide: "÷", divideontimes: "⋇", divonx: "⋇", DJcy: "Ђ", djcy: "ђ", dlcorn: "⌞", dlcrop: "⌍", dollar: "$", Dopf: "𝔻", dopf: "𝕕", Dot: "¨", dot: "˙", DotDot: "⃜", doteq: "≐", doteqdot: "≑", DotEqual: "≐", dotminus: "∸", dotplus: "∔", dotsquare: "⊡", doublebarwedge: "⌆", DoubleContourIntegral: "∯", DoubleDot: "¨", DoubleDownArrow: "⇓", DoubleLeftArrow: "⇐", DoubleLeftRightArrow: "⇔", DoubleLeftTee: "⫤", DoubleLongLeftArrow: "⟸", DoubleLongLeftRightArrow: "⟺", DoubleLongRightArrow: "⟹", DoubleRightArrow: "⇒", DoubleRightTee: "⊨", DoubleUpArrow: "⇑", DoubleUpDownArrow: "⇕", DoubleVerticalBar: "∥", DownArrowBar: "⤓", downarrow: "↓", DownArrow: "↓", Downarrow: "⇓", DownArrowUpArrow: "⇵", DownBreve: "̑", downdownarrows: "⇊", downharpoonleft: "⇃", downharpoonright: "⇂", DownLeftRightVector: "⥐", DownLeftTeeVector: "⥞", DownLeftVectorBar: "⥖", DownLeftVector: "↽", DownRightTeeVector: "⥟", DownRightVectorBar: "⥗", DownRightVector: "⇁", DownTeeArrow: "↧", DownTee: "⊤", drbkarow: "⤐", drcorn: "⌟", drcrop: "⌌", Dscr: "𝒟", dscr: "𝒹", DScy: "Ѕ", dscy: "ѕ", dsol: "⧶", Dstrok: "Đ", dstrok: "đ", dtdot: "⋱", dtri: "▿", dtrif: "▾", duarr: "⇵", duhar: "⥯", dwangle: "⦦", DZcy: "Џ", dzcy: "џ", dzigrarr: "⟿", Eacute: "É", eacute: "é", easter: "⩮", Ecaron: "Ě", ecaron: "ě", Ecirc: "Ê", ecirc: "ê", ecir: "≖", ecolon: "≕", Ecy: "Э", ecy: "э", eDDot: "⩷", Edot: "Ė", edot: "ė", eDot: "≑", ee: "ⅇ", efDot: "≒", Efr: "𝔈", efr: "𝔢", eg: "⪚", Egrave: "È", egrave: "è", egs: "⪖", egsdot: "⪘", el: "⪙", Element: "∈", elinters: "⏧", ell: "ℓ", els: "⪕", elsdot: "⪗", Emacr: "Ē", emacr: "ē", empty: "∅", emptyset: "∅", EmptySmallSquare: "◻", emptyv: "∅", EmptyVerySmallSquare: "▫", emsp13: " ", emsp14: " ", emsp: " ", ENG: "Ŋ", eng: "ŋ", ensp: " ", Eogon: "Ę", eogon: "ę", Eopf: "𝔼", eopf: "𝕖", epar: "⋕", eparsl: "⧣", eplus: "⩱", epsi: "ε", Epsilon: "Ε", epsilon: "ε", epsiv: "ϵ", eqcirc: "≖", eqcolon: "≕", eqsim: "≂", eqslantgtr: "⪖", eqslantless: "⪕", Equal: "⩵", equals: "=", EqualTilde: "≂", equest: "≟", Equilibrium: "⇌", equiv: "≡", equivDD: "⩸", eqvparsl: "⧥", erarr: "⥱", erDot: "≓", escr: "ℯ", Escr: "ℰ", esdot: "≐", Esim: "⩳", esim: "≂", Eta: "Η", eta: "η", ETH: "Ð", eth: "ð", Euml: "Ë", euml: "ë", euro: "€", excl: "!", exist: "∃", Exists: "∃", expectation: "ℰ", exponentiale: "ⅇ", ExponentialE: "ⅇ", fallingdotseq: "≒", Fcy: "Ф", fcy: "ф", female: "♀", ffilig: "ffi", fflig: "ff", ffllig: "ffl", Ffr: "𝔉", ffr: "𝔣", filig: "fi", FilledSmallSquare: "◼", FilledVerySmallSquare: "▪", fjlig: "fj", flat: "♭", fllig: "fl", fltns: "▱", fnof: "ƒ", Fopf: "𝔽", fopf: "𝕗", forall: "∀", ForAll: "∀", fork: "⋔", forkv: "⫙", Fouriertrf: "ℱ", fpartint: "⨍", frac12: "½", frac13: "⅓", frac14: "¼", frac15: "⅕", frac16: "⅙", frac18: "⅛", frac23: "⅔", frac25: "⅖", frac34: "¾", frac35: "⅗", frac38: "⅜", frac45: "⅘", frac56: "⅚", frac58: "⅝", frac78: "⅞", frasl: "⁄", frown: "⌢", fscr: "𝒻", Fscr: "ℱ", gacute: "ǵ", Gamma: "Γ", gamma: "γ", Gammad: "Ϝ", gammad: "ϝ", gap: "⪆", Gbreve: "Ğ", gbreve: "ğ", Gcedil: "Ģ", Gcirc: "Ĝ", gcirc: "ĝ", Gcy: "Г", gcy: "г", Gdot: "Ġ", gdot: "ġ", ge: "≥", gE: "≧", gEl: "⪌", gel: "⋛", geq: "≥", geqq: "≧", geqslant: "⩾", gescc: "⪩", ges: "⩾", gesdot: "⪀", gesdoto: "⪂", gesdotol: "⪄", gesl: "⋛︀", gesles: "⪔", Gfr: "𝔊", gfr: "𝔤", gg: "≫", Gg: "⋙", ggg: "⋙", gimel: "ℷ", GJcy: "Ѓ", gjcy: "ѓ", gla: "⪥", gl: "≷", glE: "⪒", glj: "⪤", gnap: "⪊", gnapprox: "⪊", gne: "⪈", gnE: "≩", gneq: "⪈", gneqq: "≩", gnsim: "⋧", Gopf: "𝔾", gopf: "𝕘", grave: "`", GreaterEqual: "≥", GreaterEqualLess: "⋛", GreaterFullEqual: "≧", GreaterGreater: "⪢", GreaterLess: "≷", GreaterSlantEqual: "⩾", GreaterTilde: "≳", Gscr: "𝒢", gscr: "ℊ", gsim: "≳", gsime: "⪎", gsiml: "⪐", gtcc: "⪧", gtcir: "⩺", gt: ">", GT: ">", Gt: "≫", gtdot: "⋗", gtlPar: "⦕", gtquest: "⩼", gtrapprox: "⪆", gtrarr: "⥸", gtrdot: "⋗", gtreqless: "⋛", gtreqqless: "⪌", gtrless: "≷", gtrsim: "≳", gvertneqq: "≩︀", gvnE: "≩︀", Hacek: "ˇ", hairsp: " ", half: "½", hamilt: "ℋ", HARDcy: "Ъ", hardcy: "ъ", harrcir: "⥈", harr: "↔", hArr: "⇔", harrw: "↭", Hat: "^", hbar: "ℏ", Hcirc: "Ĥ", hcirc: "ĥ", hearts: "♥", heartsuit: "♥", hellip: "…", hercon: "⊹", hfr: "𝔥", Hfr: "ℌ", HilbertSpace: "ℋ", hksearow: "⤥", hkswarow: "⤦", hoarr: "⇿", homtht: "∻", hookleftarrow: "↩", hookrightarrow: "↪", hopf: "𝕙", Hopf: "ℍ", horbar: "―", HorizontalLine: "─", hscr: "𝒽", Hscr: "ℋ", hslash: "ℏ", Hstrok: "Ħ", hstrok: "ħ", HumpDownHump: "≎", HumpEqual: "≏", hybull: "⁃", hyphen: "‐", Iacute: "Í", iacute: "í", ic: "\u2063", Icirc: "Î", icirc: "î", Icy: "И", icy: "и", Idot: "İ", IEcy: "Е", iecy: "е", iexcl: "¡", iff: "⇔", ifr: "𝔦", Ifr: "ℑ", Igrave: "Ì", igrave: "ì", ii: "ⅈ", iiiint: "⨌", iiint: "∭", iinfin: "⧜", iiota: "℩", IJlig: "IJ", ijlig: "ij", Imacr: "Ī", imacr: "ī", image: "ℑ", ImaginaryI: "ⅈ", imagline: "ℐ", imagpart: "ℑ", imath: "ı", Im: "ℑ", imof: "⊷", imped: "Ƶ", Implies: "⇒", incare: "℅", in: "∈", infin: "∞", infintie: "⧝", inodot: "ı", intcal: "⊺", int: "∫", Int: "∬", integers: "ℤ", Integral: "∫", intercal: "⊺", Intersection: "⋂", intlarhk: "⨗", intprod: "⨼", InvisibleComma: "\u2063", InvisibleTimes: "\u2062", IOcy: "Ё", iocy: "ё", Iogon: "Į", iogon: "į", Iopf: "𝕀", iopf: "𝕚", Iota: "Ι", iota: "ι", iprod: "⨼", iquest: "¿", iscr: "𝒾", Iscr: "ℐ", isin: "∈", isindot: "⋵", isinE: "⋹", isins: "⋴", isinsv: "⋳", isinv: "∈", it: "\u2062", Itilde: "Ĩ", itilde: "ĩ", Iukcy: "І", iukcy: "і", Iuml: "Ï", iuml: "ï", Jcirc: "Ĵ", jcirc: "ĵ", Jcy: "Й", jcy: "й", Jfr: "𝔍", jfr: "𝔧", jmath: "ȷ", Jopf: "𝕁", jopf: "𝕛", Jscr: "𝒥", jscr: "𝒿", Jsercy: "Ј", jsercy: "ј", Jukcy: "Є", jukcy: "є", Kappa: "Κ", kappa: "κ", kappav: "ϰ", Kcedil: "Ķ", kcedil: "ķ", Kcy: "К", kcy: "к", Kfr: "𝔎", kfr: "𝔨", kgreen: "ĸ", KHcy: "Х", khcy: "х", KJcy: "Ќ", kjcy: "ќ", Kopf: "𝕂", kopf: "𝕜", Kscr: "𝒦", kscr: "𝓀", lAarr: "⇚", Lacute: "Ĺ", lacute: "ĺ", laemptyv: "⦴", lagran: "ℒ", Lambda: "Λ", lambda: "λ", lang: "⟨", Lang: "⟪", langd: "⦑", langle: "⟨", lap: "⪅", Laplacetrf: "ℒ", laquo: "«", larrb: "⇤", larrbfs: "⤟", larr: "←", Larr: "↞", lArr: "⇐", larrfs: "⤝", larrhk: "↩", larrlp: "↫", larrpl: "⤹", larrsim: "⥳", larrtl: "↢", latail: "⤙", lAtail: "⤛", lat: "⪫", late: "⪭", lates: "⪭︀", lbarr: "⤌", lBarr: "⤎", lbbrk: "❲", lbrace: "{", lbrack: "[", lbrke: "⦋", lbrksld: "⦏", lbrkslu: "⦍", Lcaron: "Ľ", lcaron: "ľ", Lcedil: "Ļ", lcedil: "ļ", lceil: "⌈", lcub: "{", Lcy: "Л", lcy: "л", ldca: "⤶", ldquo: "“", ldquor: "„", ldrdhar: "⥧", ldrushar: "⥋", ldsh: "↲", le: "≤", lE: "≦", LeftAngleBracket: "⟨", LeftArrowBar: "⇤", leftarrow: "←", LeftArrow: "←", Leftarrow: "⇐", LeftArrowRightArrow: "⇆", leftarrowtail: "↢", LeftCeiling: "⌈", LeftDoubleBracket: "⟦", LeftDownTeeVector: "⥡", LeftDownVectorBar: "⥙", LeftDownVector: "⇃", LeftFloor: "⌊", leftharpoondown: "↽", leftharpoonup: "↼", leftleftarrows: "⇇", leftrightarrow: "↔", LeftRightArrow: "↔", Leftrightarrow: "⇔", leftrightarrows: "⇆", leftrightharpoons: "⇋", leftrightsquigarrow: "↭", LeftRightVector: "⥎", LeftTeeArrow: "↤", LeftTee: "⊣", LeftTeeVector: "⥚", leftthreetimes: "⋋", LeftTriangleBar: "⧏", LeftTriangle: "⊲", LeftTriangleEqual: "⊴", LeftUpDownVector: "⥑", LeftUpTeeVector: "⥠", LeftUpVectorBar: "⥘", LeftUpVector: "↿", LeftVectorBar: "⥒", LeftVector: "↼", lEg: "⪋", leg: "⋚", leq: "≤", leqq: "≦", leqslant: "⩽", lescc: "⪨", les: "⩽", lesdot: "⩿", lesdoto: "⪁", lesdotor: "⪃", lesg: "⋚︀", lesges: "⪓", lessapprox: "⪅", lessdot: "⋖", lesseqgtr: "⋚", lesseqqgtr: "⪋", LessEqualGreater: "⋚", LessFullEqual: "≦", LessGreater: "≶", lessgtr: "≶", LessLess: "⪡", lesssim: "≲", LessSlantEqual: "⩽", LessTilde: "≲", lfisht: "⥼", lfloor: "⌊", Lfr: "𝔏", lfr: "𝔩", lg: "≶", lgE: "⪑", lHar: "⥢", lhard: "↽", lharu: "↼", lharul: "⥪", lhblk: "▄", LJcy: "Љ", ljcy: "љ", llarr: "⇇", ll: "≪", Ll: "⋘", llcorner: "⌞", Lleftarrow: "⇚", llhard: "⥫", lltri: "◺", Lmidot: "Ŀ", lmidot: "ŀ", lmoustache: "⎰", lmoust: "⎰", lnap: "⪉", lnapprox: "⪉", lne: "⪇", lnE: "≨", lneq: "⪇", lneqq: "≨", lnsim: "⋦", loang: "⟬", loarr: "⇽", lobrk: "⟦", longleftarrow: "⟵", LongLeftArrow: "⟵", Longleftarrow: "⟸", longleftrightarrow: "⟷", LongLeftRightArrow: "⟷", Longleftrightarrow: "⟺", longmapsto: "⟼", longrightarrow: "⟶", LongRightArrow: "⟶", Longrightarrow: "⟹", looparrowleft: "↫", looparrowright: "↬", lopar: "⦅", Lopf: "𝕃", lopf: "𝕝", loplus: "⨭", lotimes: "⨴", lowast: "∗", lowbar: "_", LowerLeftArrow: "↙", LowerRightArrow: "↘", loz: "◊", lozenge: "◊", lozf: "⧫", lpar: "(", lparlt: "⦓", lrarr: "⇆", lrcorner: "⌟", lrhar: "⇋", lrhard: "⥭", lrm: "\u200e", lrtri: "⊿", lsaquo: "‹", lscr: "𝓁", Lscr: "ℒ", lsh: "↰", Lsh: "↰", lsim: "≲", lsime: "⪍", lsimg: "⪏", lsqb: "[", lsquo: "‘", lsquor: "‚", Lstrok: "Ł", lstrok: "ł", ltcc: "⪦", ltcir: "⩹", lt: "<", LT: "<", Lt: "≪", ltdot: "⋖", lthree: "⋋", ltimes: "⋉", ltlarr: "⥶", ltquest: "⩻", ltri: "◃", ltrie: "⊴", ltrif: "◂", ltrPar: "⦖", lurdshar: "⥊", luruhar: "⥦", lvertneqq: "≨︀", lvnE: "≨︀", macr: "¯", male: "♂", malt: "✠", maltese: "✠", Map: "⤅", map: "↦", mapsto: "↦", mapstodown: "↧", mapstoleft: "↤", mapstoup: "↥", marker: "▮", mcomma: "⨩", Mcy: "М", mcy: "м", mdash: "—", mDDot: "∺", measuredangle: "∡", MediumSpace: " ", Mellintrf: "ℳ", Mfr: "𝔐", mfr: "𝔪", mho: "℧", micro: "µ", midast: "*", midcir: "⫰", mid: "∣", middot: "·", minusb: "⊟", minus: "−", minusd: "∸", minusdu: "⨪", MinusPlus: "∓", mlcp: "⫛", mldr: "…", mnplus: "∓", models: "⊧", Mopf: "𝕄", mopf: "𝕞", mp: "∓", mscr: "𝓂", Mscr: "ℳ", mstpos: "∾", Mu: "Μ", mu: "μ", multimap: "⊸", mumap: "⊸", nabla: "∇", Nacute: "Ń", nacute: "ń", nang: "∠⃒", nap: "≉", napE: "⩰̸", napid: "≋̸", napos: "ʼn", napprox: "≉", natural: "♮", naturals: "ℕ", natur: "♮", nbsp: " ", nbump: "≎̸", nbumpe: "≏̸", ncap: "⩃", Ncaron: "Ň", ncaron: "ň", Ncedil: "Ņ", ncedil: "ņ", ncong: "≇", ncongdot: "⩭̸", ncup: "⩂", Ncy: "Н", ncy: "н", ndash: "–", nearhk: "⤤", nearr: "↗", neArr: "⇗", nearrow: "↗", ne: "≠", nedot: "≐̸", NegativeMediumSpace: "", NegativeThickSpace: "", NegativeThinSpace: "", NegativeVeryThinSpace: "", nequiv: "≢", nesear: "⤨", nesim: "≂̸", NestedGreaterGreater: "≫", NestedLessLess: "≪", NewLine: "\u000a", nexist: "∄", nexists: "∄", Nfr: "𝔑", nfr: "𝔫", ngE: "≧̸", nge: "≱", ngeq: "≱", ngeqq: "≧̸", ngeqslant: "⩾̸", nges: "⩾̸", nGg: "⋙̸", ngsim: "≵", nGt: "≫⃒", ngt: "≯", ngtr: "≯", nGtv: "≫̸", nharr: "↮", nhArr: "⇎", nhpar: "⫲", ni: "∋", nis: "⋼", nisd: "⋺", niv: "∋", NJcy: "Њ", njcy: "њ", nlarr: "↚", nlArr: "⇍", nldr: "‥", nlE: "≦̸", nle: "≰", nleftarrow: "↚", nLeftarrow: "⇍", nleftrightarrow: "↮", nLeftrightarrow: "⇎", nleq: "≰", nleqq: "≦̸", nleqslant: "⩽̸", nles: "⩽̸", nless: "≮", nLl: "⋘̸", nlsim: "≴", nLt: "≪⃒", nlt: "≮", nltri: "⋪", nltrie: "⋬", nLtv: "≪̸", nmid: "∤", NoBreak: "\u2060", NonBreakingSpace: " ", nopf: "𝕟", Nopf: "ℕ", Not: "⫬", not: "¬", NotCongruent: "≢", NotCupCap: "≭", NotDoubleVerticalBar: "∦", NotElement: "∉", NotEqual: "≠", NotEqualTilde: "≂̸", NotExists: "∄", NotGreater: "≯", NotGreaterEqual: "≱", NotGreaterFullEqual: "≧̸", NotGreaterGreater: "≫̸", NotGreaterLess: "≹", NotGreaterSlantEqual: "⩾̸", NotGreaterTilde: "≵", NotHumpDownHump: "≎̸", NotHumpEqual: "≏̸", notin: "∉", notindot: "⋵̸", notinE: "⋹̸", notinva: "∉", notinvb: "⋷", notinvc: "⋶", NotLeftTriangleBar: "⧏̸", NotLeftTriangle: "⋪", NotLeftTriangleEqual: "⋬", NotLess: "≮", NotLessEqual: "≰", NotLessGreater: "≸", NotLessLess: "≪̸", NotLessSlantEqual: "⩽̸", NotLessTilde: "≴", NotNestedGreaterGreater: "⪢̸", NotNestedLessLess: "⪡̸", notni: "∌", notniva: "∌", notnivb: "⋾", notnivc: "⋽", NotPrecedes: "⊀", NotPrecedesEqual: "⪯̸", NotPrecedesSlantEqual: "⋠", NotReverseElement: "∌", NotRightTriangleBar: "⧐̸", NotRightTriangle: "⋫", NotRightTriangleEqual: "⋭", NotSquareSubset: "⊏̸", NotSquareSubsetEqual: "⋢", NotSquareSuperset: "⊐̸", NotSquareSupersetEqual: "⋣", NotSubset: "⊂⃒", NotSubsetEqual: "⊈", NotSucceeds: "⊁", NotSucceedsEqual: "⪰̸", NotSucceedsSlantEqual: "⋡", NotSucceedsTilde: "≿̸", NotSuperset: "⊃⃒", NotSupersetEqual: "⊉", NotTilde: "≁", NotTildeEqual: "≄", NotTildeFullEqual: "≇", NotTildeTilde: "≉", NotVerticalBar: "∤", nparallel: "∦", npar: "∦", nparsl: "⫽⃥", npart: "∂̸", npolint: "⨔", npr: "⊀", nprcue: "⋠", nprec: "⊀", npreceq: "⪯̸", npre: "⪯̸", nrarrc: "⤳̸", nrarr: "↛", nrArr: "⇏", nrarrw: "↝̸", nrightarrow: "↛", nRightarrow: "⇏", nrtri: "⋫", nrtrie: "⋭", nsc: "⊁", nsccue: "⋡", nsce: "⪰̸", Nscr: "𝒩", nscr: "𝓃", nshortmid: "∤", nshortparallel: "∦", nsim: "≁", nsime: "≄", nsimeq: "≄", nsmid: "∤", nspar: "∦", nsqsube: "⋢", nsqsupe: "⋣", nsub: "⊄", nsubE: "⫅̸", nsube: "⊈", nsubset: "⊂⃒", nsubseteq: "⊈", nsubseteqq: "⫅̸", nsucc: "⊁", nsucceq: "⪰̸", nsup: "⊅", nsupE: "⫆̸", nsupe: "⊉", nsupset: "⊃⃒", nsupseteq: "⊉", nsupseteqq: "⫆̸", ntgl: "≹", Ntilde: "Ñ", ntilde: "ñ", ntlg: "≸", ntriangleleft: "⋪", ntrianglelefteq: "⋬", ntriangleright: "⋫", ntrianglerighteq: "⋭", Nu: "Ν", nu: "ν", num: "#", numero: "№", numsp: " ", nvap: "≍⃒", nvdash: "⊬", nvDash: "⊭", nVdash: "⊮", nVDash: "⊯", nvge: "≥⃒", nvgt: ">⃒", nvHarr: "⤄", nvinfin: "⧞", nvlArr: "⤂", nvle: "≤⃒", nvlt: "<⃒", nvltrie: "⊴⃒", nvrArr: "⤃", nvrtrie: "⊵⃒", nvsim: "∼⃒", nwarhk: "⤣", nwarr: "↖", nwArr: "⇖", nwarrow: "↖", nwnear: "⤧", Oacute: "Ó", oacute: "ó", oast: "⊛", Ocirc: "Ô", ocirc: "ô", ocir: "⊚", Ocy: "О", ocy: "о", odash: "⊝", Odblac: "Ő", odblac: "ő", odiv: "⨸", odot: "⊙", odsold: "⦼", OElig: "Œ", oelig: "œ", ofcir: "⦿", Ofr: "𝔒", ofr: "𝔬", ogon: "˛", Ograve: "Ò", ograve: "ò", ogt: "⧁", ohbar: "⦵", ohm: "Ω", oint: "∮", olarr: "↺", olcir: "⦾", olcross: "⦻", oline: "‾", olt: "⧀", Omacr: "Ō", omacr: "ō", Omega: "Ω", omega: "ω", Omicron: "Ο", omicron: "ο", omid: "⦶", ominus: "⊖", Oopf: "𝕆", oopf: "𝕠", opar: "⦷", OpenCurlyDoubleQuote: "“", OpenCurlyQuote: "‘", operp: "⦹", oplus: "⊕", orarr: "↻", Or: "⩔", or: "∨", ord: "⩝", order: "ℴ", orderof: "ℴ", ordf: "ª", ordm: "º", origof: "⊶", oror: "⩖", orslope: "⩗", orv: "⩛", oS: "Ⓢ", Oscr: "𝒪", oscr: "ℴ", Oslash: "Ø", oslash: "ø", osol: "⊘", Otilde: "Õ", otilde: "õ", otimesas: "⨶", Otimes: "⨷", otimes: "⊗", Ouml: "Ö", ouml: "ö", ovbar: "⌽", OverBar: "‾", OverBrace: "⏞", OverBracket: "⎴", OverParenthesis: "⏜", para: "¶", parallel: "∥", par: "∥", parsim: "⫳", parsl: "⫽", part: "∂", PartialD: "∂", Pcy: "П", pcy: "п", percnt: "%", period: ".", permil: "‰", perp: "⊥", pertenk: "‱", Pfr: "𝔓", pfr: "𝔭", Phi: "Φ", phi: "φ", phiv: "ϕ", phmmat: "ℳ", phone: "☎", Pi: "Π", pi: "π", pitchfork: "⋔", piv: "ϖ", planck: "ℏ", planckh: "ℎ", plankv: "ℏ", plusacir: "⨣", plusb: "⊞", pluscir: "⨢", plus: "+", plusdo: "∔", plusdu: "⨥", pluse: "⩲", PlusMinus: "±", plusmn: "±", plussim: "⨦", plustwo: "⨧", pm: "±", Poincareplane: "ℌ", pointint: "⨕", popf: "𝕡", Popf: "ℙ", pound: "£", prap: "⪷", Pr: "⪻", pr: "≺", prcue: "≼", precapprox: "⪷", prec: "≺", preccurlyeq: "≼", Precedes: "≺", PrecedesEqual: "⪯", PrecedesSlantEqual: "≼", PrecedesTilde: "≾", preceq: "⪯", precnapprox: "⪹", precneqq: "⪵", precnsim: "⋨", pre: "⪯", prE: "⪳", precsim: "≾", prime: "′", Prime: "″", primes: "ℙ", prnap: "⪹", prnE: "⪵", prnsim: "⋨", prod: "∏", Product: "∏", profalar: "⌮", profline: "⌒", profsurf: "⌓", prop: "∝", Proportional: "∝", Proportion: "∷", propto: "∝", prsim: "≾", prurel: "⊰", Pscr: "𝒫", pscr: "𝓅", Psi: "Ψ", psi: "ψ", puncsp: " ", Qfr: "𝔔", qfr: "𝔮", qint: "⨌", qopf: "𝕢", Qopf: "ℚ", qprime: "⁗", Qscr: "𝒬", qscr: "𝓆", quaternions: "ℍ", quatint: "⨖", quest: "?", questeq: "≟", quot: "\"", QUOT: "\"", rAarr: "⇛", race: "∽̱", Racute: "Ŕ", racute: "ŕ", radic: "√", raemptyv: "⦳", rang: "⟩", Rang: "⟫", rangd: "⦒", range: "⦥", rangle: "⟩", raquo: "»", rarrap: "⥵", rarrb: "⇥", rarrbfs: "⤠", rarrc: "⤳", rarr: "→", Rarr: "↠", rArr: "⇒", rarrfs: "⤞", rarrhk: "↪", rarrlp: "↬", rarrpl: "⥅", rarrsim: "⥴", Rarrtl: "⤖", rarrtl: "↣", rarrw: "↝", ratail: "⤚", rAtail: "⤜", ratio: "∶", rationals: "ℚ", rbarr: "⤍", rBarr: "⤏", RBarr: "⤐", rbbrk: "❳", rbrace: "}", rbrack: "]", rbrke: "⦌", rbrksld: "⦎", rbrkslu: "⦐", Rcaron: "Ř", rcaron: "ř", Rcedil: "Ŗ", rcedil: "ŗ", rceil: "⌉", rcub: "}", Rcy: "Р", rcy: "р", rdca: "⤷", rdldhar: "⥩", rdquo: "”", rdquor: "”", rdsh: "↳", real: "ℜ", realine: "ℛ", realpart: "ℜ", reals: "ℝ", Re: "ℜ", rect: "▭", reg: "®", REG: "®", ReverseElement: "∋", ReverseEquilibrium: "⇋", ReverseUpEquilibrium: "⥯", rfisht: "⥽", rfloor: "⌋", rfr: "𝔯", Rfr: "ℜ", rHar: "⥤", rhard: "⇁", rharu: "⇀", rharul: "⥬", Rho: "Ρ", rho: "ρ", rhov: "ϱ", RightAngleBracket: "⟩", RightArrowBar: "⇥", rightarrow: "→", RightArrow: "→", Rightarrow: "⇒", RightArrowLeftArrow: "⇄", rightarrowtail: "↣", RightCeiling: "⌉", RightDoubleBracket: "⟧", RightDownTeeVector: "⥝", RightDownVectorBar: "⥕", RightDownVector: "⇂", RightFloor: "⌋", rightharpoondown: "⇁", rightharpoonup: "⇀", rightleftarrows: "⇄", rightleftharpoons: "⇌", rightrightarrows: "⇉", rightsquigarrow: "↝", RightTeeArrow: "↦", RightTee: "⊢", RightTeeVector: "⥛", rightthreetimes: "⋌", RightTriangleBar: "⧐", RightTriangle: "⊳", RightTriangleEqual: "⊵", RightUpDownVector: "⥏", RightUpTeeVector: "⥜", RightUpVectorBar: "⥔", RightUpVector: "↾", RightVectorBar: "⥓", RightVector: "⇀", ring: "˚", risingdotseq: "≓", rlarr: "⇄", rlhar: "⇌", rlm: "\u200f", rmoustache: "⎱", rmoust: "⎱", rnmid: "⫮", roang: "⟭", roarr: "⇾", robrk: "⟧", ropar: "⦆", ropf: "𝕣", Ropf: "ℝ", roplus: "⨮", rotimes: "⨵", RoundImplies: "⥰", rpar: ")", rpargt: "⦔", rppolint: "⨒", rrarr: "⇉", Rrightarrow: "⇛", rsaquo: "›", rscr: "𝓇", Rscr: "ℛ", rsh: "↱", Rsh: "↱", rsqb: "]", rsquo: "’", rsquor: "’", rthree: "⋌", rtimes: "⋊", rtri: "▹", rtrie: "⊵", rtrif: "▸", rtriltri: "⧎", RuleDelayed: "⧴", ruluhar: "⥨", rx: "℞", Sacute: "Ś", sacute: "ś", sbquo: "‚", scap: "⪸", Scaron: "Š", scaron: "š", Sc: "⪼", sc: "≻", sccue: "≽", sce: "⪰", scE: "⪴", Scedil: "Ş", scedil: "ş", Scirc: "Ŝ", scirc: "ŝ", scnap: "⪺", scnE: "⪶", scnsim: "⋩", scpolint: "⨓", scsim: "≿", Scy: "С", scy: "с", sdotb: "⊡", sdot: "⋅", sdote: "⩦", searhk: "⤥", searr: "↘", seArr: "⇘", searrow: "↘", sect: "§", semi: ";", seswar: "⤩", setminus: "∖", setmn: "∖", sext: "✶", Sfr: "𝔖", sfr: "𝔰", sfrown: "⌢", sharp: "♯", SHCHcy: "Щ", shchcy: "щ", SHcy: "Ш", shcy: "ш", ShortDownArrow: "↓", ShortLeftArrow: "←", shortmid: "∣", shortparallel: "∥", ShortRightArrow: "→", ShortUpArrow: "↑", shy: "\u00ad", Sigma: "Σ", sigma: "σ", sigmaf: "ς", sigmav: "ς", sim: "∼", simdot: "⩪", sime: "≃", simeq: "≃", simg: "⪞", simgE: "⪠", siml: "⪝", simlE: "⪟", simne: "≆", simplus: "⨤", simrarr: "⥲", slarr: "←", SmallCircle: "∘", smallsetminus: "∖", smashp: "⨳", smeparsl: "⧤", smid: "∣", smile: "⌣", smt: "⪪", smte: "⪬", smtes: "⪬︀", SOFTcy: "Ь", softcy: "ь", solbar: "⌿", solb: "⧄", sol: "/", Sopf: "𝕊", sopf: "𝕤", spades: "♠", spadesuit: "♠", spar: "∥", sqcap: "⊓", sqcaps: "⊓︀", sqcup: "⊔", sqcups: "⊔︀", Sqrt: "√", sqsub: "⊏", sqsube: "⊑", sqsubset: "⊏", sqsubseteq: "⊑", sqsup: "⊐", sqsupe: "⊒", sqsupset: "⊐", sqsupseteq: "⊒", square: "□", Square: "□", SquareIntersection: "⊓", SquareSubset: "⊏", SquareSubsetEqual: "⊑", SquareSuperset: "⊐", SquareSupersetEqual: "⊒", SquareUnion: "⊔", squarf: "▪", squ: "□", squf: "▪", srarr: "→", Sscr: "𝒮", sscr: "𝓈", ssetmn: "∖", ssmile: "⌣", sstarf: "⋆", Star: "⋆", star: "☆", starf: "★", straightepsilon: "ϵ", straightphi: "ϕ", strns: "¯", sub: "⊂", Sub: "⋐", subdot: "⪽", subE: "⫅", sube: "⊆", subedot: "⫃", submult: "⫁", subnE: "⫋", subne: "⊊", subplus: "⪿", subrarr: "⥹", subset: "⊂", Subset: "⋐", subseteq: "⊆", subseteqq: "⫅", SubsetEqual: "⊆", subsetneq: "⊊", subsetneqq: "⫋", subsim: "⫇", subsub: "⫕", subsup: "⫓", succapprox: "⪸", succ: "≻", succcurlyeq: "≽", Succeeds: "≻", SucceedsEqual: "⪰", SucceedsSlantEqual: "≽", SucceedsTilde: "≿", succeq: "⪰", succnapprox: "⪺", succneqq: "⪶", succnsim: "⋩", succsim: "≿", SuchThat: "∋", sum: "∑", Sum: "∑", sung: "♪", sup1: "¹", sup2: "²", sup3: "³", sup: "⊃", Sup: "⋑", supdot: "⪾", supdsub: "⫘", supE: "⫆", supe: "⊇", supedot: "⫄", Superset: "⊃", SupersetEqual: "⊇", suphsol: "⟉", suphsub: "⫗", suplarr: "⥻", supmult: "⫂", supnE: "⫌", supne: "⊋", supplus: "⫀", supset: "⊃", Supset: "⋑", supseteq: "⊇", supseteqq: "⫆", supsetneq: "⊋", supsetneqq: "⫌", supsim: "⫈", supsub: "⫔", supsup: "⫖", swarhk: "⤦", swarr: "↙", swArr: "⇙", swarrow: "↙", swnwar: "⤪", szlig: "ß", Tab: "\u0009", target: "⌖", Tau: "Τ", tau: "τ", tbrk: "⎴", Tcaron: "Ť", tcaron: "ť", Tcedil: "Ţ", tcedil: "ţ", Tcy: "Т", tcy: "т", tdot: "⃛", telrec: "⌕", Tfr: "𝔗", tfr: "𝔱", there4: "∴", therefore: "∴", Therefore: "∴", Theta: "Θ", theta: "θ", thetasym: "ϑ", thetav: "ϑ", thickapprox: "≈", thicksim: "∼", ThickSpace: " ", ThinSpace: " ", thinsp: " ", thkap: "≈", thksim: "∼", THORN: "Þ", thorn: "þ", tilde: "˜", Tilde: "∼", TildeEqual: "≃", TildeFullEqual: "≅", TildeTilde: "≈", timesbar: "⨱", timesb: "⊠", times: "×", timesd: "⨰", tint: "∭", toea: "⤨", topbot: "⌶", topcir: "⫱", top: "⊤", Topf: "𝕋", topf: "𝕥", topfork: "⫚", tosa: "⤩", tprime: "‴", trade: "™", TRADE: "™", triangle: "▵", triangledown: "▿", triangleleft: "◃", trianglelefteq: "⊴", triangleq: "≜", triangleright: "▹", trianglerighteq: "⊵", tridot: "◬", trie: "≜", triminus: "⨺", TripleDot: "⃛", triplus: "⨹", trisb: "⧍", tritime: "⨻", trpezium: "⏢", Tscr: "𝒯", tscr: "𝓉", TScy: "Ц", tscy: "ц", TSHcy: "Ћ", tshcy: "ћ", Tstrok: "Ŧ", tstrok: "ŧ", twixt: "≬", twoheadleftarrow: "↞", twoheadrightarrow: "↠", Uacute: "Ú", uacute: "ú", uarr: "↑", Uarr: "↟", uArr: "⇑", Uarrocir: "⥉", Ubrcy: "Ў", ubrcy: "ў", Ubreve: "Ŭ", ubreve: "ŭ", Ucirc: "Û", ucirc: "û", Ucy: "У", ucy: "у", udarr: "⇅", Udblac: "Ű", udblac: "ű", udhar: "⥮", ufisht: "⥾", Ufr: "𝔘", ufr: "𝔲", Ugrave: "Ù", ugrave: "ù", uHar: "⥣", uharl: "↿", uharr: "↾", uhblk: "▀", ulcorn: "⌜", ulcorner: "⌜", ulcrop: "⌏", ultri: "◸", Umacr: "Ū", umacr: "ū", uml: "¨", UnderBar: "_", UnderBrace: "⏟", UnderBracket: "⎵", UnderParenthesis: "⏝", Union: "⋃", UnionPlus: "⊎", Uogon: "Ų", uogon: "ų", Uopf: "𝕌", uopf: "𝕦", UpArrowBar: "⤒", uparrow: "↑", UpArrow: "↑", Uparrow: "⇑", UpArrowDownArrow: "⇅", updownarrow: "↕", UpDownArrow: "↕", Updownarrow: "⇕", UpEquilibrium: "⥮", upharpoonleft: "↿", upharpoonright: "↾", uplus: "⊎", UpperLeftArrow: "↖", UpperRightArrow: "↗", upsi: "υ", Upsi: "ϒ", upsih: "ϒ", Upsilon: "Υ", upsilon: "υ", UpTeeArrow: "↥", UpTee: "⊥", upuparrows: "⇈", urcorn: "⌝", urcorner: "⌝", urcrop: "⌎", Uring: "Ů", uring: "ů", urtri: "◹", Uscr: "𝒰", uscr: "𝓊", utdot: "⋰", Utilde: "Ũ", utilde: "ũ", utri: "▵", utrif: "▴", uuarr: "⇈", Uuml: "Ü", uuml: "ü", uwangle: "⦧", vangrt: "⦜", varepsilon: "ϵ", varkappa: "ϰ", varnothing: "∅", varphi: "ϕ", varpi: "ϖ", varpropto: "∝", varr: "↕", vArr: "⇕", varrho: "ϱ", varsigma: "ς", varsubsetneq: "⊊︀", varsubsetneqq: "⫋︀", varsupsetneq: "⊋︀", varsupsetneqq: "⫌︀", vartheta: "ϑ", vartriangleleft: "⊲", vartriangleright: "⊳", vBar: "⫨", Vbar: "⫫", vBarv: "⫩", Vcy: "В", vcy: "в", vdash: "⊢", vDash: "⊨", Vdash: "⊩", VDash: "⊫", Vdashl: "⫦", veebar: "⊻", vee: "∨", Vee: "⋁", veeeq: "≚", vellip: "⋮", verbar: "|", Verbar: "‖", vert: "|", Vert: "‖", VerticalBar: "∣", VerticalLine: "|", VerticalSeparator: "❘", VerticalTilde: "≀", VeryThinSpace: " ", Vfr: "𝔙", vfr: "𝔳", vltri: "⊲", vnsub: "⊂⃒", vnsup: "⊃⃒", Vopf: "𝕍", vopf: "𝕧", vprop: "∝", vrtri: "⊳", Vscr: "𝒱", vscr: "𝓋", vsubnE: "⫋︀", vsubne: "⊊︀", vsupnE: "⫌︀", vsupne: "⊋︀", Vvdash: "⊪", vzigzag: "⦚", Wcirc: "Ŵ", wcirc: "ŵ", wedbar: "⩟", wedge: "∧", Wedge: "⋀", wedgeq: "≙", weierp: "℘", Wfr: "𝔚", wfr: "𝔴", Wopf: "𝕎", wopf: "𝕨", wp: "℘", wr: "≀", wreath: "≀", Wscr: "𝒲", wscr: "𝓌", xcap: "⋂", xcirc: "◯", xcup: "⋃", xdtri: "▽", Xfr: "𝔛", xfr: "𝔵", xharr: "⟷", xhArr: "⟺", Xi: "Ξ", xi: "ξ", xlarr: "⟵", xlArr: "⟸", xmap: "⟼", xnis: "⋻", xodot: "⨀", Xopf: "𝕏", xopf: "𝕩", xoplus: "⨁", xotime: "⨂", xrarr: "⟶", xrArr: "⟹", Xscr: "𝒳", xscr: "𝓍", xsqcup: "⨆", xuplus: "⨄", xutri: "△", xvee: "⋁", xwedge: "⋀", Yacute: "Ý", yacute: "ý", YAcy: "Я", yacy: "я", Ycirc: "Ŷ", ycirc: "ŷ", Ycy: "Ы", ycy: "ы", yen: "¥", Yfr: "𝔜", yfr: "𝔶", YIcy: "Ї", yicy: "ї", Yopf: "𝕐", yopf: "𝕪", Yscr: "𝒴", yscr: "𝓎", YUcy: "Ю", yucy: "ю", yuml: "ÿ", Yuml: "Ÿ", Zacute: "Ź", zacute: "ź", Zcaron: "Ž", zcaron: "ž", Zcy: "З", zcy: "з", Zdot: "Ż", zdot: "ż", zeetrf: "ℨ", ZeroWidthSpace: "", Zeta: "Ζ", zeta: "ζ", zfr: "𝔷", Zfr: "ℨ", ZHcy: "Ж", zhcy: "ж", zigrarr: "⇝", zopf: "𝕫", Zopf: "ℤ", Zscr: "𝒵", zscr: "𝓏", zwj: "\u200d", zwnj: "\u200c"
-};
-
-var HEXCHARCODE = /^#[xX]([A-Fa-f0-9]+)$/;
-var CHARCODE = /^#([0-9]+)$/;
-var NAMED = /^([A-Za-z0-9]+)$/;
-var EntityParser = /** @class */ (function () {
- function EntityParser(named) {
- this.named = named;
- }
- EntityParser.prototype.parse = function (entity) {
- if (!entity) {
- return;
- }
- var matches = entity.match(HEXCHARCODE);
- if (matches) {
- return String.fromCharCode(parseInt(matches[1], 16));
- }
- matches = entity.match(CHARCODE);
- if (matches) {
- return String.fromCharCode(parseInt(matches[1], 10));
- }
- matches = entity.match(NAMED);
- if (matches) {
- return this.named[matches[1]];
- }
- };
- return EntityParser;
-}());
-
-var WSP = /[\t\n\f ]/;
-var ALPHA = /[A-Za-z]/;
-var CRLF = /\r\n?/g;
-function isSpace(char) {
- return WSP.test(char);
-}
-function isAlpha(char) {
- return ALPHA.test(char);
-}
-function preprocessInput(input) {
- return input.replace(CRLF, '\n');
-}
-
-var EventedTokenizer = /** @class */ (function () {
- function EventedTokenizer(delegate, entityParser, mode) {
- if (mode === void 0) { mode = 'precompile'; }
- this.delegate = delegate;
- this.entityParser = entityParser;
- this.mode = mode;
- this.state = "beforeData" /* beforeData */;
- this.line = -1;
- this.column = -1;
- this.input = '';
- this.index = -1;
- this.tagNameBuffer = '';
- this.states = {
- beforeData: function () {
- var char = this.peek();
- if (char === '<' && !this.isIgnoredEndTag()) {
- this.transitionTo("tagOpen" /* tagOpen */);
- this.markTagStart();
- this.consume();
- }
- else {
- if (this.mode === 'precompile' && char === '\n') {
- var tag = this.tagNameBuffer.toLowerCase();
- if (tag === 'pre' || tag === 'textarea') {
- this.consume();
- }
- }
- this.transitionTo("data" /* data */);
- this.delegate.beginData();
- }
- },
- data: function () {
- var char = this.peek();
- var tag = this.tagNameBuffer;
- if (char === '<' && !this.isIgnoredEndTag()) {
- this.delegate.finishData();
- this.transitionTo("tagOpen" /* tagOpen */);
- this.markTagStart();
- this.consume();
- }
- else if (char === '&' && tag !== 'script' && tag !== 'style') {
- this.consume();
- this.delegate.appendToData(this.consumeCharRef() || '&');
- }
- else {
- this.consume();
- this.delegate.appendToData(char);
- }
- },
- tagOpen: function () {
- var char = this.consume();
- if (char === '!') {
- this.transitionTo("markupDeclarationOpen" /* markupDeclarationOpen */);
- }
- else if (char === '/') {
- this.transitionTo("endTagOpen" /* endTagOpen */);
- }
- else if (char === '@' || char === ':' || isAlpha(char)) {
- this.transitionTo("tagName" /* tagName */);
- this.tagNameBuffer = '';
- this.delegate.beginStartTag();
- this.appendToTagName(char);
- }
- },
- markupDeclarationOpen: function () {
- var char = this.consume();
- if (char === '-' && this.peek() === '-') {
- this.consume();
- this.transitionTo("commentStart" /* commentStart */);
- this.delegate.beginComment();
- }
- else {
- var maybeDoctype = char.toUpperCase() + this.input.substring(this.index, this.index + 6).toUpperCase();
- if (maybeDoctype === 'DOCTYPE') {
- this.consume();
- this.consume();
- this.consume();
- this.consume();
- this.consume();
- this.consume();
- this.transitionTo("doctype" /* doctype */);
- if (this.delegate.beginDoctype)
- this.delegate.beginDoctype();
- }
- }
- },
- doctype: function () {
- var char = this.consume();
- if (isSpace(char)) {
- this.transitionTo("beforeDoctypeName" /* beforeDoctypeName */);
- }
- },
- beforeDoctypeName: function () {
- var char = this.consume();
- if (isSpace(char)) {
- return;
- }
- else {
- this.transitionTo("doctypeName" /* doctypeName */);
- if (this.delegate.appendToDoctypeName)
- this.delegate.appendToDoctypeName(char.toLowerCase());
- }
- },
- doctypeName: function () {
- var char = this.consume();
- if (isSpace(char)) {
- this.transitionTo("afterDoctypeName" /* afterDoctypeName */);
- }
- else if (char === '>') {
- if (this.delegate.endDoctype)
- this.delegate.endDoctype();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else {
- if (this.delegate.appendToDoctypeName)
- this.delegate.appendToDoctypeName(char.toLowerCase());
- }
- },
- afterDoctypeName: function () {
- var char = this.consume();
- if (isSpace(char)) {
- return;
- }
- else if (char === '>') {
- if (this.delegate.endDoctype)
- this.delegate.endDoctype();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else {
- var nextSixChars = char.toUpperCase() + this.input.substring(this.index, this.index + 5).toUpperCase();
- var isPublic = nextSixChars.toUpperCase() === 'PUBLIC';
- var isSystem = nextSixChars.toUpperCase() === 'SYSTEM';
- if (isPublic || isSystem) {
- this.consume();
- this.consume();
- this.consume();
- this.consume();
- this.consume();
- this.consume();
- }
- if (isPublic) {
- this.transitionTo("afterDoctypePublicKeyword" /* afterDoctypePublicKeyword */);
- }
- else if (isSystem) {
- this.transitionTo("afterDoctypeSystemKeyword" /* afterDoctypeSystemKeyword */);
- }
- }
- },
- afterDoctypePublicKeyword: function () {
- var char = this.peek();
- if (isSpace(char)) {
- this.transitionTo("beforeDoctypePublicIdentifier" /* beforeDoctypePublicIdentifier */);
- this.consume();
- }
- else if (char === '"') {
- this.transitionTo("doctypePublicIdentifierDoubleQuoted" /* doctypePublicIdentifierDoubleQuoted */);
- this.consume();
- }
- else if (char === "'") {
- this.transitionTo("doctypePublicIdentifierSingleQuoted" /* doctypePublicIdentifierSingleQuoted */);
- this.consume();
- }
- else if (char === '>') {
- this.consume();
- if (this.delegate.endDoctype)
- this.delegate.endDoctype();
- this.transitionTo("beforeData" /* beforeData */);
- }
- },
- doctypePublicIdentifierDoubleQuoted: function () {
- var char = this.consume();
- if (char === '"') {
- this.transitionTo("afterDoctypePublicIdentifier" /* afterDoctypePublicIdentifier */);
- }
- else if (char === '>') {
- if (this.delegate.endDoctype)
- this.delegate.endDoctype();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else {
- if (this.delegate.appendToDoctypePublicIdentifier)
- this.delegate.appendToDoctypePublicIdentifier(char);
- }
- },
- doctypePublicIdentifierSingleQuoted: function () {
- var char = this.consume();
- if (char === "'") {
- this.transitionTo("afterDoctypePublicIdentifier" /* afterDoctypePublicIdentifier */);
- }
- else if (char === '>') {
- if (this.delegate.endDoctype)
- this.delegate.endDoctype();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else {
- if (this.delegate.appendToDoctypePublicIdentifier)
- this.delegate.appendToDoctypePublicIdentifier(char);
- }
- },
- afterDoctypePublicIdentifier: function () {
- var char = this.consume();
- if (isSpace(char)) {
- this.transitionTo("betweenDoctypePublicAndSystemIdentifiers" /* betweenDoctypePublicAndSystemIdentifiers */);
- }
- else if (char === '>') {
- if (this.delegate.endDoctype)
- this.delegate.endDoctype();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else if (char === '"') {
- this.transitionTo("doctypeSystemIdentifierDoubleQuoted" /* doctypeSystemIdentifierDoubleQuoted */);
- }
- else if (char === "'") {
- this.transitionTo("doctypeSystemIdentifierSingleQuoted" /* doctypeSystemIdentifierSingleQuoted */);
- }
- },
- betweenDoctypePublicAndSystemIdentifiers: function () {
- var char = this.consume();
- if (isSpace(char)) {
- return;
- }
- else if (char === '>') {
- if (this.delegate.endDoctype)
- this.delegate.endDoctype();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else if (char === '"') {
- this.transitionTo("doctypeSystemIdentifierDoubleQuoted" /* doctypeSystemIdentifierDoubleQuoted */);
- }
- else if (char === "'") {
- this.transitionTo("doctypeSystemIdentifierSingleQuoted" /* doctypeSystemIdentifierSingleQuoted */);
- }
- },
- doctypeSystemIdentifierDoubleQuoted: function () {
- var char = this.consume();
- if (char === '"') {
- this.transitionTo("afterDoctypeSystemIdentifier" /* afterDoctypeSystemIdentifier */);
- }
- else if (char === '>') {
- if (this.delegate.endDoctype)
- this.delegate.endDoctype();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else {
- if (this.delegate.appendToDoctypeSystemIdentifier)
- this.delegate.appendToDoctypeSystemIdentifier(char);
- }
- },
- doctypeSystemIdentifierSingleQuoted: function () {
- var char = this.consume();
- if (char === "'") {
- this.transitionTo("afterDoctypeSystemIdentifier" /* afterDoctypeSystemIdentifier */);
- }
- else if (char === '>') {
- if (this.delegate.endDoctype)
- this.delegate.endDoctype();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else {
- if (this.delegate.appendToDoctypeSystemIdentifier)
- this.delegate.appendToDoctypeSystemIdentifier(char);
- }
- },
- afterDoctypeSystemIdentifier: function () {
- var char = this.consume();
- if (isSpace(char)) {
- return;
- }
- else if (char === '>') {
- if (this.delegate.endDoctype)
- this.delegate.endDoctype();
- this.transitionTo("beforeData" /* beforeData */);
- }
- },
- commentStart: function () {
- var char = this.consume();
- if (char === '-') {
- this.transitionTo("commentStartDash" /* commentStartDash */);
- }
- else if (char === '>') {
- this.delegate.finishComment();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else {
- this.delegate.appendToCommentData(char);
- this.transitionTo("comment" /* comment */);
- }
- },
- commentStartDash: function () {
- var char = this.consume();
- if (char === '-') {
- this.transitionTo("commentEnd" /* commentEnd */);
- }
- else if (char === '>') {
- this.delegate.finishComment();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else {
- this.delegate.appendToCommentData('-');
- this.transitionTo("comment" /* comment */);
- }
- },
- comment: function () {
- var char = this.consume();
- if (char === '-') {
- this.transitionTo("commentEndDash" /* commentEndDash */);
- }
- else {
- this.delegate.appendToCommentData(char);
- }
- },
- commentEndDash: function () {
- var char = this.consume();
- if (char === '-') {
- this.transitionTo("commentEnd" /* commentEnd */);
- }
- else {
- this.delegate.appendToCommentData('-' + char);
- this.transitionTo("comment" /* comment */);
- }
- },
- commentEnd: function () {
- var char = this.consume();
- if (char === '>') {
- this.delegate.finishComment();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else {
- this.delegate.appendToCommentData('--' + char);
- this.transitionTo("comment" /* comment */);
- }
- },
- tagName: function () {
- var char = this.consume();
- if (isSpace(char)) {
- this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
- }
- else if (char === '/') {
- this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
- }
- else if (char === '>') {
- this.delegate.finishTag();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else {
- this.appendToTagName(char);
- }
- },
- endTagName: function () {
- var char = this.consume();
- if (isSpace(char)) {
- this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
- this.tagNameBuffer = '';
- }
- else if (char === '/') {
- this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
- this.tagNameBuffer = '';
- }
- else if (char === '>') {
- this.delegate.finishTag();
- this.transitionTo("beforeData" /* beforeData */);
- this.tagNameBuffer = '';
- }
- else {
- this.appendToTagName(char);
- }
- },
- beforeAttributeName: function () {
- var char = this.peek();
- if (isSpace(char)) {
- this.consume();
- return;
- }
- else if (char === '/') {
- this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
- this.consume();
- }
- else if (char === '>') {
- this.consume();
- this.delegate.finishTag();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else if (char === '=') {
- this.delegate.reportSyntaxError('attribute name cannot start with equals sign');
- this.transitionTo("attributeName" /* attributeName */);
- this.delegate.beginAttribute();
- this.consume();
- this.delegate.appendToAttributeName(char);
- }
- else {
- this.transitionTo("attributeName" /* attributeName */);
- this.delegate.beginAttribute();
- }
- },
- attributeName: function () {
- var char = this.peek();
- if (isSpace(char)) {
- this.transitionTo("afterAttributeName" /* afterAttributeName */);
- this.consume();
- }
- else if (char === '/') {
- this.delegate.beginAttributeValue(false);
- this.delegate.finishAttributeValue();
- this.consume();
- this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
- }
- else if (char === '=') {
- this.transitionTo("beforeAttributeValue" /* beforeAttributeValue */);
- this.consume();
- }
- else if (char === '>') {
- this.delegate.beginAttributeValue(false);
- this.delegate.finishAttributeValue();
- this.consume();
- this.delegate.finishTag();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else if (char === '"' || char === "'" || char === '<') {
- this.delegate.reportSyntaxError(char + ' is not a valid character within attribute names');
- this.consume();
- this.delegate.appendToAttributeName(char);
- }
- else {
- this.consume();
- this.delegate.appendToAttributeName(char);
- }
- },
- afterAttributeName: function () {
- var char = this.peek();
- if (isSpace(char)) {
- this.consume();
- return;
- }
- else if (char === '/') {
- this.delegate.beginAttributeValue(false);
- this.delegate.finishAttributeValue();
- this.consume();
- this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
- }
- else if (char === '=') {
- this.consume();
- this.transitionTo("beforeAttributeValue" /* beforeAttributeValue */);
- }
- else if (char === '>') {
- this.delegate.beginAttributeValue(false);
- this.delegate.finishAttributeValue();
- this.consume();
- this.delegate.finishTag();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else {
- this.delegate.beginAttributeValue(false);
- this.delegate.finishAttributeValue();
- this.transitionTo("attributeName" /* attributeName */);
- this.delegate.beginAttribute();
- this.consume();
- this.delegate.appendToAttributeName(char);
- }
- },
- beforeAttributeValue: function () {
- var char = this.peek();
- if (isSpace(char)) {
- this.consume();
- }
- else if (char === '"') {
- this.transitionTo("attributeValueDoubleQuoted" /* attributeValueDoubleQuoted */);
- this.delegate.beginAttributeValue(true);
- this.consume();
- }
- else if (char === "'") {
- this.transitionTo("attributeValueSingleQuoted" /* attributeValueSingleQuoted */);
- this.delegate.beginAttributeValue(true);
- this.consume();
- }
- else if (char === '>') {
- this.delegate.beginAttributeValue(false);
- this.delegate.finishAttributeValue();
- this.consume();
- this.delegate.finishTag();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else {
- this.transitionTo("attributeValueUnquoted" /* attributeValueUnquoted */);
- this.delegate.beginAttributeValue(false);
- this.consume();
- this.delegate.appendToAttributeValue(char);
- }
- },
- attributeValueDoubleQuoted: function () {
- var char = this.consume();
- if (char === '"') {
- this.delegate.finishAttributeValue();
- this.transitionTo("afterAttributeValueQuoted" /* afterAttributeValueQuoted */);
- }
- else if (char === '&') {
- this.delegate.appendToAttributeValue(this.consumeCharRef() || '&');
- }
- else {
- this.delegate.appendToAttributeValue(char);
- }
- },
- attributeValueSingleQuoted: function () {
- var char = this.consume();
- if (char === "'") {
- this.delegate.finishAttributeValue();
- this.transitionTo("afterAttributeValueQuoted" /* afterAttributeValueQuoted */);
- }
- else if (char === '&') {
- this.delegate.appendToAttributeValue(this.consumeCharRef() || '&');
- }
- else {
- this.delegate.appendToAttributeValue(char);
- }
- },
- attributeValueUnquoted: function () {
- var char = this.peek();
- if (isSpace(char)) {
- this.delegate.finishAttributeValue();
- this.consume();
- this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
- }
- else if (char === '/') {
- this.delegate.finishAttributeValue();
- this.consume();
- this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
- }
- else if (char === '&') {
- this.consume();
- this.delegate.appendToAttributeValue(this.consumeCharRef() || '&');
- }
- else if (char === '>') {
- this.delegate.finishAttributeValue();
- this.consume();
- this.delegate.finishTag();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else {
- this.consume();
- this.delegate.appendToAttributeValue(char);
- }
- },
- afterAttributeValueQuoted: function () {
- var char = this.peek();
- if (isSpace(char)) {
- this.consume();
- this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
- }
- else if (char === '/') {
- this.consume();
- this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
- }
- else if (char === '>') {
- this.consume();
- this.delegate.finishTag();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else {
- this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
- }
- },
- selfClosingStartTag: function () {
- var char = this.peek();
- if (char === '>') {
- this.consume();
- this.delegate.markTagAsSelfClosing();
- this.delegate.finishTag();
- this.transitionTo("beforeData" /* beforeData */);
- }
- else {
- this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
- }
- },
- endTagOpen: function () {
- var char = this.consume();
- if (char === '@' || char === ':' || isAlpha(char)) {
- this.transitionTo("endTagName" /* endTagName */);
- this.tagNameBuffer = '';
- this.delegate.beginEndTag();
- this.appendToTagName(char);
- }
- }
- };
- this.reset();
- }
- EventedTokenizer.prototype.reset = function () {
- this.transitionTo("beforeData" /* beforeData */);
- this.input = '';
- this.tagNameBuffer = '';
- this.index = 0;
- this.line = 1;
- this.column = 0;
- this.delegate.reset();
- };
- EventedTokenizer.prototype.transitionTo = function (state) {
- this.state = state;
- };
- EventedTokenizer.prototype.tokenize = function (input) {
- this.reset();
- this.tokenizePart(input);
- this.tokenizeEOF();
- };
- EventedTokenizer.prototype.tokenizePart = function (input) {
- this.input += preprocessInput(input);
- while (this.index < this.input.length) {
- var handler = this.states[this.state];
- if (handler !== undefined) {
- handler.call(this);
- }
- else {
- throw new Error("unhandled state " + this.state);
- }
- }
- };
- EventedTokenizer.prototype.tokenizeEOF = function () {
- this.flushData();
- };
- EventedTokenizer.prototype.flushData = function () {
- if (this.state === 'data') {
- this.delegate.finishData();
- this.transitionTo("beforeData" /* beforeData */);
- }
- };
- EventedTokenizer.prototype.peek = function () {
- return this.input.charAt(this.index);
- };
- EventedTokenizer.prototype.consume = function () {
- var char = this.peek();
- this.index++;
- if (char === '\n') {
- this.line++;
- this.column = 0;
- }
- else {
- this.column++;
- }
- return char;
- };
- EventedTokenizer.prototype.consumeCharRef = function () {
- var endIndex = this.input.indexOf(';', this.index);
- if (endIndex === -1) {
- return;
- }
- var entity = this.input.slice(this.index, endIndex);
- var chars = this.entityParser.parse(entity);
- if (chars) {
- var count = entity.length;
- // consume the entity chars
- while (count) {
- this.consume();
- count--;
- }
- // consume the `;`
- this.consume();
- return chars;
- }
- };
- EventedTokenizer.prototype.markTagStart = function () {
- this.delegate.tagOpen();
- };
- EventedTokenizer.prototype.appendToTagName = function (char) {
- this.tagNameBuffer += char;
- this.delegate.appendToTagName(char);
- };
- EventedTokenizer.prototype.isIgnoredEndTag = function () {
- var tag = this.tagNameBuffer;
- return (tag === 'title' && this.input.substring(this.index, this.index + 8) !== '</title>') ||
- (tag === 'style' && this.input.substring(this.index, this.index + 8) !== '</style>') ||
- (tag === 'script' && this.input.substring(this.index, this.index + 9) !== '</script>');
- };
- return EventedTokenizer;
-}());
-
-var Tokenizer = /** @class */ (function () {
- function Tokenizer(entityParser, options) {
- if (options === void 0) { options = {}; }
- this.options = options;
- this.token = null;
- this.startLine = 1;
- this.startColumn = 0;
- this.tokens = [];
- this.tokenizer = new EventedTokenizer(this, entityParser, options.mode);
- this._currentAttribute = undefined;
- }
- Tokenizer.prototype.tokenize = function (input) {
- this.tokens = [];
- this.tokenizer.tokenize(input);
- return this.tokens;
- };
- Tokenizer.prototype.tokenizePart = function (input) {
- this.tokens = [];
- this.tokenizer.tokenizePart(input);
- return this.tokens;
- };
- Tokenizer.prototype.tokenizeEOF = function () {
- this.tokens = [];
- this.tokenizer.tokenizeEOF();
- return this.tokens[0];
- };
- Tokenizer.prototype.reset = function () {
- this.token = null;
- this.startLine = 1;
- this.startColumn = 0;
- };
- Tokenizer.prototype.current = function () {
- var token = this.token;
- if (token === null) {
- throw new Error('token was unexpectedly null');
- }
- if (arguments.length === 0) {
- return token;
- }
- for (var i = 0; i < arguments.length; i++) {
- if (token.type === arguments[i]) {
- return token;
- }
- }
- throw new Error("token type was unexpectedly " + token.type);
- };
- Tokenizer.prototype.push = function (token) {
- this.token = token;
- this.tokens.push(token);
- };
- Tokenizer.prototype.currentAttribute = function () {
- return this._currentAttribute;
- };
- Tokenizer.prototype.addLocInfo = function () {
- if (this.options.loc) {
- this.current().loc = {
- start: {
- line: this.startLine,
- column: this.startColumn
- },
- end: {
- line: this.tokenizer.line,
- column: this.tokenizer.column
- }
- };
- }
- this.startLine = this.tokenizer.line;
- this.startColumn = this.tokenizer.column;
- };
- // Data
- Tokenizer.prototype.beginDoctype = function () {
- this.push({
- type: "Doctype" /* Doctype */,
- name: '',
- });
- };
- Tokenizer.prototype.appendToDoctypeName = function (char) {
- this.current("Doctype" /* Doctype */).name += char;
- };
- Tokenizer.prototype.appendToDoctypePublicIdentifier = function (char) {
- var doctype = this.current("Doctype" /* Doctype */);
- if (doctype.publicIdentifier === undefined) {
- doctype.publicIdentifier = char;
- }
- else {
- doctype.publicIdentifier += char;
- }
- };
- Tokenizer.prototype.appendToDoctypeSystemIdentifier = function (char) {
- var doctype = this.current("Doctype" /* Doctype */);
- if (doctype.systemIdentifier === undefined) {
- doctype.systemIdentifier = char;
- }
- else {
- doctype.systemIdentifier += char;
- }
- };
- Tokenizer.prototype.endDoctype = function () {
- this.addLocInfo();
- };
- Tokenizer.prototype.beginData = function () {
- this.push({
- type: "Chars" /* Chars */,
- chars: ''
- });
- };
- Tokenizer.prototype.appendToData = function (char) {
- this.current("Chars" /* Chars */).chars += char;
- };
- Tokenizer.prototype.finishData = function () {
- this.addLocInfo();
- };
- // Comment
- Tokenizer.prototype.beginComment = function () {
- this.push({
- type: "Comment" /* Comment */,
- chars: ''
- });
- };
- Tokenizer.prototype.appendToCommentData = function (char) {
- this.current("Comment" /* Comment */).chars += char;
- };
- Tokenizer.prototype.finishComment = function () {
- this.addLocInfo();
- };
- // Tags - basic
- Tokenizer.prototype.tagOpen = function () { };
- Tokenizer.prototype.beginStartTag = function () {
- this.push({
- type: "StartTag" /* StartTag */,
- tagName: '',
- attributes: [],
- selfClosing: false
- });
- };
- Tokenizer.prototype.beginEndTag = function () {
- this.push({
- type: "EndTag" /* EndTag */,
- tagName: ''
- });
- };
- Tokenizer.prototype.finishTag = function () {
- this.addLocInfo();
- };
- Tokenizer.prototype.markTagAsSelfClosing = function () {
- this.current("StartTag" /* StartTag */).selfClosing = true;
- };
- // Tags - name
- Tokenizer.prototype.appendToTagName = function (char) {
- this.current("StartTag" /* StartTag */, "EndTag" /* EndTag */).tagName += char;
- };
- // Tags - attributes
- Tokenizer.prototype.beginAttribute = function () {
- this._currentAttribute = ['', '', false];
- };
- Tokenizer.prototype.appendToAttributeName = function (char) {
- this.currentAttribute()[0] += char;
- };
- Tokenizer.prototype.beginAttributeValue = function (isQuoted) {
- this.currentAttribute()[2] = isQuoted;
- };
- Tokenizer.prototype.appendToAttributeValue = function (char) {
- this.currentAttribute()[1] += char;
- };
- Tokenizer.prototype.finishAttributeValue = function () {
- this.current("StartTag" /* StartTag */).attributes.push(this._currentAttribute);
- };
- Tokenizer.prototype.reportSyntaxError = function (message) {
- this.current().syntaxError = message;
- };
- return Tokenizer;
-}());
-
-function tokenize(input, options) {
- var tokenizer = new Tokenizer(new EntityParser(namedCharRefs), options);
- return tokenizer.tokenize(input);
-}
-
-
-
-// EXTERNAL MODULE: external ["wp","htmlEntities"]
-var external_wp_htmlEntities_ = __webpack_require__("rmEH");
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/validation/logger.js
-function createLogger() {
- /**
- * Creates a log handler with block validation prefix.
- *
- * @param {Function} logger Original logger function.
- *
- * @return {Function} Augmented logger function.
- */
- function createLogHandler(logger) {
- let log = function (message) {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- return logger('Block validation: ' + message, ...args);
- }; // In test environments, pre-process string substitutions to improve
- // readability of error messages. We'd prefer to avoid pulling in this
- // dependency in runtime environments, and it can be dropped by a combo
- // of Webpack env substitution + UglifyJS dead code elimination.
-
-
- if (false) {}
-
- return log;
- }
-
- return {
- // eslint-disable-next-line no-console
- error: createLogHandler(console.error),
- // eslint-disable-next-line no-console
- warning: createLogHandler(console.warn),
-
- getItems() {
- return [];
- }
-
- };
-}
-function createQueuedLogger() {
- /**
- * The list of enqueued log actions to print.
- *
- * @type {Array}
- */
- const queue = [];
- const logger = createLogger();
- return {
- error() {
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
-
- queue.push({
- log: logger.error,
- args
- });
- },
-
- warning() {
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
- args[_key3] = arguments[_key3];
- }
-
- queue.push({
- log: logger.warning,
- args
- });
- },
-
- getItems() {
- return queue;
- }
-
- };
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/validation/index.js
-/**
- * External dependencies
- */
-
-
-/**
- * WordPress dependencies
- */
-
-
-/**
- * Internal dependencies
- */
-
-
-
-
-
-/**
- * Globally matches any consecutive whitespace
- *
- * @type {RegExp}
- */
-
-const REGEXP_WHITESPACE = /[\t\n\r\v\f ]+/g;
-/**
- * Matches a string containing only whitespace
- *
- * @type {RegExp}
- */
-
-const REGEXP_ONLY_WHITESPACE = /^[\t\n\r\v\f ]*$/;
-/**
- * Matches a CSS URL type value
- *
- * @type {RegExp}
- */
-
-const REGEXP_STYLE_URL_TYPE = /^url\s*\(['"\s]*(.*?)['"\s]*\)$/;
-/**
- * Boolean attributes are attributes whose presence as being assigned is
- * meaningful, even if only empty.
- *
- * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes
- * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3
- *
- * Object.keys( Array.from( document.querySelectorAll( '#attributes-1 > tbody > tr' ) )
- * .filter( ( tr ) => tr.lastChild.textContent.indexOf( 'Boolean attribute' ) !== -1 )
- * .reduce( ( result, tr ) => Object.assign( result, {
- * [ tr.firstChild.textContent.trim() ]: true
- * } ), {} ) ).sort();
- *
- * @type {Array}
- */
-
-const BOOLEAN_ATTRIBUTES = ['allowfullscreen', 'allowpaymentrequest', 'allowusermedia', 'async', 'autofocus', 'autoplay', 'checked', 'controls', 'default', 'defer', 'disabled', 'download', 'formnovalidate', 'hidden', 'ismap', 'itemscope', 'loop', 'multiple', 'muted', 'nomodule', 'novalidate', 'open', 'playsinline', 'readonly', 'required', 'reversed', 'selected', 'typemustmatch'];
-/**
- * Enumerated attributes are attributes which must be of a specific value form.
- * Like boolean attributes, these are meaningful if specified, even if not of a
- * valid enumerated value.
- *
- * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute
- * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3
- *
- * Object.keys( Array.from( document.querySelectorAll( '#attributes-1 > tbody > tr' ) )
- * .filter( ( tr ) => /^("(.+?)";?\s*)+/.test( tr.lastChild.textContent.trim() ) )
- * .reduce( ( result, tr ) => Object.assign( result, {
- * [ tr.firstChild.textContent.trim() ]: true
- * } ), {} ) ).sort();
- *
- * @type {Array}
- */
-
-const ENUMERATED_ATTRIBUTES = ['autocapitalize', 'autocomplete', 'charset', 'contenteditable', 'crossorigin', 'decoding', 'dir', 'draggable', 'enctype', 'formenctype', 'formmethod', 'http-equiv', 'inputmode', 'kind', 'method', 'preload', 'scope', 'shape', 'spellcheck', 'translate', 'type', 'wrap'];
-/**
- * Meaningful attributes are those who cannot be safely ignored when omitted in
- * one HTML markup string and not another.
- *
- * @type {Array}
- */
-
-const MEANINGFUL_ATTRIBUTES = [...BOOLEAN_ATTRIBUTES, ...ENUMERATED_ATTRIBUTES];
-/**
- * Array of functions which receive a text string on which to apply normalizing
- * behavior for consideration in text token equivalence, carefully ordered from
- * least-to-most expensive operations.
- *
- * @type {Array}
- */
-
-const TEXT_NORMALIZATIONS = [external_lodash_["identity"], getTextWithCollapsedWhitespace];
-/**
- * Regular expression matching a named character reference. In lieu of bundling
- * a full set of references, the pattern covers the minimal necessary to test
- * positively against the full set.
- *
- * "The ampersand must be followed by one of the names given in the named
- * character references section, using the same case."
- *
- * Tested aginst "12.5 Named character references":
- *
- * ```
- * const references = Array.from( document.querySelectorAll(
- * '#named-character-references-table tr[id^=entity-] td:first-child'
- * ) ).map( ( code ) => code.textContent )
- * references.every( ( reference ) => /^[\da-z]+$/i.test( reference ) )
- * ```
- *
- * @see https://html.spec.whatwg.org/multipage/syntax.html#character-references
- * @see https://html.spec.whatwg.org/multipage/named-characters.html#named-character-references
- *
- * @type {RegExp}
- */
-
-const REGEXP_NAMED_CHARACTER_REFERENCE = /^[\da-z]+$/i;
-/**
- * Regular expression matching a decimal character reference.
- *
- * "The ampersand must be followed by a U+0023 NUMBER SIGN character (#),
- * followed by one or more ASCII digits, representing a base-ten integer"
- *
- * @see https://html.spec.whatwg.org/multipage/syntax.html#character-references
- *
- * @type {RegExp}
- */
-
-const REGEXP_DECIMAL_CHARACTER_REFERENCE = /^#\d+$/;
-/**
- * Regular expression matching a hexadecimal character reference.
- *
- * "The ampersand must be followed by a U+0023 NUMBER SIGN character (#), which
- * must be followed by either a U+0078 LATIN SMALL LETTER X character (x) or a
- * U+0058 LATIN CAPITAL LETTER X character (X), which must then be followed by
- * one or more ASCII hex digits, representing a hexadecimal integer"
- *
- * @see https://html.spec.whatwg.org/multipage/syntax.html#character-references
- *
- * @type {RegExp}
- */
-
-const REGEXP_HEXADECIMAL_CHARACTER_REFERENCE = /^#x[\da-f]+$/i;
-/**
- * Returns true if the given string is a valid character reference segment, or
- * false otherwise. The text should be stripped of `&` and `;` demarcations.
- *
- * @param {string} text Text to test.
- *
- * @return {boolean} Whether text is valid character reference.
- */
-
-function isValidCharacterReference(text) {
- return REGEXP_NAMED_CHARACTER_REFERENCE.test(text) || REGEXP_DECIMAL_CHARACTER_REFERENCE.test(text) || REGEXP_HEXADECIMAL_CHARACTER_REFERENCE.test(text);
-}
-/**
- * Subsitute EntityParser class for `simple-html-tokenizer` which uses the
- * implementation of `decodeEntities` from `html-entities`, in order to avoid
- * bundling a massive named character reference.
- *
- * @see https://github.com/tildeio/simple-html-tokenizer/tree/HEAD/src/entity-parser.ts
- */
-
-class validation_DecodeEntityParser {
- /**
- * Returns a substitute string for an entity string sequence between `&`
- * and `;`, or undefined if no substitution should occur.
- *
- * @param {string} entity Entity fragment discovered in HTML.
- *
- * @return {?string} Entity substitute value.
- */
- parse(entity) {
- if (isValidCharacterReference(entity)) {
- return Object(external_wp_htmlEntities_["decodeEntities"])('&' + entity + ';');
- }
- }
-
-}
-/**
- * Given a specified string, returns an array of strings split by consecutive
- * whitespace, ignoring leading or trailing whitespace.
- *
- * @param {string} text Original text.
- *
- * @return {string[]} Text pieces split on whitespace.
- */
-
-function getTextPiecesSplitOnWhitespace(text) {
- return text.trim().split(REGEXP_WHITESPACE);
-}
-/**
- * Given a specified string, returns a new trimmed string where all consecutive
- * whitespace is collapsed to a single space.
- *
- * @param {string} text Original text.
- *
- * @return {string} Trimmed text with consecutive whitespace collapsed.
- */
-
-function getTextWithCollapsedWhitespace(text) {
- // This is an overly simplified whitespace comparison. The specification is
- // more prescriptive of whitespace behavior in inline and block contexts.
- //
- // See: https://medium.com/@patrickbrosset/when-does-white-space-matter-in-html-b90e8a7cdd33
- return getTextPiecesSplitOnWhitespace(text).join(' ');
-}
-/**
- * Returns attribute pairs of the given StartTag token, including only pairs
- * where the value is non-empty or the attribute is a boolean attribute, an
- * enumerated attribute, or a custom data- attribute.
- *
- * @see MEANINGFUL_ATTRIBUTES
- *
- * @param {Object} token StartTag token.
- *
- * @return {Array[]} Attribute pairs.
- */
-
-function getMeaningfulAttributePairs(token) {
- return token.attributes.filter(pair => {
- const [key, value] = pair;
- return value || key.indexOf('data-') === 0 || Object(external_lodash_["includes"])(MEANINGFUL_ATTRIBUTES, key);
- });
-}
-/**
- * Returns true if two text tokens (with `chars` property) are equivalent, or
- * false otherwise.
- *
- * @param {Object} actual Actual token.
- * @param {Object} expected Expected token.
- * @param {Object} logger Validation logger object.
- *
- * @return {boolean} Whether two text tokens are equivalent.
- */
-
-function isEquivalentTextTokens(actual, expected) {
- let logger = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createLogger();
- // This function is intentionally written as syntactically "ugly" as a hot
- // path optimization. Text is progressively normalized in order from least-
- // to-most operationally expensive, until the earliest point at which text
- // can be confidently inferred as being equal.
- let actualChars = actual.chars;
- let expectedChars = expected.chars;
-
- for (let i = 0; i < TEXT_NORMALIZATIONS.length; i++) {
- const normalize = TEXT_NORMALIZATIONS[i];
- actualChars = normalize(actualChars);
- expectedChars = normalize(expectedChars);
-
- if (actualChars === expectedChars) {
- return true;
- }
- }
-
- logger.warning('Expected text `%s`, saw `%s`.', expected.chars, actual.chars);
- return false;
-}
-/**
- * Given a CSS length value, returns a normalized CSS length value for strict equality
- * comparison.
- *
- * @param {string} value CSS length value.
- *
- * @return {string} Normalized CSS length value.
- */
-
-function getNormalizedLength(value) {
- if (0 === parseFloat(value)) {
- return '0';
- } // Normalize strings with floats to always include a leading zero.
-
-
- if (value.indexOf('.') === 0) {
- return '0' + value;
- }
-
- return value;
-}
-/**
- * Given a style value, returns a normalized style value for strict equality
- * comparison.
- *
- * @param {string} value Style value.
- *
- * @return {string} Normalized style value.
- */
-
-function getNormalizedStyleValue(value) {
- const textPieces = getTextPiecesSplitOnWhitespace(value);
- const normalizedPieces = textPieces.map(getNormalizedLength);
- const result = normalizedPieces.join(' ');
- return result // Normalize URL type to omit whitespace or quotes
- .replace(REGEXP_STYLE_URL_TYPE, 'url($1)');
-}
-/**
- * Given a style attribute string, returns an object of style properties.
- *
- * @param {string} text Style attribute.
- *
- * @return {Object} Style properties.
- */
-
-function getStyleProperties(text) {
- const pairs = text // Trim ending semicolon (avoid including in split)
- .replace(/;?\s*$/, '') // Split on property assignment
- .split(';') // For each property assignment...
- .map(style => {
- // ...split further into key-value pairs
- const [key, ...valueParts] = style.split(':');
- const value = valueParts.join(':');
- return [key.trim(), getNormalizedStyleValue(value.trim())];
- });
- return Object(external_lodash_["fromPairs"])(pairs);
-}
-/**
- * Attribute-specific equality handlers
- *
- * @type {Object}
- */
-
-const isEqualAttributesOfName = {
- class: (actual, expected) => {
- // Class matches if members are the same, even if out of order or
- // superfluous whitespace between.
- return !Object(external_lodash_["xor"])(...[actual, expected].map(getTextPiecesSplitOnWhitespace)).length;
- },
- style: (actual, expected) => {
- return Object(external_lodash_["isEqual"])(...[actual, expected].map(getStyleProperties));
- },
- // For each boolean attribute, mere presence of attribute in both is enough
- // to assume equivalence.
- ...Object(external_lodash_["fromPairs"])(BOOLEAN_ATTRIBUTES.map(attribute => [attribute, external_lodash_["stubTrue"]]))
-};
-/**
- * Given two sets of attribute tuples, returns true if the attribute sets are
- * equivalent.
- *
- * @param {Array[]} actual Actual attributes tuples.
- * @param {Array[]} expected Expected attributes tuples.
- * @param {Object} logger Validation logger object.
- *
- * @return {boolean} Whether attributes are equivalent.
- */
-
-function isEqualTagAttributePairs(actual, expected) {
- let logger = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createLogger();
-
- // Attributes is tokenized as tuples. Their lengths should match. This also
- // avoids us needing to check both attributes sets, since if A has any keys
- // which do not exist in B, we know the sets to be different.
- if (actual.length !== expected.length) {
- logger.warning('Expected attributes %o, instead saw %o.', expected, actual);
- return false;
- } // Attributes are not guaranteed to occur in the same order. For validating
- // actual attributes, first convert the set of expected attribute values to
- // an object, for lookup by key.
-
-
- const expectedAttributes = {};
-
- for (let i = 0; i < expected.length; i++) {
- expectedAttributes[expected[i][0].toLowerCase()] = expected[i][1];
- }
-
- for (let i = 0; i < actual.length; i++) {
- const [name, actualValue] = actual[i];
- const nameLower = name.toLowerCase(); // As noted above, if missing member in B, assume different
-
- if (!expectedAttributes.hasOwnProperty(nameLower)) {
- logger.warning('Encountered unexpected attribute `%s`.', name);
- return false;
- }
-
- const expectedValue = expectedAttributes[nameLower];
- const isEqualAttributes = isEqualAttributesOfName[nameLower];
-
- if (isEqualAttributes) {
- // Defer custom attribute equality handling
- if (!isEqualAttributes(actualValue, expectedValue)) {
- logger.warning('Expected attribute `%s` of value `%s`, saw `%s`.', name, expectedValue, actualValue);
- return false;
- }
- } else if (actualValue !== expectedValue) {
- // Otherwise strict inequality should bail
- logger.warning('Expected attribute `%s` of value `%s`, saw `%s`.', name, expectedValue, actualValue);
- return false;
- }
- }
-
- return true;
-}
-/**
- * Token-type-specific equality handlers
- *
- * @type {Object}
- */
-
-const isEqualTokensOfType = {
- StartTag: function (actual, expected) {
- let logger = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createLogger();
-
- if (actual.tagName !== expected.tagName && // Optimization: Use short-circuit evaluation to defer case-
- // insensitive check on the assumption that the majority case will
- // have exactly equal tag names.
- actual.tagName.toLowerCase() !== expected.tagName.toLowerCase()) {
- logger.warning('Expected tag name `%s`, instead saw `%s`.', expected.tagName, actual.tagName);
- return false;
- }
-
- return isEqualTagAttributePairs(...[actual, expected].map(getMeaningfulAttributePairs), logger);
- },
- Chars: isEquivalentTextTokens,
- Comment: isEquivalentTextTokens
-};
-/**
- * Given an array of tokens, returns the first token which is not purely
- * whitespace.
- *
- * Mutates the tokens array.
- *
- * @param {Object[]} tokens Set of tokens to search.
- *
- * @return {Object} Next non-whitespace token.
- */
-
-function getNextNonWhitespaceToken(tokens) {
- let token;
-
- while (token = tokens.shift()) {
- if (token.type !== 'Chars') {
- return token;
- }
-
- if (!REGEXP_ONLY_WHITESPACE.test(token.chars)) {
- return token;
- }
- }
-}
-/**
- * Tokenize an HTML string, gracefully handling any errors thrown during
- * underlying tokenization.
- *
- * @param {string} html HTML string to tokenize.
- * @param {Object} logger Validation logger object.
- *
- * @return {Object[]|null} Array of valid tokenized HTML elements, or null on error
- */
-
-function getHTMLTokens(html) {
- let logger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : createLogger();
-
- try {
- return new Tokenizer(new validation_DecodeEntityParser()).tokenize(html);
- } catch (e) {
- logger.warning('Malformed HTML detected: %s', html);
- }
-
- return null;
-}
-/**
- * Returns true if the next HTML token closes the current token.
- *
- * @param {Object} currentToken Current token to compare with.
- * @param {Object|undefined} nextToken Next token to compare against.
- *
- * @return {boolean} true if `nextToken` closes `currentToken`, false otherwise
- */
-
-
-function isClosedByToken(currentToken, nextToken) {
- // Ensure this is a self closed token
- if (!currentToken.selfClosing) {
- return false;
- } // Check token names and determine if nextToken is the closing tag for currentToken
-
-
- if (nextToken && nextToken.tagName === currentToken.tagName && nextToken.type === 'EndTag') {
- return true;
- }
-
- return false;
-}
-/**
- * Returns true if the given HTML strings are effectively equivalent, or
- * false otherwise. Invalid HTML is not considered equivalent, even if the
- * strings directly match.
- *
- * @param {string} actual Actual HTML string.
- * @param {string} expected Expected HTML string.
- * @param {Object} logger Validation logger object.
- *
- * @return {boolean} Whether HTML strings are equivalent.
- */
-
-function isEquivalentHTML(actual, expected) {
- let logger = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createLogger();
-
- // Short-circuit if markup is identical.
- if (actual === expected) {
- return true;
- } // Tokenize input content and reserialized save content
-
-
- const [actualTokens, expectedTokens] = [actual, expected].map(html => getHTMLTokens(html, logger)); // If either is malformed then stop comparing - the strings are not equivalent
-
- if (!actualTokens || !expectedTokens) {
- return false;
- }
-
- let actualToken, expectedToken;
-
- while (actualToken = getNextNonWhitespaceToken(actualTokens)) {
- expectedToken = getNextNonWhitespaceToken(expectedTokens); // Inequal if exhausted all expected tokens
-
- if (!expectedToken) {
- logger.warning('Expected end of content, instead saw %o.', actualToken);
- return false;
- } // Inequal if next non-whitespace token of each set are not same type
-
-
- if (actualToken.type !== expectedToken.type) {
- logger.warning('Expected token of type `%s` (%o), instead saw `%s` (%o).', expectedToken.type, expectedToken, actualToken.type, actualToken);
- return false;
- } // Defer custom token type equality handling, otherwise continue and
- // assume as equal
-
-
- const isEqualTokens = isEqualTokensOfType[actualToken.type];
-
- if (isEqualTokens && !isEqualTokens(actualToken, expectedToken, logger)) {
- return false;
- } // Peek at the next tokens (actual and expected) to see if they close
- // a self-closing tag
-
-
- if (isClosedByToken(actualToken, expectedTokens[0])) {
- // Consume the next expected token that closes the current actual
- // self-closing token
- getNextNonWhitespaceToken(expectedTokens);
- } else if (isClosedByToken(expectedToken, actualTokens[0])) {
- // Consume the next actual token that closes the current expected
- // self-closing token
- getNextNonWhitespaceToken(actualTokens);
- }
- }
-
- if (expectedToken = getNextNonWhitespaceToken(expectedTokens)) {
- // If any non-whitespace tokens remain in expected token set, this
- // indicates inequality
- logger.warning('Expected %o, instead saw end of content.', expectedToken);
- return false;
- }
-
- return true;
-}
-/**
- * Returns an object with `isValid` property set to `true` if the parsed block
- * is valid given the input content. A block is considered valid if, when serialized
- * with assumed attributes, the content matches the original value. If block is
- * invalid, this function returns all validations issues as well.
- *
- * @param {string|Object} blockTypeOrName Block type.
- * @param {Object} attributes Parsed block attributes.
- * @param {string} originalBlockContent Original block content.
- * @param {Object} logger Validation logger object.
- *
- * @return {Object} Whether block is valid and contains validation messages.
- */
-
-/**
- * Returns an object with `isValid` property set to `true` if the parsed block
- * is valid given the input content. A block is considered valid if, when serialized
- * with assumed attributes, the content matches the original value. If block is
- * invalid, this function returns all validations issues as well.
- *
- * @param {import('../parser').WPBlock} block block object.
- * @param {import('../registration').WPBlockType} blockTypeOrName Block type or name.
- *
- * @return {[boolean,Object]} validation results.
- */
-
-function validateBlock(block, blockTypeOrName) {
- const isFallbackBlock = block.name === getFreeformContentHandlerName() || block.name === getUnregisteredTypeHandlerName(); // Shortcut to avoid costly validation.
-
- if (isFallbackBlock) {
- return [true];
- }
-
- const logger = createQueuedLogger();
- const blockType = normalizeBlockType(blockTypeOrName);
- let generatedBlockContent;
-
- try {
- generatedBlockContent = getSaveContent(blockType, block.attributes);
- } catch (error) {
- logger.error('Block validation failed because an error occurred while generating block content:\n\n%s', error.toString());
- return [false, logger.getItems()];
- }
-
- const isValid = isEquivalentHTML(block.originalContent, generatedBlockContent, logger);
-
- if (!isValid) {
- logger.error('Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s', blockType.name, blockType, generatedBlockContent, block.originalContent);
- }
-
- return [isValid, logger.getItems()];
-}
-/**
- * Returns true if the parsed block is valid given the input content. A block
- * is considered valid if, when serialized with assumed attributes, the content
- * matches the original value.
- *
- * Logs to console in development environments when invalid.
- *
- * @param {string|Object} blockTypeOrName Block type.
- * @param {Object} attributes Parsed block attributes.
- * @param {string} originalBlockContent Original block content.
- *
- * @return {boolean} Whether block is valid.
- */
-
-function isValidBlockContent(blockTypeOrName, attributes, originalBlockContent) {
- const blockType = normalizeBlockType(blockTypeOrName);
- const block = {
- name: blockType.name,
- attributes,
- innerBlocks: [],
- originalContent: originalBlockContent
- };
- const [isValid] = validateBlock(block, blockType);
- return isValid;
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/parser/convert-legacy-block.js
-/**
- * Convert legacy blocks to their canonical form. This function is used
- * both in the parser level for previous content and to convert such blocks
- * used in Custom Post Types templates.
- *
- * @param {string} name The block's name
- * @param {Object} attributes The block's attributes
- *
- * @return {[string, Object]} The block's name and attributes, changed accordingly if a match was found
- */
-function convertLegacyBlockNameAndAttributes(name, attributes) {
- const newAttributes = { ...attributes
- }; // Convert 'core/cover-image' block in existing content to 'core/cover'.
-
- if ('core/cover-image' === name) {
- name = 'core/cover';
- } // Convert 'core/text' blocks in existing content to 'core/paragraph'.
-
-
- if ('core/text' === name || 'core/cover-text' === name) {
- name = 'core/paragraph';
- } // Convert derivative blocks such as 'core/social-link-wordpress' to the
- // canonical form 'core/social-link'.
-
-
- if (name && name.indexOf('core/social-link-') === 0) {
- // Capture `social-link-wordpress` into `{"service":"wordpress"}`
- newAttributes.service = name.substring(17);
- name = 'core/social-link';
- } // Convert derivative blocks such as 'core-embed/instagram' to the
- // canonical form 'core/embed'.
-
-
- if (name && name.indexOf('core-embed/') === 0) {
- // Capture `core-embed/instagram` into `{"providerNameSlug":"instagram"}`
- const providerSlug = name.substring(11);
- const deprecated = {
- speaker: 'speaker-deck',
- polldaddy: 'crowdsignal'
- };
- newAttributes.providerNameSlug = providerSlug in deprecated ? deprecated[providerSlug] : providerSlug; // this is needed as the `responsive` attribute was passed
- // in a different way before the refactoring to block variations
-
- if (!['amazon-kindle', 'wordpress'].includes(providerSlug)) {
- newAttributes.responsive = true;
- }
-
- name = 'core/embed';
- } // Convert 'core/query-loop' blocks in existing content to 'core/post-template'.
- // TODO: Remove this check when WordPress 5.9 is released.
-
-
- if (name === 'core/query-loop') {
- name = 'core/post-template';
- } // Convert Post Comment blocks in existing content to Comment blocks.
- // TODO: Remove these checks when WordPress 6.0 is released.
-
-
- if (name === 'core/post-comment-author') {
- name = 'core/comment-author-name';
- }
-
- if (name === 'core/post-comment-content') {
- name = 'core/comment-content';
- }
-
- if (name === 'core/post-comment-date') {
- name = 'core/comment-date';
- }
-
- return [name, newAttributes];
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/parser/serialize-raw-block.js
-/**
- * Internal dependencies
- */
-
-/**
- * Serializes a block node into the native HTML-comment-powered block format.
- * CAVEAT: This function is intended for reserializing blocks as parsed by
- * valid parsers and skips any validation steps. This is NOT a generic
- * serialization function for in-memory blocks. For most purposes, see the
- * following functions available in the `@wordpress/blocks` package:
- *
- * @see serializeBlock
- * @see serialize
- *
- * For more on the format of block nodes as returned by valid parsers:
- *
- * @see `@wordpress/block-serialization-default-parser` package
- * @see `@wordpress/block-serialization-spec-parser` package
- *
- * @param {import(".").WPRawBlock} rawBlock A block node as returned by a valid parser.
- * @param {?Object} options Serialization options.
- * @param {?boolean} options.isCommentDelimited Whether to output HTML comments around blocks.
- *
- * @return {string} An HTML string representing a block.
- */
-
-function serializeRawBlock(rawBlock) {
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- const {
- isCommentDelimited = true
- } = options;
- const {
- blockName,
- attrs = {},
- innerBlocks = [],
- innerContent = []
- } = rawBlock;
- let childIndex = 0;
- const content = innerContent.map(item => // `null` denotes a nested block, otherwise we have an HTML fragment.
- item !== null ? item : serializeRawBlock(innerBlocks[childIndex++], options)).join('\n').replace(/\n+/g, '\n').trim();
- return isCommentDelimited ? getCommentDelimitedContent(blockName, attrs, content) : content;
-}
-
-// CONCATENATED MODULE: ./node_modules/hpq/es/get-path.js
-/**
- * Given object and string of dot-delimited path segments, returns value at
- * path or undefined if path cannot be resolved.
- *
- * @param {Object} object Lookup object
- * @param {string} path Path to resolve
- * @return {?*} Resolved value
- */
-function getPath(object, path) {
- var segments = path.split('.');
- var segment;
-
- while (segment = segments.shift()) {
- if (!(segment in object)) {
- return;
- }
-
- object = object[segment];
- }
-
- return object;
-}
-// CONCATENATED MODULE: ./node_modules/hpq/es/index.js
-/**
- * Internal dependencies
- */
-
-/**
- * Function returning a DOM document created by `createHTMLDocument`. The same
- * document is returned between invocations.
- *
- * @return {Document} DOM document.
- */
-
-var getDocument = function () {
- var doc;
- return function () {
- if (!doc) {
- doc = document.implementation.createHTMLDocument('');
- }
-
- return doc;
- };
-}();
-/**
- * Given a markup string or DOM element, creates an object aligning with the
- * shape of the matchers object, or the value returned by the matcher.
- *
- * @param {(string|Element)} source Source content
- * @param {(Object|Function)} matchers Matcher function or object of matchers
- * @return {(Object|*)} Matched value(s), shaped by object
- */
-
-
-function parse(source, matchers) {
- if (!matchers) {
- return;
- } // Coerce to element
-
-
- if ('string' === typeof source) {
- var doc = getDocument();
- doc.body.innerHTML = source;
- source = doc.body;
- } // Return singular value
-
-
- if ('function' === typeof matchers) {
- return matchers(source);
- } // Bail if we can't handle matchers
-
-
- if (Object !== matchers.constructor) {
- return;
- } // Shape result by matcher object
-
-
- return Object.keys(matchers).reduce(function (memo, key) {
- memo[key] = parse(source, matchers[key]);
- return memo;
- }, {});
-}
-/**
- * Generates a function which matches node of type selector, returning an
- * attribute by property if the attribute exists. If no selector is passed,
- * returns property of the query element.
- *
- * @param {?string} selector Optional selector
- * @param {string} name Property name
- * @return {*} Property value
- */
-
-function prop(selector, name) {
- if (1 === arguments.length) {
- name = selector;
- selector = undefined;
- }
-
- return function (node) {
- var match = node;
-
- if (selector) {
- match = node.querySelector(selector);
- }
-
- if (match) {
- return getPath(match, name);
- }
- };
-}
-/**
- * Generates a function which matches node of type selector, returning an
- * attribute by name if the attribute exists. If no selector is passed,
- * returns attribute of the query element.
- *
- * @param {?string} selector Optional selector
- * @param {string} name Attribute name
- * @return {?string} Attribute value
- */
-
-function attr(selector, name) {
- if (1 === arguments.length) {
- name = selector;
- selector = undefined;
- }
-
- return function (node) {
- var attributes = prop(selector, 'attributes')(node);
-
- if (attributes && attributes.hasOwnProperty(name)) {
- return attributes[name].value;
- }
- };
-}
-/**
- * Convenience for `prop( selector, 'innerHTML' )`.
- *
- * @see prop()
- *
- * @param {?string} selector Optional selector
- * @return {string} Inner HTML
- */
-
-function es_html(selector) {
- return prop(selector, 'innerHTML');
-}
-/**
- * Convenience for `prop( selector, 'textContent' )`.
- *
- * @see prop()
- *
- * @param {?string} selector Optional selector
- * @return {string} Text content
- */
-
-function es_text(selector) {
- return prop(selector, 'textContent');
-}
-/**
- * Creates a new matching context by first finding elements matching selector
- * using querySelectorAll before then running another `parse` on `matchers`
- * scoped to the matched elements.
- *
- * @see parse()
- *
- * @param {string} selector Selector to match
- * @param {(Object|Function)} matchers Matcher function or object of matchers
- * @return {Array.<*,Object>} Array of matched value(s)
- */
-
-function query(selector, matchers) {
- return function (node) {
- var matches = node.querySelectorAll(selector);
- return [].map.call(matches, function (match) {
- return parse(match, matchers);
- });
- };
-}
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/matchers.js
-/**
- * External dependencies
- */
-
-/**
- * Internal dependencies
- */
-
-
-
-function matchers_html(selector, multilineTag) {
- return domNode => {
- let match = domNode;
-
- if (selector) {
- match = domNode.querySelector(selector);
- }
-
- if (!match) {
- return '';
- }
-
- if (multilineTag) {
- let value = '';
- const length = match.children.length;
-
- for (let index = 0; index < length; index++) {
- const child = match.children[index];
-
- if (child.nodeName.toLowerCase() !== multilineTag) {
- continue;
- }
-
- value += child.outerHTML;
- }
-
- return value;
- }
-
- return match.innerHTML;
- };
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/node.js
-/**
- * Internal dependencies
- */
-
-/**
- * A representation of a single node within a block's rich text value. If
- * representing a text node, the value is simply a string of the node value.
- * As representing an element node, it is an object of:
- *
- * 1. `type` (string): Tag name.
- * 2. `props` (object): Attributes and children array of WPBlockNode.
- *
- * @typedef {string|Object} WPBlockNode
- */
-
-/**
- * Given a single node and a node type (e.g. `'br'`), returns true if the node
- * corresponds to that type, false otherwise.
- *
- * @param {WPBlockNode} node Block node to test
- * @param {string} type Node to type to test against.
- *
- * @return {boolean} Whether node is of intended type.
- */
-
-function isNodeOfType(node, type) {
- return node && node.type === type;
-}
-/**
- * Given an object implementing the NamedNodeMap interface, returns a plain
- * object equivalent value of name, value key-value pairs.
- *
- * @see https://dom.spec.whatwg.org/#interface-namednodemap
- *
- * @param {NamedNodeMap} nodeMap NamedNodeMap to convert to object.
- *
- * @return {Object} Object equivalent value of NamedNodeMap.
- */
-
-
-function getNamedNodeMapAsObject(nodeMap) {
- const result = {};
-
- for (let i = 0; i < nodeMap.length; i++) {
- const {
- name,
- value
- } = nodeMap[i];
- result[name] = value;
- }
-
- return result;
-}
-/**
- * Given a DOM Element or Text node, returns an equivalent block node. Throws
- * if passed any node type other than element or text.
- *
- * @throws {TypeError} If non-element/text node is passed.
- *
- * @param {Node} domNode DOM node to convert.
- *
- * @return {WPBlockNode} Block node equivalent to DOM node.
- */
-
-function fromDOM(domNode) {
- if (domNode.nodeType === domNode.TEXT_NODE) {
- return domNode.nodeValue;
- }
-
- if (domNode.nodeType !== domNode.ELEMENT_NODE) {
- throw new TypeError('A block node can only be created from a node of type text or ' + 'element.');
- }
-
- return {
- type: domNode.nodeName.toLowerCase(),
- props: { ...getNamedNodeMapAsObject(domNode.attributes),
- children: children_fromDOM(domNode.childNodes)
- }
- };
-}
-/**
- * Given a block node, returns its HTML string representation.
- *
- * @param {WPBlockNode} node Block node to convert to string.
- *
- * @return {string} String HTML representation of block node.
- */
-
-function toHTML(node) {
- return children_toHTML([node]);
-}
-/**
- * Given a selector, returns an hpq matcher generating a WPBlockNode value
- * matching the selector result.
- *
- * @param {string} selector DOM selector.
- *
- * @return {Function} hpq matcher.
- */
-
-function node_matcher(selector) {
- return domNode => {
- let match = domNode;
-
- if (selector) {
- match = domNode.querySelector(selector);
- }
-
- try {
- return fromDOM(match);
- } catch (error) {
- return null;
- }
- };
-}
-/**
- * Object of utility functions used in managing block attribute values of
- * source `node`.
- *
- * @see https://github.com/WordPress/gutenberg/pull/10439
- *
- * @deprecated since 4.0. The `node` source should not be used, and can be
- * replaced by the `html` source.
- *
- * @private
- */
-
-/* harmony default export */ var api_node = ({
- isNodeOfType,
- fromDOM,
- toHTML,
- matcher: node_matcher
-});
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/children.js
-/**
- * External dependencies
- */
-
-/**
- * WordPress dependencies
- */
-
-
-/**
- * Internal dependencies
- */
-
-
-/**
- * A representation of a block's rich text value.
- *
- * @typedef {WPBlockNode[]} WPBlockChildren
- */
-
-/**
- * Given block children, returns a serialize-capable WordPress element.
- *
- * @param {WPBlockChildren} children Block children object to convert.
- *
- * @return {WPElement} A serialize-capable element.
- */
-
-function getSerializeCapableElement(children) {
- // The fact that block children are compatible with the element serializer is
- // merely an implementation detail that currently serves to be true, but
- // should not be mistaken as being a guarantee on the external API. The
- // public API only offers guarantees to work with strings (toHTML) and DOM
- // elements (fromDOM), and should provide utilities to manipulate the value
- // rather than expect consumers to inspect or construct its shape (concat).
- return children;
-}
-/**
- * Given block children, returns an array of block nodes.
- *
- * @param {WPBlockChildren} children Block children object to convert.
- *
- * @return {Array<WPBlockNode>} An array of individual block nodes.
- */
-
-function getChildrenArray(children) {
- // The fact that block children are compatible with the element serializer
- // is merely an implementation detail that currently serves to be true, but
- // should not be mistaken as being a guarantee on the external API.
- return children;
-}
-/**
- * Given two or more block nodes, returns a new block node representing a
- * concatenation of its values.
- *
- * @param {...WPBlockChildren} blockNodes Block nodes to concatenate.
- *
- * @return {WPBlockChildren} Concatenated block node.
- */
-
-
-function concat() {
- const result = [];
-
- for (let i = 0; i < arguments.length; i++) {
- const blockNode = Object(external_lodash_["castArray"])(i < 0 || arguments.length <= i ? undefined : arguments[i]);
-
- for (let j = 0; j < blockNode.length; j++) {
- const child = blockNode[j];
- const canConcatToPreviousString = typeof child === 'string' && typeof result[result.length - 1] === 'string';
-
- if (canConcatToPreviousString) {
- result[result.length - 1] += child;
- } else {
- result.push(child);
- }
- }
- }
-
- return result;
-}
-/**
- * Given an iterable set of DOM nodes, returns equivalent block children.
- * Ignores any non-element/text nodes included in set.
- *
- * @param {Iterable.<Node>} domNodes Iterable set of DOM nodes to convert.
- *
- * @return {WPBlockChildren} Block children equivalent to DOM nodes.
- */
-
-function children_fromDOM(domNodes) {
- const result = [];
-
- for (let i = 0; i < domNodes.length; i++) {
- try {
- result.push(fromDOM(domNodes[i]));
- } catch (error) {// Simply ignore if DOM node could not be converted.
- }
- }
-
- return result;
-}
-/**
- * Given a block node, returns its HTML string representation.
- *
- * @param {WPBlockChildren} children Block node(s) to convert to string.
- *
- * @return {string} String HTML representation of block node.
- */
-
-function children_toHTML(children) {
- const element = getSerializeCapableElement(children);
- return Object(external_wp_element_["renderToString"])(element);
-}
-/**
- * Given a selector, returns an hpq matcher generating a WPBlockChildren value
- * matching the selector result.
- *
- * @param {string} selector DOM selector.
- *
- * @return {Function} hpq matcher.
- */
-
-function children_matcher(selector) {
- return domNode => {
- let match = domNode;
-
- if (selector) {
- match = domNode.querySelector(selector);
- }
-
- if (match) {
- return children_fromDOM(match.childNodes);
- }
-
- return [];
- };
-}
-/**
- * Object of utility functions used in managing block attribute values of
- * source `children`.
- *
- * @see https://github.com/WordPress/gutenberg/pull/10439
- *
- * @deprecated since 4.0. The `children` source should not be used, and can be
- * replaced by the `html` source.
- *
- * @private
- */
-
-/* harmony default export */ var api_children = ({
- concat,
- getChildrenArray,
- fromDOM: children_fromDOM,
- toHTML: children_toHTML,
- matcher: children_matcher
-});
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/parser/get-block-attributes.js
-/**
- * External dependencies
- */
-
-
-/**
- * WordPress dependencies
- */
-
-
-/**
- * Internal dependencies
- */
-
-
-
-/**
- * Higher-order hpq matcher which enhances an attribute matcher to return true
- * or false depending on whether the original matcher returns undefined. This
- * is useful for boolean attributes (e.g. disabled) whose attribute values may
- * be technically falsey (empty string), though their mere presence should be
- * enough to infer as true.
- *
- * @param {Function} matcher Original hpq matcher.
- *
- * @return {Function} Enhanced hpq matcher.
- */
-
-const toBooleanAttributeMatcher = matcher => Object(external_lodash_["flow"])([matcher, // Expected values from `attr( 'disabled' )`:
-//
-// <input>
-// - Value: `undefined`
-// - Transformed: `false`
-//
-// <input disabled>
-// - Value: `''`
-// - Transformed: `true`
-//
-// <input disabled="disabled">
-// - Value: `'disabled'`
-// - Transformed: `true`
-value => value !== undefined]);
-/**
- * Returns true if value is of the given JSON schema type, or false otherwise.
- *
- * @see http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.25
- *
- * @param {*} value Value to test.
- * @param {string} type Type to test.
- *
- * @return {boolean} Whether value is of type.
- */
-
-function isOfType(value, type) {
- switch (type) {
- case 'string':
- return typeof value === 'string';
-
- case 'boolean':
- return typeof value === 'boolean';
-
- case 'object':
- return !!value && value.constructor === Object;
-
- case 'null':
- return value === null;
-
- case 'array':
- return Array.isArray(value);
-
- case 'integer':
- case 'number':
- return typeof value === 'number';
- }
-
- return true;
-}
-/**
- * Returns true if value is of an array of given JSON schema types, or false
- * otherwise.
- *
- * @see http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.25
- *
- * @param {*} value Value to test.
- * @param {string[]} types Types to test.
- *
- * @return {boolean} Whether value is of types.
- */
-
-function isOfTypes(value, types) {
- return types.some(type => isOfType(value, type));
-}
-/**
- * Given an attribute key, an attribute's schema, a block's raw content and the
- * commentAttributes returns the attribute value depending on its source
- * definition of the given attribute key.
- *
- * @param {string} attributeKey Attribute key.
- * @param {Object} attributeSchema Attribute's schema.
- * @param {string} innerHTML Block's raw content.
- * @param {Object} commentAttributes Block's comment attributes.
- *
- * @return {*} Attribute value.
- */
-
-function getBlockAttribute(attributeKey, attributeSchema, innerHTML, commentAttributes) {
- const {
- type,
- enum: enumSet
- } = attributeSchema;
- let value;
-
- switch (attributeSchema.source) {
- // An undefined source means that it's an attribute serialized to the
- // block's "comment".
- case undefined:
- value = commentAttributes ? commentAttributes[attributeKey] : undefined;
- break;
-
- case 'attribute':
- case 'property':
- case 'html':
- case 'text':
- case 'children':
- case 'node':
- case 'query':
- case 'tag':
- value = parseWithAttributeSchema(innerHTML, attributeSchema);
- break;
- }
-
- if (!isValidByType(value, type) || !isValidByEnum(value, enumSet)) {
- // Reject the value if it is not valid. Reverting to the undefined
- // value ensures the default is respected, if applicable.
- value = undefined;
- }
-
- if (value === undefined) {
- return attributeSchema.default;
- }
-
- return value;
-}
-/**
- * Returns true if value is valid per the given block attribute schema type
- * definition, or false otherwise.
- *
- * @see https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.1.1
- *
- * @param {*} value Value to test.
- * @param {?(Array<string>|string)} type Block attribute schema type.
- *
- * @return {boolean} Whether value is valid.
- */
-
-function isValidByType(value, type) {
- return type === undefined || isOfTypes(value, Object(external_lodash_["castArray"])(type));
-}
-/**
- * Returns true if value is valid per the given block attribute schema enum
- * definition, or false otherwise.
- *
- * @see https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.1.2
- *
- * @param {*} value Value to test.
- * @param {?Array} enumSet Block attribute schema enum.
- *
- * @return {boolean} Whether value is valid.
- */
-
-function isValidByEnum(value, enumSet) {
- return !Array.isArray(enumSet) || enumSet.includes(value);
-}
-/**
- * Returns an hpq matcher given a source object.
- *
- * @param {Object} sourceConfig Attribute Source object.
- *
- * @return {Function} A hpq Matcher.
- */
-
-function matcherFromSource(sourceConfig) {
- switch (sourceConfig.source) {
- case 'attribute':
- let matcher = attr(sourceConfig.selector, sourceConfig.attribute);
-
- if (sourceConfig.type === 'boolean') {
- matcher = toBooleanAttributeMatcher(matcher);
- }
-
- return matcher;
-
- case 'html':
- return matchers_html(sourceConfig.selector, sourceConfig.multiline);
-
- case 'text':
- return es_text(sourceConfig.selector);
-
- case 'children':
- return children_matcher(sourceConfig.selector);
-
- case 'node':
- return node_matcher(sourceConfig.selector);
-
- case 'query':
- const subMatchers = Object(external_lodash_["mapValues"])(sourceConfig.query, matcherFromSource);
- return query(sourceConfig.selector, subMatchers);
-
- case 'tag':
- return Object(external_lodash_["flow"])([prop(sourceConfig.selector, 'nodeName'), nodeName => nodeName ? nodeName.toLowerCase() : undefined]);
-
- default:
- // eslint-disable-next-line no-console
- console.error(`Unknown source type "${sourceConfig.source}"`);
- }
-}
-/**
- * Given a block's raw content and an attribute's schema returns the attribute's
- * value depending on its source.
- *
- * @param {string} innerHTML Block's raw content.
- * @param {Object} attributeSchema Attribute's schema.
- *
- * @return {*} Attribute value.
- */
-
-function parseWithAttributeSchema(innerHTML, attributeSchema) {
- return parse(innerHTML, matcherFromSource(attributeSchema));
-}
-/**
- * Returns the block attributes of a registered block node given its type.
- *
- * @param {string|Object} blockTypeOrName Block type or name.
- * @param {string} innerHTML Raw block content.
- * @param {?Object} attributes Known block attributes (from delimiters).
- *
- * @return {Object} All block attributes.
- */
-
-function getBlockAttributes(blockTypeOrName, innerHTML) {
- let attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- const blockType = normalizeBlockType(blockTypeOrName);
- const blockAttributes = Object(external_lodash_["mapValues"])(blockType.attributes, (attributeSchema, attributeKey) => {
- return getBlockAttribute(attributeKey, attributeSchema, innerHTML, attributes);
- });
- return Object(external_wp_hooks_["applyFilters"])('blocks.getBlockAttributes', blockAttributes, blockType, innerHTML, attributes);
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/parser/fix-custom-classname.js
-/**
- * External dependencies
- */
-
-/**
- * Internal dependencies
- */
-
-
-
-
-/**
- * Given an HTML string, returns an array of class names assigned to the root
- * element in the markup.
- *
- * @param {string} innerHTML Markup string from which to extract classes.
- *
- * @return {string[]} Array of class names assigned to the root element.
- */
-
-function getHTMLRootElementClasses(innerHTML) {
- innerHTML = `<div data-custom-class-name>${innerHTML}</div>`;
- const parsed = parseWithAttributeSchema(innerHTML, {
- type: 'string',
- source: 'attribute',
- selector: '[data-custom-class-name] > *',
- attribute: 'class'
- });
- return parsed ? parsed.trim().split(/\s+/) : [];
-}
-/**
- * Given a parsed set of block attributes, if the block supports custom class
- * names and an unknown class (per the block's serialization behavior) is
- * found, the unknown classes are treated as custom classes. This prevents the
- * block from being considered as invalid.
- *
- * @param {Object} blockAttributes Original block attributes.
- * @param {Object} blockType Block type settings.
- * @param {string} innerHTML Original block markup.
- *
- * @return {Object} Filtered block attributes.
- */
-
-function fixCustomClassname(blockAttributes, blockType, innerHTML) {
- if (registration_hasBlockSupport(blockType, 'customClassName', true)) {
- // To determine difference, serialize block given the known set of
- // attributes, with the exception of `className`. This will determine
- // the default set of classes. From there, any difference in innerHTML
- // can be considered as custom classes.
- const attributesSansClassName = Object(external_lodash_["omit"])(blockAttributes, ['className']);
- const serialized = getSaveContent(blockType, attributesSansClassName);
- const defaultClasses = getHTMLRootElementClasses(serialized);
- const actualClasses = getHTMLRootElementClasses(innerHTML);
- const customClasses = Object(external_lodash_["difference"])(actualClasses, defaultClasses);
-
- if (customClasses.length) {
- blockAttributes.className = customClasses.join(' ');
- } else if (serialized) {
- delete blockAttributes.className;
- }
- }
-
- return blockAttributes;
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/parser/apply-built-in-validation-fixes.js
-/**
- * Internal dependencies
- */
-
-/**
- * Attempts to fix block invalidation by applying build-in validation fixes
- * like moving all extra classNames to the className attribute.
- *
- * @param {WPBlock} block block object.
- * @param {import('../registration').WPBlockType} blockType Block type. This is normalize not necessary and
- * can be inferred from the block name,
- * but it's here for performance reasons.
- *
- * @return {WPBlock} Fixed block object
- */
-
-function applyBuiltInValidationFixes(block, blockType) {
- const updatedBlockAttributes = fixCustomClassname(block.attributes, blockType, block.originalContent);
- return { ...block,
- attributes: updatedBlockAttributes
- };
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/parser/apply-block-deprecated-versions.js
-/**
- * External dependencies
- */
-
-/**
- * Internal dependencies
- */
-
-
-
-
-
-/**
- * Given a block object, returns a new copy of the block with any applicable
- * deprecated migrations applied, or the original block if it was both valid
- * and no eligible migrations exist.
- *
- * @param {import(".").WPBlock} block Parsed and invalid block object.
- * @param {import(".").WPRawBlock} rawBlock Raw block object.
- * @param {import('../registration').WPBlockType} blockType Block type. This is normalize not necessary and
- * can be inferred from the block name,
- * but it's here for performance reasons.
- *
- * @return {import(".").WPBlock} Migrated block object.
- */
-
-function applyBlockDeprecatedVersions(block, rawBlock, blockType) {
- const parsedAttributes = rawBlock.attrs;
- const {
- deprecated: deprecatedDefinitions
- } = blockType; // Bail early if there are no registered deprecations to be handled.
-
- if (!deprecatedDefinitions || !deprecatedDefinitions.length) {
- return block;
- } // By design, blocks lack any sort of version tracking. Instead, to process
- // outdated content the system operates a queue out of all the defined
- // attribute shapes and tries each definition until the input produces a
- // valid result. This mechanism seeks to avoid polluting the user-space with
- // machine-specific code. An invalid block is thus a block that could not be
- // matched successfully with any of the registered deprecation definitions.
-
-
- for (let i = 0; i < deprecatedDefinitions.length; i++) {
- // A block can opt into a migration even if the block is valid by
- // defining `isEligible` on its deprecation. If the block is both valid
- // and does not opt to migrate, skip.
- const {
- isEligible = external_lodash_["stubFalse"]
- } = deprecatedDefinitions[i];
-
- if (block.isValid && !isEligible(parsedAttributes, block.innerBlocks)) {
- continue;
- } // Block type properties which could impact either serialization or
- // parsing are not considered in the deprecated block type by default,
- // and must be explicitly provided.
-
-
- const deprecatedBlockType = Object.assign(Object(external_lodash_["omit"])(blockType, DEPRECATED_ENTRY_KEYS), deprecatedDefinitions[i]);
- let migratedBlock = { ...block,
- attributes: getBlockAttributes(deprecatedBlockType, block.originalContent, parsedAttributes)
- }; // Ignore the deprecation if it produces a block which is not valid.
-
- let [isValid] = validateBlock(migratedBlock, deprecatedBlockType); // If the migrated block is not valid intiailly, try the built-in fixes.
-
- if (!isValid) {
- migratedBlock = applyBuiltInValidationFixes(migratedBlock, deprecatedBlockType);
- [isValid] = validateBlock(migratedBlock, deprecatedBlockType);
- } // An invalid block does not imply incorrect HTML but the fact block
- // source information could be lost on reserialization.
-
-
- if (!isValid) {
- continue;
- }
-
- let migratedInnerBlocks = migratedBlock.innerBlocks;
- let migratedAttributes = migratedBlock.attributes; // A block may provide custom behavior to assign new attributes and/or
- // inner blocks.
-
- const {
- migrate
- } = deprecatedBlockType;
-
- if (migrate) {
- [migratedAttributes = parsedAttributes, migratedInnerBlocks = block.innerBlocks] = Object(external_lodash_["castArray"])(migrate(migratedAttributes, block.innerBlocks));
- }
-
- block = { ...block,
- attributes: migratedAttributes,
- innerBlocks: migratedInnerBlocks,
- isValid: true,
- validationIssues: []
- };
- }
-
- return block;
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/parser/index.js
-/**
- * WordPress dependencies
- */
-
-
-/**
- * Internal dependencies
- */
-
-
-
-
-
-
-
-
-
-
-/**
- * The raw structure of a block includes its attributes, inner
- * blocks, and inner HTML. It is important to distinguish inner blocks from
- * the HTML content of the block as only the latter is relevant for block
- * validation and edit operations.
- *
- * @typedef WPRawBlock
- *
- * @property {string=} blockName Block name
- * @property {Object=} attrs Block raw or comment attributes.
- * @property {string} innerHTML HTML content of the block.
- * @property {(string|null)[]} innerContent Content without inner blocks.
- * @property {WPRawBlock[]} innerBlocks Inner Blocks.
- */
-
-/**
- * Fully parsed block object.
- *
- * @typedef WPBlock
- *
- * @property {string} name Block name
- * @property {Object } attributes Block raw or comment attributes.
- * @property {WPBlock[]} innerBlocks Inner Blocks.
- * @property {string} originalContent Original content of the block before validation fixes.
- * @property {boolean} isValid Whether the block is valid.
- * @property {Object[]} validationIssues Validation issues.
- */
-
-/**
- * Convert legacy blocks to their canonical form. This function is used
- * both in the parser level for previous content and to convert such blocks
- * used in Custom Post Types templates.
- *
- * @param {WPRawBlock} rawBlock
- *
- * @return {WPRawBlock} The block's name and attributes, changed accordingly if a match was found
- */
-
-function convertLegacyBlocks(rawBlock) {
- const [correctName, correctedAttributes] = convertLegacyBlockNameAndAttributes(rawBlock.blockName, rawBlock.attrs);
- return { ...rawBlock,
- blockName: correctName,
- attrs: correctedAttributes
- };
-}
-/**
- * Normalize the raw block by applying the fallback block name if none given,
- * sanitize the parsed HTML...
- *
- * @param {WPRawBlock} rawBlock The raw block object.
- *
- * @return {WPRawBlock} The normalized block object.
- */
-
-
-function normalizeRawBlock(rawBlock) {
- const fallbackBlockName = getFreeformContentHandlerName(); // If the grammar parsing don't produce any block name, use the freeform block.
-
- const rawBlockName = rawBlock.blockName || getFreeformContentHandlerName();
- const rawAttributes = rawBlock.attrs || {};
- const rawInnerBlocks = rawBlock.innerBlocks || [];
- let rawInnerHTML = rawBlock.innerHTML.trim(); // Fallback content may be upgraded from classic content expecting implicit
- // automatic paragraphs, so preserve them. Assumes wpautop is idempotent,
- // meaning there are no negative consequences to repeated autop calls.
-
- if (rawBlockName === fallbackBlockName) {
- rawInnerHTML = Object(external_wp_autop_["autop"])(rawInnerHTML).trim();
- }
-
- return { ...rawBlock,
- blockName: rawBlockName,
- attrs: rawAttributes,
- innerHTML: rawInnerHTML,
- innerBlocks: rawInnerBlocks
- };
-}
-/**
- * Uses the "unregistered blockType" to create a block object.
- *
- * @param {WPRawBlock} rawBlock block.
- *
- * @return {WPRawBlock} The unregistered block object.
- */
-
-function createMissingBlockType(rawBlock) {
- const unregisteredFallbackBlock = getUnregisteredTypeHandlerName() || getFreeformContentHandlerName(); // Preserve undelimited content for use by the unregistered type
- // handler. A block node's `innerHTML` isn't enough, as that field only
- // carries the block's own HTML and not its nested blocks.
-
- const originalUndelimitedContent = serializeRawBlock(rawBlock, {
- isCommentDelimited: false
- }); // Preserve full block content for use by the unregistered type
- // handler, block boundaries included.
-
- const originalContent = serializeRawBlock(rawBlock, {
- isCommentDelimited: true
- });
- return {
- blockName: unregisteredFallbackBlock,
- attrs: {
- originalName: rawBlock.blockName,
- originalContent,
- originalUndelimitedContent
- },
- innerHTML: rawBlock.blockName ? originalContent : rawBlock.innerHTML,
- innerBlocks: rawBlock.innerBlocks,
- innerContent: rawBlock.innerContent
- };
-}
-/**
- * Given a raw block returned by grammar parsing, returns a fully parsed block.
- *
- * @param {WPRawBlock} rawBlock The raw block object.
- *
- * @return {WPBlock} Fully parsed block.
- */
-
-
-function parseRawBlock(rawBlock) {
- let normalizedBlock = normalizeRawBlock(rawBlock); // During the lifecycle of the project, we renamed some old blocks
- // and transformed others to new blocks. To avoid breaking existing content,
- // we added this function to properly parse the old content.
-
- normalizedBlock = convertLegacyBlocks(normalizedBlock); // Try finding the type for known block name.
-
- let blockType = registration_getBlockType(normalizedBlock.blockName); // If not blockType is found for the specified name, fallback to the "unregistedBlockType".
-
- if (!blockType) {
- normalizedBlock = createMissingBlockType(normalizedBlock);
- blockType = registration_getBlockType(normalizedBlock.blockName);
- } // If it's an empty freeform block or there's no blockType (no missing block handler)
- // Then, just ignore the block.
- // It might be a good idea to throw a warning here.
- // TODO: I'm unsure about the unregisteredFallbackBlock check,
- // it might ignore some dynamic unregistered third party blocks wrongly.
-
-
- const isFallbackBlock = normalizedBlock.blockName === getFreeformContentHandlerName() || normalizedBlock.blockName === getUnregisteredTypeHandlerName();
-
- if (!blockType || !normalizedBlock.innerHTML && isFallbackBlock) {
- return;
- } // Parse inner blocks recursively.
-
-
- const parsedInnerBlocks = normalizedBlock.innerBlocks.map(parseRawBlock) // See https://github.com/WordPress/gutenberg/pull/17164.
- .filter(innerBlock => !!innerBlock); // Get the fully parsed block.
-
- let parsedBlock = createBlock(normalizedBlock.blockName, getBlockAttributes(blockType, normalizedBlock.innerHTML, normalizedBlock.attrs), parsedInnerBlocks);
- parsedBlock.originalContent = normalizedBlock.innerHTML; // Attempt to validate the block.
-
- let [isValid, validationIssues] = validateBlock(parsedBlock, blockType); // If the block is invalid, attempt some built-in fixes
- // like custom classNames handling.
-
- if (!isValid) {
- parsedBlock = applyBuiltInValidationFixes(parsedBlock, blockType); // Attempt to validate the block once again after the built-in fixes.
-
- [isValid, validationIssues] = validateBlock(parsedBlock, blockType);
- }
-
- parsedBlock.isValid = isValid;
- parsedBlock.validationIssues = validationIssues; // Run the block deprecation and migrations.
- // This is performed on both invalid and valid blocks because
- // migration using the `migrate` functions should run even
- // if the output is deemed valid.
-
- parsedBlock = applyBlockDeprecatedVersions(parsedBlock, normalizedBlock, blockType);
-
- if (validationIssues && validationIssues.length > 0) {
- if (parsedBlock.isValid) {
- /* eslint-disable no-console */
- console.groupCollapsed('Updated Block: %s', blockType.name);
- console.info('Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s', blockType.name, blockType, getSaveContent(blockType, parsedBlock.attributes), parsedBlock.originalContent);
- console.groupEnd();
- /* eslint-enable no-console */
- } else {
- validationIssues.forEach(_ref => {
- let {
- log,
- args
- } = _ref;
- return log(...args);
- });
- }
- }
-
- return parsedBlock;
-}
-/**
- * Utilizes an optimized token-driven parser based on the Gutenberg grammar spec
- * defined through a parsing expression grammar to take advantage of the regular
- * cadence provided by block delimiters -- composed syntactically through HTML
- * comments -- which, given a general HTML document as an input, returns a block
- * list array representation.
- *
- * This is a recursive-descent parser that scans linearly once through the input
- * document. Instead of directly recursing it utilizes a trampoline mechanism to
- * prevent stack overflow. This initial pass is mainly interested in separating
- * and isolating the blocks serialized in the document and manifestly not in the
- * content within the blocks.
- *
- * @see
- * https://developer.wordpress.org/block-editor/packages/packages-block-serialization-default-parser/
- *
- * @param {string} content The post content.
- *
- * @return {Array} Block list.
- */
-
-function parser_parse(content) {
- return Object(external_wp_blockSerializationDefaultParser_["parse"])(content).reduce((accumulator, rawBlock) => {
- const block = parseRawBlock(rawBlock);
-
- if (block) {
- accumulator.push(block);
- }
-
- return accumulator;
- }, []);
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/get-raw-transforms.js
-/**
- * External dependencies
- */
-
-/**
- * Internal dependencies
- */
-
-
-function getRawTransforms() {
- return Object(external_lodash_["filter"])(getBlockTransforms('from'), {
- type: 'raw'
- }).map(transform => {
- return transform.isMatch ? transform : { ...transform,
- isMatch: node => transform.selector && node.matches(transform.selector)
- };
- });
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/html-to-blocks.js
-/**
- * Internal dependencies
- */
-
-
-
-/**
- * Converts HTML directly to blocks. Looks for a matching transform for each
- * top-level tag. The HTML should be filtered to not have any text between
- * top-level tags and formatted in a way that blocks can handle the HTML.
- *
- * @param {string} html HTML to convert.
- *
- * @return {Array} An array of blocks.
- */
-
-function htmlToBlocks(html) {
- const doc = document.implementation.createHTMLDocument('');
- doc.body.innerHTML = html;
- return Array.from(doc.body.children).flatMap(node => {
- const rawTransform = findTransform(getRawTransforms(), _ref => {
- let {
- isMatch
- } = _ref;
- return isMatch(node);
- });
-
- if (!rawTransform) {
- return createBlock( // Should not be hardcoded.
- 'core/html', getBlockAttributes('core/html', node.outerHTML));
- }
-
- const {
- transform,
- blockName
- } = rawTransform;
-
- if (transform) {
- return transform(node);
- }
-
- return createBlock(blockName, getBlockAttributes(blockName, node.outerHTML));
- });
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/normalise-blocks.js
-/**
- * WordPress dependencies
- */
-
-function normaliseBlocks(HTML) {
- const decuDoc = document.implementation.createHTMLDocument('');
- const accuDoc = document.implementation.createHTMLDocument('');
- const decu = decuDoc.body;
- const accu = accuDoc.body;
- decu.innerHTML = HTML;
-
- while (decu.firstChild) {
- const node = decu.firstChild; // Text nodes: wrap in a paragraph, or append to previous.
-
- if (node.nodeType === node.TEXT_NODE) {
- if (Object(external_wp_dom_["isEmpty"])(node)) {
- decu.removeChild(node);
- } else {
- if (!accu.lastChild || accu.lastChild.nodeName !== 'P') {
- accu.appendChild(accuDoc.createElement('P'));
- }
-
- accu.lastChild.appendChild(node);
- } // Element nodes.
-
- } else if (node.nodeType === node.ELEMENT_NODE) {
- // BR nodes: create a new paragraph on double, or append to previous.
- if (node.nodeName === 'BR') {
- if (node.nextSibling && node.nextSibling.nodeName === 'BR') {
- accu.appendChild(accuDoc.createElement('P'));
- decu.removeChild(node.nextSibling);
- } // Don't append to an empty paragraph.
-
-
- if (accu.lastChild && accu.lastChild.nodeName === 'P' && accu.lastChild.hasChildNodes()) {
- accu.lastChild.appendChild(node);
- } else {
- decu.removeChild(node);
- }
- } else if (node.nodeName === 'P') {
- // Only append non-empty paragraph nodes.
- if (Object(external_wp_dom_["isEmpty"])(node)) {
- decu.removeChild(node);
- } else {
- accu.appendChild(node);
- }
- } else if (Object(external_wp_dom_["isPhrasingContent"])(node)) {
- if (!accu.lastChild || accu.lastChild.nodeName !== 'P') {
- accu.appendChild(accuDoc.createElement('P'));
- }
-
- accu.lastChild.appendChild(node);
- } else {
- accu.appendChild(node);
- }
- } else {
- decu.removeChild(node);
- }
- }
-
- return accu.innerHTML;
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/special-comment-converter.js
-/**
- * WordPress dependencies
- */
-
-/**
- * Looks for `<!--nextpage-->` and `<!--more-->` comments, as well as the
- * `<!--more Some text-->` variant and its `<!--noteaser-->` companion,
- * and replaces them with a custom element representing a future block.
- *
- * The custom element is a way to bypass the rest of the `raw-handling`
- * transforms, which would eliminate other kinds of node with which to carry
- * `<!--more-->`'s data: nodes with `data` attributes, empty paragraphs, etc.
- *
- * The custom element is then expected to be recognized by any registered
- * block's `raw` transform.
- *
- * @param {Node} node The node to be processed.
- * @param {Document} doc The document of the node.
- * @return {void}
- */
-
-function specialCommentConverter(node, doc) {
- if (node.nodeType !== node.COMMENT_NODE) {
- return;
- }
-
- if (node.nodeValue === 'nextpage') {
- Object(external_wp_dom_["replace"])(node, createNextpage(doc));
- return;
- }
-
- if (node.nodeValue.indexOf('more') === 0) {
- // Grab any custom text in the comment.
- const customText = node.nodeValue.slice(4).trim();
- /*
- * When a `<!--more-->` comment is found, we need to look for any
- * `<!--noteaser-->` sibling, but it may not be a direct sibling
- * (whitespace typically lies in between)
- */
-
- let sibling = node;
- let noTeaser = false;
-
- while (sibling = sibling.nextSibling) {
- if (sibling.nodeType === sibling.COMMENT_NODE && sibling.nodeValue === 'noteaser') {
- noTeaser = true;
- Object(external_wp_dom_["remove"])(sibling);
- break;
- }
- }
-
- Object(external_wp_dom_["replace"])(node, createMore(customText, noTeaser, doc));
- }
-}
-
-function createMore(customText, noTeaser, doc) {
- const node = doc.createElement('wp-block');
- node.dataset.block = 'core/more';
-
- if (customText) {
- node.dataset.customText = customText;
- }
-
- if (noTeaser) {
- // "Boolean" data attribute
- node.dataset.noTeaser = '';
- }
-
- return node;
-}
-
-function createNextpage(doc) {
- const node = doc.createElement('wp-block');
- node.dataset.block = 'core/nextpage';
- return node;
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/comment-remover.js
-/**
- * WordPress dependencies
- */
-
-/**
- * Looks for comments, and removes them.
- *
- * @param {Node} node The node to be processed.
- * @return {void}
- */
-
-function commentRemover(node) {
- if (node.nodeType === node.COMMENT_NODE) {
- Object(external_wp_dom_["remove"])(node);
- }
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/is-inline-content.js
-/**
- * External dependencies
- */
-
-/**
- * WordPress dependencies
- */
-
-
-/**
- * Checks if the given node should be considered inline content, optionally
- * depending on a context tag.
- *
- * @param {Node} node Node name.
- * @param {string} contextTag Tag name.
- *
- * @return {boolean} True if the node is inline content, false if nohe.
- */
-
-function isInline(node, contextTag) {
- if (Object(external_wp_dom_["isTextContent"])(node)) {
- return true;
- }
-
- if (!contextTag) {
- return false;
- }
-
- const tag = node.nodeName.toLowerCase();
- const inlineAllowedTagGroups = [['ul', 'li', 'ol'], ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']];
- return inlineAllowedTagGroups.some(tagGroup => Object(external_lodash_["difference"])([tag, contextTag], tagGroup).length === 0);
-}
-
-function deepCheck(nodes, contextTag) {
- return nodes.every(node => isInline(node, contextTag) && deepCheck(Array.from(node.children), contextTag));
-}
-
-function isDoubleBR(node) {
- return node.nodeName === 'BR' && node.previousSibling && node.previousSibling.nodeName === 'BR';
-}
-
-function isInlineContent(HTML, contextTag) {
- const doc = document.implementation.createHTMLDocument('');
- doc.body.innerHTML = HTML;
- const nodes = Array.from(doc.body.children);
- return !nodes.some(isDoubleBR) && deepCheck(nodes, contextTag);
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/phrasing-content-reducer.js
-/**
- * External dependencies
- */
-
-/**
- * WordPress dependencies
- */
-
-
-function phrasingContentReducer(node, doc) {
- // In jsdom-jscore, 'node.style' can be null.
- // TODO: Explore fixing this by patching jsdom-jscore.
- if (node.nodeName === 'SPAN' && node.style) {
- const {
- fontWeight,
- fontStyle,
- textDecorationLine,
- textDecoration,
- verticalAlign
- } = node.style;
-
- if (fontWeight === 'bold' || fontWeight === '700') {
- Object(external_wp_dom_["wrap"])(doc.createElement('strong'), node);
- }
-
- if (fontStyle === 'italic') {
- Object(external_wp_dom_["wrap"])(doc.createElement('em'), node);
- } // Some DOM implementations (Safari, JSDom) don't support
- // style.textDecorationLine, so we check style.textDecoration as a
- // fallback.
-
-
- if (textDecorationLine === 'line-through' || Object(external_lodash_["includes"])(textDecoration, 'line-through')) {
- Object(external_wp_dom_["wrap"])(doc.createElement('s'), node);
- }
-
- if (verticalAlign === 'super') {
- Object(external_wp_dom_["wrap"])(doc.createElement('sup'), node);
- } else if (verticalAlign === 'sub') {
- Object(external_wp_dom_["wrap"])(doc.createElement('sub'), node);
- }
- } else if (node.nodeName === 'B') {
- node = Object(external_wp_dom_["replaceTag"])(node, 'strong');
- } else if (node.nodeName === 'I') {
- node = Object(external_wp_dom_["replaceTag"])(node, 'em');
- } else if (node.nodeName === 'A') {
- // In jsdom-jscore, 'node.target' can be null.
- // TODO: Explore fixing this by patching jsdom-jscore.
- if (node.target && node.target.toLowerCase() === '_blank') {
- node.rel = 'noreferrer noopener';
- } else {
- node.removeAttribute('target');
- node.removeAttribute('rel');
- } // Saves anchor elements name attribute as id
-
-
- if (node.name && !node.id) {
- node.id = node.name;
- } // Keeps id only if there is an internal link pointing to it
-
-
- if (node.id && !node.ownerDocument.querySelector(`[href="#${node.id}"]`)) {
- node.removeAttribute('id');
- }
- }
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/head-remover.js
-function headRemover(node) {
- if (node.nodeName !== 'SCRIPT' && node.nodeName !== 'NOSCRIPT' && node.nodeName !== 'TEMPLATE' && node.nodeName !== 'STYLE') {
- return;
- }
-
- node.parentNode.removeChild(node);
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/ms-list-converter.js
-/**
- * Browser dependencies
- */
-const {
- parseInt: ms_list_converter_parseInt
-} = window;
-
-function isList(node) {
- return node.nodeName === 'OL' || node.nodeName === 'UL';
-}
-
-function msListConverter(node, doc) {
- if (node.nodeName !== 'P') {
- return;
- }
-
- const style = node.getAttribute('style');
-
- if (!style) {
- return;
- } // Quick check.
-
-
- if (style.indexOf('mso-list') === -1) {
- return;
- }
-
- const matches = /mso-list\s*:[^;]+level([0-9]+)/i.exec(style);
-
- if (!matches) {
- return;
- }
-
- let level = ms_list_converter_parseInt(matches[1], 10) - 1 || 0;
- const prevNode = node.previousElementSibling; // Add new list if no previous.
-
- if (!prevNode || !isList(prevNode)) {
- // See https://html.spec.whatwg.org/multipage/grouping-content.html#attr-ol-type.
- const type = node.textContent.trim().slice(0, 1);
- const isNumeric = /[1iIaA]/.test(type);
- const newListNode = doc.createElement(isNumeric ? 'ol' : 'ul');
-
- if (isNumeric) {
- newListNode.setAttribute('type', type);
- }
-
- node.parentNode.insertBefore(newListNode, node);
- }
-
- const listNode = node.previousElementSibling;
- const listType = listNode.nodeName;
- const listItem = doc.createElement('li');
- let receivingNode = listNode; // Remove the first span with list info.
-
- node.removeChild(node.firstElementChild); // Add content.
-
- while (node.firstChild) {
- listItem.appendChild(node.firstChild);
- } // Change pointer depending on indentation level.
-
-
- while (level--) {
- receivingNode = receivingNode.lastElementChild || receivingNode; // If it's a list, move pointer to the last item.
-
- if (isList(receivingNode)) {
- receivingNode = receivingNode.lastElementChild || receivingNode;
- }
- } // Make sure we append to a list.
-
-
- if (!isList(receivingNode)) {
- receivingNode = receivingNode.appendChild(doc.createElement(listType));
- } // Append the list item to the list.
-
-
- receivingNode.appendChild(listItem); // Remove the wrapper paragraph.
-
- node.parentNode.removeChild(node);
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/list-reducer.js
-/**
- * WordPress dependencies
- */
-
-
-function list_reducer_isList(node) {
- return node.nodeName === 'OL' || node.nodeName === 'UL';
-}
-
-function shallowTextContent(element) {
- return Array.from(element.childNodes).map(_ref => {
- let {
- nodeValue = ''
- } = _ref;
- return nodeValue;
- }).join('');
-}
-
-function listReducer(node) {
- if (!list_reducer_isList(node)) {
- return;
- }
-
- const list = node;
- const prevElement = node.previousElementSibling; // Merge with previous list if:
- // * There is a previous list of the same type.
- // * There is only one list item.
-
- if (prevElement && prevElement.nodeName === node.nodeName && list.children.length === 1) {
- // Move all child nodes, including any text nodes, if any.
- while (list.firstChild) {
- prevElement.appendChild(list.firstChild);
- }
-
- list.parentNode.removeChild(list);
- }
-
- const parentElement = node.parentNode; // Nested list with empty parent item.
-
- if (parentElement && parentElement.nodeName === 'LI' && parentElement.children.length === 1 && !/\S/.test(shallowTextContent(parentElement))) {
- const parentListItem = parentElement;
- const prevListItem = parentListItem.previousElementSibling;
- const parentList = parentListItem.parentNode;
-
- if (prevListItem) {
- prevListItem.appendChild(list);
- parentList.removeChild(parentListItem);
- } else {
- parentList.parentNode.insertBefore(list, parentList);
- parentList.parentNode.removeChild(parentList);
- }
- } // Invalid: OL/UL > OL/UL.
-
-
- if (parentElement && list_reducer_isList(parentElement)) {
- const prevListItem = node.previousElementSibling;
-
- if (prevListItem) {
- prevListItem.appendChild(node);
- } else {
- Object(external_wp_dom_["unwrap"])(node);
- }
- }
-}
-
-// EXTERNAL MODULE: external ["wp","blob"]
-var external_wp_blob_ = __webpack_require__("xTGt");
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/image-corrector.js
-/**
- * WordPress dependencies
- */
-
-/**
- * Browser dependencies
- */
-
-const {
- atob,
- File
-} = window;
-function imageCorrector(node) {
- if (node.nodeName !== 'IMG') {
- return;
- }
-
- if (node.src.indexOf('file:') === 0) {
- node.src = '';
- } // This piece cannot be tested outside a browser env.
-
-
- if (node.src.indexOf('data:') === 0) {
- const [properties, data] = node.src.split(',');
- const [type] = properties.slice(5).split(';');
-
- if (!data || !type) {
- node.src = '';
- return;
- }
-
- let decoded; // Can throw DOMException!
-
- try {
- decoded = atob(data);
- } catch (e) {
- node.src = '';
- return;
- }
-
- const uint8Array = new Uint8Array(decoded.length);
-
- for (let i = 0; i < uint8Array.length; i++) {
- uint8Array[i] = decoded.charCodeAt(i);
- }
-
- const name = type.replace('/', '.');
- const file = new File([uint8Array], name, {
- type
- });
- node.src = Object(external_wp_blob_["createBlobURL"])(file);
- } // Remove trackers and hardly visible images.
-
-
- if (node.height === 1 || node.width === 1) {
- node.parentNode.removeChild(node);
- }
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/blockquote-normaliser.js
-/**
- * Internal dependencies
- */
-
-function blockquoteNormaliser(node) {
- if (node.nodeName !== 'BLOCKQUOTE') {
- return;
- }
-
- node.innerHTML = normaliseBlocks(node.innerHTML);
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/figure-content-reducer.js
-/**
- * External dependencies
- */
-
-/**
- * WordPress dependencies
- */
-
-
-/**
- * Whether or not the given node is figure content.
- *
- * @param {Node} node The node to check.
- * @param {Object} schema The schema to use.
- *
- * @return {boolean} True if figure content, false if not.
- */
-
-function isFigureContent(node, schema) {
- const tag = node.nodeName.toLowerCase(); // We are looking for tags that can be a child of the figure tag, excluding
- // `figcaption` and any phrasing content.
-
- if (tag === 'figcaption' || Object(external_wp_dom_["isTextContent"])(node)) {
- return false;
- }
-
- return Object(external_lodash_["has"])(schema, ['figure', 'children', tag]);
-}
-/**
- * Whether or not the given node can have an anchor.
- *
- * @param {Node} node The node to check.
- * @param {Object} schema The schema to use.
- *
- * @return {boolean} True if it can, false if not.
- */
-
-
-function canHaveAnchor(node, schema) {
- const tag = node.nodeName.toLowerCase();
- return Object(external_lodash_["has"])(schema, ['figure', 'children', 'a', 'children', tag]);
-}
-/**
- * Wraps the given element in a figure element.
- *
- * @param {Element} element The element to wrap.
- * @param {Element} beforeElement The element before which to place the figure.
- */
-
-
-function wrapFigureContent(element) {
- let beforeElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : element;
- const figure = element.ownerDocument.createElement('figure');
- beforeElement.parentNode.insertBefore(figure, beforeElement);
- figure.appendChild(element);
-}
-/**
- * This filter takes figure content out of paragraphs, wraps it in a figure
- * element, and moves any anchors with it if needed.
- *
- * @param {Node} node The node to filter.
- * @param {Document} doc The document of the node.
- * @param {Object} schema The schema to use.
- *
- * @return {void}
- */
-
-
-function figureContentReducer(node, doc, schema) {
- if (!isFigureContent(node, schema)) {
- return;
- }
-
- let nodeToInsert = node;
- const parentNode = node.parentNode; // If the figure content can have an anchor and its parent is an anchor with
- // only the figure content, take the anchor out instead of just the content.
-
- if (canHaveAnchor(node, schema) && parentNode.nodeName === 'A' && parentNode.childNodes.length === 1) {
- nodeToInsert = node.parentNode;
- }
-
- const wrapper = nodeToInsert.closest('p,div'); // If wrapped in a paragraph or div, only extract if it's aligned or if
- // there is no text content.
- // Otherwise, if directly at the root, wrap in a figure element.
-
- if (wrapper) {
- // In jsdom-jscore, 'node.classList' can be undefined.
- // In this case, default to extract as it offers a better UI experience on mobile.
- if (!node.classList) {
- wrapFigureContent(nodeToInsert, wrapper);
- } else if (node.classList.contains('alignright') || node.classList.contains('alignleft') || node.classList.contains('aligncenter') || !wrapper.textContent.trim()) {
- wrapFigureContent(nodeToInsert, wrapper);
- }
- } else if (nodeToInsert.parentNode.nodeName === 'BODY') {
- wrapFigureContent(nodeToInsert);
- }
-}
-
-// EXTERNAL MODULE: external ["wp","shortcode"]
-var external_wp_shortcode_ = __webpack_require__("SVSp");
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/shortcode-converter.js
-/**
- * External dependencies
- */
-
-/**
- * WordPress dependencies
- */
-
-
-/**
- * Internal dependencies
- */
-
-
-
-
-
-
-function segmentHTMLToShortcodeBlock(HTML) {
- let lastIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- let excludedBlockNames = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
- // Get all matches.
- const transformsFrom = getBlockTransforms('from');
- const transformation = findTransform(transformsFrom, transform => excludedBlockNames.indexOf(transform.blockName) === -1 && transform.type === 'shortcode' && Object(external_lodash_["some"])(Object(external_lodash_["castArray"])(transform.tag), tag => Object(external_wp_shortcode_["regexp"])(tag).test(HTML)));
-
- if (!transformation) {
- return [HTML];
- }
-
- const transformTags = Object(external_lodash_["castArray"])(transformation.tag);
- const transformTag = Object(external_lodash_["find"])(transformTags, tag => Object(external_wp_shortcode_["regexp"])(tag).test(HTML));
- let match;
- const previousIndex = lastIndex;
-
- if (match = Object(external_wp_shortcode_["next"])(transformTag, HTML, lastIndex)) {
- lastIndex = match.index + match.content.length;
- const beforeHTML = HTML.substr(0, match.index);
- const afterHTML = HTML.substr(lastIndex); // If the shortcode content does not contain HTML and the shortcode is
- // not on a new line (or in paragraph from Markdown converter),
- // consider the shortcode as inline text, and thus skip conversion for
- // this segment.
-
- if (!Object(external_lodash_["includes"])(match.shortcode.content || '', '<') && !(/(\n|<p>)\s*$/.test(beforeHTML) && /^\s*(\n|<\/p>)/.test(afterHTML))) {
- return segmentHTMLToShortcodeBlock(HTML, lastIndex);
- } // If a transformation's `isMatch` predicate fails for the inbound
- // shortcode, try again by excluding the current block type.
- //
- // This is the only call to `segmentHTMLToShortcodeBlock` that should
- // ever carry over `excludedBlockNames`. Other calls in the module
- // should skip that argument as a way to reset the exclusion state, so
- // that one `isMatch` fail in an HTML fragment doesn't prevent any
- // valid matches in subsequent fragments.
-
-
- if (transformation.isMatch && !transformation.isMatch(match.shortcode.attrs)) {
- return segmentHTMLToShortcodeBlock(HTML, previousIndex, [...excludedBlockNames, transformation.blockName]);
- }
-
- const attributes = Object(external_lodash_["mapValues"])(Object(external_lodash_["pickBy"])(transformation.attributes, schema => schema.shortcode), // Passing all of `match` as second argument is intentionally broad
- // but shouldn't be too relied upon.
- //
- // See: https://github.com/WordPress/gutenberg/pull/3610#discussion_r152546926
- schema => schema.shortcode(match.shortcode.attrs, match));
- const transformationBlockType = { ...registration_getBlockType(transformation.blockName),
- attributes: transformation.attributes
- };
- let block = createBlock(transformation.blockName, getBlockAttributes(transformationBlockType, match.shortcode.content, attributes));
- block.originalContent = match.shortcode.content; // Applying the built-in fixes can enhance the attributes with missing content like "className".
-
- block = applyBuiltInValidationFixes(block, transformationBlockType);
- return [...segmentHTMLToShortcodeBlock(beforeHTML), block, ...segmentHTMLToShortcodeBlock(afterHTML)];
- }
-
- return [HTML];
-}
-
-/* harmony default export */ var shortcode_converter = (segmentHTMLToShortcodeBlock);
-
-// EXTERNAL MODULE: ./node_modules/showdown/dist/showdown.js
-var showdown = __webpack_require__("M55E");
-var showdown_default = /*#__PURE__*/__webpack_require__.n(showdown);
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/markdown-converter.js
-/**
- * External dependencies
- */
- // Reuse the same showdown converter.
-
-const converter = new showdown_default.a.Converter({
- noHeaderId: true,
- tables: true,
- literalMidWordUnderscores: true,
- omitExtraWLInCodeBlocks: true,
- simpleLineBreaks: true,
- strikethrough: true
-});
-/**
- * Corrects the Slack Markdown variant of the code block.
- * If uncorrected, it will be converted to inline code.
- *
- * @see https://get.slack.help/hc/en-us/articles/202288908-how-can-i-add-formatting-to-my-messages-#code-blocks
- *
- * @param {string} text The potential Markdown text to correct.
- *
- * @return {string} The corrected Markdown.
- */
-
-function slackMarkdownVariantCorrector(text) {
- return text.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/, (match, p1, p2, p3) => `${p1}\n${p2}\n${p3}`);
-}
-/**
- * Converts a piece of text into HTML based on any Markdown present.
- * Also decodes any encoded HTML.
- *
- * @param {string} text The plain text to convert.
- *
- * @return {string} HTML.
- */
-
-
-function markdownConverter(text) {
- return converter.makeHtml(slackMarkdownVariantCorrector(text));
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/iframe-remover.js
-/**
- * Removes iframes.
- *
- * @param {Node} node The node to check.
- *
- * @return {void}
- */
-function iframeRemover(node) {
- if (node.nodeName === 'IFRAME') {
- const text = node.ownerDocument.createTextNode(node.src);
- node.parentNode.replaceChild(text, node);
- }
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/google-docs-uid-remover.js
-/**
- * WordPress dependencies
- */
-
-function googleDocsUIdRemover(node) {
- if (!node.id || node.id.indexOf('docs-internal-guid-') !== 0) {
- return;
- }
-
- Object(external_wp_dom_["unwrap"])(node);
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/utils.js
-/**
- * External dependencies
- */
-
-/**
- * WordPress dependencies
- */
-
-
-/**
- * Internal dependencies
- */
-
-
-
-function getBlockContentSchemaFromTransforms(transforms, context) {
- const phrasingContentSchema = Object(external_wp_dom_["getPhrasingContentSchema"])(context);
- const schemaArgs = {
- phrasingContentSchema,
- isPaste: context === 'paste'
- };
- const schemas = transforms.map(_ref => {
- let {
- isMatch,
- blockName,
- schema
- } = _ref;
- const hasAnchorSupport = registration_hasBlockSupport(blockName, 'anchor');
- schema = Object(external_lodash_["isFunction"])(schema) ? schema(schemaArgs) : schema; // If the block does not has anchor support and the transform does not
- // provides an isMatch we can return the schema right away.
-
- if (!hasAnchorSupport && !isMatch) {
- return schema;
- }
-
- return Object(external_lodash_["mapValues"])(schema, value => {
- let attributes = value.attributes || []; // If the block supports the "anchor" functionality, it needs to keep its ID attribute.
-
- if (hasAnchorSupport) {
- attributes = [...attributes, 'id'];
- }
-
- return { ...value,
- attributes,
- isMatch: isMatch ? isMatch : undefined
- };
- });
- });
- return Object(external_lodash_["mergeWith"])({}, ...schemas, (objValue, srcValue, key) => {
- switch (key) {
- case 'children':
- {
- if (objValue === '*' || srcValue === '*') {
- return '*';
- }
-
- return { ...objValue,
- ...srcValue
- };
- }
-
- case 'attributes':
- case 'require':
- {
- return [...(objValue || []), ...(srcValue || [])];
- }
-
- case 'isMatch':
- {
- // If one of the values being merge is undefined (matches everything),
- // the result of the merge will be undefined.
- if (!objValue || !srcValue) {
- return undefined;
- } // When merging two isMatch functions, the result is a new function
- // that returns if one of the source functions returns true.
-
-
- return function () {
- return objValue(...arguments) || srcValue(...arguments);
- };
- }
- }
- });
-}
-/**
- * Gets the block content schema, which is extracted and merged from all
- * registered blocks with raw transfroms.
- *
- * @param {string} context Set to "paste" when in paste context, where the
- * schema is more strict.
- *
- * @return {Object} A complete block content schema.
- */
-
-function getBlockContentSchema(context) {
- return getBlockContentSchemaFromTransforms(getRawTransforms(), context);
-}
-/**
- * Checks whether HTML can be considered plain text. That is, it does not contain
- * any elements that are not line breaks.
- *
- * @param {string} HTML The HTML to check.
- *
- * @return {boolean} Whether the HTML can be considered plain text.
- */
-
-function isPlain(HTML) {
- return !/<(?!br[ />])/i.test(HTML);
-}
-/**
- * Given node filters, deeply filters and mutates a NodeList.
- *
- * @param {NodeList} nodeList The nodeList to filter.
- * @param {Array} filters An array of functions that can mutate with the provided node.
- * @param {Document} doc The document of the nodeList.
- * @param {Object} schema The schema to use.
- */
-
-function deepFilterNodeList(nodeList, filters, doc, schema) {
- Array.from(nodeList).forEach(node => {
- deepFilterNodeList(node.childNodes, filters, doc, schema);
- filters.forEach(item => {
- // Make sure the node is still attached to the document.
- if (!doc.contains(node)) {
- return;
- }
-
- item(node, doc, schema);
- });
- });
-}
-/**
- * Given node filters, deeply filters HTML tags.
- * Filters from the deepest nodes to the top.
- *
- * @param {string} HTML The HTML to filter.
- * @param {Array} filters An array of functions that can mutate with the provided node.
- * @param {Object} schema The schema to use.
- *
- * @return {string} The filtered HTML.
- */
-
-function deepFilterHTML(HTML) {
- let filters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- let schema = arguments.length > 2 ? arguments[2] : undefined;
- const doc = document.implementation.createHTMLDocument('');
- doc.body.innerHTML = HTML;
- deepFilterNodeList(doc.body.childNodes, filters, doc, schema);
- return doc.body.innerHTML;
-}
-/**
- * Gets a sibling within text-level context.
- *
- * @param {Element} node The subject node.
- * @param {string} which "next" or "previous".
- */
-
-function getSibling(node, which) {
- const sibling = node[`${which}Sibling`];
-
- if (sibling && Object(external_wp_dom_["isPhrasingContent"])(sibling)) {
- return sibling;
- }
-
- const {
- parentNode
- } = node;
-
- if (!parentNode || !Object(external_wp_dom_["isPhrasingContent"])(parentNode)) {
- return;
- }
-
- return getSibling(parentNode, which);
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/html-formatting-remover.js
-/**
- * Internal dependencies
- */
-
-
-function isFormattingSpace(character) {
- return character === ' ' || character === '\r' || character === '\n' || character === '\t';
-}
-/**
- * Removes spacing that formats HTML.
- *
- * @see https://www.w3.org/TR/css-text-3/#white-space-processing
- *
- * @param {Node} node The node to be processed.
- * @return {void}
- */
-
-
-function htmlFormattingRemover(node) {
- if (node.nodeType !== node.TEXT_NODE) {
- return;
- } // Ignore pre content. Note that this does not use Element#closest due to
- // a combination of (a) node may not be Element and (b) node.parentElement
- // does not have full support in all browsers (Internet Exporer).
- //
- // See: https://developer.mozilla.org/en-US/docs/Web/API/Node/parentElement#Browser_compatibility
-
- /** @type {Node?} */
-
-
- let parent = node;
-
- while (parent = parent.parentNode) {
- if (parent.nodeType === parent.ELEMENT_NODE && parent.nodeName === 'PRE') {
- return;
- }
- } // First, replace any sequence of HTML formatting space with a single space.
-
-
- let newData = node.data.replace(/[ \r\n\t]+/g, ' '); // Remove the leading space if the text element is at the start of a block,
- // is preceded by a line break element, or has a space in the previous
- // node.
-
- if (newData[0] === ' ') {
- const previousSibling = getSibling(node, 'previous');
-
- if (!previousSibling || previousSibling.nodeName === 'BR' || previousSibling.textContent.slice(-1) === ' ') {
- newData = newData.slice(1);
- }
- } // Remove the trailing space if the text element is at the end of a block,
- // is succeded by a line break element, or has a space in the next text
- // node.
-
-
- if (newData[newData.length - 1] === ' ') {
- const nextSibling = getSibling(node, 'next');
-
- if (!nextSibling || nextSibling.nodeName === 'BR' || nextSibling.nodeType === nextSibling.TEXT_NODE && isFormattingSpace(nextSibling.textContent[0])) {
- newData = newData.slice(0, -1);
- }
- } // If there's no data left, remove the node, so `previousSibling` stays
- // accurate. Otherwise, update the node data.
-
-
- if (!newData) {
- node.parentNode.removeChild(node);
- } else {
- node.data = newData;
- }
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/br-remover.js
-/**
- * Internal dependencies
- */
-
-/**
- * Removes trailing br elements from text-level content.
- *
- * @param {Element} node Node to check.
- */
-
-function brRemover(node) {
- if (node.nodeName !== 'BR') {
- return;
- }
-
- if (getSibling(node, 'next')) {
- return;
- }
-
- node.parentNode.removeChild(node);
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/empty-paragraph-remover.js
-/**
- * Removes empty paragraph elements.
- *
- * @param {Element} node Node to check.
- */
-function emptyParagraphRemover(node) {
- if (node.nodeName !== 'P') {
- return;
- }
-
- if (node.hasChildNodes()) {
- return;
- }
-
- node.parentNode.removeChild(node);
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/paste-handler.js
-/**
- * External dependencies
- */
-
-/**
- * WordPress dependencies
- */
-
-
-/**
- * Internal dependencies
- */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/**
- * Browser dependencies
- */
-
-const {
- console: paste_handler_console
-} = window;
-/**
- * Filters HTML to only contain phrasing content.
- *
- * @param {string} HTML The HTML to filter.
- * @param {boolean} preserveWhiteSpace Whether or not to preserve consequent white space.
- *
- * @return {string} HTML only containing phrasing content.
- */
-
-function filterInlineHTML(HTML, preserveWhiteSpace) {
- HTML = deepFilterHTML(HTML, [googleDocsUIdRemover, phrasingContentReducer, commentRemover]);
- HTML = Object(external_wp_dom_["removeInvalidHTML"])(HTML, Object(external_wp_dom_["getPhrasingContentSchema"])('paste'), {
- inline: true
- });
-
- if (!preserveWhiteSpace) {
- HTML = deepFilterHTML(HTML, [htmlFormattingRemover, brRemover]);
- } // Allows us to ask for this information when we get a report.
-
-
- paste_handler_console.log('Processed inline HTML:\n\n', HTML);
- return HTML;
-}
-/**
- * Converts an HTML string to known blocks. Strips everything else.
- *
- * @param {Object} options
- * @param {string} [options.HTML] The HTML to convert.
- * @param {string} [options.plainText] Plain text version.
- * @param {string} [options.mode] Handle content as blocks or inline content.
- * * 'AUTO': Decide based on the content passed.
- * * 'INLINE': Always handle as inline content, and return string.
- * * 'BLOCKS': Always handle as blocks, and return array of blocks.
- * @param {Array} [options.tagName] The tag into which content will be inserted.
- * @param {boolean} [options.preserveWhiteSpace] Whether or not to preserve consequent white space.
- *
- * @return {Array|string} A list of blocks or a string, depending on `handlerMode`.
- */
-
-
-function pasteHandler(_ref) {
- let {
- HTML = '',
- plainText = '',
- mode = 'AUTO',
- tagName,
- preserveWhiteSpace
- } = _ref;
- // First of all, strip any meta tags.
- HTML = HTML.replace(/<meta[^>]+>/g, ''); // Strip Windows markers.
-
- HTML = HTML.replace(/^\s*<html[^>]*>\s*<body[^>]*>(?:\s*<!--\s*StartFragment\s*-->)?/i, '');
- HTML = HTML.replace(/(?:<!--\s*EndFragment\s*-->\s*)?<\/body>\s*<\/html>\s*$/i, ''); // If we detect block delimiters in HTML, parse entirely as blocks.
-
- if (mode !== 'INLINE') {
- // Check plain text if there is no HTML.
- const content = HTML ? HTML : plainText;
-
- if (content.indexOf('<!-- wp:') !== -1) {
- return parser_parse(content);
- }
- } // Normalize unicode to use composed characters.
- // This is unsupported in IE 11 but it's a nice-to-have feature, not mandatory.
- // Not normalizing the content will only affect older browsers and won't
- // entirely break the app.
- // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize
- // See: https://core.trac.wordpress.org/ticket/30130
- // See: https://github.com/WordPress/gutenberg/pull/6983#pullrequestreview-125151075
-
-
- if (String.prototype.normalize) {
- HTML = HTML.normalize();
- } // Parse Markdown (and encoded HTML) if:
- // * There is a plain text version.
- // * There is no HTML version, or it has no formatting.
-
-
- if (plainText && (!HTML || isPlain(HTML))) {
- HTML = plainText; // The markdown converter (Showdown) trims whitespace.
-
- if (!/^\s+$/.test(plainText)) {
- HTML = markdownConverter(HTML);
- } // Switch to inline mode if:
- // * The current mode is AUTO.
- // * The original plain text had no line breaks.
- // * The original plain text was not an HTML paragraph.
- // * The converted text is just a paragraph.
-
-
- if (mode === 'AUTO' && plainText.indexOf('\n') === -1 && plainText.indexOf('<p>') !== 0 && HTML.indexOf('<p>') === 0) {
- mode = 'INLINE';
- }
- }
-
- if (mode === 'INLINE') {
- return filterInlineHTML(HTML, preserveWhiteSpace);
- } // An array of HTML strings and block objects. The blocks replace matched
- // shortcodes.
-
-
- const pieces = shortcode_converter(HTML); // The call to shortcodeConverter will always return more than one element
- // if shortcodes are matched. The reason is when shortcodes are matched
- // empty HTML strings are included.
-
- const hasShortcodes = pieces.length > 1;
-
- if (mode === 'AUTO' && !hasShortcodes && isInlineContent(HTML, tagName)) {
- return filterInlineHTML(HTML, preserveWhiteSpace);
- }
-
- const phrasingContentSchema = Object(external_wp_dom_["getPhrasingContentSchema"])('paste');
- const blockContentSchema = getBlockContentSchema('paste');
- const blocks = Object(external_lodash_["compact"])(Object(external_lodash_["flatMap"])(pieces, piece => {
- // Already a block from shortcode.
- if (typeof piece !== 'string') {
- return piece;
- }
-
- const filters = [googleDocsUIdRemover, msListConverter, headRemover, listReducer, imageCorrector, phrasingContentReducer, specialCommentConverter, commentRemover, iframeRemover, figureContentReducer, blockquoteNormaliser];
- const schema = { ...blockContentSchema,
- // Keep top-level phrasing content, normalised by `normaliseBlocks`.
- ...phrasingContentSchema
- };
- piece = deepFilterHTML(piece, filters, blockContentSchema);
- piece = Object(external_wp_dom_["removeInvalidHTML"])(piece, schema);
- piece = normaliseBlocks(piece);
- piece = deepFilterHTML(piece, [htmlFormattingRemover, brRemover, emptyParagraphRemover], blockContentSchema); // Allows us to ask for this information when we get a report.
-
- paste_handler_console.log('Processed HTML piece:\n\n', piece);
- return htmlToBlocks(piece);
- })); // If we're allowed to return inline content, and there is only one
- // inlineable block, and the original plain text content does not have any
- // line breaks, then treat it as inline paste.
-
- if (mode === 'AUTO' && blocks.length === 1 && registration_hasBlockSupport(blocks[0].name, '__unstablePasteTextInline', false)) {
- // Don't catch line breaks at the start or end.
- const trimmedPlainText = plainText.replace(/^[\n]+|[\n]+$/g, '');
-
- if (trimmedPlainText !== '' && trimmedPlainText.indexOf('\n') === -1) {
- return Object(external_wp_dom_["removeInvalidHTML"])(getBlockInnerHTML(blocks[0]), phrasingContentSchema);
- }
- }
-
- return blocks;
-}
-
-// 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/blocks/build-module/api/raw-handling/index.js
-/**
- * External dependencies
- */
-
-/**
- * WordPress dependencies
- */
-
-
-
-/**
- * Internal dependencies
- */
-
-
-
-
-
-
-
-
-
-
-
-function deprecatedGetPhrasingContentSchema(context) {
- external_wp_deprecated_default()('wp.blocks.getPhrasingContentSchema', {
- since: '5.6',
- alternative: 'wp.dom.getPhrasingContentSchema'
- });
- return Object(external_wp_dom_["getPhrasingContentSchema"])(context);
-}
-/**
- * Converts an HTML string to known blocks.
- *
- * @param {Object} $1
- * @param {string} $1.HTML The HTML to convert.
- *
- * @return {Array} A list of blocks.
- */
-
-function rawHandler(_ref) {
- let {
- HTML = ''
- } = _ref;
-
- // If we detect block delimiters, parse entirely as blocks.
- if (HTML.indexOf('<!-- wp:') !== -1) {
- return parser_parse(HTML);
- } // An array of HTML strings and block objects. The blocks replace matched
- // shortcodes.
-
-
- const pieces = shortcode_converter(HTML);
- const blockContentSchema = getBlockContentSchema();
- return Object(external_lodash_["compact"])(Object(external_lodash_["flatMap"])(pieces, piece => {
- // Already a block from shortcode.
- if (typeof piece !== 'string') {
- return piece;
- } // These filters are essential for some blocks to be able to transform
- // from raw HTML. These filters move around some content or add
- // additional tags, they do not remove any content.
-
-
- const filters = [// Needed to adjust invalid lists.
- listReducer, // Needed to create more and nextpage blocks.
- specialCommentConverter, // Needed to create media blocks.
- figureContentReducer, // Needed to create the quote block, which cannot handle text
- // without wrapper paragraphs.
- blockquoteNormaliser];
- piece = deepFilterHTML(piece, filters, blockContentSchema);
- piece = normaliseBlocks(piece);
- return htmlToBlocks(piece);
- }));
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/categories.js
-/**
- * WordPress dependencies
- */
-
-/**
- * Internal dependencies
- */
-
-
-/** @typedef {import('../store/reducer').WPBlockCategory} WPBlockCategory */
-
-/**
- * Returns all the block categories.
- *
- * @return {WPBlockCategory[]} Block categories.
- */
-
-function categories_getCategories() {
- return Object(external_wp_data_["select"])(store).getCategories();
-}
-/**
- * Sets the block categories.
- *
- * @param {WPBlockCategory[]} categories Block categories.
- */
-
-function categories_setCategories(categories) {
- Object(external_wp_data_["dispatch"])(store).setCategories(categories);
-}
-/**
- * Updates a category.
- *
- * @param {string} slug Block category slug.
- * @param {WPBlockCategory} category Object containing the category properties
- * that should be updated.
- */
-
-function categories_updateCategory(slug, category) {
- Object(external_wp_data_["dispatch"])(store).updateCategory(slug, category);
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/templates.js
-/**
- * External dependencies
- */
-
-/**
- * WordPress dependencies
- */
-
-
-/**
- * Internal dependencies
- */
-
-
-
-
-/**
- * Checks whether a list of blocks matches a template by comparing the block names.
- *
- * @param {Array} blocks Block list.
- * @param {Array} template Block template.
- *
- * @return {boolean} Whether the list of blocks matches a templates.
- */
-
-function doBlocksMatchTemplate() {
- let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- let template = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- return blocks.length === template.length && Object(external_lodash_["every"])(template, (_ref, index) => {
- let [name,, innerBlocksTemplate] = _ref;
- const block = blocks[index];
- return name === block.name && doBlocksMatchTemplate(block.innerBlocks, innerBlocksTemplate);
- });
-}
-/**
- * Synchronize a block list with a block template.
- *
- * Synchronizing a block list with a block template means that we loop over the blocks
- * keep the block as is if it matches the block at the same position in the template
- * (If it has the same name) and if doesn't match, we create a new block based on the template.
- * Extra blocks not present in the template are removed.
- *
- * @param {Array} blocks Block list.
- * @param {Array} template Block template.
- *
- * @return {Array} Updated Block list.
- */
-
-function synchronizeBlocksWithTemplate() {
- let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- let template = arguments.length > 1 ? arguments[1] : undefined;
-
- // If no template is provided, return blocks unmodified.
- if (!template) {
- return blocks;
- }
-
- return Object(external_lodash_["map"])(template, (_ref2, index) => {
- let [name, attributes, innerBlocksTemplate] = _ref2;
- const block = blocks[index];
-
- if (block && block.name === name) {
- const innerBlocks = synchronizeBlocksWithTemplate(block.innerBlocks, innerBlocksTemplate);
- return { ...block,
- innerBlocks
- };
- } // To support old templates that were using the "children" format
- // for the attributes using "html" strings now, we normalize the template attributes
- // before creating the blocks.
-
-
- const blockType = registration_getBlockType(name);
-
- const isHTMLAttribute = attributeDefinition => Object(external_lodash_["get"])(attributeDefinition, ['source']) === 'html';
-
- const isQueryAttribute = attributeDefinition => Object(external_lodash_["get"])(attributeDefinition, ['source']) === 'query';
-
- const normalizeAttributes = (schema, values) => {
- return Object(external_lodash_["mapValues"])(values, (value, key) => {
- return normalizeAttribute(schema[key], value);
- });
- };
-
- const normalizeAttribute = (definition, value) => {
- if (isHTMLAttribute(definition) && Object(external_lodash_["isArray"])(value)) {
- // Introduce a deprecated call at this point
- // When we're confident that "children" format should be removed from the templates.
- return Object(external_wp_element_["renderToString"])(value);
- }
-
- if (isQueryAttribute(definition) && value) {
- return value.map(subValues => {
- return normalizeAttributes(definition.query, subValues);
- });
- }
-
- return value;
- };
-
- const normalizedAttributes = normalizeAttributes(Object(external_lodash_["get"])(blockType, ['attributes'], {}), attributes);
- const [blockName, blockAttributes] = convertLegacyBlockNameAndAttributes(name, normalizedAttributes);
- return createBlock(blockName, blockAttributes, synchronizeBlocksWithTemplate([], innerBlocksTemplate));
- });
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/index.js
-// The blocktype is the most important concept within the block API. It defines
-// all aspects of the block configuration and its interfaces, including `edit`
-// and `save`. The transforms specification allows converting one blocktype to
-// another through formulas defined by either the source or the destination.
-// Switching a blocktype is to be considered a one-way operation implying a
-// transformation in the opposite way has to be handled explicitly.
- // The block tree is composed of a collection of block nodes. Blocks contained
-// within other blocks are called inner blocks. An important design
-// consideration is that inner blocks are -- conceptually -- not part of the
-// territory established by the parent block that contains them.
-//
-// This has multiple practical implications: when parsing, we can safely dispose
-// of any block boundary found within a block from the innerHTML property when
-// transfering to state. Not doing so would have a compounding effect on memory
-// and uncertainty over the source of truth. This can be illustrated in how,
-// given a tree of `n` nested blocks, the entry node would have to contain the
-// actual content of each block while each subsequent block node in the state
-// tree would replicate the entire chain `n-1`, meaning the extreme end node
-// would have been replicated `n` times as the tree is traversed and would
-// generate uncertainty as to which one is to hold the current value of the
-// block. For composition, it also means inner blocks can effectively be child
-// components whose mechanisms can be shielded from the `edit` implementation
-// and just passed along.
-
-
- // While block transformations account for a specific surface of the API, there
-// are also raw transformations which handle arbitrary sources not made out of
-// blocks but producing block basaed on various heursitics. This includes
-// pasting rich text or HTML data.
-
- // The process of serialization aims to deflate the internal memory of the block
-// editor and its state representation back into an HTML valid string. This
-// process restores the document integrity and inserts invisible delimiters
-// around each block with HTML comment boundaries which can contain any extra
-// attributes needed to operate with the block later on.
-
- // Validation is the process of comparing a block source with its output before
-// there is any user input or interaction with a block. When this operation
-// fails -- for whatever reason -- the block is to be considered invalid. As
-// part of validating a block the system will attempt to run the source against
-// any provided deprecation definitions.
-//
-// Worth emphasizing that validation is not a case of whether the markup is
-// merely HTML spec-compliant but about how the editor knows to create such
-// markup and that its inability to create an identical result can be a strong
-// indicator of potential data loss (the invalidation is then a protective
-// measure).
-//
-// The invalidation process can also be deconstructed in phases: 1) validate the
-// block exists; 2) validate the source matches the output; 3) validate the
-// source matches deprecated outputs; 4) work through the significance of
-// differences. These are stacked in a way that favors performance and optimizes
-// for the majority of cases. That is to say, the evaluation logic can become
-// more sophisticated the further down it goes in the process as the cost is
-// accounted for. The first logic checks have to be extremely efficient since
-// they will be run for all valid and invalid blocks alike. However, once a
-// block is detected as invalid -- failing the three first steps -- it is
-// adequate to spend more time determining validity before throwing a conflict.
-
-
- // Blocks are inherently indifferent about where the data they operate with ends
-// up being saved. For example, all blocks can have a static and dynamic aspect
-// to them depending on the needs. The static nature of a block is the `save()`
-// definition that is meant to be serialized into HTML and which can be left
-// void. Any block can also register a `render_callback` on the server, which
-// makes its output dynamic either in part or in its totality.
-//
-// Child blocks are defined as a relationship that builds on top of the inner
-// blocks mechanism. A child block is a block node of a particular type that can
-// only exist within the inner block boundaries of a specific parent type. This
-// allows block authors to compose specific blocks that are not meant to be used
-// outside of a specified parent block context. Thus, child blocks extend the
-// concept of inner blocks to support a more direct relationship between sets of
-// blocks. The addition of parent–child would be a subset of the inner block
-// functionality under the premise that certain blocks only make sense as
-// children of another block.
-
-
- // Templates are, in a general sense, a basic collection of block nodes with any
-// given set of predefined attributes that are supplied as the initial state of
-// an inner blocks group. These nodes can, in turn, contain any number of nested
-// blocks within their definition. Templates allow both to specify a default
-// state for an editor session or a default set of blocks for any inner block
-// implementation within a specific block.
-
-
-
-
-
-
-// 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");
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/block-content-provider/index.js
-
-
-
-/**
- * WordPress dependencies
- */
-
-
-/**
- * Internal dependencies
- */
-
-
-const {
- Consumer,
- Provider
-} = Object(external_wp_element_["createContext"])(() => {});
-/**
- * An internal block component used in block content serialization to inject
- * nested block content within the `save` implementation of the ancestor
- * component in which it is nested. The component provides a pre-bound
- * `BlockContent` component via context, which is used by the developer-facing
- * `InnerBlocks.Content` component to render block content.
- *
- * @example
- *
- * ```jsx
- * <BlockContentProvider innerBlocks={ innerBlocks }>
- * { blockSaveElement }
- * </BlockContentProvider>
- * ```
- *
- * @param {Object} props Component props.
- * @param {WPElement} props.children Block save result.
- * @param {Array} props.innerBlocks Block(s) to serialize.
- *
- * @return {WPComponent} Element with BlockContent injected via context.
- */
-
-const BlockContentProvider = _ref => {
- let {
- children,
- innerBlocks
- } = _ref;
-
- const BlockContent = () => {
- // Value is an array of blocks, so defer to block serializer
- const html = serialize(innerBlocks, {
- isInnerBlocks: true
- }); // Use special-cased raw HTML tag to avoid default escaping
-
- return Object(external_wp_element_["createElement"])(external_wp_element_["RawHTML"], null, html);
- };
-
- return Object(external_wp_element_["createElement"])(Provider, {
- value: BlockContent
- }, children);
-};
-/**
- * A Higher Order Component used to inject BlockContent using context to the
- * wrapped component.
- *
- * @return {WPComponent} Enhanced component with injected BlockContent as prop.
- */
-
-
-const withBlockContentContext = Object(external_wp_compose_["createHigherOrderComponent"])(OriginalComponent => {
- return props => Object(external_wp_element_["createElement"])(Consumer, null, context => Object(external_wp_element_["createElement"])(OriginalComponent, Object(esm_extends["a" /* default */])({}, props, {
- BlockContent: context
- })));
-}, 'withBlockContentContext');
-/* harmony default export */ var block_content_provider = (BlockContentProvider);
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/index.js
-// A "block" is the abstract term used to describe units of markup that,
-// when composed together, form the content or layout of a page.
-// The API for blocks is exposed via `wp.blocks`.
-//
-// Supported blocks are registered by calling `registerBlockType`. Once registered,
-// the block is made available as an option to the editor interface.
-//
-// Blocks are inferred from the HTML source of a post through a parsing mechanism
-// and then stored as objects in state, from which it is then rendered for editing.
-
-
-
-
-
-/***/ }),
-
-/***/ "1CF3":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["dom"]; }());
-
-/***/ }),
-
-/***/ "1ZqX":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["data"]; }());
-
-/***/ }),
-
-/***/ "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);
-
-/***/ }),
-
-/***/ "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}});
-
-
-/***/ }),
-
-/***/ "GRId":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["element"]; }());
-
-/***/ }),
-
-/***/ "K9lf":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["compose"]; }());
-
-/***/ }),
-
-/***/ "M55E":
-/***/ (function(module, exports, __webpack_require__) {
-
-var __WEBPACK_AMD_DEFINE_RESULT__;;/*! showdown v 1.9.1 - 02-11-2019 */
-(function(){
-/**
- * Created by Tivie on 13-07-2015.
- */
-
-function getDefaultOpts (simple) {
- 'use strict';
-
- var defaultOptions = {
- omitExtraWLInCodeBlocks: {
- defaultValue: false,
- describe: 'Omit the default extra whiteline added to code blocks',
- type: 'boolean'
- },
- noHeaderId: {
- defaultValue: false,
- describe: 'Turn on/off generated header id',
- type: 'boolean'
- },
- prefixHeaderId: {
- defaultValue: false,
- describe: 'Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic \'section-\' prefix',
- type: 'string'
- },
- rawPrefixHeaderId: {
- defaultValue: false,
- describe: 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',
- type: 'boolean'
- },
- ghCompatibleHeaderId: {
- defaultValue: false,
- describe: 'Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)',
- type: 'boolean'
- },
- rawHeaderId: {
- defaultValue: false,
- describe: 'Remove only spaces, \' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids',
- type: 'boolean'
- },
- headerLevelStart: {
- defaultValue: false,
- describe: 'The header blocks level start',
- type: 'integer'
- },
- parseImgDimensions: {
- defaultValue: false,
- describe: 'Turn on/off image dimension parsing',
- type: 'boolean'
- },
- simplifiedAutoLink: {
- defaultValue: false,
- describe: 'Turn on/off GFM autolink style',
- type: 'boolean'
- },
- excludeTrailingPunctuationFromURLs: {
- defaultValue: false,
- describe: 'Excludes trailing punctuation from links generated with autoLinking',
- type: 'boolean'
- },
- literalMidWordUnderscores: {
- defaultValue: false,
- describe: 'Parse midword underscores as literal underscores',
- type: 'boolean'
- },
- literalMidWordAsterisks: {
- defaultValue: false,
- describe: 'Parse midword asterisks as literal asterisks',
- type: 'boolean'
- },
- strikethrough: {
- defaultValue: false,
- describe: 'Turn on/off strikethrough support',
- type: 'boolean'
- },
- tables: {
- defaultValue: false,
- describe: 'Turn on/off tables support',
- type: 'boolean'
- },
- tablesHeaderId: {
- defaultValue: false,
- describe: 'Add an id to table headers',
- type: 'boolean'
- },
- ghCodeBlocks: {
- defaultValue: true,
- describe: 'Turn on/off GFM fenced code blocks support',
- type: 'boolean'
- },
- tasklists: {
- defaultValue: false,
- describe: 'Turn on/off GFM tasklist support',
- type: 'boolean'
- },
- smoothLivePreview: {
- defaultValue: false,
- describe: 'Prevents weird effects in live previews due to incomplete input',
- type: 'boolean'
- },
- smartIndentationFix: {
- defaultValue: false,
- description: 'Tries to smartly fix indentation in es6 strings',
- type: 'boolean'
- },
- disableForced4SpacesIndentedSublists: {
- defaultValue: false,
- description: 'Disables the requirement of indenting nested sublists by 4 spaces',
- type: 'boolean'
- },
- simpleLineBreaks: {
- defaultValue: false,
- description: 'Parses simple line breaks as <br> (GFM Style)',
- type: 'boolean'
- },
- requireSpaceBeforeHeadingText: {
- defaultValue: false,
- description: 'Makes adding a space between `#` and the header text mandatory (GFM Style)',
- type: 'boolean'
- },
- ghMentions: {
- defaultValue: false,
- description: 'Enables github @mentions',
- type: 'boolean'
- },
- ghMentionsLink: {
- defaultValue: 'https://github.com/{u}',
- description: 'Changes the link generated by @mentions. Only applies if ghMentions option is enabled.',
- type: 'string'
- },
- encodeEmails: {
- defaultValue: true,
- description: 'Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities',
- type: 'boolean'
- },
- openLinksInNewWindow: {
- defaultValue: false,
- description: 'Open all links in new windows',
- type: 'boolean'
- },
- backslashEscapesHTMLTags: {
- defaultValue: false,
- description: 'Support for HTML Tag escaping. ex: \<div>foo\</div>',
- type: 'boolean'
- },
- emoji: {
- defaultValue: false,
- description: 'Enable emoji support. Ex: `this is a :smile: emoji`',
- type: 'boolean'
- },
- underline: {
- defaultValue: false,
- description: 'Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`',
- type: 'boolean'
- },
- completeHTMLDocument: {
- defaultValue: false,
- description: 'Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags',
- type: 'boolean'
- },
- metadata: {
- defaultValue: false,
- description: 'Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).',
- type: 'boolean'
- },
- splitAdjacentBlockquotes: {
- defaultValue: false,
- description: 'Split adjacent blockquote blocks',
- type: 'boolean'
- }
- };
- if (simple === false) {
- return JSON.parse(JSON.stringify(defaultOptions));
- }
- var ret = {};
- for (var opt in defaultOptions) {
- if (defaultOptions.hasOwnProperty(opt)) {
- ret[opt] = defaultOptions[opt].defaultValue;
- }
- }
- return ret;
-}
-
-function allOptionsOn () {
- 'use strict';
- var options = getDefaultOpts(true),
- ret = {};
- for (var opt in options) {
- if (options.hasOwnProperty(opt)) {
- ret[opt] = true;
- }
- }
- return ret;
-}
-
-/**
- * Created by Tivie on 06-01-2015.
- */
-
-// Private properties
-var showdown = {},
- parsers = {},
- extensions = {},
- globalOptions = getDefaultOpts(true),
- setFlavor = 'vanilla',
- flavor = {
- github: {
- omitExtraWLInCodeBlocks: true,
- simplifiedAutoLink: true,
- excludeTrailingPunctuationFromURLs: true,
- literalMidWordUnderscores: true,
- strikethrough: true,
- tables: true,
- tablesHeaderId: true,
- ghCodeBlocks: true,
- tasklists: true,
- disableForced4SpacesIndentedSublists: true,
- simpleLineBreaks: true,
- requireSpaceBeforeHeadingText: true,
- ghCompatibleHeaderId: true,
- ghMentions: true,
- backslashEscapesHTMLTags: true,
- emoji: true,
- splitAdjacentBlockquotes: true
- },
- original: {
- noHeaderId: true,
- ghCodeBlocks: false
- },
- ghost: {
- omitExtraWLInCodeBlocks: true,
- parseImgDimensions: true,
- simplifiedAutoLink: true,
- excludeTrailingPunctuationFromURLs: true,
- literalMidWordUnderscores: true,
- strikethrough: true,
- tables: true,
- tablesHeaderId: true,
- ghCodeBlocks: true,
- tasklists: true,
- smoothLivePreview: true,
- simpleLineBreaks: true,
- requireSpaceBeforeHeadingText: true,
- ghMentions: false,
- encodeEmails: true
- },
- vanilla: getDefaultOpts(true),
- allOn: allOptionsOn()
- };
-
-/**
- * helper namespace
- * @type {{}}
- */
-showdown.helper = {};
-
-/**
- * TODO LEGACY SUPPORT CODE
- * @type {{}}
- */
-showdown.extensions = {};
-
-/**
- * Set a global option
- * @static
- * @param {string} key
- * @param {*} value
- * @returns {showdown}
- */
-showdown.setOption = function (key, value) {
- 'use strict';
- globalOptions[key] = value;
- return this;
-};
-
-/**
- * Get a global option
- * @static
- * @param {string} key
- * @returns {*}
- */
-showdown.getOption = function (key) {
- 'use strict';
- return globalOptions[key];
-};
-
-/**
- * Get the global options
- * @static
- * @returns {{}}
- */
-showdown.getOptions = function () {
- 'use strict';
- return globalOptions;
-};
-
-/**
- * Reset global options to the default values
- * @static
- */
-showdown.resetOptions = function () {
- 'use strict';
- globalOptions = getDefaultOpts(true);
-};
-
-/**
- * Set the flavor showdown should use as default
- * @param {string} name
- */
-showdown.setFlavor = function (name) {
- 'use strict';
- if (!flavor.hasOwnProperty(name)) {
- throw Error(name + ' flavor was not found');
- }
- showdown.resetOptions();
- var preset = flavor[name];
- setFlavor = name;
- for (var option in preset) {
- if (preset.hasOwnProperty(option)) {
- globalOptions[option] = preset[option];
- }
- }
-};
-
-/**
- * Get the currently set flavor
- * @returns {string}
- */
-showdown.getFlavor = function () {
- 'use strict';
- return setFlavor;
-};
-
-/**
- * Get the options of a specified flavor. Returns undefined if the flavor was not found
- * @param {string} name Name of the flavor
- * @returns {{}|undefined}
- */
-showdown.getFlavorOptions = function (name) {
- 'use strict';
- if (flavor.hasOwnProperty(name)) {
- return flavor[name];
- }
-};
-
-/**
- * Get the default options
- * @static
- * @param {boolean} [simple=true]
- * @returns {{}}
- */
-showdown.getDefaultOptions = function (simple) {
- 'use strict';
- return getDefaultOpts(simple);
-};
-
-/**
- * Get or set a subParser
- *
- * subParser(name) - Get a registered subParser
- * subParser(name, func) - Register a subParser
- * @static
- * @param {string} name
- * @param {function} [func]
- * @returns {*}
- */
-showdown.subParser = function (name, func) {
- 'use strict';
- if (showdown.helper.isString(name)) {
- if (typeof func !== 'undefined') {
- parsers[name] = func;
- } else {
- if (parsers.hasOwnProperty(name)) {
- return parsers[name];
- } else {
- throw Error('SubParser named ' + name + ' not registered!');
- }
- }
- }
-};
-
-/**
- * Gets or registers an extension
- * @static
- * @param {string} name
- * @param {object|function=} ext
- * @returns {*}
- */
-showdown.extension = function (name, ext) {
- 'use strict';
-
- if (!showdown.helper.isString(name)) {
- throw Error('Extension \'name\' must be a string');
- }
-
- name = showdown.helper.stdExtName(name);
-
- // Getter
- if (showdown.helper.isUndefined(ext)) {
- if (!extensions.hasOwnProperty(name)) {
- throw Error('Extension named ' + name + ' is not registered!');
- }
- return extensions[name];
-
- // Setter
- } else {
- // Expand extension if it's wrapped in a function
- if (typeof ext === 'function') {
- ext = ext();
- }
-
- // Ensure extension is an array
- if (!showdown.helper.isArray(ext)) {
- ext = [ext];
- }
-
- var validExtension = validate(ext, name);
-
- if (validExtension.valid) {
- extensions[name] = ext;
- } else {
- throw Error(validExtension.error);
- }
- }
-};
-
-/**
- * Gets all extensions registered
- * @returns {{}}
- */
-showdown.getAllExtensions = function () {
- 'use strict';
- return extensions;
-};
-
-/**
- * Remove an extension
- * @param {string} name
- */
-showdown.removeExtension = function (name) {
- 'use strict';
- delete extensions[name];
-};
-
-/**
- * Removes all extensions
- */
-showdown.resetExtensions = function () {
- 'use strict';
- extensions = {};
-};
-
-/**
- * Validate extension
- * @param {array} extension
- * @param {string} name
- * @returns {{valid: boolean, error: string}}
- */
-function validate (extension, name) {
- 'use strict';
-
- var errMsg = (name) ? 'Error in ' + name + ' extension->' : 'Error in unnamed extension',
- ret = {
- valid: true,
- error: ''
- };
-
- if (!showdown.helper.isArray(extension)) {
- extension = [extension];
- }
-
- for (var i = 0; i < extension.length; ++i) {
- var baseMsg = errMsg + ' sub-extension ' + i + ': ',
- ext = extension[i];
- if (typeof ext !== 'object') {
- ret.valid = false;
- ret.error = baseMsg + 'must be an object, but ' + typeof ext + ' given';
- return ret;
- }
-
- if (!showdown.helper.isString(ext.type)) {
- ret.valid = false;
- ret.error = baseMsg + 'property "type" must be a string, but ' + typeof ext.type + ' given';
- return ret;
- }
-
- var type = ext.type = ext.type.toLowerCase();
-
- // normalize extension type
- if (type === 'language') {
- type = ext.type = 'lang';
- }
-
- if (type === 'html') {
- type = ext.type = 'output';
- }
-
- if (type !== 'lang' && type !== 'output' && type !== 'listener') {
- ret.valid = false;
- ret.error = baseMsg + 'type ' + type + ' is not recognized. Valid values: "lang/language", "output/html" or "listener"';
- return ret;
- }
-
- if (type === 'listener') {
- if (showdown.helper.isUndefined(ext.listeners)) {
- ret.valid = false;
- ret.error = baseMsg + '. Extensions of type "listener" must have a property called "listeners"';
- return ret;
- }
- } else {
- if (showdown.helper.isUndefined(ext.filter) && showdown.helper.isUndefined(ext.regex)) {
- ret.valid = false;
- ret.error = baseMsg + type + ' extensions must define either a "regex" property or a "filter" method';
- return ret;
- }
- }
-
- if (ext.listeners) {
- if (typeof ext.listeners !== 'object') {
- ret.valid = false;
- ret.error = baseMsg + '"listeners" property must be an object but ' + typeof ext.listeners + ' given';
- return ret;
- }
- for (var ln in ext.listeners) {
- if (ext.listeners.hasOwnProperty(ln)) {
- if (typeof ext.listeners[ln] !== 'function') {
- ret.valid = false;
- ret.error = baseMsg + '"listeners" property must be an hash of [event name]: [callback]. listeners.' + ln +
- ' must be a function but ' + typeof ext.listeners[ln] + ' given';
- return ret;
- }
- }
- }
- }
-
- if (ext.filter) {
- if (typeof ext.filter !== 'function') {
- ret.valid = false;
- ret.error = baseMsg + '"filter" must be a function, but ' + typeof ext.filter + ' given';
- return ret;
- }
- } else if (ext.regex) {
- if (showdown.helper.isString(ext.regex)) {
- ext.regex = new RegExp(ext.regex, 'g');
- }
- if (!(ext.regex instanceof RegExp)) {
- ret.valid = false;
- ret.error = baseMsg + '"regex" property must either be a string or a RegExp object, but ' + typeof ext.regex + ' given';
- return ret;
- }
- if (showdown.helper.isUndefined(ext.replace)) {
- ret.valid = false;
- ret.error = baseMsg + '"regex" extensions must implement a replace string or function';
- return ret;
- }
- }
- }
- return ret;
-}
-
-/**
- * Validate extension
- * @param {object} ext
- * @returns {boolean}
- */
-showdown.validateExtension = function (ext) {
- 'use strict';
-
- var validateExtension = validate(ext, null);
- if (!validateExtension.valid) {
- console.warn(validateExtension.error);
- return false;
- }
- return true;
-};
-
-/**
- * showdownjs helper functions
- */
-
-if (!showdown.hasOwnProperty('helper')) {
- showdown.helper = {};
-}
-
-/**
- * Check if var is string
- * @static
- * @param {string} a
- * @returns {boolean}
- */
-showdown.helper.isString = function (a) {
- 'use strict';
- return (typeof a === 'string' || a instanceof String);
-};
-
-/**
- * Check if var is a function
- * @static
- * @param {*} a
- * @returns {boolean}
- */
-showdown.helper.isFunction = function (a) {
- 'use strict';
- var getType = {};
- return a && getType.toString.call(a) === '[object Function]';
-};
-
-/**
- * isArray helper function
- * @static
- * @param {*} a
- * @returns {boolean}
- */
-showdown.helper.isArray = function (a) {
- 'use strict';
- return Array.isArray(a);
-};
-
-/**
- * Check if value is undefined
- * @static
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
- */
-showdown.helper.isUndefined = function (value) {
- 'use strict';
- return typeof value === 'undefined';
-};
-
-/**
- * ForEach helper function
- * Iterates over Arrays and Objects (own properties only)
- * @static
- * @param {*} obj
- * @param {function} callback Accepts 3 params: 1. value, 2. key, 3. the original array/object
- */
-showdown.helper.forEach = function (obj, callback) {
- 'use strict';
- // check if obj is defined
- if (showdown.helper.isUndefined(obj)) {
- throw new Error('obj param is required');
- }
-
- if (showdown.helper.isUndefined(callback)) {
- throw new Error('callback param is required');
- }
-
- if (!showdown.helper.isFunction(callback)) {
- throw new Error('callback param must be a function/closure');
- }
-
- if (typeof obj.forEach === 'function') {
- obj.forEach(callback);
- } else if (showdown.helper.isArray(obj)) {
- for (var i = 0; i < obj.length; i++) {
- callback(obj[i], i, obj);
- }
- } else if (typeof (obj) === 'object') {
- for (var prop in obj) {
- if (obj.hasOwnProperty(prop)) {
- callback(obj[prop], prop, obj);
- }
- }
- } else {
- throw new Error('obj does not seem to be an array or an iterable object');
- }
-};
-
-/**
- * Standardidize extension name
- * @static
- * @param {string} s extension name
- * @returns {string}
- */
-showdown.helper.stdExtName = function (s) {
- 'use strict';
- return s.replace(/[_?*+\/\\.^-]/g, '').replace(/\s/g, '').toLowerCase();
-};
-
-function escapeCharactersCallback (wholeMatch, m1) {
- 'use strict';
- var charCodeToEscape = m1.charCodeAt(0);
- return '¨E' + charCodeToEscape + 'E';
-}
-
-/**
- * Callback used to escape characters when passing through String.replace
- * @static
- * @param {string} wholeMatch
- * @param {string} m1
- * @returns {string}
- */
-showdown.helper.escapeCharactersCallback = escapeCharactersCallback;
-
-/**
- * Escape characters in a string
- * @static
- * @param {string} text
- * @param {string} charsToEscape
- * @param {boolean} afterBackslash
- * @returns {XML|string|void|*}
- */
-showdown.helper.escapeCharacters = function (text, charsToEscape, afterBackslash) {
- 'use strict';
- // First we have to escape the escape characters so that
- // we can build a character class out of them
- var regexString = '([' + charsToEscape.replace(/([\[\]\\])/g, '\\$1') + '])';
-
- if (afterBackslash) {
- regexString = '\\\\' + regexString;
- }
-
- var regex = new RegExp(regexString, 'g');
- text = text.replace(regex, escapeCharactersCallback);
-
- return text;
-};
-
-/**
- * Unescape HTML entities
- * @param txt
- * @returns {string}
- */
-showdown.helper.unescapeHTMLEntities = function (txt) {
- 'use strict';
-
- return txt
- .replace(/"/g, '"')
- .replace(/</g, '<')
- .replace(/>/g, '>')
- .replace(/&/g, '&');
-};
-
-var rgxFindMatchPos = function (str, left, right, flags) {
- 'use strict';
- var f = flags || '',
- g = f.indexOf('g') > -1,
- x = new RegExp(left + '|' + right, 'g' + f.replace(/g/g, '')),
- l = new RegExp(left, f.replace(/g/g, '')),
- pos = [],
- t, s, m, start, end;
-
- do {
- t = 0;
- while ((m = x.exec(str))) {
- if (l.test(m[0])) {
- if (!(t++)) {
- s = x.lastIndex;
- start = s - m[0].length;
- }
- } else if (t) {
- if (!--t) {
- end = m.index + m[0].length;
- var obj = {
- left: {start: start, end: s},
- match: {start: s, end: m.index},
- right: {start: m.index, end: end},
- wholeMatch: {start: start, end: end}
- };
- pos.push(obj);
- if (!g) {
- return pos;
- }
- }
- }
- }
- } while (t && (x.lastIndex = s));
-
- return pos;
-};
-
-/**
- * matchRecursiveRegExp
- *
- * (c) 2007 Steven Levithan <stevenlevithan.com>
- * MIT License
- *
- * Accepts a string to search, a left and right format delimiter
- * as regex patterns, and optional regex flags. Returns an array
- * of matches, allowing nested instances of left/right delimiters.
- * Use the "g" flag to return all matches, otherwise only the
- * first is returned. Be careful to ensure that the left and
- * right format delimiters produce mutually exclusive matches.
- * Backreferences are not supported within the right delimiter
- * due to how it is internally combined with the left delimiter.
- * When matching strings whose format delimiters are unbalanced
- * to the left or right, the output is intentionally as a
- * conventional regex library with recursion support would
- * produce, e.g. "<<x>" and "<x>>" both produce ["x"] when using
- * "<" and ">" as the delimiters (both strings contain a single,
- * balanced instance of "<x>").
- *
- * examples:
- * matchRecursiveRegExp("test", "\\(", "\\)")
- * returns: []
- * matchRecursiveRegExp("<t<<e>><s>>t<>", "<", ">", "g")
- * returns: ["t<<e>><s>", ""]
- * matchRecursiveRegExp("<div id=\"x\">test</div>", "<div\\b[^>]*>", "</div>", "gi")
- * returns: ["test"]
- */
-showdown.helper.matchRecursiveRegExp = function (str, left, right, flags) {
- 'use strict';
-
- var matchPos = rgxFindMatchPos (str, left, right, flags),
- results = [];
-
- for (var i = 0; i < matchPos.length; ++i) {
- results.push([
- str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),
- str.slice(matchPos[i].match.start, matchPos[i].match.end),
- str.slice(matchPos[i].left.start, matchPos[i].left.end),
- str.slice(matchPos[i].right.start, matchPos[i].right.end)
- ]);
- }
- return results;
-};
-
-/**
- *
- * @param {string} str
- * @param {string|function} replacement
- * @param {string} left
- * @param {string} right
- * @param {string} flags
- * @returns {string}
- */
-showdown.helper.replaceRecursiveRegExp = function (str, replacement, left, right, flags) {
- 'use strict';
-
- if (!showdown.helper.isFunction(replacement)) {
- var repStr = replacement;
- replacement = function () {
- return repStr;
- };
- }
-
- var matchPos = rgxFindMatchPos(str, left, right, flags),
- finalStr = str,
- lng = matchPos.length;
-
- if (lng > 0) {
- var bits = [];
- if (matchPos[0].wholeMatch.start !== 0) {
- bits.push(str.slice(0, matchPos[0].wholeMatch.start));
- }
- for (var i = 0; i < lng; ++i) {
- bits.push(
- replacement(
- str.slice(matchPos[i].wholeMatch.start, matchPos[i].wholeMatch.end),
- str.slice(matchPos[i].match.start, matchPos[i].match.end),
- str.slice(matchPos[i].left.start, matchPos[i].left.end),
- str.slice(matchPos[i].right.start, matchPos[i].right.end)
- )
- );
- if (i < lng - 1) {
- bits.push(str.slice(matchPos[i].wholeMatch.end, matchPos[i + 1].wholeMatch.start));
- }
- }
- if (matchPos[lng - 1].wholeMatch.end < str.length) {
- bits.push(str.slice(matchPos[lng - 1].wholeMatch.end));
- }
- finalStr = bits.join('');
- }
- return finalStr;
-};
-
-/**
- * Returns the index within the passed String object of the first occurrence of the specified regex,
- * starting the search at fromIndex. Returns -1 if the value is not found.
- *
- * @param {string} str string to search
- * @param {RegExp} regex Regular expression to search
- * @param {int} [fromIndex = 0] Index to start the search
- * @returns {Number}
- * @throws InvalidArgumentError
- */
-showdown.helper.regexIndexOf = function (str, regex, fromIndex) {
- 'use strict';
- if (!showdown.helper.isString(str)) {
- throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string';
- }
- if (regex instanceof RegExp === false) {
- throw 'InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp';
- }
- var indexOf = str.substring(fromIndex || 0).search(regex);
- return (indexOf >= 0) ? (indexOf + (fromIndex || 0)) : indexOf;
-};
-
-/**
- * Splits the passed string object at the defined index, and returns an array composed of the two substrings
- * @param {string} str string to split
- * @param {int} index index to split string at
- * @returns {[string,string]}
- * @throws InvalidArgumentError
- */
-showdown.helper.splitAtIndex = function (str, index) {
- 'use strict';
- if (!showdown.helper.isString(str)) {
- throw 'InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string';
- }
- return [str.substring(0, index), str.substring(index)];
-};
-
-/**
- * Obfuscate an e-mail address through the use of Character Entities,
- * transforming ASCII characters into their equivalent decimal or hex entities.
- *
- * Since it has a random component, subsequent calls to this function produce different results
- *
- * @param {string} mail
- * @returns {string}
- */
-showdown.helper.encodeEmailAddress = function (mail) {
- 'use strict';
- var encode = [
- function (ch) {
- return '&#' + ch.charCodeAt(0) + ';';
- },
- function (ch) {
- return '&#x' + ch.charCodeAt(0).toString(16) + ';';
- },
- function (ch) {
- return ch;
- }
- ];
-
- mail = mail.replace(/./g, function (ch) {
- if (ch === '@') {
- // this *must* be encoded. I insist.
- ch = encode[Math.floor(Math.random() * 2)](ch);
- } else {
- var r = Math.random();
- // roughly 10% raw, 45% hex, 45% dec
- ch = (
- r > 0.9 ? encode[2](ch) : r > 0.45 ? encode[1](ch) : encode[0](ch)
- );
- }
- return ch;
- });
-
- return mail;
-};
-
-/**
- *
- * @param str
- * @param targetLength
- * @param padString
- * @returns {string}
- */
-showdown.helper.padEnd = function padEnd (str, targetLength, padString) {
- 'use strict';
- /*jshint bitwise: false*/
- // eslint-disable-next-line space-infix-ops
- targetLength = targetLength>>0; //floor if number or convert non-number to 0;
- /*jshint bitwise: true*/
- padString = String(padString || ' ');
- if (str.length > targetLength) {
- return String(str);
- } else {
- targetLength = targetLength - str.length;
- if (targetLength > padString.length) {
- padString += padString.repeat(targetLength / padString.length); //append to original to ensure we are longer than needed
- }
- return String(str) + padString.slice(0,targetLength);
- }
-};
-
-/**
- * POLYFILLS
- */
-// use this instead of builtin is undefined for IE8 compatibility
-if (typeof console === 'undefined') {
- console = {
- warn: function (msg) {
- 'use strict';
- alert(msg);
- },
- log: function (msg) {
- 'use strict';
- alert(msg);
- },
- error: function (msg) {
- 'use strict';
- throw msg;
- }
- };
-}
-
-/**
- * Common regexes.
- * We declare some common regexes to improve performance
- */
-showdown.helper.regexes = {
- asteriskDashAndColon: /([*_:~])/g
-};
-
-/**
- * EMOJIS LIST
+ * EMOJIS LIST
*/
showdown.helper.emojis = {
'+1':'\ud83d\udc4d',
@@ -9976,3346 +2179,10873 @@ showdown.helper.emojis = {
'zipper_mouth_face':'\ud83e\udd10',
'zzz':'\ud83d\udca4',
- /* special emojis :P */
- 'octocat': '<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',
- 'showdown': '<span style="font-family: \'Anonymous Pro\', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;">S</span>'
+ /* special emojis :P */
+ 'octocat': '<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',
+ 'showdown': '<span style="font-family: \'Anonymous Pro\', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;">S</span>'
+};
+
+/**
+ * Created by Estevao on 31-05-2015.
+ */
+
+/**
+ * Showdown Converter class
+ * @class
+ * @param {object} [converterOptions]
+ * @returns {Converter}
+ */
+showdown.Converter = function (converterOptions) {
+ 'use strict';
+
+ var
+ /**
+ * Options used by this converter
+ * @private
+ * @type {{}}
+ */
+ options = {},
+
+ /**
+ * Language extensions used by this converter
+ * @private
+ * @type {Array}
+ */
+ langExtensions = [],
+
+ /**
+ * Output modifiers extensions used by this converter
+ * @private
+ * @type {Array}
+ */
+ outputModifiers = [],
+
+ /**
+ * Event listeners
+ * @private
+ * @type {{}}
+ */
+ listeners = {},
+
+ /**
+ * The flavor set in this converter
+ */
+ setConvFlavor = setFlavor,
+
+ /**
+ * Metadata of the document
+ * @type {{parsed: {}, raw: string, format: string}}
+ */
+ metadata = {
+ parsed: {},
+ raw: '',
+ format: ''
+ };
+
+ _constructor();
+
+ /**
+ * Converter constructor
+ * @private
+ */
+ function _constructor () {
+ converterOptions = converterOptions || {};
+
+ for (var gOpt in globalOptions) {
+ if (globalOptions.hasOwnProperty(gOpt)) {
+ options[gOpt] = globalOptions[gOpt];
+ }
+ }
+
+ // Merge options
+ if (typeof converterOptions === 'object') {
+ for (var opt in converterOptions) {
+ if (converterOptions.hasOwnProperty(opt)) {
+ options[opt] = converterOptions[opt];
+ }
+ }
+ } else {
+ throw Error('Converter expects the passed parameter to be an object, but ' + typeof converterOptions +
+ ' was passed instead.');
+ }
+
+ if (options.extensions) {
+ showdown.helper.forEach(options.extensions, _parseExtension);
+ }
+ }
+
+ /**
+ * Parse extension
+ * @param {*} ext
+ * @param {string} [name='']
+ * @private
+ */
+ function _parseExtension (ext, name) {
+
+ name = name || null;
+ // If it's a string, the extension was previously loaded
+ if (showdown.helper.isString(ext)) {
+ ext = showdown.helper.stdExtName(ext);
+ name = ext;
+
+ // LEGACY_SUPPORT CODE
+ if (showdown.extensions[ext]) {
+ console.warn('DEPRECATION WARNING: ' + ext + ' is an old extension that uses a deprecated loading method.' +
+ 'Please inform the developer that the extension should be updated!');
+ legacyExtensionLoading(showdown.extensions[ext], ext);
+ return;
+ // END LEGACY SUPPORT CODE
+
+ } else if (!showdown.helper.isUndefined(extensions[ext])) {
+ ext = extensions[ext];
+
+ } else {
+ throw Error('Extension "' + ext + '" could not be loaded. It was either not found or is not a valid extension.');
+ }
+ }
+
+ if (typeof ext === 'function') {
+ ext = ext();
+ }
+
+ if (!showdown.helper.isArray(ext)) {
+ ext = [ext];
+ }
+
+ var validExt = validate(ext, name);
+ if (!validExt.valid) {
+ throw Error(validExt.error);
+ }
+
+ for (var i = 0; i < ext.length; ++i) {
+ switch (ext[i].type) {
+
+ case 'lang':
+ langExtensions.push(ext[i]);
+ break;
+
+ case 'output':
+ outputModifiers.push(ext[i]);
+ break;
+ }
+ if (ext[i].hasOwnProperty('listeners')) {
+ for (var ln in ext[i].listeners) {
+ if (ext[i].listeners.hasOwnProperty(ln)) {
+ listen(ln, ext[i].listeners[ln]);
+ }
+ }
+ }
+ }
+
+ }
+
+ /**
+ * LEGACY_SUPPORT
+ * @param {*} ext
+ * @param {string} name
+ */
+ function legacyExtensionLoading (ext, name) {
+ if (typeof ext === 'function') {
+ ext = ext(new showdown.Converter());
+ }
+ if (!showdown.helper.isArray(ext)) {
+ ext = [ext];
+ }
+ var valid = validate(ext, name);
+
+ if (!valid.valid) {
+ throw Error(valid.error);
+ }
+
+ for (var i = 0; i < ext.length; ++i) {
+ switch (ext[i].type) {
+ case 'lang':
+ langExtensions.push(ext[i]);
+ break;
+ case 'output':
+ outputModifiers.push(ext[i]);
+ break;
+ default:// should never reach here
+ throw Error('Extension loader error: Type unrecognized!!!');
+ }
+ }
+ }
+
+ /**
+ * Listen to an event
+ * @param {string} name
+ * @param {function} callback
+ */
+ function listen (name, callback) {
+ if (!showdown.helper.isString(name)) {
+ throw Error('Invalid argument in converter.listen() method: name must be a string, but ' + typeof name + ' given');
+ }
+
+ if (typeof callback !== 'function') {
+ throw Error('Invalid argument in converter.listen() method: callback must be a function, but ' + typeof callback + ' given');
+ }
+
+ if (!listeners.hasOwnProperty(name)) {
+ listeners[name] = [];
+ }
+ listeners[name].push(callback);
+ }
+
+ function rTrimInputText (text) {
+ var rsp = text.match(/^\s*/)[0].length,
+ rgx = new RegExp('^\\s{0,' + rsp + '}', 'gm');
+ return text.replace(rgx, '');
+ }
+
+ /**
+ * Dispatch an event
+ * @private
+ * @param {string} evtName Event name
+ * @param {string} text Text
+ * @param {{}} options Converter Options
+ * @param {{}} globals
+ * @returns {string}
+ */
+ this._dispatch = function dispatch (evtName, text, options, globals) {
+ if (listeners.hasOwnProperty(evtName)) {
+ for (var ei = 0; ei < listeners[evtName].length; ++ei) {
+ var nText = listeners[evtName][ei](evtName, text, this, options, globals);
+ if (nText && typeof nText !== 'undefined') {
+ text = nText;
+ }
+ }
+ }
+ return text;
+ };
+
+ /**
+ * Listen to an event
+ * @param {string} name
+ * @param {function} callback
+ * @returns {showdown.Converter}
+ */
+ this.listen = function (name, callback) {
+ listen(name, callback);
+ return this;
+ };
+
+ /**
+ * Converts a markdown string into HTML
+ * @param {string} text
+ * @returns {*}
+ */
+ this.makeHtml = function (text) {
+ //check if text is not falsy
+ if (!text) {
+ return text;
+ }
+
+ var globals = {
+ gHtmlBlocks: [],
+ gHtmlMdBlocks: [],
+ gHtmlSpans: [],
+ gUrls: {},
+ gTitles: {},
+ gDimensions: {},
+ gListLevel: 0,
+ hashLinkCounts: {},
+ langExtensions: langExtensions,
+ outputModifiers: outputModifiers,
+ converter: this,
+ ghCodeBlocks: [],
+ metadata: {
+ parsed: {},
+ raw: '',
+ format: ''
+ }
+ };
+
+ // This lets us use ¨ trema as an escape char to avoid md5 hashes
+ // The choice of character is arbitrary; anything that isn't
+ // magic in Markdown will work.
+ text = text.replace(/¨/g, '¨T');
+
+ // Replace $ with ¨D
+ // RegExp interprets $ as a special character
+ // when it's in a replacement string
+ text = text.replace(/\$/g, '¨D');
+
+ // Standardize line endings
+ text = text.replace(/\r\n/g, '\n'); // DOS to Unix
+ text = text.replace(/\r/g, '\n'); // Mac to Unix
+
+ // Stardardize line spaces
+ text = text.replace(/\u00A0/g, ' ');
+
+ if (options.smartIndentationFix) {
+ text = rTrimInputText(text);
+ }
+
+ // Make sure text begins and ends with a couple of newlines:
+ text = '\n\n' + text + '\n\n';
+
+ // detab
+ text = showdown.subParser('detab')(text, options, globals);
+
+ /**
+ * Strip any lines consisting only of spaces and tabs.
+ * This makes subsequent regexs easier to write, because we can
+ * match consecutive blank lines with /\n+/ instead of something
+ * contorted like /[ \t]*\n+/
+ */
+ text = text.replace(/^[ \t]+$/mg, '');
+
+ //run languageExtensions
+ showdown.helper.forEach(langExtensions, function (ext) {
+ text = showdown.subParser('runExtension')(ext, text, options, globals);
+ });
+
+ // run the sub parsers
+ text = showdown.subParser('metadata')(text, options, globals);
+ text = showdown.subParser('hashPreCodeTags')(text, options, globals);
+ text = showdown.subParser('githubCodeBlocks')(text, options, globals);
+ text = showdown.subParser('hashHTMLBlocks')(text, options, globals);
+ text = showdown.subParser('hashCodeTags')(text, options, globals);
+ text = showdown.subParser('stripLinkDefinitions')(text, options, globals);
+ text = showdown.subParser('blockGamut')(text, options, globals);
+ text = showdown.subParser('unhashHTMLSpans')(text, options, globals);
+ text = showdown.subParser('unescapeSpecialChars')(text, options, globals);
+
+ // attacklab: Restore dollar signs
+ text = text.replace(/¨D/g, '$$');
+
+ // attacklab: Restore tremas
+ text = text.replace(/¨T/g, '¨');
+
+ // render a complete html document instead of a partial if the option is enabled
+ text = showdown.subParser('completeHTMLDocument')(text, options, globals);
+
+ // Run output modifiers
+ showdown.helper.forEach(outputModifiers, function (ext) {
+ text = showdown.subParser('runExtension')(ext, text, options, globals);
+ });
+
+ // update metadata
+ metadata = globals.metadata;
+ return text;
+ };
+
+ /**
+ * Converts an HTML string into a markdown string
+ * @param src
+ * @param [HTMLParser] A WHATWG DOM and HTML parser, such as JSDOM. If none is supplied, window.document will be used.
+ * @returns {string}
+ */
+ this.makeMarkdown = this.makeMd = function (src, HTMLParser) {
+
+ // replace \r\n with \n
+ src = src.replace(/\r\n/g, '\n');
+ src = src.replace(/\r/g, '\n'); // old macs
+
+ // due to an edge case, we need to find this: > <
+ // to prevent removing of non silent white spaces
+ // ex: <em>this is</em> <strong>sparta</strong>
+ src = src.replace(/>[ \t]+</, '>¨NBSP;<');
+
+ if (!HTMLParser) {
+ if (window && window.document) {
+ HTMLParser = window.document;
+ } else {
+ throw new Error('HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM');
+ }
+ }
+
+ var doc = HTMLParser.createElement('div');
+ doc.innerHTML = src;
+
+ var globals = {
+ preList: substitutePreCodeTags(doc)
+ };
+
+ // remove all newlines and collapse spaces
+ clean(doc);
+
+ // some stuff, like accidental reference links must now be escaped
+ // TODO
+ // doc.innerHTML = doc.innerHTML.replace(/\[[\S\t ]]/);
+
+ var nodes = doc.childNodes,
+ mdDoc = '';
+
+ for (var i = 0; i < nodes.length; i++) {
+ mdDoc += showdown.subParser('makeMarkdown.node')(nodes[i], globals);
+ }
+
+ function clean (node) {
+ for (var n = 0; n < node.childNodes.length; ++n) {
+ var child = node.childNodes[n];
+ if (child.nodeType === 3) {
+ if (!/\S/.test(child.nodeValue)) {
+ node.removeChild(child);
+ --n;
+ } else {
+ child.nodeValue = child.nodeValue.split('\n').join(' ');
+ child.nodeValue = child.nodeValue.replace(/(\s)+/g, '$1');
+ }
+ } else if (child.nodeType === 1) {
+ clean(child);
+ }
+ }
+ }
+
+ // find all pre tags and replace contents with placeholder
+ // we need this so that we can remove all indentation from html
+ // to ease up parsing
+ function substitutePreCodeTags (doc) {
+
+ var pres = doc.querySelectorAll('pre'),
+ presPH = [];
+
+ for (var i = 0; i < pres.length; ++i) {
+
+ if (pres[i].childElementCount === 1 && pres[i].firstChild.tagName.toLowerCase() === 'code') {
+ var content = pres[i].firstChild.innerHTML.trim(),
+ language = pres[i].firstChild.getAttribute('data-language') || '';
+
+ // if data-language attribute is not defined, then we look for class language-*
+ if (language === '') {
+ var classes = pres[i].firstChild.className.split(' ');
+ for (var c = 0; c < classes.length; ++c) {
+ var matches = classes[c].match(/^language-(.+)$/);
+ if (matches !== null) {
+ language = matches[1];
+ break;
+ }
+ }
+ }
+
+ // unescape html entities in content
+ content = showdown.helper.unescapeHTMLEntities(content);
+
+ presPH.push(content);
+ pres[i].outerHTML = '<precode language="' + language + '" precodenum="' + i.toString() + '"></precode>';
+ } else {
+ presPH.push(pres[i].innerHTML);
+ pres[i].innerHTML = '';
+ pres[i].setAttribute('prenum', i.toString());
+ }
+ }
+ return presPH;
+ }
+
+ return mdDoc;
+ };
+
+ /**
+ * Set an option of this Converter instance
+ * @param {string} key
+ * @param {*} value
+ */
+ this.setOption = function (key, value) {
+ options[key] = value;
+ };
+
+ /**
+ * Get the option of this Converter instance
+ * @param {string} key
+ * @returns {*}
+ */
+ this.getOption = function (key) {
+ return options[key];
+ };
+
+ /**
+ * Get the options of this Converter instance
+ * @returns {{}}
+ */
+ this.getOptions = function () {
+ return options;
+ };
+
+ /**
+ * Add extension to THIS converter
+ * @param {{}} extension
+ * @param {string} [name=null]
+ */
+ this.addExtension = function (extension, name) {
+ name = name || null;
+ _parseExtension(extension, name);
+ };
+
+ /**
+ * Use a global registered extension with THIS converter
+ * @param {string} extensionName Name of the previously registered extension
+ */
+ this.useExtension = function (extensionName) {
+ _parseExtension(extensionName);
+ };
+
+ /**
+ * Set the flavor THIS converter should use
+ * @param {string} name
+ */
+ this.setFlavor = function (name) {
+ if (!flavor.hasOwnProperty(name)) {
+ throw Error(name + ' flavor was not found');
+ }
+ var preset = flavor[name];
+ setConvFlavor = name;
+ for (var option in preset) {
+ if (preset.hasOwnProperty(option)) {
+ options[option] = preset[option];
+ }
+ }
+ };
+
+ /**
+ * Get the currently set flavor of this converter
+ * @returns {string}
+ */
+ this.getFlavor = function () {
+ return setConvFlavor;
+ };
+
+ /**
+ * Remove an extension from THIS converter.
+ * Note: This is a costly operation. It's better to initialize a new converter
+ * and specify the extensions you wish to use
+ * @param {Array} extension
+ */
+ this.removeExtension = function (extension) {
+ if (!showdown.helper.isArray(extension)) {
+ extension = [extension];
+ }
+ for (var a = 0; a < extension.length; ++a) {
+ var ext = extension[a];
+ for (var i = 0; i < langExtensions.length; ++i) {
+ if (langExtensions[i] === ext) {
+ langExtensions[i].splice(i, 1);
+ }
+ }
+ for (var ii = 0; ii < outputModifiers.length; ++i) {
+ if (outputModifiers[ii] === ext) {
+ outputModifiers[ii].splice(i, 1);
+ }
+ }
+ }
+ };
+
+ /**
+ * Get all extension of THIS converter
+ * @returns {{language: Array, output: Array}}
+ */
+ this.getAllExtensions = function () {
+ return {
+ language: langExtensions,
+ output: outputModifiers
+ };
+ };
+
+ /**
+ * Get the metadata of the previously parsed document
+ * @param raw
+ * @returns {string|{}}
+ */
+ this.getMetadata = function (raw) {
+ if (raw) {
+ return metadata.raw;
+ } else {
+ return metadata.parsed;
+ }
+ };
+
+ /**
+ * Get the metadata format of the previously parsed document
+ * @returns {string}
+ */
+ this.getMetadataFormat = function () {
+ return metadata.format;
+ };
+
+ /**
+ * Private: set a single key, value metadata pair
+ * @param {string} key
+ * @param {string} value
+ */
+ this._setMetadataPair = function (key, value) {
+ metadata.parsed[key] = value;
+ };
+
+ /**
+ * Private: set metadata format
+ * @param {string} format
+ */
+ this._setMetadataFormat = function (format) {
+ metadata.format = format;
+ };
+
+ /**
+ * Private: set metadata raw text
+ * @param {string} raw
+ */
+ this._setMetadataRaw = function (raw) {
+ metadata.raw = raw;
+ };
+};
+
+/**
+ * Turn Markdown link shortcuts into XHTML <a> tags.
+ */
+showdown.subParser('anchors', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('anchors.before', text, options, globals);
+
+ var writeAnchorTag = function (wholeMatch, linkText, linkId, url, m5, m6, title) {
+ if (showdown.helper.isUndefined(title)) {
+ title = '';
+ }
+ linkId = linkId.toLowerCase();
+
+ // Special case for explicit empty url
+ if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) {
+ url = '';
+ } else if (!url) {
+ if (!linkId) {
+ // lower-case and turn embedded newlines into spaces
+ linkId = linkText.toLowerCase().replace(/ ?\n/g, ' ');
+ }
+ url = '#' + linkId;
+
+ if (!showdown.helper.isUndefined(globals.gUrls[linkId])) {
+ url = globals.gUrls[linkId];
+ if (!showdown.helper.isUndefined(globals.gTitles[linkId])) {
+ title = globals.gTitles[linkId];
+ }
+ } else {
+ return wholeMatch;
+ }
+ }
+
+ //url = showdown.helper.escapeCharacters(url, '*_', false); // replaced line to improve performance
+ url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
+
+ var result = '<a href="' + url + '"';
+
+ if (title !== '' && title !== null) {
+ title = title.replace(/"/g, '"');
+ //title = showdown.helper.escapeCharacters(title, '*_', false); // replaced line to improve performance
+ title = title.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
+ result += ' title="' + title + '"';
+ }
+
+ // optionLinksInNewWindow only applies
+ // to external links. Hash links (#) open in same page
+ if (options.openLinksInNewWindow && !/^#/.test(url)) {
+ // escaped _
+ result += ' rel="noopener noreferrer" target="¨E95Eblank"';
+ }
+
+ result += '>' + linkText + '</a>';
+
+ return result;
+ };
+
+ // First, handle reference-style links: [link text] [id]
+ text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g, writeAnchorTag);
+
+ // Next, inline-style links: [link text](url "optional title")
+ // cases with crazy urls like ./image/cat1).png
+ text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
+ writeAnchorTag);
+
+ // normal cases
+ text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
+ writeAnchorTag);
+
+ // handle reference-style shortcuts: [link text]
+ // These must come last in case you've also got [link test][1]
+ // or [link test](/foo)
+ text = text.replace(/\[([^\[\]]+)]()()()()()/g, writeAnchorTag);
+
+ // Lastly handle GithubMentions if option is enabled
+ if (options.ghMentions) {
+ text = text.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi, function (wm, st, escape, mentions, username) {
+ if (escape === '\\') {
+ return st + mentions;
+ }
+
+ //check if options.ghMentionsLink is a string
+ if (!showdown.helper.isString(options.ghMentionsLink)) {
+ throw new Error('ghMentionsLink option must be a string');
+ }
+ var lnk = options.ghMentionsLink.replace(/\{u}/g, username),
+ target = '';
+ if (options.openLinksInNewWindow) {
+ target = ' rel="noopener noreferrer" target="¨E95Eblank"';
+ }
+ return st + '<a href="' + lnk + '"' + target + '>' + mentions + '</a>';
+ });
+ }
+
+ text = globals.converter._dispatch('anchors.after', text, options, globals);
+ return text;
+});
+
+// url allowed chars [a-z\d_.~:/?#[]@!$&'()*+,;=-]
+
+var simpleURLRegex = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,
+ simpleURLRegex2 = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,
+ delimUrlRegex = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,
+ simpleMailRegex = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,
+ delimMailRegex = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,
+
+ replaceLink = function (options) {
+ 'use strict';
+ return function (wm, leadingMagicChars, link, m2, m3, trailingPunctuation, trailingMagicChars) {
+ link = link.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
+ var lnkTxt = link,
+ append = '',
+ target = '',
+ lmc = leadingMagicChars || '',
+ tmc = trailingMagicChars || '';
+ if (/^www\./i.test(link)) {
+ link = link.replace(/^www\./i, 'http://www.');
+ }
+ if (options.excludeTrailingPunctuationFromURLs && trailingPunctuation) {
+ append = trailingPunctuation;
+ }
+ if (options.openLinksInNewWindow) {
+ target = ' rel="noopener noreferrer" target="¨E95Eblank"';
+ }
+ return lmc + '<a href="' + link + '"' + target + '>' + lnkTxt + '</a>' + append + tmc;
+ };
+ },
+
+ replaceMail = function (options, globals) {
+ 'use strict';
+ return function (wholeMatch, b, mail) {
+ var href = 'mailto:';
+ b = b || '';
+ mail = showdown.subParser('unescapeSpecialChars')(mail, options, globals);
+ if (options.encodeEmails) {
+ href = showdown.helper.encodeEmailAddress(href + mail);
+ mail = showdown.helper.encodeEmailAddress(mail);
+ } else {
+ href = href + mail;
+ }
+ return b + '<a href="' + href + '">' + mail + '</a>';
+ };
+ };
+
+showdown.subParser('autoLinks', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('autoLinks.before', text, options, globals);
+
+ text = text.replace(delimUrlRegex, replaceLink(options));
+ text = text.replace(delimMailRegex, replaceMail(options, globals));
+
+ text = globals.converter._dispatch('autoLinks.after', text, options, globals);
+
+ return text;
+});
+
+showdown.subParser('simplifiedAutoLinks', function (text, options, globals) {
+ 'use strict';
+
+ if (!options.simplifiedAutoLink) {
+ return text;
+ }
+
+ text = globals.converter._dispatch('simplifiedAutoLinks.before', text, options, globals);
+
+ if (options.excludeTrailingPunctuationFromURLs) {
+ text = text.replace(simpleURLRegex2, replaceLink(options));
+ } else {
+ text = text.replace(simpleURLRegex, replaceLink(options));
+ }
+ text = text.replace(simpleMailRegex, replaceMail(options, globals));
+
+ text = globals.converter._dispatch('simplifiedAutoLinks.after', text, options, globals);
+
+ return text;
+});
+
+/**
+ * These are all the transformations that form block-level
+ * tags like paragraphs, headers, and list items.
+ */
+showdown.subParser('blockGamut', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('blockGamut.before', text, options, globals);
+
+ // we parse blockquotes first so that we can have headings and hrs
+ // inside blockquotes
+ text = showdown.subParser('blockQuotes')(text, options, globals);
+ text = showdown.subParser('headers')(text, options, globals);
+
+ // Do Horizontal Rules:
+ text = showdown.subParser('horizontalRule')(text, options, globals);
+
+ text = showdown.subParser('lists')(text, options, globals);
+ text = showdown.subParser('codeBlocks')(text, options, globals);
+ text = showdown.subParser('tables')(text, options, globals);
+
+ // We already ran _HashHTMLBlocks() before, in Markdown(), but that
+ // was to escape raw HTML in the original Markdown source. This time,
+ // we're escaping the markup we've just created, so that we don't wrap
+ // <p> tags around block-level tags.
+ text = showdown.subParser('hashHTMLBlocks')(text, options, globals);
+ text = showdown.subParser('paragraphs')(text, options, globals);
+
+ text = globals.converter._dispatch('blockGamut.after', text, options, globals);
+
+ return text;
+});
+
+showdown.subParser('blockQuotes', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('blockQuotes.before', text, options, globals);
+
+ // add a couple extra lines after the text and endtext mark
+ text = text + '\n\n';
+
+ var rgx = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;
+
+ if (options.splitAdjacentBlockquotes) {
+ rgx = /^ {0,3}>[\s\S]*?(?:\n\n)/gm;
+ }
+
+ text = text.replace(rgx, function (bq) {
+ // attacklab: hack around Konqueror 3.5.4 bug:
+ // "----------bug".replace(/^-/g,"") == "bug"
+ bq = bq.replace(/^[ \t]*>[ \t]?/gm, ''); // trim one level of quoting
+
+ // attacklab: clean up hack
+ bq = bq.replace(/¨0/g, '');
+
+ bq = bq.replace(/^[ \t]+$/gm, ''); // trim whitespace-only lines
+ bq = showdown.subParser('githubCodeBlocks')(bq, options, globals);
+ bq = showdown.subParser('blockGamut')(bq, options, globals); // recurse
+
+ bq = bq.replace(/(^|\n)/g, '$1 ');
+ // These leading spaces screw with <pre> content, so we need to fix that:
+ bq = bq.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function (wholeMatch, m1) {
+ var pre = m1;
+ // attacklab: hack around Konqueror 3.5.4 bug:
+ pre = pre.replace(/^ /mg, '¨0');
+ pre = pre.replace(/¨0/g, '');
+ return pre;
+ });
+
+ return showdown.subParser('hashBlock')('<blockquote>\n' + bq + '\n</blockquote>', options, globals);
+ });
+
+ text = globals.converter._dispatch('blockQuotes.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Process Markdown `<pre><code>` blocks.
+ */
+showdown.subParser('codeBlocks', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('codeBlocks.before', text, options, globals);
+
+ // sentinel workarounds for lack of \A and \Z, safari\khtml bug
+ text += '¨0';
+
+ var pattern = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;
+ text = text.replace(pattern, function (wholeMatch, m1, m2) {
+ var codeblock = m1,
+ nextChar = m2,
+ end = '\n';
+
+ codeblock = showdown.subParser('outdent')(codeblock, options, globals);
+ codeblock = showdown.subParser('encodeCode')(codeblock, options, globals);
+ codeblock = showdown.subParser('detab')(codeblock, options, globals);
+ codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines
+ codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing newlines
+
+ if (options.omitExtraWLInCodeBlocks) {
+ end = '';
+ }
+
+ codeblock = '<pre><code>' + codeblock + end + '</code></pre>';
+
+ return showdown.subParser('hashBlock')(codeblock, options, globals) + nextChar;
+ });
+
+ // strip sentinel
+ text = text.replace(/¨0/, '');
+
+ text = globals.converter._dispatch('codeBlocks.after', text, options, globals);
+ return text;
+});
+
+/**
+ *
+ * * Backtick quotes are used for <code></code> spans.
+ *
+ * * You can use multiple backticks as the delimiters if you want to
+ * include literal backticks in the code span. So, this input:
+ *
+ * Just type ``foo `bar` baz`` at the prompt.
+ *
+ * Will translate to:
+ *
+ * <p>Just type <code>foo `bar` baz</code> at the prompt.</p>
+ *
+ * There's no arbitrary limit to the number of backticks you
+ * can use as delimters. If you need three consecutive backticks
+ * in your code, use four for delimiters, etc.
+ *
+ * * You can use spaces to get literal backticks at the edges:
+ *
+ * ... type `` `bar` `` ...
+ *
+ * Turns to:
+ *
+ * ... type <code>`bar`</code> ...
+ */
+showdown.subParser('codeSpans', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('codeSpans.before', text, options, globals);
+
+ if (typeof text === 'undefined') {
+ text = '';
+ }
+ text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
+ function (wholeMatch, m1, m2, m3) {
+ var c = m3;
+ c = c.replace(/^([ \t]*)/g, ''); // leading whitespace
+ c = c.replace(/[ \t]*$/g, ''); // trailing whitespace
+ c = showdown.subParser('encodeCode')(c, options, globals);
+ c = m1 + '<code>' + c + '</code>';
+ c = showdown.subParser('hashHTMLSpans')(c, options, globals);
+ return c;
+ }
+ );
+
+ text = globals.converter._dispatch('codeSpans.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Create a full HTML document from the processed markdown
+ */
+showdown.subParser('completeHTMLDocument', function (text, options, globals) {
+ 'use strict';
+
+ if (!options.completeHTMLDocument) {
+ return text;
+ }
+
+ text = globals.converter._dispatch('completeHTMLDocument.before', text, options, globals);
+
+ var doctype = 'html',
+ doctypeParsed = '<!DOCTYPE HTML>\n',
+ title = '',
+ charset = '<meta charset="utf-8">\n',
+ lang = '',
+ metadata = '';
+
+ if (typeof globals.metadata.parsed.doctype !== 'undefined') {
+ doctypeParsed = '<!DOCTYPE ' + globals.metadata.parsed.doctype + '>\n';
+ doctype = globals.metadata.parsed.doctype.toString().toLowerCase();
+ if (doctype === 'html' || doctype === 'html5') {
+ charset = '<meta charset="utf-8">';
+ }
+ }
+
+ for (var meta in globals.metadata.parsed) {
+ if (globals.metadata.parsed.hasOwnProperty(meta)) {
+ switch (meta.toLowerCase()) {
+ case 'doctype':
+ break;
+
+ case 'title':
+ title = '<title>' + globals.metadata.parsed.title + '</title>\n';
+ break;
+
+ case 'charset':
+ if (doctype === 'html' || doctype === 'html5') {
+ charset = '<meta charset="' + globals.metadata.parsed.charset + '">\n';
+ } else {
+ charset = '<meta name="charset" content="' + globals.metadata.parsed.charset + '">\n';
+ }
+ break;
+
+ case 'language':
+ case 'lang':
+ lang = ' lang="' + globals.metadata.parsed[meta] + '"';
+ metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n';
+ break;
+
+ default:
+ metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n';
+ }
+ }
+ }
+
+ text = doctypeParsed + '<html' + lang + '>\n<head>\n' + title + charset + metadata + '</head>\n<body>\n' + text.trim() + '\n</body>\n</html>';
+
+ text = globals.converter._dispatch('completeHTMLDocument.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Convert all tabs to spaces
+ */
+showdown.subParser('detab', function (text, options, globals) {
+ 'use strict';
+ text = globals.converter._dispatch('detab.before', text, options, globals);
+
+ // expand first n-1 tabs
+ text = text.replace(/\t(?=\t)/g, ' '); // g_tab_width
+
+ // replace the nth with two sentinels
+ text = text.replace(/\t/g, '¨A¨B');
+
+ // use the sentinel to anchor our regex so it doesn't explode
+ text = text.replace(/¨B(.+?)¨A/g, function (wholeMatch, m1) {
+ var leadingText = m1,
+ numSpaces = 4 - leadingText.length % 4; // g_tab_width
+
+ // there *must* be a better way to do this:
+ for (var i = 0; i < numSpaces; i++) {
+ leadingText += ' ';
+ }
+
+ return leadingText;
+ });
+
+ // clean up sentinels
+ text = text.replace(/¨A/g, ' '); // g_tab_width
+ text = text.replace(/¨B/g, '');
+
+ text = globals.converter._dispatch('detab.after', text, options, globals);
+ return text;
+});
+
+showdown.subParser('ellipsis', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('ellipsis.before', text, options, globals);
+
+ text = text.replace(/\.\.\./g, '…');
+
+ text = globals.converter._dispatch('ellipsis.after', text, options, globals);
+
+ return text;
+});
+
+/**
+ * Turn emoji codes into emojis
+ *
+ * List of supported emojis: https://github.com/showdownjs/showdown/wiki/Emojis
+ */
+showdown.subParser('emoji', function (text, options, globals) {
+ 'use strict';
+
+ if (!options.emoji) {
+ return text;
+ }
+
+ text = globals.converter._dispatch('emoji.before', text, options, globals);
+
+ var emojiRgx = /:([\S]+?):/g;
+
+ text = text.replace(emojiRgx, function (wm, emojiCode) {
+ if (showdown.helper.emojis.hasOwnProperty(emojiCode)) {
+ return showdown.helper.emojis[emojiCode];
+ }
+ return wm;
+ });
+
+ text = globals.converter._dispatch('emoji.after', text, options, globals);
+
+ return text;
+});
+
+/**
+ * Smart processing for ampersands and angle brackets that need to be encoded.
+ */
+showdown.subParser('encodeAmpsAndAngles', function (text, options, globals) {
+ 'use strict';
+ text = globals.converter._dispatch('encodeAmpsAndAngles.before', text, options, globals);
+
+ // Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:
+ // http://bumppo.net/projects/amputator/
+ text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, '&');
+
+ // Encode naked <'s
+ text = text.replace(/<(?![a-z\/?$!])/gi, '<');
+
+ // Encode <
+ text = text.replace(/</g, '<');
+
+ // Encode >
+ text = text.replace(/>/g, '>');
+
+ text = globals.converter._dispatch('encodeAmpsAndAngles.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Returns the string, with after processing the following backslash escape sequences.
+ *
+ * attacklab: The polite way to do this is with the new escapeCharacters() function:
+ *
+ * text = escapeCharacters(text,"\\",true);
+ * text = escapeCharacters(text,"`*_{}[]()>#+-.!",true);
+ *
+ * ...but we're sidestepping its use of the (slow) RegExp constructor
+ * as an optimization for Firefox. This function gets called a LOT.
+ */
+showdown.subParser('encodeBackslashEscapes', function (text, options, globals) {
+ 'use strict';
+ text = globals.converter._dispatch('encodeBackslashEscapes.before', text, options, globals);
+
+ text = text.replace(/\\(\\)/g, showdown.helper.escapeCharactersCallback);
+ text = text.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g, showdown.helper.escapeCharactersCallback);
+
+ text = globals.converter._dispatch('encodeBackslashEscapes.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Encode/escape certain characters inside Markdown code runs.
+ * The point is that in code, these characters are literals,
+ * and lose their special Markdown meanings.
+ */
+showdown.subParser('encodeCode', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('encodeCode.before', text, options, globals);
+
+ // Encode all ampersands; HTML entities are not
+ // entities within a Markdown code span.
+ text = text
+ .replace(/&/g, '&')
+ // Do the angle bracket song and dance:
+ .replace(/</g, '<')
+ .replace(/>/g, '>')
+ // Now, escape characters that are magic in Markdown:
+ .replace(/([*_{}\[\]\\=~-])/g, showdown.helper.escapeCharactersCallback);
+
+ text = globals.converter._dispatch('encodeCode.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Within tags -- meaning between < and > -- encode [\ ` * _ ~ =] so they
+ * don't conflict with their use in Markdown for code, italics and strong.
+ */
+showdown.subParser('escapeSpecialCharsWithinTagAttributes', function (text, options, globals) {
+ 'use strict';
+ text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.before', text, options, globals);
+
+ // Build a regex to find HTML tags.
+ var tags = /<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,
+ comments = /<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;
+
+ text = text.replace(tags, function (wholeMatch) {
+ return wholeMatch
+ .replace(/(.)<\/?code>(?=.)/g, '$1`')
+ .replace(/([\\`*_~=|])/g, showdown.helper.escapeCharactersCallback);
+ });
+
+ text = text.replace(comments, function (wholeMatch) {
+ return wholeMatch
+ .replace(/([\\`*_~=|])/g, showdown.helper.escapeCharactersCallback);
+ });
+
+ text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Handle github codeblocks prior to running HashHTML so that
+ * HTML contained within the codeblock gets escaped properly
+ * Example:
+ * ```ruby
+ * def hello_world(x)
+ * puts "Hello, #{x}"
+ * end
+ * ```
+ */
+showdown.subParser('githubCodeBlocks', function (text, options, globals) {
+ 'use strict';
+
+ // early exit if option is not enabled
+ if (!options.ghCodeBlocks) {
+ return text;
+ }
+
+ text = globals.converter._dispatch('githubCodeBlocks.before', text, options, globals);
+
+ text += '¨0';
+
+ text = text.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g, function (wholeMatch, delim, language, codeblock) {
+ var end = (options.omitExtraWLInCodeBlocks) ? '' : '\n';
+
+ // First parse the github code block
+ codeblock = showdown.subParser('encodeCode')(codeblock, options, globals);
+ codeblock = showdown.subParser('detab')(codeblock, options, globals);
+ codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines
+ codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing whitespace
+
+ codeblock = '<pre><code' + (language ? ' class="' + language + ' language-' + language + '"' : '') + '>' + codeblock + end + '</code></pre>';
+
+ codeblock = showdown.subParser('hashBlock')(codeblock, options, globals);
+
+ // Since GHCodeblocks can be false positives, we need to
+ // store the primitive text and the parsed text in a global var,
+ // and then return a token
+ return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
+ });
+
+ // attacklab: strip sentinel
+ text = text.replace(/¨0/, '');
+
+ return globals.converter._dispatch('githubCodeBlocks.after', text, options, globals);
+});
+
+showdown.subParser('hashBlock', function (text, options, globals) {
+ 'use strict';
+ text = globals.converter._dispatch('hashBlock.before', text, options, globals);
+ text = text.replace(/(^\n+|\n+$)/g, '');
+ text = '\n\n¨K' + (globals.gHtmlBlocks.push(text) - 1) + 'K\n\n';
+ text = globals.converter._dispatch('hashBlock.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Hash and escape <code> elements that should not be parsed as markdown
+ */
+showdown.subParser('hashCodeTags', function (text, options, globals) {
+ 'use strict';
+ text = globals.converter._dispatch('hashCodeTags.before', text, options, globals);
+
+ var repFunc = function (wholeMatch, match, left, right) {
+ var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right;
+ return '¨C' + (globals.gHtmlSpans.push(codeblock) - 1) + 'C';
+ };
+
+ // Hash naked <code>
+ text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '<code\\b[^>]*>', '</code>', 'gim');
+
+ text = globals.converter._dispatch('hashCodeTags.after', text, options, globals);
+ return text;
+});
+
+showdown.subParser('hashElement', function (text, options, globals) {
+ 'use strict';
+
+ return function (wholeMatch, m1) {
+ var blockText = m1;
+
+ // Undo double lines
+ blockText = blockText.replace(/\n\n/g, '\n');
+ blockText = blockText.replace(/^\n/, '');
+
+ // strip trailing blank lines
+ blockText = blockText.replace(/\n+$/g, '');
+
+ // Replace the element text with a marker ("¨KxK" where x is its key)
+ blockText = '\n\n¨K' + (globals.gHtmlBlocks.push(blockText) - 1) + 'K\n\n';
+
+ return blockText;
+ };
+});
+
+showdown.subParser('hashHTMLBlocks', function (text, options, globals) {
+ 'use strict';
+ text = globals.converter._dispatch('hashHTMLBlocks.before', text, options, globals);
+
+ var blockTags = [
+ 'pre',
+ 'div',
+ 'h1',
+ 'h2',
+ 'h3',
+ 'h4',
+ 'h5',
+ 'h6',
+ 'blockquote',
+ 'table',
+ 'dl',
+ 'ol',
+ 'ul',
+ 'script',
+ 'noscript',
+ 'form',
+ 'fieldset',
+ 'iframe',
+ 'math',
+ 'style',
+ 'section',
+ 'header',
+ 'footer',
+ 'nav',
+ 'article',
+ 'aside',
+ 'address',
+ 'audio',
+ 'canvas',
+ 'figure',
+ 'hgroup',
+ 'output',
+ 'video',
+ 'p'
+ ],
+ repFunc = function (wholeMatch, match, left, right) {
+ var txt = wholeMatch;
+ // check if this html element is marked as markdown
+ // if so, it's contents should be parsed as markdown
+ if (left.search(/\bmarkdown\b/) !== -1) {
+ txt = left + globals.converter.makeHtml(match) + right;
+ }
+ return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n';
+ };
+
+ if (options.backslashEscapesHTMLTags) {
+ // encode backslash escaped HTML tags
+ text = text.replace(/\\<(\/?[^>]+?)>/g, function (wm, inside) {
+ return '<' + inside + '>';
+ });
+ }
+
+ // hash HTML Blocks
+ for (var i = 0; i < blockTags.length; ++i) {
+
+ var opTagPos,
+ rgx1 = new RegExp('^ {0,3}(<' + blockTags[i] + '\\b[^>]*>)', 'im'),
+ patLeft = '<' + blockTags[i] + '\\b[^>]*>',
+ patRight = '</' + blockTags[i] + '>';
+ // 1. Look for the first position of the first opening HTML tag in the text
+ while ((opTagPos = showdown.helper.regexIndexOf(text, rgx1)) !== -1) {
+
+ // if the HTML tag is \ escaped, we need to escape it and break
+
+
+ //2. Split the text in that position
+ var subTexts = showdown.helper.splitAtIndex(text, opTagPos),
+ //3. Match recursively
+ newSubText1 = showdown.helper.replaceRecursiveRegExp(subTexts[1], repFunc, patLeft, patRight, 'im');
+
+ // prevent an infinite loop
+ if (newSubText1 === subTexts[1]) {
+ break;
+ }
+ text = subTexts[0].concat(newSubText1);
+ }
+ }
+ // HR SPECIAL CASE
+ text = text.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,
+ showdown.subParser('hashElement')(text, options, globals));
+
+ // Special case for standalone HTML comments
+ text = showdown.helper.replaceRecursiveRegExp(text, function (txt) {
+ return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n';
+ }, '^ {0,3}<!--', '-->', 'gm');
+
+ // PHP and ASP-style processor instructions (<?...?> and <%...%>)
+ text = text.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,
+ showdown.subParser('hashElement')(text, options, globals));
+
+ text = globals.converter._dispatch('hashHTMLBlocks.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Hash span elements that should not be parsed as markdown
+ */
+showdown.subParser('hashHTMLSpans', function (text, options, globals) {
+ 'use strict';
+ text = globals.converter._dispatch('hashHTMLSpans.before', text, options, globals);
+
+ function hashHTMLSpan (html) {
+ return '¨C' + (globals.gHtmlSpans.push(html) - 1) + 'C';
+ }
+
+ // Hash Self Closing tags
+ text = text.replace(/<[^>]+?\/>/gi, function (wm) {
+ return hashHTMLSpan(wm);
+ });
+
+ // Hash tags without properties
+ text = text.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, function (wm) {
+ return hashHTMLSpan(wm);
+ });
+
+ // Hash tags with properties
+ text = text.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, function (wm) {
+ return hashHTMLSpan(wm);
+ });
+
+ // Hash self closing tags without />
+ text = text.replace(/<[^>]+?>/gi, function (wm) {
+ return hashHTMLSpan(wm);
+ });
+
+ /*showdown.helper.matchRecursiveRegExp(text, '<code\\b[^>]*>', '</code>', 'gi');*/
+
+ text = globals.converter._dispatch('hashHTMLSpans.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Unhash HTML spans
+ */
+showdown.subParser('unhashHTMLSpans', function (text, options, globals) {
+ 'use strict';
+ text = globals.converter._dispatch('unhashHTMLSpans.before', text, options, globals);
+
+ for (var i = 0; i < globals.gHtmlSpans.length; ++i) {
+ var repText = globals.gHtmlSpans[i],
+ // limiter to prevent infinite loop (assume 10 as limit for recurse)
+ limit = 0;
+
+ while (/¨C(\d+)C/.test(repText)) {
+ var num = RegExp.$1;
+ repText = repText.replace('¨C' + num + 'C', globals.gHtmlSpans[num]);
+ if (limit === 10) {
+ console.error('maximum nesting of 10 spans reached!!!');
+ break;
+ }
+ ++limit;
+ }
+ text = text.replace('¨C' + i + 'C', repText);
+ }
+
+ text = globals.converter._dispatch('unhashHTMLSpans.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Hash and escape <pre><code> elements that should not be parsed as markdown
+ */
+showdown.subParser('hashPreCodeTags', function (text, options, globals) {
+ 'use strict';
+ text = globals.converter._dispatch('hashPreCodeTags.before', text, options, globals);
+
+ var repFunc = function (wholeMatch, match, left, right) {
+ // encode html entities
+ var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right;
+ return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
+ };
+
+ // Hash <pre><code>
+ text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>', '^ {0,3}</code>\\s*</pre>', 'gim');
+
+ text = globals.converter._dispatch('hashPreCodeTags.after', text, options, globals);
+ return text;
+});
+
+showdown.subParser('headers', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('headers.before', text, options, globals);
+
+ var headerLevelStart = (isNaN(parseInt(options.headerLevelStart))) ? 1 : parseInt(options.headerLevelStart),
+
+ // Set text-style headers:
+ // Header 1
+ // ========
+ //
+ // Header 2
+ // --------
+ //
+ setextRegexH1 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm,
+ setextRegexH2 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm;
+
+ text = text.replace(setextRegexH1, function (wholeMatch, m1) {
+
+ var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),
+ hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
+ hLevel = headerLevelStart,
+ hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';
+ return showdown.subParser('hashBlock')(hashBlock, options, globals);
+ });
+
+ text = text.replace(setextRegexH2, function (matchFound, m1) {
+ var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),
+ hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
+ hLevel = headerLevelStart + 1,
+ hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';
+ return showdown.subParser('hashBlock')(hashBlock, options, globals);
+ });
+
+ // atx-style headers:
+ // # Header 1
+ // ## Header 2
+ // ## Header 2 with closing hashes ##
+ // ...
+ // ###### Header 6
+ //
+ var atxStyle = (options.requireSpaceBeforeHeadingText) ? /^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm : /^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;
+
+ text = text.replace(atxStyle, function (wholeMatch, m1, m2) {
+ var hText = m2;
+ if (options.customizedHeaderId) {
+ hText = m2.replace(/\s?\{([^{]+?)}\s*$/, '');
+ }
+
+ var span = showdown.subParser('spanGamut')(hText, options, globals),
+ hID = (options.noHeaderId) ? '' : ' id="' + headerId(m2) + '"',
+ hLevel = headerLevelStart - 1 + m1.length,
+ header = '<h' + hLevel + hID + '>' + span + '</h' + hLevel + '>';
+
+ return showdown.subParser('hashBlock')(header, options, globals);
+ });
+
+ function headerId (m) {
+ var title,
+ prefix;
+
+ // It is separate from other options to allow combining prefix and customized
+ if (options.customizedHeaderId) {
+ var match = m.match(/\{([^{]+?)}\s*$/);
+ if (match && match[1]) {
+ m = match[1];
+ }
+ }
+
+ title = m;
+
+ // Prefix id to prevent causing inadvertent pre-existing style matches.
+ if (showdown.helper.isString(options.prefixHeaderId)) {
+ prefix = options.prefixHeaderId;
+ } else if (options.prefixHeaderId === true) {
+ prefix = 'section-';
+ } else {
+ prefix = '';
+ }
+
+ if (!options.rawPrefixHeaderId) {
+ title = prefix + title;
+ }
+
+ if (options.ghCompatibleHeaderId) {
+ title = title
+ .replace(/ /g, '-')
+ // replace previously escaped chars (&, ¨ and $)
+ .replace(/&/g, '')
+ .replace(/¨T/g, '')
+ .replace(/¨D/g, '')
+ // replace rest of the chars (&~$ are repeated as they might have been escaped)
+ // borrowed from github's redcarpet (some they should produce similar results)
+ .replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, '')
+ .toLowerCase();
+ } else if (options.rawHeaderId) {
+ title = title
+ .replace(/ /g, '-')
+ // replace previously escaped chars (&, ¨ and $)
+ .replace(/&/g, '&')
+ .replace(/¨T/g, '¨')
+ .replace(/¨D/g, '$')
+ // replace " and '
+ .replace(/["']/g, '-')
+ .toLowerCase();
+ } else {
+ title = title
+ .replace(/[^\w]/g, '')
+ .toLowerCase();
+ }
+
+ if (options.rawPrefixHeaderId) {
+ title = prefix + title;
+ }
+
+ if (globals.hashLinkCounts[title]) {
+ title = title + '-' + (globals.hashLinkCounts[title]++);
+ } else {
+ globals.hashLinkCounts[title] = 1;
+ }
+ return title;
+ }
+
+ text = globals.converter._dispatch('headers.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Turn Markdown link shortcuts into XHTML <a> tags.
+ */
+showdown.subParser('horizontalRule', function (text, options, globals) {
+ 'use strict';
+ text = globals.converter._dispatch('horizontalRule.before', text, options, globals);
+
+ var key = showdown.subParser('hashBlock')('<hr />', options, globals);
+ text = text.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, key);
+ text = text.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, key);
+ text = text.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, key);
+
+ text = globals.converter._dispatch('horizontalRule.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Turn Markdown image shortcuts into <img> tags.
+ */
+showdown.subParser('images', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('images.before', text, options, globals);
+
+ var inlineRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,
+ crazyRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,
+ base64RegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,
+ referenceRegExp = /!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,
+ refShortcutRegExp = /!\[([^\[\]]+)]()()()()()/g;
+
+ function writeImageTagBase64 (wholeMatch, altText, linkId, url, width, height, m5, title) {
+ url = url.replace(/\s/g, '');
+ return writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title);
+ }
+
+ function writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title) {
+
+ var gUrls = globals.gUrls,
+ gTitles = globals.gTitles,
+ gDims = globals.gDimensions;
+
+ linkId = linkId.toLowerCase();
+
+ if (!title) {
+ title = '';
+ }
+ // Special case for explicit empty url
+ if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) {
+ url = '';
+
+ } else if (url === '' || url === null) {
+ if (linkId === '' || linkId === null) {
+ // lower-case and turn embedded newlines into spaces
+ linkId = altText.toLowerCase().replace(/ ?\n/g, ' ');
+ }
+ url = '#' + linkId;
+
+ if (!showdown.helper.isUndefined(gUrls[linkId])) {
+ url = gUrls[linkId];
+ if (!showdown.helper.isUndefined(gTitles[linkId])) {
+ title = gTitles[linkId];
+ }
+ if (!showdown.helper.isUndefined(gDims[linkId])) {
+ width = gDims[linkId].width;
+ height = gDims[linkId].height;
+ }
+ } else {
+ return wholeMatch;
+ }
+ }
+
+ altText = altText
+ .replace(/"/g, '"')
+ //altText = showdown.helper.escapeCharacters(altText, '*_', false);
+ .replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
+ //url = showdown.helper.escapeCharacters(url, '*_', false);
+ url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
+ var result = '<img src="' + url + '" alt="' + altText + '"';
+
+ if (title && showdown.helper.isString(title)) {
+ title = title
+ .replace(/"/g, '"')
+ //title = showdown.helper.escapeCharacters(title, '*_', false);
+ .replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
+ result += ' title="' + title + '"';
+ }
+
+ if (width && height) {
+ width = (width === '*') ? 'auto' : width;
+ height = (height === '*') ? 'auto' : height;
+
+ result += ' width="' + width + '"';
+ result += ' height="' + height + '"';
+ }
+
+ result += ' />';
+
+ return result;
+ }
+
+ // First, handle reference-style labeled images: ![alt text][id]
+ text = text.replace(referenceRegExp, writeImageTag);
+
+ // Next, handle inline images: 
+
+ // base64 encoded images
+ text = text.replace(base64RegExp, writeImageTagBase64);
+
+ // cases with crazy urls like ./image/cat1).png
+ text = text.replace(crazyRegExp, writeImageTag);
+
+ // normal cases
+ text = text.replace(inlineRegExp, writeImageTag);
+
+ // handle reference-style shortcuts: ![img text]
+ text = text.replace(refShortcutRegExp, writeImageTag);
+
+ text = globals.converter._dispatch('images.after', text, options, globals);
+ return text;
+});
+
+showdown.subParser('italicsAndBold', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('italicsAndBold.before', text, options, globals);
+
+ // it's faster to have 3 separate regexes for each case than have just one
+ // because of backtracing, in some cases, it could lead to an exponential effect
+ // called "catastrophic backtrace". Ominous!
+
+ function parseInside (txt, left, right) {
+ /*
+ if (options.simplifiedAutoLink) {
+ txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);
+ }
+ */
+ return left + txt + right;
+ }
+
+ // Parse underscores
+ if (options.literalMidWordUnderscores) {
+ text = text.replace(/\b___(\S[\s\S]*?)___\b/g, function (wm, txt) {
+ return parseInside (txt, '<strong><em>', '</em></strong>');
+ });
+ text = text.replace(/\b__(\S[\s\S]*?)__\b/g, function (wm, txt) {
+ return parseInside (txt, '<strong>', '</strong>');
+ });
+ text = text.replace(/\b_(\S[\s\S]*?)_\b/g, function (wm, txt) {
+ return parseInside (txt, '<em>', '</em>');
+ });
+ } else {
+ text = text.replace(/___(\S[\s\S]*?)___/g, function (wm, m) {
+ return (/\S$/.test(m)) ? parseInside (m, '<strong><em>', '</em></strong>') : wm;
+ });
+ text = text.replace(/__(\S[\s\S]*?)__/g, function (wm, m) {
+ return (/\S$/.test(m)) ? parseInside (m, '<strong>', '</strong>') : wm;
+ });
+ text = text.replace(/_([^\s_][\s\S]*?)_/g, function (wm, m) {
+ // !/^_[^_]/.test(m) - test if it doesn't start with __ (since it seems redundant, we removed it)
+ return (/\S$/.test(m)) ? parseInside (m, '<em>', '</em>') : wm;
+ });
+ }
+
+ // Now parse asterisks
+ if (options.literalMidWordAsterisks) {
+ text = text.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g, function (wm, lead, txt) {
+ return parseInside (txt, lead + '<strong><em>', '</em></strong>');
+ });
+ text = text.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g, function (wm, lead, txt) {
+ return parseInside (txt, lead + '<strong>', '</strong>');
+ });
+ text = text.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g, function (wm, lead, txt) {
+ return parseInside (txt, lead + '<em>', '</em>');
+ });
+ } else {
+ text = text.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g, function (wm, m) {
+ return (/\S$/.test(m)) ? parseInside (m, '<strong><em>', '</em></strong>') : wm;
+ });
+ text = text.replace(/\*\*(\S[\s\S]*?)\*\*/g, function (wm, m) {
+ return (/\S$/.test(m)) ? parseInside (m, '<strong>', '</strong>') : wm;
+ });
+ text = text.replace(/\*([^\s*][\s\S]*?)\*/g, function (wm, m) {
+ // !/^\*[^*]/.test(m) - test if it doesn't start with ** (since it seems redundant, we removed it)
+ return (/\S$/.test(m)) ? parseInside (m, '<em>', '</em>') : wm;
+ });
+ }
+
+
+ text = globals.converter._dispatch('italicsAndBold.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Form HTML ordered (numbered) and unordered (bulleted) lists.
+ */
+showdown.subParser('lists', function (text, options, globals) {
+ 'use strict';
+
+ /**
+ * Process the contents of a single ordered or unordered list, splitting it
+ * into individual list items.
+ * @param {string} listStr
+ * @param {boolean} trimTrailing
+ * @returns {string}
+ */
+ function processListItems (listStr, trimTrailing) {
+ // The $g_list_level global keeps track of when we're inside a list.
+ // Each time we enter a list, we increment it; when we leave a list,
+ // we decrement. If it's zero, we're not in a list anymore.
+ //
+ // We do this because when we're not inside a list, we want to treat
+ // something like this:
+ //
+ // I recommend upgrading to version
+ // 8. Oops, now this line is treated
+ // as a sub-list.
+ //
+ // As a single paragraph, despite the fact that the second line starts
+ // with a digit-period-space sequence.
+ //
+ // Whereas when we're inside a list (or sub-list), that line will be
+ // treated as the start of a sub-list. What a kludge, huh? This is
+ // an aspect of Markdown's syntax that's hard to parse perfectly
+ // without resorting to mind-reading. Perhaps the solution is to
+ // change the syntax rules such that sub-lists must start with a
+ // starting cardinal number; e.g. "1." or "a.".
+ globals.gListLevel++;
+
+ // trim trailing blank lines:
+ listStr = listStr.replace(/\n{2,}$/, '\n');
+
+ // attacklab: add sentinel to emulate \z
+ listStr += '¨0';
+
+ var rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,
+ isParagraphed = (/\n[ \t]*\n(?!¨0)/.test(listStr));
+
+ // Since version 1.5, nesting sublists requires 4 spaces (or 1 tab) indentation,
+ // which is a syntax breaking change
+ // activating this option reverts to old behavior
+ if (options.disableForced4SpacesIndentedSublists) {
+ rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm;
+ }
+
+ listStr = listStr.replace(rgx, function (wholeMatch, m1, m2, m3, m4, taskbtn, checked) {
+ checked = (checked && checked.trim() !== '');
+
+ var item = showdown.subParser('outdent')(m4, options, globals),
+ bulletStyle = '';
+
+ // Support for github tasklists
+ if (taskbtn && options.tasklists) {
+ bulletStyle = ' class="task-list-item" style="list-style-type: none;"';
+ item = item.replace(/^[ \t]*\[(x|X| )?]/m, function () {
+ var otp = '<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';
+ if (checked) {
+ otp += ' checked';
+ }
+ otp += '>';
+ return otp;
+ });
+ }
+
+ // ISSUE #312
+ // This input: - - - a
+ // causes trouble to the parser, since it interprets it as:
+ // <ul><li><li><li>a</li></li></li></ul>
+ // instead of:
+ // <ul><li>- - a</li></ul>
+ // So, to prevent it, we will put a marker (¨A)in the beginning of the line
+ // Kind of hackish/monkey patching, but seems more effective than overcomplicating the list parser
+ item = item.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g, function (wm2) {
+ return '¨A' + wm2;
+ });
+
+ // m1 - Leading line or
+ // Has a double return (multi paragraph) or
+ // Has sublist
+ if (m1 || (item.search(/\n{2,}/) > -1)) {
+ item = showdown.subParser('githubCodeBlocks')(item, options, globals);
+ item = showdown.subParser('blockGamut')(item, options, globals);
+ } else {
+ // Recursion for sub-lists:
+ item = showdown.subParser('lists')(item, options, globals);
+ item = item.replace(/\n$/, ''); // chomp(item)
+ item = showdown.subParser('hashHTMLBlocks')(item, options, globals);
+
+ // Colapse double linebreaks
+ item = item.replace(/\n\n+/g, '\n\n');
+ if (isParagraphed) {
+ item = showdown.subParser('paragraphs')(item, options, globals);
+ } else {
+ item = showdown.subParser('spanGamut')(item, options, globals);
+ }
+ }
+
+ // now we need to remove the marker (¨A)
+ item = item.replace('¨A', '');
+ // we can finally wrap the line in list item tags
+ item = '<li' + bulletStyle + '>' + item + '</li>\n';
+
+ return item;
+ });
+
+ // attacklab: strip sentinel
+ listStr = listStr.replace(/¨0/g, '');
+
+ globals.gListLevel--;
+
+ if (trimTrailing) {
+ listStr = listStr.replace(/\s+$/, '');
+ }
+
+ return listStr;
+ }
+
+ function styleStartNumber (list, listType) {
+ // check if ol and starts by a number different than 1
+ if (listType === 'ol') {
+ var res = list.match(/^ *(\d+)\./);
+ if (res && res[1] !== '1') {
+ return ' start="' + res[1] + '"';
+ }
+ }
+ return '';
+ }
+
+ /**
+ * Check and parse consecutive lists (better fix for issue #142)
+ * @param {string} list
+ * @param {string} listType
+ * @param {boolean} trimTrailing
+ * @returns {string}
+ */
+ function parseConsecutiveLists (list, listType, trimTrailing) {
+ // check if we caught 2 or more consecutive lists by mistake
+ // we use the counterRgx, meaning if listType is UL we look for OL and vice versa
+ var olRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?\d+\.[ \t]/gm : /^ {0,3}\d+\.[ \t]/gm,
+ ulRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?[*+-][ \t]/gm : /^ {0,3}[*+-][ \t]/gm,
+ counterRxg = (listType === 'ul') ? olRgx : ulRgx,
+ result = '';
+
+ if (list.search(counterRxg) !== -1) {
+ (function parseCL (txt) {
+ var pos = txt.search(counterRxg),
+ style = styleStartNumber(list, listType);
+ if (pos !== -1) {
+ // slice
+ result += '\n\n<' + listType + style + '>\n' + processListItems(txt.slice(0, pos), !!trimTrailing) + '</' + listType + '>\n';
+
+ // invert counterType and listType
+ listType = (listType === 'ul') ? 'ol' : 'ul';
+ counterRxg = (listType === 'ul') ? olRgx : ulRgx;
+
+ //recurse
+ parseCL(txt.slice(pos));
+ } else {
+ result += '\n\n<' + listType + style + '>\n' + processListItems(txt, !!trimTrailing) + '</' + listType + '>\n';
+ }
+ })(list);
+ } else {
+ var style = styleStartNumber(list, listType);
+ result = '\n\n<' + listType + style + '>\n' + processListItems(list, !!trimTrailing) + '</' + listType + '>\n';
+ }
+
+ return result;
+ }
+
+ /** Start of list parsing **/
+ text = globals.converter._dispatch('lists.before', text, options, globals);
+ // add sentinel to hack around khtml/safari bug:
+ // http://bugs.webkit.org/show_bug.cgi?id=11231
+ text += '¨0';
+
+ if (globals.gListLevel) {
+ text = text.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
+ function (wholeMatch, list, m2) {
+ var listType = (m2.search(/[*+-]/g) > -1) ? 'ul' : 'ol';
+ return parseConsecutiveLists(list, listType, true);
+ }
+ );
+ } else {
+ text = text.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
+ function (wholeMatch, m1, list, m3) {
+ var listType = (m3.search(/[*+-]/g) > -1) ? 'ul' : 'ol';
+ return parseConsecutiveLists(list, listType, false);
+ }
+ );
+ }
+
+ // strip sentinel
+ text = text.replace(/¨0/, '');
+ text = globals.converter._dispatch('lists.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Parse metadata at the top of the document
+ */
+showdown.subParser('metadata', function (text, options, globals) {
+ 'use strict';
+
+ if (!options.metadata) {
+ return text;
+ }
+
+ text = globals.converter._dispatch('metadata.before', text, options, globals);
+
+ function parseMetadataContents (content) {
+ // raw is raw so it's not changed in any way
+ globals.metadata.raw = content;
+
+ // escape chars forbidden in html attributes
+ // double quotes
+ content = content
+ // ampersand first
+ .replace(/&/g, '&')
+ // double quotes
+ .replace(/"/g, '"');
+
+ content = content.replace(/\n {4}/g, ' ');
+ content.replace(/^([\S ]+): +([\s\S]+?)$/gm, function (wm, key, value) {
+ globals.metadata.parsed[key] = value;
+ return '';
+ });
+ }
+
+ text = text.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/, function (wholematch, format, content) {
+ parseMetadataContents(content);
+ return '¨M';
+ });
+
+ text = text.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/, function (wholematch, format, content) {
+ if (format) {
+ globals.metadata.format = format;
+ }
+ parseMetadataContents(content);
+ return '¨M';
+ });
+
+ text = text.replace(/¨M/g, '');
+
+ text = globals.converter._dispatch('metadata.after', text, options, globals);
+ return text;
+});
+
+/**
+ * Remove one level of line-leading tabs or spaces
+ */
+showdown.subParser('outdent', function (text, options, globals) {
+ 'use strict';
+ text = globals.converter._dispatch('outdent.before', text, options, globals);
+
+ // attacklab: hack around Konqueror 3.5.4 bug:
+ // "----------bug".replace(/^-/g,"") == "bug"
+ text = text.replace(/^(\t|[ ]{1,4})/gm, '¨0'); // attacklab: g_tab_width
+
+ // attacklab: clean up hack
+ text = text.replace(/¨0/g, '');
+
+ text = globals.converter._dispatch('outdent.after', text, options, globals);
+ return text;
+});
+
+/**
+ *
+ */
+showdown.subParser('paragraphs', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('paragraphs.before', text, options, globals);
+ // Strip leading and trailing lines:
+ text = text.replace(/^\n+/g, '');
+ text = text.replace(/\n+$/g, '');
+
+ var grafs = text.split(/\n{2,}/g),
+ grafsOut = [],
+ end = grafs.length; // Wrap <p> tags
+
+ for (var i = 0; i < end; i++) {
+ var str = grafs[i];
+ // if this is an HTML marker, copy it
+ if (str.search(/¨(K|G)(\d+)\1/g) >= 0) {
+ grafsOut.push(str);
+
+ // test for presence of characters to prevent empty lines being parsed
+ // as paragraphs (resulting in undesired extra empty paragraphs)
+ } else if (str.search(/\S/) >= 0) {
+ str = showdown.subParser('spanGamut')(str, options, globals);
+ str = str.replace(/^([ \t]*)/g, '<p>');
+ str += '</p>';
+ grafsOut.push(str);
+ }
+ }
+
+ /** Unhashify HTML blocks */
+ end = grafsOut.length;
+ for (i = 0; i < end; i++) {
+ var blockText = '',
+ grafsOutIt = grafsOut[i],
+ codeFlag = false;
+ // if this is a marker for an html block...
+ // use RegExp.test instead of string.search because of QML bug
+ while (/¨(K|G)(\d+)\1/.test(grafsOutIt)) {
+ var delim = RegExp.$1,
+ num = RegExp.$2;
+
+ if (delim === 'K') {
+ blockText = globals.gHtmlBlocks[num];
+ } else {
+ // we need to check if ghBlock is a false positive
+ if (codeFlag) {
+ // use encoded version of all text
+ blockText = showdown.subParser('encodeCode')(globals.ghCodeBlocks[num].text, options, globals);
+ } else {
+ blockText = globals.ghCodeBlocks[num].codeblock;
+ }
+ }
+ blockText = blockText.replace(/\$/g, '$$$$'); // Escape any dollar signs
+
+ grafsOutIt = grafsOutIt.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/, blockText);
+ // Check if grafsOutIt is a pre->code
+ if (/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(grafsOutIt)) {
+ codeFlag = true;
+ }
+ }
+ grafsOut[i] = grafsOutIt;
+ }
+ text = grafsOut.join('\n');
+ // Strip leading and trailing lines:
+ text = text.replace(/^\n+/g, '');
+ text = text.replace(/\n+$/g, '');
+ return globals.converter._dispatch('paragraphs.after', text, options, globals);
+});
+
+/**
+ * Run extension
+ */
+showdown.subParser('runExtension', function (ext, text, options, globals) {
+ 'use strict';
+
+ if (ext.filter) {
+ text = ext.filter(text, globals.converter, options);
+
+ } else if (ext.regex) {
+ // TODO remove this when old extension loading mechanism is deprecated
+ var re = ext.regex;
+ if (!(re instanceof RegExp)) {
+ re = new RegExp(re, 'g');
+ }
+ text = text.replace(re, ext.replace);
+ }
+
+ return text;
+});
+
+/**
+ * These are all the transformations that occur *within* block-level
+ * tags like paragraphs, headers, and list items.
+ */
+showdown.subParser('spanGamut', function (text, options, globals) {
+ 'use strict';
+
+ text = globals.converter._dispatch('spanGamut.before', text, options, globals);
+ text = showdown.subParser('codeSpans')(text, options, globals);
+ text = showdown.subParser('escapeSpecialCharsWithinTagAttributes')(text, options, globals);
+ text = showdown.subParser('encodeBackslashEscapes')(text, options, globals);
+
+ // Process anchor and image tags. Images must come first,
+ // because ![foo][f] looks like an anchor.
+ text = showdown.subParser('images')(text, options, globals);
+ text = showdown.subParser('anchors')(text, options, globals);
+
+ // Make links out of things like `<http://example.com/>`
+ // Must come after anchors, because you can use < and >
+ // delimiters in inline links like [this](<url>).
+ text = showdown.subParser('autoLinks')(text, options, globals);
+ text = showdown.subParser('simplifiedAutoLinks')(text, options, globals);
+ text = showdown.subParser('emoji')(text, options, globals);
+ text = showdown.subParser('underline')(text, options, globals);
+ text = showdown.subParser('italicsAndBold')(text, options, globals);
+ text = showdown.subParser('strikethrough')(text, options, globals);
+ text = showdown.subParser('ellipsis')(text, options, globals);
+
+ // we need to hash HTML tags inside spans
+ text = showdown.subParser('hashHTMLSpans')(text, options, globals);
+
+ // now we encode amps and angles
+ text = showdown.subParser('encodeAmpsAndAngles')(text, options, globals);
+
+ // Do hard breaks
+ if (options.simpleLineBreaks) {
+ // GFM style hard breaks
+ // only add line breaks if the text does not contain a block (special case for lists)
+ if (!/\n\n¨K/.test(text)) {
+ text = text.replace(/\n+/g, '<br />\n');
+ }
+ } else {
+ // Vanilla hard breaks
+ text = text.replace(/ +\n/g, '<br />\n');
+ }
+
+ text = globals.converter._dispatch('spanGamut.after', text, options, globals);
+ return text;
+});
+
+showdown.subParser('strikethrough', function (text, options, globals) {
+ 'use strict';
+
+ function parseInside (txt) {
+ if (options.simplifiedAutoLink) {
+ txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);
+ }
+ return '<del>' + txt + '</del>';
+ }
+
+ if (options.strikethrough) {
+ text = globals.converter._dispatch('strikethrough.before', text, options, globals);
+ text = text.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, function (wm, txt) { return parseInside(txt); });
+ text = globals.converter._dispatch('strikethrough.after', text, options, globals);
+ }
+
+ return text;
+});
+
+/**
+ * Strips link definitions from text, stores the URLs and titles in
+ * hash references.
+ * Link defs are in the form: ^[id]: url "optional title"
+ */
+showdown.subParser('stripLinkDefinitions', function (text, options, globals) {
+ 'use strict';
+
+ var regex = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,
+ base64Regex = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;
+
+ // attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
+ text += '¨0';
+
+ var replaceFunc = function (wholeMatch, linkId, url, width, height, blankLines, title) {
+ linkId = linkId.toLowerCase();
+ if (url.match(/^data:.+?\/.+?;base64,/)) {
+ // remove newlines
+ globals.gUrls[linkId] = url.replace(/\s/g, '');
+ } else {
+ globals.gUrls[linkId] = showdown.subParser('encodeAmpsAndAngles')(url, options, globals); // Link IDs are case-insensitive
+ }
+
+ if (blankLines) {
+ // Oops, found blank lines, so it's not a title.
+ // Put back the parenthetical statement we stole.
+ return blankLines + title;
+
+ } else {
+ if (title) {
+ globals.gTitles[linkId] = title.replace(/"|'/g, '"');
+ }
+ if (options.parseImgDimensions && width && height) {
+ globals.gDimensions[linkId] = {
+ width: width,
+ height: height
+ };
+ }
+ }
+ // Completely remove the definition from the text
+ return '';
+ };
+
+ // first we try to find base64 link references
+ text = text.replace(base64Regex, replaceFunc);
+
+ text = text.replace(regex, replaceFunc);
+
+ // attacklab: strip sentinel
+ text = text.replace(/¨0/, '');
+
+ return text;
+});
+
+showdown.subParser('tables', function (text, options, globals) {
+ 'use strict';
+
+ if (!options.tables) {
+ return text;
+ }
+
+ var tableRgx = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,
+ //singeColTblRgx = /^ {0,3}\|.+\|\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n(?: {0,3}\|.+\|\n)+(?:\n\n|¨0)/gm;
+ singeColTblRgx = /^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;
+
+ function parseStyles (sLine) {
+ if (/^:[ \t]*--*$/.test(sLine)) {
+ return ' style="text-align:left;"';
+ } else if (/^--*[ \t]*:[ \t]*$/.test(sLine)) {
+ return ' style="text-align:right;"';
+ } else if (/^:[ \t]*--*[ \t]*:$/.test(sLine)) {
+ return ' style="text-align:center;"';
+ } else {
+ return '';
+ }
+ }
+
+ function parseHeaders (header, style) {
+ var id = '';
+ header = header.trim();
+ // support both tablesHeaderId and tableHeaderId due to error in documentation so we don't break backwards compatibility
+ if (options.tablesHeaderId || options.tableHeaderId) {
+ id = ' id="' + header.replace(/ /g, '_').toLowerCase() + '"';
+ }
+ header = showdown.subParser('spanGamut')(header, options, globals);
+
+ return '<th' + id + style + '>' + header + '</th>\n';
+ }
+
+ function parseCells (cell, style) {
+ var subText = showdown.subParser('spanGamut')(cell, options, globals);
+ return '<td' + style + '>' + subText + '</td>\n';
+ }
+
+ function buildTable (headers, cells) {
+ var tb = '<table>\n<thead>\n<tr>\n',
+ tblLgn = headers.length;
+
+ for (var i = 0; i < tblLgn; ++i) {
+ tb += headers[i];
+ }
+ tb += '</tr>\n</thead>\n<tbody>\n';
+
+ for (i = 0; i < cells.length; ++i) {
+ tb += '<tr>\n';
+ for (var ii = 0; ii < tblLgn; ++ii) {
+ tb += cells[i][ii];
+ }
+ tb += '</tr>\n';
+ }
+ tb += '</tbody>\n</table>\n';
+ return tb;
+ }
+
+ function parseTable (rawTable) {
+ var i, tableLines = rawTable.split('\n');
+
+ for (i = 0; i < tableLines.length; ++i) {
+ // strip wrong first and last column if wrapped tables are used
+ if (/^ {0,3}\|/.test(tableLines[i])) {
+ tableLines[i] = tableLines[i].replace(/^ {0,3}\|/, '');
+ }
+ if (/\|[ \t]*$/.test(tableLines[i])) {
+ tableLines[i] = tableLines[i].replace(/\|[ \t]*$/, '');
+ }
+ // parse code spans first, but we only support one line code spans
+ tableLines[i] = showdown.subParser('codeSpans')(tableLines[i], options, globals);
+ }
+
+ var rawHeaders = tableLines[0].split('|').map(function (s) { return s.trim();}),
+ rawStyles = tableLines[1].split('|').map(function (s) { return s.trim();}),
+ rawCells = [],
+ headers = [],
+ styles = [],
+ cells = [];
+
+ tableLines.shift();
+ tableLines.shift();
+
+ for (i = 0; i < tableLines.length; ++i) {
+ if (tableLines[i].trim() === '') {
+ continue;
+ }
+ rawCells.push(
+ tableLines[i]
+ .split('|')
+ .map(function (s) {
+ return s.trim();
+ })
+ );
+ }
+
+ if (rawHeaders.length < rawStyles.length) {
+ return rawTable;
+ }
+
+ for (i = 0; i < rawStyles.length; ++i) {
+ styles.push(parseStyles(rawStyles[i]));
+ }
+
+ for (i = 0; i < rawHeaders.length; ++i) {
+ if (showdown.helper.isUndefined(styles[i])) {
+ styles[i] = '';
+ }
+ headers.push(parseHeaders(rawHeaders[i], styles[i]));
+ }
+
+ for (i = 0; i < rawCells.length; ++i) {
+ var row = [];
+ for (var ii = 0; ii < headers.length; ++ii) {
+ if (showdown.helper.isUndefined(rawCells[i][ii])) {
+
+ }
+ row.push(parseCells(rawCells[i][ii], styles[ii]));
+ }
+ cells.push(row);
+ }
+
+ return buildTable(headers, cells);
+ }
+
+ text = globals.converter._dispatch('tables.before', text, options, globals);
+
+ // find escaped pipe characters
+ text = text.replace(/\\(\|)/g, showdown.helper.escapeCharactersCallback);
+
+ // parse multi column tables
+ text = text.replace(tableRgx, parseTable);
+
+ // parse one column tables
+ text = text.replace(singeColTblRgx, parseTable);
+
+ text = globals.converter._dispatch('tables.after', text, options, globals);
+
+ return text;
+});
+
+showdown.subParser('underline', function (text, options, globals) {
+ 'use strict';
+
+ if (!options.underline) {
+ return text;
+ }
+
+ text = globals.converter._dispatch('underline.before', text, options, globals);
+
+ if (options.literalMidWordUnderscores) {
+ text = text.replace(/\b___(\S[\s\S]*?)___\b/g, function (wm, txt) {
+ return '<u>' + txt + '</u>';
+ });
+ text = text.replace(/\b__(\S[\s\S]*?)__\b/g, function (wm, txt) {
+ return '<u>' + txt + '</u>';
+ });
+ } else {
+ text = text.replace(/___(\S[\s\S]*?)___/g, function (wm, m) {
+ return (/\S$/.test(m)) ? '<u>' + m + '</u>' : wm;
+ });
+ text = text.replace(/__(\S[\s\S]*?)__/g, function (wm, m) {
+ return (/\S$/.test(m)) ? '<u>' + m + '</u>' : wm;
+ });
+ }
+
+ // escape remaining underscores to prevent them being parsed by italic and bold
+ text = text.replace(/(_)/g, showdown.helper.escapeCharactersCallback);
+
+ text = globals.converter._dispatch('underline.after', text, options, globals);
+
+ return text;
+});
+
+/**
+ * Swap back in all the special characters we've hidden.
+ */
+showdown.subParser('unescapeSpecialChars', function (text, options, globals) {
+ 'use strict';
+ text = globals.converter._dispatch('unescapeSpecialChars.before', text, options, globals);
+
+ text = text.replace(/¨E(\d+)E/g, function (wholeMatch, m1) {
+ var charCodeToReplace = parseInt(m1);
+ return String.fromCharCode(charCodeToReplace);
+ });
+
+ text = globals.converter._dispatch('unescapeSpecialChars.after', text, options, globals);
+ return text;
+});
+
+showdown.subParser('makeMarkdown.blockquote', function (node, globals) {
+ 'use strict';
+
+ var txt = '';
+ if (node.hasChildNodes()) {
+ var children = node.childNodes,
+ childrenLength = children.length;
+
+ for (var i = 0; i < childrenLength; ++i) {
+ var innerTxt = showdown.subParser('makeMarkdown.node')(children[i], globals);
+
+ if (innerTxt === '') {
+ continue;
+ }
+ txt += innerTxt;
+ }
+ }
+ // cleanup
+ txt = txt.trim();
+ txt = '> ' + txt.split('\n').join('\n> ');
+ return txt;
+});
+
+showdown.subParser('makeMarkdown.codeBlock', function (node, globals) {
+ 'use strict';
+
+ var lang = node.getAttribute('language'),
+ num = node.getAttribute('precodenum');
+ return '```' + lang + '\n' + globals.preList[num] + '\n```';
+});
+
+showdown.subParser('makeMarkdown.codeSpan', function (node) {
+ 'use strict';
+
+ return '`' + node.innerHTML + '`';
+});
+
+showdown.subParser('makeMarkdown.emphasis', function (node, globals) {
+ 'use strict';
+
+ var txt = '';
+ if (node.hasChildNodes()) {
+ txt += '*';
+ var children = node.childNodes,
+ childrenLength = children.length;
+ for (var i = 0; i < childrenLength; ++i) {
+ txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
+ }
+ txt += '*';
+ }
+ return txt;
+});
+
+showdown.subParser('makeMarkdown.header', function (node, globals, headerLevel) {
+ 'use strict';
+
+ var headerMark = new Array(headerLevel + 1).join('#'),
+ txt = '';
+
+ if (node.hasChildNodes()) {
+ txt = headerMark + ' ';
+ var children = node.childNodes,
+ childrenLength = children.length;
+
+ for (var i = 0; i < childrenLength; ++i) {
+ txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
+ }
+ }
+ return txt;
+});
+
+showdown.subParser('makeMarkdown.hr', function () {
+ 'use strict';
+
+ return '---';
+});
+
+showdown.subParser('makeMarkdown.image', function (node) {
+ 'use strict';
+
+ var txt = '';
+ if (node.hasAttribute('src')) {
+ txt += ' + '>';
+ if (node.hasAttribute('width') && node.hasAttribute('height')) {
+ txt += ' =' + node.getAttribute('width') + 'x' + node.getAttribute('height');
+ }
+
+ if (node.hasAttribute('title')) {
+ txt += ' "' + node.getAttribute('title') + '"';
+ }
+ txt += ')';
+ }
+ return txt;
+});
+
+showdown.subParser('makeMarkdown.links', function (node, globals) {
+ 'use strict';
+
+ var txt = '';
+ if (node.hasChildNodes() && node.hasAttribute('href')) {
+ var children = node.childNodes,
+ childrenLength = children.length;
+ txt = '[';
+ for (var i = 0; i < childrenLength; ++i) {
+ txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
+ }
+ txt += '](';
+ txt += '<' + node.getAttribute('href') + '>';
+ if (node.hasAttribute('title')) {
+ txt += ' "' + node.getAttribute('title') + '"';
+ }
+ txt += ')';
+ }
+ return txt;
+});
+
+showdown.subParser('makeMarkdown.list', function (node, globals, type) {
+ 'use strict';
+
+ var txt = '';
+ if (!node.hasChildNodes()) {
+ return '';
+ }
+ var listItems = node.childNodes,
+ listItemsLenght = listItems.length,
+ listNum = node.getAttribute('start') || 1;
+
+ for (var i = 0; i < listItemsLenght; ++i) {
+ if (typeof listItems[i].tagName === 'undefined' || listItems[i].tagName.toLowerCase() !== 'li') {
+ continue;
+ }
+
+ // define the bullet to use in list
+ var bullet = '';
+ if (type === 'ol') {
+ bullet = listNum.toString() + '. ';
+ } else {
+ bullet = '- ';
+ }
+
+ // parse list item
+ txt += bullet + showdown.subParser('makeMarkdown.listItem')(listItems[i], globals);
+ ++listNum;
+ }
+
+ // add comment at the end to prevent consecutive lists to be parsed as one
+ txt += '\n<!-- -->\n';
+ return txt.trim();
+});
+
+showdown.subParser('makeMarkdown.listItem', function (node, globals) {
+ 'use strict';
+
+ var listItemTxt = '';
+
+ var children = node.childNodes,
+ childrenLenght = children.length;
+
+ for (var i = 0; i < childrenLenght; ++i) {
+ listItemTxt += showdown.subParser('makeMarkdown.node')(children[i], globals);
+ }
+ // if it's only one liner, we need to add a newline at the end
+ if (!/\n$/.test(listItemTxt)) {
+ listItemTxt += '\n';
+ } else {
+ // it's multiparagraph, so we need to indent
+ listItemTxt = listItemTxt
+ .split('\n')
+ .join('\n ')
+ .replace(/^ {4}$/gm, '')
+ .replace(/\n\n+/g, '\n\n');
+ }
+
+ return listItemTxt;
+});
+
+
+
+showdown.subParser('makeMarkdown.node', function (node, globals, spansOnly) {
+ 'use strict';
+
+ spansOnly = spansOnly || false;
+
+ var txt = '';
+
+ // edge case of text without wrapper paragraph
+ if (node.nodeType === 3) {
+ return showdown.subParser('makeMarkdown.txt')(node, globals);
+ }
+
+ // HTML comment
+ if (node.nodeType === 8) {
+ return '<!--' + node.data + '-->\n\n';
+ }
+
+ // process only node elements
+ if (node.nodeType !== 1) {
+ return '';
+ }
+
+ var tagName = node.tagName.toLowerCase();
+
+ switch (tagName) {
+
+ //
+ // BLOCKS
+ //
+ case 'h1':
+ if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 1) + '\n\n'; }
+ break;
+ case 'h2':
+ if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 2) + '\n\n'; }
+ break;
+ case 'h3':
+ if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 3) + '\n\n'; }
+ break;
+ case 'h4':
+ if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 4) + '\n\n'; }
+ break;
+ case 'h5':
+ if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 5) + '\n\n'; }
+ break;
+ case 'h6':
+ if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 6) + '\n\n'; }
+ break;
+
+ case 'p':
+ if (!spansOnly) { txt = showdown.subParser('makeMarkdown.paragraph')(node, globals) + '\n\n'; }
+ break;
+
+ case 'blockquote':
+ if (!spansOnly) { txt = showdown.subParser('makeMarkdown.blockquote')(node, globals) + '\n\n'; }
+ break;
+
+ case 'hr':
+ if (!spansOnly) { txt = showdown.subParser('makeMarkdown.hr')(node, globals) + '\n\n'; }
+ break;
+
+ case 'ol':
+ if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ol') + '\n\n'; }
+ break;
+
+ case 'ul':
+ if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ul') + '\n\n'; }
+ break;
+
+ case 'precode':
+ if (!spansOnly) { txt = showdown.subParser('makeMarkdown.codeBlock')(node, globals) + '\n\n'; }
+ break;
+
+ case 'pre':
+ if (!spansOnly) { txt = showdown.subParser('makeMarkdown.pre')(node, globals) + '\n\n'; }
+ break;
+
+ case 'table':
+ if (!spansOnly) { txt = showdown.subParser('makeMarkdown.table')(node, globals) + '\n\n'; }
+ break;
+
+ //
+ // SPANS
+ //
+ case 'code':
+ txt = showdown.subParser('makeMarkdown.codeSpan')(node, globals);
+ break;
+
+ case 'em':
+ case 'i':
+ txt = showdown.subParser('makeMarkdown.emphasis')(node, globals);
+ break;
+
+ case 'strong':
+ case 'b':
+ txt = showdown.subParser('makeMarkdown.strong')(node, globals);
+ break;
+
+ case 'del':
+ txt = showdown.subParser('makeMarkdown.strikethrough')(node, globals);
+ break;
+
+ case 'a':
+ txt = showdown.subParser('makeMarkdown.links')(node, globals);
+ break;
+
+ case 'img':
+ txt = showdown.subParser('makeMarkdown.image')(node, globals);
+ break;
+
+ default:
+ txt = node.outerHTML + '\n\n';
+ }
+
+ // common normalization
+ // TODO eventually
+
+ return txt;
+});
+
+showdown.subParser('makeMarkdown.paragraph', function (node, globals) {
+ 'use strict';
+
+ var txt = '';
+ if (node.hasChildNodes()) {
+ var children = node.childNodes,
+ childrenLength = children.length;
+ for (var i = 0; i < childrenLength; ++i) {
+ txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
+ }
+ }
+
+ // some text normalization
+ txt = txt.trim();
+
+ return txt;
+});
+
+showdown.subParser('makeMarkdown.pre', function (node, globals) {
+ 'use strict';
+
+ var num = node.getAttribute('prenum');
+ return '<pre>' + globals.preList[num] + '</pre>';
+});
+
+showdown.subParser('makeMarkdown.strikethrough', function (node, globals) {
+ 'use strict';
+
+ var txt = '';
+ if (node.hasChildNodes()) {
+ txt += '~~';
+ var children = node.childNodes,
+ childrenLength = children.length;
+ for (var i = 0; i < childrenLength; ++i) {
+ txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
+ }
+ txt += '~~';
+ }
+ return txt;
+});
+
+showdown.subParser('makeMarkdown.strong', function (node, globals) {
+ 'use strict';
+
+ var txt = '';
+ if (node.hasChildNodes()) {
+ txt += '**';
+ var children = node.childNodes,
+ childrenLength = children.length;
+ for (var i = 0; i < childrenLength; ++i) {
+ txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
+ }
+ txt += '**';
+ }
+ return txt;
+});
+
+showdown.subParser('makeMarkdown.table', function (node, globals) {
+ 'use strict';
+
+ var txt = '',
+ tableArray = [[], []],
+ headings = node.querySelectorAll('thead>tr>th'),
+ rows = node.querySelectorAll('tbody>tr'),
+ i, ii;
+ for (i = 0; i < headings.length; ++i) {
+ var headContent = showdown.subParser('makeMarkdown.tableCell')(headings[i], globals),
+ allign = '---';
+
+ if (headings[i].hasAttribute('style')) {
+ var style = headings[i].getAttribute('style').toLowerCase().replace(/\s/g, '');
+ switch (style) {
+ case 'text-align:left;':
+ allign = ':---';
+ break;
+ case 'text-align:right;':
+ allign = '---:';
+ break;
+ case 'text-align:center;':
+ allign = ':---:';
+ break;
+ }
+ }
+ tableArray[0][i] = headContent.trim();
+ tableArray[1][i] = allign;
+ }
+
+ for (i = 0; i < rows.length; ++i) {
+ var r = tableArray.push([]) - 1,
+ cols = rows[i].getElementsByTagName('td');
+
+ for (ii = 0; ii < headings.length; ++ii) {
+ var cellContent = ' ';
+ if (typeof cols[ii] !== 'undefined') {
+ cellContent = showdown.subParser('makeMarkdown.tableCell')(cols[ii], globals);
+ }
+ tableArray[r].push(cellContent);
+ }
+ }
+
+ var cellSpacesCount = 3;
+ for (i = 0; i < tableArray.length; ++i) {
+ for (ii = 0; ii < tableArray[i].length; ++ii) {
+ var strLen = tableArray[i][ii].length;
+ if (strLen > cellSpacesCount) {
+ cellSpacesCount = strLen;
+ }
+ }
+ }
+
+ for (i = 0; i < tableArray.length; ++i) {
+ for (ii = 0; ii < tableArray[i].length; ++ii) {
+ if (i === 1) {
+ if (tableArray[i][ii].slice(-1) === ':') {
+ tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii].slice(-1), cellSpacesCount - 1, '-') + ':';
+ } else {
+ tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount, '-');
+ }
+ } else {
+ tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount);
+ }
+ }
+ txt += '| ' + tableArray[i].join(' | ') + ' |\n';
+ }
+
+ return txt.trim();
+});
+
+showdown.subParser('makeMarkdown.tableCell', function (node, globals) {
+ 'use strict';
+
+ var txt = '';
+ if (!node.hasChildNodes()) {
+ return '';
+ }
+ var children = node.childNodes,
+ childrenLength = children.length;
+
+ for (var i = 0; i < childrenLength; ++i) {
+ txt += showdown.subParser('makeMarkdown.node')(children[i], globals, true);
+ }
+ return txt.trim();
+});
+
+showdown.subParser('makeMarkdown.txt', function (node) {
+ 'use strict';
+
+ var txt = node.nodeValue;
+
+ // multiple spaces are collapsed
+ txt = txt.replace(/ +/g, ' ');
+
+ // replace the custom ¨NBSP; with a space
+ txt = txt.replace(/¨NBSP;/g, ' ');
+
+ // ", <, > and & should replace escaped html entities
+ txt = showdown.helper.unescapeHTMLEntities(txt);
+
+ // escape markdown magic characters
+ // emphasis, strong and strikethrough - can appear everywhere
+ // we also escape pipe (|) because of tables
+ // and escape ` because of code blocks and spans
+ txt = txt.replace(/([*_~|`])/g, '\\$1');
+
+ // escape > because of blockquotes
+ txt = txt.replace(/^(\s*)>/g, '\\$1>');
+
+ // hash character, only troublesome at the beginning of a line because of headers
+ txt = txt.replace(/^#/gm, '\\#');
+
+ // horizontal rules
+ txt = txt.replace(/^(\s*)([-=]{3,})(\s*)$/, '$1\\$2$3');
+
+ // dot, because of ordered lists, only troublesome at the beginning of a line when preceded by an integer
+ txt = txt.replace(/^( {0,3}\d+)\./gm, '$1\\.');
+
+ // +, * and -, at the beginning of a line becomes a list, so we need to escape them also (asterisk was already escaped)
+ txt = txt.replace(/^( {0,3})([+-])/gm, '$1\\$2');
+
+ // images and links, ] followed by ( is problematic, so we escape it
+ txt = txt.replace(/]([\s]*)\(/g, '\\]$1\\(');
+
+ // reference URIs must also be escaped
+ txt = txt.replace(/^ {0,3}\[([\S \t]*?)]:/gm, '\\[$1]:');
+
+ return txt;
+});
+
+var root = this;
+
+// AMD Loader
+if (true) {
+ !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
+ 'use strict';
+ return showdown;
+ }).call(exports, __webpack_require__, exports, module),
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
+
+// CommonJS/nodeJS Loader
+} else {}
+}).call(this);
+
+
+
+
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/ // 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__, {
+ "__EXPERIMENTAL_ELEMENTS": function() { return /* reexport */ __EXPERIMENTAL_ELEMENTS; },
+ "__EXPERIMENTAL_PATHS_WITH_MERGE": function() { return /* reexport */ __EXPERIMENTAL_PATHS_WITH_MERGE; },
+ "__EXPERIMENTAL_STYLE_PROPERTY": function() { return /* reexport */ __EXPERIMENTAL_STYLE_PROPERTY; },
+ "__experimentalCloneSanitizedBlock": function() { return /* reexport */ __experimentalCloneSanitizedBlock; },
+ "__experimentalGetAccessibleBlockLabel": function() { return /* reexport */ getAccessibleBlockLabel; },
+ "__experimentalGetBlockAttributesNamesByRole": function() { return /* reexport */ __experimentalGetBlockAttributesNamesByRole; },
+ "__experimentalGetBlockLabel": function() { return /* reexport */ getBlockLabel; },
+ "__experimentalSanitizeBlockAttributes": function() { return /* reexport */ __experimentalSanitizeBlockAttributes; },
+ "__unstableGetBlockProps": function() { return /* reexport */ getBlockProps; },
+ "__unstableGetInnerBlocksProps": function() { return /* reexport */ getInnerBlocksProps; },
+ "__unstableSerializeAndClean": function() { return /* reexport */ __unstableSerializeAndClean; },
+ "children": function() { return /* reexport */ children; },
+ "cloneBlock": function() { return /* reexport */ cloneBlock; },
+ "createBlock": function() { return /* reexport */ createBlock; },
+ "createBlocksFromInnerBlocksTemplate": function() { return /* reexport */ createBlocksFromInnerBlocksTemplate; },
+ "doBlocksMatchTemplate": function() { return /* reexport */ doBlocksMatchTemplate; },
+ "findTransform": function() { return /* reexport */ findTransform; },
+ "getBlockAttributes": function() { return /* reexport */ getBlockAttributes; },
+ "getBlockContent": function() { return /* reexport */ getBlockInnerHTML; },
+ "getBlockDefaultClassName": function() { return /* reexport */ getBlockDefaultClassName; },
+ "getBlockFromExample": function() { return /* reexport */ getBlockFromExample; },
+ "getBlockMenuDefaultClassName": function() { return /* reexport */ getBlockMenuDefaultClassName; },
+ "getBlockSupport": function() { return /* reexport */ registration_getBlockSupport; },
+ "getBlockTransforms": function() { return /* reexport */ getBlockTransforms; },
+ "getBlockType": function() { return /* reexport */ registration_getBlockType; },
+ "getBlockTypes": function() { return /* reexport */ registration_getBlockTypes; },
+ "getBlockVariations": function() { return /* reexport */ registration_getBlockVariations; },
+ "getCategories": function() { return /* reexport */ categories_getCategories; },
+ "getChildBlockNames": function() { return /* reexport */ registration_getChildBlockNames; },
+ "getDefaultBlockName": function() { return /* reexport */ registration_getDefaultBlockName; },
+ "getFreeformContentHandlerName": function() { return /* reexport */ getFreeformContentHandlerName; },
+ "getGroupingBlockName": function() { return /* reexport */ registration_getGroupingBlockName; },
+ "getPhrasingContentSchema": function() { return /* reexport */ deprecatedGetPhrasingContentSchema; },
+ "getPossibleBlockTransformations": function() { return /* reexport */ getPossibleBlockTransformations; },
+ "getSaveContent": function() { return /* reexport */ getSaveContent; },
+ "getSaveElement": function() { return /* reexport */ getSaveElement; },
+ "getUnregisteredTypeHandlerName": function() { return /* reexport */ getUnregisteredTypeHandlerName; },
+ "hasBlockSupport": function() { return /* reexport */ registration_hasBlockSupport; },
+ "hasChildBlocks": function() { return /* reexport */ registration_hasChildBlocks; },
+ "hasChildBlocksWithInserterSupport": function() { return /* reexport */ registration_hasChildBlocksWithInserterSupport; },
+ "isReusableBlock": function() { return /* reexport */ isReusableBlock; },
+ "isTemplatePart": function() { return /* reexport */ isTemplatePart; },
+ "isUnmodifiedDefaultBlock": function() { return /* reexport */ isUnmodifiedDefaultBlock; },
+ "isValidBlockContent": function() { return /* reexport */ isValidBlockContent; },
+ "isValidIcon": function() { return /* reexport */ isValidIcon; },
+ "node": function() { return /* reexport */ node; },
+ "normalizeIconObject": function() { return /* reexport */ normalizeIconObject; },
+ "parse": function() { return /* reexport */ parser_parse; },
+ "parseWithAttributeSchema": function() { return /* reexport */ parseWithAttributeSchema; },
+ "pasteHandler": function() { return /* reexport */ pasteHandler; },
+ "rawHandler": function() { return /* reexport */ rawHandler; },
+ "registerBlockCollection": function() { return /* reexport */ registerBlockCollection; },
+ "registerBlockStyle": function() { return /* reexport */ registerBlockStyle; },
+ "registerBlockType": function() { return /* reexport */ registerBlockType; },
+ "registerBlockVariation": function() { return /* reexport */ registerBlockVariation; },
+ "serialize": function() { return /* reexport */ serializer_serialize; },
+ "setCategories": function() { return /* reexport */ categories_setCategories; },
+ "setDefaultBlockName": function() { return /* reexport */ setDefaultBlockName; },
+ "setFreeformContentHandlerName": function() { return /* reexport */ setFreeformContentHandlerName; },
+ "setGroupingBlockName": function() { return /* reexport */ setGroupingBlockName; },
+ "setUnregisteredTypeHandlerName": function() { return /* reexport */ setUnregisteredTypeHandlerName; },
+ "store": function() { return /* reexport */ store; },
+ "switchToBlockType": function() { return /* reexport */ switchToBlockType; },
+ "synchronizeBlocksWithTemplate": function() { return /* reexport */ synchronizeBlocksWithTemplate; },
+ "unregisterBlockStyle": function() { return /* reexport */ unregisterBlockStyle; },
+ "unregisterBlockType": function() { return /* reexport */ unregisterBlockType; },
+ "unregisterBlockVariation": function() { return /* reexport */ unregisterBlockVariation; },
+ "unstable__bootstrapServerSideBlockDefinitions": function() { return /* reexport */ unstable__bootstrapServerSideBlockDefinitions; },
+ "updateCategory": function() { return /* reexport */ categories_updateCategory; },
+ "withBlockContentContext": function() { return /* reexport */ withBlockContentContext; }
+});
+
+// NAMESPACE OBJECT: ./node_modules/@wordpress/blocks/build-module/store/selectors.js
+var selectors_namespaceObject = {};
+__webpack_require__.r(selectors_namespaceObject);
+__webpack_require__.d(selectors_namespaceObject, {
+ "__experimentalGetUnprocessedBlockTypes": function() { return __experimentalGetUnprocessedBlockTypes; },
+ "getActiveBlockVariation": function() { return getActiveBlockVariation; },
+ "getBlockStyles": function() { return getBlockStyles; },
+ "getBlockSupport": function() { return getBlockSupport; },
+ "getBlockType": function() { return getBlockType; },
+ "getBlockTypes": function() { return getBlockTypes; },
+ "getBlockVariations": function() { return getBlockVariations; },
+ "getCategories": function() { return getCategories; },
+ "getChildBlockNames": function() { return getChildBlockNames; },
+ "getCollections": function() { return getCollections; },
+ "getDefaultBlockName": function() { return getDefaultBlockName; },
+ "getDefaultBlockVariation": function() { return getDefaultBlockVariation; },
+ "getFreeformFallbackBlockName": function() { return getFreeformFallbackBlockName; },
+ "getGroupingBlockName": function() { return getGroupingBlockName; },
+ "getUnregisteredFallbackBlockName": function() { return getUnregisteredFallbackBlockName; },
+ "hasBlockSupport": function() { return hasBlockSupport; },
+ "hasChildBlocks": function() { return hasChildBlocks; },
+ "hasChildBlocksWithInserterSupport": function() { return hasChildBlocksWithInserterSupport; },
+ "isMatchingSearchTerm": function() { return isMatchingSearchTerm; }
+});
+
+// NAMESPACE OBJECT: ./node_modules/@wordpress/blocks/build-module/store/actions.js
+var actions_namespaceObject = {};
+__webpack_require__.r(actions_namespaceObject);
+__webpack_require__.d(actions_namespaceObject, {
+ "__experimentalReapplyBlockTypeFilters": function() { return __experimentalReapplyBlockTypeFilters; },
+ "__experimentalRegisterBlockType": function() { return __experimentalRegisterBlockType; },
+ "addBlockCollection": function() { return addBlockCollection; },
+ "addBlockStyles": function() { return addBlockStyles; },
+ "addBlockTypes": function() { return addBlockTypes; },
+ "addBlockVariations": function() { return addBlockVariations; },
+ "removeBlockCollection": function() { return removeBlockCollection; },
+ "removeBlockStyles": function() { return removeBlockStyles; },
+ "removeBlockTypes": function() { return removeBlockTypes; },
+ "removeBlockVariations": function() { return removeBlockVariations; },
+ "setCategories": function() { return setCategories; },
+ "setDefaultBlockName": function() { return actions_setDefaultBlockName; },
+ "setFreeformFallbackBlockName": function() { return setFreeformFallbackBlockName; },
+ "setGroupingBlockName": function() { return actions_setGroupingBlockName; },
+ "setUnregisteredFallbackBlockName": function() { return setUnregisteredFallbackBlockName; },
+ "updateCategory": function() { return updateCategory; }
+});
+
+;// CONCATENATED MODULE: external ["wp","data"]
+var external_wp_data_namespaceObject = window["wp"]["data"];
+;// CONCATENATED MODULE: external "lodash"
+var external_lodash_namespaceObject = window["lodash"];
+;// CONCATENATED MODULE: external ["wp","i18n"]
+var external_wp_i18n_namespaceObject = window["wp"]["i18n"];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/reducer.js
+/**
+ * External dependencies
+ */
+
+/**
+ * WordPress dependencies
+ */
+
+
+
+/**
+ * @typedef {Object} WPBlockCategory
+ *
+ * @property {string} slug Unique category slug.
+ * @property {string} title Category label, for display in user interface.
+ */
+
+/**
+ * Default set of categories.
+ *
+ * @type {WPBlockCategory[]}
+ */
+
+const DEFAULT_CATEGORIES = [{
+ slug: 'text',
+ title: (0,external_wp_i18n_namespaceObject.__)('Text')
+}, {
+ slug: 'media',
+ title: (0,external_wp_i18n_namespaceObject.__)('Media')
+}, {
+ slug: 'design',
+ title: (0,external_wp_i18n_namespaceObject.__)('Design')
+}, {
+ slug: 'widgets',
+ title: (0,external_wp_i18n_namespaceObject.__)('Widgets')
+}, {
+ slug: 'theme',
+ title: (0,external_wp_i18n_namespaceObject.__)('Theme')
+}, {
+ slug: 'embed',
+ title: (0,external_wp_i18n_namespaceObject.__)('Embeds')
+}, {
+ slug: 'reusable',
+ title: (0,external_wp_i18n_namespaceObject.__)('Reusable blocks')
+}];
+/**
+ * Reducer managing the unprocessed block types in a form passed when registering the by block.
+ * It's for internal use only. It allows recomputing the processed block types on-demand after block type filters
+ * get added or removed.
+ *
+ * @param {Object} state Current state.
+ * @param {Object} action Dispatched action.
+ *
+ * @return {Object} Updated state.
+ */
+
+function unprocessedBlockTypes() {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ let action = arguments.length > 1 ? arguments[1] : undefined;
+
+ switch (action.type) {
+ case 'ADD_UNPROCESSED_BLOCK_TYPE':
+ return { ...state,
+ [action.blockType.name]: action.blockType
+ };
+
+ case 'REMOVE_BLOCK_TYPES':
+ return (0,external_lodash_namespaceObject.omit)(state, action.names);
+ }
+
+ return state;
+}
+/**
+ * Reducer managing the processed block types with all filters applied.
+ * The state is derived from the `unprocessedBlockTypes` reducer.
+ *
+ * @param {Object} state Current state.
+ * @param {Object} action Dispatched action.
+ *
+ * @return {Object} Updated state.
+ */
+
+function blockTypes() {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ let action = arguments.length > 1 ? arguments[1] : undefined;
+
+ switch (action.type) {
+ case 'ADD_BLOCK_TYPES':
+ return { ...state,
+ ...(0,external_lodash_namespaceObject.keyBy)(action.blockTypes, 'name')
+ };
+
+ case 'REMOVE_BLOCK_TYPES':
+ return (0,external_lodash_namespaceObject.omit)(state, action.names);
+ }
+
+ return state;
+}
+/**
+ * Reducer managing the block style variations.
+ *
+ * @param {Object} state Current state.
+ * @param {Object} action Dispatched action.
+ *
+ * @return {Object} Updated state.
+ */
+
+function blockStyles() {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ let action = arguments.length > 1 ? arguments[1] : undefined;
+
+ switch (action.type) {
+ case 'ADD_BLOCK_TYPES':
+ return { ...state,
+ ...(0,external_lodash_namespaceObject.mapValues)((0,external_lodash_namespaceObject.keyBy)(action.blockTypes, 'name'), blockType => {
+ return (0,external_lodash_namespaceObject.uniqBy)([...(0,external_lodash_namespaceObject.get)(blockType, ['styles'], []).map(style => ({ ...style,
+ source: 'block'
+ })), ...(0,external_lodash_namespaceObject.get)(state, [blockType.name], []).filter(_ref => {
+ let {
+ source
+ } = _ref;
+ return 'block' !== source;
+ })], style => style.name);
+ })
+ };
+
+ case 'ADD_BLOCK_STYLES':
+ return { ...state,
+ [action.blockName]: (0,external_lodash_namespaceObject.uniqBy)([...(0,external_lodash_namespaceObject.get)(state, [action.blockName], []), ...action.styles], style => style.name)
+ };
+
+ case 'REMOVE_BLOCK_STYLES':
+ return { ...state,
+ [action.blockName]: (0,external_lodash_namespaceObject.filter)((0,external_lodash_namespaceObject.get)(state, [action.blockName], []), style => action.styleNames.indexOf(style.name) === -1)
+ };
+ }
+
+ return state;
+}
+/**
+ * Reducer managing the block variations.
+ *
+ * @param {Object} state Current state.
+ * @param {Object} action Dispatched action.
+ *
+ * @return {Object} Updated state.
+ */
+
+function blockVariations() {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ let action = arguments.length > 1 ? arguments[1] : undefined;
+
+ switch (action.type) {
+ case 'ADD_BLOCK_TYPES':
+ return { ...state,
+ ...(0,external_lodash_namespaceObject.mapValues)((0,external_lodash_namespaceObject.keyBy)(action.blockTypes, 'name'), blockType => {
+ return (0,external_lodash_namespaceObject.uniqBy)([...(0,external_lodash_namespaceObject.get)(blockType, ['variations'], []).map(variation => ({ ...variation,
+ source: 'block'
+ })), ...(0,external_lodash_namespaceObject.get)(state, [blockType.name], []).filter(_ref2 => {
+ let {
+ source
+ } = _ref2;
+ return 'block' !== source;
+ })], variation => variation.name);
+ })
+ };
+
+ case 'ADD_BLOCK_VARIATIONS':
+ return { ...state,
+ [action.blockName]: (0,external_lodash_namespaceObject.uniqBy)([...(0,external_lodash_namespaceObject.get)(state, [action.blockName], []), ...action.variations], variation => variation.name)
+ };
+
+ case 'REMOVE_BLOCK_VARIATIONS':
+ return { ...state,
+ [action.blockName]: (0,external_lodash_namespaceObject.filter)((0,external_lodash_namespaceObject.get)(state, [action.blockName], []), variation => action.variationNames.indexOf(variation.name) === -1)
+ };
+ }
+
+ return state;
+}
+/**
+ * Higher-order Reducer creating a reducer keeping track of given block name.
+ *
+ * @param {string} setActionType Action type.
+ *
+ * @return {Function} Reducer.
+ */
+
+function createBlockNameSetterReducer(setActionType) {
+ return function () {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
+ let action = arguments.length > 1 ? arguments[1] : undefined;
+
+ switch (action.type) {
+ case 'REMOVE_BLOCK_TYPES':
+ if (action.names.indexOf(state) !== -1) {
+ return null;
+ }
+
+ return state;
+
+ case setActionType:
+ return action.name || null;
+ }
+
+ return state;
+ };
+}
+const defaultBlockName = createBlockNameSetterReducer('SET_DEFAULT_BLOCK_NAME');
+const freeformFallbackBlockName = createBlockNameSetterReducer('SET_FREEFORM_FALLBACK_BLOCK_NAME');
+const unregisteredFallbackBlockName = createBlockNameSetterReducer('SET_UNREGISTERED_FALLBACK_BLOCK_NAME');
+const groupingBlockName = createBlockNameSetterReducer('SET_GROUPING_BLOCK_NAME');
+/**
+ * Reducer managing the categories
+ *
+ * @param {WPBlockCategory[]} state Current state.
+ * @param {Object} action Dispatched action.
+ *
+ * @return {WPBlockCategory[]} Updated state.
+ */
+
+function categories() {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_CATEGORIES;
+ let action = arguments.length > 1 ? arguments[1] : undefined;
+
+ switch (action.type) {
+ case 'SET_CATEGORIES':
+ return action.categories || [];
+
+ case 'UPDATE_CATEGORY':
+ {
+ if (!action.category || (0,external_lodash_namespaceObject.isEmpty)(action.category)) {
+ return state;
+ }
+
+ const categoryToChange = (0,external_lodash_namespaceObject.find)(state, ['slug', action.slug]);
+
+ if (categoryToChange) {
+ return (0,external_lodash_namespaceObject.map)(state, category => {
+ if (category.slug === action.slug) {
+ return { ...category,
+ ...action.category
+ };
+ }
+
+ return category;
+ });
+ }
+ }
+ }
+
+ return state;
+}
+function collections() {
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ let action = arguments.length > 1 ? arguments[1] : undefined;
+
+ switch (action.type) {
+ case 'ADD_BLOCK_COLLECTION':
+ return { ...state,
+ [action.namespace]: {
+ title: action.title,
+ icon: action.icon
+ }
+ };
+
+ case 'REMOVE_BLOCK_COLLECTION':
+ return (0,external_lodash_namespaceObject.omit)(state, action.namespace);
+ }
+
+ return state;
+}
+/* harmony default export */ var reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
+ unprocessedBlockTypes,
+ blockTypes,
+ blockStyles,
+ blockVariations,
+ defaultBlockName,
+ freeformFallbackBlockName,
+ unregisteredFallbackBlockName,
+ groupingBlockName,
+ categories,
+ collections
+}));
+
+;// 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: ./node_modules/@wordpress/blocks/build-module/store/selectors.js
+/**
+ * External dependencies
+ */
+
+
+/** @typedef {import('../api/registration').WPBlockVariation} WPBlockVariation */
+
+/** @typedef {import('../api/registration').WPBlockVariationScope} WPBlockVariationScope */
+
+/** @typedef {import('./reducer').WPBlockCategory} WPBlockCategory */
+
+/**
+ * Given a block name or block type object, returns the corresponding
+ * normalized block type object.
+ *
+ * @param {Object} state Blocks state.
+ * @param {(string|Object)} nameOrType Block name or type object
+ *
+ * @return {Object} Block type object.
+ */
+
+const getNormalizedBlockType = (state, nameOrType) => 'string' === typeof nameOrType ? getBlockType(state, nameOrType) : nameOrType;
+/**
+ * Returns all the unprocessed block types as passed during the registration.
+ *
+ * @param {Object} state Data state.
+ *
+ * @return {Array} Unprocessed block types.
+ */
+
+
+function __experimentalGetUnprocessedBlockTypes(state) {
+ return state.unprocessedBlockTypes;
+}
+/**
+ * Returns all the available block types.
+ *
+ * @param {Object} state Data state.
+ *
+ * @return {Array} Block Types.
+ */
+
+const getBlockTypes = rememo(state => Object.values(state.blockTypes), state => [state.blockTypes]);
+/**
+ * Returns a block type by name.
+ *
+ * @param {Object} state Data state.
+ * @param {string} name Block type name.
+ *
+ * @return {Object?} Block Type.
+ */
+
+function getBlockType(state, name) {
+ return state.blockTypes[name];
+}
+/**
+ * Returns block styles by block name.
+ *
+ * @param {Object} state Data state.
+ * @param {string} name Block type name.
+ *
+ * @return {Array?} Block Styles.
+ */
+
+function getBlockStyles(state, name) {
+ return state.blockStyles[name];
+}
+/**
+ * Returns block variations by block name.
+ *
+ * @param {Object} state Data state.
+ * @param {string} blockName Block type name.
+ * @param {WPBlockVariationScope} [scope] Block variation scope name.
+ *
+ * @return {(WPBlockVariation[]|void)} Block variations.
+ */
+
+const getBlockVariations = rememo((state, blockName, scope) => {
+ const variations = state.blockVariations[blockName];
+
+ if (!variations || !scope) {
+ return variations;
+ }
+
+ return variations.filter(variation => {
+ // For backward compatibility reasons, variation's scope defaults to
+ // `block` and `inserter` when not set.
+ return (variation.scope || ['block', 'inserter']).includes(scope);
+ });
+}, (state, blockName) => [state.blockVariations[blockName]]);
+/**
+ * Returns the active block variation for a given block based on its attributes.
+ * Variations are determined by their `isActive` property.
+ * Which is either an array of block attribute keys or a function.
+ *
+ * In case of an array of block attribute keys, the `attributes` are compared
+ * to the variation's attributes using strict equality check.
+ *
+ * In case of function type, the function should accept a block's attributes
+ * and the variation's attributes and determines if a variation is active.
+ * A function that accepts a block's attributes and the variation's attributes and determines if a variation is active.
+ *
+ * @param {Object} state Data state.
+ * @param {string} blockName Name of block (example: “core/columns”).
+ * @param {Object} attributes Block attributes used to determine active variation.
+ * @param {WPBlockVariationScope} [scope] Block variation scope name.
+ *
+ * @return {(WPBlockVariation|undefined)} Active block variation.
+ */
+
+function getActiveBlockVariation(state, blockName, attributes, scope) {
+ const variations = getBlockVariations(state, blockName, scope);
+ const match = variations === null || variations === void 0 ? void 0 : variations.find(variation => {
+ var _variation$isActive;
+
+ if (Array.isArray(variation.isActive)) {
+ const blockType = getBlockType(state, blockName);
+ const attributeKeys = Object.keys((blockType === null || blockType === void 0 ? void 0 : blockType.attributes) || {});
+ const definedAttributes = variation.isActive.filter(attribute => attributeKeys.includes(attribute));
+
+ if (definedAttributes.length === 0) {
+ return false;
+ }
+
+ return definedAttributes.every(attribute => attributes[attribute] === variation.attributes[attribute]);
+ }
+
+ return (_variation$isActive = variation.isActive) === null || _variation$isActive === void 0 ? void 0 : _variation$isActive.call(variation, attributes, variation.attributes);
+ });
+ return match;
+}
+/**
+ * Returns the default block variation for the given block type.
+ * When there are multiple variations annotated as the default one,
+ * the last added item is picked. This simplifies registering overrides.
+ * When there is no default variation set, it returns the first item.
+ *
+ * @param {Object} state Data state.
+ * @param {string} blockName Block type name.
+ * @param {WPBlockVariationScope} [scope] Block variation scope name.
+ *
+ * @return {?WPBlockVariation} The default block variation.
+ */
+
+function getDefaultBlockVariation(state, blockName, scope) {
+ const variations = getBlockVariations(state, blockName, scope);
+ return (0,external_lodash_namespaceObject.findLast)(variations, 'isDefault') || (0,external_lodash_namespaceObject.first)(variations);
+}
+/**
+ * Returns all the available categories.
+ *
+ * @param {Object} state Data state.
+ *
+ * @return {WPBlockCategory[]} Categories list.
+ */
+
+function getCategories(state) {
+ return state.categories;
+}
+/**
+ * Returns all the available collections.
+ *
+ * @param {Object} state Data state.
+ *
+ * @return {Object} Collections list.
+ */
+
+function getCollections(state) {
+ return state.collections;
+}
+/**
+ * Returns the name of the default block name.
+ *
+ * @param {Object} state Data state.
+ *
+ * @return {string?} Default block name.
+ */
+
+function getDefaultBlockName(state) {
+ return state.defaultBlockName;
+}
+/**
+ * Returns the name of the block for handling non-block content.
+ *
+ * @param {Object} state Data state.
+ *
+ * @return {string?} Name of the block for handling non-block content.
+ */
+
+function getFreeformFallbackBlockName(state) {
+ return state.freeformFallbackBlockName;
+}
+/**
+ * Returns the name of the block for handling unregistered blocks.
+ *
+ * @param {Object} state Data state.
+ *
+ * @return {string?} Name of the block for handling unregistered blocks.
+ */
+
+function getUnregisteredFallbackBlockName(state) {
+ return state.unregisteredFallbackBlockName;
+}
+/**
+ * Returns the name of the block for handling unregistered blocks.
+ *
+ * @param {Object} state Data state.
+ *
+ * @return {string?} Name of the block for handling unregistered blocks.
+ */
+
+function getGroupingBlockName(state) {
+ return state.groupingBlockName;
+}
+/**
+ * Returns an array with the child blocks of a given block.
+ *
+ * @param {Object} state Data state.
+ * @param {string} blockName Block type name.
+ *
+ * @return {Array} Array of child block names.
+ */
+
+const getChildBlockNames = rememo((state, blockName) => {
+ return (0,external_lodash_namespaceObject.map)((0,external_lodash_namespaceObject.filter)(state.blockTypes, blockType => {
+ return (0,external_lodash_namespaceObject.includes)(blockType.parent, blockName);
+ }), _ref => {
+ let {
+ name
+ } = _ref;
+ return name;
+ });
+}, state => [state.blockTypes]);
+/**
+ * Returns the block support value for a feature, if defined.
+ *
+ * @param {Object} state Data state.
+ * @param {(string|Object)} nameOrType Block name or type object
+ * @param {Array|string} feature Feature to retrieve
+ * @param {*} defaultSupports Default value to return if not
+ * explicitly defined
+ *
+ * @return {?*} Block support value
+ */
+
+const getBlockSupport = (state, nameOrType, feature, defaultSupports) => {
+ const blockType = getNormalizedBlockType(state, nameOrType);
+
+ if (!(blockType !== null && blockType !== void 0 && blockType.supports)) {
+ return defaultSupports;
+ }
+
+ return (0,external_lodash_namespaceObject.get)(blockType.supports, feature, defaultSupports);
+};
+/**
+ * Returns true if the block defines support for a feature, or false otherwise.
+ *
+ * @param {Object} state Data state.
+ * @param {(string|Object)} nameOrType Block name or type object.
+ * @param {string} feature Feature to test.
+ * @param {boolean} defaultSupports Whether feature is supported by
+ * default if not explicitly defined.
+ *
+ * @return {boolean} Whether block supports feature.
+ */
+
+function hasBlockSupport(state, nameOrType, feature, defaultSupports) {
+ return !!getBlockSupport(state, nameOrType, feature, defaultSupports);
+}
+/**
+ * Returns true if the block type by the given name or object value matches a
+ * search term, or false otherwise.
+ *
+ * @param {Object} state Blocks state.
+ * @param {(string|Object)} nameOrType Block name or type object.
+ * @param {string} searchTerm Search term by which to filter.
+ *
+ * @return {Object[]} Whether block type matches search term.
+ */
+
+function isMatchingSearchTerm(state, nameOrType, searchTerm) {
+ const blockType = getNormalizedBlockType(state, nameOrType);
+ const getNormalizedSearchTerm = (0,external_lodash_namespaceObject.flow)([// Disregard diacritics.
+ // Input: "média"
+ external_lodash_namespaceObject.deburr, // Lowercase.
+ // Input: "MEDIA"
+ term => term.toLowerCase(), // Strip leading and trailing whitespace.
+ // Input: " media "
+ term => term.trim()]);
+ const normalizedSearchTerm = getNormalizedSearchTerm(searchTerm);
+ const isSearchMatch = (0,external_lodash_namespaceObject.flow)([getNormalizedSearchTerm, normalizedCandidate => (0,external_lodash_namespaceObject.includes)(normalizedCandidate, normalizedSearchTerm)]);
+ return isSearchMatch(blockType.title) || (0,external_lodash_namespaceObject.some)(blockType.keywords, isSearchMatch) || isSearchMatch(blockType.category);
+}
+/**
+ * Returns a boolean indicating if a block has child blocks or not.
+ *
+ * @param {Object} state Data state.
+ * @param {string} blockName Block type name.
+ *
+ * @return {boolean} True if a block contains child blocks and false otherwise.
+ */
+
+const hasChildBlocks = (state, blockName) => {
+ return getChildBlockNames(state, blockName).length > 0;
+};
+/**
+ * Returns a boolean indicating if a block has at least one child block with inserter support.
+ *
+ * @param {Object} state Data state.
+ * @param {string} blockName Block type name.
+ *
+ * @return {boolean} True if a block contains at least one child blocks with inserter support
+ * and false otherwise.
+ */
+
+const hasChildBlocksWithInserterSupport = (state, blockName) => {
+ return (0,external_lodash_namespaceObject.some)(getChildBlockNames(state, blockName), childBlockName => {
+ return hasBlockSupport(state, childBlockName, 'inserter', true);
+ });
+};
+
+;// CONCATENATED MODULE: external ["wp","hooks"]
+var external_wp_hooks_namespaceObject = window["wp"]["hooks"];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/constants.js
+const STORE_NAME = 'core/blocks';
+
+;// 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<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.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));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])}
+
+;// CONCATENATED MODULE: ./node_modules/colord/plugins/a11y.mjs
+var a11y_o=function(o){var t=o/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},a11y_t=function(t){return.2126*a11y_o(t.r)+.7152*a11y_o(t.g)+.0722*a11y_o(t.b)};/* harmony default export */ function a11y(o){o.prototype.luminance=function(){return o=a11y_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=a11y_t(e),d=a11y_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}}
+
+;// CONCATENATED MODULE: external ["wp","element"]
+var external_wp_element_namespaceObject = window["wp"]["element"];
+;// CONCATENATED MODULE: external ["wp","dom"]
+var external_wp_dom_namespaceObject = window["wp"]["dom"];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/constants.js
+const BLOCK_ICON_DEFAULT = 'block-default';
+/**
+ * Array of valid keys in a block type settings deprecation object.
+ *
+ * @type {string[]}
+ */
+
+const DEPRECATED_ENTRY_KEYS = ['attributes', 'supports', 'save', 'migrate', 'isEligible', 'apiVersion'];
+const __EXPERIMENTAL_STYLE_PROPERTY = {
+ //kept for back-compatibility purposes.
+ '--wp--style--color--link': {
+ value: ['color', 'link'],
+ support: ['color', 'link']
+ },
+ background: {
+ value: ['color', 'gradient'],
+ support: ['color', 'gradients']
+ },
+ backgroundColor: {
+ value: ['color', 'background'],
+ support: ['color', 'background'],
+ requiresOptOut: true
+ },
+ borderColor: {
+ value: ['border', 'color'],
+ support: ['__experimentalBorder', 'color']
+ },
+ borderRadius: {
+ value: ['border', 'radius'],
+ support: ['__experimentalBorder', 'radius'],
+ properties: {
+ borderTopLeftRadius: 'topLeft',
+ borderTopRightRadius: 'topRight',
+ borderBottomLeftRadius: 'bottomLeft',
+ borderBottomRightRadius: 'bottomRight'
+ }
+ },
+ borderStyle: {
+ value: ['border', 'style'],
+ support: ['__experimentalBorder', 'style']
+ },
+ borderWidth: {
+ value: ['border', 'width'],
+ support: ['__experimentalBorder', 'width']
+ },
+ color: {
+ value: ['color', 'text'],
+ support: ['color', 'text'],
+ requiresOptOut: true
+ },
+ linkColor: {
+ value: ['elements', 'link', 'color', 'text'],
+ support: ['color', 'link']
+ },
+ fontFamily: {
+ value: ['typography', 'fontFamily'],
+ support: ['typography', '__experimentalFontFamily']
+ },
+ fontSize: {
+ value: ['typography', 'fontSize'],
+ support: ['typography', 'fontSize']
+ },
+ fontStyle: {
+ value: ['typography', 'fontStyle'],
+ support: ['typography', '__experimentalFontStyle']
+ },
+ fontWeight: {
+ value: ['typography', 'fontWeight'],
+ support: ['typography', '__experimentalFontWeight']
+ },
+ lineHeight: {
+ value: ['typography', 'lineHeight'],
+ support: ['typography', 'lineHeight']
+ },
+ margin: {
+ value: ['spacing', 'margin'],
+ support: ['spacing', 'margin'],
+ properties: {
+ marginTop: 'top',
+ marginRight: 'right',
+ marginBottom: 'bottom',
+ marginLeft: 'left'
+ }
+ },
+ padding: {
+ value: ['spacing', 'padding'],
+ support: ['spacing', 'padding'],
+ properties: {
+ paddingTop: 'top',
+ paddingRight: 'right',
+ paddingBottom: 'bottom',
+ paddingLeft: 'left'
+ }
+ },
+ textDecoration: {
+ value: ['typography', 'textDecoration'],
+ support: ['typography', '__experimentalTextDecoration']
+ },
+ textTransform: {
+ value: ['typography', 'textTransform'],
+ support: ['typography', '__experimentalTextTransform']
+ },
+ letterSpacing: {
+ value: ['typography', 'letterSpacing'],
+ support: ['typography', '__experimentalLetterSpacing']
+ },
+ '--wp--style--block-gap': {
+ value: ['spacing', 'blockGap'],
+ support: ['spacing', 'blockGap']
+ }
+};
+const __EXPERIMENTAL_ELEMENTS = {
+ link: 'a',
+ h1: 'h1',
+ h2: 'h2',
+ h3: 'h3',
+ h4: 'h4',
+ h5: 'h5',
+ h6: 'h6'
+};
+const __EXPERIMENTAL_PATHS_WITH_MERGE = {
+ 'color.duotone': true,
+ 'color.gradients': true,
+ 'color.palette': true,
+ 'typography.fontFamilies': true,
+ 'typography.fontSizes': true
+};
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/registration.js
+/* eslint no-console: [ 'error', { allow: [ 'error', 'warn' ] } ] */
+
+/**
+ * External dependencies
+ */
+
+/**
+ * WordPress dependencies
+ */
+
+
+
+/**
+ * Internal dependencies
+ */
+
+const i18nBlockSchema = {
+ title: "block title",
+ description: "block description",
+ keywords: ["block keyword"],
+ styles: [{
+ label: "block style label"
+ }],
+ variations: [{
+ title: "block variation title",
+ description: "block variation description",
+ keywords: ["block variation keyword"]
+ }]
+};
+
+
+/**
+ * An icon type definition. One of a Dashicon slug, an element,
+ * or a component.
+ *
+ * @typedef {(string|WPElement|WPComponent)} WPIcon
+ *
+ * @see https://developer.wordpress.org/resource/dashicons/
+ */
+
+/**
+ * Render behavior of a block type icon; one of a Dashicon slug, an element,
+ * or a component.
+ *
+ * @typedef {WPIcon} WPBlockTypeIconRender
+ */
+
+/**
+ * An object describing a normalized block type icon.
+ *
+ * @typedef {Object} WPBlockTypeIconDescriptor
+ *
+ * @property {WPBlockTypeIconRender} src Render behavior of the icon,
+ * one of a Dashicon slug, an
+ * element, or a component.
+ * @property {string} background Optimal background hex string
+ * color when displaying icon.
+ * @property {string} foreground Optimal foreground hex string
+ * color when displaying icon.
+ * @property {string} shadowColor Optimal shadow hex string
+ * color when displaying icon.
+ */
+
+/**
+ * Value to use to render the icon for a block type in an editor interface,
+ * either a Dashicon slug, an element, a component, or an object describing
+ * the icon.
+ *
+ * @typedef {(WPBlockTypeIconDescriptor|WPBlockTypeIconRender)} WPBlockTypeIcon
+ */
+
+/**
+ * Named block variation scopes.
+ *
+ * @typedef {'block'|'inserter'|'transform'} WPBlockVariationScope
+ */
+
+/**
+ * An object describing a variation defined for the block type.
+ *
+ * @typedef {Object} WPBlockVariation
+ *
+ * @property {string} name The unique and machine-readable name.
+ * @property {string} title A human-readable variation title.
+ * @property {string} [description] A detailed variation description.
+ * @property {string} [category] Block type category classification,
+ * used in search interfaces to arrange
+ * block types by category.
+ * @property {WPIcon} [icon] An icon helping to visualize the variation.
+ * @property {boolean} [isDefault] Indicates whether the current variation is
+ * the default one. Defaults to `false`.
+ * @property {Object} [attributes] Values which override block attributes.
+ * @property {Array[]} [innerBlocks] Initial configuration of nested blocks.
+ * @property {Object} [example] Example provides structured data for
+ * the block preview. You can set to
+ * `undefined` to disable the preview shown
+ * for the block type.
+ * @property {WPBlockVariationScope[]} [scope] The list of scopes where the variation
+ * is applicable. When not provided, it
+ * assumes all available scopes.
+ * @property {string[]} [keywords] An array of terms (which can be translated)
+ * that help users discover the variation
+ * while searching.
+ * @property {Function|string[]} [isActive] This can be a function or an array of block attributes.
+ * Function that accepts a block's attributes and the
+ * variation's attributes and determines if a variation is active.
+ * This function doesn't try to find a match dynamically based
+ * on all block's attributes, as in many cases some attributes are irrelevant.
+ * An example would be for `embed` block where we only care
+ * about `providerNameSlug` attribute's value.
+ * We can also use a `string[]` to tell which attributes
+ * should be compared as a shorthand. Each attributes will
+ * be matched and the variation will be active if all of them are matching.
+ */
+
+/**
+ * Defined behavior of a block type.
+ *
+ * @typedef {Object} WPBlockType
+ *
+ * @property {string} name Block type's namespaced name.
+ * @property {string} title Human-readable block type label.
+ * @property {string} [description] A detailed block type description.
+ * @property {string} [category] Block type category classification,
+ * used in search interfaces to arrange
+ * block types by category.
+ * @property {WPBlockTypeIcon} [icon] Block type icon.
+ * @property {string[]} [keywords] Additional keywords to produce block
+ * type as result in search interfaces.
+ * @property {Object} [attributes] Block type attributes.
+ * @property {WPComponent} [save] Optional component describing
+ * serialized markup structure of a
+ * block type.
+ * @property {WPComponent} edit Component rendering an element to
+ * manipulate the attributes of a block
+ * in the context of an editor.
+ * @property {WPBlockVariation[]} [variations] The list of block variations.
+ * @property {Object} [example] Example provides structured data for
+ * the block preview. When not defined
+ * then no preview is shown.
+ */
+
+const serverSideBlockDefinitions = {};
+/**
+ * Sets the server side block definition of blocks.
+ *
+ * @param {Object} definitions Server-side block definitions
+ */
+// eslint-disable-next-line camelcase
+
+function unstable__bootstrapServerSideBlockDefinitions(definitions) {
+ for (const blockName of Object.keys(definitions)) {
+ // Don't overwrite if already set. It covers the case when metadata
+ // was initialized from the server.
+ if (serverSideBlockDefinitions[blockName]) {
+ // We still need to polyfill `apiVersion` for WordPress version
+ // lower than 5.7. If it isn't present in the definition shared
+ // from the server, we try to fallback to the definition passed.
+ // @see https://github.com/WordPress/gutenberg/pull/29279
+ if (serverSideBlockDefinitions[blockName].apiVersion === undefined && definitions[blockName].apiVersion) {
+ serverSideBlockDefinitions[blockName].apiVersion = definitions[blockName].apiVersion;
+ }
+
+ continue;
+ }
+
+ serverSideBlockDefinitions[blockName] = (0,external_lodash_namespaceObject.mapKeys)((0,external_lodash_namespaceObject.pickBy)(definitions[blockName], value => !(0,external_lodash_namespaceObject.isNil)(value)), (value, key) => (0,external_lodash_namespaceObject.camelCase)(key));
+ }
+}
+/**
+ * Gets block settings from metadata loaded from `block.json` file.
+ *
+ * @param {Object} metadata Block metadata loaded from `block.json`.
+ * @param {string} metadata.textdomain Textdomain to use with translations.
+ *
+ * @return {Object} Block settings.
+ */
+
+function getBlockSettingsFromMetadata(_ref) {
+ let {
+ textdomain,
+ ...metadata
+ } = _ref;
+ const allowedFields = ['apiVersion', 'title', 'category', 'parent', 'icon', 'description', 'keywords', 'attributes', 'providesContext', 'usesContext', 'supports', 'styles', 'example', 'variations'];
+ const settings = (0,external_lodash_namespaceObject.pick)(metadata, allowedFields);
+
+ if (textdomain) {
+ Object.keys(i18nBlockSchema).forEach(key => {
+ if (!settings[key]) {
+ return;
+ }
+
+ settings[key] = translateBlockSettingUsingI18nSchema(i18nBlockSchema[key], settings[key], textdomain);
+ });
+ }
+
+ return settings;
+}
+/**
+ * Registers a new block provided a unique name and an object defining its
+ * behavior. Once registered, the block is made available as an option to any
+ * editor interface where blocks are implemented.
+ *
+ * @param {string|Object} blockNameOrMetadata Block type name or its metadata.
+ * @param {Object} settings Block settings.
+ *
+ * @return {?WPBlockType} The block, if it has been successfully registered;
+ * otherwise `undefined`.
+ */
+
+
+function registerBlockType(blockNameOrMetadata, settings) {
+ const name = (0,external_lodash_namespaceObject.isObject)(blockNameOrMetadata) ? blockNameOrMetadata.name : blockNameOrMetadata;
+
+ if (typeof name !== 'string') {
+ console.error('Block names must be strings.');
+ return;
+ }
+
+ if (!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(name)) {
+ console.error('Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block');
+ return;
+ }
+
+ if ((0,external_wp_data_namespaceObject.select)(store).getBlockType(name)) {
+ console.error('Block "' + name + '" is already registered.');
+ return;
+ }
+
+ if ((0,external_lodash_namespaceObject.isObject)(blockNameOrMetadata)) {
+ unstable__bootstrapServerSideBlockDefinitions({
+ [name]: getBlockSettingsFromMetadata(blockNameOrMetadata)
+ });
+ }
+
+ const blockType = {
+ name,
+ icon: BLOCK_ICON_DEFAULT,
+ keywords: [],
+ attributes: {},
+ providesContext: {},
+ usesContext: [],
+ supports: {},
+ styles: [],
+ variations: [],
+ save: () => null,
+ ...(serverSideBlockDefinitions === null || serverSideBlockDefinitions === void 0 ? void 0 : serverSideBlockDefinitions[name]),
+ ...settings
+ };
+
+ (0,external_wp_data_namespaceObject.dispatch)(store).__experimentalRegisterBlockType(blockType);
+
+ return (0,external_wp_data_namespaceObject.select)(store).getBlockType(name);
+}
+/**
+ * Translates block settings provided with metadata using the i18n schema.
+ *
+ * @param {string|string[]|Object[]} i18nSchema I18n schema for the block setting.
+ * @param {string|string[]|Object[]} settingValue Value for the block setting.
+ * @param {string} textdomain Textdomain to use with translations.
+ *
+ * @return {string|string[]|Object[]} Translated setting.
+ */
+
+function translateBlockSettingUsingI18nSchema(i18nSchema, settingValue, textdomain) {
+ if ((0,external_lodash_namespaceObject.isString)(i18nSchema) && (0,external_lodash_namespaceObject.isString)(settingValue)) {
+ // eslint-disable-next-line @wordpress/i18n-no-variables, @wordpress/i18n-text-domain
+ return (0,external_wp_i18n_namespaceObject._x)(settingValue, i18nSchema, textdomain);
+ }
+
+ if ((0,external_lodash_namespaceObject.isArray)(i18nSchema) && !(0,external_lodash_namespaceObject.isEmpty)(i18nSchema) && (0,external_lodash_namespaceObject.isArray)(settingValue)) {
+ return settingValue.map(value => translateBlockSettingUsingI18nSchema(i18nSchema[0], value, textdomain));
+ }
+
+ if ((0,external_lodash_namespaceObject.isObject)(i18nSchema) && !(0,external_lodash_namespaceObject.isEmpty)(i18nSchema) && (0,external_lodash_namespaceObject.isObject)(settingValue)) {
+ return Object.keys(settingValue).reduce((accumulator, key) => {
+ if (!i18nSchema[key]) {
+ accumulator[key] = settingValue[key];
+ return accumulator;
+ }
+
+ accumulator[key] = translateBlockSettingUsingI18nSchema(i18nSchema[key], settingValue[key], textdomain);
+ return accumulator;
+ }, {});
+ }
+
+ return settingValue;
+}
+/**
+ * Registers a new block collection to group blocks in the same namespace in the inserter.
+ *
+ * @param {string} namespace The namespace to group blocks by in the inserter; corresponds to the block namespace.
+ * @param {Object} settings The block collection settings.
+ * @param {string} settings.title The title to display in the block inserter.
+ * @param {Object} [settings.icon] The icon to display in the block inserter.
+ */
+
+
+function registerBlockCollection(namespace, _ref2) {
+ let {
+ title,
+ icon
+ } = _ref2;
+ (0,external_wp_data_namespaceObject.dispatch)(store).addBlockCollection(namespace, title, icon);
+}
+/**
+ * Unregisters a block collection
+ *
+ * @param {string} namespace The namespace to group blocks by in the inserter; corresponds to the block namespace
+ *
+ */
+
+function unregisterBlockCollection(namespace) {
+ dispatch(blocksStore).removeBlockCollection(namespace);
+}
+/**
+ * Unregisters a block.
+ *
+ * @param {string} name Block name.
+ *
+ * @return {?WPBlockType} The previous block value, if it has been successfully
+ * unregistered; otherwise `undefined`.
+ */
+
+function unregisterBlockType(name) {
+ const oldBlock = (0,external_wp_data_namespaceObject.select)(store).getBlockType(name);
+
+ if (!oldBlock) {
+ console.error('Block "' + name + '" is not registered.');
+ return;
+ }
+
+ (0,external_wp_data_namespaceObject.dispatch)(store).removeBlockTypes(name);
+ return oldBlock;
+}
+/**
+ * Assigns name of block for handling non-block content.
+ *
+ * @param {string} blockName Block name.
+ */
+
+function setFreeformContentHandlerName(blockName) {
+ (0,external_wp_data_namespaceObject.dispatch)(store).setFreeformFallbackBlockName(blockName);
+}
+/**
+ * Retrieves name of block handling non-block content, or undefined if no
+ * handler has been defined.
+ *
+ * @return {?string} Block name.
+ */
+
+function getFreeformContentHandlerName() {
+ return (0,external_wp_data_namespaceObject.select)(store).getFreeformFallbackBlockName();
+}
+/**
+ * Retrieves name of block used for handling grouping interactions.
+ *
+ * @return {?string} Block name.
+ */
+
+function registration_getGroupingBlockName() {
+ return (0,external_wp_data_namespaceObject.select)(store).getGroupingBlockName();
+}
+/**
+ * Assigns name of block handling unregistered block types.
+ *
+ * @param {string} blockName Block name.
+ */
+
+function setUnregisteredTypeHandlerName(blockName) {
+ (0,external_wp_data_namespaceObject.dispatch)(store).setUnregisteredFallbackBlockName(blockName);
+}
+/**
+ * Retrieves name of block handling unregistered block types, or undefined if no
+ * handler has been defined.
+ *
+ * @return {?string} Block name.
+ */
+
+function getUnregisteredTypeHandlerName() {
+ return (0,external_wp_data_namespaceObject.select)(store).getUnregisteredFallbackBlockName();
+}
+/**
+ * Assigns the default block name.
+ *
+ * @param {string} name Block name.
+ */
+
+function setDefaultBlockName(name) {
+ (0,external_wp_data_namespaceObject.dispatch)(store).setDefaultBlockName(name);
+}
+/**
+ * Assigns name of block for handling block grouping interactions.
+ *
+ * @param {string} name Block name.
+ */
+
+function setGroupingBlockName(name) {
+ (0,external_wp_data_namespaceObject.dispatch)(store).setGroupingBlockName(name);
+}
+/**
+ * Retrieves the default block name.
+ *
+ * @return {?string} Block name.
+ */
+
+function registration_getDefaultBlockName() {
+ return (0,external_wp_data_namespaceObject.select)(store).getDefaultBlockName();
+}
+/**
+ * Returns a registered block type.
+ *
+ * @param {string} name Block name.
+ *
+ * @return {?Object} Block type.
+ */
+
+function registration_getBlockType(name) {
+ var _select;
+
+ return (_select = (0,external_wp_data_namespaceObject.select)(store)) === null || _select === void 0 ? void 0 : _select.getBlockType(name);
+}
+/**
+ * Returns all registered blocks.
+ *
+ * @return {Array} Block settings.
+ */
+
+function registration_getBlockTypes() {
+ return (0,external_wp_data_namespaceObject.select)(store).getBlockTypes();
+}
+/**
+ * Returns the block support value for a feature, if defined.
+ *
+ * @param {(string|Object)} nameOrType Block name or type object
+ * @param {string} feature Feature to retrieve
+ * @param {*} defaultSupports Default value to return if not
+ * explicitly defined
+ *
+ * @return {?*} Block support value
+ */
+
+function registration_getBlockSupport(nameOrType, feature, defaultSupports) {
+ return (0,external_wp_data_namespaceObject.select)(store).getBlockSupport(nameOrType, feature, defaultSupports);
+}
+/**
+ * Returns true if the block defines support for a feature, or false otherwise.
+ *
+ * @param {(string|Object)} nameOrType Block name or type object.
+ * @param {string} feature Feature to test.
+ * @param {boolean} defaultSupports Whether feature is supported by
+ * default if not explicitly defined.
+ *
+ * @return {boolean} Whether block supports feature.
+ */
+
+function registration_hasBlockSupport(nameOrType, feature, defaultSupports) {
+ return (0,external_wp_data_namespaceObject.select)(store).hasBlockSupport(nameOrType, feature, defaultSupports);
+}
+/**
+ * Determines whether or not the given block is a reusable block. This is a
+ * special block type that is used to point to a global block stored via the
+ * API.
+ *
+ * @param {Object} blockOrType Block or Block Type to test.
+ *
+ * @return {boolean} Whether the given block is a reusable block.
+ */
+
+function isReusableBlock(blockOrType) {
+ return (blockOrType === null || blockOrType === void 0 ? void 0 : blockOrType.name) === 'core/block';
+}
+/**
+ * Determines whether or not the given block is a template part. This is a
+ * special block type that allows composing a page template out of reusable
+ * design elements.
+ *
+ * @param {Object} blockOrType Block or Block Type to test.
+ *
+ * @return {boolean} Whether the given block is a template part.
+ */
+
+function isTemplatePart(blockOrType) {
+ return blockOrType.name === 'core/template-part';
+}
+/**
+ * Returns an array with the child blocks of a given block.
+ *
+ * @param {string} blockName Name of block (example: “latest-posts”).
+ *
+ * @return {Array} Array of child block names.
+ */
+
+const registration_getChildBlockNames = blockName => {
+ return (0,external_wp_data_namespaceObject.select)(store).getChildBlockNames(blockName);
+};
+/**
+ * Returns a boolean indicating if a block has child blocks or not.
+ *
+ * @param {string} blockName Name of block (example: “latest-posts”).
+ *
+ * @return {boolean} True if a block contains child blocks and false otherwise.
+ */
+
+const registration_hasChildBlocks = blockName => {
+ return (0,external_wp_data_namespaceObject.select)(store).hasChildBlocks(blockName);
+};
+/**
+ * Returns a boolean indicating if a block has at least one child block with inserter support.
+ *
+ * @param {string} blockName Block type name.
+ *
+ * @return {boolean} True if a block contains at least one child blocks with inserter support
+ * and false otherwise.
+ */
+
+const registration_hasChildBlocksWithInserterSupport = blockName => {
+ return (0,external_wp_data_namespaceObject.select)(store).hasChildBlocksWithInserterSupport(blockName);
+};
+/**
+ * Registers a new block style variation for the given block.
+ *
+ * @param {string} blockName Name of block (example: “core/latest-posts”).
+ * @param {Object} styleVariation Object containing `name` which is the class name applied to the block and `label` which identifies the variation to the user.
+ */
+
+const registerBlockStyle = (blockName, styleVariation) => {
+ (0,external_wp_data_namespaceObject.dispatch)(store).addBlockStyles(blockName, styleVariation);
+};
+/**
+ * Unregisters a block style variation for the given block.
+ *
+ * @param {string} blockName Name of block (example: “core/latest-posts”).
+ * @param {string} styleVariationName Name of class applied to the block.
+ */
+
+const unregisterBlockStyle = (blockName, styleVariationName) => {
+ (0,external_wp_data_namespaceObject.dispatch)(store).removeBlockStyles(blockName, styleVariationName);
+};
+/**
+ * Returns an array with the variations of a given block type.
+ *
+ * @param {string} blockName Name of block (example: “core/columns”).
+ * @param {WPBlockVariationScope} [scope] Block variation scope name.
+ *
+ * @return {(WPBlockVariation[]|void)} Block variations.
+ */
+
+const registration_getBlockVariations = (blockName, scope) => {
+ return (0,external_wp_data_namespaceObject.select)(store).getBlockVariations(blockName, scope);
+};
+/**
+ * Registers a new block variation for the given block type.
+ *
+ * @param {string} blockName Name of the block (example: “core/columns”).
+ * @param {WPBlockVariation} variation Object describing a block variation.
+ */
+
+const registerBlockVariation = (blockName, variation) => {
+ (0,external_wp_data_namespaceObject.dispatch)(store).addBlockVariations(blockName, variation);
+};
+/**
+ * Unregisters a block variation defined for the given block type.
+ *
+ * @param {string} blockName Name of the block (example: “core/columns”).
+ * @param {string} variationName Name of the variation defined for the block.
+ */
+
+const unregisterBlockVariation = (blockName, variationName) => {
+ (0,external_wp_data_namespaceObject.dispatch)(store).removeBlockVariations(blockName, variationName);
+};
+
+;// 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 = (v4);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/factory.js
+/**
+ * External dependencies
+ */
+
+
+/**
+ * WordPress dependencies
+ */
+
+
+/**
+ * Internal dependencies
+ */
+
+
+
+/**
+ * Returns a block object given its type and attributes.
+ *
+ * @param {string} name Block name.
+ * @param {Object} attributes Block attributes.
+ * @param {?Array} innerBlocks Nested blocks.
+ *
+ * @return {Object} Block object.
+ */
+
+function createBlock(name) {
+ let attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+ let innerBlocks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
+
+ const sanitizedAttributes = __experimentalSanitizeBlockAttributes(name, attributes);
+
+ const clientId = esm_browser_v4(); // Blocks are stored with a unique ID, the assigned type name, the block
+ // attributes, and their inner blocks.
+
+ return {
+ clientId,
+ name,
+ isValid: true,
+ attributes: sanitizedAttributes,
+ innerBlocks
+ };
+}
+/**
+ * Given an array of InnerBlocks templates or Block Objects,
+ * returns an array of created Blocks from them.
+ * It handles the case of having InnerBlocks as Blocks by
+ * converting them to the proper format to continue recursively.
+ *
+ * @param {Array} innerBlocksOrTemplate Nested blocks or InnerBlocks templates.
+ *
+ * @return {Object[]} Array of Block objects.
+ */
+
+function createBlocksFromInnerBlocksTemplate() {
+ let innerBlocksOrTemplate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ return innerBlocksOrTemplate.map(innerBlock => {
+ const innerBlockTemplate = Array.isArray(innerBlock) ? innerBlock : [innerBlock.name, innerBlock.attributes, innerBlock.innerBlocks];
+ const [name, attributes, innerBlocks = []] = innerBlockTemplate;
+ return createBlock(name, attributes, createBlocksFromInnerBlocksTemplate(innerBlocks));
+ });
+}
+/**
+ * Given a block object, returns a copy of the block object while sanitizing its attributes,
+ * optionally merging new attributes and/or replacing its inner blocks.
+ *
+ * @param {Object} block Block instance.
+ * @param {Object} mergeAttributes Block attributes.
+ * @param {?Array} newInnerBlocks Nested blocks.
+ *
+ * @return {Object} A cloned block.
+ */
+
+function __experimentalCloneSanitizedBlock(block) {
+ let mergeAttributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+ let newInnerBlocks = arguments.length > 2 ? arguments[2] : undefined;
+ const clientId = esm_browser_v4();
+
+ const sanitizedAttributes = __experimentalSanitizeBlockAttributes(block.name, { ...block.attributes,
+ ...mergeAttributes
+ });
+
+ return { ...block,
+ clientId,
+ attributes: sanitizedAttributes,
+ innerBlocks: newInnerBlocks || block.innerBlocks.map(innerBlock => __experimentalCloneSanitizedBlock(innerBlock))
+ };
+}
+/**
+ * Given a block object, returns a copy of the block object,
+ * optionally merging new attributes and/or replacing its inner blocks.
+ *
+ * @param {Object} block Block instance.
+ * @param {Object} mergeAttributes Block attributes.
+ * @param {?Array} newInnerBlocks Nested blocks.
+ *
+ * @return {Object} A cloned block.
+ */
+
+function cloneBlock(block) {
+ let mergeAttributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+ let newInnerBlocks = arguments.length > 2 ? arguments[2] : undefined;
+ const clientId = esm_browser_v4();
+ return { ...block,
+ clientId,
+ attributes: { ...block.attributes,
+ ...mergeAttributes
+ },
+ innerBlocks: newInnerBlocks || block.innerBlocks.map(innerBlock => cloneBlock(innerBlock))
+ };
+}
+/**
+ * Returns a boolean indicating whether a transform is possible based on
+ * various bits of context.
+ *
+ * @param {Object} transform The transform object to validate.
+ * @param {string} direction Is this a 'from' or 'to' transform.
+ * @param {Array} blocks The blocks to transform from.
+ *
+ * @return {boolean} Is the transform possible?
+ */
+
+const isPossibleTransformForSource = (transform, direction, blocks) => {
+ if ((0,external_lodash_namespaceObject.isEmpty)(blocks)) {
+ return false;
+ } // If multiple blocks are selected, only multi block transforms
+ // or wildcard transforms are allowed.
+
+
+ const isMultiBlock = blocks.length > 1;
+ const firstBlockName = (0,external_lodash_namespaceObject.first)(blocks).name;
+ const isValidForMultiBlocks = isWildcardBlockTransform(transform) || !isMultiBlock || transform.isMultiBlock;
+
+ if (!isValidForMultiBlocks) {
+ return false;
+ } // Check non-wildcard transforms to ensure that transform is valid
+ // for a block selection of multiple blocks of different types
+
+
+ if (!isWildcardBlockTransform(transform) && !(0,external_lodash_namespaceObject.every)(blocks, {
+ name: firstBlockName
+ })) {
+ return false;
+ } // Only consider 'block' type transforms as valid.
+
+
+ const isBlockType = transform.type === 'block';
+
+ if (!isBlockType) {
+ return false;
+ } // Check if the transform's block name matches the source block (or is a wildcard)
+ // only if this is a transform 'from'.
+
+
+ const sourceBlock = (0,external_lodash_namespaceObject.first)(blocks);
+ const hasMatchingName = direction !== 'from' || transform.blocks.indexOf(sourceBlock.name) !== -1 || isWildcardBlockTransform(transform);
+
+ if (!hasMatchingName) {
+ return false;
+ } // Don't allow single Grouping blocks to be transformed into
+ // a Grouping block.
+
+
+ if (!isMultiBlock && isContainerGroupBlock(sourceBlock.name) && isContainerGroupBlock(transform.blockName)) {
+ return false;
+ } // If the transform has a `isMatch` function specified, check that it returns true.
+
+
+ if ((0,external_lodash_namespaceObject.isFunction)(transform.isMatch)) {
+ const attributes = transform.isMultiBlock ? blocks.map(block => block.attributes) : sourceBlock.attributes;
+ const block = transform.isMultiBlock ? blocks : sourceBlock;
+
+ if (!transform.isMatch(attributes, block)) {
+ return false;
+ }
+ }
+
+ if (transform.usingMobileTransformations && isWildcardBlockTransform(transform) && !isContainerGroupBlock(sourceBlock.name)) {
+ return false;
+ }
+
+ return true;
+};
+/**
+ * Returns block types that the 'blocks' can be transformed into, based on
+ * 'from' transforms on other blocks.
+ *
+ * @param {Array} blocks The blocks to transform from.
+ *
+ * @return {Array} Block types that the blocks can be transformed into.
+ */
+
+
+const getBlockTypesForPossibleFromTransforms = blocks => {
+ if ((0,external_lodash_namespaceObject.isEmpty)(blocks)) {
+ return [];
+ }
+
+ const allBlockTypes = registration_getBlockTypes(); // filter all blocks to find those with a 'from' transform.
+
+ const blockTypesWithPossibleFromTransforms = (0,external_lodash_namespaceObject.filter)(allBlockTypes, blockType => {
+ const fromTransforms = getBlockTransforms('from', blockType.name);
+ return !!findTransform(fromTransforms, transform => {
+ return isPossibleTransformForSource(transform, 'from', blocks);
+ });
+ });
+ return blockTypesWithPossibleFromTransforms;
+};
+/**
+ * Returns block types that the 'blocks' can be transformed into, based on
+ * the source block's own 'to' transforms.
+ *
+ * @param {Array} blocks The blocks to transform from.
+ *
+ * @return {Array} Block types that the source can be transformed into.
+ */
+
+
+const getBlockTypesForPossibleToTransforms = blocks => {
+ if ((0,external_lodash_namespaceObject.isEmpty)(blocks)) {
+ return [];
+ }
+
+ const sourceBlock = (0,external_lodash_namespaceObject.first)(blocks);
+ const blockType = registration_getBlockType(sourceBlock.name);
+ const transformsTo = blockType ? getBlockTransforms('to', blockType.name) : []; // filter all 'to' transforms to find those that are possible.
+
+ const possibleTransforms = (0,external_lodash_namespaceObject.filter)(transformsTo, transform => {
+ return transform && isPossibleTransformForSource(transform, 'to', blocks);
+ }); // Build a list of block names using the possible 'to' transforms.
+
+ const blockNames = (0,external_lodash_namespaceObject.flatMap)(possibleTransforms, transformation => transformation.blocks); // Map block names to block types.
+
+ return blockNames.map(name => registration_getBlockType(name));
+};
+/**
+ * Determines whether transform is a "block" type
+ * and if so whether it is a "wildcard" transform
+ * ie: targets "any" block type
+ *
+ * @param {Object} t the Block transform object
+ *
+ * @return {boolean} whether transform is a wildcard transform
+ */
+
+
+const isWildcardBlockTransform = t => t && t.type === 'block' && Array.isArray(t.blocks) && t.blocks.includes('*');
+/**
+ * Determines whether the given Block is the core Block which
+ * acts as a container Block for other Blocks as part of the
+ * Grouping mechanics
+ *
+ * @param {string} name the name of the Block to test against
+ *
+ * @return {boolean} whether or not the Block is the container Block type
+ */
+
+const isContainerGroupBlock = name => name === registration_getGroupingBlockName();
+/**
+ * Returns an array of block types that the set of blocks received as argument
+ * can be transformed into.
+ *
+ * @param {Array} blocks Blocks array.
+ *
+ * @return {Array} Block types that the blocks argument can be transformed to.
+ */
+
+function getPossibleBlockTransformations(blocks) {
+ if ((0,external_lodash_namespaceObject.isEmpty)(blocks)) {
+ return [];
+ }
+
+ const blockTypesForFromTransforms = getBlockTypesForPossibleFromTransforms(blocks);
+ const blockTypesForToTransforms = getBlockTypesForPossibleToTransforms(blocks);
+ return (0,external_lodash_namespaceObject.uniq)([...blockTypesForFromTransforms, ...blockTypesForToTransforms]);
+}
+/**
+ * Given an array of transforms, returns the highest-priority transform where
+ * the predicate function returns a truthy value. A higher-priority transform
+ * is one with a lower priority value (i.e. first in priority order). Returns
+ * null if the transforms set is empty or the predicate function returns a
+ * falsey value for all entries.
+ *
+ * @param {Object[]} transforms Transforms to search.
+ * @param {Function} predicate Function returning true on matching transform.
+ *
+ * @return {?Object} Highest-priority transform candidate.
+ */
+
+function findTransform(transforms, predicate) {
+ // The hooks library already has built-in mechanisms for managing priority
+ // queue, so leverage via locally-defined instance.
+ const hooks = (0,external_wp_hooks_namespaceObject.createHooks)();
+
+ for (let i = 0; i < transforms.length; i++) {
+ const candidate = transforms[i];
+
+ if (predicate(candidate)) {
+ hooks.addFilter('transform', 'transform/' + i.toString(), result => result ? result : candidate, candidate.priority);
+ }
+ } // Filter name is arbitrarily chosen but consistent with above aggregation.
+
+
+ return hooks.applyFilters('transform', null);
+}
+/**
+ * Returns normal block transforms for a given transform direction, optionally
+ * for a specific block by name, or an empty array if there are no transforms.
+ * If no block name is provided, returns transforms for all blocks. A normal
+ * transform object includes `blockName` as a property.
+ *
+ * @param {string} direction Transform direction ("to", "from").
+ * @param {string|Object} blockTypeOrName Block type or name.
+ *
+ * @return {Array} Block transforms for direction.
+ */
+
+function getBlockTransforms(direction, blockTypeOrName) {
+ // When retrieving transforms for all block types, recurse into self.
+ if (blockTypeOrName === undefined) {
+ return (0,external_lodash_namespaceObject.flatMap)(registration_getBlockTypes(), _ref => {
+ let {
+ name
+ } = _ref;
+ return getBlockTransforms(direction, name);
+ });
+ } // Validate that block type exists and has array of direction.
+
+
+ const blockType = normalizeBlockType(blockTypeOrName);
+ const {
+ name: blockName,
+ transforms
+ } = blockType || {};
+
+ if (!transforms || !Array.isArray(transforms[direction])) {
+ return [];
+ }
+
+ const usingMobileTransformations = transforms.supportedMobileTransforms && Array.isArray(transforms.supportedMobileTransforms);
+ const filteredTransforms = usingMobileTransformations ? (0,external_lodash_namespaceObject.filter)(transforms[direction], t => {
+ if (t.type === 'raw') {
+ return true;
+ }
+
+ if (!t.blocks || !t.blocks.length) {
+ return false;
+ }
+
+ if (isWildcardBlockTransform(t)) {
+ return true;
+ }
+
+ return (0,external_lodash_namespaceObject.every)(t.blocks, transformBlockName => transforms.supportedMobileTransforms.includes(transformBlockName));
+ }) : transforms[direction]; // Map transforms to normal form.
+
+ return filteredTransforms.map(transform => ({ ...transform,
+ blockName,
+ usingMobileTransformations
+ }));
+}
+/**
+ * Switch one or more blocks into one or more blocks of the new block type.
+ *
+ * @param {Array|Object} blocks Blocks array or block object.
+ * @param {string} name Block name.
+ *
+ * @return {?Array} Array of blocks or null.
+ */
+
+function switchToBlockType(blocks, name) {
+ const blocksArray = (0,external_lodash_namespaceObject.castArray)(blocks);
+ const isMultiBlock = blocksArray.length > 1;
+ const firstBlock = blocksArray[0];
+ const sourceName = firstBlock.name; // Find the right transformation by giving priority to the "to"
+ // transformation.
+
+ const transformationsFrom = getBlockTransforms('from', name);
+ const transformationsTo = getBlockTransforms('to', sourceName);
+ const transformation = findTransform(transformationsTo, t => t.type === 'block' && (isWildcardBlockTransform(t) || t.blocks.indexOf(name) !== -1) && (!isMultiBlock || t.isMultiBlock)) || findTransform(transformationsFrom, t => t.type === 'block' && (isWildcardBlockTransform(t) || t.blocks.indexOf(sourceName) !== -1) && (!isMultiBlock || t.isMultiBlock)); // Stop if there is no valid transformation.
+
+ if (!transformation) {
+ return null;
+ }
+
+ let transformationResults;
+
+ if (transformation.isMultiBlock) {
+ if ((0,external_lodash_namespaceObject.has)(transformation, '__experimentalConvert')) {
+ transformationResults = transformation.__experimentalConvert(blocksArray);
+ } else {
+ transformationResults = transformation.transform(blocksArray.map(currentBlock => currentBlock.attributes), blocksArray.map(currentBlock => currentBlock.innerBlocks));
+ }
+ } else if ((0,external_lodash_namespaceObject.has)(transformation, '__experimentalConvert')) {
+ transformationResults = transformation.__experimentalConvert(firstBlock);
+ } else {
+ transformationResults = transformation.transform(firstBlock.attributes, firstBlock.innerBlocks);
+ } // Ensure that the transformation function returned an object or an array
+ // of objects.
+
+
+ if (!(0,external_lodash_namespaceObject.isObjectLike)(transformationResults)) {
+ return null;
+ } // If the transformation function returned a single object, we want to work
+ // with an array instead.
+
+
+ transformationResults = (0,external_lodash_namespaceObject.castArray)(transformationResults); // Ensure that every block object returned by the transformation has a
+ // valid block type.
+
+ if (transformationResults.some(result => !registration_getBlockType(result.name))) {
+ return null;
+ }
+
+ const hasSwitchedBlock = (0,external_lodash_namespaceObject.some)(transformationResults, result => result.name === name); // Ensure that at least one block object returned by the transformation has
+ // the expected "destination" block type.
+
+ if (!hasSwitchedBlock) {
+ return null;
+ }
+
+ const ret = transformationResults.map(result => {
+ /**
+ * Filters an individual transform result from block transformation.
+ * All of the original blocks are passed, since transformations are
+ * many-to-many, not one-to-one.
+ *
+ * @param {Object} transformedBlock The transformed block.
+ * @param {Object[]} blocks Original blocks transformed.
+ */
+ return (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.switchToBlockType.transformedBlock', result, blocks);
+ });
+ return ret;
+}
+/**
+ * Create a block object from the example API.
+ *
+ * @param {string} name
+ * @param {Object} example
+ *
+ * @return {Object} block.
+ */
+
+const getBlockFromExample = (name, example) => {
+ return createBlock(name, example.attributes, (0,external_lodash_namespaceObject.map)(example.innerBlocks, innerBlock => getBlockFromExample(innerBlock.name, innerBlock)));
+};
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/utils.js
+/**
+ * External dependencies
+ */
+
+
+
+
+/**
+ * WordPress dependencies
+ */
+
+
+
+
+/**
+ * Internal dependencies
+ */
+
+
+
+
+k([names, a11y]);
+/**
+ * Array of icon colors containing a color to be used if the icon color
+ * was not explicitly set but the icon background color was.
+ *
+ * @type {Object}
+ */
+
+const ICON_COLORS = ['#191e23', '#f8f9f9'];
+/**
+ * Determines whether the block is a default block
+ * and its attributes are equal to the default attributes
+ * which means the block is unmodified.
+ *
+ * @param {WPBlock} block Block Object
+ *
+ * @return {boolean} Whether the block is an unmodified default block
+ */
+
+function isUnmodifiedDefaultBlock(block) {
+ const defaultBlockName = registration_getDefaultBlockName();
+
+ if (block.name !== defaultBlockName) {
+ return false;
+ } // Cache a created default block if no cache exists or the default block
+ // name changed.
+
+
+ if (!isUnmodifiedDefaultBlock.block || isUnmodifiedDefaultBlock.block.name !== defaultBlockName) {
+ isUnmodifiedDefaultBlock.block = createBlock(defaultBlockName);
+ }
+
+ const newDefaultBlock = isUnmodifiedDefaultBlock.block;
+ const blockType = registration_getBlockType(defaultBlockName);
+ return (0,external_lodash_namespaceObject.every)(blockType === null || blockType === void 0 ? void 0 : blockType.attributes, (value, key) => newDefaultBlock.attributes[key] === block.attributes[key]);
+}
+/**
+ * Function that checks if the parameter is a valid icon.
+ *
+ * @param {*} icon Parameter to be checked.
+ *
+ * @return {boolean} True if the parameter is a valid icon and false otherwise.
+ */
+
+function isValidIcon(icon) {
+ return !!icon && ((0,external_lodash_namespaceObject.isString)(icon) || (0,external_wp_element_namespaceObject.isValidElement)(icon) || (0,external_lodash_namespaceObject.isFunction)(icon) || icon instanceof external_wp_element_namespaceObject.Component);
+}
+/**
+ * Function that receives an icon as set by the blocks during the registration
+ * and returns a new icon object that is normalized so we can rely on just on possible icon structure
+ * in the codebase.
+ *
+ * @param {WPBlockTypeIconRender} icon Render behavior of a block type icon;
+ * one of a Dashicon slug, an element, or a
+ * component.
+ *
+ * @return {WPBlockTypeIconDescriptor} Object describing the icon.
+ */
+
+function normalizeIconObject(icon) {
+ icon = icon || BLOCK_ICON_DEFAULT;
+
+ if (isValidIcon(icon)) {
+ return {
+ src: icon
+ };
+ }
+
+ if ((0,external_lodash_namespaceObject.has)(icon, ['background'])) {
+ const colordBgColor = w(icon.background);
+ return { ...icon,
+ foreground: icon.foreground ? icon.foreground : (0,external_lodash_namespaceObject.maxBy)(ICON_COLORS, iconColor => colordBgColor.contrast(iconColor)),
+ shadowColor: colordBgColor.alpha(0.3).toRgbString()
+ };
+ }
+
+ return icon;
+}
+/**
+ * Normalizes block type passed as param. When string is passed then
+ * it converts it to the matching block type object.
+ * It passes the original object otherwise.
+ *
+ * @param {string|Object} blockTypeOrName Block type or name.
+ *
+ * @return {?Object} Block type.
+ */
+
+function normalizeBlockType(blockTypeOrName) {
+ if ((0,external_lodash_namespaceObject.isString)(blockTypeOrName)) {
+ return registration_getBlockType(blockTypeOrName);
+ }
+
+ return blockTypeOrName;
+}
+/**
+ * Get the label for the block, usually this is either the block title,
+ * or the value of the block's `label` function when that's specified.
+ *
+ * @param {Object} blockType The block type.
+ * @param {Object} attributes The values of the block's attributes.
+ * @param {Object} context The intended use for the label.
+ *
+ * @return {string} The block label.
+ */
+
+function getBlockLabel(blockType, attributes) {
+ let context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'visual';
+ const {
+ __experimentalLabel: getLabel,
+ title
+ } = blockType;
+ const label = getLabel && getLabel(attributes, {
+ context
+ });
+
+ if (!label) {
+ return title;
+ } // Strip any HTML (i.e. RichText formatting) before returning.
+
+
+ return (0,external_wp_dom_namespaceObject.__unstableStripHTML)(label);
+}
+/**
+ * Get a label for the block for use by screenreaders, this is more descriptive
+ * than the visual label and includes the block title and the value of the
+ * `getLabel` function if it's specified.
+ *
+ * @param {Object} blockType The block type.
+ * @param {Object} attributes The values of the block's attributes.
+ * @param {?number} position The position of the block in the block list.
+ * @param {string} [direction='vertical'] The direction of the block layout.
+ *
+ * @return {string} The block label.
+ */
+
+function getAccessibleBlockLabel(blockType, attributes, position) {
+ let direction = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'vertical';
+ // `title` is already localized, `label` is a user-supplied value.
+ const title = blockType === null || blockType === void 0 ? void 0 : blockType.title;
+ const label = blockType ? getBlockLabel(blockType, attributes, 'accessibility') : '';
+ const hasPosition = position !== undefined; // getBlockLabel returns the block title as a fallback when there's no label,
+ // if it did return the title, this function needs to avoid adding the
+ // title twice within the accessible label. Use this `hasLabel` boolean to
+ // handle that.
+
+ const hasLabel = label && label !== title;
+
+ if (hasPosition && direction === 'vertical') {
+ if (hasLabel) {
+ return (0,external_wp_i18n_namespaceObject.sprintf)(
+ /* translators: accessibility text. 1: The block title. 2: The block row number. 3: The block label.. */
+ (0,external_wp_i18n_namespaceObject.__)('%1$s Block. Row %2$d. %3$s'), title, position, label);
+ }
+
+ return (0,external_wp_i18n_namespaceObject.sprintf)(
+ /* translators: accessibility text. 1: The block title. 2: The block row number. */
+ (0,external_wp_i18n_namespaceObject.__)('%1$s Block. Row %2$d'), title, position);
+ } else if (hasPosition && direction === 'horizontal') {
+ if (hasLabel) {
+ return (0,external_wp_i18n_namespaceObject.sprintf)(
+ /* translators: accessibility text. 1: The block title. 2: The block column number. 3: The block label.. */
+ (0,external_wp_i18n_namespaceObject.__)('%1$s Block. Column %2$d. %3$s'), title, position, label);
+ }
+
+ return (0,external_wp_i18n_namespaceObject.sprintf)(
+ /* translators: accessibility text. 1: The block title. 2: The block column number. */
+ (0,external_wp_i18n_namespaceObject.__)('%1$s Block. Column %2$d'), title, position);
+ }
+
+ if (hasLabel) {
+ return (0,external_wp_i18n_namespaceObject.sprintf)(
+ /* translators: accessibility text. %1: The block title. %2: The block label. */
+ (0,external_wp_i18n_namespaceObject.__)('%1$s Block. %2$s'), title, label);
+ }
+
+ return (0,external_wp_i18n_namespaceObject.sprintf)(
+ /* translators: accessibility text. %s: The block title. */
+ (0,external_wp_i18n_namespaceObject.__)('%s Block'), title);
+}
+/**
+ * Ensure attributes contains only values defined by block type, and merge
+ * default values for missing attributes.
+ *
+ * @param {string} name The block's name.
+ * @param {Object} attributes The block's attributes.
+ * @return {Object} The sanitized attributes.
+ */
+
+function __experimentalSanitizeBlockAttributes(name, attributes) {
+ // Get the type definition associated with a registered block.
+ const blockType = registration_getBlockType(name);
+
+ if (undefined === blockType) {
+ throw new Error(`Block type '${name}' is not registered.`);
+ }
+
+ return (0,external_lodash_namespaceObject.reduce)(blockType.attributes, (accumulator, schema, key) => {
+ const value = attributes[key];
+
+ if (undefined !== value) {
+ accumulator[key] = value;
+ } else if (schema.hasOwnProperty('default')) {
+ accumulator[key] = schema.default;
+ }
+
+ if (['node', 'children'].indexOf(schema.source) !== -1) {
+ // Ensure value passed is always an array, which we're expecting in
+ // the RichText component to handle the deprecated value.
+ if (typeof accumulator[key] === 'string') {
+ accumulator[key] = [accumulator[key]];
+ } else if (!Array.isArray(accumulator[key])) {
+ accumulator[key] = [];
+ }
+ }
+
+ return accumulator;
+ }, {});
+}
+/**
+ * Filter block attributes by `role` and return their names.
+ *
+ * @param {string} name Block attribute's name.
+ * @param {string} role The role of a block attribute.
+ *
+ * @return {string[]} The attribute names that have the provided role.
+ */
+
+function __experimentalGetBlockAttributesNamesByRole(name, role) {
+ var _getBlockType;
+
+ const attributes = (_getBlockType = registration_getBlockType(name)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.attributes;
+ if (!attributes) return [];
+ const attributesNames = Object.keys(attributes);
+ if (!role) return attributesNames;
+ return attributesNames.filter(attributeName => {
+ var _attributes$attribute;
+
+ return ((_attributes$attribute = attributes[attributeName]) === null || _attributes$attribute === void 0 ? void 0 : _attributes$attribute.__experimentalRole) === role;
+ });
+}
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/actions.js
+/**
+ * External dependencies
+ */
+
+/**
+ * WordPress dependencies
+ */
+
+
+
+/**
+ * Internal dependencies
+ */
+
+
+
+
+/** @typedef {import('../api/registration').WPBlockVariation} WPBlockVariation */
+
+const {
+ error,
+ warn
+} = window.console;
+/**
+ * Mapping of legacy category slugs to their latest normal values, used to
+ * accommodate updates of the default set of block categories.
+ *
+ * @type {Record<string,string>}
+ */
+
+const LEGACY_CATEGORY_MAPPING = {
+ common: 'text',
+ formatting: 'text',
+ layout: 'design'
+};
+/**
+ * Takes the unprocessed block type data and applies all the existing filters for the registered block type.
+ * Next, it validates all the settings and performs additional processing to the block type definition.
+ *
+ * @param {WPBlockType} blockType Unprocessed block type settings.
+ *
+ * @return {?WPBlockType} The block, if it has been successfully registered; otherwise `undefined`.
+ */
+
+function processBlockType(blockType) {
+ const {
+ name
+ } = blockType;
+ const settings = (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.registerBlockType', { ...blockType
+ }, name);
+
+ if (settings.deprecated) {
+ settings.deprecated = settings.deprecated.map(deprecation => (0,external_lodash_namespaceObject.pick)( // Only keep valid deprecation keys.
+ (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.registerBlockType', // Merge deprecation keys with pre-filter settings
+ // so that filters that depend on specific keys being
+ // present don't fail.
+ { // Omit deprecation keys here so that deprecations
+ // can opt out of specific keys like "supports".
+ ...(0,external_lodash_namespaceObject.omit)(blockType, DEPRECATED_ENTRY_KEYS),
+ ...deprecation
+ }, name), DEPRECATED_ENTRY_KEYS));
+ }
+
+ if (!(0,external_lodash_namespaceObject.isPlainObject)(settings)) {
+ error('Block settings must be a valid object.');
+ return;
+ }
+
+ if (!(0,external_lodash_namespaceObject.isFunction)(settings.save)) {
+ error('The "save" property must be a valid function.');
+ return;
+ }
+
+ if ('edit' in settings && !(0,external_lodash_namespaceObject.isFunction)(settings.edit)) {
+ error('The "edit" property must be a valid function.');
+ return;
+ } // Canonicalize legacy categories to equivalent fallback.
+
+
+ if (LEGACY_CATEGORY_MAPPING.hasOwnProperty(settings.category)) {
+ settings.category = LEGACY_CATEGORY_MAPPING[settings.category];
+ }
+
+ if ('category' in settings && !(0,external_lodash_namespaceObject.some)((0,external_wp_data_namespaceObject.select)(STORE_NAME).getCategories(), {
+ slug: settings.category
+ })) {
+ warn('The block "' + name + '" is registered with an invalid category "' + settings.category + '".');
+ delete settings.category;
+ }
+
+ if (!('title' in settings) || settings.title === '') {
+ error('The block "' + name + '" must have a title.');
+ return;
+ }
+
+ if (typeof settings.title !== 'string') {
+ error('Block titles must be strings.');
+ return;
+ }
+
+ settings.icon = normalizeIconObject(settings.icon);
+
+ if (!isValidIcon(settings.icon.src)) {
+ error('The icon passed is invalid. ' + 'The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional');
+ return;
+ }
+
+ return settings;
+}
+/**
+ * Returns an action object used in signalling that block types have been added.
+ *
+ * @param {Array|Object} blockTypes Block types received.
+ *
+ * @return {Object} Action object.
+ */
+
+
+function addBlockTypes(blockTypes) {
+ return {
+ type: 'ADD_BLOCK_TYPES',
+ blockTypes: (0,external_lodash_namespaceObject.castArray)(blockTypes)
+ };
+}
+/**
+ * Yields action objects signaling that the passed block type's settings should be stored in the state.
+ *
+ * @param {WPBlockType} blockType Unprocessed block type settings.
+ *
+ * @yield {Object} Action object.
+ */
+
+function* __experimentalRegisterBlockType(blockType) {
+ yield {
+ type: 'ADD_UNPROCESSED_BLOCK_TYPE',
+ blockType
+ };
+ const processedBlockType = processBlockType(blockType);
+
+ if (!processedBlockType) {
+ return;
+ }
+
+ yield addBlockTypes(processedBlockType);
+}
+/**
+ * Yields an action object signaling that all block types should be computed again.
+ * It uses stored unprocessed block types and all the most recent list of registered filters.
+ *
+ * It addresses the issue where third party block filters get registered after third party blocks. A sample sequence:
+ * 1. Filter A.
+ * 2. Block B.
+ * 3. Block C.
+ * 4. Filter D.
+ * 5. Filter E.
+ * 6. Block F.
+ * 7. Filter G.
+ * In this scenario some filters would not get applied for all blocks because they are registered too late.
+ *
+ * @yield {Object} Action object.
+ */
+
+function* __experimentalReapplyBlockTypeFilters() {
+ const unprocessedBlockTypes = (0,external_wp_data_namespaceObject.select)(STORE_NAME).__experimentalGetUnprocessedBlockTypes();
+
+ const processedBlockTypes = Object.keys(unprocessedBlockTypes).reduce((accumulator, blockName) => {
+ const result = processBlockType(unprocessedBlockTypes[blockName]);
+
+ if (result) {
+ accumulator.push(result);
+ }
+
+ return accumulator;
+ }, []);
+
+ if (!processedBlockTypes.length) {
+ return;
+ }
+
+ yield addBlockTypes(processedBlockTypes);
+}
+/**
+ * Returns an action object used to remove a registered block type.
+ *
+ * @param {string|Array} names Block name.
+ *
+ * @return {Object} Action object.
+ */
+
+function removeBlockTypes(names) {
+ return {
+ type: 'REMOVE_BLOCK_TYPES',
+ names: (0,external_lodash_namespaceObject.castArray)(names)
+ };
+}
+/**
+ * Returns an action object used in signalling that new block styles have been added.
+ *
+ * @param {string} blockName Block name.
+ * @param {Array|Object} styles Block styles.
+ *
+ * @return {Object} Action object.
+ */
+
+function addBlockStyles(blockName, styles) {
+ return {
+ type: 'ADD_BLOCK_STYLES',
+ styles: (0,external_lodash_namespaceObject.castArray)(styles),
+ blockName
+ };
+}
+/**
+ * Returns an action object used in signalling that block styles have been removed.
+ *
+ * @param {string} blockName Block name.
+ * @param {Array|string} styleNames Block style names.
+ *
+ * @return {Object} Action object.
+ */
+
+function removeBlockStyles(blockName, styleNames) {
+ return {
+ type: 'REMOVE_BLOCK_STYLES',
+ styleNames: (0,external_lodash_namespaceObject.castArray)(styleNames),
+ blockName
+ };
+}
+/**
+ * Returns an action object used in signalling that new block variations have been added.
+ *
+ * @param {string} blockName Block name.
+ * @param {WPBlockVariation|WPBlockVariation[]} variations Block variations.
+ *
+ * @return {Object} Action object.
+ */
+
+function addBlockVariations(blockName, variations) {
+ return {
+ type: 'ADD_BLOCK_VARIATIONS',
+ variations: (0,external_lodash_namespaceObject.castArray)(variations),
+ blockName
+ };
+}
+/**
+ * Returns an action object used in signalling that block variations have been removed.
+ *
+ * @param {string} blockName Block name.
+ * @param {string|string[]} variationNames Block variation names.
+ *
+ * @return {Object} Action object.
+ */
+
+function removeBlockVariations(blockName, variationNames) {
+ return {
+ type: 'REMOVE_BLOCK_VARIATIONS',
+ variationNames: (0,external_lodash_namespaceObject.castArray)(variationNames),
+ blockName
+ };
+}
+/**
+ * Returns an action object used to set the default block name.
+ *
+ * @param {string} name Block name.
+ *
+ * @return {Object} Action object.
+ */
+
+function actions_setDefaultBlockName(name) {
+ return {
+ type: 'SET_DEFAULT_BLOCK_NAME',
+ name
+ };
+}
+/**
+ * Returns an action object used to set the name of the block used as a fallback
+ * for non-block content.
+ *
+ * @param {string} name Block name.
+ *
+ * @return {Object} Action object.
+ */
+
+function setFreeformFallbackBlockName(name) {
+ return {
+ type: 'SET_FREEFORM_FALLBACK_BLOCK_NAME',
+ name
+ };
+}
+/**
+ * Returns an action object used to set the name of the block used as a fallback
+ * for unregistered blocks.
+ *
+ * @param {string} name Block name.
+ *
+ * @return {Object} Action object.
+ */
+
+function setUnregisteredFallbackBlockName(name) {
+ return {
+ type: 'SET_UNREGISTERED_FALLBACK_BLOCK_NAME',
+ name
+ };
+}
+/**
+ * Returns an action object used to set the name of the block used
+ * when grouping other blocks
+ * eg: in "Group/Ungroup" interactions
+ *
+ * @param {string} name Block name.
+ *
+ * @return {Object} Action object.
+ */
+
+function actions_setGroupingBlockName(name) {
+ return {
+ type: 'SET_GROUPING_BLOCK_NAME',
+ name
+ };
+}
+/**
+ * Returns an action object used to set block categories.
+ *
+ * @param {Object[]} categories Block categories.
+ *
+ * @return {Object} Action object.
+ */
+
+function setCategories(categories) {
+ return {
+ type: 'SET_CATEGORIES',
+ categories
+ };
+}
+/**
+ * Returns an action object used to update a category.
+ *
+ * @param {string} slug Block category slug.
+ * @param {Object} category Object containing the category properties that should be updated.
+ *
+ * @return {Object} Action object.
+ */
+
+function updateCategory(slug, category) {
+ return {
+ type: 'UPDATE_CATEGORY',
+ slug,
+ category
+ };
+}
+/**
+ * Returns an action object used to add block collections
+ *
+ * @param {string} namespace The namespace of the blocks to put in the collection
+ * @param {string} title The title to display in the block inserter
+ * @param {Object} icon (optional) The icon to display in the block inserter
+ *
+ * @return {Object} Action object.
+ */
+
+function addBlockCollection(namespace, title, icon) {
+ return {
+ type: 'ADD_BLOCK_COLLECTION',
+ namespace,
+ title,
+ icon
+ };
+}
+/**
+ * Returns an action object used to remove block collections
+ *
+ * @param {string} namespace The namespace of the blocks to put in the collection
+ *
+ * @return {Object} Action object.
+ */
+
+function removeBlockCollection(namespace) {
+ return {
+ type: 'REMOVE_BLOCK_COLLECTION',
+ namespace
+ };
+}
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/store/index.js
+/**
+ * WordPress dependencies
+ */
+
+/**
+ * Internal dependencies
+ */
+
+
+
+
+
+/**
+ * Store definition for the blocks 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: external ["wp","blockSerializationDefaultParser"]
+var external_wp_blockSerializationDefaultParser_namespaceObject = window["wp"]["blockSerializationDefaultParser"];
+;// CONCATENATED MODULE: external ["wp","autop"]
+var external_wp_autop_namespaceObject = window["wp"]["autop"];
+;// 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/blocks/build-module/api/serializer.js
+
+
+/**
+ * External dependencies
+ */
+
+/**
+ * WordPress dependencies
+ */
+
+
+
+
+
+/**
+ * Internal dependencies
+ */
+
+
+
+/**
+ * @typedef {Object} WPBlockSerializationOptions Serialization Options.
+ *
+ * @property {boolean} isInnerBlocks Whether we are serializing inner blocks.
+ */
+
+/**
+ * Returns the block's default classname from its name.
+ *
+ * @param {string} blockName The block name.
+ *
+ * @return {string} The block's default class.
+ */
+
+function getBlockDefaultClassName(blockName) {
+ // Generated HTML classes for blocks follow the `wp-block-{name}` nomenclature.
+ // Blocks provided by WordPress drop the prefixes 'core/' or 'core-' (historically used in 'core-embed/').
+ const className = 'wp-block-' + blockName.replace(/\//, '-').replace(/^core-/, '');
+ return (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.getBlockDefaultClassName', className, blockName);
+}
+/**
+ * Returns the block's default menu item classname from its name.
+ *
+ * @param {string} blockName The block name.
+ *
+ * @return {string} The block's default menu item class.
+ */
+
+function getBlockMenuDefaultClassName(blockName) {
+ // Generated HTML classes for blocks follow the `editor-block-list-item-{name}` nomenclature.
+ // Blocks provided by WordPress drop the prefixes 'core/' or 'core-' (historically used in 'core-embed/').
+ const className = 'editor-block-list-item-' + blockName.replace(/\//, '-').replace(/^core-/, '');
+ return (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.getBlockMenuDefaultClassName', className, blockName);
+}
+const blockPropsProvider = {};
+const innerBlocksPropsProvider = {};
+/**
+ * Call within a save function to get the props for the block wrapper.
+ *
+ * @param {Object} props Optional. Props to pass to the element.
+ */
+
+function getBlockProps() {
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ const {
+ blockType,
+ attributes
+ } = blockPropsProvider;
+ return (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.getSaveContent.extraProps', { ...props
+ }, blockType, attributes);
+}
+/**
+ * Call within a save function to get the props for the inner blocks wrapper.
+ *
+ * @param {Object} props Optional. Props to pass to the element.
+ */
+
+function getInnerBlocksProps() {
+ let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
+ const {
+ innerBlocks
+ } = innerBlocksPropsProvider; // Value is an array of blocks, so defer to block serializer
+
+ const html = serializer_serialize(innerBlocks, {
+ isInnerBlocks: true
+ }); // Use special-cased raw HTML tag to avoid default escaping.
+
+ const children = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.RawHTML, null, html);
+ return { ...props,
+ children
+ };
+}
+/**
+ * Given a block type containing a save render implementation and attributes, returns the
+ * enhanced element to be saved or string when raw HTML expected.
+ *
+ * @param {string|Object} blockTypeOrName Block type or name.
+ * @param {Object} attributes Block attributes.
+ * @param {?Array} innerBlocks Nested blocks.
+ *
+ * @return {Object|string} Save element or raw HTML string.
+ */
+
+function getSaveElement(blockTypeOrName, attributes) {
+ let innerBlocks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
+ const blockType = normalizeBlockType(blockTypeOrName);
+ let {
+ save
+ } = blockType; // Component classes are unsupported for save since serialization must
+ // occur synchronously. For improved interoperability with higher-order
+ // components which often return component class, emulate basic support.
+
+ if (save.prototype instanceof external_wp_element_namespaceObject.Component) {
+ const instance = new save({
+ attributes
+ });
+ save = instance.render.bind(instance);
+ }
+
+ blockPropsProvider.blockType = blockType;
+ blockPropsProvider.attributes = attributes;
+ innerBlocksPropsProvider.innerBlocks = innerBlocks;
+ let element = save({
+ attributes,
+ innerBlocks
+ });
+
+ if ((0,external_lodash_namespaceObject.isObject)(element) && (0,external_wp_hooks_namespaceObject.hasFilter)('blocks.getSaveContent.extraProps') && !(blockType.apiVersion > 1)) {
+ /**
+ * Filters the props applied to the block save result element.
+ *
+ * @param {Object} props Props applied to save element.
+ * @param {WPBlock} blockType Block type definition.
+ * @param {Object} attributes Block attributes.
+ */
+ const props = (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.getSaveContent.extraProps', { ...element.props
+ }, blockType, attributes);
+
+ if (!external_wp_isShallowEqual_default()(props, element.props)) {
+ element = (0,external_wp_element_namespaceObject.cloneElement)(element, props);
+ }
+ }
+ /**
+ * Filters the save result of a block during serialization.
+ *
+ * @param {WPElement} element Block save result.
+ * @param {WPBlock} blockType Block type definition.
+ * @param {Object} attributes Block attributes.
+ */
+
+
+ return (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.getSaveElement', element, blockType, attributes);
+}
+/**
+ * Given a block type containing a save render implementation and attributes, returns the
+ * static markup to be saved.
+ *
+ * @param {string|Object} blockTypeOrName Block type or name.
+ * @param {Object} attributes Block attributes.
+ * @param {?Array} innerBlocks Nested blocks.
+ *
+ * @return {string} Save content.
+ */
+
+function getSaveContent(blockTypeOrName, attributes, innerBlocks) {
+ const blockType = normalizeBlockType(blockTypeOrName);
+ return (0,external_wp_element_namespaceObject.renderToString)(getSaveElement(blockType, attributes, innerBlocks));
+}
+/**
+ * Returns attributes which are to be saved and serialized into the block
+ * comment delimiter.
+ *
+ * When a block exists in memory it contains as its attributes both those
+ * parsed the block comment delimiter _and_ those which matched from the
+ * contents of the block.
+ *
+ * This function returns only those attributes which are needed to persist and
+ * which cannot be matched from the block content.
+ *
+ * @param {Object<string,*>} blockType Block type.
+ * @param {Object<string,*>} attributes Attributes from in-memory block data.
+ *
+ * @return {Object<string,*>} Subset of attributes for comment serialization.
+ */
+
+function getCommentAttributes(blockType, attributes) {
+ return (0,external_lodash_namespaceObject.reduce)(blockType.attributes, (accumulator, attributeSchema, key) => {
+ const value = attributes[key]; // Ignore undefined values.
+
+ if (undefined === value) {
+ return accumulator;
+ } // Ignore all attributes but the ones with an "undefined" source
+ // "undefined" source refers to attributes saved in the block comment.
+
+
+ if (attributeSchema.source !== undefined) {
+ return accumulator;
+ } // Ignore default value.
+
+
+ if ('default' in attributeSchema && attributeSchema.default === value) {
+ return accumulator;
+ } // Otherwise, include in comment set.
+
+
+ accumulator[key] = value;
+ return accumulator;
+ }, {});
+}
+/**
+ * Given an attributes object, returns a string in the serialized attributes
+ * format prepared for post content.
+ *
+ * @param {Object} attributes Attributes object.
+ *
+ * @return {string} Serialized attributes.
+ */
+
+function serializeAttributes(attributes) {
+ return JSON.stringify(attributes) // Don't break HTML comments.
+ .replace(/--/g, '\\u002d\\u002d') // Don't break non-standard-compliant tools.
+ .replace(/</g, '\\u003c').replace(/>/g, '\\u003e').replace(/&/g, '\\u0026') // Bypass server stripslashes behavior which would unescape stringify's
+ // escaping of quotation mark.
+ //
+ // See: https://developer.wordpress.org/reference/functions/wp_kses_stripslashes/
+ .replace(/\\"/g, '\\u0022');
+}
+/**
+ * Given a block object, returns the Block's Inner HTML markup.
+ *
+ * @param {Object} block Block instance.
+ *
+ * @return {string} HTML.
+ */
+
+function getBlockInnerHTML(block) {
+ // If block was parsed as invalid or encounters an error while generating
+ // save content, use original content instead to avoid content loss. If a
+ // block contains nested content, exempt it from this condition because we
+ // otherwise have no access to its original content and content loss would
+ // still occur.
+ let saveContent = block.originalContent;
+
+ if (block.isValid || block.innerBlocks.length) {
+ try {
+ saveContent = getSaveContent(block.name, block.attributes, block.innerBlocks);
+ } catch (error) {}
+ }
+
+ return saveContent;
+}
+/**
+ * Returns the content of a block, including comment delimiters.
+ *
+ * @param {string} rawBlockName Block name.
+ * @param {Object} attributes Block attributes.
+ * @param {string} content Block save content.
+ *
+ * @return {string} Comment-delimited block content.
+ */
+
+function getCommentDelimitedContent(rawBlockName, attributes, content) {
+ const serializedAttributes = !(0,external_lodash_namespaceObject.isEmpty)(attributes) ? serializeAttributes(attributes) + ' ' : ''; // Strip core blocks of their namespace prefix.
+
+ const blockName = (0,external_lodash_namespaceObject.startsWith)(rawBlockName, 'core/') ? rawBlockName.slice(5) : rawBlockName; // @todo make the `wp:` prefix potentially configurable.
+
+ if (!content) {
+ return `<!-- wp:${blockName} ${serializedAttributes}/-->`;
+ }
+
+ return `<!-- wp:${blockName} ${serializedAttributes}-->\n` + content + `\n<!-- /wp:${blockName} -->`;
+}
+/**
+ * Returns the content of a block, including comment delimiters, determining
+ * serialized attributes and content form from the current state of the block.
+ *
+ * @param {Object} block Block instance.
+ * @param {WPBlockSerializationOptions} options Serialization options.
+ *
+ * @return {string} Serialized block.
+ */
+
+function serializeBlock(block) {
+ let {
+ isInnerBlocks = false
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+ const blockName = block.name;
+ const saveContent = getBlockInnerHTML(block);
+
+ if (blockName === getUnregisteredTypeHandlerName() || !isInnerBlocks && blockName === getFreeformContentHandlerName()) {
+ return saveContent;
+ }
+
+ const blockType = registration_getBlockType(blockName);
+ const saveAttributes = getCommentAttributes(blockType, block.attributes);
+ return getCommentDelimitedContent(blockName, saveAttributes, saveContent);
+}
+function __unstableSerializeAndClean(blocks) {
+ // A single unmodified default block is assumed to
+ // be equivalent to an empty post.
+ if (blocks.length === 1 && isUnmodifiedDefaultBlock(blocks[0])) {
+ blocks = [];
+ }
+
+ let content = serializer_serialize(blocks); // For compatibility, treat a post consisting of a
+ // single freeform block as legacy content and apply
+ // pre-block-editor removep'd content formatting.
+
+ if (blocks.length === 1 && blocks[0].name === getFreeformContentHandlerName()) {
+ content = (0,external_wp_autop_namespaceObject.removep)(content);
+ }
+
+ return content;
+}
+/**
+ * Takes a block or set of blocks and returns the serialized post content.
+ *
+ * @param {Array} blocks Block(s) to serialize.
+ * @param {WPBlockSerializationOptions} options Serialization options.
+ *
+ * @return {string} The post content.
+ */
+
+function serializer_serialize(blocks, options) {
+ return (0,external_lodash_namespaceObject.castArray)(blocks).map(block => serializeBlock(block, options)).join('\n\n');
+}
+
+;// CONCATENATED MODULE: ./node_modules/simple-html-tokenizer/dist/es6/index.js
+/**
+ * generated from https://raw.githubusercontent.com/w3c/html/26b5126f96f736f796b9e29718138919dd513744/entities.json
+ * do not edit
+ */
+var namedCharRefs = {
+ Aacute: "Á", aacute: "á", Abreve: "Ă", abreve: "ă", ac: "∾", acd: "∿", acE: "∾̳", Acirc: "Â", acirc: "â", acute: "´", Acy: "А", acy: "а", AElig: "Æ", aelig: "æ", af: "\u2061", Afr: "𝔄", afr: "𝔞", Agrave: "À", agrave: "à", alefsym: "ℵ", aleph: "ℵ", Alpha: "Α", alpha: "α", Amacr: "Ā", amacr: "ā", amalg: "⨿", amp: "&", AMP: "&", andand: "⩕", And: "⩓", and: "∧", andd: "⩜", andslope: "⩘", andv: "⩚", ang: "∠", ange: "⦤", angle: "∠", angmsdaa: "⦨", angmsdab: "⦩", angmsdac: "⦪", angmsdad: "⦫", angmsdae: "⦬", angmsdaf: "⦭", angmsdag: "⦮", angmsdah: "⦯", angmsd: "∡", angrt: "∟", angrtvb: "⊾", angrtvbd: "⦝", angsph: "∢", angst: "Å", angzarr: "⍼", Aogon: "Ą", aogon: "ą", Aopf: "𝔸", aopf: "𝕒", apacir: "⩯", ap: "≈", apE: "⩰", ape: "≊", apid: "≋", apos: "'", ApplyFunction: "\u2061", approx: "≈", approxeq: "≊", Aring: "Å", aring: "å", Ascr: "𝒜", ascr: "𝒶", Assign: "≔", ast: "*", asymp: "≈", asympeq: "≍", Atilde: "Ã", atilde: "ã", Auml: "Ä", auml: "ä", awconint: "∳", awint: "⨑", backcong: "≌", backepsilon: "϶", backprime: "‵", backsim: "∽", backsimeq: "⋍", Backslash: "∖", Barv: "⫧", barvee: "⊽", barwed: "⌅", Barwed: "⌆", barwedge: "⌅", bbrk: "⎵", bbrktbrk: "⎶", bcong: "≌", Bcy: "Б", bcy: "б", bdquo: "„", becaus: "∵", because: "∵", Because: "∵", bemptyv: "⦰", bepsi: "϶", bernou: "ℬ", Bernoullis: "ℬ", Beta: "Β", beta: "β", beth: "ℶ", between: "≬", Bfr: "𝔅", bfr: "𝔟", bigcap: "⋂", bigcirc: "◯", bigcup: "⋃", bigodot: "⨀", bigoplus: "⨁", bigotimes: "⨂", bigsqcup: "⨆", bigstar: "★", bigtriangledown: "▽", bigtriangleup: "△", biguplus: "⨄", bigvee: "⋁", bigwedge: "⋀", bkarow: "⤍", blacklozenge: "⧫", blacksquare: "▪", blacktriangle: "▴", blacktriangledown: "▾", blacktriangleleft: "◂", blacktriangleright: "▸", blank: "␣", blk12: "▒", blk14: "░", blk34: "▓", block: "█", bne: "=⃥", bnequiv: "≡⃥", bNot: "⫭", bnot: "⌐", Bopf: "𝔹", bopf: "𝕓", bot: "⊥", bottom: "⊥", bowtie: "⋈", boxbox: "⧉", boxdl: "┐", boxdL: "╕", boxDl: "╖", boxDL: "╗", boxdr: "┌", boxdR: "╒", boxDr: "╓", boxDR: "╔", boxh: "─", boxH: "═", boxhd: "┬", boxHd: "╤", boxhD: "╥", boxHD: "╦", boxhu: "┴", boxHu: "╧", boxhU: "╨", boxHU: "╩", boxminus: "⊟", boxplus: "⊞", boxtimes: "⊠", boxul: "┘", boxuL: "╛", boxUl: "╜", boxUL: "╝", boxur: "└", boxuR: "╘", boxUr: "╙", boxUR: "╚", boxv: "│", boxV: "║", boxvh: "┼", boxvH: "╪", boxVh: "╫", boxVH: "╬", boxvl: "┤", boxvL: "╡", boxVl: "╢", boxVL: "╣", boxvr: "├", boxvR: "╞", boxVr: "╟", boxVR: "╠", bprime: "‵", breve: "˘", Breve: "˘", brvbar: "¦", bscr: "𝒷", Bscr: "ℬ", bsemi: "⁏", bsim: "∽", bsime: "⋍", bsolb: "⧅", bsol: "\\", bsolhsub: "⟈", bull: "•", bullet: "•", bump: "≎", bumpE: "⪮", bumpe: "≏", Bumpeq: "≎", bumpeq: "≏", Cacute: "Ć", cacute: "ć", capand: "⩄", capbrcup: "⩉", capcap: "⩋", cap: "∩", Cap: "⋒", capcup: "⩇", capdot: "⩀", CapitalDifferentialD: "ⅅ", caps: "∩︀", caret: "⁁", caron: "ˇ", Cayleys: "ℭ", ccaps: "⩍", Ccaron: "Č", ccaron: "č", Ccedil: "Ç", ccedil: "ç", Ccirc: "Ĉ", ccirc: "ĉ", Cconint: "∰", ccups: "⩌", ccupssm: "⩐", Cdot: "Ċ", cdot: "ċ", cedil: "¸", Cedilla: "¸", cemptyv: "⦲", cent: "¢", centerdot: "·", CenterDot: "·", cfr: "𝔠", Cfr: "ℭ", CHcy: "Ч", chcy: "ч", check: "✓", checkmark: "✓", Chi: "Χ", chi: "χ", circ: "ˆ", circeq: "≗", circlearrowleft: "↺", circlearrowright: "↻", circledast: "⊛", circledcirc: "⊚", circleddash: "⊝", CircleDot: "⊙", circledR: "®", circledS: "Ⓢ", CircleMinus: "⊖", CirclePlus: "⊕", CircleTimes: "⊗", cir: "○", cirE: "⧃", cire: "≗", cirfnint: "⨐", cirmid: "⫯", cirscir: "⧂", ClockwiseContourIntegral: "∲", CloseCurlyDoubleQuote: "”", CloseCurlyQuote: "’", clubs: "♣", clubsuit: "♣", colon: ":", Colon: "∷", Colone: "⩴", colone: "≔", coloneq: "≔", comma: ",", commat: "@", comp: "∁", compfn: "∘", complement: "∁", complexes: "ℂ", cong: "≅", congdot: "⩭", Congruent: "≡", conint: "∮", Conint: "∯", ContourIntegral: "∮", copf: "𝕔", Copf: "ℂ", coprod: "∐", Coproduct: "∐", copy: "©", COPY: "©", copysr: "℗", CounterClockwiseContourIntegral: "∳", crarr: "↵", cross: "✗", Cross: "⨯", Cscr: "𝒞", cscr: "𝒸", csub: "⫏", csube: "⫑", csup: "⫐", csupe: "⫒", ctdot: "⋯", cudarrl: "⤸", cudarrr: "⤵", cuepr: "⋞", cuesc: "⋟", cularr: "↶", cularrp: "⤽", cupbrcap: "⩈", cupcap: "⩆", CupCap: "≍", cup: "∪", Cup: "⋓", cupcup: "⩊", cupdot: "⊍", cupor: "⩅", cups: "∪︀", curarr: "↷", curarrm: "⤼", curlyeqprec: "⋞", curlyeqsucc: "⋟", curlyvee: "⋎", curlywedge: "⋏", curren: "¤", curvearrowleft: "↶", curvearrowright: "↷", cuvee: "⋎", cuwed: "⋏", cwconint: "∲", cwint: "∱", cylcty: "⌭", dagger: "†", Dagger: "‡", daleth: "ℸ", darr: "↓", Darr: "↡", dArr: "⇓", dash: "‐", Dashv: "⫤", dashv: "⊣", dbkarow: "⤏", dblac: "˝", Dcaron: "Ď", dcaron: "ď", Dcy: "Д", dcy: "д", ddagger: "‡", ddarr: "⇊", DD: "ⅅ", dd: "ⅆ", DDotrahd: "⤑", ddotseq: "⩷", deg: "°", Del: "∇", Delta: "Δ", delta: "δ", demptyv: "⦱", dfisht: "⥿", Dfr: "𝔇", dfr: "𝔡", dHar: "⥥", dharl: "⇃", dharr: "⇂", DiacriticalAcute: "´", DiacriticalDot: "˙", DiacriticalDoubleAcute: "˝", DiacriticalGrave: "`", DiacriticalTilde: "˜", diam: "⋄", diamond: "⋄", Diamond: "⋄", diamondsuit: "♦", diams: "♦", die: "¨", DifferentialD: "ⅆ", digamma: "ϝ", disin: "⋲", div: "÷", divide: "÷", divideontimes: "⋇", divonx: "⋇", DJcy: "Ђ", djcy: "ђ", dlcorn: "⌞", dlcrop: "⌍", dollar: "$", Dopf: "𝔻", dopf: "𝕕", Dot: "¨", dot: "˙", DotDot: "⃜", doteq: "≐", doteqdot: "≑", DotEqual: "≐", dotminus: "∸", dotplus: "∔", dotsquare: "⊡", doublebarwedge: "⌆", DoubleContourIntegral: "∯", DoubleDot: "¨", DoubleDownArrow: "⇓", DoubleLeftArrow: "⇐", DoubleLeftRightArrow: "⇔", DoubleLeftTee: "⫤", DoubleLongLeftArrow: "⟸", DoubleLongLeftRightArrow: "⟺", DoubleLongRightArrow: "⟹", DoubleRightArrow: "⇒", DoubleRightTee: "⊨", DoubleUpArrow: "⇑", DoubleUpDownArrow: "⇕", DoubleVerticalBar: "∥", DownArrowBar: "⤓", downarrow: "↓", DownArrow: "↓", Downarrow: "⇓", DownArrowUpArrow: "⇵", DownBreve: "̑", downdownarrows: "⇊", downharpoonleft: "⇃", downharpoonright: "⇂", DownLeftRightVector: "⥐", DownLeftTeeVector: "⥞", DownLeftVectorBar: "⥖", DownLeftVector: "↽", DownRightTeeVector: "⥟", DownRightVectorBar: "⥗", DownRightVector: "⇁", DownTeeArrow: "↧", DownTee: "⊤", drbkarow: "⤐", drcorn: "⌟", drcrop: "⌌", Dscr: "𝒟", dscr: "𝒹", DScy: "Ѕ", dscy: "ѕ", dsol: "⧶", Dstrok: "Đ", dstrok: "đ", dtdot: "⋱", dtri: "▿", dtrif: "▾", duarr: "⇵", duhar: "⥯", dwangle: "⦦", DZcy: "Џ", dzcy: "џ", dzigrarr: "⟿", Eacute: "É", eacute: "é", easter: "⩮", Ecaron: "Ě", ecaron: "ě", Ecirc: "Ê", ecirc: "ê", ecir: "≖", ecolon: "≕", Ecy: "Э", ecy: "э", eDDot: "⩷", Edot: "Ė", edot: "ė", eDot: "≑", ee: "ⅇ", efDot: "≒", Efr: "𝔈", efr: "𝔢", eg: "⪚", Egrave: "È", egrave: "è", egs: "⪖", egsdot: "⪘", el: "⪙", Element: "∈", elinters: "⏧", ell: "ℓ", els: "⪕", elsdot: "⪗", Emacr: "Ē", emacr: "ē", empty: "∅", emptyset: "∅", EmptySmallSquare: "◻", emptyv: "∅", EmptyVerySmallSquare: "▫", emsp13: " ", emsp14: " ", emsp: " ", ENG: "Ŋ", eng: "ŋ", ensp: " ", Eogon: "Ę", eogon: "ę", Eopf: "𝔼", eopf: "𝕖", epar: "⋕", eparsl: "⧣", eplus: "⩱", epsi: "ε", Epsilon: "Ε", epsilon: "ε", epsiv: "ϵ", eqcirc: "≖", eqcolon: "≕", eqsim: "≂", eqslantgtr: "⪖", eqslantless: "⪕", Equal: "⩵", equals: "=", EqualTilde: "≂", equest: "≟", Equilibrium: "⇌", equiv: "≡", equivDD: "⩸", eqvparsl: "⧥", erarr: "⥱", erDot: "≓", escr: "ℯ", Escr: "ℰ", esdot: "≐", Esim: "⩳", esim: "≂", Eta: "Η", eta: "η", ETH: "Ð", eth: "ð", Euml: "Ë", euml: "ë", euro: "€", excl: "!", exist: "∃", Exists: "∃", expectation: "ℰ", exponentiale: "ⅇ", ExponentialE: "ⅇ", fallingdotseq: "≒", Fcy: "Ф", fcy: "ф", female: "♀", ffilig: "ffi", fflig: "ff", ffllig: "ffl", Ffr: "𝔉", ffr: "𝔣", filig: "fi", FilledSmallSquare: "◼", FilledVerySmallSquare: "▪", fjlig: "fj", flat: "♭", fllig: "fl", fltns: "▱", fnof: "ƒ", Fopf: "𝔽", fopf: "𝕗", forall: "∀", ForAll: "∀", fork: "⋔", forkv: "⫙", Fouriertrf: "ℱ", fpartint: "⨍", frac12: "½", frac13: "⅓", frac14: "¼", frac15: "⅕", frac16: "⅙", frac18: "⅛", frac23: "⅔", frac25: "⅖", frac34: "¾", frac35: "⅗", frac38: "⅜", frac45: "⅘", frac56: "⅚", frac58: "⅝", frac78: "⅞", frasl: "⁄", frown: "⌢", fscr: "𝒻", Fscr: "ℱ", gacute: "ǵ", Gamma: "Γ", gamma: "γ", Gammad: "Ϝ", gammad: "ϝ", gap: "⪆", Gbreve: "Ğ", gbreve: "ğ", Gcedil: "Ģ", Gcirc: "Ĝ", gcirc: "ĝ", Gcy: "Г", gcy: "г", Gdot: "Ġ", gdot: "ġ", ge: "≥", gE: "≧", gEl: "⪌", gel: "⋛", geq: "≥", geqq: "≧", geqslant: "⩾", gescc: "⪩", ges: "⩾", gesdot: "⪀", gesdoto: "⪂", gesdotol: "⪄", gesl: "⋛︀", gesles: "⪔", Gfr: "𝔊", gfr: "𝔤", gg: "≫", Gg: "⋙", ggg: "⋙", gimel: "ℷ", GJcy: "Ѓ", gjcy: "ѓ", gla: "⪥", gl: "≷", glE: "⪒", glj: "⪤", gnap: "⪊", gnapprox: "⪊", gne: "⪈", gnE: "≩", gneq: "⪈", gneqq: "≩", gnsim: "⋧", Gopf: "𝔾", gopf: "𝕘", grave: "`", GreaterEqual: "≥", GreaterEqualLess: "⋛", GreaterFullEqual: "≧", GreaterGreater: "⪢", GreaterLess: "≷", GreaterSlantEqual: "⩾", GreaterTilde: "≳", Gscr: "𝒢", gscr: "ℊ", gsim: "≳", gsime: "⪎", gsiml: "⪐", gtcc: "⪧", gtcir: "⩺", gt: ">", GT: ">", Gt: "≫", gtdot: "⋗", gtlPar: "⦕", gtquest: "⩼", gtrapprox: "⪆", gtrarr: "⥸", gtrdot: "⋗", gtreqless: "⋛", gtreqqless: "⪌", gtrless: "≷", gtrsim: "≳", gvertneqq: "≩︀", gvnE: "≩︀", Hacek: "ˇ", hairsp: " ", half: "½", hamilt: "ℋ", HARDcy: "Ъ", hardcy: "ъ", harrcir: "⥈", harr: "↔", hArr: "⇔", harrw: "↭", Hat: "^", hbar: "ℏ", Hcirc: "Ĥ", hcirc: "ĥ", hearts: "♥", heartsuit: "♥", hellip: "…", hercon: "⊹", hfr: "𝔥", Hfr: "ℌ", HilbertSpace: "ℋ", hksearow: "⤥", hkswarow: "⤦", hoarr: "⇿", homtht: "∻", hookleftarrow: "↩", hookrightarrow: "↪", hopf: "𝕙", Hopf: "ℍ", horbar: "―", HorizontalLine: "─", hscr: "𝒽", Hscr: "ℋ", hslash: "ℏ", Hstrok: "Ħ", hstrok: "ħ", HumpDownHump: "≎", HumpEqual: "≏", hybull: "⁃", hyphen: "‐", Iacute: "Í", iacute: "í", ic: "\u2063", Icirc: "Î", icirc: "î", Icy: "И", icy: "и", Idot: "İ", IEcy: "Е", iecy: "е", iexcl: "¡", iff: "⇔", ifr: "𝔦", Ifr: "ℑ", Igrave: "Ì", igrave: "ì", ii: "ⅈ", iiiint: "⨌", iiint: "∭", iinfin: "⧜", iiota: "℩", IJlig: "IJ", ijlig: "ij", Imacr: "Ī", imacr: "ī", image: "ℑ", ImaginaryI: "ⅈ", imagline: "ℐ", imagpart: "ℑ", imath: "ı", Im: "ℑ", imof: "⊷", imped: "Ƶ", Implies: "⇒", incare: "℅", in: "∈", infin: "∞", infintie: "⧝", inodot: "ı", intcal: "⊺", int: "∫", Int: "∬", integers: "ℤ", Integral: "∫", intercal: "⊺", Intersection: "⋂", intlarhk: "⨗", intprod: "⨼", InvisibleComma: "\u2063", InvisibleTimes: "\u2062", IOcy: "Ё", iocy: "ё", Iogon: "Į", iogon: "į", Iopf: "𝕀", iopf: "𝕚", Iota: "Ι", iota: "ι", iprod: "⨼", iquest: "¿", iscr: "𝒾", Iscr: "ℐ", isin: "∈", isindot: "⋵", isinE: "⋹", isins: "⋴", isinsv: "⋳", isinv: "∈", it: "\u2062", Itilde: "Ĩ", itilde: "ĩ", Iukcy: "І", iukcy: "і", Iuml: "Ï", iuml: "ï", Jcirc: "Ĵ", jcirc: "ĵ", Jcy: "Й", jcy: "й", Jfr: "𝔍", jfr: "𝔧", jmath: "ȷ", Jopf: "𝕁", jopf: "𝕛", Jscr: "𝒥", jscr: "𝒿", Jsercy: "Ј", jsercy: "ј", Jukcy: "Є", jukcy: "є", Kappa: "Κ", kappa: "κ", kappav: "ϰ", Kcedil: "Ķ", kcedil: "ķ", Kcy: "К", kcy: "к", Kfr: "𝔎", kfr: "𝔨", kgreen: "ĸ", KHcy: "Х", khcy: "х", KJcy: "Ќ", kjcy: "ќ", Kopf: "𝕂", kopf: "𝕜", Kscr: "𝒦", kscr: "𝓀", lAarr: "⇚", Lacute: "Ĺ", lacute: "ĺ", laemptyv: "⦴", lagran: "ℒ", Lambda: "Λ", lambda: "λ", lang: "⟨", Lang: "⟪", langd: "⦑", langle: "⟨", lap: "⪅", Laplacetrf: "ℒ", laquo: "«", larrb: "⇤", larrbfs: "⤟", larr: "←", Larr: "↞", lArr: "⇐", larrfs: "⤝", larrhk: "↩", larrlp: "↫", larrpl: "⤹", larrsim: "⥳", larrtl: "↢", latail: "⤙", lAtail: "⤛", lat: "⪫", late: "⪭", lates: "⪭︀", lbarr: "⤌", lBarr: "⤎", lbbrk: "❲", lbrace: "{", lbrack: "[", lbrke: "⦋", lbrksld: "⦏", lbrkslu: "⦍", Lcaron: "Ľ", lcaron: "ľ", Lcedil: "Ļ", lcedil: "ļ", lceil: "⌈", lcub: "{", Lcy: "Л", lcy: "л", ldca: "⤶", ldquo: "“", ldquor: "„", ldrdhar: "⥧", ldrushar: "⥋", ldsh: "↲", le: "≤", lE: "≦", LeftAngleBracket: "⟨", LeftArrowBar: "⇤", leftarrow: "←", LeftArrow: "←", Leftarrow: "⇐", LeftArrowRightArrow: "⇆", leftarrowtail: "↢", LeftCeiling: "⌈", LeftDoubleBracket: "⟦", LeftDownTeeVector: "⥡", LeftDownVectorBar: "⥙", LeftDownVector: "⇃", LeftFloor: "⌊", leftharpoondown: "↽", leftharpoonup: "↼", leftleftarrows: "⇇", leftrightarrow: "↔", LeftRightArrow: "↔", Leftrightarrow: "⇔", leftrightarrows: "⇆", leftrightharpoons: "⇋", leftrightsquigarrow: "↭", LeftRightVector: "⥎", LeftTeeArrow: "↤", LeftTee: "⊣", LeftTeeVector: "⥚", leftthreetimes: "⋋", LeftTriangleBar: "⧏", LeftTriangle: "⊲", LeftTriangleEqual: "⊴", LeftUpDownVector: "⥑", LeftUpTeeVector: "⥠", LeftUpVectorBar: "⥘", LeftUpVector: "↿", LeftVectorBar: "⥒", LeftVector: "↼", lEg: "⪋", leg: "⋚", leq: "≤", leqq: "≦", leqslant: "⩽", lescc: "⪨", les: "⩽", lesdot: "⩿", lesdoto: "⪁", lesdotor: "⪃", lesg: "⋚︀", lesges: "⪓", lessapprox: "⪅", lessdot: "⋖", lesseqgtr: "⋚", lesseqqgtr: "⪋", LessEqualGreater: "⋚", LessFullEqual: "≦", LessGreater: "≶", lessgtr: "≶", LessLess: "⪡", lesssim: "≲", LessSlantEqual: "⩽", LessTilde: "≲", lfisht: "⥼", lfloor: "⌊", Lfr: "𝔏", lfr: "𝔩", lg: "≶", lgE: "⪑", lHar: "⥢", lhard: "↽", lharu: "↼", lharul: "⥪", lhblk: "▄", LJcy: "Љ", ljcy: "љ", llarr: "⇇", ll: "≪", Ll: "⋘", llcorner: "⌞", Lleftarrow: "⇚", llhard: "⥫", lltri: "◺", Lmidot: "Ŀ", lmidot: "ŀ", lmoustache: "⎰", lmoust: "⎰", lnap: "⪉", lnapprox: "⪉", lne: "⪇", lnE: "≨", lneq: "⪇", lneqq: "≨", lnsim: "⋦", loang: "⟬", loarr: "⇽", lobrk: "⟦", longleftarrow: "⟵", LongLeftArrow: "⟵", Longleftarrow: "⟸", longleftrightarrow: "⟷", LongLeftRightArrow: "⟷", Longleftrightarrow: "⟺", longmapsto: "⟼", longrightarrow: "⟶", LongRightArrow: "⟶", Longrightarrow: "⟹", looparrowleft: "↫", looparrowright: "↬", lopar: "⦅", Lopf: "𝕃", lopf: "𝕝", loplus: "⨭", lotimes: "⨴", lowast: "∗", lowbar: "_", LowerLeftArrow: "↙", LowerRightArrow: "↘", loz: "◊", lozenge: "◊", lozf: "⧫", lpar: "(", lparlt: "⦓", lrarr: "⇆", lrcorner: "⌟", lrhar: "⇋", lrhard: "⥭", lrm: "\u200e", lrtri: "⊿", lsaquo: "‹", lscr: "𝓁", Lscr: "ℒ", lsh: "↰", Lsh: "↰", lsim: "≲", lsime: "⪍", lsimg: "⪏", lsqb: "[", lsquo: "‘", lsquor: "‚", Lstrok: "Ł", lstrok: "ł", ltcc: "⪦", ltcir: "⩹", lt: "<", LT: "<", Lt: "≪", ltdot: "⋖", lthree: "⋋", ltimes: "⋉", ltlarr: "⥶", ltquest: "⩻", ltri: "◃", ltrie: "⊴", ltrif: "◂", ltrPar: "⦖", lurdshar: "⥊", luruhar: "⥦", lvertneqq: "≨︀", lvnE: "≨︀", macr: "¯", male: "♂", malt: "✠", maltese: "✠", Map: "⤅", map: "↦", mapsto: "↦", mapstodown: "↧", mapstoleft: "↤", mapstoup: "↥", marker: "▮", mcomma: "⨩", Mcy: "М", mcy: "м", mdash: "—", mDDot: "∺", measuredangle: "∡", MediumSpace: " ", Mellintrf: "ℳ", Mfr: "𝔐", mfr: "𝔪", mho: "℧", micro: "µ", midast: "*", midcir: "⫰", mid: "∣", middot: "·", minusb: "⊟", minus: "−", minusd: "∸", minusdu: "⨪", MinusPlus: "∓", mlcp: "⫛", mldr: "…", mnplus: "∓", models: "⊧", Mopf: "𝕄", mopf: "𝕞", mp: "∓", mscr: "𝓂", Mscr: "ℳ", mstpos: "∾", Mu: "Μ", mu: "μ", multimap: "⊸", mumap: "⊸", nabla: "∇", Nacute: "Ń", nacute: "ń", nang: "∠⃒", nap: "≉", napE: "⩰̸", napid: "≋̸", napos: "ʼn", napprox: "≉", natural: "♮", naturals: "ℕ", natur: "♮", nbsp: " ", nbump: "≎̸", nbumpe: "≏̸", ncap: "⩃", Ncaron: "Ň", ncaron: "ň", Ncedil: "Ņ", ncedil: "ņ", ncong: "≇", ncongdot: "⩭̸", ncup: "⩂", Ncy: "Н", ncy: "н", ndash: "–", nearhk: "⤤", nearr: "↗", neArr: "⇗", nearrow: "↗", ne: "≠", nedot: "≐̸", NegativeMediumSpace: "", NegativeThickSpace: "", NegativeThinSpace: "", NegativeVeryThinSpace: "", nequiv: "≢", nesear: "⤨", nesim: "≂̸", NestedGreaterGreater: "≫", NestedLessLess: "≪", NewLine: "\u000a", nexist: "∄", nexists: "∄", Nfr: "𝔑", nfr: "𝔫", ngE: "≧̸", nge: "≱", ngeq: "≱", ngeqq: "≧̸", ngeqslant: "⩾̸", nges: "⩾̸", nGg: "⋙̸", ngsim: "≵", nGt: "≫⃒", ngt: "≯", ngtr: "≯", nGtv: "≫̸", nharr: "↮", nhArr: "⇎", nhpar: "⫲", ni: "∋", nis: "⋼", nisd: "⋺", niv: "∋", NJcy: "Њ", njcy: "њ", nlarr: "↚", nlArr: "⇍", nldr: "‥", nlE: "≦̸", nle: "≰", nleftarrow: "↚", nLeftarrow: "⇍", nleftrightarrow: "↮", nLeftrightarrow: "⇎", nleq: "≰", nleqq: "≦̸", nleqslant: "⩽̸", nles: "⩽̸", nless: "≮", nLl: "⋘̸", nlsim: "≴", nLt: "≪⃒", nlt: "≮", nltri: "⋪", nltrie: "⋬", nLtv: "≪̸", nmid: "∤", NoBreak: "\u2060", NonBreakingSpace: " ", nopf: "𝕟", Nopf: "ℕ", Not: "⫬", not: "¬", NotCongruent: "≢", NotCupCap: "≭", NotDoubleVerticalBar: "∦", NotElement: "∉", NotEqual: "≠", NotEqualTilde: "≂̸", NotExists: "∄", NotGreater: "≯", NotGreaterEqual: "≱", NotGreaterFullEqual: "≧̸", NotGreaterGreater: "≫̸", NotGreaterLess: "≹", NotGreaterSlantEqual: "⩾̸", NotGreaterTilde: "≵", NotHumpDownHump: "≎̸", NotHumpEqual: "≏̸", notin: "∉", notindot: "⋵̸", notinE: "⋹̸", notinva: "∉", notinvb: "⋷", notinvc: "⋶", NotLeftTriangleBar: "⧏̸", NotLeftTriangle: "⋪", NotLeftTriangleEqual: "⋬", NotLess: "≮", NotLessEqual: "≰", NotLessGreater: "≸", NotLessLess: "≪̸", NotLessSlantEqual: "⩽̸", NotLessTilde: "≴", NotNestedGreaterGreater: "⪢̸", NotNestedLessLess: "⪡̸", notni: "∌", notniva: "∌", notnivb: "⋾", notnivc: "⋽", NotPrecedes: "⊀", NotPrecedesEqual: "⪯̸", NotPrecedesSlantEqual: "⋠", NotReverseElement: "∌", NotRightTriangleBar: "⧐̸", NotRightTriangle: "⋫", NotRightTriangleEqual: "⋭", NotSquareSubset: "⊏̸", NotSquareSubsetEqual: "⋢", NotSquareSuperset: "⊐̸", NotSquareSupersetEqual: "⋣", NotSubset: "⊂⃒", NotSubsetEqual: "⊈", NotSucceeds: "⊁", NotSucceedsEqual: "⪰̸", NotSucceedsSlantEqual: "⋡", NotSucceedsTilde: "≿̸", NotSuperset: "⊃⃒", NotSupersetEqual: "⊉", NotTilde: "≁", NotTildeEqual: "≄", NotTildeFullEqual: "≇", NotTildeTilde: "≉", NotVerticalBar: "∤", nparallel: "∦", npar: "∦", nparsl: "⫽⃥", npart: "∂̸", npolint: "⨔", npr: "⊀", nprcue: "⋠", nprec: "⊀", npreceq: "⪯̸", npre: "⪯̸", nrarrc: "⤳̸", nrarr: "↛", nrArr: "⇏", nrarrw: "↝̸", nrightarrow: "↛", nRightarrow: "⇏", nrtri: "⋫", nrtrie: "⋭", nsc: "⊁", nsccue: "⋡", nsce: "⪰̸", Nscr: "𝒩", nscr: "𝓃", nshortmid: "∤", nshortparallel: "∦", nsim: "≁", nsime: "≄", nsimeq: "≄", nsmid: "∤", nspar: "∦", nsqsube: "⋢", nsqsupe: "⋣", nsub: "⊄", nsubE: "⫅̸", nsube: "⊈", nsubset: "⊂⃒", nsubseteq: "⊈", nsubseteqq: "⫅̸", nsucc: "⊁", nsucceq: "⪰̸", nsup: "⊅", nsupE: "⫆̸", nsupe: "⊉", nsupset: "⊃⃒", nsupseteq: "⊉", nsupseteqq: "⫆̸", ntgl: "≹", Ntilde: "Ñ", ntilde: "ñ", ntlg: "≸", ntriangleleft: "⋪", ntrianglelefteq: "⋬", ntriangleright: "⋫", ntrianglerighteq: "⋭", Nu: "Ν", nu: "ν", num: "#", numero: "№", numsp: " ", nvap: "≍⃒", nvdash: "⊬", nvDash: "⊭", nVdash: "⊮", nVDash: "⊯", nvge: "≥⃒", nvgt: ">⃒", nvHarr: "⤄", nvinfin: "⧞", nvlArr: "⤂", nvle: "≤⃒", nvlt: "<⃒", nvltrie: "⊴⃒", nvrArr: "⤃", nvrtrie: "⊵⃒", nvsim: "∼⃒", nwarhk: "⤣", nwarr: "↖", nwArr: "⇖", nwarrow: "↖", nwnear: "⤧", Oacute: "Ó", oacute: "ó", oast: "⊛", Ocirc: "Ô", ocirc: "ô", ocir: "⊚", Ocy: "О", ocy: "о", odash: "⊝", Odblac: "Ő", odblac: "ő", odiv: "⨸", odot: "⊙", odsold: "⦼", OElig: "Œ", oelig: "œ", ofcir: "⦿", Ofr: "𝔒", ofr: "𝔬", ogon: "˛", Ograve: "Ò", ograve: "ò", ogt: "⧁", ohbar: "⦵", ohm: "Ω", oint: "∮", olarr: "↺", olcir: "⦾", olcross: "⦻", oline: "‾", olt: "⧀", Omacr: "Ō", omacr: "ō", Omega: "Ω", omega: "ω", Omicron: "Ο", omicron: "ο", omid: "⦶", ominus: "⊖", Oopf: "𝕆", oopf: "𝕠", opar: "⦷", OpenCurlyDoubleQuote: "“", OpenCurlyQuote: "‘", operp: "⦹", oplus: "⊕", orarr: "↻", Or: "⩔", or: "∨", ord: "⩝", order: "ℴ", orderof: "ℴ", ordf: "ª", ordm: "º", origof: "⊶", oror: "⩖", orslope: "⩗", orv: "⩛", oS: "Ⓢ", Oscr: "𝒪", oscr: "ℴ", Oslash: "Ø", oslash: "ø", osol: "⊘", Otilde: "Õ", otilde: "õ", otimesas: "⨶", Otimes: "⨷", otimes: "⊗", Ouml: "Ö", ouml: "ö", ovbar: "⌽", OverBar: "‾", OverBrace: "⏞", OverBracket: "⎴", OverParenthesis: "⏜", para: "¶", parallel: "∥", par: "∥", parsim: "⫳", parsl: "⫽", part: "∂", PartialD: "∂", Pcy: "П", pcy: "п", percnt: "%", period: ".", permil: "‰", perp: "⊥", pertenk: "‱", Pfr: "𝔓", pfr: "𝔭", Phi: "Φ", phi: "φ", phiv: "ϕ", phmmat: "ℳ", phone: "☎", Pi: "Π", pi: "π", pitchfork: "⋔", piv: "ϖ", planck: "ℏ", planckh: "ℎ", plankv: "ℏ", plusacir: "⨣", plusb: "⊞", pluscir: "⨢", plus: "+", plusdo: "∔", plusdu: "⨥", pluse: "⩲", PlusMinus: "±", plusmn: "±", plussim: "⨦", plustwo: "⨧", pm: "±", Poincareplane: "ℌ", pointint: "⨕", popf: "𝕡", Popf: "ℙ", pound: "£", prap: "⪷", Pr: "⪻", pr: "≺", prcue: "≼", precapprox: "⪷", prec: "≺", preccurlyeq: "≼", Precedes: "≺", PrecedesEqual: "⪯", PrecedesSlantEqual: "≼", PrecedesTilde: "≾", preceq: "⪯", precnapprox: "⪹", precneqq: "⪵", precnsim: "⋨", pre: "⪯", prE: "⪳", precsim: "≾", prime: "′", Prime: "″", primes: "ℙ", prnap: "⪹", prnE: "⪵", prnsim: "⋨", prod: "∏", Product: "∏", profalar: "⌮", profline: "⌒", profsurf: "⌓", prop: "∝", Proportional: "∝", Proportion: "∷", propto: "∝", prsim: "≾", prurel: "⊰", Pscr: "𝒫", pscr: "𝓅", Psi: "Ψ", psi: "ψ", puncsp: " ", Qfr: "𝔔", qfr: "𝔮", qint: "⨌", qopf: "𝕢", Qopf: "ℚ", qprime: "⁗", Qscr: "𝒬", qscr: "𝓆", quaternions: "ℍ", quatint: "⨖", quest: "?", questeq: "≟", quot: "\"", QUOT: "\"", rAarr: "⇛", race: "∽̱", Racute: "Ŕ", racute: "ŕ", radic: "√", raemptyv: "⦳", rang: "⟩", Rang: "⟫", rangd: "⦒", range: "⦥", rangle: "⟩", raquo: "»", rarrap: "⥵", rarrb: "⇥", rarrbfs: "⤠", rarrc: "⤳", rarr: "→", Rarr: "↠", rArr: "⇒", rarrfs: "⤞", rarrhk: "↪", rarrlp: "↬", rarrpl: "⥅", rarrsim: "⥴", Rarrtl: "⤖", rarrtl: "↣", rarrw: "↝", ratail: "⤚", rAtail: "⤜", ratio: "∶", rationals: "ℚ", rbarr: "⤍", rBarr: "⤏", RBarr: "⤐", rbbrk: "❳", rbrace: "}", rbrack: "]", rbrke: "⦌", rbrksld: "⦎", rbrkslu: "⦐", Rcaron: "Ř", rcaron: "ř", Rcedil: "Ŗ", rcedil: "ŗ", rceil: "⌉", rcub: "}", Rcy: "Р", rcy: "р", rdca: "⤷", rdldhar: "⥩", rdquo: "”", rdquor: "”", rdsh: "↳", real: "ℜ", realine: "ℛ", realpart: "ℜ", reals: "ℝ", Re: "ℜ", rect: "▭", reg: "®", REG: "®", ReverseElement: "∋", ReverseEquilibrium: "⇋", ReverseUpEquilibrium: "⥯", rfisht: "⥽", rfloor: "⌋", rfr: "𝔯", Rfr: "ℜ", rHar: "⥤", rhard: "⇁", rharu: "⇀", rharul: "⥬", Rho: "Ρ", rho: "ρ", rhov: "ϱ", RightAngleBracket: "⟩", RightArrowBar: "⇥", rightarrow: "→", RightArrow: "→", Rightarrow: "⇒", RightArrowLeftArrow: "⇄", rightarrowtail: "↣", RightCeiling: "⌉", RightDoubleBracket: "⟧", RightDownTeeVector: "⥝", RightDownVectorBar: "⥕", RightDownVector: "⇂", RightFloor: "⌋", rightharpoondown: "⇁", rightharpoonup: "⇀", rightleftarrows: "⇄", rightleftharpoons: "⇌", rightrightarrows: "⇉", rightsquigarrow: "↝", RightTeeArrow: "↦", RightTee: "⊢", RightTeeVector: "⥛", rightthreetimes: "⋌", RightTriangleBar: "⧐", RightTriangle: "⊳", RightTriangleEqual: "⊵", RightUpDownVector: "⥏", RightUpTeeVector: "⥜", RightUpVectorBar: "⥔", RightUpVector: "↾", RightVectorBar: "⥓", RightVector: "⇀", ring: "˚", risingdotseq: "≓", rlarr: "⇄", rlhar: "⇌", rlm: "\u200f", rmoustache: "⎱", rmoust: "⎱", rnmid: "⫮", roang: "⟭", roarr: "⇾", robrk: "⟧", ropar: "⦆", ropf: "𝕣", Ropf: "ℝ", roplus: "⨮", rotimes: "⨵", RoundImplies: "⥰", rpar: ")", rpargt: "⦔", rppolint: "⨒", rrarr: "⇉", Rrightarrow: "⇛", rsaquo: "›", rscr: "𝓇", Rscr: "ℛ", rsh: "↱", Rsh: "↱", rsqb: "]", rsquo: "’", rsquor: "’", rthree: "⋌", rtimes: "⋊", rtri: "▹", rtrie: "⊵", rtrif: "▸", rtriltri: "⧎", RuleDelayed: "⧴", ruluhar: "⥨", rx: "℞", Sacute: "Ś", sacute: "ś", sbquo: "‚", scap: "⪸", Scaron: "Š", scaron: "š", Sc: "⪼", sc: "≻", sccue: "≽", sce: "⪰", scE: "⪴", Scedil: "Ş", scedil: "ş", Scirc: "Ŝ", scirc: "ŝ", scnap: "⪺", scnE: "⪶", scnsim: "⋩", scpolint: "⨓", scsim: "≿", Scy: "С", scy: "с", sdotb: "⊡", sdot: "⋅", sdote: "⩦", searhk: "⤥", searr: "↘", seArr: "⇘", searrow: "↘", sect: "§", semi: ";", seswar: "⤩", setminus: "∖", setmn: "∖", sext: "✶", Sfr: "𝔖", sfr: "𝔰", sfrown: "⌢", sharp: "♯", SHCHcy: "Щ", shchcy: "щ", SHcy: "Ш", shcy: "ш", ShortDownArrow: "↓", ShortLeftArrow: "←", shortmid: "∣", shortparallel: "∥", ShortRightArrow: "→", ShortUpArrow: "↑", shy: "\u00ad", Sigma: "Σ", sigma: "σ", sigmaf: "ς", sigmav: "ς", sim: "∼", simdot: "⩪", sime: "≃", simeq: "≃", simg: "⪞", simgE: "⪠", siml: "⪝", simlE: "⪟", simne: "≆", simplus: "⨤", simrarr: "⥲", slarr: "←", SmallCircle: "∘", smallsetminus: "∖", smashp: "⨳", smeparsl: "⧤", smid: "∣", smile: "⌣", smt: "⪪", smte: "⪬", smtes: "⪬︀", SOFTcy: "Ь", softcy: "ь", solbar: "⌿", solb: "⧄", sol: "/", Sopf: "𝕊", sopf: "𝕤", spades: "♠", spadesuit: "♠", spar: "∥", sqcap: "⊓", sqcaps: "⊓︀", sqcup: "⊔", sqcups: "⊔︀", Sqrt: "√", sqsub: "⊏", sqsube: "⊑", sqsubset: "⊏", sqsubseteq: "⊑", sqsup: "⊐", sqsupe: "⊒", sqsupset: "⊐", sqsupseteq: "⊒", square: "□", Square: "□", SquareIntersection: "⊓", SquareSubset: "⊏", SquareSubsetEqual: "⊑", SquareSuperset: "⊐", SquareSupersetEqual: "⊒", SquareUnion: "⊔", squarf: "▪", squ: "□", squf: "▪", srarr: "→", Sscr: "𝒮", sscr: "𝓈", ssetmn: "∖", ssmile: "⌣", sstarf: "⋆", Star: "⋆", star: "☆", starf: "★", straightepsilon: "ϵ", straightphi: "ϕ", strns: "¯", sub: "⊂", Sub: "⋐", subdot: "⪽", subE: "⫅", sube: "⊆", subedot: "⫃", submult: "⫁", subnE: "⫋", subne: "⊊", subplus: "⪿", subrarr: "⥹", subset: "⊂", Subset: "⋐", subseteq: "⊆", subseteqq: "⫅", SubsetEqual: "⊆", subsetneq: "⊊", subsetneqq: "⫋", subsim: "⫇", subsub: "⫕", subsup: "⫓", succapprox: "⪸", succ: "≻", succcurlyeq: "≽", Succeeds: "≻", SucceedsEqual: "⪰", SucceedsSlantEqual: "≽", SucceedsTilde: "≿", succeq: "⪰", succnapprox: "⪺", succneqq: "⪶", succnsim: "⋩", succsim: "≿", SuchThat: "∋", sum: "∑", Sum: "∑", sung: "♪", sup1: "¹", sup2: "²", sup3: "³", sup: "⊃", Sup: "⋑", supdot: "⪾", supdsub: "⫘", supE: "⫆", supe: "⊇", supedot: "⫄", Superset: "⊃", SupersetEqual: "⊇", suphsol: "⟉", suphsub: "⫗", suplarr: "⥻", supmult: "⫂", supnE: "⫌", supne: "⊋", supplus: "⫀", supset: "⊃", Supset: "⋑", supseteq: "⊇", supseteqq: "⫆", supsetneq: "⊋", supsetneqq: "⫌", supsim: "⫈", supsub: "⫔", supsup: "⫖", swarhk: "⤦", swarr: "↙", swArr: "⇙", swarrow: "↙", swnwar: "⤪", szlig: "ß", Tab: "\u0009", target: "⌖", Tau: "Τ", tau: "τ", tbrk: "⎴", Tcaron: "Ť", tcaron: "ť", Tcedil: "Ţ", tcedil: "ţ", Tcy: "Т", tcy: "т", tdot: "⃛", telrec: "⌕", Tfr: "𝔗", tfr: "𝔱", there4: "∴", therefore: "∴", Therefore: "∴", Theta: "Θ", theta: "θ", thetasym: "ϑ", thetav: "ϑ", thickapprox: "≈", thicksim: "∼", ThickSpace: " ", ThinSpace: " ", thinsp: " ", thkap: "≈", thksim: "∼", THORN: "Þ", thorn: "þ", tilde: "˜", Tilde: "∼", TildeEqual: "≃", TildeFullEqual: "≅", TildeTilde: "≈", timesbar: "⨱", timesb: "⊠", times: "×", timesd: "⨰", tint: "∭", toea: "⤨", topbot: "⌶", topcir: "⫱", top: "⊤", Topf: "𝕋", topf: "𝕥", topfork: "⫚", tosa: "⤩", tprime: "‴", trade: "™", TRADE: "™", triangle: "▵", triangledown: "▿", triangleleft: "◃", trianglelefteq: "⊴", triangleq: "≜", triangleright: "▹", trianglerighteq: "⊵", tridot: "◬", trie: "≜", triminus: "⨺", TripleDot: "⃛", triplus: "⨹", trisb: "⧍", tritime: "⨻", trpezium: "⏢", Tscr: "𝒯", tscr: "𝓉", TScy: "Ц", tscy: "ц", TSHcy: "Ћ", tshcy: "ћ", Tstrok: "Ŧ", tstrok: "ŧ", twixt: "≬", twoheadleftarrow: "↞", twoheadrightarrow: "↠", Uacute: "Ú", uacute: "ú", uarr: "↑", Uarr: "↟", uArr: "⇑", Uarrocir: "⥉", Ubrcy: "Ў", ubrcy: "ў", Ubreve: "Ŭ", ubreve: "ŭ", Ucirc: "Û", ucirc: "û", Ucy: "У", ucy: "у", udarr: "⇅", Udblac: "Ű", udblac: "ű", udhar: "⥮", ufisht: "⥾", Ufr: "𝔘", ufr: "𝔲", Ugrave: "Ù", ugrave: "ù", uHar: "⥣", uharl: "↿", uharr: "↾", uhblk: "▀", ulcorn: "⌜", ulcorner: "⌜", ulcrop: "⌏", ultri: "◸", Umacr: "Ū", umacr: "ū", uml: "¨", UnderBar: "_", UnderBrace: "⏟", UnderBracket: "⎵", UnderParenthesis: "⏝", Union: "⋃", UnionPlus: "⊎", Uogon: "Ų", uogon: "ų", Uopf: "𝕌", uopf: "𝕦", UpArrowBar: "⤒", uparrow: "↑", UpArrow: "↑", Uparrow: "⇑", UpArrowDownArrow: "⇅", updownarrow: "↕", UpDownArrow: "↕", Updownarrow: "⇕", UpEquilibrium: "⥮", upharpoonleft: "↿", upharpoonright: "↾", uplus: "⊎", UpperLeftArrow: "↖", UpperRightArrow: "↗", upsi: "υ", Upsi: "ϒ", upsih: "ϒ", Upsilon: "Υ", upsilon: "υ", UpTeeArrow: "↥", UpTee: "⊥", upuparrows: "⇈", urcorn: "⌝", urcorner: "⌝", urcrop: "⌎", Uring: "Ů", uring: "ů", urtri: "◹", Uscr: "𝒰", uscr: "𝓊", utdot: "⋰", Utilde: "Ũ", utilde: "ũ", utri: "▵", utrif: "▴", uuarr: "⇈", Uuml: "Ü", uuml: "ü", uwangle: "⦧", vangrt: "⦜", varepsilon: "ϵ", varkappa: "ϰ", varnothing: "∅", varphi: "ϕ", varpi: "ϖ", varpropto: "∝", varr: "↕", vArr: "⇕", varrho: "ϱ", varsigma: "ς", varsubsetneq: "⊊︀", varsubsetneqq: "⫋︀", varsupsetneq: "⊋︀", varsupsetneqq: "⫌︀", vartheta: "ϑ", vartriangleleft: "⊲", vartriangleright: "⊳", vBar: "⫨", Vbar: "⫫", vBarv: "⫩", Vcy: "В", vcy: "в", vdash: "⊢", vDash: "⊨", Vdash: "⊩", VDash: "⊫", Vdashl: "⫦", veebar: "⊻", vee: "∨", Vee: "⋁", veeeq: "≚", vellip: "⋮", verbar: "|", Verbar: "‖", vert: "|", Vert: "‖", VerticalBar: "∣", VerticalLine: "|", VerticalSeparator: "❘", VerticalTilde: "≀", VeryThinSpace: " ", Vfr: "𝔙", vfr: "𝔳", vltri: "⊲", vnsub: "⊂⃒", vnsup: "⊃⃒", Vopf: "𝕍", vopf: "𝕧", vprop: "∝", vrtri: "⊳", Vscr: "𝒱", vscr: "𝓋", vsubnE: "⫋︀", vsubne: "⊊︀", vsupnE: "⫌︀", vsupne: "⊋︀", Vvdash: "⊪", vzigzag: "⦚", Wcirc: "Ŵ", wcirc: "ŵ", wedbar: "⩟", wedge: "∧", Wedge: "⋀", wedgeq: "≙", weierp: "℘", Wfr: "𝔚", wfr: "𝔴", Wopf: "𝕎", wopf: "𝕨", wp: "℘", wr: "≀", wreath: "≀", Wscr: "𝒲", wscr: "𝓌", xcap: "⋂", xcirc: "◯", xcup: "⋃", xdtri: "▽", Xfr: "𝔛", xfr: "𝔵", xharr: "⟷", xhArr: "⟺", Xi: "Ξ", xi: "ξ", xlarr: "⟵", xlArr: "⟸", xmap: "⟼", xnis: "⋻", xodot: "⨀", Xopf: "𝕏", xopf: "𝕩", xoplus: "⨁", xotime: "⨂", xrarr: "⟶", xrArr: "⟹", Xscr: "𝒳", xscr: "𝓍", xsqcup: "⨆", xuplus: "⨄", xutri: "△", xvee: "⋁", xwedge: "⋀", Yacute: "Ý", yacute: "ý", YAcy: "Я", yacy: "я", Ycirc: "Ŷ", ycirc: "ŷ", Ycy: "Ы", ycy: "ы", yen: "¥", Yfr: "𝔜", yfr: "𝔶", YIcy: "Ї", yicy: "ї", Yopf: "𝕐", yopf: "𝕪", Yscr: "𝒴", yscr: "𝓎", YUcy: "Ю", yucy: "ю", yuml: "ÿ", Yuml: "Ÿ", Zacute: "Ź", zacute: "ź", Zcaron: "Ž", zcaron: "ž", Zcy: "З", zcy: "з", Zdot: "Ż", zdot: "ż", zeetrf: "ℨ", ZeroWidthSpace: "", Zeta: "Ζ", zeta: "ζ", zfr: "𝔷", Zfr: "ℨ", ZHcy: "Ж", zhcy: "ж", zigrarr: "⇝", zopf: "𝕫", Zopf: "ℤ", Zscr: "𝒵", zscr: "𝓏", zwj: "\u200d", zwnj: "\u200c"
+};
+
+var HEXCHARCODE = /^#[xX]([A-Fa-f0-9]+)$/;
+var CHARCODE = /^#([0-9]+)$/;
+var NAMED = /^([A-Za-z0-9]+)$/;
+var EntityParser = /** @class */ (function () {
+ function EntityParser(named) {
+ this.named = named;
+ }
+ EntityParser.prototype.parse = function (entity) {
+ if (!entity) {
+ return;
+ }
+ var matches = entity.match(HEXCHARCODE);
+ if (matches) {
+ return String.fromCharCode(parseInt(matches[1], 16));
+ }
+ matches = entity.match(CHARCODE);
+ if (matches) {
+ return String.fromCharCode(parseInt(matches[1], 10));
+ }
+ matches = entity.match(NAMED);
+ if (matches) {
+ return this.named[matches[1]];
+ }
+ };
+ return EntityParser;
+}());
+
+var WSP = /[\t\n\f ]/;
+var ALPHA = /[A-Za-z]/;
+var CRLF = /\r\n?/g;
+function isSpace(char) {
+ return WSP.test(char);
+}
+function isAlpha(char) {
+ return ALPHA.test(char);
+}
+function preprocessInput(input) {
+ return input.replace(CRLF, '\n');
+}
+
+var EventedTokenizer = /** @class */ (function () {
+ function EventedTokenizer(delegate, entityParser, mode) {
+ if (mode === void 0) { mode = 'precompile'; }
+ this.delegate = delegate;
+ this.entityParser = entityParser;
+ this.mode = mode;
+ this.state = "beforeData" /* beforeData */;
+ this.line = -1;
+ this.column = -1;
+ this.input = '';
+ this.index = -1;
+ this.tagNameBuffer = '';
+ this.states = {
+ beforeData: function () {
+ var char = this.peek();
+ if (char === '<' && !this.isIgnoredEndTag()) {
+ this.transitionTo("tagOpen" /* tagOpen */);
+ this.markTagStart();
+ this.consume();
+ }
+ else {
+ if (this.mode === 'precompile' && char === '\n') {
+ var tag = this.tagNameBuffer.toLowerCase();
+ if (tag === 'pre' || tag === 'textarea') {
+ this.consume();
+ }
+ }
+ this.transitionTo("data" /* data */);
+ this.delegate.beginData();
+ }
+ },
+ data: function () {
+ var char = this.peek();
+ var tag = this.tagNameBuffer;
+ if (char === '<' && !this.isIgnoredEndTag()) {
+ this.delegate.finishData();
+ this.transitionTo("tagOpen" /* tagOpen */);
+ this.markTagStart();
+ this.consume();
+ }
+ else if (char === '&' && tag !== 'script' && tag !== 'style') {
+ this.consume();
+ this.delegate.appendToData(this.consumeCharRef() || '&');
+ }
+ else {
+ this.consume();
+ this.delegate.appendToData(char);
+ }
+ },
+ tagOpen: function () {
+ var char = this.consume();
+ if (char === '!') {
+ this.transitionTo("markupDeclarationOpen" /* markupDeclarationOpen */);
+ }
+ else if (char === '/') {
+ this.transitionTo("endTagOpen" /* endTagOpen */);
+ }
+ else if (char === '@' || char === ':' || isAlpha(char)) {
+ this.transitionTo("tagName" /* tagName */);
+ this.tagNameBuffer = '';
+ this.delegate.beginStartTag();
+ this.appendToTagName(char);
+ }
+ },
+ markupDeclarationOpen: function () {
+ var char = this.consume();
+ if (char === '-' && this.peek() === '-') {
+ this.consume();
+ this.transitionTo("commentStart" /* commentStart */);
+ this.delegate.beginComment();
+ }
+ else {
+ var maybeDoctype = char.toUpperCase() + this.input.substring(this.index, this.index + 6).toUpperCase();
+ if (maybeDoctype === 'DOCTYPE') {
+ this.consume();
+ this.consume();
+ this.consume();
+ this.consume();
+ this.consume();
+ this.consume();
+ this.transitionTo("doctype" /* doctype */);
+ if (this.delegate.beginDoctype)
+ this.delegate.beginDoctype();
+ }
+ }
+ },
+ doctype: function () {
+ var char = this.consume();
+ if (isSpace(char)) {
+ this.transitionTo("beforeDoctypeName" /* beforeDoctypeName */);
+ }
+ },
+ beforeDoctypeName: function () {
+ var char = this.consume();
+ if (isSpace(char)) {
+ return;
+ }
+ else {
+ this.transitionTo("doctypeName" /* doctypeName */);
+ if (this.delegate.appendToDoctypeName)
+ this.delegate.appendToDoctypeName(char.toLowerCase());
+ }
+ },
+ doctypeName: function () {
+ var char = this.consume();
+ if (isSpace(char)) {
+ this.transitionTo("afterDoctypeName" /* afterDoctypeName */);
+ }
+ else if (char === '>') {
+ if (this.delegate.endDoctype)
+ this.delegate.endDoctype();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else {
+ if (this.delegate.appendToDoctypeName)
+ this.delegate.appendToDoctypeName(char.toLowerCase());
+ }
+ },
+ afterDoctypeName: function () {
+ var char = this.consume();
+ if (isSpace(char)) {
+ return;
+ }
+ else if (char === '>') {
+ if (this.delegate.endDoctype)
+ this.delegate.endDoctype();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else {
+ var nextSixChars = char.toUpperCase() + this.input.substring(this.index, this.index + 5).toUpperCase();
+ var isPublic = nextSixChars.toUpperCase() === 'PUBLIC';
+ var isSystem = nextSixChars.toUpperCase() === 'SYSTEM';
+ if (isPublic || isSystem) {
+ this.consume();
+ this.consume();
+ this.consume();
+ this.consume();
+ this.consume();
+ this.consume();
+ }
+ if (isPublic) {
+ this.transitionTo("afterDoctypePublicKeyword" /* afterDoctypePublicKeyword */);
+ }
+ else if (isSystem) {
+ this.transitionTo("afterDoctypeSystemKeyword" /* afterDoctypeSystemKeyword */);
+ }
+ }
+ },
+ afterDoctypePublicKeyword: function () {
+ var char = this.peek();
+ if (isSpace(char)) {
+ this.transitionTo("beforeDoctypePublicIdentifier" /* beforeDoctypePublicIdentifier */);
+ this.consume();
+ }
+ else if (char === '"') {
+ this.transitionTo("doctypePublicIdentifierDoubleQuoted" /* doctypePublicIdentifierDoubleQuoted */);
+ this.consume();
+ }
+ else if (char === "'") {
+ this.transitionTo("doctypePublicIdentifierSingleQuoted" /* doctypePublicIdentifierSingleQuoted */);
+ this.consume();
+ }
+ else if (char === '>') {
+ this.consume();
+ if (this.delegate.endDoctype)
+ this.delegate.endDoctype();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ },
+ doctypePublicIdentifierDoubleQuoted: function () {
+ var char = this.consume();
+ if (char === '"') {
+ this.transitionTo("afterDoctypePublicIdentifier" /* afterDoctypePublicIdentifier */);
+ }
+ else if (char === '>') {
+ if (this.delegate.endDoctype)
+ this.delegate.endDoctype();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else {
+ if (this.delegate.appendToDoctypePublicIdentifier)
+ this.delegate.appendToDoctypePublicIdentifier(char);
+ }
+ },
+ doctypePublicIdentifierSingleQuoted: function () {
+ var char = this.consume();
+ if (char === "'") {
+ this.transitionTo("afterDoctypePublicIdentifier" /* afterDoctypePublicIdentifier */);
+ }
+ else if (char === '>') {
+ if (this.delegate.endDoctype)
+ this.delegate.endDoctype();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else {
+ if (this.delegate.appendToDoctypePublicIdentifier)
+ this.delegate.appendToDoctypePublicIdentifier(char);
+ }
+ },
+ afterDoctypePublicIdentifier: function () {
+ var char = this.consume();
+ if (isSpace(char)) {
+ this.transitionTo("betweenDoctypePublicAndSystemIdentifiers" /* betweenDoctypePublicAndSystemIdentifiers */);
+ }
+ else if (char === '>') {
+ if (this.delegate.endDoctype)
+ this.delegate.endDoctype();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else if (char === '"') {
+ this.transitionTo("doctypeSystemIdentifierDoubleQuoted" /* doctypeSystemIdentifierDoubleQuoted */);
+ }
+ else if (char === "'") {
+ this.transitionTo("doctypeSystemIdentifierSingleQuoted" /* doctypeSystemIdentifierSingleQuoted */);
+ }
+ },
+ betweenDoctypePublicAndSystemIdentifiers: function () {
+ var char = this.consume();
+ if (isSpace(char)) {
+ return;
+ }
+ else if (char === '>') {
+ if (this.delegate.endDoctype)
+ this.delegate.endDoctype();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else if (char === '"') {
+ this.transitionTo("doctypeSystemIdentifierDoubleQuoted" /* doctypeSystemIdentifierDoubleQuoted */);
+ }
+ else if (char === "'") {
+ this.transitionTo("doctypeSystemIdentifierSingleQuoted" /* doctypeSystemIdentifierSingleQuoted */);
+ }
+ },
+ doctypeSystemIdentifierDoubleQuoted: function () {
+ var char = this.consume();
+ if (char === '"') {
+ this.transitionTo("afterDoctypeSystemIdentifier" /* afterDoctypeSystemIdentifier */);
+ }
+ else if (char === '>') {
+ if (this.delegate.endDoctype)
+ this.delegate.endDoctype();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else {
+ if (this.delegate.appendToDoctypeSystemIdentifier)
+ this.delegate.appendToDoctypeSystemIdentifier(char);
+ }
+ },
+ doctypeSystemIdentifierSingleQuoted: function () {
+ var char = this.consume();
+ if (char === "'") {
+ this.transitionTo("afterDoctypeSystemIdentifier" /* afterDoctypeSystemIdentifier */);
+ }
+ else if (char === '>') {
+ if (this.delegate.endDoctype)
+ this.delegate.endDoctype();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else {
+ if (this.delegate.appendToDoctypeSystemIdentifier)
+ this.delegate.appendToDoctypeSystemIdentifier(char);
+ }
+ },
+ afterDoctypeSystemIdentifier: function () {
+ var char = this.consume();
+ if (isSpace(char)) {
+ return;
+ }
+ else if (char === '>') {
+ if (this.delegate.endDoctype)
+ this.delegate.endDoctype();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ },
+ commentStart: function () {
+ var char = this.consume();
+ if (char === '-') {
+ this.transitionTo("commentStartDash" /* commentStartDash */);
+ }
+ else if (char === '>') {
+ this.delegate.finishComment();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else {
+ this.delegate.appendToCommentData(char);
+ this.transitionTo("comment" /* comment */);
+ }
+ },
+ commentStartDash: function () {
+ var char = this.consume();
+ if (char === '-') {
+ this.transitionTo("commentEnd" /* commentEnd */);
+ }
+ else if (char === '>') {
+ this.delegate.finishComment();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else {
+ this.delegate.appendToCommentData('-');
+ this.transitionTo("comment" /* comment */);
+ }
+ },
+ comment: function () {
+ var char = this.consume();
+ if (char === '-') {
+ this.transitionTo("commentEndDash" /* commentEndDash */);
+ }
+ else {
+ this.delegate.appendToCommentData(char);
+ }
+ },
+ commentEndDash: function () {
+ var char = this.consume();
+ if (char === '-') {
+ this.transitionTo("commentEnd" /* commentEnd */);
+ }
+ else {
+ this.delegate.appendToCommentData('-' + char);
+ this.transitionTo("comment" /* comment */);
+ }
+ },
+ commentEnd: function () {
+ var char = this.consume();
+ if (char === '>') {
+ this.delegate.finishComment();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else {
+ this.delegate.appendToCommentData('--' + char);
+ this.transitionTo("comment" /* comment */);
+ }
+ },
+ tagName: function () {
+ var char = this.consume();
+ if (isSpace(char)) {
+ this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
+ }
+ else if (char === '/') {
+ this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
+ }
+ else if (char === '>') {
+ this.delegate.finishTag();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else {
+ this.appendToTagName(char);
+ }
+ },
+ endTagName: function () {
+ var char = this.consume();
+ if (isSpace(char)) {
+ this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
+ this.tagNameBuffer = '';
+ }
+ else if (char === '/') {
+ this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
+ this.tagNameBuffer = '';
+ }
+ else if (char === '>') {
+ this.delegate.finishTag();
+ this.transitionTo("beforeData" /* beforeData */);
+ this.tagNameBuffer = '';
+ }
+ else {
+ this.appendToTagName(char);
+ }
+ },
+ beforeAttributeName: function () {
+ var char = this.peek();
+ if (isSpace(char)) {
+ this.consume();
+ return;
+ }
+ else if (char === '/') {
+ this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
+ this.consume();
+ }
+ else if (char === '>') {
+ this.consume();
+ this.delegate.finishTag();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else if (char === '=') {
+ this.delegate.reportSyntaxError('attribute name cannot start with equals sign');
+ this.transitionTo("attributeName" /* attributeName */);
+ this.delegate.beginAttribute();
+ this.consume();
+ this.delegate.appendToAttributeName(char);
+ }
+ else {
+ this.transitionTo("attributeName" /* attributeName */);
+ this.delegate.beginAttribute();
+ }
+ },
+ attributeName: function () {
+ var char = this.peek();
+ if (isSpace(char)) {
+ this.transitionTo("afterAttributeName" /* afterAttributeName */);
+ this.consume();
+ }
+ else if (char === '/') {
+ this.delegate.beginAttributeValue(false);
+ this.delegate.finishAttributeValue();
+ this.consume();
+ this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
+ }
+ else if (char === '=') {
+ this.transitionTo("beforeAttributeValue" /* beforeAttributeValue */);
+ this.consume();
+ }
+ else if (char === '>') {
+ this.delegate.beginAttributeValue(false);
+ this.delegate.finishAttributeValue();
+ this.consume();
+ this.delegate.finishTag();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else if (char === '"' || char === "'" || char === '<') {
+ this.delegate.reportSyntaxError(char + ' is not a valid character within attribute names');
+ this.consume();
+ this.delegate.appendToAttributeName(char);
+ }
+ else {
+ this.consume();
+ this.delegate.appendToAttributeName(char);
+ }
+ },
+ afterAttributeName: function () {
+ var char = this.peek();
+ if (isSpace(char)) {
+ this.consume();
+ return;
+ }
+ else if (char === '/') {
+ this.delegate.beginAttributeValue(false);
+ this.delegate.finishAttributeValue();
+ this.consume();
+ this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
+ }
+ else if (char === '=') {
+ this.consume();
+ this.transitionTo("beforeAttributeValue" /* beforeAttributeValue */);
+ }
+ else if (char === '>') {
+ this.delegate.beginAttributeValue(false);
+ this.delegate.finishAttributeValue();
+ this.consume();
+ this.delegate.finishTag();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else {
+ this.delegate.beginAttributeValue(false);
+ this.delegate.finishAttributeValue();
+ this.transitionTo("attributeName" /* attributeName */);
+ this.delegate.beginAttribute();
+ this.consume();
+ this.delegate.appendToAttributeName(char);
+ }
+ },
+ beforeAttributeValue: function () {
+ var char = this.peek();
+ if (isSpace(char)) {
+ this.consume();
+ }
+ else if (char === '"') {
+ this.transitionTo("attributeValueDoubleQuoted" /* attributeValueDoubleQuoted */);
+ this.delegate.beginAttributeValue(true);
+ this.consume();
+ }
+ else if (char === "'") {
+ this.transitionTo("attributeValueSingleQuoted" /* attributeValueSingleQuoted */);
+ this.delegate.beginAttributeValue(true);
+ this.consume();
+ }
+ else if (char === '>') {
+ this.delegate.beginAttributeValue(false);
+ this.delegate.finishAttributeValue();
+ this.consume();
+ this.delegate.finishTag();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else {
+ this.transitionTo("attributeValueUnquoted" /* attributeValueUnquoted */);
+ this.delegate.beginAttributeValue(false);
+ this.consume();
+ this.delegate.appendToAttributeValue(char);
+ }
+ },
+ attributeValueDoubleQuoted: function () {
+ var char = this.consume();
+ if (char === '"') {
+ this.delegate.finishAttributeValue();
+ this.transitionTo("afterAttributeValueQuoted" /* afterAttributeValueQuoted */);
+ }
+ else if (char === '&') {
+ this.delegate.appendToAttributeValue(this.consumeCharRef() || '&');
+ }
+ else {
+ this.delegate.appendToAttributeValue(char);
+ }
+ },
+ attributeValueSingleQuoted: function () {
+ var char = this.consume();
+ if (char === "'") {
+ this.delegate.finishAttributeValue();
+ this.transitionTo("afterAttributeValueQuoted" /* afterAttributeValueQuoted */);
+ }
+ else if (char === '&') {
+ this.delegate.appendToAttributeValue(this.consumeCharRef() || '&');
+ }
+ else {
+ this.delegate.appendToAttributeValue(char);
+ }
+ },
+ attributeValueUnquoted: function () {
+ var char = this.peek();
+ if (isSpace(char)) {
+ this.delegate.finishAttributeValue();
+ this.consume();
+ this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
+ }
+ else if (char === '/') {
+ this.delegate.finishAttributeValue();
+ this.consume();
+ this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
+ }
+ else if (char === '&') {
+ this.consume();
+ this.delegate.appendToAttributeValue(this.consumeCharRef() || '&');
+ }
+ else if (char === '>') {
+ this.delegate.finishAttributeValue();
+ this.consume();
+ this.delegate.finishTag();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else {
+ this.consume();
+ this.delegate.appendToAttributeValue(char);
+ }
+ },
+ afterAttributeValueQuoted: function () {
+ var char = this.peek();
+ if (isSpace(char)) {
+ this.consume();
+ this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
+ }
+ else if (char === '/') {
+ this.consume();
+ this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
+ }
+ else if (char === '>') {
+ this.consume();
+ this.delegate.finishTag();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else {
+ this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
+ }
+ },
+ selfClosingStartTag: function () {
+ var char = this.peek();
+ if (char === '>') {
+ this.consume();
+ this.delegate.markTagAsSelfClosing();
+ this.delegate.finishTag();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ else {
+ this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
+ }
+ },
+ endTagOpen: function () {
+ var char = this.consume();
+ if (char === '@' || char === ':' || isAlpha(char)) {
+ this.transitionTo("endTagName" /* endTagName */);
+ this.tagNameBuffer = '';
+ this.delegate.beginEndTag();
+ this.appendToTagName(char);
+ }
+ }
+ };
+ this.reset();
+ }
+ EventedTokenizer.prototype.reset = function () {
+ this.transitionTo("beforeData" /* beforeData */);
+ this.input = '';
+ this.tagNameBuffer = '';
+ this.index = 0;
+ this.line = 1;
+ this.column = 0;
+ this.delegate.reset();
+ };
+ EventedTokenizer.prototype.transitionTo = function (state) {
+ this.state = state;
+ };
+ EventedTokenizer.prototype.tokenize = function (input) {
+ this.reset();
+ this.tokenizePart(input);
+ this.tokenizeEOF();
+ };
+ EventedTokenizer.prototype.tokenizePart = function (input) {
+ this.input += preprocessInput(input);
+ while (this.index < this.input.length) {
+ var handler = this.states[this.state];
+ if (handler !== undefined) {
+ handler.call(this);
+ }
+ else {
+ throw new Error("unhandled state " + this.state);
+ }
+ }
+ };
+ EventedTokenizer.prototype.tokenizeEOF = function () {
+ this.flushData();
+ };
+ EventedTokenizer.prototype.flushData = function () {
+ if (this.state === 'data') {
+ this.delegate.finishData();
+ this.transitionTo("beforeData" /* beforeData */);
+ }
+ };
+ EventedTokenizer.prototype.peek = function () {
+ return this.input.charAt(this.index);
+ };
+ EventedTokenizer.prototype.consume = function () {
+ var char = this.peek();
+ this.index++;
+ if (char === '\n') {
+ this.line++;
+ this.column = 0;
+ }
+ else {
+ this.column++;
+ }
+ return char;
+ };
+ EventedTokenizer.prototype.consumeCharRef = function () {
+ var endIndex = this.input.indexOf(';', this.index);
+ if (endIndex === -1) {
+ return;
+ }
+ var entity = this.input.slice(this.index, endIndex);
+ var chars = this.entityParser.parse(entity);
+ if (chars) {
+ var count = entity.length;
+ // consume the entity chars
+ while (count) {
+ this.consume();
+ count--;
+ }
+ // consume the `;`
+ this.consume();
+ return chars;
+ }
+ };
+ EventedTokenizer.prototype.markTagStart = function () {
+ this.delegate.tagOpen();
+ };
+ EventedTokenizer.prototype.appendToTagName = function (char) {
+ this.tagNameBuffer += char;
+ this.delegate.appendToTagName(char);
+ };
+ EventedTokenizer.prototype.isIgnoredEndTag = function () {
+ var tag = this.tagNameBuffer;
+ return (tag === 'title' && this.input.substring(this.index, this.index + 8) !== '</title>') ||
+ (tag === 'style' && this.input.substring(this.index, this.index + 8) !== '</style>') ||
+ (tag === 'script' && this.input.substring(this.index, this.index + 9) !== '</script>');
+ };
+ return EventedTokenizer;
+}());
+
+var Tokenizer = /** @class */ (function () {
+ function Tokenizer(entityParser, options) {
+ if (options === void 0) { options = {}; }
+ this.options = options;
+ this.token = null;
+ this.startLine = 1;
+ this.startColumn = 0;
+ this.tokens = [];
+ this.tokenizer = new EventedTokenizer(this, entityParser, options.mode);
+ this._currentAttribute = undefined;
+ }
+ Tokenizer.prototype.tokenize = function (input) {
+ this.tokens = [];
+ this.tokenizer.tokenize(input);
+ return this.tokens;
+ };
+ Tokenizer.prototype.tokenizePart = function (input) {
+ this.tokens = [];
+ this.tokenizer.tokenizePart(input);
+ return this.tokens;
+ };
+ Tokenizer.prototype.tokenizeEOF = function () {
+ this.tokens = [];
+ this.tokenizer.tokenizeEOF();
+ return this.tokens[0];
+ };
+ Tokenizer.prototype.reset = function () {
+ this.token = null;
+ this.startLine = 1;
+ this.startColumn = 0;
+ };
+ Tokenizer.prototype.current = function () {
+ var token = this.token;
+ if (token === null) {
+ throw new Error('token was unexpectedly null');
+ }
+ if (arguments.length === 0) {
+ return token;
+ }
+ for (var i = 0; i < arguments.length; i++) {
+ if (token.type === arguments[i]) {
+ return token;
+ }
+ }
+ throw new Error("token type was unexpectedly " + token.type);
+ };
+ Tokenizer.prototype.push = function (token) {
+ this.token = token;
+ this.tokens.push(token);
+ };
+ Tokenizer.prototype.currentAttribute = function () {
+ return this._currentAttribute;
+ };
+ Tokenizer.prototype.addLocInfo = function () {
+ if (this.options.loc) {
+ this.current().loc = {
+ start: {
+ line: this.startLine,
+ column: this.startColumn
+ },
+ end: {
+ line: this.tokenizer.line,
+ column: this.tokenizer.column
+ }
+ };
+ }
+ this.startLine = this.tokenizer.line;
+ this.startColumn = this.tokenizer.column;
+ };
+ // Data
+ Tokenizer.prototype.beginDoctype = function () {
+ this.push({
+ type: "Doctype" /* Doctype */,
+ name: '',
+ });
+ };
+ Tokenizer.prototype.appendToDoctypeName = function (char) {
+ this.current("Doctype" /* Doctype */).name += char;
+ };
+ Tokenizer.prototype.appendToDoctypePublicIdentifier = function (char) {
+ var doctype = this.current("Doctype" /* Doctype */);
+ if (doctype.publicIdentifier === undefined) {
+ doctype.publicIdentifier = char;
+ }
+ else {
+ doctype.publicIdentifier += char;
+ }
+ };
+ Tokenizer.prototype.appendToDoctypeSystemIdentifier = function (char) {
+ var doctype = this.current("Doctype" /* Doctype */);
+ if (doctype.systemIdentifier === undefined) {
+ doctype.systemIdentifier = char;
+ }
+ else {
+ doctype.systemIdentifier += char;
+ }
+ };
+ Tokenizer.prototype.endDoctype = function () {
+ this.addLocInfo();
+ };
+ Tokenizer.prototype.beginData = function () {
+ this.push({
+ type: "Chars" /* Chars */,
+ chars: ''
+ });
+ };
+ Tokenizer.prototype.appendToData = function (char) {
+ this.current("Chars" /* Chars */).chars += char;
+ };
+ Tokenizer.prototype.finishData = function () {
+ this.addLocInfo();
+ };
+ // Comment
+ Tokenizer.prototype.beginComment = function () {
+ this.push({
+ type: "Comment" /* Comment */,
+ chars: ''
+ });
+ };
+ Tokenizer.prototype.appendToCommentData = function (char) {
+ this.current("Comment" /* Comment */).chars += char;
+ };
+ Tokenizer.prototype.finishComment = function () {
+ this.addLocInfo();
+ };
+ // Tags - basic
+ Tokenizer.prototype.tagOpen = function () { };
+ Tokenizer.prototype.beginStartTag = function () {
+ this.push({
+ type: "StartTag" /* StartTag */,
+ tagName: '',
+ attributes: [],
+ selfClosing: false
+ });
+ };
+ Tokenizer.prototype.beginEndTag = function () {
+ this.push({
+ type: "EndTag" /* EndTag */,
+ tagName: ''
+ });
+ };
+ Tokenizer.prototype.finishTag = function () {
+ this.addLocInfo();
+ };
+ Tokenizer.prototype.markTagAsSelfClosing = function () {
+ this.current("StartTag" /* StartTag */).selfClosing = true;
+ };
+ // Tags - name
+ Tokenizer.prototype.appendToTagName = function (char) {
+ this.current("StartTag" /* StartTag */, "EndTag" /* EndTag */).tagName += char;
+ };
+ // Tags - attributes
+ Tokenizer.prototype.beginAttribute = function () {
+ this._currentAttribute = ['', '', false];
+ };
+ Tokenizer.prototype.appendToAttributeName = function (char) {
+ this.currentAttribute()[0] += char;
+ };
+ Tokenizer.prototype.beginAttributeValue = function (isQuoted) {
+ this.currentAttribute()[2] = isQuoted;
+ };
+ Tokenizer.prototype.appendToAttributeValue = function (char) {
+ this.currentAttribute()[1] += char;
+ };
+ Tokenizer.prototype.finishAttributeValue = function () {
+ this.current("StartTag" /* StartTag */).attributes.push(this._currentAttribute);
+ };
+ Tokenizer.prototype.reportSyntaxError = function (message) {
+ this.current().syntaxError = message;
+ };
+ return Tokenizer;
+}());
+
+function tokenize(input, options) {
+ var tokenizer = new Tokenizer(new EntityParser(namedCharRefs), options);
+ return tokenizer.tokenize(input);
+}
+
+
+
+;// CONCATENATED MODULE: external ["wp","htmlEntities"]
+var external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/validation/logger.js
+function createLogger() {
+ /**
+ * Creates a log handler with block validation prefix.
+ *
+ * @param {Function} logger Original logger function.
+ *
+ * @return {Function} Augmented logger function.
+ */
+ function createLogHandler(logger) {
+ let log = function (message) {
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
+ }
+
+ return logger('Block validation: ' + message, ...args);
+ }; // In test environments, pre-process string substitutions to improve
+ // readability of error messages. We'd prefer to avoid pulling in this
+ // dependency in runtime environments, and it can be dropped by a combo
+ // of Webpack env substitution + UglifyJS dead code elimination.
+
+
+ if (false) {}
+
+ return log;
+ }
+
+ return {
+ // eslint-disable-next-line no-console
+ error: createLogHandler(console.error),
+ // eslint-disable-next-line no-console
+ warning: createLogHandler(console.warn),
+
+ getItems() {
+ return [];
+ }
+
+ };
+}
+function createQueuedLogger() {
+ /**
+ * The list of enqueued log actions to print.
+ *
+ * @type {Array}
+ */
+ const queue = [];
+ const logger = createLogger();
+ return {
+ error() {
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
+ args[_key2] = arguments[_key2];
+ }
+
+ queue.push({
+ log: logger.error,
+ args
+ });
+ },
+
+ warning() {
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
+ args[_key3] = arguments[_key3];
+ }
+
+ queue.push({
+ log: logger.warning,
+ args
+ });
+ },
+
+ getItems() {
+ return queue;
+ }
+
+ };
+}
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/validation/index.js
+/**
+ * External dependencies
+ */
+
+
+/**
+ * WordPress dependencies
+ */
+
+
+/**
+ * Internal dependencies
+ */
+
+
+
+
+
+/**
+ * Globally matches any consecutive whitespace
+ *
+ * @type {RegExp}
+ */
+
+const REGEXP_WHITESPACE = /[\t\n\r\v\f ]+/g;
+/**
+ * Matches a string containing only whitespace
+ *
+ * @type {RegExp}
+ */
+
+const REGEXP_ONLY_WHITESPACE = /^[\t\n\r\v\f ]*$/;
+/**
+ * Matches a CSS URL type value
+ *
+ * @type {RegExp}
+ */
+
+const REGEXP_STYLE_URL_TYPE = /^url\s*\(['"\s]*(.*?)['"\s]*\)$/;
+/**
+ * Boolean attributes are attributes whose presence as being assigned is
+ * meaningful, even if only empty.
+ *
+ * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes
+ * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3
+ *
+ * Object.keys( Array.from( document.querySelectorAll( '#attributes-1 > tbody > tr' ) )
+ * .filter( ( tr ) => tr.lastChild.textContent.indexOf( 'Boolean attribute' ) !== -1 )
+ * .reduce( ( result, tr ) => Object.assign( result, {
+ * [ tr.firstChild.textContent.trim() ]: true
+ * } ), {} ) ).sort();
+ *
+ * @type {Array}
+ */
+
+const BOOLEAN_ATTRIBUTES = ['allowfullscreen', 'allowpaymentrequest', 'allowusermedia', 'async', 'autofocus', 'autoplay', 'checked', 'controls', 'default', 'defer', 'disabled', 'download', 'formnovalidate', 'hidden', 'ismap', 'itemscope', 'loop', 'multiple', 'muted', 'nomodule', 'novalidate', 'open', 'playsinline', 'readonly', 'required', 'reversed', 'selected', 'typemustmatch'];
+/**
+ * Enumerated attributes are attributes which must be of a specific value form.
+ * Like boolean attributes, these are meaningful if specified, even if not of a
+ * valid enumerated value.
+ *
+ * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute
+ * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3
+ *
+ * Object.keys( Array.from( document.querySelectorAll( '#attributes-1 > tbody > tr' ) )
+ * .filter( ( tr ) => /^("(.+?)";?\s*)+/.test( tr.lastChild.textContent.trim() ) )
+ * .reduce( ( result, tr ) => Object.assign( result, {
+ * [ tr.firstChild.textContent.trim() ]: true
+ * } ), {} ) ).sort();
+ *
+ * @type {Array}
+ */
+
+const ENUMERATED_ATTRIBUTES = ['autocapitalize', 'autocomplete', 'charset', 'contenteditable', 'crossorigin', 'decoding', 'dir', 'draggable', 'enctype', 'formenctype', 'formmethod', 'http-equiv', 'inputmode', 'kind', 'method', 'preload', 'scope', 'shape', 'spellcheck', 'translate', 'type', 'wrap'];
+/**
+ * Meaningful attributes are those who cannot be safely ignored when omitted in
+ * one HTML markup string and not another.
+ *
+ * @type {Array}
+ */
+
+const MEANINGFUL_ATTRIBUTES = [...BOOLEAN_ATTRIBUTES, ...ENUMERATED_ATTRIBUTES];
+/**
+ * Array of functions which receive a text string on which to apply normalizing
+ * behavior for consideration in text token equivalence, carefully ordered from
+ * least-to-most expensive operations.
+ *
+ * @type {Array}
+ */
+
+const TEXT_NORMALIZATIONS = [external_lodash_namespaceObject.identity, getTextWithCollapsedWhitespace];
+/**
+ * Regular expression matching a named character reference. In lieu of bundling
+ * a full set of references, the pattern covers the minimal necessary to test
+ * positively against the full set.
+ *
+ * "The ampersand must be followed by one of the names given in the named
+ * character references section, using the same case."
+ *
+ * Tested aginst "12.5 Named character references":
+ *
+ * ```
+ * const references = Array.from( document.querySelectorAll(
+ * '#named-character-references-table tr[id^=entity-] td:first-child'
+ * ) ).map( ( code ) => code.textContent )
+ * references.every( ( reference ) => /^[\da-z]+$/i.test( reference ) )
+ * ```
+ *
+ * @see https://html.spec.whatwg.org/multipage/syntax.html#character-references
+ * @see https://html.spec.whatwg.org/multipage/named-characters.html#named-character-references
+ *
+ * @type {RegExp}
+ */
+
+const REGEXP_NAMED_CHARACTER_REFERENCE = /^[\da-z]+$/i;
+/**
+ * Regular expression matching a decimal character reference.
+ *
+ * "The ampersand must be followed by a U+0023 NUMBER SIGN character (#),
+ * followed by one or more ASCII digits, representing a base-ten integer"
+ *
+ * @see https://html.spec.whatwg.org/multipage/syntax.html#character-references
+ *
+ * @type {RegExp}
+ */
+
+const REGEXP_DECIMAL_CHARACTER_REFERENCE = /^#\d+$/;
+/**
+ * Regular expression matching a hexadecimal character reference.
+ *
+ * "The ampersand must be followed by a U+0023 NUMBER SIGN character (#), which
+ * must be followed by either a U+0078 LATIN SMALL LETTER X character (x) or a
+ * U+0058 LATIN CAPITAL LETTER X character (X), which must then be followed by
+ * one or more ASCII hex digits, representing a hexadecimal integer"
+ *
+ * @see https://html.spec.whatwg.org/multipage/syntax.html#character-references
+ *
+ * @type {RegExp}
+ */
+
+const REGEXP_HEXADECIMAL_CHARACTER_REFERENCE = /^#x[\da-f]+$/i;
+/**
+ * Returns true if the given string is a valid character reference segment, or
+ * false otherwise. The text should be stripped of `&` and `;` demarcations.
+ *
+ * @param {string} text Text to test.
+ *
+ * @return {boolean} Whether text is valid character reference.
+ */
+
+function isValidCharacterReference(text) {
+ return REGEXP_NAMED_CHARACTER_REFERENCE.test(text) || REGEXP_DECIMAL_CHARACTER_REFERENCE.test(text) || REGEXP_HEXADECIMAL_CHARACTER_REFERENCE.test(text);
+}
+/**
+ * Subsitute EntityParser class for `simple-html-tokenizer` which uses the
+ * implementation of `decodeEntities` from `html-entities`, in order to avoid
+ * bundling a massive named character reference.
+ *
+ * @see https://github.com/tildeio/simple-html-tokenizer/tree/HEAD/src/entity-parser.ts
+ */
+
+class DecodeEntityParser {
+ /**
+ * Returns a substitute string for an entity string sequence between `&`
+ * and `;`, or undefined if no substitution should occur.
+ *
+ * @param {string} entity Entity fragment discovered in HTML.
+ *
+ * @return {?string} Entity substitute value.
+ */
+ parse(entity) {
+ if (isValidCharacterReference(entity)) {
+ return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)('&' + entity + ';');
+ }
+ }
+
+}
+/**
+ * Given a specified string, returns an array of strings split by consecutive
+ * whitespace, ignoring leading or trailing whitespace.
+ *
+ * @param {string} text Original text.
+ *
+ * @return {string[]} Text pieces split on whitespace.
+ */
+
+function getTextPiecesSplitOnWhitespace(text) {
+ return text.trim().split(REGEXP_WHITESPACE);
+}
+/**
+ * Given a specified string, returns a new trimmed string where all consecutive
+ * whitespace is collapsed to a single space.
+ *
+ * @param {string} text Original text.
+ *
+ * @return {string} Trimmed text with consecutive whitespace collapsed.
+ */
+
+function getTextWithCollapsedWhitespace(text) {
+ // This is an overly simplified whitespace comparison. The specification is
+ // more prescriptive of whitespace behavior in inline and block contexts.
+ //
+ // See: https://medium.com/@patrickbrosset/when-does-white-space-matter-in-html-b90e8a7cdd33
+ return getTextPiecesSplitOnWhitespace(text).join(' ');
+}
+/**
+ * Returns attribute pairs of the given StartTag token, including only pairs
+ * where the value is non-empty or the attribute is a boolean attribute, an
+ * enumerated attribute, or a custom data- attribute.
+ *
+ * @see MEANINGFUL_ATTRIBUTES
+ *
+ * @param {Object} token StartTag token.
+ *
+ * @return {Array[]} Attribute pairs.
+ */
+
+function getMeaningfulAttributePairs(token) {
+ return token.attributes.filter(pair => {
+ const [key, value] = pair;
+ return value || key.indexOf('data-') === 0 || (0,external_lodash_namespaceObject.includes)(MEANINGFUL_ATTRIBUTES, key);
+ });
+}
+/**
+ * Returns true if two text tokens (with `chars` property) are equivalent, or
+ * false otherwise.
+ *
+ * @param {Object} actual Actual token.
+ * @param {Object} expected Expected token.
+ * @param {Object} logger Validation logger object.
+ *
+ * @return {boolean} Whether two text tokens are equivalent.
+ */
+
+function isEquivalentTextTokens(actual, expected) {
+ let logger = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createLogger();
+ // This function is intentionally written as syntactically "ugly" as a hot
+ // path optimization. Text is progressively normalized in order from least-
+ // to-most operationally expensive, until the earliest point at which text
+ // can be confidently inferred as being equal.
+ let actualChars = actual.chars;
+ let expectedChars = expected.chars;
+
+ for (let i = 0; i < TEXT_NORMALIZATIONS.length; i++) {
+ const normalize = TEXT_NORMALIZATIONS[i];
+ actualChars = normalize(actualChars);
+ expectedChars = normalize(expectedChars);
+
+ if (actualChars === expectedChars) {
+ return true;
+ }
+ }
+
+ logger.warning('Expected text `%s`, saw `%s`.', expected.chars, actual.chars);
+ return false;
+}
+/**
+ * Given a CSS length value, returns a normalized CSS length value for strict equality
+ * comparison.
+ *
+ * @param {string} value CSS length value.
+ *
+ * @return {string} Normalized CSS length value.
+ */
+
+function getNormalizedLength(value) {
+ if (0 === parseFloat(value)) {
+ return '0';
+ } // Normalize strings with floats to always include a leading zero.
+
+
+ if (value.indexOf('.') === 0) {
+ return '0' + value;
+ }
+
+ return value;
+}
+/**
+ * Given a style value, returns a normalized style value for strict equality
+ * comparison.
+ *
+ * @param {string} value Style value.
+ *
+ * @return {string} Normalized style value.
+ */
+
+function getNormalizedStyleValue(value) {
+ const textPieces = getTextPiecesSplitOnWhitespace(value);
+ const normalizedPieces = textPieces.map(getNormalizedLength);
+ const result = normalizedPieces.join(' ');
+ return result // Normalize URL type to omit whitespace or quotes
+ .replace(REGEXP_STYLE_URL_TYPE, 'url($1)');
+}
+/**
+ * Given a style attribute string, returns an object of style properties.
+ *
+ * @param {string} text Style attribute.
+ *
+ * @return {Object} Style properties.
+ */
+
+function getStyleProperties(text) {
+ const pairs = text // Trim ending semicolon (avoid including in split)
+ .replace(/;?\s*$/, '') // Split on property assignment
+ .split(';') // For each property assignment...
+ .map(style => {
+ // ...split further into key-value pairs
+ const [key, ...valueParts] = style.split(':');
+ const value = valueParts.join(':');
+ return [key.trim(), getNormalizedStyleValue(value.trim())];
+ });
+ return (0,external_lodash_namespaceObject.fromPairs)(pairs);
+}
+/**
+ * Attribute-specific equality handlers
+ *
+ * @type {Object}
+ */
+
+const isEqualAttributesOfName = {
+ class: (actual, expected) => {
+ // Class matches if members are the same, even if out of order or
+ // superfluous whitespace between.
+ return !(0,external_lodash_namespaceObject.xor)(...[actual, expected].map(getTextPiecesSplitOnWhitespace)).length;
+ },
+ style: (actual, expected) => {
+ return (0,external_lodash_namespaceObject.isEqual)(...[actual, expected].map(getStyleProperties));
+ },
+ // For each boolean attribute, mere presence of attribute in both is enough
+ // to assume equivalence.
+ ...(0,external_lodash_namespaceObject.fromPairs)(BOOLEAN_ATTRIBUTES.map(attribute => [attribute, external_lodash_namespaceObject.stubTrue]))
+};
+/**
+ * Given two sets of attribute tuples, returns true if the attribute sets are
+ * equivalent.
+ *
+ * @param {Array[]} actual Actual attributes tuples.
+ * @param {Array[]} expected Expected attributes tuples.
+ * @param {Object} logger Validation logger object.
+ *
+ * @return {boolean} Whether attributes are equivalent.
+ */
+
+function isEqualTagAttributePairs(actual, expected) {
+ let logger = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createLogger();
+
+ // Attributes is tokenized as tuples. Their lengths should match. This also
+ // avoids us needing to check both attributes sets, since if A has any keys
+ // which do not exist in B, we know the sets to be different.
+ if (actual.length !== expected.length) {
+ logger.warning('Expected attributes %o, instead saw %o.', expected, actual);
+ return false;
+ } // Attributes are not guaranteed to occur in the same order. For validating
+ // actual attributes, first convert the set of expected attribute values to
+ // an object, for lookup by key.
+
+
+ const expectedAttributes = {};
+
+ for (let i = 0; i < expected.length; i++) {
+ expectedAttributes[expected[i][0].toLowerCase()] = expected[i][1];
+ }
+
+ for (let i = 0; i < actual.length; i++) {
+ const [name, actualValue] = actual[i];
+ const nameLower = name.toLowerCase(); // As noted above, if missing member in B, assume different
+
+ if (!expectedAttributes.hasOwnProperty(nameLower)) {
+ logger.warning('Encountered unexpected attribute `%s`.', name);
+ return false;
+ }
+
+ const expectedValue = expectedAttributes[nameLower];
+ const isEqualAttributes = isEqualAttributesOfName[nameLower];
+
+ if (isEqualAttributes) {
+ // Defer custom attribute equality handling
+ if (!isEqualAttributes(actualValue, expectedValue)) {
+ logger.warning('Expected attribute `%s` of value `%s`, saw `%s`.', name, expectedValue, actualValue);
+ return false;
+ }
+ } else if (actualValue !== expectedValue) {
+ // Otherwise strict inequality should bail
+ logger.warning('Expected attribute `%s` of value `%s`, saw `%s`.', name, expectedValue, actualValue);
+ return false;
+ }
+ }
+
+ return true;
+}
+/**
+ * Token-type-specific equality handlers
+ *
+ * @type {Object}
+ */
+
+const isEqualTokensOfType = {
+ StartTag: function (actual, expected) {
+ let logger = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createLogger();
+
+ if (actual.tagName !== expected.tagName && // Optimization: Use short-circuit evaluation to defer case-
+ // insensitive check on the assumption that the majority case will
+ // have exactly equal tag names.
+ actual.tagName.toLowerCase() !== expected.tagName.toLowerCase()) {
+ logger.warning('Expected tag name `%s`, instead saw `%s`.', expected.tagName, actual.tagName);
+ return false;
+ }
+
+ return isEqualTagAttributePairs(...[actual, expected].map(getMeaningfulAttributePairs), logger);
+ },
+ Chars: isEquivalentTextTokens,
+ Comment: isEquivalentTextTokens
};
-
/**
- * Created by Estevao on 31-05-2015.
+ * Given an array of tokens, returns the first token which is not purely
+ * whitespace.
+ *
+ * Mutates the tokens array.
+ *
+ * @param {Object[]} tokens Set of tokens to search.
+ *
+ * @return {Object} Next non-whitespace token.
*/
+function getNextNonWhitespaceToken(tokens) {
+ let token;
+
+ while (token = tokens.shift()) {
+ if (token.type !== 'Chars') {
+ return token;
+ }
+
+ if (!REGEXP_ONLY_WHITESPACE.test(token.chars)) {
+ return token;
+ }
+ }
+}
/**
- * Showdown Converter class
- * @class
- * @param {object} [converterOptions]
- * @returns {Converter}
+ * Tokenize an HTML string, gracefully handling any errors thrown during
+ * underlying tokenization.
+ *
+ * @param {string} html HTML string to tokenize.
+ * @param {Object} logger Validation logger object.
+ *
+ * @return {Object[]|null} Array of valid tokenized HTML elements, or null on error
*/
-showdown.Converter = function (converterOptions) {
- 'use strict';
- var
- /**
- * Options used by this converter
- * @private
- * @type {{}}
- */
- options = {},
+function getHTMLTokens(html) {
+ let logger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : createLogger();
- /**
- * Language extensions used by this converter
- * @private
- * @type {Array}
- */
- langExtensions = [],
+ try {
+ return new Tokenizer(new DecodeEntityParser()).tokenize(html);
+ } catch (e) {
+ logger.warning('Malformed HTML detected: %s', html);
+ }
- /**
- * Output modifiers extensions used by this converter
- * @private
- * @type {Array}
- */
- outputModifiers = [],
+ return null;
+}
+/**
+ * Returns true if the next HTML token closes the current token.
+ *
+ * @param {Object} currentToken Current token to compare with.
+ * @param {Object|undefined} nextToken Next token to compare against.
+ *
+ * @return {boolean} true if `nextToken` closes `currentToken`, false otherwise
+ */
- /**
- * Event listeners
- * @private
- * @type {{}}
- */
- listeners = {},
- /**
- * The flavor set in this converter
- */
- setConvFlavor = setFlavor,
+function isClosedByToken(currentToken, nextToken) {
+ // Ensure this is a self closed token
+ if (!currentToken.selfClosing) {
+ return false;
+ } // Check token names and determine if nextToken is the closing tag for currentToken
- /**
- * Metadata of the document
- * @type {{parsed: {}, raw: string, format: string}}
- */
- metadata = {
- parsed: {},
- raw: '',
- format: ''
- };
- _constructor();
+ if (nextToken && nextToken.tagName === currentToken.tagName && nextToken.type === 'EndTag') {
+ return true;
+ }
- /**
- * Converter constructor
- * @private
- */
- function _constructor () {
- converterOptions = converterOptions || {};
+ return false;
+}
+/**
+ * Returns true if the given HTML strings are effectively equivalent, or
+ * false otherwise. Invalid HTML is not considered equivalent, even if the
+ * strings directly match.
+ *
+ * @param {string} actual Actual HTML string.
+ * @param {string} expected Expected HTML string.
+ * @param {Object} logger Validation logger object.
+ *
+ * @return {boolean} Whether HTML strings are equivalent.
+ */
- for (var gOpt in globalOptions) {
- if (globalOptions.hasOwnProperty(gOpt)) {
- options[gOpt] = globalOptions[gOpt];
- }
+function isEquivalentHTML(actual, expected) {
+ let logger = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createLogger();
+
+ // Short-circuit if markup is identical.
+ if (actual === expected) {
+ return true;
+ } // Tokenize input content and reserialized save content
+
+
+ const [actualTokens, expectedTokens] = [actual, expected].map(html => getHTMLTokens(html, logger)); // If either is malformed then stop comparing - the strings are not equivalent
+
+ if (!actualTokens || !expectedTokens) {
+ return false;
+ }
+
+ let actualToken, expectedToken;
+
+ while (actualToken = getNextNonWhitespaceToken(actualTokens)) {
+ expectedToken = getNextNonWhitespaceToken(expectedTokens); // Inequal if exhausted all expected tokens
+
+ if (!expectedToken) {
+ logger.warning('Expected end of content, instead saw %o.', actualToken);
+ return false;
+ } // Inequal if next non-whitespace token of each set are not same type
+
+
+ if (actualToken.type !== expectedToken.type) {
+ logger.warning('Expected token of type `%s` (%o), instead saw `%s` (%o).', expectedToken.type, expectedToken, actualToken.type, actualToken);
+ return false;
+ } // Defer custom token type equality handling, otherwise continue and
+ // assume as equal
+
+
+ const isEqualTokens = isEqualTokensOfType[actualToken.type];
+
+ if (isEqualTokens && !isEqualTokens(actualToken, expectedToken, logger)) {
+ return false;
+ } // Peek at the next tokens (actual and expected) to see if they close
+ // a self-closing tag
+
+
+ if (isClosedByToken(actualToken, expectedTokens[0])) {
+ // Consume the next expected token that closes the current actual
+ // self-closing token
+ getNextNonWhitespaceToken(expectedTokens);
+ } else if (isClosedByToken(expectedToken, actualTokens[0])) {
+ // Consume the next actual token that closes the current expected
+ // self-closing token
+ getNextNonWhitespaceToken(actualTokens);
}
+ }
+
+ if (expectedToken = getNextNonWhitespaceToken(expectedTokens)) {
+ // If any non-whitespace tokens remain in expected token set, this
+ // indicates inequality
+ logger.warning('Expected %o, instead saw end of content.', expectedToken);
+ return false;
+ }
+
+ return true;
+}
+/**
+ * Returns an object with `isValid` property set to `true` if the parsed block
+ * is valid given the input content. A block is considered valid if, when serialized
+ * with assumed attributes, the content matches the original value. If block is
+ * invalid, this function returns all validations issues as well.
+ *
+ * @param {string|Object} blockTypeOrName Block type.
+ * @param {Object} attributes Parsed block attributes.
+ * @param {string} originalBlockContent Original block content.
+ * @param {Object} logger Validation logger object.
+ *
+ * @return {Object} Whether block is valid and contains validation messages.
+ */
+
+/**
+ * Returns an object with `isValid` property set to `true` if the parsed block
+ * is valid given the input content. A block is considered valid if, when serialized
+ * with assumed attributes, the content matches the original value. If block is
+ * invalid, this function returns all validations issues as well.
+ *
+ * @param {import('../parser').WPBlock} block block object.
+ * @param {import('../registration').WPBlockType} blockTypeOrName Block type or name.
+ *
+ * @return {[boolean,Object]} validation results.
+ */
+
+function validateBlock(block, blockTypeOrName) {
+ const isFallbackBlock = block.name === getFreeformContentHandlerName() || block.name === getUnregisteredTypeHandlerName(); // Shortcut to avoid costly validation.
+
+ if (isFallbackBlock) {
+ return [true];
+ }
+
+ const logger = createQueuedLogger();
+ const blockType = normalizeBlockType(blockTypeOrName);
+ let generatedBlockContent;
+
+ try {
+ generatedBlockContent = getSaveContent(blockType, block.attributes);
+ } catch (error) {
+ logger.error('Block validation failed because an error occurred while generating block content:\n\n%s', error.toString());
+ return [false, logger.getItems()];
+ }
+
+ const isValid = isEquivalentHTML(block.originalContent, generatedBlockContent, logger);
+
+ if (!isValid) {
+ logger.error('Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s', blockType.name, blockType, generatedBlockContent, block.originalContent);
+ }
+
+ return [isValid, logger.getItems()];
+}
+/**
+ * Returns true if the parsed block is valid given the input content. A block
+ * is considered valid if, when serialized with assumed attributes, the content
+ * matches the original value.
+ *
+ * Logs to console in development environments when invalid.
+ *
+ * @param {string|Object} blockTypeOrName Block type.
+ * @param {Object} attributes Parsed block attributes.
+ * @param {string} originalBlockContent Original block content.
+ *
+ * @return {boolean} Whether block is valid.
+ */
- // Merge options
- if (typeof converterOptions === 'object') {
- for (var opt in converterOptions) {
- if (converterOptions.hasOwnProperty(opt)) {
- options[opt] = converterOptions[opt];
- }
- }
- } else {
- throw Error('Converter expects the passed parameter to be an object, but ' + typeof converterOptions +
- ' was passed instead.');
- }
+function isValidBlockContent(blockTypeOrName, attributes, originalBlockContent) {
+ const blockType = normalizeBlockType(blockTypeOrName);
+ const block = {
+ name: blockType.name,
+ attributes,
+ innerBlocks: [],
+ originalContent: originalBlockContent
+ };
+ const [isValid] = validateBlock(block, blockType);
+ return isValid;
+}
- if (options.extensions) {
- showdown.helper.forEach(options.extensions, _parseExtension);
- }
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/parser/convert-legacy-block.js
+/**
+ * Convert legacy blocks to their canonical form. This function is used
+ * both in the parser level for previous content and to convert such blocks
+ * used in Custom Post Types templates.
+ *
+ * @param {string} name The block's name
+ * @param {Object} attributes The block's attributes
+ *
+ * @return {[string, Object]} The block's name and attributes, changed accordingly if a match was found
+ */
+function convertLegacyBlockNameAndAttributes(name, attributes) {
+ const newAttributes = { ...attributes
+ }; // Convert 'core/cover-image' block in existing content to 'core/cover'.
- /**
- * Parse extension
- * @param {*} ext
- * @param {string} [name='']
- * @private
- */
- function _parseExtension (ext, name) {
+ if ('core/cover-image' === name) {
+ name = 'core/cover';
+ } // Convert 'core/text' blocks in existing content to 'core/paragraph'.
- name = name || null;
- // If it's a string, the extension was previously loaded
- if (showdown.helper.isString(ext)) {
- ext = showdown.helper.stdExtName(ext);
- name = ext;
- // LEGACY_SUPPORT CODE
- if (showdown.extensions[ext]) {
- console.warn('DEPRECATION WARNING: ' + ext + ' is an old extension that uses a deprecated loading method.' +
- 'Please inform the developer that the extension should be updated!');
- legacyExtensionLoading(showdown.extensions[ext], ext);
- return;
- // END LEGACY SUPPORT CODE
+ if ('core/text' === name || 'core/cover-text' === name) {
+ name = 'core/paragraph';
+ } // Convert derivative blocks such as 'core/social-link-wordpress' to the
+ // canonical form 'core/social-link'.
- } else if (!showdown.helper.isUndefined(extensions[ext])) {
- ext = extensions[ext];
- } else {
- throw Error('Extension "' + ext + '" could not be loaded. It was either not found or is not a valid extension.');
- }
- }
+ if (name && name.indexOf('core/social-link-') === 0) {
+ // Capture `social-link-wordpress` into `{"service":"wordpress"}`
+ newAttributes.service = name.substring(17);
+ name = 'core/social-link';
+ } // Convert derivative blocks such as 'core-embed/instagram' to the
+ // canonical form 'core/embed'.
- if (typeof ext === 'function') {
- ext = ext();
- }
- if (!showdown.helper.isArray(ext)) {
- ext = [ext];
- }
+ if (name && name.indexOf('core-embed/') === 0) {
+ // Capture `core-embed/instagram` into `{"providerNameSlug":"instagram"}`
+ const providerSlug = name.substring(11);
+ const deprecated = {
+ speaker: 'speaker-deck',
+ polldaddy: 'crowdsignal'
+ };
+ newAttributes.providerNameSlug = providerSlug in deprecated ? deprecated[providerSlug] : providerSlug; // this is needed as the `responsive` attribute was passed
+ // in a different way before the refactoring to block variations
- var validExt = validate(ext, name);
- if (!validExt.valid) {
- throw Error(validExt.error);
+ if (!['amazon-kindle', 'wordpress'].includes(providerSlug)) {
+ newAttributes.responsive = true;
}
- for (var i = 0; i < ext.length; ++i) {
- switch (ext[i].type) {
+ name = 'core/embed';
+ } // Convert 'core/query-loop' blocks in existing content to 'core/post-template'.
+ // TODO: Remove this check when WordPress 5.9 is released.
- case 'lang':
- langExtensions.push(ext[i]);
- break;
- case 'output':
- outputModifiers.push(ext[i]);
- break;
- }
- if (ext[i].hasOwnProperty('listeners')) {
- for (var ln in ext[i].listeners) {
- if (ext[i].listeners.hasOwnProperty(ln)) {
- listen(ln, ext[i].listeners[ln]);
- }
- }
- }
- }
+ if (name === 'core/query-loop') {
+ name = 'core/post-template';
+ } // Convert Post Comment blocks in existing content to Comment blocks.
+ // TODO: Remove these checks when WordPress 6.0 is released.
- }
- /**
- * LEGACY_SUPPORT
- * @param {*} ext
- * @param {string} name
- */
- function legacyExtensionLoading (ext, name) {
- if (typeof ext === 'function') {
- ext = ext(new showdown.Converter());
- }
- if (!showdown.helper.isArray(ext)) {
- ext = [ext];
- }
- var valid = validate(ext, name);
+ if (name === 'core/post-comment-author') {
+ name = 'core/comment-author-name';
+ }
- if (!valid.valid) {
- throw Error(valid.error);
- }
+ if (name === 'core/post-comment-content') {
+ name = 'core/comment-content';
+ }
- for (var i = 0; i < ext.length; ++i) {
- switch (ext[i].type) {
- case 'lang':
- langExtensions.push(ext[i]);
- break;
- case 'output':
- outputModifiers.push(ext[i]);
- break;
- default:// should never reach here
- throw Error('Extension loader error: Type unrecognized!!!');
- }
- }
+ if (name === 'core/post-comment-date') {
+ name = 'core/comment-date';
}
- /**
- * Listen to an event
- * @param {string} name
- * @param {function} callback
- */
- function listen (name, callback) {
- if (!showdown.helper.isString(name)) {
- throw Error('Invalid argument in converter.listen() method: name must be a string, but ' + typeof name + ' given');
- }
+ return [name, newAttributes];
+}
- if (typeof callback !== 'function') {
- throw Error('Invalid argument in converter.listen() method: callback must be a function, but ' + typeof callback + ' given');
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/parser/serialize-raw-block.js
+/**
+ * Internal dependencies
+ */
- if (!listeners.hasOwnProperty(name)) {
- listeners[name] = [];
- }
- listeners[name].push(callback);
- }
+/**
+ * Serializes a block node into the native HTML-comment-powered block format.
+ * CAVEAT: This function is intended for reserializing blocks as parsed by
+ * valid parsers and skips any validation steps. This is NOT a generic
+ * serialization function for in-memory blocks. For most purposes, see the
+ * following functions available in the `@wordpress/blocks` package:
+ *
+ * @see serializeBlock
+ * @see serialize
+ *
+ * For more on the format of block nodes as returned by valid parsers:
+ *
+ * @see `@wordpress/block-serialization-default-parser` package
+ * @see `@wordpress/block-serialization-spec-parser` package
+ *
+ * @param {import(".").WPRawBlock} rawBlock A block node as returned by a valid parser.
+ * @param {?Object} options Serialization options.
+ * @param {?boolean} options.isCommentDelimited Whether to output HTML comments around blocks.
+ *
+ * @return {string} An HTML string representing a block.
+ */
- function rTrimInputText (text) {
- var rsp = text.match(/^\s*/)[0].length,
- rgx = new RegExp('^\\s{0,' + rsp + '}', 'gm');
- return text.replace(rgx, '');
- }
+function serializeRawBlock(rawBlock) {
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+ const {
+ isCommentDelimited = true
+ } = options;
+ const {
+ blockName,
+ attrs = {},
+ innerBlocks = [],
+ innerContent = []
+ } = rawBlock;
+ let childIndex = 0;
+ const content = innerContent.map(item => // `null` denotes a nested block, otherwise we have an HTML fragment.
+ item !== null ? item : serializeRawBlock(innerBlocks[childIndex++], options)).join('\n').replace(/\n+/g, '\n').trim();
+ return isCommentDelimited ? getCommentDelimitedContent(blockName, attrs, content) : content;
+}
- /**
- * Dispatch an event
- * @private
- * @param {string} evtName Event name
- * @param {string} text Text
- * @param {{}} options Converter Options
- * @param {{}} globals
- * @returns {string}
- */
- this._dispatch = function dispatch (evtName, text, options, globals) {
- if (listeners.hasOwnProperty(evtName)) {
- for (var ei = 0; ei < listeners[evtName].length; ++ei) {
- var nText = listeners[evtName][ei](evtName, text, this, options, globals);
- if (nText && typeof nText !== 'undefined') {
- text = nText;
- }
- }
+;// CONCATENATED MODULE: ./node_modules/hpq/es/get-path.js
+/**
+ * Given object and string of dot-delimited path segments, returns value at
+ * path or undefined if path cannot be resolved.
+ *
+ * @param {Object} object Lookup object
+ * @param {string} path Path to resolve
+ * @return {?*} Resolved value
+ */
+function getPath(object, path) {
+ var segments = path.split('.');
+ var segment;
+
+ while (segment = segments.shift()) {
+ if (!(segment in object)) {
+ return;
}
- return text;
- };
- /**
- * Listen to an event
- * @param {string} name
- * @param {function} callback
- * @returns {showdown.Converter}
- */
- this.listen = function (name, callback) {
- listen(name, callback);
- return this;
- };
+ object = object[segment];
+ }
- /**
- * Converts a markdown string into HTML
- * @param {string} text
- * @returns {*}
- */
- this.makeHtml = function (text) {
- //check if text is not falsy
- if (!text) {
- return text;
- }
+ return object;
+}
+;// CONCATENATED MODULE: ./node_modules/hpq/es/index.js
+/**
+ * Internal dependencies
+ */
- var globals = {
- gHtmlBlocks: [],
- gHtmlMdBlocks: [],
- gHtmlSpans: [],
- gUrls: {},
- gTitles: {},
- gDimensions: {},
- gListLevel: 0,
- hashLinkCounts: {},
- langExtensions: langExtensions,
- outputModifiers: outputModifiers,
- converter: this,
- ghCodeBlocks: [],
- metadata: {
- parsed: {},
- raw: '',
- format: ''
- }
- };
+/**
+ * Function returning a DOM document created by `createHTMLDocument`. The same
+ * document is returned between invocations.
+ *
+ * @return {Document} DOM document.
+ */
- // This lets us use ¨ trema as an escape char to avoid md5 hashes
- // The choice of character is arbitrary; anything that isn't
- // magic in Markdown will work.
- text = text.replace(/¨/g, '¨T');
+var getDocument = function () {
+ var doc;
+ return function () {
+ if (!doc) {
+ doc = document.implementation.createHTMLDocument('');
+ }
- // Replace $ with ¨D
- // RegExp interprets $ as a special character
- // when it's in a replacement string
- text = text.replace(/\$/g, '¨D');
+ return doc;
+ };
+}();
+/**
+ * Given a markup string or DOM element, creates an object aligning with the
+ * shape of the matchers object, or the value returned by the matcher.
+ *
+ * @param {(string|Element)} source Source content
+ * @param {(Object|Function)} matchers Matcher function or object of matchers
+ * @return {(Object|*)} Matched value(s), shaped by object
+ */
- // Standardize line endings
- text = text.replace(/\r\n/g, '\n'); // DOS to Unix
- text = text.replace(/\r/g, '\n'); // Mac to Unix
- // Stardardize line spaces
- text = text.replace(/\u00A0/g, ' ');
+function parse(source, matchers) {
+ if (!matchers) {
+ return;
+ } // Coerce to element
- if (options.smartIndentationFix) {
- text = rTrimInputText(text);
- }
- // Make sure text begins and ends with a couple of newlines:
- text = '\n\n' + text + '\n\n';
+ if ('string' === typeof source) {
+ var doc = getDocument();
+ doc.body.innerHTML = source;
+ source = doc.body;
+ } // Return singular value
- // detab
- text = showdown.subParser('detab')(text, options, globals);
- /**
- * Strip any lines consisting only of spaces and tabs.
- * This makes subsequent regexs easier to write, because we can
- * match consecutive blank lines with /\n+/ instead of something
- * contorted like /[ \t]*\n+/
- */
- text = text.replace(/^[ \t]+$/mg, '');
+ if ('function' === typeof matchers) {
+ return matchers(source);
+ } // Bail if we can't handle matchers
- //run languageExtensions
- showdown.helper.forEach(langExtensions, function (ext) {
- text = showdown.subParser('runExtension')(ext, text, options, globals);
- });
- // run the sub parsers
- text = showdown.subParser('metadata')(text, options, globals);
- text = showdown.subParser('hashPreCodeTags')(text, options, globals);
- text = showdown.subParser('githubCodeBlocks')(text, options, globals);
- text = showdown.subParser('hashHTMLBlocks')(text, options, globals);
- text = showdown.subParser('hashCodeTags')(text, options, globals);
- text = showdown.subParser('stripLinkDefinitions')(text, options, globals);
- text = showdown.subParser('blockGamut')(text, options, globals);
- text = showdown.subParser('unhashHTMLSpans')(text, options, globals);
- text = showdown.subParser('unescapeSpecialChars')(text, options, globals);
+ if (Object !== matchers.constructor) {
+ return;
+ } // Shape result by matcher object
- // attacklab: Restore dollar signs
- text = text.replace(/¨D/g, '$$');
- // attacklab: Restore tremas
- text = text.replace(/¨T/g, '¨');
+ return Object.keys(matchers).reduce(function (memo, key) {
+ memo[key] = parse(source, matchers[key]);
+ return memo;
+ }, {});
+}
+/**
+ * Generates a function which matches node of type selector, returning an
+ * attribute by property if the attribute exists. If no selector is passed,
+ * returns property of the query element.
+ *
+ * @param {?string} selector Optional selector
+ * @param {string} name Property name
+ * @return {*} Property value
+ */
- // render a complete html document instead of a partial if the option is enabled
- text = showdown.subParser('completeHTMLDocument')(text, options, globals);
+function prop(selector, name) {
+ if (1 === arguments.length) {
+ name = selector;
+ selector = undefined;
+ }
- // Run output modifiers
- showdown.helper.forEach(outputModifiers, function (ext) {
- text = showdown.subParser('runExtension')(ext, text, options, globals);
- });
+ return function (node) {
+ var match = node;
- // update metadata
- metadata = globals.metadata;
- return text;
- };
+ if (selector) {
+ match = node.querySelector(selector);
+ }
- /**
- * Converts an HTML string into a markdown string
- * @param src
- * @param [HTMLParser] A WHATWG DOM and HTML parser, such as JSDOM. If none is supplied, window.document will be used.
- * @returns {string}
- */
- this.makeMarkdown = this.makeMd = function (src, HTMLParser) {
+ if (match) {
+ return getPath(match, name);
+ }
+ };
+}
+/**
+ * Generates a function which matches node of type selector, returning an
+ * attribute by name if the attribute exists. If no selector is passed,
+ * returns attribute of the query element.
+ *
+ * @param {?string} selector Optional selector
+ * @param {string} name Attribute name
+ * @return {?string} Attribute value
+ */
- // replace \r\n with \n
- src = src.replace(/\r\n/g, '\n');
- src = src.replace(/\r/g, '\n'); // old macs
+function attr(selector, name) {
+ if (1 === arguments.length) {
+ name = selector;
+ selector = undefined;
+ }
- // due to an edge case, we need to find this: > <
- // to prevent removing of non silent white spaces
- // ex: <em>this is</em> <strong>sparta</strong>
- src = src.replace(/>[ \t]+</, '>¨NBSP;<');
+ return function (node) {
+ var attributes = prop(selector, 'attributes')(node);
- if (!HTMLParser) {
- if (window && window.document) {
- HTMLParser = window.document;
- } else {
- throw new Error('HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM');
- }
+ if (attributes && attributes.hasOwnProperty(name)) {
+ return attributes[name].value;
}
+ };
+}
+/**
+ * Convenience for `prop( selector, 'innerHTML' )`.
+ *
+ * @see prop()
+ *
+ * @param {?string} selector Optional selector
+ * @return {string} Inner HTML
+ */
- var doc = HTMLParser.createElement('div');
- doc.innerHTML = src;
+function html(selector) {
+ return prop(selector, 'innerHTML');
+}
+/**
+ * Convenience for `prop( selector, 'textContent' )`.
+ *
+ * @see prop()
+ *
+ * @param {?string} selector Optional selector
+ * @return {string} Text content
+ */
+
+function es_text(selector) {
+ return prop(selector, 'textContent');
+}
+/**
+ * Creates a new matching context by first finding elements matching selector
+ * using querySelectorAll before then running another `parse` on `matchers`
+ * scoped to the matched elements.
+ *
+ * @see parse()
+ *
+ * @param {string} selector Selector to match
+ * @param {(Object|Function)} matchers Matcher function or object of matchers
+ * @return {Array.<*,Object>} Array of matched value(s)
+ */
+
+function query(selector, matchers) {
+ return function (node) {
+ var matches = node.querySelectorAll(selector);
+ return [].map.call(matches, function (match) {
+ return parse(match, matchers);
+ });
+ };
+}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/matchers.js
+/**
+ * External dependencies
+ */
- var globals = {
- preList: substitutePreCodeTags(doc)
- };
+/**
+ * Internal dependencies
+ */
- // remove all newlines and collapse spaces
- clean(doc);
- // some stuff, like accidental reference links must now be escaped
- // TODO
- // doc.innerHTML = doc.innerHTML.replace(/\[[\S\t ]]/);
- var nodes = doc.childNodes,
- mdDoc = '';
+function matchers_html(selector, multilineTag) {
+ return domNode => {
+ let match = domNode;
- for (var i = 0; i < nodes.length; i++) {
- mdDoc += showdown.subParser('makeMarkdown.node')(nodes[i], globals);
+ if (selector) {
+ match = domNode.querySelector(selector);
}
- function clean (node) {
- for (var n = 0; n < node.childNodes.length; ++n) {
- var child = node.childNodes[n];
- if (child.nodeType === 3) {
- if (!/\S/.test(child.nodeValue)) {
- node.removeChild(child);
- --n;
- } else {
- child.nodeValue = child.nodeValue.split('\n').join(' ');
- child.nodeValue = child.nodeValue.replace(/(\s)+/g, '$1');
- }
- } else if (child.nodeType === 1) {
- clean(child);
- }
- }
+ if (!match) {
+ return '';
}
- // find all pre tags and replace contents with placeholder
- // we need this so that we can remove all indentation from html
- // to ease up parsing
- function substitutePreCodeTags (doc) {
-
- var pres = doc.querySelectorAll('pre'),
- presPH = [];
-
- for (var i = 0; i < pres.length; ++i) {
-
- if (pres[i].childElementCount === 1 && pres[i].firstChild.tagName.toLowerCase() === 'code') {
- var content = pres[i].firstChild.innerHTML.trim(),
- language = pres[i].firstChild.getAttribute('data-language') || '';
-
- // if data-language attribute is not defined, then we look for class language-*
- if (language === '') {
- var classes = pres[i].firstChild.className.split(' ');
- for (var c = 0; c < classes.length; ++c) {
- var matches = classes[c].match(/^language-(.+)$/);
- if (matches !== null) {
- language = matches[1];
- break;
- }
- }
- }
+ if (multilineTag) {
+ let value = '';
+ const length = match.children.length;
- // unescape html entities in content
- content = showdown.helper.unescapeHTMLEntities(content);
+ for (let index = 0; index < length; index++) {
+ const child = match.children[index];
- presPH.push(content);
- pres[i].outerHTML = '<precode language="' + language + '" precodenum="' + i.toString() + '"></precode>';
- } else {
- presPH.push(pres[i].innerHTML);
- pres[i].innerHTML = '';
- pres[i].setAttribute('prenum', i.toString());
+ if (child.nodeName.toLowerCase() !== multilineTag) {
+ continue;
}
+
+ value += child.outerHTML;
}
- return presPH;
+
+ return value;
}
- return mdDoc;
+ return match.innerHTML;
};
+}
- /**
- * Set an option of this Converter instance
- * @param {string} key
- * @param {*} value
- */
- this.setOption = function (key, value) {
- options[key] = value;
- };
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/node.js
+/**
+ * Internal dependencies
+ */
- /**
- * Get the option of this Converter instance
- * @param {string} key
- * @returns {*}
- */
- this.getOption = function (key) {
- return options[key];
- };
+/**
+ * A representation of a single node within a block's rich text value. If
+ * representing a text node, the value is simply a string of the node value.
+ * As representing an element node, it is an object of:
+ *
+ * 1. `type` (string): Tag name.
+ * 2. `props` (object): Attributes and children array of WPBlockNode.
+ *
+ * @typedef {string|Object} WPBlockNode
+ */
- /**
- * Get the options of this Converter instance
- * @returns {{}}
- */
- this.getOptions = function () {
- return options;
- };
+/**
+ * Given a single node and a node type (e.g. `'br'`), returns true if the node
+ * corresponds to that type, false otherwise.
+ *
+ * @param {WPBlockNode} node Block node to test
+ * @param {string} type Node to type to test against.
+ *
+ * @return {boolean} Whether node is of intended type.
+ */
- /**
- * Add extension to THIS converter
- * @param {{}} extension
- * @param {string} [name=null]
- */
- this.addExtension = function (extension, name) {
- name = name || null;
- _parseExtension(extension, name);
- };
+function isNodeOfType(node, type) {
+ return node && node.type === type;
+}
+/**
+ * Given an object implementing the NamedNodeMap interface, returns a plain
+ * object equivalent value of name, value key-value pairs.
+ *
+ * @see https://dom.spec.whatwg.org/#interface-namednodemap
+ *
+ * @param {NamedNodeMap} nodeMap NamedNodeMap to convert to object.
+ *
+ * @return {Object} Object equivalent value of NamedNodeMap.
+ */
- /**
- * Use a global registered extension with THIS converter
- * @param {string} extensionName Name of the previously registered extension
- */
- this.useExtension = function (extensionName) {
- _parseExtension(extensionName);
- };
- /**
- * Set the flavor THIS converter should use
- * @param {string} name
- */
- this.setFlavor = function (name) {
- if (!flavor.hasOwnProperty(name)) {
- throw Error(name + ' flavor was not found');
- }
- var preset = flavor[name];
- setConvFlavor = name;
- for (var option in preset) {
- if (preset.hasOwnProperty(option)) {
- options[option] = preset[option];
- }
- }
- };
+function getNamedNodeMapAsObject(nodeMap) {
+ const result = {};
- /**
- * Get the currently set flavor of this converter
- * @returns {string}
- */
- this.getFlavor = function () {
- return setConvFlavor;
- };
+ for (let i = 0; i < nodeMap.length; i++) {
+ const {
+ name,
+ value
+ } = nodeMap[i];
+ result[name] = value;
+ }
- /**
- * Remove an extension from THIS converter.
- * Note: This is a costly operation. It's better to initialize a new converter
- * and specify the extensions you wish to use
- * @param {Array} extension
- */
- this.removeExtension = function (extension) {
- if (!showdown.helper.isArray(extension)) {
- extension = [extension];
- }
- for (var a = 0; a < extension.length; ++a) {
- var ext = extension[a];
- for (var i = 0; i < langExtensions.length; ++i) {
- if (langExtensions[i] === ext) {
- langExtensions[i].splice(i, 1);
- }
- }
- for (var ii = 0; ii < outputModifiers.length; ++i) {
- if (outputModifiers[ii] === ext) {
- outputModifiers[ii].splice(i, 1);
- }
- }
+ return result;
+}
+/**
+ * Given a DOM Element or Text node, returns an equivalent block node. Throws
+ * if passed any node type other than element or text.
+ *
+ * @throws {TypeError} If non-element/text node is passed.
+ *
+ * @param {Node} domNode DOM node to convert.
+ *
+ * @return {WPBlockNode} Block node equivalent to DOM node.
+ */
+
+function fromDOM(domNode) {
+ if (domNode.nodeType === domNode.TEXT_NODE) {
+ return domNode.nodeValue;
+ }
+
+ if (domNode.nodeType !== domNode.ELEMENT_NODE) {
+ throw new TypeError('A block node can only be created from a node of type text or ' + 'element.');
+ }
+
+ return {
+ type: domNode.nodeName.toLowerCase(),
+ props: { ...getNamedNodeMapAsObject(domNode.attributes),
+ children: children_fromDOM(domNode.childNodes)
}
};
+}
+/**
+ * Given a block node, returns its HTML string representation.
+ *
+ * @param {WPBlockNode} node Block node to convert to string.
+ *
+ * @return {string} String HTML representation of block node.
+ */
+
+function toHTML(node) {
+ return children_toHTML([node]);
+}
+/**
+ * Given a selector, returns an hpq matcher generating a WPBlockNode value
+ * matching the selector result.
+ *
+ * @param {string} selector DOM selector.
+ *
+ * @return {Function} hpq matcher.
+ */
- /**
- * Get all extension of THIS converter
- * @returns {{language: Array, output: Array}}
- */
- this.getAllExtensions = function () {
- return {
- language: langExtensions,
- output: outputModifiers
- };
- };
+function node_matcher(selector) {
+ return domNode => {
+ let match = domNode;
- /**
- * Get the metadata of the previously parsed document
- * @param raw
- * @returns {string|{}}
- */
- this.getMetadata = function (raw) {
- if (raw) {
- return metadata.raw;
- } else {
- return metadata.parsed;
+ if (selector) {
+ match = domNode.querySelector(selector);
}
- };
- /**
- * Get the metadata format of the previously parsed document
- * @returns {string}
- */
- this.getMetadataFormat = function () {
- return metadata.format;
+ try {
+ return fromDOM(match);
+ } catch (error) {
+ return null;
+ }
};
+}
+/**
+ * Object of utility functions used in managing block attribute values of
+ * source `node`.
+ *
+ * @see https://github.com/WordPress/gutenberg/pull/10439
+ *
+ * @deprecated since 4.0. The `node` source should not be used, and can be
+ * replaced by the `html` source.
+ *
+ * @private
+ */
- /**
- * Private: set a single key, value metadata pair
- * @param {string} key
- * @param {string} value
- */
- this._setMetadataPair = function (key, value) {
- metadata.parsed[key] = value;
- };
+/* harmony default export */ var node = ({
+ isNodeOfType,
+ fromDOM,
+ toHTML,
+ matcher: node_matcher
+});
- /**
- * Private: set metadata format
- * @param {string} format
- */
- this._setMetadataFormat = function (format) {
- metadata.format = format;
- };
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/children.js
+/**
+ * External dependencies
+ */
- /**
- * Private: set metadata raw text
- * @param {string} raw
- */
- this._setMetadataRaw = function (raw) {
- metadata.raw = raw;
- };
-};
-
/**
- * Turn Markdown link shortcuts into XHTML <a> tags.
+ * WordPress dependencies
*/
-showdown.subParser('anchors', function (text, options, globals) {
- 'use strict';
- text = globals.converter._dispatch('anchors.before', text, options, globals);
- var writeAnchorTag = function (wholeMatch, linkText, linkId, url, m5, m6, title) {
- if (showdown.helper.isUndefined(title)) {
- title = '';
- }
- linkId = linkId.toLowerCase();
+/**
+ * Internal dependencies
+ */
- // Special case for explicit empty url
- if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) {
- url = '';
- } else if (!url) {
- if (!linkId) {
- // lower-case and turn embedded newlines into spaces
- linkId = linkText.toLowerCase().replace(/ ?\n/g, ' ');
- }
- url = '#' + linkId;
- if (!showdown.helper.isUndefined(globals.gUrls[linkId])) {
- url = globals.gUrls[linkId];
- if (!showdown.helper.isUndefined(globals.gTitles[linkId])) {
- title = globals.gTitles[linkId];
- }
+/**
+ * A representation of a block's rich text value.
+ *
+ * @typedef {WPBlockNode[]} WPBlockChildren
+ */
+
+/**
+ * Given block children, returns a serialize-capable WordPress element.
+ *
+ * @param {WPBlockChildren} children Block children object to convert.
+ *
+ * @return {WPElement} A serialize-capable element.
+ */
+
+function getSerializeCapableElement(children) {
+ // The fact that block children are compatible with the element serializer is
+ // merely an implementation detail that currently serves to be true, but
+ // should not be mistaken as being a guarantee on the external API. The
+ // public API only offers guarantees to work with strings (toHTML) and DOM
+ // elements (fromDOM), and should provide utilities to manipulate the value
+ // rather than expect consumers to inspect or construct its shape (concat).
+ return children;
+}
+/**
+ * Given block children, returns an array of block nodes.
+ *
+ * @param {WPBlockChildren} children Block children object to convert.
+ *
+ * @return {Array<WPBlockNode>} An array of individual block nodes.
+ */
+
+function getChildrenArray(children) {
+ // The fact that block children are compatible with the element serializer
+ // is merely an implementation detail that currently serves to be true, but
+ // should not be mistaken as being a guarantee on the external API.
+ return children;
+}
+/**
+ * Given two or more block nodes, returns a new block node representing a
+ * concatenation of its values.
+ *
+ * @param {...WPBlockChildren} blockNodes Block nodes to concatenate.
+ *
+ * @return {WPBlockChildren} Concatenated block node.
+ */
+
+
+function concat() {
+ const result = [];
+
+ for (let i = 0; i < arguments.length; i++) {
+ const blockNode = (0,external_lodash_namespaceObject.castArray)(i < 0 || arguments.length <= i ? undefined : arguments[i]);
+
+ for (let j = 0; j < blockNode.length; j++) {
+ const child = blockNode[j];
+ const canConcatToPreviousString = typeof child === 'string' && typeof result[result.length - 1] === 'string';
+
+ if (canConcatToPreviousString) {
+ result[result.length - 1] += child;
} else {
- return wholeMatch;
+ result.push(child);
}
}
+ }
- //url = showdown.helper.escapeCharacters(url, '*_', false); // replaced line to improve performance
- url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
+ return result;
+}
+/**
+ * Given an iterable set of DOM nodes, returns equivalent block children.
+ * Ignores any non-element/text nodes included in set.
+ *
+ * @param {Iterable.<Node>} domNodes Iterable set of DOM nodes to convert.
+ *
+ * @return {WPBlockChildren} Block children equivalent to DOM nodes.
+ */
- var result = '<a href="' + url + '"';
+function children_fromDOM(domNodes) {
+ const result = [];
- if (title !== '' && title !== null) {
- title = title.replace(/"/g, '"');
- //title = showdown.helper.escapeCharacters(title, '*_', false); // replaced line to improve performance
- title = title.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
- result += ' title="' + title + '"';
+ for (let i = 0; i < domNodes.length; i++) {
+ try {
+ result.push(fromDOM(domNodes[i]));
+ } catch (error) {// Simply ignore if DOM node could not be converted.
}
+ }
- // optionLinksInNewWindow only applies
- // to external links. Hash links (#) open in same page
- if (options.openLinksInNewWindow && !/^#/.test(url)) {
- // escaped _
- result += ' rel="noopener noreferrer" target="¨E95Eblank"';
+ return result;
+}
+/**
+ * Given a block node, returns its HTML string representation.
+ *
+ * @param {WPBlockChildren} children Block node(s) to convert to string.
+ *
+ * @return {string} String HTML representation of block node.
+ */
+
+function children_toHTML(children) {
+ const element = getSerializeCapableElement(children);
+ return (0,external_wp_element_namespaceObject.renderToString)(element);
+}
+/**
+ * Given a selector, returns an hpq matcher generating a WPBlockChildren value
+ * matching the selector result.
+ *
+ * @param {string} selector DOM selector.
+ *
+ * @return {Function} hpq matcher.
+ */
+
+function children_matcher(selector) {
+ return domNode => {
+ let match = domNode;
+
+ if (selector) {
+ match = domNode.querySelector(selector);
+ }
+
+ if (match) {
+ return children_fromDOM(match.childNodes);
}
- result += '>' + linkText + '</a>';
+ return [];
+ };
+}
+/**
+ * Object of utility functions used in managing block attribute values of
+ * source `children`.
+ *
+ * @see https://github.com/WordPress/gutenberg/pull/10439
+ *
+ * @deprecated since 4.0. The `children` source should not be used, and can be
+ * replaced by the `html` source.
+ *
+ * @private
+ */
+
+/* harmony default export */ var children = ({
+ concat,
+ getChildrenArray,
+ fromDOM: children_fromDOM,
+ toHTML: children_toHTML,
+ matcher: children_matcher
+});
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/parser/get-block-attributes.js
+/**
+ * External dependencies
+ */
- return result;
- };
- // First, handle reference-style links: [link text] [id]
- text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g, writeAnchorTag);
+/**
+ * WordPress dependencies
+ */
- // Next, inline-style links: [link text](url "optional title")
- // cases with crazy urls like ./image/cat1).png
- text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
- writeAnchorTag);
- // normal cases
- text = text.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,
- writeAnchorTag);
+/**
+ * Internal dependencies
+ */
- // handle reference-style shortcuts: [link text]
- // These must come last in case you've also got [link test][1]
- // or [link test](/foo)
- text = text.replace(/\[([^\[\]]+)]()()()()()/g, writeAnchorTag);
- // Lastly handle GithubMentions if option is enabled
- if (options.ghMentions) {
- text = text.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi, function (wm, st, escape, mentions, username) {
- if (escape === '\\') {
- return st + mentions;
- }
- //check if options.ghMentionsLink is a string
- if (!showdown.helper.isString(options.ghMentionsLink)) {
- throw new Error('ghMentionsLink option must be a string');
- }
- var lnk = options.ghMentionsLink.replace(/\{u}/g, username),
- target = '';
- if (options.openLinksInNewWindow) {
- target = ' rel="noopener noreferrer" target="¨E95Eblank"';
- }
- return st + '<a href="' + lnk + '"' + target + '>' + mentions + '</a>';
- });
- }
+/**
+ * Higher-order hpq matcher which enhances an attribute matcher to return true
+ * or false depending on whether the original matcher returns undefined. This
+ * is useful for boolean attributes (e.g. disabled) whose attribute values may
+ * be technically falsey (empty string), though their mere presence should be
+ * enough to infer as true.
+ *
+ * @param {Function} matcher Original hpq matcher.
+ *
+ * @return {Function} Enhanced hpq matcher.
+ */
- text = globals.converter._dispatch('anchors.after', text, options, globals);
- return text;
-});
-
-// url allowed chars [a-z\d_.~:/?#[]@!$&'()*+,;=-]
+const toBooleanAttributeMatcher = matcher => (0,external_lodash_namespaceObject.flow)([matcher, // Expected values from `attr( 'disabled' )`:
+//
+// <input>
+// - Value: `undefined`
+// - Transformed: `false`
+//
+// <input disabled>
+// - Value: `''`
+// - Transformed: `true`
+//
+// <input disabled="disabled">
+// - Value: `'disabled'`
+// - Transformed: `true`
+value => value !== undefined]);
+/**
+ * Returns true if value is of the given JSON schema type, or false otherwise.
+ *
+ * @see http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.25
+ *
+ * @param {*} value Value to test.
+ * @param {string} type Type to test.
+ *
+ * @return {boolean} Whether value is of type.
+ */
-var simpleURLRegex = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,
- simpleURLRegex2 = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,
- delimUrlRegex = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,
- simpleMailRegex = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,
- delimMailRegex = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,
+function isOfType(value, type) {
+ switch (type) {
+ case 'string':
+ return typeof value === 'string';
- replaceLink = function (options) {
- 'use strict';
- return function (wm, leadingMagicChars, link, m2, m3, trailingPunctuation, trailingMagicChars) {
- link = link.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
- var lnkTxt = link,
- append = '',
- target = '',
- lmc = leadingMagicChars || '',
- tmc = trailingMagicChars || '';
- if (/^www\./i.test(link)) {
- link = link.replace(/^www\./i, 'http://www.');
- }
- if (options.excludeTrailingPunctuationFromURLs && trailingPunctuation) {
- append = trailingPunctuation;
- }
- if (options.openLinksInNewWindow) {
- target = ' rel="noopener noreferrer" target="¨E95Eblank"';
- }
- return lmc + '<a href="' + link + '"' + target + '>' + lnkTxt + '</a>' + append + tmc;
- };
- },
+ case 'boolean':
+ return typeof value === 'boolean';
- replaceMail = function (options, globals) {
- 'use strict';
- return function (wholeMatch, b, mail) {
- var href = 'mailto:';
- b = b || '';
- mail = showdown.subParser('unescapeSpecialChars')(mail, options, globals);
- if (options.encodeEmails) {
- href = showdown.helper.encodeEmailAddress(href + mail);
- mail = showdown.helper.encodeEmailAddress(mail);
- } else {
- href = href + mail;
- }
- return b + '<a href="' + href + '">' + mail + '</a>';
- };
- };
+ case 'object':
+ return !!value && value.constructor === Object;
-showdown.subParser('autoLinks', function (text, options, globals) {
- 'use strict';
+ case 'null':
+ return value === null;
- text = globals.converter._dispatch('autoLinks.before', text, options, globals);
+ case 'array':
+ return Array.isArray(value);
- text = text.replace(delimUrlRegex, replaceLink(options));
- text = text.replace(delimMailRegex, replaceMail(options, globals));
+ case 'integer':
+ case 'number':
+ return typeof value === 'number';
+ }
- text = globals.converter._dispatch('autoLinks.after', text, options, globals);
+ return true;
+}
+/**
+ * Returns true if value is of an array of given JSON schema types, or false
+ * otherwise.
+ *
+ * @see http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.25
+ *
+ * @param {*} value Value to test.
+ * @param {string[]} types Types to test.
+ *
+ * @return {boolean} Whether value is of types.
+ */
- return text;
-});
+function isOfTypes(value, types) {
+ return types.some(type => isOfType(value, type));
+}
+/**
+ * Given an attribute key, an attribute's schema, a block's raw content and the
+ * commentAttributes returns the attribute value depending on its source
+ * definition of the given attribute key.
+ *
+ * @param {string} attributeKey Attribute key.
+ * @param {Object} attributeSchema Attribute's schema.
+ * @param {string} innerHTML Block's raw content.
+ * @param {Object} commentAttributes Block's comment attributes.
+ *
+ * @return {*} Attribute value.
+ */
-showdown.subParser('simplifiedAutoLinks', function (text, options, globals) {
- 'use strict';
+function getBlockAttribute(attributeKey, attributeSchema, innerHTML, commentAttributes) {
+ const {
+ type,
+ enum: enumSet
+ } = attributeSchema;
+ let value;
- if (!options.simplifiedAutoLink) {
- return text;
+ switch (attributeSchema.source) {
+ // An undefined source means that it's an attribute serialized to the
+ // block's "comment".
+ case undefined:
+ value = commentAttributes ? commentAttributes[attributeKey] : undefined;
+ break;
+
+ case 'attribute':
+ case 'property':
+ case 'html':
+ case 'text':
+ case 'children':
+ case 'node':
+ case 'query':
+ case 'tag':
+ value = parseWithAttributeSchema(innerHTML, attributeSchema);
+ break;
}
- text = globals.converter._dispatch('simplifiedAutoLinks.before', text, options, globals);
+ if (!isValidByType(value, type) || !isValidByEnum(value, enumSet)) {
+ // Reject the value if it is not valid. Reverting to the undefined
+ // value ensures the default is respected, if applicable.
+ value = undefined;
+ }
- if (options.excludeTrailingPunctuationFromURLs) {
- text = text.replace(simpleURLRegex2, replaceLink(options));
- } else {
- text = text.replace(simpleURLRegex, replaceLink(options));
+ if (value === undefined) {
+ return attributeSchema.default;
}
- text = text.replace(simpleMailRegex, replaceMail(options, globals));
- text = globals.converter._dispatch('simplifiedAutoLinks.after', text, options, globals);
+ return value;
+}
+/**
+ * Returns true if value is valid per the given block attribute schema type
+ * definition, or false otherwise.
+ *
+ * @see https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.1.1
+ *
+ * @param {*} value Value to test.
+ * @param {?(Array<string>|string)} type Block attribute schema type.
+ *
+ * @return {boolean} Whether value is valid.
+ */
- return text;
-});
-
+function isValidByType(value, type) {
+ return type === undefined || isOfTypes(value, (0,external_lodash_namespaceObject.castArray)(type));
+}
/**
- * These are all the transformations that form block-level
- * tags like paragraphs, headers, and list items.
+ * Returns true if value is valid per the given block attribute schema enum
+ * definition, or false otherwise.
+ *
+ * @see https://json-schema.org/latest/json-schema-validation.html#rfc.section.6.1.2
+ *
+ * @param {*} value Value to test.
+ * @param {?Array} enumSet Block attribute schema enum.
+ *
+ * @return {boolean} Whether value is valid.
+ */
+
+function isValidByEnum(value, enumSet) {
+ return !Array.isArray(enumSet) || enumSet.includes(value);
+}
+/**
+ * Returns an hpq matcher given a source object.
+ *
+ * @param {Object} sourceConfig Attribute Source object.
+ *
+ * @return {Function} A hpq Matcher.
*/
-showdown.subParser('blockGamut', function (text, options, globals) {
- 'use strict';
-
- text = globals.converter._dispatch('blockGamut.before', text, options, globals);
- // we parse blockquotes first so that we can have headings and hrs
- // inside blockquotes
- text = showdown.subParser('blockQuotes')(text, options, globals);
- text = showdown.subParser('headers')(text, options, globals);
+function matcherFromSource(sourceConfig) {
+ switch (sourceConfig.source) {
+ case 'attribute':
+ let matcher = attr(sourceConfig.selector, sourceConfig.attribute);
- // Do Horizontal Rules:
- text = showdown.subParser('horizontalRule')(text, options, globals);
+ if (sourceConfig.type === 'boolean') {
+ matcher = toBooleanAttributeMatcher(matcher);
+ }
- text = showdown.subParser('lists')(text, options, globals);
- text = showdown.subParser('codeBlocks')(text, options, globals);
- text = showdown.subParser('tables')(text, options, globals);
+ return matcher;
- // We already ran _HashHTMLBlocks() before, in Markdown(), but that
- // was to escape raw HTML in the original Markdown source. This time,
- // we're escaping the markup we've just created, so that we don't wrap
- // <p> tags around block-level tags.
- text = showdown.subParser('hashHTMLBlocks')(text, options, globals);
- text = showdown.subParser('paragraphs')(text, options, globals);
+ case 'html':
+ return matchers_html(sourceConfig.selector, sourceConfig.multiline);
- text = globals.converter._dispatch('blockGamut.after', text, options, globals);
+ case 'text':
+ return es_text(sourceConfig.selector);
- return text;
-});
-
-showdown.subParser('blockQuotes', function (text, options, globals) {
- 'use strict';
+ case 'children':
+ return children_matcher(sourceConfig.selector);
- text = globals.converter._dispatch('blockQuotes.before', text, options, globals);
+ case 'node':
+ return node_matcher(sourceConfig.selector);
- // add a couple extra lines after the text and endtext mark
- text = text + '\n\n';
+ case 'query':
+ const subMatchers = (0,external_lodash_namespaceObject.mapValues)(sourceConfig.query, matcherFromSource);
+ return query(sourceConfig.selector, subMatchers);
- var rgx = /(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;
+ case 'tag':
+ return (0,external_lodash_namespaceObject.flow)([prop(sourceConfig.selector, 'nodeName'), nodeName => nodeName ? nodeName.toLowerCase() : undefined]);
- if (options.splitAdjacentBlockquotes) {
- rgx = /^ {0,3}>[\s\S]*?(?:\n\n)/gm;
+ default:
+ // eslint-disable-next-line no-console
+ console.error(`Unknown source type "${sourceConfig.source}"`);
}
+}
+/**
+ * Given a block's raw content and an attribute's schema returns the attribute's
+ * value depending on its source.
+ *
+ * @param {string} innerHTML Block's raw content.
+ * @param {Object} attributeSchema Attribute's schema.
+ *
+ * @return {*} Attribute value.
+ */
- text = text.replace(rgx, function (bq) {
- // attacklab: hack around Konqueror 3.5.4 bug:
- // "----------bug".replace(/^-/g,"") == "bug"
- bq = bq.replace(/^[ \t]*>[ \t]?/gm, ''); // trim one level of quoting
-
- // attacklab: clean up hack
- bq = bq.replace(/¨0/g, '');
-
- bq = bq.replace(/^[ \t]+$/gm, ''); // trim whitespace-only lines
- bq = showdown.subParser('githubCodeBlocks')(bq, options, globals);
- bq = showdown.subParser('blockGamut')(bq, options, globals); // recurse
-
- bq = bq.replace(/(^|\n)/g, '$1 ');
- // These leading spaces screw with <pre> content, so we need to fix that:
- bq = bq.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function (wholeMatch, m1) {
- var pre = m1;
- // attacklab: hack around Konqueror 3.5.4 bug:
- pre = pre.replace(/^ /mg, '¨0');
- pre = pre.replace(/¨0/g, '');
- return pre;
- });
+function parseWithAttributeSchema(innerHTML, attributeSchema) {
+ return parse(innerHTML, matcherFromSource(attributeSchema));
+}
+/**
+ * Returns the block attributes of a registered block node given its type.
+ *
+ * @param {string|Object} blockTypeOrName Block type or name.
+ * @param {string} innerHTML Raw block content.
+ * @param {?Object} attributes Known block attributes (from delimiters).
+ *
+ * @return {Object} All block attributes.
+ */
- return showdown.subParser('hashBlock')('<blockquote>\n' + bq + '\n</blockquote>', options, globals);
+function getBlockAttributes(blockTypeOrName, innerHTML) {
+ let attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+ const blockType = normalizeBlockType(blockTypeOrName);
+ const blockAttributes = (0,external_lodash_namespaceObject.mapValues)(blockType.attributes, (attributeSchema, attributeKey) => {
+ return getBlockAttribute(attributeKey, attributeSchema, innerHTML, attributes);
});
+ return (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.getBlockAttributes', blockAttributes, blockType, innerHTML, attributes);
+}
- text = globals.converter._dispatch('blockQuotes.after', text, options, globals);
- return text;
-});
-
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/parser/fix-custom-classname.js
/**
- * Process Markdown `<pre><code>` blocks.
+ * External dependencies
*/
-showdown.subParser('codeBlocks', function (text, options, globals) {
- 'use strict';
-
- text = globals.converter._dispatch('codeBlocks.before', text, options, globals);
-
- // sentinel workarounds for lack of \A and \Z, safari\khtml bug
- text += '¨0';
-
- var pattern = /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;
- text = text.replace(pattern, function (wholeMatch, m1, m2) {
- var codeblock = m1,
- nextChar = m2,
- end = '\n';
-
- codeblock = showdown.subParser('outdent')(codeblock, options, globals);
- codeblock = showdown.subParser('encodeCode')(codeblock, options, globals);
- codeblock = showdown.subParser('detab')(codeblock, options, globals);
- codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines
- codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing newlines
- if (options.omitExtraWLInCodeBlocks) {
- end = '';
- }
+/**
+ * Internal dependencies
+ */
- codeblock = '<pre><code>' + codeblock + end + '</code></pre>';
- return showdown.subParser('hashBlock')(codeblock, options, globals) + nextChar;
- });
- // strip sentinel
- text = text.replace(/¨0/, '');
- text = globals.converter._dispatch('codeBlocks.after', text, options, globals);
- return text;
-});
-
/**
+ * Given an HTML string, returns an array of class names assigned to the root
+ * element in the markup.
*
- * * Backtick quotes are used for <code></code> spans.
- *
- * * You can use multiple backticks as the delimiters if you want to
- * include literal backticks in the code span. So, this input:
- *
- * Just type ``foo `bar` baz`` at the prompt.
- *
- * Will translate to:
- *
- * <p>Just type <code>foo `bar` baz</code> at the prompt.</p>
+ * @param {string} innerHTML Markup string from which to extract classes.
*
- * There's no arbitrary limit to the number of backticks you
- * can use as delimters. If you need three consecutive backticks
- * in your code, use four for delimiters, etc.
+ * @return {string[]} Array of class names assigned to the root element.
+ */
+
+function getHTMLRootElementClasses(innerHTML) {
+ innerHTML = `<div data-custom-class-name>${innerHTML}</div>`;
+ const parsed = parseWithAttributeSchema(innerHTML, {
+ type: 'string',
+ source: 'attribute',
+ selector: '[data-custom-class-name] > *',
+ attribute: 'class'
+ });
+ return parsed ? parsed.trim().split(/\s+/) : [];
+}
+/**
+ * Given a parsed set of block attributes, if the block supports custom class
+ * names and an unknown class (per the block's serialization behavior) is
+ * found, the unknown classes are treated as custom classes. This prevents the
+ * block from being considered as invalid.
*
- * * You can use spaces to get literal backticks at the edges:
+ * @param {Object} blockAttributes Original block attributes.
+ * @param {Object} blockType Block type settings.
+ * @param {string} innerHTML Original block markup.
*
- * ... type `` `bar` `` ...
+ * @return {Object} Filtered block attributes.
+ */
+
+function fixCustomClassname(blockAttributes, blockType, innerHTML) {
+ if (registration_hasBlockSupport(blockType, 'customClassName', true)) {
+ // To determine difference, serialize block given the known set of
+ // attributes, with the exception of `className`. This will determine
+ // the default set of classes. From there, any difference in innerHTML
+ // can be considered as custom classes.
+ const attributesSansClassName = (0,external_lodash_namespaceObject.omit)(blockAttributes, ['className']);
+ const serialized = getSaveContent(blockType, attributesSansClassName);
+ const defaultClasses = getHTMLRootElementClasses(serialized);
+ const actualClasses = getHTMLRootElementClasses(innerHTML);
+ const customClasses = (0,external_lodash_namespaceObject.difference)(actualClasses, defaultClasses);
+
+ if (customClasses.length) {
+ blockAttributes.className = customClasses.join(' ');
+ } else if (serialized) {
+ delete blockAttributes.className;
+ }
+ }
+
+ return blockAttributes;
+}
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/parser/apply-built-in-validation-fixes.js
+/**
+ * Internal dependencies
+ */
+
+/**
+ * Attempts to fix block invalidation by applying build-in validation fixes
+ * like moving all extra classNames to the className attribute.
*
- * Turns to:
+ * @param {WPBlock} block block object.
+ * @param {import('../registration').WPBlockType} blockType Block type. This is normalize not necessary and
+ * can be inferred from the block name,
+ * but it's here for performance reasons.
*
- * ... type <code>`bar`</code> ...
+ * @return {WPBlock} Fixed block object
*/
-showdown.subParser('codeSpans', function (text, options, globals) {
- 'use strict';
- text = globals.converter._dispatch('codeSpans.before', text, options, globals);
+function applyBuiltInValidationFixes(block, blockType) {
+ const updatedBlockAttributes = fixCustomClassname(block.attributes, blockType, block.originalContent);
+ return { ...block,
+ attributes: updatedBlockAttributes
+ };
+}
- if (typeof text === 'undefined') {
- text = '';
- }
- text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
- function (wholeMatch, m1, m2, m3) {
- var c = m3;
- c = c.replace(/^([ \t]*)/g, ''); // leading whitespace
- c = c.replace(/[ \t]*$/g, ''); // trailing whitespace
- c = showdown.subParser('encodeCode')(c, options, globals);
- c = m1 + '<code>' + c + '</code>';
- c = showdown.subParser('hashHTMLSpans')(c, options, globals);
- return c;
- }
- );
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/parser/apply-block-deprecated-versions.js
+/**
+ * External dependencies
+ */
- text = globals.converter._dispatch('codeSpans.after', text, options, globals);
- return text;
-});
-
/**
- * Create a full HTML document from the processed markdown
+ * Internal dependencies
*/
-showdown.subParser('completeHTMLDocument', function (text, options, globals) {
- 'use strict';
- if (!options.completeHTMLDocument) {
- return text;
- }
- text = globals.converter._dispatch('completeHTMLDocument.before', text, options, globals);
- var doctype = 'html',
- doctypeParsed = '<!DOCTYPE HTML>\n',
- title = '',
- charset = '<meta charset="utf-8">\n',
- lang = '',
- metadata = '';
- if (typeof globals.metadata.parsed.doctype !== 'undefined') {
- doctypeParsed = '<!DOCTYPE ' + globals.metadata.parsed.doctype + '>\n';
- doctype = globals.metadata.parsed.doctype.toString().toLowerCase();
- if (doctype === 'html' || doctype === 'html5') {
- charset = '<meta charset="utf-8">';
- }
- }
- for (var meta in globals.metadata.parsed) {
- if (globals.metadata.parsed.hasOwnProperty(meta)) {
- switch (meta.toLowerCase()) {
- case 'doctype':
- break;
+/**
+ * Given a block object, returns a new copy of the block with any applicable
+ * deprecated migrations applied, or the original block if it was both valid
+ * and no eligible migrations exist.
+ *
+ * @param {import(".").WPBlock} block Parsed and invalid block object.
+ * @param {import(".").WPRawBlock} rawBlock Raw block object.
+ * @param {import('../registration').WPBlockType} blockType Block type. This is normalize not necessary and
+ * can be inferred from the block name,
+ * but it's here for performance reasons.
+ *
+ * @return {import(".").WPBlock} Migrated block object.
+ */
- case 'title':
- title = '<title>' + globals.metadata.parsed.title + '</title>\n';
- break;
+function applyBlockDeprecatedVersions(block, rawBlock, blockType) {
+ const parsedAttributes = rawBlock.attrs;
+ const {
+ deprecated: deprecatedDefinitions
+ } = blockType; // Bail early if there are no registered deprecations to be handled.
- case 'charset':
- if (doctype === 'html' || doctype === 'html5') {
- charset = '<meta charset="' + globals.metadata.parsed.charset + '">\n';
- } else {
- charset = '<meta name="charset" content="' + globals.metadata.parsed.charset + '">\n';
- }
- break;
+ if (!deprecatedDefinitions || !deprecatedDefinitions.length) {
+ return block;
+ } // By design, blocks lack any sort of version tracking. Instead, to process
+ // outdated content the system operates a queue out of all the defined
+ // attribute shapes and tries each definition until the input produces a
+ // valid result. This mechanism seeks to avoid polluting the user-space with
+ // machine-specific code. An invalid block is thus a block that could not be
+ // matched successfully with any of the registered deprecation definitions.
- case 'language':
- case 'lang':
- lang = ' lang="' + globals.metadata.parsed[meta] + '"';
- metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n';
- break;
- default:
- metadata += '<meta name="' + meta + '" content="' + globals.metadata.parsed[meta] + '">\n';
- }
- }
- }
+ for (let i = 0; i < deprecatedDefinitions.length; i++) {
+ // A block can opt into a migration even if the block is valid by
+ // defining `isEligible` on its deprecation. If the block is both valid
+ // and does not opt to migrate, skip.
+ const {
+ isEligible = external_lodash_namespaceObject.stubFalse
+ } = deprecatedDefinitions[i];
- text = doctypeParsed + '<html' + lang + '>\n<head>\n' + title + charset + metadata + '</head>\n<body>\n' + text.trim() + '\n</body>\n</html>';
+ if (block.isValid && !isEligible(parsedAttributes, block.innerBlocks)) {
+ continue;
+ } // Block type properties which could impact either serialization or
+ // parsing are not considered in the deprecated block type by default,
+ // and must be explicitly provided.
- text = globals.converter._dispatch('completeHTMLDocument.after', text, options, globals);
- return text;
-});
-
-/**
- * Convert all tabs to spaces
- */
-showdown.subParser('detab', function (text, options, globals) {
- 'use strict';
- text = globals.converter._dispatch('detab.before', text, options, globals);
- // expand first n-1 tabs
- text = text.replace(/\t(?=\t)/g, ' '); // g_tab_width
+ const deprecatedBlockType = Object.assign((0,external_lodash_namespaceObject.omit)(blockType, DEPRECATED_ENTRY_KEYS), deprecatedDefinitions[i]);
+ let migratedBlock = { ...block,
+ attributes: getBlockAttributes(deprecatedBlockType, block.originalContent, parsedAttributes)
+ }; // Ignore the deprecation if it produces a block which is not valid.
- // replace the nth with two sentinels
- text = text.replace(/\t/g, '¨A¨B');
+ let [isValid] = validateBlock(migratedBlock, deprecatedBlockType); // If the migrated block is not valid intiailly, try the built-in fixes.
- // use the sentinel to anchor our regex so it doesn't explode
- text = text.replace(/¨B(.+?)¨A/g, function (wholeMatch, m1) {
- var leadingText = m1,
- numSpaces = 4 - leadingText.length % 4; // g_tab_width
+ if (!isValid) {
+ migratedBlock = applyBuiltInValidationFixes(migratedBlock, deprecatedBlockType);
+ [isValid] = validateBlock(migratedBlock, deprecatedBlockType);
+ } // An invalid block does not imply incorrect HTML but the fact block
+ // source information could be lost on reserialization.
- // there *must* be a better way to do this:
- for (var i = 0; i < numSpaces; i++) {
- leadingText += ' ';
- }
- return leadingText;
- });
+ if (!isValid) {
+ continue;
+ }
- // clean up sentinels
- text = text.replace(/¨A/g, ' '); // g_tab_width
- text = text.replace(/¨B/g, '');
+ let migratedInnerBlocks = migratedBlock.innerBlocks;
+ let migratedAttributes = migratedBlock.attributes; // A block may provide custom behavior to assign new attributes and/or
+ // inner blocks.
- text = globals.converter._dispatch('detab.after', text, options, globals);
- return text;
-});
-
-showdown.subParser('ellipsis', function (text, options, globals) {
- 'use strict';
+ const {
+ migrate
+ } = deprecatedBlockType;
- text = globals.converter._dispatch('ellipsis.before', text, options, globals);
+ if (migrate) {
+ [migratedAttributes = parsedAttributes, migratedInnerBlocks = block.innerBlocks] = (0,external_lodash_namespaceObject.castArray)(migrate(migratedAttributes, block.innerBlocks));
+ }
- text = text.replace(/\.\.\./g, '…');
+ block = { ...block,
+ attributes: migratedAttributes,
+ innerBlocks: migratedInnerBlocks,
+ isValid: true,
+ validationIssues: []
+ };
+ }
- text = globals.converter._dispatch('ellipsis.after', text, options, globals);
+ return block;
+}
- return text;
-});
-
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/parser/index.js
/**
- * Turn emoji codes into emojis
- *
- * List of supported emojis: https://github.com/showdownjs/showdown/wiki/Emojis
+ * WordPress dependencies
*/
-showdown.subParser('emoji', function (text, options, globals) {
- 'use strict';
- if (!options.emoji) {
- return text;
- }
- text = globals.converter._dispatch('emoji.before', text, options, globals);
+/**
+ * Internal dependencies
+ */
+
- var emojiRgx = /:([\S]+?):/g;
- text = text.replace(emojiRgx, function (wm, emojiCode) {
- if (showdown.helper.emojis.hasOwnProperty(emojiCode)) {
- return showdown.helper.emojis[emojiCode];
- }
- return wm;
- });
- text = globals.converter._dispatch('emoji.after', text, options, globals);
- return text;
-});
-
-/**
- * Smart processing for ampersands and angle brackets that need to be encoded.
- */
-showdown.subParser('encodeAmpsAndAngles', function (text, options, globals) {
- 'use strict';
- text = globals.converter._dispatch('encodeAmpsAndAngles.before', text, options, globals);
- // Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:
- // http://bumppo.net/projects/amputator/
- text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, '&');
- // Encode naked <'s
- text = text.replace(/<(?![a-z\/?$!])/gi, '<');
- // Encode <
- text = text.replace(/</g, '<');
- // Encode >
- text = text.replace(/>/g, '>');
- text = globals.converter._dispatch('encodeAmpsAndAngles.after', text, options, globals);
- return text;
-});
-
/**
- * Returns the string, with after processing the following backslash escape sequences.
- *
- * attacklab: The polite way to do this is with the new escapeCharacters() function:
+ * The raw structure of a block includes its attributes, inner
+ * blocks, and inner HTML. It is important to distinguish inner blocks from
+ * the HTML content of the block as only the latter is relevant for block
+ * validation and edit operations.
*
- * text = escapeCharacters(text,"\\",true);
- * text = escapeCharacters(text,"`*_{}[]()>#+-.!",true);
+ * @typedef WPRawBlock
*
- * ...but we're sidestepping its use of the (slow) RegExp constructor
- * as an optimization for Firefox. This function gets called a LOT.
+ * @property {string=} blockName Block name
+ * @property {Object=} attrs Block raw or comment attributes.
+ * @property {string} innerHTML HTML content of the block.
+ * @property {(string|null)[]} innerContent Content without inner blocks.
+ * @property {WPRawBlock[]} innerBlocks Inner Blocks.
*/
-showdown.subParser('encodeBackslashEscapes', function (text, options, globals) {
- 'use strict';
- text = globals.converter._dispatch('encodeBackslashEscapes.before', text, options, globals);
-
- text = text.replace(/\\(\\)/g, showdown.helper.escapeCharactersCallback);
- text = text.replace(/\\([`*_{}\[\]()>#+.!~=|-])/g, showdown.helper.escapeCharactersCallback);
- text = globals.converter._dispatch('encodeBackslashEscapes.after', text, options, globals);
- return text;
-});
-
/**
- * Encode/escape certain characters inside Markdown code runs.
- * The point is that in code, these characters are literals,
- * and lose their special Markdown meanings.
+ * Fully parsed block object.
+ *
+ * @typedef WPBlock
+ *
+ * @property {string} name Block name
+ * @property {Object } attributes Block raw or comment attributes.
+ * @property {WPBlock[]} innerBlocks Inner Blocks.
+ * @property {string} originalContent Original content of the block before validation fixes.
+ * @property {boolean} isValid Whether the block is valid.
+ * @property {Object[]} validationIssues Validation issues.
*/
-showdown.subParser('encodeCode', function (text, options, globals) {
- 'use strict';
-
- text = globals.converter._dispatch('encodeCode.before', text, options, globals);
- // Encode all ampersands; HTML entities are not
- // entities within a Markdown code span.
- text = text
- .replace(/&/g, '&')
- // Do the angle bracket song and dance:
- .replace(/</g, '<')
- .replace(/>/g, '>')
- // Now, escape characters that are magic in Markdown:
- .replace(/([*_{}\[\]\\=~-])/g, showdown.helper.escapeCharactersCallback);
+/**
+ * Convert legacy blocks to their canonical form. This function is used
+ * both in the parser level for previous content and to convert such blocks
+ * used in Custom Post Types templates.
+ *
+ * @param {WPRawBlock} rawBlock
+ *
+ * @return {WPRawBlock} The block's name and attributes, changed accordingly if a match was found
+ */
- text = globals.converter._dispatch('encodeCode.after', text, options, globals);
- return text;
-});
-
+function convertLegacyBlocks(rawBlock) {
+ const [correctName, correctedAttributes] = convertLegacyBlockNameAndAttributes(rawBlock.blockName, rawBlock.attrs);
+ return { ...rawBlock,
+ blockName: correctName,
+ attrs: correctedAttributes
+ };
+}
/**
- * Within tags -- meaning between < and > -- encode [\ ` * _ ~ =] so they
- * don't conflict with their use in Markdown for code, italics and strong.
+ * Normalize the raw block by applying the fallback block name if none given,
+ * sanitize the parsed HTML...
+ *
+ * @param {WPRawBlock} rawBlock The raw block object.
+ *
+ * @return {WPRawBlock} The normalized block object.
*/
-showdown.subParser('escapeSpecialCharsWithinTagAttributes', function (text, options, globals) {
- 'use strict';
- text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.before', text, options, globals);
- // Build a regex to find HTML tags.
- var tags = /<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,
- comments = /<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;
- text = text.replace(tags, function (wholeMatch) {
- return wholeMatch
- .replace(/(.)<\/?code>(?=.)/g, '$1`')
- .replace(/([\\`*_~=|])/g, showdown.helper.escapeCharactersCallback);
- });
+function normalizeRawBlock(rawBlock) {
+ const fallbackBlockName = getFreeformContentHandlerName(); // If the grammar parsing don't produce any block name, use the freeform block.
- text = text.replace(comments, function (wholeMatch) {
- return wholeMatch
- .replace(/([\\`*_~=|])/g, showdown.helper.escapeCharactersCallback);
- });
+ const rawBlockName = rawBlock.blockName || getFreeformContentHandlerName();
+ const rawAttributes = rawBlock.attrs || {};
+ const rawInnerBlocks = rawBlock.innerBlocks || [];
+ let rawInnerHTML = rawBlock.innerHTML.trim(); // Fallback content may be upgraded from classic content expecting implicit
+ // automatic paragraphs, so preserve them. Assumes wpautop is idempotent,
+ // meaning there are no negative consequences to repeated autop calls.
- text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.after', text, options, globals);
- return text;
-});
-
+ if (rawBlockName === fallbackBlockName) {
+ rawInnerHTML = (0,external_wp_autop_namespaceObject.autop)(rawInnerHTML).trim();
+ }
+
+ return { ...rawBlock,
+ blockName: rawBlockName,
+ attrs: rawAttributes,
+ innerHTML: rawInnerHTML,
+ innerBlocks: rawInnerBlocks
+ };
+}
/**
- * Handle github codeblocks prior to running HashHTML so that
- * HTML contained within the codeblock gets escaped properly
- * Example:
- * ```ruby
- * def hello_world(x)
- * puts "Hello, #{x}"
- * end
- * ```
+ * Uses the "unregistered blockType" to create a block object.
+ *
+ * @param {WPRawBlock} rawBlock block.
+ *
+ * @return {WPRawBlock} The unregistered block object.
*/
-showdown.subParser('githubCodeBlocks', function (text, options, globals) {
- 'use strict';
- // early exit if option is not enabled
- if (!options.ghCodeBlocks) {
- return text;
- }
+function createMissingBlockType(rawBlock) {
+ const unregisteredFallbackBlock = getUnregisteredTypeHandlerName() || getFreeformContentHandlerName(); // Preserve undelimited content for use by the unregistered type
+ // handler. A block node's `innerHTML` isn't enough, as that field only
+ // carries the block's own HTML and not its nested blocks.
- text = globals.converter._dispatch('githubCodeBlocks.before', text, options, globals);
+ const originalUndelimitedContent = serializeRawBlock(rawBlock, {
+ isCommentDelimited: false
+ }); // Preserve full block content for use by the unregistered type
+ // handler, block boundaries included.
- text += '¨0';
+ const originalContent = serializeRawBlock(rawBlock, {
+ isCommentDelimited: true
+ });
+ return {
+ blockName: unregisteredFallbackBlock,
+ attrs: {
+ originalName: rawBlock.blockName,
+ originalContent,
+ originalUndelimitedContent
+ },
+ innerHTML: rawBlock.blockName ? originalContent : rawBlock.innerHTML,
+ innerBlocks: rawBlock.innerBlocks,
+ innerContent: rawBlock.innerContent
+ };
+}
+/**
+ * Given a raw block returned by grammar parsing, returns a fully parsed block.
+ *
+ * @param {WPRawBlock} rawBlock The raw block object.
+ *
+ * @return {WPBlock} Fully parsed block.
+ */
- text = text.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g, function (wholeMatch, delim, language, codeblock) {
- var end = (options.omitExtraWLInCodeBlocks) ? '' : '\n';
- // First parse the github code block
- codeblock = showdown.subParser('encodeCode')(codeblock, options, globals);
- codeblock = showdown.subParser('detab')(codeblock, options, globals);
- codeblock = codeblock.replace(/^\n+/g, ''); // trim leading newlines
- codeblock = codeblock.replace(/\n+$/g, ''); // trim trailing whitespace
+function parseRawBlock(rawBlock) {
+ let normalizedBlock = normalizeRawBlock(rawBlock); // During the lifecycle of the project, we renamed some old blocks
+ // and transformed others to new blocks. To avoid breaking existing content,
+ // we added this function to properly parse the old content.
- codeblock = '<pre><code' + (language ? ' class="' + language + ' language-' + language + '"' : '') + '>' + codeblock + end + '</code></pre>';
+ normalizedBlock = convertLegacyBlocks(normalizedBlock); // Try finding the type for known block name.
- codeblock = showdown.subParser('hashBlock')(codeblock, options, globals);
+ let blockType = registration_getBlockType(normalizedBlock.blockName); // If not blockType is found for the specified name, fallback to the "unregistedBlockType".
- // Since GHCodeblocks can be false positives, we need to
- // store the primitive text and the parsed text in a global var,
- // and then return a token
- return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
- });
+ if (!blockType) {
+ normalizedBlock = createMissingBlockType(normalizedBlock);
+ blockType = registration_getBlockType(normalizedBlock.blockName);
+ } // If it's an empty freeform block or there's no blockType (no missing block handler)
+ // Then, just ignore the block.
+ // It might be a good idea to throw a warning here.
+ // TODO: I'm unsure about the unregisteredFallbackBlock check,
+ // it might ignore some dynamic unregistered third party blocks wrongly.
- // attacklab: strip sentinel
- text = text.replace(/¨0/, '');
- return globals.converter._dispatch('githubCodeBlocks.after', text, options, globals);
-});
-
-showdown.subParser('hashBlock', function (text, options, globals) {
- 'use strict';
- text = globals.converter._dispatch('hashBlock.before', text, options, globals);
- text = text.replace(/(^\n+|\n+$)/g, '');
- text = '\n\n¨K' + (globals.gHtmlBlocks.push(text) - 1) + 'K\n\n';
- text = globals.converter._dispatch('hashBlock.after', text, options, globals);
- return text;
-});
-
-/**
- * Hash and escape <code> elements that should not be parsed as markdown
- */
-showdown.subParser('hashCodeTags', function (text, options, globals) {
- 'use strict';
- text = globals.converter._dispatch('hashCodeTags.before', text, options, globals);
+ const isFallbackBlock = normalizedBlock.blockName === getFreeformContentHandlerName() || normalizedBlock.blockName === getUnregisteredTypeHandlerName();
- var repFunc = function (wholeMatch, match, left, right) {
- var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right;
- return '¨C' + (globals.gHtmlSpans.push(codeblock) - 1) + 'C';
- };
+ if (!blockType || !normalizedBlock.innerHTML && isFallbackBlock) {
+ return;
+ } // Parse inner blocks recursively.
- // Hash naked <code>
- text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '<code\\b[^>]*>', '</code>', 'gim');
- text = globals.converter._dispatch('hashCodeTags.after', text, options, globals);
- return text;
-});
-
-showdown.subParser('hashElement', function (text, options, globals) {
- 'use strict';
+ const parsedInnerBlocks = normalizedBlock.innerBlocks.map(parseRawBlock) // See https://github.com/WordPress/gutenberg/pull/17164.
+ .filter(innerBlock => !!innerBlock); // Get the fully parsed block.
- return function (wholeMatch, m1) {
- var blockText = m1;
+ let parsedBlock = createBlock(normalizedBlock.blockName, getBlockAttributes(blockType, normalizedBlock.innerHTML, normalizedBlock.attrs), parsedInnerBlocks);
+ parsedBlock.originalContent = normalizedBlock.innerHTML; // Attempt to validate the block.
- // Undo double lines
- blockText = blockText.replace(/\n\n/g, '\n');
- blockText = blockText.replace(/^\n/, '');
+ let [isValid, validationIssues] = validateBlock(parsedBlock, blockType); // If the block is invalid, attempt some built-in fixes
+ // like custom classNames handling.
- // strip trailing blank lines
- blockText = blockText.replace(/\n+$/g, '');
+ if (!isValid) {
+ parsedBlock = applyBuiltInValidationFixes(parsedBlock, blockType); // Attempt to validate the block once again after the built-in fixes.
- // Replace the element text with a marker ("¨KxK" where x is its key)
- blockText = '\n\n¨K' + (globals.gHtmlBlocks.push(blockText) - 1) + 'K\n\n';
+ [isValid, validationIssues] = validateBlock(parsedBlock, blockType);
+ }
- return blockText;
- };
-});
-
-showdown.subParser('hashHTMLBlocks', function (text, options, globals) {
- 'use strict';
- text = globals.converter._dispatch('hashHTMLBlocks.before', text, options, globals);
+ parsedBlock.isValid = isValid;
+ parsedBlock.validationIssues = validationIssues; // Run the block deprecation and migrations.
+ // This is performed on both invalid and valid blocks because
+ // migration using the `migrate` functions should run even
+ // if the output is deemed valid.
- var blockTags = [
- 'pre',
- 'div',
- 'h1',
- 'h2',
- 'h3',
- 'h4',
- 'h5',
- 'h6',
- 'blockquote',
- 'table',
- 'dl',
- 'ol',
- 'ul',
- 'script',
- 'noscript',
- 'form',
- 'fieldset',
- 'iframe',
- 'math',
- 'style',
- 'section',
- 'header',
- 'footer',
- 'nav',
- 'article',
- 'aside',
- 'address',
- 'audio',
- 'canvas',
- 'figure',
- 'hgroup',
- 'output',
- 'video',
- 'p'
- ],
- repFunc = function (wholeMatch, match, left, right) {
- var txt = wholeMatch;
- // check if this html element is marked as markdown
- // if so, it's contents should be parsed as markdown
- if (left.search(/\bmarkdown\b/) !== -1) {
- txt = left + globals.converter.makeHtml(match) + right;
- }
- return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n';
- };
+ parsedBlock = applyBlockDeprecatedVersions(parsedBlock, normalizedBlock, blockType);
- if (options.backslashEscapesHTMLTags) {
- // encode backslash escaped HTML tags
- text = text.replace(/\\<(\/?[^>]+?)>/g, function (wm, inside) {
- return '<' + inside + '>';
- });
+ if (validationIssues && validationIssues.length > 0) {
+ if (parsedBlock.isValid) {
+ /* eslint-disable no-console */
+ console.groupCollapsed('Updated Block: %s', blockType.name);
+ console.info('Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s', blockType.name, blockType, getSaveContent(blockType, parsedBlock.attributes), parsedBlock.originalContent);
+ console.groupEnd();
+ /* eslint-enable no-console */
+ } else {
+ validationIssues.forEach(_ref => {
+ let {
+ log,
+ args
+ } = _ref;
+ return log(...args);
+ });
+ }
}
- // hash HTML Blocks
- for (var i = 0; i < blockTags.length; ++i) {
+ return parsedBlock;
+}
+/**
+ * Utilizes an optimized token-driven parser based on the Gutenberg grammar spec
+ * defined through a parsing expression grammar to take advantage of the regular
+ * cadence provided by block delimiters -- composed syntactically through HTML
+ * comments -- which, given a general HTML document as an input, returns a block
+ * list array representation.
+ *
+ * This is a recursive-descent parser that scans linearly once through the input
+ * document. Instead of directly recursing it utilizes a trampoline mechanism to
+ * prevent stack overflow. This initial pass is mainly interested in separating
+ * and isolating the blocks serialized in the document and manifestly not in the
+ * content within the blocks.
+ *
+ * @see
+ * https://developer.wordpress.org/block-editor/packages/packages-block-serialization-default-parser/
+ *
+ * @param {string} content The post content.
+ *
+ * @return {Array} Block list.
+ */
- var opTagPos,
- rgx1 = new RegExp('^ {0,3}(<' + blockTags[i] + '\\b[^>]*>)', 'im'),
- patLeft = '<' + blockTags[i] + '\\b[^>]*>',
- patRight = '</' + blockTags[i] + '>';
- // 1. Look for the first position of the first opening HTML tag in the text
- while ((opTagPos = showdown.helper.regexIndexOf(text, rgx1)) !== -1) {
+function parser_parse(content) {
+ return (0,external_wp_blockSerializationDefaultParser_namespaceObject.parse)(content).reduce((accumulator, rawBlock) => {
+ const block = parseRawBlock(rawBlock);
- // if the HTML tag is \ escaped, we need to escape it and break
+ if (block) {
+ accumulator.push(block);
+ }
+ return accumulator;
+ }, []);
+}
- //2. Split the text in that position
- var subTexts = showdown.helper.splitAtIndex(text, opTagPos),
- //3. Match recursively
- newSubText1 = showdown.helper.replaceRecursiveRegExp(subTexts[1], repFunc, patLeft, patRight, 'im');
+;// 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/blocks/build-module/api/raw-handling/get-raw-transforms.js
+/**
+ * External dependencies
+ */
- // prevent an infinite loop
- if (newSubText1 === subTexts[1]) {
- break;
- }
- text = subTexts[0].concat(newSubText1);
- }
- }
- // HR SPECIAL CASE
- text = text.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,
- showdown.subParser('hashElement')(text, options, globals));
+/**
+ * Internal dependencies
+ */
- // Special case for standalone HTML comments
- text = showdown.helper.replaceRecursiveRegExp(text, function (txt) {
- return '\n\n¨K' + (globals.gHtmlBlocks.push(txt) - 1) + 'K\n\n';
- }, '^ {0,3}<!--', '-->', 'gm');
- // PHP and ASP-style processor instructions (<?...?> and <%...%>)
- text = text.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,
- showdown.subParser('hashElement')(text, options, globals));
+function getRawTransforms() {
+ return (0,external_lodash_namespaceObject.filter)(getBlockTransforms('from'), {
+ type: 'raw'
+ }).map(transform => {
+ return transform.isMatch ? transform : { ...transform,
+ isMatch: node => transform.selector && node.matches(transform.selector)
+ };
+ });
+}
- text = globals.converter._dispatch('hashHTMLBlocks.after', text, options, globals);
- return text;
-});
-
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/html-to-blocks.js
/**
- * Hash span elements that should not be parsed as markdown
+ * Internal dependencies
*/
-showdown.subParser('hashHTMLSpans', function (text, options, globals) {
- 'use strict';
- text = globals.converter._dispatch('hashHTMLSpans.before', text, options, globals);
- function hashHTMLSpan (html) {
- return '¨C' + (globals.gHtmlSpans.push(html) - 1) + 'C';
- }
- // Hash Self Closing tags
- text = text.replace(/<[^>]+?\/>/gi, function (wm) {
- return hashHTMLSpan(wm);
- });
- // Hash tags without properties
- text = text.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g, function (wm) {
- return hashHTMLSpan(wm);
- });
+/**
+ * Converts HTML directly to blocks. Looks for a matching transform for each
+ * top-level tag. The HTML should be filtered to not have any text between
+ * top-level tags and formatted in a way that blocks can handle the HTML.
+ *
+ * @param {string} html HTML to convert.
+ *
+ * @return {Array} An array of blocks.
+ */
- // Hash tags with properties
- text = text.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g, function (wm) {
- return hashHTMLSpan(wm);
- });
+function htmlToBlocks(html) {
+ const doc = document.implementation.createHTMLDocument('');
+ doc.body.innerHTML = html;
+ return Array.from(doc.body.children).flatMap(node => {
+ const rawTransform = findTransform(getRawTransforms(), _ref => {
+ let {
+ isMatch
+ } = _ref;
+ return isMatch(node);
+ });
- // Hash self closing tags without />
- text = text.replace(/<[^>]+?>/gi, function (wm) {
- return hashHTMLSpan(wm);
- });
+ if (!rawTransform) {
+ return createBlock( // Should not be hardcoded.
+ 'core/html', getBlockAttributes('core/html', node.outerHTML));
+ }
- /*showdown.helper.matchRecursiveRegExp(text, '<code\\b[^>]*>', '</code>', 'gi');*/
+ const {
+ transform,
+ blockName
+ } = rawTransform;
- text = globals.converter._dispatch('hashHTMLSpans.after', text, options, globals);
- return text;
-});
+ if (transform) {
+ return transform(node);
+ }
+ return createBlock(blockName, getBlockAttributes(blockName, node.outerHTML));
+ });
+}
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/normalise-blocks.js
/**
- * Unhash HTML spans
+ * WordPress dependencies
*/
-showdown.subParser('unhashHTMLSpans', function (text, options, globals) {
- 'use strict';
- text = globals.converter._dispatch('unhashHTMLSpans.before', text, options, globals);
- for (var i = 0; i < globals.gHtmlSpans.length; ++i) {
- var repText = globals.gHtmlSpans[i],
- // limiter to prevent infinite loop (assume 10 as limit for recurse)
- limit = 0;
+function normaliseBlocks(HTML) {
+ const decuDoc = document.implementation.createHTMLDocument('');
+ const accuDoc = document.implementation.createHTMLDocument('');
+ const decu = decuDoc.body;
+ const accu = accuDoc.body;
+ decu.innerHTML = HTML;
- while (/¨C(\d+)C/.test(repText)) {
- var num = RegExp.$1;
- repText = repText.replace('¨C' + num + 'C', globals.gHtmlSpans[num]);
- if (limit === 10) {
- console.error('maximum nesting of 10 spans reached!!!');
- break;
+ while (decu.firstChild) {
+ const node = decu.firstChild; // Text nodes: wrap in a paragraph, or append to previous.
+
+ if (node.nodeType === node.TEXT_NODE) {
+ if ((0,external_wp_dom_namespaceObject.isEmpty)(node)) {
+ decu.removeChild(node);
+ } else {
+ if (!accu.lastChild || accu.lastChild.nodeName !== 'P') {
+ accu.appendChild(accuDoc.createElement('P'));
+ }
+
+ accu.lastChild.appendChild(node);
+ } // Element nodes.
+
+ } else if (node.nodeType === node.ELEMENT_NODE) {
+ // BR nodes: create a new paragraph on double, or append to previous.
+ if (node.nodeName === 'BR') {
+ if (node.nextSibling && node.nextSibling.nodeName === 'BR') {
+ accu.appendChild(accuDoc.createElement('P'));
+ decu.removeChild(node.nextSibling);
+ } // Don't append to an empty paragraph.
+
+
+ if (accu.lastChild && accu.lastChild.nodeName === 'P' && accu.lastChild.hasChildNodes()) {
+ accu.lastChild.appendChild(node);
+ } else {
+ decu.removeChild(node);
+ }
+ } else if (node.nodeName === 'P') {
+ // Only append non-empty paragraph nodes.
+ if ((0,external_wp_dom_namespaceObject.isEmpty)(node)) {
+ decu.removeChild(node);
+ } else {
+ accu.appendChild(node);
+ }
+ } else if ((0,external_wp_dom_namespaceObject.isPhrasingContent)(node)) {
+ if (!accu.lastChild || accu.lastChild.nodeName !== 'P') {
+ accu.appendChild(accuDoc.createElement('P'));
+ }
+
+ accu.lastChild.appendChild(node);
+ } else {
+ accu.appendChild(node);
}
- ++limit;
+ } else {
+ decu.removeChild(node);
}
- text = text.replace('¨C' + i + 'C', repText);
}
- text = globals.converter._dispatch('unhashHTMLSpans.after', text, options, globals);
- return text;
-});
-
+ return accu.innerHTML;
+}
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/special-comment-converter.js
/**
- * Hash and escape <pre><code> elements that should not be parsed as markdown
+ * WordPress dependencies
*/
-showdown.subParser('hashPreCodeTags', function (text, options, globals) {
- 'use strict';
- text = globals.converter._dispatch('hashPreCodeTags.before', text, options, globals);
- var repFunc = function (wholeMatch, match, left, right) {
- // encode html entities
- var codeblock = left + showdown.subParser('encodeCode')(match, options, globals) + right;
- return '\n\n¨G' + (globals.ghCodeBlocks.push({text: wholeMatch, codeblock: codeblock}) - 1) + 'G\n\n';
- };
+/**
+ * Looks for `<!--nextpage-->` and `<!--more-->` comments, as well as the
+ * `<!--more Some text-->` variant and its `<!--noteaser-->` companion,
+ * and replaces them with a custom element representing a future block.
+ *
+ * The custom element is a way to bypass the rest of the `raw-handling`
+ * transforms, which would eliminate other kinds of node with which to carry
+ * `<!--more-->`'s data: nodes with `data` attributes, empty paragraphs, etc.
+ *
+ * The custom element is then expected to be recognized by any registered
+ * block's `raw` transform.
+ *
+ * @param {Node} node The node to be processed.
+ * @param {Document} doc The document of the node.
+ * @return {void}
+ */
+
+function specialCommentConverter(node, doc) {
+ if (node.nodeType !== node.COMMENT_NODE) {
+ return;
+ }
+
+ if (node.nodeValue === 'nextpage') {
+ (0,external_wp_dom_namespaceObject.replace)(node, createNextpage(doc));
+ return;
+ }
+
+ if (node.nodeValue.indexOf('more') === 0) {
+ // Grab any custom text in the comment.
+ const customText = node.nodeValue.slice(4).trim();
+ /*
+ * When a `<!--more-->` comment is found, we need to look for any
+ * `<!--noteaser-->` sibling, but it may not be a direct sibling
+ * (whitespace typically lies in between)
+ */
+
+ let sibling = node;
+ let noTeaser = false;
- // Hash <pre><code>
- text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>', '^ {0,3}</code>\\s*</pre>', 'gim');
+ while (sibling = sibling.nextSibling) {
+ if (sibling.nodeType === sibling.COMMENT_NODE && sibling.nodeValue === 'noteaser') {
+ noTeaser = true;
+ (0,external_wp_dom_namespaceObject.remove)(sibling);
+ break;
+ }
+ }
- text = globals.converter._dispatch('hashPreCodeTags.after', text, options, globals);
- return text;
-});
-
-showdown.subParser('headers', function (text, options, globals) {
- 'use strict';
+ (0,external_wp_dom_namespaceObject.replace)(node, createMore(customText, noTeaser, doc));
+ }
+}
- text = globals.converter._dispatch('headers.before', text, options, globals);
+function createMore(customText, noTeaser, doc) {
+ const node = doc.createElement('wp-block');
+ node.dataset.block = 'core/more';
- var headerLevelStart = (isNaN(parseInt(options.headerLevelStart))) ? 1 : parseInt(options.headerLevelStart),
+ if (customText) {
+ node.dataset.customText = customText;
+ }
- // Set text-style headers:
- // Header 1
- // ========
- //
- // Header 2
- // --------
- //
- setextRegexH1 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm,
- setextRegexH2 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm;
+ if (noTeaser) {
+ // "Boolean" data attribute
+ node.dataset.noTeaser = '';
+ }
- text = text.replace(setextRegexH1, function (wholeMatch, m1) {
+ return node;
+}
- var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),
- hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
- hLevel = headerLevelStart,
- hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';
- return showdown.subParser('hashBlock')(hashBlock, options, globals);
- });
+function createNextpage(doc) {
+ const node = doc.createElement('wp-block');
+ node.dataset.block = 'core/nextpage';
+ return node;
+}
- text = text.replace(setextRegexH2, function (matchFound, m1) {
- var spanGamut = showdown.subParser('spanGamut')(m1, options, globals),
- hID = (options.noHeaderId) ? '' : ' id="' + headerId(m1) + '"',
- hLevel = headerLevelStart + 1,
- hashBlock = '<h' + hLevel + hID + '>' + spanGamut + '</h' + hLevel + '>';
- return showdown.subParser('hashBlock')(hashBlock, options, globals);
- });
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/list-reducer.js
+/**
+ * WordPress dependencies
+ */
- // atx-style headers:
- // # Header 1
- // ## Header 2
- // ## Header 2 with closing hashes ##
- // ...
- // ###### Header 6
- //
- var atxStyle = (options.requireSpaceBeforeHeadingText) ? /^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm : /^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;
- text = text.replace(atxStyle, function (wholeMatch, m1, m2) {
- var hText = m2;
- if (options.customizedHeaderId) {
- hText = m2.replace(/\s?\{([^{]+?)}\s*$/, '');
- }
+function isList(node) {
+ return node.nodeName === 'OL' || node.nodeName === 'UL';
+}
- var span = showdown.subParser('spanGamut')(hText, options, globals),
- hID = (options.noHeaderId) ? '' : ' id="' + headerId(m2) + '"',
- hLevel = headerLevelStart - 1 + m1.length,
- header = '<h' + hLevel + hID + '>' + span + '</h' + hLevel + '>';
+function shallowTextContent(element) {
+ return Array.from(element.childNodes).map(_ref => {
+ let {
+ nodeValue = ''
+ } = _ref;
+ return nodeValue;
+ }).join('');
+}
- return showdown.subParser('hashBlock')(header, options, globals);
- });
+function listReducer(node) {
+ if (!isList(node)) {
+ return;
+ }
- function headerId (m) {
- var title,
- prefix;
+ const list = node;
+ const prevElement = node.previousElementSibling; // Merge with previous list if:
+ // * There is a previous list of the same type.
+ // * There is only one list item.
- // It is separate from other options to allow combining prefix and customized
- if (options.customizedHeaderId) {
- var match = m.match(/\{([^{]+?)}\s*$/);
- if (match && match[1]) {
- m = match[1];
- }
+ if (prevElement && prevElement.nodeName === node.nodeName && list.children.length === 1) {
+ // Move all child nodes, including any text nodes, if any.
+ while (list.firstChild) {
+ prevElement.appendChild(list.firstChild);
}
- title = m;
+ list.parentNode.removeChild(list);
+ }
- // Prefix id to prevent causing inadvertent pre-existing style matches.
- if (showdown.helper.isString(options.prefixHeaderId)) {
- prefix = options.prefixHeaderId;
- } else if (options.prefixHeaderId === true) {
- prefix = 'section-';
- } else {
- prefix = '';
- }
+ const parentElement = node.parentNode; // Nested list with empty parent item.
- if (!options.rawPrefixHeaderId) {
- title = prefix + title;
- }
+ if (parentElement && parentElement.nodeName === 'LI' && parentElement.children.length === 1 && !/\S/.test(shallowTextContent(parentElement))) {
+ const parentListItem = parentElement;
+ const prevListItem = parentListItem.previousElementSibling;
+ const parentList = parentListItem.parentNode;
- if (options.ghCompatibleHeaderId) {
- title = title
- .replace(/ /g, '-')
- // replace previously escaped chars (&, ¨ and $)
- .replace(/&/g, '')
- .replace(/¨T/g, '')
- .replace(/¨D/g, '')
- // replace rest of the chars (&~$ are repeated as they might have been escaped)
- // borrowed from github's redcarpet (some they should produce similar results)
- .replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g, '')
- .toLowerCase();
- } else if (options.rawHeaderId) {
- title = title
- .replace(/ /g, '-')
- // replace previously escaped chars (&, ¨ and $)
- .replace(/&/g, '&')
- .replace(/¨T/g, '¨')
- .replace(/¨D/g, '$')
- // replace " and '
- .replace(/["']/g, '-')
- .toLowerCase();
+ if (prevListItem) {
+ prevListItem.appendChild(list);
+ parentList.removeChild(parentListItem);
} else {
- title = title
- .replace(/[^\w]/g, '')
- .toLowerCase();
+ parentList.parentNode.insertBefore(list, parentList);
+ parentList.parentNode.removeChild(parentList);
}
+ } // Invalid: OL/UL > OL/UL.
- if (options.rawPrefixHeaderId) {
- title = prefix + title;
- }
- if (globals.hashLinkCounts[title]) {
- title = title + '-' + (globals.hashLinkCounts[title]++);
+ if (parentElement && isList(parentElement)) {
+ const prevListItem = node.previousElementSibling;
+
+ if (prevListItem) {
+ prevListItem.appendChild(node);
} else {
- globals.hashLinkCounts[title] = 1;
+ (0,external_wp_dom_namespaceObject.unwrap)(node);
}
- return title;
}
+}
- text = globals.converter._dispatch('headers.after', text, options, globals);
- return text;
-});
-
-/**
- * Turn Markdown link shortcuts into XHTML <a> tags.
- */
-showdown.subParser('horizontalRule', function (text, options, globals) {
- 'use strict';
- text = globals.converter._dispatch('horizontalRule.before', text, options, globals);
-
- var key = showdown.subParser('hashBlock')('<hr />', options, globals);
- text = text.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, key);
- text = text.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, key);
- text = text.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, key);
-
- text = globals.converter._dispatch('horizontalRule.after', text, options, globals);
- return text;
-});
-
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/blockquote-normaliser.js
/**
- * Turn Markdown image shortcuts into <img> tags.
+ * Internal dependencies
*/
-showdown.subParser('images', function (text, options, globals) {
- 'use strict';
-
- text = globals.converter._dispatch('images.before', text, options, globals);
-
- var inlineRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,
- crazyRegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,
- base64RegExp = /!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,
- referenceRegExp = /!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,
- refShortcutRegExp = /!\[([^\[\]]+)]()()()()()/g;
- function writeImageTagBase64 (wholeMatch, altText, linkId, url, width, height, m5, title) {
- url = url.replace(/\s/g, '');
- return writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title);
+function blockquoteNormaliser(node) {
+ if (node.nodeName !== 'BLOCKQUOTE') {
+ return;
}
- function writeImageTag (wholeMatch, altText, linkId, url, width, height, m5, title) {
-
- var gUrls = globals.gUrls,
- gTitles = globals.gTitles,
- gDims = globals.gDimensions;
-
- linkId = linkId.toLowerCase();
-
- if (!title) {
- title = '';
- }
- // Special case for explicit empty url
- if (wholeMatch.search(/\(<?\s*>? ?(['"].*['"])?\)$/m) > -1) {
- url = '';
-
- } else if (url === '' || url === null) {
- if (linkId === '' || linkId === null) {
- // lower-case and turn embedded newlines into spaces
- linkId = altText.toLowerCase().replace(/ ?\n/g, ' ');
- }
- url = '#' + linkId;
-
- if (!showdown.helper.isUndefined(gUrls[linkId])) {
- url = gUrls[linkId];
- if (!showdown.helper.isUndefined(gTitles[linkId])) {
- title = gTitles[linkId];
- }
- if (!showdown.helper.isUndefined(gDims[linkId])) {
- width = gDims[linkId].width;
- height = gDims[linkId].height;
- }
- } else {
- return wholeMatch;
- }
- }
+ node.innerHTML = normaliseBlocks(node.innerHTML);
+}
- altText = altText
- .replace(/"/g, '"')
- //altText = showdown.helper.escapeCharacters(altText, '*_', false);
- .replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
- //url = showdown.helper.escapeCharacters(url, '*_', false);
- url = url.replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
- var result = '<img src="' + url + '" alt="' + altText + '"';
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/figure-content-reducer.js
+/**
+ * External dependencies
+ */
- if (title && showdown.helper.isString(title)) {
- title = title
- .replace(/"/g, '"')
- //title = showdown.helper.escapeCharacters(title, '*_', false);
- .replace(showdown.helper.regexes.asteriskDashAndColon, showdown.helper.escapeCharactersCallback);
- result += ' title="' + title + '"';
- }
+/**
+ * WordPress dependencies
+ */
- if (width && height) {
- width = (width === '*') ? 'auto' : width;
- height = (height === '*') ? 'auto' : height;
- result += ' width="' + width + '"';
- result += ' height="' + height + '"';
- }
+/**
+ * Whether or not the given node is figure content.
+ *
+ * @param {Node} node The node to check.
+ * @param {Object} schema The schema to use.
+ *
+ * @return {boolean} True if figure content, false if not.
+ */
- result += ' />';
+function isFigureContent(node, schema) {
+ const tag = node.nodeName.toLowerCase(); // We are looking for tags that can be a child of the figure tag, excluding
+ // `figcaption` and any phrasing content.
- return result;
+ if (tag === 'figcaption' || (0,external_wp_dom_namespaceObject.isTextContent)(node)) {
+ return false;
}
- // First, handle reference-style labeled images: ![alt text][id]
- text = text.replace(referenceRegExp, writeImageTag);
+ return (0,external_lodash_namespaceObject.has)(schema, ['figure', 'children', tag]);
+}
+/**
+ * Whether or not the given node can have an anchor.
+ *
+ * @param {Node} node The node to check.
+ * @param {Object} schema The schema to use.
+ *
+ * @return {boolean} True if it can, false if not.
+ */
- // Next, handle inline images: 
- // base64 encoded images
- text = text.replace(base64RegExp, writeImageTagBase64);
+function canHaveAnchor(node, schema) {
+ const tag = node.nodeName.toLowerCase();
+ return (0,external_lodash_namespaceObject.has)(schema, ['figure', 'children', 'a', 'children', tag]);
+}
+/**
+ * Wraps the given element in a figure element.
+ *
+ * @param {Element} element The element to wrap.
+ * @param {Element} beforeElement The element before which to place the figure.
+ */
- // cases with crazy urls like ./image/cat1).png
- text = text.replace(crazyRegExp, writeImageTag);
- // normal cases
- text = text.replace(inlineRegExp, writeImageTag);
+function wrapFigureContent(element) {
+ let beforeElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : element;
+ const figure = element.ownerDocument.createElement('figure');
+ beforeElement.parentNode.insertBefore(figure, beforeElement);
+ figure.appendChild(element);
+}
+/**
+ * This filter takes figure content out of paragraphs, wraps it in a figure
+ * element, and moves any anchors with it if needed.
+ *
+ * @param {Node} node The node to filter.
+ * @param {Document} doc The document of the node.
+ * @param {Object} schema The schema to use.
+ *
+ * @return {void}
+ */
- // handle reference-style shortcuts: ![img text]
- text = text.replace(refShortcutRegExp, writeImageTag);
- text = globals.converter._dispatch('images.after', text, options, globals);
- return text;
-});
-
-showdown.subParser('italicsAndBold', function (text, options, globals) {
- 'use strict';
+function figureContentReducer(node, doc, schema) {
+ if (!isFigureContent(node, schema)) {
+ return;
+ }
- text = globals.converter._dispatch('italicsAndBold.before', text, options, globals);
+ let nodeToInsert = node;
+ const parentNode = node.parentNode; // If the figure content can have an anchor and its parent is an anchor with
+ // only the figure content, take the anchor out instead of just the content.
- // it's faster to have 3 separate regexes for each case than have just one
- // because of backtracing, in some cases, it could lead to an exponential effect
- // called "catastrophic backtrace". Ominous!
+ if (canHaveAnchor(node, schema) && parentNode.nodeName === 'A' && parentNode.childNodes.length === 1) {
+ nodeToInsert = node.parentNode;
+ }
- function parseInside (txt, left, right) {
- /*
- if (options.simplifiedAutoLink) {
- txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);
+ const wrapper = nodeToInsert.closest('p,div'); // If wrapped in a paragraph or div, only extract if it's aligned or if
+ // there is no text content.
+ // Otherwise, if directly at the root, wrap in a figure element.
+
+ if (wrapper) {
+ // In jsdom-jscore, 'node.classList' can be undefined.
+ // In this case, default to extract as it offers a better UI experience on mobile.
+ if (!node.classList) {
+ wrapFigureContent(nodeToInsert, wrapper);
+ } else if (node.classList.contains('alignright') || node.classList.contains('alignleft') || node.classList.contains('aligncenter') || !wrapper.textContent.trim()) {
+ wrapFigureContent(nodeToInsert, wrapper);
}
- */
- return left + txt + right;
+ } else if (nodeToInsert.parentNode.nodeName === 'BODY') {
+ wrapFigureContent(nodeToInsert);
}
+}
- // Parse underscores
- if (options.literalMidWordUnderscores) {
- text = text.replace(/\b___(\S[\s\S]*?)___\b/g, function (wm, txt) {
- return parseInside (txt, '<strong><em>', '</em></strong>');
- });
- text = text.replace(/\b__(\S[\s\S]*?)__\b/g, function (wm, txt) {
- return parseInside (txt, '<strong>', '</strong>');
- });
- text = text.replace(/\b_(\S[\s\S]*?)_\b/g, function (wm, txt) {
- return parseInside (txt, '<em>', '</em>');
- });
- } else {
- text = text.replace(/___(\S[\s\S]*?)___/g, function (wm, m) {
- return (/\S$/.test(m)) ? parseInside (m, '<strong><em>', '</em></strong>') : wm;
- });
- text = text.replace(/__(\S[\s\S]*?)__/g, function (wm, m) {
- return (/\S$/.test(m)) ? parseInside (m, '<strong>', '</strong>') : wm;
- });
- text = text.replace(/_([^\s_][\s\S]*?)_/g, function (wm, m) {
- // !/^_[^_]/.test(m) - test if it doesn't start with __ (since it seems redundant, we removed it)
- return (/\S$/.test(m)) ? parseInside (m, '<em>', '</em>') : wm;
- });
- }
+;// CONCATENATED MODULE: external ["wp","shortcode"]
+var external_wp_shortcode_namespaceObject = window["wp"]["shortcode"];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/shortcode-converter.js
+/**
+ * External dependencies
+ */
- // Now parse asterisks
- if (options.literalMidWordAsterisks) {
- text = text.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g, function (wm, lead, txt) {
- return parseInside (txt, lead + '<strong><em>', '</em></strong>');
- });
- text = text.replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g, function (wm, lead, txt) {
- return parseInside (txt, lead + '<strong>', '</strong>');
- });
- text = text.replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g, function (wm, lead, txt) {
- return parseInside (txt, lead + '<em>', '</em>');
- });
- } else {
- text = text.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g, function (wm, m) {
- return (/\S$/.test(m)) ? parseInside (m, '<strong><em>', '</em></strong>') : wm;
- });
- text = text.replace(/\*\*(\S[\s\S]*?)\*\*/g, function (wm, m) {
- return (/\S$/.test(m)) ? parseInside (m, '<strong>', '</strong>') : wm;
- });
- text = text.replace(/\*([^\s*][\s\S]*?)\*/g, function (wm, m) {
- // !/^\*[^*]/.test(m) - test if it doesn't start with ** (since it seems redundant, we removed it)
- return (/\S$/.test(m)) ? parseInside (m, '<em>', '</em>') : wm;
- });
- }
+/**
+ * WordPress dependencies
+ */
- text = globals.converter._dispatch('italicsAndBold.after', text, options, globals);
- return text;
-});
-
/**
- * Form HTML ordered (numbered) and unordered (bulleted) lists.
+ * Internal dependencies
*/
-showdown.subParser('lists', function (text, options, globals) {
- 'use strict';
- /**
- * Process the contents of a single ordered or unordered list, splitting it
- * into individual list items.
- * @param {string} listStr
- * @param {boolean} trimTrailing
- * @returns {string}
- */
- function processListItems (listStr, trimTrailing) {
- // The $g_list_level global keeps track of when we're inside a list.
- // Each time we enter a list, we increment it; when we leave a list,
- // we decrement. If it's zero, we're not in a list anymore.
- //
- // We do this because when we're not inside a list, we want to treat
- // something like this:
- //
- // I recommend upgrading to version
- // 8. Oops, now this line is treated
- // as a sub-list.
- //
- // As a single paragraph, despite the fact that the second line starts
- // with a digit-period-space sequence.
- //
- // Whereas when we're inside a list (or sub-list), that line will be
- // treated as the start of a sub-list. What a kludge, huh? This is
- // an aspect of Markdown's syntax that's hard to parse perfectly
- // without resorting to mind-reading. Perhaps the solution is to
- // change the syntax rules such that sub-lists must start with a
- // starting cardinal number; e.g. "1." or "a.".
- globals.gListLevel++;
- // trim trailing blank lines:
- listStr = listStr.replace(/\n{2,}$/, '\n');
- // attacklab: add sentinel to emulate \z
- listStr += '¨0';
- var rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,
- isParagraphed = (/\n[ \t]*\n(?!¨0)/.test(listStr));
- // Since version 1.5, nesting sublists requires 4 spaces (or 1 tab) indentation,
- // which is a syntax breaking change
- // activating this option reverts to old behavior
- if (options.disableForced4SpacesIndentedSublists) {
- rgx = /(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm;
+
+function segmentHTMLToShortcodeBlock(HTML) {
+ let lastIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
+ let excludedBlockNames = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
+ // Get all matches.
+ const transformsFrom = getBlockTransforms('from');
+ const transformation = findTransform(transformsFrom, transform => excludedBlockNames.indexOf(transform.blockName) === -1 && transform.type === 'shortcode' && (0,external_lodash_namespaceObject.some)((0,external_lodash_namespaceObject.castArray)(transform.tag), tag => (0,external_wp_shortcode_namespaceObject.regexp)(tag).test(HTML)));
+
+ if (!transformation) {
+ return [HTML];
+ }
+
+ const transformTags = (0,external_lodash_namespaceObject.castArray)(transformation.tag);
+ const transformTag = (0,external_lodash_namespaceObject.find)(transformTags, tag => (0,external_wp_shortcode_namespaceObject.regexp)(tag).test(HTML));
+ let match;
+ const previousIndex = lastIndex;
+
+ if (match = (0,external_wp_shortcode_namespaceObject.next)(transformTag, HTML, lastIndex)) {
+ lastIndex = match.index + match.content.length;
+ const beforeHTML = HTML.substr(0, match.index);
+ const afterHTML = HTML.substr(lastIndex); // If the shortcode content does not contain HTML and the shortcode is
+ // not on a new line (or in paragraph from Markdown converter),
+ // consider the shortcode as inline text, and thus skip conversion for
+ // this segment.
+
+ if (!(0,external_lodash_namespaceObject.includes)(match.shortcode.content || '', '<') && !(/(\n|<p>)\s*$/.test(beforeHTML) && /^\s*(\n|<\/p>)/.test(afterHTML))) {
+ return segmentHTMLToShortcodeBlock(HTML, lastIndex);
+ } // If a transformation's `isMatch` predicate fails for the inbound
+ // shortcode, try again by excluding the current block type.
+ //
+ // This is the only call to `segmentHTMLToShortcodeBlock` that should
+ // ever carry over `excludedBlockNames`. Other calls in the module
+ // should skip that argument as a way to reset the exclusion state, so
+ // that one `isMatch` fail in an HTML fragment doesn't prevent any
+ // valid matches in subsequent fragments.
+
+
+ if (transformation.isMatch && !transformation.isMatch(match.shortcode.attrs)) {
+ return segmentHTMLToShortcodeBlock(HTML, previousIndex, [...excludedBlockNames, transformation.blockName]);
}
- listStr = listStr.replace(rgx, function (wholeMatch, m1, m2, m3, m4, taskbtn, checked) {
- checked = (checked && checked.trim() !== '');
+ const attributes = (0,external_lodash_namespaceObject.mapValues)((0,external_lodash_namespaceObject.pickBy)(transformation.attributes, schema => schema.shortcode), // Passing all of `match` as second argument is intentionally broad
+ // but shouldn't be too relied upon.
+ //
+ // See: https://github.com/WordPress/gutenberg/pull/3610#discussion_r152546926
+ schema => schema.shortcode(match.shortcode.attrs, match));
+ const transformationBlockType = { ...registration_getBlockType(transformation.blockName),
+ attributes: transformation.attributes
+ };
+ let block = createBlock(transformation.blockName, getBlockAttributes(transformationBlockType, match.shortcode.content, attributes));
+ block.originalContent = match.shortcode.content; // Applying the built-in fixes can enhance the attributes with missing content like "className".
- var item = showdown.subParser('outdent')(m4, options, globals),
- bulletStyle = '';
+ block = applyBuiltInValidationFixes(block, transformationBlockType);
+ return [...segmentHTMLToShortcodeBlock(beforeHTML), block, ...segmentHTMLToShortcodeBlock(afterHTML)];
+ }
- // Support for github tasklists
- if (taskbtn && options.tasklists) {
- bulletStyle = ' class="task-list-item" style="list-style-type: none;"';
- item = item.replace(/^[ \t]*\[(x|X| )?]/m, function () {
- var otp = '<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';
- if (checked) {
- otp += ' checked';
- }
- otp += '>';
- return otp;
- });
- }
+ return [HTML];
+}
- // ISSUE #312
- // This input: - - - a
- // causes trouble to the parser, since it interprets it as:
- // <ul><li><li><li>a</li></li></li></ul>
- // instead of:
- // <ul><li>- - a</li></ul>
- // So, to prevent it, we will put a marker (¨A)in the beginning of the line
- // Kind of hackish/monkey patching, but seems more effective than overcomplicating the list parser
- item = item.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g, function (wm2) {
- return '¨A' + wm2;
- });
+/* harmony default export */ var shortcode_converter = (segmentHTMLToShortcodeBlock);
- // m1 - Leading line or
- // Has a double return (multi paragraph) or
- // Has sublist
- if (m1 || (item.search(/\n{2,}/) > -1)) {
- item = showdown.subParser('githubCodeBlocks')(item, options, globals);
- item = showdown.subParser('blockGamut')(item, options, globals);
- } else {
- // Recursion for sub-lists:
- item = showdown.subParser('lists')(item, options, globals);
- item = item.replace(/\n$/, ''); // chomp(item)
- item = showdown.subParser('hashHTMLBlocks')(item, options, globals);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/utils.js
+/**
+ * External dependencies
+ */
- // Colapse double linebreaks
- item = item.replace(/\n\n+/g, '\n\n');
- if (isParagraphed) {
- item = showdown.subParser('paragraphs')(item, options, globals);
- } else {
- item = showdown.subParser('spanGamut')(item, options, globals);
- }
- }
+/**
+ * WordPress dependencies
+ */
- // now we need to remove the marker (¨A)
- item = item.replace('¨A', '');
- // we can finally wrap the line in list item tags
- item = '<li' + bulletStyle + '>' + item + '</li>\n';
- return item;
- });
+/**
+ * Internal dependencies
+ */
- // attacklab: strip sentinel
- listStr = listStr.replace(/¨0/g, '');
- globals.gListLevel--;
- if (trimTrailing) {
- listStr = listStr.replace(/\s+$/, '');
+function getBlockContentSchemaFromTransforms(transforms, context) {
+ const phrasingContentSchema = (0,external_wp_dom_namespaceObject.getPhrasingContentSchema)(context);
+ const schemaArgs = {
+ phrasingContentSchema,
+ isPaste: context === 'paste'
+ };
+ const schemas = transforms.map(_ref => {
+ let {
+ isMatch,
+ blockName,
+ schema
+ } = _ref;
+ const hasAnchorSupport = registration_hasBlockSupport(blockName, 'anchor');
+ schema = (0,external_lodash_namespaceObject.isFunction)(schema) ? schema(schemaArgs) : schema; // If the block does not has anchor support and the transform does not
+ // provides an isMatch we can return the schema right away.
+
+ if (!hasAnchorSupport && !isMatch) {
+ return schema;
}
- return listStr;
- }
+ return (0,external_lodash_namespaceObject.mapValues)(schema, value => {
+ let attributes = value.attributes || []; // If the block supports the "anchor" functionality, it needs to keep its ID attribute.
- function styleStartNumber (list, listType) {
- // check if ol and starts by a number different than 1
- if (listType === 'ol') {
- var res = list.match(/^ *(\d+)\./);
- if (res && res[1] !== '1') {
- return ' start="' + res[1] + '"';
+ if (hasAnchorSupport) {
+ attributes = [...attributes, 'id'];
}
- }
- return '';
- }
- /**
- * Check and parse consecutive lists (better fix for issue #142)
- * @param {string} list
- * @param {string} listType
- * @param {boolean} trimTrailing
- * @returns {string}
- */
- function parseConsecutiveLists (list, listType, trimTrailing) {
- // check if we caught 2 or more consecutive lists by mistake
- // we use the counterRgx, meaning if listType is UL we look for OL and vice versa
- var olRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?\d+\.[ \t]/gm : /^ {0,3}\d+\.[ \t]/gm,
- ulRgx = (options.disableForced4SpacesIndentedSublists) ? /^ ?[*+-][ \t]/gm : /^ {0,3}[*+-][ \t]/gm,
- counterRxg = (listType === 'ul') ? olRgx : ulRgx,
- result = '';
+ return { ...value,
+ attributes,
+ isMatch: isMatch ? isMatch : undefined
+ };
+ });
+ });
+ return (0,external_lodash_namespaceObject.mergeWith)({}, ...schemas, (objValue, srcValue, key) => {
+ switch (key) {
+ case 'children':
+ {
+ if (objValue === '*' || srcValue === '*') {
+ return '*';
+ }
- if (list.search(counterRxg) !== -1) {
- (function parseCL (txt) {
- var pos = txt.search(counterRxg),
- style = styleStartNumber(list, listType);
- if (pos !== -1) {
- // slice
- result += '\n\n<' + listType + style + '>\n' + processListItems(txt.slice(0, pos), !!trimTrailing) + '</' + listType + '>\n';
+ return { ...objValue,
+ ...srcValue
+ };
+ }
- // invert counterType and listType
- listType = (listType === 'ul') ? 'ol' : 'ul';
- counterRxg = (listType === 'ul') ? olRgx : ulRgx;
+ case 'attributes':
+ case 'require':
+ {
+ return [...(objValue || []), ...(srcValue || [])];
+ }
- //recurse
- parseCL(txt.slice(pos));
- } else {
- result += '\n\n<' + listType + style + '>\n' + processListItems(txt, !!trimTrailing) + '</' + listType + '>\n';
+ case 'isMatch':
+ {
+ // If one of the values being merge is undefined (matches everything),
+ // the result of the merge will be undefined.
+ if (!objValue || !srcValue) {
+ return undefined;
+ } // When merging two isMatch functions, the result is a new function
+ // that returns if one of the source functions returns true.
+
+
+ return function () {
+ return objValue(...arguments) || srcValue(...arguments);
+ };
}
- })(list);
- } else {
- var style = styleStartNumber(list, listType);
- result = '\n\n<' + listType + style + '>\n' + processListItems(list, !!trimTrailing) + '</' + listType + '>\n';
}
+ });
+}
+/**
+ * Gets the block content schema, which is extracted and merged from all
+ * registered blocks with raw transfroms.
+ *
+ * @param {string} context Set to "paste" when in paste context, where the
+ * schema is more strict.
+ *
+ * @return {Object} A complete block content schema.
+ */
- return result;
- }
+function getBlockContentSchema(context) {
+ return getBlockContentSchemaFromTransforms(getRawTransforms(), context);
+}
+/**
+ * Checks whether HTML can be considered plain text. That is, it does not contain
+ * any elements that are not line breaks.
+ *
+ * @param {string} HTML The HTML to check.
+ *
+ * @return {boolean} Whether the HTML can be considered plain text.
+ */
- /** Start of list parsing **/
- text = globals.converter._dispatch('lists.before', text, options, globals);
- // add sentinel to hack around khtml/safari bug:
- // http://bugs.webkit.org/show_bug.cgi?id=11231
- text += '¨0';
+function isPlain(HTML) {
+ return !/<(?!br[ />])/i.test(HTML);
+}
+/**
+ * Given node filters, deeply filters and mutates a NodeList.
+ *
+ * @param {NodeList} nodeList The nodeList to filter.
+ * @param {Array} filters An array of functions that can mutate with the provided node.
+ * @param {Document} doc The document of the nodeList.
+ * @param {Object} schema The schema to use.
+ */
- if (globals.gListLevel) {
- text = text.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
- function (wholeMatch, list, m2) {
- var listType = (m2.search(/[*+-]/g) > -1) ? 'ul' : 'ol';
- return parseConsecutiveLists(list, listType, true);
- }
- );
- } else {
- text = text.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,
- function (wholeMatch, m1, list, m3) {
- var listType = (m3.search(/[*+-]/g) > -1) ? 'ul' : 'ol';
- return parseConsecutiveLists(list, listType, false);
+function deepFilterNodeList(nodeList, filters, doc, schema) {
+ Array.from(nodeList).forEach(node => {
+ deepFilterNodeList(node.childNodes, filters, doc, schema);
+ filters.forEach(item => {
+ // Make sure the node is still attached to the document.
+ if (!doc.contains(node)) {
+ return;
}
- );
- }
- // strip sentinel
- text = text.replace(/¨0/, '');
- text = globals.converter._dispatch('lists.after', text, options, globals);
- return text;
-});
-
+ item(node, doc, schema);
+ });
+ });
+}
+/**
+ * Given node filters, deeply filters HTML tags.
+ * Filters from the deepest nodes to the top.
+ *
+ * @param {string} HTML The HTML to filter.
+ * @param {Array} filters An array of functions that can mutate with the provided node.
+ * @param {Object} schema The schema to use.
+ *
+ * @return {string} The filtered HTML.
+ */
+
+function deepFilterHTML(HTML) {
+ let filters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
+ let schema = arguments.length > 2 ? arguments[2] : undefined;
+ const doc = document.implementation.createHTMLDocument('');
+ doc.body.innerHTML = HTML;
+ deepFilterNodeList(doc.body.childNodes, filters, doc, schema);
+ return doc.body.innerHTML;
+}
/**
- * Parse metadata at the top of the document
+ * Gets a sibling within text-level context.
+ *
+ * @param {Element} node The subject node.
+ * @param {string} which "next" or "previous".
*/
-showdown.subParser('metadata', function (text, options, globals) {
- 'use strict';
-
- if (!options.metadata) {
- return text;
- }
- text = globals.converter._dispatch('metadata.before', text, options, globals);
+function getSibling(node, which) {
+ const sibling = node[`${which}Sibling`];
- function parseMetadataContents (content) {
- // raw is raw so it's not changed in any way
- globals.metadata.raw = content;
+ if (sibling && (0,external_wp_dom_namespaceObject.isPhrasingContent)(sibling)) {
+ return sibling;
+ }
- // escape chars forbidden in html attributes
- // double quotes
- content = content
- // ampersand first
- .replace(/&/g, '&')
- // double quotes
- .replace(/"/g, '"');
+ const {
+ parentNode
+ } = node;
- content = content.replace(/\n {4}/g, ' ');
- content.replace(/^([\S ]+): +([\s\S]+?)$/gm, function (wm, key, value) {
- globals.metadata.parsed[key] = value;
- return '';
- });
+ if (!parentNode || !(0,external_wp_dom_namespaceObject.isPhrasingContent)(parentNode)) {
+ return;
}
- text = text.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/, function (wholematch, format, content) {
- parseMetadataContents(content);
- return '¨M';
- });
-
- text = text.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/, function (wholematch, format, content) {
- if (format) {
- globals.metadata.format = format;
- }
- parseMetadataContents(content);
- return '¨M';
- });
+ return getSibling(parentNode, which);
+}
- text = text.replace(/¨M/g, '');
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/index.js
+/**
+ * External dependencies
+ */
- text = globals.converter._dispatch('metadata.after', text, options, globals);
- return text;
-});
-
/**
- * Remove one level of line-leading tabs or spaces
+ * WordPress dependencies
*/
-showdown.subParser('outdent', function (text, options, globals) {
- 'use strict';
- text = globals.converter._dispatch('outdent.before', text, options, globals);
- // attacklab: hack around Konqueror 3.5.4 bug:
- // "----------bug".replace(/^-/g,"") == "bug"
- text = text.replace(/^(\t|[ ]{1,4})/gm, '¨0'); // attacklab: g_tab_width
- // attacklab: clean up hack
- text = text.replace(/¨0/g, '');
- text = globals.converter._dispatch('outdent.after', text, options, globals);
- return text;
-});
-
/**
- *
+ * Internal dependencies
*/
-showdown.subParser('paragraphs', function (text, options, globals) {
- 'use strict';
- text = globals.converter._dispatch('paragraphs.before', text, options, globals);
- // Strip leading and trailing lines:
- text = text.replace(/^\n+/g, '');
- text = text.replace(/\n+$/g, '');
- var grafs = text.split(/\n{2,}/g),
- grafsOut = [],
- end = grafs.length; // Wrap <p> tags
- for (var i = 0; i < end; i++) {
- var str = grafs[i];
- // if this is an HTML marker, copy it
- if (str.search(/¨(K|G)(\d+)\1/g) >= 0) {
- grafsOut.push(str);
- // test for presence of characters to prevent empty lines being parsed
- // as paragraphs (resulting in undesired extra empty paragraphs)
- } else if (str.search(/\S/) >= 0) {
- str = showdown.subParser('spanGamut')(str, options, globals);
- str = str.replace(/^([ \t]*)/g, '<p>');
- str += '</p>';
- grafsOut.push(str);
- }
- }
- /** Unhashify HTML blocks */
- end = grafsOut.length;
- for (i = 0; i < end; i++) {
- var blockText = '',
- grafsOutIt = grafsOut[i],
- codeFlag = false;
- // if this is a marker for an html block...
- // use RegExp.test instead of string.search because of QML bug
- while (/¨(K|G)(\d+)\1/.test(grafsOutIt)) {
- var delim = RegExp.$1,
- num = RegExp.$2;
- if (delim === 'K') {
- blockText = globals.gHtmlBlocks[num];
- } else {
- // we need to check if ghBlock is a false positive
- if (codeFlag) {
- // use encoded version of all text
- blockText = showdown.subParser('encodeCode')(globals.ghCodeBlocks[num].text, options, globals);
- } else {
- blockText = globals.ghCodeBlocks[num].codeblock;
- }
- }
- blockText = blockText.replace(/\$/g, '$$$$'); // Escape any dollar signs
- grafsOutIt = grafsOutIt.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/, blockText);
- // Check if grafsOutIt is a pre->code
- if (/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(grafsOutIt)) {
- codeFlag = true;
- }
- }
- grafsOut[i] = grafsOutIt;
- }
- text = grafsOut.join('\n');
- // Strip leading and trailing lines:
- text = text.replace(/^\n+/g, '');
- text = text.replace(/\n+$/g, '');
- return globals.converter._dispatch('paragraphs.after', text, options, globals);
-});
-
-/**
- * Run extension
- */
-showdown.subParser('runExtension', function (ext, text, options, globals) {
- 'use strict';
- if (ext.filter) {
- text = ext.filter(text, globals.converter, options);
- } else if (ext.regex) {
- // TODO remove this when old extension loading mechanism is deprecated
- var re = ext.regex;
- if (!(re instanceof RegExp)) {
- re = new RegExp(re, 'g');
- }
- text = text.replace(re, ext.replace);
- }
- return text;
-});
-
+
+function deprecatedGetPhrasingContentSchema(context) {
+ external_wp_deprecated_default()('wp.blocks.getPhrasingContentSchema', {
+ since: '5.6',
+ alternative: 'wp.dom.getPhrasingContentSchema'
+ });
+ return (0,external_wp_dom_namespaceObject.getPhrasingContentSchema)(context);
+}
/**
- * These are all the transformations that occur *within* block-level
- * tags like paragraphs, headers, and list items.
+ * Converts an HTML string to known blocks.
+ *
+ * @param {Object} $1
+ * @param {string} $1.HTML The HTML to convert.
+ *
+ * @return {Array} A list of blocks.
*/
-showdown.subParser('spanGamut', function (text, options, globals) {
- 'use strict';
-
- text = globals.converter._dispatch('spanGamut.before', text, options, globals);
- text = showdown.subParser('codeSpans')(text, options, globals);
- text = showdown.subParser('escapeSpecialCharsWithinTagAttributes')(text, options, globals);
- text = showdown.subParser('encodeBackslashEscapes')(text, options, globals);
-
- // Process anchor and image tags. Images must come first,
- // because ![foo][f] looks like an anchor.
- text = showdown.subParser('images')(text, options, globals);
- text = showdown.subParser('anchors')(text, options, globals);
-
- // Make links out of things like `<http://example.com/>`
- // Must come after anchors, because you can use < and >
- // delimiters in inline links like [this](<url>).
- text = showdown.subParser('autoLinks')(text, options, globals);
- text = showdown.subParser('simplifiedAutoLinks')(text, options, globals);
- text = showdown.subParser('emoji')(text, options, globals);
- text = showdown.subParser('underline')(text, options, globals);
- text = showdown.subParser('italicsAndBold')(text, options, globals);
- text = showdown.subParser('strikethrough')(text, options, globals);
- text = showdown.subParser('ellipsis')(text, options, globals);
- // we need to hash HTML tags inside spans
- text = showdown.subParser('hashHTMLSpans')(text, options, globals);
+function rawHandler(_ref) {
+ let {
+ HTML = ''
+ } = _ref;
- // now we encode amps and angles
- text = showdown.subParser('encodeAmpsAndAngles')(text, options, globals);
+ // If we detect block delimiters, parse entirely as blocks.
+ if (HTML.indexOf('<!-- wp:') !== -1) {
+ return parser_parse(HTML);
+ } // An array of HTML strings and block objects. The blocks replace matched
+ // shortcodes.
- // Do hard breaks
- if (options.simpleLineBreaks) {
- // GFM style hard breaks
- // only add line breaks if the text does not contain a block (special case for lists)
- if (!/\n\n¨K/.test(text)) {
- text = text.replace(/\n+/g, '<br />\n');
- }
- } else {
- // Vanilla hard breaks
- text = text.replace(/ +\n/g, '<br />\n');
- }
- text = globals.converter._dispatch('spanGamut.after', text, options, globals);
- return text;
-});
-
-showdown.subParser('strikethrough', function (text, options, globals) {
- 'use strict';
+ const pieces = shortcode_converter(HTML);
+ const blockContentSchema = getBlockContentSchema();
+ return (0,external_lodash_namespaceObject.compact)((0,external_lodash_namespaceObject.flatMap)(pieces, piece => {
+ // Already a block from shortcode.
+ if (typeof piece !== 'string') {
+ return piece;
+ } // These filters are essential for some blocks to be able to transform
+ // from raw HTML. These filters move around some content or add
+ // additional tags, they do not remove any content.
- function parseInside (txt) {
- if (options.simplifiedAutoLink) {
- txt = showdown.subParser('simplifiedAutoLinks')(txt, options, globals);
- }
- return '<del>' + txt + '</del>';
- }
- if (options.strikethrough) {
- text = globals.converter._dispatch('strikethrough.before', text, options, globals);
- text = text.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g, function (wm, txt) { return parseInside(txt); });
- text = globals.converter._dispatch('strikethrough.after', text, options, globals);
- }
+ const filters = [// Needed to adjust invalid lists.
+ listReducer, // Needed to create more and nextpage blocks.
+ specialCommentConverter, // Needed to create media blocks.
+ figureContentReducer, // Needed to create the quote block, which cannot handle text
+ // without wrapper paragraphs.
+ blockquoteNormaliser];
+ piece = deepFilterHTML(piece, filters, blockContentSchema);
+ piece = normaliseBlocks(piece);
+ return htmlToBlocks(piece);
+ }));
+}
- return text;
-});
-
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/comment-remover.js
/**
- * Strips link definitions from text, stores the URLs and titles in
- * hash references.
- * Link defs are in the form: ^[id]: url "optional title"
+ * WordPress dependencies
*/
-showdown.subParser('stripLinkDefinitions', function (text, options, globals) {
- 'use strict';
- var regex = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,
- base64Regex = /^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;
+/**
+ * Looks for comments, and removes them.
+ *
+ * @param {Node} node The node to be processed.
+ * @return {void}
+ */
- // attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
- text += '¨0';
+function commentRemover(node) {
+ if (node.nodeType === node.COMMENT_NODE) {
+ (0,external_wp_dom_namespaceObject.remove)(node);
+ }
+}
- var replaceFunc = function (wholeMatch, linkId, url, width, height, blankLines, title) {
- linkId = linkId.toLowerCase();
- if (url.match(/^data:.+?\/.+?;base64,/)) {
- // remove newlines
- globals.gUrls[linkId] = url.replace(/\s/g, '');
- } else {
- globals.gUrls[linkId] = showdown.subParser('encodeAmpsAndAngles')(url, options, globals); // Link IDs are case-insensitive
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/is-inline-content.js
+/**
+ * External dependencies
+ */
- if (blankLines) {
- // Oops, found blank lines, so it's not a title.
- // Put back the parenthetical statement we stole.
- return blankLines + title;
+/**
+ * WordPress dependencies
+ */
- } else {
- if (title) {
- globals.gTitles[linkId] = title.replace(/"|'/g, '"');
- }
- if (options.parseImgDimensions && width && height) {
- globals.gDimensions[linkId] = {
- width: width,
- height: height
- };
- }
- }
- // Completely remove the definition from the text
- return '';
- };
- // first we try to find base64 link references
- text = text.replace(base64Regex, replaceFunc);
+/**
+ * Checks if the given node should be considered inline content, optionally
+ * depending on a context tag.
+ *
+ * @param {Node} node Node name.
+ * @param {string} contextTag Tag name.
+ *
+ * @return {boolean} True if the node is inline content, false if nohe.
+ */
- text = text.replace(regex, replaceFunc);
+function isInline(node, contextTag) {
+ if ((0,external_wp_dom_namespaceObject.isTextContent)(node)) {
+ return true;
+ }
- // attacklab: strip sentinel
- text = text.replace(/¨0/, '');
+ if (!contextTag) {
+ return false;
+ }
- return text;
-});
-
-showdown.subParser('tables', function (text, options, globals) {
- 'use strict';
+ const tag = node.nodeName.toLowerCase();
+ const inlineAllowedTagGroups = [['ul', 'li', 'ol'], ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']];
+ return inlineAllowedTagGroups.some(tagGroup => (0,external_lodash_namespaceObject.difference)([tag, contextTag], tagGroup).length === 0);
+}
- if (!options.tables) {
- return text;
- }
+function deepCheck(nodes, contextTag) {
+ return nodes.every(node => isInline(node, contextTag) && deepCheck(Array.from(node.children), contextTag));
+}
- var tableRgx = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,
- //singeColTblRgx = /^ {0,3}\|.+\|\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n(?: {0,3}\|.+\|\n)+(?:\n\n|¨0)/gm;
- singeColTblRgx = /^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;
+function isDoubleBR(node) {
+ return node.nodeName === 'BR' && node.previousSibling && node.previousSibling.nodeName === 'BR';
+}
- function parseStyles (sLine) {
- if (/^:[ \t]*--*$/.test(sLine)) {
- return ' style="text-align:left;"';
- } else if (/^--*[ \t]*:[ \t]*$/.test(sLine)) {
- return ' style="text-align:right;"';
- } else if (/^:[ \t]*--*[ \t]*:$/.test(sLine)) {
- return ' style="text-align:center;"';
- } else {
- return '';
- }
- }
+function isInlineContent(HTML, contextTag) {
+ const doc = document.implementation.createHTMLDocument('');
+ doc.body.innerHTML = HTML;
+ const nodes = Array.from(doc.body.children);
+ return !nodes.some(isDoubleBR) && deepCheck(nodes, contextTag);
+}
- function parseHeaders (header, style) {
- var id = '';
- header = header.trim();
- // support both tablesHeaderId and tableHeaderId due to error in documentation so we don't break backwards compatibility
- if (options.tablesHeaderId || options.tableHeaderId) {
- id = ' id="' + header.replace(/ /g, '_').toLowerCase() + '"';
- }
- header = showdown.subParser('spanGamut')(header, options, globals);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/phrasing-content-reducer.js
+/**
+ * External dependencies
+ */
- return '<th' + id + style + '>' + header + '</th>\n';
- }
+/**
+ * WordPress dependencies
+ */
- function parseCells (cell, style) {
- var subText = showdown.subParser('spanGamut')(cell, options, globals);
- return '<td' + style + '>' + subText + '</td>\n';
- }
- function buildTable (headers, cells) {
- var tb = '<table>\n<thead>\n<tr>\n',
- tblLgn = headers.length;
+function phrasingContentReducer(node, doc) {
+ // In jsdom-jscore, 'node.style' can be null.
+ // TODO: Explore fixing this by patching jsdom-jscore.
+ if (node.nodeName === 'SPAN' && node.style) {
+ const {
+ fontWeight,
+ fontStyle,
+ textDecorationLine,
+ textDecoration,
+ verticalAlign
+ } = node.style;
- for (var i = 0; i < tblLgn; ++i) {
- tb += headers[i];
+ if (fontWeight === 'bold' || fontWeight === '700') {
+ (0,external_wp_dom_namespaceObject.wrap)(doc.createElement('strong'), node);
}
- tb += '</tr>\n</thead>\n<tbody>\n';
- for (i = 0; i < cells.length; ++i) {
- tb += '<tr>\n';
- for (var ii = 0; ii < tblLgn; ++ii) {
- tb += cells[i][ii];
- }
- tb += '</tr>\n';
- }
- tb += '</tbody>\n</table>\n';
- return tb;
- }
+ if (fontStyle === 'italic') {
+ (0,external_wp_dom_namespaceObject.wrap)(doc.createElement('em'), node);
+ } // Some DOM implementations (Safari, JSDom) don't support
+ // style.textDecorationLine, so we check style.textDecoration as a
+ // fallback.
- function parseTable (rawTable) {
- var i, tableLines = rawTable.split('\n');
- for (i = 0; i < tableLines.length; ++i) {
- // strip wrong first and last column if wrapped tables are used
- if (/^ {0,3}\|/.test(tableLines[i])) {
- tableLines[i] = tableLines[i].replace(/^ {0,3}\|/, '');
- }
- if (/\|[ \t]*$/.test(tableLines[i])) {
- tableLines[i] = tableLines[i].replace(/\|[ \t]*$/, '');
- }
- // parse code spans first, but we only support one line code spans
- tableLines[i] = showdown.subParser('codeSpans')(tableLines[i], options, globals);
+ if (textDecorationLine === 'line-through' || (0,external_lodash_namespaceObject.includes)(textDecoration, 'line-through')) {
+ (0,external_wp_dom_namespaceObject.wrap)(doc.createElement('s'), node);
}
- var rawHeaders = tableLines[0].split('|').map(function (s) { return s.trim();}),
- rawStyles = tableLines[1].split('|').map(function (s) { return s.trim();}),
- rawCells = [],
- headers = [],
- styles = [],
- cells = [];
+ if (verticalAlign === 'super') {
+ (0,external_wp_dom_namespaceObject.wrap)(doc.createElement('sup'), node);
+ } else if (verticalAlign === 'sub') {
+ (0,external_wp_dom_namespaceObject.wrap)(doc.createElement('sub'), node);
+ }
+ } else if (node.nodeName === 'B') {
+ node = (0,external_wp_dom_namespaceObject.replaceTag)(node, 'strong');
+ } else if (node.nodeName === 'I') {
+ node = (0,external_wp_dom_namespaceObject.replaceTag)(node, 'em');
+ } else if (node.nodeName === 'A') {
+ // In jsdom-jscore, 'node.target' can be null.
+ // TODO: Explore fixing this by patching jsdom-jscore.
+ if (node.target && node.target.toLowerCase() === '_blank') {
+ node.rel = 'noreferrer noopener';
+ } else {
+ node.removeAttribute('target');
+ node.removeAttribute('rel');
+ } // Saves anchor elements name attribute as id
- tableLines.shift();
- tableLines.shift();
- for (i = 0; i < tableLines.length; ++i) {
- if (tableLines[i].trim() === '') {
- continue;
- }
- rawCells.push(
- tableLines[i]
- .split('|')
- .map(function (s) {
- return s.trim();
- })
- );
- }
+ if (node.name && !node.id) {
+ node.id = node.name;
+ } // Keeps id only if there is an internal link pointing to it
- if (rawHeaders.length < rawStyles.length) {
- return rawTable;
- }
- for (i = 0; i < rawStyles.length; ++i) {
- styles.push(parseStyles(rawStyles[i]));
+ if (node.id && !node.ownerDocument.querySelector(`[href="#${node.id}"]`)) {
+ node.removeAttribute('id');
}
+ }
+}
- for (i = 0; i < rawHeaders.length; ++i) {
- if (showdown.helper.isUndefined(styles[i])) {
- styles[i] = '';
- }
- headers.push(parseHeaders(rawHeaders[i], styles[i]));
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/head-remover.js
+function headRemover(node) {
+ if (node.nodeName !== 'SCRIPT' && node.nodeName !== 'NOSCRIPT' && node.nodeName !== 'TEMPLATE' && node.nodeName !== 'STYLE') {
+ return;
+ }
- for (i = 0; i < rawCells.length; ++i) {
- var row = [];
- for (var ii = 0; ii < headers.length; ++ii) {
- if (showdown.helper.isUndefined(rawCells[i][ii])) {
+ node.parentNode.removeChild(node);
+}
- }
- row.push(parseCells(rawCells[i][ii], styles[ii]));
- }
- cells.push(row);
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/ms-list-converter.js
+/**
+ * Browser dependencies
+ */
+const {
+ parseInt: ms_list_converter_parseInt
+} = window;
- return buildTable(headers, cells);
- }
+function ms_list_converter_isList(node) {
+ return node.nodeName === 'OL' || node.nodeName === 'UL';
+}
- text = globals.converter._dispatch('tables.before', text, options, globals);
+function msListConverter(node, doc) {
+ if (node.nodeName !== 'P') {
+ return;
+ }
- // find escaped pipe characters
- text = text.replace(/\\(\|)/g, showdown.helper.escapeCharactersCallback);
+ const style = node.getAttribute('style');
- // parse multi column tables
- text = text.replace(tableRgx, parseTable);
+ if (!style) {
+ return;
+ } // Quick check.
- // parse one column tables
- text = text.replace(singeColTblRgx, parseTable);
- text = globals.converter._dispatch('tables.after', text, options, globals);
+ if (style.indexOf('mso-list') === -1) {
+ return;
+ }
- return text;
-});
-
-showdown.subParser('underline', function (text, options, globals) {
- 'use strict';
+ const matches = /mso-list\s*:[^;]+level([0-9]+)/i.exec(style);
- if (!options.underline) {
- return text;
+ if (!matches) {
+ return;
}
- text = globals.converter._dispatch('underline.before', text, options, globals);
+ let level = ms_list_converter_parseInt(matches[1], 10) - 1 || 0;
+ const prevNode = node.previousElementSibling; // Add new list if no previous.
- if (options.literalMidWordUnderscores) {
- text = text.replace(/\b___(\S[\s\S]*?)___\b/g, function (wm, txt) {
- return '<u>' + txt + '</u>';
- });
- text = text.replace(/\b__(\S[\s\S]*?)__\b/g, function (wm, txt) {
- return '<u>' + txt + '</u>';
- });
- } else {
- text = text.replace(/___(\S[\s\S]*?)___/g, function (wm, m) {
- return (/\S$/.test(m)) ? '<u>' + m + '</u>' : wm;
- });
- text = text.replace(/__(\S[\s\S]*?)__/g, function (wm, m) {
- return (/\S$/.test(m)) ? '<u>' + m + '</u>' : wm;
- });
- }
+ if (!prevNode || !ms_list_converter_isList(prevNode)) {
+ // See https://html.spec.whatwg.org/multipage/grouping-content.html#attr-ol-type.
+ const type = node.textContent.trim().slice(0, 1);
+ const isNumeric = /[1iIaA]/.test(type);
+ const newListNode = doc.createElement(isNumeric ? 'ol' : 'ul');
- // escape remaining underscores to prevent them being parsed by italic and bold
- text = text.replace(/(_)/g, showdown.helper.escapeCharactersCallback);
+ if (isNumeric) {
+ newListNode.setAttribute('type', type);
+ }
- text = globals.converter._dispatch('underline.after', text, options, globals);
+ node.parentNode.insertBefore(newListNode, node);
+ }
- return text;
-});
-
-/**
- * Swap back in all the special characters we've hidden.
- */
-showdown.subParser('unescapeSpecialChars', function (text, options, globals) {
- 'use strict';
- text = globals.converter._dispatch('unescapeSpecialChars.before', text, options, globals);
+ const listNode = node.previousElementSibling;
+ const listType = listNode.nodeName;
+ const listItem = doc.createElement('li');
+ let receivingNode = listNode; // Remove the first span with list info.
- text = text.replace(/¨E(\d+)E/g, function (wholeMatch, m1) {
- var charCodeToReplace = parseInt(m1);
- return String.fromCharCode(charCodeToReplace);
- });
+ node.removeChild(node.firstElementChild); // Add content.
- text = globals.converter._dispatch('unescapeSpecialChars.after', text, options, globals);
- return text;
-});
-
-showdown.subParser('makeMarkdown.blockquote', function (node, globals) {
- 'use strict';
+ while (node.firstChild) {
+ listItem.appendChild(node.firstChild);
+ } // Change pointer depending on indentation level.
- var txt = '';
- if (node.hasChildNodes()) {
- var children = node.childNodes,
- childrenLength = children.length;
- for (var i = 0; i < childrenLength; ++i) {
- var innerTxt = showdown.subParser('makeMarkdown.node')(children[i], globals);
+ while (level--) {
+ receivingNode = receivingNode.lastElementChild || receivingNode; // If it's a list, move pointer to the last item.
- if (innerTxt === '') {
- continue;
- }
- txt += innerTxt;
+ if (ms_list_converter_isList(receivingNode)) {
+ receivingNode = receivingNode.lastElementChild || receivingNode;
}
- }
- // cleanup
- txt = txt.trim();
- txt = '> ' + txt.split('\n').join('\n> ');
- return txt;
-});
-
-showdown.subParser('makeMarkdown.codeBlock', function (node, globals) {
- 'use strict';
-
- var lang = node.getAttribute('language'),
- num = node.getAttribute('precodenum');
- return '```' + lang + '\n' + globals.preList[num] + '\n```';
-});
-
-showdown.subParser('makeMarkdown.codeSpan', function (node) {
- 'use strict';
+ } // Make sure we append to a list.
- return '`' + node.innerHTML + '`';
-});
-
-showdown.subParser('makeMarkdown.emphasis', function (node, globals) {
- 'use strict';
- var txt = '';
- if (node.hasChildNodes()) {
- txt += '*';
- var children = node.childNodes,
- childrenLength = children.length;
- for (var i = 0; i < childrenLength; ++i) {
- txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
- }
- txt += '*';
- }
- return txt;
-});
-
-showdown.subParser('makeMarkdown.header', function (node, globals, headerLevel) {
- 'use strict';
+ if (!ms_list_converter_isList(receivingNode)) {
+ receivingNode = receivingNode.appendChild(doc.createElement(listType));
+ } // Append the list item to the list.
- var headerMark = new Array(headerLevel + 1).join('#'),
- txt = '';
- if (node.hasChildNodes()) {
- txt = headerMark + ' ';
- var children = node.childNodes,
- childrenLength = children.length;
+ receivingNode.appendChild(listItem); // Remove the wrapper paragraph.
- for (var i = 0; i < childrenLength; ++i) {
- txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
- }
- }
- return txt;
-});
-
-showdown.subParser('makeMarkdown.hr', function () {
- 'use strict';
+ node.parentNode.removeChild(node);
+}
- return '---';
-});
-
-showdown.subParser('makeMarkdown.image', function (node) {
- 'use strict';
+;// CONCATENATED MODULE: external ["wp","blob"]
+var external_wp_blob_namespaceObject = window["wp"]["blob"];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/image-corrector.js
+/**
+ * WordPress dependencies
+ */
- var txt = '';
- if (node.hasAttribute('src')) {
- txt += ' + '>';
- if (node.hasAttribute('width') && node.hasAttribute('height')) {
- txt += ' =' + node.getAttribute('width') + 'x' + node.getAttribute('height');
- }
+/**
+ * Browser dependencies
+ */
- if (node.hasAttribute('title')) {
- txt += ' "' + node.getAttribute('title') + '"';
- }
- txt += ')';
+const {
+ atob,
+ File
+} = window;
+function imageCorrector(node) {
+ if (node.nodeName !== 'IMG') {
+ return;
}
- return txt;
-});
-
-showdown.subParser('makeMarkdown.links', function (node, globals) {
- 'use strict';
- var txt = '';
- if (node.hasChildNodes() && node.hasAttribute('href')) {
- var children = node.childNodes,
- childrenLength = children.length;
- txt = '[';
- for (var i = 0; i < childrenLength; ++i) {
- txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
- }
- txt += '](';
- txt += '<' + node.getAttribute('href') + '>';
- if (node.hasAttribute('title')) {
- txt += ' "' + node.getAttribute('title') + '"';
- }
- txt += ')';
- }
- return txt;
-});
-
-showdown.subParser('makeMarkdown.list', function (node, globals, type) {
- 'use strict';
+ if (node.src.indexOf('file:') === 0) {
+ node.src = '';
+ } // This piece cannot be tested outside a browser env.
- var txt = '';
- if (!node.hasChildNodes()) {
- return '';
- }
- var listItems = node.childNodes,
- listItemsLenght = listItems.length,
- listNum = node.getAttribute('start') || 1;
- for (var i = 0; i < listItemsLenght; ++i) {
- if (typeof listItems[i].tagName === 'undefined' || listItems[i].tagName.toLowerCase() !== 'li') {
- continue;
+ if (node.src.indexOf('data:') === 0) {
+ const [properties, data] = node.src.split(',');
+ const [type] = properties.slice(5).split(';');
+
+ if (!data || !type) {
+ node.src = '';
+ return;
}
- // define the bullet to use in list
- var bullet = '';
- if (type === 'ol') {
- bullet = listNum.toString() + '. ';
- } else {
- bullet = '- ';
+ let decoded; // Can throw DOMException!
+
+ try {
+ decoded = atob(data);
+ } catch (e) {
+ node.src = '';
+ return;
}
- // parse list item
- txt += bullet + showdown.subParser('makeMarkdown.listItem')(listItems[i], globals);
- ++listNum;
- }
+ const uint8Array = new Uint8Array(decoded.length);
- // add comment at the end to prevent consecutive lists to be parsed as one
- txt += '\n<!-- -->\n';
- return txt.trim();
-});
-
-showdown.subParser('makeMarkdown.listItem', function (node, globals) {
- 'use strict';
+ for (let i = 0; i < uint8Array.length; i++) {
+ uint8Array[i] = decoded.charCodeAt(i);
+ }
- var listItemTxt = '';
+ const name = type.replace('/', '.');
+ const file = new File([uint8Array], name, {
+ type
+ });
+ node.src = (0,external_wp_blob_namespaceObject.createBlobURL)(file);
+ } // Remove trackers and hardly visible images.
- var children = node.childNodes,
- childrenLenght = children.length;
- for (var i = 0; i < childrenLenght; ++i) {
- listItemTxt += showdown.subParser('makeMarkdown.node')(children[i], globals);
- }
- // if it's only one liner, we need to add a newline at the end
- if (!/\n$/.test(listItemTxt)) {
- listItemTxt += '\n';
- } else {
- // it's multiparagraph, so we need to indent
- listItemTxt = listItemTxt
- .split('\n')
- .join('\n ')
- .replace(/^ {4}$/gm, '')
- .replace(/\n\n+/g, '\n\n');
+ if (node.height === 1 || node.width === 1) {
+ node.parentNode.removeChild(node);
}
+}
- return listItemTxt;
-});
-
+// EXTERNAL MODULE: ./node_modules/showdown/dist/showdown.js
+var showdown = __webpack_require__(7308);
+var showdown_default = /*#__PURE__*/__webpack_require__.n(showdown);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/markdown-converter.js
+/**
+ * External dependencies
+ */
+ // Reuse the same showdown converter.
+const converter = new (showdown_default()).Converter({
+ noHeaderId: true,
+ tables: true,
+ literalMidWordUnderscores: true,
+ omitExtraWLInCodeBlocks: true,
+ simpleLineBreaks: true,
+ strikethrough: true
+});
+/**
+ * Corrects the Slack Markdown variant of the code block.
+ * If uncorrected, it will be converted to inline code.
+ *
+ * @see https://get.slack.help/hc/en-us/articles/202288908-how-can-i-add-formatting-to-my-messages-#code-blocks
+ *
+ * @param {string} text The potential Markdown text to correct.
+ *
+ * @return {string} The corrected Markdown.
+ */
-showdown.subParser('makeMarkdown.node', function (node, globals, spansOnly) {
- 'use strict';
+function slackMarkdownVariantCorrector(text) {
+ return text.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/, (match, p1, p2, p3) => `${p1}\n${p2}\n${p3}`);
+}
+/**
+ * Converts a piece of text into HTML based on any Markdown present.
+ * Also decodes any encoded HTML.
+ *
+ * @param {string} text The plain text to convert.
+ *
+ * @return {string} HTML.
+ */
- spansOnly = spansOnly || false;
- var txt = '';
+function markdownConverter(text) {
+ return converter.makeHtml(slackMarkdownVariantCorrector(text));
+}
- // edge case of text without wrapper paragraph
- if (node.nodeType === 3) {
- return showdown.subParser('makeMarkdown.txt')(node, globals);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/iframe-remover.js
+/**
+ * Removes iframes.
+ *
+ * @param {Node} node The node to check.
+ *
+ * @return {void}
+ */
+function iframeRemover(node) {
+ if (node.nodeName === 'IFRAME') {
+ const text = node.ownerDocument.createTextNode(node.src);
+ node.parentNode.replaceChild(text, node);
}
+}
- // HTML comment
- if (node.nodeType === 8) {
- return '<!--' + node.data + '-->\n\n';
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/google-docs-uid-remover.js
+/**
+ * WordPress dependencies
+ */
- // process only node elements
- if (node.nodeType !== 1) {
- return '';
+function googleDocsUIdRemover(node) {
+ if (!node.id || node.id.indexOf('docs-internal-guid-') !== 0) {
+ return;
}
- var tagName = node.tagName.toLowerCase();
+ (0,external_wp_dom_namespaceObject.unwrap)(node);
+}
- switch (tagName) {
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/html-formatting-remover.js
+/**
+ * Internal dependencies
+ */
- //
- // BLOCKS
- //
- case 'h1':
- if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 1) + '\n\n'; }
- break;
- case 'h2':
- if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 2) + '\n\n'; }
- break;
- case 'h3':
- if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 3) + '\n\n'; }
- break;
- case 'h4':
- if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 4) + '\n\n'; }
- break;
- case 'h5':
- if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 5) + '\n\n'; }
- break;
- case 'h6':
- if (!spansOnly) { txt = showdown.subParser('makeMarkdown.header')(node, globals, 6) + '\n\n'; }
- break;
- case 'p':
- if (!spansOnly) { txt = showdown.subParser('makeMarkdown.paragraph')(node, globals) + '\n\n'; }
- break;
+function isFormattingSpace(character) {
+ return character === ' ' || character === '\r' || character === '\n' || character === '\t';
+}
+/**
+ * Removes spacing that formats HTML.
+ *
+ * @see https://www.w3.org/TR/css-text-3/#white-space-processing
+ *
+ * @param {Node} node The node to be processed.
+ * @return {void}
+ */
- case 'blockquote':
- if (!spansOnly) { txt = showdown.subParser('makeMarkdown.blockquote')(node, globals) + '\n\n'; }
- break;
- case 'hr':
- if (!spansOnly) { txt = showdown.subParser('makeMarkdown.hr')(node, globals) + '\n\n'; }
- break;
+function htmlFormattingRemover(node) {
+ if (node.nodeType !== node.TEXT_NODE) {
+ return;
+ } // Ignore pre content. Note that this does not use Element#closest due to
+ // a combination of (a) node may not be Element and (b) node.parentElement
+ // does not have full support in all browsers (Internet Exporer).
+ //
+ // See: https://developer.mozilla.org/en-US/docs/Web/API/Node/parentElement#Browser_compatibility
- case 'ol':
- if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ol') + '\n\n'; }
- break;
+ /** @type {Node?} */
- case 'ul':
- if (!spansOnly) { txt = showdown.subParser('makeMarkdown.list')(node, globals, 'ul') + '\n\n'; }
- break;
- case 'precode':
- if (!spansOnly) { txt = showdown.subParser('makeMarkdown.codeBlock')(node, globals) + '\n\n'; }
- break;
+ let parent = node;
- case 'pre':
- if (!spansOnly) { txt = showdown.subParser('makeMarkdown.pre')(node, globals) + '\n\n'; }
- break;
+ while (parent = parent.parentNode) {
+ if (parent.nodeType === parent.ELEMENT_NODE && parent.nodeName === 'PRE') {
+ return;
+ }
+ } // First, replace any sequence of HTML formatting space with a single space.
- case 'table':
- if (!spansOnly) { txt = showdown.subParser('makeMarkdown.table')(node, globals) + '\n\n'; }
- break;
- //
- // SPANS
- //
- case 'code':
- txt = showdown.subParser('makeMarkdown.codeSpan')(node, globals);
- break;
+ let newData = node.data.replace(/[ \r\n\t]+/g, ' '); // Remove the leading space if the text element is at the start of a block,
+ // is preceded by a line break element, or has a space in the previous
+ // node.
- case 'em':
- case 'i':
- txt = showdown.subParser('makeMarkdown.emphasis')(node, globals);
- break;
+ if (newData[0] === ' ') {
+ const previousSibling = getSibling(node, 'previous');
- case 'strong':
- case 'b':
- txt = showdown.subParser('makeMarkdown.strong')(node, globals);
- break;
+ if (!previousSibling || previousSibling.nodeName === 'BR' || previousSibling.textContent.slice(-1) === ' ') {
+ newData = newData.slice(1);
+ }
+ } // Remove the trailing space if the text element is at the end of a block,
+ // is succeded by a line break element, or has a space in the next text
+ // node.
- case 'del':
- txt = showdown.subParser('makeMarkdown.strikethrough')(node, globals);
- break;
- case 'a':
- txt = showdown.subParser('makeMarkdown.links')(node, globals);
- break;
+ if (newData[newData.length - 1] === ' ') {
+ const nextSibling = getSibling(node, 'next');
- case 'img':
- txt = showdown.subParser('makeMarkdown.image')(node, globals);
- break;
+ if (!nextSibling || nextSibling.nodeName === 'BR' || nextSibling.nodeType === nextSibling.TEXT_NODE && isFormattingSpace(nextSibling.textContent[0])) {
+ newData = newData.slice(0, -1);
+ }
+ } // If there's no data left, remove the node, so `previousSibling` stays
+ // accurate. Otherwise, update the node data.
- default:
- txt = node.outerHTML + '\n\n';
+
+ if (!newData) {
+ node.parentNode.removeChild(node);
+ } else {
+ node.data = newData;
}
+}
- // common normalization
- // TODO eventually
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/br-remover.js
+/**
+ * Internal dependencies
+ */
- return txt;
-});
-
-showdown.subParser('makeMarkdown.paragraph', function (node, globals) {
- 'use strict';
+/**
+ * Removes trailing br elements from text-level content.
+ *
+ * @param {Element} node Node to check.
+ */
- var txt = '';
- if (node.hasChildNodes()) {
- var children = node.childNodes,
- childrenLength = children.length;
- for (var i = 0; i < childrenLength; ++i) {
- txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
- }
+function brRemover(node) {
+ if (node.nodeName !== 'BR') {
+ return;
}
- // some text normalization
- txt = txt.trim();
-
- return txt;
-});
-
-showdown.subParser('makeMarkdown.pre', function (node, globals) {
- 'use strict';
+ if (getSibling(node, 'next')) {
+ return;
+ }
- var num = node.getAttribute('prenum');
- return '<pre>' + globals.preList[num] + '</pre>';
-});
-
-showdown.subParser('makeMarkdown.strikethrough', function (node, globals) {
- 'use strict';
+ node.parentNode.removeChild(node);
+}
- var txt = '';
- if (node.hasChildNodes()) {
- txt += '~~';
- var children = node.childNodes,
- childrenLength = children.length;
- for (var i = 0; i < childrenLength; ++i) {
- txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
- }
- txt += '~~';
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/empty-paragraph-remover.js
+/**
+ * Removes empty paragraph elements.
+ *
+ * @param {Element} node Node to check.
+ */
+function emptyParagraphRemover(node) {
+ if (node.nodeName !== 'P') {
+ return;
}
- return txt;
-});
-
-showdown.subParser('makeMarkdown.strong', function (node, globals) {
- 'use strict';
- var txt = '';
if (node.hasChildNodes()) {
- txt += '**';
- var children = node.childNodes,
- childrenLength = children.length;
- for (var i = 0; i < childrenLength; ++i) {
- txt += showdown.subParser('makeMarkdown.node')(children[i], globals);
- }
- txt += '**';
+ return;
}
- return txt;
-});
-
-showdown.subParser('makeMarkdown.table', function (node, globals) {
- 'use strict';
- var txt = '',
- tableArray = [[], []],
- headings = node.querySelectorAll('thead>tr>th'),
- rows = node.querySelectorAll('tbody>tr'),
- i, ii;
- for (i = 0; i < headings.length; ++i) {
- var headContent = showdown.subParser('makeMarkdown.tableCell')(headings[i], globals),
- allign = '---';
+ node.parentNode.removeChild(node);
+}
- if (headings[i].hasAttribute('style')) {
- var style = headings[i].getAttribute('style').toLowerCase().replace(/\s/g, '');
- switch (style) {
- case 'text-align:left;':
- allign = ':---';
- break;
- case 'text-align:right;':
- allign = '---:';
- break;
- case 'text-align:center;':
- allign = ':---:';
- break;
- }
- }
- tableArray[0][i] = headContent.trim();
- tableArray[1][i] = allign;
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/paste-handler.js
+/**
+ * External dependencies
+ */
- for (i = 0; i < rows.length; ++i) {
- var r = tableArray.push([]) - 1,
- cols = rows[i].getElementsByTagName('td');
+/**
+ * WordPress dependencies
+ */
- for (ii = 0; ii < headings.length; ++ii) {
- var cellContent = ' ';
- if (typeof cols[ii] !== 'undefined') {
- cellContent = showdown.subParser('makeMarkdown.tableCell')(cols[ii], globals);
- }
- tableArray[r].push(cellContent);
- }
- }
- var cellSpacesCount = 3;
- for (i = 0; i < tableArray.length; ++i) {
- for (ii = 0; ii < tableArray[i].length; ++ii) {
- var strLen = tableArray[i][ii].length;
- if (strLen > cellSpacesCount) {
- cellSpacesCount = strLen;
- }
- }
- }
+/**
+ * Internal dependencies
+ */
- for (i = 0; i < tableArray.length; ++i) {
- for (ii = 0; ii < tableArray[i].length; ++ii) {
- if (i === 1) {
- if (tableArray[i][ii].slice(-1) === ':') {
- tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii].slice(-1), cellSpacesCount - 1, '-') + ':';
- } else {
- tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount, '-');
- }
- } else {
- tableArray[i][ii] = showdown.helper.padEnd(tableArray[i][ii], cellSpacesCount);
- }
- }
- txt += '| ' + tableArray[i].join(' | ') + ' |\n';
- }
- return txt.trim();
-});
-
-showdown.subParser('makeMarkdown.tableCell', function (node, globals) {
- 'use strict';
- var txt = '';
- if (!node.hasChildNodes()) {
- return '';
- }
- var children = node.childNodes,
- childrenLength = children.length;
- for (var i = 0; i < childrenLength; ++i) {
- txt += showdown.subParser('makeMarkdown.node')(children[i], globals, true);
- }
- return txt.trim();
-});
-
-showdown.subParser('makeMarkdown.txt', function (node) {
- 'use strict';
- var txt = node.nodeValue;
- // multiple spaces are collapsed
- txt = txt.replace(/ +/g, ' ');
- // replace the custom ¨NBSP; with a space
- txt = txt.replace(/¨NBSP;/g, ' ');
- // ", <, > and & should replace escaped html entities
- txt = showdown.helper.unescapeHTMLEntities(txt);
- // escape markdown magic characters
- // emphasis, strong and strikethrough - can appear everywhere
- // we also escape pipe (|) because of tables
- // and escape ` because of code blocks and spans
- txt = txt.replace(/([*_~|`])/g, '\\$1');
- // escape > because of blockquotes
- txt = txt.replace(/^(\s*)>/g, '\\$1>');
- // hash character, only troublesome at the beginning of a line because of headers
- txt = txt.replace(/^#/gm, '\\#');
- // horizontal rules
- txt = txt.replace(/^(\s*)([-=]{3,})(\s*)$/, '$1\\$2$3');
- // dot, because of ordered lists, only troublesome at the beginning of a line when preceded by an integer
- txt = txt.replace(/^( {0,3}\d+)\./gm, '$1\\.');
- // +, * and -, at the beginning of a line becomes a list, so we need to escape them also (asterisk was already escaped)
- txt = txt.replace(/^( {0,3})([+-])/gm, '$1\\$2');
- // images and links, ] followed by ( is problematic, so we escape it
- txt = txt.replace(/]([\s]*)\(/g, '\\]$1\\(');
- // reference URIs must also be escaped
- txt = txt.replace(/^ {0,3}\[([\S \t]*?)]:/gm, '\\[$1]:');
- return txt;
-});
-
-var root = this;
-// AMD Loader
-if (true) {
- !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
- 'use strict';
- return showdown;
- }).call(exports, __webpack_require__, exports, module),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
-// CommonJS/nodeJS Loader
-} else {}
-}).call(this);
-/***/ }),
-/***/ "NMb1":
-/***/ (function(module, exports) {
+/**
+ * Browser dependencies
+ */
-(function() { module.exports = window["wp"]["deprecated"]; }());
+const {
+ console: paste_handler_console
+} = window;
+/**
+ * Filters HTML to only contain phrasing content.
+ *
+ * @param {string} HTML The HTML to filter.
+ * @param {boolean} preserveWhiteSpace Whether or not to preserve consequent white space.
+ *
+ * @return {string} HTML only containing phrasing content.
+ */
-/***/ }),
+function filterInlineHTML(HTML, preserveWhiteSpace) {
+ HTML = deepFilterHTML(HTML, [googleDocsUIdRemover, phrasingContentReducer, commentRemover]);
+ HTML = (0,external_wp_dom_namespaceObject.removeInvalidHTML)(HTML, (0,external_wp_dom_namespaceObject.getPhrasingContentSchema)('paste'), {
+ inline: true
+ });
-/***/ "SVSp":
-/***/ (function(module, exports) {
+ if (!preserveWhiteSpace) {
+ HTML = deepFilterHTML(HTML, [htmlFormattingRemover, brRemover]);
+ } // Allows us to ask for this information when we get a report.
-(function() { module.exports = window["wp"]["shortcode"]; }());
-/***/ }),
+ paste_handler_console.log('Processed inline HTML:\n\n', HTML);
+ return HTML;
+}
+/**
+ * Converts an HTML string to known blocks. Strips everything else.
+ *
+ * @param {Object} options
+ * @param {string} [options.HTML] The HTML to convert.
+ * @param {string} [options.plainText] Plain text version.
+ * @param {string} [options.mode] Handle content as blocks or inline content.
+ * * 'AUTO': Decide based on the content passed.
+ * * 'INLINE': Always handle as inline content, and return string.
+ * * 'BLOCKS': Always handle as blocks, and return array of blocks.
+ * @param {Array} [options.tagName] The tag into which content will be inserted.
+ * @param {boolean} [options.preserveWhiteSpace] Whether or not to preserve consequent white space.
+ *
+ * @return {Array|string} A list of blocks or a string, depending on `handlerMode`.
+ */
-/***/ "UuzZ":
-/***/ (function(module, exports) {
-(function() { module.exports = window["wp"]["autop"]; }());
+function pasteHandler(_ref) {
+ let {
+ HTML = '',
+ plainText = '',
+ mode = 'AUTO',
+ tagName,
+ preserveWhiteSpace
+ } = _ref;
+ // First of all, strip any meta tags.
+ HTML = HTML.replace(/<meta[^>]+>/g, ''); // Strip Windows markers.
-/***/ }),
+ HTML = HTML.replace(/^\s*<html[^>]*>\s*<body[^>]*>(?:\s*<!--\s*StartFragment\s*-->)?/i, '');
+ HTML = HTML.replace(/(?:<!--\s*EndFragment\s*-->\s*)?<\/body>\s*<\/html>\s*$/i, ''); // If we detect block delimiters in HTML, parse entirely as blocks.
-/***/ "YLtl":
-/***/ (function(module, exports) {
+ if (mode !== 'INLINE') {
+ // Check plain text if there is no HTML.
+ const content = HTML ? HTML : plainText;
-(function() { module.exports = window["lodash"]; }());
+ if (content.indexOf('<!-- wp:') !== -1) {
+ return parser_parse(content);
+ }
+ } // Normalize unicode to use composed characters.
+ // This is unsupported in IE 11 but it's a nice-to-have feature, not mandatory.
+ // Not normalizing the content will only affect older browsers and won't
+ // entirely break the app.
+ // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize
+ // See: https://core.trac.wordpress.org/ticket/30130
+ // See: https://github.com/WordPress/gutenberg/pull/6983#pullrequestreview-125151075
-/***/ }),
-/***/ "abaT":
-/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) {
+ if (String.prototype.normalize) {
+ HTML = HTML.normalize();
+ } // Parse Markdown (and encoded HTML) if:
+ // * There is a plain text version.
+ // * There is no HTML version, or it has no formatting.
-"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<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])});
+ if (plainText && (!HTML || isPlain(HTML))) {
+ HTML = plainText; // The markdown converter (Showdown) trims whitespace.
-/***/ }),
+ if (!/^\s+$/.test(plainText)) {
+ HTML = markdownConverter(HTML);
+ } // Switch to inline mode if:
+ // * The current mode is AUTO.
+ // * The original plain text had no line breaks.
+ // * The original plain text was not an HTML paragraph.
+ // * The converted text is just a paragraph.
-/***/ "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<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.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()})};
+ if (mode === 'AUTO' && plainText.indexOf('\n') === -1 && plainText.indexOf('<p>') !== 0 && HTML.indexOf('<p>') === 0) {
+ mode = 'INLINE';
+ }
+ }
+ if (mode === 'INLINE') {
+ return filterInlineHTML(HTML, preserveWhiteSpace);
+ } // An array of HTML strings and block objects. The blocks replace matched
+ // shortcodes.
-/***/ }),
-/***/ "g56x":
-/***/ (function(module, exports) {
+ const pieces = shortcode_converter(HTML); // The call to shortcodeConverter will always return more than one element
+ // if shortcodes are matched. The reason is when shortcodes are matched
+ // empty HTML strings are included.
-(function() { module.exports = window["wp"]["hooks"]; }());
+ const hasShortcodes = pieces.length > 1;
-/***/ }),
+ if (mode === 'AUTO' && !hasShortcodes && isInlineContent(HTML, tagName)) {
+ return filterInlineHTML(HTML, preserveWhiteSpace);
+ }
-/***/ "l3Sj":
-/***/ (function(module, exports) {
+ const phrasingContentSchema = (0,external_wp_dom_namespaceObject.getPhrasingContentSchema)('paste');
+ const blockContentSchema = getBlockContentSchema('paste');
+ const blocks = (0,external_lodash_namespaceObject.compact)((0,external_lodash_namespaceObject.flatMap)(pieces, piece => {
+ // Already a block from shortcode.
+ if (typeof piece !== 'string') {
+ return piece;
+ }
-(function() { module.exports = window["wp"]["i18n"]; }());
+ const filters = [googleDocsUIdRemover, msListConverter, headRemover, listReducer, imageCorrector, phrasingContentReducer, specialCommentConverter, commentRemover, iframeRemover, figureContentReducer, blockquoteNormaliser];
+ const schema = { ...blockContentSchema,
+ // Keep top-level phrasing content, normalised by `normaliseBlocks`.
+ ...phrasingContentSchema
+ };
+ piece = deepFilterHTML(piece, filters, blockContentSchema);
+ piece = (0,external_wp_dom_namespaceObject.removeInvalidHTML)(piece, schema);
+ piece = normaliseBlocks(piece);
+ piece = deepFilterHTML(piece, [htmlFormattingRemover, brRemover, emptyParagraphRemover], blockContentSchema); // Allows us to ask for this information when we get a report.
-/***/ }),
+ paste_handler_console.log('Processed HTML piece:\n\n', piece);
+ return htmlToBlocks(piece);
+ })); // If we're allowed to return inline content, and there is only one
+ // inlineable block, and the original plain text content does not have any
+ // line breaks, then treat it as inline paste.
-/***/ "ouCq":
-/***/ (function(module, exports) {
+ if (mode === 'AUTO' && blocks.length === 1 && registration_hasBlockSupport(blocks[0].name, '__unstablePasteTextInline', false)) {
+ // Don't catch line breaks at the start or end.
+ const trimmedPlainText = plainText.replace(/^[\n]+|[\n]+$/g, '');
-(function() { module.exports = window["wp"]["blockSerializationDefaultParser"]; }());
+ if (trimmedPlainText !== '' && trimmedPlainText.indexOf('\n') === -1) {
+ return (0,external_wp_dom_namespaceObject.removeInvalidHTML)(getBlockInnerHTML(blocks[0]), phrasingContentSchema);
+ }
+ }
-/***/ }),
+ return blocks;
+}
-/***/ "pPDe":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/categories.js
+/**
+ * WordPress dependencies
+ */
-"use strict";
+/**
+ * Internal dependencies
+ */
-var LEAF_KEY, hasWeakMap;
+/** @typedef {import('../store/reducer').WPBlockCategory} WPBlockCategory */
/**
- * Arbitrary value used as key for referencing cache object in WeakMap tree.
+ * Returns all the block categories.
*
- * @type {Object}
+ * @return {WPBlockCategory[]} Block categories.
*/
-LEAF_KEY = {};
+function categories_getCategories() {
+ return (0,external_wp_data_namespaceObject.select)(store).getCategories();
+}
/**
- * Whether environment supports WeakMap.
+ * Sets the block categories.
*
- * @type {boolean}
+ * @param {WPBlockCategory[]} categories Block categories.
*/
-hasWeakMap = typeof WeakMap !== 'undefined';
+function categories_setCategories(categories) {
+ (0,external_wp_data_namespaceObject.dispatch)(store).setCategories(categories);
+}
/**
- * Returns the first argument as the sole entry in an array.
- *
- * @param {*} value Value to return.
+ * Updates a category.
*
- * @return {Array} Value returned as entry in array.
+ * @param {string} slug Block category slug.
+ * @param {WPBlockCategory} category Object containing the category properties
+ * that should be updated.
*/
-function arrayOf( value ) {
- return [ value ];
+
+function categories_updateCategory(slug, category) {
+ (0,external_wp_data_namespaceObject.dispatch)(store).updateCategory(slug, category);
}
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/templates.js
/**
- * 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.
+ * External dependencies
*/
-function isObjectLike( value ) {
- return !! value && 'object' === typeof value;
-}
/**
- * Creates and returns a new cache object.
- *
- * @return {Object} Cache object.
+ * WordPress dependencies
*/
-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.
+ * Internal dependencies
*/
-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.
+ * Checks whether a list of blocks matches a template by comparing the block names.
*
- * @param {Function} selector Selector function.
- * @param {Function} getDependants Dependant getter returning an immutable
- * reference or array of reference used in
- * cache bust consideration.
+ * @param {Array} blocks Block list.
+ * @param {Array} template Block template.
*
- * @return {Function} Memoized selector.
+ * @return {boolean} Whether the list of blocks matches a templates.
*/
-/* 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;
+function doBlocksMatchTemplate() {
+ let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ let template = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
+ return blocks.length === template.length && (0,external_lodash_namespaceObject.every)(template, (_ref, index) => {
+ let [name,, innerBlocksTemplate] = _ref;
+ const block = blocks[index];
+ return name === block.name && doBlocksMatchTemplate(block.innerBlocks, innerBlocksTemplate);
+ });
+}
+/**
+ * Synchronize a block list with a block template.
+ *
+ * Synchronizing a block list with a block template means that we loop over the blocks
+ * keep the block as is if it matches the block at the same position in the template
+ * (If it has the same name) and if doesn't match, we create a new block based on the template.
+ * Extra blocks not present in the template are removed.
+ *
+ * @param {Array} blocks Block list.
+ * @param {Array} template Block template.
+ *
+ * @return {Array} Updated Block list.
+ */
- // Create copy of arguments (avoid leaking deoptimization).
- args = new Array( len );
- for ( i = 0; i < len; i++ ) {
- args[ i ] = arguments[ i ];
- }
+function synchronizeBlocksWithTemplate() {
+ let blocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ let template = arguments.length > 1 ? arguments[1] : undefined;
- dependants = getDependants.apply( null, args );
- cache = getCache( dependants );
+ // If no template is provided, return blocks unmodified.
+ if (!template) {
+ return blocks;
+ }
- // 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();
- }
+ return (0,external_lodash_namespaceObject.map)(template, (_ref2, index) => {
+ let [name, attributes, innerBlocksTemplate] = _ref2;
+ const block = blocks[index];
- cache.lastDependants = dependants;
- }
+ if (block && block.name === name) {
+ const innerBlocks = synchronizeBlocksWithTemplate(block.innerBlocks, innerBlocksTemplate);
+ return { ...block,
+ innerBlocks
+ };
+ } // To support old templates that were using the "children" format
+ // for the attributes using "html" strings now, we normalize the template attributes
+ // before creating the blocks.
- 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
+ const blockType = registration_getBlockType(name);
- // 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;
- }
+ const isHTMLAttribute = attributeDefinition => (0,external_lodash_namespaceObject.get)(attributeDefinition, ['source']) === 'html';
- node.next = cache.head;
- node.prev = null;
- cache.head.prev = node;
- cache.head = node;
- }
+ const isQueryAttribute = attributeDefinition => (0,external_lodash_namespaceObject.get)(attributeDefinition, ['source']) === 'query';
- // Return immediately
- return node.val;
- }
+ const normalizeAttributes = (schema, values) => {
+ return (0,external_lodash_namespaceObject.mapValues)(values, (value, key) => {
+ return normalizeAttribute(schema[key], value);
+ });
+ };
- // No cached value found. Continue to insertion phase:
+ const normalizeAttribute = (definition, value) => {
+ if (isHTMLAttribute(definition) && (0,external_lodash_namespaceObject.isArray)(value)) {
+ // Introduce a deprecated call at this point
+ // When we're confident that "children" format should be removed from the templates.
+ return (0,external_wp_element_namespaceObject.renderToString)(value);
+ }
- node = {
- // Generate the result from original function
- val: selector.apply( null, args ),
- };
+ if (isQueryAttribute(definition) && value) {
+ return value.map(subValues => {
+ return normalizeAttributes(definition.query, subValues);
+ });
+ }
- // Avoid including the source object in the cache.
- args[ 0 ] = null;
- node.args = args;
+ return value;
+ };
- // Don't need to check whether node is already head, since it would
- // have been returned above already if it was
+ const normalizedAttributes = normalizeAttributes((0,external_lodash_namespaceObject.get)(blockType, ['attributes'], {}), attributes);
+ const [blockName, blockAttributes] = convertLegacyBlockNameAndAttributes(name, normalizedAttributes);
+ return createBlock(blockName, blockAttributes, synchronizeBlocksWithTemplate([], innerBlocksTemplate));
+ });
+}
- // Shift existing head down list
- if ( cache.head ) {
- cache.head.prev = node;
- node.next = cache.head;
- }
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/index.js
+// The blocktype is the most important concept within the block API. It defines
+// all aspects of the block configuration and its interfaces, including `edit`
+// and `save`. The transforms specification allows converting one blocktype to
+// another through formulas defined by either the source or the destination.
+// Switching a blocktype is to be considered a one-way operation implying a
+// transformation in the opposite way has to be handled explicitly.
+ // The block tree is composed of a collection of block nodes. Blocks contained
+// within other blocks are called inner blocks. An important design
+// consideration is that inner blocks are -- conceptually -- not part of the
+// territory established by the parent block that contains them.
+//
+// This has multiple practical implications: when parsing, we can safely dispose
+// of any block boundary found within a block from the innerHTML property when
+// transfering to state. Not doing so would have a compounding effect on memory
+// and uncertainty over the source of truth. This can be illustrated in how,
+// given a tree of `n` nested blocks, the entry node would have to contain the
+// actual content of each block while each subsequent block node in the state
+// tree would replicate the entire chain `n-1`, meaning the extreme end node
+// would have been replicated `n` times as the tree is traversed and would
+// generate uncertainty as to which one is to hold the current value of the
+// block. For composition, it also means inner blocks can effectively be child
+// components whose mechanisms can be shielded from the `edit` implementation
+// and just passed along.
- cache.head = node;
- return node.val;
- }
+ // While block transformations account for a specific surface of the API, there
+// are also raw transformations which handle arbitrary sources not made out of
+// blocks but producing block basaed on various heursitics. This includes
+// pasting rich text or HTML data.
- callSelector.getDependants = getDependants;
- callSelector.clear = clear;
- clear();
+ // The process of serialization aims to deflate the internal memory of the block
+// editor and its state representation back into an HTML valid string. This
+// process restores the document integrity and inserts invisible delimiters
+// around each block with HTML comment boundaries which can contain any extra
+// attributes needed to operate with the block later on.
- return callSelector;
-});
+ // Validation is the process of comparing a block source with its output before
+// there is any user input or interaction with a block. When this operation
+// fails -- for whatever reason -- the block is to be considered invalid. As
+// part of validating a block the system will attempt to run the source against
+// any provided deprecation definitions.
+//
+// Worth emphasizing that validation is not a case of whether the markup is
+// merely HTML spec-compliant but about how the editor knows to create such
+// markup and that its inability to create an identical result can be a strong
+// indicator of potential data loss (the invalidation is then a protective
+// measure).
+//
+// The invalidation process can also be deconstructed in phases: 1) validate the
+// block exists; 2) validate the source matches the output; 3) validate the
+// source matches deprecated outputs; 4) work through the significance of
+// differences. These are stacked in a way that favors performance and optimizes
+// for the majority of cases. That is to say, the evaluation logic can become
+// more sophisticated the further down it goes in the process as the cost is
+// accounted for. The first logic checks have to be extremely efficient since
+// they will be run for all valid and invalid blocks alike. However, once a
+// block is detected as invalid -- failing the three first steps -- it is
+// adequate to spend more time determining validity before throwing a conflict.
-/***/ }),
+ // Blocks are inherently indifferent about where the data they operate with ends
+// up being saved. For example, all blocks can have a static and dynamic aspect
+// to them depending on the needs. The static nature of a block is the `save()`
+// definition that is meant to be serialized into HTML and which can be left
+// void. Any block can also register a `render_callback` on the server, which
+// makes its output dynamic either in part or in its totality.
+//
+// Child blocks are defined as a relationship that builds on top of the inner
+// blocks mechanism. A child block is a block node of a particular type that can
+// only exist within the inner block boundaries of a specific parent type. This
+// allows block authors to compose specific blocks that are not meant to be used
+// outside of a specified parent block context. Thus, child blocks extend the
+// concept of inner blocks to support a more direct relationship between sets of
+// blocks. The addition of parent–child would be a subset of the inner block
+// functionality under the premise that certain blocks only make sense as
+// children of another block.
-/***/ "rl8x":
-/***/ (function(module, exports) {
-(function() { module.exports = window["wp"]["isShallowEqual"]; }());
+ // Templates are, in a general sense, a basic collection of block nodes with any
+// given set of predefined attributes that are supplied as the initial state of
+// an inner blocks group. These nodes can, in turn, contain any number of nested
+// blocks within their definition. Templates allow both to specify a default
+// state for an editor session or a default set of blocks for any inner block
+// implementation within a specific block.
-/***/ }),
-/***/ "rmEH":
-/***/ (function(module, exports) {
-(function() { module.exports = window["wp"]["htmlEntities"]; }());
-/***/ }),
-/***/ "wx14":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
+;// 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++) {
@@ -13333,14 +13063,97 @@ function _extends() {
return _extends.apply(this, arguments);
}
+;// CONCATENATED MODULE: external ["wp","compose"]
+var external_wp_compose_namespaceObject = window["wp"]["compose"];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/block-content-provider/index.js
+
-/***/ }),
-/***/ "xTGt":
-/***/ (function(module, exports) {
+/**
+ * WordPress dependencies
+ */
-(function() { module.exports = window["wp"]["blob"]; }());
-/***/ })
+/**
+ * Internal dependencies
+ */
+
+
+const {
+ Consumer,
+ Provider
+} = (0,external_wp_element_namespaceObject.createContext)(() => {});
+/**
+ * An internal block component used in block content serialization to inject
+ * nested block content within the `save` implementation of the ancestor
+ * component in which it is nested. The component provides a pre-bound
+ * `BlockContent` component via context, which is used by the developer-facing
+ * `InnerBlocks.Content` component to render block content.
+ *
+ * @example
+ *
+ * ```jsx
+ * <BlockContentProvider innerBlocks={ innerBlocks }>
+ * { blockSaveElement }
+ * </BlockContentProvider>
+ * ```
+ *
+ * @param {Object} props Component props.
+ * @param {WPElement} props.children Block save result.
+ * @param {Array} props.innerBlocks Block(s) to serialize.
+ *
+ * @return {WPComponent} Element with BlockContent injected via context.
+ */
+
+const BlockContentProvider = _ref => {
+ let {
+ children,
+ innerBlocks
+ } = _ref;
+
+ const BlockContent = () => {
+ // Value is an array of blocks, so defer to block serializer
+ const html = serialize(innerBlocks, {
+ isInnerBlocks: true
+ }); // Use special-cased raw HTML tag to avoid default escaping
+
+ return createElement(RawHTML, null, html);
+ };
+
+ return createElement(Provider, {
+ value: BlockContent
+ }, children);
+};
+/**
+ * A Higher Order Component used to inject BlockContent using context to the
+ * wrapped component.
+ *
+ * @return {WPComponent} Enhanced component with injected BlockContent as prop.
+ */
+
+
+const withBlockContentContext = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(OriginalComponent => {
+ return props => (0,external_wp_element_namespaceObject.createElement)(Consumer, null, context => (0,external_wp_element_namespaceObject.createElement)(OriginalComponent, _extends({}, props, {
+ BlockContent: context
+ })));
+}, 'withBlockContentContext');
+/* harmony default export */ var block_content_provider = ((/* unused pure expression or super */ null && (BlockContentProvider)));
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/index.js
+// A "block" is the abstract term used to describe units of markup that,
+// when composed together, form the content or layout of a page.
+// The API for blocks is exposed via `wp.blocks`.
+//
+// Supported blocks are registered by calling `registerBlockType`. Once registered,
+// the block is made available as an option to the editor interface.
+//
+// Blocks are inferred from the HTML source of a post through a parsing mechanism
+// and then stored as objects in state, from which it is then rendered for editing.
-/******/ });
\ No newline at end of file
+
+
+
+}();
+(window.wp = window.wp || {}).blocks = __webpack_exports__;
+/******/ })()
+;
\ No newline at end of file
diff --git a/wp-includes/js/dist/blocks.min.js b/wp-includes/js/dist/blocks.min.js
index fe54527f79..dcfb934132 100644
--- a/wp-includes/js/dist/blocks.min.js
+++ b/wp-includes/js/dist/blocks.min.js
@@ -1,3 +1,3 @@
/*! This file is auto-generated */
-this.wp=this.wp||{},this.wp.blocks=function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.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 a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));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="0ATp")}({"0ATp":function(e,t,r){"use strict";r.r(t),r.d(t,"store",(function(){return lt})),r.d(t,"createBlock",(function(){return ve})),r.d(t,"createBlocksFromInnerBlocksTemplate",(function(){return je})),r.d(t,"cloneBlock",(function(){return Oe})),r.d(t,"__experimentalCloneSanitizedBlock",(function(){return Te})),r.d(t,"getPossibleBlockTransformations",(function(){return Ee})),r.d(t,"switchToBlockType",(function(){return Ae})),r.d(t,"getBlockTransforms",(function(){return Ne})),r.d(t,"findTransform",(function(){return Be})),r.d(t,"getBlockFromExample",(function(){return Pe})),r.d(t,"parse",(function(){return Ar})),r.d(t,"getBlockAttributes",(function(){return Sr})),r.d(t,"parseWithAttributeSchema",(function(){return xr})),r.d(t,"pasteHandler",(function(){return mn})),r.d(t,"rawHandler",(function(){return yn})),r.d(t,"getPhrasingContentSchema",(function(){return kn})),r.d(t,"serialize",(function(){return Ct})),r.d(t,"getBlockContent",(function(){return jt})),r.d(t,"getBlockDefaultClassName",(function(){return ft})),r.d(t,"getBlockMenuDefaultClassName",(function(){return gt})),r.d(t,"getSaveElement",(function(){return yt})),r.d(t,"getSaveContent",(function(){return wt})),r.d(t,"__unstableGetBlockProps",(function(){return _t})),r.d(t,"__unstableGetInnerBlocksProps",(function(){return kt})),r.d(t,"__unstableSerializeAndClean",(function(){return Ot})),r.d(t,"isValidBlockContent",(function(){return cr})),r.d(t,"getCategories",(function(){return wn})),r.d(t,"setCategories",(function(){return vn})),r.d(t,"updateCategory",(function(){return jn})),r.d(t,"registerBlockType",(function(){return Q})),r.d(t,"registerBlockCollection",(function(){return Z})),r.d(t,"unregisterBlockType",(function(){return X})),r.d(t,"setFreeformContentHandlerName",(function(){return J})),r.d(t,"getFreeformContentHandlerName",(function(){return ee})),r.d(t,"setUnregisteredTypeHandlerName",(function(){return re})),r.d(t,"getUnregisteredTypeHandlerName",(function(){return ne})),r.d(t,"setDefaultBlockName",(function(){return ae})),r.d(t,"getDefaultBlockName",(function(){return ie})),r.d(t,"setGroupingBlockName",(function(){return oe})),r.d(t,"getGroupingBlockName",(function(){return te})),r.d(t,"getBlockType",(function(){return se})),r.d(t,"getBlockTypes",(function(){return ce})),r.d(t,"getBlockSupport",(function(){return le})),r.d(t,"hasBlockSupport",(function(){return ue})),r.d(t,"getBlockVariations",(function(){return _e})),r.d(t,"isReusableBlock",(function(){return de})),r.d(t,"isTemplatePart",(function(){return pe})),r.d(t,"getChildBlockNames",(function(){return he})),r.d(t,"hasChildBlocks",(function(){return fe})),r.d(t,"hasChildBlocksWithInserterSupport",(function(){return ge})),r.d(t,"unstable__bootstrapServerSideBlockDefinitions",(function(){return W})),r.d(t,"registerBlockStyle",(function(){return me})),r.d(t,"unregisterBlockStyle",(function(){return be})),r.d(t,"registerBlockVariation",(function(){return ke})),r.d(t,"unregisterBlockVariation",(function(){return ye})),r.d(t,"isUnmodifiedDefaultBlock",(function(){return Le})),r.d(t,"normalizeIconObject",(function(){return ze})),r.d(t,"isValidIcon",(function(){return De})),r.d(t,"__experimentalGetBlockLabel",(function(){return He})),r.d(t,"__experimentalGetAccessibleBlockLabel",(function(){return Ve})),r.d(t,"__experimentalSanitizeBlockAttributes",(function(){return Re})),r.d(t,"__experimentalGetBlockAttributesNamesByRole",(function(){return $e})),r.d(t,"doBlocksMatchTemplate",(function(){return Tn})),r.d(t,"synchronizeBlocksWithTemplate",(function(){return On})),r.d(t,"children",(function(){return jr})),r.d(t,"node",(function(){return kr})),r.d(t,"__EXPERIMENTAL_STYLE_PROPERTY",(function(){return F})),r.d(t,"__EXPERIMENTAL_ELEMENTS",(function(){return q})),r.d(t,"__EXPERIMENTAL_PATHS_WITH_MERGE",(function(){return U})),r.d(t,"withBlockContentContext",(function(){return Bn}));var n={};r.r(n),r.d(n,"__experimentalGetUnprocessedBlockTypes",(function(){return b})),r.d(n,"getBlockTypes",(function(){return _})),r.d(n,"getBlockType",(function(){return k})),r.d(n,"getBlockStyles",(function(){return y})),r.d(n,"getBlockVariations",(function(){return w})),r.d(n,"getActiveBlockVariation",(function(){return v})),r.d(n,"getDefaultBlockVariation",(function(){return j})),r.d(n,"getCategories",(function(){return T})),r.d(n,"getCollections",(function(){return O})),r.d(n,"getDefaultBlockName",(function(){return C})),r.d(n,"getFreeformFallbackBlockName",(function(){return x})),r.d(n,"getUnregisteredFallbackBlockName",(function(){return S})),r.d(n,"getGroupingBlockName",(function(){return E})),r.d(n,"getChildBlockNames",(function(){return B})),r.d(n,"getBlockSupport",(function(){return N})),r.d(n,"hasBlockSupport",(function(){return A})),r.d(n,"isMatchingSearchTerm",(function(){return P})),r.d(n,"hasChildBlocks",(function(){return M})),r.d(n,"hasChildBlocksWithInserterSupport",(function(){return L}));var a={};r.r(a),r.d(a,"addBlockTypes",(function(){return Ke})),r.d(a,"__experimentalRegisterBlockType",(function(){return We})),r.d(a,"__experimentalReapplyBlockTypeFilters",(function(){return Ye})),r.d(a,"removeBlockTypes",(function(){return Qe})),r.d(a,"addBlockStyles",(function(){return Ze})),r.d(a,"removeBlockStyles",(function(){return Xe})),r.d(a,"addBlockVariations",(function(){return Je})),r.d(a,"removeBlockVariations",(function(){return et})),r.d(a,"setDefaultBlockName",(function(){return tt})),r.d(a,"setFreeformFallbackBlockName",(function(){return rt})),r.d(a,"setUnregisteredFallbackBlockName",(function(){return nt})),r.d(a,"setGroupingBlockName",(function(){return at})),r.d(a,"setCategories",(function(){return ot})),r.d(a,"updateCategory",(function(){return it})),r.d(a,"addBlockCollection",(function(){return st})),r.d(a,"removeBlockCollection",(function(){return ct}));var o=r("1ZqX"),i=r("YLtl"),s=r("l3Sj");const c=[{slug:"text",title:Object(s.__)("Text")},{slug:"media",title:Object(s.__)("Media")},{slug:"design",title:Object(s.__)("Design")},{slug:"widgets",title:Object(s.__)("Widgets")},{slug:"theme",title:Object(s.__)("Theme")},{slug:"embed",title:Object(s.__)("Embeds")},{slug:"reusable",title:Object(s.__)("Reusable blocks")}];function l(e){return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1?arguments[1]:void 0;switch(r.type){case"REMOVE_BLOCK_TYPES":return-1!==r.names.indexOf(t)?null:t;case e:return r.name||null}return t}}const u=l("SET_DEFAULT_BLOCK_NAME"),d=l("SET_FREEFORM_FALLBACK_BLOCK_NAME"),p=l("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),h=l("SET_GROUPING_BLOCK_NAME");var f=Object(o.combineReducers)({unprocessedBlockTypes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_UNPROCESSED_BLOCK_TYPE":return{...e,[t.blockType.name]:t.blockType};case"REMOVE_BLOCK_TYPES":return Object(i.omit)(e,t.names)}return e},blockTypes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object(i.keyBy)(t.blockTypes,"name")};case"REMOVE_BLOCK_TYPES":return Object(i.omit)(e,t.names)}return e},blockStyles:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object(i.mapValues)(Object(i.keyBy)(t.blockTypes,"name"),t=>Object(i.uniqBy)([...Object(i.get)(t,["styles"],[]).map(e=>({...e,source:"block"})),...Object(i.get)(e,[t.name],[]).filter(e=>{let{source:t}=e;return"block"!==t})],e=>e.name))};case"ADD_BLOCK_STYLES":return{...e,[t.blockName]:Object(i.uniqBy)([...Object(i.get)(e,[t.blockName],[]),...t.styles],e=>e.name)};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:Object(i.filter)(Object(i.get)(e,[t.blockName],[]),e=>-1===t.styleNames.indexOf(e.name))}}return e},blockVariations:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object(i.mapValues)(Object(i.keyBy)(t.blockTypes,"name"),t=>Object(i.uniqBy)([...Object(i.get)(t,["variations"],[]).map(e=>({...e,source:"block"})),...Object(i.get)(e,[t.name],[]).filter(e=>{let{source:t}=e;return"block"!==t})],e=>e.name))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:Object(i.uniqBy)([...Object(i.get)(e,[t.blockName],[]),...t.variations],e=>e.name)};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:Object(i.filter)(Object(i.get)(e,[t.blockName],[]),e=>-1===t.variationNames.indexOf(e.name))}}return e},defaultBlockName:u,freeformFallbackBlockName:d,unregisteredFallbackBlockName:p,groupingBlockName:h,categories:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_CATEGORIES":return t.categories||[];case"UPDATE_CATEGORY":if(!t.category||Object(i.isEmpty)(t.category))return e;if(Object(i.find)(e,["slug",t.slug]))return Object(i.map)(e,e=>e.slug===t.slug?{...e,...t.category}:e)}return e},collections:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return Object(i.omit)(e,t.namespace)}return e}}),g=r("pPDe");const m=(e,t)=>"string"==typeof t?k(e,t):t;function b(e){return e.unprocessedBlockTypes}const _=Object(g.a)(e=>Object.values(e.blockTypes),e=>[e.blockTypes]);function k(e,t){return e.blockTypes[t]}function y(e,t){return e.blockStyles[t]}const w=Object(g.a)((e,t,r)=>{const n=e.blockVariations[t];return n&&r?n.filter(e=>(e.scope||["block","inserter"]).includes(r)):n},(e,t)=>[e.blockVariations[t]]);function v(e,t,r,n){const a=w(e,t,n);return null==a?void 0:a.find(n=>{var a;if(Array.isArray(n.isActive)){const a=k(e,t),o=Object.keys((null==a?void 0:a.attributes)||{}),i=n.isActive.filter(e=>o.includes(e));return 0!==i.length&&i.every(e=>r[e]===n.attributes[e])}return null===(a=n.isActive)||void 0===a?void 0:a.call(n,r,n.attributes)})}function j(e,t,r){const n=w(e,t,r);return Object(i.findLast)(n,"isDefault")||Object(i.first)(n)}function T(e){return e.categories}function O(e){return e.collections}function C(e){return e.defaultBlockName}function x(e){return e.freeformFallbackBlockName}function S(e){return e.unregisteredFallbackBlockName}function E(e){return e.groupingBlockName}const B=Object(g.a)((e,t)=>Object(i.map)(Object(i.filter)(e.blockTypes,e=>Object(i.includes)(e.parent,t)),e=>{let{name:t}=e;return t}),e=>[e.blockTypes]),N=(e,t,r,n)=>{const a=m(e,t);return null!=a&&a.supports?Object(i.get)(a.supports,r,n):n};function A(e,t,r,n){return!!N(e,t,r,n)}function P(e,t,r){const n=m(e,t),a=Object(i.flow)([i.deburr,e=>e.toLowerCase(),e=>e.trim()]),o=a(r),s=Object(i.flow)([a,e=>Object(i.includes)(e,o)]);return s(n.title)||Object(i.some)(n.keywords,s)||s(n.category)}const M=(e,t)=>B(e,t).length>0,L=(e,t)=>Object(i.some)(B(e,t),t=>A(e,t,"inserter",!0));var D=r("g56x");var z=r("fHnH"),I=r("abaT"),H=r("7bKH"),V=r("GRId"),R=r("1CF3");const $=["attributes","supports","save","migrate","isEligible","apiVersion"],F={"--wp--style--color--link":{value:["color","link"],support:["color","link"]},background:{value:["color","gradient"],support:["color","gradients"]},backgroundColor:{value:["color","background"],support:["color","background"],requiresOptOut:!0},borderColor:{value:["border","color"],support:["__experimentalBorder","color"]},borderRadius:{value:["border","radius"],support:["__experimentalBorder","radius"],properties:{borderTopLeftRadius:"topLeft",borderTopRightRadius:"topRight",borderBottomLeftRadius:"bottomLeft",borderBottomRightRadius:"bottomRight"}},borderStyle:{value:["border","style"],support:["__experimentalBorder","style"]},borderWidth:{value:["border","width"],support:["__experimentalBorder","width"]},color:{value:["color","text"],support:["color","text"],requiresOptOut:!0},linkColor:{value:["elements","link","color","text"],support:["color","link"]},fontFamily:{value:["typography","fontFamily"],support:["typography","__experimentalFontFamily"]},fontSize:{value:["typography","fontSize"],support:["typography","fontSize"]},fontStyle:{value:["typography","fontStyle"],support:["typography","__experimentalFontStyle"]},fontWeight:{value:["typography","fontWeight"],support:["typography","__experimentalFontWeight"]},lineHeight:{value:["typography","lineHeight"],support:["typography","lineHeight"]},margin:{value:["spacing","margin"],support:["spacing","margin"],properties:{marginTop:"top",marginRight:"right",marginBottom:"bottom",marginLeft:"left"}},padding:{value:["spacing","padding"],support:["spacing","padding"],properties:{paddingTop:"top",paddingRight:"right",paddingBottom:"bottom",paddingLeft:"left"}},textDecoration:{value:["typography","textDecoration"],support:["typography","__experimentalTextDecoration"]},textTransform:{value:["typography","textTransform"],support:["typography","__experimentalTextTransform"]},letterSpacing:{value:["typography","letterSpacing"],support:["typography","__experimentalLetterSpacing"]},"--wp--style--block-gap":{value:["spacing","blockGap"],support:["spacing","blockGap"]}},q={link:"a",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},U={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"typography.fontFamilies":!0,"typography.fontSizes":!0},G={title:"block title",description:"block description",keywords:["block keyword"],styles:[{label:"block style label"}],variations:[{title:"block variation title",description:"block variation description",keywords:["block variation keyword"]}]},K={};function W(e){for(const t of Object.keys(e))K[t]?void 0===K[t].apiVersion&&e[t].apiVersion&&(K[t].apiVersion=e[t].apiVersion):K[t]=Object(i.mapKeys)(Object(i.pickBy)(e[t],e=>!Object(i.isNil)(e)),(e,t)=>Object(i.camelCase)(t))}function Y(e){let{textdomain:t,...r}=e;const n=Object(i.pick)(r,["apiVersion","title","category","parent","icon","description","keywords","attributes","providesContext","usesContext","supports","styles","example","variations"]);return t&&Object.keys(G).forEach(e=>{n[e]&&(n[e]=function e(t,r,n){if(Object(i.isString)(t)&&Object(i.isString)(r))return Object(s._x)(r,t,n);if(Object(i.isArray)(t)&&!Object(i.isEmpty)(t)&&Object(i.isArray)(r))return r.map(r=>e(t[0],r,n));if(Object(i.isObject)(t)&&!Object(i.isEmpty)(t)&&Object(i.isObject)(r))return Object.keys(r).reduce((a,o)=>t[o]?(a[o]=e(t[o],r[o],n),a):(a[o]=r[o],a),{});return r}(G[e],n[e],t))}),n}function Q(e,t){const r=Object(i.isObject)(e)?e.name:e;if("string"!=typeof r)return void console.error("Block names must be strings.");if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(r))return void console.error("Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block");if(Object(o.select)(lt).getBlockType(r))return void console.error('Block "'+r+'" is already registered.');Object(i.isObject)(e)&&W({[r]:Y(e)});const n={name:r,icon:"block-default",keywords:[],attributes:{},providesContext:{},usesContext:[],supports:{},styles:[],variations:[],save:()=>null,...null==K?void 0:K[r],...t};return Object(o.dispatch)(lt).__experimentalRegisterBlockType(n),Object(o.select)(lt).getBlockType(r)}function Z(e,t){let{title:r,icon:n}=t;Object(o.dispatch)(lt).addBlockCollection(e,r,n)}function X(e){const t=Object(o.select)(lt).getBlockType(e);if(t)return Object(o.dispatch)(lt).removeBlockTypes(e),t;console.error('Block "'+e+'" is not registered.')}function J(e){Object(o.dispatch)(lt).setFreeformFallbackBlockName(e)}function ee(){return Object(o.select)(lt).getFreeformFallbackBlockName()}function te(){return Object(o.select)(lt).getGroupingBlockName()}function re(e){Object(o.dispatch)(lt).setUnregisteredFallbackBlockName(e)}function ne(){return Object(o.select)(lt).getUnregisteredFallbackBlockName()}function ae(e){Object(o.dispatch)(lt).setDefaultBlockName(e)}function oe(e){Object(o.dispatch)(lt).setGroupingBlockName(e)}function ie(){return Object(o.select)(lt).getDefaultBlockName()}function se(e){var t;return null===(t=Object(o.select)(lt))||void 0===t?void 0:t.getBlockType(e)}function ce(){return Object(o.select)(lt).getBlockTypes()}function le(e,t,r){return Object(o.select)(lt).getBlockSupport(e,t,r)}function ue(e,t,r){return Object(o.select)(lt).hasBlockSupport(e,t,r)}function de(e){return"core/block"===(null==e?void 0:e.name)}function pe(e){return"core/template-part"===e.name}const he=e=>Object(o.select)(lt).getChildBlockNames(e),fe=e=>Object(o.select)(lt).hasChildBlocks(e),ge=e=>Object(o.select)(lt).hasChildBlocksWithInserterSupport(e),me=(e,t)=>{Object(o.dispatch)(lt).addBlockStyles(e,t)},be=(e,t)=>{Object(o.dispatch)(lt).removeBlockStyles(e,t)},_e=(e,t)=>Object(o.select)(lt).getBlockVariations(e,t),ke=(e,t)=>{Object(o.dispatch)(lt).addBlockVariations(e,t)},ye=(e,t)=>{Object(o.dispatch)(lt).removeBlockVariations(e,t)};var we=r("7Cbv");function ve(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=Re(e,t),a=Object(we.a)();return{clientId:a,name:e,isValid:!0,attributes:n,innerBlocks:r}}function je(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(e=>{const t=Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],[r,n,a=[]]=t;return ve(r,n,je(a))})}function Te(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;const n=Object(we.a)(),a=Re(e.name,{...e.attributes,...t});return{...e,clientId:n,attributes:a,innerBlocks:r||e.innerBlocks.map(e=>Te(e))}}function Oe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;const n=Object(we.a)();return{...e,clientId:n,attributes:{...e.attributes,...t},innerBlocks:r||e.innerBlocks.map(e=>Oe(e))}}const Ce=(e,t,r)=>{if(Object(i.isEmpty)(r))return!1;const n=r.length>1,a=Object(i.first)(r).name;if(!(xe(e)||!n||e.isMultiBlock))return!1;if(!xe(e)&&!Object(i.every)(r,{name:a}))return!1;if(!("block"===e.type))return!1;const o=Object(i.first)(r);if(!("from"!==t||-1!==e.blocks.indexOf(o.name)||xe(e)))return!1;if(!n&&Se(o.name)&&Se(e.blockName))return!1;if(Object(i.isFunction)(e.isMatch)){const t=e.isMultiBlock?r.map(e=>e.attributes):o.attributes,n=e.isMultiBlock?r:o;if(!e.isMatch(t,n))return!1}return!(e.usingMobileTransformations&&xe(e)&&!Se(o.name))},xe=e=>e&&"block"===e.type&&Array.isArray(e.blocks)&&e.blocks.includes("*"),Se=e=>e===te();function Ee(e){if(Object(i.isEmpty)(e))return[];const t=(e=>{if(Object(i.isEmpty)(e))return[];const t=ce();return Object(i.filter)(t,t=>!!Be(Ne("from",t.name),t=>Ce(t,"from",e)))})(e),r=(e=>{if(Object(i.isEmpty)(e))return[];const t=se(Object(i.first)(e).name),r=t?Ne("to",t.name):[],n=Object(i.filter)(r,t=>t&&Ce(t,"to",e));return Object(i.flatMap)(n,e=>e.blocks).map(e=>se(e))})(e);return Object(i.uniq)([...t,...r])}function Be(e,t){const r=Object(D.createHooks)();for(let n=0;n<e.length;n++){const a=e[n];t(a)&&r.addFilter("transform","transform/"+n.toString(),e=>e||a,a.priority)}return r.applyFilters("transform",null)}function Ne(e,t){if(void 0===t)return Object(i.flatMap)(ce(),t=>{let{name:r}=t;return Ne(e,r)});const r=Ie(t),{name:n,transforms:a}=r||{};if(!a||!Array.isArray(a[e]))return[];const o=a.supportedMobileTransforms&&Array.isArray(a.supportedMobileTransforms);return(o?Object(i.filter)(a[e],e=>"raw"===e.type||!(!e.blocks||!e.blocks.length)&&(!!xe(e)||Object(i.every)(e.blocks,e=>a.supportedMobileTransforms.includes(e)))):a[e]).map(e=>({...e,blockName:n,usingMobileTransformations:o}))}function Ae(e,t){const r=Object(i.castArray)(e),n=r.length>1,a=r[0],o=a.name,s=Ne("from",t),c=Be(Ne("to",o),e=>"block"===e.type&&(xe(e)||-1!==e.blocks.indexOf(t))&&(!n||e.isMultiBlock))||Be(s,e=>"block"===e.type&&(xe(e)||-1!==e.blocks.indexOf(o))&&(!n||e.isMultiBlock));if(!c)return null;let l;if(l=c.isMultiBlock?Object(i.has)(c,"__experimentalConvert")?c.__experimentalConvert(r):c.transform(r.map(e=>e.attributes),r.map(e=>e.innerBlocks)):Object(i.has)(c,"__experimentalConvert")?c.__experimentalConvert(a):c.transform(a.attributes,a.innerBlocks),!Object(i.isObjectLike)(l))return null;if(l=Object(i.castArray)(l),l.some(e=>!se(e.name)))return null;if(!Object(i.some)(l,e=>e.name===t))return null;return l.map(t=>Object(D.applyFilters)("blocks.switchToBlockType.transformedBlock",t,e))}const Pe=(e,t)=>ve(e,t.attributes,Object(i.map)(t.innerBlocks,e=>Pe(e.name,e)));Object(z.b)([I.a,H.a]);const Me=["#191e23","#f8f9f9"];function Le(e){const t=ie();if(e.name!==t)return!1;Le.block&&Le.block.name===t||(Le.block=ve(t));const r=Le.block,n=se(t);return Object(i.every)(null==n?void 0:n.attributes,(t,n)=>r.attributes[n]===e.attributes[n])}function De(e){return!!e&&(Object(i.isString)(e)||Object(V.isValidElement)(e)||Object(i.isFunction)(e)||e instanceof V.Component)}function ze(e){if(De(e=e||"block-default"))return{src:e};if(Object(i.has)(e,["background"])){const t=Object(z.a)(e.background);return{...e,foreground:e.foreground?e.foreground:Object(i.maxBy)(Me,e=>t.contrast(e)),shadowColor:t.alpha(.3).toRgbString()}}return e}function Ie(e){return Object(i.isString)(e)?se(e):e}function He(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"visual";const{__experimentalLabel:n,title:a}=e,o=n&&n(t,{context:r});return o?Object(R.__unstableStripHTML)(o):a}function Ve(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vertical";const a=null==e?void 0:e.title,o=e?He(e,t,"accessibility"):"",i=void 0!==r,c=o&&o!==a;return i&&"vertical"===n?c?Object(s.sprintf)(Object(s.__)("%1$s Block. Row %2$d. %3$s"),a,r,o):Object(s.sprintf)(Object(s.__)("%1$s Block. Row %2$d"),a,r):i&&"horizontal"===n?c?Object(s.sprintf)(Object(s.__)("%1$s Block. Column %2$d. %3$s"),a,r,o):Object(s.sprintf)(Object(s.__)("%1$s Block. Column %2$d"),a,r):c?Object(s.sprintf)(Object(s.__)("%1$s Block. %2$s"),a,o):Object(s.sprintf)(Object(s.__)("%s Block"),a)}function Re(e,t){const r=se(e);if(void 0===r)throw new Error(`Block type '${e}' is not registered.`);return Object(i.reduce)(r.attributes,(e,r,n)=>{const a=t[n];return void 0!==a?e[n]=a:r.hasOwnProperty("default")&&(e[n]=r.default),-1!==["node","children"].indexOf(r.source)&&("string"==typeof e[n]?e[n]=[e[n]]:Array.isArray(e[n])||(e[n]=[])),e},{})}function $e(e,t){var r;const n=null===(r=se(e))||void 0===r?void 0:r.attributes;if(!n)return[];const a=Object.keys(n);return t?a.filter(e=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.__experimentalRole)===t}):a}const{error:Fe,warn:qe}=window.console,Ue={common:"text",formatting:"text",layout:"design"};function Ge(e){const{name:t}=e,r=Object(D.applyFilters)("blocks.registerBlockType",{...e},t);if(r.deprecated&&(r.deprecated=r.deprecated.map(r=>Object(i.pick)(Object(D.applyFilters)("blocks.registerBlockType",{...Object(i.omit)(e,$),...r},t),$))),Object(i.isPlainObject)(r))if(Object(i.isFunction)(r.save))if(!("edit"in r)||Object(i.isFunction)(r.edit))if(Ue.hasOwnProperty(r.category)&&(r.category=Ue[r.category]),"category"in r&&!Object(i.some)(Object(o.select)("core/blocks").getCategories(),{slug:r.category})&&(qe('The block "'+t+'" is registered with an invalid category "'+r.category+'".'),delete r.category),"title"in r&&""!==r.title)if("string"==typeof r.title){if(r.icon=ze(r.icon),De(r.icon.src))return r;Fe("The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional")}else Fe("Block titles must be strings.");else Fe('The block "'+t+'" must have a title.');else Fe('The "edit" property must be a valid function.');else Fe('The "save" property must be a valid function.');else Fe("Block settings must be a valid object.")}function Ke(e){return{type:"ADD_BLOCK_TYPES",blockTypes:Object(i.castArray)(e)}}function*We(e){yield{type:"ADD_UNPROCESSED_BLOCK_TYPE",blockType:e};const t=Ge(e);t&&(yield Ke(t))}function*Ye(){const e=Object(o.select)("core/blocks").__experimentalGetUnprocessedBlockTypes(),t=Object.keys(e).reduce((t,r)=>{const n=Ge(e[r]);return n&&t.push(n),t},[]);t.length&&(yield Ke(t))}function Qe(e){return{type:"REMOVE_BLOCK_TYPES",names:Object(i.castArray)(e)}}function Ze(e,t){return{type:"ADD_BLOCK_STYLES",styles:Object(i.castArray)(t),blockName:e}}function Xe(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:Object(i.castArray)(t),blockName:e}}function Je(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:Object(i.castArray)(t),blockName:e}}function et(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:Object(i.castArray)(t),blockName:e}}function tt(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function rt(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function nt(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function at(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function ot(e){return{type:"SET_CATEGORIES",categories:e}}function it(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function st(e,t,r){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:r}}function ct(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}const lt=Object(o.createReduxStore)("core/blocks",{reducer:f,selectors:n,actions:a});Object(o.register)(lt);var ut=r("ouCq"),dt=r("UuzZ"),pt=r("rl8x"),ht=r.n(pt);function ft(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return Object(D.applyFilters)("blocks.getBlockDefaultClassName",t,e)}function gt(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return Object(D.applyFilters)("blocks.getBlockMenuDefaultClassName",t,e)}const mt={},bt={};function _t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{blockType:t,attributes:r}=mt;return Object(D.applyFilters)("blocks.getSaveContent.extraProps",{...e},t,r)}function kt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{innerBlocks:t}=bt,r=Ct(t,{isInnerBlocks:!0}),n=Object(V.createElement)(V.RawHTML,null,r);return{...e,children:n}}function yt(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=Ie(e);let{save:a}=n;if(a.prototype instanceof V.Component){const e=new a({attributes:t});a=e.render.bind(e)}mt.blockType=n,mt.attributes=t,bt.innerBlocks=r;let o=a({attributes:t,innerBlocks:r});if(Object(i.isObject)(o)&&Object(D.hasFilter)("blocks.getSaveContent.extraProps")&&!(n.apiVersion>1)){const e=Object(D.applyFilters)("blocks.getSaveContent.extraProps",{...o.props},n,t);ht()(e,o.props)||(o=Object(V.cloneElement)(o,e))}return Object(D.applyFilters)("blocks.getSaveElement",o,n,t)}function wt(e,t,r){const n=Ie(e);return Object(V.renderToString)(yt(n,t,r))}function vt(e,t){return Object(i.reduce)(e.attributes,(e,r,n)=>{const a=t[n];return void 0===a||void 0!==r.source||"default"in r&&r.default===a||(e[n]=a),e},{})}function jt(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=wt(e.name,e.attributes,e.innerBlocks)}catch(e){}return t}function Tt(e,t,r){const n=Object(i.isEmpty)(t)?"":function(e){return JSON.stringify(e).replace(/--/g,"\\u002d\\u002d").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}(t)+" ",a=Object(i.startsWith)(e,"core/")?e.slice(5):e;return r?`\x3c!-- wp:${a} ${n}--\x3e\n`+r+`\n\x3c!-- /wp:${a} --\x3e`:`\x3c!-- wp:${a} ${n}/--\x3e`}function Ot(e){1===e.length&&Le(e[0])&&(e=[]);let t=Ct(e);return 1===e.length&&e[0].name===ee()&&(t=Object(dt.removep)(t)),t}function Ct(e,t){return Object(i.castArray)(e).map(e=>function(e){let{isInnerBlocks:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=e.name,n=jt(e);if(r===ne()||!t&&r===ee())return n;const a=se(r),o=vt(a,e.attributes);return Tt(r,o,n)}(e,t)).join("\n\n")}var xt=/^#[xX]([A-Fa-f0-9]+)$/,St=/^#([0-9]+)$/,Et=/^([A-Za-z0-9]+)$/,Bt=(function(){function e(e){this.named=e}e.prototype.parse=function(e){if(e){var t=e.match(xt);return t?String.fromCharCode(parseInt(t[1],16)):(t=e.match(St))?String.fromCharCode(parseInt(t[1],10)):(t=e.match(Et))?this.named[t[1]]:void 0}}}(),/[\t\n\f ]/),Nt=/[A-Za-z]/,At=/\r\n?/g;function Pt(e){return Bt.test(e)}function Mt(e){return Nt.test(e)}var Lt=function(){function e(e,t,r){void 0===r&&(r="precompile"),this.delegate=e,this.entityParser=t,this.mode=r,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var e=this.peek();if("<"!==e||this.isIgnoredEndTag()){if("precompile"===this.mode&&"\n"===e){var t=this.tagNameBuffer.toLowerCase();"pre"!==t&&"textarea"!==t||this.consume()}this.transitionTo("data"),this.delegate.beginData()}else this.transitionTo("tagOpen"),this.markTagStart(),this.consume()},data:function(){var e=this.peek(),t=this.tagNameBuffer;"<"!==e||this.isIgnoredEndTag()?"&"===e&&"script"!==t&&"style"!==t?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(e)):(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume())},tagOpen:function(){var e=this.consume();"!"===e?this.transitionTo("markupDeclarationOpen"):"/"===e?this.transitionTo("endTagOpen"):("@"===e||":"===e||Mt(e))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(e))},markupDeclarationOpen:function(){var e=this.consume();"-"===e&&"-"===this.peek()?(this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment()):"DOCTYPE"===e.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase()&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())},doctype:function(){Pt(this.consume())&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var e=this.consume();Pt(e)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase()))},doctypeName:function(){var e=this.consume();Pt(e)?this.transitionTo("afterDoctypeName"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase())},afterDoctypeName:function(){var e=this.consume();if(!Pt(e))if(">"===e)this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var t=e.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),r="PUBLIC"===t.toUpperCase(),n="SYSTEM"===t.toUpperCase();(r||n)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),r?this.transitionTo("afterDoctypePublicKeyword"):n&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var e=this.peek();Pt(e)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):'"'===e?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):"'"===e?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):">"===e&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},doctypePublicIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},afterDoctypePublicIdentifier:function(){var e=this.consume();Pt(e)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var e=this.consume();Pt(e)||(">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},doctypeSystemIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},afterDoctypeSystemIdentifier:function(){var e=this.consume();Pt(e)||">"===e&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart:function(){var e=this.consume();"-"===e?this.transitionTo("commentStartDash"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(e),this.transitionTo("comment"))},commentStartDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var e=this.consume();"-"===e?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(e)},commentEndDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+e),this.transitionTo("comment"))},commentEnd:function(){var e=this.consume();">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+e),this.transitionTo("comment"))},tagName:function(){var e=this.consume();Pt(e)?this.transitionTo("beforeAttributeName"):"/"===e?this.transitionTo("selfClosingStartTag"):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(e)},endTagName:function(){var e=this.consume();Pt(e)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):"/"===e?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(e)},beforeAttributeName:function(){var e=this.peek();Pt(e)?this.consume():"/"===e?(this.transitionTo("selfClosingStartTag"),this.consume()):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):"="===e?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var e=this.peek();Pt(e)?(this.transitionTo("afterAttributeName"),this.consume()):"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.transitionTo("beforeAttributeValue"),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):'"'===e||"'"===e||"<"===e?(this.delegate.reportSyntaxError(e+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(e)):(this.consume(),this.delegate.appendToAttributeName(e))},afterAttributeName:function(){var e=this.peek();Pt(e)?this.consume():"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.consume(),this.transitionTo("beforeAttributeValue")):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e))},beforeAttributeValue:function(){var e=this.peek();Pt(e)?this.consume():'"'===e?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):"'"===e?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(e))},attributeValueDoubleQuoted:function(){var e=this.consume();'"'===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueSingleQuoted:function(){var e=this.consume();"'"===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueUnquoted:function(){var e=this.peek();Pt(e)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"&"===e?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):">"===e?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(e))},afterAttributeValueQuoted:function(){var e=this.peek();Pt(e)?(this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.consume(),this.transitionTo("selfClosingStartTag")):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){">"===this.peek()?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var e=this.consume();("@"===e||":"===e||Mt(e))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(e))}},this.reset()}return e.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},e.prototype.transitionTo=function(e){this.state=e},e.prototype.tokenize=function(e){this.reset(),this.tokenizePart(e),this.tokenizeEOF()},e.prototype.tokenizePart=function(e){for(this.input+=function(e){return e.replace(At,"\n")}(e);this.index<this.input.length;){var t=this.states[this.state];if(void 0===t)throw new Error("unhandled state "+this.state);t.call(this)}},e.prototype.tokenizeEOF=function(){this.flushData()},e.prototype.flushData=function(){"data"===this.state&&(this.delegate.finishData(),this.transitionTo("beforeData"))},e.prototype.peek=function(){return this.input.charAt(this.index)},e.prototype.consume=function(){var e=this.peek();return this.index++,"\n"===e?(this.line++,this.column=0):this.column++,e},e.prototype.consumeCharRef=function(){var e=this.input.indexOf(";",this.index);if(-1!==e){var t=this.input.slice(this.index,e),r=this.entityParser.parse(t);if(r){for(var n=t.length;n;)this.consume(),n--;return this.consume(),r}}},e.prototype.markTagStart=function(){this.delegate.tagOpen()},e.prototype.appendToTagName=function(e){this.tagNameBuffer+=e,this.delegate.appendToTagName(e)},e.prototype.isIgnoredEndTag=function(){var e=this.tagNameBuffer;return"title"===e&&"</title>"!==this.input.substring(this.index,this.index+8)||"style"===e&&"</style>"!==this.input.substring(this.index,this.index+8)||"script"===e&&"<\/script>"!==this.input.substring(this.index,this.index+9)},e}(),Dt=function(){function e(e,t){void 0===t&&(t={}),this.options=t,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new Lt(this,e,t.mode),this._currentAttribute=void 0}return e.prototype.tokenize=function(e){return this.tokens=[],this.tokenizer.tokenize(e),this.tokens},e.prototype.tokenizePart=function(e){return this.tokens=[],this.tokenizer.tokenizePart(e),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var e=this.token;if(null===e)throw new Error("token was unexpectedly null");if(0===arguments.length)return e;for(var t=0;t<arguments.length;t++)if(e.type===arguments[t])return e;throw new Error("token type was unexpectedly "+e.type)},e.prototype.push=function(e){this.token=e,this.tokens.push(e)},e.prototype.currentAttribute=function(){return this._currentAttribute},e.prototype.addLocInfo=function(){this.options.loc&&(this.current().loc={start:{line:this.startLine,column:this.startColumn},end:{line:this.tokenizer.line,column:this.tokenizer.column}}),this.startLine=this.tokenizer.line,this.startColumn=this.tokenizer.column},e.prototype.beginDoctype=function(){this.push({type:"Doctype",name:""})},e.prototype.appendToDoctypeName=function(e){this.current("Doctype").name+=e},e.prototype.appendToDoctypePublicIdentifier=function(e){var t=this.current("Doctype");void 0===t.publicIdentifier?t.publicIdentifier=e:t.publicIdentifier+=e},e.prototype.appendToDoctypeSystemIdentifier=function(e){var t=this.current("Doctype");void 0===t.systemIdentifier?t.systemIdentifier=e:t.systemIdentifier+=e},e.prototype.endDoctype=function(){this.addLocInfo()},e.prototype.beginData=function(){this.push({type:"Chars",chars:""})},e.prototype.appendToData=function(e){this.current("Chars").chars+=e},e.prototype.finishData=function(){this.addLocInfo()},e.prototype.beginComment=function(){this.push({type:"Comment",chars:""})},e.prototype.appendToCommentData=function(e){this.current("Comment").chars+=e},e.prototype.finishComment=function(){this.addLocInfo()},e.prototype.tagOpen=function(){},e.prototype.beginStartTag=function(){this.push({type:"StartTag",tagName:"",attributes:[],selfClosing:!1})},e.prototype.beginEndTag=function(){this.push({type:"EndTag",tagName:""})},e.prototype.finishTag=function(){this.addLocInfo()},e.prototype.markTagAsSelfClosing=function(){this.current("StartTag").selfClosing=!0},e.prototype.appendToTagName=function(e){this.current("StartTag","EndTag").tagName+=e},e.prototype.beginAttribute=function(){this._currentAttribute=["","",!1]},e.prototype.appendToAttributeName=function(e){this.currentAttribute()[0]+=e},e.prototype.beginAttributeValue=function(e){this.currentAttribute()[2]=e},e.prototype.appendToAttributeValue=function(e){this.currentAttribute()[1]+=e},e.prototype.finishAttributeValue=function(){this.current("StartTag").attributes.push(this._currentAttribute)},e.prototype.reportSyntaxError=function(e){this.current().syntaxError=e},e}();var zt=r("rmEH");function It(){function e(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return e("Block validation: "+t,...n)}}return{error:e(console.error),warning:e(console.warn),getItems:()=>[]}}const Ht=/[\t\n\r\v\f ]+/g,Vt=/^[\t\n\r\v\f ]*$/,Rt=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,$t=["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"],Ft=[...$t,"autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],qt=[i.identity,function(e){return Yt(e).join(" ")}],Ut=/^[\da-z]+$/i,Gt=/^#\d+$/,Kt=/^#x[\da-f]+$/i;class Wt{parse(e){if(t=e,Ut.test(t)||Gt.test(t)||Kt.test(t))return Object(zt.decodeEntities)("&"+e+";");var t}}function Yt(e){return e.trim().split(Ht)}function Qt(e){return e.attributes.filter(e=>{const[t,r]=e;return r||0===t.indexOf("data-")||Object(i.includes)(Ft,t)})}function Zt(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:It(),n=e.chars,a=t.chars;for(let e=0;e<qt.length;e++){const t=qt[e];if(n=t(n),a=t(a),n===a)return!0}return r.warning("Expected text `%s`, saw `%s`.",t.chars,e.chars),!1}function Xt(e){return 0===parseFloat(e)?"0":0===e.indexOf(".")?"0"+e:e}function Jt(e){return Yt(e).map(Xt).join(" ").replace(Rt,"url($1)")}function er(e){const t=e.replace(/;?\s*$/,"").split(";").map(e=>{const[t,...r]=e.split(":"),n=r.join(":");return[t.trim(),Jt(n.trim())]});return Object(i.fromPairs)(t)}const tr={class:(e,t)=>!Object(i.xor)(...[e,t].map(Yt)).length,style:(e,t)=>Object(i.isEqual)(...[e,t].map(er)),...Object(i.fromPairs)($t.map(e=>[e,i.stubTrue]))};function rr(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:It();if(e.length!==t.length)return r.warning("Expected attributes %o, instead saw %o.",t,e),!1;const n={};for(let e=0;e<t.length;e++)n[t[e][0].toLowerCase()]=t[e][1];for(let t=0;t<e.length;t++){const[a,o]=e[t],i=a.toLowerCase();if(!n.hasOwnProperty(i))return r.warning("Encountered unexpected attribute `%s`.",a),!1;const s=n[i],c=tr[i];if(c){if(!c(o,s))return r.warning("Expected attribute `%s` of value `%s`, saw `%s`.",a,s,o),!1}else if(o!==s)return r.warning("Expected attribute `%s` of value `%s`, saw `%s`.",a,s,o),!1}return!0}const nr={StartTag:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:It();return e.tagName!==t.tagName&&e.tagName.toLowerCase()!==t.tagName.toLowerCase()?(r.warning("Expected tag name `%s`, instead saw `%s`.",t.tagName,e.tagName),!1):rr(...[e,t].map(Qt),r)},Chars:Zt,Comment:Zt};function ar(e){let t;for(;t=e.shift();){if("Chars"!==t.type)return t;if(!Vt.test(t.chars))return t}}function or(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:It();try{return new Dt(new Wt).tokenize(e)}catch(r){t.warning("Malformed HTML detected: %s",e)}return null}function ir(e,t){return!!e.selfClosing&&!(!t||t.tagName!==e.tagName||"EndTag"!==t.type)}function sr(e,t){if(e.name===ee()||e.name===ne())return[!0];const r=function(){const e=[],t=It();return{error(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];e.push({log:t.error,args:n})},warning(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];e.push({log:t.warning,args:n})},getItems:()=>e}}(),n=Ie(t);let a;try{a=wt(n,e.attributes)}catch(e){return r.error("Block validation failed because an error occurred while generating block content:\n\n%s",e.toString()),[!1,r.getItems()]}const o=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:It();if(e===t)return!0;const[n,a]=[e,t].map(e=>or(e,r));if(!n||!a)return!1;let o,i;for(;o=ar(n);){if(i=ar(a),!i)return r.warning("Expected end of content, instead saw %o.",o),!1;if(o.type!==i.type)return r.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",i.type,i,o.type,o),!1;const e=nr[o.type];if(e&&!e(o,i,r))return!1;ir(o,a[0])?ar(a):ir(i,n[0])&&ar(n)}return!(i=ar(a))||(r.warning("Expected %o, instead saw end of content.",i),!1)}(e.originalContent,a,r);return o||r.error("Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",n.name,n,a,e.originalContent),[o,r.getItems()]}function cr(e,t,r){const n=Ie(e),a={name:n.name,attributes:t,innerBlocks:[],originalContent:r},[o]=sr(a,n);return o}function lr(e,t){const r={...t};if("core/cover-image"===e&&(e="core/cover"),"core/text"!==e&&"core/cover-text"!==e||(e="core/paragraph"),e&&0===e.indexOf("core/social-link-")&&(r.service=e.substring(17),e="core/social-link"),e&&0===e.indexOf("core-embed/")){const t=e.substring(11),n={speaker:"speaker-deck",polldaddy:"crowdsignal"};r.providerNameSlug=t in n?n[t]:t,["amazon-kindle","wordpress"].includes(t)||(r.responsive=!0),e="core/embed"}return"core/query-loop"===e&&(e="core/post-template"),"core/post-comment-author"===e&&(e="core/comment-author-name"),"core/post-comment-content"===e&&(e="core/comment-content"),"core/post-comment-date"===e&&(e="core/comment-date"),[e,r]}function ur(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{isCommentDelimited:r=!0}=t,{blockName:n,attrs:a={},innerBlocks:o=[],innerContent:i=[]}=e;let s=0;const c=i.map(e=>null!==e?e:ur(o[s++],t)).join("\n").replace(/\n+/g,"\n").trim();return r?Tt(n,a,c):c}function dr(e,t){for(var r,n=t.split(".");r=n.shift();){if(!(r in e))return;e=e[r]}return e}var pr,hr=function(){return pr||(pr=document.implementation.createHTMLDocument("")),pr};function fr(e,t){if(t){if("string"==typeof e){var r=hr();r.body.innerHTML=e,e=r.body}if("function"==typeof t)return t(e);if(Object===t.constructor)return Object.keys(t).reduce((function(r,n){return r[n]=fr(e,t[n]),r}),{})}}function gr(e,t){return 1===arguments.length&&(t=e,e=void 0),function(r){var n=r;if(e&&(n=r.querySelector(e)),n)return dr(n,t)}}function mr(e){const t={};for(let r=0;r<e.length;r++){const{name:n,value:a}=e[r];t[n]=a}return t}function br(e){if(e.nodeType===e.TEXT_NODE)return e.nodeValue;if(e.nodeType!==e.ELEMENT_NODE)throw new TypeError("A block node can only be created from a node of type text or element.");return{type:e.nodeName.toLowerCase(),props:{...mr(e.attributes),children:yr(e.childNodes)}}}function _r(e){return t=>{let r=t;e&&(r=t.querySelector(e));try{return br(r)}catch(e){return null}}}var kr={isNodeOfType:function(e,t){return e&&e.type===t},fromDOM:br,toHTML:function(e){return wr([e])},matcher:_r};function yr(e){const t=[];for(let r=0;r<e.length;r++)try{t.push(br(e[r]))}catch(e){}return t}function wr(e){const t=e;return Object(V.renderToString)(t)}function vr(e){return t=>{let r=t;return e&&(r=t.querySelector(e)),r?yr(r.childNodes):[]}}var jr={concat:function(){const e=[];for(let t=0;t<arguments.length;t++){const r=Object(i.castArray)(t<0||arguments.length<=t?void 0:arguments[t]);for(let t=0;t<r.length;t++){const n=r[t];"string"==typeof n&&"string"==typeof e[e.length-1]?e[e.length-1]+=n:e.push(n)}}return e},getChildrenArray:function(e){return e},fromDOM:yr,toHTML:wr,matcher:vr};function Tr(e,t){return t.some(t=>function(e,t){switch(t){case"string":return"string"==typeof e;case"boolean":return"boolean"==typeof e;case"object":return!!e&&e.constructor===Object;case"null":return null===e;case"array":return Array.isArray(e);case"integer":case"number":return"number"==typeof e}return!0}(e,t))}function Or(e,t,r,n){const{type:a,enum:o}=t;let s;switch(t.source){case void 0:s=n?n[e]:void 0;break;case"attribute":case"property":case"html":case"text":case"children":case"node":case"query":case"tag":s=xr(r,t)}return function(e,t){return void 0===t||Tr(e,Object(i.castArray)(t))}(s,a)&&function(e,t){return!Array.isArray(t)||t.includes(e)}(s,o)||(s=void 0),void 0===s?t.default:s}function Cr(e){switch(e.source){case"attribute":let n=function(e,t){return 1===arguments.length&&(t=e,e=void 0),function(r){var n=gr(e,"attributes")(r);if(n&&n.hasOwnProperty(t))return n[t].value}}(e.selector,e.attribute);return"boolean"===e.type&&(n=(e=>Object(i.flow)([e,e=>void 0!==e]))(n)),n;case"html":return t=e.selector,r=e.multiline,e=>{let n=e;if(t&&(n=e.querySelector(t)),!n)return"";if(r){let e="";const t=n.children.length;for(let a=0;a<t;a++){const t=n.children[a];t.nodeName.toLowerCase()===r&&(e+=t.outerHTML)}return e}return n.innerHTML};case"text":return function(e){return gr(e,"textContent")}(e.selector);case"children":return vr(e.selector);case"node":return _r(e.selector);case"query":const a=Object(i.mapValues)(e.query,Cr);return function(e,t){return function(r){var n=r.querySelectorAll(e);return[].map.call(n,(function(e){return fr(e,t)}))}}(e.selector,a);case"tag":return Object(i.flow)([gr(e.selector,"nodeName"),e=>e?e.toLowerCase():void 0]);default:console.error(`Unknown source type "${e.source}"`)}var t,r}function xr(e,t){return fr(e,Cr(t))}function Sr(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=Ie(e),a=Object(i.mapValues)(n.attributes,(e,n)=>Or(n,e,t,r));return Object(D.applyFilters)("blocks.getBlockAttributes",a,n,t,r)}function Er(e){const t=xr(e=`<div data-custom-class-name>${e}</div>`,{type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"});return t?t.trim().split(/\s+/):[]}function Br(e,t){const r=function(e,t,r){if(ue(t,"customClassName",!0)){const n=wt(t,Object(i.omit)(e,["className"])),a=Er(n),o=Er(r),s=Object(i.difference)(o,a);s.length?e.className=s.join(" "):n&&delete e.className}return e}(e.attributes,t,e.originalContent);return{...e,attributes:r}}function Nr(e){let t=function(e){const t=ee(),r=e.blockName||ee(),n=e.attrs||{},a=e.innerBlocks||[];let o=e.innerHTML.trim();return r===t&&(o=Object(dt.autop)(o).trim()),{...e,blockName:r,attrs:n,innerHTML:o,innerBlocks:a}}(e);t=function(e){const[t,r]=lr(e.blockName,e.attrs);return{...e,blockName:t,attrs:r}}(t);let r=se(t.blockName);r||(t=function(e){const t=ne()||ee(),r=ur(e,{isCommentDelimited:!1}),n=ur(e,{isCommentDelimited:!0});return{blockName:t,attrs:{originalName:e.blockName,originalContent:n,originalUndelimitedContent:r},innerHTML:e.blockName?n:e.innerHTML,innerBlocks:e.innerBlocks,innerContent:e.innerContent}}(t),r=se(t.blockName));const n=t.blockName===ee()||t.blockName===ne();if(!r||!t.innerHTML&&n)return;const a=t.innerBlocks.map(Nr).filter(e=>!!e);let o=ve(t.blockName,Sr(r,t.innerHTML,t.attrs),a);o.originalContent=t.innerHTML;let[s,c]=sr(o,r);return s||(o=Br(o,r),[s,c]=sr(o,r)),o.isValid=s,o.validationIssues=c,o=function(e,t,r){const n=t.attrs,{deprecated:a}=r;if(!a||!a.length)return e;for(let t=0;t<a.length;t++){const{isEligible:o=i.stubFalse}=a[t];if(e.isValid&&!o(n,e.innerBlocks))continue;const s=Object.assign(Object(i.omit)(r,$),a[t]);let c={...e,attributes:Sr(s,e.originalContent,n)},[l]=sr(c,s);if(l||(c=Br(c,s),[l]=sr(c,s)),!l)continue;let u=c.innerBlocks,d=c.attributes;const{migrate:p}=s;p&&([d=n,u=e.innerBlocks]=Object(i.castArray)(p(d,e.innerBlocks))),e={...e,attributes:d,innerBlocks:u,isValid:!0,validationIssues:[]}}return e}(o,t,r),c&&c.length>0&&(o.isValid?(console.groupCollapsed("Updated Block: %s",r.name),console.info("Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",r.name,r,wt(r,o.attributes),o.originalContent),console.groupEnd()):c.forEach(e=>{let{log:t,args:r}=e;return t(...r)})),o}function Ar(e){return Object(ut.parse)(e).reduce((e,t)=>{const r=Nr(t);return r&&e.push(r),e},[])}function Pr(){return Object(i.filter)(Ne("from"),{type:"raw"}).map(e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)})}function Mr(e){const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children).flatMap(e=>{const t=Be(Pr(),t=>{let{isMatch:r}=t;return r(e)});if(!t)return ve("core/html",Sr("core/html",e.outerHTML));const{transform:r,blockName:n}=t;return r?r(e):ve(n,Sr(n,e.outerHTML))})}function Lr(e){const t=document.implementation.createHTMLDocument(""),r=document.implementation.createHTMLDocument(""),n=t.body,a=r.body;for(n.innerHTML=e;n.firstChild;){const e=n.firstChild;e.nodeType===e.TEXT_NODE?Object(R.isEmpty)(e)?n.removeChild(e):(a.lastChild&&"P"===a.lastChild.nodeName||a.appendChild(r.createElement("P")),a.lastChild.appendChild(e)):e.nodeType===e.ELEMENT_NODE?"BR"===e.nodeName?(e.nextSibling&&"BR"===e.nextSibling.nodeName&&(a.appendChild(r.createElement("P")),n.removeChild(e.nextSibling)),a.lastChild&&"P"===a.lastChild.nodeName&&a.lastChild.hasChildNodes()?a.lastChild.appendChild(e):n.removeChild(e)):"P"===e.nodeName?Object(R.isEmpty)(e)?n.removeChild(e):a.appendChild(e):Object(R.isPhrasingContent)(e)?(a.lastChild&&"P"===a.lastChild.nodeName||a.appendChild(r.createElement("P")),a.lastChild.appendChild(e)):a.appendChild(e):n.removeChild(e)}return a.innerHTML}function Dr(e,t){if(e.nodeType===e.COMMENT_NODE)if("nextpage"!==e.nodeValue){if(0===e.nodeValue.indexOf("more")){const r=e.nodeValue.slice(4).trim();let n=e,a=!1;for(;n=n.nextSibling;)if(n.nodeType===n.COMMENT_NODE&&"noteaser"===n.nodeValue){a=!0,Object(R.remove)(n);break}Object(R.replace)(e,function(e,t,r){const n=r.createElement("wp-block");n.dataset.block="core/more",e&&(n.dataset.customText=e);t&&(n.dataset.noTeaser="");return n}(r,a,t))}}else Object(R.replace)(e,function(e){const t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}(t))}function zr(e){e.nodeType===e.COMMENT_NODE&&Object(R.remove)(e)}function Ir(e,t){return e.every(e=>function(e,t){if(Object(R.isTextContent)(e))return!0;if(!t)return!1;const r=e.nodeName.toLowerCase();return[["ul","li","ol"],["h1","h2","h3","h4","h5","h6"]].some(e=>0===Object(i.difference)([r,t],e).length)}(e,t)&&Ir(Array.from(e.children),t))}function Hr(e){return"BR"===e.nodeName&&e.previousSibling&&"BR"===e.previousSibling.nodeName}function Vr(e,t){if("SPAN"===e.nodeName&&e.style){const{fontWeight:r,fontStyle:n,textDecorationLine:a,textDecoration:o,verticalAlign:s}=e.style;"bold"!==r&&"700"!==r||Object(R.wrap)(t.createElement("strong"),e),"italic"===n&&Object(R.wrap)(t.createElement("em"),e),("line-through"===a||Object(i.includes)(o,"line-through"))&&Object(R.wrap)(t.createElement("s"),e),"super"===s?Object(R.wrap)(t.createElement("sup"),e):"sub"===s&&Object(R.wrap)(t.createElement("sub"),e)}else"B"===e.nodeName?e=Object(R.replaceTag)(e,"strong"):"I"===e.nodeName?e=Object(R.replaceTag)(e,"em"):"A"===e.nodeName&&(e.target&&"_blank"===e.target.toLowerCase()?e.rel="noreferrer noopener":(e.removeAttribute("target"),e.removeAttribute("rel")),e.name&&!e.id&&(e.id=e.name),e.id&&!e.ownerDocument.querySelector(`[href="#${e.id}"]`)&&e.removeAttribute("id"))}function Rr(e){"SCRIPT"!==e.nodeName&&"NOSCRIPT"!==e.nodeName&&"TEMPLATE"!==e.nodeName&&"STYLE"!==e.nodeName||e.parentNode.removeChild(e)}const{parseInt:$r}=window;function Fr(e){return"OL"===e.nodeName||"UL"===e.nodeName}function qr(e,t){if("P"!==e.nodeName)return;const r=e.getAttribute("style");if(!r)return;if(-1===r.indexOf("mso-list"))return;const n=/mso-list\s*:[^;]+level([0-9]+)/i.exec(r);if(!n)return;let a=$r(n[1],10)-1||0;const o=e.previousElementSibling;if(!o||!Fr(o)){const r=e.textContent.trim().slice(0,1),n=/[1iIaA]/.test(r),a=t.createElement(n?"ol":"ul");n&&a.setAttribute("type",r),e.parentNode.insertBefore(a,e)}const i=e.previousElementSibling,s=i.nodeName,c=t.createElement("li");let l=i;for(e.removeChild(e.firstElementChild);e.firstChild;)c.appendChild(e.firstChild);for(;a--;)l=l.lastElementChild||l,Fr(l)&&(l=l.lastElementChild||l);Fr(l)||(l=l.appendChild(t.createElement(s))),l.appendChild(c),e.parentNode.removeChild(e)}function Ur(e){return"OL"===e.nodeName||"UL"===e.nodeName}function Gr(e){if(!Ur(e))return;const t=e,r=e.previousElementSibling;if(r&&r.nodeName===e.nodeName&&1===t.children.length){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode.removeChild(t)}const n=e.parentNode;if(n&&"LI"===n.nodeName&&1===n.children.length&&!/\S/.test((a=n,Array.from(a.childNodes).map(e=>{let{nodeValue:t=""}=e;return t}).join("")))){const e=n,r=e.previousElementSibling,a=e.parentNode;r?(r.appendChild(t),a.removeChild(e)):(a.parentNode.insertBefore(t,a),a.parentNode.removeChild(a))}var a;if(n&&Ur(n)){const t=e.previousElementSibling;t?t.appendChild(e):Object(R.unwrap)(e)}}var Kr=r("xTGt");const{atob:Wr,File:Yr}=window;function Qr(e){if("IMG"===e.nodeName){if(0===e.src.indexOf("file:")&&(e.src=""),0===e.src.indexOf("data:")){const[t,r]=e.src.split(","),[n]=t.slice(5).split(";");if(!r||!n)return void(e.src="");let a;try{a=Wr(r)}catch(t){return void(e.src="")}const o=new Uint8Array(a.length);for(let e=0;e<o.length;e++)o[e]=a.charCodeAt(e);const i=n.replace("/","."),s=new Yr([o],i,{type:n});e.src=Object(Kr.createBlobURL)(s)}1!==e.height&&1!==e.width||e.parentNode.removeChild(e)}}function Zr(e){"BLOCKQUOTE"===e.nodeName&&(e.innerHTML=Lr(e.innerHTML))}function Xr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const r=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(r,t),r.appendChild(e)}function Jr(e,t,r){if(!function(e,t){const r=e.nodeName.toLowerCase();return"figcaption"!==r&&!Object(R.isTextContent)(e)&&Object(i.has)(t,["figure","children",r])}(e,r))return;let n=e;const a=e.parentNode;(function(e,t){const r=e.nodeName.toLowerCase();return Object(i.has)(t,["figure","children","a","children",r])})(e,r)&&"A"===a.nodeName&&1===a.childNodes.length&&(n=e.parentNode);const o=n.closest("p,div");o?e.classList?(e.classList.contains("alignright")||e.classList.contains("alignleft")||e.classList.contains("aligncenter")||!o.textContent.trim())&&Xr(n,o):Xr(n,o):"BODY"===n.parentNode.nodeName&&Xr(n)}var en=r("SVSp");var tn=function e(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const a=Ne("from"),o=Be(a,e=>-1===n.indexOf(e.blockName)&&"shortcode"===e.type&&Object(i.some)(Object(i.castArray)(e.tag),e=>Object(en.regexp)(e).test(t)));if(!o)return[t];const s=Object(i.castArray)(o.tag),c=Object(i.find)(s,e=>Object(en.regexp)(e).test(t));let l;const u=r;if(l=Object(en.next)(c,t,r)){r=l.index+l.content.length;const a=t.substr(0,l.index),s=t.substr(r);if(!(Object(i.includes)(l.shortcode.content||"","<")||/(\n|<p>)\s*$/.test(a)&&/^\s*(\n|<\/p>)/.test(s)))return e(t,r);if(o.isMatch&&!o.isMatch(l.shortcode.attrs))return e(t,u,[...n,o.blockName]);const c=Object(i.mapValues)(Object(i.pickBy)(o.attributes,e=>e.shortcode),e=>e.shortcode(l.shortcode.attrs,l)),d={...se(o.blockName),attributes:o.attributes};let p=ve(o.blockName,Sr(d,l.shortcode.content,c));return p.originalContent=l.shortcode.content,p=Br(p,d),[...e(a),p,...e(s)]}return[t]},rn=r("M55E");const nn=new(r.n(rn).a.Converter)({noHeaderId:!0,tables:!0,literalMidWordUnderscores:!0,omitExtraWLInCodeBlocks:!0,simpleLineBreaks:!0,strikethrough:!0});function an(e){if("IFRAME"===e.nodeName){const t=e.ownerDocument.createTextNode(e.src);e.parentNode.replaceChild(t,e)}}function on(e){e.id&&0===e.id.indexOf("docs-internal-guid-")&&Object(R.unwrap)(e)}function sn(e){return function(e,t){const r={phrasingContentSchema:Object(R.getPhrasingContentSchema)(t),isPaste:"paste"===t},n=e.map(e=>{let{isMatch:t,blockName:n,schema:a}=e;const o=ue(n,"anchor");return a=Object(i.isFunction)(a)?a(r):a,o||t?Object(i.mapValues)(a,e=>{let r=e.attributes||[];return o&&(r=[...r,"id"]),{...e,attributes:r,isMatch:t||void 0}}):a});return Object(i.mergeWith)({},...n,(e,t,r)=>{switch(r){case"children":return"*"===e||"*"===t?"*":{...e,...t};case"attributes":case"require":return[...e||[],...t||[]];case"isMatch":if(!e||!t)return;return function(){return e(...arguments)||t(...arguments)}}})}(Pr(),e)}function cn(e,t,r,n){Array.from(e).forEach(e=>{cn(e.childNodes,t,r,n),t.forEach(t=>{r.contains(e)&&t(e,r,n)})})}function ln(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,cn(n.body.childNodes,t,n,r),n.body.innerHTML}function un(e,t){const r=e[t+"Sibling"];if(r&&Object(R.isPhrasingContent)(r))return r;const{parentNode:n}=e;return n&&Object(R.isPhrasingContent)(n)?un(n,t):void 0}function dn(e){if(e.nodeType!==e.TEXT_NODE)return;let t=e;for(;t=t.parentNode;)if(t.nodeType===t.ELEMENT_NODE&&"PRE"===t.nodeName)return;let r=e.data.replace(/[ \r\n\t]+/g," ");if(" "===r[0]){const t=un(e,"previous");t&&"BR"!==t.nodeName&&" "!==t.textContent.slice(-1)||(r=r.slice(1))}if(" "===r[r.length-1]){const t=un(e,"next");(!t||"BR"===t.nodeName||t.nodeType===t.TEXT_NODE&&(" "===(n=t.textContent[0])||"\r"===n||"\n"===n||"\t"===n))&&(r=r.slice(0,-1))}var n;r?e.data=r:e.parentNode.removeChild(e)}function pn(e){"BR"===e.nodeName&&(un(e,"next")||e.parentNode.removeChild(e))}function hn(e){"P"===e.nodeName&&(e.hasChildNodes()||e.parentNode.removeChild(e))}const{console:fn}=window;function gn(e,t){return e=ln(e,[on,Vr,zr]),e=Object(R.removeInvalidHTML)(e,Object(R.getPhrasingContentSchema)("paste"),{inline:!0}),t||(e=ln(e,[dn,pn])),fn.log("Processed inline HTML:\n\n",e),e}function mn(e){let{HTML:t="",plainText:r="",mode:n="AUTO",tagName:a,preserveWhiteSpace:o}=e;if(t=t.replace(/<meta[^>]+>/g,""),t=t.replace(/^\s*<html[^>]*>\s*<body[^>]*>(?:\s*<!--\s*StartFragment\s*-->)?/i,""),t=t.replace(/(?:<!--\s*EndFragment\s*-->\s*)?<\/body>\s*<\/html>\s*$/i,""),"INLINE"!==n){const e=t||r;if(-1!==e.indexOf("\x3c!-- wp:"))return Ar(e)}var s;if(String.prototype.normalize&&(t=t.normalize()),!r||t&&!function(e){return!/<(?!br[ />])/i.test(e)}(t)||(t=r,/^\s+$/.test(r)||(s=t,t=nn.makeHtml(function(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,(e,t,r,n)=>`${t}\n${r}\n${n}`)}(s))),"AUTO"===n&&-1===r.indexOf("\n")&&0!==r.indexOf("<p>")&&0===t.indexOf("<p>")&&(n="INLINE")),"INLINE"===n)return gn(t,o);const c=tn(t),l=c.length>1;if("AUTO"===n&&!l&&function(e,t){const r=document.implementation.createHTMLDocument("");r.body.innerHTML=e;const n=Array.from(r.body.children);return!n.some(Hr)&&Ir(n,t)}(t,a))return gn(t,o);const u=Object(R.getPhrasingContentSchema)("paste"),d=sn("paste"),p=Object(i.compact)(Object(i.flatMap)(c,e=>{if("string"!=typeof e)return e;const t=[on,qr,Rr,Gr,Qr,Vr,Dr,zr,an,Jr,Zr],r={...d,...u};return e=ln(e,t,d),e=ln(e=Lr(e=Object(R.removeInvalidHTML)(e,r)),[dn,pn,hn],d),fn.log("Processed HTML piece:\n\n",e),Mr(e)}));if("AUTO"===n&&1===p.length&&ue(p[0].name,"__unstablePasteTextInline",!1)){const e=r.replace(/^[\n]+|[\n]+$/g,"");if(""!==e&&-1===e.indexOf("\n"))return Object(R.removeInvalidHTML)(jt(p[0]),u)}return p}var bn=r("NMb1"),_n=r.n(bn);function kn(e){return _n()("wp.blocks.getPhrasingContentSchema",{since:"5.6",alternative:"wp.dom.getPhrasingContentSchema"}),Object(R.getPhrasingContentSchema)(e)}function yn(e){let{HTML:t=""}=e;if(-1!==t.indexOf("\x3c!-- wp:"))return Ar(t);const r=tn(t),n=sn();return Object(i.compact)(Object(i.flatMap)(r,e=>{if("string"!=typeof e)return e;return Mr(e=Lr(e=ln(e,[Gr,Dr,Jr,Zr],n)))}))}function wn(){return Object(o.select)(lt).getCategories()}function vn(e){Object(o.dispatch)(lt).setCategories(e)}function jn(e,t){Object(o.dispatch)(lt).updateCategory(e,t)}function Tn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length===t.length&&Object(i.every)(t,(t,r)=>{let[n,,a]=t;const o=e[r];return n===o.name&&Tn(o.innerBlocks,a)})}function On(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return t?Object(i.map)(t,(t,r)=>{let[n,a,o]=t;const s=e[r];if(s&&s.name===n){const e=On(s.innerBlocks,o);return{...s,innerBlocks:e}}const c=se(n),l=(e,t)=>Object(i.mapValues)(t,(t,r)=>u(e[r],t)),u=(e,t)=>{return r=e,"html"===Object(i.get)(r,["source"])&&Object(i.isArray)(t)?Object(V.renderToString)(t):(e=>"query"===Object(i.get)(e,["source"]))(e)&&t?t.map(t=>l(e.query,t)):t;var r},d=l(Object(i.get)(c,["attributes"],{}),a),[p,h]=lr(n,d);return ve(p,h,On([],o))}):e}var Cn=r("wx14"),xn=r("K9lf");const{Consumer:Sn,Provider:En}=Object(V.createContext)(()=>{}),Bn=Object(xn.createHigherOrderComponent)(e=>t=>Object(V.createElement)(Sn,null,r=>Object(V.createElement)(e,Object(Cn.a)({},t,{BlockContent:r}))),"withBlockContentContext")},"1CF3":function(e,t){e.exports=window.wp.dom},"1ZqX":function(e,t){e.exports=window.wp.data},"7Cbv":function(e,t,r){"use strict";var n,a=new Uint8Array(16);function o(){if(!n&&!(n="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 n(a)}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 s=function(e){return"string"==typeof e&&i.test(e)},c=[],l=0;l<256;++l)c.push((l+256).toString(16).substr(1));var u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(c[e[t+0]]+c[e[t+1]]+c[e[t+2]]+c[e[t+3]]+"-"+c[e[t+4]]+c[e[t+5]]+"-"+c[e[t+6]]+c[e[t+7]]+"-"+c[e[t+8]]+c[e[t+9]]+"-"+c[e[t+10]]+c[e[t+11]]+c[e[t+12]]+c[e[t+13]]+c[e[t+14]]+c[e[t+15]]).toLowerCase();if(!s(r))throw TypeError("Stringified UUID is invalid");return r};t.a=function(e,t,r){var n=(e=e||{}).random||(e.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var a=0;a<16;++a)t[r+a]=n[a];return t}return u(n)}},"7bKH":function(e,t,r){"use strict";var n=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},a=function(e){return.2126*n(e.r)+.7152*n(e.g)+.0722*n(e.b)};t.a=function(e){e.prototype.luminance=function(){return e=a(this.rgba),void 0===(t=2)&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r+0;var e,t,r},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var r,n,o,i,s,c,l,u=t instanceof e?t:new e(t);return i=this.rgba,s=u.toRgb(),r=(c=a(i))>(l=a(s))?(c+.05)/(l+.05):(l+.05)/(c+.05),void 0===(n=2)&&(n=0),void 0===o&&(o=Math.pow(10,n)),Math.floor(o*r)/o+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(o=(r=t).size)?"normal":o,"AAA"===(a=void 0===(n=r.level)?"AA":n)&&"normal"===i?7:"AA"===a&&"large"===i?3:4.5);var r,n,a,o,i}}},GRId:function(e,t){e.exports=window.wp.element},K9lf:function(e,t){e.exports=window.wp.compose},M55E:function(e,t,r){var n;/*! showdown v 1.9.1 - 02-11-2019 */
-(function(){function a(e){"use strict";var t={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:"Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,description:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,description:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,description:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(!1===e)return JSON.parse(JSON.stringify(t));var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n].defaultValue);return r}var o={},i={},s={},c=a(!0),l="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:a(!0),allOn:function(){"use strict";var e=a(!0),t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=!0);return t}()};function d(e,t){"use strict";var r=t?"Error in "+t+" extension->":"Error in unnamed extension",n={valid:!0,error:""};o.helper.isArray(e)||(e=[e]);for(var a=0;a<e.length;++a){var i=r+" sub-extension "+a+": ",s=e[a];if("object"!=typeof s)return n.valid=!1,n.error=i+"must be an object, but "+typeof s+" given",n;if(!o.helper.isString(s.type))return n.valid=!1,n.error=i+'property "type" must be a string, but '+typeof s.type+" given",n;var c=s.type=s.type.toLowerCase();if("language"===c&&(c=s.type="lang"),"html"===c&&(c=s.type="output"),"lang"!==c&&"output"!==c&&"listener"!==c)return n.valid=!1,n.error=i+"type "+c+' is not recognized. Valid values: "lang/language", "output/html" or "listener"',n;if("listener"===c){if(o.helper.isUndefined(s.listeners))return n.valid=!1,n.error=i+'. Extensions of type "listener" must have a property called "listeners"',n}else if(o.helper.isUndefined(s.filter)&&o.helper.isUndefined(s.regex))return n.valid=!1,n.error=i+c+' extensions must define either a "regex" property or a "filter" method',n;if(s.listeners){if("object"!=typeof s.listeners)return n.valid=!1,n.error=i+'"listeners" property must be an object but '+typeof s.listeners+" given",n;for(var l in s.listeners)if(s.listeners.hasOwnProperty(l)&&"function"!=typeof s.listeners[l])return n.valid=!1,n.error=i+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+l+" must be a function but "+typeof s.listeners[l]+" given",n}if(s.filter){if("function"!=typeof s.filter)return n.valid=!1,n.error=i+'"filter" must be a function, but '+typeof s.filter+" given",n}else if(s.regex){if(o.helper.isString(s.regex)&&(s.regex=new RegExp(s.regex,"g")),!(s.regex instanceof RegExp))return n.valid=!1,n.error=i+'"regex" property must either be a string or a RegExp object, but '+typeof s.regex+" given",n;if(o.helper.isUndefined(s.replace))return n.valid=!1,n.error=i+'"regex" extensions must implement a replace string or function',n}}return n}function p(e,t){"use strict";return"¨E"+t.charCodeAt(0)+"E"}o.helper={},o.extensions={},o.setOption=function(e,t){"use strict";return c[e]=t,this},o.getOption=function(e){"use strict";return c[e]},o.getOptions=function(){"use strict";return c},o.resetOptions=function(){"use strict";c=a(!0)},o.setFlavor=function(e){"use strict";if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");o.resetOptions();var t=u[e];for(var r in l=e,t)t.hasOwnProperty(r)&&(c[r]=t[r])},o.getFlavor=function(){"use strict";return l},o.getFlavorOptions=function(e){"use strict";if(u.hasOwnProperty(e))return u[e]},o.getDefaultOptions=function(e){"use strict";return a(e)},o.subParser=function(e,t){"use strict";if(o.helper.isString(e)){if(void 0===t){if(i.hasOwnProperty(e))return i[e];throw Error("SubParser named "+e+" not registered!")}i[e]=t}},o.extension=function(e,t){"use strict";if(!o.helper.isString(e))throw Error("Extension 'name' must be a string");if(e=o.helper.stdExtName(e),o.helper.isUndefined(t)){if(!s.hasOwnProperty(e))throw Error("Extension named "+e+" is not registered!");return s[e]}"function"==typeof t&&(t=t()),o.helper.isArray(t)||(t=[t]);var r=d(t,e);if(!r.valid)throw Error(r.error);s[e]=t},o.getAllExtensions=function(){"use strict";return s},o.removeExtension=function(e){"use strict";delete s[e]},o.resetExtensions=function(){"use strict";s={}},o.validateExtension=function(e){"use strict";var t=d(e,null);return!!t.valid||(console.warn(t.error),!1)},o.hasOwnProperty("helper")||(o.helper={}),o.helper.isString=function(e){"use strict";return"string"==typeof e||e instanceof String},o.helper.isFunction=function(e){"use strict";return e&&"[object Function]"==={}.toString.call(e)},o.helper.isArray=function(e){"use strict";return Array.isArray(e)},o.helper.isUndefined=function(e){"use strict";return void 0===e},o.helper.forEach=function(e,t){"use strict";if(o.helper.isUndefined(e))throw new Error("obj param is required");if(o.helper.isUndefined(t))throw new Error("callback param is required");if(!o.helper.isFunction(t))throw new Error("callback param must be a function/closure");if("function"==typeof e.forEach)e.forEach(t);else if(o.helper.isArray(e))for(var r=0;r<e.length;r++)t(e[r],r,e);else{if("object"!=typeof e)throw new Error("obj does not seem to be an array or an iterable object");for(var n in e)e.hasOwnProperty(n)&&t(e[n],n,e)}},o.helper.stdExtName=function(e){"use strict";return e.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()},o.helper.escapeCharactersCallback=p,o.helper.escapeCharacters=function(e,t,r){"use strict";var n="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])";r&&(n="\\\\"+n);var a=new RegExp(n,"g");return e=e.replace(a,p)},o.helper.unescapeHTMLEntities=function(e){"use strict";return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")};var h=function(e,t,r,n){"use strict";var a,o,i,s,c,l=n||"",u=l.indexOf("g")>-1,d=new RegExp(t+"|"+r,"g"+l.replace(/g/g,"")),p=new RegExp(t,l.replace(/g/g,"")),h=[];do{for(a=0;i=d.exec(e);)if(p.test(i[0]))a++||(s=(o=d.lastIndex)-i[0].length);else if(a&&!--a){c=i.index+i[0].length;var f={left:{start:s,end:o},match:{start:o,end:i.index},right:{start:i.index,end:c},wholeMatch:{start:s,end:c}};if(h.push(f),!u)return h}}while(a&&(d.lastIndex=o));return h};o.helper.matchRecursiveRegExp=function(e,t,r,n){"use strict";for(var a=h(e,t,r,n),o=[],i=0;i<a.length;++i)o.push([e.slice(a[i].wholeMatch.start,a[i].wholeMatch.end),e.slice(a[i].match.start,a[i].match.end),e.slice(a[i].left.start,a[i].left.end),e.slice(a[i].right.start,a[i].right.end)]);return o},o.helper.replaceRecursiveRegExp=function(e,t,r,n,a){"use strict";if(!o.helper.isFunction(t)){var i=t;t=function(){return i}}var s=h(e,r,n,a),c=e,l=s.length;if(l>0){var u=[];0!==s[0].wholeMatch.start&&u.push(e.slice(0,s[0].wholeMatch.start));for(var d=0;d<l;++d)u.push(t(e.slice(s[d].wholeMatch.start,s[d].wholeMatch.end),e.slice(s[d].match.start,s[d].match.end),e.slice(s[d].left.start,s[d].left.end),e.slice(s[d].right.start,s[d].right.end))),d<l-1&&u.push(e.slice(s[d].wholeMatch.end,s[d+1].wholeMatch.start));s[l-1].wholeMatch.end<e.length&&u.push(e.slice(s[l-1].wholeMatch.end)),c=u.join("")}return c},o.helper.regexIndexOf=function(e,t,r){"use strict";if(!o.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";if(t instanceof RegExp==!1)throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";var n=e.substring(r||0).search(t);return n>=0?n+(r||0):n},o.helper.splitAtIndex=function(e,t){"use strict";if(!o.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[e.substring(0,t),e.substring(t)]},o.helper.encodeEmailAddress=function(e){"use strict";var t=[function(e){return"&#"+e.charCodeAt(0)+";"},function(e){return"&#x"+e.charCodeAt(0).toString(16)+";"},function(e){return e}];return e=e.replace(/./g,(function(e){if("@"===e)e=t[Math.floor(2*Math.random())](e);else{var r=Math.random();e=r>.9?t[2](e):r>.45?t[1](e):t[0](e)}return e}))},o.helper.padEnd=function(e,t,r){"use strict";return t>>=0,r=String(r||" "),e.length>t?String(e):((t-=e.length)>r.length&&(r+=r.repeat(t/r.length)),String(e)+r.slice(0,t))},"undefined"==typeof console&&(console={warn:function(e){"use strict";alert(e)},log:function(e){"use strict";alert(e)},error:function(e){"use strict";throw e}}),o.helper.regexes={asteriskDashAndColon:/([*_:~])/g},o.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',showdown:"<span style=\"font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;\">S</span>"},o.Converter=function(e){"use strict";var t={},r=[],n=[],a={},i=l,p={parsed:{},raw:"",format:""};function h(e,t){if(t=t||null,o.helper.isString(e)){if(t=e=o.helper.stdExtName(e),o.extensions[e])return console.warn("DEPRECATION WARNING: "+e+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),void function(e,t){"function"==typeof e&&(e=e(new o.Converter));o.helper.isArray(e)||(e=[e]);var a=d(e,t);if(!a.valid)throw Error(a.error);for(var i=0;i<e.length;++i)switch(e[i].type){case"lang":r.push(e[i]);break;case"output":n.push(e[i]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}(o.extensions[e],e);if(o.helper.isUndefined(s[e]))throw Error('Extension "'+e+'" could not be loaded. It was either not found or is not a valid extension.');e=s[e]}"function"==typeof e&&(e=e()),o.helper.isArray(e)||(e=[e]);var a=d(e,t);if(!a.valid)throw Error(a.error);for(var i=0;i<e.length;++i){switch(e[i].type){case"lang":r.push(e[i]);break;case"output":n.push(e[i])}if(e[i].hasOwnProperty("listeners"))for(var c in e[i].listeners)e[i].listeners.hasOwnProperty(c)&&f(c,e[i].listeners[c])}}function f(e,t){if(!o.helper.isString(e))throw Error("Invalid argument in converter.listen() method: name must be a string, but "+typeof e+" given");if("function"!=typeof t)throw Error("Invalid argument in converter.listen() method: callback must be a function, but "+typeof t+" given");a.hasOwnProperty(e)||(a[e]=[]),a[e].push(t)}!function(){for(var r in e=e||{},c)c.hasOwnProperty(r)&&(t[r]=c[r]);if("object"!=typeof e)throw Error("Converter expects the passed parameter to be an object, but "+typeof e+" was passed instead.");for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.extensions&&o.helper.forEach(t.extensions,h)}(),this._dispatch=function(e,t,r,n){if(a.hasOwnProperty(e))for(var o=0;o<a[e].length;++o){var i=a[e][o](e,t,this,r,n);i&&void 0!==i&&(t=i)}return t},this.listen=function(e,t){return f(e,t),this},this.makeHtml=function(e){if(!e)return e;var a={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:r,outputModifiers:n,converter:this,ghCodeBlocks:[],metadata:{parsed:{},raw:"",format:""}};return e=(e=(e=(e=(e=e.replace(/¨/g,"¨T")).replace(/\$/g,"¨D")).replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/\u00A0/g," "),t.smartIndentationFix&&(e=function(e){var t=e.match(/^\s*/)[0].length,r=new RegExp("^\\s{0,"+t+"}","gm");return e.replace(r,"")}(e)),e="\n\n"+e+"\n\n",e=(e=o.subParser("detab")(e,t,a)).replace(/^[ \t]+$/gm,""),o.helper.forEach(r,(function(r){e=o.subParser("runExtension")(r,e,t,a)})),e=o.subParser("metadata")(e,t,a),e=o.subParser("hashPreCodeTags")(e,t,a),e=o.subParser("githubCodeBlocks")(e,t,a),e=o.subParser("hashHTMLBlocks")(e,t,a),e=o.subParser("hashCodeTags")(e,t,a),e=o.subParser("stripLinkDefinitions")(e,t,a),e=o.subParser("blockGamut")(e,t,a),e=o.subParser("unhashHTMLSpans")(e,t,a),e=(e=(e=o.subParser("unescapeSpecialChars")(e,t,a)).replace(/¨D/g,"$$")).replace(/¨T/g,"¨"),e=o.subParser("completeHTMLDocument")(e,t,a),o.helper.forEach(n,(function(r){e=o.subParser("runExtension")(r,e,t,a)})),p=a.metadata,e},this.makeMarkdown=this.makeMd=function(e,t){if(e=(e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/>[ \t]+</,">¨NBSP;<"),!t){if(!window||!window.document)throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");t=window.document}var r=t.createElement("div");r.innerHTML=e;var n={preList:function(e){for(var t=e.querySelectorAll("pre"),r=[],n=0;n<t.length;++n)if(1===t[n].childElementCount&&"code"===t[n].firstChild.tagName.toLowerCase()){var a=t[n].firstChild.innerHTML.trim(),i=t[n].firstChild.getAttribute("data-language")||"";if(""===i)for(var s=t[n].firstChild.className.split(" "),c=0;c<s.length;++c){var l=s[c].match(/^language-(.+)$/);if(null!==l){i=l[1];break}}a=o.helper.unescapeHTMLEntities(a),r.push(a),t[n].outerHTML='<precode language="'+i+'" precodenum="'+n.toString()+'"></precode>'}else r.push(t[n].innerHTML),t[n].innerHTML="",t[n].setAttribute("prenum",n.toString());return r}(r)};!function e(t){for(var r=0;r<t.childNodes.length;++r){var n=t.childNodes[r];3===n.nodeType?/\S/.test(n.nodeValue)?(n.nodeValue=n.nodeValue.split("\n").join(" "),n.nodeValue=n.nodeValue.replace(/(\s)+/g,"$1")):(t.removeChild(n),--r):1===n.nodeType&&e(n)}}(r);for(var a=r.childNodes,i="",s=0;s<a.length;s++)i+=o.subParser("makeMarkdown.node")(a[s],n);return i},this.setOption=function(e,r){t[e]=r},this.getOption=function(e){return t[e]},this.getOptions=function(){return t},this.addExtension=function(e,t){h(e,t=t||null)},this.useExtension=function(e){h(e)},this.setFlavor=function(e){if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");var r=u[e];for(var n in i=e,r)r.hasOwnProperty(n)&&(t[n]=r[n])},this.getFlavor=function(){return i},this.removeExtension=function(e){o.helper.isArray(e)||(e=[e]);for(var t=0;t<e.length;++t){for(var a=e[t],i=0;i<r.length;++i)r[i]===a&&r[i].splice(i,1);for(;0<n.length;++i)n[0]===a&&n[0].splice(i,1)}},this.getAllExtensions=function(){return{language:r,output:n}},this.getMetadata=function(e){return e?p.raw:p.parsed},this.getMetadataFormat=function(){return p.format},this._setMetadataPair=function(e,t){p.parsed[e]=t},this._setMetadataFormat=function(e){p.format=e},this._setMetadataRaw=function(e){p.raw=e}},o.subParser("anchors",(function(e,t,r){"use strict";var n=function(e,n,a,i,s,c,l){if(o.helper.isUndefined(l)&&(l=""),a=a.toLowerCase(),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)i="";else if(!i){if(a||(a=n.toLowerCase().replace(/ ?\n/g," ")),i="#"+a,o.helper.isUndefined(r.gUrls[a]))return e;i=r.gUrls[a],o.helper.isUndefined(r.gTitles[a])||(l=r.gTitles[a])}var u='<a href="'+(i=i.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback))+'"';return""!==l&&null!==l&&(u+=' title="'+(l=(l=l.replace(/"/g,""")).replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback))+'"'),t.openLinksInNewWindow&&!/^#/.test(i)&&(u+=' rel="noopener noreferrer" target="¨E95Eblank"'),u+=">"+n+"</a>"};return e=(e=(e=(e=(e=r.converter._dispatch("anchors.before",e,t,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,n)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,n)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,n)).replace(/\[([^\[\]]+)]()()()()()/g,n),t.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim,(function(e,r,n,a,i){if("\\"===n)return r+a;if(!o.helper.isString(t.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var s=t.ghMentionsLink.replace(/\{u}/g,i),c="";return t.openLinksInNewWindow&&(c=' rel="noopener noreferrer" target="¨E95Eblank"'),r+'<a href="'+s+'"'+c+">"+a+"</a>"}))),e=r.converter._dispatch("anchors.after",e,t,r)}));var f=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,g=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,m=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,b=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,_=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,k=function(e){"use strict";return function(t,r,n,a,i,s,c){var l=n=n.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback),u="",d="",p=r||"",h=c||"";return/^www\./i.test(n)&&(n=n.replace(/^www\./i,"http://www.")),e.excludeTrailingPunctuationFromURLs&&s&&(u=s),e.openLinksInNewWindow&&(d=' rel="noopener noreferrer" target="¨E95Eblank"'),p+'<a href="'+n+'"'+d+">"+l+"</a>"+u+h}},y=function(e,t){"use strict";return function(r,n,a){var i="mailto:";return n=n||"",a=o.subParser("unescapeSpecialChars")(a,e,t),e.encodeEmails?(i=o.helper.encodeEmailAddress(i+a),a=o.helper.encodeEmailAddress(a)):i+=a,n+'<a href="'+i+'">'+a+"</a>"}};o.subParser("autoLinks",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("autoLinks.before",e,t,r)).replace(m,k(t))).replace(_,y(t,r)),e=r.converter._dispatch("autoLinks.after",e,t,r)})),o.subParser("simplifiedAutoLinks",(function(e,t,r){"use strict";return t.simplifiedAutoLink?(e=r.converter._dispatch("simplifiedAutoLinks.before",e,t,r),e=(e=t.excludeTrailingPunctuationFromURLs?e.replace(g,k(t)):e.replace(f,k(t))).replace(b,y(t,r)),e=r.converter._dispatch("simplifiedAutoLinks.after",e,t,r)):e})),o.subParser("blockGamut",(function(e,t,r){"use strict";return e=r.converter._dispatch("blockGamut.before",e,t,r),e=o.subParser("blockQuotes")(e,t,r),e=o.subParser("headers")(e,t,r),e=o.subParser("horizontalRule")(e,t,r),e=o.subParser("lists")(e,t,r),e=o.subParser("codeBlocks")(e,t,r),e=o.subParser("tables")(e,t,r),e=o.subParser("hashHTMLBlocks")(e,t,r),e=o.subParser("paragraphs")(e,t,r),e=r.converter._dispatch("blockGamut.after",e,t,r)})),o.subParser("blockQuotes",(function(e,t,r){"use strict";e=r.converter._dispatch("blockQuotes.before",e,t,r),e+="\n\n";var n=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return t.splitAdjacentBlockquotes&&(n=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),e=e.replace(n,(function(e){return e=(e=(e=e.replace(/^[ \t]*>[ \t]?/gm,"")).replace(/¨0/g,"")).replace(/^[ \t]+$/gm,""),e=o.subParser("githubCodeBlocks")(e,t,r),e=(e=(e=o.subParser("blockGamut")(e,t,r)).replace(/(^|\n)/g,"$1 ")).replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,(function(e,t){var r=t;return r=(r=r.replace(/^ /gm,"¨0")).replace(/¨0/g,"")})),o.subParser("hashBlock")("<blockquote>\n"+e+"\n</blockquote>",t,r)})),e=r.converter._dispatch("blockQuotes.after",e,t,r)})),o.subParser("codeBlocks",(function(e,t,r){"use strict";e=r.converter._dispatch("codeBlocks.before",e,t,r);return e=(e=(e+="¨0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g,(function(e,n,a){var i=n,s=a,c="\n";return i=o.subParser("outdent")(i,t,r),i=o.subParser("encodeCode")(i,t,r),i=(i=(i=o.subParser("detab")(i,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,""),t.omitExtraWLInCodeBlocks&&(c=""),i="<pre><code>"+i+c+"</code></pre>",o.subParser("hashBlock")(i,t,r)+s}))).replace(/¨0/,""),e=r.converter._dispatch("codeBlocks.after",e,t,r)})),o.subParser("codeSpans",(function(e,t,r){"use strict";return void 0===(e=r.converter._dispatch("codeSpans.before",e,t,r))&&(e=""),e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,(function(e,n,a,i){var s=i;return s=(s=s.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),s=n+"<code>"+(s=o.subParser("encodeCode")(s,t,r))+"</code>",s=o.subParser("hashHTMLSpans")(s,t,r)})),e=r.converter._dispatch("codeSpans.after",e,t,r)})),o.subParser("completeHTMLDocument",(function(e,t,r){"use strict";if(!t.completeHTMLDocument)return e;e=r.converter._dispatch("completeHTMLDocument.before",e,t,r);var n="html",a="<!DOCTYPE HTML>\n",o="",i='<meta charset="utf-8">\n',s="",c="";for(var l in void 0!==r.metadata.parsed.doctype&&(a="<!DOCTYPE "+r.metadata.parsed.doctype+">\n","html"!==(n=r.metadata.parsed.doctype.toString().toLowerCase())&&"html5"!==n||(i='<meta charset="utf-8">')),r.metadata.parsed)if(r.metadata.parsed.hasOwnProperty(l))switch(l.toLowerCase()){case"doctype":break;case"title":o="<title>"+r.metadata.parsed.title+"</title>\n";break;case"charset":i="html"===n||"html5"===n?'<meta charset="'+r.metadata.parsed.charset+'">\n':'<meta name="charset" content="'+r.metadata.parsed.charset+'">\n';break;case"language":case"lang":s=' lang="'+r.metadata.parsed[l]+'"',c+='<meta name="'+l+'" content="'+r.metadata.parsed[l]+'">\n';break;default:c+='<meta name="'+l+'" content="'+r.metadata.parsed[l]+'">\n'}return e=a+"<html"+s+">\n<head>\n"+o+i+c+"</head>\n<body>\n"+e.trim()+"\n</body>\n</html>",e=r.converter._dispatch("completeHTMLDocument.after",e,t,r)})),o.subParser("detab",(function(e,t,r){"use strict";return e=(e=(e=(e=(e=(e=r.converter._dispatch("detab.before",e,t,r)).replace(/\t(?=\t)/g," ")).replace(/\t/g,"¨A¨B")).replace(/¨B(.+?)¨A/g,(function(e,t){for(var r=t,n=4-r.length%4,a=0;a<n;a++)r+=" ";return r}))).replace(/¨A/g," ")).replace(/¨B/g,""),e=r.converter._dispatch("detab.after",e,t,r)})),o.subParser("ellipsis",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("ellipsis.before",e,t,r)).replace(/\.\.\./g,"…"),e=r.converter._dispatch("ellipsis.after",e,t,r)})),o.subParser("emoji",(function(e,t,r){"use strict";if(!t.emoji)return e;return e=(e=r.converter._dispatch("emoji.before",e,t,r)).replace(/:([\S]+?):/g,(function(e,t){return o.helper.emojis.hasOwnProperty(t)?o.helper.emojis[t]:e})),e=r.converter._dispatch("emoji.after",e,t,r)})),o.subParser("encodeAmpsAndAngles",(function(e,t,r){"use strict";return e=(e=(e=(e=(e=r.converter._dispatch("encodeAmpsAndAngles.before",e,t,r)).replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&")).replace(/<(?![a-z\/?$!])/gi,"<")).replace(/</g,"<")).replace(/>/g,">"),e=r.converter._dispatch("encodeAmpsAndAngles.after",e,t,r)})),o.subParser("encodeBackslashEscapes",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("encodeBackslashEscapes.before",e,t,r)).replace(/\\(\\)/g,o.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,o.helper.escapeCharactersCallback),e=r.converter._dispatch("encodeBackslashEscapes.after",e,t,r)})),o.subParser("encodeCode",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("encodeCode.before",e,t,r)).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/([*_{}\[\]\\=~-])/g,o.helper.escapeCharactersCallback),e=r.converter._dispatch("encodeCode.after",e,t,r)})),o.subParser("escapeSpecialCharsWithinTagAttributes",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",e,t,r)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,(function(e){return e.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,o.helper.escapeCharactersCallback)}))).replace(/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi,(function(e){return e.replace(/([\\`*_~=|])/g,o.helper.escapeCharactersCallback)})),e=r.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,t,r)})),o.subParser("githubCodeBlocks",(function(e,t,r){"use strict";return t.ghCodeBlocks?(e=r.converter._dispatch("githubCodeBlocks.before",e,t,r),e=(e=(e+="¨0").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,(function(e,n,a,i){var s=t.omitExtraWLInCodeBlocks?"":"\n";return i=o.subParser("encodeCode")(i,t,r),i="<pre><code"+(a?' class="'+a+" language-"+a+'"':"")+">"+(i=(i=(i=o.subParser("detab")(i,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+s+"</code></pre>",i=o.subParser("hashBlock")(i,t,r),"\n\n¨G"+(r.ghCodeBlocks.push({text:e,codeblock:i})-1)+"G\n\n"}))).replace(/¨0/,""),r.converter._dispatch("githubCodeBlocks.after",e,t,r)):e})),o.subParser("hashBlock",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("hashBlock.before",e,t,r)).replace(/(^\n+|\n+$)/g,""),e="\n\n¨K"+(r.gHtmlBlocks.push(e)-1)+"K\n\n",e=r.converter._dispatch("hashBlock.after",e,t,r)})),o.subParser("hashCodeTags",(function(e,t,r){"use strict";e=r.converter._dispatch("hashCodeTags.before",e,t,r);return e=o.helper.replaceRecursiveRegExp(e,(function(e,n,a,i){var s=a+o.subParser("encodeCode")(n,t,r)+i;return"¨C"+(r.gHtmlSpans.push(s)-1)+"C"}),"<code\\b[^>]*>","</code>","gim"),e=r.converter._dispatch("hashCodeTags.after",e,t,r)})),o.subParser("hashElement",(function(e,t,r){"use strict";return function(e,t){var n=t;return n=(n=(n=n.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),n="\n\n¨K"+(r.gHtmlBlocks.push(n)-1)+"K\n\n"}})),o.subParser("hashHTMLBlocks",(function(e,t,r){"use strict";e=r.converter._dispatch("hashHTMLBlocks.before",e,t,r);var n=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],a=function(e,t,n,a){var o=e;return-1!==n.search(/\bmarkdown\b/)&&(o=n+r.converter.makeHtml(t)+a),"\n\n¨K"+(r.gHtmlBlocks.push(o)-1)+"K\n\n"};t.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,(function(e,t){return"<"+t+">"})));for(var i=0;i<n.length;++i)for(var s,c=new RegExp("^ {0,3}(<"+n[i]+"\\b[^>]*>)","im"),l="<"+n[i]+"\\b[^>]*>",u="</"+n[i]+">";-1!==(s=o.helper.regexIndexOf(e,c));){var d=o.helper.splitAtIndex(e,s),p=o.helper.replaceRecursiveRegExp(d[1],a,l,u,"im");if(p===d[1])break;e=d[0].concat(p)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,o.subParser("hashElement")(e,t,r)),e=(e=o.helper.replaceRecursiveRegExp(e,(function(e){return"\n\n¨K"+(r.gHtmlBlocks.push(e)-1)+"K\n\n"}),"^ {0,3}\x3c!--","--\x3e","gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,o.subParser("hashElement")(e,t,r)),e=r.converter._dispatch("hashHTMLBlocks.after",e,t,r)})),o.subParser("hashHTMLSpans",(function(e,t,r){"use strict";function n(e){return"¨C"+(r.gHtmlSpans.push(e)-1)+"C"}return e=(e=(e=(e=(e=r.converter._dispatch("hashHTMLSpans.before",e,t,r)).replace(/<[^>]+?\/>/gi,(function(e){return n(e)}))).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,(function(e){return n(e)}))).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,(function(e){return n(e)}))).replace(/<[^>]+?>/gi,(function(e){return n(e)})),e=r.converter._dispatch("hashHTMLSpans.after",e,t,r)})),o.subParser("unhashHTMLSpans",(function(e,t,r){"use strict";e=r.converter._dispatch("unhashHTMLSpans.before",e,t,r);for(var n=0;n<r.gHtmlSpans.length;++n){for(var a=r.gHtmlSpans[n],o=0;/¨C(\d+)C/.test(a);){var i=RegExp.$1;if(a=a.replace("¨C"+i+"C",r.gHtmlSpans[i]),10===o){console.error("maximum nesting of 10 spans reached!!!");break}++o}e=e.replace("¨C"+n+"C",a)}return e=r.converter._dispatch("unhashHTMLSpans.after",e,t,r)})),o.subParser("hashPreCodeTags",(function(e,t,r){"use strict";e=r.converter._dispatch("hashPreCodeTags.before",e,t,r);return e=o.helper.replaceRecursiveRegExp(e,(function(e,n,a,i){var s=a+o.subParser("encodeCode")(n,t,r)+i;return"\n\n¨G"+(r.ghCodeBlocks.push({text:e,codeblock:s})-1)+"G\n\n"}),"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>","^ {0,3}</code>\\s*</pre>","gim"),e=r.converter._dispatch("hashPreCodeTags.after",e,t,r)})),o.subParser("headers",(function(e,t,r){"use strict";e=r.converter._dispatch("headers.before",e,t,r);var n=isNaN(parseInt(t.headerLevelStart))?1:parseInt(t.headerLevelStart),a=t.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,i=t.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;e=(e=e.replace(a,(function(e,a){var i=o.subParser("spanGamut")(a,t,r),s=t.noHeaderId?"":' id="'+c(a)+'"',l="<h"+n+s+">"+i+"</h"+n+">";return o.subParser("hashBlock")(l,t,r)}))).replace(i,(function(e,a){var i=o.subParser("spanGamut")(a,t,r),s=t.noHeaderId?"":' id="'+c(a)+'"',l=n+1,u="<h"+l+s+">"+i+"</h"+l+">";return o.subParser("hashBlock")(u,t,r)}));var s=t.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;function c(e){var n,a;if(t.customizedHeaderId){var i=e.match(/\{([^{]+?)}\s*$/);i&&i[1]&&(e=i[1])}return n=e,a=o.helper.isString(t.prefixHeaderId)?t.prefixHeaderId:!0===t.prefixHeaderId?"section-":"",t.rawPrefixHeaderId||(n=a+n),n=t.ghCompatibleHeaderId?n.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():t.rawHeaderId?n.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():n.replace(/[^\w]/g,"").toLowerCase(),t.rawPrefixHeaderId&&(n=a+n),r.hashLinkCounts[n]?n=n+"-"+r.hashLinkCounts[n]++:r.hashLinkCounts[n]=1,n}return e=e.replace(s,(function(e,a,i){var s=i;t.customizedHeaderId&&(s=i.replace(/\s?\{([^{]+?)}\s*$/,""));var l=o.subParser("spanGamut")(s,t,r),u=t.noHeaderId?"":' id="'+c(i)+'"',d=n-1+a.length,p="<h"+d+u+">"+l+"</h"+d+">";return o.subParser("hashBlock")(p,t,r)})),e=r.converter._dispatch("headers.after",e,t,r)})),o.subParser("horizontalRule",(function(e,t,r){"use strict";e=r.converter._dispatch("horizontalRule.before",e,t,r);var n=o.subParser("hashBlock")("<hr />",t,r);return e=(e=(e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,n)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,n)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,n),e=r.converter._dispatch("horizontalRule.after",e,t,r)})),o.subParser("images",(function(e,t,r){"use strict";function n(e,t,n,a,i,s,c,l){var u=r.gUrls,d=r.gTitles,p=r.gDimensions;if(n=n.toLowerCase(),l||(l=""),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)a="";else if(""===a||null===a){if(""!==n&&null!==n||(n=t.toLowerCase().replace(/ ?\n/g," ")),a="#"+n,o.helper.isUndefined(u[n]))return e;a=u[n],o.helper.isUndefined(d[n])||(l=d[n]),o.helper.isUndefined(p[n])||(i=p[n].width,s=p[n].height)}t=t.replace(/"/g,""").replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback);var h='<img src="'+(a=a.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback))+'" alt="'+t+'"';return l&&o.helper.isString(l)&&(h+=' title="'+(l=l.replace(/"/g,""").replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback))+'"'),i&&s&&(h+=' width="'+(i="*"===i?"auto":i)+'"',h+=' height="'+(s="*"===s?"auto":s)+'"'),h+=" />"}return e=(e=(e=(e=(e=(e=r.converter._dispatch("images.before",e,t,r)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,n)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,(function(e,t,r,a,o,i,s,c){return n(e,t,r,a=a.replace(/\s/g,""),o,i,s,c)}))).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,n)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,n)).replace(/!\[([^\[\]]+)]()()()()()/g,n),e=r.converter._dispatch("images.after",e,t,r)})),o.subParser("italicsAndBold",(function(e,t,r){"use strict";function n(e,t,r){return t+e+r}return e=r.converter._dispatch("italicsAndBold.before",e,t,r),e=t.literalMidWordUnderscores?(e=(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return n(t,"<strong><em>","</em></strong>")}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return n(t,"<strong>","</strong>")}))).replace(/\b_(\S[\s\S]*?)_\b/g,(function(e,t){return n(t,"<em>","</em>")})):(e=(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?n(t,"<strong><em>","</em></strong>"):e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?n(t,"<strong>","</strong>"):e}))).replace(/_([^\s_][\s\S]*?)_/g,(function(e,t){return/\S$/.test(t)?n(t,"<em>","</em>"):e})),e=t.literalMidWordAsterisks?(e=(e=e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,(function(e,t,r){return n(r,t+"<strong><em>","</em></strong>")}))).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,(function(e,t,r){return n(r,t+"<strong>","</strong>")}))).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,(function(e,t,r){return n(r,t+"<em>","</em>")})):(e=(e=e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,(function(e,t){return/\S$/.test(t)?n(t,"<strong><em>","</em></strong>"):e}))).replace(/\*\*(\S[\s\S]*?)\*\*/g,(function(e,t){return/\S$/.test(t)?n(t,"<strong>","</strong>"):e}))).replace(/\*([^\s*][\s\S]*?)\*/g,(function(e,t){return/\S$/.test(t)?n(t,"<em>","</em>"):e})),e=r.converter._dispatch("italicsAndBold.after",e,t,r)})),o.subParser("lists",(function(e,t,r){"use strict";function n(e,n){r.gListLevel++,e=e.replace(/\n{2,}$/,"\n");var a=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,i=/\n[ \t]*\n(?!¨0)/.test(e+="¨0");return t.disableForced4SpacesIndentedSublists&&(a=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=(e=e.replace(a,(function(e,n,a,s,c,l,u){u=u&&""!==u.trim();var d=o.subParser("outdent")(c,t,r),p="";return l&&t.tasklists&&(p=' class="task-list-item" style="list-style-type: none;"',d=d.replace(/^[ \t]*\[(x|X| )?]/m,(function(){var e='<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';return u&&(e+=" checked"),e+=">"}))),d=d.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,(function(e){return"¨A"+e})),n||d.search(/\n{2,}/)>-1?(d=o.subParser("githubCodeBlocks")(d,t,r),d=o.subParser("blockGamut")(d,t,r)):(d=(d=o.subParser("lists")(d,t,r)).replace(/\n$/,""),d=(d=o.subParser("hashHTMLBlocks")(d,t,r)).replace(/\n\n+/g,"\n\n"),d=i?o.subParser("paragraphs")(d,t,r):o.subParser("spanGamut")(d,t,r)),d="<li"+p+">"+(d=d.replace("¨A",""))+"</li>\n"}))).replace(/¨0/g,""),r.gListLevel--,n&&(e=e.replace(/\s+$/,"")),e}function a(e,t){if("ol"===t){var r=e.match(/^ *(\d+)\./);if(r&&"1"!==r[1])return' start="'+r[1]+'"'}return""}function i(e,r,o){var i=t.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,s=t.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,c="ul"===r?i:s,l="";if(-1!==e.search(c))!function t(u){var d=u.search(c),p=a(e,r);-1!==d?(l+="\n\n<"+r+p+">\n"+n(u.slice(0,d),!!o)+"</"+r+">\n",c="ul"===(r="ul"===r?"ol":"ul")?i:s,t(u.slice(d))):l+="\n\n<"+r+p+">\n"+n(u,!!o)+"</"+r+">\n"}(e);else{var u=a(e,r);l="\n\n<"+r+u+">\n"+n(e,!!o)+"</"+r+">\n"}return l}return e=r.converter._dispatch("lists.before",e,t,r),e+="¨0",e=(e=r.gListLevel?e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,r){return i(t,r.search(/[*+-]/g)>-1?"ul":"ol",!0)})):e.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,r,n){return i(r,n.search(/[*+-]/g)>-1?"ul":"ol",!1)}))).replace(/¨0/,""),e=r.converter._dispatch("lists.after",e,t,r)})),o.subParser("metadata",(function(e,t,r){"use strict";if(!t.metadata)return e;function n(e){r.metadata.raw=e,(e=(e=e.replace(/&/g,"&").replace(/"/g,""")).replace(/\n {4}/g," ")).replace(/^([\S ]+): +([\s\S]+?)$/gm,(function(e,t,n){return r.metadata.parsed[t]=n,""}))}return e=(e=(e=(e=r.converter._dispatch("metadata.before",e,t,r)).replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,(function(e,t,r){return n(r),"¨M"}))).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,(function(e,t,a){return t&&(r.metadata.format=t),n(a),"¨M"}))).replace(/¨M/g,""),e=r.converter._dispatch("metadata.after",e,t,r)})),o.subParser("outdent",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("outdent.before",e,t,r)).replace(/^(\t|[ ]{1,4})/gm,"¨0")).replace(/¨0/g,""),e=r.converter._dispatch("outdent.after",e,t,r)})),o.subParser("paragraphs",(function(e,t,r){"use strict";for(var n=(e=(e=(e=r.converter._dispatch("paragraphs.before",e,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),a=[],i=n.length,s=0;s<i;s++){var c=n[s];c.search(/¨(K|G)(\d+)\1/g)>=0?a.push(c):c.search(/\S/)>=0&&(c=(c=o.subParser("spanGamut")(c,t,r)).replace(/^([ \t]*)/g,"<p>"),c+="</p>",a.push(c))}for(i=a.length,s=0;s<i;s++){for(var l="",u=a[s],d=!1;/¨(K|G)(\d+)\1/.test(u);){var p=RegExp.$1,h=RegExp.$2;l=(l="K"===p?r.gHtmlBlocks[h]:d?o.subParser("encodeCode")(r.ghCodeBlocks[h].text,t,r):r.ghCodeBlocks[h].codeblock).replace(/\$/g,"$$$$"),u=u.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/,l),/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(u)&&(d=!0)}a[s]=u}return e=(e=(e=a.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),r.converter._dispatch("paragraphs.after",e,t,r)})),o.subParser("runExtension",(function(e,t,r,n){"use strict";if(e.filter)t=e.filter(t,n.converter,r);else if(e.regex){var a=e.regex;a instanceof RegExp||(a=new RegExp(a,"g")),t=t.replace(a,e.replace)}return t})),o.subParser("spanGamut",(function(e,t,r){"use strict";return e=r.converter._dispatch("spanGamut.before",e,t,r),e=o.subParser("codeSpans")(e,t,r),e=o.subParser("escapeSpecialCharsWithinTagAttributes")(e,t,r),e=o.subParser("encodeBackslashEscapes")(e,t,r),e=o.subParser("images")(e,t,r),e=o.subParser("anchors")(e,t,r),e=o.subParser("autoLinks")(e,t,r),e=o.subParser("simplifiedAutoLinks")(e,t,r),e=o.subParser("emoji")(e,t,r),e=o.subParser("underline")(e,t,r),e=o.subParser("italicsAndBold")(e,t,r),e=o.subParser("strikethrough")(e,t,r),e=o.subParser("ellipsis")(e,t,r),e=o.subParser("hashHTMLSpans")(e,t,r),e=o.subParser("encodeAmpsAndAngles")(e,t,r),t.simpleLineBreaks?/\n\n¨K/.test(e)||(e=e.replace(/\n+/g,"<br />\n")):e=e.replace(/ +\n/g,"<br />\n"),e=r.converter._dispatch("spanGamut.after",e,t,r)})),o.subParser("strikethrough",(function(e,t,r){"use strict";return t.strikethrough&&(e=(e=r.converter._dispatch("strikethrough.before",e,t,r)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,(function(e,n){return function(e){return t.simplifiedAutoLink&&(e=o.subParser("simplifiedAutoLinks")(e,t,r)),"<del>"+e+"</del>"}(n)})),e=r.converter._dispatch("strikethrough.after",e,t,r)),e})),o.subParser("stripLinkDefinitions",(function(e,t,r){"use strict";var n=function(e,n,a,i,s,c,l){return n=n.toLowerCase(),a.match(/^data:.+?\/.+?;base64,/)?r.gUrls[n]=a.replace(/\s/g,""):r.gUrls[n]=o.subParser("encodeAmpsAndAngles")(a,t,r),c?c+l:(l&&(r.gTitles[n]=l.replace(/"|'/g,""")),t.parseImgDimensions&&i&&s&&(r.gDimensions[n]={width:i,height:s}),"")};return e=(e=(e=(e+="¨0").replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,n)).replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,n)).replace(/¨0/,"")})),o.subParser("tables",(function(e,t,r){"use strict";if(!t.tables)return e;function n(e,n){return"<td"+n+">"+o.subParser("spanGamut")(e,t,r)+"</td>\n"}function a(e){var a,i=e.split("\n");for(a=0;a<i.length;++a)/^ {0,3}\|/.test(i[a])&&(i[a]=i[a].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(i[a])&&(i[a]=i[a].replace(/\|[ \t]*$/,"")),i[a]=o.subParser("codeSpans")(i[a],t,r);var s,c,l,u,d=i[0].split("|").map((function(e){return e.trim()})),p=i[1].split("|").map((function(e){return e.trim()})),h=[],f=[],g=[],m=[];for(i.shift(),i.shift(),a=0;a<i.length;++a)""!==i[a].trim()&&h.push(i[a].split("|").map((function(e){return e.trim()})));if(d.length<p.length)return e;for(a=0;a<p.length;++a)g.push((s=p[a],/^:[ \t]*--*$/.test(s)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(s)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(s)?' style="text-align:center;"':""));for(a=0;a<d.length;++a)o.helper.isUndefined(g[a])&&(g[a]=""),f.push((c=d[a],l=g[a],u=void 0,u="",c=c.trim(),(t.tablesHeaderId||t.tableHeaderId)&&(u=' id="'+c.replace(/ /g,"_").toLowerCase()+'"'),"<th"+u+l+">"+(c=o.subParser("spanGamut")(c,t,r))+"</th>\n"));for(a=0;a<h.length;++a){for(var b=[],_=0;_<f.length;++_)o.helper.isUndefined(h[a][_]),b.push(n(h[a][_],g[_]));m.push(b)}return function(e,t){for(var r="<table>\n<thead>\n<tr>\n",n=e.length,a=0;a<n;++a)r+=e[a];for(r+="</tr>\n</thead>\n<tbody>\n",a=0;a<t.length;++a){r+="<tr>\n";for(var o=0;o<n;++o)r+=t[a][o];r+="</tr>\n"}return r+="</tbody>\n</table>\n"}(f,m)}return e=(e=(e=(e=r.converter._dispatch("tables.before",e,t,r)).replace(/\\(\|)/g,o.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,a)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm,a),e=r.converter._dispatch("tables.after",e,t,r)})),o.subParser("underline",(function(e,t,r){"use strict";return t.underline?(e=r.converter._dispatch("underline.before",e,t,r),e=(e=t.literalMidWordUnderscores?(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return"<u>"+t+"</u>"}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return"<u>"+t+"</u>"})):(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e}))).replace(/(_)/g,o.helper.escapeCharactersCallback),e=r.converter._dispatch("underline.after",e,t,r)):e})),o.subParser("unescapeSpecialChars",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("unescapeSpecialChars.before",e,t,r)).replace(/¨E(\d+)E/g,(function(e,t){var r=parseInt(t);return String.fromCharCode(r)})),e=r.converter._dispatch("unescapeSpecialChars.after",e,t,r)})),o.subParser("makeMarkdown.blockquote",(function(e,t){"use strict";var r="";if(e.hasChildNodes())for(var n=e.childNodes,a=n.length,i=0;i<a;++i){var s=o.subParser("makeMarkdown.node")(n[i],t);""!==s&&(r+=s)}return r="> "+(r=r.trim()).split("\n").join("\n> ")})),o.subParser("makeMarkdown.codeBlock",(function(e,t){"use strict";var r=e.getAttribute("language"),n=e.getAttribute("precodenum");return"```"+r+"\n"+t.preList[n]+"\n```"})),o.subParser("makeMarkdown.codeSpan",(function(e){"use strict";return"`"+e.innerHTML+"`"})),o.subParser("makeMarkdown.emphasis",(function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="*";for(var n=e.childNodes,a=n.length,i=0;i<a;++i)r+=o.subParser("makeMarkdown.node")(n[i],t);r+="*"}return r})),o.subParser("makeMarkdown.header",(function(e,t,r){"use strict";var n=new Array(r+1).join("#"),a="";if(e.hasChildNodes()){a=n+" ";for(var i=e.childNodes,s=i.length,c=0;c<s;++c)a+=o.subParser("makeMarkdown.node")(i[c],t)}return a})),o.subParser("makeMarkdown.hr",(function(){"use strict";return"---"})),o.subParser("makeMarkdown.image",(function(e){"use strict";var t="";return e.hasAttribute("src")&&(t+="+">",e.hasAttribute("width")&&e.hasAttribute("height")&&(t+=" ="+e.getAttribute("width")+"x"+e.getAttribute("height")),e.hasAttribute("title")&&(t+=' "'+e.getAttribute("title")+'"'),t+=")"),t})),o.subParser("makeMarkdown.links",(function(e,t){"use strict";var r="";if(e.hasChildNodes()&&e.hasAttribute("href")){var n=e.childNodes,a=n.length;r="[";for(var i=0;i<a;++i)r+=o.subParser("makeMarkdown.node")(n[i],t);r+="](",r+="<"+e.getAttribute("href")+">",e.hasAttribute("title")&&(r+=' "'+e.getAttribute("title")+'"'),r+=")"}return r})),o.subParser("makeMarkdown.list",(function(e,t,r){"use strict";var n="";if(!e.hasChildNodes())return"";for(var a=e.childNodes,i=a.length,s=e.getAttribute("start")||1,c=0;c<i;++c)if(void 0!==a[c].tagName&&"li"===a[c].tagName.toLowerCase()){n+=("ol"===r?s.toString()+". ":"- ")+o.subParser("makeMarkdown.listItem")(a[c],t),++s}return(n+="\n\x3c!-- --\x3e\n").trim()})),o.subParser("makeMarkdown.listItem",(function(e,t){"use strict";for(var r="",n=e.childNodes,a=n.length,i=0;i<a;++i)r+=o.subParser("makeMarkdown.node")(n[i],t);return/\n$/.test(r)?r=r.split("\n").join("\n ").replace(/^ {4}$/gm,"").replace(/\n\n+/g,"\n\n"):r+="\n",r})),o.subParser("makeMarkdown.node",(function(e,t,r){"use strict";r=r||!1;var n="";if(3===e.nodeType)return o.subParser("makeMarkdown.txt")(e,t);if(8===e.nodeType)return"\x3c!--"+e.data+"--\x3e\n\n";if(1!==e.nodeType)return"";switch(e.tagName.toLowerCase()){case"h1":r||(n=o.subParser("makeMarkdown.header")(e,t,1)+"\n\n");break;case"h2":r||(n=o.subParser("makeMarkdown.header")(e,t,2)+"\n\n");break;case"h3":r||(n=o.subParser("makeMarkdown.header")(e,t,3)+"\n\n");break;case"h4":r||(n=o.subParser("makeMarkdown.header")(e,t,4)+"\n\n");break;case"h5":r||(n=o.subParser("makeMarkdown.header")(e,t,5)+"\n\n");break;case"h6":r||(n=o.subParser("makeMarkdown.header")(e,t,6)+"\n\n");break;case"p":r||(n=o.subParser("makeMarkdown.paragraph")(e,t)+"\n\n");break;case"blockquote":r||(n=o.subParser("makeMarkdown.blockquote")(e,t)+"\n\n");break;case"hr":r||(n=o.subParser("makeMarkdown.hr")(e,t)+"\n\n");break;case"ol":r||(n=o.subParser("makeMarkdown.list")(e,t,"ol")+"\n\n");break;case"ul":r||(n=o.subParser("makeMarkdown.list")(e,t,"ul")+"\n\n");break;case"precode":r||(n=o.subParser("makeMarkdown.codeBlock")(e,t)+"\n\n");break;case"pre":r||(n=o.subParser("makeMarkdown.pre")(e,t)+"\n\n");break;case"table":r||(n=o.subParser("makeMarkdown.table")(e,t)+"\n\n");break;case"code":n=o.subParser("makeMarkdown.codeSpan")(e,t);break;case"em":case"i":n=o.subParser("makeMarkdown.emphasis")(e,t);break;case"strong":case"b":n=o.subParser("makeMarkdown.strong")(e,t);break;case"del":n=o.subParser("makeMarkdown.strikethrough")(e,t);break;case"a":n=o.subParser("makeMarkdown.links")(e,t);break;case"img":n=o.subParser("makeMarkdown.image")(e,t);break;default:n=e.outerHTML+"\n\n"}return n})),o.subParser("makeMarkdown.paragraph",(function(e,t){"use strict";var r="";if(e.hasChildNodes())for(var n=e.childNodes,a=n.length,i=0;i<a;++i)r+=o.subParser("makeMarkdown.node")(n[i],t);return r=r.trim()})),o.subParser("makeMarkdown.pre",(function(e,t){"use strict";var r=e.getAttribute("prenum");return"<pre>"+t.preList[r]+"</pre>"})),o.subParser("makeMarkdown.strikethrough",(function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="~~";for(var n=e.childNodes,a=n.length,i=0;i<a;++i)r+=o.subParser("makeMarkdown.node")(n[i],t);r+="~~"}return r})),o.subParser("makeMarkdown.strong",(function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="**";for(var n=e.childNodes,a=n.length,i=0;i<a;++i)r+=o.subParser("makeMarkdown.node")(n[i],t);r+="**"}return r})),o.subParser("makeMarkdown.table",(function(e,t){"use strict";var r,n,a="",i=[[],[]],s=e.querySelectorAll("thead>tr>th"),c=e.querySelectorAll("tbody>tr");for(r=0;r<s.length;++r){var l=o.subParser("makeMarkdown.tableCell")(s[r],t),u="---";if(s[r].hasAttribute("style"))switch(s[r].getAttribute("style").toLowerCase().replace(/\s/g,"")){case"text-align:left;":u=":---";break;case"text-align:right;":u="---:";break;case"text-align:center;":u=":---:"}i[0][r]=l.trim(),i[1][r]=u}for(r=0;r<c.length;++r){var d=i.push([])-1,p=c[r].getElementsByTagName("td");for(n=0;n<s.length;++n){var h=" ";void 0!==p[n]&&(h=o.subParser("makeMarkdown.tableCell")(p[n],t)),i[d].push(h)}}var f=3;for(r=0;r<i.length;++r)for(n=0;n<i[r].length;++n){var g=i[r][n].length;g>f&&(f=g)}for(r=0;r<i.length;++r){for(n=0;n<i[r].length;++n)1===r?":"===i[r][n].slice(-1)?i[r][n]=o.helper.padEnd(i[r][n].slice(-1),f-1,"-")+":":i[r][n]=o.helper.padEnd(i[r][n],f,"-"):i[r][n]=o.helper.padEnd(i[r][n],f);a+="| "+i[r].join(" | ")+" |\n"}return a.trim()})),o.subParser("makeMarkdown.tableCell",(function(e,t){"use strict";var r="";if(!e.hasChildNodes())return"";for(var n=e.childNodes,a=n.length,i=0;i<a;++i)r+=o.subParser("makeMarkdown.node")(n[i],t,!0);return r.trim()})),o.subParser("makeMarkdown.txt",(function(e){"use strict";var t=e.nodeValue;return t=(t=t.replace(/ +/g," ")).replace(/¨NBSP;/g," "),t=(t=(t=(t=(t=(t=(t=(t=(t=o.helper.unescapeHTMLEntities(t)).replace(/([*_~|`])/g,"\\$1")).replace(/^(\s*)>/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")}));void 0===(n=function(){"use strict";return o}.call(t,r,t,e))||(e.exports=n)}).call(this)},NMb1:function(e,t){e.exports=window.wp.deprecated},SVSp:function(e,t){e.exports=window.wp.shortcode},UuzZ:function(e,t){e.exports=window.wp.autop},YLtl:function(e,t){e.exports=window.lodash},abaT:function(e,t,r){"use strict";t.a=function(e,t){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},n={};for(var a in r)n[r[a]]=a;var o={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,i,s=n[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var c=this.toRgb(),l=1/0,u="black";if(!o.length)for(var d in r)o[d]=new e(r[d]).toRgb();for(var p in r){var h=(a=c,i=o[p],Math.pow(a.r-i.r,2)+Math.pow(a.g-i.g,2)+Math.pow(a.b-i.b,2));h<l&&(l=h,u=p)}return u}},t.string.push([function(t){var n=t.toLowerCase(),a="transparent"===n?"#0000":r[n];return a?new e(a).toRgb():null},"name"])}},fHnH:function(e,t,r){"use strict";r.d(t,"a",(function(){return E})),r.d(t,"b",(function(){return N}));var n={grad:.9,turn:360,rad:360/(2*Math.PI)},a=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},o=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},i=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e>t?e:t},s=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},c=function(e){return{r:i(e.r,0,255),g:i(e.g,0,255),b:i(e.b,0,255),a:i(e.a)}},l=function(e){return{r:o(e.r),g:o(e.g),b:o(e.b),a:o(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},p=function(e){var t=e.r,r=e.g,n=e.b,a=e.a,o=Math.max(t,r,n),i=o-Math.min(t,r,n),s=i?o===t?(r-n)/i:o===r?2+(n-t)/i:4+(t-r)/i:0;return{h:60*(s<0?s+6:s),s:o?i/o*100:0,v:o/255*100,a:a}},h=function(e){var t=e.h,r=e.s,n=e.v,a=e.a;t=t/360*6,r/=100,n/=100;var o=Math.floor(t),i=n*(1-r),s=n*(1-(t-o)*r),c=n*(1-(1-t+o)*r),l=o%6;return{r:255*[n,s,i,i,c,n][l],g:255*[c,n,n,s,i,i][l],b:255*[i,i,c,n,n,s][l],a:a}},f=function(e){return{h:s(e.h),s:i(e.s,0,100),l:i(e.l,0,100),a:i(e.a)}},g=function(e){return{h:o(e.h),s:o(e.s),l:o(e.l),a:o(e.a,3)}},m=function(e){return h((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}));var t,r,n},b=function(e){return{h:(t=p(e)).h,s:(a=(200-(r=t.s))*(n=t.v)/100)>0&&a<200?r*n/100/(a<=100?a:200-a)*100:0,l:a/2,a:t.a};var t,r,n,a},_=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,k=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,w=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v={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?o(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?o(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=y.exec(e)||w.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:c({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=_.exec(e)||k.exec(e);if(!t)return null;var r,a,o=f({h:(r=t[1],a=t[2],void 0===a&&(a="deg"),Number(r)*(n[a]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return m(o)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,o=e.a,i=void 0===o?1:o;return a(t)&&a(r)&&a(n)?c({r:Number(t),g:Number(r),b:Number(n),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,o=e.a,i=void 0===o?1:o;if(!a(t)||!a(r)||!a(n))return null;var s=f({h:Number(t),s:Number(r),l:Number(n),a:Number(i)});return m(s)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,o=e.a,c=void 0===o?1:o;if(!a(t)||!a(r)||!a(n))return null;var l=function(e){return{h:s(e.h),s:i(e.s,0,100),v:i(e.v,0,100),a:i(e.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(c)});return h(l)},"hsv"]]},j=function(e,t){for(var r=0;r<t.length;r++){var n=t[r][0](e);if(n)return[n,t[r][1]]}return[null,void 0]},T=function(e){return"string"==typeof e?j(e.trim(),v.string):"object"==typeof e&&null!==e?j(e,v.object):[null,void 0]},O=function(e,t){var r=b(e);return{h:r.h,s:i(r.s+100*t,0,100),l:r.l,a:r.a}},C=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},x=function(e,t){var r=b(e);return{h:r.h,s:r.s,l:i(r.l+100*t,0,100),a:r.a}},S=function(){function e(e){this.parsed=T(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return o(C(this.rgba),2)},e.prototype.isDark=function(){return C(this.rgba)<.5},e.prototype.isLight=function(){return C(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=l(this.rgba)).r,r=e.g,n=e.b,i=(a=e.a)<1?d(o(255*a)):"","#"+d(t)+d(r)+d(n)+i;var e,t,r,n,a,i},e.prototype.toRgb=function(){return l(this.rgba)},e.prototype.toRgbString=function(){return t=(e=l(this.rgba)).r,r=e.g,n=e.b,(a=e.a)<1?"rgba("+t+", "+r+", "+n+", "+a+")":"rgb("+t+", "+r+", "+n+")";var e,t,r,n,a},e.prototype.toHsl=function(){return g(b(this.rgba))},e.prototype.toHslString=function(){return t=(e=g(b(this.rgba))).h,r=e.s,n=e.l,(a=e.a)<1?"hsla("+t+", "+r+"%, "+n+"%, "+a+")":"hsl("+t+", "+r+"%, "+n+"%)";var e,t,r,n,a},e.prototype.toHsv=function(){return e=p(this.rgba),{h:o(e.h),s:o(e.s),v:o(e.v),a:o(e.a,3)};var e},e.prototype.invert=function(){return E({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),E(O(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),E(O(this.rgba,-e))},e.prototype.grayscale=function(){return E(O(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),E(x(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),E(x(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?E({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):o(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=b(this.rgba);return"number"==typeof e?E({h:e,s:t.s,l:t.l,a:t.a}):o(t.h)},e.prototype.isEqual=function(e){return this.toHex()===E(e).toHex()},e}(),E=function(e){return e instanceof S?e:new S(e)},B=[],N=function(e){e.forEach((function(e){B.indexOf(e)<0&&(e(S,v),B.push(e))}))}},g56x:function(e,t){e.exports=window.wp.hooks},l3Sj:function(e,t){e.exports=window.wp.i18n},ouCq:function(e,t){e.exports=window.wp.blockSerializationDefaultParser},pPDe:function(e,t,r){"use strict";var n,a;function o(e){return[e]}function i(){var e={clear:function(){e.head=null}};return e}function s(e,t,r){var n;if(e.length!==t.length)return!1;for(n=r;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}n={},a="undefined"!=typeof WeakMap,t.a=function(e,t){var r,c;function l(){r=a?new WeakMap:i()}function u(){var r,n,a,o,i,l=arguments.length;for(o=new Array(l),a=0;a<l;a++)o[a]=arguments[a];for(i=t.apply(null,o),(r=c(i)).isUniqueByDependants||(r.lastDependants&&!s(i,r.lastDependants,0)&&r.clear(),r.lastDependants=i),n=r.head;n;){if(s(n.args,o,1))return n!==r.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=r.head,n.prev=null,r.head.prev=n,r.head=n),n.val;n=n.next}return n={val:e.apply(null,o)},o[0]=null,n.args=o,r.head&&(r.head.prev=n,n.next=r.head),r.head=n,n.val}return t||(t=o),c=a?function(e){var t,a,o,s,c,l=r,u=!0;for(t=0;t<e.length;t++){if(a=e[t],!(c=a)||"object"!=typeof c){u=!1;break}l.has(a)?l=l.get(a):(o=new WeakMap,l.set(a,o),l=o)}return l.has(n)||((s=i()).isUniqueByDependants=u,l.set(n,s)),l.get(n)}:function(){return r},u.getDependants=t,u.clear=l,l(),u}},rl8x:function(e,t){e.exports=window.wp.isShallowEqual},rmEH:function(e,t){e.exports=window.wp.htmlEntities},wx14:function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))},xTGt:function(e,t){e.exports=window.wp.blob}});
\ No newline at end of file
+!function(){var e={7308:function(e,t,r){var n;/*! showdown v 1.9.1 - 02-11-2019 */
+(function(){function a(e){"use strict";var t={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:"Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,description:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,description:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,description:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(!1===e)return JSON.parse(JSON.stringify(t));var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n].defaultValue);return r}var o={},i={},s={},c=a(!0),l="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:a(!0),allOn:function(){"use strict";var e=a(!0),t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=!0);return t}()};function d(e,t){"use strict";var r=t?"Error in "+t+" extension->":"Error in unnamed extension",n={valid:!0,error:""};o.helper.isArray(e)||(e=[e]);for(var a=0;a<e.length;++a){var i=r+" sub-extension "+a+": ",s=e[a];if("object"!=typeof s)return n.valid=!1,n.error=i+"must be an object, but "+typeof s+" given",n;if(!o.helper.isString(s.type))return n.valid=!1,n.error=i+'property "type" must be a string, but '+typeof s.type+" given",n;var c=s.type=s.type.toLowerCase();if("language"===c&&(c=s.type="lang"),"html"===c&&(c=s.type="output"),"lang"!==c&&"output"!==c&&"listener"!==c)return n.valid=!1,n.error=i+"type "+c+' is not recognized. Valid values: "lang/language", "output/html" or "listener"',n;if("listener"===c){if(o.helper.isUndefined(s.listeners))return n.valid=!1,n.error=i+'. Extensions of type "listener" must have a property called "listeners"',n}else if(o.helper.isUndefined(s.filter)&&o.helper.isUndefined(s.regex))return n.valid=!1,n.error=i+c+' extensions must define either a "regex" property or a "filter" method',n;if(s.listeners){if("object"!=typeof s.listeners)return n.valid=!1,n.error=i+'"listeners" property must be an object but '+typeof s.listeners+" given",n;for(var l in s.listeners)if(s.listeners.hasOwnProperty(l)&&"function"!=typeof s.listeners[l])return n.valid=!1,n.error=i+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+l+" must be a function but "+typeof s.listeners[l]+" given",n}if(s.filter){if("function"!=typeof s.filter)return n.valid=!1,n.error=i+'"filter" must be a function, but '+typeof s.filter+" given",n}else if(s.regex){if(o.helper.isString(s.regex)&&(s.regex=new RegExp(s.regex,"g")),!(s.regex instanceof RegExp))return n.valid=!1,n.error=i+'"regex" property must either be a string or a RegExp object, but '+typeof s.regex+" given",n;if(o.helper.isUndefined(s.replace))return n.valid=!1,n.error=i+'"regex" extensions must implement a replace string or function',n}}return n}function p(e,t){"use strict";return"¨E"+t.charCodeAt(0)+"E"}o.helper={},o.extensions={},o.setOption=function(e,t){"use strict";return c[e]=t,this},o.getOption=function(e){"use strict";return c[e]},o.getOptions=function(){"use strict";return c},o.resetOptions=function(){"use strict";c=a(!0)},o.setFlavor=function(e){"use strict";if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");o.resetOptions();var t=u[e];for(var r in l=e,t)t.hasOwnProperty(r)&&(c[r]=t[r])},o.getFlavor=function(){"use strict";return l},o.getFlavorOptions=function(e){"use strict";if(u.hasOwnProperty(e))return u[e]},o.getDefaultOptions=function(e){"use strict";return a(e)},o.subParser=function(e,t){"use strict";if(o.helper.isString(e)){if(void 0===t){if(i.hasOwnProperty(e))return i[e];throw Error("SubParser named "+e+" not registered!")}i[e]=t}},o.extension=function(e,t){"use strict";if(!o.helper.isString(e))throw Error("Extension 'name' must be a string");if(e=o.helper.stdExtName(e),o.helper.isUndefined(t)){if(!s.hasOwnProperty(e))throw Error("Extension named "+e+" is not registered!");return s[e]}"function"==typeof t&&(t=t()),o.helper.isArray(t)||(t=[t]);var r=d(t,e);if(!r.valid)throw Error(r.error);s[e]=t},o.getAllExtensions=function(){"use strict";return s},o.removeExtension=function(e){"use strict";delete s[e]},o.resetExtensions=function(){"use strict";s={}},o.validateExtension=function(e){"use strict";var t=d(e,null);return!!t.valid||(console.warn(t.error),!1)},o.hasOwnProperty("helper")||(o.helper={}),o.helper.isString=function(e){"use strict";return"string"==typeof e||e instanceof String},o.helper.isFunction=function(e){"use strict";return e&&"[object Function]"==={}.toString.call(e)},o.helper.isArray=function(e){"use strict";return Array.isArray(e)},o.helper.isUndefined=function(e){"use strict";return void 0===e},o.helper.forEach=function(e,t){"use strict";if(o.helper.isUndefined(e))throw new Error("obj param is required");if(o.helper.isUndefined(t))throw new Error("callback param is required");if(!o.helper.isFunction(t))throw new Error("callback param must be a function/closure");if("function"==typeof e.forEach)e.forEach(t);else if(o.helper.isArray(e))for(var r=0;r<e.length;r++)t(e[r],r,e);else{if("object"!=typeof e)throw new Error("obj does not seem to be an array or an iterable object");for(var n in e)e.hasOwnProperty(n)&&t(e[n],n,e)}},o.helper.stdExtName=function(e){"use strict";return e.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()},o.helper.escapeCharactersCallback=p,o.helper.escapeCharacters=function(e,t,r){"use strict";var n="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])";r&&(n="\\\\"+n);var a=new RegExp(n,"g");return e=e.replace(a,p)},o.helper.unescapeHTMLEntities=function(e){"use strict";return e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")};var h=function(e,t,r,n){"use strict";var a,o,i,s,c,l=n||"",u=l.indexOf("g")>-1,d=new RegExp(t+"|"+r,"g"+l.replace(/g/g,"")),p=new RegExp(t,l.replace(/g/g,"")),h=[];do{for(a=0;i=d.exec(e);)if(p.test(i[0]))a++||(s=(o=d.lastIndex)-i[0].length);else if(a&&!--a){c=i.index+i[0].length;var f={left:{start:s,end:o},match:{start:o,end:i.index},right:{start:i.index,end:c},wholeMatch:{start:s,end:c}};if(h.push(f),!u)return h}}while(a&&(d.lastIndex=o));return h};o.helper.matchRecursiveRegExp=function(e,t,r,n){"use strict";for(var a=h(e,t,r,n),o=[],i=0;i<a.length;++i)o.push([e.slice(a[i].wholeMatch.start,a[i].wholeMatch.end),e.slice(a[i].match.start,a[i].match.end),e.slice(a[i].left.start,a[i].left.end),e.slice(a[i].right.start,a[i].right.end)]);return o},o.helper.replaceRecursiveRegExp=function(e,t,r,n,a){"use strict";if(!o.helper.isFunction(t)){var i=t;t=function(){return i}}var s=h(e,r,n,a),c=e,l=s.length;if(l>0){var u=[];0!==s[0].wholeMatch.start&&u.push(e.slice(0,s[0].wholeMatch.start));for(var d=0;d<l;++d)u.push(t(e.slice(s[d].wholeMatch.start,s[d].wholeMatch.end),e.slice(s[d].match.start,s[d].match.end),e.slice(s[d].left.start,s[d].left.end),e.slice(s[d].right.start,s[d].right.end))),d<l-1&&u.push(e.slice(s[d].wholeMatch.end,s[d+1].wholeMatch.start));s[l-1].wholeMatch.end<e.length&&u.push(e.slice(s[l-1].wholeMatch.end)),c=u.join("")}return c},o.helper.regexIndexOf=function(e,t,r){"use strict";if(!o.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";if(t instanceof RegExp==!1)throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";var n=e.substring(r||0).search(t);return n>=0?n+(r||0):n},o.helper.splitAtIndex=function(e,t){"use strict";if(!o.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[e.substring(0,t),e.substring(t)]},o.helper.encodeEmailAddress=function(e){"use strict";var t=[function(e){return"&#"+e.charCodeAt(0)+";"},function(e){return"&#x"+e.charCodeAt(0).toString(16)+";"},function(e){return e}];return e=e.replace(/./g,(function(e){if("@"===e)e=t[Math.floor(2*Math.random())](e);else{var r=Math.random();e=r>.9?t[2](e):r>.45?t[1](e):t[0](e)}return e}))},o.helper.padEnd=function(e,t,r){"use strict";return t>>=0,r=String(r||" "),e.length>t?String(e):((t-=e.length)>r.length&&(r+=r.repeat(t/r.length)),String(e)+r.slice(0,t))},"undefined"==typeof console&&(console={warn:function(e){"use strict";alert(e)},log:function(e){"use strict";alert(e)},error:function(e){"use strict";throw e}}),o.helper.regexes={asteriskDashAndColon:/([*_:~])/g},o.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️‍♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴‍♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱‍♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇‍♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷‍♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨‍❤️‍👨",couple_with_heart_woman_woman:"👩‍❤️‍👩",couplekiss_man_man:"👨‍❤️‍💋‍👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩‍❤️‍💋‍👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯‍♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁‍🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨‍👦",family_man_boy_boy:"👨‍👦‍👦",family_man_girl:"👨‍👧",family_man_girl_boy:"👨‍👧‍👦",family_man_girl_girl:"👨‍👧‍👧",family_man_man_boy:"👨‍👨‍👦",family_man_man_boy_boy:"👨‍👨‍👦‍👦",family_man_man_girl:"👨‍👨‍👧",family_man_man_girl_boy:"👨‍👨‍👧‍👦",family_man_man_girl_girl:"👨‍👨‍👧‍👧",family_man_woman_boy_boy:"👨‍👩‍👦‍👦",family_man_woman_girl:"👨‍👩‍👧",family_man_woman_girl_boy:"👨‍👩‍👧‍👦",family_man_woman_girl_girl:"👨‍👩‍👧‍👧",family_woman_boy:"👩‍👦",family_woman_boy_boy:"👩‍👦‍👦",family_woman_girl:"👩‍👧",family_woman_girl_boy:"👩‍👧‍👦",family_woman_girl_girl:"👩‍👧‍👧",family_woman_woman_boy:"👩‍👩‍👦",family_woman_woman_boy_boy:"👩‍👩‍👦‍👦",family_woman_woman_girl:"👩‍👩‍👧",family_woman_woman_girl_boy:"👩‍👩‍👧‍👦",family_woman_woman_girl_girl:"👩‍👩‍👧‍👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️‍♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍‍♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️‍♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂‍♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇‍♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨‍🎨",man_astronaut:"👨‍🚀",man_cartwheeling:"🤸‍♂️",man_cook:"👨‍🍳",man_dancing:"🕺",man_facepalming:"🤦‍♂️",man_factory_worker:"👨‍🏭",man_farmer:"👨‍🌾",man_firefighter:"👨‍🚒",man_health_worker:"👨‍⚕️",man_in_tuxedo:"🤵",man_judge:"👨‍⚖️",man_juggling:"🤹‍♂️",man_mechanic:"👨‍🔧",man_office_worker:"👨‍💼",man_pilot:"👨‍✈️",man_playing_handball:"🤾‍♂️",man_playing_water_polo:"🤽‍♂️",man_scientist:"👨‍🔬",man_shrugging:"🤷‍♂️",man_singer:"👨‍🎤",man_student:"👨‍🎓",man_teacher:"👨‍🏫",man_technologist:"👨‍💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆‍♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼‍♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵‍♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅‍♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆‍♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮‍♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎‍♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️‍🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋‍♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣‍♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃‍♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄‍♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊‍♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁‍♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶‍♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️‍♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩‍🎨",woman_astronaut:"👩‍🚀",woman_cartwheeling:"🤸‍♀️",woman_cook:"👩‍🍳",woman_facepalming:"🤦‍♀️",woman_factory_worker:"👩‍🏭",woman_farmer:"👩‍🌾",woman_firefighter:"👩‍🚒",woman_health_worker:"👩‍⚕️",woman_judge:"👩‍⚖️",woman_juggling:"🤹‍♀️",woman_mechanic:"👩‍🔧",woman_office_worker:"👩‍💼",woman_pilot:"👩‍✈️",woman_playing_handball:"🤾‍♀️",woman_playing_water_polo:"🤽‍♀️",woman_scientist:"👩‍🔬",woman_shrugging:"🤷‍♀️",woman_singer:"👩‍🎤",woman_student:"👩‍🎓",woman_teacher:"👩‍🏫",woman_technologist:"👩‍💻",woman_with_turban:"👳‍♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼‍♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',showdown:"<span style=\"font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;\">S</span>"},o.Converter=function(e){"use strict";var t={},r=[],n=[],a={},i=l,p={parsed:{},raw:"",format:""};function h(e,t){if(t=t||null,o.helper.isString(e)){if(t=e=o.helper.stdExtName(e),o.extensions[e])return console.warn("DEPRECATION WARNING: "+e+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),void function(e,t){"function"==typeof e&&(e=e(new o.Converter));o.helper.isArray(e)||(e=[e]);var a=d(e,t);if(!a.valid)throw Error(a.error);for(var i=0;i<e.length;++i)switch(e[i].type){case"lang":r.push(e[i]);break;case"output":n.push(e[i]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}(o.extensions[e],e);if(o.helper.isUndefined(s[e]))throw Error('Extension "'+e+'" could not be loaded. It was either not found or is not a valid extension.');e=s[e]}"function"==typeof e&&(e=e()),o.helper.isArray(e)||(e=[e]);var a=d(e,t);if(!a.valid)throw Error(a.error);for(var i=0;i<e.length;++i){switch(e[i].type){case"lang":r.push(e[i]);break;case"output":n.push(e[i])}if(e[i].hasOwnProperty("listeners"))for(var c in e[i].listeners)e[i].listeners.hasOwnProperty(c)&&f(c,e[i].listeners[c])}}function f(e,t){if(!o.helper.isString(e))throw Error("Invalid argument in converter.listen() method: name must be a string, but "+typeof e+" given");if("function"!=typeof t)throw Error("Invalid argument in converter.listen() method: callback must be a function, but "+typeof t+" given");a.hasOwnProperty(e)||(a[e]=[]),a[e].push(t)}!function(){for(var r in e=e||{},c)c.hasOwnProperty(r)&&(t[r]=c[r]);if("object"!=typeof e)throw Error("Converter expects the passed parameter to be an object, but "+typeof e+" was passed instead.");for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.extensions&&o.helper.forEach(t.extensions,h)}(),this._dispatch=function(e,t,r,n){if(a.hasOwnProperty(e))for(var o=0;o<a[e].length;++o){var i=a[e][o](e,t,this,r,n);i&&void 0!==i&&(t=i)}return t},this.listen=function(e,t){return f(e,t),this},this.makeHtml=function(e){if(!e)return e;var a={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:r,outputModifiers:n,converter:this,ghCodeBlocks:[],metadata:{parsed:{},raw:"",format:""}};return e=(e=(e=(e=(e=e.replace(/¨/g,"¨T")).replace(/\$/g,"¨D")).replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/\u00A0/g," "),t.smartIndentationFix&&(e=function(e){var t=e.match(/^\s*/)[0].length,r=new RegExp("^\\s{0,"+t+"}","gm");return e.replace(r,"")}(e)),e="\n\n"+e+"\n\n",e=(e=o.subParser("detab")(e,t,a)).replace(/^[ \t]+$/gm,""),o.helper.forEach(r,(function(r){e=o.subParser("runExtension")(r,e,t,a)})),e=o.subParser("metadata")(e,t,a),e=o.subParser("hashPreCodeTags")(e,t,a),e=o.subParser("githubCodeBlocks")(e,t,a),e=o.subParser("hashHTMLBlocks")(e,t,a),e=o.subParser("hashCodeTags")(e,t,a),e=o.subParser("stripLinkDefinitions")(e,t,a),e=o.subParser("blockGamut")(e,t,a),e=o.subParser("unhashHTMLSpans")(e,t,a),e=(e=(e=o.subParser("unescapeSpecialChars")(e,t,a)).replace(/¨D/g,"$$")).replace(/¨T/g,"¨"),e=o.subParser("completeHTMLDocument")(e,t,a),o.helper.forEach(n,(function(r){e=o.subParser("runExtension")(r,e,t,a)})),p=a.metadata,e},this.makeMarkdown=this.makeMd=function(e,t){if(e=(e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/>[ \t]+</,">¨NBSP;<"),!t){if(!window||!window.document)throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");t=window.document}var r=t.createElement("div");r.innerHTML=e;var n={preList:function(e){for(var t=e.querySelectorAll("pre"),r=[],n=0;n<t.length;++n)if(1===t[n].childElementCount&&"code"===t[n].firstChild.tagName.toLowerCase()){var a=t[n].firstChild.innerHTML.trim(),i=t[n].firstChild.getAttribute("data-language")||"";if(""===i)for(var s=t[n].firstChild.className.split(" "),c=0;c<s.length;++c){var l=s[c].match(/^language-(.+)$/);if(null!==l){i=l[1];break}}a=o.helper.unescapeHTMLEntities(a),r.push(a),t[n].outerHTML='<precode language="'+i+'" precodenum="'+n.toString()+'"></precode>'}else r.push(t[n].innerHTML),t[n].innerHTML="",t[n].setAttribute("prenum",n.toString());return r}(r)};!function e(t){for(var r=0;r<t.childNodes.length;++r){var n=t.childNodes[r];3===n.nodeType?/\S/.test(n.nodeValue)?(n.nodeValue=n.nodeValue.split("\n").join(" "),n.nodeValue=n.nodeValue.replace(/(\s)+/g,"$1")):(t.removeChild(n),--r):1===n.nodeType&&e(n)}}(r);for(var a=r.childNodes,i="",s=0;s<a.length;s++)i+=o.subParser("makeMarkdown.node")(a[s],n);return i},this.setOption=function(e,r){t[e]=r},this.getOption=function(e){return t[e]},this.getOptions=function(){return t},this.addExtension=function(e,t){h(e,t=t||null)},this.useExtension=function(e){h(e)},this.setFlavor=function(e){if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");var r=u[e];for(var n in i=e,r)r.hasOwnProperty(n)&&(t[n]=r[n])},this.getFlavor=function(){return i},this.removeExtension=function(e){o.helper.isArray(e)||(e=[e]);for(var t=0;t<e.length;++t){for(var a=e[t],i=0;i<r.length;++i)r[i]===a&&r[i].splice(i,1);for(;0<n.length;++i)n[0]===a&&n[0].splice(i,1)}},this.getAllExtensions=function(){return{language:r,output:n}},this.getMetadata=function(e){return e?p.raw:p.parsed},this.getMetadataFormat=function(){return p.format},this._setMetadataPair=function(e,t){p.parsed[e]=t},this._setMetadataFormat=function(e){p.format=e},this._setMetadataRaw=function(e){p.raw=e}},o.subParser("anchors",(function(e,t,r){"use strict";var n=function(e,n,a,i,s,c,l){if(o.helper.isUndefined(l)&&(l=""),a=a.toLowerCase(),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)i="";else if(!i){if(a||(a=n.toLowerCase().replace(/ ?\n/g," ")),i="#"+a,o.helper.isUndefined(r.gUrls[a]))return e;i=r.gUrls[a],o.helper.isUndefined(r.gTitles[a])||(l=r.gTitles[a])}var u='<a href="'+(i=i.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback))+'"';return""!==l&&null!==l&&(u+=' title="'+(l=(l=l.replace(/"/g,""")).replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback))+'"'),t.openLinksInNewWindow&&!/^#/.test(i)&&(u+=' rel="noopener noreferrer" target="¨E95Eblank"'),u+=">"+n+"</a>"};return e=(e=(e=(e=(e=r.converter._dispatch("anchors.before",e,t,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,n)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,n)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,n)).replace(/\[([^\[\]]+)]()()()()()/g,n),t.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim,(function(e,r,n,a,i){if("\\"===n)return r+a;if(!o.helper.isString(t.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var s=t.ghMentionsLink.replace(/\{u}/g,i),c="";return t.openLinksInNewWindow&&(c=' rel="noopener noreferrer" target="¨E95Eblank"'),r+'<a href="'+s+'"'+c+">"+a+"</a>"}))),e=r.converter._dispatch("anchors.after",e,t,r)}));var f=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,g=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,m=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,b=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,_=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,k=function(e){"use strict";return function(t,r,n,a,i,s,c){var l=n=n.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback),u="",d="",p=r||"",h=c||"";return/^www\./i.test(n)&&(n=n.replace(/^www\./i,"http://www.")),e.excludeTrailingPunctuationFromURLs&&s&&(u=s),e.openLinksInNewWindow&&(d=' rel="noopener noreferrer" target="¨E95Eblank"'),p+'<a href="'+n+'"'+d+">"+l+"</a>"+u+h}},y=function(e,t){"use strict";return function(r,n,a){var i="mailto:";return n=n||"",a=o.subParser("unescapeSpecialChars")(a,e,t),e.encodeEmails?(i=o.helper.encodeEmailAddress(i+a),a=o.helper.encodeEmailAddress(a)):i+=a,n+'<a href="'+i+'">'+a+"</a>"}};o.subParser("autoLinks",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("autoLinks.before",e,t,r)).replace(m,k(t))).replace(_,y(t,r)),e=r.converter._dispatch("autoLinks.after",e,t,r)})),o.subParser("simplifiedAutoLinks",(function(e,t,r){"use strict";return t.simplifiedAutoLink?(e=r.converter._dispatch("simplifiedAutoLinks.before",e,t,r),e=(e=t.excludeTrailingPunctuationFromURLs?e.replace(g,k(t)):e.replace(f,k(t))).replace(b,y(t,r)),e=r.converter._dispatch("simplifiedAutoLinks.after",e,t,r)):e})),o.subParser("blockGamut",(function(e,t,r){"use strict";return e=r.converter._dispatch("blockGamut.before",e,t,r),e=o.subParser("blockQuotes")(e,t,r),e=o.subParser("headers")(e,t,r),e=o.subParser("horizontalRule")(e,t,r),e=o.subParser("lists")(e,t,r),e=o.subParser("codeBlocks")(e,t,r),e=o.subParser("tables")(e,t,r),e=o.subParser("hashHTMLBlocks")(e,t,r),e=o.subParser("paragraphs")(e,t,r),e=r.converter._dispatch("blockGamut.after",e,t,r)})),o.subParser("blockQuotes",(function(e,t,r){"use strict";e=r.converter._dispatch("blockQuotes.before",e,t,r),e+="\n\n";var n=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return t.splitAdjacentBlockquotes&&(n=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),e=e.replace(n,(function(e){return e=(e=(e=e.replace(/^[ \t]*>[ \t]?/gm,"")).replace(/¨0/g,"")).replace(/^[ \t]+$/gm,""),e=o.subParser("githubCodeBlocks")(e,t,r),e=(e=(e=o.subParser("blockGamut")(e,t,r)).replace(/(^|\n)/g,"$1 ")).replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,(function(e,t){var r=t;return r=(r=r.replace(/^ /gm,"¨0")).replace(/¨0/g,"")})),o.subParser("hashBlock")("<blockquote>\n"+e+"\n</blockquote>",t,r)})),e=r.converter._dispatch("blockQuotes.after",e,t,r)})),o.subParser("codeBlocks",(function(e,t,r){"use strict";e=r.converter._dispatch("codeBlocks.before",e,t,r);return e=(e=(e+="¨0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g,(function(e,n,a){var i=n,s=a,c="\n";return i=o.subParser("outdent")(i,t,r),i=o.subParser("encodeCode")(i,t,r),i=(i=(i=o.subParser("detab")(i,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,""),t.omitExtraWLInCodeBlocks&&(c=""),i="<pre><code>"+i+c+"</code></pre>",o.subParser("hashBlock")(i,t,r)+s}))).replace(/¨0/,""),e=r.converter._dispatch("codeBlocks.after",e,t,r)})),o.subParser("codeSpans",(function(e,t,r){"use strict";return void 0===(e=r.converter._dispatch("codeSpans.before",e,t,r))&&(e=""),e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,(function(e,n,a,i){var s=i;return s=(s=s.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),s=n+"<code>"+(s=o.subParser("encodeCode")(s,t,r))+"</code>",s=o.subParser("hashHTMLSpans")(s,t,r)})),e=r.converter._dispatch("codeSpans.after",e,t,r)})),o.subParser("completeHTMLDocument",(function(e,t,r){"use strict";if(!t.completeHTMLDocument)return e;e=r.converter._dispatch("completeHTMLDocument.before",e,t,r);var n="html",a="<!DOCTYPE HTML>\n",o="",i='<meta charset="utf-8">\n',s="",c="";for(var l in void 0!==r.metadata.parsed.doctype&&(a="<!DOCTYPE "+r.metadata.parsed.doctype+">\n","html"!==(n=r.metadata.parsed.doctype.toString().toLowerCase())&&"html5"!==n||(i='<meta charset="utf-8">')),r.metadata.parsed)if(r.metadata.parsed.hasOwnProperty(l))switch(l.toLowerCase()){case"doctype":break;case"title":o="<title>"+r.metadata.parsed.title+"</title>\n";break;case"charset":i="html"===n||"html5"===n?'<meta charset="'+r.metadata.parsed.charset+'">\n':'<meta name="charset" content="'+r.metadata.parsed.charset+'">\n';break;case"language":case"lang":s=' lang="'+r.metadata.parsed[l]+'"',c+='<meta name="'+l+'" content="'+r.metadata.parsed[l]+'">\n';break;default:c+='<meta name="'+l+'" content="'+r.metadata.parsed[l]+'">\n'}return e=a+"<html"+s+">\n<head>\n"+o+i+c+"</head>\n<body>\n"+e.trim()+"\n</body>\n</html>",e=r.converter._dispatch("completeHTMLDocument.after",e,t,r)})),o.subParser("detab",(function(e,t,r){"use strict";return e=(e=(e=(e=(e=(e=r.converter._dispatch("detab.before",e,t,r)).replace(/\t(?=\t)/g," ")).replace(/\t/g,"¨A¨B")).replace(/¨B(.+?)¨A/g,(function(e,t){for(var r=t,n=4-r.length%4,a=0;a<n;a++)r+=" ";return r}))).replace(/¨A/g," ")).replace(/¨B/g,""),e=r.converter._dispatch("detab.after",e,t,r)})),o.subParser("ellipsis",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("ellipsis.before",e,t,r)).replace(/\.\.\./g,"…"),e=r.converter._dispatch("ellipsis.after",e,t,r)})),o.subParser("emoji",(function(e,t,r){"use strict";if(!t.emoji)return e;return e=(e=r.converter._dispatch("emoji.before",e,t,r)).replace(/:([\S]+?):/g,(function(e,t){return o.helper.emojis.hasOwnProperty(t)?o.helper.emojis[t]:e})),e=r.converter._dispatch("emoji.after",e,t,r)})),o.subParser("encodeAmpsAndAngles",(function(e,t,r){"use strict";return e=(e=(e=(e=(e=r.converter._dispatch("encodeAmpsAndAngles.before",e,t,r)).replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&")).replace(/<(?![a-z\/?$!])/gi,"<")).replace(/</g,"<")).replace(/>/g,">"),e=r.converter._dispatch("encodeAmpsAndAngles.after",e,t,r)})),o.subParser("encodeBackslashEscapes",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("encodeBackslashEscapes.before",e,t,r)).replace(/\\(\\)/g,o.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,o.helper.escapeCharactersCallback),e=r.converter._dispatch("encodeBackslashEscapes.after",e,t,r)})),o.subParser("encodeCode",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("encodeCode.before",e,t,r)).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/([*_{}\[\]\\=~-])/g,o.helper.escapeCharactersCallback),e=r.converter._dispatch("encodeCode.after",e,t,r)})),o.subParser("escapeSpecialCharsWithinTagAttributes",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",e,t,r)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,(function(e){return e.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,o.helper.escapeCharactersCallback)}))).replace(/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi,(function(e){return e.replace(/([\\`*_~=|])/g,o.helper.escapeCharactersCallback)})),e=r.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,t,r)})),o.subParser("githubCodeBlocks",(function(e,t,r){"use strict";return t.ghCodeBlocks?(e=r.converter._dispatch("githubCodeBlocks.before",e,t,r),e=(e=(e+="¨0").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,(function(e,n,a,i){var s=t.omitExtraWLInCodeBlocks?"":"\n";return i=o.subParser("encodeCode")(i,t,r),i="<pre><code"+(a?' class="'+a+" language-"+a+'"':"")+">"+(i=(i=(i=o.subParser("detab")(i,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+s+"</code></pre>",i=o.subParser("hashBlock")(i,t,r),"\n\n¨G"+(r.ghCodeBlocks.push({text:e,codeblock:i})-1)+"G\n\n"}))).replace(/¨0/,""),r.converter._dispatch("githubCodeBlocks.after",e,t,r)):e})),o.subParser("hashBlock",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("hashBlock.before",e,t,r)).replace(/(^\n+|\n+$)/g,""),e="\n\n¨K"+(r.gHtmlBlocks.push(e)-1)+"K\n\n",e=r.converter._dispatch("hashBlock.after",e,t,r)})),o.subParser("hashCodeTags",(function(e,t,r){"use strict";e=r.converter._dispatch("hashCodeTags.before",e,t,r);return e=o.helper.replaceRecursiveRegExp(e,(function(e,n,a,i){var s=a+o.subParser("encodeCode")(n,t,r)+i;return"¨C"+(r.gHtmlSpans.push(s)-1)+"C"}),"<code\\b[^>]*>","</code>","gim"),e=r.converter._dispatch("hashCodeTags.after",e,t,r)})),o.subParser("hashElement",(function(e,t,r){"use strict";return function(e,t){var n=t;return n=(n=(n=n.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),n="\n\n¨K"+(r.gHtmlBlocks.push(n)-1)+"K\n\n"}})),o.subParser("hashHTMLBlocks",(function(e,t,r){"use strict";e=r.converter._dispatch("hashHTMLBlocks.before",e,t,r);var n=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],a=function(e,t,n,a){var o=e;return-1!==n.search(/\bmarkdown\b/)&&(o=n+r.converter.makeHtml(t)+a),"\n\n¨K"+(r.gHtmlBlocks.push(o)-1)+"K\n\n"};t.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,(function(e,t){return"<"+t+">"})));for(var i=0;i<n.length;++i)for(var s,c=new RegExp("^ {0,3}(<"+n[i]+"\\b[^>]*>)","im"),l="<"+n[i]+"\\b[^>]*>",u="</"+n[i]+">";-1!==(s=o.helper.regexIndexOf(e,c));){var d=o.helper.splitAtIndex(e,s),p=o.helper.replaceRecursiveRegExp(d[1],a,l,u,"im");if(p===d[1])break;e=d[0].concat(p)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,o.subParser("hashElement")(e,t,r)),e=(e=o.helper.replaceRecursiveRegExp(e,(function(e){return"\n\n¨K"+(r.gHtmlBlocks.push(e)-1)+"K\n\n"}),"^ {0,3}\x3c!--","--\x3e","gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,o.subParser("hashElement")(e,t,r)),e=r.converter._dispatch("hashHTMLBlocks.after",e,t,r)})),o.subParser("hashHTMLSpans",(function(e,t,r){"use strict";function n(e){return"¨C"+(r.gHtmlSpans.push(e)-1)+"C"}return e=(e=(e=(e=(e=r.converter._dispatch("hashHTMLSpans.before",e,t,r)).replace(/<[^>]+?\/>/gi,(function(e){return n(e)}))).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,(function(e){return n(e)}))).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,(function(e){return n(e)}))).replace(/<[^>]+?>/gi,(function(e){return n(e)})),e=r.converter._dispatch("hashHTMLSpans.after",e,t,r)})),o.subParser("unhashHTMLSpans",(function(e,t,r){"use strict";e=r.converter._dispatch("unhashHTMLSpans.before",e,t,r);for(var n=0;n<r.gHtmlSpans.length;++n){for(var a=r.gHtmlSpans[n],o=0;/¨C(\d+)C/.test(a);){var i=RegExp.$1;if(a=a.replace("¨C"+i+"C",r.gHtmlSpans[i]),10===o){console.error("maximum nesting of 10 spans reached!!!");break}++o}e=e.replace("¨C"+n+"C",a)}return e=r.converter._dispatch("unhashHTMLSpans.after",e,t,r)})),o.subParser("hashPreCodeTags",(function(e,t,r){"use strict";e=r.converter._dispatch("hashPreCodeTags.before",e,t,r);return e=o.helper.replaceRecursiveRegExp(e,(function(e,n,a,i){var s=a+o.subParser("encodeCode")(n,t,r)+i;return"\n\n¨G"+(r.ghCodeBlocks.push({text:e,codeblock:s})-1)+"G\n\n"}),"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>","^ {0,3}</code>\\s*</pre>","gim"),e=r.converter._dispatch("hashPreCodeTags.after",e,t,r)})),o.subParser("headers",(function(e,t,r){"use strict";e=r.converter._dispatch("headers.before",e,t,r);var n=isNaN(parseInt(t.headerLevelStart))?1:parseInt(t.headerLevelStart),a=t.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,i=t.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;e=(e=e.replace(a,(function(e,a){var i=o.subParser("spanGamut")(a,t,r),s=t.noHeaderId?"":' id="'+c(a)+'"',l="<h"+n+s+">"+i+"</h"+n+">";return o.subParser("hashBlock")(l,t,r)}))).replace(i,(function(e,a){var i=o.subParser("spanGamut")(a,t,r),s=t.noHeaderId?"":' id="'+c(a)+'"',l=n+1,u="<h"+l+s+">"+i+"</h"+l+">";return o.subParser("hashBlock")(u,t,r)}));var s=t.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;function c(e){var n,a;if(t.customizedHeaderId){var i=e.match(/\{([^{]+?)}\s*$/);i&&i[1]&&(e=i[1])}return n=e,a=o.helper.isString(t.prefixHeaderId)?t.prefixHeaderId:!0===t.prefixHeaderId?"section-":"",t.rawPrefixHeaderId||(n=a+n),n=t.ghCompatibleHeaderId?n.replace(/ /g,"-").replace(/&/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():t.rawHeaderId?n.replace(/ /g,"-").replace(/&/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():n.replace(/[^\w]/g,"").toLowerCase(),t.rawPrefixHeaderId&&(n=a+n),r.hashLinkCounts[n]?n=n+"-"+r.hashLinkCounts[n]++:r.hashLinkCounts[n]=1,n}return e=e.replace(s,(function(e,a,i){var s=i;t.customizedHeaderId&&(s=i.replace(/\s?\{([^{]+?)}\s*$/,""));var l=o.subParser("spanGamut")(s,t,r),u=t.noHeaderId?"":' id="'+c(i)+'"',d=n-1+a.length,p="<h"+d+u+">"+l+"</h"+d+">";return o.subParser("hashBlock")(p,t,r)})),e=r.converter._dispatch("headers.after",e,t,r)})),o.subParser("horizontalRule",(function(e,t,r){"use strict";e=r.converter._dispatch("horizontalRule.before",e,t,r);var n=o.subParser("hashBlock")("<hr />",t,r);return e=(e=(e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,n)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,n)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,n),e=r.converter._dispatch("horizontalRule.after",e,t,r)})),o.subParser("images",(function(e,t,r){"use strict";function n(e,t,n,a,i,s,c,l){var u=r.gUrls,d=r.gTitles,p=r.gDimensions;if(n=n.toLowerCase(),l||(l=""),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)a="";else if(""===a||null===a){if(""!==n&&null!==n||(n=t.toLowerCase().replace(/ ?\n/g," ")),a="#"+n,o.helper.isUndefined(u[n]))return e;a=u[n],o.helper.isUndefined(d[n])||(l=d[n]),o.helper.isUndefined(p[n])||(i=p[n].width,s=p[n].height)}t=t.replace(/"/g,""").replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback);var h='<img src="'+(a=a.replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback))+'" alt="'+t+'"';return l&&o.helper.isString(l)&&(h+=' title="'+(l=l.replace(/"/g,""").replace(o.helper.regexes.asteriskDashAndColon,o.helper.escapeCharactersCallback))+'"'),i&&s&&(h+=' width="'+(i="*"===i?"auto":i)+'"',h+=' height="'+(s="*"===s?"auto":s)+'"'),h+=" />"}return e=(e=(e=(e=(e=(e=r.converter._dispatch("images.before",e,t,r)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,n)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,(function(e,t,r,a,o,i,s,c){return n(e,t,r,a=a.replace(/\s/g,""),o,i,s,c)}))).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,n)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,n)).replace(/!\[([^\[\]]+)]()()()()()/g,n),e=r.converter._dispatch("images.after",e,t,r)})),o.subParser("italicsAndBold",(function(e,t,r){"use strict";function n(e,t,r){return t+e+r}return e=r.converter._dispatch("italicsAndBold.before",e,t,r),e=t.literalMidWordUnderscores?(e=(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return n(t,"<strong><em>","</em></strong>")}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return n(t,"<strong>","</strong>")}))).replace(/\b_(\S[\s\S]*?)_\b/g,(function(e,t){return n(t,"<em>","</em>")})):(e=(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?n(t,"<strong><em>","</em></strong>"):e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?n(t,"<strong>","</strong>"):e}))).replace(/_([^\s_][\s\S]*?)_/g,(function(e,t){return/\S$/.test(t)?n(t,"<em>","</em>"):e})),e=t.literalMidWordAsterisks?(e=(e=e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,(function(e,t,r){return n(r,t+"<strong><em>","</em></strong>")}))).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,(function(e,t,r){return n(r,t+"<strong>","</strong>")}))).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,(function(e,t,r){return n(r,t+"<em>","</em>")})):(e=(e=e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,(function(e,t){return/\S$/.test(t)?n(t,"<strong><em>","</em></strong>"):e}))).replace(/\*\*(\S[\s\S]*?)\*\*/g,(function(e,t){return/\S$/.test(t)?n(t,"<strong>","</strong>"):e}))).replace(/\*([^\s*][\s\S]*?)\*/g,(function(e,t){return/\S$/.test(t)?n(t,"<em>","</em>"):e})),e=r.converter._dispatch("italicsAndBold.after",e,t,r)})),o.subParser("lists",(function(e,t,r){"use strict";function n(e,n){r.gListLevel++,e=e.replace(/\n{2,}$/,"\n");var a=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,i=/\n[ \t]*\n(?!¨0)/.test(e+="¨0");return t.disableForced4SpacesIndentedSublists&&(a=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=(e=e.replace(a,(function(e,n,a,s,c,l,u){u=u&&""!==u.trim();var d=o.subParser("outdent")(c,t,r),p="";return l&&t.tasklists&&(p=' class="task-list-item" style="list-style-type: none;"',d=d.replace(/^[ \t]*\[(x|X| )?]/m,(function(){var e='<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';return u&&(e+=" checked"),e+=">"}))),d=d.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,(function(e){return"¨A"+e})),n||d.search(/\n{2,}/)>-1?(d=o.subParser("githubCodeBlocks")(d,t,r),d=o.subParser("blockGamut")(d,t,r)):(d=(d=o.subParser("lists")(d,t,r)).replace(/\n$/,""),d=(d=o.subParser("hashHTMLBlocks")(d,t,r)).replace(/\n\n+/g,"\n\n"),d=i?o.subParser("paragraphs")(d,t,r):o.subParser("spanGamut")(d,t,r)),d="<li"+p+">"+(d=d.replace("¨A",""))+"</li>\n"}))).replace(/¨0/g,""),r.gListLevel--,n&&(e=e.replace(/\s+$/,"")),e}function a(e,t){if("ol"===t){var r=e.match(/^ *(\d+)\./);if(r&&"1"!==r[1])return' start="'+r[1]+'"'}return""}function i(e,r,o){var i=t.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,s=t.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,c="ul"===r?i:s,l="";if(-1!==e.search(c))!function t(u){var d=u.search(c),p=a(e,r);-1!==d?(l+="\n\n<"+r+p+">\n"+n(u.slice(0,d),!!o)+"</"+r+">\n",c="ul"===(r="ul"===r?"ol":"ul")?i:s,t(u.slice(d))):l+="\n\n<"+r+p+">\n"+n(u,!!o)+"</"+r+">\n"}(e);else{var u=a(e,r);l="\n\n<"+r+u+">\n"+n(e,!!o)+"</"+r+">\n"}return l}return e=r.converter._dispatch("lists.before",e,t,r),e+="¨0",e=(e=r.gListLevel?e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,r){return i(t,r.search(/[*+-]/g)>-1?"ul":"ol",!0)})):e.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,r,n){return i(r,n.search(/[*+-]/g)>-1?"ul":"ol",!1)}))).replace(/¨0/,""),e=r.converter._dispatch("lists.after",e,t,r)})),o.subParser("metadata",(function(e,t,r){"use strict";if(!t.metadata)return e;function n(e){r.metadata.raw=e,(e=(e=e.replace(/&/g,"&").replace(/"/g,""")).replace(/\n {4}/g," ")).replace(/^([\S ]+): +([\s\S]+?)$/gm,(function(e,t,n){return r.metadata.parsed[t]=n,""}))}return e=(e=(e=(e=r.converter._dispatch("metadata.before",e,t,r)).replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,(function(e,t,r){return n(r),"¨M"}))).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,(function(e,t,a){return t&&(r.metadata.format=t),n(a),"¨M"}))).replace(/¨M/g,""),e=r.converter._dispatch("metadata.after",e,t,r)})),o.subParser("outdent",(function(e,t,r){"use strict";return e=(e=(e=r.converter._dispatch("outdent.before",e,t,r)).replace(/^(\t|[ ]{1,4})/gm,"¨0")).replace(/¨0/g,""),e=r.converter._dispatch("outdent.after",e,t,r)})),o.subParser("paragraphs",(function(e,t,r){"use strict";for(var n=(e=(e=(e=r.converter._dispatch("paragraphs.before",e,t,r)).replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),a=[],i=n.length,s=0;s<i;s++){var c=n[s];c.search(/¨(K|G)(\d+)\1/g)>=0?a.push(c):c.search(/\S/)>=0&&(c=(c=o.subParser("spanGamut")(c,t,r)).replace(/^([ \t]*)/g,"<p>"),c+="</p>",a.push(c))}for(i=a.length,s=0;s<i;s++){for(var l="",u=a[s],d=!1;/¨(K|G)(\d+)\1/.test(u);){var p=RegExp.$1,h=RegExp.$2;l=(l="K"===p?r.gHtmlBlocks[h]:d?o.subParser("encodeCode")(r.ghCodeBlocks[h].text,t,r):r.ghCodeBlocks[h].codeblock).replace(/\$/g,"$$$$"),u=u.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/,l),/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(u)&&(d=!0)}a[s]=u}return e=(e=(e=a.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),r.converter._dispatch("paragraphs.after",e,t,r)})),o.subParser("runExtension",(function(e,t,r,n){"use strict";if(e.filter)t=e.filter(t,n.converter,r);else if(e.regex){var a=e.regex;a instanceof RegExp||(a=new RegExp(a,"g")),t=t.replace(a,e.replace)}return t})),o.subParser("spanGamut",(function(e,t,r){"use strict";return e=r.converter._dispatch("spanGamut.before",e,t,r),e=o.subParser("codeSpans")(e,t,r),e=o.subParser("escapeSpecialCharsWithinTagAttributes")(e,t,r),e=o.subParser("encodeBackslashEscapes")(e,t,r),e=o.subParser("images")(e,t,r),e=o.subParser("anchors")(e,t,r),e=o.subParser("autoLinks")(e,t,r),e=o.subParser("simplifiedAutoLinks")(e,t,r),e=o.subParser("emoji")(e,t,r),e=o.subParser("underline")(e,t,r),e=o.subParser("italicsAndBold")(e,t,r),e=o.subParser("strikethrough")(e,t,r),e=o.subParser("ellipsis")(e,t,r),e=o.subParser("hashHTMLSpans")(e,t,r),e=o.subParser("encodeAmpsAndAngles")(e,t,r),t.simpleLineBreaks?/\n\n¨K/.test(e)||(e=e.replace(/\n+/g,"<br />\n")):e=e.replace(/ +\n/g,"<br />\n"),e=r.converter._dispatch("spanGamut.after",e,t,r)})),o.subParser("strikethrough",(function(e,t,r){"use strict";return t.strikethrough&&(e=(e=r.converter._dispatch("strikethrough.before",e,t,r)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,(function(e,n){return function(e){return t.simplifiedAutoLink&&(e=o.subParser("simplifiedAutoLinks")(e,t,r)),"<del>"+e+"</del>"}(n)})),e=r.converter._dispatch("strikethrough.after",e,t,r)),e})),o.subParser("stripLinkDefinitions",(function(e,t,r){"use strict";var n=function(e,n,a,i,s,c,l){return n=n.toLowerCase(),a.match(/^data:.+?\/.+?;base64,/)?r.gUrls[n]=a.replace(/\s/g,""):r.gUrls[n]=o.subParser("encodeAmpsAndAngles")(a,t,r),c?c+l:(l&&(r.gTitles[n]=l.replace(/"|'/g,""")),t.parseImgDimensions&&i&&s&&(r.gDimensions[n]={width:i,height:s}),"")};return e=(e=(e=(e+="¨0").replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,n)).replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,n)).replace(/¨0/,"")})),o.subParser("tables",(function(e,t,r){"use strict";if(!t.tables)return e;function n(e,n){return"<td"+n+">"+o.subParser("spanGamut")(e,t,r)+"</td>\n"}function a(e){var a,i=e.split("\n");for(a=0;a<i.length;++a)/^ {0,3}\|/.test(i[a])&&(i[a]=i[a].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(i[a])&&(i[a]=i[a].replace(/\|[ \t]*$/,"")),i[a]=o.subParser("codeSpans")(i[a],t,r);var s,c,l,u,d=i[0].split("|").map((function(e){return e.trim()})),p=i[1].split("|").map((function(e){return e.trim()})),h=[],f=[],g=[],m=[];for(i.shift(),i.shift(),a=0;a<i.length;++a)""!==i[a].trim()&&h.push(i[a].split("|").map((function(e){return e.trim()})));if(d.length<p.length)return e;for(a=0;a<p.length;++a)g.push((s=p[a],/^:[ \t]*--*$/.test(s)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(s)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(s)?' style="text-align:center;"':""));for(a=0;a<d.length;++a)o.helper.isUndefined(g[a])&&(g[a]=""),f.push((c=d[a],l=g[a],u=void 0,u="",c=c.trim(),(t.tablesHeaderId||t.tableHeaderId)&&(u=' id="'+c.replace(/ /g,"_").toLowerCase()+'"'),"<th"+u+l+">"+(c=o.subParser("spanGamut")(c,t,r))+"</th>\n"));for(a=0;a<h.length;++a){for(var b=[],_=0;_<f.length;++_)o.helper.isUndefined(h[a][_]),b.push(n(h[a][_],g[_]));m.push(b)}return function(e,t){for(var r="<table>\n<thead>\n<tr>\n",n=e.length,a=0;a<n;++a)r+=e[a];for(r+="</tr>\n</thead>\n<tbody>\n",a=0;a<t.length;++a){r+="<tr>\n";for(var o=0;o<n;++o)r+=t[a][o];r+="</tr>\n"}return r+"</tbody>\n</table>\n"}(f,m)}return e=(e=(e=(e=r.converter._dispatch("tables.before",e,t,r)).replace(/\\(\|)/g,o.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,a)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm,a),e=r.converter._dispatch("tables.after",e,t,r)})),o.subParser("underline",(function(e,t,r){"use strict";return t.underline?(e=r.converter._dispatch("underline.before",e,t,r),e=(e=t.literalMidWordUnderscores?(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return"<u>"+t+"</u>"}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return"<u>"+t+"</u>"})):(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e}))).replace(/(_)/g,o.helper.escapeCharactersCallback),e=r.converter._dispatch("underline.after",e,t,r)):e})),o.subParser("unescapeSpecialChars",(function(e,t,r){"use strict";return e=(e=r.converter._dispatch("unescapeSpecialChars.before",e,t,r)).replace(/¨E(\d+)E/g,(function(e,t){var r=parseInt(t);return String.fromCharCode(r)})),e=r.converter._dispatch("unescapeSpecialChars.after",e,t,r)})),o.subParser("makeMarkdown.blockquote",(function(e,t){"use strict";var r="";if(e.hasChildNodes())for(var n=e.childNodes,a=n.length,i=0;i<a;++i){var s=o.subParser("makeMarkdown.node")(n[i],t);""!==s&&(r+=s)}return r="> "+(r=r.trim()).split("\n").join("\n> ")})),o.subParser("makeMarkdown.codeBlock",(function(e,t){"use strict";var r=e.getAttribute("language"),n=e.getAttribute("precodenum");return"```"+r+"\n"+t.preList[n]+"\n```"})),o.subParser("makeMarkdown.codeSpan",(function(e){"use strict";return"`"+e.innerHTML+"`"})),o.subParser("makeMarkdown.emphasis",(function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="*";for(var n=e.childNodes,a=n.length,i=0;i<a;++i)r+=o.subParser("makeMarkdown.node")(n[i],t);r+="*"}return r})),o.subParser("makeMarkdown.header",(function(e,t,r){"use strict";var n=new Array(r+1).join("#"),a="";if(e.hasChildNodes()){a=n+" ";for(var i=e.childNodes,s=i.length,c=0;c<s;++c)a+=o.subParser("makeMarkdown.node")(i[c],t)}return a})),o.subParser("makeMarkdown.hr",(function(){"use strict";return"---"})),o.subParser("makeMarkdown.image",(function(e){"use strict";var t="";return e.hasAttribute("src")&&(t+="+">",e.hasAttribute("width")&&e.hasAttribute("height")&&(t+=" ="+e.getAttribute("width")+"x"+e.getAttribute("height")),e.hasAttribute("title")&&(t+=' "'+e.getAttribute("title")+'"'),t+=")"),t})),o.subParser("makeMarkdown.links",(function(e,t){"use strict";var r="";if(e.hasChildNodes()&&e.hasAttribute("href")){var n=e.childNodes,a=n.length;r="[";for(var i=0;i<a;++i)r+=o.subParser("makeMarkdown.node")(n[i],t);r+="](",r+="<"+e.getAttribute("href")+">",e.hasAttribute("title")&&(r+=' "'+e.getAttribute("title")+'"'),r+=")"}return r})),o.subParser("makeMarkdown.list",(function(e,t,r){"use strict";var n="";if(!e.hasChildNodes())return"";for(var a=e.childNodes,i=a.length,s=e.getAttribute("start")||1,c=0;c<i;++c)if(void 0!==a[c].tagName&&"li"===a[c].tagName.toLowerCase()){n+=("ol"===r?s.toString()+". ":"- ")+o.subParser("makeMarkdown.listItem")(a[c],t),++s}return(n+="\n\x3c!-- --\x3e\n").trim()})),o.subParser("makeMarkdown.listItem",(function(e,t){"use strict";for(var r="",n=e.childNodes,a=n.length,i=0;i<a;++i)r+=o.subParser("makeMarkdown.node")(n[i],t);return/\n$/.test(r)?r=r.split("\n").join("\n ").replace(/^ {4}$/gm,"").replace(/\n\n+/g,"\n\n"):r+="\n",r})),o.subParser("makeMarkdown.node",(function(e,t,r){"use strict";r=r||!1;var n="";if(3===e.nodeType)return o.subParser("makeMarkdown.txt")(e,t);if(8===e.nodeType)return"\x3c!--"+e.data+"--\x3e\n\n";if(1!==e.nodeType)return"";switch(e.tagName.toLowerCase()){case"h1":r||(n=o.subParser("makeMarkdown.header")(e,t,1)+"\n\n");break;case"h2":r||(n=o.subParser("makeMarkdown.header")(e,t,2)+"\n\n");break;case"h3":r||(n=o.subParser("makeMarkdown.header")(e,t,3)+"\n\n");break;case"h4":r||(n=o.subParser("makeMarkdown.header")(e,t,4)+"\n\n");break;case"h5":r||(n=o.subParser("makeMarkdown.header")(e,t,5)+"\n\n");break;case"h6":r||(n=o.subParser("makeMarkdown.header")(e,t,6)+"\n\n");break;case"p":r||(n=o.subParser("makeMarkdown.paragraph")(e,t)+"\n\n");break;case"blockquote":r||(n=o.subParser("makeMarkdown.blockquote")(e,t)+"\n\n");break;case"hr":r||(n=o.subParser("makeMarkdown.hr")(e,t)+"\n\n");break;case"ol":r||(n=o.subParser("makeMarkdown.list")(e,t,"ol")+"\n\n");break;case"ul":r||(n=o.subParser("makeMarkdown.list")(e,t,"ul")+"\n\n");break;case"precode":r||(n=o.subParser("makeMarkdown.codeBlock")(e,t)+"\n\n");break;case"pre":r||(n=o.subParser("makeMarkdown.pre")(e,t)+"\n\n");break;case"table":r||(n=o.subParser("makeMarkdown.table")(e,t)+"\n\n");break;case"code":n=o.subParser("makeMarkdown.codeSpan")(e,t);break;case"em":case"i":n=o.subParser("makeMarkdown.emphasis")(e,t);break;case"strong":case"b":n=o.subParser("makeMarkdown.strong")(e,t);break;case"del":n=o.subParser("makeMarkdown.strikethrough")(e,t);break;case"a":n=o.subParser("makeMarkdown.links")(e,t);break;case"img":n=o.subParser("makeMarkdown.image")(e,t);break;default:n=e.outerHTML+"\n\n"}return n})),o.subParser("makeMarkdown.paragraph",(function(e,t){"use strict";var r="";if(e.hasChildNodes())for(var n=e.childNodes,a=n.length,i=0;i<a;++i)r+=o.subParser("makeMarkdown.node")(n[i],t);return r=r.trim()})),o.subParser("makeMarkdown.pre",(function(e,t){"use strict";var r=e.getAttribute("prenum");return"<pre>"+t.preList[r]+"</pre>"})),o.subParser("makeMarkdown.strikethrough",(function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="~~";for(var n=e.childNodes,a=n.length,i=0;i<a;++i)r+=o.subParser("makeMarkdown.node")(n[i],t);r+="~~"}return r})),o.subParser("makeMarkdown.strong",(function(e,t){"use strict";var r="";if(e.hasChildNodes()){r+="**";for(var n=e.childNodes,a=n.length,i=0;i<a;++i)r+=o.subParser("makeMarkdown.node")(n[i],t);r+="**"}return r})),o.subParser("makeMarkdown.table",(function(e,t){"use strict";var r,n,a="",i=[[],[]],s=e.querySelectorAll("thead>tr>th"),c=e.querySelectorAll("tbody>tr");for(r=0;r<s.length;++r){var l=o.subParser("makeMarkdown.tableCell")(s[r],t),u="---";if(s[r].hasAttribute("style"))switch(s[r].getAttribute("style").toLowerCase().replace(/\s/g,"")){case"text-align:left;":u=":---";break;case"text-align:right;":u="---:";break;case"text-align:center;":u=":---:"}i[0][r]=l.trim(),i[1][r]=u}for(r=0;r<c.length;++r){var d=i.push([])-1,p=c[r].getElementsByTagName("td");for(n=0;n<s.length;++n){var h=" ";void 0!==p[n]&&(h=o.subParser("makeMarkdown.tableCell")(p[n],t)),i[d].push(h)}}var f=3;for(r=0;r<i.length;++r)for(n=0;n<i[r].length;++n){var g=i[r][n].length;g>f&&(f=g)}for(r=0;r<i.length;++r){for(n=0;n<i[r].length;++n)1===r?":"===i[r][n].slice(-1)?i[r][n]=o.helper.padEnd(i[r][n].slice(-1),f-1,"-")+":":i[r][n]=o.helper.padEnd(i[r][n],f,"-"):i[r][n]=o.helper.padEnd(i[r][n],f);a+="| "+i[r].join(" | ")+" |\n"}return a.trim()})),o.subParser("makeMarkdown.tableCell",(function(e,t){"use strict";var r="";if(!e.hasChildNodes())return"";for(var n=e.childNodes,a=n.length,i=0;i<a;++i)r+=o.subParser("makeMarkdown.node")(n[i],t,!0);return r.trim()})),o.subParser("makeMarkdown.txt",(function(e){"use strict";var t=e.nodeValue;return t=(t=t.replace(/ +/g," ")).replace(/¨NBSP;/g," "),t=(t=(t=(t=(t=(t=(t=(t=(t=o.helper.unescapeHTMLEntities(t)).replace(/([*_~|`])/g,"\\$1")).replace(/^(\s*)>/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")}));void 0===(n=function(){"use strict";return o}.call(t,r,t,e))||(e.exports=n)}).call(this)}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};!function(){"use strict";r.r(n),r.d(n,{__EXPERIMENTAL_ELEMENTS:function(){return Te},__EXPERIMENTAL_PATHS_WITH_MERGE:function(){return Ce},__EXPERIMENTAL_STYLE_PROPERTY:function(){return ve},__experimentalCloneSanitizedBlock:function(){return pt},__experimentalGetAccessibleBlockLabel:function(){return Bt},__experimentalGetBlockAttributesNamesByRole:function(){return At},__experimentalGetBlockLabel:function(){return Et},__experimentalSanitizeBlockAttributes:function(){return Nt},__unstableGetBlockProps:function(){return ir},__unstableGetInnerBlocksProps:function(){return sr},__unstableSerializeAndClean:function(){return hr},children:function(){return pn},cloneBlock:function(){return ht},createBlock:function(){return ut},createBlocksFromInnerBlocksTemplate:function(){return dt},doBlocksMatchTemplate:function(){return pa},findTransform:function(){return _t},getBlockAttributes:function(){return bn},getBlockContent:function(){return dr},getBlockDefaultClassName:function(){return rr},getBlockFromExample:function(){return wt},getBlockMenuDefaultClassName:function(){return nr},getBlockSupport:function(){return Fe},getBlockTransforms:function(){return kt},getBlockType:function(){return Re},getBlockTypes:function(){return $e},getBlockVariations:function(){return Xe},getCategories:function(){return la},getChildBlockNames:function(){return Ke},getDefaultBlockName:function(){return He},getFreeformContentHandlerName:function(){return De},getGroupingBlockName:function(){return je},getPhrasingContentSchema:function(){return Vn},getPossibleBlockTransformations:function(){return bt},getSaveContent:function(){return lr},getSaveElement:function(){return cr},getUnregisteredTypeHandlerName:function(){return Oe},hasBlockSupport:function(){return qe},hasChildBlocks:function(){return We},hasChildBlocksWithInserterSupport:function(){return Ye},isReusableBlock:function(){return Ue},isTemplatePart:function(){return Ge},isUnmodifiedDefaultBlock:function(){return Tt},isValidBlockContent:function(){return Qr},isValidIcon:function(){return Ct},node:function(){return cn},normalizeIconObject:function(){return xt},parse:function(){return wn},parseWithAttributeSchema:function(){return mn},pasteHandler:function(){return ca},rawHandler:function(){return Hn},registerBlockCollection:function(){return Pe},registerBlockStyle:function(){return Qe},registerBlockType:function(){return Ne},registerBlockVariation:function(){return Je},serialize:function(){return fr},setCategories:function(){return ua},setDefaultBlockName:function(){return Ie},setFreeformContentHandlerName:function(){return Me},setGroupingBlockName:function(){return Ve},setUnregisteredTypeHandlerName:function(){return ze},store:function(){return Zt},switchToBlockType:function(){return yt},synchronizeBlocksWithTemplate:function(){return ha},unregisterBlockStyle:function(){return Ze},unregisterBlockType:function(){return Le},unregisterBlockVariation:function(){return et},unstable__bootstrapServerSideBlockDefinitions:function(){return Ee},updateCategory:function(){return da},withBlockContentContext:function(){return _a}});var e={};r.r(e),r.d(e,{__experimentalGetUnprocessedBlockTypes:function(){return w},getActiveBlockVariation:function(){return S},getBlockStyles:function(){return C},getBlockSupport:function(){return j},getBlockType:function(){return T},getBlockTypes:function(){return v},getBlockVariations:function(){return x},getCategories:function(){return B},getChildBlockNames:function(){return D},getCollections:function(){return N},getDefaultBlockName:function(){return A},getDefaultBlockVariation:function(){return E},getFreeformFallbackBlockName:function(){return P},getGroupingBlockName:function(){return M},getUnregisteredFallbackBlockName:function(){return L},hasBlockSupport:function(){return z},hasChildBlocks:function(){return I},hasChildBlocksWithInserterSupport:function(){return V},isMatchingSearchTerm:function(){return O}});var t={};r.r(t),r.d(t,{__experimentalReapplyBlockTypeFilters:function(){return Ot},__experimentalRegisterBlockType:function(){return zt},addBlockCollection:function(){return Yt},addBlockStyles:function(){return Vt},addBlockTypes:function(){return jt},addBlockVariations:function(){return Rt},removeBlockCollection:function(){return Qt},removeBlockStyles:function(){return Ht},removeBlockTypes:function(){return It},removeBlockVariations:function(){return $t},setCategories:function(){return Kt},setDefaultBlockName:function(){return Ft},setFreeformFallbackBlockName:function(){return qt},setGroupingBlockName:function(){return Gt},setUnregisteredFallbackBlockName:function(){return Ut},updateCategory:function(){return Wt}});var a=window.wp.data,o=window.lodash,i=window.wp.i18n;const s=[{slug:"text",title:(0,i.__)("Text")},{slug:"media",title:(0,i.__)("Media")},{slug:"design",title:(0,i.__)("Design")},{slug:"widgets",title:(0,i.__)("Widgets")},{slug:"theme",title:(0,i.__)("Theme")},{slug:"embed",title:(0,i.__)("Embeds")},{slug:"reusable",title:(0,i.__)("Reusable blocks")}];function c(e){return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1?arguments[1]:void 0;switch(r.type){case"REMOVE_BLOCK_TYPES":return-1!==r.names.indexOf(t)?null:t;case e:return r.name||null}return t}}const l=c("SET_DEFAULT_BLOCK_NAME"),u=c("SET_FREEFORM_FALLBACK_BLOCK_NAME"),d=c("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),p=c("SET_GROUPING_BLOCK_NAME");var h,f,g=(0,a.combineReducers)({unprocessedBlockTypes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_UNPROCESSED_BLOCK_TYPE":return{...e,[t.blockType.name]:t.blockType};case"REMOVE_BLOCK_TYPES":return(0,o.omit)(e,t.names)}return e},blockTypes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...(0,o.keyBy)(t.blockTypes,"name")};case"REMOVE_BLOCK_TYPES":return(0,o.omit)(e,t.names)}return e},blockStyles:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...(0,o.mapValues)((0,o.keyBy)(t.blockTypes,"name"),(t=>(0,o.uniqBy)([...(0,o.get)(t,["styles"],[]).map((e=>({...e,source:"block"}))),...(0,o.get)(e,[t.name],[]).filter((e=>{let{source:t}=e;return"block"!==t}))],(e=>e.name))))};case"ADD_BLOCK_STYLES":return{...e,[t.blockName]:(0,o.uniqBy)([...(0,o.get)(e,[t.blockName],[]),...t.styles],(e=>e.name))};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:(0,o.filter)((0,o.get)(e,[t.blockName],[]),(e=>-1===t.styleNames.indexOf(e.name)))}}return e},blockVariations:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...(0,o.mapValues)((0,o.keyBy)(t.blockTypes,"name"),(t=>(0,o.uniqBy)([...(0,o.get)(t,["variations"],[]).map((e=>({...e,source:"block"}))),...(0,o.get)(e,[t.name],[]).filter((e=>{let{source:t}=e;return"block"!==t}))],(e=>e.name))))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:(0,o.uniqBy)([...(0,o.get)(e,[t.blockName],[]),...t.variations],(e=>e.name))};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:(0,o.filter)((0,o.get)(e,[t.blockName],[]),(e=>-1===t.variationNames.indexOf(e.name)))}}return e},defaultBlockName:l,freeformFallbackBlockName:u,unregisteredFallbackBlockName:d,groupingBlockName:p,categories:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_CATEGORIES":return t.categories||[];case"UPDATE_CATEGORY":if(!t.category||(0,o.isEmpty)(t.category))return e;if((0,o.find)(e,["slug",t.slug]))return(0,o.map)(e,(e=>e.slug===t.slug?{...e,...t.category}:e))}return e},collections:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return(0,o.omit)(e,t.namespace)}return e}});function m(e){return[e]}function b(){var e={clear:function(){e.head=null}};return e}function _(e,t,r){var n;if(e.length!==t.length)return!1;for(n=r;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function k(e,t){var r,n;function a(){r=f?new WeakMap:b()}function o(){var r,a,o,i,s,c=arguments.length;for(i=new Array(c),o=0;o<c;o++)i[o]=arguments[o];for(s=t.apply(null,i),(r=n(s)).isUniqueByDependants||(r.lastDependants&&!_(s,r.lastDependants,0)&&r.clear(),r.lastDependants=s),a=r.head;a;){if(_(a.args,i,1))return a!==r.head&&(a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=r.head,a.prev=null,r.head.prev=a,r.head=a),a.val;a=a.next}return a={val:e.apply(null,i)},i[0]=null,a.args=i,r.head&&(r.head.prev=a,a.next=r.head),r.head=a,a.val}return t||(t=m),n=f?function(e){var t,n,a,o,i,s=r,c=!0;for(t=0;t<e.length;t++){if(n=e[t],!(i=n)||"object"!=typeof i){c=!1;break}s.has(n)?s=s.get(n):(a=new WeakMap,s.set(n,a),s=a)}return s.has(h)||((o=b()).isUniqueByDependants=c,s.set(h,o)),s.get(h)}:function(){return r},o.getDependants=t,o.clear=a,a(),o}h={},f="undefined"!=typeof WeakMap;const y=(e,t)=>"string"==typeof t?T(e,t):t;function w(e){return e.unprocessedBlockTypes}const v=k((e=>Object.values(e.blockTypes)),(e=>[e.blockTypes]));function T(e,t){return e.blockTypes[t]}function C(e,t){return e.blockStyles[t]}const x=k(((e,t,r)=>{const n=e.blockVariations[t];return n&&r?n.filter((e=>(e.scope||["block","inserter"]).includes(r))):n}),((e,t)=>[e.blockVariations[t]]));function S(e,t,r,n){const a=x(e,t,n);return null==a?void 0:a.find((n=>{var a;if(Array.isArray(n.isActive)){const a=T(e,t),o=Object.keys((null==a?void 0:a.attributes)||{}),i=n.isActive.filter((e=>o.includes(e)));return 0!==i.length&&i.every((e=>r[e]===n.attributes[e]))}return null===(a=n.isActive)||void 0===a?void 0:a.call(n,r,n.attributes)}))}function E(e,t,r){const n=x(e,t,r);return(0,o.findLast)(n,"isDefault")||(0,o.first)(n)}function B(e){return e.categories}function N(e){return e.collections}function A(e){return e.defaultBlockName}function P(e){return e.freeformFallbackBlockName}function L(e){return e.unregisteredFallbackBlockName}function M(e){return e.groupingBlockName}const D=k(((e,t)=>(0,o.map)((0,o.filter)(e.blockTypes,(e=>(0,o.includes)(e.parent,t))),(e=>{let{name:t}=e;return t}))),(e=>[e.blockTypes])),j=(e,t,r,n)=>{const a=y(e,t);return null!=a&&a.supports?(0,o.get)(a.supports,r,n):n};function z(e,t,r,n){return!!j(e,t,r,n)}function O(e,t,r){const n=y(e,t),a=(0,o.flow)([o.deburr,e=>e.toLowerCase(),e=>e.trim()]),i=a(r),s=(0,o.flow)([a,e=>(0,o.includes)(e,i)]);return s(n.title)||(0,o.some)(n.keywords,s)||s(n.category)}const I=(e,t)=>D(e,t).length>0,V=(e,t)=>(0,o.some)(D(e,t),(t=>z(e,t,"inserter",!0)));var H=window.wp.hooks;const R="core/blocks";var $={grad:.9,turn:360,rad:360/(2*Math.PI)},F=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},q=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},U=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e>t?e:t},G=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},K=function(e){return{r:U(e.r,0,255),g:U(e.g,0,255),b:U(e.b,0,255),a:U(e.a)}},W=function(e){return{r:q(e.r),g:q(e.g),b:q(e.b),a:q(e.a,3)}},Y=/^#([0-9a-f]{3,8})$/i,Q=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Z=function(e){var t=e.r,r=e.g,n=e.b,a=e.a,o=Math.max(t,r,n),i=o-Math.min(t,r,n),s=i?o===t?(r-n)/i:o===r?2+(n-t)/i:4+(t-r)/i:0;return{h:60*(s<0?s+6:s),s:o?i/o*100:0,v:o/255*100,a:a}},X=function(e){var t=e.h,r=e.s,n=e.v,a=e.a;t=t/360*6,r/=100,n/=100;var o=Math.floor(t),i=n*(1-r),s=n*(1-(t-o)*r),c=n*(1-(1-t+o)*r),l=o%6;return{r:255*[n,s,i,i,c,n][l],g:255*[c,n,n,s,i,i][l],b:255*[i,i,c,n,n,s][l],a:a}},J=function(e){return{h:G(e.h),s:U(e.s,0,100),l:U(e.l,0,100),a:U(e.a)}},ee=function(e){return{h:q(e.h),s:q(e.s),l:q(e.l),a:q(e.a,3)}},te=function(e){return X((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}));var t,r,n},re=function(e){return{h:(t=Z(e)).h,s:(a=(200-(r=t.s))*(n=t.v)/100)>0&&a<200?r*n/100/(a<=100?a:200-a)*100:0,l:a/2,a:t.a};var t,r,n,a},ne=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ae=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,oe=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ie=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,se={string:[[function(e){var t=Y.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?q(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?q(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=oe.exec(e)||ie.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:K({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=ne.exec(e)||ae.exec(e);if(!t)return null;var r,n,a=J({h:(r=t[1],n=t[2],void 0===n&&(n="deg"),Number(r)*($[n]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return te(a)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,a=e.a,o=void 0===a?1:a;return F(t)&&F(r)&&F(n)?K({r:Number(t),g:Number(r),b:Number(n),a:Number(o)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,a=e.a,o=void 0===a?1:a;if(!F(t)||!F(r)||!F(n))return null;var i=J({h:Number(t),s:Number(r),l:Number(n),a:Number(o)});return te(i)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,a=e.a,o=void 0===a?1:a;if(!F(t)||!F(r)||!F(n))return null;var i=function(e){return{h:G(e.h),s:U(e.s,0,100),v:U(e.v,0,100),a:U(e.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(o)});return X(i)},"hsv"]]},ce=function(e,t){for(var r=0;r<t.length;r++){var n=t[r][0](e);if(n)return[n,t[r][1]]}return[null,void 0]},le=function(e){return"string"==typeof e?ce(e.trim(),se.string):"object"==typeof e&&null!==e?ce(e,se.object):[null,void 0]},ue=function(e,t){var r=re(e);return{h:r.h,s:U(r.s+100*t,0,100),l:r.l,a:r.a}},de=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},pe=function(e,t){var r=re(e);return{h:r.h,s:r.s,l:U(r.l+100*t,0,100),a:r.a}},he=function(){function e(e){this.parsed=le(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return q(de(this.rgba),2)},e.prototype.isDark=function(){return de(this.rgba)<.5},e.prototype.isLight=function(){return de(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=W(this.rgba)).r,r=e.g,n=e.b,o=(a=e.a)<1?Q(q(255*a)):"","#"+Q(t)+Q(r)+Q(n)+o;var e,t,r,n,a,o},e.prototype.toRgb=function(){return W(this.rgba)},e.prototype.toRgbString=function(){return t=(e=W(this.rgba)).r,r=e.g,n=e.b,(a=e.a)<1?"rgba("+t+", "+r+", "+n+", "+a+")":"rgb("+t+", "+r+", "+n+")";var e,t,r,n,a},e.prototype.toHsl=function(){return ee(re(this.rgba))},e.prototype.toHslString=function(){return t=(e=ee(re(this.rgba))).h,r=e.s,n=e.l,(a=e.a)<1?"hsla("+t+", "+r+"%, "+n+"%, "+a+")":"hsl("+t+", "+r+"%, "+n+"%)";var e,t,r,n,a},e.prototype.toHsv=function(){return e=Z(this.rgba),{h:q(e.h),s:q(e.s),v:q(e.v),a:q(e.a,3)};var e},e.prototype.invert=function(){return fe({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),fe(ue(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),fe(ue(this.rgba,-e))},e.prototype.grayscale=function(){return fe(ue(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),fe(pe(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),fe(pe(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?fe({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):q(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=re(this.rgba);return"number"==typeof e?fe({h:e,s:t.s,l:t.l,a:t.a}):q(t.h)},e.prototype.isEqual=function(e){return this.toHex()===fe(e).toHex()},e}(),fe=function(e){return e instanceof he?e:new he(e)},ge=[];var me=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},be=function(e){return.2126*me(e.r)+.7152*me(e.g)+.0722*me(e.b)};var _e=window.wp.element,ke=window.wp.dom;const ye="block-default",we=["attributes","supports","save","migrate","isEligible","apiVersion"],ve={"--wp--style--color--link":{value:["color","link"],support:["color","link"]},background:{value:["color","gradient"],support:["color","gradients"]},backgroundColor:{value:["color","background"],support:["color","background"],requiresOptOut:!0},borderColor:{value:["border","color"],support:["__experimentalBorder","color"]},borderRadius:{value:["border","radius"],support:["__experimentalBorder","radius"],properties:{borderTopLeftRadius:"topLeft",borderTopRightRadius:"topRight",borderBottomLeftRadius:"bottomLeft",borderBottomRightRadius:"bottomRight"}},borderStyle:{value:["border","style"],support:["__experimentalBorder","style"]},borderWidth:{value:["border","width"],support:["__experimentalBorder","width"]},color:{value:["color","text"],support:["color","text"],requiresOptOut:!0},linkColor:{value:["elements","link","color","text"],support:["color","link"]},fontFamily:{value:["typography","fontFamily"],support:["typography","__experimentalFontFamily"]},fontSize:{value:["typography","fontSize"],support:["typography","fontSize"]},fontStyle:{value:["typography","fontStyle"],support:["typography","__experimentalFontStyle"]},fontWeight:{value:["typography","fontWeight"],support:["typography","__experimentalFontWeight"]},lineHeight:{value:["typography","lineHeight"],support:["typography","lineHeight"]},margin:{value:["spacing","margin"],support:["spacing","margin"],properties:{marginTop:"top",marginRight:"right",marginBottom:"bottom",marginLeft:"left"}},padding:{value:["spacing","padding"],support:["spacing","padding"],properties:{paddingTop:"top",paddingRight:"right",paddingBottom:"bottom",paddingLeft:"left"}},textDecoration:{value:["typography","textDecoration"],support:["typography","__experimentalTextDecoration"]},textTransform:{value:["typography","textTransform"],support:["typography","__experimentalTextTransform"]},letterSpacing:{value:["typography","letterSpacing"],support:["typography","__experimentalLetterSpacing"]},"--wp--style--block-gap":{value:["spacing","blockGap"],support:["spacing","blockGap"]}},Te={link:"a",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},Ce={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"typography.fontFamilies":!0,"typography.fontSizes":!0},xe={title:"block title",description:"block description",keywords:["block keyword"],styles:[{label:"block style label"}],variations:[{title:"block variation title",description:"block variation description",keywords:["block variation keyword"]}]},Se={};function Ee(e){for(const t of Object.keys(e))Se[t]?void 0===Se[t].apiVersion&&e[t].apiVersion&&(Se[t].apiVersion=e[t].apiVersion):Se[t]=(0,o.mapKeys)((0,o.pickBy)(e[t],(e=>!(0,o.isNil)(e))),((e,t)=>(0,o.camelCase)(t)))}function Be(e){let{textdomain:t,...r}=e;const n=(0,o.pick)(r,["apiVersion","title","category","parent","icon","description","keywords","attributes","providesContext","usesContext","supports","styles","example","variations"]);return t&&Object.keys(xe).forEach((e=>{n[e]&&(n[e]=Ae(xe[e],n[e],t))})),n}function Ne(e,t){const r=(0,o.isObject)(e)?e.name:e;if("string"!=typeof r)return void console.error("Block names must be strings.");if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(r))return void console.error("Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block");if((0,a.select)(Zt).getBlockType(r))return void console.error('Block "'+r+'" is already registered.');(0,o.isObject)(e)&&Ee({[r]:Be(e)});const n={name:r,icon:ye,keywords:[],attributes:{},providesContext:{},usesContext:[],supports:{},styles:[],variations:[],save:()=>null,...null==Se?void 0:Se[r],...t};return(0,a.dispatch)(Zt).__experimentalRegisterBlockType(n),(0,a.select)(Zt).getBlockType(r)}function Ae(e,t,r){return(0,o.isString)(e)&&(0,o.isString)(t)?(0,i._x)(t,e,r):(0,o.isArray)(e)&&!(0,o.isEmpty)(e)&&(0,o.isArray)(t)?t.map((t=>Ae(e[0],t,r))):(0,o.isObject)(e)&&!(0,o.isEmpty)(e)&&(0,o.isObject)(t)?Object.keys(t).reduce(((n,a)=>e[a]?(n[a]=Ae(e[a],t[a],r),n):(n[a]=t[a],n)),{}):t}function Pe(e,t){let{title:r,icon:n}=t;(0,a.dispatch)(Zt).addBlockCollection(e,r,n)}function Le(e){const t=(0,a.select)(Zt).getBlockType(e);if(t)return(0,a.dispatch)(Zt).removeBlockTypes(e),t;console.error('Block "'+e+'" is not registered.')}function Me(e){(0,a.dispatch)(Zt).setFreeformFallbackBlockName(e)}function De(){return(0,a.select)(Zt).getFreeformFallbackBlockName()}function je(){return(0,a.select)(Zt).getGroupingBlockName()}function ze(e){(0,a.dispatch)(Zt).setUnregisteredFallbackBlockName(e)}function Oe(){return(0,a.select)(Zt).getUnregisteredFallbackBlockName()}function Ie(e){(0,a.dispatch)(Zt).setDefaultBlockName(e)}function Ve(e){(0,a.dispatch)(Zt).setGroupingBlockName(e)}function He(){return(0,a.select)(Zt).getDefaultBlockName()}function Re(e){var t;return null===(t=(0,a.select)(Zt))||void 0===t?void 0:t.getBlockType(e)}function $e(){return(0,a.select)(Zt).getBlockTypes()}function Fe(e,t,r){return(0,a.select)(Zt).getBlockSupport(e,t,r)}function qe(e,t,r){return(0,a.select)(Zt).hasBlockSupport(e,t,r)}function Ue(e){return"core/block"===(null==e?void 0:e.name)}function Ge(e){return"core/template-part"===e.name}const Ke=e=>(0,a.select)(Zt).getChildBlockNames(e),We=e=>(0,a.select)(Zt).hasChildBlocks(e),Ye=e=>(0,a.select)(Zt).hasChildBlocksWithInserterSupport(e),Qe=(e,t)=>{(0,a.dispatch)(Zt).addBlockStyles(e,t)},Ze=(e,t)=>{(0,a.dispatch)(Zt).removeBlockStyles(e,t)},Xe=(e,t)=>(0,a.select)(Zt).getBlockVariations(e,t),Je=(e,t)=>{(0,a.dispatch)(Zt).addBlockVariations(e,t)},et=(e,t)=>{(0,a.dispatch)(Zt).removeBlockVariations(e,t)};var tt,rt=new Uint8Array(16);function nt(){if(!tt&&!(tt="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 tt(rt)}var at=/^(?:[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 ot=function(e){return"string"==typeof e&&at.test(e)},it=[],st=0;st<256;++st)it.push((st+256).toString(16).substr(1));var ct=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(it[e[t+0]]+it[e[t+1]]+it[e[t+2]]+it[e[t+3]]+"-"+it[e[t+4]]+it[e[t+5]]+"-"+it[e[t+6]]+it[e[t+7]]+"-"+it[e[t+8]]+it[e[t+9]]+"-"+it[e[t+10]]+it[e[t+11]]+it[e[t+12]]+it[e[t+13]]+it[e[t+14]]+it[e[t+15]]).toLowerCase();if(!ot(r))throw TypeError("Stringified UUID is invalid");return r};var lt=function(e,t,r){var n=(e=e||{}).random||(e.rng||nt)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var a=0;a<16;++a)t[r+a]=n[a];return t}return ct(n)};function ut(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=Nt(e,t),a=lt();return{clientId:a,name:e,isValid:!0,attributes:n,innerBlocks:r}}function dt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((e=>{const t=Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],[r,n,a=[]]=t;return ut(r,n,dt(a))}))}function pt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;const n=lt(),a=Nt(e.name,{...e.attributes,...t});return{...e,clientId:n,attributes:a,innerBlocks:r||e.innerBlocks.map((e=>pt(e)))}}function ht(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;const n=lt();return{...e,clientId:n,attributes:{...e.attributes,...t},innerBlocks:r||e.innerBlocks.map((e=>ht(e)))}}const ft=(e,t,r)=>{if((0,o.isEmpty)(r))return!1;const n=r.length>1,a=(0,o.first)(r).name;if(!(gt(e)||!n||e.isMultiBlock))return!1;if(!gt(e)&&!(0,o.every)(r,{name:a}))return!1;if(!("block"===e.type))return!1;const i=(0,o.first)(r);if(!("from"!==t||-1!==e.blocks.indexOf(i.name)||gt(e)))return!1;if(!n&&mt(i.name)&&mt(e.blockName))return!1;if((0,o.isFunction)(e.isMatch)){const t=e.isMultiBlock?r.map((e=>e.attributes)):i.attributes,n=e.isMultiBlock?r:i;if(!e.isMatch(t,n))return!1}return!(e.usingMobileTransformations&>(e)&&!mt(i.name))},gt=e=>e&&"block"===e.type&&Array.isArray(e.blocks)&&e.blocks.includes("*"),mt=e=>e===je();function bt(e){if((0,o.isEmpty)(e))return[];const t=(e=>{if((0,o.isEmpty)(e))return[];const t=$e();return(0,o.filter)(t,(t=>!!_t(kt("from",t.name),(t=>ft(t,"from",e)))))})(e),r=(e=>{if((0,o.isEmpty)(e))return[];const t=Re((0,o.first)(e).name),r=t?kt("to",t.name):[],n=(0,o.filter)(r,(t=>t&&ft(t,"to",e)));return(0,o.flatMap)(n,(e=>e.blocks)).map((e=>Re(e)))})(e);return(0,o.uniq)([...t,...r])}function _t(e,t){const r=(0,H.createHooks)();for(let n=0;n<e.length;n++){const a=e[n];t(a)&&r.addFilter("transform","transform/"+n.toString(),(e=>e||a),a.priority)}return r.applyFilters("transform",null)}function kt(e,t){if(void 0===t)return(0,o.flatMap)($e(),(t=>{let{name:r}=t;return kt(e,r)}));const r=St(t),{name:n,transforms:a}=r||{};if(!a||!Array.isArray(a[e]))return[];const i=a.supportedMobileTransforms&&Array.isArray(a.supportedMobileTransforms),s=i?(0,o.filter)(a[e],(e=>"raw"===e.type||!(!e.blocks||!e.blocks.length)&&(!!gt(e)||(0,o.every)(e.blocks,(e=>a.supportedMobileTransforms.includes(e)))))):a[e];return s.map((e=>({...e,blockName:n,usingMobileTransformations:i})))}function yt(e,t){const r=(0,o.castArray)(e),n=r.length>1,a=r[0],i=a.name,s=kt("from",t),c=_t(kt("to",i),(e=>"block"===e.type&&(gt(e)||-1!==e.blocks.indexOf(t))&&(!n||e.isMultiBlock)))||_t(s,(e=>"block"===e.type&&(gt(e)||-1!==e.blocks.indexOf(i))&&(!n||e.isMultiBlock)));if(!c)return null;let l;if(l=c.isMultiBlock?(0,o.has)(c,"__experimentalConvert")?c.__experimentalConvert(r):c.transform(r.map((e=>e.attributes)),r.map((e=>e.innerBlocks))):(0,o.has)(c,"__experimentalConvert")?c.__experimentalConvert(a):c.transform(a.attributes,a.innerBlocks),!(0,o.isObjectLike)(l))return null;if(l=(0,o.castArray)(l),l.some((e=>!Re(e.name))))return null;if(!(0,o.some)(l,(e=>e.name===t)))return null;return l.map((t=>(0,H.applyFilters)("blocks.switchToBlockType.transformedBlock",t,e)))}const wt=(e,t)=>ut(e,t.attributes,(0,o.map)(t.innerBlocks,(e=>wt(e.name,e))));!function(e){e.forEach((function(e){ge.indexOf(e)<0&&(e(he,se),ge.push(e))}))}([function(e,t){var r={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},n={};for(var a in r)n[r[a]]=a;var o={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,i,s=n[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var c=this.toRgb(),l=1/0,u="black";if(!o.length)for(var d in r)o[d]=new e(r[d]).toRgb();for(var p in r){var h=(a=c,i=o[p],Math.pow(a.r-i.r,2)+Math.pow(a.g-i.g,2)+Math.pow(a.b-i.b,2));h<l&&(l=h,u=p)}return u}},t.string.push([function(t){var n=t.toLowerCase(),a="transparent"===n?"#0000":r[n];return a?new e(a).toRgb():null},"name"])},function(e){e.prototype.luminance=function(){return e=be(this.rgba),void 0===(t=2)&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r+0;var e,t,r},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var r,n,a,o,i,s,c,l=t instanceof e?t:new e(t);return o=this.rgba,i=l.toRgb(),r=(s=be(o))>(c=be(i))?(s+.05)/(c+.05):(c+.05)/(s+.05),void 0===(n=2)&&(n=0),void 0===a&&(a=Math.pow(10,n)),Math.floor(a*r)/a+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(o=(r=t).size)?"normal":o,"AAA"===(a=void 0===(n=r.level)?"AA":n)&&"normal"===i?7:"AA"===a&&"large"===i?3:4.5);var r,n,a,o,i}}]);const vt=["#191e23","#f8f9f9"];function Tt(e){const t=He();if(e.name!==t)return!1;Tt.block&&Tt.block.name===t||(Tt.block=ut(t));const r=Tt.block,n=Re(t);return(0,o.every)(null==n?void 0:n.attributes,((t,n)=>r.attributes[n]===e.attributes[n]))}function Ct(e){return!!e&&((0,o.isString)(e)||(0,_e.isValidElement)(e)||(0,o.isFunction)(e)||e instanceof _e.Component)}function xt(e){if(Ct(e=e||ye))return{src:e};if((0,o.has)(e,["background"])){const t=fe(e.background);return{...e,foreground:e.foreground?e.foreground:(0,o.maxBy)(vt,(e=>t.contrast(e))),shadowColor:t.alpha(.3).toRgbString()}}return e}function St(e){return(0,o.isString)(e)?Re(e):e}function Et(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"visual";const{__experimentalLabel:n,title:a}=e,o=n&&n(t,{context:r});return o?(0,ke.__unstableStripHTML)(o):a}function Bt(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"vertical";const a=null==e?void 0:e.title,o=e?Et(e,t,"accessibility"):"",s=void 0!==r,c=o&&o!==a;return s&&"vertical"===n?c?(0,i.sprintf)((0,i.__)("%1$s Block. Row %2$d. %3$s"),a,r,o):(0,i.sprintf)((0,i.__)("%1$s Block. Row %2$d"),a,r):s&&"horizontal"===n?c?(0,i.sprintf)((0,i.__)("%1$s Block. Column %2$d. %3$s"),a,r,o):(0,i.sprintf)((0,i.__)("%1$s Block. Column %2$d"),a,r):c?(0,i.sprintf)((0,i.__)("%1$s Block. %2$s"),a,o):(0,i.sprintf)((0,i.__)("%s Block"),a)}function Nt(e,t){const r=Re(e);if(void 0===r)throw new Error(`Block type '${e}' is not registered.`);return(0,o.reduce)(r.attributes,((e,r,n)=>{const a=t[n];return void 0!==a?e[n]=a:r.hasOwnProperty("default")&&(e[n]=r.default),-1!==["node","children"].indexOf(r.source)&&("string"==typeof e[n]?e[n]=[e[n]]:Array.isArray(e[n])||(e[n]=[])),e}),{})}function At(e,t){var r;const n=null===(r=Re(e))||void 0===r?void 0:r.attributes;if(!n)return[];const a=Object.keys(n);return t?a.filter((e=>{var r;return(null===(r=n[e])||void 0===r?void 0:r.__experimentalRole)===t})):a}const{error:Pt,warn:Lt}=window.console,Mt={common:"text",formatting:"text",layout:"design"};function Dt(e){const{name:t}=e,r=(0,H.applyFilters)("blocks.registerBlockType",{...e},t);if(r.deprecated&&(r.deprecated=r.deprecated.map((r=>(0,o.pick)((0,H.applyFilters)("blocks.registerBlockType",{...(0,o.omit)(e,we),...r},t),we)))),(0,o.isPlainObject)(r))if((0,o.isFunction)(r.save))if(!("edit"in r)||(0,o.isFunction)(r.edit))if(Mt.hasOwnProperty(r.category)&&(r.category=Mt[r.category]),"category"in r&&!(0,o.some)((0,a.select)(R).getCategories(),{slug:r.category})&&(Lt('The block "'+t+'" is registered with an invalid category "'+r.category+'".'),delete r.category),"title"in r&&""!==r.title)if("string"==typeof r.title){if(r.icon=xt(r.icon),Ct(r.icon.src))return r;Pt("The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional")}else Pt("Block titles must be strings.");else Pt('The block "'+t+'" must have a title.');else Pt('The "edit" property must be a valid function.');else Pt('The "save" property must be a valid function.');else Pt("Block settings must be a valid object.")}function jt(e){return{type:"ADD_BLOCK_TYPES",blockTypes:(0,o.castArray)(e)}}function*zt(e){yield{type:"ADD_UNPROCESSED_BLOCK_TYPE",blockType:e};const t=Dt(e);t&&(yield jt(t))}function*Ot(){const e=(0,a.select)(R).__experimentalGetUnprocessedBlockTypes(),t=Object.keys(e).reduce(((t,r)=>{const n=Dt(e[r]);return n&&t.push(n),t}),[]);t.length&&(yield jt(t))}function It(e){return{type:"REMOVE_BLOCK_TYPES",names:(0,o.castArray)(e)}}function Vt(e,t){return{type:"ADD_BLOCK_STYLES",styles:(0,o.castArray)(t),blockName:e}}function Ht(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:(0,o.castArray)(t),blockName:e}}function Rt(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:(0,o.castArray)(t),blockName:e}}function $t(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:(0,o.castArray)(t),blockName:e}}function Ft(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function qt(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function Ut(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function Gt(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function Kt(e){return{type:"SET_CATEGORIES",categories:e}}function Wt(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function Yt(e,t,r){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:r}}function Qt(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}const Zt=(0,a.createReduxStore)(R,{reducer:g,selectors:e,actions:t});(0,a.register)(Zt);var Xt=window.wp.blockSerializationDefaultParser,Jt=window.wp.autop,er=window.wp.isShallowEqual,tr=r.n(er);function rr(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,H.applyFilters)("blocks.getBlockDefaultClassName",t,e)}function nr(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,H.applyFilters)("blocks.getBlockMenuDefaultClassName",t,e)}const ar={},or={};function ir(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{blockType:t,attributes:r}=ar;return(0,H.applyFilters)("blocks.getSaveContent.extraProps",{...e},t,r)}function sr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{innerBlocks:t}=or,r=fr(t,{isInnerBlocks:!0}),n=(0,_e.createElement)(_e.RawHTML,null,r);return{...e,children:n}}function cr(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=St(e);let{save:a}=n;if(a.prototype instanceof _e.Component){const e=new a({attributes:t});a=e.render.bind(e)}ar.blockType=n,ar.attributes=t,or.innerBlocks=r;let i=a({attributes:t,innerBlocks:r});if((0,o.isObject)(i)&&(0,H.hasFilter)("blocks.getSaveContent.extraProps")&&!(n.apiVersion>1)){const e=(0,H.applyFilters)("blocks.getSaveContent.extraProps",{...i.props},n,t);tr()(e,i.props)||(i=(0,_e.cloneElement)(i,e))}return(0,H.applyFilters)("blocks.getSaveElement",i,n,t)}function lr(e,t,r){const n=St(e);return(0,_e.renderToString)(cr(n,t,r))}function ur(e,t){return(0,o.reduce)(e.attributes,((e,r,n)=>{const a=t[n];return void 0===a||void 0!==r.source||"default"in r&&r.default===a||(e[n]=a),e}),{})}function dr(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=lr(e.name,e.attributes,e.innerBlocks)}catch(e){}return t}function pr(e,t,r){const n=(0,o.isEmpty)(t)?"":function(e){return JSON.stringify(e).replace(/--/g,"\\u002d\\u002d").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}(t)+" ",a=(0,o.startsWith)(e,"core/")?e.slice(5):e;return r?`\x3c!-- wp:${a} ${n}--\x3e\n`+r+`\n\x3c!-- /wp:${a} --\x3e`:`\x3c!-- wp:${a} ${n}/--\x3e`}function hr(e){1===e.length&&Tt(e[0])&&(e=[]);let t=fr(e);return 1===e.length&&e[0].name===De()&&(t=(0,Jt.removep)(t)),t}function fr(e,t){return(0,o.castArray)(e).map((e=>function(e){let{isInnerBlocks:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=e.name,n=dr(e);if(r===Oe()||!t&&r===De())return n;const a=ur(Re(r),e.attributes);return pr(r,a,n)}(e,t))).join("\n\n")}var gr=/^#[xX]([A-Fa-f0-9]+)$/,mr=/^#([0-9]+)$/,br=/^([A-Za-z0-9]+)$/,_r=(function(){function e(e){this.named=e}e.prototype.parse=function(e){if(e){var t=e.match(gr);return t?String.fromCharCode(parseInt(t[1],16)):(t=e.match(mr))?String.fromCharCode(parseInt(t[1],10)):(t=e.match(br))?this.named[t[1]]:void 0}}}(),/[\t\n\f ]/),kr=/[A-Za-z]/,yr=/\r\n?/g;function wr(e){return _r.test(e)}function vr(e){return kr.test(e)}var Tr=function(){function e(e,t,r){void 0===r&&(r="precompile"),this.delegate=e,this.entityParser=t,this.mode=r,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var e=this.peek();if("<"!==e||this.isIgnoredEndTag()){if("precompile"===this.mode&&"\n"===e){var t=this.tagNameBuffer.toLowerCase();"pre"!==t&&"textarea"!==t||this.consume()}this.transitionTo("data"),this.delegate.beginData()}else this.transitionTo("tagOpen"),this.markTagStart(),this.consume()},data:function(){var e=this.peek(),t=this.tagNameBuffer;"<"!==e||this.isIgnoredEndTag()?"&"===e&&"script"!==t&&"style"!==t?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(e)):(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume())},tagOpen:function(){var e=this.consume();"!"===e?this.transitionTo("markupDeclarationOpen"):"/"===e?this.transitionTo("endTagOpen"):("@"===e||":"===e||vr(e))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(e))},markupDeclarationOpen:function(){var e=this.consume();"-"===e&&"-"===this.peek()?(this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment()):"DOCTYPE"===e.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase()&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())},doctype:function(){wr(this.consume())&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var e=this.consume();wr(e)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase()))},doctypeName:function(){var e=this.consume();wr(e)?this.transitionTo("afterDoctypeName"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase())},afterDoctypeName:function(){var e=this.consume();if(!wr(e))if(">"===e)this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var t=e.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),r="PUBLIC"===t.toUpperCase(),n="SYSTEM"===t.toUpperCase();(r||n)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),r?this.transitionTo("afterDoctypePublicKeyword"):n&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var e=this.peek();wr(e)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):'"'===e?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):"'"===e?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):">"===e&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},doctypePublicIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},afterDoctypePublicIdentifier:function(){var e=this.consume();wr(e)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var e=this.consume();wr(e)||(">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},doctypeSystemIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},afterDoctypeSystemIdentifier:function(){var e=this.consume();wr(e)||">"===e&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart:function(){var e=this.consume();"-"===e?this.transitionTo("commentStartDash"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(e),this.transitionTo("comment"))},commentStartDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var e=this.consume();"-"===e?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(e)},commentEndDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+e),this.transitionTo("comment"))},commentEnd:function(){var e=this.consume();">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+e),this.transitionTo("comment"))},tagName:function(){var e=this.consume();wr(e)?this.transitionTo("beforeAttributeName"):"/"===e?this.transitionTo("selfClosingStartTag"):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(e)},endTagName:function(){var e=this.consume();wr(e)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):"/"===e?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(e)},beforeAttributeName:function(){var e=this.peek();wr(e)?this.consume():"/"===e?(this.transitionTo("selfClosingStartTag"),this.consume()):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):"="===e?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var e=this.peek();wr(e)?(this.transitionTo("afterAttributeName"),this.consume()):"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.transitionTo("beforeAttributeValue"),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):'"'===e||"'"===e||"<"===e?(this.delegate.reportSyntaxError(e+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(e)):(this.consume(),this.delegate.appendToAttributeName(e))},afterAttributeName:function(){var e=this.peek();wr(e)?this.consume():"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.consume(),this.transitionTo("beforeAttributeValue")):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e))},beforeAttributeValue:function(){var e=this.peek();wr(e)?this.consume():'"'===e?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):"'"===e?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(e))},attributeValueDoubleQuoted:function(){var e=this.consume();'"'===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueSingleQuoted:function(){var e=this.consume();"'"===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueUnquoted:function(){var e=this.peek();wr(e)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"&"===e?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):">"===e?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(e))},afterAttributeValueQuoted:function(){var e=this.peek();wr(e)?(this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.consume(),this.transitionTo("selfClosingStartTag")):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){">"===this.peek()?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var e=this.consume();("@"===e||":"===e||vr(e))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(e))}},this.reset()}return e.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},e.prototype.transitionTo=function(e){this.state=e},e.prototype.tokenize=function(e){this.reset(),this.tokenizePart(e),this.tokenizeEOF()},e.prototype.tokenizePart=function(e){for(this.input+=function(e){return e.replace(yr,"\n")}(e);this.index<this.input.length;){var t=this.states[this.state];if(void 0===t)throw new Error("unhandled state "+this.state);t.call(this)}},e.prototype.tokenizeEOF=function(){this.flushData()},e.prototype.flushData=function(){"data"===this.state&&(this.delegate.finishData(),this.transitionTo("beforeData"))},e.prototype.peek=function(){return this.input.charAt(this.index)},e.prototype.consume=function(){var e=this.peek();return this.index++,"\n"===e?(this.line++,this.column=0):this.column++,e},e.prototype.consumeCharRef=function(){var e=this.input.indexOf(";",this.index);if(-1!==e){var t=this.input.slice(this.index,e),r=this.entityParser.parse(t);if(r){for(var n=t.length;n;)this.consume(),n--;return this.consume(),r}}},e.prototype.markTagStart=function(){this.delegate.tagOpen()},e.prototype.appendToTagName=function(e){this.tagNameBuffer+=e,this.delegate.appendToTagName(e)},e.prototype.isIgnoredEndTag=function(){var e=this.tagNameBuffer;return"title"===e&&"</title>"!==this.input.substring(this.index,this.index+8)||"style"===e&&"</style>"!==this.input.substring(this.index,this.index+8)||"script"===e&&"<\/script>"!==this.input.substring(this.index,this.index+9)},e}(),Cr=function(){function e(e,t){void 0===t&&(t={}),this.options=t,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new Tr(this,e,t.mode),this._currentAttribute=void 0}return e.prototype.tokenize=function(e){return this.tokens=[],this.tokenizer.tokenize(e),this.tokens},e.prototype.tokenizePart=function(e){return this.tokens=[],this.tokenizer.tokenizePart(e),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var e=this.token;if(null===e)throw new Error("token was unexpectedly null");if(0===arguments.length)return e;for(var t=0;t<arguments.length;t++)if(e.type===arguments[t])return e;throw new Error("token type was unexpectedly "+e.type)},e.prototype.push=function(e){this.token=e,this.tokens.push(e)},e.prototype.currentAttribute=function(){return this._currentAttribute},e.prototype.addLocInfo=function(){this.options.loc&&(this.current().loc={start:{line:this.startLine,column:this.startColumn},end:{line:this.tokenizer.line,column:this.tokenizer.column}}),this.startLine=this.tokenizer.line,this.startColumn=this.tokenizer.column},e.prototype.beginDoctype=function(){this.push({type:"Doctype",name:""})},e.prototype.appendToDoctypeName=function(e){this.current("Doctype").name+=e},e.prototype.appendToDoctypePublicIdentifier=function(e){var t=this.current("Doctype");void 0===t.publicIdentifier?t.publicIdentifier=e:t.publicIdentifier+=e},e.prototype.appendToDoctypeSystemIdentifier=function(e){var t=this.current("Doctype");void 0===t.systemIdentifier?t.systemIdentifier=e:t.systemIdentifier+=e},e.prototype.endDoctype=function(){this.addLocInfo()},e.prototype.beginData=function(){this.push({type:"Chars",chars:""})},e.prototype.appendToData=function(e){this.current("Chars").chars+=e},e.prototype.finishData=function(){this.addLocInfo()},e.prototype.beginComment=function(){this.push({type:"Comment",chars:""})},e.prototype.appendToCommentData=function(e){this.current("Comment").chars+=e},e.prototype.finishComment=function(){this.addLocInfo()},e.prototype.tagOpen=function(){},e.prototype.beginStartTag=function(){this.push({type:"StartTag",tagName:"",attributes:[],selfClosing:!1})},e.prototype.beginEndTag=function(){this.push({type:"EndTag",tagName:""})},e.prototype.finishTag=function(){this.addLocInfo()},e.prototype.markTagAsSelfClosing=function(){this.current("StartTag").selfClosing=!0},e.prototype.appendToTagName=function(e){this.current("StartTag","EndTag").tagName+=e},e.prototype.beginAttribute=function(){this._currentAttribute=["","",!1]},e.prototype.appendToAttributeName=function(e){this.currentAttribute()[0]+=e},e.prototype.beginAttributeValue=function(e){this.currentAttribute()[2]=e},e.prototype.appendToAttributeValue=function(e){this.currentAttribute()[1]+=e},e.prototype.finishAttributeValue=function(){this.current("StartTag").attributes.push(this._currentAttribute)},e.prototype.reportSyntaxError=function(e){this.current().syntaxError=e},e}();var xr=window.wp.htmlEntities;function Sr(){function e(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return e("Block validation: "+t,...n)}}return{error:e(console.error),warning:e(console.warn),getItems:()=>[]}}const Er=/[\t\n\r\v\f ]+/g,Br=/^[\t\n\r\v\f ]*$/,Nr=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,Ar=["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"],Pr=[...Ar,"autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],Lr=[o.identity,function(e){return Or(e).join(" ")}],Mr=/^[\da-z]+$/i,Dr=/^#\d+$/,jr=/^#x[\da-f]+$/i;class zr{parse(e){if(t=e,Mr.test(t)||Dr.test(t)||jr.test(t))return(0,xr.decodeEntities)("&"+e+";");var t}}function Or(e){return e.trim().split(Er)}function Ir(e){return e.attributes.filter((e=>{const[t,r]=e;return r||0===t.indexOf("data-")||(0,o.includes)(Pr,t)}))}function Vr(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Sr(),n=e.chars,a=t.chars;for(let e=0;e<Lr.length;e++){const t=Lr[e];if(n=t(n),a=t(a),n===a)return!0}return r.warning("Expected text `%s`, saw `%s`.",t.chars,e.chars),!1}function Hr(e){return 0===parseFloat(e)?"0":0===e.indexOf(".")?"0"+e:e}function Rr(e){return Or(e).map(Hr).join(" ").replace(Nr,"url($1)")}function $r(e){const t=e.replace(/;?\s*$/,"").split(";").map((e=>{const[t,...r]=e.split(":"),n=r.join(":");return[t.trim(),Rr(n.trim())]}));return(0,o.fromPairs)(t)}const Fr={class:(e,t)=>!(0,o.xor)(...[e,t].map(Or)).length,style:(e,t)=>(0,o.isEqual)(...[e,t].map($r)),...(0,o.fromPairs)(Ar.map((e=>[e,o.stubTrue])))};function qr(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Sr();if(e.length!==t.length)return r.warning("Expected attributes %o, instead saw %o.",t,e),!1;const n={};for(let e=0;e<t.length;e++)n[t[e][0].toLowerCase()]=t[e][1];for(let t=0;t<e.length;t++){const[a,o]=e[t],i=a.toLowerCase();if(!n.hasOwnProperty(i))return r.warning("Encountered unexpected attribute `%s`.",a),!1;const s=n[i],c=Fr[i];if(c){if(!c(o,s))return r.warning("Expected attribute `%s` of value `%s`, saw `%s`.",a,s,o),!1}else if(o!==s)return r.warning("Expected attribute `%s` of value `%s`, saw `%s`.",a,s,o),!1}return!0}const Ur={StartTag:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Sr();return e.tagName!==t.tagName&&e.tagName.toLowerCase()!==t.tagName.toLowerCase()?(r.warning("Expected tag name `%s`, instead saw `%s`.",t.tagName,e.tagName),!1):qr(...[e,t].map(Ir),r)},Chars:Vr,Comment:Vr};function Gr(e){let t;for(;t=e.shift();){if("Chars"!==t.type)return t;if(!Br.test(t.chars))return t}}function Kr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sr();try{return new Cr(new zr).tokenize(e)}catch(r){t.warning("Malformed HTML detected: %s",e)}return null}function Wr(e,t){return!!e.selfClosing&&!(!t||t.tagName!==e.tagName||"EndTag"!==t.type)}function Yr(e,t){if(e.name===De()||e.name===Oe())return[!0];const r=function(){const e=[],t=Sr();return{error(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];e.push({log:t.error,args:n})},warning(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];e.push({log:t.warning,args:n})},getItems:()=>e}}(),n=St(t);let a;try{a=lr(n,e.attributes)}catch(e){return r.error("Block validation failed because an error occurred while generating block content:\n\n%s",e.toString()),[!1,r.getItems()]}const o=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Sr();if(e===t)return!0;const[n,a]=[e,t].map((e=>Kr(e,r)));if(!n||!a)return!1;let o,i;for(;o=Gr(n);){if(i=Gr(a),!i)return r.warning("Expected end of content, instead saw %o.",o),!1;if(o.type!==i.type)return r.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",i.type,i,o.type,o),!1;const e=Ur[o.type];if(e&&!e(o,i,r))return!1;Wr(o,a[0])?Gr(a):Wr(i,n[0])&&Gr(n)}return!(i=Gr(a))||(r.warning("Expected %o, instead saw end of content.",i),!1)}(e.originalContent,a,r);return o||r.error("Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",n.name,n,a,e.originalContent),[o,r.getItems()]}function Qr(e,t,r){const n=St(e),a={name:n.name,attributes:t,innerBlocks:[],originalContent:r},[o]=Yr(a,n);return o}function Zr(e,t){const r={...t};if("core/cover-image"===e&&(e="core/cover"),"core/text"!==e&&"core/cover-text"!==e||(e="core/paragraph"),e&&0===e.indexOf("core/social-link-")&&(r.service=e.substring(17),e="core/social-link"),e&&0===e.indexOf("core-embed/")){const t=e.substring(11),n={speaker:"speaker-deck",polldaddy:"crowdsignal"};r.providerNameSlug=t in n?n[t]:t,["amazon-kindle","wordpress"].includes(t)||(r.responsive=!0),e="core/embed"}return"core/query-loop"===e&&(e="core/post-template"),"core/post-comment-author"===e&&(e="core/comment-author-name"),"core/post-comment-content"===e&&(e="core/comment-content"),"core/post-comment-date"===e&&(e="core/comment-date"),[e,r]}function Xr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{isCommentDelimited:r=!0}=t,{blockName:n,attrs:a={},innerBlocks:o=[],innerContent:i=[]}=e;let s=0;const c=i.map((e=>null!==e?e:Xr(o[s++],t))).join("\n").replace(/\n+/g,"\n").trim();return r?pr(n,a,c):c}function Jr(e,t){for(var r,n=t.split(".");r=n.shift();){if(!(r in e))return;e=e[r]}return e}var en,tn=function(){return en||(en=document.implementation.createHTMLDocument("")),en};function rn(e,t){if(t){if("string"==typeof e){var r=tn();r.body.innerHTML=e,e=r.body}if("function"==typeof t)return t(e);if(Object===t.constructor)return Object.keys(t).reduce((function(r,n){return r[n]=rn(e,t[n]),r}),{})}}function nn(e,t){return 1===arguments.length&&(t=e,e=void 0),function(r){var n=r;if(e&&(n=r.querySelector(e)),n)return Jr(n,t)}}function an(e){const t={};for(let r=0;r<e.length;r++){const{name:n,value:a}=e[r];t[n]=a}return t}function on(e){if(e.nodeType===e.TEXT_NODE)return e.nodeValue;if(e.nodeType!==e.ELEMENT_NODE)throw new TypeError("A block node can only be created from a node of type text or element.");return{type:e.nodeName.toLowerCase(),props:{...an(e.attributes),children:ln(e.childNodes)}}}function sn(e){return t=>{let r=t;e&&(r=t.querySelector(e));try{return on(r)}catch(e){return null}}}var cn={isNodeOfType:function(e,t){return e&&e.type===t},fromDOM:on,toHTML:function(e){return un([e])},matcher:sn};function ln(e){const t=[];for(let r=0;r<e.length;r++)try{t.push(on(e[r]))}catch(e){}return t}function un(e){const t=e;return(0,_e.renderToString)(t)}function dn(e){return t=>{let r=t;return e&&(r=t.querySelector(e)),r?ln(r.childNodes):[]}}var pn={concat:function(){const e=[];for(let t=0;t<arguments.length;t++){const r=(0,o.castArray)(t<0||arguments.length<=t?void 0:arguments[t]);for(let t=0;t<r.length;t++){const n=r[t];"string"==typeof n&&"string"==typeof e[e.length-1]?e[e.length-1]+=n:e.push(n)}}return e},getChildrenArray:function(e){return e},fromDOM:ln,toHTML:un,matcher:dn};function hn(e,t){return t.some((t=>function(e,t){switch(t){case"string":return"string"==typeof e;case"boolean":return"boolean"==typeof e;case"object":return!!e&&e.constructor===Object;case"null":return null===e;case"array":return Array.isArray(e);case"integer":case"number":return"number"==typeof e}return!0}(e,t)))}function fn(e,t,r,n){const{type:a,enum:i}=t;let s;switch(t.source){case void 0:s=n?n[e]:void 0;break;case"attribute":case"property":case"html":case"text":case"children":case"node":case"query":case"tag":s=mn(r,t)}return function(e,t){return void 0===t||hn(e,(0,o.castArray)(t))}(s,a)&&function(e,t){return!Array.isArray(t)||t.includes(e)}(s,i)||(s=void 0),void 0===s?t.default:s}function gn(e){switch(e.source){case"attribute":let n=function(e,t){return 1===arguments.length&&(t=e,e=void 0),function(r){var n=nn(e,"attributes")(r);if(n&&n.hasOwnProperty(t))return n[t].value}}(e.selector,e.attribute);return"boolean"===e.type&&(n=(e=>(0,o.flow)([e,e=>void 0!==e]))(n)),n;case"html":return t=e.selector,r=e.multiline,e=>{let n=e;if(t&&(n=e.querySelector(t)),!n)return"";if(r){let e="";const t=n.children.length;for(let a=0;a<t;a++){const t=n.children[a];t.nodeName.toLowerCase()===r&&(e+=t.outerHTML)}return e}return n.innerHTML};case"text":return function(e){return nn(e,"textContent")}(e.selector);case"children":return dn(e.selector);case"node":return sn(e.selector);case"query":const a=(0,o.mapValues)(e.query,gn);return function(e,t){return function(r){var n=r.querySelectorAll(e);return[].map.call(n,(function(e){return rn(e,t)}))}}(e.selector,a);case"tag":return(0,o.flow)([nn(e.selector,"nodeName"),e=>e?e.toLowerCase():void 0]);default:console.error(`Unknown source type "${e.source}"`)}var t,r}function mn(e,t){return rn(e,gn(t))}function bn(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=St(e),a=(0,o.mapValues)(n.attributes,((e,n)=>fn(n,e,t,r)));return(0,H.applyFilters)("blocks.getBlockAttributes",a,n,t,r)}function _n(e){const t=mn(e=`<div data-custom-class-name>${e}</div>`,{type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"});return t?t.trim().split(/\s+/):[]}function kn(e,t){const r=function(e,t,r){if(qe(t,"customClassName",!0)){const n=lr(t,(0,o.omit)(e,["className"])),a=_n(n),i=_n(r),s=(0,o.difference)(i,a);s.length?e.className=s.join(" "):n&&delete e.className}return e}(e.attributes,t,e.originalContent);return{...e,attributes:r}}function yn(e){let t=function(e){const t=De(),r=e.blockName||De(),n=e.attrs||{},a=e.innerBlocks||[];let o=e.innerHTML.trim();return r===t&&(o=(0,Jt.autop)(o).trim()),{...e,blockName:r,attrs:n,innerHTML:o,innerBlocks:a}}(e);t=function(e){const[t,r]=Zr(e.blockName,e.attrs);return{...e,blockName:t,attrs:r}}(t);let r=Re(t.blockName);r||(t=function(e){const t=Oe()||De(),r=Xr(e,{isCommentDelimited:!1}),n=Xr(e,{isCommentDelimited:!0});return{blockName:t,attrs:{originalName:e.blockName,originalContent:n,originalUndelimitedContent:r},innerHTML:e.blockName?n:e.innerHTML,innerBlocks:e.innerBlocks,innerContent:e.innerContent}}(t),r=Re(t.blockName));const n=t.blockName===De()||t.blockName===Oe();if(!r||!t.innerHTML&&n)return;const a=t.innerBlocks.map(yn).filter((e=>!!e));let i=ut(t.blockName,bn(r,t.innerHTML,t.attrs),a);i.originalContent=t.innerHTML;let[s,c]=Yr(i,r);return s||(i=kn(i,r),[s,c]=Yr(i,r)),i.isValid=s,i.validationIssues=c,i=function(e,t,r){const n=t.attrs,{deprecated:a}=r;if(!a||!a.length)return e;for(let t=0;t<a.length;t++){const{isEligible:i=o.stubFalse}=a[t];if(e.isValid&&!i(n,e.innerBlocks))continue;const s=Object.assign((0,o.omit)(r,we),a[t]);let c={...e,attributes:bn(s,e.originalContent,n)},[l]=Yr(c,s);if(l||(c=kn(c,s),[l]=Yr(c,s)),!l)continue;let u=c.innerBlocks,d=c.attributes;const{migrate:p}=s;p&&([d=n,u=e.innerBlocks]=(0,o.castArray)(p(d,e.innerBlocks))),e={...e,attributes:d,innerBlocks:u,isValid:!0,validationIssues:[]}}return e}(i,t,r),c&&c.length>0&&(i.isValid?(console.groupCollapsed("Updated Block: %s",r.name),console.info("Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",r.name,r,lr(r,i.attributes),i.originalContent),console.groupEnd()):c.forEach((e=>{let{log:t,args:r}=e;return t(...r)}))),i}function wn(e){return(0,Xt.parse)(e).reduce(((e,t)=>{const r=yn(t);return r&&e.push(r),e}),[])}var vn=window.wp.deprecated,Tn=r.n(vn);function Cn(){return(0,o.filter)(kt("from"),{type:"raw"}).map((e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)}))}function xn(e){const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children).flatMap((e=>{const t=_t(Cn(),(t=>{let{isMatch:r}=t;return r(e)}));if(!t)return ut("core/html",bn("core/html",e.outerHTML));const{transform:r,blockName:n}=t;return r?r(e):ut(n,bn(n,e.outerHTML))}))}function Sn(e){const t=document.implementation.createHTMLDocument(""),r=document.implementation.createHTMLDocument(""),n=t.body,a=r.body;for(n.innerHTML=e;n.firstChild;){const e=n.firstChild;e.nodeType===e.TEXT_NODE?(0,ke.isEmpty)(e)?n.removeChild(e):(a.lastChild&&"P"===a.lastChild.nodeName||a.appendChild(r.createElement("P")),a.lastChild.appendChild(e)):e.nodeType===e.ELEMENT_NODE?"BR"===e.nodeName?(e.nextSibling&&"BR"===e.nextSibling.nodeName&&(a.appendChild(r.createElement("P")),n.removeChild(e.nextSibling)),a.lastChild&&"P"===a.lastChild.nodeName&&a.lastChild.hasChildNodes()?a.lastChild.appendChild(e):n.removeChild(e)):"P"===e.nodeName?(0,ke.isEmpty)(e)?n.removeChild(e):a.appendChild(e):(0,ke.isPhrasingContent)(e)?(a.lastChild&&"P"===a.lastChild.nodeName||a.appendChild(r.createElement("P")),a.lastChild.appendChild(e)):a.appendChild(e):n.removeChild(e)}return a.innerHTML}function En(e,t){if(e.nodeType===e.COMMENT_NODE)if("nextpage"!==e.nodeValue){if(0===e.nodeValue.indexOf("more")){const r=e.nodeValue.slice(4).trim();let n=e,a=!1;for(;n=n.nextSibling;)if(n.nodeType===n.COMMENT_NODE&&"noteaser"===n.nodeValue){a=!0,(0,ke.remove)(n);break}(0,ke.replace)(e,function(e,t,r){const n=r.createElement("wp-block");n.dataset.block="core/more",e&&(n.dataset.customText=e);t&&(n.dataset.noTeaser="");return n}(r,a,t))}}else(0,ke.replace)(e,function(e){const t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}(t))}function Bn(e){return"OL"===e.nodeName||"UL"===e.nodeName}function Nn(e){if(!Bn(e))return;const t=e,r=e.previousElementSibling;if(r&&r.nodeName===e.nodeName&&1===t.children.length){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode.removeChild(t)}const n=e.parentNode;if(n&&"LI"===n.nodeName&&1===n.children.length&&!/\S/.test((a=n,Array.from(a.childNodes).map((e=>{let{nodeValue:t=""}=e;return t})).join("")))){const e=n,r=e.previousElementSibling,a=e.parentNode;r?(r.appendChild(t),a.removeChild(e)):(a.parentNode.insertBefore(t,a),a.parentNode.removeChild(a))}var a;if(n&&Bn(n)){const t=e.previousElementSibling;t?t.appendChild(e):(0,ke.unwrap)(e)}}function An(e){"BLOCKQUOTE"===e.nodeName&&(e.innerHTML=Sn(e.innerHTML))}function Pn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const r=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(r,t),r.appendChild(e)}function Ln(e,t,r){if(!function(e,t){const r=e.nodeName.toLowerCase();return"figcaption"!==r&&!(0,ke.isTextContent)(e)&&(0,o.has)(t,["figure","children",r])}(e,r))return;let n=e;const a=e.parentNode;(function(e,t){const r=e.nodeName.toLowerCase();return(0,o.has)(t,["figure","children","a","children",r])})(e,r)&&"A"===a.nodeName&&1===a.childNodes.length&&(n=e.parentNode);const i=n.closest("p,div");i?e.classList?(e.classList.contains("alignright")||e.classList.contains("alignleft")||e.classList.contains("aligncenter")||!i.textContent.trim())&&Pn(n,i):Pn(n,i):"BODY"===n.parentNode.nodeName&&Pn(n)}var Mn=window.wp.shortcode;var Dn=function e(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const a=kt("from"),i=_t(a,(e=>-1===n.indexOf(e.blockName)&&"shortcode"===e.type&&(0,o.some)((0,o.castArray)(e.tag),(e=>(0,Mn.regexp)(e).test(t)))));if(!i)return[t];const s=(0,o.castArray)(i.tag),c=(0,o.find)(s,(e=>(0,Mn.regexp)(e).test(t)));let l;const u=r;if(l=(0,Mn.next)(c,t,r)){r=l.index+l.content.length;const a=t.substr(0,l.index),s=t.substr(r);if(!((0,o.includes)(l.shortcode.content||"","<")||/(\n|<p>)\s*$/.test(a)&&/^\s*(\n|<\/p>)/.test(s)))return e(t,r);if(i.isMatch&&!i.isMatch(l.shortcode.attrs))return e(t,u,[...n,i.blockName]);const c=(0,o.mapValues)((0,o.pickBy)(i.attributes,(e=>e.shortcode)),(e=>e.shortcode(l.shortcode.attrs,l))),d={...Re(i.blockName),attributes:i.attributes};let p=ut(i.blockName,bn(d,l.shortcode.content,c));return p.originalContent=l.shortcode.content,p=kn(p,d),[...e(a),p,...e(s)]}return[t]};function jn(e){return function(e,t){const r={phrasingContentSchema:(0,ke.getPhrasingContentSchema)(t),isPaste:"paste"===t},n=e.map((e=>{let{isMatch:t,blockName:n,schema:a}=e;const i=qe(n,"anchor");return a=(0,o.isFunction)(a)?a(r):a,i||t?(0,o.mapValues)(a,(e=>{let r=e.attributes||[];return i&&(r=[...r,"id"]),{...e,attributes:r,isMatch:t||void 0}})):a}));return(0,o.mergeWith)({},...n,((e,t,r)=>{switch(r){case"children":return"*"===e||"*"===t?"*":{...e,...t};case"attributes":case"require":return[...e||[],...t||[]];case"isMatch":if(!e||!t)return;return function(){return e(...arguments)||t(...arguments)}}}))}(Cn(),e)}function zn(e,t,r,n){Array.from(e).forEach((e=>{zn(e.childNodes,t,r,n),t.forEach((t=>{r.contains(e)&&t(e,r,n)}))}))}function On(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,zn(n.body.childNodes,t,n,r),n.body.innerHTML}function In(e,t){const r=e[`${t}Sibling`];if(r&&(0,ke.isPhrasingContent)(r))return r;const{parentNode:n}=e;return n&&(0,ke.isPhrasingContent)(n)?In(n,t):void 0}function Vn(e){return Tn()("wp.blocks.getPhrasingContentSchema",{since:"5.6",alternative:"wp.dom.getPhrasingContentSchema"}),(0,ke.getPhrasingContentSchema)(e)}function Hn(e){let{HTML:t=""}=e;if(-1!==t.indexOf("\x3c!-- wp:"))return wn(t);const r=Dn(t),n=jn();return(0,o.compact)((0,o.flatMap)(r,(e=>{if("string"!=typeof e)return e;return xn(e=Sn(e=On(e,[Nn,En,Ln,An],n)))})))}function Rn(e){e.nodeType===e.COMMENT_NODE&&(0,ke.remove)(e)}function $n(e,t){return e.every((e=>function(e,t){if((0,ke.isTextContent)(e))return!0;if(!t)return!1;const r=e.nodeName.toLowerCase();return[["ul","li","ol"],["h1","h2","h3","h4","h5","h6"]].some((e=>0===(0,o.difference)([r,t],e).length))}(e,t)&&$n(Array.from(e.children),t)))}function Fn(e){return"BR"===e.nodeName&&e.previousSibling&&"BR"===e.previousSibling.nodeName}function qn(e,t){if("SPAN"===e.nodeName&&e.style){const{fontWeight:r,fontStyle:n,textDecorationLine:a,textDecoration:i,verticalAlign:s}=e.style;"bold"!==r&&"700"!==r||(0,ke.wrap)(t.createElement("strong"),e),"italic"===n&&(0,ke.wrap)(t.createElement("em"),e),("line-through"===a||(0,o.includes)(i,"line-through"))&&(0,ke.wrap)(t.createElement("s"),e),"super"===s?(0,ke.wrap)(t.createElement("sup"),e):"sub"===s&&(0,ke.wrap)(t.createElement("sub"),e)}else"B"===e.nodeName?e=(0,ke.replaceTag)(e,"strong"):"I"===e.nodeName?e=(0,ke.replaceTag)(e,"em"):"A"===e.nodeName&&(e.target&&"_blank"===e.target.toLowerCase()?e.rel="noreferrer noopener":(e.removeAttribute("target"),e.removeAttribute("rel")),e.name&&!e.id&&(e.id=e.name),e.id&&!e.ownerDocument.querySelector(`[href="#${e.id}"]`)&&e.removeAttribute("id"))}function Un(e){"SCRIPT"!==e.nodeName&&"NOSCRIPT"!==e.nodeName&&"TEMPLATE"!==e.nodeName&&"STYLE"!==e.nodeName||e.parentNode.removeChild(e)}const{parseInt:Gn}=window;function Kn(e){return"OL"===e.nodeName||"UL"===e.nodeName}function Wn(e,t){if("P"!==e.nodeName)return;const r=e.getAttribute("style");if(!r)return;if(-1===r.indexOf("mso-list"))return;const n=/mso-list\s*:[^;]+level([0-9]+)/i.exec(r);if(!n)return;let a=Gn(n[1],10)-1||0;const o=e.previousElementSibling;if(!o||!Kn(o)){const r=e.textContent.trim().slice(0,1),n=/[1iIaA]/.test(r),a=t.createElement(n?"ol":"ul");n&&a.setAttribute("type",r),e.parentNode.insertBefore(a,e)}const i=e.previousElementSibling,s=i.nodeName,c=t.createElement("li");let l=i;for(e.removeChild(e.firstElementChild);e.firstChild;)c.appendChild(e.firstChild);for(;a--;)l=l.lastElementChild||l,Kn(l)&&(l=l.lastElementChild||l);Kn(l)||(l=l.appendChild(t.createElement(s))),l.appendChild(c),e.parentNode.removeChild(e)}var Yn=window.wp.blob;const{atob:Qn,File:Zn}=window;function Xn(e){if("IMG"===e.nodeName){if(0===e.src.indexOf("file:")&&(e.src=""),0===e.src.indexOf("data:")){const[t,r]=e.src.split(","),[n]=t.slice(5).split(";");if(!r||!n)return void(e.src="");let a;try{a=Qn(r)}catch(t){return void(e.src="")}const o=new Uint8Array(a.length);for(let e=0;e<o.length;e++)o[e]=a.charCodeAt(e);const i=n.replace("/","."),s=new Zn([o],i,{type:n});e.src=(0,Yn.createBlobURL)(s)}1!==e.height&&1!==e.width||e.parentNode.removeChild(e)}}var Jn=r(7308);const ea=new(r.n(Jn)().Converter)({noHeaderId:!0,tables:!0,literalMidWordUnderscores:!0,omitExtraWLInCodeBlocks:!0,simpleLineBreaks:!0,strikethrough:!0});function ta(e){if("IFRAME"===e.nodeName){const t=e.ownerDocument.createTextNode(e.src);e.parentNode.replaceChild(t,e)}}function ra(e){e.id&&0===e.id.indexOf("docs-internal-guid-")&&(0,ke.unwrap)(e)}function na(e){if(e.nodeType!==e.TEXT_NODE)return;let t=e;for(;t=t.parentNode;)if(t.nodeType===t.ELEMENT_NODE&&"PRE"===t.nodeName)return;let r=e.data.replace(/[ \r\n\t]+/g," ");if(" "===r[0]){const t=In(e,"previous");t&&"BR"!==t.nodeName&&" "!==t.textContent.slice(-1)||(r=r.slice(1))}if(" "===r[r.length-1]){const t=In(e,"next");(!t||"BR"===t.nodeName||t.nodeType===t.TEXT_NODE&&(" "===(n=t.textContent[0])||"\r"===n||"\n"===n||"\t"===n))&&(r=r.slice(0,-1))}var n;r?e.data=r:e.parentNode.removeChild(e)}function aa(e){"BR"===e.nodeName&&(In(e,"next")||e.parentNode.removeChild(e))}function oa(e){"P"===e.nodeName&&(e.hasChildNodes()||e.parentNode.removeChild(e))}const{console:ia}=window;function sa(e,t){return e=On(e,[ra,qn,Rn]),e=(0,ke.removeInvalidHTML)(e,(0,ke.getPhrasingContentSchema)("paste"),{inline:!0}),t||(e=On(e,[na,aa])),ia.log("Processed inline HTML:\n\n",e),e}function ca(e){let{HTML:t="",plainText:r="",mode:n="AUTO",tagName:a,preserveWhiteSpace:i}=e;if(t=t.replace(/<meta[^>]+>/g,""),t=t.replace(/^\s*<html[^>]*>\s*<body[^>]*>(?:\s*<!--\s*StartFragment\s*-->)?/i,""),t=t.replace(/(?:<!--\s*EndFragment\s*-->\s*)?<\/body>\s*<\/html>\s*$/i,""),"INLINE"!==n){const e=t||r;if(-1!==e.indexOf("\x3c!-- wp:"))return wn(e)}var s;if(String.prototype.normalize&&(t=t.normalize()),!r||t&&!function(e){return!/<(?!br[ />])/i.test(e)}(t)||(t=r,/^\s+$/.test(r)||(s=t,t=ea.makeHtml(function(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,((e,t,r,n)=>`${t}\n${r}\n${n}`))}(s))),"AUTO"===n&&-1===r.indexOf("\n")&&0!==r.indexOf("<p>")&&0===t.indexOf("<p>")&&(n="INLINE")),"INLINE"===n)return sa(t,i);const c=Dn(t),l=c.length>1;if("AUTO"===n&&!l&&function(e,t){const r=document.implementation.createHTMLDocument("");r.body.innerHTML=e;const n=Array.from(r.body.children);return!n.some(Fn)&&$n(n,t)}(t,a))return sa(t,i);const u=(0,ke.getPhrasingContentSchema)("paste"),d=jn("paste"),p=(0,o.compact)((0,o.flatMap)(c,(e=>{if("string"!=typeof e)return e;const t=[ra,Wn,Un,Nn,Xn,qn,En,Rn,ta,Ln,An],r={...d,...u};return e=On(e,t,d),e=On(e=Sn(e=(0,ke.removeInvalidHTML)(e,r)),[na,aa,oa],d),ia.log("Processed HTML piece:\n\n",e),xn(e)})));if("AUTO"===n&&1===p.length&&qe(p[0].name,"__unstablePasteTextInline",!1)){const e=r.replace(/^[\n]+|[\n]+$/g,"");if(""!==e&&-1===e.indexOf("\n"))return(0,ke.removeInvalidHTML)(dr(p[0]),u)}return p}function la(){return(0,a.select)(Zt).getCategories()}function ua(e){(0,a.dispatch)(Zt).setCategories(e)}function da(e,t){(0,a.dispatch)(Zt).updateCategory(e,t)}function pa(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length===t.length&&(0,o.every)(t,((t,r)=>{let[n,,a]=t;const o=e[r];return n===o.name&&pa(o.innerBlocks,a)}))}function ha(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return t?(0,o.map)(t,((t,r)=>{let[n,a,i]=t;const s=e[r];if(s&&s.name===n){const e=ha(s.innerBlocks,i);return{...s,innerBlocks:e}}const c=Re(n),l=(e,t)=>(0,o.mapValues)(t,((t,r)=>u(e[r],t))),u=(e,t)=>{return r=e,"html"===(0,o.get)(r,["source"])&&(0,o.isArray)(t)?(0,_e.renderToString)(t):(e=>"query"===(0,o.get)(e,["source"]))(e)&&t?t.map((t=>l(e.query,t))):t;var r},d=l((0,o.get)(c,["attributes"],{}),a),[p,h]=Zr(n,d);return ut(p,h,ha([],i))})):e}function fa(){return fa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fa.apply(this,arguments)}var ga=window.wp.compose;const{Consumer:ma,Provider:ba}=(0,_e.createContext)((()=>{})),_a=(0,ga.createHigherOrderComponent)((e=>t=>(0,_e.createElement)(ma,null,(r=>(0,_e.createElement)(e,fa({},t,{BlockContent:r}))))),"withBlockContentContext")}(),(window.wp=window.wp||{}).blocks=n}();
\ No newline at end of file
diff --git a/wp-includes/js/dist/components.js b/wp-includes/js/dist/components.js
index a5b9a10208..c66527aba0 100644
--- a/wp-includes/js/dist/components.js
+++ b/wp-includes/js/dist/components.js
@@ -1,1562 +1,1456 @@
-this["wp"] = this["wp"] || {}; this["wp"]["components"] =
-/******/ (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 = "SB3u");
-/******/ })
-/************************************************************************/
-/******/ ({
+/******/ (function() { // webpackBootstrap
+/******/ var __webpack_modules__ = ({
-/***/ "+1VY":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 5096:
+/***/ (function(module) {
"use strict";
-// EXTERNAL MODULE: ./node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js
-var emotion_sheet_browser_esm = __webpack_require__("ep+1");
-
-// CONCATENATED MODULE: ./node_modules/stylis/dist/stylis.mjs
-var e="-ms-";var r="-moz-";var a="-webkit-";var c="comm";var n="rule";var t="decl";var s="@page";var u="@media";var i="@import";var f="@charset";var o="@viewport";var l="@supports";var v="@document";var h="@namespace";var p="@keyframes";var b="@font-face";var w="@counter-style";var $="@font-feature-values";var k=Math.abs;var d=String.fromCharCode;var g=Object.assign;function m(e,r){return(((r<<2^z(e,0))<<2^z(e,1))<<2^z(e,2))<<2^z(e,3)}function x(e){return e.trim()}function y(e,r){return(e=r.exec(e))?e[0]:e}function j(e,r,a){return e.replace(r,a)}function C(e,r){return e.indexOf(r)}function z(e,r){return e.charCodeAt(r)|0}function A(e,r,a){return e.slice(r,a)}function O(e){return e.length}function M(e){return e.length}function S(e,r){return r.push(e),e}function q(e,r){return e.map(r).join("")}var B=1;var D=1;var E=0;var F=0;var G=0;var H="";function I(e,r,a,c,n,t,s){return{value:e,root:r,parent:a,type:c,props:n,children:t,line:B,column:D,length:s,return:""}}function J(e,r){return g(I("",null,null,"",null,null,0),e,{length:-e.length},r)}function K(){return G}function L(){G=F>0?z(H,--F):0;if(D--,G===10)D=1,B--;return G}function N(){G=F<E?z(H,F++):0;if(D++,G===10)D=1,B++;return G}function P(){return z(H,F)}function Q(){return F}function R(e,r){return A(H,e,r)}function T(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function U(e){return B=D=1,E=O(H=e),F=0,[]}function V(e){return H="",e}function W(e){return x(R(F-1,ee(e===91?e+2:e===40?e+1:e)))}function X(e){return V(Z(U(e)))}function Y(e){while(G=P())if(G<33)N();else break;return T(e)>2||T(G)>3?"":" "}function Z(e){while(N())switch(T(G)){case 0:S(ae(F-1),e);break;case 2:S(W(G),e);break;default:S(d(G),e)}return e}function _(e,r){while(--r&&N())if(G<48||G>102||G>57&&G<65||G>70&&G<97)break;return R(e,Q()+(r<6&&P()==32&&N()==32))}function ee(e){while(N())switch(G){case e:return F;case 34:case 39:if(e!==34&&e!==39)ee(G);break;case 40:if(e===41)ee(e);break;case 92:N();break}return F}function re(e,r){while(N())if(e+G===47+10)break;else if(e+G===42+42&&P()===47)break;return"/*"+R(r,F-1)+"*"+d(e===47?e:N())}function ae(e){while(!T(P()))N();return R(e,F)}function ce(e){return V(ne("",null,null,null,[""],e=U(e),0,[0],e))}function ne(e,r,a,c,n,t,s,u,i){var f=0;var o=0;var l=s;var v=0;var h=0;var p=0;var b=1;var w=1;var $=1;var k=0;var g="";var m=n;var x=t;var y=c;var z=g;while(w)switch(p=k,k=N()){case 40:if(p!=108&&z.charCodeAt(l-1)==58){if(C(z+=j(W(k),"&","&\f"),"&\f")!=-1)$=-1;break}case 34:case 39:case 91:z+=W(k);break;case 9:case 10:case 13:case 32:z+=Y(p);break;case 92:z+=_(Q()-1,7);continue;case 47:switch(P()){case 42:case 47:S(se(re(N(),Q()),r,a),i);break;default:z+="/"}break;case 123*b:u[f++]=O(z)*$;case 125*b:case 59:case 0:switch(k){case 0:case 125:w=0;case 59+o:if(h>0&&O(z)-l)S(h>32?ue(z+";",c,a,l-1):ue(j(z," ","")+";",c,a,l-2),i);break;case 59:z+=";";default:S(y=te(z,r,a,f,o,n,u,g,m=[],x=[],l),t);if(k===123)if(o===0)ne(z,r,y,y,m,t,l,u,x);else switch(v){case 100:case 109:case 115:ne(e,y,y,c&&S(te(e,y,y,0,0,n,u,g,n,m=[],l),x),n,x,l,u,c?m:x);break;default:ne(z,y,y,y,[""],x,0,u,x)}}f=o=h=0,b=$=1,g=z="",l=s;break;case 58:l=1+O(z),h=p;default:if(b<1)if(k==123)--b;else if(k==125&&b++==0&&L()==125)continue;switch(z+=d(k),k*b){case 38:$=o>0?1:(z+="\f",-1);break;case 44:u[f++]=(O(z)-1)*$,$=1;break;case 64:if(P()===45)z+=W(N());v=P(),o=l=O(g=z+=ae(Q())),k++;break;case 45:if(p===45&&O(z)==2)b=0}}return t}function te(e,r,a,c,t,s,u,i,f,o,l){var v=t-1;var h=t===0?s:[""];var p=M(h);for(var b=0,w=0,$=0;b<c;++b)for(var d=0,g=A(e,v+1,v=k(w=u[b])),m=e;d<p;++d)if(m=x(w>0?h[d]+" "+g:j(g,/&\f/g,h[d])))f[$++]=m;return I(e,r,a,t===0?n:i,f,o,l)}function se(e,r,a){return I(e,r,a,c,d(K()),A(e,2,-2),0)}function ue(e,r,a,c){return I(e,r,a,t,A(e,0,c),A(e,c+1,-1),c)}function ie(c,n){switch(m(c,n)){case 5103:return a+"print-"+c+c;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return a+c+c;case 5349:case 4246:case 4810:case 6968:case 2756:return a+c+r+c+e+c+c;case 6828:case 4268:return a+c+e+c+c;case 6165:return a+c+e+"flex-"+c+c;case 5187:return a+c+j(c,/(\w+).+(:[^]+)/,a+"box-$1$2"+e+"flex-$1$2")+c;case 5443:return a+c+e+"flex-item-"+j(c,/flex-|-self/,"")+c;case 4675:return a+c+e+"flex-line-pack"+j(c,/align-content|flex-|-self/,"")+c;case 5548:return a+c+e+j(c,"shrink","negative")+c;case 5292:return a+c+e+j(c,"basis","preferred-size")+c;case 6060:return a+"box-"+j(c,"-grow","")+a+c+e+j(c,"grow","positive")+c;case 4554:return a+j(c,/([^-])(transform)/g,"$1"+a+"$2")+c;case 6187:return j(j(j(c,/(zoom-|grab)/,a+"$1"),/(image-set)/,a+"$1"),c,"")+c;case 5495:case 3959:return j(c,/(image-set\([^]*)/,a+"$1"+"$`$1");case 4968:return j(j(c,/(.+:)(flex-)?(.*)/,a+"box-pack:$3"+e+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+a+c+c;case 4095:case 3583:case 4068:case 2532:return j(c,/(.+)-inline(.+)/,a+"$1$2")+c;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(O(c)-1-n>6)switch(z(c,n+1)){case 109:if(z(c,n+4)!==45)break;case 102:return j(c,/(.+:)(.+)-([^]+)/,"$1"+a+"$2-$3"+"$1"+r+(z(c,n+3)==108?"$3":"$2-$3"))+c;case 115:return~C(c,"stretch")?ie(j(c,"stretch","fill-available"),n)+c:c}break;case 4949:if(z(c,n+1)!==115)break;case 6444:switch(z(c,O(c)-3-(~C(c,"!important")&&10))){case 107:return j(c,":",":"+a)+c;case 101:return j(c,/(.+:)([^;!]+)(;|!.+)?/,"$1"+a+(z(c,14)===45?"inline-":"")+"box$3"+"$1"+a+"$2$3"+"$1"+e+"$2box$3")+c}break;case 5936:switch(z(c,n+11)){case 114:return a+c+e+j(c,/[svh]\w+-[tblr]{2}/,"tb")+c;case 108:return a+c+e+j(c,/[svh]\w+-[tblr]{2}/,"tb-rl")+c;case 45:return a+c+e+j(c,/[svh]\w+-[tblr]{2}/,"lr")+c}return a+c+e+c+c}return c}function fe(e,r){var a="";var c=M(e);for(var n=0;n<c;n++)a+=r(e[n],n,e,r)||"";return a}function oe(e,r,a,s){switch(e.type){case i:case t:return e.return=e.return||e.value;case c:return"";case p:return e.return=e.value+"{"+fe(e.children,s)+"}";case n:e.value=e.props.join(",")}return O(a=fe(e.children,s))?e.return=e.value+"{"+a+"}":""}function le(e){var r=M(e);return function(a,c,n,t){var s="";for(var u=0;u<r;u++)s+=e[u](a,c,n,t)||"";return s}}function ve(e){return function(r){if(!r.root)if(r=r.return)e(r)}}function he(c,s,u,i){if(c.length>-1)if(!c.return)switch(c.type){case t:c.return=ie(c.value,c.length);break;case p:return fe([J(c,{value:j(c.value,"@","@"+a)})],i);case n:if(c.length)return q(c.props,(function(n){switch(y(n,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return fe([J(c,{props:[j(n,/:(read-\w+)/,":"+r+"$1")]})],i);case"::placeholder":return fe([J(c,{props:[j(n,/:(plac\w+)/,":"+a+"input-$1")]}),J(c,{props:[j(n,/:(plac\w+)/,":"+r+"$1")]}),J(c,{props:[j(n,/:(plac\w+)/,e+"input-$1")]})],i)}return""}))}}function pe(e){switch(e.type){case n:e.props=e.props.map((function(r){return q(X(r),(function(r,a,c){switch(z(r,0)){case 12:return A(r,1,O(r));case 0:case 40:case 43:case 62:case 126:return r;case 58:if(c[++a]==="global")c[a]="",c[++a]="\f"+A(c[a],a=1,-1);case 32:return a===1?"":r;default:switch(a){case 0:e=r;return M(c)>1?"":r;case a=M(c)-1:case 2:return a===2?r+e+e:r+e;default:return r}}}))}))}}
-//# sourceMappingURL=stylis.mjs.map
-
-// EXTERNAL MODULE: ./node_modules/@emotion/weak-memoize/dist/weak-memoize.browser.esm.js
-var weak_memoize_browser_esm = __webpack_require__("gRFL");
-
-// EXTERNAL MODULE: ./node_modules/@emotion/memoize/dist/emotion-memoize.browser.esm.js
-var emotion_memoize_browser_esm = __webpack_require__("SVgp");
-
-// CONCATENATED MODULE: ./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js
-
-
-
-
-
-var last = function last(arr) {
- return arr.length ? arr[arr.length - 1] : null;
-}; // based on https://github.com/thysultan/stylis.js/blob/e6843c373ebcbbfade25ebcc23f540ed8508da0a/src/Tokenizer.js#L239-L244
-
-
-var emotion_cache_browser_esm_identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
- var previous = 0;
- var character = 0;
-
- while (true) {
- previous = character;
- character = P(); // &\f
-
- if (previous === 38 && character === 12) {
- points[index] = 1;
- }
-
- if (T(character)) {
- break;
- }
-
- N();
- }
-
- return R(begin, F);
-};
-
-var emotion_cache_browser_esm_toRules = function toRules(parsed, points) {
- // pretend we've started with a comma
- var index = -1;
- var character = 44;
-
- do {
- switch (T(character)) {
- case 0:
- // &\f
- if (character === 38 && P() === 12) {
- // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
- // stylis inserts \f after & to know when & where it should replace this sequence with the context selector
- // and when it should just concatenate the outer and inner selectors
- // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
- points[index] = 1;
- }
-
- parsed[index] += emotion_cache_browser_esm_identifierWithPointTracking(F - 1, points, index);
- break;
-
- case 2:
- parsed[index] += W(character);
- break;
- case 4:
- // comma
- if (character === 44) {
- // colon
- parsed[++index] = P() === 58 ? '&\f' : '';
- points[index] = parsed[index].length;
- break;
- }
+function noop() {
+ return null;
+}
- // fallthrough
+noop.isRequired = noop;
- default:
- parsed[index] += d(character);
- }
- } while (character = N());
+function noopThunk() {
+ return noop;
+}
- return parsed;
+module.exports = {
+ and: noopThunk,
+ between: noopThunk,
+ booleanSome: noopThunk,
+ childrenHavePropXorChildren: noopThunk,
+ childrenOf: noopThunk,
+ childrenOfType: noopThunk,
+ childrenSequenceOf: noopThunk,
+ componentWithName: noopThunk,
+ disallowedIf: noopThunk,
+ elementType: noopThunk,
+ empty: noopThunk,
+ explicitNull: noopThunk,
+ forbidExtraProps: Object,
+ integer: noopThunk,
+ keysOf: noopThunk,
+ mutuallyExclusiveProps: noopThunk,
+ mutuallyExclusiveTrueProps: noopThunk,
+ nChildren: noopThunk,
+ nonNegativeInteger: noop,
+ nonNegativeNumber: noopThunk,
+ numericString: noopThunk,
+ object: noopThunk,
+ or: noopThunk,
+ predicate: noopThunk,
+ range: noopThunk,
+ ref: noopThunk,
+ requiredBy: noopThunk,
+ restrictedProp: noopThunk,
+ sequenceOf: noopThunk,
+ shape: noopThunk,
+ stringEndsWith: noopThunk,
+ stringStartsWith: noopThunk,
+ uniqueArray: noopThunk,
+ uniqueArrayOf: noopThunk,
+ valuesOf: noopThunk,
+ withShape: noopThunk
};
-var emotion_cache_browser_esm_getRules = function getRules(value, points) {
- return V(emotion_cache_browser_esm_toRules(U(value), points));
-}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
-
-
-var fixedElements = /* #__PURE__ */new WeakMap();
-var compat = function compat(element) {
- if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
- // negative .length indicates that this rule has been already prefixed
- element.length < 1) {
- return;
- }
-
- var value = element.value,
- parent = element.parent;
- var isImplicitRule = element.column === parent.column && element.line === parent.line;
-
- while (parent.type !== 'rule') {
- parent = parent.parent;
- if (!parent) return;
- } // short-circuit for the simplest case
-
-
- if (element.props.length === 1 && value.charCodeAt(0) !== 58
- /* colon */
- && !fixedElements.get(parent)) {
- return;
- } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
- // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
-
-
- if (isImplicitRule) {
- return;
- }
-
- fixedElements.set(element, true);
- var points = [];
- var rules = emotion_cache_browser_esm_getRules(value, points);
- var parentRules = parent.props;
-
- for (var i = 0, k = 0; i < rules.length; i++) {
- for (var j = 0; j < parentRules.length; j++, k++) {
- element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
- }
- }
-};
-var removeLabel = function removeLabel(element) {
- if (element.type === 'decl') {
- var value = element.value;
- if ( // charcode for l
- value.charCodeAt(0) === 108 && // charcode for b
- value.charCodeAt(2) === 98) {
- // this ignores label
- element["return"] = '';
- element.value = '';
- }
- }
-};
-var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
+/***/ }),
-var isIgnoringComment = function isIgnoringComment(element) {
- return !!element && element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
-};
+/***/ 4882:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
- return function (element, index, children) {
- if (element.type !== 'rule') return;
- var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
+module.exports = true ? __webpack_require__(5096) : 0;
- if (unsafePseudoClasses && cache.compat !== true) {
- var prevElement = index > 0 ? children[index - 1] : null;
- if (prevElement && isIgnoringComment(last(prevElement.children))) {
- return;
- }
- unsafePseudoClasses.forEach(function (unsafePseudoClass) {
- console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
- });
- }
- };
-};
+/***/ }),
-var isImportRule = function isImportRule(element) {
- return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
-};
+/***/ 4485:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {
- for (var i = index - 1; i >= 0; i--) {
- if (!isImportRule(children[i])) {
- return true;
- }
- }
+"use strict";
- return false;
-}; // use this to remove incorrect elements from further processing
-// so they don't get handed to the `sheet` (or anything else)
-// as that could potentially lead to additional logs which in turn could be overhelming to the user
+var ArraySpeciesCreate = __webpack_require__(1539);
+var FlattenIntoArray = __webpack_require__(6739);
+var Get = __webpack_require__(6448);
+var ToIntegerOrInfinity = __webpack_require__(1723);
+var ToLength = __webpack_require__(6840);
+var ToObject = __webpack_require__(1283);
-var nullifyElement = function nullifyElement(element) {
- element.type = '';
- element.value = '';
- element["return"] = '';
- element.children = '';
- element.props = '';
-};
+module.exports = function flat() {
+ var O = ToObject(this);
+ var sourceLen = ToLength(Get(O, 'length'));
-var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {
- if (!isImportRule(element)) {
- return;
- }
+ var depthNum = 1;
+ if (arguments.length > 0 && typeof arguments[0] !== 'undefined') {
+ depthNum = ToIntegerOrInfinity(arguments[0]);
+ }
- if (element.parent) {
- console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
- nullifyElement(element);
- } else if (isPrependedWithRegularRules(index, children)) {
- console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
- nullifyElement(element);
- }
+ var A = ArraySpeciesCreate(O, 0);
+ FlattenIntoArray(A, O, sourceLen, 0, depthNum);
+ return A;
};
-var defaultStylisPlugins = [he];
-
-var emotion_cache_browser_esm_createCache = function createCache(options) {
- var key = options.key;
-
- if (false) {}
-
- if ( key === 'css') {
- var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
- // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
- // note this very very intentionally targets all style elements regardless of the key to ensure
- // that creating a cache works inside of render of a React component
-
- Array.prototype.forEach.call(ssrStyles, function (node) {
- // we want to only move elements which have a space in the data-emotion attribute value
- // because that indicates that it is an Emotion 11 server-side rendered style elements
- // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
- // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
- // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
- // will not result in the Emotion 10 styles being destroyed
- var dataEmotionAttribute = node.getAttribute('data-emotion');
- if (dataEmotionAttribute.indexOf(' ') === -1) {
- return;
- }
- document.head.appendChild(node);
- node.setAttribute('data-s', '');
- });
- }
+/***/ }),
- var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
+/***/ 116:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- if (false) {}
+"use strict";
- var inserted = {}; // $FlowFixMe
- var container;
- var nodesToHydrate = [];
+var define = __webpack_require__(9170);
+var callBind = __webpack_require__(9961);
- {
- container = options.container || document.head;
- Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
- // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
- document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
- var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe
+var implementation = __webpack_require__(4485);
+var getPolyfill = __webpack_require__(616);
+var polyfill = getPolyfill();
+var shim = __webpack_require__(2059);
- for (var i = 1; i < attrib.length; i++) {
- inserted[attrib[i]] = true;
- }
+var boundFlat = callBind(polyfill);
- nodesToHydrate.push(node);
- });
- }
+define(boundFlat, {
+ getPolyfill: getPolyfill,
+ implementation: implementation,
+ shim: shim
+});
- var _insert;
+module.exports = boundFlat;
- var omnipresentPlugins = [compat, removeLabel];
- if (false) {}
+/***/ }),
- {
- var currentSheet;
- var finalizingPlugins = [oe, false ? undefined : ve(function (rule) {
- currentSheet.insert(rule);
- })];
- var serializer = le(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
+/***/ 9630:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- var stylis = function stylis(styles) {
- return fe(ce(styles), serializer);
- };
+"use strict";
- _insert = function insert(selector, serialized, sheet, shouldCache) {
- currentSheet = sheet;
- if (false) {}
+var GetIntrinsic = __webpack_require__(1801);
- stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
+var callBind = __webpack_require__(9961);
- if (shouldCache) {
- cache.inserted[serialized.name] = true;
- }
- };
- }
+var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
- var cache = {
- key: key,
- sheet: new emotion_sheet_browser_esm["a" /* StyleSheet */]({
- key: key,
- container: container,
- nonce: options.nonce,
- speedy: options.speedy,
- prepend: options.prepend,
- insertionPoint: options.insertionPoint
- }),
- nonce: options.nonce,
- inserted: inserted,
- registered: {},
- insert: _insert
- };
- cache.sheet.hydrate(nodesToHydrate);
- return cache;
+module.exports = function callBoundIntrinsic(name, allowMissing) {
+ var intrinsic = GetIntrinsic(name, !!allowMissing);
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
+ return callBind(intrinsic);
+ }
+ return intrinsic;
};
-/* harmony default export */ var emotion_cache_browser_esm = __webpack_exports__["a"] = (emotion_cache_browser_esm_createCache);
-
/***/ }),
-/***/ "+51k":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 9961:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports['default'] = getActiveElement;
-function getActiveElement() {
- return typeof document !== 'undefined' && document.activeElement;
-}
-
-/***/ }),
+var bind = __webpack_require__(1930);
+var GetIntrinsic = __webpack_require__(1801);
-/***/ "+WFq":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+var $apply = GetIntrinsic('%Function.prototype.apply%');
+var $call = GetIntrinsic('%Function.prototype.call%');
+var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useSlot; });
-/* 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 _slot_fill_context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("JYkG");
-// @ts-nocheck
+var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
+var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
+var $max = GetIntrinsic('%Math.max%');
-/**
- * WordPress dependencies
- */
+if ($defineProperty) {
+ try {
+ $defineProperty({}, 'a', { value: 1 });
+ } catch (e) {
+ // IE 8 has a broken defineProperty
+ $defineProperty = null;
+ }
+}
-/**
- * Internal dependencies
- */
+module.exports = function callBind(originalFunction) {
+ var func = $reflectApply(bind, $call, arguments);
+ if ($gOPD && $defineProperty) {
+ var desc = $gOPD(func, 'length');
+ if (desc.configurable) {
+ // original length, plus the receiver, minus any additional arguments (after the receiver)
+ $defineProperty(
+ func,
+ 'length',
+ { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
+ );
+ }
+ }
+ return func;
+};
+var applyBind = function applyBind() {
+ return $reflectApply(bind, $apply, arguments);
+};
-function useSlot(name) {
- const registry = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useContext"])(_slot_fill_context__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"]);
- const slot = registry.slots[name] || {};
- const slotFills = registry.fills[name];
- const fills = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(() => slotFills || [], [slotFills]);
- const updateSlot = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(fillProps => {
- registry.updateSlot(name, fillProps);
- }, [name, registry.updateSlot]);
- const unregisterSlot = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(slotRef => {
- registry.unregisterSlot(name, slotRef);
- }, [name, registry.unregisterSlot]);
- const registerFill = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(fillRef => {
- registry.registerFill(name, fillRef);
- }, [name, registry.registerFill]);
- const unregisterFill = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(fillRef => {
- registry.unregisterFill(name, fillRef);
- }, [name, registry.unregisterFill]);
- return { ...slot,
- updateSlot,
- unregisterSlot,
- fills,
- registerFill,
- unregisterFill
- };
+if ($defineProperty) {
+ $defineProperty(module.exports, 'apply', { value: applyBind });
+} else {
+ module.exports.apply = applyBind;
}
/***/ }),
-/***/ "+ipW":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 4219:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return canUseDOM; });
-/* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("SyVe");
-
-
-
-function checkIsBrowser() {
- var _window = Object(_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[/* getWindow */ "a"])();
-
- return Boolean(typeof _window !== "undefined" && _window.document && _window.document.createElement);
-}
-/**
- * It's `true` if it is running in a browser environment or `false` if it is not (SSR).
- *
- * @example
- * import { canUseDOM } from "reakit-utils";
- *
- * const title = canUseDOM ? document.title : "";
- */
-
-
-var canUseDOM = checkIsBrowser();
-
-
-/***/ }),
-
-/***/ "/9aa":
-/***/ (function(module, exports, __webpack_require__) {
+var undefined;
-var baseGetTag = __webpack_require__("NykK"),
- isObjectLike = __webpack_require__("ExA7");
+var $SyntaxError = SyntaxError;
+var $Function = Function;
+var $TypeError = TypeError;
-/** `Object#toString` result references. */
-var symbolTag = '[object Symbol]';
+// eslint-disable-next-line consistent-return
+var getEvalledConstructor = function (expressionSyntax) {
+ try {
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
+ } catch (e) {}
+};
-/**
- * Checks if `value` is classified as a `Symbol` primitive or object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
- * @example
- *
- * _.isSymbol(Symbol.iterator);
- * // => true
- *
- * _.isSymbol('abc');
- * // => false
- */
-function isSymbol(value) {
- return typeof value == 'symbol' ||
- (isObjectLike(value) && baseGetTag(value) == symbolTag);
+var $gOPD = Object.getOwnPropertyDescriptor;
+if ($gOPD) {
+ try {
+ $gOPD({}, '');
+ } catch (e) {
+ $gOPD = null; // this is IE 8, which has a broken gOPD
+ }
}
-module.exports = isSymbol;
+var throwTypeError = function () {
+ throw new $TypeError();
+};
+var ThrowTypeError = $gOPD
+ ? (function () {
+ try {
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
+ arguments.callee; // IE 8 does not throw here
+ return throwTypeError;
+ } catch (calleeThrows) {
+ try {
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
+ return $gOPD(arguments, 'callee').get;
+ } catch (gOPDthrows) {
+ return throwTypeError;
+ }
+ }
+ }())
+ : throwTypeError;
+var hasSymbols = __webpack_require__(9828)();
-/***/ }),
+var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
-/***/ "/A+k":
-/***/ (function(module, exports, __webpack_require__) {
+var needsEval = {};
-"use strict";
-
-
-var GetIntrinsic = __webpack_require__("j1Hc");
-
-var $TypeError = GetIntrinsic('%TypeError%');
-
-var Get = __webpack_require__("aBsX");
-var ToLength = __webpack_require__("3HW2");
-var Type = __webpack_require__("PoQ0");
-
-// https://262.ecma-international.org/11.0/#sec-lengthofarraylike
+var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
-module.exports = function LengthOfArrayLike(obj) {
- if (Type(obj) !== 'Object') {
- throw new $TypeError('Assertion failed: `obj` must be an Object');
- }
- return ToLength(Get(obj, 'length'));
+var INTRINSICS = {
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
+ '%Array%': Array,
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
+ '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
+ '%AsyncFromSyncIteratorPrototype%': undefined,
+ '%AsyncFunction%': needsEval,
+ '%AsyncGenerator%': needsEval,
+ '%AsyncGeneratorFunction%': needsEval,
+ '%AsyncIteratorPrototype%': needsEval,
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
+ '%Boolean%': Boolean,
+ '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
+ '%Date%': Date,
+ '%decodeURI%': decodeURI,
+ '%decodeURIComponent%': decodeURIComponent,
+ '%encodeURI%': encodeURI,
+ '%encodeURIComponent%': encodeURIComponent,
+ '%Error%': Error,
+ '%eval%': eval, // eslint-disable-line no-eval
+ '%EvalError%': EvalError,
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
+ '%Function%': $Function,
+ '%GeneratorFunction%': needsEval,
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
+ '%isFinite%': isFinite,
+ '%isNaN%': isNaN,
+ '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined,
+ '%Map%': typeof Map === 'undefined' ? undefined : Map,
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
+ '%Math%': Math,
+ '%Number%': Number,
+ '%Object%': Object,
+ '%parseFloat%': parseFloat,
+ '%parseInt%': parseInt,
+ '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
+ '%RangeError%': RangeError,
+ '%ReferenceError%': ReferenceError,
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
+ '%RegExp%': RegExp,
+ '%Set%': typeof Set === 'undefined' ? undefined : Set,
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
+ '%String%': String,
+ '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
+ '%Symbol%': hasSymbols ? Symbol : undefined,
+ '%SyntaxError%': $SyntaxError,
+ '%ThrowTypeError%': ThrowTypeError,
+ '%TypedArray%': TypedArray,
+ '%TypeError%': $TypeError,
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
+ '%URIError%': URIError,
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
};
-// TODO: use this all over
-
-
-/***/ }),
-
-/***/ "/ZKw":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
+var doEval = function doEval(name) {
+ var value;
+ if (name === '%AsyncFunction%') {
+ value = getEvalledConstructor('async function () {}');
+ } else if (name === '%GeneratorFunction%') {
+ value = getEvalledConstructor('function* () {}');
+ } else if (name === '%AsyncGeneratorFunction%') {
+ value = getEvalledConstructor('async function* () {}');
+ } else if (name === '%AsyncGenerator%') {
+ var fn = doEval('%AsyncGeneratorFunction%');
+ if (fn) {
+ value = fn.prototype;
+ }
+ } else if (name === '%AsyncIteratorPrototype%') {
+ var gen = doEval('%AsyncGenerator%');
+ if (gen) {
+ value = getProto(gen.prototype);
+ }
+ }
+ INTRINSICS[name] = value;
-var define = __webpack_require__("82c2");
-var callBind = __webpack_require__("SLit");
+ return value;
+};
-var implementation = __webpack_require__("yN6O");
-var getPolyfill = __webpack_require__("22yB");
-var polyfill = getPolyfill();
-var shim = __webpack_require__("v3P4");
+var LEGACY_ALIASES = {
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
+ '%ArrayPrototype%': ['Array', 'prototype'],
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
+ '%DataViewPrototype%': ['DataView', 'prototype'],
+ '%DatePrototype%': ['Date', 'prototype'],
+ '%ErrorPrototype%': ['Error', 'prototype'],
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
+ '%FunctionPrototype%': ['Function', 'prototype'],
+ '%Generator%': ['GeneratorFunction', 'prototype'],
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
+ '%JSONParse%': ['JSON', 'parse'],
+ '%JSONStringify%': ['JSON', 'stringify'],
+ '%MapPrototype%': ['Map', 'prototype'],
+ '%NumberPrototype%': ['Number', 'prototype'],
+ '%ObjectPrototype%': ['Object', 'prototype'],
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
+ '%PromisePrototype%': ['Promise', 'prototype'],
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
+ '%Promise_all%': ['Promise', 'all'],
+ '%Promise_reject%': ['Promise', 'reject'],
+ '%Promise_resolve%': ['Promise', 'resolve'],
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
+ '%SetPrototype%': ['Set', 'prototype'],
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
+ '%StringPrototype%': ['String', 'prototype'],
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
+};
-var boundFlat = callBind(polyfill);
+var bind = __webpack_require__(1930);
+var hasOwn = __webpack_require__(9284);
+var $concat = bind.call(Function.call, Array.prototype.concat);
+var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
+var $replace = bind.call(Function.call, String.prototype.replace);
+var $strSlice = bind.call(Function.call, String.prototype.slice);
-define(boundFlat, {
- getPolyfill: getPolyfill,
- implementation: implementation,
- shim: shim
-});
+/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
+var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
+var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
+var stringToPath = function stringToPath(string) {
+ var first = $strSlice(string, 0, 1);
+ var last = $strSlice(string, -1);
+ if (first === '%' && last !== '%') {
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
+ } else if (last === '%' && first !== '%') {
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
+ }
+ var result = [];
+ $replace(string, rePropName, function (match, number, quote, subString) {
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
+ });
+ return result;
+};
+/* end adaptation */
-module.exports = boundFlat;
+var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
+ var intrinsicName = name;
+ var alias;
+ if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
+ alias = LEGACY_ALIASES[intrinsicName];
+ intrinsicName = '%' + alias[0] + '%';
+ }
+ if (hasOwn(INTRINSICS, intrinsicName)) {
+ var value = INTRINSICS[intrinsicName];
+ if (value === needsEval) {
+ value = doEval(intrinsicName);
+ }
+ if (typeof value === 'undefined' && !allowMissing) {
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
+ }
-/***/ }),
+ return {
+ alias: alias,
+ name: intrinsicName,
+ value: value
+ };
+ }
-/***/ "/sVA":
-/***/ (function(module, exports, __webpack_require__) {
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
+};
-"use strict";
+module.exports = function GetIntrinsic(name, allowMissing) {
+ if (typeof name !== 'string' || name.length === 0) {
+ throw new $TypeError('intrinsic name must be a non-empty string');
+ }
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
+ throw new $TypeError('"allowMissing" argument must be a boolean');
+ }
+ var parts = stringToPath(name);
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
-var toStr = Object.prototype.toString;
-var hasSymbols = __webpack_require__("UVaH")();
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
+ var intrinsicRealName = intrinsic.name;
+ var value = intrinsic.value;
+ var skipFurtherCaching = false;
-if (hasSymbols) {
- var symToStr = Symbol.prototype.toString;
- var symStringRegex = /^Symbol\(.*\)$/;
- var isSymbolObject = function isRealSymbolObject(value) {
- if (typeof value.valueOf() !== 'symbol') {
- return false;
- }
- return symStringRegex.test(symToStr.call(value));
- };
+ var alias = intrinsic.alias;
+ if (alias) {
+ intrinsicBaseName = alias[0];
+ $spliceApply(parts, $concat([0, 1], alias));
+ }
- module.exports = function isSymbol(value) {
- if (typeof value === 'symbol') {
- return true;
- }
- if (toStr.call(value) !== '[object Symbol]') {
- return false;
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
+ var part = parts[i];
+ var first = $strSlice(part, 0, 1);
+ var last = $strSlice(part, -1);
+ if (
+ (
+ (first === '"' || first === "'" || first === '`')
+ || (last === '"' || last === "'" || last === '`')
+ )
+ && first !== last
+ ) {
+ throw new $SyntaxError('property names with quotes must have matching quotes');
}
- try {
- return isSymbolObject(value);
- } catch (e) {
- return false;
+ if (part === 'constructor' || !isOwn) {
+ skipFurtherCaching = true;
}
- };
-} else {
- module.exports = function isSymbol(value) {
- // this environment does not support Symbols.
- return false && false;
- };
-}
+ intrinsicBaseName += '.' + part;
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
+ if (hasOwn(INTRINSICS, intrinsicRealName)) {
+ value = INTRINSICS[intrinsicRealName];
+ } else if (value != null) {
+ if (!(part in value)) {
+ if (!allowMissing) {
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
+ }
+ return void undefined;
+ }
+ if ($gOPD && (i + 1) >= parts.length) {
+ var desc = $gOPD(value, part);
+ isOwn = !!desc;
-/***/ }),
+ // By convention, when a data property is converted to an accessor
+ // property to emulate a data property that does not suffer from
+ // the override mistake, that accessor's getter is marked with
+ // an `originalValue` property. Here, when we detect this, we
+ // uphold the illusion by pretending to see that original data
+ // property, i.e., returning the value rather than the getter
+ // itself.
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
+ value = desc.get;
+ } else {
+ value = value[part];
+ }
+ } else {
+ isOwn = hasOwn(value, part);
+ value = value[part];
+ }
-/***/ 0:
-/***/ (function(module, exports) {
+ if (isOwn && !skipFurtherCaching) {
+ INTRINSICS[intrinsicRealName] = value;
+ }
+ }
+ }
+ return value;
+};
-/* (ignored) */
/***/ }),
-/***/ "030x":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 9828:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-var styleInterface = void 0;
-var styleTheme = void 0;
-
-var START_MARK = 'react-with-styles.resolve.start';
-var END_MARK = 'react-with-styles.resolve.end';
-var MEASURE_MARK = '\uD83D\uDC69\u200D\uD83C\uDFA8 [resolve]';
-
-function registerTheme(theme) {
- styleTheme = theme;
-}
+var origSymbol = typeof Symbol !== 'undefined' && Symbol;
+var hasSymbolSham = __webpack_require__(5960);
-function registerInterface(interfaceToRegister) {
- styleInterface = interfaceToRegister;
-}
+module.exports = function hasNativeSymbols() {
+ if (typeof origSymbol !== 'function') { return false; }
+ if (typeof Symbol !== 'function') { return false; }
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
-function create(makeFromTheme, createWithDirection) {
- var styles = createWithDirection(makeFromTheme(styleTheme));
- return function () {
- return styles;
- };
-}
+ return hasSymbolSham();
+};
-function createLTR(makeFromTheme) {
- return create(makeFromTheme, styleInterface.createLTR || styleInterface.create);
-}
-function createRTL(makeFromTheme) {
- return create(makeFromTheme, styleInterface.createRTL || styleInterface.create);
-}
+/***/ }),
-function get() {
- return styleTheme;
-}
+/***/ 5960:
+/***/ (function(module) {
-function resolve() {
- if (false) {}
+"use strict";
- for (var _len = arguments.length, styles = Array(_len), _key = 0; _key < _len; _key++) {
- styles[_key] = arguments[_key];
- }
- var result = styleInterface.resolve(styles);
+/* eslint complexity: [2, 18], max-statements: [2, 33] */
+module.exports = function hasSymbols() {
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
+ if (typeof Symbol.iterator === 'symbol') { return true; }
- if (false) {}
+ var obj = {};
+ var sym = Symbol('test');
+ var symObj = Object(sym);
+ if (typeof sym === 'string') { return false; }
- return result;
-}
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
-function resolveLTR() {
- for (var _len2 = arguments.length, styles = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- styles[_key2] = arguments[_key2];
- }
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
+ // if (sym instanceof Symbol) { return false; }
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
+ // if (!(symObj instanceof Symbol)) { return false; }
- if (styleInterface.resolveLTR) {
- return styleInterface.resolveLTR(styles);
- }
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
- return resolve(styles);
-}
+ var symVal = 42;
+ obj[sym] = symVal;
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
-function resolveRTL() {
- for (var _len3 = arguments.length, styles = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
- styles[_key3] = arguments[_key3];
- }
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
- if (styleInterface.resolveRTL) {
- return styleInterface.resolveRTL(styles);
- }
+ var syms = Object.getOwnPropertySymbols(obj);
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
- return resolve(styles);
-}
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
-function flush() {
- if (styleInterface.flush) {
- styleInterface.flush();
- }
-}
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
+ }
-exports['default'] = {
- registerTheme: registerTheme,
- registerInterface: registerInterface,
- create: createLTR,
- createLTR: createLTR,
- createRTL: createRTL,
- get: get,
- resolve: resolveLTR,
- resolveLTR: resolveLTR,
- resolveRTL: resolveRTL,
- flush: flush
+ return true;
};
+
/***/ }),
-/***/ "0Dl3":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 4363:
+/***/ (function(module) {
"use strict";
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports['default'] = getNumberOfCalendarMonthWeeks;
-
-var _moment = __webpack_require__("wy2R");
-
-var _moment2 = _interopRequireDefault(_moment);
+var fnToStr = Function.prototype.toString;
+var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
+var badArrayLike;
+var isCallableMarker;
+if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
+ try {
+ badArrayLike = Object.defineProperty({}, 'length', {
+ get: function () {
+ throw isCallableMarker;
+ }
+ });
+ isCallableMarker = {};
+ // eslint-disable-next-line no-throw-literal
+ reflectApply(function () { throw 42; }, null, badArrayLike);
+ } catch (_) {
+ if (_ !== isCallableMarker) {
+ reflectApply = null;
+ }
+ }
+} else {
+ reflectApply = null;
+}
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+var constructorRegex = /^\s*class\b/;
+var isES6ClassFn = function isES6ClassFunction(value) {
+ try {
+ var fnStr = fnToStr.call(value);
+ return constructorRegex.test(fnStr);
+ } catch (e) {
+ return false; // not a function
+ }
+};
-function getBlankDaysBeforeFirstDay(firstDayOfMonth, firstDayOfWeek) {
- var weekDayDiff = firstDayOfMonth.day() - firstDayOfWeek;
- return (weekDayDiff + 7) % 7;
-}
+var tryFunctionObject = function tryFunctionToStr(value) {
+ try {
+ if (isES6ClassFn(value)) { return false; }
+ fnToStr.call(value);
+ return true;
+ } catch (e) {
+ return false;
+ }
+};
+var toStr = Object.prototype.toString;
+var fnClass = '[object Function]';
+var genClass = '[object GeneratorFunction]';
+var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`
+/* globals document: false */
+var documentDotAll = typeof document === 'object' && typeof document.all === 'undefined' && document.all !== undefined ? document.all : {};
-function getNumberOfCalendarMonthWeeks(month) {
- var firstDayOfWeek = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _moment2['default'].localeData().firstDayOfWeek();
+module.exports = reflectApply
+ ? function isCallable(value) {
+ if (value === documentDotAll) { return true; }
+ if (!value) { return false; }
+ if (typeof value !== 'function' && typeof value !== 'object') { return false; }
+ if (typeof value === 'function' && !value.prototype) { return true; }
+ try {
+ reflectApply(value, null, badArrayLike);
+ } catch (e) {
+ if (e !== isCallableMarker) { return false; }
+ }
+ return !isES6ClassFn(value);
+ }
+ : function isCallable(value) {
+ if (value === documentDotAll) { return true; }
+ if (!value) { return false; }
+ if (typeof value !== 'function' && typeof value !== 'object') { return false; }
+ if (typeof value === 'function' && !value.prototype) { return true; }
+ if (hasToStringTag) { return tryFunctionObject(value); }
+ if (isES6ClassFn(value)) { return false; }
+ var strClass = toStr.call(value);
+ return strClass === fnClass || strClass === genClass;
+ };
- var firstDayOfMonth = month.clone().startOf('month');
- var numBlankDays = getBlankDaysBeforeFirstDay(firstDayOfMonth, firstDayOfWeek);
- return Math.ceil((numBlankDays + month.daysInMonth()) / 7);
-}
/***/ }),
-/***/ "0HL0":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 4221:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return setTextFieldValue; });
-/* harmony import */ var reakit_utils_fireEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("qOxZ");
-function setTextFieldValue(element, value) {
- if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) {
- var _Object$getOwnPropert;
+var callBound = __webpack_require__(9630);
+var hasToStringTag = __webpack_require__(4111)();
+var has;
+var $exec;
+var isRegexMarker;
+var badStringifier;
- var proto = Object.getPrototypeOf(element);
- var setValue = (_Object$getOwnPropert = Object.getOwnPropertyDescriptor(proto, "value")) === null || _Object$getOwnPropert === void 0 ? void 0 : _Object$getOwnPropert.set;
+if (hasToStringTag) {
+ has = callBound('Object.prototype.hasOwnProperty');
+ $exec = callBound('RegExp.prototype.exec');
+ isRegexMarker = {};
- if (setValue) {
- setValue.call(element, value);
- Object(reakit_utils_fireEvent__WEBPACK_IMPORTED_MODULE_0__[/* fireEvent */ "a"])(element, "input", {
- bubbles: true
- });
- }
- }
-}
+ var throwRegexMarker = function () {
+ throw isRegexMarker;
+ };
+ badStringifier = {
+ toString: throwRegexMarker,
+ valueOf: throwRegexMarker
+ };
+ if (typeof Symbol.toPrimitive === 'symbol') {
+ badStringifier[Symbol.toPrimitive] = throwRegexMarker;
+ }
+}
+var $toString = callBound('Object.prototype.toString');
+var gOPD = Object.getOwnPropertyDescriptor;
+var regexClass = '[object RegExp]';
+module.exports = hasToStringTag
+ // eslint-disable-next-line consistent-return
+ ? function isRegex(value) {
+ if (!value || typeof value !== 'object') {
+ return false;
+ }
-/***/ }),
+ var descriptor = gOPD(value, 'lastIndex');
+ var hasLastIndexDataProperty = descriptor && has(descriptor, 'value');
+ if (!hasLastIndexDataProperty) {
+ return false;
+ }
-/***/ "0XP8":
-/***/ (function(module, exports, __webpack_require__) {
+ try {
+ $exec(value, badStringifier);
+ } catch (e) {
+ return e === isRegexMarker;
+ }
+ }
+ : function isRegex(value) {
+ // In older browsers, typeof regex incorrectly returns 'function'
+ if (!value || (typeof value !== 'object' && typeof value !== 'function')) {
+ return false;
+ }
-"use strict";
+ return $toString(value) === regexClass;
+ };
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+/***/ }),
-var _react = __webpack_require__("cDcd");
+/***/ 3205:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-var _react2 = _interopRequireDefault(_react);
+var hasMap = typeof Map === 'function' && Map.prototype;
+var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
+var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
+var mapForEach = hasMap && Map.prototype.forEach;
+var hasSet = typeof Set === 'function' && Set.prototype;
+var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
+var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
+var setForEach = hasSet && Set.prototype.forEach;
+var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
+var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
+var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
+var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
+var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
+var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
+var booleanValueOf = Boolean.prototype.valueOf;
+var objectToString = Object.prototype.toString;
+var functionToString = Function.prototype.toString;
+var $match = String.prototype.match;
+var $slice = String.prototype.slice;
+var $replace = String.prototype.replace;
+var $toUpperCase = String.prototype.toUpperCase;
+var $toLowerCase = String.prototype.toLowerCase;
+var $test = RegExp.prototype.test;
+var $concat = Array.prototype.concat;
+var $join = Array.prototype.join;
+var $arrSlice = Array.prototype.slice;
+var $floor = Math.floor;
+var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
+var gOPS = Object.getOwnPropertySymbols;
+var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
+var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
+// ie, `has-tostringtag/shams
+var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
+ ? Symbol.toStringTag
+ : null;
+var isEnumerable = Object.prototype.propertyIsEnumerable;
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
+ [].__proto__ === Array.prototype // eslint-disable-line no-proto
+ ? function (O) {
+ return O.__proto__; // eslint-disable-line no-proto
+ }
+ : null
+);
-var LeftArrow = function () {
- function LeftArrow(props) {
- return _react2['default'].createElement(
- 'svg',
- props,
- _react2['default'].createElement('path', {
- d: 'M336.2 274.5l-210.1 210h805.4c13 0 23 10 23 23s-10 23-23 23H126.1l210.1 210.1c11 11 11 21 0 32-5 5-10 7-16 7s-11-2-16-7l-249.1-249c-11-11-11-21 0-32l249.1-249.1c21-21.1 53 10.9 32 32z'
- })
- );
- }
+function addNumericSeparator(num, str) {
+ if (
+ num === Infinity
+ || num === -Infinity
+ || num !== num
+ || (num && num > -1000 && num < 1000)
+ || $test.call(/e/, str)
+ ) {
+ return str;
+ }
+ var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
+ if (typeof num === 'number') {
+ var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
+ if (int !== num) {
+ var intStr = String(int);
+ var dec = $slice.call(str, intStr.length + 1);
+ return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
+ }
+ }
+ return $replace.call(str, sepRegex, '$&_');
+}
- return LeftArrow;
-}();
+var inspectCustom = (__webpack_require__(4080).custom);
+var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
-LeftArrow.defaultProps = {
- viewBox: '0 0 1000 1000'
-};
-exports['default'] = LeftArrow;
+module.exports = function inspect_(obj, options, depth, seen) {
+ var opts = options || {};
-/***/ }),
+ if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
+ throw new TypeError('option "quoteStyle" must be "single" or "double"');
+ }
+ if (
+ has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
+ ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
+ : opts.maxStringLength !== null
+ )
+ ) {
+ throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
+ }
+ var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
+ if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
+ throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
+ }
-/***/ "1+Kn":
-/***/ (function(module, exports, __webpack_require__) {
+ if (
+ has(opts, 'indent')
+ && opts.indent !== null
+ && opts.indent !== '\t'
+ && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
+ ) {
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
+ }
+ if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
+ }
+ var numericSeparator = opts.numericSeparator;
-"use strict";
+ if (typeof obj === 'undefined') {
+ return 'undefined';
+ }
+ if (obj === null) {
+ return 'null';
+ }
+ if (typeof obj === 'boolean') {
+ return obj ? 'true' : 'false';
+ }
+ if (typeof obj === 'string') {
+ return inspectString(obj, opts);
+ }
+ if (typeof obj === 'number') {
+ if (obj === 0) {
+ return Infinity / obj > 0 ? '0' : '-0';
+ }
+ var str = String(obj);
+ return numericSeparator ? addNumericSeparator(obj, str) : str;
+ }
+ if (typeof obj === 'bigint') {
+ var bigIntStr = String(obj) + 'n';
+ return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
+ }
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.BOTTOM_RIGHT = exports.TOP_RIGHT = exports.TOP_LEFT = undefined;
+ var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
+ if (typeof depth === 'undefined') { depth = 0; }
+ if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
+ return isArray(obj) ? '[Array]' : '[Object]';
+ }
-var _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; };
+ var indent = getIndent(opts, depth);
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+ if (typeof seen === 'undefined') {
+ seen = [];
+ } else if (indexOf(seen, obj) >= 0) {
+ return '[Circular]';
+ }
-var _object = __webpack_require__("Koq/");
+ function inspect(value, from, noIndent) {
+ if (from) {
+ seen = $arrSlice.call(seen);
+ seen.push(from);
+ }
+ if (noIndent) {
+ var newOpts = {
+ depth: opts.depth
+ };
+ if (has(opts, 'quoteStyle')) {
+ newOpts.quoteStyle = opts.quoteStyle;
+ }
+ return inspect_(value, newOpts, depth + 1, seen);
+ }
+ return inspect_(value, opts, depth + 1, seen);
+ }
-var _object2 = _interopRequireDefault(_object);
+ if (typeof obj === 'function') {
+ var name = nameOf(obj);
+ var keys = arrObjKeys(obj, inspect);
+ return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
+ }
+ if (isSymbol(obj)) {
+ var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
+ return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
+ }
+ if (isElement(obj)) {
+ var s = '<' + $toLowerCase.call(String(obj.nodeName));
+ var attrs = obj.attributes || [];
+ for (var i = 0; i < attrs.length; i++) {
+ s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
+ }
+ s += '>';
+ if (obj.childNodes && obj.childNodes.length) { s += '...'; }
+ s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
+ return s;
+ }
+ if (isArray(obj)) {
+ if (obj.length === 0) { return '[]'; }
+ var xs = arrObjKeys(obj, inspect);
+ if (indent && !singleLineValues(xs)) {
+ return '[' + indentedJoin(xs, indent) + ']';
+ }
+ return '[ ' + $join.call(xs, ', ') + ' ]';
+ }
+ if (isError(obj)) {
+ var parts = arrObjKeys(obj, inspect);
+ if ('cause' in obj && !isEnumerable.call(obj, 'cause')) {
+ return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
+ }
+ if (parts.length === 0) { return '[' + String(obj) + ']'; }
+ return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
+ }
+ if (typeof obj === 'object' && customInspect) {
+ if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
+ return obj[inspectSymbol]();
+ } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
+ return obj.inspect();
+ }
+ }
+ if (isMap(obj)) {
+ var mapParts = [];
+ mapForEach.call(obj, function (value, key) {
+ mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
+ });
+ return collectionOf('Map', mapSize.call(obj), mapParts, indent);
+ }
+ if (isSet(obj)) {
+ var setParts = [];
+ setForEach.call(obj, function (value) {
+ setParts.push(inspect(value, obj));
+ });
+ return collectionOf('Set', setSize.call(obj), setParts, indent);
+ }
+ if (isWeakMap(obj)) {
+ return weakCollectionOf('WeakMap');
+ }
+ if (isWeakSet(obj)) {
+ return weakCollectionOf('WeakSet');
+ }
+ if (isWeakRef(obj)) {
+ return weakCollectionOf('WeakRef');
+ }
+ if (isNumber(obj)) {
+ return markBoxed(inspect(Number(obj)));
+ }
+ if (isBigInt(obj)) {
+ return markBoxed(inspect(bigIntValueOf.call(obj)));
+ }
+ if (isBoolean(obj)) {
+ return markBoxed(booleanValueOf.call(obj));
+ }
+ if (isString(obj)) {
+ return markBoxed(inspect(String(obj)));
+ }
+ if (!isDate(obj) && !isRegExp(obj)) {
+ var ys = arrObjKeys(obj, inspect);
+ var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
+ var protoTag = obj instanceof Object ? '' : 'null prototype';
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
+ var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
+ var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
+ if (ys.length === 0) { return tag + '{}'; }
+ if (indent) {
+ return tag + '{' + indentedJoin(ys, indent) + '}';
+ }
+ return tag + '{ ' + $join.call(ys, ', ') + ' }';
+ }
+ return String(obj);
+};
-var _react = __webpack_require__("cDcd");
+function wrapQuotes(s, defaultStyle, opts) {
+ var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
+ return quoteChar + s + quoteChar;
+}
-var _react2 = _interopRequireDefault(_react);
+function quote(s) {
+ return $replace.call(String(s), /"/g, '"');
+}
-var _propTypes = __webpack_require__("17x9");
+function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
+function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
+function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
+function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
+function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
+function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
+function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
-var _propTypes2 = _interopRequireDefault(_propTypes);
+// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
+function isSymbol(obj) {
+ if (hasShammedSymbols) {
+ return obj && typeof obj === 'object' && obj instanceof Symbol;
+ }
+ if (typeof obj === 'symbol') {
+ return true;
+ }
+ if (!obj || typeof obj !== 'object' || !symToString) {
+ return false;
+ }
+ try {
+ symToString.call(obj);
+ return true;
+ } catch (e) {}
+ return false;
+}
-var _airbnbPropTypes = __webpack_require__("Hsqg");
+function isBigInt(obj) {
+ if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
+ return false;
+ }
+ try {
+ bigIntValueOf.call(obj);
+ return true;
+ } catch (e) {}
+ return false;
+}
-var _reactWithStyles = __webpack_require__("TG4+");
+var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
+function has(obj, key) {
+ return hasOwn.call(obj, key);
+}
-var _defaultPhrases = __webpack_require__("vV+G");
+function toStr(obj) {
+ return objectToString.call(obj);
+}
-var _getPhrasePropTypes = __webpack_require__("yc2e");
+function nameOf(f) {
+ if (f.name) { return f.name; }
+ var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
+ if (m) { return m[1]; }
+ return null;
+}
-var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
+function indexOf(xs, x) {
+ if (xs.indexOf) { return xs.indexOf(x); }
+ for (var i = 0, l = xs.length; i < l; i++) {
+ if (xs[i] === x) { return i; }
+ }
+ return -1;
+}
-var _KeyboardShortcutRow = __webpack_require__("zN8g");
+function isMap(x) {
+ if (!mapSize || !x || typeof x !== 'object') {
+ return false;
+ }
+ try {
+ mapSize.call(x);
+ try {
+ setSize.call(x);
+ } catch (s) {
+ return true;
+ }
+ return x instanceof Map; // core-js workaround, pre-v2.5.0
+ } catch (e) {}
+ return false;
+}
-var _KeyboardShortcutRow2 = _interopRequireDefault(_KeyboardShortcutRow);
+function isWeakMap(x) {
+ if (!weakMapHas || !x || typeof x !== 'object') {
+ return false;
+ }
+ try {
+ weakMapHas.call(x, weakMapHas);
+ try {
+ weakSetHas.call(x, weakSetHas);
+ } catch (s) {
+ return true;
+ }
+ return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
+ } catch (e) {}
+ return false;
+}
-var _CloseButton = __webpack_require__("xEte");
+function isWeakRef(x) {
+ if (!weakRefDeref || !x || typeof x !== 'object') {
+ return false;
+ }
+ try {
+ weakRefDeref.call(x);
+ return true;
+ } catch (e) {}
+ return false;
+}
-var _CloseButton2 = _interopRequireDefault(_CloseButton);
+function isSet(x) {
+ if (!setSize || !x || typeof x !== 'object') {
+ return false;
+ }
+ try {
+ setSize.call(x);
+ try {
+ mapSize.call(x);
+ } catch (m) {
+ return true;
+ }
+ return x instanceof Set; // core-js workaround, pre-v2.5.0
+ } catch (e) {}
+ return false;
+}
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+function isWeakSet(x) {
+ if (!weakSetHas || !x || typeof x !== 'object') {
+ return false;
+ }
+ try {
+ weakSetHas.call(x, weakSetHas);
+ try {
+ weakMapHas.call(x, weakMapHas);
+ } catch (s) {
+ return true;
+ }
+ return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
+ } catch (e) {}
+ return false;
+}
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+function isElement(x) {
+ if (!x || typeof x !== 'object') { return false; }
+ if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
+ return true;
+ }
+ return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
+}
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+function inspectString(str, opts) {
+ if (str.length > opts.maxStringLength) {
+ var remaining = str.length - opts.maxStringLength;
+ var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
+ return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
+ }
+ // eslint-disable-next-line no-control-regex
+ var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
+ return wrapQuotes(s, 'single', opts);
+}
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+function lowbyte(c) {
+ var n = c.charCodeAt(0);
+ var x = {
+ 8: 'b',
+ 9: 't',
+ 10: 'n',
+ 12: 'f',
+ 13: 'r'
+ }[n];
+ if (x) { return '\\' + x; }
+ return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
+}
-var TOP_LEFT = exports.TOP_LEFT = 'top-left';
-var TOP_RIGHT = exports.TOP_RIGHT = 'top-right';
-var BOTTOM_RIGHT = exports.BOTTOM_RIGHT = 'bottom-right';
+function markBoxed(str) {
+ return 'Object(' + str + ')';
+}
-var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
- block: _propTypes2['default'].bool,
- buttonLocation: _propTypes2['default'].oneOf([TOP_LEFT, TOP_RIGHT, BOTTOM_RIGHT]),
- showKeyboardShortcutsPanel: _propTypes2['default'].bool,
- openKeyboardShortcutsPanel: _propTypes2['default'].func,
- closeKeyboardShortcutsPanel: _propTypes2['default'].func,
- phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerKeyboardShortcutsPhrases))
-}));
+function weakCollectionOf(type) {
+ return type + ' { ? }';
+}
-var defaultProps = {
- block: false,
- buttonLocation: BOTTOM_RIGHT,
- showKeyboardShortcutsPanel: false,
- openKeyboardShortcutsPanel: function () {
- function openKeyboardShortcutsPanel() {}
-
- return openKeyboardShortcutsPanel;
- }(),
- closeKeyboardShortcutsPanel: function () {
- function closeKeyboardShortcutsPanel() {}
-
- return closeKeyboardShortcutsPanel;
- }(),
-
- phrases: _defaultPhrases.DayPickerKeyboardShortcutsPhrases
-};
+function collectionOf(type, size, entries, indent) {
+ var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
+ return type + ' (' + size + ') {' + joinedEntries + '}';
+}
-function getKeyboardShortcuts(phrases) {
- return [{
- unicode: '↵',
- label: phrases.enterKey,
- action: phrases.selectFocusedDate
- }, {
- unicode: '←/→',
- label: phrases.leftArrowRightArrow,
- action: phrases.moveFocusByOneDay
- }, {
- unicode: '↑/↓',
- label: phrases.upArrowDownArrow,
- action: phrases.moveFocusByOneWeek
- }, {
- unicode: 'PgUp/PgDn',
- label: phrases.pageUpPageDown,
- action: phrases.moveFocusByOneMonth
- }, {
- unicode: 'Home/End',
- label: phrases.homeEnd,
- action: phrases.moveFocustoStartAndEndOfWeek
- }, {
- unicode: 'Esc',
- label: phrases.escape,
- action: phrases.returnFocusToInput
- }, {
- unicode: '?',
- label: phrases.questionMark,
- action: phrases.openThisPanel
- }];
+function singleLineValues(xs) {
+ for (var i = 0; i < xs.length; i++) {
+ if (indexOf(xs[i], '\n') >= 0) {
+ return false;
+ }
+ }
+ return true;
}
-var DayPickerKeyboardShortcuts = function (_React$Component) {
- _inherits(DayPickerKeyboardShortcuts, _React$Component);
+function getIndent(opts, depth) {
+ var baseIndent;
+ if (opts.indent === '\t') {
+ baseIndent = '\t';
+ } else if (typeof opts.indent === 'number' && opts.indent > 0) {
+ baseIndent = $join.call(Array(opts.indent + 1), ' ');
+ } else {
+ return null;
+ }
+ return {
+ base: baseIndent,
+ prev: $join.call(Array(depth + 1), baseIndent)
+ };
+}
- function DayPickerKeyboardShortcuts() {
- var _ref;
+function indentedJoin(xs, indent) {
+ if (xs.length === 0) { return ''; }
+ var lineJoiner = '\n' + indent.prev + indent.base;
+ return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
+}
- _classCallCheck(this, DayPickerKeyboardShortcuts);
+function arrObjKeys(obj, inspect) {
+ var isArr = isArray(obj);
+ var xs = [];
+ if (isArr) {
+ xs.length = obj.length;
+ for (var i = 0; i < obj.length; i++) {
+ xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
+ }
+ }
+ var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
+ var symMap;
+ if (hasShammedSymbols) {
+ symMap = {};
+ for (var k = 0; k < syms.length; k++) {
+ symMap['$' + syms[k]] = syms[k];
+ }
+ }
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
+ for (var key in obj) { // eslint-disable-line no-restricted-syntax
+ if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
+ if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
+ if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
+ // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
+ continue; // eslint-disable-line no-restricted-syntax, no-continue
+ } else if ($test.call(/[^\w$]/, key)) {
+ xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
+ } else {
+ xs.push(key + ': ' + inspect(obj[key], obj));
+ }
+ }
+ if (typeof gOPS === 'function') {
+ for (var j = 0; j < syms.length; j++) {
+ if (isEnumerable.call(obj, syms[j])) {
+ xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
+ }
+ }
}
+ return xs;
+}
- var _this = _possibleConstructorReturn(this, (_ref = DayPickerKeyboardShortcuts.__proto__ || Object.getPrototypeOf(DayPickerKeyboardShortcuts)).call.apply(_ref, [this].concat(args)));
- var phrases = _this.props.phrases;
+/***/ }),
- _this.keyboardShortcuts = getKeyboardShortcuts(phrases);
+/***/ 616:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- _this.onShowKeyboardShortcutsButtonClick = _this.onShowKeyboardShortcutsButtonClick.bind(_this);
- _this.setShowKeyboardShortcutsButtonRef = _this.setShowKeyboardShortcutsButtonRef.bind(_this);
- _this.setHideKeyboardShortcutsButtonRef = _this.setHideKeyboardShortcutsButtonRef.bind(_this);
- _this.handleFocus = _this.handleFocus.bind(_this);
- _this.onKeyDown = _this.onKeyDown.bind(_this);
- return _this;
- }
+"use strict";
- _createClass(DayPickerKeyboardShortcuts, [{
- key: 'componentWillReceiveProps',
- value: function () {
- function componentWillReceiveProps(nextProps) {
- var phrases = this.props.phrases;
- if (nextProps.phrases !== phrases) {
- this.keyboardShortcuts = getKeyboardShortcuts(nextProps.phrases);
- }
- }
+var implementation = __webpack_require__(4485);
- return componentWillReceiveProps;
- }()
- }, {
- key: 'componentDidUpdate',
- value: function () {
- function componentDidUpdate() {
- this.handleFocus();
- }
+module.exports = function getPolyfill() {
+ return Array.prototype.flat || implementation;
+};
- return componentDidUpdate;
- }()
- }, {
- key: 'onKeyDown',
- value: function () {
- function onKeyDown(e) {
- e.stopPropagation();
- var closeKeyboardShortcutsPanel = this.props.closeKeyboardShortcutsPanel;
- // Because the close button is the only focusable element inside of the panel, this
- // amounts to a very basic focus trap. The user can exit the panel by "pressing" the
- // close button or hitting escape
+/***/ }),
- switch (e.key) {
- case 'Enter':
- case ' ':
- case 'Spacebar': // for older browsers
- case 'Escape':
- closeKeyboardShortcutsPanel();
- break;
+/***/ 2059:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- // do nothing - this allows the up and down arrows continue their
- // default behavior of scrolling the content of the Keyboard Shortcuts Panel
- // which is needed when only a single month is shown for instance.
- case 'ArrowUp':
- case 'ArrowDown':
- break;
+"use strict";
- // completely block the rest of the keys that have functionality outside of this panel
- case 'Tab':
- case 'Home':
- case 'End':
- case 'PageUp':
- case 'PageDown':
- case 'ArrowLeft':
- case 'ArrowRight':
- e.preventDefault();
- break;
- default:
- break;
- }
- }
+var define = __webpack_require__(9170);
+var getPolyfill = __webpack_require__(616);
- return onKeyDown;
- }()
- }, {
- key: 'onShowKeyboardShortcutsButtonClick',
- value: function () {
- function onShowKeyboardShortcutsButtonClick() {
- var _this2 = this;
+module.exports = function shimFlat() {
+ var polyfill = getPolyfill();
+ define(
+ Array.prototype,
+ { flat: polyfill },
+ { flat: function () { return Array.prototype.flat !== polyfill; } }
+ );
+ return polyfill;
+};
- var openKeyboardShortcutsPanel = this.props.openKeyboardShortcutsPanel;
- // we want to return focus to this button after closing the keyboard shortcuts panel
+/***/ }),
- openKeyboardShortcutsPanel(function () {
- _this2.showKeyboardShortcutsButton.focus();
- });
- }
+/***/ 7615:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- return onShowKeyboardShortcutsButtonClick;
- }()
- }, {
- key: 'setShowKeyboardShortcutsButtonRef',
- value: function () {
- function setShowKeyboardShortcutsButtonRef(ref) {
- this.showKeyboardShortcutsButton = ref;
- }
+"use strict";
- return setShowKeyboardShortcutsButtonRef;
- }()
- }, {
- key: 'setHideKeyboardShortcutsButtonRef',
- value: function () {
- function setHideKeyboardShortcutsButtonRef(ref) {
- this.hideKeyboardShortcutsButton = ref;
- }
- return setHideKeyboardShortcutsButtonRef;
- }()
- }, {
- key: 'handleFocus',
- value: function () {
- function handleFocus() {
- if (this.hideKeyboardShortcutsButton) {
- // automatically move focus into the dialog by moving
- // to the only interactive element, the hide button
- this.hideKeyboardShortcutsButton.focus();
- }
- }
+var GetIntrinsic = __webpack_require__(1801);
- return handleFocus;
- }()
- }, {
- key: 'render',
- value: function () {
- function render() {
- var _this3 = this;
+var callBind = __webpack_require__(2550);
- var _props = this.props,
- block = _props.block,
- buttonLocation = _props.buttonLocation,
- showKeyboardShortcutsPanel = _props.showKeyboardShortcutsPanel,
- closeKeyboardShortcutsPanel = _props.closeKeyboardShortcutsPanel,
- styles = _props.styles,
- phrases = _props.phrases;
+var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
+module.exports = function callBoundIntrinsic(name, allowMissing) {
+ var intrinsic = GetIntrinsic(name, !!allowMissing);
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
+ return callBind(intrinsic);
+ }
+ return intrinsic;
+};
- var toggleButtonText = showKeyboardShortcutsPanel ? phrases.hideKeyboardShortcutsPanel : phrases.showKeyboardShortcutsPanel;
- var bottomRight = buttonLocation === BOTTOM_RIGHT;
- var topRight = buttonLocation === TOP_RIGHT;
- var topLeft = buttonLocation === TOP_LEFT;
+/***/ }),
- return _react2['default'].createElement(
- 'div',
- null,
- _react2['default'].createElement(
- 'button',
- _extends({
- ref: this.setShowKeyboardShortcutsButtonRef
- }, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_buttonReset, styles.DayPickerKeyboardShortcuts_show, bottomRight && styles.DayPickerKeyboardShortcuts_show__bottomRight, topRight && styles.DayPickerKeyboardShortcuts_show__topRight, topLeft && styles.DayPickerKeyboardShortcuts_show__topLeft), {
- type: 'button',
- 'aria-label': toggleButtonText,
- onClick: this.onShowKeyboardShortcutsButtonClick,
- onKeyDown: function () {
- function onKeyDown(e) {
- if (e.key === 'Enter') {
- e.preventDefault();
- } else if (e.key === 'Space') {
- _this3.onShowKeyboardShortcutsButtonClick(e);
- }
- }
+/***/ 2550:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- return onKeyDown;
- }(),
- onMouseUp: function () {
- function onMouseUp(e) {
- e.currentTarget.blur();
- }
+"use strict";
- return onMouseUp;
- }()
- }),
- _react2['default'].createElement(
- 'span',
- (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_showSpan, bottomRight && styles.DayPickerKeyboardShortcuts_showSpan__bottomRight, topRight && styles.DayPickerKeyboardShortcuts_showSpan__topRight, topLeft && styles.DayPickerKeyboardShortcuts_showSpan__topLeft),
- '?'
- )
- ),
- showKeyboardShortcutsPanel && _react2['default'].createElement(
- 'div',
- _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_panel), {
- role: 'dialog',
- 'aria-labelledby': 'DayPickerKeyboardShortcuts_title',
- 'aria-describedby': 'DayPickerKeyboardShortcuts_description'
- }),
- _react2['default'].createElement(
- 'div',
- _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_title), {
- id: 'DayPickerKeyboardShortcuts_title'
- }),
- phrases.keyboardShortcuts
- ),
- _react2['default'].createElement(
- 'button',
- _extends({
- ref: this.setHideKeyboardShortcutsButtonRef
- }, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_buttonReset, styles.DayPickerKeyboardShortcuts_close), {
- type: 'button',
- tabIndex: '0',
- 'aria-label': phrases.hideKeyboardShortcutsPanel,
- onClick: closeKeyboardShortcutsPanel,
- onKeyDown: this.onKeyDown
- }),
- _react2['default'].createElement(_CloseButton2['default'], (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_closeSvg))
- ),
- _react2['default'].createElement(
- 'ul',
- _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_list), {
- id: 'DayPickerKeyboardShortcuts_description'
- }),
- this.keyboardShortcuts.map(function (_ref2) {
- var unicode = _ref2.unicode,
- label = _ref2.label,
- action = _ref2.action;
- return _react2['default'].createElement(_KeyboardShortcutRow2['default'], {
- key: label,
- unicode: unicode,
- label: label,
- action: action,
- block: block
- });
- })
- )
- )
- );
- }
- return render;
- }()
- }]);
+var bind = __webpack_require__(1930);
+var GetIntrinsic = __webpack_require__(1801);
- return DayPickerKeyboardShortcuts;
-}(_react2['default'].Component);
+var $apply = GetIntrinsic('%Function.prototype.apply%');
+var $call = GetIntrinsic('%Function.prototype.call%');
+var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
-DayPickerKeyboardShortcuts.propTypes = propTypes;
-DayPickerKeyboardShortcuts.defaultProps = defaultProps;
+var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
-exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref3) {
- var _ref3$reactDates = _ref3.reactDates,
- color = _ref3$reactDates.color,
- font = _ref3$reactDates.font,
- zIndex = _ref3$reactDates.zIndex;
- return {
- DayPickerKeyboardShortcuts_buttonReset: {
- background: 'none',
- border: 0,
- borderRadius: 0,
- color: 'inherit',
- font: 'inherit',
- lineHeight: 'normal',
- overflow: 'visible',
- padding: 0,
- cursor: 'pointer',
- fontSize: font.size,
+if ($defineProperty) {
+ try {
+ $defineProperty({}, 'a', { value: 1 });
+ } catch (e) {
+ // IE 8 has a broken defineProperty
+ $defineProperty = null;
+ }
+}
- ':active': {
- outline: 'none'
- }
- },
+module.exports = function callBind() {
+ return $reflectApply(bind, $call, arguments);
+};
- DayPickerKeyboardShortcuts_show: {
- width: 22,
- position: 'absolute',
- zIndex: zIndex + 2
- },
+var applyBind = function applyBind() {
+ return $reflectApply(bind, $apply, arguments);
+};
- DayPickerKeyboardShortcuts_show__bottomRight: {
- borderTop: '26px solid transparent',
- borderRight: '33px solid ' + String(color.core.primary),
- bottom: 0,
- right: 0,
+if ($defineProperty) {
+ $defineProperty(module.exports, 'apply', { value: applyBind });
+} else {
+ module.exports.apply = applyBind;
+}
- ':hover': {
- borderRight: '33px solid ' + String(color.core.primary_dark)
- }
- },
- DayPickerKeyboardShortcuts_show__topRight: {
- borderBottom: '26px solid transparent',
- borderRight: '33px solid ' + String(color.core.primary),
- top: 0,
- right: 0,
+/***/ }),
- ':hover': {
- borderRight: '33px solid ' + String(color.core.primary_dark)
- }
- },
+/***/ 4403:
+/***/ (function(module, exports) {
- DayPickerKeyboardShortcuts_show__topLeft: {
- borderBottom: '26px solid transparent',
- borderLeft: '33px solid ' + String(color.core.primary),
- top: 0,
- left: 0,
+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 */
- ':hover': {
- borderLeft: '33px solid ' + String(color.core.primary_dark)
- }
- },
+(function () {
+ 'use strict';
- DayPickerKeyboardShortcuts_showSpan: {
- color: color.core.white,
- position: 'absolute'
- },
+ var hasOwn = {}.hasOwnProperty;
- DayPickerKeyboardShortcuts_showSpan__bottomRight: {
- bottom: 0,
- right: -28
- },
+ function classNames() {
+ var classes = [];
- DayPickerKeyboardShortcuts_showSpan__topRight: {
- top: 1,
- right: -28
- },
+ for (var i = 0; i < arguments.length; i++) {
+ var arg = arguments[i];
+ if (!arg) continue;
- DayPickerKeyboardShortcuts_showSpan__topLeft: {
- top: 1,
- left: -28
- },
+ var argType = typeof arg;
- DayPickerKeyboardShortcuts_panel: {
- overflow: 'auto',
- background: color.background,
- border: '1px solid ' + String(color.core.border),
- borderRadius: 2,
- position: 'absolute',
- top: 0,
- bottom: 0,
- right: 0,
- left: 0,
- zIndex: zIndex + 2,
- padding: 22,
- margin: 33
- },
+ 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());
+ }
+ }
+ }
- DayPickerKeyboardShortcuts_title: {
- fontSize: 16,
- fontWeight: 'bold',
- margin: 0
- },
+ return classes.join(' ');
+ }
- DayPickerKeyboardShortcuts_list: {
- listStyle: 'none',
- padding: 0,
- fontSize: font.size
- },
-
- DayPickerKeyboardShortcuts_close: {
- position: 'absolute',
- right: 22,
- top: 22,
- zIndex: zIndex + 2,
-
- ':active': {
- outline: 'none'
- }
- },
-
- DayPickerKeyboardShortcuts_closeSvg: {
- height: 15,
- width: 15,
- fill: color.core.grayLighter,
-
- ':hover': {
- fill: color.core.grayLight
- },
-
- ':focus': {
- fill: color.core.grayLight
- }
- }
- };
-})(DayPickerKeyboardShortcuts);
-
-/***/ }),
-
-/***/ "10Kj":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var GetIntrinsic = __webpack_require__("j1Hc");
-
-var $TypeError = GetIntrinsic('%TypeError%');
-var $SyntaxError = GetIntrinsic('%SyntaxError%');
-
-var has = __webpack_require__("oNNP");
-
-var predicates = {
- // https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type
- 'Property Descriptor': function isPropertyDescriptor(Type, Desc) {
- if (Type(Desc) !== 'Object') {
- return false;
- }
- var allowed = {
- '[[Configurable]]': true,
- '[[Enumerable]]': true,
- '[[Get]]': true,
- '[[Set]]': true,
- '[[Value]]': true,
- '[[Writable]]': true
- };
-
- for (var key in Desc) { // eslint-disable-line
- if (has(Desc, key) && !allowed[key]) {
- return false;
- }
- }
-
- var isData = has(Desc, '[[Value]]');
- var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');
- if (isData && IsAccessor) {
- throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');
- }
- return true;
- }
-};
-
-module.exports = function assertRecord(Type, recordType, argumentName, value) {
- var predicate = predicates[recordType];
- if (typeof predicate !== 'function') {
- throw new $SyntaxError('unknown record type: ' + recordType);
- }
- if (!predicate(Type, value)) {
- throw new $TypeError(argumentName + ' must be a ' + recordType);
- }
-};
-
-
-/***/ }),
-
-/***/ "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":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["dom"]; }());
-
-/***/ }),
-
-/***/ "1KsK":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var toStr = Object.prototype.toString;
-
-module.exports = function isArguments(value) {
- var str = toStr.call(value);
- var isArgs = str === '[object Arguments]';
- if (!isArgs) {
- isArgs = str !== '[object Array]' &&
- value !== null &&
- typeof value === 'object' &&
- typeof value.length === 'number' &&
- value.length >= 0 &&
- toStr.call(value.callee) === '[object Function]';
- }
- return isArgs;
-};
-
-
-/***/ }),
-
-/***/ "1P9b":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-// http://262.ecma-international.org/5.1/#sec-9.11
-
-module.exports = __webpack_require__("Asd8");
+ 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 {}
+}());
/***/ }),
-/***/ "1TsT":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 8495:
+/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEventListener", function() { return addEventListener; });
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ "addEventListener": function() { return /* binding */ addEventListener; }
+/* harmony export */ });
var CAN_USE_DOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
// Adapted from Modernizr
@@ -1767,5820 +1661,6196 @@ function addEventListener(target, eventName, listener, options) {
/***/ }),
-/***/ "1ao6":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 9170:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-var GetIntrinsic = __webpack_require__("j1Hc");
+var keys = __webpack_require__(806);
+var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
-var $TypeError = GetIntrinsic('%TypeError%');
+var toStr = Object.prototype.toString;
+var concat = Array.prototype.concat;
+var origDefineProperty = Object.defineProperty;
-var IsPropertyKey = __webpack_require__("nR7C");
-var Type = __webpack_require__("PoQ0");
+var isFunction = function (fn) {
+ return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
+};
-// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty
+var arePropertyDescriptorsSupported = function () {
+ var obj = {};
+ try {
+ origDefineProperty(obj, 'x', { enumerable: false, value: obj });
+ // eslint-disable-next-line no-unused-vars, no-restricted-syntax
+ for (var _ in obj) { // jscs:ignore disallowUnusedVariables
+ return false;
+ }
+ return obj.x === obj;
+ } catch (e) { /* this is IE 8. */
+ return false;
+ }
+};
+var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
-module.exports = function HasProperty(O, P) {
- if (Type(O) !== 'Object') {
- throw new $TypeError('Assertion failed: `O` must be an Object');
+var defineProperty = function (object, name, value, predicate) {
+ if (name in object && (!isFunction(predicate) || !predicate())) {
+ return;
}
- if (!IsPropertyKey(P)) {
- throw new $TypeError('Assertion failed: `P` must be a Property Key');
+ if (supportsDescriptors) {
+ origDefineProperty(object, name, {
+ configurable: true,
+ enumerable: false,
+ value: value,
+ writable: true
+ });
+ } else {
+ object[name] = value;
}
- return P in O;
};
+var defineProperties = function (object, map) {
+ var predicates = arguments.length > 2 ? arguments[2] : {};
+ var props = keys(map);
+ if (hasSymbols) {
+ props = concat.call(props, Object.getOwnPropertySymbols(map));
+ }
+ for (var i = 0; i < props.length; i += 1) {
+ defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
+ }
+};
+
+defineProperties.supportsDescriptors = !!supportsDescriptors;
+
+module.exports = defineProperties;
+
/***/ }),
-/***/ "1iEr":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 8110:
+/***/ (function(module) {
"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
- */
+module.exports = function contains(other) {
+ if (arguments.length < 1) {
+ throw new TypeError('1 argument is required');
+ }
+ if (typeof other !== 'object') {
+ throw new TypeError('Argument 1 (”other“) to Node.contains must be an instance of Node');
+ }
-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);
+ var node = other;
+ do {
+ if (this === node) {
+ return true;
+ }
+ if (node) {
+ node = node.parentNode;
+ }
+ } while (node);
+
+ return false;
+};
/***/ }),
-/***/ "1seS":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 6789:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-var slice = Array.prototype.slice;
-var isArgs = __webpack_require__("1KsK");
-
-var origKeys = Object.keys;
-var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__("sYn3");
+var define = __webpack_require__(9170);
-var originalKeys = Object.keys;
+var implementation = __webpack_require__(8110);
+var getPolyfill = __webpack_require__(8267);
+var polyfill = getPolyfill();
+var shim = __webpack_require__(714);
-keysShim.shim = function shimObjectKeys() {
- if (Object.keys) {
- var keysWorksWithArguments = (function () {
- // Safari 5.0 bug
- var args = Object.keys(arguments);
- return args && args.length === arguments.length;
- }(1, 2));
- if (!keysWorksWithArguments) {
- Object.keys = function keys(object) { // eslint-disable-line func-name-matching
- if (isArgs(object)) {
- return originalKeys(slice.call(object));
- }
- return originalKeys(object);
- };
- }
- } else {
- Object.keys = keysShim;
- }
- return Object.keys || keysShim;
+var boundContains = function contains(node, other) {
+ return polyfill.apply(node, [other]);
};
-module.exports = keysShim;
+define(boundContains, {
+ getPolyfill: getPolyfill,
+ implementation: implementation,
+ shim: shim
+});
+
+module.exports = boundContains;
/***/ }),
-/***/ "22yB":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 8267:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-var implementation = __webpack_require__("yN6O");
+var implementation = __webpack_require__(8110);
module.exports = function getPolyfill() {
- return Array.prototype.flat || implementation;
+ if (typeof document !== 'undefined') {
+ if (document.contains) {
+ return document.contains;
+ }
+ if (document.body && document.body.contains) {
+ try {
+ if (typeof document.body.contains.call(document, '') === 'boolean') {
+ return document.body.contains;
+ }
+ } catch (e) { /**/ }
+ }
+ }
+ return implementation;
};
/***/ }),
-/***/ "25kQ":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 714:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-module.exports = __webpack_require__("aUaa");
+var define = __webpack_require__(9170);
+var getPolyfill = __webpack_require__(8267);
+
+module.exports = function shimContains() {
+ var polyfill = getPolyfill();
+ if (typeof document !== 'undefined') {
+ define(
+ document,
+ { contains: polyfill },
+ { contains: function () { return document.contains !== polyfill; } }
+ );
+ if (typeof Element !== 'undefined') {
+ define(
+ Element.prototype,
+ { contains: polyfill },
+ { contains: function () { return Element.prototype.contains !== polyfill; } }
+ );
+ }
+ }
+ return polyfill;
+};
/***/ }),
-/***/ "2Q00":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 1345:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports['default'] = CalendarWeek;
-
-var _react = __webpack_require__("cDcd");
-
-var _react2 = _interopRequireDefault(_react);
-
-var _airbnbPropTypes = __webpack_require__("Hsqg");
+var util = __webpack_require__(5022);
-var _CalendarDay = __webpack_require__("N3k4");
-
-var _CalendarDay2 = _interopRequireDefault(_CalendarDay);
+function scrollIntoView(elem, container, config) {
+ config = config || {};
+ // document 归一化到 window
+ if (container.nodeType === 9) {
+ container = util.getWindow(container);
+ }
-var _CustomizableCalendarDay = __webpack_require__("GET3");
+ 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;
-var _CustomizableCalendarDay2 = _interopRequireDefault(_CustomizableCalendarDay);
+ allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+ 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;
-var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({
- children: (0, _airbnbPropTypes.or)([(0, _airbnbPropTypes.childrenOfType)(_CalendarDay2['default']), (0, _airbnbPropTypes.childrenOfType)(_CustomizableCalendarDay2['default'])]).isRequired
-});
+ 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
+ };
+ }
-function CalendarWeek(_ref) {
- var children = _ref.children;
+ 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);
+ }
+ }
+ }
- return _react2['default'].createElement(
- 'tr',
- null,
- children
- );
+ 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);
+ }
+ }
+ }
+ }
}
-CalendarWeek.propTypes = propTypes;
+module.exports = scrollIntoView;
/***/ }),
-/***/ "2S2E":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 5425:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+module.exports = __webpack_require__(1345);
-var _propTypes = __webpack_require__("17x9");
+/***/ }),
-var _propTypes2 = _interopRequireDefault(_propTypes);
+/***/ 5022:
+/***/ (function(module) {
-var _constants = __webpack_require__("Fv1B");
+"use strict";
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-exports['default'] = _propTypes2['default'].oneOf(_constants.WEEKDAYS);
+var _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; };
-/***/ }),
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
-/***/ "2gm7":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;
-"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);
-
-
-/***/ }),
-
-/***/ "2mql":
-/***/ (function(module, exports, __webpack_require__) {
+function getClientPosition(elem) {
+ var box = undefined;
+ var x = undefined;
+ var y = undefined;
+ var doc = elem.ownerDocument;
+ var body = doc.body;
+ var docElem = doc && doc.documentElement;
+ // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式
+ box = elem.getBoundingClientRect();
-"use strict";
+ // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop
+ // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确
+ // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin
+ x = box.left;
+ y = box.top;
-var reactIs = __webpack_require__("TOwV");
+ // In IE, most of the time, 2 extra pixels are added to the top and left
+ // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and
+ // IE6 standards mode, this border can be overridden by setting the
+ // document element's border to zero -- thus, we cannot rely on the
+ // offset always being 2 pixels.
-/**
- * Copyright 2015, Yahoo! Inc.
- * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
- */
-var REACT_STATICS = {
- childContextTypes: true,
- contextType: true,
- contextTypes: true,
- defaultProps: true,
- displayName: true,
- getDefaultProps: true,
- getDerivedStateFromError: true,
- getDerivedStateFromProps: true,
- mixins: true,
- propTypes: true,
- type: true
-};
-var KNOWN_STATICS = {
- name: true,
- length: true,
- prototype: true,
- caller: true,
- callee: true,
- arguments: true,
- arity: true
-};
-var FORWARD_REF_STATICS = {
- '$$typeof': true,
- render: true,
- defaultProps: true,
- displayName: true,
- propTypes: true
-};
-var MEMO_STATICS = {
- '$$typeof': true,
- compare: true,
- defaultProps: true,
- displayName: true,
- propTypes: true,
- type: true
-};
-var TYPE_STATICS = {};
-TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
-TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
+ // In quirks mode, the offset can be determined by querying the body's
+ // clientLeft/clientTop, but in standards mode, it is found by querying
+ // the document element's clientLeft/clientTop. Since we already called
+ // getClientBoundingRect we have already forced a reflow, so it is not
+ // too expensive just to query them all.
-function getStatics(component) {
- // React v16.11 and below
- if (reactIs.isMemo(component)) {
- return MEMO_STATICS;
- } // React v16.12 and above
+ // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的
+ // 窗口边框标准是设 documentElement ,quirks 时设置 body
+ // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去
+ // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置
+ // 标准 ie 下 docElem.clientTop 就是 border-top
+ // ie7 html 即窗口边框改变不了。永远为 2
+ // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0
+ x -= docElem.clientLeft || body.clientLeft || 0;
+ y -= docElem.clientTop || body.clientTop || 0;
- return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
+ return {
+ left: x,
+ top: y
+ };
}
-var defineProperty = Object.defineProperty;
-var getOwnPropertyNames = Object.getOwnPropertyNames;
-var getOwnPropertySymbols = Object.getOwnPropertySymbols;
-var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
-var getPrototypeOf = Object.getPrototypeOf;
-var objectPrototype = Object.prototype;
-function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
- if (typeof sourceComponent !== 'string') {
- // don't hoist over string (html) components
- if (objectPrototype) {
- var inheritedComponent = getPrototypeOf(sourceComponent);
-
- if (inheritedComponent && inheritedComponent !== objectPrototype) {
- hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
- }
- }
-
- var keys = getOwnPropertyNames(sourceComponent);
-
- if (getOwnPropertySymbols) {
- keys = keys.concat(getOwnPropertySymbols(sourceComponent));
+function getScroll(w, top) {
+ var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];
+ var method = 'scroll' + (top ? 'Top' : 'Left');
+ if (typeof ret !== 'number') {
+ var d = w.document;
+ // ie6,7,8 standard mode
+ ret = d.documentElement[method];
+ if (typeof ret !== 'number') {
+ // quirks mode
+ ret = d.body[method];
}
+ }
+ return ret;
+}
- var targetStatics = getStatics(targetComponent);
- var sourceStatics = getStatics(sourceComponent);
+function getScrollLeft(w) {
+ return getScroll(w);
+}
- for (var i = 0; i < keys.length; ++i) {
- var key = keys[i];
+function getScrollTop(w) {
+ return getScroll(w, true);
+}
- if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
- var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
+function getOffset(el) {
+ var pos = getClientPosition(el);
+ var doc = el.ownerDocument;
+ var w = doc.defaultView || doc.parentWindow;
+ pos.left += getScrollLeft(w);
+ pos.top += getScrollTop(w);
+ return pos;
+}
+function _getComputedStyle(elem, name, computedStyle_) {
+ var val = '';
+ var d = elem.ownerDocument;
+ var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);
- try {
- // Avoid failures from read-only properties
- defineProperty(targetComponent, key, descriptor);
- } catch (e) {}
- }
- }
+ // https://github.com/kissyteam/kissy/issues/61
+ if (computedStyle) {
+ val = computedStyle.getPropertyValue(name) || computedStyle[name];
}
- return targetComponent;
+ return val;
}
-module.exports = hoistNonReactStatics;
+var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');
+var RE_POS = /^(top|right|bottom|left)$/;
+var CURRENT_STYLE = 'currentStyle';
+var RUNTIME_STYLE = 'runtimeStyle';
+var LEFT = 'left';
+var PX = 'px';
+function _getComputedStyleIE(elem, name) {
+ // currentStyle maybe null
+ // http://msdn.microsoft.com/en-us/library/ms535231.aspx
+ var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];
-/***/ }),
+ // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值
+ // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19
+ // 在 ie 下不对,需要直接用 offset 方式
+ // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了
-/***/ "3HW2":
-/***/ (function(module, exports, __webpack_require__) {
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ // exclude left right for relativity
+ if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {
+ // Remember the original values
+ var style = elem.style;
+ var left = style[LEFT];
+ var rsLeft = elem[RUNTIME_STYLE][LEFT];
-"use strict";
+ // prevent flashing of content
+ elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];
+ // Put in the new values to get a computed value out
+ style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;
+ ret = style.pixelLeft + PX;
-var MAX_SAFE_INTEGER = __webpack_require__("yyeE");
+ // Revert the changed values
+ style[LEFT] = left;
-var ToIntegerOrInfinity = __webpack_require__("3iup");
+ elem[RUNTIME_STYLE][LEFT] = rsLeft;
+ }
+ return ret === '' ? 'auto' : ret;
+}
-module.exports = function ToLength(argument) {
- var len = ToIntegerOrInfinity(argument);
- if (len <= 0) { return 0; } // includes converting -0 to +0
- if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }
- return len;
-};
+var getComputedStyleX = undefined;
+if (typeof window !== 'undefined') {
+ getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;
+}
+function each(arr, fn) {
+ for (var i = 0; i < arr.length; i++) {
+ fn(arr[i]);
+ }
+}
-/***/ }),
+function isBorderBoxFn(elem) {
+ return getComputedStyleX(elem, 'boxSizing') === 'border-box';
+}
-/***/ "3HjQ":
-/***/ (function(module, exports) {
+var BOX_MODELS = ['margin', 'border', 'padding'];
+var CONTENT_INDEX = -1;
+var PADDING_INDEX = 2;
+var BORDER_INDEX = 1;
+var MARGIN_INDEX = 0;
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-// This function takes an array of styles and separates them into styles that
-// are handled by Aphrodite and inline styles.
-function separateStyles(stylesArray) {
- var classNames = [];
+function swap(elem, options, callback) {
+ var old = {};
+ var style = elem.style;
+ var name = undefined;
- // Since determining if an Object is empty requires collecting all of its
- // keys, and we want the best performance in this code because we are in the
- // render path, we are going to do a little bookkeeping ourselves.
- var hasInlineStyles = false;
- var inlineStyles = {};
+ // Remember the old values, and insert the new ones
+ for (name in options) {
+ if (options.hasOwnProperty(name)) {
+ old[name] = style[name];
+ style[name] = options[name];
+ }
+ }
- // This is run on potentially every node in the tree when rendering, where
- // performance is critical. Normally we would prefer using `forEach`, but
- // old-fashioned for loops are faster so that's what we have chosen here.
- for (var i = 0; i < stylesArray.length; i++) {
- // eslint-disable-line no-plusplus
- var style = stylesArray[i];
+ callback.call(elem);
- // If this style is falsy, we just want to disregard it. This allows for
- // syntax like:
- //
- // css(isFoo && styles.foo)
- if (style) {
- if (typeof style === 'string') {
- classNames.push(style);
- } else {
- Object.assign(inlineStyles, style);
- hasInlineStyles = true;
- }
+ // Revert the old values
+ for (name in options) {
+ if (options.hasOwnProperty(name)) {
+ style[name] = old[name];
}
}
-
- return {
- classNames: classNames,
- hasInlineStyles: hasInlineStyles,
- inlineStyles: inlineStyles
- };
}
-exports['default'] = separateStyles;
-
-/***/ }),
-
-/***/ "3gBW":
-/***/ (function(module, exports, __webpack_require__) {
-
-// eslint-disable-next-line import/no-unresolved
-module.exports = __webpack_require__("50qU");
-
-
-/***/ }),
-
-/***/ "3iup":
-/***/ (function(module, exports, __webpack_require__) {
+function getPBMWidth(elem, props, which) {
+ var value = 0;
+ var prop = undefined;
+ var j = undefined;
+ var i = undefined;
+ for (j = 0; j < props.length; j++) {
+ prop = props[j];
+ if (prop) {
+ for (i = 0; i < which.length; i++) {
+ var cssProp = undefined;
+ if (prop === 'border') {
+ cssProp = prop + which[i] + 'Width';
+ } else {
+ cssProp = prop + which[i];
+ }
+ value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;
+ }
+ }
+ }
+ return value;
+}
-"use strict";
+/**
+ * A crude way of determining if an object is a window
+ * @member util
+ */
+function isWindow(obj) {
+ // must use == for ie8
+ /* eslint eqeqeq:0 */
+ return obj != null && obj == obj.window;
+}
+var domUtils = {};
-var ES5ToInteger = __webpack_require__("Wfh+");
+each(['Width', 'Height'], function (name) {
+ domUtils['doc' + name] = function (refWin) {
+ var d = refWin.document;
+ return Math.max(
+ // firefox chrome documentElement.scrollHeight< body.scrollHeight
+ // ie standard mode : documentElement.scrollHeight> body.scrollHeight
+ d.documentElement['scroll' + name],
+ // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?
+ d.body['scroll' + name], domUtils['viewport' + name](d));
+ };
-var ToNumber = __webpack_require__("Rhcr");
+ domUtils['viewport' + name] = function (win) {
+ // pc browser includes scrollbar in window.innerWidth
+ var prop = 'client' + name;
+ var doc = win.document;
+ var body = doc.body;
+ var documentElement = doc.documentElement;
+ var documentElementProp = documentElement[prop];
+ // 标准模式取 documentElement
+ // backcompat 取 body
+ return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;
+ };
+});
-// https://www.ecma-international.org/ecma-262/11.0/#sec-tointeger
+/*
+ 得到元素的大小信息
+ @param elem
+ @param name
+ @param {String} [extra] 'padding' : (css width) + padding
+ 'border' : (css width) + padding + border
+ 'margin' : (css width) + padding + border + margin
+ */
+function getWH(elem, name, extra) {
+ if (isWindow(elem)) {
+ return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);
+ } else if (elem.nodeType === 9) {
+ return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);
+ }
+ var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
+ var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;
+ var computedStyle = getComputedStyleX(elem);
+ var isBorderBox = isBorderBoxFn(elem, computedStyle);
+ var cssBoxValue = 0;
+ if (borderBoxValue == null || borderBoxValue <= 0) {
+ borderBoxValue = undefined;
+ // Fall back to computed then un computed css if necessary
+ cssBoxValue = getComputedStyleX(elem, name);
+ if (cssBoxValue == null || Number(cssBoxValue) < 0) {
+ cssBoxValue = elem.style[name] || 0;
+ }
+ // Normalize '', auto, and prepare for extra
+ cssBoxValue = parseFloat(cssBoxValue) || 0;
+ }
+ if (extra === undefined) {
+ extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;
+ }
+ var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;
+ var val = borderBoxValue || cssBoxValue;
+ if (extra === CONTENT_INDEX) {
+ if (borderBoxValueOrIsBorderBox) {
+ return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);
+ }
+ return cssBoxValue;
+ }
+ if (borderBoxValueOrIsBorderBox) {
+ var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle);
+ return val + (extra === BORDER_INDEX ? 0 : padding);
+ }
+ return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);
+}
-module.exports = function ToInteger(value) {
- var number = ToNumber(value);
- if (number !== 0) {
- number = ES5ToInteger(number);
- }
- return number === 0 ? 0 : number;
+var cssShow = {
+ position: 'absolute',
+ visibility: 'hidden',
+ display: 'block'
};
+// fix #119 : https://github.com/kissyteam/kissy/issues/119
+function getWHIgnoreDisplay(elem) {
+ var val = undefined;
+ var args = arguments;
+ // in case elem is window
+ // elem.offsetWidth === undefined
+ if (elem.offsetWidth !== 0) {
+ val = getWH.apply(undefined, args);
+ } else {
+ swap(elem, cssShow, function () {
+ val = getWH.apply(undefined, args);
+ });
+ }
+ return val;
+}
-/***/ }),
-
-/***/ "4cSd":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var define = __webpack_require__("82c2");
-var callBind = __webpack_require__("PrET");
-
-var implementation = __webpack_require__("rQy3");
-var getPolyfill = __webpack_require__("xoj2");
-var shim = __webpack_require__("ib7Q");
+function css(el, name, v) {
+ var value = v;
+ if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {
+ for (var i in name) {
+ if (name.hasOwnProperty(i)) {
+ css(el, i, name[i]);
+ }
+ }
+ return undefined;
+ }
+ if (typeof value !== 'undefined') {
+ if (typeof value === 'number') {
+ value += 'px';
+ }
+ el.style[name] = value;
+ return undefined;
+ }
+ return getComputedStyleX(el, name);
+}
-var polyfill = callBind(getPolyfill(), Object);
+each(['width', 'height'], function (name) {
+ var first = name.charAt(0).toUpperCase() + name.slice(1);
+ domUtils['outer' + first] = function (el, includeMargin) {
+ return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);
+ };
+ var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];
-define(polyfill, {
- getPolyfill: getPolyfill,
- implementation: implementation,
- shim: shim
+ domUtils[name] = function (elem, val) {
+ if (val !== undefined) {
+ if (elem) {
+ var computedStyle = getComputedStyleX(elem);
+ var isBorderBox = isBorderBoxFn(elem);
+ if (isBorderBox) {
+ val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);
+ }
+ return css(elem, name, val);
+ }
+ return undefined;
+ }
+ return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);
+ };
});
-module.exports = polyfill;
-
+// 设置 elem 相对 elem.ownerDocument 的坐标
+function setOffset(elem, offset) {
+ // set position first, in-case top/left are set even on static elem
+ if (css(elem, 'position') === 'static') {
+ elem.style.position = 'relative';
+ }
-/***/ }),
+ var old = getOffset(elem);
+ var ret = {};
+ var current = undefined;
+ var key = undefined;
-/***/ "4eJC":
-/***/ (function(module, exports, __webpack_require__) {
+ for (key in offset) {
+ if (offset.hasOwnProperty(key)) {
+ current = parseFloat(css(elem, key)) || 0;
+ ret[key] = current + offset[key] - old[key];
+ }
+ }
+ css(elem, ret);
+}
-/**
- * Memize options object.
- *
- * @typedef MemizeOptions
- *
- * @property {number} [maxSize] Maximum size of the cache.
- */
+module.exports = _extends({
+ getWindow: function getWindow(node) {
+ var doc = node.ownerDocument || node;
+ return doc.defaultView || doc.parentWindow;
+ },
+ offset: function offset(el, value) {
+ if (typeof value !== 'undefined') {
+ setOffset(el, value);
+ } else {
+ return getOffset(el);
+ }
+ },
-/**
- * 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.
- */
+ isWindow: isWindow,
+ each: each,
+ css: css,
+ clone: function clone(obj) {
+ var ret = {};
+ for (var i in obj) {
+ if (obj.hasOwnProperty(i)) {
+ ret[i] = obj[i];
+ }
+ }
+ var overflow = obj.overflow;
+ if (overflow) {
+ for (var i in obj) {
+ if (obj.hasOwnProperty(i)) {
+ ret.overflow[i] = obj.overflow[i];
+ }
+ }
+ }
+ return ret;
+ },
+ scrollLeft: function scrollLeft(w, v) {
+ if (isWindow(w)) {
+ if (v === undefined) {
+ return getScrollLeft(w);
+ }
+ window.scrollTo(v, getScrollTop(w));
+ } else {
+ if (v === undefined) {
+ return w.scrollLeft;
+ }
+ w.scrollLeft = v;
+ }
+ },
+ scrollTop: function scrollTop(w, v) {
+ if (isWindow(w)) {
+ if (v === undefined) {
+ return getScrollTop(w);
+ }
+ window.scrollTo(getScrollLeft(w), v);
+ } else {
+ if (v === undefined) {
+ return w.scrollTop;
+ }
+ w.scrollTop = v;
+ }
+ },
-/**
- * Properties of the enhanced function for controlling cache.
- *
- * @typedef MemizeMemoizedFunction
- *
- * @property {()=>void} clear Clear the cache.
- */
+ viewportWidth: 0,
+ viewportHeight: 0
+}, domUtils);
-/**
- * Accepts a function to be memoized, and returns a new memoized function, with
- * optional options.
- *
- * @template {Function} F
+/***/ }),
+
+/***/ 9214:
+/***/ (function(__unused_webpack_module, exports) {
+
+"use strict";
+var __webpack_unused_export__;
+/** @license React v17.0.2
+ * react-is.production.min.js
*
- * @param {F} fn Function to memoize.
- * @param {MemizeOptions} [options] Options object.
+ * Copyright (c) Facebook, Inc. and its affiliates.
*
- * @return {F & MemizeMemoizedFunction} Memoized function.
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
*/
-function memize( fn, options ) {
- var size = 0;
+var b=60103,c=60106,d=60107,e=60108,f=60114,g=60109,h=60110,k=60112,l=60113,m=60120,n=60115,p=60116,q=60121,r=60122,u=60117,v=60129,w=60131;
+if("function"===typeof Symbol&&Symbol.for){var x=Symbol.for;b=x("react.element");c=x("react.portal");d=x("react.fragment");e=x("react.strict_mode");f=x("react.profiler");g=x("react.provider");h=x("react.context");k=x("react.forward_ref");l=x("react.suspense");m=x("react.suspense_list");n=x("react.memo");p=x("react.lazy");q=x("react.block");r=x("react.server.block");u=x("react.fundamental");v=x("react.debug_trace_mode");w=x("react.legacy_hidden")}
+function y(a){if("object"===typeof a&&null!==a){var t=a.$$typeof;switch(t){case b:switch(a=a.type,a){case d:case f:case e:case l:case m:return a;default:switch(a=a&&a.$$typeof,a){case h:case k:case p:case n:case g:return a;default:return t}}case c:return t}}}var z=g,A=b,B=k,C=d,D=p,E=n,F=c,G=f,H=e,I=l;__webpack_unused_export__=h;__webpack_unused_export__=z;__webpack_unused_export__=A;__webpack_unused_export__=B;__webpack_unused_export__=C;__webpack_unused_export__=D;__webpack_unused_export__=E;__webpack_unused_export__=F;__webpack_unused_export__=G;__webpack_unused_export__=H;
+__webpack_unused_export__=I;__webpack_unused_export__=function(){return!1};__webpack_unused_export__=function(){return!1};__webpack_unused_export__=function(a){return y(a)===h};__webpack_unused_export__=function(a){return y(a)===g};__webpack_unused_export__=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===b};__webpack_unused_export__=function(a){return y(a)===k};__webpack_unused_export__=function(a){return y(a)===d};__webpack_unused_export__=function(a){return y(a)===p};__webpack_unused_export__=function(a){return y(a)===n};
+__webpack_unused_export__=function(a){return y(a)===c};__webpack_unused_export__=function(a){return y(a)===f};__webpack_unused_export__=function(a){return y(a)===e};__webpack_unused_export__=function(a){return y(a)===l};__webpack_unused_export__=function(a){return"string"===typeof a||"function"===typeof a||a===d||a===f||a===v||a===e||a===l||a===m||a===w||"object"===typeof a&&null!==a&&(a.$$typeof===p||a.$$typeof===n||a.$$typeof===g||a.$$typeof===h||a.$$typeof===k||a.$$typeof===u||a.$$typeof===q||a[0]===r)?!0:!1};
+__webpack_unused_export__=y;
- /** @type {?MemizeCacheNode|undefined} */
- var head;
- /** @type {?MemizeCacheNode|undefined} */
- var tail;
+/***/ }),
- options = options || {};
+/***/ 2797:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- function memoized( /* ...args */ ) {
- var node = head,
- len = arguments.length,
- args, i;
+"use strict";
- 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;
- }
+if (true) {
+ /* unused reexport */ __webpack_require__(9214);
+} else {}
- // 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;
- }
+/***/ 5249:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- // 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;
- }
+"use strict";
- node.next = head;
- node.prev = null;
- /** @type {MemizeCacheNode} */ ( head ).prev = node;
- head = node;
- }
- // Return immediately
- return node.val;
+var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';
+
+var isPrimitive = __webpack_require__(3777);
+var isCallable = __webpack_require__(5443);
+var isDate = __webpack_require__(8659);
+var isSymbol = __webpack_require__(3082);
+
+var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) {
+ if (typeof O === 'undefined' || O === null) {
+ throw new TypeError('Cannot call method on ' + O);
+ }
+ if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) {
+ throw new TypeError('hint must be "string" or "number"');
+ }
+ var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString'];
+ var method, result, i;
+ for (i = 0; i < methodNames.length; ++i) {
+ method = O[methodNames[i]];
+ if (isCallable(method)) {
+ result = method.call(O);
+ if (isPrimitive(result)) {
+ return result;
+ }
}
+ }
+ throw new TypeError('No default value');
+};
- // No cached value found. Continue to insertion phase:
+var GetMethod = function GetMethod(O, P) {
+ var func = O[P];
+ if (func !== null && typeof func !== 'undefined') {
+ if (!isCallable(func)) {
+ throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function');
+ }
+ return func;
+ }
+ return void 0;
+};
- // Create a copy of arguments (avoid leaking deoptimization)
- args = new Array( len );
- for ( i = 0; i < len; i++ ) {
- args[ i ] = arguments[ i ];
+// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive
+module.exports = function ToPrimitive(input) {
+ if (isPrimitive(input)) {
+ return input;
+ }
+ var hint = 'default';
+ if (arguments.length > 1) {
+ if (arguments[1] === String) {
+ hint = 'string';
+ } else if (arguments[1] === Number) {
+ hint = 'number';
}
+ }
- node = {
- args: args,
+ var exoticToPrim;
+ if (hasSymbols) {
+ if (Symbol.toPrimitive) {
+ exoticToPrim = GetMethod(input, Symbol.toPrimitive);
+ } else if (isSymbol(input)) {
+ exoticToPrim = Symbol.prototype.valueOf;
+ }
+ }
+ if (typeof exoticToPrim !== 'undefined') {
+ var result = exoticToPrim.call(input, hint);
+ if (isPrimitive(result)) {
+ return result;
+ }
+ throw new TypeError('unable to convert exotic object to primitive');
+ }
+ if (hint === 'default' && (isDate(input) || isSymbol(input))) {
+ hint = 'string';
+ }
+ return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint);
+};
- // 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;
- }
+/***/ 8023:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- // 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++;
- }
+"use strict";
- head = node;
- return node.val;
- }
+var toStr = Object.prototype.toString;
- memoized.clear = function() {
- head = null;
- tail = null;
- size = 0;
- };
+var isPrimitive = __webpack_require__(3777);
- if ( false ) {}
+var isCallable = __webpack_require__(5443);
- // 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.
+// http://ecma-international.org/ecma-262/5.1/#sec-8.12.8
+var ES5internalSlots = {
+ '[[DefaultValue]]': function (O) {
+ var actualHint;
+ if (arguments.length > 1) {
+ actualHint = arguments[1];
+ } else {
+ actualHint = toStr.call(O) === '[object Date]' ? String : Number;
+ }
- // @ts-ignore
- return memoized;
-}
+ if (actualHint === String || actualHint === Number) {
+ var methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString'];
+ var value, i;
+ for (i = 0; i < methods.length; ++i) {
+ if (isCallable(O[methods[i]])) {
+ value = O[methods[i]]();
+ if (isPrimitive(value)) {
+ return value;
+ }
+ }
+ }
+ throw new TypeError('No default value');
+ }
+ throw new TypeError('invalid [[DefaultValue]] hint supplied');
+ }
+};
-module.exports = memize;
+// http://ecma-international.org/ecma-262/5.1/#sec-9.1
+module.exports = function ToPrimitive(input) {
+ if (isPrimitive(input)) {
+ return input;
+ }
+ if (arguments.length > 1) {
+ return ES5internalSlots['[[DefaultValue]]'](input, arguments[1]);
+ }
+ return ES5internalSlots['[[DefaultValue]]'](input);
+};
/***/ }),
-/***/ "4po3":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 3777:
+/***/ (function(module) {
"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isTextField; });
-/**
- * Check whether the given element is a text field, where text field is defined
- * by the ability to select within the input, or that it is contenteditable.
- *
- * @example
- * import { isTextField } from "reakit-utils";
- *
- * isTextField(document.querySelector("div")); // false
- * isTextField(document.querySelector("input")); // true
- * isTextField(document.querySelector("input[type='button']")); // false
- * isTextField(document.querySelector("textarea")); // true
- * isTextField(document.querySelector("div[contenteditable='true']")); // true
- */
-function isTextField(element) {
- try {
- var isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null;
- var isTextArea = element.tagName === "TEXTAREA";
- var isContentEditable = element.contentEditable === "true";
- return isTextInput || isTextArea || isContentEditable || false;
- } catch (error) {
- // Safari throws an exception when trying to get `selectionStart`
- // on non-text <input> elements (which, understandably, don't
- // have the text selection API). We catch this via a try/catch
- // block, as opposed to a more explicit check of the element's
- // input types, because of Safari's non-standard behavior. This
- // also means we don't have to worry about the list of input
- // types that support `selectionStart` changing as the HTML spec
- // evolves over time.
- return false;
- }
-}
+module.exports = function isPrimitive(value) {
+ return value === null || (typeof value !== 'function' && typeof value !== 'object');
+};
/***/ }),
-/***/ "4qvr":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 2920:
+/***/ (function(module) {
-var hasMap = typeof Map === 'function' && Map.prototype;
-var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
-var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
-var mapForEach = hasMap && Map.prototype.forEach;
-var hasSet = typeof Set === 'function' && Set.prototype;
-var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
-var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
-var setForEach = hasSet && Set.prototype.forEach;
-var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
-var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
-var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
-var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
-var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
-var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
-var booleanValueOf = Boolean.prototype.valueOf;
-var objectToString = Object.prototype.toString;
-var functionToString = Function.prototype.toString;
-var $match = String.prototype.match;
-var $slice = String.prototype.slice;
-var $replace = String.prototype.replace;
-var $toUpperCase = String.prototype.toUpperCase;
-var $toLowerCase = String.prototype.toLowerCase;
-var $test = RegExp.prototype.test;
-var $concat = Array.prototype.concat;
-var $join = Array.prototype.join;
-var $arrSlice = Array.prototype.slice;
-var $floor = Math.floor;
-var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
-var gOPS = Object.getOwnPropertySymbols;
-var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
-var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
-// ie, `has-tostringtag/shams
-var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
- ? Symbol.toStringTag
- : null;
-var isEnumerable = Object.prototype.propertyIsEnumerable;
+//
+// Main
+//
-var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
- [].__proto__ === Array.prototype // eslint-disable-line no-proto
- ? function (O) {
- return O.__proto__; // eslint-disable-line no-proto
- }
- : null
-);
+function memoize (fn, options) {
+ var cache = options && options.cache
+ ? options.cache
+ : cacheDefault
-function addNumericSeparator(num, str) {
- if (
- num === Infinity
- || num === -Infinity
- || num !== num
- || (num && num > -1000 && num < 1000)
- || $test.call(/e/, str)
- ) {
- return str;
- }
- var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
- if (typeof num === 'number') {
- var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
- if (int !== num) {
- var intStr = String(int);
- var dec = $slice.call(str, intStr.length + 1);
- return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
- }
- }
- return $replace.call(str, sepRegex, '$&_');
-}
+ var serializer = options && options.serializer
+ ? options.serializer
+ : serializerDefault
-var inspectCustom = __webpack_require__(0).custom;
-var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
+ var strategy = options && options.strategy
+ ? options.strategy
+ : strategyDefault
-module.exports = function inspect_(obj, options, depth, seen) {
- var opts = options || {};
+ return strategy(fn, {
+ cache: cache,
+ serializer: serializer
+ })
+}
- if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
- throw new TypeError('option "quoteStyle" must be "single" or "double"');
- }
- if (
- has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
- ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
- : opts.maxStringLength !== null
- )
- ) {
- throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
- }
- var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
- if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
- throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
- }
+//
+// Strategy
+//
- if (
- has(opts, 'indent')
- && opts.indent !== null
- && opts.indent !== '\t'
- && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
- ) {
- throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
- }
- if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
- throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
- }
- var numericSeparator = opts.numericSeparator;
+function isPrimitive (value) {
+ return value == null || typeof value === 'number' || typeof value === 'boolean' // || typeof value === "string" 'unsafe' primitive for our needs
+}
- if (typeof obj === 'undefined') {
- return 'undefined';
- }
- if (obj === null) {
- return 'null';
- }
- if (typeof obj === 'boolean') {
- return obj ? 'true' : 'false';
- }
+function monadic (fn, cache, serializer, arg) {
+ var cacheKey = isPrimitive(arg) ? arg : serializer(arg)
- if (typeof obj === 'string') {
- return inspectString(obj, opts);
- }
- if (typeof obj === 'number') {
- if (obj === 0) {
- return Infinity / obj > 0 ? '0' : '-0';
- }
- var str = String(obj);
- return numericSeparator ? addNumericSeparator(obj, str) : str;
- }
- if (typeof obj === 'bigint') {
- var bigIntStr = String(obj) + 'n';
- return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
- }
+ var computedValue = cache.get(cacheKey)
+ if (typeof computedValue === 'undefined') {
+ computedValue = fn.call(this, arg)
+ cache.set(cacheKey, computedValue)
+ }
- var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
- if (typeof depth === 'undefined') { depth = 0; }
- if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
- return isArray(obj) ? '[Array]' : '[Object]';
- }
+ return computedValue
+}
- var indent = getIndent(opts, depth);
+function variadic (fn, cache, serializer) {
+ var args = Array.prototype.slice.call(arguments, 3)
+ var cacheKey = serializer(args)
- if (typeof seen === 'undefined') {
- seen = [];
- } else if (indexOf(seen, obj) >= 0) {
- return '[Circular]';
- }
+ var computedValue = cache.get(cacheKey)
+ if (typeof computedValue === 'undefined') {
+ computedValue = fn.apply(this, args)
+ cache.set(cacheKey, computedValue)
+ }
- function inspect(value, from, noIndent) {
- if (from) {
- seen = $arrSlice.call(seen);
- seen.push(from);
- }
- if (noIndent) {
- var newOpts = {
- depth: opts.depth
- };
- if (has(opts, 'quoteStyle')) {
- newOpts.quoteStyle = opts.quoteStyle;
- }
- return inspect_(value, newOpts, depth + 1, seen);
- }
- return inspect_(value, opts, depth + 1, seen);
- }
+ return computedValue
+}
- if (typeof obj === 'function') {
- var name = nameOf(obj);
- var keys = arrObjKeys(obj, inspect);
- return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
- }
- if (isSymbol(obj)) {
- var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
- return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
- }
- if (isElement(obj)) {
- var s = '<' + $toLowerCase.call(String(obj.nodeName));
- var attrs = obj.attributes || [];
- for (var i = 0; i < attrs.length; i++) {
- s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
- }
- s += '>';
- if (obj.childNodes && obj.childNodes.length) { s += '...'; }
- s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
- return s;
- }
- if (isArray(obj)) {
- if (obj.length === 0) { return '[]'; }
- var xs = arrObjKeys(obj, inspect);
- if (indent && !singleLineValues(xs)) {
- return '[' + indentedJoin(xs, indent) + ']';
- }
- return '[ ' + $join.call(xs, ', ') + ' ]';
- }
- if (isError(obj)) {
- var parts = arrObjKeys(obj, inspect);
- if ('cause' in obj && !isEnumerable.call(obj, 'cause')) {
- return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
- }
- if (parts.length === 0) { return '[' + String(obj) + ']'; }
- return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
- }
- if (typeof obj === 'object' && customInspect) {
- if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
- return obj[inspectSymbol]();
- } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
- return obj.inspect();
- }
- }
- if (isMap(obj)) {
- var mapParts = [];
- mapForEach.call(obj, function (value, key) {
- mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
- });
- return collectionOf('Map', mapSize.call(obj), mapParts, indent);
- }
- if (isSet(obj)) {
- var setParts = [];
- setForEach.call(obj, function (value) {
- setParts.push(inspect(value, obj));
- });
- return collectionOf('Set', setSize.call(obj), setParts, indent);
- }
- if (isWeakMap(obj)) {
- return weakCollectionOf('WeakMap');
- }
- if (isWeakSet(obj)) {
- return weakCollectionOf('WeakSet');
- }
- if (isWeakRef(obj)) {
- return weakCollectionOf('WeakRef');
- }
- if (isNumber(obj)) {
- return markBoxed(inspect(Number(obj)));
- }
- if (isBigInt(obj)) {
- return markBoxed(inspect(bigIntValueOf.call(obj)));
- }
- if (isBoolean(obj)) {
- return markBoxed(booleanValueOf.call(obj));
- }
- if (isString(obj)) {
- return markBoxed(inspect(String(obj)));
- }
- if (!isDate(obj) && !isRegExp(obj)) {
- var ys = arrObjKeys(obj, inspect);
- var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
- var protoTag = obj instanceof Object ? '' : 'null prototype';
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
- var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
- var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
- if (ys.length === 0) { return tag + '{}'; }
- if (indent) {
- return tag + '{' + indentedJoin(ys, indent) + '}';
- }
- return tag + '{ ' + $join.call(ys, ', ') + ' }';
- }
- return String(obj);
-};
-
-function wrapQuotes(s, defaultStyle, opts) {
- var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
- return quoteChar + s + quoteChar;
+function assemble (fn, context, strategy, cache, serialize) {
+ return strategy.bind(
+ context,
+ fn,
+ cache,
+ serialize
+ )
}
-function quote(s) {
- return $replace.call(String(s), /"/g, '"');
+function strategyDefault (fn, options) {
+ var strategy = fn.length === 1 ? monadic : variadic
+
+ return assemble(
+ fn,
+ this,
+ strategy,
+ options.cache.create(),
+ options.serializer
+ )
}
-function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
-function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
-function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
-function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
-function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
-function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
-function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
+function strategyVariadic (fn, options) {
+ var strategy = variadic
-// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
-function isSymbol(obj) {
- if (hasShammedSymbols) {
- return obj && typeof obj === 'object' && obj instanceof Symbol;
- }
- if (typeof obj === 'symbol') {
- return true;
- }
- if (!obj || typeof obj !== 'object' || !symToString) {
- return false;
- }
- try {
- symToString.call(obj);
- return true;
- } catch (e) {}
- return false;
+ return assemble(
+ fn,
+ this,
+ strategy,
+ options.cache.create(),
+ options.serializer
+ )
}
-function isBigInt(obj) {
- if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
- return false;
- }
- try {
- bigIntValueOf.call(obj);
- return true;
- } catch (e) {}
- return false;
-}
+function strategyMonadic (fn, options) {
+ var strategy = monadic
-var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
-function has(obj, key) {
- return hasOwn.call(obj, key);
+ return assemble(
+ fn,
+ this,
+ strategy,
+ options.cache.create(),
+ options.serializer
+ )
}
-function toStr(obj) {
- return objectToString.call(obj);
-}
+//
+// Serializer
+//
-function nameOf(f) {
- if (f.name) { return f.name; }
- var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
- if (m) { return m[1]; }
- return null;
+function serializerDefault () {
+ return JSON.stringify(arguments)
}
-function indexOf(xs, x) {
- if (xs.indexOf) { return xs.indexOf(x); }
- for (var i = 0, l = xs.length; i < l; i++) {
- if (xs[i] === x) { return i; }
- }
- return -1;
-}
+//
+// Cache
+//
-function isMap(x) {
- if (!mapSize || !x || typeof x !== 'object') {
- return false;
- }
- try {
- mapSize.call(x);
- try {
- setSize.call(x);
- } catch (s) {
- return true;
- }
- return x instanceof Map; // core-js workaround, pre-v2.5.0
- } catch (e) {}
- return false;
+function ObjectWithoutPrototypeCache () {
+ this.cache = Object.create(null)
}
-function isWeakMap(x) {
- if (!weakMapHas || !x || typeof x !== 'object') {
- return false;
- }
- try {
- weakMapHas.call(x, weakMapHas);
- try {
- weakSetHas.call(x, weakSetHas);
- } catch (s) {
- return true;
- }
- return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
- } catch (e) {}
- return false;
+ObjectWithoutPrototypeCache.prototype.has = function (key) {
+ return (key in this.cache)
}
-function isWeakRef(x) {
- if (!weakRefDeref || !x || typeof x !== 'object') {
- return false;
- }
- try {
- weakRefDeref.call(x);
- return true;
- } catch (e) {}
- return false;
+ObjectWithoutPrototypeCache.prototype.get = function (key) {
+ return this.cache[key]
}
-function isSet(x) {
- if (!setSize || !x || typeof x !== 'object') {
- return false;
- }
- try {
- setSize.call(x);
- try {
- mapSize.call(x);
- } catch (m) {
- return true;
- }
- return x instanceof Set; // core-js workaround, pre-v2.5.0
- } catch (e) {}
- return false;
+ObjectWithoutPrototypeCache.prototype.set = function (key, value) {
+ this.cache[key] = value
}
-function isWeakSet(x) {
- if (!weakSetHas || !x || typeof x !== 'object') {
- return false;
- }
- try {
- weakSetHas.call(x, weakSetHas);
- try {
- weakMapHas.call(x, weakMapHas);
- } catch (s) {
- return true;
- }
- return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
- } catch (e) {}
- return false;
+var cacheDefault = {
+ create: function create () {
+ return new ObjectWithoutPrototypeCache()
+ }
}
-function isElement(x) {
- if (!x || typeof x !== 'object') { return false; }
- if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
- return true;
- }
- return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
-}
+//
+// API
+//
-function inspectString(str, opts) {
- if (str.length > opts.maxStringLength) {
- var remaining = str.length - opts.maxStringLength;
- var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
- return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
- }
- // eslint-disable-next-line no-control-regex
- var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
- return wrapQuotes(s, 'single', opts);
+module.exports = memoize
+module.exports.strategies = {
+ variadic: strategyVariadic,
+ monadic: strategyMonadic
}
-function lowbyte(c) {
- var n = c.charCodeAt(0);
- var x = {
- 8: 'b',
- 9: 't',
- 10: 'n',
- 12: 'f',
- 13: 'r'
- }[n];
- if (x) { return '\\' + x; }
- return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
-}
-function markBoxed(str) {
- return 'Object(' + str + ')';
-}
+/***/ }),
-function weakCollectionOf(type) {
- return type + ' { ? }';
-}
+/***/ 3889:
+/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
-function collectionOf(type, size, entries, indent) {
- var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
- return type + ' (' + size + ') {' + joinedEntries + '}';
-}
+"use strict";
-function singleLineValues(xs) {
- for (var i = 0; i < xs.length; i++) {
- if (indexOf(xs[i], '\n') >= 0) {
- return false;
- }
- }
- return true;
-}
+// EXPORTS
+__webpack_require__.d(__webpack_exports__, {
+ "Z": function() { return /* binding */ is_prop_valid_browser_esm; }
+});
-function getIndent(opts, depth) {
- var baseIndent;
- if (opts.indent === '\t') {
- baseIndent = '\t';
- } else if (typeof opts.indent === 'number' && opts.indent > 0) {
- baseIndent = $join.call(Array(opts.indent + 1), ' ');
- } else {
- return null;
- }
- return {
- base: baseIndent,
- prev: $join.call(Array(depth + 1), baseIndent)
- };
+;// CONCATENATED MODULE: ./node_modules/framer-motion/node_modules/@emotion/memoize/dist/memoize.browser.esm.js
+function memoize(fn) {
+ var cache = {};
+ return function (arg) {
+ if (cache[arg] === undefined) cache[arg] = fn(arg);
+ return cache[arg];
+ };
}
-function indentedJoin(xs, indent) {
- if (xs.length === 0) { return ''; }
- var lineJoiner = '\n' + indent.prev + indent.base;
- return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
-}
+/* harmony default export */ var memoize_browser_esm = (memoize);
-function arrObjKeys(obj, inspect) {
- var isArr = isArray(obj);
- var xs = [];
- if (isArr) {
- xs.length = obj.length;
- for (var i = 0; i < obj.length; i++) {
- xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
- }
- }
- var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
- var symMap;
- if (hasShammedSymbols) {
- symMap = {};
- for (var k = 0; k < syms.length; k++) {
- symMap['$' + syms[k]] = syms[k];
- }
- }
+;// CONCATENATED MODULE: ./node_modules/framer-motion/node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js
- for (var key in obj) { // eslint-disable-line no-restricted-syntax
- if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
- if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
- if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
- // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
- continue; // eslint-disable-line no-restricted-syntax, no-continue
- } else if ($test.call(/[^\w$]/, key)) {
- xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
- } else {
- xs.push(key + ': ' + inspect(obj[key], obj));
- }
- }
- if (typeof gOPS === 'function') {
- for (var j = 0; j < syms.length; j++) {
- if (isEnumerable.call(obj, syms[j])) {
- xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
- }
- }
- }
- return xs;
+
+var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
+
+var index = memoize_browser_esm(function (prop) {
+ return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
+ /* o */
+ && prop.charCodeAt(1) === 110
+ /* n */
+ && prop.charCodeAt(2) < 91;
}
+/* Z+1 */
+);
+
+/* harmony default export */ var is_prop_valid_browser_esm = (index);
/***/ }),
-/***/ "50qU":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 9930:
+/***/ (function(module) {
"use strict";
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+/* eslint no-invalid-this: 1 */
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
+var slice = Array.prototype.slice;
+var toStr = Object.prototype.toString;
+var funcType = '[object Function]';
-var _react = __webpack_require__("cDcd");
+module.exports = function bind(that) {
+ var target = this;
+ if (typeof target !== 'function' || toStr.call(target) !== funcType) {
+ throw new TypeError(ERROR_MESSAGE + target);
+ }
+ var args = slice.call(arguments, 1);
-var _react2 = _interopRequireDefault(_react);
+ var bound;
+ var binder = function () {
+ if (this instanceof bound) {
+ var result = target.apply(
+ this,
+ args.concat(slice.call(arguments))
+ );
+ if (Object(result) === result) {
+ return result;
+ }
+ return this;
+ } else {
+ return target.apply(
+ that,
+ args.concat(slice.call(arguments))
+ );
+ }
+ };
-var _propTypes = __webpack_require__("17x9");
+ var boundLength = Math.max(0, target.length - args.length);
+ var boundArgs = [];
+ for (var i = 0; i < boundLength; i++) {
+ boundArgs.push('$' + i);
+ }
-var _propTypes2 = _interopRequireDefault(_propTypes);
+ bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
-var _airbnbPropTypes = __webpack_require__("Hsqg");
+ if (target.prototype) {
+ var Empty = function Empty() {};
+ Empty.prototype = target.prototype;
+ bound.prototype = new Empty();
+ Empty.prototype = null;
+ }
-var _consolidatedEvents = __webpack_require__("1TsT");
+ return bound;
+};
-var _object = __webpack_require__("4cSd");
-var _object2 = _interopRequireDefault(_object);
+/***/ }),
-var _document = __webpack_require__("n1Y7");
+/***/ 1930:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-var _document2 = _interopRequireDefault(_document);
+"use strict";
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+var implementation = __webpack_require__(9930);
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+module.exports = Function.prototype.bind || implementation;
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-var DISPLAY = {
- BLOCK: 'block',
- FLEX: 'flex',
- INLINE: 'inline',
- INLINE_BLOCK: 'inline-block',
- CONTENTS: 'contents'
-};
+/***/ }),
-var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({
- children: _propTypes2['default'].node.isRequired,
- onOutsideClick: _propTypes2['default'].func.isRequired,
- disabled: _propTypes2['default'].bool,
- useCapture: _propTypes2['default'].bool,
- display: _propTypes2['default'].oneOf((0, _object2['default'])(DISPLAY))
-});
+/***/ 1801:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-var defaultProps = {
- disabled: false,
+"use strict";
- // `useCapture` is set to true by default so that a `stopPropagation` in the
- // children will not prevent all outside click handlers from firing - maja
- useCapture: true,
- display: DISPLAY.BLOCK
-};
-var OutsideClickHandler = function (_React$Component) {
- _inherits(OutsideClickHandler, _React$Component);
+/* globals
+ AggregateError,
+ Atomics,
+ FinalizationRegistry,
+ SharedArrayBuffer,
+ WeakRef,
+*/
- function OutsideClickHandler() {
- var _ref;
+var undefined;
- _classCallCheck(this, OutsideClickHandler);
+var $SyntaxError = SyntaxError;
+var $Function = Function;
+var $TypeError = TypeError;
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
+// eslint-disable-next-line consistent-return
+var getEvalledConstructor = function (expressionSyntax) {
+ try {
+ // eslint-disable-next-line no-new-func
+ return Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
+ } catch (e) {}
+};
- var _this = _possibleConstructorReturn(this, (_ref = OutsideClickHandler.__proto__ || Object.getPrototypeOf(OutsideClickHandler)).call.apply(_ref, [this].concat(args)));
+var $gOPD = Object.getOwnPropertyDescriptor;
+if ($gOPD) {
+ try {
+ $gOPD({}, '');
+ } catch (e) {
+ $gOPD = null; // this is IE 8, which has a broken gOPD
+ }
+}
- _this.onMouseDown = _this.onMouseDown.bind(_this);
- _this.onMouseUp = _this.onMouseUp.bind(_this);
- _this.setChildNodeRef = _this.setChildNodeRef.bind(_this);
- return _this;
- }
+var throwTypeError = function () {
+ throw new $TypeError();
+};
+var ThrowTypeError = $gOPD
+ ? (function () {
+ try {
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
+ arguments.callee; // IE 8 does not throw here
+ return throwTypeError;
+ } catch (calleeThrows) {
+ try {
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
+ return $gOPD(arguments, 'callee').get;
+ } catch (gOPDthrows) {
+ return throwTypeError;
+ }
+ }
+ }())
+ : throwTypeError;
- _createClass(OutsideClickHandler, [{
- key: 'componentDidMount',
- value: function () {
- function componentDidMount() {
- var _props = this.props,
- disabled = _props.disabled,
- useCapture = _props.useCapture;
+var hasSymbols = __webpack_require__(9905)();
+var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
- if (!disabled) this.addMouseDownEventListener(useCapture);
- }
+var asyncGenFunction = getEvalledConstructor('async function* () {}');
+var asyncGenFunctionPrototype = asyncGenFunction ? asyncGenFunction.prototype : undefined;
+var asyncGenPrototype = asyncGenFunctionPrototype ? asyncGenFunctionPrototype.prototype : undefined;
- return componentDidMount;
- }()
- }, {
- key: 'componentDidUpdate',
- value: function () {
- function componentDidUpdate(_ref2) {
- var prevDisabled = _ref2.disabled;
- var _props2 = this.props,
- disabled = _props2.disabled,
- useCapture = _props2.useCapture;
+var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
- if (prevDisabled !== disabled) {
- if (disabled) {
- this.removeEventListeners();
- } else {
- this.addMouseDownEventListener(useCapture);
- }
- }
- }
+var INTRINSICS = {
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
+ '%Array%': Array,
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
+ '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
+ '%AsyncFromSyncIteratorPrototype%': undefined,
+ '%AsyncFunction%': getEvalledConstructor('async function () {}'),
+ '%AsyncGenerator%': asyncGenFunctionPrototype,
+ '%AsyncGeneratorFunction%': asyncGenFunction,
+ '%AsyncIteratorPrototype%': asyncGenPrototype ? getProto(asyncGenPrototype) : undefined,
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
+ '%Boolean%': Boolean,
+ '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
+ '%Date%': Date,
+ '%decodeURI%': decodeURI,
+ '%decodeURIComponent%': decodeURIComponent,
+ '%encodeURI%': encodeURI,
+ '%encodeURIComponent%': encodeURIComponent,
+ '%Error%': Error,
+ '%eval%': eval, // eslint-disable-line no-eval
+ '%EvalError%': EvalError,
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
+ '%Function%': $Function,
+ '%GeneratorFunction%': getEvalledConstructor('function* () {}'),
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
+ '%isFinite%': isFinite,
+ '%isNaN%': isNaN,
+ '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined,
+ '%Map%': typeof Map === 'undefined' ? undefined : Map,
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
+ '%Math%': Math,
+ '%Number%': Number,
+ '%Object%': Object,
+ '%parseFloat%': parseFloat,
+ '%parseInt%': parseInt,
+ '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
+ '%RangeError%': RangeError,
+ '%ReferenceError%': ReferenceError,
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
+ '%RegExp%': RegExp,
+ '%Set%': typeof Set === 'undefined' ? undefined : Set,
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
+ '%String%': String,
+ '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
+ '%Symbol%': hasSymbols ? Symbol : undefined,
+ '%SyntaxError%': $SyntaxError,
+ '%ThrowTypeError%': ThrowTypeError,
+ '%TypedArray%': TypedArray,
+ '%TypeError%': $TypeError,
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
+ '%URIError%': URIError,
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
+};
- return componentDidUpdate;
- }()
- }, {
- key: 'componentWillUnmount',
- value: function () {
- function componentWillUnmount() {
- this.removeEventListeners();
- }
+var LEGACY_ALIASES = {
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
+ '%ArrayPrototype%': ['Array', 'prototype'],
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
+ '%DataViewPrototype%': ['DataView', 'prototype'],
+ '%DatePrototype%': ['Date', 'prototype'],
+ '%ErrorPrototype%': ['Error', 'prototype'],
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
+ '%FunctionPrototype%': ['Function', 'prototype'],
+ '%Generator%': ['GeneratorFunction', 'prototype'],
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
+ '%JSONParse%': ['JSON', 'parse'],
+ '%JSONStringify%': ['JSON', 'stringify'],
+ '%MapPrototype%': ['Map', 'prototype'],
+ '%NumberPrototype%': ['Number', 'prototype'],
+ '%ObjectPrototype%': ['Object', 'prototype'],
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
+ '%PromisePrototype%': ['Promise', 'prototype'],
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
+ '%Promise_all%': ['Promise', 'all'],
+ '%Promise_reject%': ['Promise', 'reject'],
+ '%Promise_resolve%': ['Promise', 'resolve'],
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
+ '%SetPrototype%': ['Set', 'prototype'],
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
+ '%StringPrototype%': ['String', 'prototype'],
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
+};
- return componentWillUnmount;
- }()
+var bind = __webpack_require__(1930);
+var hasOwn = __webpack_require__(9284);
+var $concat = bind.call(Function.call, Array.prototype.concat);
+var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
+var $replace = bind.call(Function.call, String.prototype.replace);
+var $strSlice = bind.call(Function.call, String.prototype.slice);
- // Use mousedown/mouseup to enforce that clicks remain outside the root's
- // descendant tree, even when dragged. This should also get triggered on
- // touch devices.
+/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
+var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
+var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
+var stringToPath = function stringToPath(string) {
+ var first = $strSlice(string, 0, 1);
+ var last = $strSlice(string, -1);
+ if (first === '%' && last !== '%') {
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
+ } else if (last === '%' && first !== '%') {
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
+ }
+ var result = [];
+ $replace(string, rePropName, function (match, number, quote, subString) {
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
+ });
+ return result;
+};
+/* end adaptation */
- }, {
- key: 'onMouseDown',
- value: function () {
- function onMouseDown(e) {
- var useCapture = this.props.useCapture;
+var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
+ var intrinsicName = name;
+ var alias;
+ if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
+ alias = LEGACY_ALIASES[intrinsicName];
+ intrinsicName = '%' + alias[0] + '%';
+ }
+ if (hasOwn(INTRINSICS, intrinsicName)) {
+ var value = INTRINSICS[intrinsicName];
+ if (typeof value === 'undefined' && !allowMissing) {
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
+ }
- var isDescendantOfRoot = this.childNode && (0, _document2['default'])(this.childNode, e.target);
- if (!isDescendantOfRoot) {
- if (this.removeMouseUp) {
- this.removeMouseUp();
- this.removeMouseUp = null;
- }
- this.removeMouseUp = (0, _consolidatedEvents.addEventListener)(document, 'mouseup', this.onMouseUp, { capture: useCapture });
- }
- }
+ return {
+ alias: alias,
+ name: intrinsicName,
+ value: value
+ };
+ }
- return onMouseDown;
- }()
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
+};
- // Use mousedown/mouseup to enforce that clicks remain outside the root's
- // descendant tree, even when dragged. This should also get triggered on
- // touch devices.
+module.exports = function GetIntrinsic(name, allowMissing) {
+ if (typeof name !== 'string' || name.length === 0) {
+ throw new $TypeError('intrinsic name must be a non-empty string');
+ }
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
+ throw new $TypeError('"allowMissing" argument must be a boolean');
+ }
- }, {
- key: 'onMouseUp',
- value: function () {
- function onMouseUp(e) {
- var onOutsideClick = this.props.onOutsideClick;
+ var parts = stringToPath(name);
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
+ var intrinsicRealName = intrinsic.name;
+ var value = intrinsic.value;
+ var skipFurtherCaching = false;
- var isDescendantOfRoot = this.childNode && (0, _document2['default'])(this.childNode, e.target);
- if (this.removeMouseUp) {
- this.removeMouseUp();
- this.removeMouseUp = null;
- }
+ var alias = intrinsic.alias;
+ if (alias) {
+ intrinsicBaseName = alias[0];
+ $spliceApply(parts, $concat([0, 1], alias));
+ }
- if (!isDescendantOfRoot) {
- onOutsideClick(e);
- }
- }
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
+ var part = parts[i];
+ var first = $strSlice(part, 0, 1);
+ var last = $strSlice(part, -1);
+ if (
+ (
+ (first === '"' || first === "'" || first === '`')
+ || (last === '"' || last === "'" || last === '`')
+ )
+ && first !== last
+ ) {
+ throw new $SyntaxError('property names with quotes must have matching quotes');
+ }
+ if (part === 'constructor' || !isOwn) {
+ skipFurtherCaching = true;
+ }
- return onMouseUp;
- }()
- }, {
- key: 'setChildNodeRef',
- value: function () {
- function setChildNodeRef(ref) {
- this.childNode = ref;
- }
+ intrinsicBaseName += '.' + part;
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
- return setChildNodeRef;
- }()
- }, {
- key: 'addMouseDownEventListener',
- value: function () {
- function addMouseDownEventListener(useCapture) {
- this.removeMouseDown = (0, _consolidatedEvents.addEventListener)(document, 'mousedown', this.onMouseDown, { capture: useCapture });
- }
+ if (hasOwn(INTRINSICS, intrinsicRealName)) {
+ value = INTRINSICS[intrinsicRealName];
+ } else if (value != null) {
+ if (!(part in value)) {
+ if (!allowMissing) {
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
+ }
+ return void undefined;
+ }
+ if ($gOPD && (i + 1) >= parts.length) {
+ var desc = $gOPD(value, part);
+ isOwn = !!desc;
- return addMouseDownEventListener;
- }()
- }, {
- key: 'removeEventListeners',
- value: function () {
- function removeEventListeners() {
- if (this.removeMouseDown) this.removeMouseDown();
- if (this.removeMouseUp) this.removeMouseUp();
- }
+ // By convention, when a data property is converted to an accessor
+ // property to emulate a data property that does not suffer from
+ // the override mistake, that accessor's getter is marked with
+ // an `originalValue` property. Here, when we detect this, we
+ // uphold the illusion by pretending to see that original data
+ // property, i.e., returning the value rather than the getter
+ // itself.
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
+ value = desc.get;
+ } else {
+ value = value[part];
+ }
+ } else {
+ isOwn = hasOwn(value, part);
+ value = value[part];
+ }
- return removeEventListeners;
- }()
- }, {
- key: 'render',
- value: function () {
- function render() {
- var _props3 = this.props,
- children = _props3.children,
- display = _props3.display;
+ if (isOwn && !skipFurtherCaching) {
+ INTRINSICS[intrinsicRealName] = value;
+ }
+ }
+ }
+ return value;
+};
- return _react2['default'].createElement(
- 'div',
- {
- ref: this.setChildNodeRef,
- style: display !== DISPLAY.BLOCK && (0, _object2['default'])(DISPLAY).includes(display) ? { display: display } : undefined
- },
- children
- );
- }
+/***/ }),
- return render;
- }()
- }]);
+/***/ 5371:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- return OutsideClickHandler;
-}(_react2['default'].Component);
+"use strict";
-exports['default'] = OutsideClickHandler;
+var define = __webpack_require__(9170);
+var isSymbol = __webpack_require__(3082);
-OutsideClickHandler.propTypes = propTypes;
-OutsideClickHandler.defaultProps = defaultProps;
+var globalKey = '__ global cache key __';
+/* istanbul ignore else */
+// eslint-disable-next-line no-restricted-properties
+if (typeof Symbol === 'function' && isSymbol(Symbol('foo')) && typeof Symbol['for'] === 'function') {
+ // eslint-disable-next-line no-restricted-properties
+ globalKey = Symbol['for'](globalKey);
+}
-/***/ }),
+var trueThunk = function () {
+ return true;
+};
-/***/ "5V/u":
-/***/ (function(module, exports) {
+var ensureCache = function ensureCache() {
+ if (!__webpack_require__.g[globalKey]) {
+ var properties = {};
+ properties[globalKey] = {};
+ var predicates = {};
+ predicates[globalKey] = trueThunk;
+ define(__webpack_require__.g, properties, predicates);
+ }
+ return __webpack_require__.g[globalKey];
+};
-module.exports =
-/******/ (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] = {
-/******/ exports: {},
-/******/ id: moduleId,
-/******/ loaded: false
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-/******/
-/******/ // Flag the module as loaded
-/******/ module.loaded = 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;
-/******/
-/******/ // __webpack_public_path__
-/******/ __webpack_require__.p = "";
-/******/
-/******/ // Load entry module and return exports
-/******/ return __webpack_require__(0);
-/******/ })
-/************************************************************************/
-/******/ ([
-/* 0 */
-/***/ (function(module, exports, __webpack_require__) {
+var cache = ensureCache();
- module.exports = __webpack_require__(1);
+var isPrimitive = function isPrimitive(val) {
+ return val === null || (typeof val !== 'object' && typeof val !== 'function');
+};
+var getPrimitiveKey = function getPrimitiveKey(val) {
+ if (isSymbol(val)) {
+ return Symbol.prototype.valueOf.call(val);
+ }
+ return typeof val + ' | ' + String(val);
+};
-/***/ }),
-/* 1 */
-/***/ (function(module, exports, __webpack_require__) {
+var requirePrimitiveKey = function requirePrimitiveKey(val) {
+ if (!isPrimitive(val)) {
+ throw new TypeError('key must not be an object');
+ }
+};
- 'use strict';
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _utils = __webpack_require__(2);
-
- Object.defineProperty(exports, 'combineChunks', {
- enumerable: true,
- get: function get() {
- return _utils.combineChunks;
- }
- });
- Object.defineProperty(exports, 'fillInChunks', {
- enumerable: true,
- get: function get() {
- return _utils.fillInChunks;
- }
- });
- Object.defineProperty(exports, 'findAll', {
- enumerable: true,
- get: function get() {
- return _utils.findAll;
- }
- });
- Object.defineProperty(exports, 'findChunks', {
- enumerable: true,
- get: function get() {
- return _utils.findChunks;
- }
- });
+var globalCache = {
+ clear: function clear() {
+ delete __webpack_require__.g[globalKey];
+ cache = ensureCache();
+ },
-/***/ }),
-/* 2 */
-/***/ (function(module, exports) {
+ 'delete': function deleteKey(key) {
+ requirePrimitiveKey(key);
+ delete cache[getPrimitiveKey(key)];
+ return !globalCache.has(key);
+ },
- 'use strict';
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
-
- /**
- * Creates an array of chunk objects representing both higlightable and non highlightable pieces of text that match each search word.
- * @return Array of "chunks" (where a Chunk is { start:number, end:number, highlight:boolean })
- */
- var findAll = exports.findAll = function findAll(_ref) {
- var autoEscape = _ref.autoEscape,
- _ref$caseSensitive = _ref.caseSensitive,
- caseSensitive = _ref$caseSensitive === undefined ? false : _ref$caseSensitive,
- _ref$findChunks = _ref.findChunks,
- findChunks = _ref$findChunks === undefined ? defaultFindChunks : _ref$findChunks,
- sanitize = _ref.sanitize,
- searchWords = _ref.searchWords,
- textToHighlight = _ref.textToHighlight;
- return fillInChunks({
- chunksToHighlight: combineChunks({
- chunks: findChunks({
- autoEscape: autoEscape,
- caseSensitive: caseSensitive,
- sanitize: sanitize,
- searchWords: searchWords,
- textToHighlight: textToHighlight
- })
- }),
- totalLength: textToHighlight ? textToHighlight.length : 0
- });
- };
-
- /**
- * Takes an array of {start:number, end:number} objects and combines chunks that overlap into single chunks.
- * @return {start:number, end:number}[]
- */
-
-
- var combineChunks = exports.combineChunks = function combineChunks(_ref2) {
- var chunks = _ref2.chunks;
-
- chunks = chunks.sort(function (first, second) {
- return first.start - second.start;
- }).reduce(function (processedChunks, nextChunk) {
- // First chunk just goes straight in the array...
- if (processedChunks.length === 0) {
- return [nextChunk];
- } else {
- // ... subsequent chunks get checked to see if they overlap...
- var prevChunk = processedChunks.pop();
- if (nextChunk.start <= prevChunk.end) {
- // It may be the case that prevChunk completely surrounds nextChunk, so take the
- // largest of the end indeces.
- var endIndex = Math.max(prevChunk.end, nextChunk.end);
- processedChunks.push({ highlight: false, start: prevChunk.start, end: endIndex });
- } else {
- processedChunks.push(prevChunk, nextChunk);
- }
- return processedChunks;
- }
- }, []);
-
- return chunks;
- };
-
- /**
- * Examine text for any matches.
- * If we find matches, add them to the returned array as a "chunk" object ({start:number, end:number}).
- * @return {start:number, end:number}[]
- */
- var defaultFindChunks = function defaultFindChunks(_ref3) {
- var autoEscape = _ref3.autoEscape,
- caseSensitive = _ref3.caseSensitive,
- _ref3$sanitize = _ref3.sanitize,
- sanitize = _ref3$sanitize === undefined ? defaultSanitize : _ref3$sanitize,
- searchWords = _ref3.searchWords,
- textToHighlight = _ref3.textToHighlight;
-
- textToHighlight = sanitize(textToHighlight);
-
- return searchWords.filter(function (searchWord) {
- return searchWord;
- }) // Remove empty words
- .reduce(function (chunks, searchWord) {
- searchWord = sanitize(searchWord);
-
- if (autoEscape) {
- searchWord = escapeRegExpFn(searchWord);
- }
-
- var regex = new RegExp(searchWord, caseSensitive ? 'g' : 'gi');
-
- var match = void 0;
- while (match = regex.exec(textToHighlight)) {
- var _start = match.index;
- var _end = regex.lastIndex;
- // We do not return zero-length matches
- if (_end > _start) {
- chunks.push({ highlight: false, start: _start, end: _end });
- }
-
- // Prevent browsers like Firefox from getting stuck in an infinite loop
- // See http://www.regexguru.com/2008/04/watch-out-for-zero-length-matches/
- if (match.index === regex.lastIndex) {
- regex.lastIndex++;
- }
- }
-
- return chunks;
- }, []);
- };
- // Allow the findChunks to be overridden in findAll,
- // but for backwards compatibility we export as the old name
- exports.findChunks = defaultFindChunks;
-
- /**
- * Given a set of chunks to highlight, create an additional set of chunks
- * to represent the bits of text between the highlighted text.
- * @param chunksToHighlight {start:number, end:number}[]
- * @param totalLength number
- * @return {start:number, end:number, highlight:boolean}[]
- */
-
- var fillInChunks = exports.fillInChunks = function fillInChunks(_ref4) {
- var chunksToHighlight = _ref4.chunksToHighlight,
- totalLength = _ref4.totalLength;
-
- var allChunks = [];
- var append = function append(start, end, highlight) {
- if (end - start > 0) {
- allChunks.push({
- start: start,
- end: end,
- highlight: highlight
- });
- }
- };
-
- if (chunksToHighlight.length === 0) {
- append(0, totalLength, false);
- } else {
- var lastIndex = 0;
- chunksToHighlight.forEach(function (chunk) {
- append(lastIndex, chunk.start, false);
- append(chunk.start, chunk.end, true);
- lastIndex = chunk.end;
- });
- append(lastIndex, totalLength, false);
- }
- return allChunks;
- };
-
- function defaultSanitize(string) {
- return string;
- }
-
- function escapeRegExpFn(string) {
- return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
- }
-
-/***/ })
-/******/ ]);
-
-
-/***/ }),
-
-/***/ "5aBA":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/** @license React v17.0.2
- * react-is.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-var b=60103,c=60106,d=60107,e=60108,f=60114,g=60109,h=60110,k=60112,l=60113,m=60120,n=60115,p=60116,q=60121,r=60122,u=60117,v=60129,w=60131;
-if("function"===typeof Symbol&&Symbol.for){var x=Symbol.for;b=x("react.element");c=x("react.portal");d=x("react.fragment");e=x("react.strict_mode");f=x("react.profiler");g=x("react.provider");h=x("react.context");k=x("react.forward_ref");l=x("react.suspense");m=x("react.suspense_list");n=x("react.memo");p=x("react.lazy");q=x("react.block");r=x("react.server.block");u=x("react.fundamental");v=x("react.debug_trace_mode");w=x("react.legacy_hidden")}
-function y(a){if("object"===typeof a&&null!==a){var t=a.$$typeof;switch(t){case b:switch(a=a.type,a){case d:case f:case e:case l:case m:return a;default:switch(a=a&&a.$$typeof,a){case h:case k:case p:case n:case g:return a;default:return t}}case c:return t}}}var z=g,A=b,B=k,C=d,D=p,E=n,F=c,G=f,H=e,I=l;exports.ContextConsumer=h;exports.ContextProvider=z;exports.Element=A;exports.ForwardRef=B;exports.Fragment=C;exports.Lazy=D;exports.Memo=E;exports.Portal=F;exports.Profiler=G;exports.StrictMode=H;
-exports.Suspense=I;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return y(a)===h};exports.isContextProvider=function(a){return y(a)===g};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return y(a)===k};exports.isFragment=function(a){return y(a)===d};exports.isLazy=function(a){return y(a)===p};exports.isMemo=function(a){return y(a)===n};
-exports.isPortal=function(a){return y(a)===c};exports.isProfiler=function(a){return y(a)===f};exports.isStrictMode=function(a){return y(a)===e};exports.isSuspense=function(a){return y(a)===l};exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===d||a===f||a===v||a===e||a===l||a===m||a===w||"object"===typeof a&&null!==a&&(a.$$typeof===p||a.$$typeof===n||a.$$typeof===g||a.$$typeof===h||a.$$typeof===k||a.$$typeof===u||a.$$typeof===q||a[0]===r)?!0:!1};
-exports.typeOf=y;
-
-
-/***/ }),
-
-/***/ "5yQQ":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
+ get: function get(key) {
+ requirePrimitiveKey(key);
+ return cache[getPrimitiveKey(key)];
+ },
+ has: function has(key) {
+ requirePrimitiveKey(key);
+ return getPrimitiveKey(key) in cache;
+ },
-var implementation = __webpack_require__("nRDI");
+ set: function set(key, value) {
+ requirePrimitiveKey(key);
+ var primitiveKey = getPrimitiveKey(key);
+ var props = {};
+ props[primitiveKey] = value;
+ var predicates = {};
+ predicates[primitiveKey] = trueThunk;
+ define(cache, props, predicates);
+ return globalCache.has(key);
+ },
-module.exports = function getPolyfill() {
- if (typeof document !== 'undefined') {
- if (document.contains) {
- return document.contains;
- }
- if (document.body && document.body.contains) {
- try {
- if (typeof document.body.contains.call(document, '') === 'boolean') {
- return document.body.contains;
- }
- } catch (e) { /**/ }
+ setIfMissingThenGet: function setIfMissingThenGet(key, valueThunk) {
+ if (globalCache.has(key)) {
+ return globalCache.get(key);
}
+ var item = valueThunk();
+ globalCache.set(key, item);
+ return item;
}
- return implementation;
};
+module.exports = globalCache;
-/***/ }),
-
-/***/ "6/BL":
-/***/ (function(module, exports, __webpack_require__) {
-"use strict";
+/***/ }),
+/***/ 7115:
+/***/ (function(__unused_webpack_module, exports) {
-var has = __webpack_require__("oNNP");
+// Copyright (c) 2014 Rafael Caricio. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
-var assertRecord = __webpack_require__("10Kj");
+var GradientParser = {};
-var Type = __webpack_require__("PoQ0");
+GradientParser.parse = (function() {
-// https://ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor
+ var tokens = {
+ linearGradient: /^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,
+ repeatingLinearGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,
+ radialGradient: /^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,
+ repeatingRadialGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,
+ sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,
+ extentKeywords: /^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,
+ positionKeywords: /^(left|center|right|top|bottom)/i,
+ pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,
+ percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,
+ emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,
+ angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,
+ startCall: /^\(/,
+ endCall: /^\)/,
+ comma: /^,/,
+ hexColor: /^\#([0-9a-fA-F]+)/,
+ literalColor: /^([a-zA-Z]+)/,
+ rgbColor: /^rgb/i,
+ rgbaColor: /^rgba/i,
+ number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/
+ };
-module.exports = function IsDataDescriptor(Desc) {
- if (typeof Desc === 'undefined') {
- return false;
- }
+ var input = '';
- assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
+ function error(msg) {
+ var err = new Error(input + ': ' + msg);
+ err.source = input;
+ throw err;
+ }
- if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {
- return false;
- }
+ function getAST() {
+ var ast = matchListDefinitions();
- return true;
-};
+ if (input.length > 0) {
+ error('Invalid input not EOF');
+ }
+ return ast;
+ }
-/***/ }),
+ function matchListDefinitions() {
+ return matchListing(matchDefinition);
+ }
-/***/ "60zJ":
-/***/ (function(module, exports, __webpack_require__) {
+ function matchDefinition() {
+ return matchGradient(
+ 'linear-gradient',
+ tokens.linearGradient,
+ matchLinearOrientation) ||
-"use strict";
+ matchGradient(
+ 'repeating-linear-gradient',
+ tokens.repeatingLinearGradient,
+ matchLinearOrientation) ||
+ matchGradient(
+ 'radial-gradient',
+ tokens.radialGradient,
+ matchListRadialOrientations) ||
-// https://262.ecma-international.org/5.1/#sec-8
+ matchGradient(
+ 'repeating-radial-gradient',
+ tokens.repeatingRadialGradient,
+ matchListRadialOrientations);
+ }
-module.exports = function Type(x) {
- if (x === null) {
- return 'Null';
- }
- if (typeof x === 'undefined') {
- return 'Undefined';
- }
- if (typeof x === 'function' || typeof x === 'object') {
- return 'Object';
- }
- if (typeof x === 'number') {
- return 'Number';
- }
- if (typeof x === 'boolean') {
- return 'Boolean';
- }
- if (typeof x === 'string') {
- return 'String';
- }
-};
+ function matchGradient(gradientType, pattern, orientationMatcher) {
+ return matchCall(pattern, function(captures) {
+ var orientation = orientationMatcher();
+ if (orientation) {
+ if (!scan(tokens.comma)) {
+ error('Missing comma before color stops');
+ }
+ }
-/***/ }),
+ return {
+ type: gradientType,
+ orientation: orientation,
+ colorStops: matchListing(matchColorStop)
+ };
+ });
+ }
-/***/ "6Ehn":
-/***/ (function(module, exports, __webpack_require__) {
+ function matchCall(pattern, callback) {
+ var captures = scan(pattern);
-"use strict";
+ if (captures) {
+ if (!scan(tokens.startCall)) {
+ error('Missing (');
+ }
+ result = callback(captures);
-var GetIntrinsic = __webpack_require__("j1Hc");
+ if (!scan(tokens.endCall)) {
+ error('Missing )');
+ }
-var $ArrayPrototype = GetIntrinsic('%Array.prototype%');
-var $RangeError = GetIntrinsic('%RangeError%');
-var $SyntaxError = GetIntrinsic('%SyntaxError%');
-var $TypeError = GetIntrinsic('%TypeError%');
+ return result;
+ }
+ }
-var IsIntegralNumber = __webpack_require__("J2ba");
+ function matchLinearOrientation() {
+ return matchSideOrCorner() ||
+ matchAngle();
+ }
-var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1;
+ function matchSideOrCorner() {
+ return match('directional', tokens.sideOrCorner, 1);
+ }
-var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || (
- // eslint-disable-next-line no-proto, no-negated-condition
- [].__proto__ !== $ArrayPrototype
- ? null
- : function (O, proto) {
- O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign
- return O;
- }
-);
+ function matchAngle() {
+ return match('angular', tokens.angleValue, 1);
+ }
-// https://www.ecma-international.org/ecma-262/12.0/#sec-arraycreate
+ function matchListRadialOrientations() {
+ var radialOrientations,
+ radialOrientation = matchRadialOrientation(),
+ lookaheadCache;
-module.exports = function ArrayCreate(length) {
- if (!IsIntegralNumber(length) || length < 0) {
- throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0');
- }
- if (length > MAX_ARRAY_LENGTH) {
- throw new $RangeError('length is greater than (2**32 - 1)');
- }
- var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype;
- var A = []; // steps 3, 5
- if (proto !== $ArrayPrototype) { // step 4
- if (!$setProto) {
- throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]');
- }
- $setProto(A, proto);
- }
- if (length !== 0) { // bypasses the need for step 6
- A.length = length;
- }
- /* step 6, the above as a shortcut for the below
- OrdinaryDefineOwnProperty(A, 'length', {
- '[[Configurable]]': false,
- '[[Enumerable]]': false,
- '[[Value]]': length,
- '[[Writable]]': true
- });
- */
- return A;
-};
+ if (radialOrientation) {
+ radialOrientations = [];
+ radialOrientations.push(radialOrientation);
+ lookaheadCache = input;
+ if (scan(tokens.comma)) {
+ radialOrientation = matchRadialOrientation();
+ if (radialOrientation) {
+ radialOrientations.push(radialOrientation);
+ } else {
+ input = lookaheadCache;
+ }
+ }
+ }
-/***/ }),
+ return radialOrientations;
+ }
-/***/ "6HWY":
-/***/ (function(module, exports, __webpack_require__) {
+ function matchRadialOrientation() {
+ var radialType = matchCircle() ||
+ matchEllipse();
-"use strict";
+ if (radialType) {
+ radialType.at = matchAtPosition();
+ } else {
+ var defaultPosition = matchPositioning();
+ if (defaultPosition) {
+ radialType = {
+ type: 'default-radial',
+ at: defaultPosition
+ };
+ }
+ }
+ return radialType;
+ }
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports['default'] = isNextMonth;
+ function matchCircle() {
+ var circle = match('shape', /^(circle)/i, 0);
-var _moment = __webpack_require__("wy2R");
+ if (circle) {
+ circle.style = matchLength() || matchExtentKeyword();
+ }
-var _moment2 = _interopRequireDefault(_moment);
+ return circle;
+ }
-var _isSameMonth = __webpack_require__("ulUS");
+ function matchEllipse() {
+ var ellipse = match('shape', /^(ellipse)/i, 0);
-var _isSameMonth2 = _interopRequireDefault(_isSameMonth);
+ if (ellipse) {
+ ellipse.style = matchDistance() || matchExtentKeyword();
+ }
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+ return ellipse;
+ }
-function isNextMonth(a, b) {
- if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
- return (0, _isSameMonth2['default'])(a.clone().add(1, 'month'), b);
-}
+ function matchExtentKeyword() {
+ return match('extent-keyword', tokens.extentKeywords, 1);
+ }
-/***/ }),
+ function matchAtPosition() {
+ if (match('position', /^at/, 0)) {
+ var positioning = matchPositioning();
-/***/ "6I5v":
-/***/ (function(module, exports, __webpack_require__) {
+ if (!positioning) {
+ error('Missing positioning value');
+ }
-"use strict";
+ return positioning;
+ }
+ }
+ function matchPositioning() {
+ var location = matchCoordinates();
-module.exports = function sign(number) {
- return number >= 0 ? 1 : -1;
-};
+ if (location.x || location.y) {
+ return {
+ type: 'position',
+ value: location
+ };
+ }
+ }
+ function matchCoordinates() {
+ return {
+ x: matchDistance(),
+ y: matchDistance()
+ };
+ }
-/***/ }),
+ function matchListing(matcher) {
+ var captures = matcher(),
+ result = [];
-/***/ "6XE+":
-/***/ (function(module, exports, __webpack_require__) {
+ if (captures) {
+ result.push(captures);
+ while (scan(tokens.comma)) {
+ captures = matcher();
+ if (captures) {
+ result.push(captures);
+ } else {
+ error('One extra comma');
+ }
+ }
+ }
-"use strict";
+ return result;
+ }
+ function matchColorStop() {
+ var color = matchColor();
-var GetIntrinsic = __webpack_require__("j1Hc");
-
-var $gOPD = __webpack_require__("knm9");
-var $TypeError = GetIntrinsic('%TypeError%');
-
-var callBound = __webpack_require__("qeuH");
-
-var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
-
-var has = __webpack_require__("oNNP");
-
-var IsArray = __webpack_require__("Bl8U");
-var IsPropertyKey = __webpack_require__("nR7C");
-var IsRegExp = __webpack_require__("a73V");
-var ToPropertyDescriptor = __webpack_require__("6orR");
-var Type = __webpack_require__("PoQ0");
-
-// https://ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty
-
-module.exports = function OrdinaryGetOwnProperty(O, P) {
- if (Type(O) !== 'Object') {
- throw new $TypeError('Assertion failed: O must be an Object');
- }
- if (!IsPropertyKey(P)) {
- throw new $TypeError('Assertion failed: P must be a Property Key');
- }
- if (!has(O, P)) {
- return void 0;
- }
- if (!$gOPD) {
- // ES3 / IE 8 fallback
- var arrayLength = IsArray(O) && P === 'length';
- var regexLastIndex = IsRegExp(O) && P === 'lastIndex';
- return {
- '[[Configurable]]': !(arrayLength || regexLastIndex),
- '[[Enumerable]]': $isEnumerable(O, P),
- '[[Value]]': O[P],
- '[[Writable]]': true
- };
- }
- return ToPropertyDescriptor($gOPD(O, P));
-};
-
-
-/***/ }),
-
-/***/ "6orR":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var has = __webpack_require__("oNNP");
-
-var GetIntrinsic = __webpack_require__("j1Hc");
-
-var $TypeError = GetIntrinsic('%TypeError%');
-
-var Type = __webpack_require__("PoQ0");
-var ToBoolean = __webpack_require__("e87w");
-var IsCallable = __webpack_require__("1P9b");
-
-// https://262.ecma-international.org/5.1/#sec-8.10.5
-
-module.exports = function ToPropertyDescriptor(Obj) {
- if (Type(Obj) !== 'Object') {
- throw new $TypeError('ToPropertyDescriptor requires an object');
- }
-
- var desc = {};
- if (has(Obj, 'enumerable')) {
- desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);
- }
- if (has(Obj, 'configurable')) {
- desc['[[Configurable]]'] = ToBoolean(Obj.configurable);
- }
- if (has(Obj, 'value')) {
- desc['[[Value]]'] = Obj.value;
- }
- if (has(Obj, 'writable')) {
- desc['[[Writable]]'] = ToBoolean(Obj.writable);
- }
- if (has(Obj, 'get')) {
- var getter = Obj.get;
- if (typeof getter !== 'undefined' && !IsCallable(getter)) {
- throw new $TypeError('getter must be a function');
- }
- desc['[[Get]]'] = getter;
- }
- if (has(Obj, 'set')) {
- var setter = Obj.set;
- if (typeof setter !== 'undefined' && !IsCallable(setter)) {
- throw new $TypeError('setter must be a function');
- }
- desc['[[Set]]'] = setter;
- }
-
- if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {
- throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
- }
- return desc;
-};
+ if (!color) {
+ error('Expected color definition');
+ }
+ color.length = matchDistance();
+ return color;
+ }
-/***/ }),
+ function matchColor() {
+ return matchHexColor() ||
+ matchRGBAColor() ||
+ matchRGBColor() ||
+ matchLiteralColor();
+ }
-/***/ "6zzY":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ function matchLiteralColor() {
+ return match('literal', tokens.literalColor, 0);
+ }
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/* unused harmony export ComponentsContext */
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return useComponentsContext; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ContextSystemProvider; });
-/* 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_warning__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Z23Y");
-/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_2__);
+ function matchHexColor() {
+ return match('hex', tokens.hexColor, 1);
+ }
+ function matchRGBColor() {
+ return matchCall(tokens.rgbColor, function() {
+ return {
+ type: 'rgb',
+ value: matchListing(matchNumber)
+ };
+ });
+ }
-/**
- * External dependencies
- */
+ function matchRGBAColor() {
+ return matchCall(tokens.rgbaColor, function() {
+ return {
+ type: 'rgba',
+ value: matchListing(matchNumber)
+ };
+ });
+ }
-/**
- * WordPress dependencies
- */
+ function matchNumber() {
+ return scan(tokens.number)[1];
+ }
+ function matchDistance() {
+ return match('%', tokens.percentageValue, 1) ||
+ matchPositionKeyword() ||
+ matchLength();
+ }
+ function matchPositionKeyword() {
+ return match('position-keyword', tokens.positionKeywords, 1);
+ }
-const ComponentsContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])(
-/** @type {Record<string, any>} */
-{});
-const useComponentsContext = () => Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useContext"])(ComponentsContext);
-/**
- * Runs an effect only on update (i.e., ignores the first render)
- *
- * @param {import('react').EffectCallback} effect
- * @param {import('react').DependencyList} deps
- */
+ function matchLength() {
+ return match('px', tokens.pixelValue, 1) ||
+ match('em', tokens.emValue, 1);
+ }
-function useUpdateEffect(effect, deps) {
- const mounted = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useRef"])(false);
- Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(() => {
- if (mounted.current) {
- return effect();
+ function match(type, pattern, captureIndex) {
+ var captures = scan(pattern);
+ if (captures) {
+ return {
+ type: type,
+ value: captures[captureIndex]
+ };
}
+ }
- mounted.current = true;
- return undefined;
- }, deps);
-}
-/**
- * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value.
- *
- * Note: This function will warn if it detects an un-memoized `value`
- *
- * @param {Object} props
- * @param {Record<string, any>} props.value
- * @return {Record<string, any>} The consolidated value.
- */
+ function scan(regexp) {
+ var captures,
+ blankCaptures;
+ blankCaptures = /^[\n\r\t\s]+/.exec(input);
+ if (blankCaptures) {
+ consume(blankCaptures[0].length);
+ }
-function useContextSystemBridge(_ref) {
- let {
- value
- } = _ref;
- const parentContext = useComponentsContext();
- const valueRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useRef"])(value);
- useUpdateEffect(() => {
- if ( // objects are equivalent
- Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isEqual"])(valueRef.current, value) && // but not the same reference
- valueRef.current !== value) {
- typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_2___default()(`Please memoize your context: ${JSON.stringify(value)}`) : void 0;
+ captures = regexp.exec(input);
+ if (captures) {
+ consume(captures[0].length);
}
- }, [value]); // `parentContext` will always be memoized (i.e., the result of this hook itself)
- // or the default value from when the `ComponentsContext` was originally
- // initialized (which will never change, it's a static variable)
- // so this memoization will prevent `merge` and `cloneDeep` from rerunning unless
- // the references to `value` change OR the `parentContext` has an actual material change
- // (because again, it's guaranteed to be memoized or a static reference to the empty object
- // so we know that the only changes for `parentContext` are material ones... i.e., why we
- // don't have to warn in the `useUpdateEffect` hook above for `parentContext` and we only
- // need to bother with the `value`). The `useUpdateEffect` above will ensure that we are
- // correctly warning when the `value` isn't being properly memoized. All of that to say
- // that this should be super safe to assume that `useMemo` will only run on actual
- // changes to the two dependencies, therefore saving us calls to `merge` and `cloneDeep`!
- const config = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(() => {
- return Object(lodash__WEBPACK_IMPORTED_MODULE_1__["merge"])(Object(lodash__WEBPACK_IMPORTED_MODULE_1__["cloneDeep"])(parentContext), value);
- }, [parentContext, value]);
- return config;
-}
-/**
- * A Provider component that can modify props for connected components within
- * the Context system.
- *
- * @example
- * ```jsx
- * <ContextSystemProvider value={{ Button: { size: 'small' }}}>
- * <Button>...</Button>
- * </ContextSystemProvider>
- * ```
- *
- * @template {Record<string, any>} T
- * @param {Object} options
- * @param {import('react').ReactNode} options.children Children to render.
- * @param {T} options.value Props to render into connected components.
- * @return {JSX.Element} A Provider wrapped component.
- */
+ return captures;
+ }
+ function consume(size) {
+ input = input.substr(size);
+ }
-const BaseContextSystemProvider = _ref2 => {
- let {
- children,
- value
- } = _ref2;
- const contextValue = useContextSystemBridge({
- value
- });
- return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(ComponentsContext.Provider, {
- value: contextValue
- }, children);
-};
+ return function(code) {
+ input = code.toString();
+ return getAST();
+ };
+})();
-const ContextSystemProvider = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["memo"])(BaseContextSystemProvider);
+exports.parse = (GradientParser || {}).parse;
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB")))
/***/ }),
-/***/ "71Og":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 9905:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isButton; });
-var buttonInputTypes = ["button", "color", "file", "image", "reset", "submit"];
-/**
- * Checks whether `element` is a native HTML button element.
- *
- * @example
- * import { isButton } from "reakit-utils";
- *
- * isButton(document.querySelector("button")); // true
- * isButton(document.querySelector("input[type='button']")); // true
- * isButton(document.querySelector("div")); // false
- * isButton(document.querySelector("input[type='text']")); // false
- * isButton(document.querySelector("div[role='button']")); // false
- *
- * @returns {boolean}
- */
-
-function isButton(element) {
- if (element.tagName === "BUTTON") return true;
- if (element.tagName === "INPUT") {
- var input = element;
- return buttonInputTypes.indexOf(input.type) !== -1;
- }
- return false;
-}
+var origSymbol = __webpack_require__.g.Symbol;
+var hasSymbolSham = __webpack_require__(5682);
+module.exports = function hasNativeSymbols() {
+ if (typeof origSymbol !== 'function') { return false; }
+ if (typeof Symbol !== 'function') { return false; }
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
+ return hasSymbolSham();
+};
/***/ }),
-/***/ "75pU":
-/***/ (function(module, exports) {
-
-//
-// Main
-//
+/***/ 5682:
+/***/ (function(module) {
-function memoize (fn, options) {
- var cache = options && options.cache
- ? options.cache
- : cacheDefault
+"use strict";
- var serializer = options && options.serializer
- ? options.serializer
- : serializerDefault
- var strategy = options && options.strategy
- ? options.strategy
- : strategyDefault
+/* eslint complexity: [2, 18], max-statements: [2, 33] */
+module.exports = function hasSymbols() {
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
+ if (typeof Symbol.iterator === 'symbol') { return true; }
- return strategy(fn, {
- cache: cache,
- serializer: serializer
- })
-}
+ var obj = {};
+ var sym = Symbol('test');
+ var symObj = Object(sym);
+ if (typeof sym === 'string') { return false; }
-//
-// Strategy
-//
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
-function isPrimitive (value) {
- return value == null || typeof value === 'number' || typeof value === 'boolean' // || typeof value === "string" 'unsafe' primitive for our needs
-}
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
+ // if (sym instanceof Symbol) { return false; }
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
+ // if (!(symObj instanceof Symbol)) { return false; }
-function monadic (fn, cache, serializer, arg) {
- var cacheKey = isPrimitive(arg) ? arg : serializer(arg)
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
- var computedValue = cache.get(cacheKey)
- if (typeof computedValue === 'undefined') {
- computedValue = fn.call(this, arg)
- cache.set(cacheKey, computedValue)
- }
+ var symVal = 42;
+ obj[sym] = symVal;
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
- return computedValue
-}
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
-function variadic (fn, cache, serializer) {
- var args = Array.prototype.slice.call(arguments, 3)
- var cacheKey = serializer(args)
+ var syms = Object.getOwnPropertySymbols(obj);
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
- var computedValue = cache.get(cacheKey)
- if (typeof computedValue === 'undefined') {
- computedValue = fn.apply(this, args)
- cache.set(cacheKey, computedValue)
- }
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
- return computedValue
-}
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
+ }
-function assemble (fn, context, strategy, cache, serialize) {
- return strategy.bind(
- context,
- fn,
- cache,
- serialize
- )
-}
+ return true;
+};
-function strategyDefault (fn, options) {
- var strategy = fn.length === 1 ? monadic : variadic
- return assemble(
- fn,
- this,
- strategy,
- options.cache.create(),
- options.serializer
- )
-}
+/***/ }),
-function strategyVariadic (fn, options) {
- var strategy = variadic
+/***/ 81:
+/***/ (function(module) {
- return assemble(
- fn,
- this,
- strategy,
- options.cache.create(),
- options.serializer
- )
-}
+"use strict";
-function strategyMonadic (fn, options) {
- var strategy = monadic
- return assemble(
- fn,
- this,
- strategy,
- options.cache.create(),
- options.serializer
- )
-}
+/* eslint complexity: [2, 18], max-statements: [2, 33] */
+module.exports = function hasSymbols() {
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
+ if (typeof Symbol.iterator === 'symbol') { return true; }
-//
-// Serializer
-//
+ var obj = {};
+ var sym = Symbol('test');
+ var symObj = Object(sym);
+ if (typeof sym === 'string') { return false; }
-function serializerDefault () {
- return JSON.stringify(arguments)
-}
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
-//
-// Cache
-//
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
+ // if (sym instanceof Symbol) { return false; }
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
+ // if (!(symObj instanceof Symbol)) { return false; }
-function ObjectWithoutPrototypeCache () {
- this.cache = Object.create(null)
-}
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
-ObjectWithoutPrototypeCache.prototype.has = function (key) {
- return (key in this.cache)
-}
+ var symVal = 42;
+ obj[sym] = symVal;
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
-ObjectWithoutPrototypeCache.prototype.get = function (key) {
- return this.cache[key]
-}
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
-ObjectWithoutPrototypeCache.prototype.set = function (key, value) {
- this.cache[key] = value
-}
+ var syms = Object.getOwnPropertySymbols(obj);
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
-var cacheDefault = {
- create: function create () {
- return new ObjectWithoutPrototypeCache()
- }
-}
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
-//
-// API
-//
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
+ }
-module.exports = memoize
-module.exports.strategies = {
- variadic: strategyVariadic,
- monadic: strategyMonadic
-}
+ return true;
+};
/***/ }),
-/***/ "7Cbv":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 4111:
+/***/ (function(module, __unused_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);
-}
+var hasSymbols = __webpack_require__(81);
-/* harmony default export */ var esm_browser_validate = (validate);
-// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js
+module.exports = function hasToStringTagShams() {
+ return hasSymbols() && !!Symbol.toStringTag;
+};
-/**
- * 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));
-}
+/***/ 9284:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-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
+"use strict";
- if (!esm_browser_validate(uuid)) {
- throw TypeError('Stringified UUID is invalid');
- }
- return uuid;
-}
+var bind = __webpack_require__(1930);
-/* harmony default export */ var esm_browser_stringify = (stringify);
-// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js
+module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
+/***/ }),
-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`
+/***/ 3138:
+/***/ (function(module) {
- rnds[6] = rnds[6] & 0x0f | 0x40;
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
-
- if (buf) {
- offset = offset || 0;
+module.exports =
+/******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+/******/
+/******/ // The require function
+/******/ function __nested_webpack_require_187__(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] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_187__);
+/******/
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/******/
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __nested_webpack_require_187__.m = modules;
+/******/
+/******/ // expose the module cache
+/******/ __nested_webpack_require_187__.c = installedModules;
+/******/
+/******/ // __webpack_public_path__
+/******/ __nested_webpack_require_187__.p = "";
+/******/
+/******/ // Load entry module and return exports
+/******/ return __nested_webpack_require_187__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ (function(module, exports, __nested_webpack_require_1468__) {
- for (var i = 0; i < 16; ++i) {
- buf[offset + i] = rnds[i];
- }
+ module.exports = __nested_webpack_require_1468__(1);
- return buf;
- }
- return esm_browser_stringify(rnds);
-}
+/***/ }),
+/* 1 */
+/***/ (function(module, exports, __nested_webpack_require_1587__) {
-/* harmony default export */ var esm_browser_v4 = __webpack_exports__["a"] = (v4);
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+ var _utils = __nested_webpack_require_1587__(2);
+
+ Object.defineProperty(exports, 'combineChunks', {
+ enumerable: true,
+ get: function get() {
+ return _utils.combineChunks;
+ }
+ });
+ Object.defineProperty(exports, 'fillInChunks', {
+ enumerable: true,
+ get: function get() {
+ return _utils.fillInChunks;
+ }
+ });
+ Object.defineProperty(exports, 'findAll', {
+ enumerable: true,
+ get: function get() {
+ return _utils.findAll;
+ }
+ });
+ Object.defineProperty(exports, 'findChunks', {
+ enumerable: true,
+ get: function get() {
+ return _utils.findChunks;
+ }
+ });
/***/ }),
+/* 2 */
+/***/ (function(module, exports) {
-/***/ "7Jlx":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return contextConnect; });
-/* unused harmony export getConnectNamespace */
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return hasConnectNamespace; });
-/* 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_warning__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Z23Y");
-/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("tQ+x");
-/* harmony import */ var _get_styled_class_name_from_key__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("UAm0");
-/**
- * External dependencies
- */
+ 'use strict';
+
+ Object.defineProperty(exports, "__esModule", {
+ value: true
+ });
+
+
+ /**
+ * Creates an array of chunk objects representing both higlightable and non highlightable pieces of text that match each search word.
+ * @return Array of "chunks" (where a Chunk is { start:number, end:number, highlight:boolean })
+ */
+ var findAll = exports.findAll = function findAll(_ref) {
+ var autoEscape = _ref.autoEscape,
+ _ref$caseSensitive = _ref.caseSensitive,
+ caseSensitive = _ref$caseSensitive === undefined ? false : _ref$caseSensitive,
+ _ref$findChunks = _ref.findChunks,
+ findChunks = _ref$findChunks === undefined ? defaultFindChunks : _ref$findChunks,
+ sanitize = _ref.sanitize,
+ searchWords = _ref.searchWords,
+ textToHighlight = _ref.textToHighlight;
+ return fillInChunks({
+ chunksToHighlight: combineChunks({
+ chunks: findChunks({
+ autoEscape: autoEscape,
+ caseSensitive: caseSensitive,
+ sanitize: sanitize,
+ searchWords: searchWords,
+ textToHighlight: textToHighlight
+ })
+ }),
+ totalLength: textToHighlight ? textToHighlight.length : 0
+ });
+ };
+
+ /**
+ * Takes an array of {start:number, end:number} objects and combines chunks that overlap into single chunks.
+ * @return {start:number, end:number}[]
+ */
+
+
+ var combineChunks = exports.combineChunks = function combineChunks(_ref2) {
+ var chunks = _ref2.chunks;
+
+ chunks = chunks.sort(function (first, second) {
+ return first.start - second.start;
+ }).reduce(function (processedChunks, nextChunk) {
+ // First chunk just goes straight in the array...
+ if (processedChunks.length === 0) {
+ return [nextChunk];
+ } else {
+ // ... subsequent chunks get checked to see if they overlap...
+ var prevChunk = processedChunks.pop();
+ if (nextChunk.start <= prevChunk.end) {
+ // It may be the case that prevChunk completely surrounds nextChunk, so take the
+ // largest of the end indeces.
+ var endIndex = Math.max(prevChunk.end, nextChunk.end);
+ processedChunks.push({ highlight: false, start: prevChunk.start, end: endIndex });
+ } else {
+ processedChunks.push(prevChunk, nextChunk);
+ }
+ return processedChunks;
+ }
+ }, []);
+
+ return chunks;
+ };
+
+ /**
+ * Examine text for any matches.
+ * If we find matches, add them to the returned array as a "chunk" object ({start:number, end:number}).
+ * @return {start:number, end:number}[]
+ */
+ var defaultFindChunks = function defaultFindChunks(_ref3) {
+ var autoEscape = _ref3.autoEscape,
+ caseSensitive = _ref3.caseSensitive,
+ _ref3$sanitize = _ref3.sanitize,
+ sanitize = _ref3$sanitize === undefined ? defaultSanitize : _ref3$sanitize,
+ searchWords = _ref3.searchWords,
+ textToHighlight = _ref3.textToHighlight;
+
+ textToHighlight = sanitize(textToHighlight);
+
+ return searchWords.filter(function (searchWord) {
+ return searchWord;
+ }) // Remove empty words
+ .reduce(function (chunks, searchWord) {
+ searchWord = sanitize(searchWord);
+
+ if (autoEscape) {
+ searchWord = escapeRegExpFn(searchWord);
+ }
+
+ var regex = new RegExp(searchWord, caseSensitive ? 'g' : 'gi');
+
+ var match = void 0;
+ while (match = regex.exec(textToHighlight)) {
+ var _start = match.index;
+ var _end = regex.lastIndex;
+ // We do not return zero-length matches
+ if (_end > _start) {
+ chunks.push({ highlight: false, start: _start, end: _end });
+ }
+
+ // Prevent browsers like Firefox from getting stuck in an infinite loop
+ // See http://www.regexguru.com/2008/04/watch-out-for-zero-length-matches/
+ if (match.index === regex.lastIndex) {
+ regex.lastIndex++;
+ }
+ }
+
+ return chunks;
+ }, []);
+ };
+ // Allow the findChunks to be overridden in findAll,
+ // but for backwards compatibility we export as the old name
+ exports.findChunks = defaultFindChunks;
+
+ /**
+ * Given a set of chunks to highlight, create an additional set of chunks
+ * to represent the bits of text between the highlighted text.
+ * @param chunksToHighlight {start:number, end:number}[]
+ * @param totalLength number
+ * @return {start:number, end:number, highlight:boolean}[]
+ */
+
+ var fillInChunks = exports.fillInChunks = function fillInChunks(_ref4) {
+ var chunksToHighlight = _ref4.chunksToHighlight,
+ totalLength = _ref4.totalLength;
+
+ var allChunks = [];
+ var append = function append(start, end, highlight) {
+ if (end - start > 0) {
+ allChunks.push({
+ start: start,
+ end: end,
+ highlight: highlight
+ });
+ }
+ };
+
+ if (chunksToHighlight.length === 0) {
+ append(0, totalLength, false);
+ } else {
+ var lastIndex = 0;
+ chunksToHighlight.forEach(function (chunk) {
+ append(lastIndex, chunk.start, false);
+ append(chunk.start, chunk.end, true);
+ lastIndex = chunk.end;
+ });
+ append(lastIndex, totalLength, false);
+ }
+ return allChunks;
+ };
+
+ function defaultSanitize(string) {
+ return string;
+ }
+
+ function escapeRegExpFn(string) {
+ return string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
+ }
-/**
- * WordPress dependencies
- */
+/***/ })
+/******/ ]);
+/***/ }),
-/**
- * Internal dependencies
- */
+/***/ 1281:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-/* eslint-disable jsdoc/valid-types */
+var reactIs = __webpack_require__(338);
/**
- * Forwards ref (React.ForwardRef) and "Connects" (or registers) a component
- * within the Context system under a specified namespace.
- *
- * This is an (experimental) evolution of the initial connect() HOC.
- * The hope is that we can improve render performance by removing functional
- * component wrappers.
- *
- * @template {import('./wordpress-component').WordPressComponentProps<{}, any, any>} P
- * @param {(props: P, ref: import('react').Ref<any>) => JSX.Element | null} Component The component to register into the Context system.
- * @param {string} namespace The namespace to register the component under.
- * @param {Object} options
- * @param {boolean} [options.memo=false]
- * @return {import('./wordpress-component').WordPressComponentFromProps<P>} The connected WordPressComponent
+ * Copyright 2015, Yahoo! Inc.
+ * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
+var REACT_STATICS = {
+ childContextTypes: true,
+ contextType: true,
+ contextTypes: true,
+ defaultProps: true,
+ displayName: true,
+ getDefaultProps: true,
+ getDerivedStateFromError: true,
+ getDerivedStateFromProps: true,
+ mixins: true,
+ propTypes: true,
+ type: true
+};
+var KNOWN_STATICS = {
+ name: true,
+ length: true,
+ prototype: true,
+ caller: true,
+ callee: true,
+ arguments: true,
+ arity: true
+};
+var FORWARD_REF_STATICS = {
+ '$$typeof': true,
+ render: true,
+ defaultProps: true,
+ displayName: true,
+ propTypes: true
+};
+var MEMO_STATICS = {
+ '$$typeof': true,
+ compare: true,
+ defaultProps: true,
+ displayName: true,
+ propTypes: true,
+ type: true
+};
+var TYPE_STATICS = {};
+TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
+TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
-function contextConnect(Component, namespace) {
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+function getStatics(component) {
+ // React v16.11 and below
+ if (reactIs.isMemo(component)) {
+ return MEMO_STATICS;
+ } // React v16.12 and above
- /* eslint-enable jsdoc/valid-types */
- const {
- memo: memoProp = false
- } = options;
- let WrappedComponent = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(Component);
- if (memoProp) {
- // @ts-ignore
- WrappedComponent = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["memo"])(WrappedComponent);
- }
+ return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
+}
- if (typeof namespace === 'undefined') {
- typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_2___default()('contextConnect: Please provide a namespace') : void 0;
- } // @ts-ignore internal property
+var defineProperty = Object.defineProperty;
+var getOwnPropertyNames = Object.getOwnPropertyNames;
+var getOwnPropertySymbols = Object.getOwnPropertySymbols;
+var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
+var getPrototypeOf = Object.getPrototypeOf;
+var objectPrototype = Object.prototype;
+function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
+ if (typeof sourceComponent !== 'string') {
+ // don't hoist over string (html) components
+ if (objectPrototype) {
+ var inheritedComponent = getPrototypeOf(sourceComponent);
+ if (inheritedComponent && inheritedComponent !== objectPrototype) {
+ hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
+ }
+ }
- let mergedNamespace = WrappedComponent[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]] || [namespace];
- /**
- * Consolidate (merge) namespaces before attaching it to the WrappedComponent.
- */
+ var keys = getOwnPropertyNames(sourceComponent);
- if (Array.isArray(namespace)) {
- mergedNamespace = [...mergedNamespace, ...namespace];
- }
+ if (getOwnPropertySymbols) {
+ keys = keys.concat(getOwnPropertySymbols(sourceComponent));
+ }
- if (typeof namespace === 'string') {
- mergedNamespace = [...mergedNamespace, namespace];
- }
+ var targetStatics = getStatics(targetComponent);
+ var sourceStatics = getStatics(sourceComponent);
- WrappedComponent.displayName = namespace; // @ts-ignore internal property
+ for (var i = 0; i < keys.length; ++i) {
+ var key = keys[i];
- WrappedComponent[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]] = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["uniq"])(mergedNamespace); // @ts-ignore WordPressComponent property
+ if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
+ var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
- WrappedComponent.selector = `.${Object(_get_styled_class_name_from_key__WEBPACK_IMPORTED_MODULE_4__[/* getStyledClassNameFromKey */ "a"])(namespace)}`; // @ts-ignore
+ try {
+ // Avoid failures from read-only properties
+ defineProperty(targetComponent, key, descriptor);
+ } catch (e) {}
+ }
+ }
+ }
- return WrappedComponent;
+ return targetComponent;
}
-/**
- * Attempts to retrieve the connected namespace from a component.
- *
- * @param {import('react').ReactChild | undefined | {}} Component The component to retrieve a namespace from.
- * @return {Array<string>} The connected namespaces.
- */
-function getConnectNamespace(Component) {
- if (!Component) return [];
- let namespaces = []; // @ts-ignore internal property
+module.exports = hoistNonReactStatics;
- if (Component[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]]) {
- // @ts-ignore internal property
- namespaces = Component[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]];
- } // @ts-ignore
+/***/ }),
- if (Component.type && Component.type[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]]) {
- // @ts-ignore
- namespaces = Component.type[_constants__WEBPACK_IMPORTED_MODULE_3__[/* CONNECT_STATIC_NAMESPACE */ "c"]];
- }
+/***/ 5443:
+/***/ (function(module) {
- return namespaces;
-}
-/**
- * Checks to see if a component is connected within the Context system.
- *
- * @param {import('react').ReactNode} Component The component to retrieve a namespace from.
- * @param {Array<string>|string} match The namespace to check.
- * @return {boolean} The result.
- */
+"use strict";
-function hasConnectNamespace(Component, match) {
- if (!Component) return false;
- if (typeof match === 'string') {
- return getConnectNamespace(Component).includes(match);
- }
+var fnToStr = Function.prototype.toString;
+var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
+var badArrayLike;
+var isCallableMarker;
+if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
+ try {
+ badArrayLike = Object.defineProperty({}, 'length', {
+ get: function () {
+ throw isCallableMarker;
+ }
+ });
+ isCallableMarker = {};
+ // eslint-disable-next-line no-throw-literal
+ reflectApply(function () { throw 42; }, null, badArrayLike);
+ } catch (_) {
+ if (_ !== isCallableMarker) {
+ reflectApply = null;
+ }
+ }
+} else {
+ reflectApply = null;
+}
- if (Array.isArray(match)) {
- return match.some(result => getConnectNamespace(Component).includes(result));
- }
+var constructorRegex = /^\s*class\b/;
+var isES6ClassFn = function isES6ClassFunction(value) {
+ try {
+ var fnStr = fnToStr.call(value);
+ return constructorRegex.test(fnStr);
+ } catch (e) {
+ return false; // not a function
+ }
+};
- return false;
-}
+var tryFunctionObject = function tryFunctionToStr(value) {
+ try {
+ if (isES6ClassFn(value)) { return false; }
+ fnToStr.call(value);
+ return true;
+ } catch (e) {
+ return false;
+ }
+};
+var toStr = Object.prototype.toString;
+var fnClass = '[object Function]';
+var genClass = '[object GeneratorFunction]';
+var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
+
+module.exports = reflectApply
+ ? function isCallable(value) {
+ if (!value) { return false; }
+ if (typeof value !== 'function' && typeof value !== 'object') { return false; }
+ if (typeof value === 'function' && !value.prototype) { return true; }
+ try {
+ reflectApply(value, null, badArrayLike);
+ } catch (e) {
+ if (e !== isCallableMarker) { return false; }
+ }
+ return !isES6ClassFn(value);
+ }
+ : function isCallable(value) {
+ if (!value) { return false; }
+ if (typeof value !== 'function' && typeof value !== 'object') { return false; }
+ if (typeof value === 'function' && !value.prototype) { return true; }
+ if (hasToStringTag) { return tryFunctionObject(value); }
+ if (isES6ClassFn(value)) { return false; }
+ var strClass = toStr.call(value);
+ return strClass === fnClass || strClass === genClass;
+ };
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB")))
/***/ }),
-/***/ "7bKH":
-/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) {
+/***/ 8659:
+/***/ (function(module) {
"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}});
+
+
+var getDay = Date.prototype.getDay;
+var tryDateObject = function tryDateGetDayCall(value) {
+ try {
+ getDay.call(value);
+ return true;
+ } catch (e) {
+ return false;
+ }
+};
+
+var toStr = Object.prototype.toString;
+var dateClass = '[object Date]';
+var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
+
+module.exports = function isDateObject(value) {
+ if (typeof value !== 'object' || value === null) {
+ return false;
+ }
+ return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;
+};
/***/ }),
-/***/ "82c2":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 3082:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-var keys = __webpack_require__("1seS");
-var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
-
var toStr = Object.prototype.toString;
-var concat = Array.prototype.concat;
-var origDefineProperty = Object.defineProperty;
-
-var isFunction = function (fn) {
- return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
-};
+var hasSymbols = __webpack_require__(9905)();
-var arePropertyDescriptorsSupported = function () {
- var obj = {};
- try {
- origDefineProperty(obj, 'x', { enumerable: false, value: obj });
- // eslint-disable-next-line no-unused-vars, no-restricted-syntax
- for (var _ in obj) { // jscs:ignore disallowUnusedVariables
+if (hasSymbols) {
+ var symToStr = Symbol.prototype.toString;
+ var symStringRegex = /^Symbol\(.*\)$/;
+ var isSymbolObject = function isRealSymbolObject(value) {
+ if (typeof value.valueOf() !== 'symbol') {
return false;
}
- return obj.x === obj;
- } catch (e) { /* this is IE 8. */
- return false;
- }
-};
-var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
+ return symStringRegex.test(symToStr.call(value));
+ };
-var defineProperty = function (object, name, value, predicate) {
- if (name in object && (!isFunction(predicate) || !predicate())) {
- return;
- }
- if (supportsDescriptors) {
- origDefineProperty(object, name, {
- configurable: true,
- enumerable: false,
- value: value,
- writable: true
- });
- } else {
- object[name] = value;
- }
-};
+ module.exports = function isSymbol(value) {
+ if (typeof value === 'symbol') {
+ return true;
+ }
+ if (toStr.call(value) !== '[object Symbol]') {
+ return false;
+ }
+ try {
+ return isSymbolObject(value);
+ } catch (e) {
+ return false;
+ }
+ };
+} else {
-var defineProperties = function (object, map) {
- var predicates = arguments.length > 2 ? arguments[2] : {};
- var props = keys(map);
- if (hasSymbols) {
- props = concat.call(props, Object.getOwnPropertySymbols(map));
- }
- for (var i = 0; i < props.length; i += 1) {
- defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
- }
-};
+ module.exports = function isSymbol(value) {
+ // this environment does not support Symbols.
+ return false && 0;
+ };
+}
-defineProperties.supportsDescriptors = !!supportsDescriptors;
-module.exports = defineProperties;
+/***/ }),
+
+/***/ 5834:
+/***/ (function(module, exports) {
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = isTouchDevice;
+function isTouchDevice() {
+ return !!(typeof window !== 'undefined' && ('ontouchstart' in window || window.DocumentTouch && typeof document !== 'undefined' && document instanceof window.DocumentTouch)) || !!(typeof navigator !== 'undefined' && (navigator.maxTouchPoints || navigator.msMaxTouchPoints));
+}
+module.exports = exports['default'];
/***/ }),
-/***/ "8R9v":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
+/***/ 4937:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+var root = __webpack_require__(158);
-var define = __webpack_require__("82c2");
-var getPolyfill = __webpack_require__("yLpt");
+/** Built-in value references. */
+var Symbol = root.Symbol;
-module.exports = function shimAssign() {
- var polyfill = getPolyfill();
- define(
- Object,
- { assign: polyfill },
- { assign: function () { return Object.assign !== polyfill; } }
- );
- return polyfill;
-};
+module.exports = Symbol;
/***/ }),
-/***/ "8oxB":
-/***/ (function(module, exports) {
+/***/ 194:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-// shim for using process in browser
-var process = module.exports = {};
+var Symbol = __webpack_require__(4937),
+ getRawTag = __webpack_require__(5401),
+ objectToString = __webpack_require__(2445);
-// 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.
+/** `Object#toString` result references. */
+var nullTag = '[object Null]',
+ undefinedTag = '[object Undefined]';
-var cachedSetTimeout;
-var cachedClearTimeout;
+/** Built-in value references. */
+var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
-function defaultSetTimout() {
- throw new Error('setTimeout has not been defined');
-}
-function defaultClearTimeout () {
- throw new Error('clearTimeout has not been defined');
+/**
+ * The base implementation of `getTag` without fallbacks for buggy environments.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
+ */
+function baseGetTag(value) {
+ if (value == null) {
+ return value === undefined ? undefinedTag : nullTag;
+ }
+ return (symToStringTag && symToStringTag in Object(value))
+ ? getRawTag(value)
+ : objectToString(value);
}
-(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);
- }
- }
+module.exports = baseGetTag;
+/***/ }),
-}
-var queue = [];
-var draining = false;
-var currentQueue;
-var queueIndex = -1;
+/***/ 2383:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-function cleanUpNextTick() {
- if (!draining || !currentQueue) {
- return;
- }
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- drainQueue();
- }
-}
+var trimmedEndIndex = __webpack_require__(8725);
-function drainQueue() {
- if (draining) {
- return;
- }
- var timeout = runTimeout(cleanUpNextTick);
- draining = true;
+/** Used to match leading whitespace. */
+var reTrimStart = /^\s+/;
- 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);
+/**
+ * The base implementation of `_.trim`.
+ *
+ * @private
+ * @param {string} string The string to trim.
+ * @returns {string} Returns the trimmed string.
+ */
+function baseTrim(string) {
+ return string
+ ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
+ : string;
}
-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);
- }
-};
+module.exports = baseTrim;
-// 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; };
+/***/ }),
+/***/ 4528:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-/***/ }),
+/** Detect free variable `global` from Node.js. */
+var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
-/***/ "8sMu":
-/***/ (function(module, exports, __webpack_require__) {
+module.exports = freeGlobal;
-"use strict";
+/***/ }),
-// var modulo = require('./modulo');
-var $floor = Math.floor;
+/***/ 5401:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-// http://262.ecma-international.org/5.1/#sec-5.2
+var Symbol = __webpack_require__(4937);
-module.exports = function floor(x) {
- // return x - modulo(x, 1);
- return $floor(x);
-};
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto.hasOwnProperty;
-/***/ }),
+/**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var nativeObjectToString = objectProto.toString;
-/***/ "9Do8":
-/***/ (function(module, exports, __webpack_require__) {
+/** Built-in value references. */
+var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
-"use strict";
+/**
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the raw `toStringTag`.
+ */
+function getRawTag(value) {
+ var isOwn = hasOwnProperty.call(value, symToStringTag),
+ tag = value[symToStringTag];
+ try {
+ value[symToStringTag] = undefined;
+ var unmasked = true;
+ } catch (e) {}
-module.exports = __webpack_require__("zt9T");
+ var result = nativeObjectToString.call(value);
+ if (unmasked) {
+ if (isOwn) {
+ value[symToStringTag] = tag;
+ } else {
+ delete value[symToStringTag];
+ }
+ }
+ return result;
+}
-/***/ }),
+module.exports = getRawTag;
-/***/ "9VDH":
-/***/ (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_primitives__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Tqx9");
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("vUUf");
+/***/ }),
+/***/ 2445:
+/***/ (function(module) {
-/**
- * External dependencies
- */
-// eslint-disable-next-line no-restricted-imports
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
/**
- * WordPress dependencies
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
*/
-
+var nativeObjectToString = objectProto.toString;
/**
- * Internal dependencies
+ * Converts `value` to a string using `Object.prototype.toString`.
+ *
+ * @private
+ * @param {*} value The value to convert.
+ * @returns {string} Returns the converted string.
*/
+function objectToString(value) {
+ return nativeObjectToString.call(value);
+}
+module.exports = objectToString;
-function Icon(_ref) {
- let {
- icon = null,
- size = 24,
- ...additionalProps
- } = _ref;
-
- if ('string' === typeof icon) {
- return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_dashicon__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({
- icon: icon
- }, additionalProps));
- }
-
- if (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["isValidElement"])(icon) && _dashicon__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"] === icon.type) {
- return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["cloneElement"])(icon, { ...additionalProps
- });
- }
-
- if ('function' === typeof icon) {
- if (icon.prototype instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_1__["Component"]) {
- return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(icon, {
- size,
- ...additionalProps
- });
- }
+/***/ }),
- return icon({
- size,
- ...additionalProps
- });
- }
+/***/ 158:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- if (icon && (icon.type === 'svg' || icon.type === _wordpress_primitives__WEBPACK_IMPORTED_MODULE_2__["SVG"])) {
- const appliedProps = {
- width: size,
- height: size,
- ...icon.props,
- ...additionalProps
- };
- return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_2__["SVG"], appliedProps);
- }
+var freeGlobal = __webpack_require__(4528);
- if (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["isValidElement"])(icon)) {
- return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["cloneElement"])(icon, {
- // @ts-ignore Just forwarding the size prop along
- size,
- ...additionalProps
- });
- }
+/** Detect free variable `self`. */
+var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
- return icon;
-}
+/** Used as a reference to the global object. */
+var root = freeGlobal || freeSelf || Function('return this')();
-/* harmony default export */ __webpack_exports__["a"] = (Icon);
+module.exports = root;
/***/ }),
-/***/ "9Zbq":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 8725:
+/***/ (function(module) {
+
+/** Used to match a single whitespace character. */
+var reWhitespace = /\s/;
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return matches; });
/**
- * Ponyfill for `Element.prototype.matches`
+ * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
+ * character of `string`.
*
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
+ * @private
+ * @param {string} string The string to inspect.
+ * @returns {number} Returns the index of the last non-whitespace character.
*/
-function matches(element, selectors) {
- if ("matches" in element) {
- return element.matches(selectors);
- }
-
- if ("msMatchesSelector" in element) {
- return element.msMatchesSelector(selectors);
- }
+function trimmedEndIndex(string) {
+ var index = string.length;
- return element.webkitMatchesSelector(selectors);
+ while (index-- && reWhitespace.test(string.charAt(index))) {}
+ return index;
}
-
+module.exports = trimmedEndIndex;
/***/ }),
-/***/ "9cOx":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 6897:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-"use strict";
+var isObject = __webpack_require__(3619),
+ now = __webpack_require__(8253),
+ toNumber = __webpack_require__(5053);
+/** Error message constants. */
+var FUNC_ERROR_TEXT = 'Expected a function';
-var GetIntrinsic = __webpack_require__("j1Hc");
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max,
+ nativeMin = Math.min;
-var $Array = GetIntrinsic('%Array%');
+/**
+ * Creates a debounced function that delays invoking `func` until after `wait`
+ * milliseconds have elapsed since the last time the debounced function was
+ * invoked. The debounced function comes with a `cancel` method to cancel
+ * delayed `func` invocations and a `flush` method to immediately invoke them.
+ * Provide `options` to indicate whether `func` should be invoked on the
+ * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
+ * with the last arguments provided to the debounced function. Subsequent
+ * calls to the debounced function return the result of the last `func`
+ * invocation.
+ *
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
+ * invoked on the trailing edge of the timeout only if the debounced function
+ * is invoked more than once during the `wait` timeout.
+ *
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
+ *
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
+ * for details over the differences between `_.debounce` and `_.throttle`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Function
+ * @param {Function} func The function to debounce.
+ * @param {number} [wait=0] The number of milliseconds to delay.
+ * @param {Object} [options={}] The options object.
+ * @param {boolean} [options.leading=false]
+ * Specify invoking on the leading edge of the timeout.
+ * @param {number} [options.maxWait]
+ * The maximum time `func` is allowed to be delayed before it's invoked.
+ * @param {boolean} [options.trailing=true]
+ * Specify invoking on the trailing edge of the timeout.
+ * @returns {Function} Returns the new debounced function.
+ * @example
+ *
+ * // Avoid costly calculations while the window size is in flux.
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
+ *
+ * // Invoke `sendMail` when clicked, debouncing subsequent calls.
+ * jQuery(element).on('click', _.debounce(sendMail, 300, {
+ * 'leading': true,
+ * 'trailing': false
+ * }));
+ *
+ * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
+ * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
+ * var source = new EventSource('/stream');
+ * jQuery(source).on('message', debounced);
+ *
+ * // Cancel the trailing debounced invocation.
+ * jQuery(window).on('popstate', debounced.cancel);
+ */
+function debounce(func, wait, options) {
+ var lastArgs,
+ lastThis,
+ maxWait,
+ result,
+ timerId,
+ lastCallTime,
+ lastInvokeTime = 0,
+ leading = false,
+ maxing = false,
+ trailing = true;
-// eslint-disable-next-line global-require
-var toStr = !$Array.isArray && __webpack_require__("qeuH")('Object.prototype.toString');
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ wait = toNumber(wait) || 0;
+ if (isObject(options)) {
+ leading = !!options.leading;
+ maxing = 'maxWait' in options;
+ maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
+ }
-// https://ecma-international.org/ecma-262/6.0/#sec-isarray
+ function invokeFunc(time) {
+ var args = lastArgs,
+ thisArg = lastThis;
-module.exports = $Array.isArray || function IsArray(argument) {
- return toStr(argument) === '[object Array]';
-};
+ lastArgs = lastThis = undefined;
+ lastInvokeTime = time;
+ result = func.apply(thisArg, args);
+ return result;
+ }
+ function leadingEdge(time) {
+ // Reset any `maxWait` timer.
+ lastInvokeTime = time;
+ // Start the timer for the trailing edge.
+ timerId = setTimeout(timerExpired, wait);
+ // Invoke the leading edge.
+ return leading ? invokeFunc(time) : result;
+ }
-/***/ }),
+ function remainingWait(time) {
+ var timeSinceLastCall = time - lastCallTime,
+ timeSinceLastInvoke = time - lastInvokeTime,
+ timeWaiting = wait - timeSinceLastCall;
-/***/ "9gmn":
-/***/ (function(module, exports, __webpack_require__) {
+ return maxing
+ ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
+ : timeWaiting;
+ }
-"use strict";
+ function shouldInvoke(time) {
+ var timeSinceLastCall = time - lastCallTime,
+ timeSinceLastInvoke = time - lastInvokeTime;
+ // Either this is the first call, activity has stopped and we're at the
+ // trailing edge, the system time has gone backwards and we're treating
+ // it as the trailing edge, or we've hit the `maxWait` limit.
+ return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
+ (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
+ }
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+ function timerExpired() {
+ var time = now();
+ if (shouldInvoke(time)) {
+ return trailingEdge(time);
+ }
+ // Restart the timer.
+ timerId = setTimeout(timerExpired, remainingWait(time));
+ }
-var _react = __webpack_require__("cDcd");
+ function trailingEdge(time) {
+ timerId = undefined;
-var _react2 = _interopRequireDefault(_react);
+ // Only invoke if we have `lastArgs` which means `func` has been
+ // debounced at least once.
+ if (trailing && lastArgs) {
+ return invokeFunc(time);
+ }
+ lastArgs = lastThis = undefined;
+ return result;
+ }
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+ function cancel() {
+ if (timerId !== undefined) {
+ clearTimeout(timerId);
+ }
+ lastInvokeTime = 0;
+ lastArgs = lastCallTime = lastThis = timerId = undefined;
+ }
-var ChevronUp = function () {
- function ChevronUp(props) {
- return _react2['default'].createElement(
- 'svg',
- props,
- _react2['default'].createElement('path', {
- d: 'M32.1 712.6l453.2-452.2c11-11 21-11 32 0l453.2 452.2c4 5 6 10 6 16 0 13-10 23-22 23-7 0-12-2-16-7L501.3 308.5 64.1 744.7c-4 5-9 7-15 7-7 0-12-2-17-7-9-11-9-21 0-32.1z'
- })
- );
+ function flush() {
+ return timerId === undefined ? result : trailingEdge(now());
}
- return ChevronUp;
-}();
+ function debounced() {
+ var time = now(),
+ isInvoking = shouldInvoke(time);
-ChevronUp.defaultProps = {
- viewBox: '0 0 1000 1000'
-};
-exports['default'] = ChevronUp;
+ lastArgs = arguments;
+ lastThis = this;
+ lastCallTime = time;
-/***/ }),
+ if (isInvoking) {
+ if (timerId === undefined) {
+ return leadingEdge(lastCallTime);
+ }
+ if (maxing) {
+ // Handle invocations in a tight loop.
+ clearTimeout(timerId);
+ timerId = setTimeout(timerExpired, wait);
+ return invokeFunc(lastCallTime);
+ }
+ }
+ if (timerId === undefined) {
+ timerId = setTimeout(timerExpired, wait);
+ }
+ return result;
+ }
+ debounced.cancel = cancel;
+ debounced.flush = flush;
+ return debounced;
+}
-/***/ "9pTB":
-/***/ (function(module, exports, __webpack_require__) {
+module.exports = debounce;
-"use strict";
-/* WEBPACK VAR INJECTION */(function(global) {
-var define = __webpack_require__("82c2");
-var isSymbol = __webpack_require__("/sVA");
+/***/ }),
-var globalKey = '__ global cache key __';
-/* istanbul ignore else */
-// eslint-disable-next-line no-restricted-properties
-if (typeof Symbol === 'function' && isSymbol(Symbol('foo')) && typeof Symbol['for'] === 'function') {
- // eslint-disable-next-line no-restricted-properties
- globalKey = Symbol['for'](globalKey);
+/***/ 3619:
+/***/ (function(module) {
+
+/**
+ * Checks if `value` is the
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */
+function isObject(value) {
+ var type = typeof value;
+ return value != null && (type == 'object' || type == 'function');
}
-var trueThunk = function () {
- return true;
-};
+module.exports = isObject;
-var ensureCache = function ensureCache() {
- if (!global[globalKey]) {
- var properties = {};
- properties[globalKey] = {};
- var predicates = {};
- predicates[globalKey] = trueThunk;
- define(global, properties, predicates);
- }
- return global[globalKey];
-};
-var cache = ensureCache();
+/***/ }),
-var isPrimitive = function isPrimitive(val) {
- return val === null || (typeof val !== 'object' && typeof val !== 'function');
-};
+/***/ 1653:
+/***/ (function(module) {
-var getPrimitiveKey = function getPrimitiveKey(val) {
- if (isSymbol(val)) {
- return Symbol.prototype.valueOf.call(val);
- }
- return typeof val + ' | ' + String(val);
-};
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+ return value != null && typeof value == 'object';
+}
-var requirePrimitiveKey = function requirePrimitiveKey(val) {
- if (!isPrimitive(val)) {
- throw new TypeError('key must not be an object');
- }
-};
+module.exports = isObjectLike;
-var globalCache = {
- clear: function clear() {
- delete global[globalKey];
- cache = ensureCache();
- },
- 'delete': function deleteKey(key) {
- requirePrimitiveKey(key);
- delete cache[getPrimitiveKey(key)];
- return !globalCache.has(key);
- },
+/***/ }),
- get: function get(key) {
- requirePrimitiveKey(key);
- return cache[getPrimitiveKey(key)];
- },
+/***/ 1878:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- has: function has(key) {
- requirePrimitiveKey(key);
- return getPrimitiveKey(key) in cache;
- },
+var baseGetTag = __webpack_require__(194),
+ isObjectLike = __webpack_require__(1653);
- set: function set(key, value) {
- requirePrimitiveKey(key);
- var primitiveKey = getPrimitiveKey(key);
- var props = {};
- props[primitiveKey] = value;
- var predicates = {};
- predicates[primitiveKey] = trueThunk;
- define(cache, props, predicates);
- return globalCache.has(key);
- },
+/** `Object#toString` result references. */
+var symbolTag = '[object Symbol]';
- setIfMissingThenGet: function setIfMissingThenGet(key, valueThunk) {
- if (globalCache.has(key)) {
- return globalCache.get(key);
- }
- var item = valueThunk();
- globalCache.set(key, item);
- return item;
- }
-};
+/**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+function isSymbol(value) {
+ return typeof value == 'symbol' ||
+ (isObjectLike(value) && baseGetTag(value) == symbolTag);
+}
-module.exports = globalCache;
+module.exports = isSymbol;
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("yLpj")))
/***/ }),
-/***/ "AClM":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 8253:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-"use strict";
+var root = __webpack_require__(158);
-// EXPORTS
-__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ ensureFocus; });
+/**
+ * Gets the timestamp of the number of milliseconds that have elapsed since
+ * the Unix epoch (1 January 1970 00:00:00 UTC).
+ *
+ * @static
+ * @memberOf _
+ * @since 2.4.0
+ * @category Date
+ * @returns {number} Returns the timestamp.
+ * @example
+ *
+ * _.defer(function(stamp) {
+ * console.log(_.now() - stamp);
+ * }, _.now());
+ * // => Logs the number of milliseconds it took for the deferred invocation.
+ */
+var now = function() {
+ return root.Date.now();
+};
-// EXTERNAL MODULE: ./node_modules/reakit-utils/es/getActiveElement.js
-var getActiveElement = __webpack_require__("Nym8");
+module.exports = now;
+
+
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/reakit-utils/es/hasFocus.js
+/***/ 8172:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+var debounce = __webpack_require__(6897),
+ isObject = __webpack_require__(3619);
+/** Error message constants. */
+var FUNC_ERROR_TEXT = 'Expected a function';
/**
- * Checks if `element` has focus. Elements that are referenced by
- * `aria-activedescendant` are also considered.
+ * Creates a throttled function that only invokes `func` at most once per
+ * every `wait` milliseconds. The throttled function comes with a `cancel`
+ * method to cancel delayed `func` invocations and a `flush` method to
+ * immediately invoke them. Provide `options` to indicate whether `func`
+ * should be invoked on the leading and/or trailing edge of the `wait`
+ * timeout. The `func` is invoked with the last arguments provided to the
+ * throttled function. Subsequent calls to the throttled function return the
+ * result of the last `func` invocation.
+ *
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
+ * invoked on the trailing edge of the timeout only if the throttled function
+ * is invoked more than once during the `wait` timeout.
*
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
+ *
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
+ * for details over the differences between `_.throttle` and `_.debounce`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Function
+ * @param {Function} func The function to throttle.
+ * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
+ * @param {Object} [options={}] The options object.
+ * @param {boolean} [options.leading=true]
+ * Specify invoking on the leading edge of the timeout.
+ * @param {boolean} [options.trailing=true]
+ * Specify invoking on the trailing edge of the timeout.
+ * @returns {Function} Returns the new throttled function.
* @example
- * import { hasFocus } from "reakit-utils";
*
- * hasFocus(document.getElementById("id"));
+ * // Avoid excessively updating the position while scrolling.
+ * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
+ *
+ * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
+ * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
+ * jQuery(element).on('click', throttled);
+ *
+ * // Cancel the trailing throttled invocation.
+ * jQuery(window).on('popstate', throttled.cancel);
*/
+function throttle(func, wait, options) {
+ var leading = true,
+ trailing = true;
-function hasFocus(element) {
- var activeElement = Object(getActiveElement["a" /* getActiveElement */])(element);
- if (!activeElement) return false;
- if (activeElement === element) return true;
- var activeDescendant = activeElement.getAttribute("aria-activedescendant");
- if (!activeDescendant) return false;
- return activeDescendant === element.id;
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ if (isObject(options)) {
+ leading = 'leading' in options ? !!options.leading : leading;
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
+ }
+ return debounce(func, wait, {
+ 'leading': leading,
+ 'maxWait': wait,
+ 'trailing': trailing
+ });
}
+module.exports = throttle;
+
+
+/***/ }),
+
+/***/ 5053:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+
+var baseTrim = __webpack_require__(2383),
+ isObject = __webpack_require__(3619),
+ isSymbol = __webpack_require__(1878);
+/** Used as references for various `Number` constants. */
+var NAN = 0 / 0;
-// CONCATENATED MODULE: ./node_modules/reakit-utils/es/ensureFocus.js
+/** Used to detect bad signed hexadecimal string values. */
+var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
+/** Used to detect binary string values. */
+var reIsBinary = /^0b[01]+$/i;
+/** Used to detect octal string values. */
+var reIsOctal = /^0o[0-7]+$/i;
+/** Built-in method references without a dependency on `root`. */
+var freeParseInt = parseInt;
/**
- * Ensures `element` will receive focus if it's not already.
+ * Converts `value` to a number.
*
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {number} Returns the number.
* @example
- * import { ensureFocus } from "reakit-utils";
*
- * ensureFocus(document.activeElement); // does nothing
+ * _.toNumber(3.2);
+ * // => 3.2
*
- * const element = document.querySelector("input");
+ * _.toNumber(Number.MIN_VALUE);
+ * // => 5e-324
*
- * ensureFocus(element); // focuses element
- * ensureFocus(element, { preventScroll: true }); // focuses element preventing scroll jump
+ * _.toNumber(Infinity);
+ * // => Infinity
*
- * function isActive(el) {
- * return el.dataset.active === "true";
- * }
+ * _.toNumber('3.2');
+ * // => 3.2
+ */
+function toNumber(value) {
+ if (typeof value == 'number') {
+ return value;
+ }
+ if (isSymbol(value)) {
+ return NAN;
+ }
+ if (isObject(value)) {
+ var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
+ value = isObject(other) ? (other + '') : other;
+ }
+ if (typeof value != 'string') {
+ return value === 0 ? value : +value;
+ }
+ value = baseTrim(value);
+ var isBinary = reIsBinary.test(value);
+ return (isBinary || reIsOctal.test(value))
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
+ : (reIsBadHex.test(value) ? NAN : +value);
+}
+
+module.exports = toNumber;
+
+
+/***/ }),
+
+/***/ 9756:
+/***/ (function(module) {
+
+/**
+ * Memize options object.
*
- * ensureFocus(document.querySelector("[data-active='true']"), { isActive }); // does nothing
+ * @typedef MemizeOptions
*
- * @returns {number} `requestAnimationFrame` call ID so it can be passed to `cancelAnimationFrame` if needed.
+ * @property {number} [maxSize] Maximum size of the cache.
*/
-function ensureFocus(element, _temp) {
- var _ref = _temp === void 0 ? {} : _temp,
- preventScroll = _ref.preventScroll,
- _ref$isActive = _ref.isActive,
- isActive = _ref$isActive === void 0 ? hasFocus : _ref$isActive;
- if (isActive(element)) return -1;
- element.focus({
- preventScroll: preventScroll
- });
- if (isActive(element)) return -1;
- return requestAnimationFrame(function () {
- element.focus({
- preventScroll: preventScroll
- });
- });
-}
+/**
+ * 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;
-/***/ "AM7I":
-/***/ (function(module, exports, __webpack_require__) {
+ options = options || {};
-"use strict";
+ 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.
-/* globals
- AggregateError,
- Atomics,
- FinalizationRegistry,
- SharedArrayBuffer,
- WeakRef,
-*/
+ // Check whether node arguments match arguments length
+ if ( node.args.length !== arguments.length ) {
+ node = node.next;
+ continue;
+ }
-var undefined;
+ // Check whether node arguments match arguments values
+ for ( i = 0; i < len; i++ ) {
+ if ( node.args[ i ] !== arguments[ i ] ) {
+ node = node.next;
+ continue searchCache;
+ }
+ }
-var $SyntaxError = SyntaxError;
-var $Function = Function;
-var $TypeError = TypeError;
+ // At this point we can assume we've found a match
-// eslint-disable-next-line consistent-return
-var getEvalledConstructor = function (expressionSyntax) {
- try {
- // eslint-disable-next-line no-new-func
- return Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
- } catch (e) {}
-};
+ // 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;
+ }
-var $gOPD = Object.getOwnPropertyDescriptor;
-if ($gOPD) {
- try {
- $gOPD({}, '');
- } catch (e) {
- $gOPD = null; // this is IE 8, which has a broken gOPD
- }
-}
+ // 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;
+ }
-var throwTypeError = function () {
- throw new $TypeError();
-};
-var ThrowTypeError = $gOPD
- ? (function () {
- try {
- // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
- arguments.callee; // IE 8 does not throw here
- return throwTypeError;
- } catch (calleeThrows) {
- try {
- // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
- return $gOPD(arguments, 'callee').get;
- } catch (gOPDthrows) {
- return throwTypeError;
+ node.next = head;
+ node.prev = null;
+ /** @type {MemizeCacheNode} */ ( head ).prev = node;
+ head = node;
}
+
+ // Return immediately
+ return node.val;
}
- }())
- : throwTypeError;
-var hasSymbols = __webpack_require__("UVaH")();
+ // No cached value found. Continue to insertion phase:
-var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
+ // Create a copy of arguments (avoid leaking deoptimization)
+ args = new Array( len );
+ for ( i = 0; i < len; i++ ) {
+ args[ i ] = arguments[ i ];
+ }
-var asyncGenFunction = getEvalledConstructor('async function* () {}');
-var asyncGenFunctionPrototype = asyncGenFunction ? asyncGenFunction.prototype : undefined;
-var asyncGenPrototype = asyncGenFunctionPrototype ? asyncGenFunctionPrototype.prototype : undefined;
+ node = {
+ args: args,
-var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
+ // Generate the result from original function
+ val: fn.apply( null, args ),
+ };
-var INTRINSICS = {
- '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
- '%Array%': Array,
- '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
- '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
- '%AsyncFromSyncIteratorPrototype%': undefined,
- '%AsyncFunction%': getEvalledConstructor('async function () {}'),
- '%AsyncGenerator%': asyncGenFunctionPrototype,
- '%AsyncGeneratorFunction%': asyncGenFunction,
- '%AsyncIteratorPrototype%': asyncGenPrototype ? getProto(asyncGenPrototype) : undefined,
- '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
- '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
- '%Boolean%': Boolean,
- '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
- '%Date%': Date,
- '%decodeURI%': decodeURI,
- '%decodeURIComponent%': decodeURIComponent,
- '%encodeURI%': encodeURI,
- '%encodeURIComponent%': encodeURIComponent,
- '%Error%': Error,
- '%eval%': eval, // eslint-disable-line no-eval
- '%EvalError%': EvalError,
- '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
- '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
- '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
- '%Function%': $Function,
- '%GeneratorFunction%': getEvalledConstructor('function* () {}'),
- '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
- '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
- '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
- '%isFinite%': isFinite,
- '%isNaN%': isNaN,
- '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
- '%JSON%': typeof JSON === 'object' ? JSON : undefined,
- '%Map%': typeof Map === 'undefined' ? undefined : Map,
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
- '%Math%': Math,
- '%Number%': Number,
- '%Object%': Object,
- '%parseFloat%': parseFloat,
- '%parseInt%': parseInt,
- '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
- '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
- '%RangeError%': RangeError,
- '%ReferenceError%': ReferenceError,
- '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
- '%RegExp%': RegExp,
- '%Set%': typeof Set === 'undefined' ? undefined : Set,
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
- '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
- '%String%': String,
- '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
- '%Symbol%': hasSymbols ? Symbol : undefined,
- '%SyntaxError%': $SyntaxError,
- '%ThrowTypeError%': ThrowTypeError,
- '%TypedArray%': TypedArray,
- '%TypeError%': $TypeError,
- '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
- '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
- '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
- '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
- '%URIError%': URIError,
- '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
- '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
-};
+ // Don't need to check whether node is already head, since it would
+ // have been returned above already if it was
-var LEGACY_ALIASES = {
- '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
- '%ArrayPrototype%': ['Array', 'prototype'],
- '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
- '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
- '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
- '%ArrayProto_values%': ['Array', 'prototype', 'values'],
- '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
- '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
- '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
- '%BooleanPrototype%': ['Boolean', 'prototype'],
- '%DataViewPrototype%': ['DataView', 'prototype'],
- '%DatePrototype%': ['Date', 'prototype'],
- '%ErrorPrototype%': ['Error', 'prototype'],
- '%EvalErrorPrototype%': ['EvalError', 'prototype'],
- '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
- '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
- '%FunctionPrototype%': ['Function', 'prototype'],
- '%Generator%': ['GeneratorFunction', 'prototype'],
- '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
- '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
- '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
- '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
- '%JSONParse%': ['JSON', 'parse'],
- '%JSONStringify%': ['JSON', 'stringify'],
- '%MapPrototype%': ['Map', 'prototype'],
- '%NumberPrototype%': ['Number', 'prototype'],
- '%ObjectPrototype%': ['Object', 'prototype'],
- '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
- '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
- '%PromisePrototype%': ['Promise', 'prototype'],
- '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
- '%Promise_all%': ['Promise', 'all'],
- '%Promise_reject%': ['Promise', 'reject'],
- '%Promise_resolve%': ['Promise', 'resolve'],
- '%RangeErrorPrototype%': ['RangeError', 'prototype'],
- '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
- '%RegExpPrototype%': ['RegExp', 'prototype'],
- '%SetPrototype%': ['Set', 'prototype'],
- '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
- '%StringPrototype%': ['String', 'prototype'],
- '%SymbolPrototype%': ['Symbol', 'prototype'],
- '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
- '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
- '%TypeErrorPrototype%': ['TypeError', 'prototype'],
- '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
- '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
- '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
- '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
- '%URIErrorPrototype%': ['URIError', 'prototype'],
- '%WeakMapPrototype%': ['WeakMap', 'prototype'],
- '%WeakSetPrototype%': ['WeakSet', 'prototype']
-};
+ // 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;
+ }
-var bind = __webpack_require__("D3zA");
-var hasOwn = __webpack_require__("oNNP");
-var $concat = bind.call(Function.call, Array.prototype.concat);
-var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
-var $replace = bind.call(Function.call, String.prototype.replace);
-var $strSlice = bind.call(Function.call, String.prototype.slice);
+ // 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++;
+ }
-/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
-var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
-var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
-var stringToPath = function stringToPath(string) {
- var first = $strSlice(string, 0, 1);
- var last = $strSlice(string, -1);
- if (first === '%' && last !== '%') {
- throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
- } else if (last === '%' && first !== '%') {
- throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
- }
- var result = [];
- $replace(string, rePropName, function (match, number, quote, subString) {
- result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
- });
- return result;
-};
-/* end adaptation */
+ head = node;
-var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
- var intrinsicName = name;
- var alias;
- if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
- alias = LEGACY_ALIASES[intrinsicName];
- intrinsicName = '%' + alias[0] + '%';
+ return node.val;
}
- if (hasOwn(INTRINSICS, intrinsicName)) {
- var value = INTRINSICS[intrinsicName];
- if (typeof value === 'undefined' && !allowMissing) {
- throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
- }
+ memoized.clear = function() {
+ head = null;
+ tail = null;
+ size = 0;
+ };
- return {
- alias: alias,
- name: intrinsicName,
- value: value
- };
- }
+ if ( false ) {}
- throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
-};
+ // 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.
-module.exports = function GetIntrinsic(name, allowMissing) {
- if (typeof name !== 'string' || name.length === 0) {
- throw new $TypeError('intrinsic name must be a non-empty string');
- }
- if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
- throw new $TypeError('"allowMissing" argument must be a boolean');
- }
+ // @ts-ignore
+ return memoized;
+}
- var parts = stringToPath(name);
- var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
+module.exports = memize;
- var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
- var intrinsicRealName = intrinsic.name;
- var value = intrinsic.value;
- var skipFurtherCaching = false;
- var alias = intrinsic.alias;
- if (alias) {
- intrinsicBaseName = alias[0];
- $spliceApply(parts, $concat([0, 1], alias));
- }
+/***/ }),
- for (var i = 1, isOwn = true; i < parts.length; i += 1) {
- var part = parts[i];
- var first = $strSlice(part, 0, 1);
- var last = $strSlice(part, -1);
- if (
- (
- (first === '"' || first === "'" || first === '`')
- || (last === '"' || last === "'" || last === '`')
- )
- && first !== last
- ) {
- throw new $SyntaxError('property names with quotes must have matching quotes');
+/***/ 8383:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+
+"use strict";
+
+
+var keysShim;
+if (!Object.keys) {
+ // modified from https://github.com/es-shims/es5-shim
+ var has = Object.prototype.hasOwnProperty;
+ var toStr = Object.prototype.toString;
+ var isArgs = __webpack_require__(4418); // eslint-disable-line global-require
+ var isEnumerable = Object.prototype.propertyIsEnumerable;
+ var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
+ var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
+ var dontEnums = [
+ 'toString',
+ 'toLocaleString',
+ 'valueOf',
+ 'hasOwnProperty',
+ 'isPrototypeOf',
+ 'propertyIsEnumerable',
+ 'constructor'
+ ];
+ var equalsConstructorPrototype = function (o) {
+ var ctor = o.constructor;
+ return ctor && ctor.prototype === o;
+ };
+ var excludedKeys = {
+ $applicationCache: true,
+ $console: true,
+ $external: true,
+ $frame: true,
+ $frameElement: true,
+ $frames: true,
+ $innerHeight: true,
+ $innerWidth: true,
+ $onmozfullscreenchange: true,
+ $onmozfullscreenerror: true,
+ $outerHeight: true,
+ $outerWidth: true,
+ $pageXOffset: true,
+ $pageYOffset: true,
+ $parent: true,
+ $scrollLeft: true,
+ $scrollTop: true,
+ $scrollX: true,
+ $scrollY: true,
+ $self: true,
+ $webkitIndexedDB: true,
+ $webkitStorageInfo: true,
+ $window: true
+ };
+ var hasAutomationEqualityBug = (function () {
+ /* global window */
+ if (typeof window === 'undefined') { return false; }
+ for (var k in window) {
+ try {
+ if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
+ try {
+ equalsConstructorPrototype(window[k]);
+ } catch (e) {
+ return true;
+ }
+ }
+ } catch (e) {
+ return true;
+ }
}
- if (part === 'constructor' || !isOwn) {
- skipFurtherCaching = true;
+ return false;
+ }());
+ var equalsConstructorPrototypeIfNotBuggy = function (o) {
+ /* global window */
+ if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
+ return equalsConstructorPrototype(o);
+ }
+ try {
+ return equalsConstructorPrototype(o);
+ } catch (e) {
+ return false;
}
+ };
- intrinsicBaseName += '.' + part;
- intrinsicRealName = '%' + intrinsicBaseName + '%';
+ keysShim = function keys(object) {
+ var isObject = object !== null && typeof object === 'object';
+ var isFunction = toStr.call(object) === '[object Function]';
+ var isArguments = isArgs(object);
+ var isString = isObject && toStr.call(object) === '[object String]';
+ var theKeys = [];
- if (hasOwn(INTRINSICS, intrinsicRealName)) {
- value = INTRINSICS[intrinsicRealName];
- } else if (value != null) {
- if (!(part in value)) {
- if (!allowMissing) {
- throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
- }
- return void undefined;
+ if (!isObject && !isFunction && !isArguments) {
+ throw new TypeError('Object.keys called on a non-object');
+ }
+
+ var skipProto = hasProtoEnumBug && isFunction;
+ if (isString && object.length > 0 && !has.call(object, 0)) {
+ for (var i = 0; i < object.length; ++i) {
+ theKeys.push(String(i));
}
- if ($gOPD && (i + 1) >= parts.length) {
- var desc = $gOPD(value, part);
- isOwn = !!desc;
+ }
- // By convention, when a data property is converted to an accessor
- // property to emulate a data property that does not suffer from
- // the override mistake, that accessor's getter is marked with
- // an `originalValue` property. Here, when we detect this, we
- // uphold the illusion by pretending to see that original data
- // property, i.e., returning the value rather than the getter
- // itself.
- if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
- value = desc.get;
- } else {
- value = value[part];
+ if (isArguments && object.length > 0) {
+ for (var j = 0; j < object.length; ++j) {
+ theKeys.push(String(j));
+ }
+ } else {
+ for (var name in object) {
+ if (!(skipProto && name === 'prototype') && has.call(object, name)) {
+ theKeys.push(String(name));
}
- } else {
- isOwn = hasOwn(value, part);
- value = value[part];
}
+ }
- if (isOwn && !skipFurtherCaching) {
- INTRINSICS[intrinsicRealName] = value;
+ if (hasDontEnumBug) {
+ var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
+
+ for (var k = 0; k < dontEnums.length; ++k) {
+ if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
+ theKeys.push(dontEnums[k]);
+ }
}
}
- }
- return value;
-};
+ return theKeys;
+ };
+}
+module.exports = keysShim;
/***/ }),
-/***/ "AP2z":
-/***/ (function(module, exports, __webpack_require__) {
-
-var Symbol = __webpack_require__("nmnc");
-
-/** Used for built-in method references. */
-var objectProto = Object.prototype;
+/***/ 806:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
+"use strict";
-/**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
-var nativeObjectToString = objectProto.toString;
-/** Built-in value references. */
-var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
+var slice = Array.prototype.slice;
+var isArgs = __webpack_require__(4418);
-/**
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the raw `toStringTag`.
- */
-function getRawTag(value) {
- var isOwn = hasOwnProperty.call(value, symToStringTag),
- tag = value[symToStringTag];
+var origKeys = Object.keys;
+var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__(8383);
- try {
- value[symToStringTag] = undefined;
- var unmasked = true;
- } catch (e) {}
+var originalKeys = Object.keys;
- var result = nativeObjectToString.call(value);
- if (unmasked) {
- if (isOwn) {
- value[symToStringTag] = tag;
- } else {
- delete value[symToStringTag];
- }
- }
- return result;
-}
+keysShim.shim = function shimObjectKeys() {
+ if (Object.keys) {
+ var keysWorksWithArguments = (function () {
+ // Safari 5.0 bug
+ var args = Object.keys(arguments);
+ return args && args.length === arguments.length;
+ }(1, 2));
+ if (!keysWorksWithArguments) {
+ Object.keys = function keys(object) { // eslint-disable-line func-name-matching
+ if (isArgs(object)) {
+ return originalKeys(slice.call(object));
+ }
+ return originalKeys(object);
+ };
+ }
+ } else {
+ Object.keys = keysShim;
+ }
+ return Object.keys || keysShim;
+};
-module.exports = getRawTag;
+module.exports = keysShim;
/***/ }),
-/***/ "APjL":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 4418:
+/***/ (function(module) {
"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return closest; });
-/* harmony import */ var _matches_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("9Zbq");
-
-
-/**
- * Ponyfill for `Element.prototype.closest`
- *
- * @example
- * import { closest } from "reakit-utils";
- *
- * closest(document.getElementById("id"), "div");
- * // same as
- * document.getElementById("id").closest("div");
- */
-function closest(element, selectors) {
- if ("closest" in element) return element.closest(selectors);
-
- do {
- if (Object(_matches_js__WEBPACK_IMPORTED_MODULE_0__[/* matches */ "a"])(element, selectors)) return element;
- element = element.parentElement || element.parentNode;
- } while (element !== null && element.nodeType === 1);
- return null;
-}
+var toStr = Object.prototype.toString;
+module.exports = function isArguments(value) {
+ var str = toStr.call(value);
+ var isArgs = str === '[object Arguments]';
+ if (!isArgs) {
+ isArgs = str !== '[object Array]' &&
+ value !== null &&
+ typeof value === 'object' &&
+ typeof value.length === 'number' &&
+ value.length >= 0 &&
+ toStr.call(value.callee) === '[object Function]';
+ }
+ return isArgs;
+};
/***/ }),
-/***/ "AXvK":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 2148:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useIsomorphicEffect; });
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _canUseDOM_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("+ipW");
-
-
-
-
-
-/**
- * `React.useLayoutEffect` that fallbacks to `React.useEffect` on server side
- * rendering.
- */
-var useIsomorphicEffect = !_canUseDOM_js__WEBPACK_IMPORTED_MODULE_1__[/* canUseDOM */ "a"] ? react__WEBPACK_IMPORTED_MODULE_0__["useEffect"] : react__WEBPACK_IMPORTED_MODULE_0__["useLayoutEffect"];
+// modified from https://github.com/es-shims/es6-shim
+var keys = __webpack_require__(806);
+var canBeObject = function (obj) {
+ return typeof obj !== 'undefined' && obj !== null;
+};
+var hasSymbols = __webpack_require__(5682)();
+var callBound = __webpack_require__(7615);
+var toObject = Object;
+var $push = callBound('Array.prototype.push');
+var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');
+var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;
+// eslint-disable-next-line no-unused-vars
+module.exports = function assign(target, source1) {
+ if (!canBeObject(target)) { throw new TypeError('target must be an object'); }
+ var objTarget = toObject(target);
+ var s, source, i, props, syms, value, key;
+ for (s = 1; s < arguments.length; ++s) {
+ source = toObject(arguments[s]);
+ props = keys(source);
+ var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);
+ if (getSymbols) {
+ syms = getSymbols(source);
+ for (i = 0; i < syms.length; ++i) {
+ key = syms[i];
+ if ($propIsEnumerable(source, key)) {
+ $push(props, key);
+ }
+ }
+ }
+ for (i = 0; i < props.length; ++i) {
+ key = props[i];
+ value = source[key];
+ if ($propIsEnumerable(source, key)) {
+ objTarget[key] = value;
+ }
+ }
+ }
+ return objTarget;
+};
/***/ }),
-/***/ "Ae65":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 4011:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports['default'] = getCalendarDaySettings;
-
-var _getPhrase = __webpack_require__("oOcr");
-
-var _getPhrase2 = _interopRequireDefault(_getPhrase);
-
-var _constants = __webpack_require__("Fv1B");
+var defineProperties = __webpack_require__(9170);
+var callBind = __webpack_require__(2550);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+var implementation = __webpack_require__(2148);
+var getPolyfill = __webpack_require__(293);
+var shim = __webpack_require__(2666);
-function getCalendarDaySettings(day, ariaLabelFormat, daySize, modifiers, phrases) {
- var chooseAvailableDate = phrases.chooseAvailableDate,
- dateIsUnavailable = phrases.dateIsUnavailable,
- dateIsSelected = phrases.dateIsSelected;
+var polyfill = callBind.apply(getPolyfill());
+// eslint-disable-next-line no-unused-vars
+var bound = function assign(target, source1) {
+ return polyfill(Object, arguments);
+};
+defineProperties(bound, {
+ getPolyfill: getPolyfill,
+ implementation: implementation,
+ shim: shim
+});
- var daySizeStyles = {
- width: daySize,
- height: daySize - 1
- };
+module.exports = bound;
- var useDefaultCursor = modifiers.has('blocked-minimum-nights') || modifiers.has('blocked-calendar') || modifiers.has('blocked-out-of-range');
- var selected = modifiers.has('selected') || modifiers.has('selected-start') || modifiers.has('selected-end');
+/***/ }),
- var hoveredSpan = !selected && (modifiers.has('hovered-span') || modifiers.has('after-hovered-start'));
+/***/ 293:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- var isOutsideRange = modifiers.has('blocked-out-of-range');
+"use strict";
- var formattedDate = { date: day.format(ariaLabelFormat) };
- var ariaLabel = (0, _getPhrase2['default'])(chooseAvailableDate, formattedDate);
- if (modifiers.has(_constants.BLOCKED_MODIFIER)) {
- ariaLabel = (0, _getPhrase2['default'])(dateIsUnavailable, formattedDate);
- } else if (selected) {
- ariaLabel = (0, _getPhrase2['default'])(dateIsSelected, formattedDate);
- }
+var implementation = __webpack_require__(2148);
- return {
- daySizeStyles: daySizeStyles,
- useDefaultCursor: useDefaultCursor,
- selected: selected,
- hoveredSpan: hoveredSpan,
- isOutsideRange: isOutsideRange,
- ariaLabel: ariaLabel
- };
-}
-
-/***/ }),
-
-/***/ "AeFk":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* unused harmony export ClassNames */
-/* unused harmony export Global */
-/* unused harmony export createElement */
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return css; });
-/* unused harmony export jsx */
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return keyframes; });
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _emotion_cache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("+1VY");
-/* harmony import */ var _emotion_element_699e6908_browser_esm_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("ek6p");
-/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("pVnL");
-/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _emotion_weak_memoize__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("gRFL");
-/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("2mql");
-/* harmony import */ var hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _emotion_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("eVQB");
-/* harmony import */ var _emotion_serialize__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("Exhd");
-/* harmony import */ var _emotion_sheet__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("ep+1");
-
-
-
-
-
-
-
-
-
-
-
-
-var pkg = {
- name: "@emotion/react",
- version: "11.7.1",
- main: "dist/emotion-react.cjs.js",
- module: "dist/emotion-react.esm.js",
- browser: {
- "./dist/emotion-react.cjs.js": "./dist/emotion-react.browser.cjs.js",
- "./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js"
- },
- types: "types/index.d.ts",
- files: [
- "src",
- "dist",
- "jsx-runtime",
- "jsx-dev-runtime",
- "_isolated-hnrs",
- "types/*.d.ts",
- "macro.js",
- "macro.d.ts",
- "macro.js.flow"
- ],
- sideEffects: false,
- author: "mitchellhamilton <mitchell@mitchellhamilton.me>",
- license: "MIT",
- scripts: {
- "test:typescript": "dtslint types"
- },
- dependencies: {
- "@babel/runtime": "^7.13.10",
- "@emotion/cache": "^11.7.1",
- "@emotion/serialize": "^1.0.2",
- "@emotion/sheet": "^1.1.0",
- "@emotion/utils": "^1.0.0",
- "@emotion/weak-memoize": "^0.2.5",
- "hoist-non-react-statics": "^3.3.1"
- },
- peerDependencies: {
- "@babel/core": "^7.0.0",
- react: ">=16.8.0"
- },
- peerDependenciesMeta: {
- "@babel/core": {
- optional: true
- },
- "@types/react": {
- optional: true
- }
- },
- devDependencies: {
- "@babel/core": "^7.13.10",
- "@emotion/css": "11.7.1",
- "@emotion/css-prettifier": "1.0.1",
- "@emotion/server": "11.4.0",
- "@emotion/styled": "11.6.0",
- "@types/react": "^16.9.11",
- dtslint: "^0.3.0",
- "html-tag-names": "^1.1.2",
- react: "16.14.0",
- "svg-tag-names": "^1.1.1"
- },
- repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
- publishConfig: {
- access: "public"
- },
- "umd:main": "dist/emotion-react.umd.min.js",
- preconstruct: {
- entrypoints: [
- "./index.js",
- "./jsx-runtime.js",
- "./jsx-dev-runtime.js",
- "./_isolated-hnrs.js"
- ],
- umdName: "emotionReact"
+var lacksProperEnumerationOrder = function () {
+ if (!Object.assign) {
+ return false;
+ }
+ /*
+ * v8, specifically in node 4.x, has a bug with incorrect property enumeration order
+ * note: this does not detect the bug unless there's 20 characters
+ */
+ var str = 'abcdefghijklmnopqrst';
+ var letters = str.split('');
+ var map = {};
+ for (var i = 0; i < letters.length; ++i) {
+ map[letters[i]] = letters[i];
+ }
+ var obj = Object.assign({}, map);
+ var actual = '';
+ for (var k in obj) {
+ actual += k;
}
+ return str !== actual;
};
-var jsx = function jsx(type, props) {
- var args = arguments;
-
- if (props == null || !_emotion_element_699e6908_browser_esm_js__WEBPACK_IMPORTED_MODULE_2__[/* h */ "f"].call(props, 'css')) {
- // $FlowFixMe
- return react__WEBPACK_IMPORTED_MODULE_0__["createElement"].apply(undefined, args);
- }
-
- var argsLength = args.length;
- var createElementArgArray = new Array(argsLength);
- createElementArgArray[0] = _emotion_element_699e6908_browser_esm_js__WEBPACK_IMPORTED_MODULE_2__[/* E */ "b"];
- createElementArgArray[1] = Object(_emotion_element_699e6908_browser_esm_js__WEBPACK_IMPORTED_MODULE_2__[/* c */ "e"])(type, props);
-
- for (var i = 2; i < argsLength; i++) {
- createElementArgArray[i] = args[i];
- } // $FlowFixMe
-
-
- return react__WEBPACK_IMPORTED_MODULE_0__["createElement"].apply(null, createElementArgArray);
+var assignHasPendingExceptions = function () {
+ if (!Object.assign || !Object.preventExtensions) {
+ return false;
+ }
+ /*
+ * Firefox 37 still has "pending exception" logic in its Object.assign implementation,
+ * which is 72% slower than our shim, and Firefox 40's native implementation.
+ */
+ var thrower = Object.preventExtensions({ 1: 2 });
+ try {
+ Object.assign(thrower, 'xy');
+ } catch (e) {
+ return thrower[1] === 'y';
+ }
+ return false;
};
-var warnedAboutCssPropForGlobal = false; // maintain place over rerenders.
-// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
-// initial client-side render from SSR, use place of hydrating tag
-
-var Global = /* #__PURE__ */Object(_emotion_element_699e6908_browser_esm_js__WEBPACK_IMPORTED_MODULE_2__[/* w */ "g"])(function (props, cache) {
- if (false) {}
-
- var styles = props.styles;
- var serialized = Object(_emotion_serialize__WEBPACK_IMPORTED_MODULE_7__[/* serializeStyles */ "a"])([styles], undefined, Object(react__WEBPACK_IMPORTED_MODULE_0__["useContext"])(_emotion_element_699e6908_browser_esm_js__WEBPACK_IMPORTED_MODULE_2__[/* T */ "c"]));
- // but it is based on a constant that will never change at runtime
- // it's effectively like having two implementations and switching them out
- // so it's not actually breaking anything
-
-
- var sheetRef = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])();
- Object(react__WEBPACK_IMPORTED_MODULE_0__["useLayoutEffect"])(function () {
- var key = cache.key + "-global";
- var sheet = new _emotion_sheet__WEBPACK_IMPORTED_MODULE_8__[/* StyleSheet */ "a"]({
- key: key,
- nonce: cache.sheet.nonce,
- container: cache.sheet.container,
- speedy: cache.sheet.isSpeedy
- });
- var rehydrating = false; // $FlowFixMe
-
- var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]");
-
- if (cache.sheet.tags.length) {
- sheet.before = cache.sheet.tags[0];
- }
-
- if (node !== null) {
- rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other <Global/>s
-
- node.setAttribute('data-emotion', key);
- sheet.hydrate([node]);
- }
-
- sheetRef.current = [sheet, rehydrating];
- return function () {
- sheet.flush();
- };
- }, [cache]);
- Object(react__WEBPACK_IMPORTED_MODULE_0__["useLayoutEffect"])(function () {
- var sheetRefCurrent = sheetRef.current;
- var sheet = sheetRefCurrent[0],
- rehydrating = sheetRefCurrent[1];
-
- if (rehydrating) {
- sheetRefCurrent[1] = false;
- return;
- }
-
- if (serialized.next !== undefined) {
- // insert keyframes
- Object(_emotion_utils__WEBPACK_IMPORTED_MODULE_6__[/* insertStyles */ "b"])(cache, serialized.next, true);
- }
+module.exports = function getPolyfill() {
+ if (!Object.assign) {
+ return implementation;
+ }
+ if (lacksProperEnumerationOrder()) {
+ return implementation;
+ }
+ if (assignHasPendingExceptions()) {
+ return implementation;
+ }
+ return Object.assign;
+};
- if (sheet.tags.length) {
- // if this doesn't exist then it will be null so the style element will be appended
- var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
- sheet.before = element;
- sheet.flush();
- }
- cache.insert("", serialized, sheet, false);
- }, [cache, serialized.name]);
- return null;
-});
+/***/ }),
-if (false) {}
+/***/ 2666:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-function css() {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
+"use strict";
- return Object(_emotion_serialize__WEBPACK_IMPORTED_MODULE_7__[/* serializeStyles */ "a"])(args);
-}
-var keyframes = function keyframes() {
- var insertable = css.apply(void 0, arguments);
- var name = "animation-" + insertable.name; // $FlowFixMe
+var define = __webpack_require__(9170);
+var getPolyfill = __webpack_require__(293);
- return {
- name: name,
- styles: "@keyframes " + name + "{" + insertable.styles + "}",
- anim: 1,
- toString: function toString() {
- return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
- }
- };
+module.exports = function shimAssign() {
+ var polyfill = getPolyfill();
+ define(
+ Object,
+ { assign: polyfill },
+ { assign: function () { return Object.assign !== polyfill; } }
+ );
+ return polyfill;
};
-var classnames = function classnames(args) {
- var len = args.length;
- var i = 0;
- var cls = '';
-
- for (; i < len; i++) {
- var arg = args[i];
- if (arg == null) continue;
- var toAdd = void 0;
-
- switch (typeof arg) {
- case 'boolean':
- break;
-
- case 'object':
- {
- if (Array.isArray(arg)) {
- toAdd = classnames(arg);
- } else {
- if (false) {}
-
- toAdd = '';
-
- for (var k in arg) {
- if (arg[k] && k) {
- toAdd && (toAdd += ' ');
- toAdd += k;
- }
- }
- }
-
- break;
- }
- default:
- {
- toAdd = arg;
- }
- }
+/***/ }),
- if (toAdd) {
- cls && (cls += ' ');
- cls += toAdd;
- }
- }
+/***/ 1631:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- return cls;
-};
+"use strict";
-function merge(registered, css, className) {
- var registeredStyles = [];
- var rawClassName = Object(_emotion_utils__WEBPACK_IMPORTED_MODULE_6__[/* getRegisteredStyles */ "a"])(registered, registeredStyles, className);
- if (registeredStyles.length < 2) {
- return className;
- }
+var has = __webpack_require__(9284);
+var RequireObjectCoercible = __webpack_require__(604);
+var callBound = __webpack_require__(7615);
- return rawClassName + css(registeredStyles);
-}
+var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
-var Noop = function Noop() {
- return null;
+module.exports = function values(O) {
+ var obj = RequireObjectCoercible(O);
+ var vals = [];
+ for (var key in obj) {
+ if (has(obj, key) && $isEnumerable(obj, key)) {
+ vals.push(obj[key]);
+ }
+ }
+ return vals;
};
-var ClassNames = /* #__PURE__ */Object(_emotion_element_699e6908_browser_esm_js__WEBPACK_IMPORTED_MODULE_2__[/* w */ "g"])(function (props, cache) {
- var hasRendered = false;
- var css = function css() {
- if (hasRendered && "production" !== 'production') {
- throw new Error('css can only be used during render');
- }
+/***/ }),
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
+/***/ 5861:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- var serialized = Object(_emotion_serialize__WEBPACK_IMPORTED_MODULE_7__[/* serializeStyles */ "a"])(args, cache.registered);
+"use strict";
- {
- Object(_emotion_utils__WEBPACK_IMPORTED_MODULE_6__[/* insertStyles */ "b"])(cache, serialized, false);
- }
- return cache.key + "-" + serialized.name;
- };
+var define = __webpack_require__(9170);
+var callBind = __webpack_require__(2550);
- var cx = function cx() {
- if (hasRendered && "production" !== 'production') {
- throw new Error('cx can only be used during render');
- }
+var implementation = __webpack_require__(1631);
+var getPolyfill = __webpack_require__(779);
+var shim = __webpack_require__(7256);
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
+var polyfill = callBind(getPolyfill(), Object);
- return merge(cache.registered, css, classnames(args));
- };
+define(polyfill, {
+ getPolyfill: getPolyfill,
+ implementation: implementation,
+ shim: shim
+});
- var content = {
- css: css,
- cx: cx,
- theme: Object(react__WEBPACK_IMPORTED_MODULE_0__["useContext"])(_emotion_element_699e6908_browser_esm_js__WEBPACK_IMPORTED_MODULE_2__[/* T */ "c"])
- };
- var ele = props.children(content);
- hasRendered = true;
- var possiblyStyleElement = /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(Noop, null);
+module.exports = polyfill;
- return /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, possiblyStyleElement, ele);
-});
+/***/ }),
-if (false) {}
+/***/ 604:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-if (false) { var globalKey, globalContext, isJest, isBrowser; }
+"use strict";
+module.exports = __webpack_require__(2559);
/***/ }),
-/***/ "Asd8":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 2559:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-var fnToStr = Function.prototype.toString;
-var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
-var badArrayLike;
-var isCallableMarker;
-if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
- try {
- badArrayLike = Object.defineProperty({}, 'length', {
- get: function () {
- throw isCallableMarker;
- }
- });
- isCallableMarker = {};
- // eslint-disable-next-line no-throw-literal
- reflectApply(function () { throw 42; }, null, badArrayLike);
- } catch (_) {
- if (_ !== isCallableMarker) {
- reflectApply = null;
- }
- }
-} else {
- reflectApply = null;
-}
+var GetIntrinsic = __webpack_require__(6732);
-var constructorRegex = /^\s*class\b/;
-var isES6ClassFn = function isES6ClassFunction(value) {
- try {
- var fnStr = fnToStr.call(value);
- return constructorRegex.test(fnStr);
- } catch (e) {
- return false; // not a function
- }
-};
+var $TypeError = GetIntrinsic('%TypeError%');
-var tryFunctionObject = function tryFunctionToStr(value) {
- try {
- if (isES6ClassFn(value)) { return false; }
- fnToStr.call(value);
- return true;
- } catch (e) {
- return false;
- }
-};
-var toStr = Object.prototype.toString;
-var fnClass = '[object Function]';
-var genClass = '[object GeneratorFunction]';
-var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`
-/* globals document: false */
-var documentDotAll = typeof document === 'object' && typeof document.all === 'undefined' && document.all !== undefined ? document.all : {};
+// http://www.ecma-international.org/ecma-262/5.1/#sec-9.10
-module.exports = reflectApply
- ? function isCallable(value) {
- if (value === documentDotAll) { return true; }
- if (!value) { return false; }
- if (typeof value !== 'function' && typeof value !== 'object') { return false; }
- if (typeof value === 'function' && !value.prototype) { return true; }
- try {
- reflectApply(value, null, badArrayLike);
- } catch (e) {
- if (e !== isCallableMarker) { return false; }
- }
- return !isES6ClassFn(value);
+module.exports = function CheckObjectCoercible(value, optMessage) {
+ if (value == null) {
+ throw new $TypeError(optMessage || ('Cannot call method on ' + value));
}
- : function isCallable(value) {
- if (value === documentDotAll) { return true; }
- if (!value) { return false; }
- if (typeof value !== 'function' && typeof value !== 'object') { return false; }
- if (typeof value === 'function' && !value.prototype) { return true; }
- if (hasToStringTag) { return tryFunctionObject(value); }
- if (isES6ClassFn(value)) { return false; }
- var strClass = toStr.call(value);
- return strClass === fnClass || strClass === genClass;
- };
+ return value;
+};
/***/ }),
-/***/ "B6Q+":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 6732:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-var hasSymbols = __webpack_require__("qGip");
-
-module.exports = function hasToStringTagShams() {
- return hasSymbols() && !!Symbol.toStringTag;
-};
-
+/* globals
+ AggregateError,
+ Atomics,
+ FinalizationRegistry,
+ SharedArrayBuffer,
+ WeakRef,
+*/
-/***/ }),
+var undefined;
-/***/ "BZp5":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+var $SyntaxError = SyntaxError;
+var $Function = Function;
+var $TypeError = TypeError;
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _objectSpread2; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _createForOfIteratorHelperLoose; });
-function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
+// eslint-disable-next-line consistent-return
+var getEvalledConstructor = function (expressionSyntax) {
+ try {
+ // eslint-disable-next-line no-new-func
+ return Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
+ } catch (e) {}
+};
- return obj;
+var $gOPD = Object.getOwnPropertyDescriptor;
+if ($gOPD) {
+ try {
+ $gOPD({}, '');
+ } catch (e) {
+ $gOPD = null; // this is IE 8, which has a broken gOPD
+ }
}
-function ownKeys(object, enumerableOnly) {
- var keys = Object.keys(object);
-
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object);
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
- });
- keys.push.apply(keys, symbols);
- }
+var throwTypeError = function () { throw new $TypeError(); };
+var ThrowTypeError = $gOPD
+ ? (function () {
+ try {
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
+ arguments.callee; // IE 8 does not throw here
+ return throwTypeError;
+ } catch (calleeThrows) {
+ try {
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
+ return $gOPD(arguments, 'callee').get;
+ } catch (gOPDthrows) {
+ return throwTypeError;
+ }
+ }
+ }())
+ : throwTypeError;
- return keys;
-}
+var hasSymbols = __webpack_require__(9905)();
-function _objectSpread2(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i] != null ? arguments[i] : {};
+var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
- if (i % 2) {
- ownKeys(Object(source), true).forEach(function (key) {
- _defineProperty(target, key, source[key]);
- });
- } else if (Object.getOwnPropertyDescriptors) {
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
- } else {
- ownKeys(Object(source)).forEach(function (key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- }
+var asyncGenFunction = getEvalledConstructor('async function* () {}');
+var asyncGenFunctionPrototype = asyncGenFunction ? asyncGenFunction.prototype : undefined;
+var asyncGenPrototype = asyncGenFunctionPrototype ? asyncGenFunctionPrototype.prototype : undefined;
- return target;
-}
+var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
-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;
-}
+var INTRINSICS = {
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
+ '%Array%': Array,
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
+ '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
+ '%AsyncFromSyncIteratorPrototype%': undefined,
+ '%AsyncFunction%': getEvalledConstructor('async function () {}'),
+ '%AsyncGenerator%': asyncGenFunctionPrototype,
+ '%AsyncGeneratorFunction%': asyncGenFunction,
+ '%AsyncIteratorPrototype%': asyncGenPrototype ? getProto(asyncGenPrototype) : undefined,
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
+ '%Boolean%': Boolean,
+ '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
+ '%Date%': Date,
+ '%decodeURI%': decodeURI,
+ '%decodeURIComponent%': decodeURIComponent,
+ '%encodeURI%': encodeURI,
+ '%encodeURIComponent%': encodeURIComponent,
+ '%Error%': Error,
+ '%eval%': eval, // eslint-disable-line no-eval
+ '%EvalError%': EvalError,
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
+ '%Function%': $Function,
+ '%GeneratorFunction%': getEvalledConstructor('function* () {}'),
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
+ '%isFinite%': isFinite,
+ '%isNaN%': isNaN,
+ '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined,
+ '%Map%': typeof Map === 'undefined' ? undefined : Map,
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
+ '%Math%': Math,
+ '%Number%': Number,
+ '%Object%': Object,
+ '%parseFloat%': parseFloat,
+ '%parseInt%': parseInt,
+ '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
+ '%RangeError%': RangeError,
+ '%ReferenceError%': ReferenceError,
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
+ '%RegExp%': RegExp,
+ '%Set%': typeof Set === 'undefined' ? undefined : Set,
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
+ '%String%': String,
+ '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
+ '%Symbol%': hasSymbols ? Symbol : undefined,
+ '%SyntaxError%': $SyntaxError,
+ '%ThrowTypeError%': ThrowTypeError,
+ '%TypedArray%': TypedArray,
+ '%TypeError%': $TypeError,
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
+ '%URIError%': URIError,
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
+};
-function _unsupportedIterableToArray(o, minLen) {
- if (!o) return;
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if (n === "Object" && o.constructor) n = o.constructor.name;
- if (n === "Map" || n === "Set") return Array.from(o);
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
-}
+var LEGACY_ALIASES = {
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
+ '%ArrayPrototype%': ['Array', 'prototype'],
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
+ '%DataViewPrototype%': ['DataView', 'prototype'],
+ '%DatePrototype%': ['Date', 'prototype'],
+ '%ErrorPrototype%': ['Error', 'prototype'],
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
+ '%FunctionPrototype%': ['Function', 'prototype'],
+ '%Generator%': ['GeneratorFunction', 'prototype'],
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
+ '%JSONParse%': ['JSON', 'parse'],
+ '%JSONStringify%': ['JSON', 'stringify'],
+ '%MapPrototype%': ['Map', 'prototype'],
+ '%NumberPrototype%': ['Number', 'prototype'],
+ '%ObjectPrototype%': ['Object', 'prototype'],
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
+ '%PromisePrototype%': ['Promise', 'prototype'],
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
+ '%Promise_all%': ['Promise', 'all'],
+ '%Promise_reject%': ['Promise', 'reject'],
+ '%Promise_resolve%': ['Promise', 'resolve'],
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
+ '%SetPrototype%': ['Set', 'prototype'],
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
+ '%StringPrototype%': ['String', 'prototype'],
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
+};
-function _arrayLikeToArray(arr, len) {
- if (len == null || len > arr.length) len = arr.length;
+var bind = __webpack_require__(1930);
+var hasOwn = __webpack_require__(9284);
+var $concat = bind.call(Function.call, Array.prototype.concat);
+var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
+var $replace = bind.call(Function.call, String.prototype.replace);
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
+/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
+var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
+var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
+var stringToPath = function stringToPath(string) {
+ var result = [];
+ $replace(string, rePropName, function (match, number, quote, subString) {
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
+ });
+ return result;
+};
+/* end adaptation */
- return arr2;
-}
+var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
+ var intrinsicName = name;
+ var alias;
+ if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
+ alias = LEGACY_ALIASES[intrinsicName];
+ intrinsicName = '%' + alias[0] + '%';
+ }
-function _createForOfIteratorHelperLoose(o, allowArrayLike) {
- var it;
+ if (hasOwn(INTRINSICS, intrinsicName)) {
+ var value = INTRINSICS[intrinsicName];
+ if (typeof value === 'undefined' && !allowMissing) {
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
+ }
- if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
- if (it) o = it;
- var i = 0;
- return function () {
- if (i >= o.length) return {
- done: true
- };
- return {
- done: false,
- value: o[i++]
- };
- };
- }
+ return {
+ alias: alias,
+ name: intrinsicName,
+ value: value
+ };
+ }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
+};
- it = o[Symbol.iterator]();
- return it.next.bind(it);
-}
+module.exports = function GetIntrinsic(name, allowMissing) {
+ if (typeof name !== 'string' || name.length === 0) {
+ throw new $TypeError('intrinsic name must be a non-empty string');
+ }
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
+ throw new $TypeError('"allowMissing" argument must be a boolean');
+ }
+ var parts = stringToPath(name);
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
+ var intrinsicRealName = intrinsic.name;
+ var value = intrinsic.value;
+ var skipFurtherCaching = false;
+ var alias = intrinsic.alias;
+ if (alias) {
+ intrinsicBaseName = alias[0];
+ $spliceApply(parts, $concat([0, 1], alias));
+ }
-/***/ }),
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
+ var part = parts[i];
+ if (part === 'constructor' || !isOwn) {
+ skipFurtherCaching = true;
+ }
-/***/ "BeK9":
-/***/ (function(module, exports, __webpack_require__) {
+ intrinsicBaseName += '.' + part;
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
-"use strict";
+ if (hasOwn(INTRINSICS, intrinsicRealName)) {
+ value = INTRINSICS[intrinsicRealName];
+ } else if (value != null) {
+ if ($gOPD && (i + 1) >= parts.length) {
+ var desc = $gOPD(value, part);
+ isOwn = !!desc;
+ if (!allowMissing && !(part in value)) {
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
+ }
+ // By convention, when a data property is converted to an accessor
+ // property to emulate a data property that does not suffer from
+ // the override mistake, that accessor's getter is marked with
+ // an `originalValue` property. Here, when we detect this, we
+ // uphold the illusion by pretending to see that original data
+ // property, i.e., returning the value rather than the getter
+ // itself.
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
+ value = desc.get;
+ } else {
+ value = value[part];
+ }
+ } else {
+ isOwn = hasOwn(value, part);
+ value = value[part];
+ }
-module.exports = function isPrimitive(value) {
- return value === null || (typeof value !== 'function' && typeof value !== 'object');
+ if (isOwn && !skipFurtherCaching) {
+ INTRINSICS[intrinsicRealName] = value;
+ }
+ }
+ }
+ return value;
};
/***/ }),
-/***/ "Bl8U":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 779:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-var GetIntrinsic = __webpack_require__("j1Hc");
-
-var $Array = GetIntrinsic('%Array%');
-
-// eslint-disable-next-line global-require
-var toStr = !$Array.isArray && __webpack_require__("qeuH")('Object.prototype.toString');
-
-// https://ecma-international.org/ecma-262/6.0/#sec-isarray
+var implementation = __webpack_require__(1631);
-module.exports = $Array.isArray || function IsArray(argument) {
- return toStr(argument) === '[object Array]';
+module.exports = function getPolyfill() {
+ return typeof Object.values === 'function' ? Object.values : implementation;
};
/***/ }),
-/***/ "Bpkj":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 7256:
+/***/ (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_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
- */
+var getPolyfill = __webpack_require__(779);
+var define = __webpack_require__(9170);
-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);
+module.exports = function shimValues() {
+ var polyfill = getPolyfill();
+ define(Object, { values: polyfill }, {
+ values: function testValues() {
+ return Object.values !== polyfill;
+ }
+ });
+ return polyfill;
+};
/***/ }),
-/***/ "C6yU":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 5372:
+/***/ (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 useContextSystem; });
-/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Z23Y");
-/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _context_system_provider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("6zzY");
-/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("Ohaz");
-/* harmony import */ var _get_styled_class_name_from_key__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("UAm0");
-/* harmony import */ var _utils_hooks_use_cx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("h9+V");
/**
- * WordPress dependencies
+ * 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.
*/
-/**
- * Internal dependencies
- */
+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;
+};
-/**
- * @template TProps
- * @typedef {TProps & { className: string }} ConnectedProps
- */
+/***/ }),
+
+/***/ 2652:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
/**
- * Custom hook that derives registered props from the Context system.
- * These derived props are then consolidated with incoming component props.
+ * Copyright (c) 2013-present, Facebook, Inc.
*
- * @template {{ className?: string }} P
- * @param {P} props Incoming props from the component.
- * @param {string} namespace The namespace to register and to derive context props from.
- * @return {ConnectedProps<P>} The connected props.
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
*/
-function useContextSystem(props, namespace) {
- const contextSystemProps = Object(_context_system_provider__WEBPACK_IMPORTED_MODULE_1__[/* useComponentsContext */ "b"])();
-
- if (typeof namespace === 'undefined') {
- typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_0___default()('useContextSystem: Please provide a namespace') : void 0;
- }
-
- const contextProps = (contextSystemProps === null || contextSystemProps === void 0 ? void 0 : contextSystemProps[namespace]) || {};
- /* eslint-disable jsdoc/no-undefined-types */
+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)();
+}
- /** @type {ConnectedProps<P>} */
- // @ts-ignore We fill in the missing properties below
- const finalComponentProps = { ...Object(_utils__WEBPACK_IMPORTED_MODULE_2__[/* getConnectedNamespace */ "a"])(),
- ...Object(_utils__WEBPACK_IMPORTED_MODULE_2__[/* getNamespace */ "b"])(namespace)
- };
- /* eslint-enable jsdoc/no-undefined-types */
+/***/ }),
- const {
- _overrides: overrideProps,
- ...otherContextProps
- } = contextProps;
- const initialMergedProps = Object.entries(otherContextProps).length ? Object.assign({}, otherContextProps, props) : props;
- const cx = Object(_utils_hooks_use_cx__WEBPACK_IMPORTED_MODULE_4__[/* useCx */ "a"])();
- const classes = cx(Object(_get_styled_class_name_from_key__WEBPACK_IMPORTED_MODULE_3__[/* getStyledClassNameFromKey */ "a"])(namespace), props.className); // Provides the ability to customize the render of the component.
+/***/ 9567:
+/***/ (function(module) {
- const rendered = typeof initialMergedProps.renderChildren === 'function' ? initialMergedProps.renderChildren(initialMergedProps) : initialMergedProps.children;
+"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.
+ */
- for (const key in initialMergedProps) {
- // @ts-ignore filling in missing props
- finalComponentProps[key] = initialMergedProps[key];
- }
- for (const key in overrideProps) {
- // @ts-ignore filling in missing props
- finalComponentProps[key] = overrideProps[key];
- } // @ts-ignore
+var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
- finalComponentProps.children = rendered;
- finalComponentProps.className = classes;
- return finalComponentProps;
-}
+module.exports = ReactPropTypesSecret;
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB")))
/***/ }),
-/***/ "Cw+6":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 2541:
+/***/ (function(module) {
"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__);
-
-
/**
- * External dependencies
+ * 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.
+ *
+ * @providesModule shallowCompare
*/
-/** @typedef {string | { display: string, ariaLabel: string }} Shortcut */
+
+
+var hasOwnProperty = Object.prototype.hasOwnProperty;
/**
- * @typedef Props
- * @property {Shortcut} shortcut Shortcut configuration
- * @property {string} [className] Classname
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
*/
+function is(x, y) {
+ // SameValue algorithm
+ if (x === y) {
+ // Steps 1-5, 7-10
+ // Steps 6.b-6.e: +0 != -0
+ // Added the nonzero y check to make Flow happy, but it is redundant
+ return x !== 0 || y !== 0 || 1 / x === 1 / y;
+ } else {
+ // Step 6.a: NaN == NaN
+ return x !== x && y !== y;
+ }
+}
/**
- * @param {Props} props Props
- * @return {JSX.Element | null} Element
+ * Performs equality by iterating through keys on an object and returning false
+ * when any key has values which are not strictly equal between the arguments.
+ * Returns true when the values of all keys are strictly equal.
*/
+function shallowEqual(objA, objB) {
+ if (is(objA, objB)) {
+ return true;
+ }
-function Shortcut(_ref) {
- let {
- shortcut,
- className
- } = _ref;
-
- if (!shortcut) {
- return null;
+ if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
+ return false;
}
- let displayText;
- let ariaLabel;
+ var keysA = Object.keys(objA);
+ var keysB = Object.keys(objB);
- if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isString"])(shortcut)) {
- displayText = shortcut;
+ if (keysA.length !== keysB.length) {
+ return false;
}
- if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isObject"])(shortcut)) {
- displayText = shortcut.display;
- ariaLabel = shortcut.ariaLabel;
+ // Test for A's keys different from B.
+ for (var i = 0; i < keysA.length; i++) {
+ if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
+ return false;
+ }
}
- return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", {
- className: className,
- "aria-label": ariaLabel
- }, displayText);
+ return true;
}
-/* harmony default export */ __webpack_exports__["a"] = (Shortcut);
-
-
-/***/ }),
-
-/***/ "Cx2f":
-/***/ (function(module, exports, __webpack_require__) {
+/**
+ * Does a shallow comparison for props and state.
+ * See ReactComponentWithPureRenderMixin
+ * See also https://facebook.github.io/react/docs/shallow-compare.html
+ */
+function shallowCompare(instance, nextProps, nextState) {
+ return (
+ !shallowEqual(instance.props, nextProps) ||
+ !shallowEqual(instance.state, nextState)
+ );
+}
-"use strict";
+module.exports = shallowCompare;
-var toPrimitive = __webpack_require__("WZeS");
+/***/ }),
-// https://ecma-international.org/ecma-262/6.0/#sec-toprimitive
+/***/ 4185:
+/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
-module.exports = function ToPrimitive(input) {
- if (arguments.length > 1) {
- return toPrimitive(input, arguments[1]);
- }
- return toPrimitive(input);
-};
+// eslint-disable-next-line import/no-unresolved
+__webpack_require__(17);
/***/ }),
-/***/ "D3zA":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 7617:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
-var implementation = __webpack_require__("aI7X");
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports.PureCalendarDay = undefined;
-module.exports = Function.prototype.bind || implementation;
+var _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; };
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-/***/ }),
+var _object = __webpack_require__(4011);
-/***/ "DHWS":
-/***/ (function(module, exports, __webpack_require__) {
+var _object2 = _interopRequireDefault(_object);
-"use strict";
+var _react = __webpack_require__(9196);
+var _react2 = _interopRequireDefault(_react);
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+var _propTypes = __webpack_require__(2652);
-var _react = __webpack_require__("cDcd");
+var _propTypes2 = _interopRequireDefault(_propTypes);
-var _react2 = _interopRequireDefault(_react);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+var _reactAddonsShallowCompare = __webpack_require__(2541);
-var ChevronDown = function () {
- function ChevronDown(props) {
- return _react2['default'].createElement(
- 'svg',
- props,
- _react2['default'].createElement('path', {
- d: 'M967.5 288.5L514.3 740.7c-11 11-21 11-32 0L29.1 288.5c-4-5-6-11-6-16 0-13 10-23 23-23 6 0 11 2 15 7l437.2 436.2 437.2-436.2c4-5 9-7 16-7 6 0 11 2 16 7 9 10.9 9 21 0 32z'
- })
- );
- }
+var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
- return ChevronDown;
-}();
+var _reactMomentProptypes = __webpack_require__(6150);
-ChevronDown.defaultProps = {
- viewBox: '0 0 1000 1000'
-};
-exports['default'] = ChevronDown;
+var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
-/***/ }),
+var _airbnbPropTypes = __webpack_require__(4882);
-/***/ "DZdY":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+var _reactWithStyles = __webpack_require__(3576);
-"use strict";
+var _moment = __webpack_require__(6292);
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
-var esm_extends = __webpack_require__("wx14");
+var _moment2 = _interopRequireDefault(_moment);
-// EXTERNAL MODULE: external "React"
-var external_React_ = __webpack_require__("cDcd");
+var _defaultPhrases = __webpack_require__(6030);
-// EXTERNAL MODULE: ./node_modules/@emotion/memoize/dist/emotion-memoize.browser.esm.js
-var emotion_memoize_browser_esm = __webpack_require__("SVgp");
+var _getPhrasePropTypes = __webpack_require__(2893);
-// CONCATENATED MODULE: ./node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.browser.esm.js
+var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
+var _getCalendarDaySettings = __webpack_require__(7475);
-var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
+var _getCalendarDaySettings2 = _interopRequireDefault(_getCalendarDaySettings);
-var isPropValid = /* #__PURE__ */Object(emotion_memoize_browser_esm["a" /* default */])(function (prop) {
- return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
- /* o */
- && prop.charCodeAt(1) === 110
- /* n */
- && prop.charCodeAt(2) < 91;
-}
-/* Z+1 */
-);
+var _ModifiersShape = __webpack_require__(6747);
-/* harmony default export */ var emotion_is_prop_valid_browser_esm = (isPropValid);
+var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
-// EXTERNAL MODULE: ./node_modules/@emotion/react/dist/emotion-element-699e6908.browser.esm.js
-var emotion_element_699e6908_browser_esm = __webpack_require__("ek6p");
+var _constants = __webpack_require__(257);
-// EXTERNAL MODULE: ./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js
-var emotion_utils_browser_esm = __webpack_require__("eVQB");
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-// EXTERNAL MODULE: ./node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js + 2 modules
-var emotion_serialize_browser_esm = __webpack_require__("Exhd");
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-// CONCATENATED MODULE: ./node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
+ day: _reactMomentProptypes2['default'].momentObj,
+ daySize: _airbnbPropTypes.nonNegativeInteger,
+ isOutsideDay: _propTypes2['default'].bool,
+ modifiers: _ModifiersShape2['default'],
+ isFocused: _propTypes2['default'].bool,
+ tabIndex: _propTypes2['default'].oneOf([0, -1]),
+ onDayClick: _propTypes2['default'].func,
+ onDayMouseEnter: _propTypes2['default'].func,
+ onDayMouseLeave: _propTypes2['default'].func,
+ renderDayContents: _propTypes2['default'].func,
+ ariaLabelFormat: _propTypes2['default'].string,
+ // internationalization
+ phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases))
+}));
+var defaultProps = {
+ day: (0, _moment2['default'])(),
+ daySize: _constants.DAY_SIZE,
+ isOutsideDay: false,
+ modifiers: new Set(),
+ isFocused: false,
+ tabIndex: -1,
+ onDayClick: function () {
+ function onDayClick() {}
+ return onDayClick;
+ }(),
+ onDayMouseEnter: function () {
+ function onDayMouseEnter() {}
+ return onDayMouseEnter;
+ }(),
+ onDayMouseLeave: function () {
+ function onDayMouseLeave() {}
-var testOmitPropsOnStringTag = emotion_is_prop_valid_browser_esm;
+ return onDayMouseLeave;
+ }(),
-var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
- return key !== 'theme';
-};
+ renderDayContents: null,
+ ariaLabelFormat: 'dddd, LL',
-var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
- return typeof tag === 'string' && // 96 is one less than the char code
- // for "a" so this is checking that
- // it's a lowercase character
- tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
+ // internationalization
+ phrases: _defaultPhrases.CalendarDayPhrases
};
-var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
- var shouldForwardProp;
-
- if (options) {
- var optionsShouldForwardProp = options.shouldForwardProp;
- shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
- return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
- } : optionsShouldForwardProp;
- }
-
- if (typeof shouldForwardProp !== 'function' && isReal) {
- shouldForwardProp = tag.__emotion_forwardProp;
- }
- return shouldForwardProp;
-};
+var CalendarDay = function (_React$Component) {
+ _inherits(CalendarDay, _React$Component);
-var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
+ function CalendarDay() {
+ var _ref;
-var Noop = function Noop() {
- return null;
-};
+ _classCallCheck(this, CalendarDay);
-var emotion_styled_base_browser_esm_createStyled = function createStyled(tag, options) {
- if (false) {}
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
- var isReal = tag.__emotion_real === tag;
- var baseTag = isReal && tag.__emotion_base || tag;
- var identifierName;
- var targetClassName;
+ var _this = _possibleConstructorReturn(this, (_ref = CalendarDay.__proto__ || Object.getPrototypeOf(CalendarDay)).call.apply(_ref, [this].concat(args)));
- if (options !== undefined) {
- identifierName = options.label;
- targetClassName = options.target;
+ _this.setButtonRef = _this.setButtonRef.bind(_this);
+ return _this;
}
- var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
- var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
- var shouldUseAs = !defaultShouldForwardProp('as');
- return function () {
- var args = arguments;
- var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
+ _createClass(CalendarDay, [{
+ key: 'shouldComponentUpdate',
+ value: function () {
+ function shouldComponentUpdate(nextProps, nextState) {
+ return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
+ }
- if (identifierName !== undefined) {
- styles.push("label:" + identifierName + ";");
- }
+ return shouldComponentUpdate;
+ }()
+ }, {
+ key: 'componentDidUpdate',
+ value: function () {
+ function componentDidUpdate(prevProps) {
+ var _props = this.props,
+ isFocused = _props.isFocused,
+ tabIndex = _props.tabIndex;
- if (args[0] == null || args[0].raw === undefined) {
- styles.push.apply(styles, args);
- } else {
- if (false) {}
+ if (tabIndex === 0) {
+ if (isFocused || tabIndex !== prevProps.tabIndex) {
+ this.buttonRef.focus();
+ }
+ }
+ }
- styles.push(args[0][0]);
- var len = args.length;
- var i = 1;
+ return componentDidUpdate;
+ }()
+ }, {
+ key: 'onDayClick',
+ value: function () {
+ function onDayClick(day, e) {
+ var onDayClick = this.props.onDayClick;
- for (; i < len; i++) {
- if (false) {}
+ onDayClick(day, e);
+ }
- styles.push(args[i], args[0][i]);
+ return onDayClick;
+ }()
+ }, {
+ key: 'onDayMouseEnter',
+ value: function () {
+ function onDayMouseEnter(day, e) {
+ var onDayMouseEnter = this.props.onDayMouseEnter;
+
+ onDayMouseEnter(day, e);
}
- } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
+ return onDayMouseEnter;
+ }()
+ }, {
+ key: 'onDayMouseLeave',
+ value: function () {
+ function onDayMouseLeave(day, e) {
+ var onDayMouseLeave = this.props.onDayMouseLeave;
- var Styled = Object(emotion_element_699e6908_browser_esm["g" /* w */])(function (props, cache, ref) {
- var finalTag = shouldUseAs && props.as || baseTag;
- var className = '';
- var classInterpolations = [];
- var mergedProps = props;
+ onDayMouseLeave(day, e);
+ }
- if (props.theme == null) {
- mergedProps = {};
+ return onDayMouseLeave;
+ }()
+ }, {
+ key: 'onKeyDown',
+ value: function () {
+ function onKeyDown(day, e) {
+ var onDayClick = this.props.onDayClick;
+ var key = e.key;
- for (var key in props) {
- mergedProps[key] = props[key];
+ if (key === 'Enter' || key === ' ') {
+ onDayClick(day, e);
}
-
- mergedProps.theme = Object(external_React_["useContext"])(emotion_element_699e6908_browser_esm["c" /* T */]);
}
- if (typeof props.className === 'string') {
- className = Object(emotion_utils_browser_esm["a" /* getRegisteredStyles */])(cache.registered, classInterpolations, props.className);
- } else if (props.className != null) {
- className = props.className + " ";
+ return onKeyDown;
+ }()
+ }, {
+ key: 'setButtonRef',
+ value: function () {
+ function setButtonRef(ref) {
+ this.buttonRef = ref;
}
- var serialized = Object(emotion_serialize_browser_esm["a" /* serializeStyles */])(styles.concat(classInterpolations), cache.registered, mergedProps);
- var rules = Object(emotion_utils_browser_esm["b" /* insertStyles */])(cache, serialized, typeof finalTag === 'string');
- className += cache.key + "-" + serialized.name;
+ return setButtonRef;
+ }()
+ }, {
+ key: 'render',
+ value: function () {
+ function render() {
+ var _this2 = this;
- if (targetClassName !== undefined) {
- className += " " + targetClassName;
- }
+ var _props2 = this.props,
+ day = _props2.day,
+ ariaLabelFormat = _props2.ariaLabelFormat,
+ daySize = _props2.daySize,
+ isOutsideDay = _props2.isOutsideDay,
+ modifiers = _props2.modifiers,
+ renderDayContents = _props2.renderDayContents,
+ tabIndex = _props2.tabIndex,
+ styles = _props2.styles,
+ phrases = _props2.phrases;
- var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(finalTag) : defaultShouldForwardProp;
- var newProps = {};
- for (var _key in props) {
- if (shouldUseAs && _key === 'as') continue;
+ if (!day) return _react2['default'].createElement('td', null);
- if ( // $FlowFixMe
- finalShouldForwardProp(_key)) {
- newProps[_key] = props[_key];
- }
- }
+ var _getCalendarDaySettin = (0, _getCalendarDaySettings2['default'])(day, ariaLabelFormat, daySize, modifiers, phrases),
+ daySizeStyles = _getCalendarDaySettin.daySizeStyles,
+ useDefaultCursor = _getCalendarDaySettin.useDefaultCursor,
+ selected = _getCalendarDaySettin.selected,
+ hoveredSpan = _getCalendarDaySettin.hoveredSpan,
+ isOutsideRange = _getCalendarDaySettin.isOutsideRange,
+ ariaLabel = _getCalendarDaySettin.ariaLabel;
- newProps.className = className;
- newProps.ref = ref;
- var ele = /*#__PURE__*/Object(external_React_["createElement"])(finalTag, newProps);
- var possiblyStyleElement = /*#__PURE__*/Object(external_React_["createElement"])(Noop, null);
+ return _react2['default'].createElement(
+ 'td',
+ _extends({}, (0, _reactWithStyles.css)(styles.CalendarDay, useDefaultCursor && styles.CalendarDay__defaultCursor, styles.CalendarDay__default, isOutsideDay && styles.CalendarDay__outside, modifiers.has('today') && styles.CalendarDay__today, modifiers.has('first-day-of-week') && styles.CalendarDay__firstDayOfWeek, modifiers.has('last-day-of-week') && styles.CalendarDay__lastDayOfWeek, modifiers.has('hovered-offset') && styles.CalendarDay__hovered_offset, modifiers.has('highlighted-calendar') && styles.CalendarDay__highlighted_calendar, modifiers.has('blocked-minimum-nights') && styles.CalendarDay__blocked_minimum_nights, modifiers.has('blocked-calendar') && styles.CalendarDay__blocked_calendar, hoveredSpan && styles.CalendarDay__hovered_span, modifiers.has('selected-span') && styles.CalendarDay__selected_span, modifiers.has('last-in-range') && styles.CalendarDay__last_in_range, modifiers.has('selected-start') && styles.CalendarDay__selected_start, modifiers.has('selected-end') && styles.CalendarDay__selected_end, selected && styles.CalendarDay__selected, isOutsideRange && styles.CalendarDay__blocked_out_of_range, daySizeStyles), {
+ role: 'button' // eslint-disable-line jsx-a11y/no-noninteractive-element-to-interactive-role
+ , ref: this.setButtonRef,
+ 'aria-label': ariaLabel,
+ onMouseEnter: function () {
+ function onMouseEnter(e) {
+ _this2.onDayMouseEnter(day, e);
+ }
+ return onMouseEnter;
+ }(),
+ onMouseLeave: function () {
+ function onMouseLeave(e) {
+ _this2.onDayMouseLeave(day, e);
+ }
- return /*#__PURE__*/Object(external_React_["createElement"])(external_React_["Fragment"], null, possiblyStyleElement, ele);
- });
- Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
- Styled.defaultProps = tag.defaultProps;
- Styled.__emotion_real = Styled;
- Styled.__emotion_base = baseTag;
- Styled.__emotion_styles = styles;
- Styled.__emotion_forwardProp = shouldForwardProp;
- Object.defineProperty(Styled, 'toString', {
- value: function value() {
- if (targetClassName === undefined && "production" !== 'production') {
- return 'NO_COMPONENT_SELECTOR';
- } // $FlowFixMe: coerce undefined to string
+ return onMouseLeave;
+ }(),
+ onMouseUp: function () {
+ function onMouseUp(e) {
+ e.currentTarget.blur();
+ }
+ return onMouseUp;
+ }(),
+ onClick: function () {
+ function onClick(e) {
+ _this2.onDayClick(day, e);
+ }
- return "." + targetClassName;
+ return onClick;
+ }(),
+ onKeyDown: function () {
+ function onKeyDown(e) {
+ _this2.onKeyDown(day, e);
+ }
+
+ return onKeyDown;
+ }(),
+ tabIndex: tabIndex
+ }),
+ renderDayContents ? renderDayContents(day, modifiers) : day.format('D')
+ );
}
- });
- Styled.withComponent = function (nextTag, nextOptions) {
- return createStyled(nextTag, Object(esm_extends["a" /* default */])({}, options, nextOptions, {
- shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
- })).apply(void 0, styles);
- };
+ return render;
+ }()
+ }]);
- return Styled;
- };
-};
+ return CalendarDay;
+}(_react2['default'].Component);
-/* harmony default export */ var emotion_styled_base_browser_esm = __webpack_exports__["a"] = (emotion_styled_base_browser_esm_createStyled);
+CalendarDay.propTypes = propTypes;
+CalendarDay.defaultProps = defaultProps;
+exports.PureCalendarDay = CalendarDay;
+exports["default"] = (0, _reactWithStyles.withStyles)(function (_ref2) {
+ var _ref2$reactDates = _ref2.reactDates,
+ color = _ref2$reactDates.color,
+ font = _ref2$reactDates.font;
+ return {
+ CalendarDay: {
+ boxSizing: 'border-box',
+ cursor: 'pointer',
+ fontSize: font.size,
+ textAlign: 'center',
-/***/ }),
+ ':active': {
+ outline: 0
+ }
+ },
-/***/ "DciD":
-/***/ (function(module, exports, __webpack_require__) {
+ CalendarDay__defaultCursor: {
+ cursor: 'default'
+ },
-"use strict";
+ CalendarDay__default: {
+ border: '1px solid ' + String(color.core.borderLight),
+ color: color.text,
+ background: color.background,
+ ':hover': {
+ background: color.core.borderLight,
+ border: '1px double ' + String(color.core.borderLight),
+ color: 'inherit'
+ }
+ },
-function noop() {
- return null;
-}
+ CalendarDay__hovered_offset: {
+ background: color.core.borderBright,
+ border: '1px double ' + String(color.core.borderLight),
+ color: 'inherit'
+ },
-noop.isRequired = noop;
+ CalendarDay__outside: {
+ border: 0,
+ background: color.outside.backgroundColor,
+ color: color.outside.color,
-function noopThunk() {
- return noop;
-}
+ ':hover': {
+ border: 0
+ }
+ },
-module.exports = {
- and: noopThunk,
- between: noopThunk,
- booleanSome: noopThunk,
- childrenHavePropXorChildren: noopThunk,
- childrenOf: noopThunk,
- childrenOfType: noopThunk,
- childrenSequenceOf: noopThunk,
- componentWithName: noopThunk,
- disallowedIf: noopThunk,
- elementType: noopThunk,
- empty: noopThunk,
- explicitNull: noopThunk,
- forbidExtraProps: Object,
- integer: noopThunk,
- keysOf: noopThunk,
- mutuallyExclusiveProps: noopThunk,
- mutuallyExclusiveTrueProps: noopThunk,
- nChildren: noopThunk,
- nonNegativeInteger: noop,
- nonNegativeNumber: noopThunk,
- numericString: noopThunk,
- object: noopThunk,
- or: noopThunk,
- predicate: noopThunk,
- range: noopThunk,
- ref: noopThunk,
- requiredBy: noopThunk,
- restrictedProp: noopThunk,
- sequenceOf: noopThunk,
- shape: noopThunk,
- stringEndsWith: noopThunk,
- stringStartsWith: noopThunk,
- uniqueArray: noopThunk,
- uniqueArrayOf: noopThunk,
- valuesOf: noopThunk,
- withShape: noopThunk
-};
+ CalendarDay__blocked_minimum_nights: {
+ background: color.minimumNights.backgroundColor,
+ border: '1px solid ' + String(color.minimumNights.borderColor),
+ color: color.minimumNights.color,
+ ':hover': {
+ background: color.minimumNights.backgroundColor_hover,
+ color: color.minimumNights.color_active
+ },
-/***/ }),
+ ':active': {
+ background: color.minimumNights.backgroundColor_active,
+ color: color.minimumNights.color_active
+ }
+ },
-/***/ "DmXP":
-/***/ (function(module, exports, __webpack_require__) {
+ CalendarDay__highlighted_calendar: {
+ background: color.highlighted.backgroundColor,
+ color: color.highlighted.color,
-"use strict";
+ ':hover': {
+ background: color.highlighted.backgroundColor_hover,
+ color: color.highlighted.color_active
+ },
+ ':active': {
+ background: color.highlighted.backgroundColor_active,
+ color: color.highlighted.color_active
+ }
+ },
-var getDay = Date.prototype.getDay;
-var tryDateObject = function tryDateGetDayCall(value) {
- try {
- getDay.call(value);
- return true;
- } catch (e) {
- return false;
- }
-};
+ CalendarDay__selected_span: {
+ background: color.selectedSpan.backgroundColor,
+ border: '1px solid ' + String(color.selectedSpan.borderColor),
+ color: color.selectedSpan.color,
-var toStr = Object.prototype.toString;
-var dateClass = '[object Date]';
-var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
+ ':hover': {
+ background: color.selectedSpan.backgroundColor_hover,
+ border: '1px solid ' + String(color.selectedSpan.borderColor),
+ color: color.selectedSpan.color_active
+ },
-module.exports = function isDateObject(value) {
- if (typeof value !== 'object' || value === null) {
- return false;
- }
- return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;
-};
+ ':active': {
+ background: color.selectedSpan.backgroundColor_active,
+ border: '1px solid ' + String(color.selectedSpan.borderColor),
+ color: color.selectedSpan.color_active
+ }
+ },
+ CalendarDay__last_in_range: {
+ borderRight: color.core.primary
+ },
-/***/ }),
+ CalendarDay__selected: {
+ background: color.selected.backgroundColor,
+ border: '1px solid ' + String(color.selected.borderColor),
+ color: color.selected.color,
-/***/ "DzJC":
-/***/ (function(module, exports, __webpack_require__) {
+ ':hover': {
+ background: color.selected.backgroundColor_hover,
+ border: '1px solid ' + String(color.selected.borderColor),
+ color: color.selected.color_active
+ },
-var debounce = __webpack_require__("sEfC"),
- isObject = __webpack_require__("GoyQ");
+ ':active': {
+ background: color.selected.backgroundColor_active,
+ border: '1px solid ' + String(color.selected.borderColor),
+ color: color.selected.color_active
+ }
+ },
-/** Error message constants. */
-var FUNC_ERROR_TEXT = 'Expected a function';
+ CalendarDay__hovered_span: {
+ background: color.hoveredSpan.backgroundColor,
+ border: '1px solid ' + String(color.hoveredSpan.borderColor),
+ color: color.hoveredSpan.color,
-/**
- * Creates a throttled function that only invokes `func` at most once per
- * every `wait` milliseconds. The throttled function comes with a `cancel`
- * method to cancel delayed `func` invocations and a `flush` method to
- * immediately invoke them. Provide `options` to indicate whether `func`
- * should be invoked on the leading and/or trailing edge of the `wait`
- * timeout. The `func` is invoked with the last arguments provided to the
- * throttled function. Subsequent calls to the throttled function return the
- * result of the last `func` invocation.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
- * invoked on the trailing edge of the timeout only if the throttled function
- * is invoked more than once during the `wait` timeout.
- *
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
- *
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
- * for details over the differences between `_.throttle` and `_.debounce`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to throttle.
- * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
- * @param {Object} [options={}] The options object.
- * @param {boolean} [options.leading=true]
- * Specify invoking on the leading edge of the timeout.
- * @param {boolean} [options.trailing=true]
- * Specify invoking on the trailing edge of the timeout.
- * @returns {Function} Returns the new throttled function.
- * @example
- *
- * // Avoid excessively updating the position while scrolling.
- * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
- *
- * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
- * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
- * jQuery(element).on('click', throttled);
- *
- * // Cancel the trailing throttled invocation.
- * jQuery(window).on('popstate', throttled.cancel);
- */
-function throttle(func, wait, options) {
- var leading = true,
- trailing = true;
+ ':hover': {
+ background: color.hoveredSpan.backgroundColor_hover,
+ border: '1px solid ' + String(color.hoveredSpan.borderColor),
+ color: color.hoveredSpan.color_active
+ },
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- if (isObject(options)) {
- leading = 'leading' in options ? !!options.leading : leading;
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
- return debounce(func, wait, {
- 'leading': leading,
- 'maxWait': wait,
- 'trailing': trailing
- });
-}
+ ':active': {
+ background: color.hoveredSpan.backgroundColor_active,
+ border: '1px solid ' + String(color.hoveredSpan.borderColor),
+ color: color.hoveredSpan.color_active
+ }
+ },
-module.exports = throttle;
+ CalendarDay__blocked_calendar: {
+ background: color.blocked_calendar.backgroundColor,
+ border: '1px solid ' + String(color.blocked_calendar.borderColor),
+ color: color.blocked_calendar.color,
+ ':hover': {
+ background: color.blocked_calendar.backgroundColor_hover,
+ border: '1px solid ' + String(color.blocked_calendar.borderColor),
+ color: color.blocked_calendar.color_active
+ },
-/***/ }),
+ ':active': {
+ background: color.blocked_calendar.backgroundColor_active,
+ border: '1px solid ' + String(color.blocked_calendar.borderColor),
+ color: color.blocked_calendar.color_active
+ }
+ },
-/***/ "ExA7":
-/***/ (function(module, exports) {
+ CalendarDay__blocked_out_of_range: {
+ background: color.blocked_out_of_range.backgroundColor,
+ border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
+ color: color.blocked_out_of_range.color,
-/**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
-function isObjectLike(value) {
- return value != null && typeof value == 'object';
-}
+ ':hover': {
+ background: color.blocked_out_of_range.backgroundColor_hover,
+ border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
+ color: color.blocked_out_of_range.color_active
+ },
-module.exports = isObjectLike;
+ ':active': {
+ background: color.blocked_out_of_range.backgroundColor_active,
+ border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
+ color: color.blocked_out_of_range.color_active
+ }
+ },
+ CalendarDay__selected_start: {},
+ CalendarDay__selected_end: {},
+ CalendarDay__today: {},
+ CalendarDay__firstDayOfWeek: {},
+ CalendarDay__lastDayOfWeek: {}
+ };
+})(CalendarDay);
/***/ }),
-/***/ "Exhd":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 5986:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
-// EXPORTS
-__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ emotion_serialize_browser_esm_serializeStyles; });
-
-// CONCATENATED MODULE: ./node_modules/@emotion/hash/dist/hash.browser.esm.js
-/* eslint-disable */
-// Inspired by https://github.com/garycourt/murmurhash-js
-// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
-function murmur2(str) {
- // 'm' and 'r' are mixing constants generated offline.
- // They're not really 'magic', they just happen to work well.
- // const m = 0x5bd1e995;
- // const r = 24;
- // Initialize the hash
- var h = 0; // Mix 4 bytes at a time into the hash
- var k,
- i = 0,
- len = str.length;
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
- for (; len >= 4; ++i, len -= 4) {
- k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
- k =
- /* Math.imul(k, m): */
- (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
- k ^=
- /* k >>> r: */
- k >>> 24;
- h =
- /* Math.imul(k, m): */
- (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
- /* Math.imul(h, m): */
- (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
- } // Handle the last few bytes of the input array
+var _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; };
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
- switch (len) {
- case 3:
- h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
+var _object = __webpack_require__(4011);
- case 2:
- h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
+var _object2 = _interopRequireDefault(_object);
- case 1:
- h ^= str.charCodeAt(i) & 0xff;
- h =
- /* Math.imul(h, m): */
- (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
- } // Do a few final mixes of the hash to ensure the last few
- // bytes are well-incorporated.
+var _react = __webpack_require__(9196);
+var _react2 = _interopRequireDefault(_react);
- h ^= h >>> 13;
- h =
- /* Math.imul(h, m): */
- (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
- return ((h ^ h >>> 15) >>> 0).toString(36);
-}
+var _propTypes = __webpack_require__(2652);
-/* harmony default export */ var hash_browser_esm = (murmur2);
+var _propTypes2 = _interopRequireDefault(_propTypes);
-// CONCATENATED MODULE: ./node_modules/@emotion/unitless/dist/unitless.browser.esm.js
-var unitlessKeys = {
- animationIterationCount: 1,
- borderImageOutset: 1,
- borderImageSlice: 1,
- borderImageWidth: 1,
- boxFlex: 1,
- boxFlexGroup: 1,
- boxOrdinalGroup: 1,
- columnCount: 1,
- columns: 1,
- flex: 1,
- flexGrow: 1,
- flexPositive: 1,
- flexShrink: 1,
- flexNegative: 1,
- flexOrder: 1,
- gridRow: 1,
- gridRowEnd: 1,
- gridRowSpan: 1,
- gridRowStart: 1,
- gridColumn: 1,
- gridColumnEnd: 1,
- gridColumnSpan: 1,
- gridColumnStart: 1,
- msGridRow: 1,
- msGridRowSpan: 1,
- msGridColumn: 1,
- msGridColumnSpan: 1,
- fontWeight: 1,
- lineHeight: 1,
- opacity: 1,
- order: 1,
- orphans: 1,
- tabSize: 1,
- widows: 1,
- zIndex: 1,
- zoom: 1,
- WebkitLineClamp: 1,
- // SVG-related properties
- fillOpacity: 1,
- floodOpacity: 1,
- stopOpacity: 1,
- strokeDasharray: 1,
- strokeDashoffset: 1,
- strokeMiterlimit: 1,
- strokeOpacity: 1,
- strokeWidth: 1
-};
+var _reactAddonsShallowCompare = __webpack_require__(2541);
-/* harmony default export */ var unitless_browser_esm = (unitlessKeys);
+var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
-// EXTERNAL MODULE: ./node_modules/@emotion/memoize/dist/emotion-memoize.browser.esm.js
-var emotion_memoize_browser_esm = __webpack_require__("SVgp");
+var _reactMomentProptypes = __webpack_require__(6150);
-// CONCATENATED MODULE: ./node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js
+var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
+var _airbnbPropTypes = __webpack_require__(4882);
+var _reactWithStyles = __webpack_require__(3576);
+var _moment = __webpack_require__(6292);
-var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
-var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
-var hyphenateRegex = /[A-Z]|^ms/g;
-var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
+var _moment2 = _interopRequireDefault(_moment);
-var isCustomProperty = function isCustomProperty(property) {
- return property.charCodeAt(1) === 45;
-};
+var _defaultPhrases = __webpack_require__(6030);
-var isProcessableValue = function isProcessableValue(value) {
- return value != null && typeof value !== 'boolean';
-};
+var _getPhrasePropTypes = __webpack_require__(2893);
-var processStyleName = /* #__PURE__ */Object(emotion_memoize_browser_esm["a" /* default */])(function (styleName) {
- return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
-});
+var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
-var emotion_serialize_browser_esm_processStyleValue = function processStyleValue(key, value) {
- switch (key) {
- case 'animation':
- case 'animationName':
- {
- if (typeof value === 'string') {
- return value.replace(animationRegex, function (match, p1, p2) {
- cursor = {
- name: p1,
- styles: p2,
- next: cursor
- };
- return p1;
- });
- }
- }
- }
+var _CalendarWeek = __webpack_require__(4604);
- if (unitless_browser_esm[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
- return value + 'px';
- }
+var _CalendarWeek2 = _interopRequireDefault(_CalendarWeek);
- return value;
-};
+var _CalendarDay = __webpack_require__(7617);
-if (false) { var hyphenatedCache, hyphenPattern, msPattern, oldProcessStyleValue, contentValues, contentValuePattern; }
+var _CalendarDay2 = _interopRequireDefault(_CalendarDay);
-function handleInterpolation(mergedProps, registered, interpolation) {
- if (interpolation == null) {
- return '';
- }
+var _calculateDimension = __webpack_require__(8607);
- if (interpolation.__emotion_styles !== undefined) {
- if (false) {}
+var _calculateDimension2 = _interopRequireDefault(_calculateDimension);
- return interpolation;
- }
+var _getCalendarMonthWeeks = __webpack_require__(5644);
- switch (typeof interpolation) {
- case 'boolean':
- {
- return '';
- }
+var _getCalendarMonthWeeks2 = _interopRequireDefault(_getCalendarMonthWeeks);
- case 'object':
- {
- if (interpolation.anim === 1) {
- cursor = {
- name: interpolation.name,
- styles: interpolation.styles,
- next: cursor
- };
- return interpolation.name;
- }
+var _isSameDay = __webpack_require__(3923);
- if (interpolation.styles !== undefined) {
- var next = interpolation.next;
+var _isSameDay2 = _interopRequireDefault(_isSameDay);
- if (next !== undefined) {
- // not the most efficient thing ever but this is a pretty rare case
- // and there will be very few iterations of this generally
- while (next !== undefined) {
- cursor = {
- name: next.name,
- styles: next.styles,
- next: cursor
- };
- next = next.next;
- }
- }
+var _toISODateString = __webpack_require__(7310);
- var styles = interpolation.styles + ";";
+var _toISODateString2 = _interopRequireDefault(_toISODateString);
- if (false) {}
+var _ModifiersShape = __webpack_require__(6747);
- return styles;
- }
+var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
- return createStringFromObject(mergedProps, registered, interpolation);
- }
+var _ScrollableOrientationShape = __webpack_require__(6553);
- case 'function':
- {
- if (mergedProps !== undefined) {
- var previousCursor = cursor;
- var result = interpolation(mergedProps);
- cursor = previousCursor;
- return handleInterpolation(mergedProps, registered, result);
- } else if (false) {}
+var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
- break;
- }
+var _DayOfWeekShape = __webpack_require__(243);
- case 'string':
- if (false) { var replaced, matched; }
+var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
- break;
- } // finalize string values (regular strings and functions interpolated into css calls)
+var _constants = __webpack_require__(257);
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- if (registered == null) {
- return interpolation;
- }
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- var cached = registered[interpolation];
- return cached !== undefined ? cached : interpolation;
-}
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-function createStringFromObject(mergedProps, registered, obj) {
- var string = '';
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint react/no-array-index-key: 0 */
- if (Array.isArray(obj)) {
- for (var i = 0; i < obj.length; i++) {
- string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
- }
- } else {
- for (var _key in obj) {
- var value = obj[_key];
+var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
+ month: _reactMomentProptypes2['default'].momentObj,
+ horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
+ isVisible: _propTypes2['default'].bool,
+ enableOutsideDays: _propTypes2['default'].bool,
+ modifiers: _propTypes2['default'].objectOf(_ModifiersShape2['default']),
+ orientation: _ScrollableOrientationShape2['default'],
+ daySize: _airbnbPropTypes.nonNegativeInteger,
+ onDayClick: _propTypes2['default'].func,
+ onDayMouseEnter: _propTypes2['default'].func,
+ onDayMouseLeave: _propTypes2['default'].func,
+ onMonthSelect: _propTypes2['default'].func,
+ onYearSelect: _propTypes2['default'].func,
+ renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
+ renderCalendarDay: _propTypes2['default'].func,
+ renderDayContents: _propTypes2['default'].func,
+ renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
+ firstDayOfWeek: _DayOfWeekShape2['default'],
+ setMonthTitleHeight: _propTypes2['default'].func,
+ verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
- if (typeof value !== 'object') {
- if (registered != null && registered[value] !== undefined) {
- string += _key + "{" + registered[value] + "}";
- } else if (isProcessableValue(value)) {
- string += processStyleName(_key) + ":" + emotion_serialize_browser_esm_processStyleValue(_key, value) + ";";
- }
- } else {
- if (_key === 'NO_COMPONENT_SELECTOR' && "production" !== 'production') {
- throw new Error('Component selectors can only be used in conjunction with @emotion/babel-plugin.');
- }
+ focusedDate: _reactMomentProptypes2['default'].momentObj, // indicates focusable day
+ isFocused: _propTypes2['default'].bool, // indicates whether or not to move focus to focusable day
- if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
- for (var _i = 0; _i < value.length; _i++) {
- if (isProcessableValue(value[_i])) {
- string += processStyleName(_key) + ":" + emotion_serialize_browser_esm_processStyleValue(_key, value[_i]) + ";";
- }
- }
- } else {
- var interpolated = handleInterpolation(mergedProps, registered, value);
+ // i18n
+ monthFormat: _propTypes2['default'].string,
+ phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases)),
+ dayAriaLabelFormat: _propTypes2['default'].string
+}));
- switch (_key) {
- case 'animation':
- case 'animationName':
- {
- string += processStyleName(_key) + ":" + interpolated + ";";
- break;
- }
+var defaultProps = {
+ month: (0, _moment2['default'])(),
+ horizontalMonthPadding: 13,
+ isVisible: true,
+ enableOutsideDays: false,
+ modifiers: {},
+ orientation: _constants.HORIZONTAL_ORIENTATION,
+ daySize: _constants.DAY_SIZE,
+ onDayClick: function () {
+ function onDayClick() {}
- default:
- {
- if (false) {}
+ return onDayClick;
+ }(),
+ onDayMouseEnter: function () {
+ function onDayMouseEnter() {}
- string += _key + "{" + interpolated + "}";
- }
- }
- }
- }
- }
- }
+ return onDayMouseEnter;
+ }(),
+ onDayMouseLeave: function () {
+ function onDayMouseLeave() {}
- return string;
-}
+ return onDayMouseLeave;
+ }(),
+ onMonthSelect: function () {
+ function onMonthSelect() {}
-var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
-var sourceMapPattern;
+ return onMonthSelect;
+ }(),
+ onYearSelect: function () {
+ function onYearSelect() {}
-if (false) {} // this is the cursor for keyframes
-// keyframes are stored on the SerializedStyles object as a linked list
+ return onYearSelect;
+ }(),
+ renderMonthText: null,
+ renderCalendarDay: function () {
+ function renderCalendarDay(props) {
+ return _react2['default'].createElement(_CalendarDay2['default'], props);
+ }
-var cursor;
-var emotion_serialize_browser_esm_serializeStyles = function serializeStyles(args, registered, mergedProps) {
- if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
- return args[0];
- }
+ return renderCalendarDay;
+ }(),
+ renderDayContents: null,
+ renderMonthElement: null,
+ firstDayOfWeek: null,
+ setMonthTitleHeight: null,
- var stringMode = true;
- var styles = '';
- cursor = undefined;
- var strings = args[0];
+ focusedDate: null,
+ isFocused: false,
- if (strings == null || strings.raw === undefined) {
- stringMode = false;
- styles += handleInterpolation(mergedProps, registered, strings);
- } else {
- if (false) {}
+ // i18n
+ monthFormat: 'MMMM YYYY', // english locale
+ phrases: _defaultPhrases.CalendarDayPhrases,
+ dayAriaLabelFormat: undefined,
+ verticalBorderSpacing: undefined
+};
- styles += strings[0];
- } // we start at 1 since we've already handled the first arg
+var CalendarMonth = function (_React$Component) {
+ _inherits(CalendarMonth, _React$Component);
+ function CalendarMonth(props) {
+ _classCallCheck(this, CalendarMonth);
- for (var i = 1; i < args.length; i++) {
- styles += handleInterpolation(mergedProps, registered, args[i]);
+ var _this = _possibleConstructorReturn(this, (CalendarMonth.__proto__ || Object.getPrototypeOf(CalendarMonth)).call(this, props));
- if (stringMode) {
- if (false) {}
+ _this.state = {
+ weeks: (0, _getCalendarMonthWeeks2['default'])(props.month, props.enableOutsideDays, props.firstDayOfWeek == null ? _moment2['default'].localeData().firstDayOfWeek() : props.firstDayOfWeek)
+ };
- styles += strings[i];
- }
+ _this.setCaptionRef = _this.setCaptionRef.bind(_this);
+ _this.setMonthTitleHeight = _this.setMonthTitleHeight.bind(_this);
+ return _this;
}
- var sourceMap;
-
- if (false) {} // using a global regex with .exec is stateful so lastIndex has to be reset each time
-
+ _createClass(CalendarMonth, [{
+ key: 'componentDidMount',
+ value: function () {
+ function componentDidMount() {
+ this.setMonthTitleHeightTimeout = setTimeout(this.setMonthTitleHeight, 0);
+ }
- labelPattern.lastIndex = 0;
- var identifierName = '';
- var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
+ return componentDidMount;
+ }()
+ }, {
+ key: 'componentWillReceiveProps',
+ value: function () {
+ function componentWillReceiveProps(nextProps) {
+ var month = nextProps.month,
+ enableOutsideDays = nextProps.enableOutsideDays,
+ firstDayOfWeek = nextProps.firstDayOfWeek;
+ var _props = this.props,
+ prevMonth = _props.month,
+ prevEnableOutsideDays = _props.enableOutsideDays,
+ prevFirstDayOfWeek = _props.firstDayOfWeek;
- while ((match = labelPattern.exec(styles)) !== null) {
- identifierName += '-' + // $FlowFixMe we know it's not null
- match[1];
- }
+ if (!month.isSame(prevMonth) || enableOutsideDays !== prevEnableOutsideDays || firstDayOfWeek !== prevFirstDayOfWeek) {
+ this.setState({
+ weeks: (0, _getCalendarMonthWeeks2['default'])(month, enableOutsideDays, firstDayOfWeek == null ? _moment2['default'].localeData().firstDayOfWeek() : firstDayOfWeek)
+ });
+ }
+ }
- var name = hash_browser_esm(styles) + identifierName;
+ return componentWillReceiveProps;
+ }()
+ }, {
+ key: 'shouldComponentUpdate',
+ value: function () {
+ function shouldComponentUpdate(nextProps, nextState) {
+ return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
+ }
- if (false) {}
+ return shouldComponentUpdate;
+ }()
+ }, {
+ key: 'componentWillUnmount',
+ value: function () {
+ function componentWillUnmount() {
+ if (this.setMonthTitleHeightTimeout) {
+ clearTimeout(this.setMonthTitleHeightTimeout);
+ }
+ }
- return {
- name: name,
- styles: styles,
- next: cursor
- };
-};
+ return componentWillUnmount;
+ }()
+ }, {
+ key: 'setMonthTitleHeight',
+ value: function () {
+ function setMonthTitleHeight() {
+ var setMonthTitleHeight = this.props.setMonthTitleHeight;
+ if (setMonthTitleHeight) {
+ var captionHeight = (0, _calculateDimension2['default'])(this.captionRef, 'height', true, true);
+ setMonthTitleHeight(captionHeight);
+ }
+ }
+ return setMonthTitleHeight;
+ }()
+ }, {
+ key: 'setCaptionRef',
+ value: function () {
+ function setCaptionRef(ref) {
+ this.captionRef = ref;
+ }
+ return setCaptionRef;
+ }()
+ }, {
+ key: 'render',
+ value: function () {
+ function render() {
+ var _props2 = this.props,
+ dayAriaLabelFormat = _props2.dayAriaLabelFormat,
+ daySize = _props2.daySize,
+ focusedDate = _props2.focusedDate,
+ horizontalMonthPadding = _props2.horizontalMonthPadding,
+ isFocused = _props2.isFocused,
+ isVisible = _props2.isVisible,
+ modifiers = _props2.modifiers,
+ month = _props2.month,
+ monthFormat = _props2.monthFormat,
+ onDayClick = _props2.onDayClick,
+ onDayMouseEnter = _props2.onDayMouseEnter,
+ onDayMouseLeave = _props2.onDayMouseLeave,
+ onMonthSelect = _props2.onMonthSelect,
+ onYearSelect = _props2.onYearSelect,
+ orientation = _props2.orientation,
+ phrases = _props2.phrases,
+ renderCalendarDay = _props2.renderCalendarDay,
+ renderDayContents = _props2.renderDayContents,
+ renderMonthElement = _props2.renderMonthElement,
+ renderMonthText = _props2.renderMonthText,
+ styles = _props2.styles,
+ verticalBorderSpacing = _props2.verticalBorderSpacing;
+ var weeks = this.state.weeks;
-/***/ }),
+ var monthTitle = renderMonthText ? renderMonthText(month) : month.format(monthFormat);
-/***/ "F7ZS":
-/***/ (function(module, exports, __webpack_require__) {
+ var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
-"use strict";
+ return _react2['default'].createElement(
+ 'div',
+ _extends({}, (0, _reactWithStyles.css)(styles.CalendarMonth, { padding: '0 ' + String(horizontalMonthPadding) + 'px' }), {
+ 'data-visible': isVisible
+ }),
+ _react2['default'].createElement(
+ 'div',
+ _extends({
+ ref: this.setCaptionRef
+ }, (0, _reactWithStyles.css)(styles.CalendarMonth_caption, verticalScrollable && styles.CalendarMonth_caption__verticalScrollable)),
+ renderMonthElement ? renderMonthElement({ month: month, onMonthSelect: onMonthSelect, onYearSelect: onYearSelect }) : _react2['default'].createElement(
+ 'strong',
+ null,
+ monthTitle
+ )
+ ),
+ _react2['default'].createElement(
+ 'table',
+ _extends({}, (0, _reactWithStyles.css)(!verticalBorderSpacing && styles.CalendarMonth_table, verticalBorderSpacing && styles.CalendarMonth_verticalSpacing, verticalBorderSpacing && { borderSpacing: '0px ' + String(verticalBorderSpacing) + 'px' }), {
+ role: 'presentation'
+ }),
+ _react2['default'].createElement(
+ 'tbody',
+ null,
+ weeks.map(function (week, i) {
+ return _react2['default'].createElement(
+ _CalendarWeek2['default'],
+ { key: i },
+ week.map(function (day, dayOfWeek) {
+ return renderCalendarDay({
+ key: dayOfWeek,
+ day: day,
+ daySize: daySize,
+ isOutsideDay: !day || day.month() !== month.month(),
+ tabIndex: isVisible && (0, _isSameDay2['default'])(day, focusedDate) ? 0 : -1,
+ isFocused: isFocused,
+ onDayMouseEnter: onDayMouseEnter,
+ onDayMouseLeave: onDayMouseLeave,
+ onDayClick: onDayClick,
+ renderDayContents: renderDayContents,
+ phrases: phrases,
+ modifiers: modifiers[(0, _toISODateString2['default'])(day)],
+ ariaLabelFormat: dayAriaLabelFormat
+ });
+ })
+ );
+ })
+ )
+ )
+ );
+ }
+ return render;
+ }()
+ }]);
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports['default'] = getCalendarMonthWeeks;
+ return CalendarMonth;
+}(_react2['default'].Component);
-var _moment = __webpack_require__("wy2R");
+CalendarMonth.propTypes = propTypes;
+CalendarMonth.defaultProps = defaultProps;
-var _moment2 = _interopRequireDefault(_moment);
+exports["default"] = (0, _reactWithStyles.withStyles)(function (_ref) {
+ var _ref$reactDates = _ref.reactDates,
+ color = _ref$reactDates.color,
+ font = _ref$reactDates.font,
+ spacing = _ref$reactDates.spacing;
+ return {
+ CalendarMonth: {
+ background: color.background,
+ textAlign: 'center',
+ verticalAlign: 'top',
+ userSelect: 'none'
+ },
-var _constants = __webpack_require__("Fv1B");
+ CalendarMonth_table: {
+ borderCollapse: 'collapse',
+ borderSpacing: 0
+ },
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+ CalendarMonth_verticalSpacing: {
+ borderCollapse: 'separate'
+ },
-function getCalendarMonthWeeks(month, enableOutsideDays) {
- var firstDayOfWeek = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _moment2['default'].localeData().firstDayOfWeek();
+ CalendarMonth_caption: {
+ color: color.text,
+ fontSize: font.captionSize,
+ textAlign: 'center',
+ paddingTop: spacing.captionPaddingTop,
+ paddingBottom: spacing.captionPaddingBottom,
+ captionSide: 'initial'
+ },
- if (!_moment2['default'].isMoment(month) || !month.isValid()) {
- throw new TypeError('`month` must be a valid moment object');
- }
- if (_constants.WEEKDAYS.indexOf(firstDayOfWeek) === -1) {
- throw new TypeError('`firstDayOfWeek` must be an integer between 0 and 6');
- }
+ CalendarMonth_caption__verticalScrollable: {
+ paddingTop: 12,
+ paddingBottom: 7
+ }
+ };
+})(CalendarMonth);
- // set utc offset to get correct dates in future (when timezone changes)
- var firstOfMonth = month.clone().startOf('month').hour(12);
- var lastOfMonth = month.clone().endOf('month').hour(12);
+/***/ }),
- // calculate the exact first and last days to fill the entire matrix
- // (considering days outside month)
- var prevDays = (firstOfMonth.day() + 7 - firstDayOfWeek) % 7;
- var nextDays = (firstDayOfWeek + 6 - lastOfMonth.day()) % 7;
- var firstDay = firstOfMonth.clone().subtract(prevDays, 'day');
- var lastDay = lastOfMonth.clone().add(nextDays, 'day');
+/***/ 7938:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- var totalDays = lastDay.diff(firstDay, 'days') + 1;
+"use strict";
- var currentDay = firstDay.clone();
- var weeksInMonth = [];
- for (var i = 0; i < totalDays; i += 1) {
- if (i % 7 === 0) {
- weeksInMonth.push([]);
- }
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
- var day = null;
- if (i >= prevDays && i < totalDays - nextDays || enableOutsideDays) {
- day = currentDay.clone();
- }
+var _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; };
- weeksInMonth[weeksInMonth.length - 1].push(day);
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
- currentDay.add(1, 'day');
- }
+var _object = __webpack_require__(4011);
- return weeksInMonth;
-}
+var _object2 = _interopRequireDefault(_object);
-/***/ }),
+var _react = __webpack_require__(9196);
-/***/ "FpZJ":
-/***/ (function(module, exports, __webpack_require__) {
+var _react2 = _interopRequireDefault(_react);
-"use strict";
+var _propTypes = __webpack_require__(2652);
+var _propTypes2 = _interopRequireDefault(_propTypes);
-/* eslint complexity: [2, 18], max-statements: [2, 33] */
-module.exports = function hasSymbols() {
- if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
- if (typeof Symbol.iterator === 'symbol') { return true; }
+var _reactAddonsShallowCompare = __webpack_require__(2541);
- var obj = {};
- var sym = Symbol('test');
- var symObj = Object(sym);
- if (typeof sym === 'string') { return false; }
+var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
- if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
- if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
+var _reactMomentProptypes = __webpack_require__(6150);
- // temp disabled per https://github.com/ljharb/object.assign/issues/17
- // if (sym instanceof Symbol) { return false; }
- // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
- // if (!(symObj instanceof Symbol)) { return false; }
+var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
- // if (typeof Symbol.prototype.toString !== 'function') { return false; }
- // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
+var _airbnbPropTypes = __webpack_require__(4882);
- var symVal = 42;
- obj[sym] = symVal;
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
- if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
+var _reactWithStyles = __webpack_require__(3576);
- if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
+var _moment = __webpack_require__(6292);
- var syms = Object.getOwnPropertySymbols(obj);
- if (syms.length !== 1 || syms[0] !== sym) { return false; }
+var _moment2 = _interopRequireDefault(_moment);
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
+var _consolidatedEvents = __webpack_require__(8495);
- if (typeof Object.getOwnPropertyDescriptor === 'function') {
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
- if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
- }
+var _defaultPhrases = __webpack_require__(6030);
- return true;
-};
+var _getPhrasePropTypes = __webpack_require__(2893);
+var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
-/***/ }),
+var _CalendarMonth = __webpack_require__(5986);
-/***/ "FqII":
-/***/ (function(module, exports) {
+var _CalendarMonth2 = _interopRequireDefault(_CalendarMonth);
-(function() { module.exports = window["wp"]["date"]; }());
+var _isTransitionEndSupported = __webpack_require__(7978);
-/***/ }),
+var _isTransitionEndSupported2 = _interopRequireDefault(_isTransitionEndSupported);
-/***/ "FufO":
-/***/ (function(module, exports, __webpack_require__) {
+var _getTransformStyles = __webpack_require__(8304);
-"use strict";
+var _getTransformStyles2 = _interopRequireDefault(_getTransformStyles);
+var _getCalendarMonthWidth = __webpack_require__(8964);
-// modified from https://github.com/es-shims/es6-shim
-var keys = __webpack_require__("1seS");
-var canBeObject = function (obj) {
- return typeof obj !== 'undefined' && obj !== null;
-};
-var hasSymbols = __webpack_require__("FpZJ")();
-var callBound = __webpack_require__("VF6F");
-var toObject = Object;
-var $push = callBound('Array.prototype.push');
-var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');
-var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;
+var _getCalendarMonthWidth2 = _interopRequireDefault(_getCalendarMonthWidth);
-// eslint-disable-next-line no-unused-vars
-module.exports = function assign(target, source1) {
- if (!canBeObject(target)) { throw new TypeError('target must be an object'); }
- var objTarget = toObject(target);
- var s, source, i, props, syms, value, key;
- for (s = 1; s < arguments.length; ++s) {
- source = toObject(arguments[s]);
- props = keys(source);
- var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);
- if (getSymbols) {
- syms = getSymbols(source);
- for (i = 0; i < syms.length; ++i) {
- key = syms[i];
- if ($propIsEnumerable(source, key)) {
- $push(props, key);
- }
- }
- }
- for (i = 0; i < props.length; ++i) {
- key = props[i];
- value = source[key];
- if ($propIsEnumerable(source, key)) {
- objTarget[key] = value;
- }
- }
- }
- return objTarget;
-};
+var _toISOMonthString = __webpack_require__(2705);
+var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString);
-/***/ }),
+var _isPrevMonth = __webpack_require__(3858);
-/***/ "Fv1B":
-/***/ (function(module, exports, __webpack_require__) {
+var _isPrevMonth2 = _interopRequireDefault(_isPrevMonth);
-"use strict";
+var _isNextMonth = __webpack_require__(1310);
+var _isNextMonth2 = _interopRequireDefault(_isNextMonth);
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-var DISPLAY_FORMAT = exports.DISPLAY_FORMAT = 'L';
-var ISO_FORMAT = exports.ISO_FORMAT = 'YYYY-MM-DD';
-var ISO_MONTH_FORMAT = exports.ISO_MONTH_FORMAT = 'YYYY-MM';
+var _ModifiersShape = __webpack_require__(6747);
-var START_DATE = exports.START_DATE = 'startDate';
-var END_DATE = exports.END_DATE = 'endDate';
+var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
-var HORIZONTAL_ORIENTATION = exports.HORIZONTAL_ORIENTATION = 'horizontal';
-var VERTICAL_ORIENTATION = exports.VERTICAL_ORIENTATION = 'vertical';
-var VERTICAL_SCROLLABLE = exports.VERTICAL_SCROLLABLE = 'verticalScrollable';
+var _ScrollableOrientationShape = __webpack_require__(6553);
-var ICON_BEFORE_POSITION = exports.ICON_BEFORE_POSITION = 'before';
-var ICON_AFTER_POSITION = exports.ICON_AFTER_POSITION = 'after';
+var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
-var INFO_POSITION_TOP = exports.INFO_POSITION_TOP = 'top';
-var INFO_POSITION_BOTTOM = exports.INFO_POSITION_BOTTOM = 'bottom';
-var INFO_POSITION_BEFORE = exports.INFO_POSITION_BEFORE = 'before';
-var INFO_POSITION_AFTER = exports.INFO_POSITION_AFTER = 'after';
+var _DayOfWeekShape = __webpack_require__(243);
-var ANCHOR_LEFT = exports.ANCHOR_LEFT = 'left';
-var ANCHOR_RIGHT = exports.ANCHOR_RIGHT = 'right';
+var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
-var OPEN_DOWN = exports.OPEN_DOWN = 'down';
-var OPEN_UP = exports.OPEN_UP = 'up';
+var _constants = __webpack_require__(257);
-var DAY_SIZE = exports.DAY_SIZE = 39;
-var BLOCKED_MODIFIER = exports.BLOCKED_MODIFIER = 'blocked';
-var WEEKDAYS = exports.WEEKDAYS = [0, 1, 2, 3, 4, 5, 6];
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-var FANG_WIDTH_PX = exports.FANG_WIDTH_PX = 20;
-var FANG_HEIGHT_PX = exports.FANG_HEIGHT_PX = 10;
-var DEFAULT_VERTICAL_SPACING = exports.DEFAULT_VERTICAL_SPACING = 22;
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-var MODIFIER_KEY_NAMES = exports.MODIFIER_KEY_NAMES = new Set(['Shift', 'Control', 'Alt', 'Meta']);
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-/***/ }),
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-/***/ "G3V0":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
+ enableOutsideDays: _propTypes2['default'].bool,
+ firstVisibleMonthIndex: _propTypes2['default'].number,
+ horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
+ initialMonth: _reactMomentProptypes2['default'].momentObj,
+ isAnimating: _propTypes2['default'].bool,
+ numberOfMonths: _propTypes2['default'].number,
+ modifiers: _propTypes2['default'].objectOf(_propTypes2['default'].objectOf(_ModifiersShape2['default'])),
+ orientation: _ScrollableOrientationShape2['default'],
+ onDayClick: _propTypes2['default'].func,
+ onDayMouseEnter: _propTypes2['default'].func,
+ onDayMouseLeave: _propTypes2['default'].func,
+ onMonthTransitionEnd: _propTypes2['default'].func,
+ onMonthChange: _propTypes2['default'].func,
+ onYearChange: _propTypes2['default'].func,
+ renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
+ renderCalendarDay: _propTypes2['default'].func,
+ renderDayContents: _propTypes2['default'].func,
+ translationValue: _propTypes2['default'].number,
+ renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
+ daySize: _airbnbPropTypes.nonNegativeInteger,
+ focusedDate: _reactMomentProptypes2['default'].momentObj, // indicates focusable day
+ isFocused: _propTypes2['default'].bool, // indicates whether or not to move focus to focusable day
+ firstDayOfWeek: _DayOfWeekShape2['default'],
+ setMonthTitleHeight: _propTypes2['default'].func,
+ isRTL: _propTypes2['default'].bool,
+ transitionDuration: _airbnbPropTypes.nonNegativeInteger,
+ verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
-"use strict";
-/* unused harmony export Tabbable */
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useTabbable; });
-/* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("BZp5");
-/* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("hE48");
-/* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("qdes");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("cDcd");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("aU41");
-/* harmony import */ var reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("71Og");
-/* harmony import */ var reakit_warning__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("KA1K");
-/* harmony import */ var reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("eNtd");
-/* harmony import */ var reakit_utils_useIsomorphicEffect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("AXvK");
-/* harmony import */ var reakit_utils_hasFocusWithin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("PcHe");
-/* harmony import */ var reakit_utils_isPortalEvent__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("Vq1w");
-/* harmony import */ var reakit_utils_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("reMF");
-/* harmony import */ var reakit_utils_tabbable__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("kqkJ");
-/* harmony import */ var _Role_Role_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("zGFp");
+ // i18n
+ monthFormat: _propTypes2['default'].string,
+ phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases)),
+ dayAriaLabelFormat: _propTypes2['default'].string
+}));
+var defaultProps = {
+ enableOutsideDays: false,
+ firstVisibleMonthIndex: 0,
+ horizontalMonthPadding: 13,
+ initialMonth: (0, _moment2['default'])(),
+ isAnimating: false,
+ numberOfMonths: 1,
+ modifiers: {},
+ orientation: _constants.HORIZONTAL_ORIENTATION,
+ onDayClick: function () {
+ function onDayClick() {}
+ return onDayClick;
+ }(),
+ onDayMouseEnter: function () {
+ function onDayMouseEnter() {}
+ return onDayMouseEnter;
+ }(),
+ onDayMouseLeave: function () {
+ function onDayMouseLeave() {}
+ return onDayMouseLeave;
+ }(),
+ onMonthChange: function () {
+ function onMonthChange() {}
+ return onMonthChange;
+ }(),
+ onYearChange: function () {
+ function onYearChange() {}
+ return onYearChange;
+ }(),
+ onMonthTransitionEnd: function () {
+ function onMonthTransitionEnd() {}
+ return onMonthTransitionEnd;
+ }(),
+ renderMonthText: null,
+ renderCalendarDay: undefined,
+ renderDayContents: null,
+ translationValue: null,
+ renderMonthElement: null,
+ daySize: _constants.DAY_SIZE,
+ focusedDate: null,
+ isFocused: false,
+ firstDayOfWeek: null,
+ setMonthTitleHeight: null,
+ isRTL: false,
+ transitionDuration: 200,
+ verticalBorderSpacing: undefined,
+ // i18n
+ monthFormat: 'MMMM YYYY', // english locale
+ phrases: _defaultPhrases.CalendarDayPhrases,
+ dayAriaLabelFormat: undefined
+};
+function getMonths(initialMonth, numberOfMonths, withoutTransitionMonths) {
+ var month = initialMonth.clone();
+ if (!withoutTransitionMonths) month = month.subtract(1, 'month');
+ var months = [];
+ for (var i = 0; i < (withoutTransitionMonths ? numberOfMonths : numberOfMonths + 2); i += 1) {
+ months.push(month);
+ month = month.clone().add(1, 'month');
+ }
+ return months;
+}
+var CalendarMonthGrid = function (_React$Component) {
+ _inherits(CalendarMonthGrid, _React$Component);
+ function CalendarMonthGrid(props) {
+ _classCallCheck(this, CalendarMonthGrid);
+ var _this = _possibleConstructorReturn(this, (CalendarMonthGrid.__proto__ || Object.getPrototypeOf(CalendarMonthGrid)).call(this, props));
-// Automatically generated
-var TABBABLE_KEYS = ["disabled", "focusable"];
+ var withoutTransitionMonths = props.orientation === _constants.VERTICAL_SCROLLABLE;
+ _this.state = {
+ months: getMonths(props.initialMonth, props.numberOfMonths, withoutTransitionMonths)
+ };
-var isSafariOrFirefoxOnMac = Object(reakit_utils_dom__WEBPACK_IMPORTED_MODULE_11__[/* isUA */ "a"])("Mac") && !Object(reakit_utils_dom__WEBPACK_IMPORTED_MODULE_11__[/* isUA */ "a"])("Chrome") && (Object(reakit_utils_dom__WEBPACK_IMPORTED_MODULE_11__[/* isUA */ "a"])("Safari") || Object(reakit_utils_dom__WEBPACK_IMPORTED_MODULE_11__[/* isUA */ "a"])("Firefox"));
+ _this.isTransitionEndSupported = (0, _isTransitionEndSupported2['default'])();
+ _this.onTransitionEnd = _this.onTransitionEnd.bind(_this);
+ _this.setContainerRef = _this.setContainerRef.bind(_this);
-function focusIfNeeded(element) {
- if (!Object(reakit_utils_hasFocusWithin__WEBPACK_IMPORTED_MODULE_9__[/* hasFocusWithin */ "a"])(element) && Object(reakit_utils_tabbable__WEBPACK_IMPORTED_MODULE_12__[/* isFocusable */ "c"])(element)) {
- element.focus();
+ _this.locale = _moment2['default'].locale();
+ _this.onMonthSelect = _this.onMonthSelect.bind(_this);
+ _this.onYearSelect = _this.onYearSelect.bind(_this);
+ return _this;
}
-}
-function isNativeTabbable(element) {
- return ["BUTTON", "INPUT", "SELECT", "TEXTAREA", "A"].includes(element.tagName);
-}
+ _createClass(CalendarMonthGrid, [{
+ key: 'componentDidMount',
+ value: function () {
+ function componentDidMount() {
+ this.removeEventListener = (0, _consolidatedEvents.addEventListener)(this.container, 'transitionend', this.onTransitionEnd);
+ }
-function supportsDisabledAttribute(element) {
- return ["BUTTON", "INPUT", "SELECT", "TEXTAREA"].includes(element.tagName);
-}
+ return componentDidMount;
+ }()
+ }, {
+ key: 'componentWillReceiveProps',
+ value: function () {
+ function componentWillReceiveProps(nextProps) {
+ var _this2 = this;
-function getTabIndex(trulyDisabled, nativeTabbable, supportsDisabled, htmlTabIndex) {
- if (trulyDisabled) {
- if (nativeTabbable && !supportsDisabled) {
- // Anchor, audio and video tags don't support the `disabled` attribute.
- // We must pass tabIndex={-1} so they don't receive focus on tab.
- return -1;
- } // Elements that support the `disabled` attribute don't need tabIndex.
+ var initialMonth = nextProps.initialMonth,
+ numberOfMonths = nextProps.numberOfMonths,
+ orientation = nextProps.orientation;
+ var months = this.state.months;
+ var _props = this.props,
+ prevInitialMonth = _props.initialMonth,
+ prevNumberOfMonths = _props.numberOfMonths;
+ var hasMonthChanged = !prevInitialMonth.isSame(initialMonth, 'month');
+ var hasNumberOfMonthsChanged = prevNumberOfMonths !== numberOfMonths;
+ var newMonths = months;
- return undefined;
- }
+ if (hasMonthChanged && !hasNumberOfMonthsChanged) {
+ if ((0, _isNextMonth2['default'])(prevInitialMonth, initialMonth)) {
+ newMonths = months.slice(1);
+ newMonths.push(months[months.length - 1].clone().add(1, 'month'));
+ } else if ((0, _isPrevMonth2['default'])(prevInitialMonth, initialMonth)) {
+ newMonths = months.slice(0, months.length - 1);
+ newMonths.unshift(months[0].clone().subtract(1, 'month'));
+ } else {
+ var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
+ newMonths = getMonths(initialMonth, numberOfMonths, withoutTransitionMonths);
+ }
+ }
- if (nativeTabbable) {
- // If the element is enabled and it's natively tabbable, we don't need to
- // specify a tabIndex attribute unless it's explicitly set by the user.
- return htmlTabIndex;
- } // If the element is enabled and is not natively tabbable, we have to
- // fallback tabIndex={0}.
+ if (hasNumberOfMonthsChanged) {
+ var _withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
+ newMonths = getMonths(initialMonth, numberOfMonths, _withoutTransitionMonths);
+ }
+ var momentLocale = _moment2['default'].locale();
+ if (this.locale !== momentLocale) {
+ this.locale = momentLocale;
+ newMonths = newMonths.map(function (m) {
+ return m.locale(_this2.locale);
+ });
+ }
- return htmlTabIndex || 0;
-}
+ this.setState({
+ months: newMonths
+ });
+ }
-function useDisableEvent(htmlEventRef, disabled) {
- return Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) {
- var _htmlEventRef$current;
+ return componentWillReceiveProps;
+ }()
+ }, {
+ key: 'shouldComponentUpdate',
+ value: function () {
+ function shouldComponentUpdate(nextProps, nextState) {
+ return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
+ }
- (_htmlEventRef$current = htmlEventRef.current) === null || _htmlEventRef$current === void 0 ? void 0 : _htmlEventRef$current.call(htmlEventRef, event);
- if (event.defaultPrevented) return;
+ return shouldComponentUpdate;
+ }()
+ }, {
+ key: 'componentDidUpdate',
+ value: function () {
+ function componentDidUpdate() {
+ var _props2 = this.props,
+ isAnimating = _props2.isAnimating,
+ transitionDuration = _props2.transitionDuration,
+ onMonthTransitionEnd = _props2.onMonthTransitionEnd;
- if (disabled) {
- event.stopPropagation();
- event.preventDefault();
- }
- }, [htmlEventRef, disabled]);
-}
+ // For IE9, immediately call onMonthTransitionEnd instead of
+ // waiting for the animation to complete. Similarly, if transitionDuration
+ // is set to 0, also immediately invoke the onMonthTransitionEnd callback
-var useTabbable = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({
- name: "Tabbable",
- compose: _Role_Role_js__WEBPACK_IMPORTED_MODULE_13__[/* useRole */ "a"],
- keys: TABBABLE_KEYS,
- useOptions: function useOptions(options, _ref) {
- var disabled = _ref.disabled;
- return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({
- disabled: disabled
- }, options);
- },
- useProps: function useProps(options, _ref2) {
- var htmlRef = _ref2.ref,
- htmlTabIndex = _ref2.tabIndex,
- htmlOnClickCapture = _ref2.onClickCapture,
- htmlOnMouseDownCapture = _ref2.onMouseDownCapture,
- htmlOnMouseDown = _ref2.onMouseDown,
- htmlOnKeyPressCapture = _ref2.onKeyPressCapture,
- htmlStyle = _ref2.style,
- htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_ref2, ["ref", "tabIndex", "onClickCapture", "onMouseDownCapture", "onMouseDown", "onKeyPressCapture", "style"]);
+ if ((!this.isTransitionEndSupported || !transitionDuration) && isAnimating) {
+ onMonthTransitionEnd();
+ }
+ }
- var ref = Object(react__WEBPACK_IMPORTED_MODULE_3__["useRef"])(null);
- var onClickCaptureRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnClickCapture);
- var onMouseDownCaptureRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnMouseDownCapture);
- var onMouseDownRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnMouseDown);
- var onKeyPressCaptureRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnKeyPressCapture);
- var trulyDisabled = !!options.disabled && !options.focusable;
+ return componentDidUpdate;
+ }()
+ }, {
+ key: 'componentWillUnmount',
+ value: function () {
+ function componentWillUnmount() {
+ if (this.removeEventListener) this.removeEventListener();
+ }
- var _React$useState = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(true),
- nativeTabbable = _React$useState[0],
- setNativeTabbable = _React$useState[1];
+ return componentWillUnmount;
+ }()
+ }, {
+ key: 'onTransitionEnd',
+ value: function () {
+ function onTransitionEnd() {
+ var onMonthTransitionEnd = this.props.onMonthTransitionEnd;
- var _React$useState2 = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(true),
- supportsDisabled = _React$useState2[0],
- setSupportsDisabled = _React$useState2[1];
+ onMonthTransitionEnd();
+ }
- var style = options.disabled ? Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({
- pointerEvents: "none"
- }, htmlStyle) : htmlStyle;
- Object(reakit_utils_useIsomorphicEffect__WEBPACK_IMPORTED_MODULE_8__[/* useIsomorphicEffect */ "a"])(function () {
- var tabbable = ref.current;
+ return onTransitionEnd;
+ }()
+ }, {
+ key: 'onMonthSelect',
+ value: function () {
+ function onMonthSelect(currentMonth, newMonthVal) {
+ var newMonth = currentMonth.clone();
+ var _props3 = this.props,
+ onMonthChange = _props3.onMonthChange,
+ orientation = _props3.orientation;
+ var months = this.state.months;
- if (!tabbable) {
- false ? undefined : void 0;
- return;
+ var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
+ var initialMonthSubtraction = months.indexOf(currentMonth);
+ if (!withoutTransitionMonths) {
+ initialMonthSubtraction -= 1;
+ }
+ newMonth.set('month', newMonthVal).subtract(initialMonthSubtraction, 'months');
+ onMonthChange(newMonth);
}
- if (!isNativeTabbable(tabbable)) {
- setNativeTabbable(false);
+ return onMonthSelect;
+ }()
+ }, {
+ key: 'onYearSelect',
+ value: function () {
+ function onYearSelect(currentMonth, newYearVal) {
+ var newMonth = currentMonth.clone();
+ var _props4 = this.props,
+ onYearChange = _props4.onYearChange,
+ orientation = _props4.orientation;
+ var months = this.state.months;
+
+ var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
+ var initialMonthSubtraction = months.indexOf(currentMonth);
+ if (!withoutTransitionMonths) {
+ initialMonthSubtraction -= 1;
+ }
+ newMonth.set('year', newYearVal).subtract(initialMonthSubtraction, 'months');
+ onYearChange(newMonth);
}
- if (!supportsDisabledAttribute(tabbable)) {
- setSupportsDisabled(false);
+ return onYearSelect;
+ }()
+ }, {
+ key: 'setContainerRef',
+ value: function () {
+ function setContainerRef(ref) {
+ this.container = ref;
}
- }, []);
- var onClickCapture = useDisableEvent(onClickCaptureRef, options.disabled);
- var onMouseDownCapture = useDisableEvent(onMouseDownCaptureRef, options.disabled);
- var onKeyPressCapture = useDisableEvent(onKeyPressCaptureRef, options.disabled);
- var onMouseDown = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) {
- var _onMouseDownRef$curre;
- (_onMouseDownRef$curre = onMouseDownRef.current) === null || _onMouseDownRef$curre === void 0 ? void 0 : _onMouseDownRef$curre.call(onMouseDownRef, event);
- var element = event.currentTarget;
- if (event.defaultPrevented) return; // Safari and Firefox on MacOS don't focus on buttons on mouse down
- // like other browsers/platforms. Instead, they focus on the closest
- // focusable ancestor element, which is ultimately the body element. So
- // we make sure to give focus to the tabbable element on mouse down so
- // it works consistently across browsers.
+ return setContainerRef;
+ }()
+ }, {
+ key: 'render',
+ value: function () {
+ function render() {
+ var _this3 = this;
- if (!isSafariOrFirefoxOnMac) return;
- if (Object(reakit_utils_isPortalEvent__WEBPACK_IMPORTED_MODULE_10__[/* isPortalEvent */ "a"])(event)) return;
- if (!Object(reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_5__[/* isButton */ "a"])(element)) return; // We can't focus right away after on mouse down, otherwise it would
- // prevent drag events from happening. So we schedule the focus to the
- // next animation frame.
+ var _props5 = this.props,
+ enableOutsideDays = _props5.enableOutsideDays,
+ firstVisibleMonthIndex = _props5.firstVisibleMonthIndex,
+ horizontalMonthPadding = _props5.horizontalMonthPadding,
+ isAnimating = _props5.isAnimating,
+ modifiers = _props5.modifiers,
+ numberOfMonths = _props5.numberOfMonths,
+ monthFormat = _props5.monthFormat,
+ orientation = _props5.orientation,
+ translationValue = _props5.translationValue,
+ daySize = _props5.daySize,
+ onDayMouseEnter = _props5.onDayMouseEnter,
+ onDayMouseLeave = _props5.onDayMouseLeave,
+ onDayClick = _props5.onDayClick,
+ renderMonthText = _props5.renderMonthText,
+ renderCalendarDay = _props5.renderCalendarDay,
+ renderDayContents = _props5.renderDayContents,
+ renderMonthElement = _props5.renderMonthElement,
+ onMonthTransitionEnd = _props5.onMonthTransitionEnd,
+ firstDayOfWeek = _props5.firstDayOfWeek,
+ focusedDate = _props5.focusedDate,
+ isFocused = _props5.isFocused,
+ isRTL = _props5.isRTL,
+ styles = _props5.styles,
+ phrases = _props5.phrases,
+ dayAriaLabelFormat = _props5.dayAriaLabelFormat,
+ transitionDuration = _props5.transitionDuration,
+ verticalBorderSpacing = _props5.verticalBorderSpacing,
+ setMonthTitleHeight = _props5.setMonthTitleHeight;
+ var months = this.state.months;
- var raf = requestAnimationFrame(function () {
- element.removeEventListener("mouseup", focusImmediately, true);
- focusIfNeeded(element);
- }); // If mouseUp happens before the next animation frame (which is common
- // on touch screens or by just tapping the trackpad on MacBook's), we
- // cancel the animation frame and immediately focus on the element.
+ var isVertical = orientation === _constants.VERTICAL_ORIENTATION;
+ var isVerticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
+ var isHorizontal = orientation === _constants.HORIZONTAL_ORIENTATION;
- var focusImmediately = function focusImmediately() {
- cancelAnimationFrame(raf);
- focusIfNeeded(element);
- }; // By listening to the event in the capture phase, we make sure the
- // focus event is fired before the onMouseUp and onMouseUpCapture React
- // events, which is aligned with the default browser behavior.
+ var calendarMonthWidth = (0, _getCalendarMonthWidth2['default'])(daySize, horizontalMonthPadding);
+ var width = isVertical || isVerticalScrollable ? calendarMonthWidth : (numberOfMonths + 2) * calendarMonthWidth;
- element.addEventListener("mouseup", focusImmediately, {
- once: true,
- capture: true
- });
- }, []);
- return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({
- ref: Object(reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_4__[/* useForkRef */ "a"])(ref, htmlRef),
- style: style,
- tabIndex: getTabIndex(trulyDisabled, nativeTabbable, supportsDisabled, htmlTabIndex),
- disabled: trulyDisabled && supportsDisabled ? true : undefined,
- "aria-disabled": options.disabled ? true : undefined,
- onClickCapture: onClickCapture,
- onMouseDownCapture: onMouseDownCapture,
- onMouseDown: onMouseDown,
- onKeyPressCapture: onKeyPressCapture
- }, htmlProps);
- }
-});
-var Tabbable = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({
- as: "div",
- useHook: useTabbable
-});
+ var transformType = isVertical || isVerticalScrollable ? 'translateY' : 'translateX';
+ var transformValue = transformType + '(' + String(translationValue) + 'px)';
+
+ return _react2['default'].createElement(
+ 'div',
+ _extends({}, (0, _reactWithStyles.css)(styles.CalendarMonthGrid, isHorizontal && styles.CalendarMonthGrid__horizontal, isVertical && styles.CalendarMonthGrid__vertical, isVerticalScrollable && styles.CalendarMonthGrid__vertical_scrollable, isAnimating && styles.CalendarMonthGrid__animating, isAnimating && transitionDuration && {
+ transition: 'transform ' + String(transitionDuration) + 'ms ease-in-out'
+ }, (0, _object2['default'])({}, (0, _getTransformStyles2['default'])(transformValue), {
+ width: width
+ })), {
+ ref: this.setContainerRef,
+ onTransitionEnd: onMonthTransitionEnd
+ }),
+ months.map(function (month, i) {
+ var isVisible = i >= firstVisibleMonthIndex && i < firstVisibleMonthIndex + numberOfMonths;
+ var hideForAnimation = i === 0 && !isVisible;
+ var showForAnimation = i === 0 && isAnimating && isVisible;
+ var monthString = (0, _toISOMonthString2['default'])(month);
+ return _react2['default'].createElement(
+ 'div',
+ _extends({
+ key: monthString
+ }, (0, _reactWithStyles.css)(isHorizontal && styles.CalendarMonthGrid_month__horizontal, hideForAnimation && styles.CalendarMonthGrid_month__hideForAnimation, showForAnimation && !isVertical && !isRTL && {
+ position: 'absolute',
+ left: -calendarMonthWidth
+ }, showForAnimation && !isVertical && isRTL && {
+ position: 'absolute',
+ right: 0
+ }, showForAnimation && isVertical && {
+ position: 'absolute',
+ top: -translationValue
+ }, !isVisible && !isAnimating && styles.CalendarMonthGrid_month__hidden)),
+ _react2['default'].createElement(_CalendarMonth2['default'], {
+ month: month,
+ isVisible: isVisible,
+ enableOutsideDays: enableOutsideDays,
+ modifiers: modifiers[monthString],
+ monthFormat: monthFormat,
+ orientation: orientation,
+ onDayMouseEnter: onDayMouseEnter,
+ onDayMouseLeave: onDayMouseLeave,
+ onDayClick: onDayClick,
+ onMonthSelect: _this3.onMonthSelect,
+ onYearSelect: _this3.onYearSelect,
+ renderMonthText: renderMonthText,
+ renderCalendarDay: renderCalendarDay,
+ renderDayContents: renderDayContents,
+ renderMonthElement: renderMonthElement,
+ firstDayOfWeek: firstDayOfWeek,
+ daySize: daySize,
+ focusedDate: isVisible ? focusedDate : null,
+ isFocused: isFocused,
+ phrases: phrases,
+ setMonthTitleHeight: setMonthTitleHeight,
+ dayAriaLabelFormat: dayAriaLabelFormat,
+ verticalBorderSpacing: verticalBorderSpacing,
+ horizontalMonthPadding: horizontalMonthPadding
+ })
+ );
+ })
+ );
+ }
+
+ return render;
+ }()
+ }]);
+
+ return CalendarMonthGrid;
+}(_react2['default'].Component);
+
+CalendarMonthGrid.propTypes = propTypes;
+CalendarMonthGrid.defaultProps = defaultProps;
+
+exports["default"] = (0, _reactWithStyles.withStyles)(function (_ref) {
+ var _ref$reactDates = _ref.reactDates,
+ color = _ref$reactDates.color,
+ noScrollBarOnVerticalScrollable = _ref$reactDates.noScrollBarOnVerticalScrollable,
+ spacing = _ref$reactDates.spacing,
+ zIndex = _ref$reactDates.zIndex;
+ return {
+ CalendarMonthGrid: {
+ background: color.background,
+ textAlign: 'left',
+ zIndex: zIndex
+ },
+
+ CalendarMonthGrid__animating: {
+ zIndex: zIndex + 1
+ },
+
+ CalendarMonthGrid__horizontal: {
+ position: 'absolute',
+ left: spacing.dayPickerHorizontalPadding
+ },
+
+ CalendarMonthGrid__vertical: {
+ margin: '0 auto'
+ },
+
+ CalendarMonthGrid__vertical_scrollable: (0, _object2['default'])({
+ margin: '0 auto',
+ overflowY: 'scroll'
+ }, noScrollBarOnVerticalScrollable && {
+ '-webkitOverflowScrolling': 'touch',
+ '::-webkit-scrollbar': {
+ '-webkit-appearance': 'none',
+ display: 'none'
+ }
+ }),
+ CalendarMonthGrid_month__horizontal: {
+ display: 'inline-block',
+ verticalAlign: 'top',
+ minHeight: '100%'
+ },
+ CalendarMonthGrid_month__hideForAnimation: {
+ position: 'absolute',
+ zIndex: zIndex - 1,
+ opacity: 0,
+ pointerEvents: 'none'
+ },
+ CalendarMonthGrid_month__hidden: {
+ visibility: 'hidden'
+ }
+ };
+})(CalendarMonthGrid);
/***/ }),
-/***/ "GET3":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 4604:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
-Object.defineProperty(exports, "__esModule", {
+Object.defineProperty(exports, "__esModule", ({
value: true
+}));
+exports["default"] = CalendarWeek;
+
+var _react = __webpack_require__(9196);
+
+var _react2 = _interopRequireDefault(_react);
+
+var _airbnbPropTypes = __webpack_require__(4882);
+
+var _CalendarDay = __webpack_require__(7617);
+
+var _CalendarDay2 = _interopRequireDefault(_CalendarDay);
+
+var _CustomizableCalendarDay = __webpack_require__(6698);
+
+var _CustomizableCalendarDay2 = _interopRequireDefault(_CustomizableCalendarDay);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+
+var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({
+ children: (0, _airbnbPropTypes.or)([(0, _airbnbPropTypes.childrenOfType)(_CalendarDay2['default']), (0, _airbnbPropTypes.childrenOfType)(_CustomizableCalendarDay2['default'])]).isRequired
});
+
+function CalendarWeek(_ref) {
+ var children = _ref.children;
+
+ return _react2['default'].createElement(
+ 'tr',
+ null,
+ children
+ );
+}
+
+CalendarWeek.propTypes = propTypes;
+
+/***/ }),
+
+/***/ 9588:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+
+var _react = __webpack_require__(9196);
+
+var _react2 = _interopRequireDefault(_react);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+
+var ChevronDown = function () {
+ function ChevronDown(props) {
+ return _react2['default'].createElement(
+ 'svg',
+ props,
+ _react2['default'].createElement('path', {
+ d: 'M967.5 288.5L514.3 740.7c-11 11-21 11-32 0L29.1 288.5c-4-5-6-11-6-16 0-13 10-23 23-23 6 0 11 2 15 7l437.2 436.2 437.2-436.2c4-5 9-7 16-7 6 0 11 2 16 7 9 10.9 9 21 0 32z'
+ })
+ );
+ }
+
+ return ChevronDown;
+}();
+
+ChevronDown.defaultProps = {
+ viewBox: '0 0 1000 1000'
+};
+exports["default"] = ChevronDown;
+
+/***/ }),
+
+/***/ 1809:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+
+var _react = __webpack_require__(9196);
+
+var _react2 = _interopRequireDefault(_react);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+
+var ChevronUp = function () {
+ function ChevronUp(props) {
+ return _react2['default'].createElement(
+ 'svg',
+ props,
+ _react2['default'].createElement('path', {
+ d: 'M32.1 712.6l453.2-452.2c11-11 21-11 32 0l453.2 452.2c4 5 6 10 6 16 0 13-10 23-22 23-7 0-12-2-16-7L501.3 308.5 64.1 744.7c-4 5-9 7-15 7-7 0-12-2-17-7-9-11-9-21 0-32.1z'
+ })
+ );
+ }
+
+ return ChevronUp;
+}();
+
+ChevronUp.defaultProps = {
+ viewBox: '0 0 1000 1000'
+};
+exports["default"] = ChevronUp;
+
+/***/ }),
+
+/***/ 6973:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+
+var _react = __webpack_require__(9196);
+
+var _react2 = _interopRequireDefault(_react);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+
+var CloseButton = function () {
+ function CloseButton(props) {
+ return _react2['default'].createElement(
+ 'svg',
+ props,
+ _react2['default'].createElement('path', {
+ fillRule: 'evenodd',
+ d: 'M11.53.47a.75.75 0 0 0-1.061 0l-4.47 4.47L1.529.47A.75.75 0 1 0 .468 1.531l4.47 4.47-4.47 4.47a.75.75 0 1 0 1.061 1.061l4.47-4.47 4.47 4.47a.75.75 0 1 0 1.061-1.061l-4.47-4.47 4.47-4.47a.75.75 0 0 0 0-1.061z'
+ })
+ );
+ }
+
+ return CloseButton;
+}();
+
+CloseButton.defaultProps = {
+ viewBox: '0 0 12 12'
+};
+exports["default"] = CloseButton;
+
+/***/ }),
+
+/***/ 6698:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
+
+"use strict";
+
+
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
exports.PureCustomizableCalendarDay = exports.selectedStyles = exports.lastInRangeStyles = exports.selectedSpanStyles = exports.hoveredSpanStyles = exports.blockedOutOfRangeStyles = exports.blockedCalendarStyles = exports.blockedMinNightsStyles = exports.highlightedCalendarStyles = exports.outsideStyles = exports.defaultStyles = undefined;
var _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; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-var _object = __webpack_require__("Koq/");
+var _object = __webpack_require__(4011);
var _object2 = _interopRequireDefault(_object);
-var _react = __webpack_require__("cDcd");
+var _react = __webpack_require__(9196);
var _react2 = _interopRequireDefault(_react);
-var _propTypes = __webpack_require__("17x9");
+var _propTypes = __webpack_require__(2652);
var _propTypes2 = _interopRequireDefault(_propTypes);
-var _reactAddonsShallowCompare = __webpack_require__("YZDV");
+var _reactAddonsShallowCompare = __webpack_require__(2541);
var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
-var _reactMomentProptypes = __webpack_require__("XGBb");
+var _reactMomentProptypes = __webpack_require__(6150);
var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
-var _airbnbPropTypes = __webpack_require__("Hsqg");
+var _airbnbPropTypes = __webpack_require__(4882);
-var _reactWithStyles = __webpack_require__("TG4+");
+var _reactWithStyles = __webpack_require__(3576);
-var _moment = __webpack_require__("wy2R");
+var _moment = __webpack_require__(6292);
var _moment2 = _interopRequireDefault(_moment);
-var _defaultPhrases = __webpack_require__("vV+G");
+var _defaultPhrases = __webpack_require__(6030);
-var _getPhrasePropTypes = __webpack_require__("yc2e");
+var _getPhrasePropTypes = __webpack_require__(2893);
var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
-var _getCalendarDaySettings = __webpack_require__("Ae65");
+var _getCalendarDaySettings = __webpack_require__(7475);
var _getCalendarDaySettings2 = _interopRequireDefault(_getCalendarDaySettings);
-var _constants = __webpack_require__("Fv1B");
+var _constants = __webpack_require__(257);
-var _DefaultTheme = __webpack_require__("xOhs");
+var _DefaultTheme = __webpack_require__(8158);
var _DefaultTheme2 = _interopRequireDefault(_DefaultTheme);
@@ -8014,7 +8284,7 @@ CustomizableCalendarDay.propTypes = propTypes;
CustomizableCalendarDay.defaultProps = defaultProps;
exports.PureCustomizableCalendarDay = CustomizableCalendarDay;
-exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
+exports["default"] = (0, _reactWithStyles.withStyles)(function (_ref2) {
var font = _ref2.reactDates.font;
return {
CalendarDay: {
@@ -8036,1796 +8306,1948 @@ exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
/***/ }),
-/***/ "GG7f":
-/***/ (function(module, exports, __webpack_require__) {
-
-// eslint-disable-next-line import/no-unresolved
-__webpack_require__("H24B");
-
+/***/ 8665:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
-/***/ }),
+"use strict";
-/***/ "GK4x":
-/***/ (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
- */
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports.PureDayPicker = exports.defaultProps = undefined;
-const ToolbarContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])();
-/* harmony default export */ __webpack_exports__["a"] = (ToolbarContext);
+var _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; };
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-/***/ }),
+var _object = __webpack_require__(4011);
-/***/ "GRId":
-/***/ (function(module, exports) {
+var _object2 = _interopRequireDefault(_object);
-(function() { module.exports = window["wp"]["element"]; }());
+var _react = __webpack_require__(9196);
-/***/ }),
+var _react2 = _interopRequireDefault(_react);
-/***/ "Gn0q":
-/***/ (function(module, exports, __webpack_require__) {
+var _propTypes = __webpack_require__(2652);
-"use strict";
+var _propTypes2 = _interopRequireDefault(_propTypes);
+var _reactAddonsShallowCompare = __webpack_require__(2541);
-var define = __webpack_require__("82c2");
-var getPolyfill = __webpack_require__("5yQQ");
+var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
-module.exports = function shimContains() {
- var polyfill = getPolyfill();
- if (typeof document !== 'undefined') {
- define(
- document,
- { contains: polyfill },
- { contains: function () { return document.contains !== polyfill; } }
- );
- if (typeof Element !== 'undefined') {
- define(
- Element.prototype,
- { contains: polyfill },
- { contains: function () { return Element.prototype.contains !== polyfill; } }
- );
- }
- }
- return polyfill;
-};
+var _airbnbPropTypes = __webpack_require__(4882);
+var _reactWithStyles = __webpack_require__(3576);
-/***/ }),
+var _moment = __webpack_require__(6292);
-/***/ "GoyQ":
-/***/ (function(module, exports) {
+var _moment2 = _interopRequireDefault(_moment);
-/**
- * Checks if `value` is the
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(_.noop);
- * // => true
- *
- * _.isObject(null);
- * // => false
- */
-function isObject(value) {
- var type = typeof value;
- return value != null && (type == 'object' || type == 'function');
-}
+var _throttle = __webpack_require__(8172);
-module.exports = isObject;
+var _throttle2 = _interopRequireDefault(_throttle);
+var _isTouchDevice = __webpack_require__(5834);
-/***/ }),
+var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice);
-/***/ "H24B":
-/***/ (function(module, exports, __webpack_require__) {
+var _reactOutsideClickHandler = __webpack_require__(6606);
-"use strict";
+var _reactOutsideClickHandler2 = _interopRequireDefault(_reactOutsideClickHandler);
+var _defaultPhrases = __webpack_require__(6030);
-var _registerCSSInterfaceWithDefaultTheme = __webpack_require__("TUyu");
+var _getPhrasePropTypes = __webpack_require__(2893);
-var _registerCSSInterfaceWithDefaultTheme2 = _interopRequireDefault(_registerCSSInterfaceWithDefaultTheme);
+var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+var _CalendarMonthGrid = __webpack_require__(7938);
-(0, _registerCSSInterfaceWithDefaultTheme2['default'])();
+var _CalendarMonthGrid2 = _interopRequireDefault(_CalendarMonthGrid);
-/***/ }),
+var _DayPickerNavigation = __webpack_require__(3895);
-/***/ "Hsqg":
-/***/ (function(module, exports, __webpack_require__) {
+var _DayPickerNavigation2 = _interopRequireDefault(_DayPickerNavigation);
-module.exports = true ? __webpack_require__("DciD") : undefined;
+var _DayPickerKeyboardShortcuts = __webpack_require__(600);
+var _DayPickerKeyboardShortcuts2 = _interopRequireDefault(_DayPickerKeyboardShortcuts);
+var _getNumberOfCalendarMonthWeeks = __webpack_require__(4112);
-/***/ }),
+var _getNumberOfCalendarMonthWeeks2 = _interopRequireDefault(_getNumberOfCalendarMonthWeeks);
-/***/ "HwJD":
-/***/ (function(module, exports, __webpack_require__) {
+var _getCalendarMonthWidth = __webpack_require__(8964);
-"use strict";
+var _getCalendarMonthWidth2 = _interopRequireDefault(_getCalendarMonthWidth);
+var _calculateDimension = __webpack_require__(8607);
-module.exports = Number.isNaN || function isNaN(a) {
- return a !== a;
-};
+var _calculateDimension2 = _interopRequireDefault(_calculateDimension);
+var _getActiveElement = __webpack_require__(5814);
-/***/ }),
+var _getActiveElement2 = _interopRequireDefault(_getActiveElement);
-/***/ "HyUg":
-/***/ (function(module, exports, __webpack_require__) {
+var _isDayVisible = __webpack_require__(5713);
-"use strict";
+var _isDayVisible2 = _interopRequireDefault(_isDayVisible);
+var _ModifiersShape = __webpack_require__(6747);
-var origSymbol = typeof Symbol !== 'undefined' && Symbol;
-var hasSymbolSham = __webpack_require__("eJkf");
+var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
-module.exports = function hasNativeSymbols() {
- if (typeof origSymbol !== 'function') { return false; }
- if (typeof Symbol !== 'function') { return false; }
- if (typeof origSymbol('foo') !== 'symbol') { return false; }
- if (typeof Symbol('bar') !== 'symbol') { return false; }
+var _ScrollableOrientationShape = __webpack_require__(6553);
- return hasSymbolSham();
-};
+var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
+var _DayOfWeekShape = __webpack_require__(243);
-/***/ }),
+var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
-/***/ "I/A+":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+var _CalendarInfoPositionShape = __webpack_require__(8182);
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _objectSpread2; });
-/* unused harmony export b */
-function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
+var _CalendarInfoPositionShape2 = _interopRequireDefault(_CalendarInfoPositionShape);
- return obj;
-}
+var _constants = __webpack_require__(257);
-function ownKeys(object, enumerableOnly) {
- var keys = Object.keys(object);
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object);
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
- });
- keys.push.apply(keys, symbols);
- }
+function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
- return keys;
-}
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-function _objectSpread2(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i] != null ? arguments[i] : {};
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
- if (i % 2) {
- ownKeys(Object(source), true).forEach(function (key) {
- _defineProperty(target, key, source[key]);
- });
- } else if (Object.getOwnPropertyDescriptors) {
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
- } else {
- ownKeys(Object(source)).forEach(function (key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- }
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
- return target;
-}
+var MONTH_PADDING = 23;
+var PREV_TRANSITION = 'prev';
+var NEXT_TRANSITION = 'next';
+var MONTH_SELECTION_TRANSITION = 'month_selection';
+var YEAR_SELECTION_TRANSITION = 'year_selection';
-function _objectWithoutPropertiesLoose(source, excluded) {
- if (source == null) return {};
- var target = {};
- var sourceKeys = Object.keys(source);
- var key, i;
+var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
- for (i = 0; i < sourceKeys.length; i++) {
- key = sourceKeys[i];
- if (excluded.indexOf(key) >= 0) continue;
- target[key] = source[key];
- }
+ // calendar presentation props
+ enableOutsideDays: _propTypes2['default'].bool,
+ numberOfMonths: _propTypes2['default'].number,
+ orientation: _ScrollableOrientationShape2['default'],
+ withPortal: _propTypes2['default'].bool,
+ onOutsideClick: _propTypes2['default'].func,
+ hidden: _propTypes2['default'].bool,
+ initialVisibleMonth: _propTypes2['default'].func,
+ firstDayOfWeek: _DayOfWeekShape2['default'],
+ renderCalendarInfo: _propTypes2['default'].func,
+ calendarInfoPosition: _CalendarInfoPositionShape2['default'],
+ hideKeyboardShortcutsPanel: _propTypes2['default'].bool,
+ daySize: _airbnbPropTypes.nonNegativeInteger,
+ isRTL: _propTypes2['default'].bool,
+ verticalHeight: _airbnbPropTypes.nonNegativeInteger,
+ noBorder: _propTypes2['default'].bool,
+ transitionDuration: _airbnbPropTypes.nonNegativeInteger,
+ verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
+ horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
- return target;
-}
+ // navigation props
+ navPrev: _propTypes2['default'].node,
+ navNext: _propTypes2['default'].node,
+ noNavButtons: _propTypes2['default'].bool,
+ onPrevMonthClick: _propTypes2['default'].func,
+ onNextMonthClick: _propTypes2['default'].func,
+ onMonthChange: _propTypes2['default'].func,
+ onYearChange: _propTypes2['default'].func,
+ onMultiplyScrollableMonths: _propTypes2['default'].func, // VERTICAL_SCROLLABLE daypickers only
-function _unsupportedIterableToArray(o, minLen) {
- if (!o) return;
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if (n === "Object" && o.constructor) n = o.constructor.name;
- if (n === "Map" || n === "Set") return Array.from(o);
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
-}
+ // month props
+ renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
+ renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
-function _arrayLikeToArray(arr, len) {
- if (len == null || len > arr.length) len = arr.length;
+ // day props
+ modifiers: _propTypes2['default'].objectOf(_propTypes2['default'].objectOf(_ModifiersShape2['default'])),
+ renderCalendarDay: _propTypes2['default'].func,
+ renderDayContents: _propTypes2['default'].func,
+ onDayClick: _propTypes2['default'].func,
+ onDayMouseEnter: _propTypes2['default'].func,
+ onDayMouseLeave: _propTypes2['default'].func,
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
+ // accessibility props
+ isFocused: _propTypes2['default'].bool,
+ getFirstFocusableDay: _propTypes2['default'].func,
+ onBlur: _propTypes2['default'].func,
+ showKeyboardShortcuts: _propTypes2['default'].bool,
- return arr2;
-}
+ // internationalization
+ monthFormat: _propTypes2['default'].string,
+ weekDayFormat: _propTypes2['default'].string,
+ phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerPhrases)),
+ dayAriaLabelFormat: _propTypes2['default'].string
+}));
-function _createForOfIteratorHelperLoose(o, allowArrayLike) {
- var it;
+var defaultProps = exports.defaultProps = {
+ // calendar presentation props
+ enableOutsideDays: false,
+ numberOfMonths: 2,
+ orientation: _constants.HORIZONTAL_ORIENTATION,
+ withPortal: false,
+ onOutsideClick: function () {
+ function onOutsideClick() {}
- if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
- if (it) o = it;
- var i = 0;
- return function () {
- if (i >= o.length) return {
- done: true
- };
- return {
- done: false,
- value: o[i++]
- };
- };
- }
+ return onOutsideClick;
+ }(),
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
+ hidden: false,
+ initialVisibleMonth: function () {
+ function initialVisibleMonth() {
+ return (0, _moment2['default'])();
+ }
- it = o[Symbol.iterator]();
- return it.next.bind(it);
-}
+ return initialVisibleMonth;
+ }(),
+ firstDayOfWeek: null,
+ renderCalendarInfo: null,
+ calendarInfoPosition: _constants.INFO_POSITION_BOTTOM,
+ hideKeyboardShortcutsPanel: false,
+ daySize: _constants.DAY_SIZE,
+ isRTL: false,
+ verticalHeight: null,
+ noBorder: false,
+ transitionDuration: undefined,
+ verticalBorderSpacing: undefined,
+ horizontalMonthPadding: 13,
+ // navigation props
+ navPrev: null,
+ navNext: null,
+ noNavButtons: false,
+ onPrevMonthClick: function () {
+ function onPrevMonthClick() {}
+ return onPrevMonthClick;
+ }(),
+ onNextMonthClick: function () {
+ function onNextMonthClick() {}
+ return onNextMonthClick;
+ }(),
+ onMonthChange: function () {
+ function onMonthChange() {}
-/***/ }),
+ return onMonthChange;
+ }(),
+ onYearChange: function () {
+ function onYearChange() {}
-/***/ "IVEb":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ return onYearChange;
+ }(),
+ onMultiplyScrollableMonths: function () {
+ function onMultiplyScrollableMonths() {}
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useCreateElement; });
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _SystemContext_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("eUCI");
-/* harmony import */ var _rollupPluginBabelHelpers_0c84a174_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("RDTF");
+ return onMultiplyScrollableMonths;
+ }(),
+ // month props
+ renderMonthText: null,
+ renderMonthElement: null,
+ // day props
+ modifiers: {},
+ renderCalendarDay: undefined,
+ renderDayContents: null,
+ onDayClick: function () {
+ function onDayClick() {}
-function isRenderProp(children) {
- return typeof children === "function";
-}
+ return onDayClick;
+ }(),
+ onDayMouseEnter: function () {
+ function onDayMouseEnter() {}
-/**
- * Custom hook that will call `children` if it's a function. If
- * `useCreateElement` has been passed to the context, it'll be used instead.
- *
- * @example
- * import React from "react";
- * import { SystemProvider, useCreateElement } from "reakit-system";
- *
- * const system = {
- * useCreateElement(type, props, children = props.children) {
- * // very similar to what `useCreateElement` does already
- * if (typeof children === "function") {
- * const { children: _, ...rest } = props;
- * return children(rest);
- * }
- * return React.createElement(type, props, children);
- * },
- * };
- *
- * function Component(props) {
- * return useCreateElement("div", props);
- * }
- *
- * function App() {
- * return (
- * <SystemProvider unstable_system={system}>
- * <Component url="url">{({ url }) => <a href={url}>link</a>}</Component>
- * </SystemProvider>
- * );
- * }
- */
+ return onDayMouseEnter;
+ }(),
+ onDayMouseLeave: function () {
+ function onDayMouseLeave() {}
-var useCreateElement = function useCreateElement(type, props, children) {
- if (children === void 0) {
- children = props.children;
- }
+ return onDayMouseLeave;
+ }(),
- var context = Object(react__WEBPACK_IMPORTED_MODULE_0__["useContext"])(_SystemContext_js__WEBPACK_IMPORTED_MODULE_1__[/* SystemContext */ "a"]);
- if (context.useCreateElement) {
- return context.useCreateElement(type, props, children);
- }
+ // accessibility props
+ isFocused: false,
+ getFirstFocusableDay: null,
+ onBlur: function () {
+ function onBlur() {}
- if (typeof type === "string" && isRenderProp(children)) {
- var _ = props.children,
- rest = Object(_rollupPluginBabelHelpers_0c84a174_js__WEBPACK_IMPORTED_MODULE_2__[/* a */ "b"])(props, ["children"]);
+ return onBlur;
+ }(),
- return children(rest);
- }
+ showKeyboardShortcuts: false,
- return /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(type, props, children);
+ // internationalization
+ monthFormat: 'MMMM YYYY',
+ weekDayFormat: 'dd',
+ phrases: _defaultPhrases.DayPickerPhrases,
+ dayAriaLabelFormat: undefined
};
+var DayPicker = function (_React$Component) {
+ _inherits(DayPicker, _React$Component);
+ function DayPicker(props) {
+ _classCallCheck(this, DayPicker);
+ var _this = _possibleConstructorReturn(this, (DayPicker.__proto__ || Object.getPrototypeOf(DayPicker)).call(this, props));
-/***/ }),
+ var currentMonth = props.hidden ? (0, _moment2['default'])() : props.initialVisibleMonth();
-/***/ "IdCN":
-/***/ (function(module, exports, __webpack_require__) {
+ var focusedDate = currentMonth.clone().startOf('month');
+ if (props.getFirstFocusableDay) {
+ focusedDate = props.getFirstFocusableDay(currentMonth);
+ }
-"use strict";
+ var horizontalMonthPadding = props.horizontalMonthPadding;
-var fnToStr = Function.prototype.toString;
-var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
-var badArrayLike;
-var isCallableMarker;
-if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
- try {
- badArrayLike = Object.defineProperty({}, 'length', {
- get: function () {
- throw isCallableMarker;
- }
- });
- isCallableMarker = {};
- // eslint-disable-next-line no-throw-literal
- reflectApply(function () { throw 42; }, null, badArrayLike);
- } catch (_) {
- if (_ !== isCallableMarker) {
- reflectApply = null;
- }
- }
-} else {
- reflectApply = null;
-}
+ var translationValue = props.isRTL && _this.isHorizontal() ? -(0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding) : 0;
-var constructorRegex = /^\s*class\b/;
-var isES6ClassFn = function isES6ClassFunction(value) {
- try {
- var fnStr = fnToStr.call(value);
- return constructorRegex.test(fnStr);
- } catch (e) {
- return false; // not a function
- }
-};
+ _this.hasSetInitialVisibleMonth = !props.hidden;
+ _this.state = {
+ currentMonth: currentMonth,
+ monthTransition: null,
+ translationValue: translationValue,
+ scrollableMonthMultiple: 1,
+ calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding),
+ focusedDate: !props.hidden || props.isFocused ? focusedDate : null,
+ nextFocusedDate: null,
+ showKeyboardShortcuts: props.showKeyboardShortcuts,
+ onKeyboardShortcutsPanelClose: function () {
+ function onKeyboardShortcutsPanelClose() {}
-var tryFunctionObject = function tryFunctionToStr(value) {
- try {
- if (isES6ClassFn(value)) { return false; }
- fnToStr.call(value);
- return true;
- } catch (e) {
- return false;
- }
-};
-var toStr = Object.prototype.toString;
-var fnClass = '[object Function]';
-var genClass = '[object GeneratorFunction]';
-var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
+ return onKeyboardShortcutsPanelClose;
+ }(),
-module.exports = reflectApply
- ? function isCallable(value) {
- if (!value) { return false; }
- if (typeof value !== 'function' && typeof value !== 'object') { return false; }
- if (typeof value === 'function' && !value.prototype) { return true; }
- try {
- reflectApply(value, null, badArrayLike);
- } catch (e) {
- if (e !== isCallableMarker) { return false; }
- }
- return !isES6ClassFn(value);
- }
- : function isCallable(value) {
- if (!value) { return false; }
- if (typeof value !== 'function' && typeof value !== 'object') { return false; }
- if (typeof value === 'function' && !value.prototype) { return true; }
- if (hasToStringTag) { return tryFunctionObject(value); }
- if (isES6ClassFn(value)) { return false; }
- var strClass = toStr.call(value);
- return strClass === fnClass || strClass === genClass;
- };
+ isTouchDevice: (0, _isTouchDevice2['default'])(),
+ withMouseInteractions: true,
+ calendarInfoWidth: 0,
+ monthTitleHeight: null,
+ hasSetHeight: false
+ };
+ _this.setCalendarMonthWeeks(currentMonth);
-/***/ }),
+ _this.calendarMonthGridHeight = 0;
+ _this.setCalendarInfoWidthTimeout = null;
-/***/ "IgE5":
-/***/ (function(module, exports, __webpack_require__) {
+ _this.onKeyDown = _this.onKeyDown.bind(_this);
+ _this.throttledKeyDown = (0, _throttle2['default'])(_this.onFinalKeyDown, 200, { trailing: false });
+ _this.onPrevMonthClick = _this.onPrevMonthClick.bind(_this);
+ _this.onNextMonthClick = _this.onNextMonthClick.bind(_this);
+ _this.onMonthChange = _this.onMonthChange.bind(_this);
+ _this.onYearChange = _this.onYearChange.bind(_this);
-"use strict";
+ _this.multiplyScrollableMonths = _this.multiplyScrollableMonths.bind(_this);
+ _this.updateStateAfterMonthTransition = _this.updateStateAfterMonthTransition.bind(_this);
+ _this.openKeyboardShortcutsPanel = _this.openKeyboardShortcutsPanel.bind(_this);
+ _this.closeKeyboardShortcutsPanel = _this.closeKeyboardShortcutsPanel.bind(_this);
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports['default'] = isDayVisible;
+ _this.setCalendarInfoRef = _this.setCalendarInfoRef.bind(_this);
+ _this.setContainerRef = _this.setContainerRef.bind(_this);
+ _this.setTransitionContainerRef = _this.setTransitionContainerRef.bind(_this);
+ _this.setMonthTitleHeight = _this.setMonthTitleHeight.bind(_this);
+ return _this;
+ }
-var _isBeforeDay = __webpack_require__("h6xH");
+ _createClass(DayPicker, [{
+ key: 'componentDidMount',
+ value: function () {
+ function componentDidMount() {
+ var currentMonth = this.state.currentMonth;
-var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
-
-var _isAfterDay = __webpack_require__("Nho6");
-
-var _isAfterDay2 = _interopRequireDefault(_isAfterDay);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+ if (this.calendarInfo) {
+ this.setState({
+ isTouchDevice: (0, _isTouchDevice2['default'])(),
+ calendarInfoWidth: (0, _calculateDimension2['default'])(this.calendarInfo, 'width', true, true)
+ });
+ } else {
+ this.setState({ isTouchDevice: (0, _isTouchDevice2['default'])() });
+ }
-function isDayVisible(day, month, numberOfMonths, enableOutsideDays) {
- var firstDayOfFirstMonth = month.clone().startOf('month');
- if (enableOutsideDays) firstDayOfFirstMonth = firstDayOfFirstMonth.startOf('week');
- if ((0, _isBeforeDay2['default'])(day, firstDayOfFirstMonth)) return false;
+ this.setCalendarMonthWeeks(currentMonth);
+ }
- var lastDayOfLastMonth = month.clone().add(numberOfMonths - 1, 'months').endOf('month');
- if (enableOutsideDays) lastDayOfLastMonth = lastDayOfLastMonth.endOf('week');
- return !(0, _isAfterDay2['default'])(day, lastDayOfLastMonth);
-}
+ return componentDidMount;
+ }()
+ }, {
+ key: 'componentWillReceiveProps',
+ value: function () {
+ function componentWillReceiveProps(nextProps) {
+ var hidden = nextProps.hidden,
+ isFocused = nextProps.isFocused,
+ showKeyboardShortcuts = nextProps.showKeyboardShortcuts,
+ onBlur = nextProps.onBlur,
+ renderMonthText = nextProps.renderMonthText,
+ horizontalMonthPadding = nextProps.horizontalMonthPadding;
+ var currentMonth = this.state.currentMonth;
-/***/ }),
-/***/ "J2ba":
-/***/ (function(module, exports, __webpack_require__) {
+ if (!hidden) {
+ if (!this.hasSetInitialVisibleMonth) {
+ this.hasSetInitialVisibleMonth = true;
+ this.setState({
+ currentMonth: nextProps.initialVisibleMonth()
+ });
+ }
+ }
-"use strict";
+ var _props = this.props,
+ daySize = _props.daySize,
+ prevIsFocused = _props.isFocused,
+ prevRenderMonthText = _props.renderMonthText;
-var abs = __webpack_require__("S8ty");
-var floor = __webpack_require__("8sMu");
-var Type = __webpack_require__("PoQ0");
+ if (nextProps.daySize !== daySize) {
+ this.setState({
+ calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(nextProps.daySize, horizontalMonthPadding)
+ });
+ }
-var $isNaN = __webpack_require__("HwJD");
-var $isFinite = __webpack_require__("ald4");
+ if (isFocused !== prevIsFocused) {
+ if (isFocused) {
+ var focusedDate = this.getFocusedDay(currentMonth);
-// https://tc39.es/ecma262/#sec-isintegralnumber
+ var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose;
-module.exports = function IsIntegralNumber(argument) {
- if (Type(argument) !== 'Number' || $isNaN(argument) || !$isFinite(argument)) {
- return false;
- }
- var absValue = abs(argument);
- return floor(absValue) === absValue;
-};
+ if (nextProps.showKeyboardShortcuts) {
+ // the ? shortcut came from the input and we should return input there once it is close
+ onKeyboardShortcutsPanelClose = onBlur;
+ }
+ this.setState({
+ showKeyboardShortcuts: showKeyboardShortcuts,
+ onKeyboardShortcutsPanelClose: onKeyboardShortcutsPanelClose,
+ focusedDate: focusedDate,
+ withMouseInteractions: false
+ });
+ } else {
+ this.setState({ focusedDate: null });
+ }
+ }
-/***/ }),
+ if (renderMonthText !== prevRenderMonthText) {
+ this.setState({
+ monthTitleHeight: null
+ });
+ }
+ }
-/***/ "J7JS":
-/***/ (function(module, exports, __webpack_require__) {
+ return componentWillReceiveProps;
+ }()
+ }, {
+ key: 'shouldComponentUpdate',
+ value: function () {
+ function shouldComponentUpdate(nextProps, nextState) {
+ return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
+ }
-"use strict";
+ return shouldComponentUpdate;
+ }()
+ }, {
+ key: 'componentWillUpdate',
+ value: function () {
+ function componentWillUpdate() {
+ var _this2 = this;
+ var transitionDuration = this.props.transitionDuration;
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
+ // Calculating the dimensions trigger a DOM repaint which
+ // breaks the CSS transition.
+ // The setTimeout will wait until the transition ends.
-var _propTypes = __webpack_require__("17x9");
+ if (this.calendarInfo) {
+ this.setCalendarInfoWidthTimeout = setTimeout(function () {
+ var calendarInfoWidth = _this2.state.calendarInfoWidth;
-var _propTypes2 = _interopRequireDefault(_propTypes);
+ var calendarInfoPanelWidth = (0, _calculateDimension2['default'])(_this2.calendarInfo, 'width', true, true);
+ if (calendarInfoWidth !== calendarInfoPanelWidth) {
+ _this2.setState({
+ calendarInfoWidth: calendarInfoPanelWidth
+ });
+ }
+ }, transitionDuration);
+ }
+ }
-var _airbnbPropTypes = __webpack_require__("Hsqg");
+ return componentWillUpdate;
+ }()
+ }, {
+ key: 'componentDidUpdate',
+ value: function () {
+ function componentDidUpdate(prevProps) {
+ var _props2 = this.props,
+ orientation = _props2.orientation,
+ daySize = _props2.daySize,
+ isFocused = _props2.isFocused,
+ numberOfMonths = _props2.numberOfMonths;
+ var _state = this.state,
+ focusedDate = _state.focusedDate,
+ monthTitleHeight = _state.monthTitleHeight;
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+ if (this.isHorizontal() && (orientation !== prevProps.orientation || daySize !== prevProps.daySize)) {
+ var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1);
+ var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
+ var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1;
+ this.adjustDayPickerHeight(newMonthHeight);
+ }
-function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
+ if (!prevProps.isFocused && isFocused && !focusedDate) {
+ this.container.focus();
+ }
+ }
-exports['default'] = (0, _airbnbPropTypes.and)([_propTypes2['default'].instanceOf(Set), function () {
- function modifiers(props, propName) {
- for (var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
- rest[_key - 2] = arguments[_key];
- }
+ return componentDidUpdate;
+ }()
+ }, {
+ key: 'componentWillUnmount',
+ value: function () {
+ function componentWillUnmount() {
+ clearTimeout(this.setCalendarInfoWidthTimeout);
+ }
- var propValue = props[propName];
+ return componentWillUnmount;
+ }()
+ }, {
+ key: 'onKeyDown',
+ value: function () {
+ function onKeyDown(e) {
+ e.stopPropagation();
+ if (!_constants.MODIFIER_KEY_NAMES.has(e.key)) {
+ this.throttledKeyDown(e);
+ }
+ }
- var firstError = void 0;
- [].concat(_toConsumableArray(propValue)).some(function (v, i) {
- var _PropTypes$string;
+ return onKeyDown;
+ }()
+ }, {
+ key: 'onFinalKeyDown',
+ value: function () {
+ function onFinalKeyDown(e) {
+ this.setState({ withMouseInteractions: false });
- var fakePropName = String(propName) + ': index ' + String(i);
- firstError = (_PropTypes$string = _propTypes2['default'].string).isRequired.apply(_PropTypes$string, [_defineProperty({}, fakePropName, v), fakePropName].concat(rest));
- return firstError != null;
- });
- return firstError == null ? null : firstError;
- }
+ var _props3 = this.props,
+ onBlur = _props3.onBlur,
+ isRTL = _props3.isRTL;
+ var _state2 = this.state,
+ focusedDate = _state2.focusedDate,
+ showKeyboardShortcuts = _state2.showKeyboardShortcuts;
- return modifiers;
-}()], 'Modifiers (Set of Strings)');
+ if (!focusedDate) return;
-/***/ }),
+ var newFocusedDate = focusedDate.clone();
-/***/ "JLmN":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ var didTransitionMonth = false;
-"use strict";
-/* unused harmony export Clickable */
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useClickable; });
-/* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("BZp5");
-/* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("hE48");
-/* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("qdes");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("cDcd");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("71Og");
-/* harmony import */ var reakit_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("KA1K");
-/* harmony import */ var reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("eNtd");
-/* harmony import */ var reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("k2cL");
-/* harmony import */ var _Tabbable_Tabbable_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("G3V0");
+ // focus might be anywhere when the keyboard shortcuts panel is opened so we want to
+ // return it to wherever it was before when the panel was opened
+ var activeElement = (0, _getActiveElement2['default'])();
+ var onKeyboardShortcutsPanelClose = function () {
+ function onKeyboardShortcutsPanelClose() {
+ if (activeElement) activeElement.focus();
+ }
+ return onKeyboardShortcutsPanelClose;
+ }();
+ switch (e.key) {
+ case 'ArrowUp':
+ e.preventDefault();
+ newFocusedDate.subtract(1, 'week');
+ didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
+ break;
+ case 'ArrowLeft':
+ e.preventDefault();
+ if (isRTL) {
+ newFocusedDate.add(1, 'day');
+ } else {
+ newFocusedDate.subtract(1, 'day');
+ }
+ didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
+ break;
+ case 'Home':
+ e.preventDefault();
+ newFocusedDate.startOf('week');
+ didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
+ break;
+ case 'PageUp':
+ e.preventDefault();
+ newFocusedDate.subtract(1, 'month');
+ didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
+ break;
+ case 'ArrowDown':
+ e.preventDefault();
+ newFocusedDate.add(1, 'week');
+ didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
+ break;
+ case 'ArrowRight':
+ e.preventDefault();
+ if (isRTL) {
+ newFocusedDate.subtract(1, 'day');
+ } else {
+ newFocusedDate.add(1, 'day');
+ }
+ didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
+ break;
+ case 'End':
+ e.preventDefault();
+ newFocusedDate.endOf('week');
+ didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
+ break;
+ case 'PageDown':
+ e.preventDefault();
+ newFocusedDate.add(1, 'month');
+ didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
+ break;
+ case '?':
+ this.openKeyboardShortcutsPanel(onKeyboardShortcutsPanelClose);
+ break;
+ case 'Escape':
+ if (showKeyboardShortcuts) {
+ this.closeKeyboardShortcutsPanel();
+ } else {
+ onBlur();
+ }
+ break;
+ default:
+ break;
+ }
+ // If there was a month transition, do not update the focused date until the transition has
+ // completed. Otherwise, attempting to focus on a DOM node may interrupt the CSS animation. If
+ // didTransitionMonth is true, the focusedDate gets updated in #updateStateAfterMonthTransition
+ if (!didTransitionMonth) {
+ this.setState({
+ focusedDate: newFocusedDate
+ });
+ }
+ }
+ return onFinalKeyDown;
+ }()
+ }, {
+ key: 'onPrevMonthClick',
+ value: function () {
+ function onPrevMonthClick(nextFocusedDate, e) {
+ var _props4 = this.props,
+ daySize = _props4.daySize,
+ isRTL = _props4.isRTL,
+ numberOfMonths = _props4.numberOfMonths;
+ var _state3 = this.state,
+ calendarMonthWidth = _state3.calendarMonthWidth,
+ monthTitleHeight = _state3.monthTitleHeight;
+ if (e) e.preventDefault();
+ var translationValue = void 0;
+ if (this.isVertical()) {
+ var calendarMonthWeeksHeight = this.calendarMonthWeeks[0] * (daySize - 1);
+ translationValue = monthTitleHeight + calendarMonthWeeksHeight + 1;
+ } else if (this.isHorizontal()) {
+ translationValue = calendarMonthWidth;
+ if (isRTL) {
+ translationValue = -2 * calendarMonthWidth;
+ }
+ var visibleCalendarWeeks = this.calendarMonthWeeks.slice(0, numberOfMonths);
+ var _calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
+ var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight + 1;
+ this.adjustDayPickerHeight(newMonthHeight);
+ }
+ this.setState({
+ monthTransition: PREV_TRANSITION,
+ translationValue: translationValue,
+ focusedDate: null,
+ nextFocusedDate: nextFocusedDate
+ });
+ }
+ return onPrevMonthClick;
+ }()
+ }, {
+ key: 'onMonthChange',
+ value: function () {
+ function onMonthChange(currentMonth) {
+ this.setCalendarMonthWeeks(currentMonth);
+ this.calculateAndSetDayPickerHeight();
+ // Translation value is a hack to force an invisible transition that
+ // properly rerenders the CalendarMonthGrid
+ this.setState({
+ monthTransition: MONTH_SELECTION_TRANSITION,
+ translationValue: 0.00001,
+ focusedDate: null,
+ nextFocusedDate: currentMonth,
+ currentMonth: currentMonth
+ });
+ }
+ return onMonthChange;
+ }()
+ }, {
+ key: 'onYearChange',
+ value: function () {
+ function onYearChange(currentMonth) {
+ this.setCalendarMonthWeeks(currentMonth);
+ this.calculateAndSetDayPickerHeight();
+ // Translation value is a hack to force an invisible transition that
+ // properly rerenders the CalendarMonthGrid
+ this.setState({
+ monthTransition: YEAR_SELECTION_TRANSITION,
+ translationValue: 0.0001,
+ focusedDate: null,
+ nextFocusedDate: currentMonth,
+ currentMonth: currentMonth
+ });
+ }
-// Automatically generated
-var CLICKABLE_KEYS = ["unstable_clickOnEnter", "unstable_clickOnSpace"];
+ return onYearChange;
+ }()
+ }, {
+ key: 'onNextMonthClick',
+ value: function () {
+ function onNextMonthClick(nextFocusedDate, e) {
+ var _props5 = this.props,
+ isRTL = _props5.isRTL,
+ numberOfMonths = _props5.numberOfMonths,
+ daySize = _props5.daySize;
+ var _state4 = this.state,
+ calendarMonthWidth = _state4.calendarMonthWidth,
+ monthTitleHeight = _state4.monthTitleHeight;
-function isNativeClick(event) {
- var element = event.currentTarget;
- if (!event.isTrusted) return false; // istanbul ignore next: can't test trusted events yet
- return Object(reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_4__[/* isButton */ "a"])(element) || element.tagName === "INPUT" || element.tagName === "TEXTAREA" || element.tagName === "A" || element.tagName === "SELECT";
-}
+ if (e) e.preventDefault();
-var useClickable = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({
- name: "Clickable",
- compose: _Tabbable_Tabbable_js__WEBPACK_IMPORTED_MODULE_8__[/* useTabbable */ "a"],
- keys: CLICKABLE_KEYS,
- useOptions: function useOptions(_ref) {
- var _ref$unstable_clickOn = _ref.unstable_clickOnEnter,
- unstable_clickOnEnter = _ref$unstable_clickOn === void 0 ? true : _ref$unstable_clickOn,
- _ref$unstable_clickOn2 = _ref.unstable_clickOnSpace,
- unstable_clickOnSpace = _ref$unstable_clickOn2 === void 0 ? true : _ref$unstable_clickOn2,
- options = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_ref, ["unstable_clickOnEnter", "unstable_clickOnSpace"]);
+ var translationValue = void 0;
- return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({
- unstable_clickOnEnter: unstable_clickOnEnter,
- unstable_clickOnSpace: unstable_clickOnSpace
- }, options);
- },
- useProps: function useProps(options, _ref2) {
- var htmlOnKeyDown = _ref2.onKeyDown,
- htmlOnKeyUp = _ref2.onKeyUp,
- htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_ref2, ["onKeyDown", "onKeyUp"]);
+ if (this.isVertical()) {
+ var firstVisibleMonthWeeks = this.calendarMonthWeeks[1];
+ var calendarMonthWeeksHeight = firstVisibleMonthWeeks * (daySize - 1);
+ translationValue = -(monthTitleHeight + calendarMonthWeeksHeight + 1);
+ }
- var _React$useState = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(false),
- active = _React$useState[0],
- setActive = _React$useState[1];
+ if (this.isHorizontal()) {
+ translationValue = -calendarMonthWidth;
+ if (isRTL) {
+ translationValue = 0;
+ }
- var onKeyDownRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnKeyDown);
- var onKeyUpRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnKeyUp);
- var onKeyDown = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) {
- var _onKeyDownRef$current;
+ var visibleCalendarWeeks = this.calendarMonthWeeks.slice(2, numberOfMonths + 2);
+ var _calendarMonthWeeksHeight2 = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
+ var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight2 + 1;
+ this.adjustDayPickerHeight(newMonthHeight);
+ }
- (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event);
- if (event.defaultPrevented) return;
- if (options.disabled) return;
- if (event.metaKey) return;
- if (!Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__[/* isSelfTarget */ "a"])(event)) return;
- var isEnter = options.unstable_clickOnEnter && event.key === "Enter";
- var isSpace = options.unstable_clickOnSpace && event.key === " ";
+ this.setState({
+ monthTransition: NEXT_TRANSITION,
+ translationValue: translationValue,
+ focusedDate: null,
+ nextFocusedDate: nextFocusedDate
+ });
+ }
- if (isEnter || isSpace) {
- if (isNativeClick(event)) return;
- event.preventDefault();
+ return onNextMonthClick;
+ }()
+ }, {
+ key: 'getFirstDayOfWeek',
+ value: function () {
+ function getFirstDayOfWeek() {
+ var firstDayOfWeek = this.props.firstDayOfWeek;
- if (isEnter) {
- event.currentTarget.click();
- } else if (isSpace) {
- setActive(true);
+ if (firstDayOfWeek == null) {
+ return _moment2['default'].localeData().firstDayOfWeek();
}
- }
- }, [options.disabled, options.unstable_clickOnEnter, options.unstable_clickOnSpace]);
- var onKeyUp = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) {
- var _onKeyUpRef$current;
-
- (_onKeyUpRef$current = onKeyUpRef.current) === null || _onKeyUpRef$current === void 0 ? void 0 : _onKeyUpRef$current.call(onKeyUpRef, event);
- if (event.defaultPrevented) return;
- if (options.disabled) return;
- if (event.metaKey) return;
- var isSpace = options.unstable_clickOnSpace && event.key === " ";
- if (active && isSpace) {
- setActive(false);
- event.currentTarget.click();
+ return firstDayOfWeek;
}
- }, [options.disabled, options.unstable_clickOnSpace, active]);
- return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({
- "data-active": active || undefined,
- onKeyDown: onKeyDown,
- onKeyUp: onKeyUp
- }, htmlProps);
- }
-});
-var Clickable = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({
- as: "button",
- memo: true,
- useHook: useClickable
-});
-
+ return getFirstDayOfWeek;
+ }()
+ }, {
+ key: 'getFirstVisibleIndex',
+ value: function () {
+ function getFirstVisibleIndex() {
+ var orientation = this.props.orientation;
+ var monthTransition = this.state.monthTransition;
-/***/ }),
+ if (orientation === _constants.VERTICAL_SCROLLABLE) return 0;
-/***/ "JYkG":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ var firstVisibleMonthIndex = 1;
+ if (monthTransition === PREV_TRANSITION) {
+ firstVisibleMonthIndex -= 1;
+ } else if (monthTransition === NEXT_TRANSITION) {
+ firstVisibleMonthIndex += 1;
+ }
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/* 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_warning__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Z23Y");
-/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_1__);
-// @ts-nocheck
+ return firstVisibleMonthIndex;
+ }
-/**
- * WordPress dependencies
- */
+ return getFirstVisibleIndex;
+ }()
+ }, {
+ key: 'getFocusedDay',
+ value: function () {
+ function getFocusedDay(newMonth) {
+ var _props6 = this.props,
+ getFirstFocusableDay = _props6.getFirstFocusableDay,
+ numberOfMonths = _props6.numberOfMonths;
-const SlotFillContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])({
- slots: {},
- fills: {},
- registerSlot: () => {
- typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_1___default()('Components must be wrapped within `SlotFillProvider`. ' + 'See https://developer.wordpress.org/block-editor/components/slot-fill/') : void 0;
- },
- updateSlot: () => {},
- unregisterSlot: () => {},
- registerFill: () => {},
- unregisterFill: () => {}
-});
-/* harmony default export */ __webpack_exports__["a"] = (SlotFillContext);
+ var focusedDate = void 0;
+ if (getFirstFocusableDay) {
+ focusedDate = getFirstFocusableDay(newMonth);
+ }
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB")))
+ if (newMonth && (!focusedDate || !(0, _isDayVisible2['default'])(focusedDate, newMonth, numberOfMonths))) {
+ focusedDate = newMonth.clone().startOf('month');
+ }
-/***/ }),
+ return focusedDate;
+ }
-/***/ "Jt44":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-// TODO: remove, semver-major
-
-module.exports = __webpack_require__("j1Hc");
+ return getFocusedDay;
+ }()
+ }, {
+ key: 'setMonthTitleHeight',
+ value: function () {
+ function setMonthTitleHeight(monthTitleHeight) {
+ var _this3 = this;
+ this.setState({
+ monthTitleHeight: monthTitleHeight
+ }, function () {
+ _this3.calculateAndSetDayPickerHeight();
+ });
+ }
-/***/ }),
+ return setMonthTitleHeight;
+ }()
+ }, {
+ key: 'setCalendarMonthWeeks',
+ value: function () {
+ function setCalendarMonthWeeks(currentMonth) {
+ var numberOfMonths = this.props.numberOfMonths;
-/***/ "Jx1U":
-/***/ (function(module, exports) {
-// Copyright (c) 2014 Rafael Caricio. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
+ this.calendarMonthWeeks = [];
+ var month = currentMonth.clone().subtract(1, 'months');
+ var firstDayOfWeek = this.getFirstDayOfWeek();
+ for (var i = 0; i < numberOfMonths + 2; i += 1) {
+ var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(month, firstDayOfWeek);
+ this.calendarMonthWeeks.push(numberOfWeeks);
+ month = month.add(1, 'months');
+ }
+ }
-var GradientParser = {};
+ return setCalendarMonthWeeks;
+ }()
+ }, {
+ key: 'setContainerRef',
+ value: function () {
+ function setContainerRef(ref) {
+ this.container = ref;
+ }
-GradientParser.parse = (function() {
+ return setContainerRef;
+ }()
+ }, {
+ key: 'setCalendarInfoRef',
+ value: function () {
+ function setCalendarInfoRef(ref) {
+ this.calendarInfo = ref;
+ }
- var tokens = {
- linearGradient: /^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,
- repeatingLinearGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,
- radialGradient: /^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,
- repeatingRadialGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,
- sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,
- extentKeywords: /^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,
- positionKeywords: /^(left|center|right|top|bottom)/i,
- pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,
- percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,
- emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,
- angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,
- startCall: /^\(/,
- endCall: /^\)/,
- comma: /^,/,
- hexColor: /^\#([0-9a-fA-F]+)/,
- literalColor: /^([a-zA-Z]+)/,
- rgbColor: /^rgb/i,
- rgbaColor: /^rgba/i,
- number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/
- };
+ return setCalendarInfoRef;
+ }()
+ }, {
+ key: 'setTransitionContainerRef',
+ value: function () {
+ function setTransitionContainerRef(ref) {
+ this.transitionContainer = ref;
+ }
- var input = '';
+ return setTransitionContainerRef;
+ }()
+ }, {
+ key: 'maybeTransitionNextMonth',
+ value: function () {
+ function maybeTransitionNextMonth(newFocusedDate) {
+ var numberOfMonths = this.props.numberOfMonths;
+ var _state5 = this.state,
+ currentMonth = _state5.currentMonth,
+ focusedDate = _state5.focusedDate;
- function error(msg) {
- var err = new Error(input + ': ' + msg);
- err.source = input;
- throw err;
- }
- function getAST() {
- var ast = matchListDefinitions();
+ var newFocusedDateMonth = newFocusedDate.month();
+ var focusedDateMonth = focusedDate.month();
+ var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths);
+ if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) {
+ this.onNextMonthClick(newFocusedDate);
+ return true;
+ }
- if (input.length > 0) {
- error('Invalid input not EOF');
- }
+ return false;
+ }
- return ast;
- }
+ return maybeTransitionNextMonth;
+ }()
+ }, {
+ key: 'maybeTransitionPrevMonth',
+ value: function () {
+ function maybeTransitionPrevMonth(newFocusedDate) {
+ var numberOfMonths = this.props.numberOfMonths;
+ var _state6 = this.state,
+ currentMonth = _state6.currentMonth,
+ focusedDate = _state6.focusedDate;
- function matchListDefinitions() {
- return matchListing(matchDefinition);
- }
- function matchDefinition() {
- return matchGradient(
- 'linear-gradient',
- tokens.linearGradient,
- matchLinearOrientation) ||
+ var newFocusedDateMonth = newFocusedDate.month();
+ var focusedDateMonth = focusedDate.month();
+ var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths);
+ if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) {
+ this.onPrevMonthClick(newFocusedDate);
+ return true;
+ }
- matchGradient(
- 'repeating-linear-gradient',
- tokens.repeatingLinearGradient,
- matchLinearOrientation) ||
+ return false;
+ }
- matchGradient(
- 'radial-gradient',
- tokens.radialGradient,
- matchListRadialOrientations) ||
+ return maybeTransitionPrevMonth;
+ }()
+ }, {
+ key: 'multiplyScrollableMonths',
+ value: function () {
+ function multiplyScrollableMonths(e) {
+ var onMultiplyScrollableMonths = this.props.onMultiplyScrollableMonths;
- matchGradient(
- 'repeating-radial-gradient',
- tokens.repeatingRadialGradient,
- matchListRadialOrientations);
- }
+ if (e) e.preventDefault();
- function matchGradient(gradientType, pattern, orientationMatcher) {
- return matchCall(pattern, function(captures) {
+ if (onMultiplyScrollableMonths) onMultiplyScrollableMonths(e);
- var orientation = orientationMatcher();
- if (orientation) {
- if (!scan(tokens.comma)) {
- error('Missing comma before color stops');
- }
+ this.setState(function (_ref) {
+ var scrollableMonthMultiple = _ref.scrollableMonthMultiple;
+ return {
+ scrollableMonthMultiple: scrollableMonthMultiple + 1
+ };
+ });
}
- return {
- type: gradientType,
- orientation: orientation,
- colorStops: matchListing(matchColorStop)
- };
- });
- }
-
- function matchCall(pattern, callback) {
- var captures = scan(pattern);
+ return multiplyScrollableMonths;
+ }()
+ }, {
+ key: 'isHorizontal',
+ value: function () {
+ function isHorizontal() {
+ var orientation = this.props.orientation;
- if (captures) {
- if (!scan(tokens.startCall)) {
- error('Missing (');
+ return orientation === _constants.HORIZONTAL_ORIENTATION;
}
- result = callback(captures);
+ return isHorizontal;
+ }()
+ }, {
+ key: 'isVertical',
+ value: function () {
+ function isVertical() {
+ var orientation = this.props.orientation;
- if (!scan(tokens.endCall)) {
- error('Missing )');
+ return orientation === _constants.VERTICAL_ORIENTATION || orientation === _constants.VERTICAL_SCROLLABLE;
}
- return result;
- }
- }
-
- function matchLinearOrientation() {
- return matchSideOrCorner() ||
- matchAngle();
- }
+ return isVertical;
+ }()
+ }, {
+ key: 'updateStateAfterMonthTransition',
+ value: function () {
+ function updateStateAfterMonthTransition() {
+ var _this4 = this;
- function matchSideOrCorner() {
- return match('directional', tokens.sideOrCorner, 1);
- }
+ var _props7 = this.props,
+ onPrevMonthClick = _props7.onPrevMonthClick,
+ onNextMonthClick = _props7.onNextMonthClick,
+ numberOfMonths = _props7.numberOfMonths,
+ onMonthChange = _props7.onMonthChange,
+ onYearChange = _props7.onYearChange,
+ isRTL = _props7.isRTL;
+ var _state7 = this.state,
+ currentMonth = _state7.currentMonth,
+ monthTransition = _state7.monthTransition,
+ focusedDate = _state7.focusedDate,
+ nextFocusedDate = _state7.nextFocusedDate,
+ withMouseInteractions = _state7.withMouseInteractions,
+ calendarMonthWidth = _state7.calendarMonthWidth;
- function matchAngle() {
- return match('angular', tokens.angleValue, 1);
- }
- function matchListRadialOrientations() {
- var radialOrientations,
- radialOrientation = matchRadialOrientation(),
- lookaheadCache;
+ if (!monthTransition) return;
- if (radialOrientation) {
- radialOrientations = [];
- radialOrientations.push(radialOrientation);
+ var newMonth = currentMonth.clone();
+ var firstDayOfWeek = this.getFirstDayOfWeek();
+ if (monthTransition === PREV_TRANSITION) {
+ newMonth.subtract(1, 'month');
+ if (onPrevMonthClick) onPrevMonthClick(newMonth);
+ var newInvisibleMonth = newMonth.clone().subtract(1, 'month');
+ var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(newInvisibleMonth, firstDayOfWeek);
+ this.calendarMonthWeeks = [numberOfWeeks].concat(_toConsumableArray(this.calendarMonthWeeks.slice(0, -1)));
+ } else if (monthTransition === NEXT_TRANSITION) {
+ newMonth.add(1, 'month');
+ if (onNextMonthClick) onNextMonthClick(newMonth);
+ var _newInvisibleMonth = newMonth.clone().add(numberOfMonths, 'month');
+ var _numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(_newInvisibleMonth, firstDayOfWeek);
+ this.calendarMonthWeeks = [].concat(_toConsumableArray(this.calendarMonthWeeks.slice(1)), [_numberOfWeeks]);
+ } else if (monthTransition === MONTH_SELECTION_TRANSITION) {
+ if (onMonthChange) onMonthChange(newMonth);
+ } else if (monthTransition === YEAR_SELECTION_TRANSITION) {
+ if (onYearChange) onYearChange(newMonth);
+ }
- lookaheadCache = input;
- if (scan(tokens.comma)) {
- radialOrientation = matchRadialOrientation();
- if (radialOrientation) {
- radialOrientations.push(radialOrientation);
- } else {
- input = lookaheadCache;
+ var newFocusedDate = null;
+ if (nextFocusedDate) {
+ newFocusedDate = nextFocusedDate;
+ } else if (!focusedDate && !withMouseInteractions) {
+ newFocusedDate = this.getFocusedDay(newMonth);
}
- }
- }
- return radialOrientations;
- }
+ this.setState({
+ currentMonth: newMonth,
+ monthTransition: null,
+ translationValue: isRTL && this.isHorizontal() ? -calendarMonthWidth : 0,
+ nextFocusedDate: null,
+ focusedDate: newFocusedDate
+ }, function () {
+ // we don't want to focus on the relevant calendar day after a month transition
+ // if the user is navigating around using a mouse
+ if (withMouseInteractions) {
+ var activeElement = (0, _getActiveElement2['default'])();
+ if (activeElement && activeElement !== document.body && _this4.container.contains(activeElement)) {
+ activeElement.blur();
+ }
+ }
+ });
+ }
- function matchRadialOrientation() {
- var radialType = matchCircle() ||
- matchEllipse();
+ return updateStateAfterMonthTransition;
+ }()
+ }, {
+ key: 'adjustDayPickerHeight',
+ value: function () {
+ function adjustDayPickerHeight(newMonthHeight) {
+ var _this5 = this;
- if (radialType) {
- radialType.at = matchAtPosition();
- } else {
- var defaultPosition = matchPositioning();
- if (defaultPosition) {
- radialType = {
- type: 'default-radial',
- at: defaultPosition
- };
+ var monthHeight = newMonthHeight + MONTH_PADDING;
+ if (monthHeight !== this.calendarMonthGridHeight) {
+ this.transitionContainer.style.height = String(monthHeight) + 'px';
+ if (!this.calendarMonthGridHeight) {
+ setTimeout(function () {
+ _this5.setState({ hasSetHeight: true });
+ }, 0);
+ }
+ this.calendarMonthGridHeight = monthHeight;
+ }
}
- }
-
- return radialType;
- }
- function matchCircle() {
- var circle = match('shape', /^(circle)/i, 0);
+ return adjustDayPickerHeight;
+ }()
+ }, {
+ key: 'calculateAndSetDayPickerHeight',
+ value: function () {
+ function calculateAndSetDayPickerHeight() {
+ var _props8 = this.props,
+ daySize = _props8.daySize,
+ numberOfMonths = _props8.numberOfMonths;
+ var monthTitleHeight = this.state.monthTitleHeight;
- if (circle) {
- circle.style = matchLength() || matchExtentKeyword();
- }
- return circle;
- }
+ var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1);
+ var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
+ var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1;
- function matchEllipse() {
- var ellipse = match('shape', /^(ellipse)/i, 0);
+ if (this.isHorizontal()) {
+ this.adjustDayPickerHeight(newMonthHeight);
+ }
+ }
- if (ellipse) {
- ellipse.style = matchDistance() || matchExtentKeyword();
- }
+ return calculateAndSetDayPickerHeight;
+ }()
+ }, {
+ key: 'openKeyboardShortcutsPanel',
+ value: function () {
+ function openKeyboardShortcutsPanel(onCloseCallBack) {
+ this.setState({
+ showKeyboardShortcuts: true,
+ onKeyboardShortcutsPanelClose: onCloseCallBack
+ });
+ }
- return ellipse;
- }
+ return openKeyboardShortcutsPanel;
+ }()
+ }, {
+ key: 'closeKeyboardShortcutsPanel',
+ value: function () {
+ function closeKeyboardShortcutsPanel() {
+ var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose;
- function matchExtentKeyword() {
- return match('extent-keyword', tokens.extentKeywords, 1);
- }
- function matchAtPosition() {
- if (match('position', /^at/, 0)) {
- var positioning = matchPositioning();
+ if (onKeyboardShortcutsPanelClose) {
+ onKeyboardShortcutsPanelClose();
+ }
- if (!positioning) {
- error('Missing positioning value');
+ this.setState({
+ onKeyboardShortcutsPanelClose: null,
+ showKeyboardShortcuts: false
+ });
}
- return positioning;
- }
- }
-
- function matchPositioning() {
- var location = matchCoordinates();
+ return closeKeyboardShortcutsPanel;
+ }()
+ }, {
+ key: 'renderNavigation',
+ value: function () {
+ function renderNavigation() {
+ var _this6 = this;
- if (location.x || location.y) {
- return {
- type: 'position',
- value: location
- };
- }
- }
+ var _props9 = this.props,
+ navPrev = _props9.navPrev,
+ navNext = _props9.navNext,
+ noNavButtons = _props9.noNavButtons,
+ orientation = _props9.orientation,
+ phrases = _props9.phrases,
+ isRTL = _props9.isRTL;
- function matchCoordinates() {
- return {
- x: matchDistance(),
- y: matchDistance()
- };
- }
- function matchListing(matcher) {
- var captures = matcher(),
- result = [];
+ if (noNavButtons) {
+ return null;
+ }
- if (captures) {
- result.push(captures);
- while (scan(tokens.comma)) {
- captures = matcher();
- if (captures) {
- result.push(captures);
+ var onNextMonthClick = void 0;
+ if (orientation === _constants.VERTICAL_SCROLLABLE) {
+ onNextMonthClick = this.multiplyScrollableMonths;
} else {
- error('One extra comma');
+ onNextMonthClick = function () {
+ function onNextMonthClick(e) {
+ _this6.onNextMonthClick(null, e);
+ }
+
+ return onNextMonthClick;
+ }();
}
- }
- }
- return result;
- }
+ return _react2['default'].createElement(_DayPickerNavigation2['default'], {
+ onPrevMonthClick: function () {
+ function onPrevMonthClick(e) {
+ _this6.onPrevMonthClick(null, e);
+ }
- function matchColorStop() {
- var color = matchColor();
+ return onPrevMonthClick;
+ }(),
+ onNextMonthClick: onNextMonthClick,
+ navPrev: navPrev,
+ navNext: navNext,
+ orientation: orientation,
+ phrases: phrases,
+ isRTL: isRTL
+ });
+ }
- if (!color) {
- error('Expected color definition');
- }
+ return renderNavigation;
+ }()
+ }, {
+ key: 'renderWeekHeader',
+ value: function () {
+ function renderWeekHeader(index) {
+ var _props10 = this.props,
+ daySize = _props10.daySize,
+ horizontalMonthPadding = _props10.horizontalMonthPadding,
+ orientation = _props10.orientation,
+ weekDayFormat = _props10.weekDayFormat,
+ styles = _props10.styles;
+ var calendarMonthWidth = this.state.calendarMonthWidth;
- color.length = matchDistance();
- return color;
- }
+ var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
+ var horizontalStyle = {
+ left: index * calendarMonthWidth
+ };
+ var verticalStyle = {
+ marginLeft: -calendarMonthWidth / 2
+ };
- function matchColor() {
- return matchHexColor() ||
- matchRGBAColor() ||
- matchRGBColor() ||
- matchLiteralColor();
- }
-
- function matchLiteralColor() {
- return match('literal', tokens.literalColor, 0);
- }
-
- function matchHexColor() {
- return match('hex', tokens.hexColor, 1);
- }
-
- function matchRGBColor() {
- return matchCall(tokens.rgbColor, function() {
- return {
- type: 'rgb',
- value: matchListing(matchNumber)
- };
- });
- }
-
- function matchRGBAColor() {
- return matchCall(tokens.rgbaColor, function() {
- return {
- type: 'rgba',
- value: matchListing(matchNumber)
- };
- });
- }
+ var weekHeaderStyle = {}; // no styles applied to the vertical-scrollable orientation
+ if (this.isHorizontal()) {
+ weekHeaderStyle = horizontalStyle;
+ } else if (this.isVertical() && !verticalScrollable) {
+ weekHeaderStyle = verticalStyle;
+ }
- function matchNumber() {
- return scan(tokens.number)[1];
- }
+ var firstDayOfWeek = this.getFirstDayOfWeek();
- function matchDistance() {
- return match('%', tokens.percentageValue, 1) ||
- matchPositionKeyword() ||
- matchLength();
- }
+ var header = [];
+ for (var i = 0; i < 7; i += 1) {
+ header.push(_react2['default'].createElement(
+ 'li',
+ _extends({ key: i }, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader_li, { width: daySize })),
+ _react2['default'].createElement(
+ 'small',
+ null,
+ (0, _moment2['default'])().day((i + firstDayOfWeek) % 7).format(weekDayFormat)
+ )
+ ));
+ }
- function matchPositionKeyword() {
- return match('position-keyword', tokens.positionKeywords, 1);
- }
+ return _react2['default'].createElement(
+ 'div',
+ _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader, this.isVertical() && styles.DayPicker_weekHeader__vertical, verticalScrollable && styles.DayPicker_weekHeader__verticalScrollable, weekHeaderStyle, { padding: '0 ' + String(horizontalMonthPadding) + 'px' }), {
+ key: 'week-' + String(index)
+ }),
+ _react2['default'].createElement(
+ 'ul',
+ (0, _reactWithStyles.css)(styles.DayPicker_weekHeader_ul),
+ header
+ )
+ );
+ }
- function matchLength() {
- return match('px', tokens.pixelValue, 1) ||
- match('em', tokens.emValue, 1);
- }
+ return renderWeekHeader;
+ }()
+ }, {
+ key: 'render',
+ value: function () {
+ function render() {
+ var _this7 = this;
- function match(type, pattern, captureIndex) {
- var captures = scan(pattern);
- if (captures) {
- return {
- type: type,
- value: captures[captureIndex]
- };
- }
- }
+ var _state8 = this.state,
+ calendarMonthWidth = _state8.calendarMonthWidth,
+ currentMonth = _state8.currentMonth,
+ monthTransition = _state8.monthTransition,
+ translationValue = _state8.translationValue,
+ scrollableMonthMultiple = _state8.scrollableMonthMultiple,
+ focusedDate = _state8.focusedDate,
+ showKeyboardShortcuts = _state8.showKeyboardShortcuts,
+ isTouch = _state8.isTouchDevice,
+ hasSetHeight = _state8.hasSetHeight,
+ calendarInfoWidth = _state8.calendarInfoWidth,
+ monthTitleHeight = _state8.monthTitleHeight;
+ var _props11 = this.props,
+ enableOutsideDays = _props11.enableOutsideDays,
+ numberOfMonths = _props11.numberOfMonths,
+ orientation = _props11.orientation,
+ modifiers = _props11.modifiers,
+ withPortal = _props11.withPortal,
+ onDayClick = _props11.onDayClick,
+ onDayMouseEnter = _props11.onDayMouseEnter,
+ onDayMouseLeave = _props11.onDayMouseLeave,
+ firstDayOfWeek = _props11.firstDayOfWeek,
+ renderMonthText = _props11.renderMonthText,
+ renderCalendarDay = _props11.renderCalendarDay,
+ renderDayContents = _props11.renderDayContents,
+ renderCalendarInfo = _props11.renderCalendarInfo,
+ renderMonthElement = _props11.renderMonthElement,
+ calendarInfoPosition = _props11.calendarInfoPosition,
+ hideKeyboardShortcutsPanel = _props11.hideKeyboardShortcutsPanel,
+ onOutsideClick = _props11.onOutsideClick,
+ monthFormat = _props11.monthFormat,
+ daySize = _props11.daySize,
+ isFocused = _props11.isFocused,
+ isRTL = _props11.isRTL,
+ styles = _props11.styles,
+ theme = _props11.theme,
+ phrases = _props11.phrases,
+ verticalHeight = _props11.verticalHeight,
+ dayAriaLabelFormat = _props11.dayAriaLabelFormat,
+ noBorder = _props11.noBorder,
+ transitionDuration = _props11.transitionDuration,
+ verticalBorderSpacing = _props11.verticalBorderSpacing,
+ horizontalMonthPadding = _props11.horizontalMonthPadding;
+ var dayPickerHorizontalPadding = theme.reactDates.spacing.dayPickerHorizontalPadding;
- function scan(regexp) {
- var captures,
- blankCaptures;
- blankCaptures = /^[\n\r\t\s]+/.exec(input);
- if (blankCaptures) {
- consume(blankCaptures[0].length);
- }
+ var isHorizontal = this.isHorizontal();
- captures = regexp.exec(input);
- if (captures) {
- consume(captures[0].length);
- }
+ var numOfWeekHeaders = this.isVertical() ? 1 : numberOfMonths;
+ var weekHeaders = [];
+ for (var i = 0; i < numOfWeekHeaders; i += 1) {
+ weekHeaders.push(this.renderWeekHeader(i));
+ }
- return captures;
- }
+ var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
+ var height = void 0;
+ if (isHorizontal) {
+ height = this.calendarMonthGridHeight;
+ } else if (this.isVertical() && !verticalScrollable && !withPortal) {
+ // If the user doesn't set a desired height,
+ // we default back to this kind of made-up value that generally looks good
+ height = verticalHeight || 1.75 * calendarMonthWidth;
+ }
- function consume(size) {
- input = input.substr(size);
- }
+ var isCalendarMonthGridAnimating = monthTransition !== null;
- return function(code) {
- input = code.toString();
- return getAST();
- };
-})();
+ var shouldFocusDate = !isCalendarMonthGridAnimating && isFocused;
-exports.parse = (GradientParser || {}).parse;
+ var keyboardShortcutButtonLocation = _DayPickerKeyboardShortcuts.BOTTOM_RIGHT;
+ if (this.isVertical()) {
+ keyboardShortcutButtonLocation = withPortal ? _DayPickerKeyboardShortcuts.TOP_LEFT : _DayPickerKeyboardShortcuts.TOP_RIGHT;
+ }
+ var shouldAnimateHeight = isHorizontal && hasSetHeight;
-/***/ }),
+ var calendarInfoPositionTop = calendarInfoPosition === _constants.INFO_POSITION_TOP;
+ var calendarInfoPositionBottom = calendarInfoPosition === _constants.INFO_POSITION_BOTTOM;
+ var calendarInfoPositionBefore = calendarInfoPosition === _constants.INFO_POSITION_BEFORE;
+ var calendarInfoPositionAfter = calendarInfoPosition === _constants.INFO_POSITION_AFTER;
+ var calendarInfoIsInline = calendarInfoPositionBefore || calendarInfoPositionAfter;
-/***/ "K+tz":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ var calendarInfo = renderCalendarInfo && _react2['default'].createElement(
+ 'div',
+ _extends({
+ ref: this.setCalendarInfoRef
+ }, (0, _reactWithStyles.css)(calendarInfoIsInline && styles.DayPicker_calendarInfo__horizontal)),
+ renderCalendarInfo()
+ );
-"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__);
+ var calendarInfoPanelWidth = renderCalendarInfo && calendarInfoIsInline ? calendarInfoWidth : 0;
+ var firstVisibleMonthIndex = this.getFirstVisibleIndex();
+ var wrapperHorizontalWidth = calendarMonthWidth * numberOfMonths + 2 * dayPickerHorizontalPadding;
+ // Adding `1px` because of whitespace between 2 inline-block
+ var fullHorizontalWidth = wrapperHorizontalWidth + calendarInfoPanelWidth + 1;
-/**
- * WordPress dependencies
- */
+ var transitionContainerStyle = {
+ width: isHorizontal && wrapperHorizontalWidth,
+ height: height
+ };
-const external = 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.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"
-}));
-/* harmony default export */ __webpack_exports__["a"] = (external);
+ var dayPickerWrapperStyle = {
+ width: isHorizontal && wrapperHorizontalWidth
+ };
+ var dayPickerStyle = {
+ width: isHorizontal && fullHorizontalWidth,
-/***/ }),
+ // These values are to center the datepicker (approximately) on the page
+ marginLeft: isHorizontal && withPortal ? -fullHorizontalWidth / 2 : null,
+ marginTop: isHorizontal && withPortal ? -calendarMonthWidth / 2 : null
+ };
-/***/ "K9lf":
-/***/ (function(module, exports) {
+ return _react2['default'].createElement(
+ 'div',
+ _extends({
+ role: 'application',
+ 'aria-label': phrases.calendarLabel
+ }, (0, _reactWithStyles.css)(styles.DayPicker, isHorizontal && styles.DayPicker__horizontal, verticalScrollable && styles.DayPicker__verticalScrollable, isHorizontal && withPortal && styles.DayPicker_portal__horizontal, this.isVertical() && withPortal && styles.DayPicker_portal__vertical, dayPickerStyle, !monthTitleHeight && styles.DayPicker__hidden, !noBorder && styles.DayPicker__withBorder)),
+ _react2['default'].createElement(
+ _reactOutsideClickHandler2['default'],
+ { onOutsideClick: onOutsideClick },
+ (calendarInfoPositionTop || calendarInfoPositionBefore) && calendarInfo,
+ _react2['default'].createElement(
+ 'div',
+ (0, _reactWithStyles.css)(dayPickerWrapperStyle, calendarInfoIsInline && isHorizontal && styles.DayPicker_wrapper__horizontal),
+ _react2['default'].createElement(
+ 'div',
+ _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeaders, isHorizontal && styles.DayPicker_weekHeaders__horizontal), {
+ 'aria-hidden': 'true',
+ role: 'presentation'
+ }),
+ weekHeaders
+ ),
+ _react2['default'].createElement(
+ 'div',
+ _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_focusRegion), {
+ ref: this.setContainerRef,
+ onClick: function () {
+ function onClick(e) {
+ e.stopPropagation();
+ }
-(function() { module.exports = window["wp"]["compose"]; }());
+ return onClick;
+ }(),
+ onKeyDown: this.onKeyDown,
+ onMouseUp: function () {
+ function onMouseUp() {
+ _this7.setState({ withMouseInteractions: true });
+ }
-/***/ }),
+ return onMouseUp;
+ }(),
+ role: 'region',
+ tabIndex: -1
+ }),
+ !verticalScrollable && this.renderNavigation(),
+ _react2['default'].createElement(
+ 'div',
+ _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_transitionContainer, shouldAnimateHeight && styles.DayPicker_transitionContainer__horizontal, this.isVertical() && styles.DayPicker_transitionContainer__vertical, verticalScrollable && styles.DayPicker_transitionContainer__verticalScrollable, transitionContainerStyle), {
+ ref: this.setTransitionContainerRef
+ }),
+ _react2['default'].createElement(_CalendarMonthGrid2['default'], {
+ setMonthTitleHeight: !monthTitleHeight ? this.setMonthTitleHeight : undefined,
+ translationValue: translationValue,
+ enableOutsideDays: enableOutsideDays,
+ firstVisibleMonthIndex: firstVisibleMonthIndex,
+ initialMonth: currentMonth,
+ isAnimating: isCalendarMonthGridAnimating,
+ modifiers: modifiers,
+ orientation: orientation,
+ numberOfMonths: numberOfMonths * scrollableMonthMultiple,
+ onDayClick: onDayClick,
+ onDayMouseEnter: onDayMouseEnter,
+ onDayMouseLeave: onDayMouseLeave,
+ onMonthChange: this.onMonthChange,
+ onYearChange: this.onYearChange,
+ renderMonthText: renderMonthText,
+ renderCalendarDay: renderCalendarDay,
+ renderDayContents: renderDayContents,
+ renderMonthElement: renderMonthElement,
+ onMonthTransitionEnd: this.updateStateAfterMonthTransition,
+ monthFormat: monthFormat,
+ daySize: daySize,
+ firstDayOfWeek: firstDayOfWeek,
+ isFocused: shouldFocusDate,
+ focusedDate: focusedDate,
+ phrases: phrases,
+ isRTL: isRTL,
+ dayAriaLabelFormat: dayAriaLabelFormat,
+ transitionDuration: transitionDuration,
+ verticalBorderSpacing: verticalBorderSpacing,
+ horizontalMonthPadding: horizontalMonthPadding
+ }),
+ verticalScrollable && this.renderNavigation()
+ ),
+ !isTouch && !hideKeyboardShortcutsPanel && _react2['default'].createElement(_DayPickerKeyboardShortcuts2['default'], {
+ block: this.isVertical() && !withPortal,
+ buttonLocation: keyboardShortcutButtonLocation,
+ showKeyboardShortcutsPanel: showKeyboardShortcuts,
+ openKeyboardShortcutsPanel: this.openKeyboardShortcutsPanel,
+ closeKeyboardShortcutsPanel: this.closeKeyboardShortcutsPanel,
+ phrases: phrases
+ })
+ )
+ ),
+ (calendarInfoPositionBottom || calendarInfoPositionAfter) && calendarInfo
+ )
+ );
+ }
-/***/ "KA1K":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ return render;
+ }()
+ }]);
-"use strict";
+ return DayPicker;
+}(_react2['default'].Component);
-// UNUSED EXPORTS: warning, useWarning
+DayPicker.propTypes = propTypes;
+DayPicker.defaultProps = defaultProps;
-// EXTERNAL MODULE: ./node_modules/reakit-warning/es/warning.js
-var warning = __webpack_require__("WnOg");
+exports.PureDayPicker = DayPicker;
+exports["default"] = (0, _reactWithStyles.withStyles)(function (_ref2) {
+ var _ref2$reactDates = _ref2.reactDates,
+ color = _ref2$reactDates.color,
+ font = _ref2$reactDates.font,
+ noScrollBarOnVerticalScrollable = _ref2$reactDates.noScrollBarOnVerticalScrollable,
+ spacing = _ref2$reactDates.spacing,
+ zIndex = _ref2$reactDates.zIndex;
+ return {
+ DayPicker: {
+ background: color.background,
+ position: 'relative',
+ textAlign: 'left'
+ },
-// EXTERNAL MODULE: external "React"
-var external_React_ = __webpack_require__("cDcd");
+ DayPicker__horizontal: {
+ background: color.background
+ },
-// EXTERNAL MODULE: ./node_modules/reakit-utils/es/isObject.js
-var isObject = __webpack_require__("Ptb8");
+ DayPicker__verticalScrollable: {
+ height: '100%'
+ },
-// CONCATENATED MODULE: ./node_modules/reakit-warning/es/useWarning.js
+ DayPicker__hidden: {
+ visibility: 'hidden'
+ },
+ DayPicker__withBorder: {
+ boxShadow: '0 2px 6px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.07)',
+ borderRadius: 3
+ },
+ DayPicker_portal__horizontal: {
+ boxShadow: 'none',
+ position: 'absolute',
+ left: '50%',
+ top: '50%'
+ },
+ DayPicker_portal__vertical: {
+ position: 'initial'
+ },
+ DayPicker_focusRegion: {
+ outline: 'none'
+ },
-function isRefObject(ref) {
- return Object(isObject["a" /* isObject */])(ref) && "current" in ref;
-}
-/**
- * Logs `messages` to the console using `console.warn` based on a `condition`.
- * This should be used inside components.
- */
+ DayPicker_calendarInfo__horizontal: {
+ display: 'inline-block',
+ verticalAlign: 'top'
+ },
+ DayPicker_wrapper__horizontal: {
+ display: 'inline-block',
+ verticalAlign: 'top'
+ },
-function useWarning(condition) {
- for (var _len = arguments.length, messages = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- messages[_key - 1] = arguments[_key];
- }
+ DayPicker_weekHeaders: {
+ position: 'relative'
+ },
- if (false) {}
-}
+ DayPicker_weekHeaders__horizontal: {
+ marginLeft: spacing.dayPickerHorizontalPadding
+ },
+ DayPicker_weekHeader: {
+ color: color.placeholderText,
+ position: 'absolute',
+ top: 62,
+ zIndex: zIndex + 2,
+ textAlign: 'left'
+ },
+ DayPicker_weekHeader__vertical: {
+ left: '50%'
+ },
-// CONCATENATED MODULE: ./node_modules/reakit-warning/es/index.js
+ DayPicker_weekHeader__verticalScrollable: {
+ top: 0,
+ display: 'table-row',
+ borderBottom: '1px solid ' + String(color.core.border),
+ background: color.background,
+ marginLeft: 0,
+ left: 0,
+ width: '100%',
+ textAlign: 'center'
+ },
+ DayPicker_weekHeader_ul: {
+ listStyle: 'none',
+ margin: '1px 0',
+ paddingLeft: 0,
+ paddingRight: 0,
+ fontSize: font.size
+ },
+ DayPicker_weekHeader_li: {
+ display: 'inline-block',
+ textAlign: 'center'
+ },
+ DayPicker_transitionContainer: {
+ position: 'relative',
+ overflow: 'hidden',
+ borderRadius: 3
+ },
+ DayPicker_transitionContainer__horizontal: {
+ transition: 'height 0.2s ease-in-out'
+ },
+ DayPicker_transitionContainer__vertical: {
+ width: '100%'
+ },
+ DayPicker_transitionContainer__verticalScrollable: (0, _object2['default'])({
+ paddingTop: 20,
+ height: '100%',
+ position: 'absolute',
+ top: 0,
+ bottom: 0,
+ right: 0,
+ left: 0,
+ overflowY: 'scroll'
+ }, noScrollBarOnVerticalScrollable && {
+ '-webkitOverflowScrolling': 'touch',
+ '::-webkit-scrollbar': {
+ '-webkit-appearance': 'none',
+ display: 'none'
+ }
+ })
+ };
+})(DayPicker);
/***/ }),
-/***/ "KCH1":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 600:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return unstable_IdContext; });
-/* unused harmony export unstable_IdProvider */
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("cDcd");
-/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-var defaultPrefix = "id";
-function generateRandomString(prefix) {
- if (prefix === void 0) {
- prefix = defaultPrefix;
- }
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports.BOTTOM_RIGHT = exports.TOP_RIGHT = exports.TOP_LEFT = undefined;
- return "" + (prefix ? prefix + "-" : "") + Math.random().toString(32).substr(2, 6);
-}
+var _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; };
-var unstable_IdContext = /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createContext"])(generateRandomString);
-function unstable_IdProvider(_ref) {
- var children = _ref.children,
- _ref$prefix = _ref.prefix,
- prefix = _ref$prefix === void 0 ? defaultPrefix : _ref$prefix;
- var count = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(0);
- var generateId = Object(react__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(function (localPrefix) {
- if (localPrefix === void 0) {
- localPrefix = prefix;
- }
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
- return "" + (localPrefix ? localPrefix + "-" : "") + ++count.current;
- }, [prefix]);
- return /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(unstable_IdContext.Provider, {
- value: generateId
- }, children);
-}
+var _object = __webpack_require__(4011);
+var _object2 = _interopRequireDefault(_object);
+var _react = __webpack_require__(9196);
+var _react2 = _interopRequireDefault(_react);
-/***/ }),
+var _propTypes = __webpack_require__(2652);
-/***/ "KfNM":
-/***/ (function(module, exports) {
+var _propTypes2 = _interopRequireDefault(_propTypes);
-/** Used for built-in method references. */
-var objectProto = Object.prototype;
+var _airbnbPropTypes = __webpack_require__(4882);
-/**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
-var nativeObjectToString = objectProto.toString;
+var _reactWithStyles = __webpack_require__(3576);
-/**
- * Converts `value` to a string using `Object.prototype.toString`.
- *
- * @private
- * @param {*} value The value to convert.
- * @returns {string} Returns the converted string.
- */
-function objectToString(value) {
- return nativeObjectToString.call(value);
-}
+var _defaultPhrases = __webpack_require__(6030);
-module.exports = objectToString;
+var _getPhrasePropTypes = __webpack_require__(2893);
+var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
-/***/ }),
+var _KeyboardShortcutRow = __webpack_require__(5820);
-/***/ "Koq/":
-/***/ (function(module, exports, __webpack_require__) {
+var _KeyboardShortcutRow2 = _interopRequireDefault(_KeyboardShortcutRow);
-"use strict";
+var _CloseButton = __webpack_require__(6973);
+var _CloseButton2 = _interopRequireDefault(_CloseButton);
-var defineProperties = __webpack_require__("82c2");
-var callBind = __webpack_require__("PrET");
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-var implementation = __webpack_require__("FufO");
-var getPolyfill = __webpack_require__("yLpt");
-var shim = __webpack_require__("8R9v");
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-var polyfill = callBind.apply(getPolyfill());
-// eslint-disable-next-line no-unused-vars
-var bound = function assign(target, source1) {
- return polyfill(Object, arguments);
-};
-
-defineProperties(bound, {
- getPolyfill: getPolyfill,
- implementation: implementation,
- shim: shim
-});
-
-module.exports = bound;
-
-
-/***/ }),
-
-/***/ "KtDd":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var GetIntrinsic = __webpack_require__("j1Hc");
-
-var $species = GetIntrinsic('%Symbol.species%', true);
-var $TypeError = GetIntrinsic('%TypeError%');
-
-var ArrayCreate = __webpack_require__("6Ehn");
-var Get = __webpack_require__("aBsX");
-var IsArray = __webpack_require__("Bl8U");
-var IsConstructor = __webpack_require__("TFEf");
-var IsIntegralNumber = __webpack_require__("J2ba");
-var Type = __webpack_require__("PoQ0");
-
-// https://ecma-international.org/ecma-262/12.0/#sec-arrayspeciescreate
-
-module.exports = function ArraySpeciesCreate(originalArray, length) {
- if (!IsIntegralNumber(length) || length < 0) {
- throw new $TypeError('Assertion failed: length must be an integer >= 0');
- }
-
- var isArray = IsArray(originalArray);
- if (!isArray) {
- return ArrayCreate(length);
- }
-
- var C = Get(originalArray, 'constructor');
- // TODO: figure out how to make a cross-realm normal Array, a same-realm Array
- // if (IsConstructor(C)) {
- // if C is another realm's Array, C = undefined
- // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ?
- // }
- if ($species && Type(C) === 'Object') {
- C = Get(C, $species);
- if (C === null) {
- C = void 0;
- }
- }
-
- if (typeof C === 'undefined') {
- return ArrayCreate(length);
- }
- if (!IsConstructor(C)) {
- throw new $TypeError('C must be a constructor');
- }
- return new C(length); // Construct(C, length);
-};
-
-
-
-/***/ }),
-
-/***/ "Kz5y":
-/***/ (function(module, exports, __webpack_require__) {
-
-var freeGlobal = __webpack_require__("WFqU");
-
-/** Detect free variable `self`. */
-var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
-
-/** Used as a reference to the global object. */
-var root = freeGlobal || freeSelf || Function('return this')();
-
-module.exports = root;
-
-
-/***/ }),
-
-/***/ "L8Kx":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getAnimateClassName; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Animate; });
-/* 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__);
-/**
- * External dependencies
- */
-
-/**
- * @typedef {'top' | 'top left' | 'top right' | 'middle' | 'middle left' | 'middle right' | 'bottom' | 'bottom left' | 'bottom right'} AppearOrigin
- * @typedef {'left' | 'right'} SlideInOrigin
- * @typedef {{ type: 'appear'; origin?: AppearOrigin }} AppearOptions
- * @typedef {{ type: 'slide-in'; origin?: SlideInOrigin }} SlideInOptions
- * @typedef {{ type: 'loading' }} LoadingOptions
- * @typedef {AppearOptions | SlideInOptions | LoadingOptions} GetAnimateOptions
- */
-
-/* eslint-disable jsdoc/valid-types */
-
-/**
- * @param {GetAnimateOptions['type']} type The animation type
- * @return {'top' | 'left'} Default origin
- */
-
-function getDefaultOrigin(type) {
- return type === 'appear' ? 'top' : 'left';
-}
-/* eslint-enable jsdoc/valid-types */
-
-/**
- * @param {GetAnimateOptions} options
- *
- * @return {string | void} ClassName that applies the animations
- */
-
-
-function getAnimateClassName(options) {
- if (options.type === 'loading') {
- return classnames__WEBPACK_IMPORTED_MODULE_0___default()('components-animate__loading');
- }
-
- const {
- type,
- origin = getDefaultOrigin(type)
- } = options;
-
- if (type === 'appear') {
- const [yAxis, xAxis = 'center'] = origin.split(' ');
- return classnames__WEBPACK_IMPORTED_MODULE_0___default()('components-animate__appear', {
- ['is-from-' + xAxis]: xAxis !== 'center',
- ['is-from-' + yAxis]: yAxis !== 'middle'
- });
- }
-
- if (type === 'slide-in') {
- return classnames__WEBPACK_IMPORTED_MODULE_0___default()('components-animate__slide-in', 'is-from-' + origin);
- }
-} // @ts-ignore Reason: Planned for deprecation
-
-function Animate(_ref) {
- let {
- type,
- options = {},
- children
- } = _ref;
- return children({
- className: getAnimateClassName({
- type,
- ...options
- })
- });
-}
-
-
-/***/ }),
-
-/***/ "LTAC":
-/***/ (function(module, exports) {
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports['default'] = isTouchDevice;
-function isTouchDevice() {
- return !!(typeof window !== 'undefined' && ('ontouchstart' in window || window.DocumentTouch && typeof document !== 'undefined' && document instanceof window.DocumentTouch)) || !!(typeof navigator !== 'undefined' && (navigator.maxTouchPoints || navigator.msMaxTouchPoints));
-}
-module.exports = exports['default'];
-
-/***/ }),
-
-/***/ "Lxf3":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var toStr = Object.prototype.toString;
-
-var isPrimitive = __webpack_require__("Teho");
-
-var isCallable = __webpack_require__("IdCN");
-
-// http://ecma-international.org/ecma-262/5.1/#sec-8.12.8
-var ES5internalSlots = {
- '[[DefaultValue]]': function (O) {
- var actualHint;
- if (arguments.length > 1) {
- actualHint = arguments[1];
- } else {
- actualHint = toStr.call(O) === '[object Date]' ? String : Number;
- }
-
- if (actualHint === String || actualHint === Number) {
- var methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString'];
- var value, i;
- for (i = 0; i < methods.length; ++i) {
- if (isCallable(O[methods[i]])) {
- value = O[methods[i]]();
- if (isPrimitive(value)) {
- return value;
- }
- }
- }
- throw new TypeError('No default value');
- }
- throw new TypeError('invalid [[DefaultValue]] hint supplied');
- }
-};
-
-// http://ecma-international.org/ecma-262/5.1/#sec-9.1
-module.exports = function ToPrimitive(input) {
- if (isPrimitive(input)) {
- return input;
- }
- if (arguments.length > 1) {
- return ES5internalSlots['[[DefaultValue]]'](input, arguments[1]);
- }
- return ES5internalSlots['[[DefaultValue]]'](input);
-};
-
-
-/***/ }),
-
-/***/ "Mih7":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasUserFocus; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return setUserFocus; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return userFocus; });
-function userFocus(element) {
- element.userFocus = true;
- element.focus();
- element.userFocus = false;
-}
-function hasUserFocus(element) {
- return !!element.userFocus;
-}
-function setUserFocus(element, value) {
- element.userFocus = value;
-}
-
-
-
-
-/***/ }),
-
-/***/ "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);
-
-
-/***/ }),
-
-/***/ "N3k4":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.PureCalendarDay = undefined;
-
-var _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; };
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-var _object = __webpack_require__("Koq/");
-
-var _object2 = _interopRequireDefault(_object);
-
-var _react = __webpack_require__("cDcd");
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = __webpack_require__("17x9");
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _reactAddonsShallowCompare = __webpack_require__("YZDV");
-
-var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
-
-var _reactMomentProptypes = __webpack_require__("XGBb");
-
-var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
-
-var _airbnbPropTypes = __webpack_require__("Hsqg");
-
-var _reactWithStyles = __webpack_require__("TG4+");
-
-var _moment = __webpack_require__("wy2R");
-
-var _moment2 = _interopRequireDefault(_moment);
-
-var _defaultPhrases = __webpack_require__("vV+G");
-
-var _getPhrasePropTypes = __webpack_require__("yc2e");
-
-var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
-
-var _getCalendarDaySettings = __webpack_require__("Ae65");
-
-var _getCalendarDaySettings2 = _interopRequireDefault(_getCalendarDaySettings);
-
-var _ModifiersShape = __webpack_require__("J7JS");
-
-var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
-
-var _constants = __webpack_require__("Fv1B");
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
- day: _reactMomentProptypes2['default'].momentObj,
- daySize: _airbnbPropTypes.nonNegativeInteger,
- isOutsideDay: _propTypes2['default'].bool,
- modifiers: _ModifiersShape2['default'],
- isFocused: _propTypes2['default'].bool,
- tabIndex: _propTypes2['default'].oneOf([0, -1]),
- onDayClick: _propTypes2['default'].func,
- onDayMouseEnter: _propTypes2['default'].func,
- onDayMouseLeave: _propTypes2['default'].func,
- renderDayContents: _propTypes2['default'].func,
- ariaLabelFormat: _propTypes2['default'].string,
+var TOP_LEFT = exports.TOP_LEFT = 'top-left';
+var TOP_RIGHT = exports.TOP_RIGHT = 'top-right';
+var BOTTOM_RIGHT = exports.BOTTOM_RIGHT = 'bottom-right';
- // internationalization
- phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases))
+var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
+ block: _propTypes2['default'].bool,
+ buttonLocation: _propTypes2['default'].oneOf([TOP_LEFT, TOP_RIGHT, BOTTOM_RIGHT]),
+ showKeyboardShortcutsPanel: _propTypes2['default'].bool,
+ openKeyboardShortcutsPanel: _propTypes2['default'].func,
+ closeKeyboardShortcutsPanel: _propTypes2['default'].func,
+ phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerKeyboardShortcutsPhrases))
}));
var defaultProps = {
- day: (0, _moment2['default'])(),
- daySize: _constants.DAY_SIZE,
- isOutsideDay: false,
- modifiers: new Set(),
- isFocused: false,
- tabIndex: -1,
- onDayClick: function () {
- function onDayClick() {}
-
- return onDayClick;
- }(),
- onDayMouseEnter: function () {
- function onDayMouseEnter() {}
+ block: false,
+ buttonLocation: BOTTOM_RIGHT,
+ showKeyboardShortcutsPanel: false,
+ openKeyboardShortcutsPanel: function () {
+ function openKeyboardShortcutsPanel() {}
- return onDayMouseEnter;
+ return openKeyboardShortcutsPanel;
}(),
- onDayMouseLeave: function () {
- function onDayMouseLeave() {}
+ closeKeyboardShortcutsPanel: function () {
+ function closeKeyboardShortcutsPanel() {}
- return onDayMouseLeave;
+ return closeKeyboardShortcutsPanel;
}(),
- renderDayContents: null,
- ariaLabelFormat: 'dddd, LL',
-
- // internationalization
- phrases: _defaultPhrases.CalendarDayPhrases
+ phrases: _defaultPhrases.DayPickerKeyboardShortcutsPhrases
};
-var CalendarDay = function (_React$Component) {
- _inherits(CalendarDay, _React$Component);
+function getKeyboardShortcuts(phrases) {
+ return [{
+ unicode: '↵',
+ label: phrases.enterKey,
+ action: phrases.selectFocusedDate
+ }, {
+ unicode: '←/→',
+ label: phrases.leftArrowRightArrow,
+ action: phrases.moveFocusByOneDay
+ }, {
+ unicode: '↑/↓',
+ label: phrases.upArrowDownArrow,
+ action: phrases.moveFocusByOneWeek
+ }, {
+ unicode: 'PgUp/PgDn',
+ label: phrases.pageUpPageDown,
+ action: phrases.moveFocusByOneMonth
+ }, {
+ unicode: 'Home/End',
+ label: phrases.homeEnd,
+ action: phrases.moveFocustoStartAndEndOfWeek
+ }, {
+ unicode: 'Esc',
+ label: phrases.escape,
+ action: phrases.returnFocusToInput
+ }, {
+ unicode: '?',
+ label: phrases.questionMark,
+ action: phrases.openThisPanel
+ }];
+}
- function CalendarDay() {
+var DayPickerKeyboardShortcuts = function (_React$Component) {
+ _inherits(DayPickerKeyboardShortcuts, _React$Component);
+
+ function DayPickerKeyboardShortcuts() {
var _ref;
- _classCallCheck(this, CalendarDay);
+ _classCallCheck(this, DayPickerKeyboardShortcuts);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
- var _this = _possibleConstructorReturn(this, (_ref = CalendarDay.__proto__ || Object.getPrototypeOf(CalendarDay)).call.apply(_ref, [this].concat(args)));
+ var _this = _possibleConstructorReturn(this, (_ref = DayPickerKeyboardShortcuts.__proto__ || Object.getPrototypeOf(DayPickerKeyboardShortcuts)).call.apply(_ref, [this].concat(args)));
- _this.setButtonRef = _this.setButtonRef.bind(_this);
+ var phrases = _this.props.phrases;
+
+ _this.keyboardShortcuts = getKeyboardShortcuts(phrases);
+
+ _this.onShowKeyboardShortcutsButtonClick = _this.onShowKeyboardShortcutsButtonClick.bind(_this);
+ _this.setShowKeyboardShortcutsButtonRef = _this.setShowKeyboardShortcutsButtonRef.bind(_this);
+ _this.setHideKeyboardShortcutsButtonRef = _this.setHideKeyboardShortcutsButtonRef.bind(_this);
+ _this.handleFocus = _this.handleFocus.bind(_this);
+ _this.onKeyDown = _this.onKeyDown.bind(_this);
return _this;
}
- _createClass(CalendarDay, [{
- key: 'shouldComponentUpdate',
+ _createClass(DayPickerKeyboardShortcuts, [{
+ key: 'componentWillReceiveProps',
value: function () {
- function shouldComponentUpdate(nextProps, nextState) {
- return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
+ function componentWillReceiveProps(nextProps) {
+ var phrases = this.props.phrases;
+
+ if (nextProps.phrases !== phrases) {
+ this.keyboardShortcuts = getKeyboardShortcuts(nextProps.phrases);
+ }
}
- return shouldComponentUpdate;
+ return componentWillReceiveProps;
}()
}, {
key: 'componentDidUpdate',
value: function () {
- function componentDidUpdate(prevProps) {
- var _props = this.props,
- isFocused = _props.isFocused,
- tabIndex = _props.tabIndex;
-
- if (tabIndex === 0) {
- if (isFocused || tabIndex !== prevProps.tabIndex) {
- this.buttonRef.focus();
- }
- }
+ function componentDidUpdate() {
+ this.handleFocus();
}
return componentDidUpdate;
}()
}, {
- key: 'onDayClick',
+ key: 'onKeyDown',
value: function () {
- function onDayClick(day, e) {
- var onDayClick = this.props.onDayClick;
+ function onKeyDown(e) {
+ e.stopPropagation();
- onDayClick(day, e);
+ var closeKeyboardShortcutsPanel = this.props.closeKeyboardShortcutsPanel;
+ // Because the close button is the only focusable element inside of the panel, this
+ // amounts to a very basic focus trap. The user can exit the panel by "pressing" the
+ // close button or hitting escape
+
+ switch (e.key) {
+ case 'Enter':
+ case ' ':
+ case 'Spacebar': // for older browsers
+ case 'Escape':
+ closeKeyboardShortcutsPanel();
+ break;
+
+ // do nothing - this allows the up and down arrows continue their
+ // default behavior of scrolling the content of the Keyboard Shortcuts Panel
+ // which is needed when only a single month is shown for instance.
+ case 'ArrowUp':
+ case 'ArrowDown':
+ break;
+
+ // completely block the rest of the keys that have functionality outside of this panel
+ case 'Tab':
+ case 'Home':
+ case 'End':
+ case 'PageUp':
+ case 'PageDown':
+ case 'ArrowLeft':
+ case 'ArrowRight':
+ e.preventDefault();
+ break;
+
+ default:
+ break;
+ }
}
- return onDayClick;
+ return onKeyDown;
}()
}, {
- key: 'onDayMouseEnter',
+ key: 'onShowKeyboardShortcutsButtonClick',
value: function () {
- function onDayMouseEnter(day, e) {
- var onDayMouseEnter = this.props.onDayMouseEnter;
+ function onShowKeyboardShortcutsButtonClick() {
+ var _this2 = this;
- onDayMouseEnter(day, e);
+ var openKeyboardShortcutsPanel = this.props.openKeyboardShortcutsPanel;
+
+ // we want to return focus to this button after closing the keyboard shortcuts panel
+
+ openKeyboardShortcutsPanel(function () {
+ _this2.showKeyboardShortcutsButton.focus();
+ });
}
- return onDayMouseEnter;
+ return onShowKeyboardShortcutsButtonClick;
}()
}, {
- key: 'onDayMouseLeave',
+ key: 'setShowKeyboardShortcutsButtonRef',
value: function () {
- function onDayMouseLeave(day, e) {
- var onDayMouseLeave = this.props.onDayMouseLeave;
-
- onDayMouseLeave(day, e);
+ function setShowKeyboardShortcutsButtonRef(ref) {
+ this.showKeyboardShortcutsButton = ref;
}
- return onDayMouseLeave;
+ return setShowKeyboardShortcutsButtonRef;
}()
}, {
- key: 'onKeyDown',
+ key: 'setHideKeyboardShortcutsButtonRef',
value: function () {
- function onKeyDown(day, e) {
- var onDayClick = this.props.onDayClick;
- var key = e.key;
-
- if (key === 'Enter' || key === ' ') {
- onDayClick(day, e);
- }
+ function setHideKeyboardShortcutsButtonRef(ref) {
+ this.hideKeyboardShortcutsButton = ref;
}
- return onKeyDown;
+ return setHideKeyboardShortcutsButtonRef;
}()
}, {
- key: 'setButtonRef',
+ key: 'handleFocus',
value: function () {
- function setButtonRef(ref) {
- this.buttonRef = ref;
+ function handleFocus() {
+ if (this.hideKeyboardShortcutsButton) {
+ // automatically move focus into the dialog by moving
+ // to the only interactive element, the hide button
+ this.hideKeyboardShortcutsButton.focus();
+ }
}
- return setButtonRef;
+ return handleFocus;
}()
}, {
key: 'render',
value: function () {
function render() {
- var _this2 = this;
+ var _this3 = this;
- var _props2 = this.props,
- day = _props2.day,
- ariaLabelFormat = _props2.ariaLabelFormat,
- daySize = _props2.daySize,
- isOutsideDay = _props2.isOutsideDay,
- modifiers = _props2.modifiers,
- renderDayContents = _props2.renderDayContents,
- tabIndex = _props2.tabIndex,
- styles = _props2.styles,
- phrases = _props2.phrases;
+ var _props = this.props,
+ block = _props.block,
+ buttonLocation = _props.buttonLocation,
+ showKeyboardShortcutsPanel = _props.showKeyboardShortcutsPanel,
+ closeKeyboardShortcutsPanel = _props.closeKeyboardShortcutsPanel,
+ styles = _props.styles,
+ phrases = _props.phrases;
- if (!day) return _react2['default'].createElement('td', null);
+ var toggleButtonText = showKeyboardShortcutsPanel ? phrases.hideKeyboardShortcutsPanel : phrases.showKeyboardShortcutsPanel;
- var _getCalendarDaySettin = (0, _getCalendarDaySettings2['default'])(day, ariaLabelFormat, daySize, modifiers, phrases),
- daySizeStyles = _getCalendarDaySettin.daySizeStyles,
- useDefaultCursor = _getCalendarDaySettin.useDefaultCursor,
- selected = _getCalendarDaySettin.selected,
- hoveredSpan = _getCalendarDaySettin.hoveredSpan,
- isOutsideRange = _getCalendarDaySettin.isOutsideRange,
- ariaLabel = _getCalendarDaySettin.ariaLabel;
+ var bottomRight = buttonLocation === BOTTOM_RIGHT;
+ var topRight = buttonLocation === TOP_RIGHT;
+ var topLeft = buttonLocation === TOP_LEFT;
return _react2['default'].createElement(
- 'td',
- _extends({}, (0, _reactWithStyles.css)(styles.CalendarDay, useDefaultCursor && styles.CalendarDay__defaultCursor, styles.CalendarDay__default, isOutsideDay && styles.CalendarDay__outside, modifiers.has('today') && styles.CalendarDay__today, modifiers.has('first-day-of-week') && styles.CalendarDay__firstDayOfWeek, modifiers.has('last-day-of-week') && styles.CalendarDay__lastDayOfWeek, modifiers.has('hovered-offset') && styles.CalendarDay__hovered_offset, modifiers.has('highlighted-calendar') && styles.CalendarDay__highlighted_calendar, modifiers.has('blocked-minimum-nights') && styles.CalendarDay__blocked_minimum_nights, modifiers.has('blocked-calendar') && styles.CalendarDay__blocked_calendar, hoveredSpan && styles.CalendarDay__hovered_span, modifiers.has('selected-span') && styles.CalendarDay__selected_span, modifiers.has('last-in-range') && styles.CalendarDay__last_in_range, modifiers.has('selected-start') && styles.CalendarDay__selected_start, modifiers.has('selected-end') && styles.CalendarDay__selected_end, selected && styles.CalendarDay__selected, isOutsideRange && styles.CalendarDay__blocked_out_of_range, daySizeStyles), {
- role: 'button' // eslint-disable-line jsx-a11y/no-noninteractive-element-to-interactive-role
- , ref: this.setButtonRef,
- 'aria-label': ariaLabel,
- onMouseEnter: function () {
- function onMouseEnter(e) {
- _this2.onDayMouseEnter(day, e);
- }
-
- return onMouseEnter;
- }(),
- onMouseLeave: function () {
- function onMouseLeave(e) {
- _this2.onDayMouseLeave(day, e);
- }
-
- return onMouseLeave;
- }(),
- onMouseUp: function () {
- function onMouseUp(e) {
- e.currentTarget.blur();
- }
-
- return onMouseUp;
- }(),
- onClick: function () {
- function onClick(e) {
- _this2.onDayClick(day, e);
- }
+ 'div',
+ null,
+ _react2['default'].createElement(
+ 'button',
+ _extends({
+ ref: this.setShowKeyboardShortcutsButtonRef
+ }, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_buttonReset, styles.DayPickerKeyboardShortcuts_show, bottomRight && styles.DayPickerKeyboardShortcuts_show__bottomRight, topRight && styles.DayPickerKeyboardShortcuts_show__topRight, topLeft && styles.DayPickerKeyboardShortcuts_show__topLeft), {
+ type: 'button',
+ 'aria-label': toggleButtonText,
+ onClick: this.onShowKeyboardShortcutsButtonClick,
+ onKeyDown: function () {
+ function onKeyDown(e) {
+ if (e.key === 'Enter') {
+ e.preventDefault();
+ } else if (e.key === 'Space') {
+ _this3.onShowKeyboardShortcutsButtonClick(e);
+ }
+ }
- return onClick;
- }(),
- onKeyDown: function () {
- function onKeyDown(e) {
- _this2.onKeyDown(day, e);
- }
+ return onKeyDown;
+ }(),
+ onMouseUp: function () {
+ function onMouseUp(e) {
+ e.currentTarget.blur();
+ }
- return onKeyDown;
- }(),
- tabIndex: tabIndex
- }),
- renderDayContents ? renderDayContents(day, modifiers) : day.format('D')
+ return onMouseUp;
+ }()
+ }),
+ _react2['default'].createElement(
+ 'span',
+ (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_showSpan, bottomRight && styles.DayPickerKeyboardShortcuts_showSpan__bottomRight, topRight && styles.DayPickerKeyboardShortcuts_showSpan__topRight, topLeft && styles.DayPickerKeyboardShortcuts_showSpan__topLeft),
+ '?'
+ )
+ ),
+ showKeyboardShortcutsPanel && _react2['default'].createElement(
+ 'div',
+ _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_panel), {
+ role: 'dialog',
+ 'aria-labelledby': 'DayPickerKeyboardShortcuts_title',
+ 'aria-describedby': 'DayPickerKeyboardShortcuts_description'
+ }),
+ _react2['default'].createElement(
+ 'div',
+ _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_title), {
+ id: 'DayPickerKeyboardShortcuts_title'
+ }),
+ phrases.keyboardShortcuts
+ ),
+ _react2['default'].createElement(
+ 'button',
+ _extends({
+ ref: this.setHideKeyboardShortcutsButtonRef
+ }, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_buttonReset, styles.DayPickerKeyboardShortcuts_close), {
+ type: 'button',
+ tabIndex: '0',
+ 'aria-label': phrases.hideKeyboardShortcutsPanel,
+ onClick: closeKeyboardShortcutsPanel,
+ onKeyDown: this.onKeyDown
+ }),
+ _react2['default'].createElement(_CloseButton2['default'], (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_closeSvg))
+ ),
+ _react2['default'].createElement(
+ 'ul',
+ _extends({}, (0, _reactWithStyles.css)(styles.DayPickerKeyboardShortcuts_list), {
+ id: 'DayPickerKeyboardShortcuts_description'
+ }),
+ this.keyboardShortcuts.map(function (_ref2) {
+ var unicode = _ref2.unicode,
+ label = _ref2.label,
+ action = _ref2.action;
+ return _react2['default'].createElement(_KeyboardShortcutRow2['default'], {
+ key: label,
+ unicode: unicode,
+ label: label,
+ action: action,
+ block: block
+ });
+ })
+ )
+ )
);
}
@@ -9833,395 +10255,556 @@ var CalendarDay = function (_React$Component) {
}()
}]);
- return CalendarDay;
+ return DayPickerKeyboardShortcuts;
}(_react2['default'].Component);
-CalendarDay.propTypes = propTypes;
-CalendarDay.defaultProps = defaultProps;
+DayPickerKeyboardShortcuts.propTypes = propTypes;
+DayPickerKeyboardShortcuts.defaultProps = defaultProps;
-exports.PureCalendarDay = CalendarDay;
-exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
- var _ref2$reactDates = _ref2.reactDates,
- color = _ref2$reactDates.color,
- font = _ref2$reactDates.font;
+exports["default"] = (0, _reactWithStyles.withStyles)(function (_ref3) {
+ var _ref3$reactDates = _ref3.reactDates,
+ color = _ref3$reactDates.color,
+ font = _ref3$reactDates.font,
+ zIndex = _ref3$reactDates.zIndex;
return {
- CalendarDay: {
- boxSizing: 'border-box',
+ DayPickerKeyboardShortcuts_buttonReset: {
+ background: 'none',
+ border: 0,
+ borderRadius: 0,
+ color: 'inherit',
+ font: 'inherit',
+ lineHeight: 'normal',
+ overflow: 'visible',
+ padding: 0,
cursor: 'pointer',
fontSize: font.size,
- textAlign: 'center',
':active': {
- outline: 0
+ outline: 'none'
}
},
- CalendarDay__defaultCursor: {
- cursor: 'default'
+ DayPickerKeyboardShortcuts_show: {
+ width: 22,
+ position: 'absolute',
+ zIndex: zIndex + 2
},
- CalendarDay__default: {
- border: '1px solid ' + String(color.core.borderLight),
- color: color.text,
- background: color.background,
+ DayPickerKeyboardShortcuts_show__bottomRight: {
+ borderTop: '26px solid transparent',
+ borderRight: '33px solid ' + String(color.core.primary),
+ bottom: 0,
+ right: 0,
':hover': {
- background: color.core.borderLight,
- border: '1px double ' + String(color.core.borderLight),
- color: 'inherit'
+ borderRight: '33px solid ' + String(color.core.primary_dark)
}
},
- CalendarDay__hovered_offset: {
- background: color.core.borderBright,
- border: '1px double ' + String(color.core.borderLight),
- color: 'inherit'
- },
-
- CalendarDay__outside: {
- border: 0,
- background: color.outside.backgroundColor,
- color: color.outside.color,
+ DayPickerKeyboardShortcuts_show__topRight: {
+ borderBottom: '26px solid transparent',
+ borderRight: '33px solid ' + String(color.core.primary),
+ top: 0,
+ right: 0,
':hover': {
- border: 0
+ borderRight: '33px solid ' + String(color.core.primary_dark)
}
},
- CalendarDay__blocked_minimum_nights: {
- background: color.minimumNights.backgroundColor,
- border: '1px solid ' + String(color.minimumNights.borderColor),
- color: color.minimumNights.color,
+ DayPickerKeyboardShortcuts_show__topLeft: {
+ borderBottom: '26px solid transparent',
+ borderLeft: '33px solid ' + String(color.core.primary),
+ top: 0,
+ left: 0,
':hover': {
- background: color.minimumNights.backgroundColor_hover,
- color: color.minimumNights.color_active
- },
-
- ':active': {
- background: color.minimumNights.backgroundColor_active,
- color: color.minimumNights.color_active
+ borderLeft: '33px solid ' + String(color.core.primary_dark)
}
},
- CalendarDay__highlighted_calendar: {
- background: color.highlighted.backgroundColor,
- color: color.highlighted.color,
-
- ':hover': {
- background: color.highlighted.backgroundColor_hover,
- color: color.highlighted.color_active
- },
-
- ':active': {
- background: color.highlighted.backgroundColor_active,
- color: color.highlighted.color_active
- }
+ DayPickerKeyboardShortcuts_showSpan: {
+ color: color.core.white,
+ position: 'absolute'
},
- CalendarDay__selected_span: {
- background: color.selectedSpan.backgroundColor,
- border: '1px solid ' + String(color.selectedSpan.borderColor),
- color: color.selectedSpan.color,
-
- ':hover': {
- background: color.selectedSpan.backgroundColor_hover,
- border: '1px solid ' + String(color.selectedSpan.borderColor),
- color: color.selectedSpan.color_active
- },
-
- ':active': {
- background: color.selectedSpan.backgroundColor_active,
- border: '1px solid ' + String(color.selectedSpan.borderColor),
- color: color.selectedSpan.color_active
- }
+ DayPickerKeyboardShortcuts_showSpan__bottomRight: {
+ bottom: 0,
+ right: -28
},
- CalendarDay__last_in_range: {
- borderRight: color.core.primary
+ DayPickerKeyboardShortcuts_showSpan__topRight: {
+ top: 1,
+ right: -28
},
- CalendarDay__selected: {
- background: color.selected.backgroundColor,
- border: '1px solid ' + String(color.selected.borderColor),
- color: color.selected.color,
-
- ':hover': {
- background: color.selected.backgroundColor_hover,
- border: '1px solid ' + String(color.selected.borderColor),
- color: color.selected.color_active
- },
-
- ':active': {
- background: color.selected.backgroundColor_active,
- border: '1px solid ' + String(color.selected.borderColor),
- color: color.selected.color_active
- }
+ DayPickerKeyboardShortcuts_showSpan__topLeft: {
+ top: 1,
+ left: -28
},
- CalendarDay__hovered_span: {
- background: color.hoveredSpan.backgroundColor,
- border: '1px solid ' + String(color.hoveredSpan.borderColor),
- color: color.hoveredSpan.color,
-
- ':hover': {
- background: color.hoveredSpan.backgroundColor_hover,
- border: '1px solid ' + String(color.hoveredSpan.borderColor),
- color: color.hoveredSpan.color_active
- },
+ DayPickerKeyboardShortcuts_panel: {
+ overflow: 'auto',
+ background: color.background,
+ border: '1px solid ' + String(color.core.border),
+ borderRadius: 2,
+ position: 'absolute',
+ top: 0,
+ bottom: 0,
+ right: 0,
+ left: 0,
+ zIndex: zIndex + 2,
+ padding: 22,
+ margin: 33
+ },
- ':active': {
- background: color.hoveredSpan.backgroundColor_active,
- border: '1px solid ' + String(color.hoveredSpan.borderColor),
- color: color.hoveredSpan.color_active
- }
+ DayPickerKeyboardShortcuts_title: {
+ fontSize: 16,
+ fontWeight: 'bold',
+ margin: 0
},
- CalendarDay__blocked_calendar: {
- background: color.blocked_calendar.backgroundColor,
- border: '1px solid ' + String(color.blocked_calendar.borderColor),
- color: color.blocked_calendar.color,
+ DayPickerKeyboardShortcuts_list: {
+ listStyle: 'none',
+ padding: 0,
+ fontSize: font.size
+ },
- ':hover': {
- background: color.blocked_calendar.backgroundColor_hover,
- border: '1px solid ' + String(color.blocked_calendar.borderColor),
- color: color.blocked_calendar.color_active
- },
+ DayPickerKeyboardShortcuts_close: {
+ position: 'absolute',
+ right: 22,
+ top: 22,
+ zIndex: zIndex + 2,
':active': {
- background: color.blocked_calendar.backgroundColor_active,
- border: '1px solid ' + String(color.blocked_calendar.borderColor),
- color: color.blocked_calendar.color_active
+ outline: 'none'
}
},
- CalendarDay__blocked_out_of_range: {
- background: color.blocked_out_of_range.backgroundColor,
- border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
- color: color.blocked_out_of_range.color,
+ DayPickerKeyboardShortcuts_closeSvg: {
+ height: 15,
+ width: 15,
+ fill: color.core.grayLighter,
':hover': {
- background: color.blocked_out_of_range.backgroundColor_hover,
- border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
- color: color.blocked_out_of_range.color_active
+ fill: color.core.grayLight
},
- ':active': {
- background: color.blocked_out_of_range.backgroundColor_active,
- border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
- color: color.blocked_out_of_range.color_active
+ ':focus': {
+ fill: color.core.grayLight
}
- },
-
- CalendarDay__selected_start: {},
- CalendarDay__selected_end: {},
- CalendarDay__today: {},
- CalendarDay__firstDayOfWeek: {},
- CalendarDay__lastDayOfWeek: {}
+ }
};
-})(CalendarDay);
-
-/***/ }),
-
-/***/ "NMb1":
-/***/ (function(module, exports) {
-
-(function() { module.exports = window["wp"]["deprecated"]; }());
+})(DayPickerKeyboardShortcuts);
/***/ }),
-/***/ "NTP4":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 3895:
+/***/ (function(__unused_webpack_module, 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"
+Object.defineProperty(exports, "__esModule", ({
+ value: true
}));
-/* 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__);
+var _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; };
+var _object = __webpack_require__(4011);
-/**
- * WordPress dependencies
- */
+var _object2 = _interopRequireDefault(_object);
-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);
+var _react = __webpack_require__(9196);
+var _react2 = _interopRequireDefault(_react);
-/***/ }),
+var _propTypes = __webpack_require__(2652);
-/***/ "Nho6":
-/***/ (function(module, exports, __webpack_require__) {
+var _propTypes2 = _interopRequireDefault(_propTypes);
-"use strict";
+var _airbnbPropTypes = __webpack_require__(4882);
+var _reactWithStyles = __webpack_require__(3576);
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports['default'] = isAfterDay;
+var _defaultPhrases = __webpack_require__(6030);
-var _moment = __webpack_require__("wy2R");
+var _getPhrasePropTypes = __webpack_require__(2893);
-var _moment2 = _interopRequireDefault(_moment);
+var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
-var _isBeforeDay = __webpack_require__("h6xH");
+var _LeftArrow = __webpack_require__(8);
-var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
+var _LeftArrow2 = _interopRequireDefault(_LeftArrow);
-var _isSameDay = __webpack_require__("pRvc");
+var _RightArrow = __webpack_require__(4921);
-var _isSameDay2 = _interopRequireDefault(_isSameDay);
+var _RightArrow2 = _interopRequireDefault(_RightArrow);
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+var _ChevronUp = __webpack_require__(1809);
-function isAfterDay(a, b) {
- if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
- return !(0, _isBeforeDay2['default'])(a, b) && !(0, _isSameDay2['default'])(a, b);
-}
+var _ChevronUp2 = _interopRequireDefault(_ChevronUp);
-/***/ }),
+var _ChevronDown = __webpack_require__(9588);
-/***/ "Nloh":
-/***/ (function(module, exports, __webpack_require__) {
+var _ChevronDown2 = _interopRequireDefault(_ChevronDown);
-"use strict";
+var _ScrollableOrientationShape = __webpack_require__(6553);
+var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.PureDayPicker = exports.defaultProps = undefined;
+var _constants = __webpack_require__(257);
-var _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; };
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
-var _object = __webpack_require__("Koq/");
+var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
+ navPrev: _propTypes2['default'].node,
+ navNext: _propTypes2['default'].node,
+ orientation: _ScrollableOrientationShape2['default'],
-var _object2 = _interopRequireDefault(_object);
+ onPrevMonthClick: _propTypes2['default'].func,
+ onNextMonthClick: _propTypes2['default'].func,
-var _react = __webpack_require__("cDcd");
+ // internationalization
+ phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerNavigationPhrases)),
-var _react2 = _interopRequireDefault(_react);
+ isRTL: _propTypes2['default'].bool
+}));
-var _propTypes = __webpack_require__("17x9");
+var defaultProps = {
+ navPrev: null,
+ navNext: null,
+ orientation: _constants.HORIZONTAL_ORIENTATION,
-var _propTypes2 = _interopRequireDefault(_propTypes);
+ onPrevMonthClick: function () {
+ function onPrevMonthClick() {}
-var _reactAddonsShallowCompare = __webpack_require__("YZDV");
+ return onPrevMonthClick;
+ }(),
+ onNextMonthClick: function () {
+ function onNextMonthClick() {}
-var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
+ return onNextMonthClick;
+ }(),
-var _airbnbPropTypes = __webpack_require__("Hsqg");
-var _reactWithStyles = __webpack_require__("TG4+");
+ // internationalization
+ phrases: _defaultPhrases.DayPickerNavigationPhrases,
+ isRTL: false
+};
-var _moment = __webpack_require__("wy2R");
+function DayPickerNavigation(_ref) {
+ var navPrev = _ref.navPrev,
+ navNext = _ref.navNext,
+ onPrevMonthClick = _ref.onPrevMonthClick,
+ onNextMonthClick = _ref.onNextMonthClick,
+ orientation = _ref.orientation,
+ phrases = _ref.phrases,
+ isRTL = _ref.isRTL,
+ styles = _ref.styles;
-var _moment2 = _interopRequireDefault(_moment);
+ var isHorizontal = orientation === _constants.HORIZONTAL_ORIENTATION;
+ var isVertical = orientation !== _constants.HORIZONTAL_ORIENTATION;
+ var isVerticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
-var _throttle = __webpack_require__("DzJC");
+ var navPrevIcon = navPrev;
+ var navNextIcon = navNext;
+ var isDefaultNavPrev = false;
+ var isDefaultNavNext = false;
+ if (!navPrevIcon) {
+ isDefaultNavPrev = true;
+ var Icon = isVertical ? _ChevronUp2['default'] : _LeftArrow2['default'];
+ if (isRTL && !isVertical) {
+ Icon = _RightArrow2['default'];
+ }
+ navPrevIcon = _react2['default'].createElement(Icon, (0, _reactWithStyles.css)(isHorizontal && styles.DayPickerNavigation_svg__horizontal, isVertical && styles.DayPickerNavigation_svg__vertical));
+ }
-var _throttle2 = _interopRequireDefault(_throttle);
+ if (!navNextIcon) {
+ isDefaultNavNext = true;
+ var _Icon = isVertical ? _ChevronDown2['default'] : _RightArrow2['default'];
+ if (isRTL && !isVertical) {
+ _Icon = _LeftArrow2['default'];
+ }
+ navNextIcon = _react2['default'].createElement(_Icon, (0, _reactWithStyles.css)(isHorizontal && styles.DayPickerNavigation_svg__horizontal, isVertical && styles.DayPickerNavigation_svg__vertical));
+ }
-var _isTouchDevice = __webpack_require__("LTAC");
+ var isDefaultNav = isVerticalScrollable ? isDefaultNavNext : isDefaultNavNext || isDefaultNavPrev;
-var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice);
+ return _react2['default'].createElement(
+ 'div',
+ _reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation, isHorizontal && styles.DayPickerNavigation__horizontal].concat(_toConsumableArray(isVertical && [styles.DayPickerNavigation__vertical, isDefaultNav && styles.DayPickerNavigation__verticalDefault]), _toConsumableArray(isVerticalScrollable && [styles.DayPickerNavigation__verticalScrollable, isDefaultNav && styles.DayPickerNavigation__verticalScrollableDefault]))),
+ !isVerticalScrollable && _react2['default'].createElement(
+ 'div',
+ _extends({
+ role: 'button',
+ tabIndex: '0'
+ }, _reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation_button, isDefaultNavPrev && styles.DayPickerNavigation_button__default].concat(_toConsumableArray(isHorizontal && [styles.DayPickerNavigation_button__horizontal].concat(_toConsumableArray(isDefaultNavPrev && [styles.DayPickerNavigation_button__horizontalDefault, !isRTL && styles.DayPickerNavigation_leftButton__horizontalDefault, isRTL && styles.DayPickerNavigation_rightButton__horizontalDefault]))), _toConsumableArray(isVertical && [styles.DayPickerNavigation_button__vertical].concat(_toConsumableArray(isDefaultNavPrev && [styles.DayPickerNavigation_button__verticalDefault, styles.DayPickerNavigation_prevButton__verticalDefault]))))), {
+ 'aria-label': phrases.jumpToPrevMonth,
+ onClick: onPrevMonthClick,
+ onKeyUp: function () {
+ function onKeyUp(e) {
+ var key = e.key;
-var _reactOutsideClickHandler = __webpack_require__("3gBW");
+ if (key === 'Enter' || key === ' ') onPrevMonthClick(e);
+ }
-var _reactOutsideClickHandler2 = _interopRequireDefault(_reactOutsideClickHandler);
+ return onKeyUp;
+ }(),
+ onMouseUp: function () {
+ function onMouseUp(e) {
+ e.currentTarget.blur();
+ }
-var _defaultPhrases = __webpack_require__("vV+G");
+ return onMouseUp;
+ }()
+ }),
+ navPrevIcon
+ ),
+ _react2['default'].createElement(
+ 'div',
+ _extends({
+ role: 'button',
+ tabIndex: '0'
+ }, _reactWithStyles.css.apply(undefined, [styles.DayPickerNavigation_button, isDefaultNavNext && styles.DayPickerNavigation_button__default].concat(_toConsumableArray(isHorizontal && [styles.DayPickerNavigation_button__horizontal].concat(_toConsumableArray(isDefaultNavNext && [styles.DayPickerNavigation_button__horizontalDefault, isRTL && styles.DayPickerNavigation_leftButton__horizontalDefault, !isRTL && styles.DayPickerNavigation_rightButton__horizontalDefault]))), _toConsumableArray(isVertical && [styles.DayPickerNavigation_button__vertical, styles.DayPickerNavigation_nextButton__vertical].concat(_toConsumableArray(isDefaultNavNext && [styles.DayPickerNavigation_button__verticalDefault, styles.DayPickerNavigation_nextButton__verticalDefault, isVerticalScrollable && styles.DayPickerNavigation_nextButton__verticalScrollableDefault]))))), {
+ 'aria-label': phrases.jumpToNextMonth,
+ onClick: onNextMonthClick,
+ onKeyUp: function () {
+ function onKeyUp(e) {
+ var key = e.key;
-var _getPhrasePropTypes = __webpack_require__("yc2e");
+ if (key === 'Enter' || key === ' ') onNextMonthClick(e);
+ }
-var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
+ return onKeyUp;
+ }(),
+ onMouseUp: function () {
+ function onMouseUp(e) {
+ e.currentTarget.blur();
+ }
-var _CalendarMonthGrid = __webpack_require__("Thzv");
+ return onMouseUp;
+ }()
+ }),
+ navNextIcon
+ )
+ );
+}
-var _CalendarMonthGrid2 = _interopRequireDefault(_CalendarMonthGrid);
+DayPickerNavigation.propTypes = propTypes;
+DayPickerNavigation.defaultProps = defaultProps;
-var _DayPickerNavigation = __webpack_require__("zfJ5");
+exports["default"] = (0, _reactWithStyles.withStyles)(function (_ref2) {
+ var _ref2$reactDates = _ref2.reactDates,
+ color = _ref2$reactDates.color,
+ zIndex = _ref2$reactDates.zIndex;
+ return {
+ DayPickerNavigation: {
+ position: 'relative',
+ zIndex: zIndex + 2
+ },
-var _DayPickerNavigation2 = _interopRequireDefault(_DayPickerNavigation);
+ DayPickerNavigation__horizontal: {
+ height: 0
+ },
-var _DayPickerKeyboardShortcuts = __webpack_require__("1+Kn");
+ DayPickerNavigation__vertical: {},
+ DayPickerNavigation__verticalScrollable: {},
-var _DayPickerKeyboardShortcuts2 = _interopRequireDefault(_DayPickerKeyboardShortcuts);
+ DayPickerNavigation__verticalDefault: {
+ position: 'absolute',
+ width: '100%',
+ height: 52,
+ bottom: 0,
+ left: 0
+ },
-var _getNumberOfCalendarMonthWeeks = __webpack_require__("0Dl3");
+ DayPickerNavigation__verticalScrollableDefault: {
+ position: 'relative'
+ },
-var _getNumberOfCalendarMonthWeeks2 = _interopRequireDefault(_getNumberOfCalendarMonthWeeks);
+ DayPickerNavigation_button: {
+ cursor: 'pointer',
+ userSelect: 'none',
+ border: 0,
+ padding: 0,
+ margin: 0
+ },
-var _getCalendarMonthWidth = __webpack_require__("m2ax");
+ DayPickerNavigation_button__default: {
+ border: '1px solid ' + String(color.core.borderLight),
+ backgroundColor: color.background,
+ color: color.placeholderText,
-var _getCalendarMonthWidth2 = _interopRequireDefault(_getCalendarMonthWidth);
+ ':focus': {
+ border: '1px solid ' + String(color.core.borderMedium)
+ },
-var _calculateDimension = __webpack_require__("ixyq");
+ ':hover': {
+ border: '1px solid ' + String(color.core.borderMedium)
+ },
-var _calculateDimension2 = _interopRequireDefault(_calculateDimension);
+ ':active': {
+ background: color.backgroundDark
+ }
+ },
-var _getActiveElement = __webpack_require__("+51k");
+ DayPickerNavigation_button__horizontal: {},
-var _getActiveElement2 = _interopRequireDefault(_getActiveElement);
+ DayPickerNavigation_button__horizontalDefault: {
+ position: 'absolute',
+ top: 18,
+ lineHeight: 0.78,
+ borderRadius: 3,
+ padding: '6px 9px'
+ },
+
+ DayPickerNavigation_leftButton__horizontalDefault: {
+ left: 22
+ },
+
+ DayPickerNavigation_rightButton__horizontalDefault: {
+ right: 22
+ },
+
+ DayPickerNavigation_button__vertical: {},
+
+ DayPickerNavigation_button__verticalDefault: {
+ padding: 5,
+ background: color.background,
+ boxShadow: '0 0 5px 2px rgba(0, 0, 0, 0.1)',
+ position: 'relative',
+ display: 'inline-block',
+ height: '100%',
+ width: '50%'
+ },
+
+ DayPickerNavigation_prevButton__verticalDefault: {},
+
+ DayPickerNavigation_nextButton__verticalDefault: {
+ borderLeft: 0
+ },
+
+ DayPickerNavigation_nextButton__verticalScrollableDefault: {
+ width: '100%'
+ },
+
+ DayPickerNavigation_svg__horizontal: {
+ height: 19,
+ width: 19,
+ fill: color.core.grayLight,
+ display: 'block'
+ },
+
+ DayPickerNavigation_svg__vertical: {
+ height: 42,
+ width: 42,
+ fill: color.text,
+ display: 'block'
+ }
+ };
+})(DayPickerNavigation);
+
+/***/ }),
+
+/***/ 6302:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
+
+"use strict";
+var __webpack_unused_export__;
+
+
+__webpack_unused_export__ = ({
+ value: true
+});
+
+var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _object = __webpack_require__(4011);
+
+var _object2 = _interopRequireDefault(_object);
+
+var _react = __webpack_require__(9196);
+
+var _react2 = _interopRequireDefault(_react);
+
+var _propTypes = __webpack_require__(2652);
+
+var _propTypes2 = _interopRequireDefault(_propTypes);
+
+var _reactMomentProptypes = __webpack_require__(6150);
+
+var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
+
+var _airbnbPropTypes = __webpack_require__(4882);
+
+var _moment = __webpack_require__(6292);
+
+var _moment2 = _interopRequireDefault(_moment);
+
+var _object3 = __webpack_require__(5861);
+
+var _object4 = _interopRequireDefault(_object3);
+
+var _isTouchDevice = __webpack_require__(5834);
+
+var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice);
+
+var _defaultPhrases = __webpack_require__(6030);
+
+var _getPhrasePropTypes = __webpack_require__(2893);
+
+var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
+
+var _isSameDay = __webpack_require__(3923);
+
+var _isSameDay2 = _interopRequireDefault(_isSameDay);
+
+var _isAfterDay = __webpack_require__(7365);
+
+var _isAfterDay2 = _interopRequireDefault(_isAfterDay);
+
+var _getVisibleDays = __webpack_require__(3268);
-var _isDayVisible = __webpack_require__("IgE5");
+var _getVisibleDays2 = _interopRequireDefault(_getVisibleDays);
+
+var _isDayVisible = __webpack_require__(5713);
var _isDayVisible2 = _interopRequireDefault(_isDayVisible);
-var _ModifiersShape = __webpack_require__("J7JS");
+var _toISODateString = __webpack_require__(7310);
-var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
+var _toISODateString2 = _interopRequireDefault(_toISODateString);
-var _ScrollableOrientationShape = __webpack_require__("aE6U");
+var _toISOMonthString = __webpack_require__(2705);
+
+var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString);
+
+var _ScrollableOrientationShape = __webpack_require__(6553);
var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
-var _DayOfWeekShape = __webpack_require__("2S2E");
+var _DayOfWeekShape = __webpack_require__(243);
var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
-var _CalendarInfoPositionShape = __webpack_require__("oR9Z");
+var _CalendarInfoPositionShape = __webpack_require__(8182);
var _CalendarInfoPositionShape2 = _interopRequireDefault(_CalendarInfoPositionShape);
-var _constants = __webpack_require__("Fv1B");
+var _constants = __webpack_require__(257);
+
+var _DayPicker = __webpack_require__(8665);
+
+var _DayPicker2 = _interopRequireDefault(_DayPicker);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
+function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -10229,105 +10812,120 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-var MONTH_PADDING = 23;
-var PREV_TRANSITION = 'prev';
-var NEXT_TRANSITION = 'next';
-var MONTH_SELECTION_TRANSITION = 'month_selection';
-var YEAR_SELECTION_TRANSITION = 'year_selection';
+var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({
+ date: _reactMomentProptypes2['default'].momentObj,
+ onDateChange: _propTypes2['default'].func,
-var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
+ focused: _propTypes2['default'].bool,
+ onFocusChange: _propTypes2['default'].func,
+ onClose: _propTypes2['default'].func,
- // calendar presentation props
+ keepOpenOnDateSelect: _propTypes2['default'].bool,
+ isOutsideRange: _propTypes2['default'].func,
+ isDayBlocked: _propTypes2['default'].func,
+ isDayHighlighted: _propTypes2['default'].func,
+
+ // DayPicker props
+ renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
+ renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
enableOutsideDays: _propTypes2['default'].bool,
numberOfMonths: _propTypes2['default'].number,
orientation: _ScrollableOrientationShape2['default'],
withPortal: _propTypes2['default'].bool,
- onOutsideClick: _propTypes2['default'].func,
- hidden: _propTypes2['default'].bool,
initialVisibleMonth: _propTypes2['default'].func,
firstDayOfWeek: _DayOfWeekShape2['default'],
- renderCalendarInfo: _propTypes2['default'].func,
- calendarInfoPosition: _CalendarInfoPositionShape2['default'],
hideKeyboardShortcutsPanel: _propTypes2['default'].bool,
daySize: _airbnbPropTypes.nonNegativeInteger,
- isRTL: _propTypes2['default'].bool,
verticalHeight: _airbnbPropTypes.nonNegativeInteger,
noBorder: _propTypes2['default'].bool,
- transitionDuration: _airbnbPropTypes.nonNegativeInteger,
verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
+ transitionDuration: _airbnbPropTypes.nonNegativeInteger,
horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
- // navigation props
navPrev: _propTypes2['default'].node,
navNext: _propTypes2['default'].node,
- noNavButtons: _propTypes2['default'].bool,
+
onPrevMonthClick: _propTypes2['default'].func,
onNextMonthClick: _propTypes2['default'].func,
- onMonthChange: _propTypes2['default'].func,
- onYearChange: _propTypes2['default'].func,
- onMultiplyScrollableMonths: _propTypes2['default'].func, // VERTICAL_SCROLLABLE daypickers only
-
- // month props
- renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
- renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
-
- // day props
- modifiers: _propTypes2['default'].objectOf(_propTypes2['default'].objectOf(_ModifiersShape2['default'])),
+ onOutsideClick: _propTypes2['default'].func,
renderCalendarDay: _propTypes2['default'].func,
renderDayContents: _propTypes2['default'].func,
- onDayClick: _propTypes2['default'].func,
- onDayMouseEnter: _propTypes2['default'].func,
- onDayMouseLeave: _propTypes2['default'].func,
+ renderCalendarInfo: _propTypes2['default'].func,
+ calendarInfoPosition: _CalendarInfoPositionShape2['default'],
- // accessibility props
- isFocused: _propTypes2['default'].bool,
- getFirstFocusableDay: _propTypes2['default'].func,
+ // accessibility
onBlur: _propTypes2['default'].func,
+ isFocused: _propTypes2['default'].bool,
showKeyboardShortcuts: _propTypes2['default'].bool,
- // internationalization
+ // i18n
monthFormat: _propTypes2['default'].string,
weekDayFormat: _propTypes2['default'].string,
phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerPhrases)),
- dayAriaLabelFormat: _propTypes2['default'].string
-}));
+ dayAriaLabelFormat: _propTypes2['default'].string,
-var defaultProps = exports.defaultProps = {
- // calendar presentation props
- enableOutsideDays: false,
- numberOfMonths: 2,
- orientation: _constants.HORIZONTAL_ORIENTATION,
- withPortal: false,
- onOutsideClick: function () {
- function onOutsideClick() {}
+ isRTL: _propTypes2['default'].bool
+});
- return onOutsideClick;
+var defaultProps = {
+ date: undefined, // TODO: use null
+ onDateChange: function () {
+ function onDateChange() {}
+
+ return onDateChange;
}(),
- hidden: false,
- initialVisibleMonth: function () {
- function initialVisibleMonth() {
- return (0, _moment2['default'])();
- }
- return initialVisibleMonth;
+ focused: false,
+ onFocusChange: function () {
+ function onFocusChange() {}
+
+ return onFocusChange;
}(),
- firstDayOfWeek: null,
- renderCalendarInfo: null,
- calendarInfoPosition: _constants.INFO_POSITION_BOTTOM,
+ onClose: function () {
+ function onClose() {}
+
+ return onClose;
+ }(),
+
+
+ keepOpenOnDateSelect: false,
+ isOutsideRange: function () {
+ function isOutsideRange() {}
+
+ return isOutsideRange;
+ }(),
+ isDayBlocked: function () {
+ function isDayBlocked() {}
+
+ return isDayBlocked;
+ }(),
+ isDayHighlighted: function () {
+ function isDayHighlighted() {}
+
+ return isDayHighlighted;
+ }(),
+
+
+ // DayPicker props
+ renderMonthText: null,
+ enableOutsideDays: false,
+ numberOfMonths: 1,
+ orientation: _constants.HORIZONTAL_ORIENTATION,
+ withPortal: false,
hideKeyboardShortcutsPanel: false,
+ initialVisibleMonth: null,
+ firstDayOfWeek: null,
daySize: _constants.DAY_SIZE,
- isRTL: false,
verticalHeight: null,
noBorder: false,
- transitionDuration: undefined,
verticalBorderSpacing: undefined,
+ transitionDuration: undefined,
horizontalMonthPadding: 13,
- // navigation props
navPrev: null,
navNext: null,
- noNavButtons: false,
+
onPrevMonthClick: function () {
function onPrevMonthClick() {}
@@ -10338,150 +10936,150 @@ var defaultProps = exports.defaultProps = {
return onNextMonthClick;
}(),
- onMonthChange: function () {
- function onMonthChange() {}
-
- return onMonthChange;
- }(),
- onYearChange: function () {
- function onYearChange() {}
-
- return onYearChange;
- }(),
- onMultiplyScrollableMonths: function () {
- function onMultiplyScrollableMonths() {}
+ onOutsideClick: function () {
+ function onOutsideClick() {}
- return onMultiplyScrollableMonths;
+ return onOutsideClick;
}(),
- // month props
- renderMonthText: null,
- renderMonthElement: null,
-
- // day props
- modifiers: {},
renderCalendarDay: undefined,
renderDayContents: null,
- onDayClick: function () {
- function onDayClick() {}
-
- return onDayClick;
- }(),
- onDayMouseEnter: function () {
- function onDayMouseEnter() {}
-
- return onDayMouseEnter;
- }(),
- onDayMouseLeave: function () {
- function onDayMouseLeave() {}
-
- return onDayMouseLeave;
- }(),
-
+ renderCalendarInfo: null,
+ renderMonthElement: null,
+ calendarInfoPosition: _constants.INFO_POSITION_BOTTOM,
- // accessibility props
- isFocused: false,
- getFirstFocusableDay: null,
+ // accessibility
onBlur: function () {
function onBlur() {}
return onBlur;
}(),
+ isFocused: false,
showKeyboardShortcuts: false,
- // internationalization
+ // i18n
monthFormat: 'MMMM YYYY',
weekDayFormat: 'dd',
phrases: _defaultPhrases.DayPickerPhrases,
- dayAriaLabelFormat: undefined
+ dayAriaLabelFormat: undefined,
+
+ isRTL: false
};
-var DayPicker = function (_React$Component) {
- _inherits(DayPicker, _React$Component);
+var DayPickerSingleDateController = function (_React$Component) {
+ _inherits(DayPickerSingleDateController, _React$Component);
- function DayPicker(props) {
- _classCallCheck(this, DayPicker);
+ function DayPickerSingleDateController(props) {
+ _classCallCheck(this, DayPickerSingleDateController);
- var _this = _possibleConstructorReturn(this, (DayPicker.__proto__ || Object.getPrototypeOf(DayPicker)).call(this, props));
+ var _this = _possibleConstructorReturn(this, (DayPickerSingleDateController.__proto__ || Object.getPrototypeOf(DayPickerSingleDateController)).call(this, props));
- var currentMonth = props.hidden ? (0, _moment2['default'])() : props.initialVisibleMonth();
+ _this.isTouchDevice = false;
+ _this.today = (0, _moment2['default'])();
- var focusedDate = currentMonth.clone().startOf('month');
- if (props.getFirstFocusableDay) {
- focusedDate = props.getFirstFocusableDay(currentMonth);
- }
+ _this.modifiers = {
+ today: function () {
+ function today(day) {
+ return _this.isToday(day);
+ }
- var horizontalMonthPadding = props.horizontalMonthPadding;
+ return today;
+ }(),
+ blocked: function () {
+ function blocked(day) {
+ return _this.isBlocked(day);
+ }
+ return blocked;
+ }(),
+ 'blocked-calendar': function () {
+ function blockedCalendar(day) {
+ return props.isDayBlocked(day);
+ }
- var translationValue = props.isRTL && _this.isHorizontal() ? -(0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding) : 0;
+ return blockedCalendar;
+ }(),
+ 'blocked-out-of-range': function () {
+ function blockedOutOfRange(day) {
+ return props.isOutsideRange(day);
+ }
- _this.hasSetInitialVisibleMonth = !props.hidden;
- _this.state = {
- currentMonth: currentMonth,
- monthTransition: null,
- translationValue: translationValue,
- scrollableMonthMultiple: 1,
- calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding),
- focusedDate: !props.hidden || props.isFocused ? focusedDate : null,
- nextFocusedDate: null,
- showKeyboardShortcuts: props.showKeyboardShortcuts,
- onKeyboardShortcutsPanelClose: function () {
- function onKeyboardShortcutsPanelClose() {}
+ return blockedOutOfRange;
+ }(),
+ 'highlighted-calendar': function () {
+ function highlightedCalendar(day) {
+ return props.isDayHighlighted(day);
+ }
- return onKeyboardShortcutsPanelClose;
+ return highlightedCalendar;
+ }(),
+ valid: function () {
+ function valid(day) {
+ return !_this.isBlocked(day);
+ }
+
+ return valid;
}(),
+ hovered: function () {
+ function hovered(day) {
+ return _this.isHovered(day);
+ }
- isTouchDevice: (0, _isTouchDevice2['default'])(),
- withMouseInteractions: true,
- calendarInfoWidth: 0,
- monthTitleHeight: null,
- hasSetHeight: false
+ return hovered;
+ }(),
+ selected: function () {
+ function selected(day) {
+ return _this.isSelected(day);
+ }
+
+ return selected;
+ }(),
+ 'first-day-of-week': function () {
+ function firstDayOfWeek(day) {
+ return _this.isFirstDayOfWeek(day);
+ }
+
+ return firstDayOfWeek;
+ }(),
+ 'last-day-of-week': function () {
+ function lastDayOfWeek(day) {
+ return _this.isLastDayOfWeek(day);
+ }
+
+ return lastDayOfWeek;
+ }()
};
- _this.setCalendarMonthWeeks(currentMonth);
+ var _this$getStateForNewM = _this.getStateForNewMonth(props),
+ currentMonth = _this$getStateForNewM.currentMonth,
+ visibleDays = _this$getStateForNewM.visibleDays;
- _this.calendarMonthGridHeight = 0;
- _this.setCalendarInfoWidthTimeout = null;
+ _this.state = {
+ hoverDate: null,
+ currentMonth: currentMonth,
+ visibleDays: visibleDays
+ };
+
+ _this.onDayMouseEnter = _this.onDayMouseEnter.bind(_this);
+ _this.onDayMouseLeave = _this.onDayMouseLeave.bind(_this);
+ _this.onDayClick = _this.onDayClick.bind(_this);
- _this.onKeyDown = _this.onKeyDown.bind(_this);
- _this.throttledKeyDown = (0, _throttle2['default'])(_this.onFinalKeyDown, 200, { trailing: false });
_this.onPrevMonthClick = _this.onPrevMonthClick.bind(_this);
_this.onNextMonthClick = _this.onNextMonthClick.bind(_this);
_this.onMonthChange = _this.onMonthChange.bind(_this);
_this.onYearChange = _this.onYearChange.bind(_this);
- _this.multiplyScrollableMonths = _this.multiplyScrollableMonths.bind(_this);
- _this.updateStateAfterMonthTransition = _this.updateStateAfterMonthTransition.bind(_this);
-
- _this.openKeyboardShortcutsPanel = _this.openKeyboardShortcutsPanel.bind(_this);
- _this.closeKeyboardShortcutsPanel = _this.closeKeyboardShortcutsPanel.bind(_this);
-
- _this.setCalendarInfoRef = _this.setCalendarInfoRef.bind(_this);
- _this.setContainerRef = _this.setContainerRef.bind(_this);
- _this.setTransitionContainerRef = _this.setTransitionContainerRef.bind(_this);
- _this.setMonthTitleHeight = _this.setMonthTitleHeight.bind(_this);
+ _this.getFirstFocusableDay = _this.getFirstFocusableDay.bind(_this);
return _this;
}
- _createClass(DayPicker, [{
+ _createClass(DayPickerSingleDateController, [{
key: 'componentDidMount',
value: function () {
function componentDidMount() {
- var currentMonth = this.state.currentMonth;
-
- if (this.calendarInfo) {
- this.setState({
- isTouchDevice: (0, _isTouchDevice2['default'])(),
- calendarInfoWidth: (0, _calculateDimension2['default'])(this.calendarInfo, 'width', true, true)
- });
- } else {
- this.setState({ isTouchDevice: (0, _isTouchDevice2['default'])() });
- }
-
- this.setCalendarMonthWeeks(currentMonth);
+ this.isTouchDevice = (0, _isTouchDevice2['default'])();
}
return componentDidMount;
@@ -10490,61 +11088,123 @@ var DayPicker = function (_React$Component) {
key: 'componentWillReceiveProps',
value: function () {
function componentWillReceiveProps(nextProps) {
- var hidden = nextProps.hidden,
- isFocused = nextProps.isFocused,
- showKeyboardShortcuts = nextProps.showKeyboardShortcuts,
- onBlur = nextProps.onBlur,
- renderMonthText = nextProps.renderMonthText,
- horizontalMonthPadding = nextProps.horizontalMonthPadding;
- var currentMonth = this.state.currentMonth;
+ var _this2 = this;
+
+ var date = nextProps.date,
+ focused = nextProps.focused,
+ isOutsideRange = nextProps.isOutsideRange,
+ isDayBlocked = nextProps.isDayBlocked,
+ isDayHighlighted = nextProps.isDayHighlighted,
+ initialVisibleMonth = nextProps.initialVisibleMonth,
+ numberOfMonths = nextProps.numberOfMonths,
+ enableOutsideDays = nextProps.enableOutsideDays;
+ var _props = this.props,
+ prevIsOutsideRange = _props.isOutsideRange,
+ prevIsDayBlocked = _props.isDayBlocked,
+ prevIsDayHighlighted = _props.isDayHighlighted,
+ prevNumberOfMonths = _props.numberOfMonths,
+ prevEnableOutsideDays = _props.enableOutsideDays,
+ prevInitialVisibleMonth = _props.initialVisibleMonth,
+ prevFocused = _props.focused,
+ prevDate = _props.date;
+ var visibleDays = this.state.visibleDays;
- if (!hidden) {
- if (!this.hasSetInitialVisibleMonth) {
- this.hasSetInitialVisibleMonth = true;
- this.setState({
- currentMonth: nextProps.initialVisibleMonth()
- });
- }
+ var recomputeOutsideRange = false;
+ var recomputeDayBlocked = false;
+ var recomputeDayHighlighted = false;
+
+ if (isOutsideRange !== prevIsOutsideRange) {
+ this.modifiers['blocked-out-of-range'] = function (day) {
+ return isOutsideRange(day);
+ };
+ recomputeOutsideRange = true;
}
- var _props = this.props,
- daySize = _props.daySize,
- prevIsFocused = _props.isFocused,
- prevRenderMonthText = _props.renderMonthText;
+ if (isDayBlocked !== prevIsDayBlocked) {
+ this.modifiers['blocked-calendar'] = function (day) {
+ return isDayBlocked(day);
+ };
+ recomputeDayBlocked = true;
+ }
+
+ if (isDayHighlighted !== prevIsDayHighlighted) {
+ this.modifiers['highlighted-calendar'] = function (day) {
+ return isDayHighlighted(day);
+ };
+ recomputeDayHighlighted = true;
+ }
+ var recomputePropModifiers = recomputeOutsideRange || recomputeDayBlocked || recomputeDayHighlighted;
+
+ if (numberOfMonths !== prevNumberOfMonths || enableOutsideDays !== prevEnableOutsideDays || initialVisibleMonth !== prevInitialVisibleMonth && !prevFocused && focused) {
+ var newMonthState = this.getStateForNewMonth(nextProps);
+ var currentMonth = newMonthState.currentMonth;
+ visibleDays = newMonthState.visibleDays;
- if (nextProps.daySize !== daySize) {
this.setState({
- calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(nextProps.daySize, horizontalMonthPadding)
+ currentMonth: currentMonth,
+ visibleDays: visibleDays
});
}
- if (isFocused !== prevIsFocused) {
- if (isFocused) {
- var focusedDate = this.getFocusedDay(currentMonth);
+ var didDateChange = date !== prevDate;
+ var didFocusChange = focused !== prevFocused;
- var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose;
+ var modifiers = {};
- if (nextProps.showKeyboardShortcuts) {
- // the ? shortcut came from the input and we should return input there once it is close
- onKeyboardShortcutsPanelClose = onBlur;
- }
+ if (didDateChange) {
+ modifiers = this.deleteModifier(modifiers, prevDate, 'selected');
+ modifiers = this.addModifier(modifiers, date, 'selected');
+ }
- this.setState({
- showKeyboardShortcuts: showKeyboardShortcuts,
- onKeyboardShortcutsPanelClose: onKeyboardShortcutsPanelClose,
- focusedDate: focusedDate,
- withMouseInteractions: false
+ if (didFocusChange || recomputePropModifiers) {
+ (0, _object4['default'])(visibleDays).forEach(function (days) {
+ Object.keys(days).forEach(function (day) {
+ var momentObj = (0, _moment2['default'])(day);
+ if (_this2.isBlocked(momentObj)) {
+ modifiers = _this2.addModifier(modifiers, momentObj, 'blocked');
+ } else {
+ modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked');
+ }
+
+ if (didFocusChange || recomputeOutsideRange) {
+ if (isOutsideRange(momentObj)) {
+ modifiers = _this2.addModifier(modifiers, momentObj, 'blocked-out-of-range');
+ } else {
+ modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked-out-of-range');
+ }
+ }
+
+ if (didFocusChange || recomputeDayBlocked) {
+ if (isDayBlocked(momentObj)) {
+ modifiers = _this2.addModifier(modifiers, momentObj, 'blocked-calendar');
+ } else {
+ modifiers = _this2.deleteModifier(modifiers, momentObj, 'blocked-calendar');
+ }
+ }
+
+ if (didFocusChange || recomputeDayHighlighted) {
+ if (isDayHighlighted(momentObj)) {
+ modifiers = _this2.addModifier(modifiers, momentObj, 'highlighted-calendar');
+ } else {
+ modifiers = _this2.deleteModifier(modifiers, momentObj, 'highlighted-calendar');
+ }
+ }
});
- } else {
- this.setState({ focusedDate: null });
- }
+ });
}
- if (renderMonthText !== prevRenderMonthText) {
+ var today = (0, _moment2['default'])();
+ if (!(0, _isSameDay2['default'])(this.today, today)) {
+ modifiers = this.deleteModifier(modifiers, this.today, 'today');
+ modifiers = this.addModifier(modifiers, today, 'today');
+ this.today = today;
+ }
+
+ if (Object.keys(modifiers).length > 0) {
this.setState({
- monthTitleHeight: null
+ visibleDays: (0, _object2['default'])({}, visibleDays, modifiers)
});
}
}
@@ -10552,256 +11212,155 @@ var DayPicker = function (_React$Component) {
return componentWillReceiveProps;
}()
}, {
- key: 'shouldComponentUpdate',
+ key: 'componentWillUpdate',
value: function () {
- function shouldComponentUpdate(nextProps, nextState) {
- return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
+ function componentWillUpdate() {
+ this.today = (0, _moment2['default'])();
}
- return shouldComponentUpdate;
+ return componentWillUpdate;
}()
}, {
- key: 'componentWillUpdate',
+ key: 'onDayClick',
value: function () {
- function componentWillUpdate() {
- var _this2 = this;
-
- var transitionDuration = this.props.transitionDuration;
-
- // Calculating the dimensions trigger a DOM repaint which
- // breaks the CSS transition.
- // The setTimeout will wait until the transition ends.
+ function onDayClick(day, e) {
+ if (e) e.preventDefault();
+ if (this.isBlocked(day)) return;
+ var _props2 = this.props,
+ onDateChange = _props2.onDateChange,
+ keepOpenOnDateSelect = _props2.keepOpenOnDateSelect,
+ onFocusChange = _props2.onFocusChange,
+ onClose = _props2.onClose;
- if (this.calendarInfo) {
- this.setCalendarInfoWidthTimeout = setTimeout(function () {
- var calendarInfoWidth = _this2.state.calendarInfoWidth;
- var calendarInfoPanelWidth = (0, _calculateDimension2['default'])(_this2.calendarInfo, 'width', true, true);
- if (calendarInfoWidth !== calendarInfoPanelWidth) {
- _this2.setState({
- calendarInfoWidth: calendarInfoPanelWidth
- });
- }
- }, transitionDuration);
+ onDateChange(day);
+ if (!keepOpenOnDateSelect) {
+ onFocusChange({ focused: false });
+ onClose({ date: day });
}
}
- return componentWillUpdate;
+ return onDayClick;
}()
}, {
- key: 'componentDidUpdate',
+ key: 'onDayMouseEnter',
value: function () {
- function componentDidUpdate(prevProps) {
- var _props2 = this.props,
- orientation = _props2.orientation,
- daySize = _props2.daySize,
- isFocused = _props2.isFocused,
- numberOfMonths = _props2.numberOfMonths;
+ function onDayMouseEnter(day) {
+ if (this.isTouchDevice) return;
var _state = this.state,
- focusedDate = _state.focusedDate,
- monthTitleHeight = _state.monthTitleHeight;
+ hoverDate = _state.hoverDate,
+ visibleDays = _state.visibleDays;
- if (this.isHorizontal() && (orientation !== prevProps.orientation || daySize !== prevProps.daySize)) {
- var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1);
- var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
- var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1;
- this.adjustDayPickerHeight(newMonthHeight);
- }
+ var modifiers = this.deleteModifier({}, hoverDate, 'hovered');
+ modifiers = this.addModifier(modifiers, day, 'hovered');
- if (!prevProps.isFocused && isFocused && !focusedDate) {
- this.container.focus();
- }
+ this.setState({
+ hoverDate: day,
+ visibleDays: (0, _object2['default'])({}, visibleDays, modifiers)
+ });
}
- return componentDidUpdate;
+ return onDayMouseEnter;
}()
}, {
- key: 'componentWillUnmount',
+ key: 'onDayMouseLeave',
value: function () {
- function componentWillUnmount() {
- clearTimeout(this.setCalendarInfoWidthTimeout);
- }
+ function onDayMouseLeave() {
+ var _state2 = this.state,
+ hoverDate = _state2.hoverDate,
+ visibleDays = _state2.visibleDays;
- return componentWillUnmount;
- }()
- }, {
- key: 'onKeyDown',
- value: function () {
- function onKeyDown(e) {
- e.stopPropagation();
- if (!_constants.MODIFIER_KEY_NAMES.has(e.key)) {
- this.throttledKeyDown(e);
- }
+ if (this.isTouchDevice || !hoverDate) return;
+
+ var modifiers = this.deleteModifier({}, hoverDate, 'hovered');
+
+ this.setState({
+ hoverDate: null,
+ visibleDays: (0, _object2['default'])({}, visibleDays, modifiers)
+ });
}
- return onKeyDown;
+ return onDayMouseLeave;
}()
}, {
- key: 'onFinalKeyDown',
+ key: 'onPrevMonthClick',
value: function () {
- function onFinalKeyDown(e) {
- this.setState({ withMouseInteractions: false });
-
+ function onPrevMonthClick() {
var _props3 = this.props,
- onBlur = _props3.onBlur,
- isRTL = _props3.isRTL;
- var _state2 = this.state,
- focusedDate = _state2.focusedDate,
- showKeyboardShortcuts = _state2.showKeyboardShortcuts;
-
- if (!focusedDate) return;
-
- var newFocusedDate = focusedDate.clone();
-
- var didTransitionMonth = false;
-
- // focus might be anywhere when the keyboard shortcuts panel is opened so we want to
- // return it to wherever it was before when the panel was opened
- var activeElement = (0, _getActiveElement2['default'])();
- var onKeyboardShortcutsPanelClose = function () {
- function onKeyboardShortcutsPanelClose() {
- if (activeElement) activeElement.focus();
- }
-
- return onKeyboardShortcutsPanelClose;
- }();
-
- switch (e.key) {
- case 'ArrowUp':
- e.preventDefault();
- newFocusedDate.subtract(1, 'week');
- didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
- break;
- case 'ArrowLeft':
- e.preventDefault();
- if (isRTL) {
- newFocusedDate.add(1, 'day');
- } else {
- newFocusedDate.subtract(1, 'day');
- }
- didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
- break;
- case 'Home':
- e.preventDefault();
- newFocusedDate.startOf('week');
- didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
- break;
- case 'PageUp':
- e.preventDefault();
- newFocusedDate.subtract(1, 'month');
- didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
- break;
-
- case 'ArrowDown':
- e.preventDefault();
- newFocusedDate.add(1, 'week');
- didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
- break;
- case 'ArrowRight':
- e.preventDefault();
- if (isRTL) {
- newFocusedDate.subtract(1, 'day');
- } else {
- newFocusedDate.add(1, 'day');
- }
- didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
- break;
- case 'End':
- e.preventDefault();
- newFocusedDate.endOf('week');
- didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
- break;
- case 'PageDown':
- e.preventDefault();
- newFocusedDate.add(1, 'month');
- didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
- break;
+ onPrevMonthClick = _props3.onPrevMonthClick,
+ numberOfMonths = _props3.numberOfMonths,
+ enableOutsideDays = _props3.enableOutsideDays;
+ var _state3 = this.state,
+ currentMonth = _state3.currentMonth,
+ visibleDays = _state3.visibleDays;
- case '?':
- this.openKeyboardShortcutsPanel(onKeyboardShortcutsPanelClose);
- break;
- case 'Escape':
- if (showKeyboardShortcuts) {
- this.closeKeyboardShortcutsPanel();
- } else {
- onBlur();
- }
- break;
+ var newVisibleDays = {};
+ Object.keys(visibleDays).sort().slice(0, numberOfMonths + 1).forEach(function (month) {
+ newVisibleDays[month] = visibleDays[month];
+ });
- default:
- break;
- }
+ var prevMonth = currentMonth.clone().subtract(1, 'month');
+ var prevMonthVisibleDays = (0, _getVisibleDays2['default'])(prevMonth, 1, enableOutsideDays);
- // If there was a month transition, do not update the focused date until the transition has
- // completed. Otherwise, attempting to focus on a DOM node may interrupt the CSS animation. If
- // didTransitionMonth is true, the focusedDate gets updated in #updateStateAfterMonthTransition
- if (!didTransitionMonth) {
- this.setState({
- focusedDate: newFocusedDate
- });
- }
+ this.setState({
+ currentMonth: prevMonth,
+ visibleDays: (0, _object2['default'])({}, newVisibleDays, this.getModifiers(prevMonthVisibleDays))
+ }, function () {
+ onPrevMonthClick(prevMonth.clone());
+ });
}
- return onFinalKeyDown;
+ return onPrevMonthClick;
}()
}, {
- key: 'onPrevMonthClick',
+ key: 'onNextMonthClick',
value: function () {
- function onPrevMonthClick(nextFocusedDate, e) {
+ function onNextMonthClick() {
var _props4 = this.props,
- daySize = _props4.daySize,
- isRTL = _props4.isRTL,
- numberOfMonths = _props4.numberOfMonths;
- var _state3 = this.state,
- calendarMonthWidth = _state3.calendarMonthWidth,
- monthTitleHeight = _state3.monthTitleHeight;
-
+ onNextMonthClick = _props4.onNextMonthClick,
+ numberOfMonths = _props4.numberOfMonths,
+ enableOutsideDays = _props4.enableOutsideDays;
+ var _state4 = this.state,
+ currentMonth = _state4.currentMonth,
+ visibleDays = _state4.visibleDays;
- if (e) e.preventDefault();
- var translationValue = void 0;
- if (this.isVertical()) {
- var calendarMonthWeeksHeight = this.calendarMonthWeeks[0] * (daySize - 1);
- translationValue = monthTitleHeight + calendarMonthWeeksHeight + 1;
- } else if (this.isHorizontal()) {
- translationValue = calendarMonthWidth;
- if (isRTL) {
- translationValue = -2 * calendarMonthWidth;
- }
+ var newVisibleDays = {};
+ Object.keys(visibleDays).sort().slice(1).forEach(function (month) {
+ newVisibleDays[month] = visibleDays[month];
+ });
- var visibleCalendarWeeks = this.calendarMonthWeeks.slice(0, numberOfMonths);
- var _calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
- var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight + 1;
- this.adjustDayPickerHeight(newMonthHeight);
- }
+ var nextMonth = currentMonth.clone().add(numberOfMonths, 'month');
+ var nextMonthVisibleDays = (0, _getVisibleDays2['default'])(nextMonth, 1, enableOutsideDays);
+ var newCurrentMonth = currentMonth.clone().add(1, 'month');
this.setState({
- monthTransition: PREV_TRANSITION,
- translationValue: translationValue,
- focusedDate: null,
- nextFocusedDate: nextFocusedDate
+ currentMonth: newCurrentMonth,
+ visibleDays: (0, _object2['default'])({}, newVisibleDays, this.getModifiers(nextMonthVisibleDays))
+ }, function () {
+ onNextMonthClick(newCurrentMonth.clone());
});
}
- return onPrevMonthClick;
+ return onNextMonthClick;
}()
}, {
key: 'onMonthChange',
value: function () {
- function onMonthChange(currentMonth) {
- this.setCalendarMonthWeeks(currentMonth);
- this.calculateAndSetDayPickerHeight();
+ function onMonthChange(newMonth) {
+ var _props5 = this.props,
+ numberOfMonths = _props5.numberOfMonths,
+ enableOutsideDays = _props5.enableOutsideDays,
+ orientation = _props5.orientation;
+
+ var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
+ var newVisibleDays = (0, _getVisibleDays2['default'])(newMonth, numberOfMonths, enableOutsideDays, withoutTransitionMonths);
- // Translation value is a hack to force an invisible transition that
- // properly rerenders the CalendarMonthGrid
this.setState({
- monthTransition: MONTH_SELECTION_TRANSITION,
- translationValue: 0.00001,
- focusedDate: null,
- nextFocusedDate: currentMonth,
- currentMonth: currentMonth
+ currentMonth: newMonth.clone(),
+ visibleDays: this.getModifiers(newVisibleDays)
});
}
@@ -10810,9276 +11369,6509 @@ var DayPicker = function (_React$Component) {
}, {
key: 'onYearChange',
value: function () {
- function onYearChange(currentMonth) {
- this.setCalendarMonthWeeks(currentMonth);
- this.calculateAndSetDayPickerHeight();
+ function onYearChange(newMonth) {
+ var _props6 = this.props,
+ numberOfMonths = _props6.numberOfMonths,
+ enableOutsideDays = _props6.enableOutsideDays,
+ orientation = _props6.orientation;
+
+ var withoutTransitionMonths = orientation === _constants.VERTICAL_SCROLLABLE;
+ var newVisibleDays = (0, _getVisibleDays2['default'])(newMonth, numberOfMonths, enableOutsideDays, withoutTransitionMonths);
- // Translation value is a hack to force an invisible transition that
- // properly rerenders the CalendarMonthGrid
this.setState({
- monthTransition: YEAR_SELECTION_TRANSITION,
- translationValue: 0.0001,
- focusedDate: null,
- nextFocusedDate: currentMonth,
- currentMonth: currentMonth
+ currentMonth: newMonth.clone(),
+ visibleDays: this.getModifiers(newVisibleDays)
});
}
return onYearChange;
}()
}, {
- key: 'onNextMonthClick',
+ key: 'getFirstFocusableDay',
value: function () {
- function onNextMonthClick(nextFocusedDate, e) {
- var _props5 = this.props,
- isRTL = _props5.isRTL,
- numberOfMonths = _props5.numberOfMonths,
- daySize = _props5.daySize;
- var _state4 = this.state,
- calendarMonthWidth = _state4.calendarMonthWidth,
- monthTitleHeight = _state4.monthTitleHeight;
-
+ function getFirstFocusableDay(newMonth) {
+ var _this3 = this;
- if (e) e.preventDefault();
+ var _props7 = this.props,
+ date = _props7.date,
+ numberOfMonths = _props7.numberOfMonths;
- var translationValue = void 0;
- if (this.isVertical()) {
- var firstVisibleMonthWeeks = this.calendarMonthWeeks[1];
- var calendarMonthWeeksHeight = firstVisibleMonthWeeks * (daySize - 1);
- translationValue = -(monthTitleHeight + calendarMonthWeeksHeight + 1);
+ var focusedDate = newMonth.clone().startOf('month');
+ if (date) {
+ focusedDate = date.clone();
}
- if (this.isHorizontal()) {
- translationValue = -calendarMonthWidth;
- if (isRTL) {
- translationValue = 0;
+ if (this.isBlocked(focusedDate)) {
+ var days = [];
+ var lastVisibleDay = newMonth.clone().add(numberOfMonths - 1, 'months').endOf('month');
+ var currentDay = focusedDate.clone();
+ while (!(0, _isAfterDay2['default'])(currentDay, lastVisibleDay)) {
+ currentDay = currentDay.clone().add(1, 'day');
+ days.push(currentDay);
}
- var visibleCalendarWeeks = this.calendarMonthWeeks.slice(2, numberOfMonths + 2);
- var _calendarMonthWeeksHeight2 = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
- var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight2 + 1;
- this.adjustDayPickerHeight(newMonthHeight);
+ var viableDays = days.filter(function (day) {
+ return !_this3.isBlocked(day) && (0, _isAfterDay2['default'])(day, focusedDate);
+ });
+ if (viableDays.length > 0) {
+ var _viableDays = _slicedToArray(viableDays, 1);
+
+ focusedDate = _viableDays[0];
+ }
}
- this.setState({
- monthTransition: NEXT_TRANSITION,
- translationValue: translationValue,
- focusedDate: null,
- nextFocusedDate: nextFocusedDate
- });
+ return focusedDate;
}
- return onNextMonthClick;
+ return getFirstFocusableDay;
}()
}, {
- key: 'getFirstDayOfWeek',
+ key: 'getModifiers',
value: function () {
- function getFirstDayOfWeek() {
- var firstDayOfWeek = this.props.firstDayOfWeek;
+ function getModifiers(visibleDays) {
+ var _this4 = this;
- if (firstDayOfWeek == null) {
- return _moment2['default'].localeData().firstDayOfWeek();
- }
+ var modifiers = {};
+ Object.keys(visibleDays).forEach(function (month) {
+ modifiers[month] = {};
+ visibleDays[month].forEach(function (day) {
+ modifiers[month][(0, _toISODateString2['default'])(day)] = _this4.getModifiersForDay(day);
+ });
+ });
- return firstDayOfWeek;
+ return modifiers;
}
- return getFirstDayOfWeek;
+ return getModifiers;
}()
}, {
- key: 'getFirstVisibleIndex',
+ key: 'getModifiersForDay',
value: function () {
- function getFirstVisibleIndex() {
- var orientation = this.props.orientation;
- var monthTransition = this.state.monthTransition;
-
-
- if (orientation === _constants.VERTICAL_SCROLLABLE) return 0;
-
- var firstVisibleMonthIndex = 1;
- if (monthTransition === PREV_TRANSITION) {
- firstVisibleMonthIndex -= 1;
- } else if (monthTransition === NEXT_TRANSITION) {
- firstVisibleMonthIndex += 1;
- }
+ function getModifiersForDay(day) {
+ var _this5 = this;
- return firstVisibleMonthIndex;
+ return new Set(Object.keys(this.modifiers).filter(function (modifier) {
+ return _this5.modifiers[modifier](day);
+ }));
}
- return getFirstVisibleIndex;
+ return getModifiersForDay;
}()
}, {
- key: 'getFocusedDay',
+ key: 'getStateForNewMonth',
value: function () {
- function getFocusedDay(newMonth) {
- var _props6 = this.props,
- getFirstFocusableDay = _props6.getFirstFocusableDay,
- numberOfMonths = _props6.numberOfMonths;
-
-
- var focusedDate = void 0;
- if (getFirstFocusableDay) {
- focusedDate = getFirstFocusableDay(newMonth);
- }
-
- if (newMonth && (!focusedDate || !(0, _isDayVisible2['default'])(focusedDate, newMonth, numberOfMonths))) {
- focusedDate = newMonth.clone().startOf('month');
- }
-
- return focusedDate;
- }
+ function getStateForNewMonth(nextProps) {
+ var _this6 = this;
- return getFocusedDay;
- }()
- }, {
- key: 'setMonthTitleHeight',
- value: function () {
- function setMonthTitleHeight(monthTitleHeight) {
- var _this3 = this;
+ var initialVisibleMonth = nextProps.initialVisibleMonth,
+ date = nextProps.date,
+ numberOfMonths = nextProps.numberOfMonths,
+ enableOutsideDays = nextProps.enableOutsideDays;
- this.setState({
- monthTitleHeight: monthTitleHeight
- }, function () {
- _this3.calculateAndSetDayPickerHeight();
+ var initialVisibleMonthThunk = initialVisibleMonth || (date ? function () {
+ return date;
+ } : function () {
+ return _this6.today;
});
+ var currentMonth = initialVisibleMonthThunk();
+ var visibleDays = this.getModifiers((0, _getVisibleDays2['default'])(currentMonth, numberOfMonths, enableOutsideDays));
+ return { currentMonth: currentMonth, visibleDays: visibleDays };
}
- return setMonthTitleHeight;
+ return getStateForNewMonth;
}()
}, {
- key: 'setCalendarMonthWeeks',
+ key: 'addModifier',
value: function () {
- function setCalendarMonthWeeks(currentMonth) {
- var numberOfMonths = this.props.numberOfMonths;
+ function addModifier(updatedDays, day, modifier) {
+ var _props8 = this.props,
+ numberOfVisibleMonths = _props8.numberOfMonths,
+ enableOutsideDays = _props8.enableOutsideDays,
+ orientation = _props8.orientation;
+ var _state5 = this.state,
+ firstVisibleMonth = _state5.currentMonth,
+ visibleDays = _state5.visibleDays;
- this.calendarMonthWeeks = [];
- var month = currentMonth.clone().subtract(1, 'months');
- var firstDayOfWeek = this.getFirstDayOfWeek();
- for (var i = 0; i < numberOfMonths + 2; i += 1) {
- var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(month, firstDayOfWeek);
- this.calendarMonthWeeks.push(numberOfWeeks);
- month = month.add(1, 'months');
+ var currentMonth = firstVisibleMonth;
+ var numberOfMonths = numberOfVisibleMonths;
+ if (orientation === _constants.VERTICAL_SCROLLABLE) {
+ numberOfMonths = Object.keys(visibleDays).length;
+ } else {
+ currentMonth = currentMonth.clone().subtract(1, 'month');
+ numberOfMonths += 2;
+ }
+ if (!day || !(0, _isDayVisible2['default'])(day, currentMonth, numberOfMonths, enableOutsideDays)) {
+ return updatedDays;
}
- }
-
- return setCalendarMonthWeeks;
- }()
- }, {
- key: 'setContainerRef',
- value: function () {
- function setContainerRef(ref) {
- this.container = ref;
- }
-
- return setContainerRef;
- }()
- }, {
- key: 'setCalendarInfoRef',
- value: function () {
- function setCalendarInfoRef(ref) {
- this.calendarInfo = ref;
- }
- return setCalendarInfoRef;
- }()
- }, {
- key: 'setTransitionContainerRef',
- value: function () {
- function setTransitionContainerRef(ref) {
- this.transitionContainer = ref;
- }
+ var iso = (0, _toISODateString2['default'])(day);
- return setTransitionContainerRef;
- }()
- }, {
- key: 'maybeTransitionNextMonth',
- value: function () {
- function maybeTransitionNextMonth(newFocusedDate) {
- var numberOfMonths = this.props.numberOfMonths;
- var _state5 = this.state,
- currentMonth = _state5.currentMonth,
- focusedDate = _state5.focusedDate;
+ var updatedDaysAfterAddition = (0, _object2['default'])({}, updatedDays);
+ if (enableOutsideDays) {
+ var monthsToUpdate = Object.keys(visibleDays).filter(function (monthKey) {
+ return Object.keys(visibleDays[monthKey]).indexOf(iso) > -1;
+ });
+ updatedDaysAfterAddition = monthsToUpdate.reduce(function (days, monthIso) {
+ var month = updatedDays[monthIso] || visibleDays[monthIso];
+ var modifiers = new Set(month[iso]);
+ modifiers.add(modifier);
+ return (0, _object2['default'])({}, days, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
+ }, updatedDaysAfterAddition);
+ } else {
+ var monthIso = (0, _toISOMonthString2['default'])(day);
+ var month = updatedDays[monthIso] || visibleDays[monthIso];
- var newFocusedDateMonth = newFocusedDate.month();
- var focusedDateMonth = focusedDate.month();
- var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths);
- if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) {
- this.onNextMonthClick(newFocusedDate);
- return true;
+ var modifiers = new Set(month[iso]);
+ modifiers.add(modifier);
+ updatedDaysAfterAddition = (0, _object2['default'])({}, updatedDaysAfterAddition, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
}
- return false;
+ return updatedDaysAfterAddition;
}
- return maybeTransitionNextMonth;
+ return addModifier;
}()
}, {
- key: 'maybeTransitionPrevMonth',
+ key: 'deleteModifier',
value: function () {
- function maybeTransitionPrevMonth(newFocusedDate) {
- var numberOfMonths = this.props.numberOfMonths;
+ function deleteModifier(updatedDays, day, modifier) {
+ var _props9 = this.props,
+ numberOfVisibleMonths = _props9.numberOfMonths,
+ enableOutsideDays = _props9.enableOutsideDays,
+ orientation = _props9.orientation;
var _state6 = this.state,
- currentMonth = _state6.currentMonth,
- focusedDate = _state6.focusedDate;
+ firstVisibleMonth = _state6.currentMonth,
+ visibleDays = _state6.visibleDays;
- var newFocusedDateMonth = newFocusedDate.month();
- var focusedDateMonth = focusedDate.month();
- var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths);
- if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) {
- this.onPrevMonthClick(newFocusedDate);
- return true;
+ var currentMonth = firstVisibleMonth;
+ var numberOfMonths = numberOfVisibleMonths;
+ if (orientation === _constants.VERTICAL_SCROLLABLE) {
+ numberOfMonths = Object.keys(visibleDays).length;
+ } else {
+ currentMonth = currentMonth.clone().subtract(1, 'month');
+ numberOfMonths += 2;
+ }
+ if (!day || !(0, _isDayVisible2['default'])(day, currentMonth, numberOfMonths, enableOutsideDays)) {
+ return updatedDays;
}
- return false;
- }
+ var iso = (0, _toISODateString2['default'])(day);
- return maybeTransitionPrevMonth;
- }()
- }, {
- key: 'multiplyScrollableMonths',
- value: function () {
- function multiplyScrollableMonths(e) {
- var onMultiplyScrollableMonths = this.props.onMultiplyScrollableMonths;
+ var updatedDaysAfterDeletion = (0, _object2['default'])({}, updatedDays);
+ if (enableOutsideDays) {
+ var monthsToUpdate = Object.keys(visibleDays).filter(function (monthKey) {
+ return Object.keys(visibleDays[monthKey]).indexOf(iso) > -1;
+ });
- if (e) e.preventDefault();
+ updatedDaysAfterDeletion = monthsToUpdate.reduce(function (days, monthIso) {
+ var month = updatedDays[monthIso] || visibleDays[monthIso];
+ var modifiers = new Set(month[iso]);
+ modifiers['delete'](modifier);
+ return (0, _object2['default'])({}, days, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
+ }, updatedDaysAfterDeletion);
+ } else {
+ var monthIso = (0, _toISOMonthString2['default'])(day);
+ var month = updatedDays[monthIso] || visibleDays[monthIso];
- if (onMultiplyScrollableMonths) onMultiplyScrollableMonths(e);
+ var modifiers = new Set(month[iso]);
+ modifiers['delete'](modifier);
+ updatedDaysAfterDeletion = (0, _object2['default'])({}, updatedDaysAfterDeletion, _defineProperty({}, monthIso, (0, _object2['default'])({}, month, _defineProperty({}, iso, modifiers))));
+ }
- this.setState(function (_ref) {
- var scrollableMonthMultiple = _ref.scrollableMonthMultiple;
- return {
- scrollableMonthMultiple: scrollableMonthMultiple + 1
- };
- });
+ return updatedDaysAfterDeletion;
}
- return multiplyScrollableMonths;
+ return deleteModifier;
}()
}, {
- key: 'isHorizontal',
+ key: 'isBlocked',
value: function () {
- function isHorizontal() {
- var orientation = this.props.orientation;
+ function isBlocked(day) {
+ var _props10 = this.props,
+ isDayBlocked = _props10.isDayBlocked,
+ isOutsideRange = _props10.isOutsideRange;
- return orientation === _constants.HORIZONTAL_ORIENTATION;
+ return isDayBlocked(day) || isOutsideRange(day);
}
- return isHorizontal;
+ return isBlocked;
}()
}, {
- key: 'isVertical',
+ key: 'isHovered',
value: function () {
- function isVertical() {
- var orientation = this.props.orientation;
+ function isHovered(day) {
+ var _ref = this.state || {},
+ hoverDate = _ref.hoverDate;
- return orientation === _constants.VERTICAL_ORIENTATION || orientation === _constants.VERTICAL_SCROLLABLE;
+ return (0, _isSameDay2['default'])(day, hoverDate);
}
- return isVertical;
+ return isHovered;
}()
}, {
- key: 'updateStateAfterMonthTransition',
+ key: 'isSelected',
value: function () {
- function updateStateAfterMonthTransition() {
- var _this4 = this;
-
- var _props7 = this.props,
- onPrevMonthClick = _props7.onPrevMonthClick,
- onNextMonthClick = _props7.onNextMonthClick,
- numberOfMonths = _props7.numberOfMonths,
- onMonthChange = _props7.onMonthChange,
- onYearChange = _props7.onYearChange,
- isRTL = _props7.isRTL;
- var _state7 = this.state,
- currentMonth = _state7.currentMonth,
- monthTransition = _state7.monthTransition,
- focusedDate = _state7.focusedDate,
- nextFocusedDate = _state7.nextFocusedDate,
- withMouseInteractions = _state7.withMouseInteractions,
- calendarMonthWidth = _state7.calendarMonthWidth;
-
-
- if (!monthTransition) return;
-
- var newMonth = currentMonth.clone();
- var firstDayOfWeek = this.getFirstDayOfWeek();
- if (monthTransition === PREV_TRANSITION) {
- newMonth.subtract(1, 'month');
- if (onPrevMonthClick) onPrevMonthClick(newMonth);
- var newInvisibleMonth = newMonth.clone().subtract(1, 'month');
- var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(newInvisibleMonth, firstDayOfWeek);
- this.calendarMonthWeeks = [numberOfWeeks].concat(_toConsumableArray(this.calendarMonthWeeks.slice(0, -1)));
- } else if (monthTransition === NEXT_TRANSITION) {
- newMonth.add(1, 'month');
- if (onNextMonthClick) onNextMonthClick(newMonth);
- var _newInvisibleMonth = newMonth.clone().add(numberOfMonths, 'month');
- var _numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(_newInvisibleMonth, firstDayOfWeek);
- this.calendarMonthWeeks = [].concat(_toConsumableArray(this.calendarMonthWeeks.slice(1)), [_numberOfWeeks]);
- } else if (monthTransition === MONTH_SELECTION_TRANSITION) {
- if (onMonthChange) onMonthChange(newMonth);
- } else if (monthTransition === YEAR_SELECTION_TRANSITION) {
- if (onYearChange) onYearChange(newMonth);
- }
-
- var newFocusedDate = null;
- if (nextFocusedDate) {
- newFocusedDate = nextFocusedDate;
- } else if (!focusedDate && !withMouseInteractions) {
- newFocusedDate = this.getFocusedDay(newMonth);
- }
+ function isSelected(day) {
+ var date = this.props.date;
- this.setState({
- currentMonth: newMonth,
- monthTransition: null,
- translationValue: isRTL && this.isHorizontal() ? -calendarMonthWidth : 0,
- nextFocusedDate: null,
- focusedDate: newFocusedDate
- }, function () {
- // we don't want to focus on the relevant calendar day after a month transition
- // if the user is navigating around using a mouse
- if (withMouseInteractions) {
- var activeElement = (0, _getActiveElement2['default'])();
- if (activeElement && activeElement !== document.body && _this4.container.contains(activeElement)) {
- activeElement.blur();
- }
- }
- });
+ return (0, _isSameDay2['default'])(day, date);
}
- return updateStateAfterMonthTransition;
+ return isSelected;
}()
}, {
- key: 'adjustDayPickerHeight',
+ key: 'isToday',
value: function () {
- function adjustDayPickerHeight(newMonthHeight) {
- var _this5 = this;
-
- var monthHeight = newMonthHeight + MONTH_PADDING;
- if (monthHeight !== this.calendarMonthGridHeight) {
- this.transitionContainer.style.height = String(monthHeight) + 'px';
- if (!this.calendarMonthGridHeight) {
- setTimeout(function () {
- _this5.setState({ hasSetHeight: true });
- }, 0);
- }
- this.calendarMonthGridHeight = monthHeight;
- }
+ function isToday(day) {
+ return (0, _isSameDay2['default'])(day, this.today);
}
- return adjustDayPickerHeight;
+ return isToday;
}()
}, {
- key: 'calculateAndSetDayPickerHeight',
+ key: 'isFirstDayOfWeek',
value: function () {
- function calculateAndSetDayPickerHeight() {
- var _props8 = this.props,
- daySize = _props8.daySize,
- numberOfMonths = _props8.numberOfMonths;
- var monthTitleHeight = this.state.monthTitleHeight;
-
-
- var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1);
- var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
- var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1;
+ function isFirstDayOfWeek(day) {
+ var firstDayOfWeek = this.props.firstDayOfWeek;
- if (this.isHorizontal()) {
- this.adjustDayPickerHeight(newMonthHeight);
- }
+ return day.day() === (firstDayOfWeek || _moment2['default'].localeData().firstDayOfWeek());
}
- return calculateAndSetDayPickerHeight;
+ return isFirstDayOfWeek;
}()
}, {
- key: 'openKeyboardShortcutsPanel',
+ key: 'isLastDayOfWeek',
value: function () {
- function openKeyboardShortcutsPanel(onCloseCallBack) {
- this.setState({
- showKeyboardShortcuts: true,
- onKeyboardShortcutsPanelClose: onCloseCallBack
- });
+ function isLastDayOfWeek(day) {
+ var firstDayOfWeek = this.props.firstDayOfWeek;
+
+ return day.day() === ((firstDayOfWeek || _moment2['default'].localeData().firstDayOfWeek()) + 6) % 7;
}
- return openKeyboardShortcutsPanel;
+ return isLastDayOfWeek;
}()
}, {
- key: 'closeKeyboardShortcutsPanel',
+ key: 'render',
value: function () {
- function closeKeyboardShortcutsPanel() {
- var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose;
+ function render() {
+ var _props11 = this.props,
+ numberOfMonths = _props11.numberOfMonths,
+ orientation = _props11.orientation,
+ monthFormat = _props11.monthFormat,
+ renderMonthText = _props11.renderMonthText,
+ navPrev = _props11.navPrev,
+ navNext = _props11.navNext,
+ onOutsideClick = _props11.onOutsideClick,
+ withPortal = _props11.withPortal,
+ focused = _props11.focused,
+ enableOutsideDays = _props11.enableOutsideDays,
+ hideKeyboardShortcutsPanel = _props11.hideKeyboardShortcutsPanel,
+ daySize = _props11.daySize,
+ firstDayOfWeek = _props11.firstDayOfWeek,
+ renderCalendarDay = _props11.renderCalendarDay,
+ renderDayContents = _props11.renderDayContents,
+ renderCalendarInfo = _props11.renderCalendarInfo,
+ renderMonthElement = _props11.renderMonthElement,
+ calendarInfoPosition = _props11.calendarInfoPosition,
+ isFocused = _props11.isFocused,
+ isRTL = _props11.isRTL,
+ phrases = _props11.phrases,
+ dayAriaLabelFormat = _props11.dayAriaLabelFormat,
+ onBlur = _props11.onBlur,
+ showKeyboardShortcuts = _props11.showKeyboardShortcuts,
+ weekDayFormat = _props11.weekDayFormat,
+ verticalHeight = _props11.verticalHeight,
+ noBorder = _props11.noBorder,
+ transitionDuration = _props11.transitionDuration,
+ verticalBorderSpacing = _props11.verticalBorderSpacing,
+ horizontalMonthPadding = _props11.horizontalMonthPadding;
+ var _state7 = this.state,
+ currentMonth = _state7.currentMonth,
+ visibleDays = _state7.visibleDays;
- if (onKeyboardShortcutsPanelClose) {
- onKeyboardShortcutsPanelClose();
- }
+ return _react2['default'].createElement(_DayPicker2['default'], {
+ orientation: orientation,
+ enableOutsideDays: enableOutsideDays,
+ modifiers: visibleDays,
+ numberOfMonths: numberOfMonths,
+ onDayClick: this.onDayClick,
+ onDayMouseEnter: this.onDayMouseEnter,
+ onDayMouseLeave: this.onDayMouseLeave,
+ onPrevMonthClick: this.onPrevMonthClick,
+ onNextMonthClick: this.onNextMonthClick,
+ onMonthChange: this.onMonthChange,
+ onYearChange: this.onYearChange,
+ monthFormat: monthFormat,
+ withPortal: withPortal,
+ hidden: !focused,
+ hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
+ initialVisibleMonth: function () {
+ function initialVisibleMonth() {
+ return currentMonth;
+ }
- this.setState({
- onKeyboardShortcutsPanelClose: null,
- showKeyboardShortcuts: false
+ return initialVisibleMonth;
+ }(),
+ firstDayOfWeek: firstDayOfWeek,
+ onOutsideClick: onOutsideClick,
+ navPrev: navPrev,
+ navNext: navNext,
+ renderMonthText: renderMonthText,
+ renderCalendarDay: renderCalendarDay,
+ renderDayContents: renderDayContents,
+ renderCalendarInfo: renderCalendarInfo,
+ renderMonthElement: renderMonthElement,
+ calendarInfoPosition: calendarInfoPosition,
+ isFocused: isFocused,
+ getFirstFocusableDay: this.getFirstFocusableDay,
+ onBlur: onBlur,
+ phrases: phrases,
+ daySize: daySize,
+ isRTL: isRTL,
+ showKeyboardShortcuts: showKeyboardShortcuts,
+ weekDayFormat: weekDayFormat,
+ dayAriaLabelFormat: dayAriaLabelFormat,
+ verticalHeight: verticalHeight,
+ noBorder: noBorder,
+ transitionDuration: transitionDuration,
+ verticalBorderSpacing: verticalBorderSpacing,
+ horizontalMonthPadding: horizontalMonthPadding
});
}
- return closeKeyboardShortcutsPanel;
+ return render;
}()
- }, {
- key: 'renderNavigation',
- value: function () {
- function renderNavigation() {
- var _this6 = this;
+ }]);
- var _props9 = this.props,
- navPrev = _props9.navPrev,
- navNext = _props9.navNext,
- noNavButtons = _props9.noNavButtons,
- orientation = _props9.orientation,
- phrases = _props9.phrases,
- isRTL = _props9.isRTL;
+ return DayPickerSingleDateController;
+}(_react2['default'].Component);
+exports.Z = DayPickerSingleDateController;
- if (noNavButtons) {
- return null;
- }
- var onNextMonthClick = void 0;
- if (orientation === _constants.VERTICAL_SCROLLABLE) {
- onNextMonthClick = this.multiplyScrollableMonths;
- } else {
- onNextMonthClick = function () {
- function onNextMonthClick(e) {
- _this6.onNextMonthClick(null, e);
- }
+DayPickerSingleDateController.propTypes = propTypes;
+DayPickerSingleDateController.defaultProps = defaultProps;
- return onNextMonthClick;
- }();
- }
+/***/ }),
- return _react2['default'].createElement(_DayPickerNavigation2['default'], {
- onPrevMonthClick: function () {
- function onPrevMonthClick(e) {
- _this6.onPrevMonthClick(null, e);
- }
+/***/ 5820:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- return onPrevMonthClick;
- }(),
- onNextMonthClick: onNextMonthClick,
- navPrev: navPrev,
- navNext: navNext,
- orientation: orientation,
- phrases: phrases,
- isRTL: isRTL
- });
- }
+"use strict";
- return renderNavigation;
- }()
- }, {
- key: 'renderWeekHeader',
- value: function () {
- function renderWeekHeader(index) {
- var _props10 = this.props,
- daySize = _props10.daySize,
- horizontalMonthPadding = _props10.horizontalMonthPadding,
- orientation = _props10.orientation,
- weekDayFormat = _props10.weekDayFormat,
- styles = _props10.styles;
- var calendarMonthWidth = this.state.calendarMonthWidth;
- var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
- var horizontalStyle = {
- left: index * calendarMonthWidth
- };
- var verticalStyle = {
- marginLeft: -calendarMonthWidth / 2
- };
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
- var weekHeaderStyle = {}; // no styles applied to the vertical-scrollable orientation
- if (this.isHorizontal()) {
- weekHeaderStyle = horizontalStyle;
- } else if (this.isVertical() && !verticalScrollable) {
- weekHeaderStyle = verticalStyle;
- }
+var _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; };
- var firstDayOfWeek = this.getFirstDayOfWeek();
+var _object = __webpack_require__(4011);
- var header = [];
- for (var i = 0; i < 7; i += 1) {
- header.push(_react2['default'].createElement(
- 'li',
- _extends({ key: i }, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader_li, { width: daySize })),
- _react2['default'].createElement(
- 'small',
- null,
- (0, _moment2['default'])().day((i + firstDayOfWeek) % 7).format(weekDayFormat)
- )
- ));
- }
+var _object2 = _interopRequireDefault(_object);
- return _react2['default'].createElement(
- 'div',
- _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader, this.isVertical() && styles.DayPicker_weekHeader__vertical, verticalScrollable && styles.DayPicker_weekHeader__verticalScrollable, weekHeaderStyle, { padding: '0 ' + String(horizontalMonthPadding) + 'px' }), {
- key: 'week-' + String(index)
- }),
- _react2['default'].createElement(
- 'ul',
- (0, _reactWithStyles.css)(styles.DayPicker_weekHeader_ul),
- header
- )
- );
- }
+var _react = __webpack_require__(9196);
- return renderWeekHeader;
- }()
- }, {
- key: 'render',
- value: function () {
- function render() {
- var _this7 = this;
+var _react2 = _interopRequireDefault(_react);
- var _state8 = this.state,
- calendarMonthWidth = _state8.calendarMonthWidth,
- currentMonth = _state8.currentMonth,
- monthTransition = _state8.monthTransition,
- translationValue = _state8.translationValue,
- scrollableMonthMultiple = _state8.scrollableMonthMultiple,
- focusedDate = _state8.focusedDate,
- showKeyboardShortcuts = _state8.showKeyboardShortcuts,
- isTouch = _state8.isTouchDevice,
- hasSetHeight = _state8.hasSetHeight,
- calendarInfoWidth = _state8.calendarInfoWidth,
- monthTitleHeight = _state8.monthTitleHeight;
- var _props11 = this.props,
- enableOutsideDays = _props11.enableOutsideDays,
- numberOfMonths = _props11.numberOfMonths,
- orientation = _props11.orientation,
- modifiers = _props11.modifiers,
- withPortal = _props11.withPortal,
- onDayClick = _props11.onDayClick,
- onDayMouseEnter = _props11.onDayMouseEnter,
- onDayMouseLeave = _props11.onDayMouseLeave,
- firstDayOfWeek = _props11.firstDayOfWeek,
- renderMonthText = _props11.renderMonthText,
- renderCalendarDay = _props11.renderCalendarDay,
- renderDayContents = _props11.renderDayContents,
- renderCalendarInfo = _props11.renderCalendarInfo,
- renderMonthElement = _props11.renderMonthElement,
- calendarInfoPosition = _props11.calendarInfoPosition,
- hideKeyboardShortcutsPanel = _props11.hideKeyboardShortcutsPanel,
- onOutsideClick = _props11.onOutsideClick,
- monthFormat = _props11.monthFormat,
- daySize = _props11.daySize,
- isFocused = _props11.isFocused,
- isRTL = _props11.isRTL,
- styles = _props11.styles,
- theme = _props11.theme,
- phrases = _props11.phrases,
- verticalHeight = _props11.verticalHeight,
- dayAriaLabelFormat = _props11.dayAriaLabelFormat,
- noBorder = _props11.noBorder,
- transitionDuration = _props11.transitionDuration,
- verticalBorderSpacing = _props11.verticalBorderSpacing,
- horizontalMonthPadding = _props11.horizontalMonthPadding;
- var dayPickerHorizontalPadding = theme.reactDates.spacing.dayPickerHorizontalPadding;
+var _propTypes = __webpack_require__(2652);
+var _propTypes2 = _interopRequireDefault(_propTypes);
- var isHorizontal = this.isHorizontal();
+var _airbnbPropTypes = __webpack_require__(4882);
- var numOfWeekHeaders = this.isVertical() ? 1 : numberOfMonths;
- var weekHeaders = [];
- for (var i = 0; i < numOfWeekHeaders; i += 1) {
- weekHeaders.push(this.renderWeekHeader(i));
- }
+var _reactWithStyles = __webpack_require__(3576);
- var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
- var height = void 0;
- if (isHorizontal) {
- height = this.calendarMonthGridHeight;
- } else if (this.isVertical() && !verticalScrollable && !withPortal) {
- // If the user doesn't set a desired height,
- // we default back to this kind of made-up value that generally looks good
- height = verticalHeight || 1.75 * calendarMonthWidth;
- }
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- var isCalendarMonthGridAnimating = monthTransition !== null;
+var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
+ unicode: _propTypes2['default'].string.isRequired,
+ label: _propTypes2['default'].string.isRequired,
+ action: _propTypes2['default'].string.isRequired,
+ block: _propTypes2['default'].bool
+}));
- var shouldFocusDate = !isCalendarMonthGridAnimating && isFocused;
+var defaultProps = {
+ block: false
+};
- var keyboardShortcutButtonLocation = _DayPickerKeyboardShortcuts.BOTTOM_RIGHT;
- if (this.isVertical()) {
- keyboardShortcutButtonLocation = withPortal ? _DayPickerKeyboardShortcuts.TOP_LEFT : _DayPickerKeyboardShortcuts.TOP_RIGHT;
- }
+function KeyboardShortcutRow(_ref) {
+ var unicode = _ref.unicode,
+ label = _ref.label,
+ action = _ref.action,
+ block = _ref.block,
+ styles = _ref.styles;
- var shouldAnimateHeight = isHorizontal && hasSetHeight;
+ return _react2['default'].createElement(
+ 'li',
+ (0, _reactWithStyles.css)(styles.KeyboardShortcutRow, block && styles.KeyboardShortcutRow__block),
+ _react2['default'].createElement(
+ 'div',
+ (0, _reactWithStyles.css)(styles.KeyboardShortcutRow_keyContainer, block && styles.KeyboardShortcutRow_keyContainer__block),
+ _react2['default'].createElement(
+ 'span',
+ _extends({}, (0, _reactWithStyles.css)(styles.KeyboardShortcutRow_key), {
+ role: 'img',
+ 'aria-label': String(label) + ',' // add comma so screen readers will pause before reading action
+ }),
+ unicode
+ )
+ ),
+ _react2['default'].createElement(
+ 'div',
+ (0, _reactWithStyles.css)(styles.KeyboardShortcutRow_action),
+ action
+ )
+ );
+}
- var calendarInfoPositionTop = calendarInfoPosition === _constants.INFO_POSITION_TOP;
- var calendarInfoPositionBottom = calendarInfoPosition === _constants.INFO_POSITION_BOTTOM;
- var calendarInfoPositionBefore = calendarInfoPosition === _constants.INFO_POSITION_BEFORE;
- var calendarInfoPositionAfter = calendarInfoPosition === _constants.INFO_POSITION_AFTER;
- var calendarInfoIsInline = calendarInfoPositionBefore || calendarInfoPositionAfter;
+KeyboardShortcutRow.propTypes = propTypes;
+KeyboardShortcutRow.defaultProps = defaultProps;
- var calendarInfo = renderCalendarInfo && _react2['default'].createElement(
- 'div',
- _extends({
- ref: this.setCalendarInfoRef
- }, (0, _reactWithStyles.css)(calendarInfoIsInline && styles.DayPicker_calendarInfo__horizontal)),
- renderCalendarInfo()
- );
+exports["default"] = (0, _reactWithStyles.withStyles)(function (_ref2) {
+ var color = _ref2.reactDates.color;
+ return {
+ KeyboardShortcutRow: {
+ listStyle: 'none',
+ margin: '6px 0'
+ },
- var calendarInfoPanelWidth = renderCalendarInfo && calendarInfoIsInline ? calendarInfoWidth : 0;
+ KeyboardShortcutRow__block: {
+ marginBottom: 16
+ },
- var firstVisibleMonthIndex = this.getFirstVisibleIndex();
- var wrapperHorizontalWidth = calendarMonthWidth * numberOfMonths + 2 * dayPickerHorizontalPadding;
- // Adding `1px` because of whitespace between 2 inline-block
- var fullHorizontalWidth = wrapperHorizontalWidth + calendarInfoPanelWidth + 1;
+ KeyboardShortcutRow_keyContainer: {
+ display: 'inline-block',
+ whiteSpace: 'nowrap',
+ textAlign: 'right',
+ marginRight: 6
+ },
- var transitionContainerStyle = {
- width: isHorizontal && wrapperHorizontalWidth,
- height: height
- };
+ KeyboardShortcutRow_keyContainer__block: {
+ textAlign: 'left',
+ display: 'inline'
+ },
- var dayPickerWrapperStyle = {
- width: isHorizontal && wrapperHorizontalWidth
- };
+ KeyboardShortcutRow_key: {
+ fontFamily: 'monospace',
+ fontSize: 12,
+ textTransform: 'uppercase',
+ background: color.core.grayLightest,
+ padding: '2px 6px'
+ },
- var dayPickerStyle = {
- width: isHorizontal && fullHorizontalWidth,
+ KeyboardShortcutRow_action: {
+ display: 'inline',
+ wordBreak: 'break-word',
+ marginLeft: 8
+ }
+ };
+})(KeyboardShortcutRow);
- // These values are to center the datepicker (approximately) on the page
- marginLeft: isHorizontal && withPortal ? -fullHorizontalWidth / 2 : null,
- marginTop: isHorizontal && withPortal ? -calendarMonthWidth / 2 : null
- };
+/***/ }),
- return _react2['default'].createElement(
- 'div',
- _extends({
- role: 'application',
- 'aria-label': phrases.calendarLabel
- }, (0, _reactWithStyles.css)(styles.DayPicker, isHorizontal && styles.DayPicker__horizontal, verticalScrollable && styles.DayPicker__verticalScrollable, isHorizontal && withPortal && styles.DayPicker_portal__horizontal, this.isVertical() && withPortal && styles.DayPicker_portal__vertical, dayPickerStyle, !monthTitleHeight && styles.DayPicker__hidden, !noBorder && styles.DayPicker__withBorder)),
- _react2['default'].createElement(
- _reactOutsideClickHandler2['default'],
- { onOutsideClick: onOutsideClick },
- (calendarInfoPositionTop || calendarInfoPositionBefore) && calendarInfo,
- _react2['default'].createElement(
- 'div',
- (0, _reactWithStyles.css)(dayPickerWrapperStyle, calendarInfoIsInline && isHorizontal && styles.DayPicker_wrapper__horizontal),
- _react2['default'].createElement(
- 'div',
- _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeaders, isHorizontal && styles.DayPicker_weekHeaders__horizontal), {
- 'aria-hidden': 'true',
- role: 'presentation'
- }),
- weekHeaders
- ),
- _react2['default'].createElement(
- 'div',
- _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_focusRegion), {
- ref: this.setContainerRef,
- onClick: function () {
- function onClick(e) {
- e.stopPropagation();
- }
+/***/ 8:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- return onClick;
- }(),
- onKeyDown: this.onKeyDown,
- onMouseUp: function () {
- function onMouseUp() {
- _this7.setState({ withMouseInteractions: true });
- }
+"use strict";
- return onMouseUp;
- }(),
- role: 'region',
- tabIndex: -1
- }),
- !verticalScrollable && this.renderNavigation(),
- _react2['default'].createElement(
- 'div',
- _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_transitionContainer, shouldAnimateHeight && styles.DayPicker_transitionContainer__horizontal, this.isVertical() && styles.DayPicker_transitionContainer__vertical, verticalScrollable && styles.DayPicker_transitionContainer__verticalScrollable, transitionContainerStyle), {
- ref: this.setTransitionContainerRef
- }),
- _react2['default'].createElement(_CalendarMonthGrid2['default'], {
- setMonthTitleHeight: !monthTitleHeight ? this.setMonthTitleHeight : undefined,
- translationValue: translationValue,
- enableOutsideDays: enableOutsideDays,
- firstVisibleMonthIndex: firstVisibleMonthIndex,
- initialMonth: currentMonth,
- isAnimating: isCalendarMonthGridAnimating,
- modifiers: modifiers,
- orientation: orientation,
- numberOfMonths: numberOfMonths * scrollableMonthMultiple,
- onDayClick: onDayClick,
- onDayMouseEnter: onDayMouseEnter,
- onDayMouseLeave: onDayMouseLeave,
- onMonthChange: this.onMonthChange,
- onYearChange: this.onYearChange,
- renderMonthText: renderMonthText,
- renderCalendarDay: renderCalendarDay,
- renderDayContents: renderDayContents,
- renderMonthElement: renderMonthElement,
- onMonthTransitionEnd: this.updateStateAfterMonthTransition,
- monthFormat: monthFormat,
- daySize: daySize,
- firstDayOfWeek: firstDayOfWeek,
- isFocused: shouldFocusDate,
- focusedDate: focusedDate,
- phrases: phrases,
- isRTL: isRTL,
- dayAriaLabelFormat: dayAriaLabelFormat,
- transitionDuration: transitionDuration,
- verticalBorderSpacing: verticalBorderSpacing,
- horizontalMonthPadding: horizontalMonthPadding
- }),
- verticalScrollable && this.renderNavigation()
- ),
- !isTouch && !hideKeyboardShortcutsPanel && _react2['default'].createElement(_DayPickerKeyboardShortcuts2['default'], {
- block: this.isVertical() && !withPortal,
- buttonLocation: keyboardShortcutButtonLocation,
- showKeyboardShortcutsPanel: showKeyboardShortcuts,
- openKeyboardShortcutsPanel: this.openKeyboardShortcutsPanel,
- closeKeyboardShortcutsPanel: this.closeKeyboardShortcutsPanel,
- phrases: phrases
- })
- )
- ),
- (calendarInfoPositionBottom || calendarInfoPositionAfter) && calendarInfo
- )
- );
- }
- return render;
- }()
- }]);
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
- return DayPicker;
-}(_react2['default'].Component);
+var _react = __webpack_require__(9196);
-DayPicker.propTypes = propTypes;
-DayPicker.defaultProps = defaultProps;
+var _react2 = _interopRequireDefault(_react);
-exports.PureDayPicker = DayPicker;
-exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
- var _ref2$reactDates = _ref2.reactDates,
- color = _ref2$reactDates.color,
- font = _ref2$reactDates.font,
- noScrollBarOnVerticalScrollable = _ref2$reactDates.noScrollBarOnVerticalScrollable,
- spacing = _ref2$reactDates.spacing,
- zIndex = _ref2$reactDates.zIndex;
- return {
- DayPicker: {
- background: color.background,
- position: 'relative',
- textAlign: 'left'
- },
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- DayPicker__horizontal: {
- background: color.background
- },
+var LeftArrow = function () {
+ function LeftArrow(props) {
+ return _react2['default'].createElement(
+ 'svg',
+ props,
+ _react2['default'].createElement('path', {
+ d: 'M336.2 274.5l-210.1 210h805.4c13 0 23 10 23 23s-10 23-23 23H126.1l210.1 210.1c11 11 11 21 0 32-5 5-10 7-16 7s-11-2-16-7l-249.1-249c-11-11-11-21 0-32l249.1-249.1c21-21.1 53 10.9 32 32z'
+ })
+ );
+ }
- DayPicker__verticalScrollable: {
- height: '100%'
- },
+ return LeftArrow;
+}();
- DayPicker__hidden: {
- visibility: 'hidden'
- },
+LeftArrow.defaultProps = {
+ viewBox: '0 0 1000 1000'
+};
+exports["default"] = LeftArrow;
- DayPicker__withBorder: {
- boxShadow: '0 2px 6px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.07)',
- borderRadius: 3
- },
+/***/ }),
- DayPicker_portal__horizontal: {
- boxShadow: 'none',
- position: 'absolute',
- left: '50%',
- top: '50%'
- },
+/***/ 4921:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- DayPicker_portal__vertical: {
- position: 'initial'
- },
+"use strict";
- DayPicker_focusRegion: {
- outline: 'none'
- },
- DayPicker_calendarInfo__horizontal: {
- display: 'inline-block',
- verticalAlign: 'top'
- },
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
- DayPicker_wrapper__horizontal: {
- display: 'inline-block',
- verticalAlign: 'top'
- },
+var _react = __webpack_require__(9196);
- DayPicker_weekHeaders: {
- position: 'relative'
- },
+var _react2 = _interopRequireDefault(_react);
- DayPicker_weekHeaders__horizontal: {
- marginLeft: spacing.dayPickerHorizontalPadding
- },
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- DayPicker_weekHeader: {
- color: color.placeholderText,
- position: 'absolute',
- top: 62,
- zIndex: zIndex + 2,
- textAlign: 'left'
- },
+var RightArrow = function () {
+ function RightArrow(props) {
+ return _react2['default'].createElement(
+ 'svg',
+ props,
+ _react2['default'].createElement('path', {
+ d: 'M694.4 242.4l249.1 249.1c11 11 11 21 0 32L694.4 772.7c-5 5-10 7-16 7s-11-2-16-7c-11-11-11-21 0-32l210.1-210.1H67.1c-13 0-23-10-23-23s10-23 23-23h805.4L662.4 274.5c-21-21.1 11-53.1 32-32.1z'
+ })
+ );
+ }
- DayPicker_weekHeader__vertical: {
- left: '50%'
- },
+ return RightArrow;
+}();
- DayPicker_weekHeader__verticalScrollable: {
- top: 0,
- display: 'table-row',
- borderBottom: '1px solid ' + String(color.core.border),
- background: color.background,
- marginLeft: 0,
- left: 0,
- width: '100%',
- textAlign: 'center'
- },
+RightArrow.defaultProps = {
+ viewBox: '0 0 1000 1000'
+};
+exports["default"] = RightArrow;
- DayPicker_weekHeader_ul: {
- listStyle: 'none',
- margin: '1px 0',
- paddingLeft: 0,
- paddingRight: 0,
- fontSize: font.size
- },
+/***/ }),
- DayPicker_weekHeader_li: {
- display: 'inline-block',
- textAlign: 'center'
- },
+/***/ 257:
+/***/ (function(__unused_webpack_module, exports) {
- DayPicker_transitionContainer: {
- position: 'relative',
- overflow: 'hidden',
- borderRadius: 3
- },
+"use strict";
- DayPicker_transitionContainer__horizontal: {
- transition: 'height 0.2s ease-in-out'
- },
- DayPicker_transitionContainer__vertical: {
- width: '100%'
- },
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+var DISPLAY_FORMAT = exports.DISPLAY_FORMAT = 'L';
+var ISO_FORMAT = exports.ISO_FORMAT = 'YYYY-MM-DD';
+var ISO_MONTH_FORMAT = exports.ISO_MONTH_FORMAT = 'YYYY-MM';
- DayPicker_transitionContainer__verticalScrollable: (0, _object2['default'])({
- paddingTop: 20,
- height: '100%',
- position: 'absolute',
- top: 0,
- bottom: 0,
- right: 0,
- left: 0,
- overflowY: 'scroll'
- }, noScrollBarOnVerticalScrollable && {
- '-webkitOverflowScrolling': 'touch',
- '::-webkit-scrollbar': {
- '-webkit-appearance': 'none',
- display: 'none'
- }
- })
- };
-})(DayPicker);
+var START_DATE = exports.START_DATE = 'startDate';
+var END_DATE = exports.END_DATE = 'endDate';
-/***/ }),
+var HORIZONTAL_ORIENTATION = exports.HORIZONTAL_ORIENTATION = 'horizontal';
+var VERTICAL_ORIENTATION = exports.VERTICAL_ORIENTATION = 'vertical';
+var VERTICAL_SCROLLABLE = exports.VERTICAL_SCROLLABLE = 'verticalScrollable';
-/***/ "NykK":
-/***/ (function(module, exports, __webpack_require__) {
+var ICON_BEFORE_POSITION = exports.ICON_BEFORE_POSITION = 'before';
+var ICON_AFTER_POSITION = exports.ICON_AFTER_POSITION = 'after';
-var Symbol = __webpack_require__("nmnc"),
- getRawTag = __webpack_require__("AP2z"),
- objectToString = __webpack_require__("KfNM");
+var INFO_POSITION_TOP = exports.INFO_POSITION_TOP = 'top';
+var INFO_POSITION_BOTTOM = exports.INFO_POSITION_BOTTOM = 'bottom';
+var INFO_POSITION_BEFORE = exports.INFO_POSITION_BEFORE = 'before';
+var INFO_POSITION_AFTER = exports.INFO_POSITION_AFTER = 'after';
-/** `Object#toString` result references. */
-var nullTag = '[object Null]',
- undefinedTag = '[object Undefined]';
+var ANCHOR_LEFT = exports.ANCHOR_LEFT = 'left';
+var ANCHOR_RIGHT = exports.ANCHOR_RIGHT = 'right';
-/** Built-in value references. */
-var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
+var OPEN_DOWN = exports.OPEN_DOWN = 'down';
+var OPEN_UP = exports.OPEN_UP = 'up';
-/**
- * The base implementation of `getTag` without fallbacks for buggy environments.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
- */
-function baseGetTag(value) {
- if (value == null) {
- return value === undefined ? undefinedTag : nullTag;
- }
- return (symToStringTag && symToStringTag in Object(value))
- ? getRawTag(value)
- : objectToString(value);
-}
+var DAY_SIZE = exports.DAY_SIZE = 39;
+var BLOCKED_MODIFIER = exports.BLOCKED_MODIFIER = 'blocked';
+var WEEKDAYS = exports.WEEKDAYS = [0, 1, 2, 3, 4, 5, 6];
-module.exports = baseGetTag;
+var FANG_WIDTH_PX = exports.FANG_WIDTH_PX = 20;
+var FANG_HEIGHT_PX = exports.FANG_HEIGHT_PX = 10;
+var DEFAULT_VERTICAL_SPACING = exports.DEFAULT_VERTICAL_SPACING = 22;
+var MODIFIER_KEY_NAMES = exports.MODIFIER_KEY_NAMES = new Set(['Shift', 'Control', 'Alt', 'Meta']);
/***/ }),
-/***/ "Nym8":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 6030:
+/***/ (function(__unused_webpack_module, exports) {
"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getActiveElement; });
-/* harmony import */ var _getDocument_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ouKs");
-
-
-/**
- * Returns `element.ownerDocument.activeElement`.
- */
-
-function getActiveElement(element) {
- var _getDocument = Object(_getDocument_js__WEBPACK_IMPORTED_MODULE_0__[/* getDocument */ "a"])(element),
- activeElement = _getDocument.activeElement;
- if (!(activeElement !== null && activeElement !== void 0 && activeElement.nodeName)) {
- // In IE11, activeElement might be an empty object if we're interacting
- // with elements inside of an iframe.
- return null;
- }
- return activeElement;
-}
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+var calendarLabel = 'Calendar';
+var closeDatePicker = 'Close';
+var focusStartDate = 'Interact with the calendar and add the check-in date for your trip.';
+var clearDate = 'Clear Date';
+var clearDates = 'Clear Dates';
+var jumpToPrevMonth = 'Move backward to switch to the previous month.';
+var jumpToNextMonth = 'Move forward to switch to the next month.';
+var keyboardShortcuts = 'Keyboard Shortcuts';
+var showKeyboardShortcutsPanel = 'Open the keyboard shortcuts panel.';
+var hideKeyboardShortcutsPanel = 'Close the shortcuts panel.';
+var openThisPanel = 'Open this panel.';
+var enterKey = 'Enter key';
+var leftArrowRightArrow = 'Right and left arrow keys';
+var upArrowDownArrow = 'up and down arrow keys';
+var pageUpPageDown = 'page up and page down keys';
+var homeEnd = 'Home and end keys';
+var escape = 'Escape key';
+var questionMark = 'Question mark';
+var selectFocusedDate = 'Select the date in focus.';
+var moveFocusByOneDay = 'Move backward (left) and forward (right) by one day.';
+var moveFocusByOneWeek = 'Move backward (up) and forward (down) by one week.';
+var moveFocusByOneMonth = 'Switch months.';
+var moveFocustoStartAndEndOfWeek = 'Go to the first or last day of a week.';
+var returnFocusToInput = 'Return to the date input field.';
+var keyboardNavigationInstructions = 'Press the down arrow key to interact with the calendar and\n select a date. Press the question mark key to get the keyboard shortcuts for changing dates.';
+var chooseAvailableStartDate = function chooseAvailableStartDate(_ref) {
+ var date = _ref.date;
+ return 'Choose ' + String(date) + ' as your check-in date. It\u2019s available.';
+};
+var chooseAvailableEndDate = function chooseAvailableEndDate(_ref2) {
+ var date = _ref2.date;
+ return 'Choose ' + String(date) + ' as your check-out date. It\u2019s available.';
+};
+var chooseAvailableDate = function chooseAvailableDate(_ref3) {
+ var date = _ref3.date;
+ return date;
+};
+var dateIsUnavailable = function dateIsUnavailable(_ref4) {
+ var date = _ref4.date;
+ return 'Not available. ' + String(date);
+};
+var dateIsSelected = function dateIsSelected(_ref5) {
+ var date = _ref5.date;
+ return 'Selected. ' + String(date);
+};
+exports["default"] = {
+ calendarLabel: calendarLabel,
+ closeDatePicker: closeDatePicker,
+ focusStartDate: focusStartDate,
+ clearDate: clearDate,
+ clearDates: clearDates,
+ jumpToPrevMonth: jumpToPrevMonth,
+ jumpToNextMonth: jumpToNextMonth,
+ keyboardShortcuts: keyboardShortcuts,
+ showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
+ hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
+ openThisPanel: openThisPanel,
+ enterKey: enterKey,
+ leftArrowRightArrow: leftArrowRightArrow,
+ upArrowDownArrow: upArrowDownArrow,
+ pageUpPageDown: pageUpPageDown,
+ homeEnd: homeEnd,
+ escape: escape,
+ questionMark: questionMark,
+ selectFocusedDate: selectFocusedDate,
+ moveFocusByOneDay: moveFocusByOneDay,
+ moveFocusByOneWeek: moveFocusByOneWeek,
+ moveFocusByOneMonth: moveFocusByOneMonth,
+ moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
+ returnFocusToInput: returnFocusToInput,
+ keyboardNavigationInstructions: keyboardNavigationInstructions,
+ chooseAvailableStartDate: chooseAvailableStartDate,
+ chooseAvailableEndDate: chooseAvailableEndDate,
+ dateIsUnavailable: dateIsUnavailable,
+ dateIsSelected: dateIsSelected
+};
+var DateRangePickerPhrases = exports.DateRangePickerPhrases = {
+ calendarLabel: calendarLabel,
+ closeDatePicker: closeDatePicker,
+ clearDates: clearDates,
+ focusStartDate: focusStartDate,
+ jumpToPrevMonth: jumpToPrevMonth,
+ jumpToNextMonth: jumpToNextMonth,
+ keyboardShortcuts: keyboardShortcuts,
+ showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
+ hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
+ openThisPanel: openThisPanel,
+ enterKey: enterKey,
+ leftArrowRightArrow: leftArrowRightArrow,
+ upArrowDownArrow: upArrowDownArrow,
+ pageUpPageDown: pageUpPageDown,
+ homeEnd: homeEnd,
+ escape: escape,
+ questionMark: questionMark,
+ selectFocusedDate: selectFocusedDate,
+ moveFocusByOneDay: moveFocusByOneDay,
+ moveFocusByOneWeek: moveFocusByOneWeek,
+ moveFocusByOneMonth: moveFocusByOneMonth,
+ moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
+ returnFocusToInput: returnFocusToInput,
+ keyboardNavigationInstructions: keyboardNavigationInstructions,
+ chooseAvailableStartDate: chooseAvailableStartDate,
+ chooseAvailableEndDate: chooseAvailableEndDate,
+ dateIsUnavailable: dateIsUnavailable,
+ dateIsSelected: dateIsSelected
+};
-/***/ }),
+var DateRangePickerInputPhrases = exports.DateRangePickerInputPhrases = {
+ focusStartDate: focusStartDate,
+ clearDates: clearDates,
+ keyboardNavigationInstructions: keyboardNavigationInstructions
+};
-/***/ "Ohaz":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+var SingleDatePickerPhrases = exports.SingleDatePickerPhrases = {
+ calendarLabel: calendarLabel,
+ closeDatePicker: closeDatePicker,
+ clearDate: clearDate,
+ jumpToPrevMonth: jumpToPrevMonth,
+ jumpToNextMonth: jumpToNextMonth,
+ keyboardShortcuts: keyboardShortcuts,
+ showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
+ hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
+ openThisPanel: openThisPanel,
+ enterKey: enterKey,
+ leftArrowRightArrow: leftArrowRightArrow,
+ upArrowDownArrow: upArrowDownArrow,
+ pageUpPageDown: pageUpPageDown,
+ homeEnd: homeEnd,
+ escape: escape,
+ questionMark: questionMark,
+ selectFocusedDate: selectFocusedDate,
+ moveFocusByOneDay: moveFocusByOneDay,
+ moveFocusByOneWeek: moveFocusByOneWeek,
+ moveFocusByOneMonth: moveFocusByOneMonth,
+ moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
+ returnFocusToInput: returnFocusToInput,
+ keyboardNavigationInstructions: keyboardNavigationInstructions,
+ chooseAvailableDate: chooseAvailableDate,
+ dateIsUnavailable: dateIsUnavailable,
+ dateIsSelected: dateIsSelected
+};
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getNamespace; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getConnectedNamespace; });
-/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("tQ+x");
-/**
- * Internal dependencies
- */
+var SingleDatePickerInputPhrases = exports.SingleDatePickerInputPhrases = {
+ clearDate: clearDate,
+ keyboardNavigationInstructions: keyboardNavigationInstructions
+};
-/**
- * Creates a dedicated context namespace HTML attribute for components.
- * ns is short for "namespace"
- *
- * @example
- * ```jsx
- * <div {...ns('Container')} />
- * ```
- *
- * @param {string} componentName The name for the component.
- * @return {Record<string, any>} A props object with the namespaced HTML attribute.
- */
+var DayPickerPhrases = exports.DayPickerPhrases = {
+ calendarLabel: calendarLabel,
+ jumpToPrevMonth: jumpToPrevMonth,
+ jumpToNextMonth: jumpToNextMonth,
+ keyboardShortcuts: keyboardShortcuts,
+ showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
+ hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
+ openThisPanel: openThisPanel,
+ enterKey: enterKey,
+ leftArrowRightArrow: leftArrowRightArrow,
+ upArrowDownArrow: upArrowDownArrow,
+ pageUpPageDown: pageUpPageDown,
+ homeEnd: homeEnd,
+ escape: escape,
+ questionMark: questionMark,
+ selectFocusedDate: selectFocusedDate,
+ moveFocusByOneDay: moveFocusByOneDay,
+ moveFocusByOneWeek: moveFocusByOneWeek,
+ moveFocusByOneMonth: moveFocusByOneMonth,
+ moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
+ returnFocusToInput: returnFocusToInput,
+ chooseAvailableStartDate: chooseAvailableStartDate,
+ chooseAvailableEndDate: chooseAvailableEndDate,
+ chooseAvailableDate: chooseAvailableDate,
+ dateIsUnavailable: dateIsUnavailable,
+ dateIsSelected: dateIsSelected
+};
-function getNamespace(componentName) {
- return {
- [_constants__WEBPACK_IMPORTED_MODULE_0__[/* COMPONENT_NAMESPACE */ "a"]]: componentName
- };
-}
-/**
- * Creates a dedicated connected context namespace HTML attribute for components.
- * ns is short for "namespace"
- *
- * @example
- * ```jsx
- * <div {...cns()} />
- * ```
- *
- * @return {Record<string, any>} A props object with the namespaced HTML attribute.
- */
+var DayPickerKeyboardShortcutsPhrases = exports.DayPickerKeyboardShortcutsPhrases = {
+ keyboardShortcuts: keyboardShortcuts,
+ showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
+ hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
+ openThisPanel: openThisPanel,
+ enterKey: enterKey,
+ leftArrowRightArrow: leftArrowRightArrow,
+ upArrowDownArrow: upArrowDownArrow,
+ pageUpPageDown: pageUpPageDown,
+ homeEnd: homeEnd,
+ escape: escape,
+ questionMark: questionMark,
+ selectFocusedDate: selectFocusedDate,
+ moveFocusByOneDay: moveFocusByOneDay,
+ moveFocusByOneWeek: moveFocusByOneWeek,
+ moveFocusByOneMonth: moveFocusByOneMonth,
+ moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
+ returnFocusToInput: returnFocusToInput
+};
-function getConnectedNamespace() {
- return {
- [_constants__WEBPACK_IMPORTED_MODULE_0__[/* CONNECTED_NAMESPACE */ "b"]]: true
- };
-}
+var DayPickerNavigationPhrases = exports.DayPickerNavigationPhrases = {
+ jumpToPrevMonth: jumpToPrevMonth,
+ jumpToNextMonth: jumpToNextMonth
+};
+var CalendarDayPhrases = exports.CalendarDayPhrases = {
+ chooseAvailableDate: chooseAvailableDate,
+ dateIsUnavailable: dateIsUnavailable,
+ dateIsSelected: dateIsSelected
+};
/***/ }),
-/***/ "PFEc":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 17:
+/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
"use strict";
-var GetIntrinsic = __webpack_require__("j1Hc");
-
-var $Object = GetIntrinsic('%Object%');
-
-var RequireObjectCoercible = __webpack_require__("eH4f");
+var _registerCSSInterfaceWithDefaultTheme = __webpack_require__(9305);
-// https://ecma-international.org/ecma-262/6.0/#sec-toobject
+var _registerCSSInterfaceWithDefaultTheme2 = _interopRequireDefault(_registerCSSInterfaceWithDefaultTheme);
-module.exports = function ToObject(value) {
- RequireObjectCoercible(value);
- return $Object(value);
-};
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+(0, _registerCSSInterfaceWithDefaultTheme2['default'])();
/***/ }),
-/***/ "PcHe":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 8182:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasFocusWithin; });
-/* harmony import */ var _getActiveElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("Nym8");
-/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("utzN");
-
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
-/**
- * Checks if `element` has focus within. Elements that are referenced by
- * `aria-activedescendant` are also considered.
- *
- * @example
- * import { hasFocusWithin } from "reakit-utils";
- *
- * hasFocusWithin(document.getElementById("id"));
- */
+var _propTypes = __webpack_require__(2652);
-function hasFocusWithin(element) {
- var activeElement = Object(_getActiveElement_js__WEBPACK_IMPORTED_MODULE_0__[/* getActiveElement */ "a"])(element);
- if (!activeElement) return false;
- if (Object(_contains_js__WEBPACK_IMPORTED_MODULE_1__[/* contains */ "a"])(element, activeElement)) return true;
- var activeDescendant = activeElement.getAttribute("aria-activedescendant");
- if (!activeDescendant) return false;
- if (activeDescendant === element.id) return true;
- return !!element.querySelector("#" + activeDescendant);
-}
+var _propTypes2 = _interopRequireDefault(_propTypes);
+var _constants = __webpack_require__(257);
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+exports["default"] = _propTypes2['default'].oneOf([_constants.INFO_POSITION_TOP, _constants.INFO_POSITION_BOTTOM, _constants.INFO_POSITION_BEFORE, _constants.INFO_POSITION_AFTER]);
/***/ }),
-/***/ "Pjai":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 243:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
-var ToPrimitive = __webpack_require__("vLdR");
-
-// http://262.ecma-international.org/5.1/#sec-9.3
-
-module.exports = function ToNumber(value) {
- var prim = ToPrimitive(value, Number);
- if (typeof prim !== 'string') {
- return +prim; // eslint-disable-line no-implicit-coercion
- }
-
- // eslint-disable-next-line no-control-regex
- var trimmed = prim.replace(/^[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+|[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+$/g, '');
- if ((/^0[ob]|^[+-]0x/).test(trimmed)) {
- return NaN;
- }
-
- return +trimmed; // eslint-disable-line no-implicit-coercion
-};
-
-
-/***/ }),
-
-/***/ "PoQ0":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+var _propTypes = __webpack_require__(2652);
-var ES5Type = __webpack_require__("60zJ");
+var _propTypes2 = _interopRequireDefault(_propTypes);
-// https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values
+var _constants = __webpack_require__(257);
-module.exports = function Type(x) {
- if (typeof x === 'symbol') {
- return 'Symbol';
- }
- if (typeof x === 'bigint') {
- return 'BigInt';
- }
- return ES5Type(x);
-};
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+exports["default"] = _propTypes2['default'].oneOf(_constants.WEEKDAYS);
/***/ }),
-/***/ "Pq96":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 6747:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
-Object.defineProperty(exports, "__esModule", {
+Object.defineProperty(exports, "__esModule", ({
value: true
-});
-exports['default'] = isPrevMonth;
-
-var _moment = __webpack_require__("wy2R");
+}));
-var _moment2 = _interopRequireDefault(_moment);
+var _propTypes = __webpack_require__(2652);
-var _isSameMonth = __webpack_require__("ulUS");
+var _propTypes2 = _interopRequireDefault(_propTypes);
-var _isSameMonth2 = _interopRequireDefault(_isSameMonth);
+var _airbnbPropTypes = __webpack_require__(4882);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-function isPrevMonth(a, b) {
- if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
- return (0, _isSameMonth2['default'])(a.clone().subtract(1, 'month'), b);
-}
-
-/***/ }),
-
-/***/ "PrET":
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var bind = __webpack_require__("D3zA");
-var GetIntrinsic = __webpack_require__("AM7I");
-
-var $apply = GetIntrinsic('%Function.prototype.apply%');
-var $call = GetIntrinsic('%Function.prototype.call%');
-var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
+function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
+function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
-if ($defineProperty) {
- try {
- $defineProperty({}, 'a', { value: 1 });
- } catch (e) {
- // IE 8 has a broken defineProperty
- $defineProperty = null;
- }
-}
+exports["default"] = (0, _airbnbPropTypes.and)([_propTypes2['default'].instanceOf(Set), function () {
+ function modifiers(props, propName) {
+ for (var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
+ rest[_key - 2] = arguments[_key];
+ }
-module.exports = function callBind() {
- return $reflectApply(bind, $call, arguments);
-};
+ var propValue = props[propName];
-var applyBind = function applyBind() {
- return $reflectApply(bind, $apply, arguments);
-};
+ var firstError = void 0;
+ [].concat(_toConsumableArray(propValue)).some(function (v, i) {
+ var _PropTypes$string;
-if ($defineProperty) {
- $defineProperty(module.exports, 'apply', { value: applyBind });
-} else {
- module.exports.apply = applyBind;
-}
+ var fakePropName = String(propName) + ': index ' + String(i);
+ firstError = (_PropTypes$string = _propTypes2['default'].string).isRequired.apply(_PropTypes$string, [_defineProperty({}, fakePropName, v), fakePropName].concat(rest));
+ return firstError != null;
+ });
+ return firstError == null ? null : firstError;
+ }
+ return modifiers;
+}()], 'Modifiers (Set of Strings)');
/***/ }),
-/***/ "Ptb8":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 6553:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isObject; });
-/**
- * Checks whether `arg` is an object or not.
- *
- * @returns {boolean}
- */
-function isObject(arg) {
- return typeof arg === "object" && arg != null;
-}
-
-
-
-/***/ }),
-/***/ "Q4Sy":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
-"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__);
+var _propTypes = __webpack_require__(2652);
+var _propTypes2 = _interopRequireDefault(_propTypes);
-/**
- * WordPress dependencies
- */
+var _constants = __webpack_require__(257);
-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);
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+exports["default"] = _propTypes2['default'].oneOf([_constants.HORIZONTAL_ORIENTATION, _constants.VERTICAL_ORIENTATION, _constants.VERTICAL_SCROLLABLE]);
/***/ }),
-/***/ "QEu6":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 8158:
+/***/ (function(__unused_webpack_module, exports) {
"use strict";
-Object.defineProperty(exports, "__esModule", {
+Object.defineProperty(exports, "__esModule", ({
value: true
-});
-var CHANNEL = exports.CHANNEL = '__direction__';
-
-var DIRECTIONS = exports.DIRECTIONS = {
- LTR: 'ltr',
- RTL: 'rtl'
-};
+}));
+var core = {
+ white: '#fff',
+ gray: '#484848',
+ grayLight: '#82888a',
+ grayLighter: '#cacccd',
+ grayLightest: '#f2f2f2',
-/***/ }),
+ borderMedium: '#c4c4c4',
+ border: '#dbdbdb',
+ borderLight: '#e4e7e7',
+ borderLighter: '#eceeee',
+ borderBright: '#f4f5f5',
-/***/ "QIyF":
-/***/ (function(module, exports, __webpack_require__) {
+ primary: '#00a699',
+ primaryShade_1: '#33dacd',
+ primaryShade_2: '#66e2da',
+ primaryShade_3: '#80e8e0',
+ primaryShade_4: '#b2f1ec',
+ primary_dark: '#008489',
-var root = __webpack_require__("Kz5y");
+ secondary: '#007a87',
-/**
- * Gets the timestamp of the number of milliseconds that have elapsed since
- * the Unix epoch (1 January 1970 00:00:00 UTC).
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Date
- * @returns {number} Returns the timestamp.
- * @example
- *
- * _.defer(function(stamp) {
- * console.log(_.now() - stamp);
- * }, _.now());
- * // => Logs the number of milliseconds it took for the deferred invocation.
- */
-var now = function() {
- return root.Date.now();
+ yellow: '#ffe8bc',
+ yellow_dark: '#ffce71'
};
-module.exports = now;
-
-
-/***/ }),
+exports["default"] = {
+ reactDates: {
+ zIndex: 0,
+ border: {
+ input: {
+ border: 0,
+ borderTop: 0,
+ borderRight: 0,
+ borderBottom: '2px solid transparent',
+ borderLeft: 0,
+ outlineFocused: 0,
+ borderFocused: 0,
+ borderTopFocused: 0,
+ borderLeftFocused: 0,
+ borderBottomFocused: '2px solid ' + String(core.primary_dark),
+ borderRightFocused: 0,
+ borderRadius: 0
+ },
+ pickerInput: {
+ borderWidth: 1,
+ borderStyle: 'solid',
+ borderRadius: 2
+ }
+ },
-/***/ "Qmvf":
-/***/ (function(module, exports, __webpack_require__) {
+ color: {
+ core: core,
-"use strict";
+ disabled: core.grayLightest,
+ background: core.white,
+ backgroundDark: '#f2f2f2',
+ backgroundFocused: core.white,
+ border: 'rgb(219, 219, 219)',
+ text: core.gray,
+ textDisabled: core.border,
+ textFocused: '#007a87',
+ placeholderText: '#757575',
-var GetIntrinsic = __webpack_require__("j1Hc");
+ outside: {
+ backgroundColor: core.white,
+ backgroundColor_active: core.white,
+ backgroundColor_hover: core.white,
+ color: core.gray,
+ color_active: core.gray,
+ color_hover: core.gray
+ },
-var has = __webpack_require__("oNNP");
-var $TypeError = GetIntrinsic('%TypeError%');
+ highlighted: {
+ backgroundColor: core.yellow,
+ backgroundColor_active: core.yellow_dark,
+ backgroundColor_hover: core.yellow_dark,
+ color: core.gray,
+ color_active: core.gray,
+ color_hover: core.gray
+ },
-module.exports = function IsPropertyDescriptor(ES, Desc) {
- if (ES.Type(Desc) !== 'Object') {
- return false;
- }
- var allowed = {
- '[[Configurable]]': true,
- '[[Enumerable]]': true,
- '[[Get]]': true,
- '[[Set]]': true,
- '[[Value]]': true,
- '[[Writable]]': true
- };
+ minimumNights: {
+ backgroundColor: core.white,
+ backgroundColor_active: core.white,
+ backgroundColor_hover: core.white,
+ borderColor: core.borderLighter,
+ color: core.grayLighter,
+ color_active: core.grayLighter,
+ color_hover: core.grayLighter
+ },
- for (var key in Desc) { // eslint-disable-line no-restricted-syntax
- if (has(Desc, key) && !allowed[key]) {
- return false;
- }
- }
+ hoveredSpan: {
+ backgroundColor: core.primaryShade_4,
+ backgroundColor_active: core.primaryShade_3,
+ backgroundColor_hover: core.primaryShade_4,
+ borderColor: core.primaryShade_3,
+ borderColor_active: core.primaryShade_3,
+ borderColor_hover: core.primaryShade_3,
+ color: core.secondary,
+ color_active: core.secondary,
+ color_hover: core.secondary
+ },
- if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) {
- throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');
- }
- return true;
-};
+ selectedSpan: {
+ backgroundColor: core.primaryShade_2,
+ backgroundColor_active: core.primaryShade_1,
+ backgroundColor_hover: core.primaryShade_1,
+ borderColor: core.primaryShade_1,
+ borderColor_active: core.primary,
+ borderColor_hover: core.primary,
+ color: core.white,
+ color_active: core.white,
+ color_hover: core.white
+ },
+ selected: {
+ backgroundColor: core.primary,
+ backgroundColor_active: core.primary,
+ backgroundColor_hover: core.primary,
+ borderColor: core.primary,
+ borderColor_active: core.primary,
+ borderColor_hover: core.primary,
+ color: core.white,
+ color_active: core.white,
+ color_hover: core.white
+ },
-/***/ }),
+ blocked_calendar: {
+ backgroundColor: core.grayLighter,
+ backgroundColor_active: core.grayLighter,
+ backgroundColor_hover: core.grayLighter,
+ borderColor: core.grayLighter,
+ borderColor_active: core.grayLighter,
+ borderColor_hover: core.grayLighter,
+ color: core.grayLight,
+ color_active: core.grayLight,
+ color_hover: core.grayLight
+ },
-/***/ "RDTF":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ blocked_out_of_range: {
+ backgroundColor: core.white,
+ backgroundColor_active: core.white,
+ backgroundColor_hover: core.white,
+ borderColor: core.borderLight,
+ borderColor_active: core.borderLight,
+ borderColor_hover: core.borderLight,
+ color: core.grayLighter,
+ color_active: core.grayLighter,
+ color_hover: core.grayLighter
+ }
+ },
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread2; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _objectWithoutPropertiesLoose; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _createForOfIteratorHelperLoose; });
-function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
+ spacing: {
+ dayPickerHorizontalPadding: 9,
+ captionPaddingTop: 22,
+ captionPaddingBottom: 37,
+ inputPadding: 0,
+ displayTextPaddingVertical: undefined,
+ displayTextPaddingTop: 11,
+ displayTextPaddingBottom: 9,
+ displayTextPaddingHorizontal: undefined,
+ displayTextPaddingLeft: 11,
+ displayTextPaddingRight: 11,
+ displayTextPaddingVertical_small: undefined,
+ displayTextPaddingTop_small: 7,
+ displayTextPaddingBottom_small: 5,
+ displayTextPaddingHorizontal_small: undefined,
+ displayTextPaddingLeft_small: 7,
+ displayTextPaddingRight_small: 7
+ },
- return obj;
-}
+ sizing: {
+ inputWidth: 130,
+ inputWidth_small: 97,
+ arrowWidth: 24
+ },
-function ownKeys(object, enumerableOnly) {
- var keys = Object.keys(object);
+ noScrollBarOnVerticalScrollable: false,
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object);
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
- });
- keys.push.apply(keys, symbols);
+ font: {
+ size: 14,
+ captionSize: 18,
+ input: {
+ size: 19,
+ lineHeight: '24px',
+ size_small: 15,
+ lineHeight_small: '18px',
+ letterSpacing_small: '0.2px',
+ styleDisabled: 'italic'
+ }
+ }
}
+};
- return keys;
-}
+/***/ }),
-function _objectSpread2(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i] != null ? arguments[i] : {};
+/***/ 8607:
+/***/ (function(__unused_webpack_module, exports) {
- if (i % 2) {
- ownKeys(Object(source), true).forEach(function (key) {
- _defineProperty(target, key, source[key]);
- });
- } else if (Object.getOwnPropertyDescriptors) {
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
- } else {
- ownKeys(Object(source)).forEach(function (key) {
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
- });
- }
- }
+"use strict";
- return target;
-}
-function _objectWithoutPropertiesLoose(source, excluded) {
- if (source == null) return {};
- var target = {};
- var sourceKeys = Object.keys(source);
- var key, i;
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = calculateDimension;
+function calculateDimension(el, axis) {
+ var borderBox = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
+ var withMargin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
- for (i = 0; i < sourceKeys.length; i++) {
- key = sourceKeys[i];
- if (excluded.indexOf(key) >= 0) continue;
- target[key] = source[key];
+ if (!el) {
+ return 0;
}
- return target;
-}
-
-function _unsupportedIterableToArray(o, minLen) {
- if (!o) return;
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if (n === "Object" && o.constructor) n = o.constructor.name;
- if (n === "Map" || n === "Set") return Array.from(o);
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
-}
-
-function _arrayLikeToArray(arr, len) {
- if (len == null || len > arr.length) len = arr.length;
+ var axisStart = axis === 'width' ? 'Left' : 'Top';
+ var axisEnd = axis === 'width' ? 'Right' : 'Bottom';
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
+ // Only read styles if we need to
+ var style = !borderBox || withMargin ? window.getComputedStyle(el) : null;
- return arr2;
-}
+ // Offset includes border and padding
+ var offsetWidth = el.offsetWidth,
+ offsetHeight = el.offsetHeight;
-function _createForOfIteratorHelperLoose(o, allowArrayLike) {
- var it;
+ var size = axis === 'width' ? offsetWidth : offsetHeight;
- if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
- if (it) o = it;
- var i = 0;
- return function () {
- if (i >= o.length) return {
- done: true
- };
- return {
- done: false,
- value: o[i++]
- };
- };
- }
+ // Get the inner size
+ if (!borderBox) {
+ size -= parseFloat(style['padding' + axisStart]) + parseFloat(style['padding' + axisEnd]) + parseFloat(style['border' + axisStart + 'Width']) + parseFloat(style['border' + axisEnd + 'Width']);
+ }
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+ // Apply margin
+ if (withMargin) {
+ size += parseFloat(style['margin' + axisStart]) + parseFloat(style['margin' + axisEnd]);
}
- it = o[Symbol.iterator]();
- return it.next.bind(it);
+ return size;
}
-
-
-
/***/ }),
-/***/ "RMJe":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 5814:
+/***/ (function(__unused_webpack_module, exports) {
"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"
+Object.defineProperty(exports, "__esModule", ({
+ value: true
}));
-/* harmony default export */ __webpack_exports__["a"] = (check);
-
+exports["default"] = getActiveElement;
+function getActiveElement() {
+ return typeof document !== 'undefined' && document.activeElement;
+}
/***/ }),
-/***/ "Rhcr":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 7475:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
-var GetIntrinsic = __webpack_require__("j1Hc");
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = getCalendarDaySettings;
-var $TypeError = GetIntrinsic('%TypeError%');
-var $Number = GetIntrinsic('%Number%');
-var $RegExp = GetIntrinsic('%RegExp%');
-var $parseInteger = GetIntrinsic('%parseInt%');
+var _getPhrase = __webpack_require__(7098);
-var callBound = __webpack_require__("qeuH");
-var regexTester = __webpack_require__("ZbWB");
-var isPrimitive = __webpack_require__("BeK9");
+var _getPhrase2 = _interopRequireDefault(_getPhrase);
-var $strSlice = callBound('String.prototype.slice');
-var isBinary = regexTester(/^0b[01]+$/i);
-var isOctal = regexTester(/^0o[0-7]+$/i);
-var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i);
-var nonWS = ['\u0085', '\u200b', '\ufffe'].join('');
-var nonWSregex = new $RegExp('[' + nonWS + ']', 'g');
-var hasNonWS = regexTester(nonWSregex);
+var _constants = __webpack_require__(257);
-// whitespace from: https://es5.github.io/#x15.5.4.20
-// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324
-var ws = [
- '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003',
- '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028',
- '\u2029\uFEFF'
-].join('');
-var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g');
-var $replace = callBound('String.prototype.replace');
-var $trim = function (value) {
- return $replace(value, trimRegex, '');
-};
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-var ToPrimitive = __webpack_require__("Cx2f");
+function getCalendarDaySettings(day, ariaLabelFormat, daySize, modifiers, phrases) {
+ var chooseAvailableDate = phrases.chooseAvailableDate,
+ dateIsUnavailable = phrases.dateIsUnavailable,
+ dateIsSelected = phrases.dateIsSelected;
-// https://ecma-international.org/ecma-262/6.0/#sec-tonumber
-module.exports = function ToNumber(argument) {
- var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number);
- if (typeof value === 'symbol') {
- throw new $TypeError('Cannot convert a Symbol value to a number');
- }
- if (typeof value === 'bigint') {
- throw new $TypeError('Conversion from \'BigInt\' to \'number\' is not allowed.');
- }
- if (typeof value === 'string') {
- if (isBinary(value)) {
- return ToNumber($parseInteger($strSlice(value, 2), 2));
- } else if (isOctal(value)) {
- return ToNumber($parseInteger($strSlice(value, 2), 8));
- } else if (hasNonWS(value) || isInvalidHexLiteral(value)) {
- return NaN;
- }
- var trimmed = $trim(value);
- if (trimmed !== value) {
- return ToNumber(trimmed);
- }
+ var daySizeStyles = {
+ width: daySize,
+ height: daySize - 1
+ };
- }
- return $Number(value);
-};
+ var useDefaultCursor = modifiers.has('blocked-minimum-nights') || modifiers.has('blocked-calendar') || modifiers.has('blocked-out-of-range');
+ var selected = modifiers.has('selected') || modifiers.has('selected-start') || modifiers.has('selected-end');
-/***/ }),
+ var hoveredSpan = !selected && (modifiers.has('hovered-span') || modifiers.has('after-hovered-start'));
-/***/ "RxS6":
-/***/ (function(module, exports) {
+ var isOutsideRange = modifiers.has('blocked-out-of-range');
+
+ var formattedDate = { date: day.format(ariaLabelFormat) };
+
+ var ariaLabel = (0, _getPhrase2['default'])(chooseAvailableDate, formattedDate);
+ if (modifiers.has(_constants.BLOCKED_MODIFIER)) {
+ ariaLabel = (0, _getPhrase2['default'])(dateIsUnavailable, formattedDate);
+ } else if (selected) {
+ ariaLabel = (0, _getPhrase2['default'])(dateIsSelected, formattedDate);
+ }
-(function() { module.exports = window["wp"]["keycodes"]; }());
+ return {
+ daySizeStyles: daySizeStyles,
+ useDefaultCursor: useDefaultCursor,
+ selected: selected,
+ hoveredSpan: hoveredSpan,
+ isOutsideRange: isOutsideRange,
+ ariaLabel: ariaLabel
+ };
+}
/***/ }),
-/***/ "S3lO":
-/***/ (function(module, exports, __webpack_require__) {
+/***/ 5644:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
"use strict";
-var GetIntrinsic = __webpack_require__("j1Hc");
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = getCalendarMonthWeeks;
-var $TypeError = GetIntrinsic('%TypeError%');
+var _moment = __webpack_require__(6292);
-var DefineOwnProperty = __webpack_require__("wTIp");
+var _moment2 = _interopRequireDefault(_moment);
-var FromPropertyDescriptor = __webpack_require__("rQBh");
-var OrdinaryGetOwnProperty = __webpack_require__("6XE+");
-var IsDataDescriptor = __webpack_require__("6/BL");
-var IsExtensible = __webpack_require__("UaFt");
-var IsPropertyKey = __webpack_require__("nR7C");
-var SameValue = __webpack_require__("uug5");
-var Type = __webpack_require__("PoQ0");
+var _constants = __webpack_require__(257);
-// https://ecma-international.org/ecma-262/6.0/#sec-createdataproperty
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-module.exports = function CreateDataProperty(O, P, V) {
- if (Type(O) !== 'Object') {
- throw new $TypeError('Assertion failed: Type(O) is not Object');
- }
- if (!IsPropertyKey(P)) {
- throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
- }
- var oldDesc = OrdinaryGetOwnProperty(O, P);
- var extensible = !oldDesc || IsExtensible(O);
- var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']);
- if (immutable || !extensible) {
- return false;
- }
- return DefineOwnProperty(
- IsDataDescriptor,
- SameValue,
- FromPropertyDescriptor,
- O,
- P,
- {
- '[[Configurable]]': true,
- '[[Enumerable]]': true,
- '[[Value]]': V,
- '[[Writable]]': true
- }
- );
-};
+function getCalendarMonthWeeks(month, enableOutsideDays) {
+ var firstDayOfWeek = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _moment2['default'].localeData().firstDayOfWeek();
+ if (!_moment2['default'].isMoment(month) || !month.isValid()) {
+ throw new TypeError('`month` must be a valid moment object');
+ }
+ if (_constants.WEEKDAYS.indexOf(firstDayOfWeek) === -1) {
+ throw new TypeError('`firstDayOfWeek` must be an integer between 0 and 6');
+ }
-/***/ }),
+ // set utc offset to get correct dates in future (when timezone changes)
+ var firstOfMonth = month.clone().startOf('month').hour(12);
+ var lastOfMonth = month.clone().endOf('month').hour(12);
-/***/ "S8ty":
-/***/ (function(module, exports, __webpack_require__) {
+ // calculate the exact first and last days to fill the entire matrix
+ // (considering days outside month)
+ var prevDays = (firstOfMonth.day() + 7 - firstDayOfWeek) % 7;
+ var nextDays = (firstDayOfWeek + 6 - lastOfMonth.day()) % 7;
+ var firstDay = firstOfMonth.clone().subtract(prevDays, 'day');
+ var lastDay = lastOfMonth.clone().add(nextDays, 'day');
-"use strict";
+ var totalDays = lastDay.diff(firstDay, 'days') + 1;
+ var currentDay = firstDay.clone();
+ var weeksInMonth = [];
-var GetIntrinsic = __webpack_require__("j1Hc");
+ for (var i = 0; i < totalDays; i += 1) {
+ if (i % 7 === 0) {
+ weeksInMonth.push([]);
+ }
-var $abs = GetIntrinsic('%Math.abs%');
+ var day = null;
+ if (i >= prevDays && i < totalDays - nextDays || enableOutsideDays) {
+ day = currentDay.clone();
+ }
-// http://262.ecma-international.org/5.1/#sec-5.2
+ weeksInMonth[weeksInMonth.length - 1].push(day);
-module.exports = function abs(x) {
- return $abs(x);
-};
+ currentDay.add(1, 'day');
+ }
+ return weeksInMonth;
+}
/***/ }),
-/***/ "SB3u":
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ 8964:
+/***/ (function(__unused_webpack_module, exports) {
"use strict";
-// ESM COMPAT FLAG
-__webpack_require__.r(__webpack_exports__);
-// EXPORTS
-__webpack_require__.d(__webpack_exports__, "SVG", function() { return /* reexport */ external_wp_primitives_["SVG"]; });
-__webpack_require__.d(__webpack_exports__, "Path", function() { return /* reexport */ external_wp_primitives_["Path"]; });
-__webpack_require__.d(__webpack_exports__, "Circle", function() { return /* reexport */ external_wp_primitives_["Circle"]; });
-__webpack_require__.d(__webpack_exports__, "Polygon", function() { return /* reexport */ external_wp_primitives_["Polygon"]; });
-__webpack_require__.d(__webpack_exports__, "Rect", function() { return /* reexport */ external_wp_primitives_["Rect"]; });
-__webpack_require__.d(__webpack_exports__, "G", function() { return /* reexport */ external_wp_primitives_["G"]; });
-__webpack_require__.d(__webpack_exports__, "HorizontalRule", function() { return /* reexport */ external_wp_primitives_["HorizontalRule"]; });
-__webpack_require__.d(__webpack_exports__, "BlockQuotation", function() { return /* reexport */ external_wp_primitives_["BlockQuotation"]; });
-__webpack_require__.d(__webpack_exports__, "__experimentalAlignmentMatrixControl", function() { return /* reexport */ AlignmentMatrixControl; });
-__webpack_require__.d(__webpack_exports__, "Animate", function() { return /* reexport */ build_module_animate["a" /* default */]; });
-__webpack_require__.d(__webpack_exports__, "__unstableGetAnimateClassName", function() { return /* reexport */ build_module_animate["b" /* getAnimateClassName */]; });
-__webpack_require__.d(__webpack_exports__, "__unstableMotion", function() { return /* reexport */ motion; });
-__webpack_require__.d(__webpack_exports__, "AnglePickerControl", function() { return /* reexport */ AnglePickerControl; });
-__webpack_require__.d(__webpack_exports__, "Autocomplete", function() { return /* reexport */ Autocomplete; });
-__webpack_require__.d(__webpack_exports__, "__unstableUseAutocompleteProps", function() { return /* reexport */ useAutocompleteProps; });
-__webpack_require__.d(__webpack_exports__, "BaseControl", function() { return /* reexport */ base_control; });
-__webpack_require__.d(__webpack_exports__, "__experimentalBoxControl", function() { return /* reexport */ BoxControl; });
-__webpack_require__.d(__webpack_exports__, "Button", function() { return /* reexport */ build_module_button["a" /* default */]; });
-__webpack_require__.d(__webpack_exports__, "ButtonGroup", function() { return /* reexport */ button_group; });
-__webpack_require__.d(__webpack_exports__, "Card", function() { return /* reexport */ card_component; });
-__webpack_require__.d(__webpack_exports__, "CardBody", function() { return /* reexport */ card_body_component; });
-__webpack_require__.d(__webpack_exports__, "CardDivider", function() { return /* reexport */ card_divider_component; });
-__webpack_require__.d(__webpack_exports__, "CardFooter", function() { return /* reexport */ card_footer_component; });
-__webpack_require__.d(__webpack_exports__, "CardHeader", function() { return /* reexport */ card_header_component; });
-__webpack_require__.d(__webpack_exports__, "CardMedia", function() { return /* reexport */ card_media_component; });
-__webpack_require__.d(__webpack_exports__, "CheckboxControl", function() { return /* reexport */ CheckboxControl; });
-__webpack_require__.d(__webpack_exports__, "ClipboardButton", function() { return /* reexport */ ClipboardButton; });
-__webpack_require__.d(__webpack_exports__, "__experimentalPaletteEdit", function() { return /* reexport */ PaletteEdit; });
-__webpack_require__.d(__webpack_exports__, "ColorIndicator", function() { return /* reexport */ color_indicator; });
-__webpack_require__.d(__webpack_exports__, "ColorPalette", function() { return /* reexport */ ColorPalette; });
-__webpack_require__.d(__webpack_exports__, "ColorPicker", function() { return /* reexport */ LegacyAdapter; });
-__webpack_require__.d(__webpack_exports__, "ComboboxControl", function() { return /* reexport */ combobox_control; });
-__webpack_require__.d(__webpack_exports__, "__unstableComposite", function() { return /* reexport */ Composite; });
-__webpack_require__.d(__webpack_exports__, "__unstableCompositeGroup", function() { return /* reexport */ CompositeGroup; });
-__webpack_require__.d(__webpack_exports__, "__unstableCompositeItem", function() { return /* reexport */ CompositeItem["a" /* CompositeItem */]; });
-__webpack_require__.d(__webpack_exports__, "__unstableUseCompositeState", function() { return /* reexport */ useCompositeState; });
-__webpack_require__.d(__webpack_exports__, "CustomSelectControl", function() { return /* reexport */ CustomSelectControl; });
-__webpack_require__.d(__webpack_exports__, "Dashicon", function() { return /* reexport */ dashicon["a" /* default */]; });
-__webpack_require__.d(__webpack_exports__, "DateTimePicker", function() { return /* reexport */ date_time; });
-__webpack_require__.d(__webpack_exports__, "DatePicker", function() { return /* reexport */ date_time_date; });
-__webpack_require__.d(__webpack_exports__, "TimePicker", function() { return /* reexport */ date_time_time; });
-__webpack_require__.d(__webpack_exports__, "__experimentalDimensionControl", function() { return /* reexport */ dimension_control; });
-__webpack_require__.d(__webpack_exports__, "Disabled", function() { return /* reexport */ build_module_disabled; });
-__webpack_require__.d(__webpack_exports__, "__unstableDisclosureContent", function() { return /* reexport */ DisclosureContent; });
-__webpack_require__.d(__webpack_exports__, "__experimentalDivider", function() { return /* reexport */ divider_component; });
-__webpack_require__.d(__webpack_exports__, "Draggable", function() { return /* reexport */ Draggable; });
-__webpack_require__.d(__webpack_exports__, "DropZone", function() { return /* reexport */ DropZoneComponent; });
-__webpack_require__.d(__webpack_exports__, "DropZoneProvider", function() { return /* reexport */ DropZoneProvider; });
-__webpack_require__.d(__webpack_exports__, "Dropdown", function() { return /* reexport */ Dropdown; });
-__webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return /* reexport */ dropdown_menu; });
-__webpack_require__.d(__webpack_exports__, "DuotoneSwatch", function() { return /* reexport */ duotone_swatch; });
-__webpack_require__.d(__webpack_exports__, "DuotonePicker", function() { return /* reexport */ duotone_picker; });
-__webpack_require__.d(__webpack_exports__, "__experimentalElevation", function() { return /* reexport */ elevation_component; });
-__webpack_require__.d(__webpack_exports__, "ExternalLink", function() { return /* reexport */ external_link; });
-__webpack_require__.d(__webpack_exports__, "Flex", function() { return /* reexport */ flex_component; });
-__webpack_require__.d(__webpack_exports__, "FlexBlock", function() { return /* reexport */ flex_block_component; });
-__webpack_require__.d(__webpack_exports__, "FlexItem", function() { return /* reexport */ flex_item_component; });
-__webpack_require__.d(__webpack_exports__, "__experimentalFlyout", function() { return /* reexport */ flyout_component; });
-__webpack_require__.d(__webpack_exports__, "FocalPointPicker", function() { return /* reexport */ focal_point_picker; });
-__webpack_require__.d(__webpack_exports__, "FocusableIframe", function() { return /* reexport */ FocusableIframe; });
-__webpack_require__.d(__webpack_exports__, "FontSizePicker", function() { return /* reexport */ font_size_picker; });
-__webpack_require__.d(__webpack_exports__, "FormFileUpload", function() { return /* reexport */ form_file_upload; });
-__webpack_require__.d(__webpack_exports__, "FormToggle", function() { return /* reexport */ form_toggle; });
-__webpack_require__.d(__webpack_exports__, "FormTokenField", function() { return /* reexport */ form_token_field; });
-__webpack_require__.d(__webpack_exports__, "GradientPicker", function() { return /* reexport */ GradientPicker; });
-__webpack_require__.d(__webpack_exports__, "CustomGradientPicker", function() { return /* reexport */ CustomGradientPicker; });
-__webpack_require__.d(__webpack_exports__, "__experimentalGrid", function() { return /* reexport */ grid_component; });
-__webpack_require__.d(__webpack_exports__, "Guide", function() { return /* reexport */ Guide; });
-__webpack_require__.d(__webpack_exports__, "GuidePage", function() { return /* reexport */ GuidePage; });
-__webpack_require__.d(__webpack_exports__, "__experimentalHeading", function() { return /* reexport */ heading_component; });
-__webpack_require__.d(__webpack_exports__, "__experimentalHStack", function() { return /* reexport */ h_stack_component; });
-__webpack_require__.d(__webpack_exports__, "Icon", function() { return /* reexport */ components_build_module_icon["a" /* default */]; });
-__webpack_require__.d(__webpack_exports__, "IconButton", function() { return /* reexport */ deprecated; });
-__webpack_require__.d(__webpack_exports__, "__experimentalItemGroup", function() { return /* reexport */ item_group_component; });
-__webpack_require__.d(__webpack_exports__, "__experimentalItem", function() { return /* reexport */ item_component; });
-__webpack_require__.d(__webpack_exports__, "__experimentalInputControl", function() { return /* reexport */ input_control; });
-__webpack_require__.d(__webpack_exports__, "KeyboardShortcuts", function() { return /* reexport */ keyboard_shortcuts; });
-__webpack_require__.d(__webpack_exports__, "MenuGroup", function() { return /* reexport */ menu_group; });
-__webpack_require__.d(__webpack_exports__, "MenuItem", function() { return /* reexport */ menu_item; });
-__webpack_require__.d(__webpack_exports__, "MenuItemsChoice", function() { return /* reexport */ MenuItemsChoice; });
-__webpack_require__.d(__webpack_exports__, "Modal", function() { return /* reexport */ Modal; });
-__webpack_require__.d(__webpack_exports__, "ScrollLock", function() { return /* reexport */ scroll_lock["a" /* default */]; });
-__webpack_require__.d(__webpack_exports__, "NavigableMenu", function() { return /* reexport */ navigable_container_menu; });
-__webpack_require__.d(__webpack_exports__, "TabbableContainer", function() { return /* reexport */ navigable_container_tabbable; });
-__webpack_require__.d(__webpack_exports__, "__experimentalNavigation", function() { return /* reexport */ Navigation; });
-__webpack_require__.d(__webpack_exports__, "__experimentalNavigationBackButton", function() { return /* reexport */ back_button; });
-__webpack_require__.d(__webpack_exports__, "__experimentalNavigationGroup", function() { return /* reexport */ NavigationGroup; });
-__webpack_require__.d(__webpack_exports__, "__experimentalNavigationItem", function() { return /* reexport */ NavigationItem; });
-__webpack_require__.d(__webpack_exports__, "__experimentalNavigationMenu", function() { return /* reexport */ NavigationMenu; });
-__webpack_require__.d(__webpack_exports__, "__experimentalNavigatorProvider", function() { return /* reexport */ navigator_provider_component; });
-__webpack_require__.d(__webpack_exports__, "__experimentalNavigatorScreen", function() { return /* reexport */ navigator_screen_component; });
-__webpack_require__.d(__webpack_exports__, "__experimentalUseNavigator", function() { return /* reexport */ use_navigator; });
-__webpack_require__.d(__webpack_exports__, "Notice", function() { return /* reexport */ build_module_notice; });
-__webpack_require__.d(__webpack_exports__, "__experimentalNumberControl", function() { return /* reexport */ number_control; });
-__webpack_require__.d(__webpack_exports__, "NoticeList", function() { return /* reexport */ notice_list; });
-__webpack_require__.d(__webpack_exports__, "Panel", function() { return /* reexport */ panel; });
-__webpack_require__.d(__webpack_exports__, "PanelBody", function() { return /* reexport */ panel_body; });
-__webpack_require__.d(__webpack_exports__, "PanelHeader", function() { return /* reexport */ panel_header; });
-__webpack_require__.d(__webpack_exports__, "PanelRow", function() { return /* reexport */ panel_row; });
-__webpack_require__.d(__webpack_exports__, "Placeholder", function() { return /* reexport */ build_module_placeholder; });
-__webpack_require__.d(__webpack_exports__, "Popover", function() { return /* reexport */ build_module_popover["a" /* default */]; });
-__webpack_require__.d(__webpack_exports__, "QueryControls", function() { return /* reexport */ QueryControls; });
-__webpack_require__.d(__webpack_exports__, "__experimentalRadio", function() { return /* reexport */ build_module_radio; });
-__webpack_require__.d(__webpack_exports__, "__experimentalRadioGroup", function() { return /* reexport */ radio_group; });
-__webpack_require__.d(__webpack_exports__, "RadioControl", function() { return /* reexport */ RadioControl; });
-__webpack_require__.d(__webpack_exports__, "RangeControl", function() { return /* reexport */ range_control; });
-__webpack_require__.d(__webpack_exports__, "ResizableBox", function() { return /* reexport */ resizable_box; });
-__webpack_require__.d(__webpack_exports__, "ResponsiveWrapper", function() { return /* reexport */ responsive_wrapper; });
-__webpack_require__.d(__webpack_exports__, "SandBox", function() { return /* reexport */ Sandbox; });
-__webpack_require__.d(__webpack_exports__, "SearchControl", function() { return /* reexport */ search_control; });
-__webpack_require__.d(__webpack_exports__, "SelectControl", function() { return /* reexport */ select_control; });
-__webpack_require__.d(__webpack_exports__, "Snackbar", function() { return /* reexport */ snackbar["a" /* default */]; });
-__webpack_require__.d(__webpack_exports__, "SnackbarList", function() { return /* reexport */ snackbar_list; });
-__webpack_require__.d(__webpack_exports__, "__experimentalSpacer", function() { return /* reexport */ spacer_component; });
-__webpack_require__.d(__webpack_exports__, "__experimentalScrollable", function() { return /* reexport */ scrollable_component; });
-__webpack_require__.d(__webpack_exports__, "Spinner", function() { return /* reexport */ Spinner; });
-__webpack_require__.d(__webpack_exports__, "__experimentalSurface", function() { return /* reexport */ surface_component; });
-__webpack_require__.d(__webpack_exports__, "TabPanel", function() { return /* reexport */ TabPanel; });
-__webpack_require__.d(__webpack_exports__, "__experimentalText", function() { return /* reexport */ text_component; });
-__webpack_require__.d(__webpack_exports__, "TextControl", function() { return /* reexport */ text_control; });
-__webpack_require__.d(__webpack_exports__, "TextareaControl", function() { return /* reexport */ TextareaControl; });
-__webpack_require__.d(__webpack_exports__, "TextHighlight", function() { return /* reexport */ text_highlight; });
-__webpack_require__.d(__webpack_exports__, "Tip", function() { return /* reexport */ tip; });
-__webpack_require__.d(__webpack_exports__, "ToggleControl", function() { return /* reexport */ ToggleControl; });
-__webpack_require__.d(__webpack_exports__, "__experimentalToggleGroupControl", function() { return /* reexport */ toggle_group_control_component; });
-__webpack_require__.d(__webpack_exports__, "__experimentalToggleGroupControlOption", function() { return /* reexport */ toggle_group_control_option_component; });
-__webpack_require__.d(__webpack_exports__, "Toolbar", function() { return /* reexport */ toolbar; });
-__webpack_require__.d(__webpack_exports__, "ToolbarButton", function() { return /* reexport */ toolbar_button; });
-__webpack_require__.d(__webpack_exports__, "ToolbarDropdownMenu", function() { return /* reexport */ toolbar_dropdown_menu; });
-__webpack_require__.d(__webpack_exports__, "__experimentalToolbarContext", function() { return /* reexport */ toolbar_context["a" /* default */]; });
-__webpack_require__.d(__webpack_exports__, "ToolbarGroup", function() { return /* reexport */ toolbar_group; });
-__webpack_require__.d(__webpack_exports__, "ToolbarItem", function() { return /* reexport */ toolbar_item["a" /* default */]; });
-__webpack_require__.d(__webpack_exports__, "__experimentalToolsPanel", function() { return /* reexport */ tools_panel_component; });
-__webpack_require__.d(__webpack_exports__, "__experimentalToolsPanelItem", function() { return /* reexport */ tools_panel_item_component; });
-__webpack_require__.d(__webpack_exports__, "__experimentalToolsPanelContext", function() { return /* reexport */ ToolsPanelContext; });
-__webpack_require__.d(__webpack_exports__, "Tooltip", function() { return /* reexport */ build_module_tooltip["a" /* default */]; });
-__webpack_require__.d(__webpack_exports__, "__experimentalTreeGrid", function() { return /* reexport */ tree_grid; });
-__webpack_require__.d(__webpack_exports__, "__experimentalTreeGridRow", function() { return /* reexport */ tree_grid_row; });
-__webpack_require__.d(__webpack_exports__, "__experimentalTreeGridCell", function() { return /* reexport */ tree_grid_cell; });
-__webpack_require__.d(__webpack_exports__, "__experimentalTreeGridItem", function() { return /* reexport */ tree_grid_item; });
-__webpack_require__.d(__webpack_exports__, "TreeSelect", function() { return /* reexport */ TreeSelect; });
-__webpack_require__.d(__webpack_exports__, "__experimentalTruncate", function() { return /* reexport */ truncate_component; });
-__webpack_require__.d(__webpack_exports__, "__experimentalUnitControl", function() { return /* reexport */ unit_control; });
-__webpack_require__.d(__webpack_exports__, "__experimentalUseCustomUnits", function() { return /* reexport */ useCustomUnits; });
-__webpack_require__.d(__webpack_exports__, "__experimentalParseUnit", function() { return /* reexport */ parseUnit; });
-__webpack_require__.d(__webpack_exports__, "__experimentalView", function() { return /* reexport */ view_component["a" /* default */]; });
-__webpack_require__.d(__webpack_exports__, "VisuallyHidden", function() { return /* reexport */ component["a" /* default */]; });
-__webpack_require__.d(__webpack_exports__, "__experimentalVStack", function() { return /* reexport */ v_stack_component; });
-__webpack_require__.d(__webpack_exports__, "IsolatedEventContainer", function() { return /* reexport */ isolated_event_container; });
-__webpack_require__.d(__webpack_exports__, "createSlotFill", function() { return /* reexport */ slot_fill["d" /* createSlotFill */]; });
-__webpack_require__.d(__webpack_exports__, "Slot", function() { return /* reexport */ slot_fill["c" /* Slot */]; });
-__webpack_require__.d(__webpack_exports__, "Fill", function() { return /* reexport */ slot_fill["a" /* Fill */]; });
-__webpack_require__.d(__webpack_exports__, "SlotFillProvider", function() { return /* reexport */ slot_fill["b" /* Provider */]; });
-__webpack_require__.d(__webpack_exports__, "__experimentalUseSlot", function() { return /* reexport */ use_slot["a" /* default */]; });
-__webpack_require__.d(__webpack_exports__, "__experimentalStyleProvider", function() { return /* reexport */ StyleProvider; });
-__webpack_require__.d(__webpack_exports__, "__experimentalZStack", function() { return /* reexport */ z_stack_component; });
-__webpack_require__.d(__webpack_exports__, "navigateRegions", function() { return /* reexport */ navigate_regions; });
-__webpack_require__.d(__webpack_exports__, "__unstableUseNavigateRegions", function() { return /* reexport */ useNavigateRegions; });
-__webpack_require__.d(__webpack_exports__, "withConstrainedTabbing", function() { return /* reexport */ with_constrained_tabbing; });
-__webpack_require__.d(__webpack_exports__, "withFallbackStyles", function() { return /* reexport */ with_fallback_styles; });
-__webpack_require__.d(__webpack_exports__, "withFilters", function() { return /* reexport */ withFilters; });
-__webpack_require__.d(__webpack_exports__, "withFocusOutside", function() { return /* reexport */ with_focus_outside; });
-__webpack_require__.d(__webpack_exports__, "withFocusReturn", function() { return /* reexport */ with_focus_return; });
-__webpack_require__.d(__webpack_exports__, "FocusReturnProvider", function() { return /* reexport */ with_focus_return_Provider; });
-__webpack_require__.d(__webpack_exports__, "withNotices", function() { return /* reexport */ with_notices; });
-__webpack_require__.d(__webpack_exports__, "withSpokenMessages", function() { return /* reexport */ with_spoken_messages; });
-// NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/text/styles.js
-var text_styles_namespaceObject = {};
-__webpack_require__.r(text_styles_namespaceObject);
-__webpack_require__.d(text_styles_namespaceObject, "Text", function() { return Text; });
-__webpack_require__.d(text_styles_namespaceObject, "block", function() { return styles_block; });
-__webpack_require__.d(text_styles_namespaceObject, "positive", function() { return positive; });
-__webpack_require__.d(text_styles_namespaceObject, "destructive", function() { return destructive; });
-__webpack_require__.d(text_styles_namespaceObject, "muted", function() { return styles_muted; });
-__webpack_require__.d(text_styles_namespaceObject, "highlighterText", function() { return highlighterText; });
-__webpack_require__.d(text_styles_namespaceObject, "upperCase", function() { return styles_upperCase; });
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = getCalendarMonthWidth;
+function getCalendarMonthWidth(daySize, calendarMonthPadding) {
+ return 7 * daySize + 2 * calendarMonthPadding + 1;
+}
-// NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/ui/tooltip/styles.js
-var tooltip_styles_namespaceObject = {};
-__webpack_require__.r(tooltip_styles_namespaceObject);
-__webpack_require__.d(tooltip_styles_namespaceObject, "TooltipContent", function() { return TooltipContent; });
-__webpack_require__.d(tooltip_styles_namespaceObject, "TooltipPopoverView", function() { return TooltipPopoverView; });
-__webpack_require__.d(tooltip_styles_namespaceObject, "noOutline", function() { return noOutline; });
-__webpack_require__.d(tooltip_styles_namespaceObject, "TooltipShortcut", function() { return TooltipShortcut; });
+/***/ }),
-// NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option/styles.js
-var toggle_group_control_option_styles_namespaceObject = {};
-__webpack_require__.r(toggle_group_control_option_styles_namespaceObject);
-__webpack_require__.d(toggle_group_control_option_styles_namespaceObject, "LabelView", function() { return LabelView; });
-__webpack_require__.d(toggle_group_control_option_styles_namespaceObject, "labelBlock", function() { return labelBlock; });
-__webpack_require__.d(toggle_group_control_option_styles_namespaceObject, "buttonView", function() { return buttonView; });
-__webpack_require__.d(toggle_group_control_option_styles_namespaceObject, "buttonActive", function() { return buttonActive; });
-__webpack_require__.d(toggle_group_control_option_styles_namespaceObject, "ButtonContentView", function() { return ButtonContentView; });
-__webpack_require__.d(toggle_group_control_option_styles_namespaceObject, "separatorActive", function() { return separatorActive; });
-__webpack_require__.d(toggle_group_control_option_styles_namespaceObject, "LabelPlaceholderView", function() { return LabelPlaceholderView; });
-__webpack_require__.d(toggle_group_control_option_styles_namespaceObject, "medium", function() { return medium; });
+/***/ 4112:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
-// EXTERNAL MODULE: external ["wp","primitives"]
-var external_wp_primitives_ = __webpack_require__("Tqx9");
+"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");
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = getNumberOfCalendarMonthWeeks;
-// EXTERNAL MODULE: external "lodash"
-var external_lodash_ = __webpack_require__("YLtl");
+var _moment = __webpack_require__(6292);
-// EXTERNAL MODULE: ./node_modules/classnames/index.js
-var classnames = __webpack_require__("TSYQ");
-var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
+var _moment2 = _interopRequireDefault(_moment);
-// EXTERNAL MODULE: external ["wp","i18n"]
-var external_wp_i18n_ = __webpack_require__("l3Sj");
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-// EXTERNAL MODULE: external ["wp","compose"]
-var external_wp_compose_ = __webpack_require__("K9lf");
+function getBlankDaysBeforeFirstDay(firstDayOfMonth, firstDayOfWeek) {
+ var weekDayDiff = firstDayOfMonth.day() - firstDayOfWeek;
+ return (weekDayDiff + 7) % 7;
+}
-// EXTERNAL MODULE: ./node_modules/reakit/es/Composite/CompositeItem.js
-var CompositeItem = __webpack_require__("kTC8");
+function getNumberOfCalendarMonthWeeks(month) {
+ var firstDayOfWeek = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _moment2['default'].localeData().firstDayOfWeek();
-// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/tooltip/index.js
-var build_module_tooltip = __webpack_require__("W/NR");
+ var firstDayOfMonth = month.clone().startOf('month');
+ var numBlankDays = getBlankDaysBeforeFirstDay(firstDayOfMonth, firstDayOfWeek);
+ return Math.ceil((numBlankDays + month.daysInMonth()) / 7);
+}
-// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/component.js + 1 modules
-var component = __webpack_require__("iSWJ");
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/utils.js
-/**
- * External dependencies
- */
+/***/ 7098:
+/***/ (function(__unused_webpack_module, exports) {
-/**
- * WordPress dependencies
- */
+"use strict";
-const GRID = [['top left', 'top center', 'top right'], ['center left', 'center center', 'center right'], ['bottom left', 'bottom center', 'bottom right']]; // Stored as map as i18n __() only accepts strings (not variables)
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = getPhrase;
+function getPhrase(phrase, args) {
+ if (typeof phrase === 'string') return phrase;
-const ALIGNMENT_LABEL = {
- 'top left': Object(external_wp_i18n_["__"])('Top Left'),
- 'top center': Object(external_wp_i18n_["__"])('Top Center'),
- 'top right': Object(external_wp_i18n_["__"])('Top Right'),
- 'center left': Object(external_wp_i18n_["__"])('Center Left'),
- 'center center': Object(external_wp_i18n_["__"])('Center Center'),
- 'center right': Object(external_wp_i18n_["__"])('Center Right'),
- 'bottom left': Object(external_wp_i18n_["__"])('Bottom Left'),
- 'bottom center': Object(external_wp_i18n_["__"])('Bottom Center'),
- 'bottom right': Object(external_wp_i18n_["__"])('Bottom Right')
-}; // Transforms GRID into a flat Array of values
+ if (typeof phrase === 'function') {
+ return phrase(args);
+ }
-const ALIGNMENTS = Object(external_lodash_["flattenDeep"])(GRID);
-/**
- * Parses and transforms an incoming value to better match the alignment values
- *
- * @param {string} value An alignment value to parse.
- *
- * @return {string} The parsed value.
- */
-
-function transformValue(value) {
- const nextValue = value === 'center' ? 'center center' : value;
- return nextValue.replace('-', ' ');
-}
-/**
- * Creates an item ID based on a prefix ID and an alignment value.
- *
- * @param {string} prefixId An ID to prefix.
- * @param {string} value An alignment value.
- *
- * @return {string} The item id.
- */
-
-function utils_getItemId(prefixId, value) {
- const valueId = transformValue(value).replace(' ', '-');
- return `${prefixId}-${valueId}`;
-}
-/**
- * Retrieves the alignment index from a value.
- *
- * @param {string} alignment Value to check.
- *
- * @return {number} The index of a matching alignment.
- */
-
-function getAlignmentIndex() {
- let alignment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'center';
- const item = transformValue(alignment).replace('-', ' ');
- const index = ALIGNMENTS.indexOf(item);
- return index > -1 ? index : undefined;
+ return '';
}
-// EXTERNAL MODULE: ./node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js + 1 modules
-var emotion_styled_base_browser_esm = __webpack_require__("DZdY");
-
-// EXTERNAL MODULE: ./node_modules/@emotion/react/dist/emotion-react.browser.esm.js
-var emotion_react_browser_esm = __webpack_require__("AeFk");
+/***/ }),
-// EXTERNAL MODULE: ./node_modules/colord/index.mjs
-var colord = __webpack_require__("fHnH");
+/***/ 2893:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
-// EXTERNAL MODULE: ./node_modules/colord/plugins/names.mjs
-var names = __webpack_require__("abaT");
+"use strict";
-// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/colors.js
-/**
- * External dependencies
- */
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = getPhrasePropTypes;
-Object(colord["b" /* extend */])([names["a" /* default */]]);
-/**
- * Generating a CSS compliant rgba() color value.
- *
- * @param {string} hexValue The hex value to convert to rgba().
- * @param {number} alpha The alpha value for opacity.
- * @return {string} The converted rgba() color value.
- *
- * @example
- * rgba( '#000000', 0.5 )
- * // rgba(0, 0, 0, 0.5)
- */
+var _object = __webpack_require__(4011);
-function rgba() {
- let hexValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
- let alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
- return Object(colord["a" /* colord */])(hexValue).alpha(alpha).toRgbString();
-}
+var _object2 = _interopRequireDefault(_object);
-// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/colors-values.js
-/**
- * External dependencies
- */
+var _propTypes = __webpack_require__(2652);
-/**
- * Internal dependencies
- */
+var _propTypes2 = _interopRequireDefault(_propTypes);
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-const BASE = {
- black: '#000',
- white: '#fff'
-};
-/**
- * TODO: Continue to update values as "G2" design evolves.
- *
- * "G2" refers to the movement to advance the interface of the block editor.
- * https://github.com/WordPress/gutenberg/issues/18667
- */
+function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-const G2 = {
- blue: {
- medium: {
- focus: '#007cba',
- focusDark: '#fff'
- }
- },
- gray: {
- 900: '#1e1e1e',
- 700: '#757575',
- // Meets 4.6:1 text contrast against white.
- 600: '#949494',
- // Meets 3:1 UI or large text contrast against white.
- 400: '#ccc',
- 200: '#ddd',
- // Used for most borders.
- 100: '#f0f0f0'
- },
- darkGray: {
- primary: '#1e1e1e',
- heading: '#050505'
- },
- mediumGray: {
- text: '#757575'
- },
- lightGray: {
- ui: '#949494',
- secondary: '#ccc',
- tertiary: '#e7e8e9'
- }
-};
-const DARK_GRAY = {
- 900: '#191e23',
- 800: '#23282d',
- 700: '#32373c',
- 600: '#40464d',
- 500: '#555d66',
- // Use this most of the time for dark items.
- 400: '#606a73',
- 300: '#6c7781',
- // Lightest gray that can be used for AA text contrast.
- 200: '#7e8993',
- 150: '#8d96a0',
- // Lightest gray that can be used for AA non-text contrast.
- 100: '#8f98a1',
- placeholder: rgba(G2.gray[900], 0.62)
-};
-const DARK_OPACITY = {
- 900: rgba('#000510', 0.9),
- 800: rgba('#00000a', 0.85),
- 700: rgba('#06060b', 0.8),
- 600: rgba('#000913', 0.75),
- 500: rgba('#0a1829', 0.7),
- 400: rgba('#0a1829', 0.65),
- 300: rgba('#0e1c2e', 0.62),
- 200: rgba('#162435', 0.55),
- 100: rgba('#223443', 0.5),
- backgroundFill: rgba(DARK_GRAY[700], 0.7)
-};
-const DARK_OPACITY_LIGHT = {
- 900: rgba('#304455', 0.45),
- 800: rgba('#425863', 0.4),
- 700: rgba('#667886', 0.35),
- 600: rgba('#7b86a2', 0.3),
- 500: rgba('#9197a2', 0.25),
- 400: rgba('#95959c', 0.2),
- 300: rgba('#829493', 0.15),
- 200: rgba('#8b8b96', 0.1),
- 100: rgba('#747474', 0.05)
-};
-const LIGHT_GRAY = {
- 900: '#a2aab2',
- 800: '#b5bcc2',
- 700: '#ccd0d4',
- 600: '#d7dade',
- 500: '#e2e4e7',
- // Good for "grayed" items and borders.
- 400: '#e8eaeb',
- // Good for "readonly" input fields and special text selection.
- 300: '#edeff0',
- 200: '#f3f4f5',
- 100: '#f8f9f9',
- placeholder: rgba(BASE.white, 0.65)
-};
-const LIGHT_OPACITY_LIGHT = {
- 900: rgba(BASE.white, 0.5),
- 800: rgba(BASE.white, 0.45),
- 700: rgba(BASE.white, 0.4),
- 600: rgba(BASE.white, 0.35),
- 500: rgba(BASE.white, 0.3),
- 400: rgba(BASE.white, 0.25),
- 300: rgba(BASE.white, 0.2),
- 200: rgba(BASE.white, 0.15),
- 100: rgba(BASE.white, 0.1),
- backgroundFill: rgba(LIGHT_GRAY[300], 0.8)
-}; // Additional colors.
-// Some are from https://make.wordpress.org/design/handbook/foundations/colors/.
+function getPhrasePropTypes(defaultPhrases) {
+ return Object.keys(defaultPhrases).reduce(function (phrases, key) {
+ return (0, _object2['default'])({}, phrases, _defineProperty({}, key, _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].func, _propTypes2['default'].node])));
+ }, {});
+}
-const BLUE = {
- wordpress: {
- 700: '#00669b'
- },
- dark: {
- 900: '#0071a1'
- },
- medium: {
- 900: '#006589',
- 800: '#00739c',
- 700: '#007fac',
- 600: '#008dbe',
- 500: '#00a0d2',
- 400: '#33b3db',
- 300: '#66c6e4',
- 200: '#bfe7f3',
- 100: '#e5f5fa',
- highlight: '#b3e7fe',
- focus: '#007cba'
- }
-};
-const ALERT = {
- yellow: '#f0b849',
- red: '#d94f4f',
- green: '#4ab866'
-};
-const ADMIN = {
- theme: `var( --wp-admin-theme-color, ${BLUE.wordpress[700]})`,
- themeDark10: `var( --wp-admin-theme-color-darker-10, ${BLUE.medium.focus})`
-}; // Namespaced values for raw colors hex codes
+/***/ }),
-const UI = {
- theme: ADMIN.theme,
- background: BASE.white,
- backgroundDisabled: LIGHT_GRAY[200],
- border: G2.gray[700],
- borderHover: G2.gray[700],
- borderFocus: ADMIN.themeDark10,
- borderDisabled: G2.gray[400],
- borderLight: G2.gray[200],
- label: DARK_GRAY[500],
- textDisabled: DARK_GRAY[150],
- textDark: BASE.white,
- textLight: BASE.black
-};
-const COLORS = { ...BASE,
- darkGray: Object(external_lodash_["merge"])({}, DARK_GRAY, G2.darkGray),
- darkOpacity: DARK_OPACITY,
- darkOpacityLight: DARK_OPACITY_LIGHT,
- mediumGray: G2.mediumGray,
- gray: G2.gray,
- lightGray: Object(external_lodash_["merge"])({}, LIGHT_GRAY, G2.lightGray),
- lightGrayLight: LIGHT_OPACITY_LIGHT,
- blue: Object(external_lodash_["merge"])({}, BLUE, G2.blue),
- alert: ALERT,
- admin: ADMIN,
- ui: UI
-};
-/* harmony default export */ var colors_values = (COLORS);
+/***/ 8304:
+/***/ (function(__unused_webpack_module, exports) {
-// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/reduce-motion.js
-/**
- * Allows users to opt-out of animations via OS-level preferences.
- *
- * @param {'transition' | 'animation' | string} [prop='transition'] CSS Property name
- * @return {string} Generated CSS code for the reduced style
- */
-function reduceMotion() {
- let prop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transition';
- let style;
+"use strict";
- switch (prop) {
- case 'transition':
- style = 'transition-duration: 0ms;';
- break;
- case 'animation':
- style = 'animation-duration: 1ms;';
- break;
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = getTransformStyles;
+function getTransformStyles(transformValue) {
+ return {
+ transform: transformValue,
+ msTransform: transformValue,
+ MozTransform: transformValue,
+ WebkitTransform: transformValue
+ };
+}
- default:
- style = `
- animation-duration: 1ms;
- transition-duration: 0ms;
- `;
- }
+/***/ }),
- return `
- @media ( prefers-reduced-motion: reduce ) {
- ${style};
- }
- `;
-}
+/***/ 3268:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
-// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js
+"use strict";
-function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = getVisibleDays;
-/**
- * External dependencies
- */
+var _moment = __webpack_require__(6292);
-/**
- * Internal dependencies
- */
+var _moment2 = _interopRequireDefault(_moment);
+var _toISOMonthString = __webpack_require__(2705);
+var _toISOMonthString2 = _interopRequireDefault(_toISOMonthString);
-var alignment_matrix_control_styles_ref = true ? {
- name: "lp9rn7",
- styles: "border-radius:2px;box-sizing:border-box;display:grid;grid-template-columns:repeat( 3, 1fr );outline:none"
-} : undefined;
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-const rootBase = () => {
- return alignment_matrix_control_styles_ref;
-};
+function getVisibleDays(month, numberOfMonths, enableOutsideDays, withoutTransitionMonths) {
+ if (!_moment2['default'].isMoment(month)) return {};
-const rootSize = _ref2 => {
- let {
- size = 92
- } = _ref2;
- return /*#__PURE__*/Object(emotion_react_browser_esm["a" /* css */])("grid-template-rows:repeat( 3, calc( ", size, "px / 3 ) );width:", size, "px;" + ( true ? "" : undefined), true ? "" : undefined);
-};
+ var visibleDaysByMonth = {};
+ var currentMonth = withoutTransitionMonths ? month.clone() : month.clone().subtract(1, 'month');
+ for (var i = 0; i < (withoutTransitionMonths ? numberOfMonths : numberOfMonths + 2); i += 1) {
+ var visibleDays = [];
-const Root = Object(emotion_styled_base_browser_esm["a" /* default */])("div", true ? {
- target: "e1od1u4s3"
-} : undefined)(rootBase, ";border:1px solid transparent;cursor:pointer;grid-template-columns:auto;", rootSize, ";" + ( true ? "" : undefined));
-const Row = Object(emotion_styled_base_browser_esm["a" /* default */])("div", true ? {
- target: "e1od1u4s2"
-} : undefined)( true ? {
- name: "1x5gbbj",
- styles: "box-sizing:border-box;display:grid;grid-template-columns:repeat( 3, 1fr )"
-} : undefined);
+ // set utc offset to get correct dates in future (when timezone changes)
+ var baseDate = currentMonth.clone();
+ var firstOfMonth = baseDate.clone().startOf('month').hour(12);
+ var lastOfMonth = baseDate.clone().endOf('month').hour(12);
-const pointActive = _ref3 => {
- let {
- isActive
- } = _ref3;
- const boxShadow = isActive ? `0 0 0 2px ${COLORS.black}` : null;
- const pointColor = isActive ? COLORS.black : COLORS.lightGray[800];
- const pointColorHover = isActive ? COLORS.black : COLORS.blue.medium.focus;
- return /*#__PURE__*/Object(emotion_react_browser_esm["a" /* css */])("box-shadow:", boxShadow, ";color:", pointColor, ";*:hover>&{color:", pointColorHover, ";}" + ( true ? "" : undefined), true ? "" : undefined);
-};
+ var currentDay = firstOfMonth.clone();
-const pointBase = props => {
- return /*#__PURE__*/Object(emotion_react_browser_esm["a" /* css */])("background:currentColor;box-sizing:border-box;display:grid;margin:auto;transition:all 120ms linear;", reduceMotion('transition'), " ", pointActive(props), ";" + ( true ? "" : undefined), true ? "" : undefined);
-};
-const Point = Object(emotion_styled_base_browser_esm["a" /* default */])("span", true ? {
- target: "e1od1u4s1"
-} : undefined)("height:6px;width:6px;", pointBase, ";" + ( true ? "" : undefined));
-const Cell = Object(emotion_styled_base_browser_esm["a" /* default */])("span", true ? {
- target: "e1od1u4s0"
-} : undefined)( true ? {
- name: "rjf3ub",
- styles: "appearance:none;border:none;box-sizing:border-box;margin:0;display:flex;position:relative;outline:none;align-items:center;justify-content:center;padding:0"
-} : undefined);
+ // days belonging to the previous month
+ if (enableOutsideDays) {
+ for (var j = 0; j < currentDay.weekday(); j += 1) {
+ var prevDay = currentDay.clone().subtract(j + 1, 'day');
+ visibleDays.unshift(prevDay);
+ }
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/cell.js
+ while (currentDay < lastOfMonth) {
+ visibleDays.push(currentDay.clone());
+ currentDay.add(1, 'day');
+ }
+ if (enableOutsideDays) {
+ // weekday() returns the index of the day of the week according to the locale
+ // this means if the week starts on Monday, weekday() will return 0 for a Monday date, not 1
+ if (currentDay.weekday() !== 0) {
+ // days belonging to the next month
+ for (var k = currentDay.weekday(), count = 0; k < 7; k += 1, count += 1) {
+ var nextDay = currentDay.clone().add(count, 'day');
+ visibleDays.push(nextDay);
+ }
+ }
+ }
+ visibleDaysByMonth[(0, _toISOMonthString2['default'])(currentMonth)] = visibleDays;
+ currentMonth = currentMonth.clone().add(1, 'month');
+ }
-/**
- * Internal dependencies
- */
+ return visibleDaysByMonth;
+}
+/***/ }),
+/***/ 7365:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
-/**
- * Internal dependencies
- */
+"use strict";
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = isAfterDay;
-function cell_Cell(_ref) {
- let {
- isActive = false,
- value,
- ...props
- } = _ref;
- const tooltipText = ALIGNMENT_LABEL[value];
- return Object(external_wp_element_["createElement"])(build_module_tooltip["a" /* default */], {
- text: tooltipText
- }, Object(external_wp_element_["createElement"])(CompositeItem["a" /* CompositeItem */], Object(esm_extends["a" /* default */])({
- as: Cell,
- role: "gridcell"
- }, props), Object(external_wp_element_["createElement"])(component["a" /* default */], null, value), Object(external_wp_element_["createElement"])(Point, {
- isActive: isActive,
- role: "presentation"
- })));
-}
+var _moment = __webpack_require__(6292);
-// EXTERNAL MODULE: ./node_modules/reakit/es/_rollupPluginBabelHelpers-1f0bf8c2.js
-var _rollupPluginBabelHelpers_1f0bf8c2 = __webpack_require__("BZp5");
+var _moment2 = _interopRequireDefault(_moment);
-// EXTERNAL MODULE: external "React"
-var external_React_ = __webpack_require__("cDcd");
-var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_);
+var _isBeforeDay = __webpack_require__(862);
-// EXTERNAL MODULE: ./node_modules/reakit-utils/es/useIsomorphicEffect.js
-var useIsomorphicEffect = __webpack_require__("AXvK");
+var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
-// CONCATENATED MODULE: ./node_modules/reakit-utils/es/useSealedState.js
+var _isSameDay = __webpack_require__(3923);
+var _isSameDay2 = _interopRequireDefault(_isSameDay);
-/**
- * React custom hook that returns the very first value passed to `initialState`,
- * even if it changes between re-renders.
- */
-function useSealedState(initialState) {
- var _React$useState = Object(external_React_["useState"])(initialState),
- sealed = _React$useState[0];
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- return sealed;
+function isAfterDay(a, b) {
+ if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
+ return !(0, _isBeforeDay2['default'])(a, b) && !(0, _isSameDay2['default'])(a, b);
}
+/***/ }),
+/***/ 862:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
-// EXTERNAL MODULE: ./node_modules/reakit-utils/es/getDocument.js
-var getDocument = __webpack_require__("ouKs");
+"use strict";
-// CONCATENATED MODULE: ./node_modules/reakit/es/reverse-30eaa122.js
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = isBeforeDay;
-function groupItems(items) {
- var groups = [[]];
+var _moment = __webpack_require__(6292);
- var _loop = function _loop() {
- var item = _step.value;
- var group = groups.find(function (g) {
- return !g[0] || g[0].groupId === item.groupId;
- });
+var _moment2 = _interopRequireDefault(_moment);
- if (group) {
- group.push(item);
- } else {
- groups.push([item]);
- }
- };
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(items), _step; !(_step = _iterator()).done;) {
- _loop();
- }
+function isBeforeDay(a, b) {
+ if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
- return groups;
-}
+ var aYear = a.year();
+ var aMonth = a.month();
-function flatten(grid) {
- var flattened = [];
+ var bYear = b.year();
+ var bMonth = b.month();
- for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(grid), _step; !(_step = _iterator()).done;) {
- var row = _step.value;
- flattened.push.apply(flattened, row);
- }
+ var isSameYear = aYear === bYear;
+ var isSameMonth = aMonth === bMonth;
- return flattened;
+ if (isSameYear && isSameMonth) return a.date() < b.date();
+ if (isSameYear) return aMonth < bMonth;
+ return aYear < bYear;
}
-function reverse(array) {
- return array.slice().reverse();
-}
+/***/ }),
+/***/ 5713:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
+"use strict";
-// EXTERNAL MODULE: ./node_modules/reakit/es/getCurrentId-5aa9849e.js
-var getCurrentId_5aa9849e = __webpack_require__("iYXd");
-// CONCATENATED MODULE: ./node_modules/reakit/es/findEnabledItemById-8ddca752.js
-function findEnabledItemById(items, id) {
- if (!id) return undefined;
- return items === null || items === void 0 ? void 0 : items.find(function (item) {
- return item.id === id && !item.disabled;
- });
-}
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = isDayVisible;
+var _isBeforeDay = __webpack_require__(862);
+var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
-// CONCATENATED MODULE: ./node_modules/reakit-utils/es/applyState.js
-function isUpdater(argument) {
- return typeof argument === "function";
-}
-/**
- * Receives a `setState` argument and calls it with `currentValue` if it's a
- * function. Otherwise return the argument as the new value.
- *
- * @example
- * import { applyState } from "reakit-utils";
- *
- * applyState((value) => value + 1, 1); // 2
- * applyState(2, 1); // 2
- */
+var _isAfterDay = __webpack_require__(7365);
+var _isAfterDay2 = _interopRequireDefault(_isAfterDay);
-function applyState(argument, currentValue) {
- if (isUpdater(argument)) {
- return argument(currentValue);
- }
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- return argument;
-}
+function isDayVisible(day, month, numberOfMonths, enableOutsideDays) {
+ var firstDayOfFirstMonth = month.clone().startOf('month');
+ if (enableOutsideDays) firstDayOfFirstMonth = firstDayOfFirstMonth.startOf('week');
+ if ((0, _isBeforeDay2['default'])(day, firstDayOfFirstMonth)) return false;
+ var lastDayOfLastMonth = month.clone().add(numberOfMonths - 1, 'months').endOf('month');
+ if (enableOutsideDays) lastDayOfLastMonth = lastDayOfLastMonth.endOf('week');
+ return !(0, _isAfterDay2['default'])(day, lastDayOfLastMonth);
+}
+/***/ }),
-// EXTERNAL MODULE: ./node_modules/reakit/es/Id/IdProvider.js
-var IdProvider = __webpack_require__("KCH1");
+/***/ 1310:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
-// CONCATENATED MODULE: ./node_modules/reakit/es/Id/IdState.js
+"use strict";
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = isNextMonth;
+var _moment = __webpack_require__(6292);
-function unstable_useIdState(initialState) {
- if (initialState === void 0) {
- initialState = {};
- }
+var _moment2 = _interopRequireDefault(_moment);
- var _useSealedState = useSealedState(initialState),
- initialBaseId = _useSealedState.baseId;
+var _isSameMonth = __webpack_require__(4669);
- var generateId = Object(external_React_["useContext"])(IdProvider["a" /* unstable_IdContext */]);
- var idCountRef = Object(external_React_["useRef"])(0);
+var _isSameMonth2 = _interopRequireDefault(_isSameMonth);
- var _React$useState = Object(external_React_["useState"])(function () {
- return initialBaseId || generateId();
- }),
- baseId = _React$useState[0],
- setBaseId = _React$useState[1];
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- return {
- baseId: baseId,
- setBaseId: setBaseId,
- unstable_idCountRef: idCountRef
- };
+function isNextMonth(a, b) {
+ if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
+ return (0, _isSameMonth2['default'])(a.clone().add(1, 'month'), b);
}
+/***/ }),
+/***/ 3858:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
-// CONCATENATED MODULE: ./node_modules/reakit/es/Composite/CompositeState.js
-
+"use strict";
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = isPrevMonth;
+var _moment = __webpack_require__(6292);
+var _moment2 = _interopRequireDefault(_moment);
+var _isSameMonth = __webpack_require__(4669);
+var _isSameMonth2 = _interopRequireDefault(_isSameMonth);
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+function isPrevMonth(a, b) {
+ if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
+ return (0, _isSameMonth2['default'])(a.clone().subtract(1, 'month'), b);
+}
+/***/ }),
+/***/ 3923:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
-function isElementPreceding(element1, element2) {
- return Boolean(element2.compareDocumentPosition(element1) & Node.DOCUMENT_POSITION_PRECEDING);
-}
+"use strict";
-function findDOMIndex(items, item) {
- return items.findIndex(function (currentItem) {
- if (!currentItem.ref.current || !item.ref.current) {
- return false;
- }
- return isElementPreceding(item.ref.current, currentItem.ref.current);
- });
-}
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = isSameDay;
-function getMaxLength(rows) {
- var maxLength = 0;
+var _moment = __webpack_require__(6292);
- for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(rows), _step; !(_step = _iterator()).done;) {
- var length = _step.value.length;
+var _moment2 = _interopRequireDefault(_moment);
- if (length > maxLength) {
- maxLength = length;
- }
- }
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- return maxLength;
+function isSameDay(a, b) {
+ if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
+ // Compare least significant, most likely to change units first
+ // Moment's isSame clones moment inputs and is a tad slow
+ return a.date() === b.date() && a.month() === b.month() && a.year() === b.year();
}
-/**
- * Turns [row1, row1, row2, row2] into [row1, row2, row1, row2]
- */
+/***/ }),
-function verticalizeItems(items) {
- var groups = groupItems(items);
- var maxLength = getMaxLength(groups);
- var verticalized = [];
+/***/ 4669:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- for (var i = 0; i < maxLength; i += 1) {
- for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(groups), _step; !(_step = _iterator()).done;) {
- var group = _step.value;
+"use strict";
- if (group[i]) {
- verticalized.push(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, group[i]), {}, {
- // If there's no groupId, it means that it's not a grid composite,
- // but a single row instead. So, instead of verticalizing it, that
- // is, assigning a different groupId based on the column index, we
- // keep it undefined so they will be part of the same group.
- // It's useful when using up/down on one-dimensional composites.
- groupId: group[i].groupId ? "" + i : undefined
- }));
- }
- }
- }
- return verticalized;
-}
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = isSameMonth;
-function createEmptyItem(groupId) {
- return {
- id: "__EMPTY_ITEM__",
- disabled: true,
- ref: {
- current: null
- },
- groupId: groupId
- };
-}
-/**
- * Turns [[row1, row1], [row2]] into [[row1, row1], [row2, row2]]
- */
+var _moment = __webpack_require__(6292);
+var _moment2 = _interopRequireDefault(_moment);
-function fillGroups(groups, currentId, shift) {
- var maxLength = getMaxLength(groups);
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(groups), _step; !(_step = _iterator()).done;) {
- var group = _step.value;
+function isSameMonth(a, b) {
+ if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
+ // Compare least significant, most likely to change units first
+ // Moment's isSame clones moment inputs and is a tad slow
+ return a.month() === b.month() && a.year() === b.year();
+}
- for (var i = 0; i < maxLength; i += 1) {
- var item = group[i];
+/***/ }),
- if (!item || shift && item.disabled) {
- var isFrist = i === 0;
- var previousItem = isFrist && shift ? Object(getCurrentId_5aa9849e["a" /* f */])(group) : group[i - 1];
- group[i] = previousItem && currentId !== (previousItem === null || previousItem === void 0 ? void 0 : previousItem.id) && shift ? previousItem : createEmptyItem(previousItem === null || previousItem === void 0 ? void 0 : previousItem.groupId);
- }
- }
- }
+/***/ 7978:
+/***/ (function(__unused_webpack_module, exports) {
- return groups;
-}
+"use strict";
-var nullItem = {
- id: null,
- ref: {
- current: null
- }
-};
-function placeItemsAfter(items, id, shouldInsertNullItem) {
- var index = items.findIndex(function (item) {
- return item.id === id;
- });
- return [].concat(items.slice(index + 1), shouldInsertNullItem ? [nullItem] : [], items.slice(0, index));
-}
-function getItemsInGroup(items, groupId) {
- return items.filter(function (item) {
- return item.groupId === groupId;
- });
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = isTransitionEndSupported;
+function isTransitionEndSupported() {
+ return !!(typeof window !== 'undefined' && 'TransitionEvent' in window);
}
-var map = {
- horizontal: "vertical",
- vertical: "horizontal"
-};
-function getOppositeOrientation(orientation) {
- return orientation && map[orientation];
-}
+/***/ }),
-function addItemAtIndex(array, item, index) {
- if (!(index in array)) {
- return [].concat(array, [item]);
- }
+/***/ 9305:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- return [].concat(array.slice(0, index), [item], array.slice(index));
-}
+"use strict";
-function sortBasedOnDOMPosition(items) {
- var pairs = items.map(function (item, index) {
- return [index, item];
- });
- var isOrderDifferent = false;
- pairs.sort(function (_ref, _ref2) {
- var indexA = _ref[0],
- a = _ref[1];
- var indexB = _ref2[0],
- b = _ref2[1];
- var elementA = a.ref.current;
- var elementB = b.ref.current;
- if (!elementA || !elementB) return 0; // a before b
- if (isElementPreceding(elementA, elementB)) {
- if (indexA > indexB) {
- isOrderDifferent = true;
- }
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = registerCSSInterfaceWithDefaultTheme;
- return -1;
- } // a after b
+var _reactWithStylesInterfaceCss = __webpack_require__(5553);
+var _reactWithStylesInterfaceCss2 = _interopRequireDefault(_reactWithStylesInterfaceCss);
- if (indexA < indexB) {
- isOrderDifferent = true;
- }
+var _registerInterfaceWithDefaultTheme = __webpack_require__(1980);
- return 1;
- });
+var _registerInterfaceWithDefaultTheme2 = _interopRequireDefault(_registerInterfaceWithDefaultTheme);
- if (isOrderDifferent) {
- return pairs.map(function (_ref3) {
- var _ = _ref3[0],
- item = _ref3[1];
- return item;
- });
- }
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- return items;
+function registerCSSInterfaceWithDefaultTheme() {
+ (0, _registerInterfaceWithDefaultTheme2['default'])(_reactWithStylesInterfaceCss2['default']);
}
-function setItemsBasedOnDOMPosition(items, setItems) {
- var sortedItems = sortBasedOnDOMPosition(items);
+/***/ }),
- if (items !== sortedItems) {
- setItems(sortedItems);
- }
-}
+/***/ 1980:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
-function getCommonParent(items) {
- var _firstItem$ref$curren;
+"use strict";
- var firstItem = items[0],
- nextItems = items.slice(1);
- var parentElement = firstItem === null || firstItem === void 0 ? void 0 : (_firstItem$ref$curren = firstItem.ref.current) === null || _firstItem$ref$curren === void 0 ? void 0 : _firstItem$ref$curren.parentElement;
- var _loop = function _loop() {
- var parent = parentElement;
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = registerInterfaceWithDefaultTheme;
- if (nextItems.every(function (item) {
- return parent.contains(item.ref.current);
- })) {
- return {
- v: parentElement
- };
- }
+var _ThemedStyleSheet = __webpack_require__(9349);
- parentElement = parentElement.parentElement;
- };
+var _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet);
- while (parentElement) {
- var _ret = _loop();
+var _DefaultTheme = __webpack_require__(8158);
- if (typeof _ret === "object") return _ret.v;
- }
+var _DefaultTheme2 = _interopRequireDefault(_DefaultTheme);
- return Object(getDocument["a" /* getDocument */])(parentElement).body;
-} // istanbul ignore next: JSDOM doesn't support IntersectionObverser
-// See https://github.com/jsdom/jsdom/issues/2032
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+function registerInterfaceWithDefaultTheme(reactWithStylesInterface) {
+ _ThemedStyleSheet2['default'].registerInterface(reactWithStylesInterface);
+ _ThemedStyleSheet2['default'].registerTheme(_DefaultTheme2['default']);
+}
-function useIntersectionObserver(items, setItems) {
- var previousItems = Object(external_React_["useRef"])([]);
- Object(external_React_["useEffect"])(function () {
- var callback = function callback() {
- var hasPreviousItems = !!previousItems.current.length; // We don't want to sort items if items have been just registered.
+/***/ }),
- if (hasPreviousItems) {
- setItemsBasedOnDOMPosition(items, setItems);
- }
+/***/ 7310:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- previousItems.current = items;
- };
+"use strict";
- var root = getCommonParent(items);
- var observer = new IntersectionObserver(callback, {
- root: root
- });
- for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2["c" /* b */])(items), _step; !(_step = _iterator()).done;) {
- var item = _step.value;
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = toISODateString;
- if (item.ref.current) {
- observer.observe(item.ref.current);
- }
- }
+var _moment = __webpack_require__(6292);
- return function () {
- observer.disconnect();
- };
- }, [items]);
-}
+var _moment2 = _interopRequireDefault(_moment);
-function useTimeoutObserver(items, setItems) {
- Object(external_React_["useEffect"])(function () {
- var callback = function callback() {
- return setItemsBasedOnDOMPosition(items, setItems);
- };
+var _toMomentObject = __webpack_require__(2008);
- var timeout = setTimeout(callback, 250);
- return function () {
- return clearTimeout(timeout);
- };
- });
-}
+var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
-function useSortBasedOnDOMPosition(items, setItems) {
- if (typeof IntersectionObserver === "function") {
- useIntersectionObserver(items, setItems);
- } else {
- useTimeoutObserver(items, setItems);
- }
-}
+var _constants = __webpack_require__(257);
-function CompositeState_reducer(state, action) {
- var virtual = state.unstable_virtual,
- rtl = state.rtl,
- orientation = state.orientation,
- items = state.items,
- groups = state.groups,
- currentId = state.currentId,
- loop = state.loop,
- wrap = state.wrap,
- pastIds = state.pastIds,
- shift = state.shift,
- moves = state.unstable_moves,
- includesBaseElement = state.unstable_includesBaseElement,
- initialVirtual = state.initialVirtual,
- initialRTL = state.initialRTL,
- initialOrientation = state.initialOrientation,
- initialCurrentId = state.initialCurrentId,
- initialLoop = state.initialLoop,
- initialWrap = state.initialWrap,
- initialShift = state.initialShift,
- hasSetCurrentId = state.hasSetCurrentId;
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- switch (action.type) {
- case "registerGroup":
- {
- var _group = action.group; // If there are no groups yet, just add it as the first one
+function toISODateString(date, currentFormat) {
+ var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat);
+ if (!dateObj) return null;
- if (groups.length === 0) {
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- groups: [_group]
- });
- } // Finds the group index based on DOM position
+ return dateObj.format(_constants.ISO_FORMAT);
+}
+/***/ }),
- var index = findDOMIndex(groups, _group);
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- groups: addItemAtIndex(groups, _group, index)
- });
- }
+/***/ 2705:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- case "unregisterGroup":
- {
- var _id = action.id;
- var nextGroups = groups.filter(function (group) {
- return group.id !== _id;
- }); // The group isn't registered, so do nothing
+"use strict";
- if (nextGroups.length === groups.length) {
- return state;
- }
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- groups: nextGroups
- });
- }
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = toISOMonthString;
- case "registerItem":
- {
- var _item = action.item; // Finds the item group based on the DOM hierarchy
+var _moment = __webpack_require__(6292);
- var _group2 = groups.find(function (r) {
- var _r$ref$current;
+var _moment2 = _interopRequireDefault(_moment);
- return (_r$ref$current = r.ref.current) === null || _r$ref$current === void 0 ? void 0 : _r$ref$current.contains(_item.ref.current);
- }); // Group will be null if it's a one-dimensional composite
+var _toMomentObject = __webpack_require__(2008);
+var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
- var nextItem = Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
- groupId: _group2 === null || _group2 === void 0 ? void 0 : _group2.id
- }, _item);
+var _constants = __webpack_require__(257);
- var _index = findDOMIndex(items, nextItem);
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- var nextState = Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- items: addItemAtIndex(items, nextItem, _index)
- });
+function toISOMonthString(date, currentFormat) {
+ var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat);
+ if (!dateObj) return null;
- if (!hasSetCurrentId && !moves && initialCurrentId === undefined) {
- var _findFirstEnabledItem;
+ return dateObj.format(_constants.ISO_MONTH_FORMAT);
+}
- // Sets currentId to the first enabled item. This runs whenever an item
- // is registered because the first enabled item may be registered
- // asynchronously.
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, nextState), {}, {
- currentId: (_findFirstEnabledItem = Object(getCurrentId_5aa9849e["a" /* f */])(nextState.items)) === null || _findFirstEnabledItem === void 0 ? void 0 : _findFirstEnabledItem.id
- });
- }
+/***/ }),
- return nextState;
- }
+/***/ 2008:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- case "unregisterItem":
- {
- var _id2 = action.id;
- var nextItems = items.filter(function (item) {
- return item.id !== _id2;
- }); // The item isn't registered, so do nothing
+"use strict";
- if (nextItems.length === items.length) {
- return state;
- } // Filters out the item that is being removed from the pastIds list
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = toMomentObject;
- var nextPastIds = pastIds.filter(function (pastId) {
- return pastId !== _id2;
- });
+var _moment = __webpack_require__(6292);
- var _nextState = Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- pastIds: nextPastIds,
- items: nextItems
- }); // If the current item is the item that is being removed, focus pastId
+var _moment2 = _interopRequireDefault(_moment);
+var _constants = __webpack_require__(257);
- if (currentId && currentId === _id2) {
- var nextId = includesBaseElement ? null : Object(getCurrentId_5aa9849e["b" /* g */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState), {}, {
- currentId: nextPastIds[0]
- }));
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState), {}, {
- currentId: nextId
- });
- }
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
- return _nextState;
- }
+function toMomentObject(dateString, customFormat) {
+ var dateFormats = customFormat ? [customFormat, _constants.DISPLAY_FORMAT, _constants.ISO_FORMAT] : [_constants.DISPLAY_FORMAT, _constants.ISO_FORMAT];
- case "move":
- {
- var _id3 = action.id; // move() does nothing
+ var date = (0, _moment2['default'])(dateString, dateFormats, true);
+ return date.isValid() ? date.hour(12) : null;
+}
- if (_id3 === undefined) {
- return state;
- } // Removes the current item and the item that is receiving focus from the
- // pastIds list
+/***/ }),
+/***/ 4821:
+/***/ (function(__unused_webpack_module, exports) {
- var filteredPastIds = pastIds.filter(function (pastId) {
- return pastId !== currentId && pastId !== _id3;
- }); // If there's a currentId, add it to the pastIds list so it can be focused
- // if the new item gets removed or disabled
+"use strict";
+/** @license React v16.13.1
+ * react-is.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
- var _nextPastIds = currentId ? [currentId].concat(filteredPastIds) : filteredPastIds;
+var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
+Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
+function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;
+exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};
+exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};
+exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;
- var _nextState2 = Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- pastIds: _nextPastIds
- }); // move(null) will focus the composite element itself, not an item
+/***/ }),
- if (_id3 === null) {
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState2), {}, {
- unstable_moves: moves + 1,
- currentId: Object(getCurrentId_5aa9849e["b" /* g */])(_nextState2, _id3)
- });
- }
+/***/ 338:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- var _item2 = findEnabledItemById(items, _id3);
+"use strict";
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState2), {}, {
- unstable_moves: _item2 ? moves + 1 : moves,
- currentId: Object(getCurrentId_5aa9849e["b" /* g */])(_nextState2, _item2 === null || _item2 === void 0 ? void 0 : _item2.id)
- });
- }
- case "next":
- {
- // If there's no item focused, we just move the first one
- if (currentId == null) {
- return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
- type: "first"
- }));
- } // RTL doesn't make sense on vertical navigation
+if (true) {
+ module.exports = __webpack_require__(4821);
+} else {}
- var isHorizontal = orientation !== "vertical";
- var isRTL = rtl && isHorizontal;
- var allItems = isRTL ? reverse(items) : items;
- var currentItem = allItems.find(function (item) {
- return item.id === currentId;
- }); // If there's no item focused, we just move the first one
+/***/ }),
- if (!currentItem) {
- return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
- type: "first"
- }));
- }
+/***/ 9217:
+/***/ (function(module) {
- var isGrid = !!currentItem.groupId;
- var currentIndex = allItems.indexOf(currentItem);
+var messages = {
+ invalidPredicate: '`predicate` must be a function',
+ invalidPropValidator: '`propValidator` must be a function',
+ requiredCore: 'is marked as required',
+ invalidTypeCore: 'Invalid input type',
+ predicateFailureCore: 'Failed to succeed with predicate',
+ anonymousMessage: '<<anonymous>>',
+ baseInvalidMessage: 'Invalid ',
+};
- var _nextItems = allItems.slice(currentIndex + 1);
+function constructPropValidatorVariations(propValidator) {
+ if (typeof propValidator !== 'function') {
+ throw new Error(messages.invalidPropValidator);
+ }
- var nextItemsInGroup = getItemsInGroup(_nextItems, currentItem.groupId); // Home, End
+ var requiredPropValidator = propValidator.bind(null, false, null);
+ requiredPropValidator.isRequired = propValidator.bind(null, true, null);
- if (action.allTheWay) {
- // We reverse so we can get the last enabled item in the group. If it's
- // RTL, nextItems and nextItemsInGroup are already reversed and don't
- // have the items before the current one anymore. So we have to get
- // items in group again with allItems.
- var _nextItem2 = Object(getCurrentId_5aa9849e["a" /* f */])(isRTL ? getItemsInGroup(allItems, currentItem.groupId) : reverse(nextItemsInGroup));
+ requiredPropValidator.withPredicate = function predicateApplication(predicate) {
+ if (typeof predicate !== 'function') {
+ throw new Error(messages.invalidPredicate);
+ }
+ var basePropValidator = propValidator.bind(null, false, predicate);
+ basePropValidator.isRequired = propValidator.bind(null, true, predicate);
+ return basePropValidator;
+ };
- return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
- type: "move",
- id: _nextItem2 === null || _nextItem2 === void 0 ? void 0 : _nextItem2.id
- }));
- }
+ return requiredPropValidator;
+}
- var oppositeOrientation = getOppositeOrientation( // If it's a grid and orientation is not set, it's a next/previous
- // call, which is inherently horizontal. up/down will call next with
- // orientation set to vertical by default (see below on up/down cases).
- isGrid ? orientation || "horizontal" : orientation);
- var canLoop = loop && loop !== oppositeOrientation;
- var canWrap = isGrid && wrap && wrap !== oppositeOrientation;
- var hasNullItem = // `previous` and `up` will set action.hasNullItem, but when calling
- // next directly, hasNullItem will only be true if it's not a grid and
- // loop is set to true, which means that pressing right or down keys on
- // grids will never focus the composite element. On one-dimensional
- // composites that don't loop, pressing right or down keys also doesn't
- // focus the composite element.
- action.hasNullItem || !isGrid && canLoop && includesBaseElement;
+function createInvalidRequiredErrorMessage(propName, componentName, value) {
+ return new Error(
+ 'The prop `' + propName + '` ' + messages.requiredCore +
+ ' in `' + componentName + '`, but its value is `' + value + '`.'
+ );
+}
- if (canLoop) {
- var loopItems = canWrap && !hasNullItem ? allItems : getItemsInGroup(allItems, currentItem.groupId); // Turns [0, 1, current, 3, 4] into [3, 4, 0, 1]
+var independentGuardianValue = -1;
- var sortedItems = placeItemsAfter(loopItems, currentId, hasNullItem);
+function preValidationRequireCheck(isRequired, componentName, propFullName, propValue) {
+ var isPropValueUndefined = typeof propValue === 'undefined';
+ var isPropValueNull = propValue === null;
- var _nextItem3 = Object(getCurrentId_5aa9849e["a" /* f */])(sortedItems, currentId);
+ if (isRequired) {
+ if (isPropValueUndefined) {
+ return createInvalidRequiredErrorMessage(propFullName, componentName, 'undefined');
+ } else if (isPropValueNull) {
+ return createInvalidRequiredErrorMessage(propFullName, componentName, 'null');
+ }
+ }
- return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
- type: "move",
- id: _nextItem3 === null || _nextItem3 === void 0 ? void 0 : _nextItem3.id
- }));
- }
+ if (isPropValueUndefined || isPropValueNull) {
+ return null;
+ }
- if (canWrap) {
- var _nextItem4 = Object(getCurrentId_5aa9849e["a" /* f */])( // We can use nextItems, which contains all the next items, including
- // items from other groups, to wrap between groups. However, if there
- // is a null item (the composite element), we'll only use the next
- // items in the group. So moving next from the last item will focus
- // the composite element (null). On grid composites, horizontal
- // navigation never focuses the composite element, only vertical.
- hasNullItem ? nextItemsInGroup : _nextItems, currentId);
-
- var _nextId = hasNullItem ? (_nextItem4 === null || _nextItem4 === void 0 ? void 0 : _nextItem4.id) || null : _nextItem4 === null || _nextItem4 === void 0 ? void 0 : _nextItem4.id;
-
- return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
- type: "move",
- id: _nextId
- }));
- }
-
- var _nextItem = Object(getCurrentId_5aa9849e["a" /* f */])(nextItemsInGroup, currentId);
-
- if (!_nextItem && hasNullItem) {
- return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
- type: "move",
- id: null
- }));
- }
+ return independentGuardianValue;
+}
- return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
- type: "move",
- id: _nextItem === null || _nextItem === void 0 ? void 0 : _nextItem.id
- }));
- }
+function createMomentChecker(type, typeValidator, validator, momentType) {
- case "previous":
- {
- // If currentId is initially set to null, the composite element will be
- // focusable while navigating with arrow keys. But, if it's a grid, we
- // don't want to focus the composite element with horizontal navigation.
- var _isGrid = !!groups.length;
+ function propValidator(
+ isRequired, // Bound parameter to indicate with the propType is required
+ predicate, // Bound parameter to allow user to add dynamic validation
+ props,
+ propName,
+ componentName,
+ location,
+ propFullName
+ ) {
+ var propValue = props[ propName ];
+ var propType = typeof propValue;
- var _hasNullItem = !_isGrid && includesBaseElement;
+ componentName = componentName || messages.anonymousMessage;
+ propFullName = propFullName || propName;
- var _nextState3 = CompositeState_reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- items: reverse(items)
- }), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
- type: "next",
- hasNullItem: _hasNullItem
- }));
+ var preValidationRequireCheckValue = preValidationRequireCheck(
+ isRequired, componentName, propFullName, propValue
+ );
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState3), {}, {
- items: items
- });
- }
+ if (preValidationRequireCheckValue !== independentGuardianValue) {
+ return preValidationRequireCheckValue;
+ }
- case "down":
- {
- var shouldShift = shift && !action.allTheWay; // First, we make sure groups have the same number of items by filling it
- // with disabled fake items. Then, we reorganize the items list so
- // [1-1, 1-2, 2-1, 2-2] becomes [1-1, 2-1, 1-2, 2-2].
+ if (typeValidator && !typeValidator(propValue)) {
+ return new Error(
+ messages.invalidTypeCore + ': `' + propName + '` of type `' + propType + '` ' +
+ 'supplied to `' + componentName + '`, expected `' + type + '`.'
+ );
+ }
- var verticalItems = verticalizeItems(flatten(fillGroups(groupItems(items), currentId, shouldShift)));
+ if (!validator(propValue)) {
+ return new Error(
+ messages.baseInvalidMessage + location + ' `' + propName + '` of type `' + propType + '` ' +
+ 'supplied to `' + componentName + '`, expected `' + momentType + '`.'
+ );
+ }
- var _canLoop = loop && loop !== "horizontal"; // Pressing down arrow key will only focus the composite element if loop
- // is true or vertical.
+ if (predicate && !predicate(propValue)) {
+ var predicateName = predicate.name || messages.anonymousMessage;
+ return new Error(
+ messages.baseInvalidMessage + location + ' `' + propName + '` of type `' + propType + '` ' +
+ 'supplied to `' + componentName + '`. ' + messages.predicateFailureCore + ' `' +
+ predicateName + '`.'
+ );
+ }
+ return null;
- var _hasNullItem2 = _canLoop && includesBaseElement;
+ }
- var _nextState4 = CompositeState_reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- orientation: "vertical",
- items: verticalItems
- }), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
- type: "next",
- hasNullItem: _hasNullItem2
- }));
+ return constructPropValidatorVariations(propValidator);
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState4), {}, {
- orientation: orientation,
- items: items
- });
- }
+}
- case "up":
- {
- var _shouldShift = shift && !action.allTheWay;
+module.exports = {
+ constructPropValidatorVariations: constructPropValidatorVariations,
+ createMomentChecker: createMomentChecker,
+ messages: messages,
+};
- var _verticalItems = verticalizeItems(reverse(flatten(fillGroups(groupItems(items), currentId, _shouldShift)))); // If currentId is initially set to null, we'll always focus the
- // composite element when the up arrow key is pressed in the first row.
+/***/ }),
- var _hasNullItem3 = includesBaseElement;
+/***/ 6150:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- var _nextState5 = CompositeState_reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- orientation: "vertical",
- items: _verticalItems
- }), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
- type: "next",
- hasNullItem: _hasNullItem3
- }));
+var moment = __webpack_require__(6292);
+var momentValidationWrapper = __webpack_require__(3416);
+var core = __webpack_require__(9217);
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState5), {}, {
- orientation: orientation,
- items: items
- });
- }
+module.exports = {
- case "first":
- {
- var firstItem = Object(getCurrentId_5aa9849e["a" /* f */])(items);
- return CompositeState_reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
- type: "move",
- id: firstItem === null || firstItem === void 0 ? void 0 : firstItem.id
- }));
- }
+ momentObj : core.createMomentChecker(
+ 'object',
+ function(obj) {
+ return typeof obj === 'object';
+ },
+ function isValid(value) {
+ return momentValidationWrapper.isValidMoment(value);
+ },
+ 'Moment'
+ ),
- case "last":
- {
- var _nextState6 = CompositeState_reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- items: reverse(items)
- }), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, action), {}, {
- type: "first"
- }));
+ momentString : core.createMomentChecker(
+ 'string',
+ function(str) {
+ return typeof str === 'string';
+ },
+ function isValid(value) {
+ return momentValidationWrapper.isValidMoment(moment(value));
+ },
+ 'Moment'
+ ),
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, _nextState6), {}, {
- items: items
- });
- }
+ momentDurationObj : core.createMomentChecker(
+ 'object',
+ function(obj) {
+ return typeof obj === 'object';
+ },
+ function isValid(value) {
+ return moment.isDuration(value);
+ },
+ 'Duration'
+ ),
- case "sort":
- {
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- items: sortBasedOnDOMPosition(items),
- groups: sortBasedOnDOMPosition(groups)
- });
- }
+};
- case "setVirtual":
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- unstable_virtual: applyState(action.virtual, virtual)
- });
- case "setRTL":
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- rtl: applyState(action.rtl, rtl)
- });
+/***/ }),
- case "setOrientation":
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- orientation: applyState(action.orientation, orientation)
- });
+/***/ 3416:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- case "setCurrentId":
- {
- var nextCurrentId = Object(getCurrentId_5aa9849e["b" /* g */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- currentId: applyState(action.currentId, currentId)
- }));
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- currentId: nextCurrentId,
- hasSetCurrentId: true
- });
- }
+var moment = __webpack_require__(6292);
- case "setLoop":
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- loop: applyState(action.loop, loop)
- });
+function isValidMoment(testMoment) {
+ if (typeof moment.isMoment === 'function' && !moment.isMoment(testMoment)) {
+ return false;
+ }
- case "setWrap":
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- wrap: applyState(action.wrap, wrap)
- });
+ /* istanbul ignore else */
+ if (typeof testMoment.isValid === 'function') {
+ // moment 1.7.0+
+ return testMoment.isValid();
+ }
- case "setShift":
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- shift: applyState(action.shift, shift)
- });
+ /* istanbul ignore next */
+ return !isNaN(testMoment);
+}
- case "setIncludesBaseElement":
- {
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- unstable_includesBaseElement: applyState(action.includesBaseElement, includesBaseElement)
- });
- }
+module.exports = {
+ isValidMoment : isValidMoment,
+};
- case "reset":
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- unstable_virtual: initialVirtual,
- rtl: initialRTL,
- orientation: initialOrientation,
- currentId: Object(getCurrentId_5aa9849e["b" /* g */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- currentId: initialCurrentId
- })),
- loop: initialLoop,
- wrap: initialWrap,
- shift: initialShift,
- unstable_moves: 0,
- pastIds: []
- });
- case "setItems":
- {
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), {}, {
- items: action.items
- });
- }
+/***/ }),
- default:
- throw new Error();
- }
-}
+/***/ 2239:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
-function useAction(fn) {
- return Object(external_React_["useCallback"])(fn, []);
-}
+"use strict";
-function useIsUnmountedRef() {
- var isUnmountedRef = Object(external_React_["useRef"])(false);
- Object(useIsomorphicEffect["a" /* useIsomorphicEffect */])(function () {
- return function () {
- isUnmountedRef.current = true;
- };
- }, []);
- return isUnmountedRef;
-}
-function useCompositeState(initialState) {
- if (initialState === void 0) {
- initialState = {};
- }
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
- var _useSealedState = useSealedState(initialState),
- _useSealedState$unsta = _useSealedState.unstable_virtual,
- virtual = _useSealedState$unsta === void 0 ? false : _useSealedState$unsta,
- _useSealedState$rtl = _useSealedState.rtl,
- rtl = _useSealedState$rtl === void 0 ? false : _useSealedState$rtl,
- orientation = _useSealedState.orientation,
- currentId = _useSealedState.currentId,
- _useSealedState$loop = _useSealedState.loop,
- loop = _useSealedState$loop === void 0 ? false : _useSealedState$loop,
- _useSealedState$wrap = _useSealedState.wrap,
- wrap = _useSealedState$wrap === void 0 ? false : _useSealedState$wrap,
- _useSealedState$shift = _useSealedState.shift,
- shift = _useSealedState$shift === void 0 ? false : _useSealedState$shift,
- unstable_includesBaseElement = _useSealedState.unstable_includesBaseElement,
- sealed = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_useSealedState, ["unstable_virtual", "rtl", "orientation", "currentId", "loop", "wrap", "shift", "unstable_includesBaseElement"]);
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
- var idState = unstable_useIdState(sealed);
+var _react = __webpack_require__(9196);
- var _React$useReducer = Object(external_React_["useReducer"])(CompositeState_reducer, {
- unstable_virtual: virtual,
- rtl: rtl,
- orientation: orientation,
- items: [],
- groups: [],
- currentId: currentId,
- loop: loop,
- wrap: wrap,
- shift: shift,
- unstable_moves: 0,
- pastIds: [],
- unstable_includesBaseElement: unstable_includesBaseElement != null ? unstable_includesBaseElement : currentId === null,
- initialVirtual: virtual,
- initialRTL: rtl,
- initialOrientation: orientation,
- initialCurrentId: currentId,
- initialLoop: loop,
- initialWrap: wrap,
- initialShift: shift
- }),
- _React$useReducer$ = _React$useReducer[0],
- pastIds = _React$useReducer$.pastIds,
- initialVirtual = _React$useReducer$.initialVirtual,
- initialRTL = _React$useReducer$.initialRTL,
- initialOrientation = _React$useReducer$.initialOrientation,
- initialCurrentId = _React$useReducer$.initialCurrentId,
- initialLoop = _React$useReducer$.initialLoop,
- initialWrap = _React$useReducer$.initialWrap,
- initialShift = _React$useReducer$.initialShift,
- hasSetCurrentId = _React$useReducer$.hasSetCurrentId,
- state = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_React$useReducer$, ["pastIds", "initialVirtual", "initialRTL", "initialOrientation", "initialCurrentId", "initialLoop", "initialWrap", "initialShift", "hasSetCurrentId"]),
- dispatch = _React$useReducer[1];
+var _react2 = _interopRequireDefault(_react);
- var _React$useState = Object(external_React_["useState"])(false),
- hasActiveWidget = _React$useState[0],
- setHasActiveWidget = _React$useState[1]; // register/unregister may be called when this component is unmounted. We
- // store the unmounted state here so we don't update the state if it's true.
- // This only happens in a very specific situation.
- // See https://github.com/reakit/reakit/issues/650
+var _propTypes = __webpack_require__(2652);
+var _propTypes2 = _interopRequireDefault(_propTypes);
- var isUnmountedRef = useIsUnmountedRef();
- var setItems = Object(external_React_["useCallback"])(function (items) {
- return dispatch({
- type: "setItems",
- items: items
- });
- }, []);
- useSortBasedOnDOMPosition(state.items, setItems);
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, idState), state), {}, {
- unstable_hasActiveWidget: hasActiveWidget,
- unstable_setHasActiveWidget: setHasActiveWidget,
- registerItem: useAction(function (item) {
- if (isUnmountedRef.current) return;
- dispatch({
- type: "registerItem",
- item: item
- });
- }),
- unregisterItem: useAction(function (id) {
- if (isUnmountedRef.current) return;
- dispatch({
- type: "unregisterItem",
- id: id
- });
- }),
- registerGroup: useAction(function (group) {
- if (isUnmountedRef.current) return;
- dispatch({
- type: "registerGroup",
- group: group
- });
- }),
- unregisterGroup: useAction(function (id) {
- if (isUnmountedRef.current) return;
- dispatch({
- type: "unregisterGroup",
- id: id
- });
- }),
- move: useAction(function (id) {
- return dispatch({
- type: "move",
- id: id
- });
- }),
- next: useAction(function (allTheWay) {
- return dispatch({
- type: "next",
- allTheWay: allTheWay
- });
- }),
- previous: useAction(function (allTheWay) {
- return dispatch({
- type: "previous",
- allTheWay: allTheWay
- });
- }),
- up: useAction(function (allTheWay) {
- return dispatch({
- type: "up",
- allTheWay: allTheWay
- });
- }),
- down: useAction(function (allTheWay) {
- return dispatch({
- type: "down",
- allTheWay: allTheWay
- });
- }),
- first: useAction(function () {
- return dispatch({
- type: "first"
- });
- }),
- last: useAction(function () {
- return dispatch({
- type: "last"
- });
- }),
- sort: useAction(function () {
- return dispatch({
- type: "sort"
- });
- }),
- unstable_setVirtual: useAction(function (value) {
- return dispatch({
- type: "setVirtual",
- virtual: value
- });
- }),
- setRTL: useAction(function (value) {
- return dispatch({
- type: "setRTL",
- rtl: value
- });
- }),
- setOrientation: useAction(function (value) {
- return dispatch({
- type: "setOrientation",
- orientation: value
- });
- }),
- setCurrentId: useAction(function (value) {
- return dispatch({
- type: "setCurrentId",
- currentId: value
- });
- }),
- setLoop: useAction(function (value) {
- return dispatch({
- type: "setLoop",
- loop: value
- });
- }),
- setWrap: useAction(function (value) {
- return dispatch({
- type: "setWrap",
- wrap: value
- });
- }),
- setShift: useAction(function (value) {
- return dispatch({
- type: "setShift",
- shift: value
- });
- }),
- unstable_setIncludesBaseElement: useAction(function (value) {
- return dispatch({
- type: "setIncludesBaseElement",
- includesBaseElement: value
- });
- }),
- reset: useAction(function () {
- return dispatch({
- type: "reset"
- });
- })
- });
-}
+var _airbnbPropTypes = __webpack_require__(4882);
+var _consolidatedEvents = __webpack_require__(8495);
+var _object = __webpack_require__(5861);
-// EXTERNAL MODULE: ./node_modules/reakit-system/es/createComponent.js + 3 modules
-var createComponent = __webpack_require__("hE48");
+var _object2 = _interopRequireDefault(_object);
-// EXTERNAL MODULE: ./node_modules/reakit-system/es/createHook.js + 4 modules
-var createHook = __webpack_require__("qdes");
+var _document = __webpack_require__(6789);
-// EXTERNAL MODULE: ./node_modules/reakit-utils/es/useForkRef.js
-var useForkRef = __webpack_require__("aU41");
+var _document2 = _interopRequireDefault(_document);
-// EXTERNAL MODULE: ./node_modules/reakit-warning/es/index.js + 1 modules
-var es = __webpack_require__("KA1K");
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-// EXTERNAL MODULE: ./node_modules/reakit-utils/es/useLiveRef.js
-var useLiveRef = __webpack_require__("eNtd");
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-// EXTERNAL MODULE: ./node_modules/reakit-utils/es/isSelfTarget.js
-var isSelfTarget = __webpack_require__("k2cL");
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-// EXTERNAL MODULE: ./node_modules/reakit/es/Role/Role.js
-var Role = __webpack_require__("zGFp");
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-// EXTERNAL MODULE: ./node_modules/reakit/es/Tabbable/Tabbable.js
-var Tabbable = __webpack_require__("G3V0");
+var DISPLAY = {
+ BLOCK: 'block',
+ FLEX: 'flex',
+ INLINE: 'inline',
+ INLINE_BLOCK: 'inline-block',
+ CONTENTS: 'contents'
+};
-// EXTERNAL MODULE: ./node_modules/reakit-system/es/useCreateElement.js
-var useCreateElement = __webpack_require__("IVEb");
+var propTypes = (0, _airbnbPropTypes.forbidExtraProps)({
+ children: _propTypes2['default'].node.isRequired,
+ onOutsideClick: _propTypes2['default'].func.isRequired,
+ disabled: _propTypes2['default'].bool,
+ useCapture: _propTypes2['default'].bool,
+ display: _propTypes2['default'].oneOf((0, _object2['default'])(DISPLAY))
+});
-// EXTERNAL MODULE: ./node_modules/reakit-utils/es/_rollupPluginBabelHelpers-1f0bf8c2.js
-var es_rollupPluginBabelHelpers_1f0bf8c2 = __webpack_require__("I/A+");
+var defaultProps = {
+ disabled: false,
-// EXTERNAL MODULE: ./node_modules/reakit-utils/es/createEvent.js
-var createEvent = __webpack_require__("khzz");
+ // `useCapture` is set to true by default so that a `stopPropagation` in the
+ // children will not prevent all outside click handlers from firing - maja
+ useCapture: true,
+ display: DISPLAY.BLOCK
+};
-// CONCATENATED MODULE: ./node_modules/reakit-utils/es/fireBlurEvent.js
+var OutsideClickHandler = function (_React$Component) {
+ _inherits(OutsideClickHandler, _React$Component);
+ function OutsideClickHandler() {
+ var _ref;
+ _classCallCheck(this, OutsideClickHandler);
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
-function createFocusEvent(element, type, eventInit) {
- if (eventInit === void 0) {
- eventInit = {};
- }
+ var _this = _possibleConstructorReturn(this, (_ref = OutsideClickHandler.__proto__ || Object.getPrototypeOf(OutsideClickHandler)).call.apply(_ref, [this].concat(args)));
- if (typeof FocusEvent === "function") {
- return new FocusEvent(type, eventInit);
+ _this.onMouseDown = _this.onMouseDown.bind(_this);
+ _this.onMouseUp = _this.onMouseUp.bind(_this);
+ _this.setChildNodeRef = _this.setChildNodeRef.bind(_this);
+ return _this;
}
- return Object(createEvent["a" /* createEvent */])(element, type, eventInit);
-}
-/**
- * Creates and dispatches a blur event in a way that also works on IE 11.
- *
- * @example
- * import { fireBlurEvent } from "reakit-utils";
- *
- * fireBlurEvent(document.getElementById("id"));
- */
+ _createClass(OutsideClickHandler, [{
+ key: 'componentDidMount',
+ value: function () {
+ function componentDidMount() {
+ var _props = this.props,
+ disabled = _props.disabled,
+ useCapture = _props.useCapture;
-function fireBlurEvent(element, eventInit) {
- var event = createFocusEvent(element, "blur", eventInit);
- var defaultAllowed = element.dispatchEvent(event);
+ if (!disabled) this.addMouseDownEventListener(useCapture);
+ }
- var bubbleInit = Object(es_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(es_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, eventInit), {}, {
- bubbles: true
- });
+ return componentDidMount;
+ }()
+ }, {
+ key: 'componentDidUpdate',
+ value: function () {
+ function componentDidUpdate(_ref2) {
+ var prevDisabled = _ref2.disabled;
+ var _props2 = this.props,
+ disabled = _props2.disabled,
+ useCapture = _props2.useCapture;
- element.dispatchEvent(createFocusEvent(element, "focusout", bubbleInit));
- return defaultAllowed;
-}
+ if (prevDisabled !== disabled) {
+ if (disabled) {
+ this.removeEventListeners();
+ } else {
+ this.addMouseDownEventListener(useCapture);
+ }
+ }
+ }
+ return componentDidUpdate;
+ }()
+ }, {
+ key: 'componentWillUnmount',
+ value: function () {
+ function componentWillUnmount() {
+ this.removeEventListeners();
+ }
+ return componentWillUnmount;
+ }()
-// EXTERNAL MODULE: ./node_modules/reakit-utils/es/getWindow.js
-var getWindow = __webpack_require__("SyVe");
+ // Use mousedown/mouseup to enforce that clicks remain outside the root's
+ // descendant tree, even when dragged. This should also get triggered on
+ // touch devices.
-// CONCATENATED MODULE: ./node_modules/reakit-utils/es/fireKeyboardEvent.js
+ }, {
+ key: 'onMouseDown',
+ value: function () {
+ function onMouseDown(e) {
+ var useCapture = this.props.useCapture;
+ var isDescendantOfRoot = this.childNode && (0, _document2['default'])(this.childNode, e.target);
+ if (!isDescendantOfRoot) {
+ if (this.removeMouseUp) {
+ this.removeMouseUp();
+ this.removeMouseUp = null;
+ }
+ this.removeMouseUp = (0, _consolidatedEvents.addEventListener)(document, 'mouseup', this.onMouseUp, { capture: useCapture });
+ }
+ }
-function createKeyboardEvent(element, type, eventInit) {
- if (eventInit === void 0) {
- eventInit = {};
- }
+ return onMouseDown;
+ }()
- if (typeof KeyboardEvent === "function") {
- return new KeyboardEvent(type, eventInit);
- } // IE 11 doesn't support Event constructors
+ // Use mousedown/mouseup to enforce that clicks remain outside the root's
+ // descendant tree, even when dragged. This should also get triggered on
+ // touch devices.
+ }, {
+ key: 'onMouseUp',
+ value: function () {
+ function onMouseUp(e) {
+ var onOutsideClick = this.props.onOutsideClick;
- var event = Object(getDocument["a" /* getDocument */])(element).createEvent("KeyboardEvent");
- event.initKeyboardEvent(type, eventInit.bubbles, eventInit.cancelable, Object(getWindow["a" /* getWindow */])(element), eventInit.key, eventInit.location, eventInit.ctrlKey, eventInit.altKey, eventInit.shiftKey, eventInit.metaKey);
- return event;
-}
-/**
- * Creates and dispatches `KeyboardEvent` in a way that also works on IE 11.
- *
- * @example
- * import { fireKeyboardEvent } from "reakit-utils";
- *
- * fireKeyboardEvent(document.getElementById("id"), "keydown", {
- * key: "ArrowDown",
- * shiftKey: true,
- * });
- */
+ var isDescendantOfRoot = this.childNode && (0, _document2['default'])(this.childNode, e.target);
+ if (this.removeMouseUp) {
+ this.removeMouseUp();
+ this.removeMouseUp = null;
+ }
-function fireKeyboardEvent(element, type, eventInit) {
- return element.dispatchEvent(createKeyboardEvent(element, type, eventInit));
-}
+ if (!isDescendantOfRoot) {
+ onOutsideClick(e);
+ }
+ }
+
+ return onMouseUp;
+ }()
+ }, {
+ key: 'setChildNodeRef',
+ value: function () {
+ function setChildNodeRef(ref) {
+ this.childNode = ref;
+ }
+
+ return setChildNodeRef;
+ }()
+ }, {
+ key: 'addMouseDownEventListener',
+ value: function () {
+ function addMouseDownEventListener(useCapture) {
+ this.removeMouseDown = (0, _consolidatedEvents.addEventListener)(document, 'mousedown', this.onMouseDown, { capture: useCapture });
+ }
+ return addMouseDownEventListener;
+ }()
+ }, {
+ key: 'removeEventListeners',
+ value: function () {
+ function removeEventListeners() {
+ if (this.removeMouseDown) this.removeMouseDown();
+ if (this.removeMouseUp) this.removeMouseUp();
+ }
+ return removeEventListeners;
+ }()
+ }, {
+ key: 'render',
+ value: function () {
+ function render() {
+ var _props3 = this.props,
+ children = _props3.children,
+ display = _props3.display;
-// EXTERNAL MODULE: ./node_modules/reakit-utils/es/canUseDOM.js
-var canUseDOM = __webpack_require__("+ipW");
-// EXTERNAL MODULE: ./node_modules/reakit-utils/es/getActiveElement.js
-var getActiveElement = __webpack_require__("Nym8");
+ return _react2['default'].createElement(
+ 'div',
+ {
+ ref: this.setChildNodeRef,
+ style: display !== DISPLAY.BLOCK && (0, _object2['default'])(DISPLAY).includes(display) ? { display: display } : undefined
+ },
+ children
+ );
+ }
-// CONCATENATED MODULE: ./node_modules/reakit-utils/es/getNextActiveElementOnBlur.js
+ return render;
+ }()
+ }]);
+ return OutsideClickHandler;
+}(_react2['default'].Component);
+exports["default"] = OutsideClickHandler;
+OutsideClickHandler.propTypes = propTypes;
+OutsideClickHandler.defaultProps = defaultProps;
-var isIE11 = canUseDOM["a" /* canUseDOM */] && "msCrypto" in window;
-/**
- * Cross-browser method that returns the next active element (the element that
- * is receiving focus) after a blur event is dispatched. It receives the blur
- * event object as the argument.
- *
- * @example
- * import { getNextActiveElementOnBlur } from "reakit-utils";
- *
- * const element = document.getElementById("id");
- * element.addEventListener("blur", (event) => {
- * const nextActiveElement = getNextActiveElementOnBlur(event);
- * });
- */
+/***/ }),
-function getNextActiveElementOnBlur(event) {
- // IE 11 doesn't support event.relatedTarget on blur.
- // document.activeElement points the the next active element.
- // On modern browsers, document.activeElement points to the current target.
- if (isIE11) {
- var activeElement = Object(getActiveElement["a" /* getActiveElement */])(event.currentTarget);
- return activeElement;
- }
+/***/ 6606:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- return event.relatedTarget;
-}
+// eslint-disable-next-line import/no-unresolved
+module.exports = __webpack_require__(2239);
+/***/ }),
-// EXTERNAL MODULE: ./node_modules/reakit/es/__keys-6742f591.js
-var _keys_6742f591 = __webpack_require__("TFuP");
+/***/ 235:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-// EXTERNAL MODULE: ./node_modules/reakit/es/userFocus-e16425e3.js
-var userFocus_e16425e3 = __webpack_require__("Mih7");
+var e=__webpack_require__(9196),n={display:"block",opacity:0,position:"absolute",top:0,left:0,height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:-1},t=function(t){var r=t.onResize,u=e.useRef();return function(n,t){var r=function(){return n.current&&n.current.contentDocument&&n.current.contentDocument.defaultView};function u(){t();var e=r();e&&e.addEventListener("resize",t)}e.useEffect((function(){return r()?u():n.current&&n.current.addEventListener&&n.current.addEventListener("load",u),function(){var e=r();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("resize",t)}}),[])}(u,(function(){return r(u)})),e.createElement("iframe",{style:n,src:"about:blank",ref:u,"aria-hidden":!0,tabIndex:-1,frameBorder:0})},r=function(e){return{width:null!=e?e.offsetWidth:null,height:null!=e?e.offsetHeight:null}};module.exports=function(n){void 0===n&&(n=r);var u=e.useState(n(null)),o=u[0],i=u[1],c=e.useCallback((function(e){return i(n(e.current))}),[n]);return[e.useMemo((function(){return e.createElement(t,{onResize:c})}),[c]),o]};
-// CONCATENATED MODULE: ./node_modules/reakit/es/Composite/Composite.js
+/***/ }),
+/***/ 5080:
+/***/ (function(__unused_webpack_module, exports) {
+"use strict";
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+var CHANNEL = exports.CHANNEL = '__direction__';
+var DIRECTIONS = exports.DIRECTIONS = {
+ LTR: 'ltr',
+ RTL: 'rtl'
+};
+/***/ }),
+/***/ 6640:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
+"use strict";
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+var _propTypes = __webpack_require__(2652);
+var _propTypes2 = _interopRequireDefault(_propTypes);
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+exports["default"] = _propTypes2['default'].shape({
+ getState: _propTypes2['default'].func,
+ setState: _propTypes2['default'].func,
+ subscribe: _propTypes2['default'].func
+});
+/***/ }),
+/***/ 3688:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
+var __webpack_unused_export__;
+__webpack_unused_export__ = ({
+ value: true
+});
+var _arrayPrototype = __webpack_require__(116);
+var _arrayPrototype2 = _interopRequireDefault(_arrayPrototype);
+var _globalCache = __webpack_require__(5371);
+var _globalCache2 = _interopRequireDefault(_globalCache);
+var _constants = __webpack_require__(6930);
+var _getClassName = __webpack_require__(1689);
+var _getClassName2 = _interopRequireDefault(_getClassName);
+var _separateStyles2 = __webpack_require__(1881);
+var _separateStyles3 = _interopRequireDefault(_separateStyles2);
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
-var Composite_isIE11 = canUseDOM["a" /* canUseDOM */] && "msCrypto" in window;
+/**
+ * Function required as part of the react-with-styles interface. Parses the styles provided by
+ * react-with-styles to produce class names based on the style name and optionally the namespace if
+ * available.
+ *
+ * stylesObject {Object} The styles object passed to withStyles.
+ *
+ * Return an object mapping style names to class names.
+ */
+function create(stylesObject) {
+ var stylesToClasses = {};
+ var styleNames = Object.keys(stylesObject);
+ var sharedState = _globalCache2['default'].get(_constants.GLOBAL_CACHE_KEY) || {};
+ var _sharedState$namespac = sharedState.namespace,
+ namespace = _sharedState$namespac === undefined ? '' : _sharedState$namespac;
-function canProxyKeyboardEvent(event) {
- if (!Object(isSelfTarget["a" /* isSelfTarget */])(event)) return false;
- if (event.metaKey) return false;
- if (event.key === "Tab") return false;
- return true;
+ styleNames.forEach(function (styleName) {
+ var className = (0, _getClassName2['default'])(namespace, styleName);
+ stylesToClasses[styleName] = className;
+ });
+ return stylesToClasses;
}
-function useKeyboardEventProxy(virtual, currentItem, htmlEventHandler) {
- var eventHandlerRef = Object(useLiveRef["a" /* useLiveRef */])(htmlEventHandler);
- return Object(external_React_["useCallback"])(function (event) {
- var _eventHandlerRef$curr;
+/**
+ * Process styles to be consumed by a component.
+ *
+ * stylesArray {Array} Array of the following: values returned by create, plain JavaScript objects
+ * representing inline styles, or arrays thereof.
+ *
+ * Return an object with optional className and style properties to be spread on a component.
+ */
+function resolve(stylesArray) {
+ var flattenedStyles = (0, _arrayPrototype2['default'])(stylesArray, Infinity);
- (_eventHandlerRef$curr = eventHandlerRef.current) === null || _eventHandlerRef$curr === void 0 ? void 0 : _eventHandlerRef$curr.call(eventHandlerRef, event);
- if (event.defaultPrevented) return;
+ var _separateStyles = (0, _separateStyles3['default'])(flattenedStyles),
+ classNames = _separateStyles.classNames,
+ hasInlineStyles = _separateStyles.hasInlineStyles,
+ inlineStyles = _separateStyles.inlineStyles;
- if (virtual && canProxyKeyboardEvent(event)) {
- var currentElement = currentItem === null || currentItem === void 0 ? void 0 : currentItem.ref.current;
+ var specificClassNames = classNames.map(function (name, index) {
+ return String(name) + ' ' + String(name) + '_' + String(index + 1);
+ });
+ var className = specificClassNames.join(' ');
- if (currentElement) {
- if (!fireKeyboardEvent(currentElement, event.type, event)) {
- event.preventDefault();
- } // The event will be triggered on the composite item and then
- // propagated up to this composite element again, so we can pretend
- // that it wasn't called on this component in the first place.
+ var result = { className: className };
+ if (hasInlineStyles) result.style = inlineStyles;
+ return result;
+}
+exports["default"] = { create: create, resolve: resolve };
- if (event.currentTarget.contains(currentElement)) {
- event.stopPropagation();
- }
- }
- }
- }, [virtual, currentItem]);
-} // istanbul ignore next
+/***/ }),
+/***/ 6930:
+/***/ (function(__unused_webpack_module, exports) {
-function useActiveElementRef(elementRef) {
- var activeElementRef = Object(external_React_["useRef"])(null);
- Object(external_React_["useEffect"])(function () {
- var document = Object(getDocument["a" /* getDocument */])(elementRef.current);
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+var GLOBAL_CACHE_KEY = 'reactWithStylesInterfaceCSS';
+var MAX_SPECIFICITY = 20;
- var onFocus = function onFocus(event) {
- var target = event.target;
- activeElementRef.current = target;
- };
+exports.GLOBAL_CACHE_KEY = GLOBAL_CACHE_KEY;
+exports.MAX_SPECIFICITY = MAX_SPECIFICITY;
- document.addEventListener("focus", onFocus, true);
- return function () {
- document.removeEventListener("focus", onFocus, true);
- };
- }, []);
- return activeElementRef;
-}
+/***/ }),
-function findFirstEnabledItemInTheLastRow(items) {
- return Object(getCurrentId_5aa9849e["a" /* f */])(flatten(reverse(groupItems(items))));
-}
+/***/ 1689:
+/***/ (function(__unused_webpack_module, exports) {
-function isItem(items, element) {
- return items === null || items === void 0 ? void 0 : items.some(function (item) {
- return !!element && item.ref.current === element;
- });
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports["default"] = getClassName;
+/**
+ * Construct a class name.
+ *
+ * namespace {String} Used to construct unique class names.
+ * styleName {String} Name identifying the specific style.
+ *
+ * Return the class name.
+ */
+function getClassName(namespace, styleName) {
+ var namespaceSegment = namespace.length > 0 ? String(namespace) + '__' : '';
+ return '' + namespaceSegment + String(styleName);
}
-function useScheduleUserFocus(currentItem) {
- var currentItemRef = Object(useLiveRef["a" /* useLiveRef */])(currentItem);
+/***/ }),
- var _React$useReducer = Object(external_React_["useReducer"])(function (n) {
- return n + 1;
- }, 0),
- scheduled = _React$useReducer[0],
- schedule = _React$useReducer[1];
+/***/ 1881:
+/***/ (function(__unused_webpack_module, exports) {
- Object(external_React_["useEffect"])(function () {
- var _currentItemRef$curre;
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+// This function takes an array of styles and separates them into styles that
+// are handled by Aphrodite and inline styles.
+function separateStyles(stylesArray) {
+ var classNames = [];
- var currentElement = (_currentItemRef$curre = currentItemRef.current) === null || _currentItemRef$curre === void 0 ? void 0 : _currentItemRef$curre.ref.current;
+ // Since determining if an Object is empty requires collecting all of its
+ // keys, and we want the best performance in this code because we are in the
+ // render path, we are going to do a little bookkeeping ourselves.
+ var hasInlineStyles = false;
+ var inlineStyles = {};
- if (scheduled && currentElement) {
- Object(userFocus_e16425e3["c" /* u */])(currentElement);
+ // This is run on potentially every node in the tree when rendering, where
+ // performance is critical. Normally we would prefer using `forEach`, but
+ // old-fashioned for loops are faster so that's what we have chosen here.
+ for (var i = 0; i < stylesArray.length; i++) {
+ // eslint-disable-line no-plusplus
+ var style = stylesArray[i];
+
+ // If this style is falsy, we just want to disregard it. This allows for
+ // syntax like:
+ //
+ // css(isFoo && styles.foo)
+ if (style) {
+ if (typeof style === 'string') {
+ classNames.push(style);
+ } else {
+ Object.assign(inlineStyles, style);
+ hasInlineStyles = true;
+ }
}
- }, [scheduled]);
- return schedule;
+ }
+
+ return {
+ classNames: classNames,
+ hasInlineStyles: hasInlineStyles,
+ inlineStyles: inlineStyles
+ };
}
-var useComposite = Object(createHook["a" /* createHook */])({
- name: "Composite",
- compose: [Tabbable["a" /* useTabbable */]],
- keys: _keys_6742f591["a" /* C */],
- useOptions: function useOptions(options) {
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, options), {}, {
- currentId: Object(getCurrentId_5aa9849e["b" /* g */])(options)
- });
- },
- useProps: function useProps(options, _ref) {
- var htmlRef = _ref.ref,
- htmlOnFocusCapture = _ref.onFocusCapture,
- htmlOnFocus = _ref.onFocus,
- htmlOnBlurCapture = _ref.onBlurCapture,
- htmlOnKeyDown = _ref.onKeyDown,
- htmlOnKeyDownCapture = _ref.onKeyDownCapture,
- htmlOnKeyUpCapture = _ref.onKeyUpCapture,
- htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref, ["ref", "onFocusCapture", "onFocus", "onBlurCapture", "onKeyDown", "onKeyDownCapture", "onKeyUpCapture"]);
+exports["default"] = separateStyles;
- var ref = Object(external_React_["useRef"])(null);
- var currentItem = findEnabledItemById(options.items, options.currentId);
- var previousElementRef = Object(external_React_["useRef"])(null);
- var onFocusCaptureRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnFocusCapture);
- var onFocusRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnFocus);
- var onBlurCaptureRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnBlurCapture);
- var onKeyDownRef = Object(useLiveRef["a" /* useLiveRef */])(htmlOnKeyDown);
- var scheduleUserFocus = useScheduleUserFocus(currentItem); // IE 11 doesn't support event.relatedTarget, so we use the active element
- // ref instead.
+/***/ }),
- var activeElementRef = Composite_isIE11 ? useActiveElementRef(ref) : undefined;
- Object(external_React_["useEffect"])(function () {
- var element = ref.current;
+/***/ 5553:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
- if (options.unstable_moves && !currentItem) {
- false ? undefined : void 0; // If composite.move(null) has been called, the composite container
- // will receive focus.
+// eslint-disable-next-line import/no-unresolved
+module.exports = __webpack_require__(3688)["default"];
- element === null || element === void 0 ? void 0 : element.focus();
- }
- }, [options.unstable_moves, currentItem]);
- var onKeyDownCapture = useKeyboardEventProxy(options.unstable_virtual, currentItem, htmlOnKeyDownCapture);
- var onKeyUpCapture = useKeyboardEventProxy(options.unstable_virtual, currentItem, htmlOnKeyUpCapture);
- var onFocusCapture = Object(external_React_["useCallback"])(function (event) {
- var _onFocusCaptureRef$cu;
- (_onFocusCaptureRef$cu = onFocusCaptureRef.current) === null || _onFocusCaptureRef$cu === void 0 ? void 0 : _onFocusCaptureRef$cu.call(onFocusCaptureRef, event);
- if (event.defaultPrevented) return;
- if (!options.unstable_virtual) return; // IE11 doesn't support event.relatedTarget, so we use the active
- // element ref instead.
+/***/ }),
- var previousActiveElement = (activeElementRef === null || activeElementRef === void 0 ? void 0 : activeElementRef.current) || event.relatedTarget;
- var previousActiveElementWasItem = isItem(options.items, previousActiveElement);
+/***/ 9349:
+/***/ (function(__unused_webpack_module, exports) {
- if (Object(isSelfTarget["a" /* isSelfTarget */])(event) && previousActiveElementWasItem) {
- // Composite has been focused as a result of an item receiving focus.
- // The composite item will move focus back to the composite
- // container. In this case, we don't want to propagate this
- // additional event nor call the onFocus handler passed to
- // <Composite onFocus={...} />.
- event.stopPropagation(); // We keep track of the previous active item element so we can
- // manually fire a blur event on it later when the focus is moved to
- // another item on the onBlurCapture event below.
+"use strict";
- previousElementRef.current = previousActiveElement;
- }
- }, [options.unstable_virtual, options.items]);
- var onFocus = Object(external_React_["useCallback"])(function (event) {
- var _onFocusRef$current;
- (_onFocusRef$current = onFocusRef.current) === null || _onFocusRef$current === void 0 ? void 0 : _onFocusRef$current.call(onFocusRef, event);
- if (event.defaultPrevented) return;
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+var styleInterface = void 0;
+var styleTheme = void 0;
- if (options.unstable_virtual) {
- if (Object(isSelfTarget["a" /* isSelfTarget */])(event)) {
- // This means that the composite element has been focused while the
- // composite item has not. For example, by clicking on the
- // composite element without touching any item, or by tabbing into
- // the composite element. In this case, we want to trigger focus on
- // the item, just like it would happen with roving tabindex.
- // When it receives focus, the composite item will put focus back
- // on the composite element, in which case hasItemWithFocus will be
- // true.
- scheduleUserFocus();
- }
- } else if (Object(isSelfTarget["a" /* isSelfTarget */])(event)) {
- var _options$setCurrentId;
+var START_MARK = 'react-with-styles.resolve.start';
+var END_MARK = 'react-with-styles.resolve.end';
+var MEASURE_MARK = '\uD83D\uDC69\u200D\uD83C\uDFA8 [resolve]';
- // When the roving tabindex composite gets intentionally focused (for
- // example, by clicking directly on it, and not on an item), we make
- // sure to set the current id to null (which means the composite
- // itself is focused).
- (_options$setCurrentId = options.setCurrentId) === null || _options$setCurrentId === void 0 ? void 0 : _options$setCurrentId.call(options, null);
- }
- }, [options.unstable_virtual, options.setCurrentId]);
- var onBlurCapture = Object(external_React_["useCallback"])(function (event) {
- var _onBlurCaptureRef$cur;
+function registerTheme(theme) {
+ styleTheme = theme;
+}
- (_onBlurCaptureRef$cur = onBlurCaptureRef.current) === null || _onBlurCaptureRef$cur === void 0 ? void 0 : _onBlurCaptureRef$cur.call(onBlurCaptureRef, event);
- if (event.defaultPrevented) return;
- if (!options.unstable_virtual) return; // When virtual is set to true, we move focus from the composite
- // container (this component) to the composite item that is being
- // selected. Then we move focus back to the composite container. This
- // is so we can provide the same API as the roving tabindex method,
- // which means people can attach onFocus/onBlur handlers on the
- // CompositeItem component regardless of whether it's virtual or not.
- // This sequence of blurring and focusing items and composite may be
- // confusing, so we ignore intermediate focus and blurs by stopping its
- // propagation and not calling the passed onBlur handler (htmlOnBlur).
+function registerInterface(interfaceToRegister) {
+ styleInterface = interfaceToRegister;
+}
- var currentElement = (currentItem === null || currentItem === void 0 ? void 0 : currentItem.ref.current) || null;
- var nextActiveElement = getNextActiveElementOnBlur(event);
- var nextActiveElementIsItem = isItem(options.items, nextActiveElement);
+function create(makeFromTheme, createWithDirection) {
+ var styles = createWithDirection(makeFromTheme(styleTheme));
+ return function () {
+ return styles;
+ };
+}
- if (Object(isSelfTarget["a" /* isSelfTarget */])(event) && nextActiveElementIsItem) {
- // This is an intermediate blur event: blurring the composite
- // container to focus an item (nextActiveElement).
- if (nextActiveElement === currentElement) {
- // The next active element will be the same as the current item in
- // the state in two scenarios:
- // - Moving focus with keyboard: the state is updated before the
- // blur event is triggered, so here the current item is already
- // pointing to the next active element.
- // - Clicking on the current active item with a pointer: this
- // will trigger blur on the composite element and then the next
- // active element will be the same as the current item. Clicking on
- // an item other than the current one doesn't end up here as the
- // currentItem state will be updated only after it.
- if (previousElementRef.current && previousElementRef.current !== nextActiveElement) {
- // If there's a previous active item and it's not a click action,
- // then we fire a blur event on it so it will work just like if
- // it had DOM focus before (like when using roving tabindex).
- fireBlurEvent(previousElementRef.current, event);
- }
- } else if (currentElement) {
- // This will be true when the next active element is not the
- // current element, but there's a current item. This will only
- // happen when clicking with a pointer on a different item, when
- // there's already an item selected, in which case currentElement
- // is the item that is getting blurred, and nextActiveElement is
- // the item that is being clicked.
- fireBlurEvent(currentElement, event);
- } // We want to ignore intermediate blur events, so we stop its
- // propagation and return early so onFocus will not be called.
+function createLTR(makeFromTheme) {
+ return create(makeFromTheme, styleInterface.createLTR || styleInterface.create);
+}
+function createRTL(makeFromTheme) {
+ return create(makeFromTheme, styleInterface.createRTL || styleInterface.create);
+}
- event.stopPropagation();
- } else {
- var targetIsItem = isItem(options.items, event.target);
+function get() {
+ return styleTheme;
+}
- if (!targetIsItem && currentElement) {
- // If target is not a composite item, it may be the composite
- // element itself (isSelfTarget) or a tabbable element inside the
- // composite widget. This may be triggered by clicking outside the
- // composite widget or by tabbing out of it. In either cases we
- // want to fire a blur event on the current item.
- fireBlurEvent(currentElement, event);
- }
- }
- }, [options.unstable_virtual, options.items, currentItem]);
- var onKeyDown = Object(external_React_["useCallback"])(function (event) {
- var _onKeyDownRef$current, _options$groups;
+function resolve() {
+ if (false) {}
- (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event);
- if (event.defaultPrevented) return;
- if (options.currentId !== null) return;
- if (!Object(isSelfTarget["a" /* isSelfTarget */])(event)) return;
- var isVertical = options.orientation !== "horizontal";
- var isHorizontal = options.orientation !== "vertical";
- var isGrid = !!((_options$groups = options.groups) !== null && _options$groups !== void 0 && _options$groups.length);
+ for (var _len = arguments.length, styles = Array(_len), _key = 0; _key < _len; _key++) {
+ styles[_key] = arguments[_key];
+ }
- var up = function up() {
- if (isGrid) {
- var item = findFirstEnabledItemInTheLastRow(options.items);
+ var result = styleInterface.resolve(styles);
- if (item !== null && item !== void 0 && item.id) {
- var _options$move;
+ if (false) {}
- (_options$move = options.move) === null || _options$move === void 0 ? void 0 : _options$move.call(options, item.id);
- }
- } else {
- var _options$last;
+ return result;
+}
- (_options$last = options.last) === null || _options$last === void 0 ? void 0 : _options$last.call(options);
- }
- };
+function resolveLTR() {
+ for (var _len2 = arguments.length, styles = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
+ styles[_key2] = arguments[_key2];
+ }
- var keyMap = {
- ArrowUp: (isGrid || isVertical) && up,
- ArrowRight: (isGrid || isHorizontal) && options.first,
- ArrowDown: (isGrid || isVertical) && options.first,
- ArrowLeft: (isGrid || isHorizontal) && options.last,
- Home: options.first,
- End: options.last,
- PageUp: options.first,
- PageDown: options.last
- };
- var action = keyMap[event.key];
+ if (styleInterface.resolveLTR) {
+ return styleInterface.resolveLTR(styles);
+ }
- if (action) {
- event.preventDefault();
- action();
- }
- }, [options.currentId, options.orientation, options.groups, options.items, options.move, options.last, options.first]);
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
- ref: Object(useForkRef["a" /* useForkRef */])(ref, htmlRef),
- id: options.baseId,
- onFocus: onFocus,
- onFocusCapture: onFocusCapture,
- onBlurCapture: onBlurCapture,
- onKeyDownCapture: onKeyDownCapture,
- onKeyDown: onKeyDown,
- onKeyUpCapture: onKeyUpCapture,
- "aria-activedescendant": options.unstable_virtual ? (currentItem === null || currentItem === void 0 ? void 0 : currentItem.id) || undefined : undefined
- }, htmlProps);
- },
- useComposeProps: function useComposeProps(options, htmlProps) {
- htmlProps = Object(Role["a" /* useRole */])(options, htmlProps, true);
- var tabbableHTMLProps = Object(Tabbable["a" /* useTabbable */])(options, htmlProps, true);
+ return resolve(styles);
+}
- if (options.unstable_virtual || options.currentId === null) {
- // Composite will only be tabbable by default if the focus is managed
- // using aria-activedescendant, which requires DOM focus on the container
- // element (the composite)
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
- tabIndex: 0
- }, tabbableHTMLProps);
- }
+function resolveRTL() {
+ for (var _len3 = arguments.length, styles = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
+ styles[_key3] = arguments[_key3];
+ }
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, htmlProps), {}, {
- ref: tabbableHTMLProps.ref
- });
+ if (styleInterface.resolveRTL) {
+ return styleInterface.resolveRTL(styles);
}
-});
-var Composite = Object(createComponent["a" /* createComponent */])({
- as: "div",
- useHook: useComposite,
- useCreateElement: function useCreateElement$1(type, props, children) {
- false ? undefined : void 0;
- return Object(useCreateElement["a" /* useCreateElement */])(type, props, children);
+
+ return resolve(styles);
+}
+
+function flush() {
+ if (styleInterface.flush) {
+ styleInterface.flush();
}
-});
+}
+exports["default"] = {
+ registerTheme: registerTheme,
+ registerInterface: registerInterface,
+ create: createLTR,
+ createLTR: createLTR,
+ createRTL: createRTL,
+ get: get,
+ resolve: resolveLTR,
+ resolveLTR: resolveLTR,
+ resolveRTL: resolveRTL,
+ flush: flush
+};
+/***/ }),
-// EXTERNAL MODULE: ./node_modules/reakit/es/Id/Id.js
-var Id = __webpack_require__("ym77");
+/***/ 3576:
+/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
-// CONCATENATED MODULE: ./node_modules/reakit/es/Group/Group.js
+"use strict";
+Object.defineProperty(exports, "__esModule", ({
+ value: true
+}));
+exports.withStylesPropTypes = exports.css = undefined;
+var _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; };
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+exports.withStyles = withStyles;
-// Automatically generated
-var GROUP_KEYS = [];
+var _object = __webpack_require__(4011);
-var useGroup = Object(createHook["a" /* createHook */])({
- name: "Group",
- compose: Role["a" /* useRole */],
- keys: GROUP_KEYS,
- useProps: function useProps(_, htmlProps) {
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
- role: "group"
- }, htmlProps);
- }
-});
-var Group = Object(createComponent["a" /* createComponent */])({
- as: "div",
- useHook: useGroup
-});
+var _object2 = _interopRequireDefault(_object);
+var _react = __webpack_require__(9196);
+var _react2 = _interopRequireDefault(_react);
-// CONCATENATED MODULE: ./node_modules/reakit/es/Composite/CompositeGroup.js
+var _propTypes = __webpack_require__(2652);
+var _propTypes2 = _interopRequireDefault(_propTypes);
+var _hoistNonReactStatics = __webpack_require__(1281);
+var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
+var _constants = __webpack_require__(5080);
+var _brcast = __webpack_require__(6640);
+var _brcast2 = _interopRequireDefault(_brcast);
+var _ThemedStyleSheet = __webpack_require__(9349);
+var _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet);
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /* eslint react/forbid-foreign-prop-types: off */
-var useCompositeGroup = Object(createHook["a" /* createHook */])({
- name: "CompositeGroup",
- compose: [useGroup, Id["a" /* unstable_useId */]],
- keys: _keys_6742f591["b" /* a */],
- propsAreEqual: function propsAreEqual(prev, next) {
- if (!next.id || prev.id !== next.id) {
- return useGroup.unstable_propsAreEqual(prev, next);
+// Add some named exports to assist in upgrading and for convenience
+var css = exports.css = _ThemedStyleSheet2['default'].resolveLTR;
+var withStylesPropTypes = exports.withStylesPropTypes = {
+ styles: _propTypes2['default'].object.isRequired, // eslint-disable-line react/forbid-prop-types
+ theme: _propTypes2['default'].object.isRequired, // eslint-disable-line react/forbid-prop-types
+ css: _propTypes2['default'].func.isRequired
+};
+
+var EMPTY_STYLES = {};
+var EMPTY_STYLES_FN = function EMPTY_STYLES_FN() {
+ return EMPTY_STYLES;
+};
+
+var START_MARK = 'react-with-styles.createStyles.start';
+var END_MARK = 'react-with-styles.createStyles.end';
+
+function baseClass(pureComponent) {
+ if (pureComponent) {
+ if (!_react2['default'].PureComponent) {
+ throw new ReferenceError('withStyles() pureComponent option requires React 15.3.0 or later');
}
- var prevCurrentId = prev.currentId,
- prevMoves = prev.unstable_moves,
- prevProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(prev, ["currentId", "unstable_moves"]);
+ return _react2['default'].PureComponent;
+ }
- var nextCurrentId = next.currentId,
- nextMoves = next.unstable_moves,
- nextProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(next, ["currentId", "unstable_moves"]);
+ return _react2['default'].Component;
+}
- if (prev.items && next.items) {
- var prevCurrentItem = findEnabledItemById(prev.items, prevCurrentId);
- var nextCurrentItem = findEnabledItemById(next.items, nextCurrentId);
- var prevGroupId = prevCurrentItem === null || prevCurrentItem === void 0 ? void 0 : prevCurrentItem.groupId;
- var nextGroupId = nextCurrentItem === null || nextCurrentItem === void 0 ? void 0 : nextCurrentItem.groupId;
+var contextTypes = _defineProperty({}, _constants.CHANNEL, _brcast2['default']);
- if (next.id === nextGroupId || next.id === prevGroupId) {
- return false;
- }
+var defaultDirection = _constants.DIRECTIONS.LTR;
+
+function withStyles(styleFn) {
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref$stylesPropName = _ref.stylesPropName,
+ stylesPropName = _ref$stylesPropName === undefined ? 'styles' : _ref$stylesPropName,
+ _ref$themePropName = _ref.themePropName,
+ themePropName = _ref$themePropName === undefined ? 'theme' : _ref$themePropName,
+ _ref$cssPropName = _ref.cssPropName,
+ cssPropName = _ref$cssPropName === undefined ? 'css' : _ref$cssPropName,
+ _ref$flushBefore = _ref.flushBefore,
+ flushBefore = _ref$flushBefore === undefined ? false : _ref$flushBefore,
+ _ref$pureComponent = _ref.pureComponent,
+ pureComponent = _ref$pureComponent === undefined ? false : _ref$pureComponent;
+
+ var styleDefLTR = void 0;
+ var styleDefRTL = void 0;
+ var currentThemeLTR = void 0;
+ var currentThemeRTL = void 0;
+ var BaseClass = baseClass(pureComponent);
+
+ function getResolveMethod(direction) {
+ return direction === _constants.DIRECTIONS.LTR ? _ThemedStyleSheet2['default'].resolveLTR : _ThemedStyleSheet2['default'].resolveRTL;
+ }
+
+ function getCurrentTheme(direction) {
+ return direction === _constants.DIRECTIONS.LTR ? currentThemeLTR : currentThemeRTL;
+ }
+
+ function getStyleDef(direction, wrappedComponentName) {
+ var currentTheme = getCurrentTheme(direction);
+ var styleDef = direction === _constants.DIRECTIONS.LTR ? styleDefLTR : styleDefRTL;
+
+ var registeredTheme = _ThemedStyleSheet2['default'].get();
+
+ // Return the existing styles if they've already been defined
+ // and if the theme used to create them corresponds to the theme
+ // registered with ThemedStyleSheet
+ if (styleDef && currentTheme === registeredTheme) {
+ return styleDef;
}
- return useGroup.unstable_propsAreEqual(prevProps, nextProps);
- },
- useProps: function useProps(options, _ref) {
- var htmlRef = _ref.ref,
- htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref, ["ref"]);
+ if (false) {}
- var ref = Object(external_React_["useRef"])(null);
- var id = options.id; // We need this to be called before CompositeItems' register
+ var isRTL = direction === _constants.DIRECTIONS.RTL;
- Object(useIsomorphicEffect["a" /* useIsomorphicEffect */])(function () {
- var _options$registerGrou;
+ if (isRTL) {
+ styleDefRTL = styleFn ? _ThemedStyleSheet2['default'].createRTL(styleFn) : EMPTY_STYLES_FN;
- if (!id) return undefined;
- (_options$registerGrou = options.registerGroup) === null || _options$registerGrou === void 0 ? void 0 : _options$registerGrou.call(options, {
- id: id,
- ref: ref
- });
- return function () {
- var _options$unregisterGr;
+ currentThemeRTL = registeredTheme;
+ styleDef = styleDefRTL;
+ } else {
+ styleDefLTR = styleFn ? _ThemedStyleSheet2['default'].createLTR(styleFn) : EMPTY_STYLES_FN;
- (_options$unregisterGr = options.unregisterGroup) === null || _options$unregisterGr === void 0 ? void 0 : _options$unregisterGr.call(options, id);
- };
- }, [id, options.registerGroup, options.unregisterGroup]);
- return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({
- ref: Object(useForkRef["a" /* useForkRef */])(ref, htmlRef)
- }, htmlProps);
- }
-});
-var CompositeGroup = Object(createComponent["a" /* createComponent */])({
- as: "div",
- useHook: useCompositeGroup
-});
+ currentThemeLTR = registeredTheme;
+ styleDef = styleDefLTR;
+ }
+ if (false) { var measureName; }
+ return styleDef;
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js
+ function getState(direction, wrappedComponentName) {
+ return {
+ resolveMethod: getResolveMethod(direction),
+ styleDef: getStyleDef(direction, wrappedComponentName)
+ };
+ }
+ return function () {
+ function withStylesHOC(WrappedComponent) {
+ var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
-function alignment_matrix_control_icon_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
+ // NOTE: Use a class here so components are ref-able if need be:
+ // eslint-disable-next-line react/prefer-stateless-function
-/**
- * External dependencies
- */
+ var WithStyles = function (_BaseClass) {
+ _inherits(WithStyles, _BaseClass);
-/**
- * Internal dependencies
- */
+ function WithStyles(props, context) {
+ _classCallCheck(this, WithStyles);
+ var _this = _possibleConstructorReturn(this, (WithStyles.__proto__ || Object.getPrototypeOf(WithStyles)).call(this, props, context));
+ var direction = _this.context[_constants.CHANNEL] ? _this.context[_constants.CHANNEL].getState() : defaultDirection;
-const alignment_matrix_control_icon_styles_rootSize = () => {
- const padding = 1.5;
- const size = 24;
- return /*#__PURE__*/Object(emotion_react_browser_esm["a" /* css */])({
- gridTemplateRows: `repeat( 3, calc( ${size - padding * 2}px / 3))`,
- padding,
- maxHeight: size,
- maxWidth: size
- }, true ? "" : undefined, true ? "" : undefined);
-};
+ _this.state = getState(direction, wrappedComponentName);
+ return _this;
+ }
-const rootPointerEvents = _ref => {
- let {
- disablePointerEvents
- } = _ref;
- return /*#__PURE__*/Object(emotion_react_browser_esm["a" /* css */])({
- pointerEvents: disablePointerEvents ? 'none' : null
- }, true ? "" : undefined, true ? "" : undefined);
-};
+ _createClass(WithStyles, [{
+ key: 'componentDidMount',
+ value: function () {
+ function componentDidMount() {
+ var _this2 = this;
-const alignment_matrix_control_icon_styles_Wrapper = Object(emotion_styled_base_browser_esm["a" /* default */])("div", true ? {
- target: "elqsdmc2"
-} : undefined)( true ? {
- name: "ogl07i",
- styles: "box-sizing:border-box;padding:2px"
-} : undefined);
-const alignment_matrix_control_icon_styles_Root = Object(emotion_styled_base_browser_esm["a" /* default */])("div", true ? {
- target: "elqsdmc1"
-} : undefined)("transform-origin:top left;height:100%;width:100%;", rootBase, ";", alignment_matrix_control_icon_styles_rootSize, ";", rootPointerEvents, ";" + ( true ? "" : undefined));
+ if (this.context[_constants.CHANNEL]) {
+ // subscribe to future direction changes
+ this.channelUnsubscribe = this.context[_constants.CHANNEL].subscribe(function (direction) {
+ _this2.setState(getState(direction, wrappedComponentName));
+ });
+ }
+ }
-const alignment_matrix_control_icon_styles_pointActive = _ref2 => {
- let {
- isActive
- } = _ref2;
- const boxShadow = isActive ? `0 0 0 1px currentColor` : null;
- return /*#__PURE__*/Object(emotion_react_browser_esm["a" /* css */])("box-shadow:", boxShadow, ";color:currentColor;*:hover>&{color:currentColor;}" + ( true ? "" : undefined), true ? "" : undefined);
-};
+ return componentDidMount;
+ }()
+ }, {
+ key: 'componentWillUnmount',
+ value: function () {
+ function componentWillUnmount() {
+ if (this.channelUnsubscribe) {
+ this.channelUnsubscribe();
+ }
+ }
-const alignment_matrix_control_icon_styles_Point = Object(emotion_styled_base_browser_esm["a" /* default */])("span", true ? {
- target: "elqsdmc0"
-} : undefined)("height:2px;width:2px;", pointBase, ";", alignment_matrix_control_icon_styles_pointActive, ";" + ( true ? "" : undefined));
-const alignment_matrix_control_icon_styles_Cell = Cell;
+ return componentWillUnmount;
+ }()
+ }, {
+ key: 'render',
+ value: function () {
+ function render() {
+ var _ref2;
-// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/icon.js
+ // As some components will depend on previous styles in
+ // the component tree, we provide the option of flushing the
+ // buffered styles (i.e. to a style tag) **before** the rendering
+ // cycle begins.
+ //
+ // The interfaces provide the optional "flush" method which
+ // is run in turn by ThemedStyleSheet.flush.
+ if (flushBefore) {
+ _ThemedStyleSheet2['default'].flush();
+ }
+ var _state = this.state,
+ resolveMethod = _state.resolveMethod,
+ styleDef = _state.styleDef;
-/**
- * External dependencies
- */
+ return _react2['default'].createElement(WrappedComponent, _extends({}, this.props, (_ref2 = {}, _defineProperty(_ref2, themePropName, _ThemedStyleSheet2['default'].get()), _defineProperty(_ref2, stylesPropName, styleDef()), _defineProperty(_ref2, cssPropName, resolveMethod), _ref2)));
+ }
-/**
- * Internal dependencies
- */
+ return render;
+ }()
+ }]);
+ return WithStyles;
+ }(BaseClass);
+ WithStyles.WrappedComponent = WrappedComponent;
+ WithStyles.displayName = 'withStyles(' + String(wrappedComponentName) + ')';
+ WithStyles.contextTypes = contextTypes;
+ if (WrappedComponent.propTypes) {
+ WithStyles.propTypes = (0, _object2['default'])({}, WrappedComponent.propTypes);
+ delete WithStyles.propTypes[stylesPropName];
+ delete WithStyles.propTypes[themePropName];
+ delete WithStyles.propTypes[cssPropName];
+ }
+ if (WrappedComponent.defaultProps) {
+ WithStyles.defaultProps = (0, _object2['default'])({}, WrappedComponent.defaultProps);
+ }
-const BASE_SIZE = 24;
-function AlignmentMatrixControlIcon(_ref) {
- let {
- className,
- disablePointerEvents = true,
- size = BASE_SIZE,
- style = {},
- value = 'center',
- ...props
- } = _ref;
- const alignIndex = getAlignmentIndex(value);
- const scale = (size / BASE_SIZE).toFixed(2);
- const classes = classnames_default()('component-alignment-matrix-control-icon', className);
- const styles = { ...style,
- transform: `scale(${scale})`
- };
- return Object(external_wp_element_["createElement"])(alignment_matrix_control_icon_styles_Root, Object(esm_extends["a" /* default */])({}, props, {
- className: classes,
- disablePointerEvents: disablePointerEvents,
- role: "presentation",
- size: size,
- style: styles
- }), ALIGNMENTS.map((align, index) => {
- const isActive = alignIndex === index;
- return Object(external_wp_element_["createElement"])(alignment_matrix_control_icon_styles_Cell, {
- key: align
- }, Object(external_wp_element_["createElement"])(alignment_matrix_control_icon_styles_Point, {
- isActive: isActive
- }));
- }));
+ return (0, _hoistNonReactStatics2['default'])(WithStyles, WrappedComponent);
+ }
+
+ return withStylesHOC;
+ }();
}
-// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/index.js
+/***/ }),
+/***/ 9196:
+/***/ (function(module) {
+"use strict";
+module.exports = window["React"];
-/**
- * External dependencies
- */
+/***/ }),
+/***/ 6292:
+/***/ (function(module) {
-/**
- * WordPress dependencies
- */
+"use strict";
+module.exports = window["moment"];
+/***/ }),
+/***/ 4080:
+/***/ (function() {
+/* (ignored) */
-/**
- * Internal dependencies
- */
+/***/ }),
+/***/ 7472:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
+var GetIntrinsic = __webpack_require__(4219);
+var $Array = GetIntrinsic('%Array%');
+// eslint-disable-next-line global-require
+var toStr = !$Array.isArray && __webpack_require__(9630)('Object.prototype.toString');
-function useBaseId(id) {
- const instanceId = Object(external_wp_compose_["useInstanceId"])(AlignmentMatrixControl, 'alignment-matrix-control');
- return id || instanceId;
-}
+// https://ecma-international.org/ecma-262/6.0/#sec-isarray
-function AlignmentMatrixControl(_ref) {
- let {
- className,
- id,
- label = Object(external_wp_i18n_["__"])('Alignment Matrix Control'),
- defaultValue = 'center center',
- value,
- onChange = external_lodash_["noop"],
- width = 92,
- ...props
- } = _ref;
- const [immutableDefaultValue] = Object(external_wp_element_["useState"])(value !== null && value !== void 0 ? value : defaultValue);
- const baseId = useBaseId(id);
- const initialCurrentId = utils_getItemId(baseId, immutableDefaultValue);
- const composite = useCompositeState({
- baseId,
- currentId: initialCurrentId,
- rtl: Object(external_wp_i18n_["isRTL"])()
- });
+module.exports = $Array.isArray || function IsArray(argument) {
+ return toStr(argument) === '[object Array]';
+};
- const handleOnChange = nextValue => {
- onChange(nextValue);
- };
- Object(external_wp_element_["useEffect"])(() => {
- if (typeof value !== 'undefined') {
- composite.setCurrentId(utils_getItemId(baseId, value));
- }
- }, [value, composite.setCurrentId]);
- const classes = classnames_default()('component-alignment-matrix-control', className);
- return Object(external_wp_element_["createElement"])(Composite, Object(esm_extends["a" /* default */])({}, props, composite, {
- "aria-label": label,
- as: Root,
- className: classes,
- role: "grid",
- width: width
- }), GRID.map((cells, index) => Object(external_wp_element_["createElement"])(CompositeGroup, Object(esm_extends["a" /* default */])({}, composite, {
- as: Row,
- role: "row",
- key: index
- }), cells.map(cell => {
- const cellId = utils_getItemId(baseId, cell);
- const isActive = composite.currentId === cellId;
- return Object(external_wp_element_["createElement"])(cell_Cell, Object(esm_extends["a" /* default */])({}, composite, {
- id: cellId,
- isActive: isActive,
- key: cell,
- value: cell,
- onFocus: () => handleOnChange(cell),
- tabIndex: isActive ? 0 : -1
- }));
- }))));
-}
-AlignmentMatrixControl.Icon = AlignmentMatrixControlIcon;
+/***/ }),
-// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/animate/index.js
-var build_module_animate = __webpack_require__("L8Kx");
-
-// CONCATENATED MODULE: ./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) {
- if (typeof b !== "function" && b !== null)
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-}
-
-var __assign = function() {
- __assign = Object.assign || function __assign(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
- }
- return t;
- }
- return __assign.apply(this, arguments);
-}
-
-function __rest(s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
- t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
- t[p[i]] = s[p[i]];
- }
- return t;
-}
-
-function __decorate(decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
-}
-
-function __param(paramIndex, decorator) {
- return function (target, key) { decorator(target, key, paramIndex); }
-}
-
-function __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;
-}
-
-/** @deprecated */
-function __spread() {
- for (var ar = [], i = 0; i < arguments.length; i++)
- ar = ar.concat(__read(arguments[i]));
- return ar;
-}
-
-/** @deprecated */
-function __spreadArrays() {
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
- r[k] = a[j];
- return r;
-}
-
-function __spreadArray(to, from, pack) {
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
- if (ar || !(i in from)) {
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
- ar[i] = from[i];
- }
- }
- return to.concat(ar || Array.prototype.slice.call(from));
-}
-
-function __await(v) {
- return this instanceof __await ? (this.v = v, this) : new __await(v);
-}
-
-function __asyncGenerator(thisArg, _arguments, generator) {
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
- return i = {}, 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, state, kind, f) {
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
-}
-
-function __classPrivateFieldSet(receiver, state, value, kind, f) {
- if (kind === "m") throw new TypeError("Private method is not writable");
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
-}
-
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/definitions.js
-var createDefinition = function (propNames) { return ({
- isEnabled: function (props) { return propNames.some(function (name) { return !!props[name]; }); },
-}); };
-var featureDefinitions = {
- measureLayout: createDefinition([
- "layout",
- "layoutId",
- "drag",
- "_layoutResetTransform",
- ]),
- animation: createDefinition([
- "animate",
- "exit",
- "variants",
- "whileHover",
- "whileTap",
- "whileFocus",
- "whileDrag",
- ]),
- exit: createDefinition(["exit"]),
- drag: createDefinition(["drag", "dragControls"]),
- focus: createDefinition(["whileFocus"]),
- hover: createDefinition(["whileHover", "onHoverStart", "onHoverEnd"]),
- tap: createDefinition(["whileTap", "onTap", "onTapStart", "onTapCancel"]),
- pan: createDefinition([
- "onPan",
- "onPanStart",
- "onPanSessionStart",
- "onPanEnd",
- ]),
- layoutAnimation: createDefinition(["layout", "layoutId"]),
-};
-function loadFeatures(features) {
- for (var key in features) {
- var Component = features[key];
- if (Component !== null)
- featureDefinitions[key].Component = Component;
- }
-}
-
-
-
-// CONCATENATED MODULE: ./node_modules/hey-listen/dist/hey-listen.es.js
-var warning = function () { };
-var invariant = function () { };
-if (false) {}
+/***/ 3665:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/LazyContext.js
+var GetIntrinsic = __webpack_require__(4219);
+var $ArrayPrototype = GetIntrinsic('%Array.prototype%');
+var $RangeError = GetIntrinsic('%RangeError%');
+var $SyntaxError = GetIntrinsic('%SyntaxError%');
+var $TypeError = GetIntrinsic('%TypeError%');
-var LazyContext = Object(external_React_["createContext"])({ strict: false });
+var IsIntegralNumber = __webpack_require__(485);
+var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1;
+var $setProto = GetIntrinsic('%Object.setPrototypeOf%', true) || (
+ // eslint-disable-next-line no-proto, no-negated-condition
+ [].__proto__ !== $ArrayPrototype
+ ? null
+ : function (O, proto) {
+ O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign
+ return O;
+ }
+);
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/use-features.js
+// https://www.ecma-international.org/ecma-262/12.0/#sec-arraycreate
+module.exports = function ArrayCreate(length) {
+ if (!IsIntegralNumber(length) || length < 0) {
+ throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0');
+ }
+ if (length > MAX_ARRAY_LENGTH) {
+ throw new $RangeError('length is greater than (2**32 - 1)');
+ }
+ var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype;
+ var A = []; // steps 3, 5
+ if (proto !== $ArrayPrototype) { // step 4
+ if (!$setProto) {
+ throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]');
+ }
+ $setProto(A, proto);
+ }
+ if (length !== 0) { // bypasses the need for step 6
+ A.length = length;
+ }
+ /* step 6, the above as a shortcut for the below
+ OrdinaryDefineOwnProperty(A, 'length', {
+ '[[Configurable]]': false,
+ '[[Enumerable]]': false,
+ '[[Value]]': length,
+ '[[Writable]]': true
+ });
+ */
+ return A;
+};
+/***/ }),
+/***/ 1539:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-var featureNames = Object.keys(featureDefinitions);
-var numFeatures = featureNames.length;
-/**
- * Load features via renderless components based on the provided MotionProps.
- */
-function useFeatures(props, visualElement, preloadedFeatures) {
- var features = [];
- var lazyContext = Object(external_React_["useContext"])(LazyContext);
- if (!visualElement)
- return null;
- /**
- * If we're in development mode, check to make sure we're not rendering a motion component
- * as a child of LazyMotion, as this will break the file-size benefits of using it.
- */
- if (false) {}
- for (var i = 0; i < numFeatures; i++) {
- var name_1 = featureNames[i];
- var _a = featureDefinitions[name_1], isEnabled = _a.isEnabled, Component = _a.Component;
- /**
- * It might be possible in the future to use this moment to
- * dynamically request functionality. In initial tests this
- * was producing a lot of duplication amongst bundles.
- */
- if (isEnabled(props) && Component) {
- features.push(external_React_["createElement"](Component, __assign({ key: name_1 }, props, { visualElement: visualElement })));
- }
- }
- return features;
-}
+var GetIntrinsic = __webpack_require__(4219);
+var $species = GetIntrinsic('%Symbol.species%', true);
+var $TypeError = GetIntrinsic('%TypeError%');
+var ArrayCreate = __webpack_require__(3665);
+var Get = __webpack_require__(6448);
+var IsArray = __webpack_require__(5971);
+var IsConstructor = __webpack_require__(4065);
+var IsIntegralNumber = __webpack_require__(485);
+var Type = __webpack_require__(9747);
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionConfigContext.js
+// https://ecma-international.org/ecma-262/12.0/#sec-arrayspeciescreate
+module.exports = function ArraySpeciesCreate(originalArray, length) {
+ if (!IsIntegralNumber(length) || length < 0) {
+ throw new $TypeError('Assertion failed: length must be an integer >= 0');
+ }
-/**
- * @public
- */
-var MotionConfigContext = Object(external_React_["createContext"])({
- transformPagePoint: function (p) { return p; },
- isStatic: false,
-});
+ var isArray = IsArray(originalArray);
+ if (!isArray) {
+ return ArrayCreate(length);
+ }
+ var C = Get(originalArray, 'constructor');
+ // TODO: figure out how to make a cross-realm normal Array, a same-realm Array
+ // if (IsConstructor(C)) {
+ // if C is another realm's Array, C = undefined
+ // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ?
+ // }
+ if ($species && Type(C) === 'Object') {
+ C = Get(C, $species);
+ if (C === null) {
+ C = void 0;
+ }
+ }
+ if (typeof C === 'undefined') {
+ return ArrayCreate(length);
+ }
+ if (!IsConstructor(C)) {
+ throw new $TypeError('C must be a constructor');
+ }
+ return new C(length); // Construct(C, length);
+};
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/index.js
-var MotionContext = Object(external_React_["createContext"])({});
-function useVisualElementContext() {
- return Object(external_React_["useContext"])(MotionContext).visualElement;
-}
+/***/ }),
+/***/ 8323:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/PresenceContext.js
+var GetIntrinsic = __webpack_require__(4219);
+var callBound = __webpack_require__(9630);
-/**
- * @public
- */
-var PresenceContext = Object(external_React_["createContext"])(null);
+var $TypeError = GetIntrinsic('%TypeError%');
+var IsArray = __webpack_require__(5971);
+var $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('%Function.prototype.apply%');
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-constant.js
+// https://ecma-international.org/ecma-262/6.0/#sec-call
+module.exports = function Call(F, V) {
+ var argumentsList = arguments.length > 2 ? arguments[2] : [];
+ if (!IsArray(argumentsList)) {
+ throw new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List');
+ }
+ return $apply(F, V, argumentsList);
+};
-/**
- * Creates a constant value over the lifecycle of a component.
- *
- * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer
- * a guarantee that it won't re-run for performance reasons later on. By using `useConstant`
- * you can ensure that initialisers don't execute twice or more.
- */
-function useConstant(init) {
- var ref = Object(external_React_["useRef"])(null);
- if (ref.current === null) {
- ref.current = init();
- }
- return ref.current;
-}
+/***/ }),
+/***/ 5597:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js
+"use strict";
+var GetIntrinsic = __webpack_require__(4219);
+var $TypeError = GetIntrinsic('%TypeError%');
-/**
- * When a component is the child of `AnimatePresence`, it can use `usePresence`
- * to access information about whether it's still present in the React tree.
- *
- * ```jsx
- * import { usePresence } from "framer-motion"
- *
- * export const Component = () => {
- * const [isPresent, safeToRemove] = usePresence()
- *
- * useEffect(() => {
- * !isPresent && setTimeout(safeToRemove, 1000)
- * }, [isPresent])
- *
- * return <div />
- * }
- * ```
- *
- * If `isPresent` is `false`, it means that a component has been removed the tree, but
- * `AnimatePresence` won't really remove it until `safeToRemove` has been called.
- *
- * @public
- */
-function usePresence() {
- var context = Object(external_React_["useContext"])(PresenceContext);
- if (context === null)
- return [true, null];
- var isPresent = context.isPresent, onExitComplete = context.onExitComplete, register = context.register;
- // It's safe to call the following hooks conditionally (after an early return) because the context will always
- // either be null or non-null for the lifespan of the component.
- // Replace with useOpaqueId when released in React
- var id = useUniqueId();
- Object(external_React_["useEffect"])(function () { return register(id); }, []);
- var safeToRemove = function () { return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id); };
- return !isPresent && onExitComplete ? [false, safeToRemove] : [true];
-}
-/**
- * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present.
- * There is no `safeToRemove` function.
- *
- * ```jsx
- * import { useIsPresent } from "framer-motion"
- *
- * export const Component = () => {
- * const isPresent = useIsPresent()
- *
- * useEffect(() => {
- * !isPresent && console.log("I've been removed!")
- * }, [isPresent])
- *
- * return <div />
- * }
- * ```
- *
- * @public
- */
-function useIsPresent() {
- return use_presence_isPresent(Object(external_React_["useContext"])(PresenceContext));
-}
-function use_presence_isPresent(context) {
- return context === null ? true : context.isPresent;
-}
-var counter = 0;
-var incrementId = function () { return counter++; };
-var useUniqueId = function () { return useConstant(incrementId); };
+var DefineOwnProperty = __webpack_require__(1327);
+var FromPropertyDescriptor = __webpack_require__(8487);
+var OrdinaryGetOwnProperty = __webpack_require__(6403);
+var IsDataDescriptor = __webpack_require__(1392);
+var IsExtensible = __webpack_require__(3428);
+var IsPropertyKey = __webpack_require__(3290);
+var SameValue = __webpack_require__(9836);
+var Type = __webpack_require__(9747);
+// https://ecma-international.org/ecma-262/6.0/#sec-createdataproperty
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/LayoutGroupContext.js
+module.exports = function CreateDataProperty(O, P, V) {
+ if (Type(O) !== 'Object') {
+ throw new $TypeError('Assertion failed: Type(O) is not Object');
+ }
+ if (!IsPropertyKey(P)) {
+ throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
+ }
+ var oldDesc = OrdinaryGetOwnProperty(O, P);
+ var extensible = !oldDesc || IsExtensible(O);
+ var immutable = oldDesc && (!oldDesc['[[Writable]]'] || !oldDesc['[[Configurable]]']);
+ if (immutable || !extensible) {
+ return false;
+ }
+ return DefineOwnProperty(
+ IsDataDescriptor,
+ SameValue,
+ FromPropertyDescriptor,
+ O,
+ P,
+ {
+ '[[Configurable]]': true,
+ '[[Enumerable]]': true,
+ '[[Value]]': V,
+ '[[Writable]]': true
+ }
+ );
+};
-/**
- * @internal
- */
-var LayoutGroupContext = Object(external_React_["createContext"])(null);
+/***/ }),
+/***/ 3323:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-browser.js
-var isBrowser = typeof window !== "undefined";
+var GetIntrinsic = __webpack_require__(4219);
+var $TypeError = GetIntrinsic('%TypeError%');
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js
+var CreateDataProperty = __webpack_require__(5597);
+var IsPropertyKey = __webpack_require__(3290);
+var Type = __webpack_require__(9747);
+// // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow
+module.exports = function CreateDataPropertyOrThrow(O, P, V) {
+ if (Type(O) !== 'Object') {
+ throw new $TypeError('Assertion failed: Type(O) is not Object');
+ }
+ if (!IsPropertyKey(P)) {
+ throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
+ }
+ var success = CreateDataProperty(O, P, V);
+ if (!success) {
+ throw new $TypeError('unable to create data property');
+ }
+ return success;
+};
-var useIsomorphicLayoutEffect = isBrowser ? external_React_["useLayoutEffect"] : external_React_["useEffect"];
+/***/ }),
+/***/ 6356:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js
+"use strict";
+var GetIntrinsic = __webpack_require__(4219);
+var $TypeError = GetIntrinsic('%TypeError%');
+var isPropertyDescriptor = __webpack_require__(8682);
+var DefineOwnProperty = __webpack_require__(1327);
+var FromPropertyDescriptor = __webpack_require__(8487);
+var IsAccessorDescriptor = __webpack_require__(7857);
+var IsDataDescriptor = __webpack_require__(1392);
+var IsPropertyKey = __webpack_require__(3290);
+var SameValue = __webpack_require__(9836);
+var ToPropertyDescriptor = __webpack_require__(2402);
+var Type = __webpack_require__(9747);
+// https://ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow
+module.exports = function DefinePropertyOrThrow(O, P, desc) {
+ if (Type(O) !== 'Object') {
+ throw new $TypeError('Assertion failed: Type(O) is not Object');
+ }
+ if (!IsPropertyKey(P)) {
+ throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
+ }
+ var Desc = isPropertyDescriptor({
+ Type: Type,
+ IsDataDescriptor: IsDataDescriptor,
+ IsAccessorDescriptor: IsAccessorDescriptor
+ }, desc) ? desc : ToPropertyDescriptor(desc);
+ if (!isPropertyDescriptor({
+ Type: Type,
+ IsDataDescriptor: IsDataDescriptor,
+ IsAccessorDescriptor: IsAccessorDescriptor
+ }, Desc)) {
+ throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor');
+ }
-function useLayoutId(_a) {
- var layoutId = _a.layoutId;
- var layoutGroupId = Object(external_React_["useContext"])(LayoutGroupContext);
- return layoutGroupId && layoutId !== undefined
- ? layoutGroupId + "-" + layoutId
- : layoutId;
-}
-function useVisualElement(Component, visualState, props, createVisualElement) {
- var config = Object(external_React_["useContext"])(MotionConfigContext);
- var lazyContext = Object(external_React_["useContext"])(LazyContext);
- var parent = useVisualElementContext();
- var presenceContext = Object(external_React_["useContext"])(PresenceContext);
- var layoutId = useLayoutId(props);
- var visualElementRef = Object(external_React_["useRef"])(undefined);
- /**
- * If we haven't preloaded a renderer, check to see if we have one lazy-loaded
- */
- if (!createVisualElement)
- createVisualElement = lazyContext.renderer;
- if (!visualElementRef.current && createVisualElement) {
- visualElementRef.current = createVisualElement(Component, {
- visualState: visualState,
- parent: parent,
- props: __assign(__assign({}, props), { layoutId: layoutId }),
- presenceId: presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.id,
- blockInitialAnimation: (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false,
- });
- }
- var visualElement = visualElementRef.current;
- useIsomorphicLayoutEffect(function () {
- if (!visualElement)
- return;
- visualElement.setProps(__assign(__assign(__assign({}, config), props), { layoutId: layoutId }));
- visualElement.isPresent = use_presence_isPresent(presenceContext);
- visualElement.isPresenceRoot =
- !parent || parent.presenceId !== (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.id);
- /**
- * Fire a render to ensure the latest state is reflected on-screen.
- */
- visualElement.syncRender();
- });
- Object(external_React_["useEffect"])(function () {
- var _a;
- if (!visualElement)
- return;
- /**
- * In a future refactor we can replace the features-as-components and
- * have this loop through them all firing "effect" listeners
- */
- (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.animateChanges();
- });
- useIsomorphicLayoutEffect(function () { return function () { return visualElement === null || visualElement === void 0 ? void 0 : visualElement.notifyUnmount(); }; }, []);
- return visualElement;
-}
+ return DefineOwnProperty(
+ IsDataDescriptor,
+ SameValue,
+ FromPropertyDescriptor,
+ O,
+ P,
+ Desc
+ );
+};
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-ref-object.js
-function isRefObject(ref) {
- return (typeof ref === "object" &&
- Object.prototype.hasOwnProperty.call(ref, "current"));
-}
+/***/ 6739:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js
+var GetIntrinsic = __webpack_require__(4219);
+var $TypeError = GetIntrinsic('%TypeError%');
+var MAX_SAFE_INTEGER = __webpack_require__(8540);
-/**
- * Creates a ref function that, when called, hydrates the provided
- * external ref and VisualElement.
- */
-function useMotionRef(visualState, visualElement, externalRef) {
- return Object(external_React_["useCallback"])(function (instance) {
- var _a;
- instance && ((_a = visualState.mount) === null || _a === void 0 ? void 0 : _a.call(visualState, instance));
- if (visualElement) {
- instance
- ? visualElement.mount(instance)
- : visualElement.unmount();
- }
- if (externalRef) {
- if (typeof externalRef === "function") {
- externalRef(instance);
- }
- else if (isRefObject(externalRef)) {
- externalRef.current = instance;
- }
- }
- },
- /**
- * Only pass a new ref callback to React if we've received a visual element
- * factory. Otherwise we'll be mounting/remounting every time externalRef
- * or other dependencies change.
- */
- [visualElement]);
-}
+var Call = __webpack_require__(8323);
+var CreateDataPropertyOrThrow = __webpack_require__(3323);
+var Get = __webpack_require__(6448);
+var HasProperty = __webpack_require__(3059);
+var IsArray = __webpack_require__(5971);
+var LengthOfArrayLike = __webpack_require__(2151);
+var ToString = __webpack_require__(6888);
+// https://262.ecma-international.org/11.0/#sec-flattenintoarray
+// eslint-disable-next-line max-params
+module.exports = function FlattenIntoArray(target, source, sourceLen, start, depth) {
+ var mapperFunction;
+ if (arguments.length > 5) {
+ mapperFunction = arguments[5];
+ }
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/variants.js
-/**
- * Decides if the supplied variable is an array of variant labels
- */
-function isVariantLabels(v) {
- return Array.isArray(v);
-}
-/**
- * Decides if the supplied variable is variant label
- */
-function isVariantLabel(v) {
- return typeof v === "string" || isVariantLabels(v);
-}
-/**
- * Creates an object containing the latest state of every MotionValue on a VisualElement
- */
-function getCurrent(visualElement) {
- var current = {};
- visualElement.forEachValue(function (value, key) { return (current[key] = value.get()); });
- return current;
-}
-/**
- * Creates an object containing the latest velocity of every MotionValue on a VisualElement
- */
-function getVelocity(visualElement) {
- var velocity = {};
- visualElement.forEachValue(function (value, key) { return (velocity[key] = value.getVelocity()); });
- return velocity;
-}
-function resolveVariantFromProps(props, definition, custom, currentValues, currentVelocity) {
- var _a;
- if (currentValues === void 0) { currentValues = {}; }
- if (currentVelocity === void 0) { currentVelocity = {}; }
- if (typeof definition === "string") {
- definition = (_a = props.variants) === null || _a === void 0 ? void 0 : _a[definition];
- }
- return typeof definition === "function"
- ? definition(custom !== null && custom !== void 0 ? custom : props.custom, currentValues, currentVelocity)
- : definition;
-}
-function resolveVariant(visualElement, definition, custom) {
- var props = visualElement.getProps();
- return resolveVariantFromProps(props, definition, custom !== null && custom !== void 0 ? custom : props.custom, getCurrent(visualElement), getVelocity(visualElement));
-}
-function checkIfControllingVariants(props) {
- var _a;
- return (typeof ((_a = props.animate) === null || _a === void 0 ? void 0 : _a.start) === "function" ||
- isVariantLabel(props.initial) ||
- isVariantLabel(props.animate) ||
- isVariantLabel(props.whileHover) ||
- isVariantLabel(props.whileDrag) ||
- isVariantLabel(props.whileTap) ||
- isVariantLabel(props.whileFocus) ||
- isVariantLabel(props.exit));
-}
-function checkIfVariantNode(props) {
- return Boolean(checkIfControllingVariants(props) || props.variants);
-}
+ var targetIndex = start;
+ var sourceIndex = 0;
+ while (sourceIndex < sourceLen) {
+ var P = ToString(sourceIndex);
+ var exists = HasProperty(source, P);
+ if (exists === true) {
+ var element = Get(source, P);
+ if (typeof mapperFunction !== 'undefined') {
+ if (arguments.length <= 6) {
+ throw new $TypeError('Assertion failed: thisArg is required when mapperFunction is provided');
+ }
+ element = Call(mapperFunction, arguments[6], [element, sourceIndex, source]);
+ }
+ var shouldFlatten = false;
+ if (depth > 0) {
+ shouldFlatten = IsArray(element);
+ }
+ if (shouldFlatten) {
+ var elementLen = LengthOfArrayLike(element);
+ targetIndex = FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1);
+ } else {
+ if (targetIndex >= MAX_SAFE_INTEGER) {
+ throw new $TypeError('index too large');
+ }
+ CreateDataPropertyOrThrow(target, ToString(targetIndex), element);
+ targetIndex += 1;
+ }
+ }
+ sourceIndex += 1;
+ }
+ return targetIndex;
+};
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/utils.js
+/***/ }),
+/***/ 8487:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-function getCurrentTreeVariants(props, context) {
- if (checkIfControllingVariants(props)) {
- var initial = props.initial, animate = props.animate;
- return {
- initial: initial === false || isVariantLabel(initial)
- ? initial
- : undefined,
- animate: isVariantLabel(animate) ? animate : undefined,
- };
- }
- return props.inherit !== false ? context : {};
-}
+"use strict";
+var assertRecord = __webpack_require__(5114);
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/MotionContext/create.js
+var Type = __webpack_require__(9747);
+// https://ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor
+module.exports = function FromPropertyDescriptor(Desc) {
+ if (typeof Desc === 'undefined') {
+ return Desc;
+ }
+ assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
+
+ var obj = {};
+ if ('[[Value]]' in Desc) {
+ obj.value = Desc['[[Value]]'];
+ }
+ if ('[[Writable]]' in Desc) {
+ obj.writable = Desc['[[Writable]]'];
+ }
+ if ('[[Get]]' in Desc) {
+ obj.get = Desc['[[Get]]'];
+ }
+ if ('[[Set]]' in Desc) {
+ obj.set = Desc['[[Set]]'];
+ }
+ if ('[[Enumerable]]' in Desc) {
+ obj.enumerable = Desc['[[Enumerable]]'];
+ }
+ if ('[[Configurable]]' in Desc) {
+ obj.configurable = Desc['[[Configurable]]'];
+ }
+ return obj;
+};
-function useCreateMotionContext(props, isStatic) {
- var _a = getCurrentTreeVariants(props, Object(external_React_["useContext"])(MotionContext)), initial = _a.initial, animate = _a.animate;
- return Object(external_React_["useMemo"])(function () { return ({ initial: initial, animate: animate }); },
- /**
- * Only break memoisation in static mode
- */
- isStatic
- ? [
- variantLabelsAsDependency(initial),
- variantLabelsAsDependency(animate),
- ]
- : []);
-}
-function variantLabelsAsDependency(prop) {
- return Array.isArray(prop) ? prop.join(" ") : prop;
-}
+/***/ }),
+
+/***/ 6448:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/index.js
+var GetIntrinsic = __webpack_require__(4219);
+var $TypeError = GetIntrinsic('%TypeError%');
+var inspect = __webpack_require__(3205);
+var IsPropertyKey = __webpack_require__(3290);
+var Type = __webpack_require__(9747);
+/**
+ * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p
+ * 1. Assert: Type(O) is Object.
+ * 2. Assert: IsPropertyKey(P) is true.
+ * 3. Return O.[[Get]](P, O).
+ */
+module.exports = function Get(O, P) {
+ // 7.3.1.1
+ if (Type(O) !== 'Object') {
+ throw new $TypeError('Assertion failed: Type(O) is not Object');
+ }
+ // 7.3.1.2
+ if (!IsPropertyKey(P)) {
+ throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));
+ }
+ // 7.3.1.3
+ return O[P];
+};
+/***/ }),
+/***/ 3059:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-/**
- * Create a `motion` component.
- *
- * This function accepts a Component argument, which can be either a string (ie "div"
- * for `motion.div`), or an actual React component.
- *
- * Alongside this is a config option which provides a way of rendering the provided
- * component "offline", or outside the React render cycle.
- *
- * @internal
- */
-function createMotionComponent(_a) {
- var preloadedFeatures = _a.preloadedFeatures, createVisualElement = _a.createVisualElement, useRender = _a.useRender, useVisualState = _a.useVisualState, Component = _a.Component;
- preloadedFeatures && loadFeatures(preloadedFeatures);
- function MotionComponent(props, externalRef) {
- /**
- * If we're rendering in a static environment, we only visually update the component
- * as a result of a React-rerender rather than interactions or animations. This
- * means we don't need to load additional memory structures like VisualElement,
- * or any gesture/animation features.
- */
- var isStatic = Object(external_React_["useContext"])(MotionConfigContext).isStatic;
- var features = null;
- /**
- * Create the tree context. This is memoized and will only trigger renders
- * when the current tree variant changes in static mode.
- */
- var context = useCreateMotionContext(props, isStatic);
- /**
- *
- */
- var visualState = useVisualState(props, isStatic);
- if (!isStatic && isBrowser) {
- /**
- * Create a VisualElement for this component. A VisualElement provides a common
- * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as
- * providing a way of rendering to these APIs outside of the React render loop
- * for more performant animations and interactions
- */
- context.visualElement = useVisualElement(Component, visualState, props, createVisualElement);
- /**
- * Load Motion gesture and animation features. These are rendered as renderless
- * components so each feature can optionally make use of React lifecycle methods.
- *
- * TODO: The intention is to move these away from a React-centric to a
- * VisualElement-centric lifecycle scheme.
- */
- features = useFeatures(props, context.visualElement, preloadedFeatures);
- }
- /**
- * The mount order and hierarchy is specific to ensure our element ref
- * is hydrated by the time features fire their effects.
- */
- return (external_React_["createElement"](external_React_["Fragment"], null,
- external_React_["createElement"](MotionContext.Provider, { value: context }, useRender(Component, props, useMotionRef(visualState, context.visualElement, externalRef), visualState, isStatic)),
- features));
- }
- return Object(external_React_["forwardRef"])(MotionComponent);
-}
+var GetIntrinsic = __webpack_require__(4219);
+var $TypeError = GetIntrinsic('%TypeError%');
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/motion-proxy.js
+var IsPropertyKey = __webpack_require__(3290);
+var Type = __webpack_require__(9747);
+// https://ecma-international.org/ecma-262/6.0/#sec-hasproperty
-/**
- * Convert any React component into a `motion` component. The provided component
- * **must** use `React.forwardRef` to the underlying DOM component you want to animate.
- *
- * ```jsx
- * const Component = React.forwardRef((props, ref) => {
- * return <div ref={ref} />
- * })
- *
- * const MotionComponent = motion(Component)
- * ```
- *
- * @public
- */
-function createMotionProxy(createConfig) {
- function custom(Component, customMotionComponentConfig) {
- if (customMotionComponentConfig === void 0) { customMotionComponentConfig = {}; }
- return createMotionComponent(createConfig(Component, customMotionComponentConfig));
- }
- /**
- * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.
- * Rather than generating them anew every render.
- */
- var componentCache = new Map();
- return new Proxy(custom, {
- /**
- * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
- * The prop name is passed through as `key` and we can use that to generate a `motion`
- * DOM component with that name.
- */
- get: function (_target, key) {
- /**
- * If this element doesn't exist in the component cache, create it and cache.
- */
- if (!componentCache.has(key)) {
- componentCache.set(key, custom(key));
- }
- return componentCache.get(key);
- },
- });
-}
+module.exports = function HasProperty(O, P) {
+ if (Type(O) !== 'Object') {
+ throw new $TypeError('Assertion failed: `O` must be an Object');
+ }
+ if (!IsPropertyKey(P)) {
+ throw new $TypeError('Assertion failed: `P` must be a Property Key');
+ }
+ return P in O;
+};
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js
-/**
- * We keep these listed seperately as we use the lowercase tag names as part
- * of the runtime bundle to detect SVG components
- */
-var lowercaseSVGElements = [
- "animate",
- "circle",
- "defs",
- "desc",
- "ellipse",
- "g",
- "image",
- "line",
- "filter",
- "marker",
- "mask",
- "metadata",
- "path",
- "pattern",
- "polygon",
- "polyline",
- "rect",
- "stop",
- "svg",
- "switch",
- "symbol",
- "text",
- "tspan",
- "use",
- "view",
-];
+/***/ 7857:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js
+var has = __webpack_require__(9284);
+var assertRecord = __webpack_require__(5114);
-function isSVGComponent(Component) {
- if (
- /**
- * If it's not a string, it's a custom React component. Currently we only support
- * HTML custom React components.
- */
- typeof Component !== "string" ||
- /**
- * If it contains a dash, the element is a custom HTML webcomponent.
- */
- Component.includes("-")) {
- return false;
- }
- else if (
- /**
- * If it's in our list of lowercase SVG tags, it's an SVG component
- */
- lowercaseSVGElements.indexOf(Component) > -1 ||
- /**
- * If it contains a capital letter, it's an SVG component
- */
- /[A-Z]/.test(Component)) {
- return true;
- }
- return false;
-}
+var Type = __webpack_require__(9747);
+// https://ecma-international.org/ecma-262/6.0/#sec-isaccessordescriptor
+module.exports = function IsAccessorDescriptor(Desc) {
+ if (typeof Desc === 'undefined') {
+ return false;
+ }
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/scale-correction.js
-var valueScaleCorrection = {};
-/**
- * @internal
- */
-function addScaleCorrection(correctors) {
- for (var key in correctors) {
- valueScaleCorrection[key] = correctors[key];
- }
-}
+ assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
+ if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {
+ return false;
+ }
+ return true;
+};
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/transform.js
-/**
- * A list of all transformable axes. We'll use this list to generated a version
- * of each axes for each transform.
- */
-var transformAxes = ["", "X", "Y", "Z"];
-/**
- * An ordered array of each transformable value. By default, transform values
- * will be sorted to this order.
- */
-var transform_order = ["translate", "scale", "rotate", "skew"];
-/**
- * Generate a list of every possible transform key.
- */
-var transformProps = ["transformPerspective", "x", "y", "z"];
-transform_order.forEach(function (operationKey) {
- return transformAxes.forEach(function (axesKey) {
- return transformProps.push(operationKey + axesKey);
- });
-});
-/**
- * A function to use with Array.sort to sort transform keys by their default order.
- */
-function sortTransformProps(a, b) {
- return transformProps.indexOf(a) - transformProps.indexOf(b);
-}
-/**
- * A quick lookup for transform props.
- */
-var transformPropSet = new Set(transformProps);
-function isTransformProp(key) {
- return transformPropSet.has(key);
-}
-/**
- * A quick lookup for transform origin props
- */
-var transformOriginProps = new Set(["originX", "originY", "originZ"]);
-function isTransformOriginProp(key) {
- return transformOriginProps.has(key);
-}
+/***/ }),
+/***/ 5971:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.js
+"use strict";
+var GetIntrinsic = __webpack_require__(4219);
-function isForcedMotionValue(key, _a) {
- var layout = _a.layout, layoutId = _a.layoutId;
- return (isTransformProp(key) ||
- isTransformOriginProp(key) ||
- ((layout || layoutId !== undefined) &&
- (!!valueScaleCorrection[key] || key === "opacity")));
-}
+var $Array = GetIntrinsic('%Array%');
+// eslint-disable-next-line global-require
+var toStr = !$Array.isArray && __webpack_require__(9630)('Object.prototype.toString');
+// https://ecma-international.org/ecma-262/6.0/#sec-isarray
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/utils/is-motion-value.js
-var isMotionValue = function (value) {
- return value !== null && typeof value === "object" && value.getVelocity;
+module.exports = $Array.isArray || function IsArray(argument) {
+ return toStr(argument) === '[object Array]';
};
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/build-transform.js
+/***/ 1089:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-var translateAlias = {
- x: "translateX",
- y: "translateY",
- z: "translateZ",
- transformPerspective: "perspective",
-};
-/**
- * Build a CSS transform style from individual x/y/scale etc properties.
- *
- * This outputs with a default order of transforms/scales/rotations, this can be customised by
- * providing a transformTemplate function.
- */
-function buildTransform(_a, _b, transformIsDefault, transformTemplate) {
- var transform = _a.transform, transformKeys = _a.transformKeys;
- var _c = _b.enableHardwareAcceleration, enableHardwareAcceleration = _c === void 0 ? true : _c, _d = _b.allowTransformNone, allowTransformNone = _d === void 0 ? true : _d;
- // The transform string we're going to build into.
- var transformString = "";
- // Transform keys into their default order - this will determine the output order.
- transformKeys.sort(sortTransformProps);
- // Track whether the defined transform has a defined z so we don't add a
- // second to enable hardware acceleration
- var transformHasZ = false;
- // Loop over each transform and build them into transformString
- var numTransformKeys = transformKeys.length;
- for (var i = 0; i < numTransformKeys; i++) {
- var key = transformKeys[i];
- transformString += (translateAlias[key] || key) + "(" + transform[key] + ") ";
- if (key === "z")
- transformHasZ = true;
- }
- if (!transformHasZ && enableHardwareAcceleration) {
- transformString += "translateZ(0)";
- }
- else {
- transformString = transformString.trim();
- }
- // If we have a custom `transform` template, pass our transform values and
- // generated transformString to that before returning
- if (transformTemplate) {
- transformString = transformTemplate(transform, transformIsDefault ? "" : transformString);
- }
- else if (allowTransformNone && transformIsDefault) {
- transformString = "none";
- }
- return transformString;
-}
-/**
- * Build a transformOrigin style. Uses the same defaults as the browser for
- * undefined origins.
- */
-function buildTransformOrigin(_a) {
- var _b = _a.originX, originX = _b === void 0 ? "50%" : _b, _c = _a.originY, originY = _c === void 0 ? "50%" : _c, _d = _a.originZ, originZ = _d === void 0 ? 0 : _d;
- return originX + " " + originY + " " + originZ;
-}
+// http://262.ecma-international.org/5.1/#sec-9.11
+module.exports = __webpack_require__(4363);
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.js
-/**
- * Returns true if the provided key is a CSS variable
- */
-function isCSSVariable(key) {
- return key.startsWith("--");
-}
+/***/ }),
+/***/ 4065:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.js
-/**
- * Provided a value and a ValueType, returns the value as that value type.
- */
-var getValueAsType = function (value, type) {
- return type && typeof value === "number"
- ? type.transform(value)
- : value;
-};
+"use strict";
+var GetIntrinsic = __webpack_require__(137);
-// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/utils.js
-var clamp = function (min, max) { return function (v) {
- return Math.max(Math.min(v, max), min);
-}; };
-var utils_sanitize = function (v) { return (v % 1 ? Number(v.toFixed(5)) : v); };
-var floatRegex = /(-)?([\d]*\.?[\d])+/g;
-var colorRegex = /(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi;
-var singleColorRegex = /^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;
-function isString(v) {
- return typeof v === 'string';
-}
+var $construct = GetIntrinsic('%Reflect.construct%', true);
+var DefinePropertyOrThrow = __webpack_require__(6356);
+try {
+ DefinePropertyOrThrow({}, '', { '[[Get]]': function () {} });
+} catch (e) {
+ // Accessor properties aren't supported
+ DefinePropertyOrThrow = null;
+}
+// https://ecma-international.org/ecma-262/6.0/#sec-isconstructor
-// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/numbers/units.js
+if (DefinePropertyOrThrow && $construct) {
+ var isConstructorMarker = {};
+ var badArrayLike = {};
+ DefinePropertyOrThrow(badArrayLike, 'length', {
+ '[[Get]]': function () {
+ throw isConstructorMarker;
+ },
+ '[[Enumerable]]': true
+ });
+ module.exports = function IsConstructor(argument) {
+ try {
+ // `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`:
+ $construct(argument, badArrayLike);
+ } catch (err) {
+ return err === isConstructorMarker;
+ }
+ };
+} else {
+ module.exports = function IsConstructor(argument) {
+ // unfortunately there's no way to truly check this without try/catch `new argument` in old environments
+ return typeof argument === 'function' && !!argument.prototype;
+ };
+}
-var createUnitType = function (unit) { return ({
- test: function (v) {
- return isString(v) && v.endsWith(unit) && v.split(' ').length === 1;
- },
- parse: parseFloat,
- transform: function (v) { return "" + v + unit; },
-}); };
-var degrees = createUnitType('deg');
-var percent = createUnitType('%');
-var px = createUnitType('px');
-var vh = createUnitType('vh');
-var vw = createUnitType('vw');
-var progressPercentage = __assign(__assign({}, percent), { parse: function (v) { return percent.parse(v) / 100; }, transform: function (v) { return percent.transform(v * 100); } });
+/***/ }),
+/***/ 1392:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/numbers/index.js
+var has = __webpack_require__(9284);
+var assertRecord = __webpack_require__(5114);
-var numbers_number = {
- test: function (v) { return typeof v === 'number'; },
- parse: parseFloat,
- transform: function (v) { return v; },
-};
-var numbers_alpha = __assign(__assign({}, numbers_number), { transform: clamp(0, 1) });
-var numbers_scale = __assign(__assign({}, numbers_number), { default: 1 });
+var Type = __webpack_require__(9747);
+// https://ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor
+module.exports = function IsDataDescriptor(Desc) {
+ if (typeof Desc === 'undefined') {
+ return false;
+ }
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/type-int.js
+ assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
+ if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {
+ return false;
+ }
+ return true;
+};
-var type_int_int = __assign(__assign({}, numbers_number), { transform: Math.round });
+/***/ }),
+/***/ 3428:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/number.js
+"use strict";
+var GetIntrinsic = __webpack_require__(4219);
-var numberValueTypes = {
- // Border props
- borderWidth: px,
- borderTopWidth: px,
- borderRightWidth: px,
- borderBottomWidth: px,
- borderLeftWidth: px,
- borderRadius: px,
- radius: px,
- borderTopLeftRadius: px,
- borderTopRightRadius: px,
- borderBottomRightRadius: px,
- borderBottomLeftRadius: px,
- // Positioning props
- width: px,
- maxWidth: px,
- height: px,
- maxHeight: px,
- size: px,
- top: px,
- right: px,
- bottom: px,
- left: px,
- // Spacing props
- padding: px,
- paddingTop: px,
- paddingRight: px,
- paddingBottom: px,
- paddingLeft: px,
- margin: px,
- marginTop: px,
- marginRight: px,
- marginBottom: px,
- marginLeft: px,
- // Transform props
- rotate: degrees,
- rotateX: degrees,
- rotateY: degrees,
- rotateZ: degrees,
- scale: numbers_scale,
- scaleX: numbers_scale,
- scaleY: numbers_scale,
- scaleZ: numbers_scale,
- skew: degrees,
- skewX: degrees,
- skewY: degrees,
- distance: px,
- translateX: px,
- translateY: px,
- translateZ: px,
- x: px,
- y: px,
- z: px,
- perspective: px,
- transformPerspective: px,
- opacity: numbers_alpha,
- originX: progressPercentage,
- originY: progressPercentage,
- originZ: px,
- // Misc
- zIndex: type_int_int,
- // SVG
- fillOpacity: numbers_alpha,
- strokeOpacity: numbers_alpha,
- numOctaves: type_int_int,
-};
+var $Object = GetIntrinsic('%Object%');
+var isPrimitive = __webpack_require__(5019);
+var $preventExtensions = $Object.preventExtensions;
+var $isExtensible = $Object.isExtensible;
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/build-styles.js
+// https://ecma-international.org/ecma-262/6.0/#sec-isextensible-o
+module.exports = $preventExtensions
+ ? function IsExtensible(obj) {
+ return !isPrimitive(obj) && $isExtensible(obj);
+ }
+ : function IsExtensible(obj) {
+ return !isPrimitive(obj);
+ };
+/***/ }),
+/***/ 485:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-function buildHTMLStyles(state, latestValues, projection, layoutState, options, transformTemplate, buildProjectionTransform, buildProjectionTransformOrigin) {
- var _a;
- var style = state.style, vars = state.vars, transform = state.transform, transformKeys = state.transformKeys, transformOrigin = state.transformOrigin;
- // Empty the transformKeys array. As we're throwing out refs to its items
- // this might not be as cheap as suspected. Maybe using the array as a buffer
- // with a manual incrementation would be better.
- transformKeys.length = 0;
- // Track whether we encounter any transform or transformOrigin values.
- var hasTransform = false;
- var hasTransformOrigin = false;
- // Does the calculated transform essentially equal "none"?
- var transformIsNone = true;
- /**
- * Loop over all our latest animated values and decide whether to handle them
- * as a style or CSS variable.
- *
- * Transforms and transform origins are kept seperately for further processing.
- */
- for (var key in latestValues) {
- var value = latestValues[key];
- /**
- * If this is a CSS variable we don't do any further processing.
- */
- if (isCSSVariable(key)) {
- vars[key] = value;
- continue;
- }
- // Convert the value to its default value type, ie 0 -> "0px"
- var valueType = numberValueTypes[key];
- var valueAsType = getValueAsType(value, valueType);
- if (isTransformProp(key)) {
- // If this is a transform, flag to enable further transform processing
- hasTransform = true;
- transform[key] = valueAsType;
- transformKeys.push(key);
- // If we already know we have a non-default transform, early return
- if (!transformIsNone)
- continue;
- // Otherwise check to see if this is a default transform
- if (value !== ((_a = valueType.default) !== null && _a !== void 0 ? _a : 0))
- transformIsNone = false;
- }
- else if (isTransformOriginProp(key)) {
- transformOrigin[key] = valueAsType;
- // If this is a transform origin, flag and enable further transform-origin processing
- hasTransformOrigin = true;
- }
- else {
- /**
- * If layout projection is on, and we need to perform scale correction for this
- * value type, perform it.
- */
- if ((projection === null || projection === void 0 ? void 0 : projection.isHydrated) &&
- (layoutState === null || layoutState === void 0 ? void 0 : layoutState.isHydrated) &&
- valueScaleCorrection[key]) {
- var correctedValue = valueScaleCorrection[key].process(value, layoutState, projection);
- /**
- * Scale-correctable values can define a number of other values to break
- * down into. For instance borderRadius needs applying to borderBottomLeftRadius etc
- */
- var applyTo = valueScaleCorrection[key].applyTo;
- if (applyTo) {
- var num = applyTo.length;
- for (var i = 0; i < num; i++) {
- style[applyTo[i]] = correctedValue;
- }
- }
- else {
- style[key] = correctedValue;
- }
- }
- else {
- style[key] = valueAsType;
- }
- }
- }
- if (layoutState &&
- projection &&
- buildProjectionTransform &&
- buildProjectionTransformOrigin) {
- style.transform = buildProjectionTransform(layoutState.deltaFinal, layoutState.treeScale, hasTransform ? transform : undefined);
- if (transformTemplate) {
- style.transform = transformTemplate(transform, style.transform);
- }
- style.transformOrigin = buildProjectionTransformOrigin(layoutState);
- }
- else {
- if (hasTransform) {
- style.transform = buildTransform(state, options, transformIsNone, transformTemplate);
- }
- if (hasTransformOrigin) {
- style.transformOrigin = buildTransformOrigin(transformOrigin);
- }
- }
-}
+var abs = __webpack_require__(13);
+var floor = __webpack_require__(5127);
+var Type = __webpack_require__(9747);
+var $isNaN = __webpack_require__(3234);
+var $isFinite = __webpack_require__(7061);
+// https://tc39.es/ecma262/#sec-isintegralnumber
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js
-var createHtmlRenderState = function () { return ({
- style: {},
- transform: {},
- transformKeys: [],
- transformOrigin: {},
- vars: {},
-}); };
+module.exports = function IsIntegralNumber(argument) {
+ if (Type(argument) !== 'Number' || $isNaN(argument) || !$isFinite(argument)) {
+ return false;
+ }
+ var absValue = abs(argument);
+ return floor(absValue) === absValue;
+};
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/use-props.js
+/***/ 3290:
+/***/ (function(module) {
+"use strict";
+// https://ecma-international.org/ecma-262/6.0/#sec-ispropertykey
+module.exports = function IsPropertyKey(argument) {
+ return typeof argument === 'string' || typeof argument === 'symbol';
+};
+/***/ }),
-function copyRawValuesOnly(target, source, props) {
- for (var key in source) {
- if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {
- target[key] = source[key];
- }
- }
-}
-function useInitialMotionValues(_a, visualState, isStatic) {
- var transformTemplate = _a.transformTemplate;
- return Object(external_React_["useMemo"])(function () {
- var state = createHtmlRenderState();
- buildHTMLStyles(state, visualState, undefined, undefined, { enableHardwareAcceleration: !isStatic }, transformTemplate);
- var vars = state.vars, style = state.style;
- return __assign(__assign({}, vars), style);
- }, [visualState]);
-}
-function useStyle(props, visualState, isStatic) {
- var styleProp = props.style || {};
- var style = {};
- /**
- * Copy non-Motion Values straight into style
- */
- copyRawValuesOnly(style, styleProp, props);
- Object.assign(style, useInitialMotionValues(props, visualState, isStatic));
- if (props.transformValues) {
- style = props.transformValues(style);
- }
- return style;
-}
-function useHTMLProps(props, visualState, isStatic) {
- // The `any` isn't ideal but it is the type of createElement props argument
- var htmlProps = {};
- var style = useStyle(props, visualState, isStatic);
- if (Boolean(props.drag)) {
- // Disable the ghost element when a user drags
- htmlProps.draggable = false;
- // Disable text selection
- style.userSelect = style.WebkitUserSelect = style.WebkitTouchCallout =
- "none";
- // Disable scrolling on the draggable direction
- style.touchAction =
- props.drag === true
- ? "none"
- : "pan-" + (props.drag === "x" ? "y" : "x");
- }
- htmlProps.style = style;
- return htmlProps;
-}
+/***/ 1275:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/valid-prop.js
-/**
- * A list of all valid MotionProps.
- *
- * @internalremarks
- * This doesn't throw if a `MotionProp` name is missing - it should.
- */
-var validMotionProps = new Set([
- "initial",
- "animate",
- "exit",
- "style",
- "variants",
- "transition",
- "transformTemplate",
- "transformValues",
- "custom",
- "inherit",
- "layout",
- "layoutId",
- "_layoutResetTransform",
- "onLayoutAnimationComplete",
- "onViewportBoxUpdate",
- "onLayoutMeasure",
- "onBeforeLayoutMeasure",
- "onAnimationStart",
- "onAnimationComplete",
- "onUpdate",
- "onDragStart",
- "onDrag",
- "onDragEnd",
- "onMeasureDragConstraints",
- "onDirectionLock",
- "onDragTransitionEnd",
- "drag",
- "dragControls",
- "dragListener",
- "dragConstraints",
- "dragDirectionLock",
- "_dragX",
- "_dragY",
- "dragElastic",
- "dragMomentum",
- "dragPropagation",
- "dragTransition",
- "whileDrag",
- "onPan",
- "onPanStart",
- "onPanEnd",
- "onPanSessionStart",
- "onTap",
- "onTapStart",
- "onTapCancel",
- "onHoverStart",
- "onHoverEnd",
- "whileFocus",
- "whileTap",
- "whileHover",
-]);
-/**
- * Check whether a prop name is a valid `MotionProp` key.
- *
- * @param key - Name of the property to check
- * @returns `true` is key is a valid `MotionProp`.
- *
- * @public
- */
-function isValidMotionProp(key) {
- return validMotionProps.has(key);
-}
+var GetIntrinsic = __webpack_require__(4219);
+var $match = GetIntrinsic('%Symbol.match%', true);
+var hasRegExpMatcher = __webpack_require__(4221);
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js
+var ToBoolean = __webpack_require__(3704);
+// https://ecma-international.org/ecma-262/6.0/#sec-isregexp
-var shouldForward = function (key) { return !isValidMotionProp(key); };
-/**
- * Emotion and Styled Components both allow users to pass through arbitrary props to their components
- * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which
- * of these should be passed to the underlying DOM node.
- *
- * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props
- * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props
- * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of
- * `@emotion/is-prop-valid`, however to fix this problem we need to use it.
- *
- * By making it an optionalDependency we can offer this functionality only in the situations where it's
- * actually required.
- */
-try {
- var emotionIsPropValid_1 = __webpack_require__("gCm3").default;
- shouldForward = function (key) {
- // Handle events explicitly as Emotion validates them all as true
- if (key.startsWith("on")) {
- return !isValidMotionProp(key);
- }
- else {
- return emotionIsPropValid_1(key);
- }
- };
-}
-catch (_a) {
- // We don't need to actually do anything here - the fallback is the existing `isPropValid`.
-}
-function filterProps(props, isDom, forwardMotionProps) {
- var filteredProps = {};
- for (var key in props) {
- if (shouldForward(key) ||
- (forwardMotionProps === true && isValidMotionProp(key)) ||
- (!isDom && !isValidMotionProp(key))) {
- filteredProps[key] = props[key];
- }
- }
- return filteredProps;
-}
+module.exports = function IsRegExp(argument) {
+ if (!argument || typeof argument !== 'object') {
+ return false;
+ }
+ if ($match) {
+ var isRegExp = argument[$match];
+ if (typeof isRegExp !== 'undefined') {
+ return ToBoolean(isRegExp);
+ }
+ }
+ return hasRegExpMatcher(argument);
+};
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.js
+/***/ 2151:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-function calcOrigin(origin, offset, size) {
- return typeof origin === "string"
- ? origin
- : px.transform(offset + size * origin);
-}
-/**
- * The SVG transform origin defaults are different to CSS and is less intuitive,
- * so we use the measured dimensions of the SVG to reconcile these.
- */
-function calcSVGTransformOrigin(dimensions, originX, originY) {
- var pxOriginX = calcOrigin(originX, dimensions.x, dimensions.width);
- var pxOriginY = calcOrigin(originY, dimensions.y, dimensions.height);
- return pxOriginX + " " + pxOriginY;
-}
+var GetIntrinsic = __webpack_require__(4219);
+var $TypeError = GetIntrinsic('%TypeError%');
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/path.js
+var Get = __webpack_require__(6448);
+var ToLength = __webpack_require__(6840);
+var Type = __webpack_require__(9747);
+// https://262.ecma-international.org/11.0/#sec-lengthofarraylike
-// Convert a progress 0-1 to a pixels value based on the provided length
-var progressToPixels = function (progress, length) {
- return px.transform(progress * length);
-};
-var dashKeys = {
- offset: "stroke-dashoffset",
- array: "stroke-dasharray",
-};
-var camelKeys = {
- offset: "strokeDashoffset",
- array: "strokeDasharray",
+module.exports = function LengthOfArrayLike(obj) {
+ if (Type(obj) !== 'Object') {
+ throw new $TypeError('Assertion failed: `obj` must be an Object');
+ }
+ return ToLength(Get(obj, 'length'));
};
-/**
- * Build SVG path properties. Uses the path's measured length to convert
- * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset
- * and stroke-dasharray attributes.
- *
- * This function is mutative to reduce per-frame GC.
- */
-function buildSVGPath(attrs, totalLength, length, spacing, offset, useDashCase) {
- if (spacing === void 0) { spacing = 1; }
- if (offset === void 0) { offset = 0; }
- if (useDashCase === void 0) { useDashCase = true; }
- // We use dash case when setting attributes directly to the DOM node and camel case
- // when defining props on a React component.
- var keys = useDashCase ? dashKeys : camelKeys;
- // Build the dash offset
- attrs[keys.offset] = progressToPixels(-offset, totalLength);
- // Build the dash array
- var pathLength = progressToPixels(length, totalLength);
- var pathSpacing = progressToPixels(spacing, totalLength);
- attrs[keys.array] = pathLength + " " + pathSpacing;
-}
+// TODO: use this all over
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.js
+/***/ }),
+/***/ 6403:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
+var GetIntrinsic = __webpack_require__(4219);
-/**
- * Build SVG visual attrbutes, like cx and style.transform
- */
-function buildSVGAttrs(state, _a, projection, layoutState, options, transformTemplate, buildProjectionTransform, buildProjectionTransformOrigin) {
- var attrX = _a.attrX, attrY = _a.attrY, originX = _a.originX, originY = _a.originY, pathLength = _a.pathLength, _b = _a.pathSpacing, pathSpacing = _b === void 0 ? 1 : _b, _c = _a.pathOffset, pathOffset = _c === void 0 ? 0 : _c,
- // This is object creation, which we try to avoid per-frame.
- latest = __rest(_a, ["attrX", "attrY", "originX", "originY", "pathLength", "pathSpacing", "pathOffset"]);
- buildHTMLStyles(state, latest, projection, layoutState, options, transformTemplate, buildProjectionTransform, buildProjectionTransformOrigin);
- state.attrs = state.style;
- state.style = {};
- var attrs = state.attrs, style = state.style, dimensions = state.dimensions, totalPathLength = state.totalPathLength;
- /**
- * However, we apply transforms as CSS transforms. So if we detect a transform we take it from attrs
- * and copy it into style.
- */
- if (attrs.transform) {
- if (dimensions)
- style.transform = attrs.transform;
- delete attrs.transform;
- }
- // Parse transformOrigin
- if (dimensions &&
- (originX !== undefined || originY !== undefined || style.transform)) {
- style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5);
- }
- // Treat x/y not as shortcuts but as actual attributes
- if (attrX !== undefined)
- attrs.x = attrX;
- if (attrY !== undefined)
- attrs.y = attrY;
- // Build SVG path if one has been measured
- if (totalPathLength !== undefined && pathLength !== undefined) {
- buildSVGPath(attrs, totalPathLength, pathLength, pathSpacing, pathOffset, false);
- }
-}
+var $gOPD = __webpack_require__(5180);
+var $TypeError = GetIntrinsic('%TypeError%');
+var callBound = __webpack_require__(9630);
+var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js
+var has = __webpack_require__(9284);
+var IsArray = __webpack_require__(5971);
+var IsPropertyKey = __webpack_require__(3290);
+var IsRegExp = __webpack_require__(1275);
+var ToPropertyDescriptor = __webpack_require__(2402);
+var Type = __webpack_require__(9747);
+// https://ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty
-var createSvgRenderState = function () { return (__assign(__assign({}, createHtmlRenderState()), { attrs: {} })); };
+module.exports = function OrdinaryGetOwnProperty(O, P) {
+ if (Type(O) !== 'Object') {
+ throw new $TypeError('Assertion failed: O must be an Object');
+ }
+ if (!IsPropertyKey(P)) {
+ throw new $TypeError('Assertion failed: P must be a Property Key');
+ }
+ if (!has(O, P)) {
+ return void 0;
+ }
+ if (!$gOPD) {
+ // ES3 / IE 8 fallback
+ var arrayLength = IsArray(O) && P === 'length';
+ var regexLastIndex = IsRegExp(O) && P === 'lastIndex';
+ return {
+ '[[Configurable]]': !(arrayLength || regexLastIndex),
+ '[[Enumerable]]': $isEnumerable(O, P),
+ '[[Value]]': O[P],
+ '[[Writable]]': true
+ };
+ }
+ return ToPropertyDescriptor($gOPD(O, P));
+};
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/use-props.js
+/***/ 6953:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
+module.exports = __webpack_require__(3031);
+/***/ }),
-function useSVGProps(props, visualState) {
- var visualProps = Object(external_React_["useMemo"])(function () {
- var state = createSvgRenderState();
- buildSVGAttrs(state, visualState, undefined, undefined, { enableHardwareAcceleration: false }, props.transformTemplate);
- return __assign(__assign({}, state.attrs), { style: __assign({}, state.style) });
- }, [visualState]);
- if (props.style) {
- var rawStyles = {};
- copyRawValuesOnly(rawStyles, props.style, props);
- visualProps.style = __assign(__assign({}, rawStyles), visualProps.style);
- }
- return visualProps;
-}
+/***/ 9836:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/use-render.js
+var $isNaN = __webpack_require__(3234);
+// http://262.ecma-international.org/5.1/#sec-9.12
+module.exports = function SameValue(x, y) {
+ if (x === y) { // 0 === -0, but they are not identical.
+ if (x === 0) { return 1 / x === 1 / y; }
+ return true;
+ }
+ return $isNaN(x) && $isNaN(y);
+};
+/***/ }),
+/***/ 3704:
+/***/ (function(module) {
+"use strict";
-function createUseRender(forwardMotionProps) {
- if (forwardMotionProps === void 0) { forwardMotionProps = false; }
- var useRender = function (Component, props, ref, _a, isStatic) {
- var latestValues = _a.latestValues;
- var useVisualProps = isSVGComponent(Component)
- ? useSVGProps
- : useHTMLProps;
- var visualProps = useVisualProps(props, latestValues, isStatic);
- var filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps);
- var elementProps = __assign(__assign(__assign({}, filteredProps), visualProps), { ref: ref });
- return Object(external_React_["createElement"])(Component, elementProps);
- };
- return useRender;
-}
+// http://262.ecma-international.org/5.1/#sec-9.2
+module.exports = function ToBoolean(value) { return !!value; };
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.js
-var CAMEL_CASE_PATTERN = /([a-z])([A-Z])/g;
-var REPLACE_TEMPLATE = "$1-$2";
-/**
- * Convert camelCase to dash-case properties.
- */
-var camelToDash = function (str) {
- return str.replace(CAMEL_CASE_PATTERN, REPLACE_TEMPLATE).toLowerCase();
+
+/***/ }),
+
+/***/ 1723:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+
+"use strict";
+
+
+var ES5ToInteger = __webpack_require__(8537);
+
+var ToNumber = __webpack_require__(5541);
+
+// https://www.ecma-international.org/ecma-262/11.0/#sec-tointeger
+
+module.exports = function ToInteger(value) {
+ var number = ToNumber(value);
+ if (number !== 0) {
+ number = ES5ToInteger(number);
+ }
+ return number === 0 ? 0 : number;
};
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/render.js
-function renderHTML(element, _a) {
- var style = _a.style, vars = _a.vars;
- // Directly assign style into the Element's style prop. In tests Object.assign is the
- // fastest way to assign styles.
- Object.assign(element.style, style);
- // Loop over any CSS variables and assign those.
- for (var key in vars) {
- element.style.setProperty(key, vars[key]);
- }
-}
+/***/ 6840:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.js
-/**
- * A set of attribute names that are always read/written as camel case.
- */
-var camelCaseAttributes = new Set([
- "baseFrequency",
- "diffuseConstant",
- "kernelMatrix",
- "kernelUnitLength",
- "keySplines",
- "keyTimes",
- "limitingConeAngle",
- "markerHeight",
- "markerWidth",
- "numOctaves",
- "targetX",
- "targetY",
- "surfaceScale",
- "specularConstant",
- "specularExponent",
- "stdDeviation",
- "tableValues",
- "viewBox",
- "gradientTransform",
-]);
+var MAX_SAFE_INTEGER = __webpack_require__(8540);
+
+var ToIntegerOrInfinity = __webpack_require__(1723);
+module.exports = function ToLength(argument) {
+ var len = ToIntegerOrInfinity(argument);
+ if (len <= 0) { return 0; } // includes converting -0 to +0
+ if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }
+ return len;
+};
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/render.js
+/***/ }),
+/***/ 5541:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-function renderSVG(element, renderState) {
- renderHTML(element, renderState);
- for (var key in renderState.attrs) {
- element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]);
- }
-}
+var GetIntrinsic = __webpack_require__(4219);
+var $TypeError = GetIntrinsic('%TypeError%');
+var $Number = GetIntrinsic('%Number%');
+var $RegExp = GetIntrinsic('%RegExp%');
+var $parseInteger = GetIntrinsic('%parseInt%');
+var callBound = __webpack_require__(9630);
+var regexTester = __webpack_require__(8441);
+var isPrimitive = __webpack_require__(5019);
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.js
+var $strSlice = callBound('String.prototype.slice');
+var isBinary = regexTester(/^0b[01]+$/i);
+var isOctal = regexTester(/^0o[0-7]+$/i);
+var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i);
+var nonWS = ['\u0085', '\u200b', '\ufffe'].join('');
+var nonWSregex = new $RegExp('[' + nonWS + ']', 'g');
+var hasNonWS = regexTester(nonWSregex);
+// whitespace from: https://es5.github.io/#x15.5.4.20
+// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324
+var ws = [
+ '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003',
+ '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028',
+ '\u2029\uFEFF'
+].join('');
+var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g');
+var $replace = callBound('String.prototype.replace');
+var $trim = function (value) {
+ return $replace(value, trimRegex, '');
+};
+var ToPrimitive = __webpack_require__(6745);
-function scrape_motion_values_scrapeMotionValuesFromProps(props) {
- var style = props.style;
- var newValues = {};
- for (var key in style) {
- if (isMotionValue(style[key]) || isForcedMotionValue(key, props)) {
- newValues[key] = style[key];
- }
- }
- return newValues;
-}
+// https://ecma-international.org/ecma-262/6.0/#sec-tonumber
+module.exports = function ToNumber(argument) {
+ var value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number);
+ if (typeof value === 'symbol') {
+ throw new $TypeError('Cannot convert a Symbol value to a number');
+ }
+ if (typeof value === 'bigint') {
+ throw new $TypeError('Conversion from \'BigInt\' to \'number\' is not allowed.');
+ }
+ if (typeof value === 'string') {
+ if (isBinary(value)) {
+ return ToNumber($parseInteger($strSlice(value, 2), 2));
+ } else if (isOctal(value)) {
+ return ToNumber($parseInteger($strSlice(value, 2), 8));
+ } else if (hasNonWS(value) || isInvalidHexLiteral(value)) {
+ return NaN;
+ }
+ var trimmed = $trim(value);
+ if (trimmed !== value) {
+ return ToNumber(trimmed);
+ }
+ }
+ return $Number(value);
+};
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.js
+/***/ }),
+/***/ 1283:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-function utils_scrape_motion_values_scrapeMotionValuesFromProps(props) {
- var newValues = scrape_motion_values_scrapeMotionValuesFromProps(props);
- for (var key in props) {
- if (isMotionValue(props[key])) {
- var targetKey = key === "x" || key === "y" ? "attr" + key.toUpperCase() : key;
- newValues[targetKey] = props[key];
- }
- }
- return newValues;
-}
+"use strict";
+var GetIntrinsic = __webpack_require__(4219);
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.js
-function isAnimationControls(v) {
- return typeof v === "object" && typeof v.start === "function";
-}
+var $Object = GetIntrinsic('%Object%');
+var RequireObjectCoercible = __webpack_require__(6953);
+// https://ecma-international.org/ecma-262/6.0/#sec-toobject
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.js
-var isKeyframesTarget = function (v) {
- return Array.isArray(v);
+module.exports = function ToObject(value) {
+ RequireObjectCoercible(value);
+ return $Object(value);
};
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/resolve-value.js
+/***/ 6745:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-var resolve_value_isCustomValue = function (v) {
- return Boolean(v && typeof v === "object" && v.mix && v.toValue);
-};
-var resolveFinalValueInKeyframes = function (v) {
- // TODO maybe throw if v.length - 1 is placeholder token?
- return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v;
+
+var toPrimitive = __webpack_require__(5249);
+
+// https://ecma-international.org/ecma-262/6.0/#sec-toprimitive
+
+module.exports = function ToPrimitive(input) {
+ if (arguments.length > 1) {
+ return toPrimitive(input, arguments[1]);
+ }
+ return toPrimitive(input);
};
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.js
+/***/ 2402:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-/**
- * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself
- *
- * TODO: Remove and move to library
- *
- * @internal
- */
-function resolveMotionValue(value) {
- var unwrappedValue = isMotionValue(value) ? value.get() : value;
- return resolve_value_isCustomValue(unwrappedValue)
- ? unwrappedValue.toValue()
- : unwrappedValue;
-}
+var has = __webpack_require__(9284);
+var GetIntrinsic = __webpack_require__(4219);
+var $TypeError = GetIntrinsic('%TypeError%');
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js
+var Type = __webpack_require__(9747);
+var ToBoolean = __webpack_require__(3704);
+var IsCallable = __webpack_require__(1089);
+// https://262.ecma-international.org/5.1/#sec-8.10.5
+module.exports = function ToPropertyDescriptor(Obj) {
+ if (Type(Obj) !== 'Object') {
+ throw new $TypeError('ToPropertyDescriptor requires an object');
+ }
+ var desc = {};
+ if (has(Obj, 'enumerable')) {
+ desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);
+ }
+ if (has(Obj, 'configurable')) {
+ desc['[[Configurable]]'] = ToBoolean(Obj.configurable);
+ }
+ if (has(Obj, 'value')) {
+ desc['[[Value]]'] = Obj.value;
+ }
+ if (has(Obj, 'writable')) {
+ desc['[[Writable]]'] = ToBoolean(Obj.writable);
+ }
+ if (has(Obj, 'get')) {
+ var getter = Obj.get;
+ if (typeof getter !== 'undefined' && !IsCallable(getter)) {
+ throw new $TypeError('getter must be a function');
+ }
+ desc['[[Get]]'] = getter;
+ }
+ if (has(Obj, 'set')) {
+ var setter = Obj.set;
+ if (typeof setter !== 'undefined' && !IsCallable(setter)) {
+ throw new $TypeError('setter must be a function');
+ }
+ desc['[[Set]]'] = setter;
+ }
+ if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {
+ throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
+ }
+ return desc;
+};
+/***/ }),
+/***/ 6888:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-function makeState(_a, props, context, presenceContext) {
- var scrapeMotionValuesFromProps = _a.scrapeMotionValuesFromProps, createRenderState = _a.createRenderState, onMount = _a.onMount;
- var state = {
- latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps),
- renderState: createRenderState(),
- };
- if (onMount) {
- state.mount = function (instance) { return onMount(props, instance, state); };
- }
- return state;
-}
-var makeUseVisualState = function (config) { return function (props, isStatic) {
- var context = Object(external_React_["useContext"])(MotionContext);
- var presenceContext = Object(external_React_["useContext"])(PresenceContext);
- return isStatic
- ? makeState(config, props, context, presenceContext)
- : useConstant(function () { return makeState(config, props, context, presenceContext); });
-}; };
-function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
- var values = {};
- var blockInitialAnimation = (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false;
- var motionValues = scrapeMotionValues(props);
- for (var key in motionValues) {
- values[key] = resolveMotionValue(motionValues[key]);
- }
- var initial = props.initial, animate = props.animate;
- var isControllingVariants = checkIfControllingVariants(props);
- var isVariantNode = checkIfVariantNode(props);
- if (context &&
- isVariantNode &&
- !isControllingVariants &&
- props.inherit !== false) {
- initial !== null && initial !== void 0 ? initial : (initial = context.initial);
- animate !== null && animate !== void 0 ? animate : (animate = context.animate);
- }
- var variantToSet = blockInitialAnimation || initial === false ? animate : initial;
- if (variantToSet &&
- typeof variantToSet !== "boolean" &&
- !isAnimationControls(variantToSet)) {
- var list = Array.isArray(variantToSet) ? variantToSet : [variantToSet];
- list.forEach(function (definition) {
- var resolved = resolveVariantFromProps(props, definition);
- if (!resolved)
- return;
- var transitionEnd = resolved.transitionEnd; resolved.transition; var target = __rest(resolved, ["transitionEnd", "transition"]);
- for (var key in target)
- values[key] = target[key];
- for (var key in transitionEnd)
- values[key] = transitionEnd[key];
- });
- }
- return values;
-}
+var GetIntrinsic = __webpack_require__(4219);
+var $String = GetIntrinsic('%String%');
+var $TypeError = GetIntrinsic('%TypeError%');
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/config-motion.js
+// https://ecma-international.org/ecma-262/6.0/#sec-tostring
+module.exports = function ToString(argument) {
+ if (typeof argument === 'symbol') {
+ throw new $TypeError('Cannot convert a Symbol value to a string');
+ }
+ return $String(argument);
+};
+/***/ }),
+/***/ 9747:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-var svgMotionConfig = {
- useVisualState: makeUseVisualState({
- scrapeMotionValuesFromProps: utils_scrape_motion_values_scrapeMotionValuesFromProps,
- createRenderState: createSvgRenderState,
- onMount: function (props, instance, _a) {
- var renderState = _a.renderState, latestValues = _a.latestValues;
- try {
- renderState.dimensions =
- typeof instance.getBBox ===
- "function"
- ? instance.getBBox()
- : instance.getBoundingClientRect();
- }
- catch (e) {
- // Most likely trying to measure an unrendered element under Firefox
- renderState.dimensions = {
- x: 0,
- y: 0,
- width: 0,
- height: 0,
- };
- }
- if (isPath(instance)) {
- renderState.totalPathLength = instance.getTotalLength();
- }
- buildSVGAttrs(renderState, latestValues, undefined, undefined, { enableHardwareAcceleration: false }, props.transformTemplate);
- // TODO: Replace with direct assignment
- renderSVG(instance, renderState);
- },
- }),
+
+var ES5Type = __webpack_require__(290);
+
+// https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values
+
+module.exports = function Type(x) {
+ if (typeof x === 'symbol') {
+ return 'Symbol';
+ }
+ if (typeof x === 'bigint') {
+ return 'BigInt';
+ }
+ return ES5Type(x);
};
-function isPath(element) {
- return element.tagName === "path";
-}
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/config-motion.js
+/***/ 13:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
+var GetIntrinsic = __webpack_require__(4219);
-var htmlMotionConfig = {
- useVisualState: makeUseVisualState({
- scrapeMotionValuesFromProps: scrape_motion_values_scrapeMotionValuesFromProps,
- createRenderState: createHtmlRenderState,
- }),
+var $abs = GetIntrinsic('%Math.abs%');
+
+// http://262.ecma-international.org/5.1/#sec-5.2
+
+module.exports = function abs(x) {
+ return $abs(x);
};
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/create-config.js
+/***/ 5127:
+/***/ (function(module) {
+"use strict";
+// var modulo = require('./modulo');
+var $floor = Math.floor;
+// http://262.ecma-international.org/5.1/#sec-5.2
+module.exports = function floor(x) {
+ // return x - modulo(x, 1);
+ return $floor(x);
+};
-function createDomMotionConfig(Component, _a, preloadedFeatures, createVisualElement) {
- var _b = _a.forwardMotionProps, forwardMotionProps = _b === void 0 ? false : _b;
- var baseConfig = isSVGComponent(Component)
- ? svgMotionConfig
- : htmlMotionConfig;
- return __assign(__assign({}, baseConfig), { preloadedFeatures: preloadedFeatures, useRender: createUseRender(forwardMotionProps), createVisualElement: createVisualElement,
- Component: Component });
-}
+/***/ }),
+/***/ 3031:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/types.js
-var AnimationType;
-(function (AnimationType) {
- AnimationType["Animate"] = "animate";
- AnimationType["Hover"] = "whileHover";
- AnimationType["Tap"] = "whileTap";
- AnimationType["Drag"] = "whileDrag";
- AnimationType["Focus"] = "whileFocus";
- AnimationType["Exit"] = "exit";
-})(AnimationType || (AnimationType = {}));
+"use strict";
+var GetIntrinsic = __webpack_require__(4219);
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/use-dom-event.js
+var $TypeError = GetIntrinsic('%TypeError%');
+// http://262.ecma-international.org/5.1/#sec-9.10
-function addDomEvent(target, eventName, handler, options) {
- target.addEventListener(eventName, handler, options);
- return function () { return target.removeEventListener(eventName, handler, options); };
-}
-/**
- * Attaches an event listener directly to the provided DOM element.
- *
- * Bypassing React's event system can be desirable, for instance when attaching non-passive
- * event handlers.
- *
- * ```jsx
- * const ref = useRef(null)
- *
- * useDomEvent(ref, 'wheel', onWheel, { passive: false })
- *
- * return <div ref={ref} />
- * ```
- *
- * @param ref - React.RefObject that's been provided to the element you want to bind the listener to.
- * @param eventName - Name of the event you want listen for.
- * @param handler - Function to fire when receiving the event.
- * @param options - Options to pass to `Event.addEventListener`.
- *
- * @public
- */
-function useDomEvent(ref, eventName, handler, options) {
- Object(external_React_["useEffect"])(function () {
- var element = ref.current;
- if (handler && element) {
- return addDomEvent(element, eventName, handler, options);
- }
- }, [ref, eventName, handler, options]);
-}
+module.exports = function CheckObjectCoercible(value, optMessage) {
+ if (value == null) {
+ throw new $TypeError(optMessage || ('Cannot call method on ' + value));
+ }
+ return value;
+};
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-focus-gesture.js
+/***/ 8537:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-/**
- *
- * @param props
- * @param ref
- * @internal
- */
-function useFocusGesture(_a) {
- var whileFocus = _a.whileFocus, visualElement = _a.visualElement;
- var onFocus = function () {
- var _a;
- (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Focus, true);
- };
- var onBlur = function () {
- var _a;
- (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Focus, false);
- };
- useDomEvent(visualElement, "focus", whileFocus ? onFocus : undefined);
- useDomEvent(visualElement, "blur", whileFocus ? onBlur : undefined);
-}
+var abs = __webpack_require__(6195);
+var floor = __webpack_require__(7914);
+var ToNumber = __webpack_require__(4018);
+var $isNaN = __webpack_require__(3234);
+var $isFinite = __webpack_require__(7061);
+var $sign = __webpack_require__(2163);
+// http://262.ecma-international.org/5.1/#sec-9.4
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/utils/event-type.js
-function isMouseEvent(event) {
- // PointerEvent inherits from MouseEvent so we can't use a straight instanceof check.
- if (typeof PointerEvent !== "undefined" && event instanceof PointerEvent) {
- return !!(event.pointerType === "mouse");
- }
- return event instanceof MouseEvent;
-}
-function isTouchEvent(event) {
- var hasTouches = !!event.touches;
- return hasTouches;
-}
+module.exports = function ToInteger(value) {
+ var number = ToNumber(value);
+ if ($isNaN(number)) { return 0; }
+ if (number === 0 || !$isFinite(number)) { return number; }
+ return $sign(number) * floor(abs(number));
+};
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/event-info.js
+/***/ 4018:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-/**
- * Filters out events not attached to the primary pointer (currently left mouse button)
- * @param eventHandler
- */
-function filterPrimaryPointer(eventHandler) {
- return function (event) {
- var isMouseEvent = event instanceof MouseEvent;
- var isPrimaryPointer = !isMouseEvent ||
- (isMouseEvent && event.button === 0);
- if (isPrimaryPointer) {
- eventHandler(event);
- }
- };
-}
-var defaultPagePoint = { pageX: 0, pageY: 0 };
-function pointFromTouch(e, pointType) {
- if (pointType === void 0) { pointType = "page"; }
- var primaryTouch = e.touches[0] || e.changedTouches[0];
- var point = primaryTouch || defaultPagePoint;
- return {
- x: point[pointType + "X"],
- y: point[pointType + "Y"],
- };
-}
-function pointFromMouse(point, pointType) {
- if (pointType === void 0) { pointType = "page"; }
- return {
- x: point[pointType + "X"],
- y: point[pointType + "Y"],
- };
-}
-function extractEventInfo(event, pointType) {
- if (pointType === void 0) { pointType = "page"; }
- return {
- point: isTouchEvent(event)
- ? pointFromTouch(event, pointType)
- : pointFromMouse(event, pointType),
- };
-}
-function getViewportPointFromEvent(event) {
- return extractEventInfo(event, "client");
-}
-var wrapHandler = function (handler, shouldFilterPrimaryPointer) {
- if (shouldFilterPrimaryPointer === void 0) { shouldFilterPrimaryPointer = false; }
- var listener = function (event) {
- return handler(event, extractEventInfo(event));
- };
- return shouldFilterPrimaryPointer
- ? filterPrimaryPointer(listener)
- : listener;
-};
+var ToPrimitive = __webpack_require__(583);
+// http://262.ecma-international.org/5.1/#sec-9.3
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/utils.js
+module.exports = function ToNumber(value) {
+ var prim = ToPrimitive(value, Number);
+ if (typeof prim !== 'string') {
+ return +prim; // eslint-disable-line no-implicit-coercion
+ }
+ // eslint-disable-next-line no-control-regex
+ var trimmed = prim.replace(/^[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+|[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+$/g, '');
+ if ((/^0[ob]|^[+-]0x/).test(trimmed)) {
+ return NaN;
+ }
-// We check for event support via functions in case they've been mocked by a testing suite.
-var supportsPointerEvents = function () {
- return isBrowser && window.onpointerdown === null;
-};
-var supportsTouchEvents = function () {
- return isBrowser && window.ontouchstart === null;
-};
-var supportsMouseEvents = function () {
- return isBrowser && window.onmousedown === null;
+ return +trimmed; // eslint-disable-line no-implicit-coercion
};
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/events/use-pointer-event.js
+/***/ 583:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
+// http://262.ecma-international.org/5.1/#sec-9.1
-var mouseEventNames = {
- pointerdown: "mousedown",
- pointermove: "mousemove",
- pointerup: "mouseup",
- pointercancel: "mousecancel",
- pointerover: "mouseover",
- pointerout: "mouseout",
- pointerenter: "mouseenter",
- pointerleave: "mouseleave",
-};
-var touchEventNames = {
- pointerdown: "touchstart",
- pointermove: "touchmove",
- pointerup: "touchend",
- pointercancel: "touchcancel",
-};
-function getPointerEventName(name) {
- if (supportsPointerEvents()) {
- return name;
- }
- else if (supportsTouchEvents()) {
- return touchEventNames[name];
- }
- else if (supportsMouseEvents()) {
- return mouseEventNames[name];
- }
- return name;
-}
-function addPointerEvent(target, eventName, handler, options) {
- return addDomEvent(target, getPointerEventName(eventName), wrapHandler(handler, eventName === "pointerdown"), options);
-}
-function usePointerEvent(ref, eventName, handler, options) {
- return useDomEvent(ref, getPointerEventName(eventName), handler && wrapHandler(handler, eventName === "pointerdown"), options);
-}
+module.exports = __webpack_require__(8023);
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/utils/lock.js
-function createLock(name) {
- var lock = null;
- return function () {
- var openLock = function () {
- lock = null;
- };
- if (lock === null) {
- lock = name;
- return openLock;
- }
- return false;
- };
-}
-var globalHorizontalLock = createLock("dragHorizontal");
-var globalVerticalLock = createLock("dragVertical");
-function getGlobalLock(drag) {
- var lock = false;
- if (drag === "y") {
- lock = globalVerticalLock();
- }
- else if (drag === "x") {
- lock = globalHorizontalLock();
- }
- else {
- var openHorizontal_1 = globalHorizontalLock();
- var openVertical_1 = globalVerticalLock();
- if (openHorizontal_1 && openVertical_1) {
- lock = function () {
- openHorizontal_1();
- openVertical_1();
- };
- }
- else {
- // Release the locks because we don't use them
- if (openHorizontal_1)
- openHorizontal_1();
- if (openVertical_1)
- openVertical_1();
- }
- }
- return lock;
-}
-function isDragActive() {
- // Check the gesture lock - if we get it, it means no drag gesture is active
- // and we can safely fire the tap gesture.
- var openGestureLock = getGlobalLock(true);
- if (!openGestureLock)
- return true;
- openGestureLock();
- return false;
-}
+/***/ 290:
+/***/ (function(module) {
+"use strict";
+
+
+// https://262.ecma-international.org/5.1/#sec-8
+module.exports = function Type(x) {
+ if (x === null) {
+ return 'Null';
+ }
+ if (typeof x === 'undefined') {
+ return 'Undefined';
+ }
+ if (typeof x === 'function' || typeof x === 'object') {
+ return 'Object';
+ }
+ if (typeof x === 'number') {
+ return 'Number';
+ }
+ if (typeof x === 'boolean') {
+ return 'Boolean';
+ }
+ if (typeof x === 'string') {
+ return 'String';
+ }
+};
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-hover-gesture.js
+/***/ }),
+/***/ 6195:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-function createHoverEvent(visualElement, isActive, callback) {
- return function (event, info) {
- var _a;
- if (!isMouseEvent(event) || isDragActive())
- return;
- callback === null || callback === void 0 ? void 0 : callback(event, info);
- (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Hover, isActive);
- };
-}
-function useHoverGesture(_a) {
- var onHoverStart = _a.onHoverStart, onHoverEnd = _a.onHoverEnd, whileHover = _a.whileHover, visualElement = _a.visualElement;
- usePointerEvent(visualElement, "pointerenter", onHoverStart || whileHover
- ? createHoverEvent(visualElement, true, onHoverStart)
- : undefined);
- usePointerEvent(visualElement, "pointerleave", onHoverEnd || whileHover
- ? createHoverEvent(visualElement, false, onHoverEnd)
- : undefined);
-}
+var GetIntrinsic = __webpack_require__(4219);
+var $abs = GetIntrinsic('%Math.abs%');
+// http://262.ecma-international.org/5.1/#sec-5.2
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/utils/is-node-or-child.js
-/**
- * Recursively traverse up the tree to check whether the provided child node
- * is the parent or a descendant of it.
- *
- * @param parent - Element to find
- * @param child - Element to test against parent
- */
-var isNodeOrChild = function (parent, child) {
- if (!child) {
- return false;
- }
- else if (parent === child) {
- return true;
- }
- else {
- return isNodeOrChild(parent, child.parentElement);
- }
+module.exports = function abs(x) {
+ return $abs(x);
};
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/use-unmount-effect.js
+/***/ 7914:
+/***/ (function(module) {
+"use strict";
-function useUnmountEffect(callback) {
- return Object(external_React_["useEffect"])(function () { return function () { return callback(); }; }, []);
-}
+// var modulo = require('./modulo');
+var $floor = Math.floor;
+// http://262.ecma-international.org/5.1/#sec-5.2
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/pipe.js
-var combineFunctions = function (a, b) { return function (v) { return b(a(v)); }; };
-var pipe = function () {
- var transformers = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- transformers[_i] = arguments[_i];
- }
- return transformers.reduce(combineFunctions);
+module.exports = function floor(x) {
+ // return x - modulo(x, 1);
+ return $floor(x);
};
+/***/ }),
+
+/***/ 137:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+
+"use strict";
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-tap-gesture.js
+// TODO: remove, semver-major
+module.exports = __webpack_require__(4219);
+/***/ }),
+/***/ 1327:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-/**
- * @param handlers -
- * @internal
- */
-function useTapGesture(_a) {
- var onTap = _a.onTap, onTapStart = _a.onTapStart, onTapCancel = _a.onTapCancel, whileTap = _a.whileTap, visualElement = _a.visualElement;
- var hasPressListeners = onTap || onTapStart || onTapCancel || whileTap;
- var isPressing = Object(external_React_["useRef"])(false);
- var cancelPointerEndListeners = Object(external_React_["useRef"])(null);
- function removePointerEndListener() {
- var _a;
- (_a = cancelPointerEndListeners.current) === null || _a === void 0 ? void 0 : _a.call(cancelPointerEndListeners);
- cancelPointerEndListeners.current = null;
- }
- function checkPointerEnd() {
- var _a;
- removePointerEndListener();
- isPressing.current = false;
- (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Tap, false);
- return !isDragActive();
- }
- function onPointerUp(event, info) {
- if (!checkPointerEnd())
- return;
- /**
- * We only count this as a tap gesture if the event.target is the same
- * as, or a child of, this component's element
- */
- !isNodeOrChild(visualElement.getInstance(), event.target)
- ? onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info)
- : onTap === null || onTap === void 0 ? void 0 : onTap(event, info);
- }
- function onPointerCancel(event, info) {
- if (!checkPointerEnd())
- return;
- onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info);
- }
- function onPointerDown(event, info) {
- var _a;
- removePointerEndListener();
- if (isPressing.current)
- return;
- isPressing.current = true;
- cancelPointerEndListeners.current = pipe(addPointerEvent(window, "pointerup", onPointerUp), addPointerEvent(window, "pointercancel", onPointerCancel));
- onTapStart === null || onTapStart === void 0 ? void 0 : onTapStart(event, info);
- (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Tap, true);
- }
- usePointerEvent(visualElement, "pointerdown", hasPressListeners ? onPointerDown : undefined);
- useUnmountEffect(removePointerEndListener);
+var GetIntrinsic = __webpack_require__(4219);
+
+var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
+
+if ($defineProperty) {
+ try {
+ $defineProperty({}, 'a', { value: 1 });
+ } catch (e) {
+ // IE 8 has a broken defineProperty
+ $defineProperty = null;
+ }
}
+// node v0.6 has a bug where array lengths can be Set but not Defined
+var hasArrayLengthDefineBug = Object.defineProperty && Object.defineProperty([], 'length', { value: 1 }).length === 0;
+
+// eslint-disable-next-line global-require
+var isArray = hasArrayLengthDefineBug && __webpack_require__(7472); // this does not depend on any other AOs.
+var callBound = __webpack_require__(9630);
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/utils/make-renderless-component.js
-var makeRenderlessComponent = function (hook) { return function (props) {
- hook(props);
- return null;
-}; };
+var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
+
+// eslint-disable-next-line max-params
+module.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) {
+ if (!$defineProperty) {
+ if (!IsDataDescriptor(desc)) {
+ // ES3 does not support getters/setters
+ return false;
+ }
+ if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) {
+ return false;
+ }
+
+ // fallback for ES3
+ if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) {
+ // a non-enumerable existing property
+ return false;
+ }
+
+ // property does not exist at all, or exists but is enumerable
+ var V = desc['[[Value]]'];
+ // eslint-disable-next-line no-param-reassign
+ O[P] = V; // will use [[Define]]
+ return SameValue(O[P], V);
+ }
+ if (
+ hasArrayLengthDefineBug
+ && P === 'length'
+ && '[[Value]]' in desc
+ && isArray(O)
+ && O.length !== desc['[[Value]]']
+ ) {
+ // eslint-disable-next-line no-param-reassign
+ O.length = desc['[[Value]]'];
+ return O.length === desc['[[Value]]'];
+ }
+ $defineProperty(O, P, FromPropertyDescriptor(desc));
+ return true;
+};
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/gestures.js
+/***/ }),
+/***/ 5114:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
+var GetIntrinsic = __webpack_require__(4219);
-var gestureAnimations = {
- tap: makeRenderlessComponent(useTapGesture),
- focus: makeRenderlessComponent(useFocusGesture),
- hover: makeRenderlessComponent(useHoverGesture),
+var $TypeError = GetIntrinsic('%TypeError%');
+var $SyntaxError = GetIntrinsic('%SyntaxError%');
+
+var has = __webpack_require__(9284);
+
+var predicates = {
+ // https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type
+ 'Property Descriptor': function isPropertyDescriptor(Type, Desc) {
+ if (Type(Desc) !== 'Object') {
+ return false;
+ }
+ var allowed = {
+ '[[Configurable]]': true,
+ '[[Enumerable]]': true,
+ '[[Get]]': true,
+ '[[Set]]': true,
+ '[[Value]]': true,
+ '[[Writable]]': true
+ };
+
+ for (var key in Desc) { // eslint-disable-line
+ if (has(Desc, key) && !allowed[key]) {
+ return false;
+ }
+ }
+
+ var isData = has(Desc, '[[Value]]');
+ var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');
+ if (isData && IsAccessor) {
+ throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');
+ }
+ return true;
+ }
};
+module.exports = function assertRecord(Type, recordType, argumentName, value) {
+ var predicate = predicates[recordType];
+ if (typeof predicate !== 'function') {
+ throw new $SyntaxError('unknown record type: ' + recordType);
+ }
+ if (!predicate(Type, value)) {
+ throw new $TypeError(argumentName + ' must be a ' + recordType);
+ }
+};
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/shallow-compare.js
-function shallowCompare(next, prev) {
- if (!Array.isArray(prev))
- return false;
- var prevLength = prev.length;
- if (prevLength !== next.length)
- return false;
- for (var i = 0; i < prevLength; i++) {
- if (prev[i] !== next[i])
- return false;
- }
- return true;
+/***/ }),
+
+/***/ 5180:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+
+"use strict";
+
+
+var GetIntrinsic = __webpack_require__(4219);
+
+var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
+if ($gOPD) {
+ try {
+ $gOPD([], 'length');
+ } catch (e) {
+ // IE 8 has a broken gOPD
+ $gOPD = null;
+ }
}
+module.exports = $gOPD;
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/clamp.js
-var clamp_clamp = function (min, max, v) {
- return Math.min(Math.max(v, min), max);
-};
+/***/ }),
+/***/ 7061:
+/***/ (function(module) {
+"use strict";
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/utils/find-spring.js
+var $isNaN = Number.isNaN || function (a) { return a !== a; };
-
-var safeMin = 0.001;
-var minDuration = 0.01;
-var maxDuration = 10.0;
-var minDamping = 0.05;
-var maxDamping = 1;
-function findSpring(_a) {
- var _b = _a.duration, duration = _b === void 0 ? 800 : _b, _c = _a.bounce, bounce = _c === void 0 ? 0.25 : _c, _d = _a.velocity, velocity = _d === void 0 ? 0 : _d, _e = _a.mass, mass = _e === void 0 ? 1 : _e;
- var envelope;
- var derivative;
- warning(duration <= maxDuration * 1000, "Spring duration must be 10 seconds or less");
- var dampingRatio = 1 - bounce;
- dampingRatio = clamp_clamp(minDamping, maxDamping, dampingRatio);
- duration = clamp_clamp(minDuration, maxDuration, duration / 1000);
- if (dampingRatio < 1) {
- envelope = function (undampedFreq) {
- var exponentialDecay = undampedFreq * dampingRatio;
- var delta = exponentialDecay * duration;
- var a = exponentialDecay - velocity;
- var b = calcAngularFreq(undampedFreq, dampingRatio);
- var c = Math.exp(-delta);
- return safeMin - (a / b) * c;
- };
- derivative = function (undampedFreq) {
- var exponentialDecay = undampedFreq * dampingRatio;
- var delta = exponentialDecay * duration;
- var d = delta * velocity + velocity;
- var e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;
- var f = Math.exp(-delta);
- var g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);
- var factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;
- return (factor * ((d - e) * f)) / g;
- };
- }
- else {
- envelope = function (undampedFreq) {
- var a = Math.exp(-undampedFreq * duration);
- var b = (undampedFreq - velocity) * duration + 1;
- return -safeMin + a * b;
- };
- derivative = function (undampedFreq) {
- var a = Math.exp(-undampedFreq * duration);
- var b = (velocity - undampedFreq) * (duration * duration);
- return a * b;
- };
- }
- var initialGuess = 5 / duration;
- var undampedFreq = approximateRoot(envelope, derivative, initialGuess);
- duration = duration * 1000;
- if (isNaN(undampedFreq)) {
- return {
- stiffness: 100,
- damping: 10,
- duration: duration,
- };
- }
- else {
- var stiffness = Math.pow(undampedFreq, 2) * mass;
- return {
- stiffness: stiffness,
- damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),
- duration: duration,
- };
- }
-}
-var rootIterations = 12;
-function approximateRoot(envelope, derivative, initialGuess) {
- var result = initialGuess;
- for (var i = 1; i < rootIterations; i++) {
- result = result - envelope(result) / derivative(result);
- }
- return result;
-}
-function calcAngularFreq(undampedFreq, dampingRatio) {
- return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);
-}
+module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; };
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/generators/spring.js
+/***/ 3234:
+/***/ (function(module) {
+"use strict";
-var durationKeys = ["duration", "bounce"];
-var physicsKeys = ["stiffness", "damping", "mass"];
-function isSpringType(options, keys) {
- return keys.some(function (key) { return options[key] !== undefined; });
-}
-function getSpringOptions(options) {
- var springOptions = __assign({ velocity: 0.0, stiffness: 100, damping: 10, mass: 1.0, isResolvedFromDuration: false }, options);
- if (!isSpringType(options, physicsKeys) &&
- isSpringType(options, durationKeys)) {
- var derived = findSpring(options);
- springOptions = __assign(__assign(__assign({}, springOptions), derived), { velocity: 0.0, mass: 1.0 });
- springOptions.isResolvedFromDuration = true;
- }
- return springOptions;
-}
-function spring(_a) {
- var _b = _a.from, from = _b === void 0 ? 0.0 : _b, _c = _a.to, to = _c === void 0 ? 1.0 : _c, _d = _a.restSpeed, restSpeed = _d === void 0 ? 2 : _d, restDelta = _a.restDelta, options = __rest(_a, ["from", "to", "restSpeed", "restDelta"]);
- var state = { done: false, value: from };
- var _e = getSpringOptions(options), stiffness = _e.stiffness, damping = _e.damping, mass = _e.mass, velocity = _e.velocity, duration = _e.duration, isResolvedFromDuration = _e.isResolvedFromDuration;
- var resolveSpring = zero;
- var resolveVelocity = zero;
- function createSpring() {
- var initialVelocity = velocity ? -(velocity / 1000) : 0.0;
- var initialDelta = to - from;
- var dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));
- var undampedAngularFreq = Math.sqrt(stiffness / mass) / 1000;
- restDelta !== null && restDelta !== void 0 ? restDelta : (restDelta = Math.abs(to - from) <= 1 ? 0.01 : 0.4);
- if (dampingRatio < 1) {
- var angularFreq_1 = calcAngularFreq(undampedAngularFreq, dampingRatio);
- resolveSpring = function (t) {
- var envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);
- return (to -
- envelope *
- (((initialVelocity +
- dampingRatio * undampedAngularFreq * initialDelta) /
- angularFreq_1) *
- Math.sin(angularFreq_1 * t) +
- initialDelta * Math.cos(angularFreq_1 * t)));
- };
- resolveVelocity = function (t) {
- var envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);
- return (dampingRatio *
- undampedAngularFreq *
- envelope *
- ((Math.sin(angularFreq_1 * t) *
- (initialVelocity +
- dampingRatio *
- undampedAngularFreq *
- initialDelta)) /
- angularFreq_1 +
- initialDelta * Math.cos(angularFreq_1 * t)) -
- envelope *
- (Math.cos(angularFreq_1 * t) *
- (initialVelocity +
- dampingRatio *
- undampedAngularFreq *
- initialDelta) -
- angularFreq_1 *
- initialDelta *
- Math.sin(angularFreq_1 * t)));
- };
- }
- else if (dampingRatio === 1) {
- resolveSpring = function (t) {
- return to -
- Math.exp(-undampedAngularFreq * t) *
- (initialDelta +
- (initialVelocity + undampedAngularFreq * initialDelta) *
- t);
- };
- }
- else {
- var dampedAngularFreq_1 = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);
- resolveSpring = function (t) {
- var envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);
- var freqForT = Math.min(dampedAngularFreq_1 * t, 300);
- return (to -
- (envelope *
- ((initialVelocity +
- dampingRatio * undampedAngularFreq * initialDelta) *
- Math.sinh(freqForT) +
- dampedAngularFreq_1 *
- initialDelta *
- Math.cosh(freqForT))) /
- dampedAngularFreq_1);
- };
- }
- }
- createSpring();
- return {
- next: function (t) {
- var current = resolveSpring(t);
- if (!isResolvedFromDuration) {
- var currentVelocity = resolveVelocity(t) * 1000;
- var isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;
- var isBelowDisplacementThreshold = Math.abs(to - current) <= restDelta;
- state.done =
- isBelowVelocityThreshold && isBelowDisplacementThreshold;
- }
- else {
- state.done = t >= duration;
- }
- state.value = state.done ? to : current;
- return state;
- },
- flipTarget: function () {
- var _a;
- velocity = -velocity;
- _a = [to, from], from = _a[0], to = _a[1];
- createSpring();
- },
- };
-}
-spring.needsInterpolation = function (a, b) {
- return typeof a === "string" || typeof b === "string";
+module.exports = Number.isNaN || function isNaN(a) {
+ return a !== a;
};
-var zero = function (_t) { return 0; };
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/progress.js
-var progress_progress = function (from, to, value) {
- var toFromDifference = to - from;
- return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
-};
+/***/ 5019:
+/***/ (function(module) {
+"use strict";
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/mix.js
-var mix = function (from, to, progress) {
- return -progress * from + progress * to + from;
+module.exports = function isPrimitive(value) {
+ return value === null || (typeof value !== 'function' && typeof value !== 'object');
};
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/utils.js
+/***/ 8682:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-var isColorString = function (type, testProp) { return function (v) {
- return Boolean((isString(v) && singleColorRegex.test(v) && v.startsWith(type)) ||
- (testProp && Object.prototype.hasOwnProperty.call(v, testProp)));
-}; };
-var splitColor = function (aName, bName, cName) { return function (v) {
- var _a;
- if (!isString(v))
- return v;
- var _b = v.match(floatRegex), a = _b[0], b = _b[1], c = _b[2], alpha = _b[3];
- return _a = {},
- _a[aName] = parseFloat(a),
- _a[bName] = parseFloat(b),
- _a[cName] = parseFloat(c),
- _a.alpha = alpha !== undefined ? parseFloat(alpha) : 1,
- _a;
-}; };
+var GetIntrinsic = __webpack_require__(4219);
+var has = __webpack_require__(9284);
+var $TypeError = GetIntrinsic('%TypeError%');
-// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/rgba.js
+module.exports = function IsPropertyDescriptor(ES, Desc) {
+ if (ES.Type(Desc) !== 'Object') {
+ return false;
+ }
+ var allowed = {
+ '[[Configurable]]': true,
+ '[[Enumerable]]': true,
+ '[[Get]]': true,
+ '[[Set]]': true,
+ '[[Value]]': true,
+ '[[Writable]]': true
+ };
+ for (var key in Desc) { // eslint-disable-line no-restricted-syntax
+ if (has(Desc, key) && !allowed[key]) {
+ return false;
+ }
+ }
+ if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) {
+ throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');
+ }
+ return true;
+};
+/***/ }),
-var clampRgbUnit = clamp(0, 255);
-var rgbUnit = __assign(__assign({}, numbers_number), { transform: function (v) { return Math.round(clampRgbUnit(v)); } });
-var rgba_rgba = {
- test: isColorString('rgb', 'red'),
- parse: splitColor('red', 'green', 'blue'),
- transform: function (_a) {
- var red = _a.red, green = _a.green, blue = _a.blue, _b = _a.alpha, alpha$1 = _b === void 0 ? 1 : _b;
- return 'rgba(' +
- rgbUnit.transform(red) +
- ', ' +
- rgbUnit.transform(green) +
- ', ' +
- rgbUnit.transform(blue) +
- ', ' +
- utils_sanitize(numbers_alpha.transform(alpha$1)) +
- ')';
- },
-};
+/***/ 8540:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
+"use strict";
-// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/hex.js
+var GetIntrinsic = __webpack_require__(4219);
+var $Math = GetIntrinsic('%Math%');
+var $Number = GetIntrinsic('%Number%');
+module.exports = $Number.MAX_SAFE_INTEGER || $Math.pow(2, 53) - 1;
-function parseHex(v) {
- var r = '';
- var g = '';
- var b = '';
- var a = '';
- if (v.length > 5) {
- r = v.substr(1, 2);
- g = v.substr(3, 2);
- b = v.substr(5, 2);
- a = v.substr(7, 2);
- }
- else {
- r = v.substr(1, 1);
- g = v.substr(2, 1);
- b = v.substr(3, 1);
- a = v.substr(4, 1);
- r += r;
- g += g;
- b += b;
- a += a;
- }
- return {
- red: parseInt(r, 16),
- green: parseInt(g, 16),
- blue: parseInt(b, 16),
- alpha: a ? parseInt(a, 16) / 255 : 1,
- };
-}
-var hex_hex = {
- test: isColorString('#'),
- parse: parseHex,
- transform: rgba_rgba.transform,
-};
+/***/ }),
+/***/ 8441:
+/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/hsla.js
+"use strict";
+var GetIntrinsic = __webpack_require__(4219);
+var $test = GetIntrinsic('RegExp.prototype.test');
+var callBind = __webpack_require__(9961);
-var hsla = {
- test: isColorString('hsl', 'hue'),
- parse: splitColor('hue', 'saturation', 'lightness'),
- transform: function (_a) {
- var hue = _a.hue, saturation = _a.saturation, lightness = _a.lightness, _b = _a.alpha, alpha$1 = _b === void 0 ? 1 : _b;
- return ('hsla(' +
- Math.round(hue) +
- ', ' +
- percent.transform(utils_sanitize(saturation)) +
- ', ' +
- percent.transform(utils_sanitize(lightness)) +
- ', ' +
- utils_sanitize(numbers_alpha.transform(alpha$1)) +
- ')');
- },
+module.exports = function regexTester(regex) {
+ return callBind($test, regex);
};
+/***/ }),
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/mix-color.js
-
-
+/***/ 2163:
+/***/ (function(module) {
+"use strict";
-var mixLinearColor = function (from, to, v) {
- var fromExpo = from * from;
- var toExpo = to * to;
- return Math.sqrt(Math.max(0, v * (toExpo - fromExpo) + fromExpo));
-};
-var colorTypes = [hex_hex, rgba_rgba, hsla];
-var getColorType = function (v) {
- return colorTypes.find(function (type) { return type.test(v); });
-};
-var notAnimatable = function (color) {
- return "'" + color + "' is not an animatable color. Use the equivalent color code instead.";
-};
-var mixColor = function (from, to) {
- var fromColorType = getColorType(from);
- var toColorType = getColorType(to);
- invariant(!!fromColorType, notAnimatable(from));
- invariant(!!toColorType, notAnimatable(to));
- invariant(fromColorType.transform === toColorType.transform, "Both colors must be hex/RGBA, OR both must be HSLA.");
- var fromColor = fromColorType.parse(from);
- var toColor = toColorType.parse(to);
- var blended = __assign({}, fromColor);
- var mixFunc = fromColorType === hsla ? mix : mixLinearColor;
- return function (v) {
- for (var key in blended) {
- if (key !== "alpha") {
- blended[key] = mixFunc(fromColor[key], toColor[key], v);
- }
- }
- blended.alpha = mix(fromColor.alpha, toColor.alpha, v);
- return fromColorType.transform(blended);
- };
+module.exports = function sign(number) {
+ return number >= 0 ? 1 : -1;
};
+/***/ })
+
+/******/ });
+/************************************************************************/
+/******/ // The module cache
+/******/ var __webpack_module_cache__ = {};
+/******/
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+/******/ // Check if module is in cache
+/******/ var cachedModule = __webpack_module_cache__[moduleId];
+/******/ if (cachedModule !== undefined) {
+/******/ return cachedModule.exports;
+/******/ }
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = __webpack_module_cache__[moduleId] = {
+/******/ // no module.id needed
+/******/ // no module.loaded needed
+/******/ exports: {}
+/******/ };
+/******/
+/******/ // Execute the module function
+/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
+/******/
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+/******/
+/************************************************************************/
+/******/ /* webpack/runtime/compat get default export */
+/******/ !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/global */
+/******/ !function() {
+/******/ __webpack_require__.g = (function() {
+/******/ if (typeof globalThis === 'object') return globalThis;
+/******/ try {
+/******/ return this || new Function('return this')();
+/******/ } catch (e) {
+/******/ if (typeof window === 'object') return window;
+/******/ }
+/******/ })();
+/******/ }();
+/******/
+/******/ /* 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__);
-// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/color/index.js
+// EXPORTS
+__webpack_require__.d(__webpack_exports__, {
+ "AnglePickerControl": function() { return /* reexport */ AnglePickerControl; },
+ "Animate": function() { return /* reexport */ Animate; },
+ "Autocomplete": function() { return /* reexport */ Autocomplete; },
+ "BaseControl": function() { return /* reexport */ base_control; },
+ "BlockQuotation": function() { return /* reexport */ external_wp_primitives_namespaceObject.BlockQuotation; },
+ "Button": function() { return /* reexport */ build_module_button; },
+ "ButtonGroup": function() { return /* reexport */ button_group; },
+ "Card": function() { return /* reexport */ card_component; },
+ "CardBody": function() { return /* reexport */ card_body_component; },
+ "CardDivider": function() { return /* reexport */ card_divider_component; },
+ "CardFooter": function() { return /* reexport */ card_footer_component; },
+ "CardHeader": function() { return /* reexport */ card_header_component; },
+ "CardMedia": function() { return /* reexport */ card_media_component; },
+ "CheckboxControl": function() { return /* reexport */ CheckboxControl; },
+ "Circle": function() { return /* reexport */ external_wp_primitives_namespaceObject.Circle; },
+ "ClipboardButton": function() { return /* reexport */ ClipboardButton; },
+ "ColorIndicator": function() { return /* reexport */ color_indicator; },
+ "ColorPalette": function() { return /* reexport */ ColorPalette; },
+ "ColorPicker": function() { return /* reexport */ LegacyAdapter; },
+ "ComboboxControl": function() { return /* reexport */ combobox_control; },
+ "CustomGradientPicker": function() { return /* reexport */ CustomGradientPicker; },
+ "CustomSelectControl": function() { return /* reexport */ CustomSelectControl; },
+ "Dashicon": function() { return /* reexport */ dashicon; },
+ "DatePicker": function() { return /* reexport */ date; },
+ "DateTimePicker": function() { return /* reexport */ date_time; },
+ "Disabled": function() { return /* reexport */ disabled; },
+ "Draggable": function() { return /* reexport */ Draggable; },
+ "DropZone": function() { return /* reexport */ DropZoneComponent; },
+ "DropZoneProvider": function() { return /* reexport */ DropZoneProvider; },
+ "Dropdown": function() { return /* reexport */ Dropdown; },
+ "DropdownMenu": function() { return /* reexport */ dropdown_menu; },
+ "DuotonePicker": function() { return /* reexport */ duotone_picker; },
+ "DuotoneSwatch": function() { return /* reexport */ duotone_swatch; },
+ "ExternalLink": function() { return /* reexport */ external_link; },
+ "Fill": function() { return /* reexport */ slot_fill_Fill; },
+ "Flex": function() { return /* reexport */ flex_component; },
+ "FlexBlock": function() { return /* reexport */ flex_block_component; },
+ "FlexItem": function() { return /* reexport */ flex_item_component; },
+ "FocalPointPicker": function() { return /* reexport */ focal_point_picker; },
+ "FocusReturnProvider": function() { return /* reexport */ with_focus_return_Provider; },
+ "FocusableIframe": function() { return /* reexport */ FocusableIframe; },
+ "FontSizePicker": function() { return /* reexport */ font_size_picker; },
+ "FormFileUpload": function() { return /* reexport */ form_file_upload; },
+ "FormToggle": function() { return /* reexport */ form_toggle; },
+ "FormTokenField": function() { return /* reexport */ form_token_field; },
+ "G": function() { return /* reexport */ external_wp_primitives_namespaceObject.G; },
+ "GradientPicker": function() { return /* reexport */ GradientPicker; },
+ "Guide": function() { return /* reexport */ Guide; },
+ "GuidePage": function() { return /* reexport */ GuidePage; },
+ "HorizontalRule": function() { return /* reexport */ external_wp_primitives_namespaceObject.HorizontalRule; },
+ "Icon": function() { return /* reexport */ build_module_icon; },
+ "IconButton": function() { return /* reexport */ deprecated; },
+ "IsolatedEventContainer": function() { return /* reexport */ isolated_event_container; },
+ "KeyboardShortcuts": function() { return /* reexport */ keyboard_shortcuts; },
+ "MenuGroup": function() { return /* reexport */ menu_group; },
+ "MenuItem": function() { return /* reexport */ menu_item; },
+ "MenuItemsChoice": function() { return /* reexport */ MenuItemsChoice; },
+ "Modal": function() { return /* reexport */ Modal; },
+ "NavigableMenu": function() { return /* reexport */ navigable_container_menu; },
+ "Notice": function() { return /* reexport */ build_module_notice; },
+ "NoticeList": function() { return /* reexport */ list; },
+ "Panel": function() { return /* reexport */ panel; },
+ "PanelBody": function() { return /* reexport */ body; },
+ "PanelHeader": function() { return /* reexport */ panel_header; },
+ "PanelRow": function() { return /* reexport */ row; },
+ "Path": function() { return /* reexport */ external_wp_primitives_namespaceObject.Path; },
+ "Placeholder": function() { return /* reexport */ placeholder; },
+ "Polygon": function() { return /* reexport */ external_wp_primitives_namespaceObject.Polygon; },
+ "Popover": function() { return /* reexport */ popover; },
+ "QueryControls": function() { return /* reexport */ QueryControls; },
+ "RadioControl": function() { return /* reexport */ RadioControl; },
+ "RangeControl": function() { return /* reexport */ range_control; },
+ "Rect": function() { return /* reexport */ external_wp_primitives_namespaceObject.Rect; },
+ "ResizableBox": function() { return /* reexport */ resizable_box; },
+ "ResponsiveWrapper": function() { return /* reexport */ responsive_wrapper; },
+ "SVG": function() { return /* reexport */ external_wp_primitives_namespaceObject.SVG; },
+ "SandBox": function() { return /* reexport */ Sandbox; },
+ "ScrollLock": function() { return /* reexport */ ScrollLock; },
+ "SearchControl": function() { return /* reexport */ search_control; },
+ "SelectControl": function() { return /* reexport */ select_control; },
+ "Slot": function() { return /* reexport */ slot_fill_Slot; },
+ "SlotFillProvider": function() { return /* reexport */ Provider; },
+ "Snackbar": function() { return /* reexport */ snackbar; },
+ "SnackbarList": function() { return /* reexport */ snackbar_list; },
+ "Spinner": function() { return /* reexport */ Spinner; },
+ "TabPanel": function() { return /* reexport */ TabPanel; },
+ "TabbableContainer": function() { return /* reexport */ tabbable; },
+ "TextControl": function() { return /* reexport */ text_control; },
+ "TextHighlight": function() { return /* reexport */ text_highlight; },
+ "TextareaControl": function() { return /* reexport */ TextareaControl; },
+ "TimePicker": function() { return /* reexport */ time; },
+ "Tip": function() { return /* reexport */ tip; },
+ "ToggleControl": function() { return /* reexport */ ToggleControl; },
+ "Toolbar": function() { return /* reexport */ toolbar; },
+ "ToolbarButton": function() { return /* reexport */ toolbar_button; },
+ "ToolbarDropdownMenu": function() { return /* reexport */ toolbar_dropdown_menu; },
+ "ToolbarGroup": function() { return /* reexport */ toolbar_group; },
+ "ToolbarItem": function() { return /* reexport */ toolbar_item; },
+ "Tooltip": function() { return /* reexport */ tooltip; },
+ "TreeSelect": function() { return /* reexport */ TreeSelect; },
+ "VisuallyHidden": function() { return /* reexport */ visually_hidden_component; },
+ "__experimentalAlignmentMatrixControl": function() { return /* reexport */ AlignmentMatrixControl; },
+ "__experimentalBoxControl": function() { return /* reexport */ BoxControl; },
+ "__experimentalDimensionControl": function() { return /* reexport */ dimension_control; },
+ "__experimentalDivider": function() { return /* reexport */ divider_component; },
+ "__experimentalElevation": function() { return /* reexport */ elevation_component; },
+ "__experimentalFlyout": function() { return /* reexport */ flyout_component; },
+ "__experimentalGrid": function() { return /* reexport */ grid_component; },
+ "__experimentalHStack": function() { return /* reexport */ h_stack_component; },
+ "__experimentalHeading": function() { return /* reexport */ heading_component; },
+ "__experimentalInputControl": function() { return /* reexport */ input_control; },
+ "__experimentalItem": function() { return /* reexport */ item_component; },
+ "__experimentalItemGroup": function() { return /* reexport */ item_group_component; },
+ "__experimentalNavigation": function() { return /* reexport */ Navigation; },
+ "__experimentalNavigationBackButton": function() { return /* reexport */ back_button; },
+ "__experimentalNavigationGroup": function() { return /* reexport */ NavigationGroup; },
+ "__experimentalNavigationItem": function() { return /* reexport */ NavigationItem; },
+ "__experimentalNavigationMenu": function() { return /* reexport */ NavigationMenu; },
+ "__experimentalNavigatorProvider": function() { return /* reexport */ navigator_provider_component; },
+ "__experimentalNavigatorScreen": function() { return /* reexport */ navigator_screen_component; },
+ "__experimentalNumberControl": function() { return /* reexport */ number_control; },
+ "__experimentalPaletteEdit": function() { return /* reexport */ PaletteEdit; },
+ "__experimentalParseUnit": function() { return /* reexport */ parseUnit; },
+ "__experimentalRadio": function() { return /* reexport */ build_module_radio; },
+ "__experimentalRadioGroup": function() { return /* reexport */ radio_group; },
+ "__experimentalScrollable": function() { return /* reexport */ scrollable_component; },
+ "__experimentalSpacer": function() { return /* reexport */ spacer_component; },
+ "__experimentalStyleProvider": function() { return /* reexport */ StyleProvider; },
+ "__experimentalSurface": function() { return /* reexport */ surface_component; },
+ "__experimentalText": function() { return /* reexport */ text_component; },
+ "__experimentalToggleGroupControl": function() { return /* reexport */ toggle_group_control_component; },
+ "__experimentalToggleGroupControlOption": function() { return /* reexport */ toggle_group_control_option_component; },
+ "__experimentalToolbarContext": function() { return /* reexport */ toolbar_context; },
+ "__experimentalToolsPanel": function() { return /* reexport */ tools_panel_component; },
+ "__experimentalToolsPanelContext": function() { return /* reexport */ ToolsPanelContext; },
+ "__experimentalToolsPanelItem": function() { return /* reexport */ tools_panel_item_component; },
+ "__experimentalTreeGrid": function() { return /* reexport */ tree_grid; },
+ "__experimentalTreeGridCell": function() { return /* reexport */ cell; },
+ "__experimentalTreeGridItem": function() { return /* reexport */ tree_grid_item; },
+ "__experimentalTreeGridRow": function() { return /* reexport */ tree_grid_row; },
+ "__experimentalTruncate": function() { return /* reexport */ truncate_component; },
+ "__experimentalUnitControl": function() { return /* reexport */ unit_control; },
+ "__experimentalUseCustomUnits": function() { return /* reexport */ useCustomUnits; },
+ "__experimentalUseNavigator": function() { return /* reexport */ use_navigator; },
+ "__experimentalUseSlot": function() { return /* reexport */ use_slot_useSlot; },
+ "__experimentalVStack": function() { return /* reexport */ v_stack_component; },
+ "__experimentalView": function() { return /* reexport */ component; },
+ "__experimentalZStack": function() { return /* reexport */ z_stack_component; },
+ "__unstableComposite": function() { return /* reexport */ Composite; },
+ "__unstableCompositeGroup": function() { return /* reexport */ CompositeGroup; },
+ "__unstableCompositeItem": function() { return /* reexport */ CompositeItem; },
+ "__unstableDisclosureContent": function() { return /* reexport */ DisclosureContent; },
+ "__unstableGetAnimateClassName": function() { return /* reexport */ getAnimateClassName; },
+ "__unstableMotion": function() { return /* reexport */ motion; },
+ "__unstableUseAutocompleteProps": function() { return /* reexport */ useAutocompleteProps; },
+ "__unstableUseCompositeState": function() { return /* reexport */ useCompositeState; },
+ "__unstableUseNavigateRegions": function() { return /* reexport */ useNavigateRegions; },
+ "createSlotFill": function() { return /* reexport */ createSlotFill; },
+ "navigateRegions": function() { return /* reexport */ navigate_regions; },
+ "withConstrainedTabbing": function() { return /* reexport */ with_constrained_tabbing; },
+ "withFallbackStyles": function() { return /* reexport */ with_fallback_styles; },
+ "withFilters": function() { return /* reexport */ withFilters; },
+ "withFocusOutside": function() { return /* reexport */ with_focus_outside; },
+ "withFocusReturn": function() { return /* reexport */ with_focus_return; },
+ "withNotices": function() { return /* reexport */ with_notices; },
+ "withSpokenMessages": function() { return /* reexport */ with_spoken_messages; }
+});
+// NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/text/styles.js
+var text_styles_namespaceObject = {};
+__webpack_require__.r(text_styles_namespaceObject);
+__webpack_require__.d(text_styles_namespaceObject, {
+ "Text": function() { return Text; },
+ "block": function() { return styles_block; },
+ "destructive": function() { return destructive; },
+ "highlighterText": function() { return highlighterText; },
+ "muted": function() { return muted; },
+ "positive": function() { return positive; },
+ "upperCase": function() { return upperCase; }
+});
+// NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/ui/tooltip/styles.js
+var tooltip_styles_namespaceObject = {};
+__webpack_require__.r(tooltip_styles_namespaceObject);
+__webpack_require__.d(tooltip_styles_namespaceObject, {
+ "TooltipContent": function() { return TooltipContent; },
+ "TooltipPopoverView": function() { return TooltipPopoverView; },
+ "TooltipShortcut": function() { return TooltipShortcut; },
+ "noOutline": function() { return noOutline; }
+});
+// NAMESPACE OBJECT: ./node_modules/@wordpress/components/build-module/toggle-group-control/toggle-group-control-option/styles.js
+var toggle_group_control_option_styles_namespaceObject = {};
+__webpack_require__.r(toggle_group_control_option_styles_namespaceObject);
+__webpack_require__.d(toggle_group_control_option_styles_namespaceObject, {
+ "ButtonContentView": function() { return ButtonContentView; },
+ "LabelPlaceholderView": function() { return LabelPlaceholderView; },
+ "LabelView": function() { return LabelView; },
+ "buttonActive": function() { return buttonActive; },
+ "buttonView": function() { return buttonView; },
+ "labelBlock": function() { return labelBlock; },
+ "medium": function() { return medium; },
+ "separatorActive": function() { return separatorActive; }
+});
+;// CONCATENATED MODULE: external ["wp","primitives"]
+var external_wp_primitives_namespaceObject = window["wp"]["primitives"];
+;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
+function extends_extends() {
+ extends_extends = Object.assign || function (target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];
-var color_color = {
- test: function (v) { return rgba_rgba.test(v) || hex_hex.test(v) || hsla.test(v); },
- parse: function (v) {
- if (rgba_rgba.test(v)) {
- return rgba_rgba.parse(v);
- }
- else if (hsla.test(v)) {
- return hsla.parse(v);
- }
- else {
- return hex_hex.parse(v);
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
}
- },
- transform: function (v) {
- return isString(v)
- ? v
- : v.hasOwnProperty('red')
- ? rgba_rgba.transform(v)
- : hsla.transform(v);
- },
-};
-
+ }
+ }
+ return target;
+ };
-// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/complex/index.js
+ return extends_extends.apply(this, arguments);
+}
+;// CONCATENATED MODULE: external ["wp","element"]
+var external_wp_element_namespaceObject = window["wp"]["element"];
+;// CONCATENATED MODULE: external "lodash"
+var external_lodash_namespaceObject = window["lodash"];
+// EXTERNAL MODULE: ./node_modules/classnames/index.js
+var classnames = __webpack_require__(4403);
+var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
+;// CONCATENATED MODULE: external ["wp","i18n"]
+var external_wp_i18n_namespaceObject = window["wp"]["i18n"];
+;// CONCATENATED MODULE: external ["wp","compose"]
+var external_wp_compose_namespaceObject = window["wp"]["compose"];
+;// CONCATENATED MODULE: ./node_modules/reakit/es/_rollupPluginBabelHelpers-1f0bf8c2.js
+function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+ return obj;
+}
+function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ if (enumerableOnly) symbols = symbols.filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ keys.push.apply(keys, symbols);
+ }
-var colorToken = '${c}';
-var numberToken = '${n}';
-function complex_test(v) {
- var _a, _b, _c, _d;
- return (isNaN(v) &&
- isString(v) &&
- ((_b = (_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) + ((_d = (_c = v.match(colorRegex)) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0);
-}
-function analyse(v) {
- var values = [];
- var numColors = 0;
- var colors = v.match(colorRegex);
- if (colors) {
- numColors = colors.length;
- v = v.replace(colorRegex, colorToken);
- values.push.apply(values, colors.map(color_color.parse));
- }
- var numbers = v.match(floatRegex);
- if (numbers) {
- v = v.replace(floatRegex, numberToken);
- values.push.apply(values, numbers.map(numbers_number.parse));
- }
- return { values: values, numColors: numColors, tokenised: v };
-}
-function parse(v) {
- return analyse(v).values;
-}
-function createTransformer(v) {
- var _a = analyse(v), values = _a.values, numColors = _a.numColors, tokenised = _a.tokenised;
- var numValues = values.length;
- return function (v) {
- var output = tokenised;
- for (var i = 0; i < numValues; i++) {
- output = output.replace(i < numColors ? colorToken : numberToken, i < numColors ? color_color.transform(v[i]) : utils_sanitize(v[i]));
- }
- return output;
- };
-}
-var convertNumbersToZero = function (v) {
- return typeof v === 'number' ? 0 : v;
-};
-function getAnimatableNone(v) {
- var parsed = parse(v);
- var transformer = createTransformer(v);
- return transformer(parsed.map(convertNumbersToZero));
+ return keys;
}
-var complex = { test: complex_test, parse: parse, createTransformer: createTransformer, getAnimatableNone: getAnimatableNone };
-
+function _objectSpread2(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/inc.js
-var zeroPoint = {
- x: 0,
- y: 0,
- z: 0
-};
-var isNum = function (v) { return typeof v === 'number'; };
+ if (i % 2) {
+ ownKeys(Object(source), true).forEach(function (key) {
+ _defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
+ } else {
+ ownKeys(Object(source)).forEach(function (key) {
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+ });
+ }
+ }
+ return target;
+}
+function _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(source, excluded) {
+ if (source == null) return {};
+ var target = {};
+ var sourceKeys = Object.keys(source);
+ var key, i;
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/mix-complex.js
-
+ for (i = 0; i < sourceKeys.length; i++) {
+ key = sourceKeys[i];
+ if (excluded.indexOf(key) >= 0) continue;
+ target[key] = source[key];
+ }
+ return target;
+}
+function _unsupportedIterableToArray(o, minLen) {
+ if (!o) return;
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
+ var n = Object.prototype.toString.call(o).slice(8, -1);
+ if (n === "Object" && o.constructor) n = o.constructor.name;
+ if (n === "Map" || n === "Set") return Array.from(o);
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
+}
+function _arrayLikeToArray(arr, len) {
+ if (len == null || len > arr.length) len = arr.length;
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
+ return arr2;
+}
+function _createForOfIteratorHelperLoose(o, allowArrayLike) {
+ var it;
-function getMixer(origin, target) {
- if (isNum(origin)) {
- return function (v) { return mix(origin, target, v); };
- }
- else if (color_color.test(origin)) {
- return mixColor(origin, target);
- }
- else {
- return mixComplex(origin, target);
- }
-}
-var mixArray = function (from, to) {
- var output = __spreadArray([], from);
- var numValues = output.length;
- var blendValue = from.map(function (fromThis, i) { return getMixer(fromThis, to[i]); });
- return function (v) {
- for (var i = 0; i < numValues; i++) {
- output[i] = blendValue[i](v);
- }
- return output;
- };
-};
-var mixObject = function (origin, target) {
- var output = __assign(__assign({}, origin), target);
- var blendValue = {};
- for (var key in output) {
- if (origin[key] !== undefined && target[key] !== undefined) {
- blendValue[key] = getMixer(origin[key], target[key]);
- }
- }
- return function (v) {
- for (var key in blendValue) {
- output[key] = blendValue[key](v);
- }
- return output;
- };
-};
-function mix_complex_analyse(value) {
- var parsed = complex.parse(value);
- var numValues = parsed.length;
- var numNumbers = 0;
- var numRGB = 0;
- var numHSL = 0;
- for (var i = 0; i < numValues; i++) {
- if (numNumbers || typeof parsed[i] === "number") {
- numNumbers++;
- }
- else {
- if (parsed[i].hue !== undefined) {
- numHSL++;
- }
- else {
- numRGB++;
- }
- }
+ if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
+ if (it) o = it;
+ var i = 0;
+ return function () {
+ if (i >= o.length) return {
+ done: true
+ };
+ return {
+ done: false,
+ value: o[i++]
+ };
+ };
}
- return { parsed: parsed, numNumbers: numNumbers, numRGB: numRGB, numHSL: numHSL };
-}
-var mixComplex = function (origin, target) {
- var template = complex.createTransformer(target);
- var originStats = mix_complex_analyse(origin);
- var targetStats = mix_complex_analyse(target);
- invariant(originStats.numHSL === targetStats.numHSL &&
- originStats.numRGB === targetStats.numRGB &&
- originStats.numNumbers >= targetStats.numNumbers, "Complex values '" + origin + "' and '" + target + "' too different to mix. Ensure all colors are of the same type.");
- return pipe(mixArray(originStats.parsed, targetStats.parsed), template);
-};
-
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+ }
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/interpolate.js
+ it = o[Symbol.iterator]();
+ return it.next.bind(it);
+}
+// EXTERNAL MODULE: external "React"
+var external_React_ = __webpack_require__(9196);
+var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_);
+;// CONCATENATED MODULE: ./node_modules/reakit-system/es/_rollupPluginBabelHelpers-0c84a174.js
+function _rollupPluginBabelHelpers_0c84a174_defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+ return obj;
+}
+function _rollupPluginBabelHelpers_0c84a174_ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ if (enumerableOnly) symbols = symbols.filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ keys.push.apply(keys, symbols);
+ }
+ return keys;
+}
+function _rollupPluginBabelHelpers_0c84a174_objectSpread2(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
-var mixNumber = function (from, to) { return function (p) { return mix(from, to, p); }; };
-function detectMixerFactory(v) {
- if (typeof v === 'number') {
- return mixNumber;
- }
- else if (typeof v === 'string') {
- if (color_color.test(v)) {
- return mixColor;
- }
- else {
- return mixComplex;
- }
- }
- else if (Array.isArray(v)) {
- return mixArray;
- }
- else if (typeof v === 'object') {
- return mixObject;
+ if (i % 2) {
+ _rollupPluginBabelHelpers_0c84a174_ownKeys(Object(source), true).forEach(function (key) {
+ _rollupPluginBabelHelpers_0c84a174_defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
+ } else {
+ _rollupPluginBabelHelpers_0c84a174_ownKeys(Object(source)).forEach(function (key) {
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+ });
}
+ }
+
+ return target;
}
-function createMixers(output, ease, customMixer) {
- var mixers = [];
- var mixerFactory = customMixer || detectMixerFactory(output[0]);
- var numMixers = output.length - 1;
- for (var i = 0; i < numMixers; i++) {
- var mixer = mixerFactory(output[i], output[i + 1]);
- if (ease) {
- var easingFunction = Array.isArray(ease) ? ease[i] : ease;
- mixer = pipe(easingFunction, mixer);
- }
- mixers.push(mixer);
- }
- return mixers;
+
+function _rollupPluginBabelHelpers_0c84a174_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;
}
-function fastInterpolate(_a, _b) {
- var from = _a[0], to = _a[1];
- var mixer = _b[0];
- return function (v) { return mixer(progress_progress(from, to, v)); };
+
+function _rollupPluginBabelHelpers_0c84a174_unsupportedIterableToArray(o, minLen) {
+ if (!o) return;
+ if (typeof o === "string") return _rollupPluginBabelHelpers_0c84a174_arrayLikeToArray(o, minLen);
+ var n = Object.prototype.toString.call(o).slice(8, -1);
+ if (n === "Object" && o.constructor) n = o.constructor.name;
+ if (n === "Map" || n === "Set") return Array.from(o);
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _rollupPluginBabelHelpers_0c84a174_arrayLikeToArray(o, minLen);
}
-function slowInterpolate(input, mixers) {
- var inputLength = input.length;
- var lastInputIndex = inputLength - 1;
- return function (v) {
- var mixerIndex = 0;
- var foundMixerIndex = false;
- if (v <= input[0]) {
- foundMixerIndex = true;
- }
- else if (v >= input[lastInputIndex]) {
- mixerIndex = lastInputIndex - 1;
- foundMixerIndex = true;
- }
- if (!foundMixerIndex) {
- var i = 1;
- for (; i < inputLength; i++) {
- if (input[i] > v || i === lastInputIndex) {
- break;
- }
- }
- mixerIndex = i - 1;
- }
- var progressInRange = progress_progress(input[mixerIndex], input[mixerIndex + 1], v);
- return mixers[mixerIndex](progressInRange);
- };
+
+function _rollupPluginBabelHelpers_0c84a174_arrayLikeToArray(arr, len) {
+ if (len == null || len > arr.length) len = arr.length;
+
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
+
+ return arr2;
}
-function interpolate(input, output, _a) {
- var _b = _a === void 0 ? {} : _a, _c = _b.clamp, isClamp = _c === void 0 ? true : _c, ease = _b.ease, mixer = _b.mixer;
- var inputLength = input.length;
- invariant(inputLength === output.length, 'Both input and output ranges must be the same length');
- invariant(!ease || !Array.isArray(ease) || ease.length === inputLength - 1, 'Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values.');
- if (input[0] > input[inputLength - 1]) {
- input = [].concat(input);
- output = [].concat(output);
- input.reverse();
- output.reverse();
+
+function _rollupPluginBabelHelpers_0c84a174_createForOfIteratorHelperLoose(o, allowArrayLike) {
+ var it;
+
+ if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
+ if (Array.isArray(o) || (it = _rollupPluginBabelHelpers_0c84a174_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
+ if (it) o = it;
+ var i = 0;
+ return function () {
+ if (i >= o.length) return {
+ done: true
+ };
+ return {
+ done: false,
+ value: o[i++]
+ };
+ };
}
- var mixers = createMixers(output, ease, mixer);
- var interpolator = inputLength === 2
- ? fastInterpolate(input, mixers)
- : slowInterpolate(input, mixers);
- return isClamp
- ? function (v) { return interpolator(clamp_clamp(input[0], input[inputLength - 1], v)); }
- : interpolator;
-}
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+ }
+ it = o[Symbol.iterator]();
+ return it.next.bind(it);
+}
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/easing/utils.js
-var reverseEasing = function (easing) { return function (p) { return 1 - easing(1 - p); }; };
-var mirrorEasing = function (easing) { return function (p) {
- return p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;
-}; };
-var createExpoIn = function (power) { return function (p) { return Math.pow(p, power); }; };
-var createBackIn = function (power) { return function (p) {
- return p * p * ((power + 1) * p - power);
-}; };
-var createAnticipate = function (power) {
- var backEasing = createBackIn(power);
- return function (p) {
- return (p *= 2) < 1
- ? 0.5 * backEasing(p)
- : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));
- };
-};
+;// CONCATENATED MODULE: ./node_modules/reakit-system/es/SystemContext.js
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/easing/index.js
+var SystemContext = /*#__PURE__*/(0,external_React_.createContext)({});
-var DEFAULT_OVERSHOOT_STRENGTH = 1.525;
-var BOUNCE_FIRST_THRESHOLD = 4.0 / 11.0;
-var BOUNCE_SECOND_THRESHOLD = 8.0 / 11.0;
-var BOUNCE_THIRD_THRESHOLD = 9.0 / 10.0;
-var linear = function (p) { return p; };
-var easeIn = createExpoIn(2);
-var easeOut = reverseEasing(easeIn);
-var easeInOut = mirrorEasing(easeIn);
-var circIn = function (p) { return 1 - Math.sin(Math.acos(p)); };
-var circOut = reverseEasing(circIn);
-var circInOut = mirrorEasing(circOut);
-var backIn = createBackIn(DEFAULT_OVERSHOOT_STRENGTH);
-var backOut = reverseEasing(backIn);
-var backInOut = mirrorEasing(backIn);
-var anticipate = createAnticipate(DEFAULT_OVERSHOOT_STRENGTH);
-var ca = 4356.0 / 361.0;
-var easing_cb = 35442.0 / 1805.0;
-var cc = 16061.0 / 1805.0;
-var bounceOut = function (p) {
- if (p === 1 || p === 0)
- return p;
- var p2 = p * p;
- return p < BOUNCE_FIRST_THRESHOLD
- ? 7.5625 * p2
- : p < BOUNCE_SECOND_THRESHOLD
- ? 9.075 * p2 - 9.9 * p + 3.4
- : p < BOUNCE_THIRD_THRESHOLD
- ? ca * p2 - easing_cb * p + cc
- : 10.8 * p * p - 20.52 * p + 10.72;
-};
-var bounceIn = reverseEasing(bounceOut);
-var bounceInOut = function (p) {
- return p < 0.5
- ? 0.5 * (1.0 - bounceOut(1.0 - p * 2.0))
- : 0.5 * bounceOut(p * 2.0 - 1.0) + 0.5;
-};
+;// CONCATENATED MODULE: ./node_modules/reakit-system/es/useCreateElement.js
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/generators/keyframes.js
-function defaultEasing(values, easing) {
- return values.map(function () { return easing || easeInOut; }).splice(0, values.length - 1);
+function isRenderProp(children) {
+ return typeof children === "function";
}
-function defaultOffset(values) {
- var numValues = values.length;
- return values.map(function (_value, i) {
- return i !== 0 ? i / (numValues - 1) : 0;
+
+/**
+ * Custom hook that will call `children` if it's a function. If
+ * `useCreateElement` has been passed to the context, it'll be used instead.
+ *
+ * @example
+ * import React from "react";
+ * import { SystemProvider, useCreateElement } from "reakit-system";
+ *
+ * const system = {
+ * useCreateElement(type, props, children = props.children) {
+ * // very similar to what `useCreateElement` does already
+ * if (typeof children === "function") {
+ * const { children: _, ...rest } = props;
+ * return children(rest);
+ * }
+ * return React.createElement(type, props, children);
+ * },
+ * };
+ *
+ * function Component(props) {
+ * return useCreateElement("div", props);
+ * }
+ *
+ * function App() {
+ * return (
+ * <SystemProvider unstable_system={system}>
+ * <Component url="url">{({ url }) => <a href={url}>link</a>}</Component>
+ * </SystemProvider>
+ * );
+ * }
+ */
+
+var useCreateElement = function useCreateElement(type, props, children) {
+ if (children === void 0) {
+ children = props.children;
+ }
+
+ var context = (0,external_React_.useContext)(SystemContext);
+
+ if (context.useCreateElement) {
+ return context.useCreateElement(type, props, children);
+ }
+
+ if (typeof type === "string" && isRenderProp(children)) {
+ var _ = props.children,
+ rest = _rollupPluginBabelHelpers_0c84a174_objectWithoutPropertiesLoose(props, ["children"]);
+
+ return children(rest);
+ }
+
+ return /*#__PURE__*/(0,external_React_.createElement)(type, props, children);
+};
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/_rollupPluginBabelHelpers-1f0bf8c2.js
+function _rollupPluginBabelHelpers_1f0bf8c2_defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
});
-}
-function convertOffsetToTimes(offset, duration) {
- return offset.map(function (o) { return o * duration; });
-}
-function keyframes(_a) {
- var _b = _a.from, from = _b === void 0 ? 0 : _b, _c = _a.to, to = _c === void 0 ? 1 : _c, ease = _a.ease, offset = _a.offset, _d = _a.duration, duration = _d === void 0 ? 300 : _d;
- var state = { done: false, value: from };
- var values = Array.isArray(to) ? to : [from, to];
- var times = convertOffsetToTimes(offset && offset.length === values.length
- ? offset
- : defaultOffset(values), duration);
- function createInterpolator() {
- return interpolate(times, values, {
- ease: Array.isArray(ease) ? ease : defaultEasing(values, ease),
- });
- }
- var interpolator = createInterpolator();
- return {
- next: function (t) {
- state.value = interpolator(t);
- state.done = t >= duration;
- return state;
- },
- flipTarget: function () {
- values.reverse();
- interpolator = createInterpolator();
- },
- };
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
}
+function _rollupPluginBabelHelpers_1f0bf8c2_ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ if (enumerableOnly) symbols = symbols.filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ });
+ keys.push.apply(keys, symbols);
+ }
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/generators/decay.js
-function decay(_a) {
- var _b = _a.velocity, velocity = _b === void 0 ? 0 : _b, _c = _a.from, from = _c === void 0 ? 0 : _c, _d = _a.power, power = _d === void 0 ? 0.8 : _d, _e = _a.timeConstant, timeConstant = _e === void 0 ? 350 : _e, _f = _a.restDelta, restDelta = _f === void 0 ? 0.5 : _f, modifyTarget = _a.modifyTarget;
- var state = { done: false, value: from };
- var amplitude = power * velocity;
- var ideal = from + amplitude;
- var target = modifyTarget === undefined ? ideal : modifyTarget(ideal);
- if (target !== ideal)
- amplitude = target - from;
- return {
- next: function (t) {
- var delta = -amplitude * Math.exp(-t / timeConstant);
- state.done = !(delta > restDelta || delta < -restDelta);
- state.value = state.done ? target : target + delta;
- return state;
- },
- flipTarget: function () { },
- };
+ return keys;
}
+function _rollupPluginBabelHelpers_1f0bf8c2_objectSpread2(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {};
+ if (i % 2) {
+ _rollupPluginBabelHelpers_1f0bf8c2_ownKeys(Object(source), true).forEach(function (key) {
+ _rollupPluginBabelHelpers_1f0bf8c2_defineProperty(target, key, source[key]);
+ });
+ } else if (Object.getOwnPropertyDescriptors) {
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
+ } else {
+ _rollupPluginBabelHelpers_1f0bf8c2_ownKeys(Object(source)).forEach(function (key) {
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+ });
+ }
+ }
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/utils/detect-animation-from-options.js
+ return target;
+}
+function es_rollupPluginBabelHelpers_1f0bf8c2_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;
+}
-var types = { keyframes: keyframes, spring: spring, decay: decay };
-function detectAnimationFromOptions(config) {
- if (Array.isArray(config.to)) {
- return keyframes;
- }
- else if (types[config.type]) {
- return types[config.type];
- }
- var keys = new Set(Object.keys(config));
- if (keys.has("ease") ||
- (keys.has("duration") && !keys.has("dampingRatio"))) {
- return keyframes;
- }
- else if (keys.has("dampingRatio") ||
- keys.has("stiffness") ||
- keys.has("mass") ||
- keys.has("damping") ||
- keys.has("restSpeed") ||
- keys.has("restDelta")) {
- return spring;
- }
- return keyframes;
+function _rollupPluginBabelHelpers_1f0bf8c2_unsupportedIterableToArray(o, minLen) {
+ if (!o) return;
+ if (typeof o === "string") return _rollupPluginBabelHelpers_1f0bf8c2_arrayLikeToArray(o, minLen);
+ var n = Object.prototype.toString.call(o).slice(8, -1);
+ if (n === "Object" && o.constructor) n = o.constructor.name;
+ if (n === "Map" || n === "Set") return Array.from(o);
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _rollupPluginBabelHelpers_1f0bf8c2_arrayLikeToArray(o, minLen);
}
+function _rollupPluginBabelHelpers_1f0bf8c2_arrayLikeToArray(arr, len) {
+ if (len == null || len > arr.length) len = arr.length;
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
-// CONCATENATED MODULE: ./node_modules/framesync/dist/es/on-next-frame.js
-var defaultTimestep = (1 / 60) * 1000;
-var getCurrentTime = typeof performance !== "undefined"
- ? function () { return performance.now(); }
- : function () { return Date.now(); };
-var onNextFrame = typeof window !== "undefined"
- ? function (callback) {
- return window.requestAnimationFrame(callback);
+ return arr2;
+}
+
+function _rollupPluginBabelHelpers_1f0bf8c2_createForOfIteratorHelperLoose(o, allowArrayLike) {
+ var it;
+
+ if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
+ if (Array.isArray(o) || (it = _rollupPluginBabelHelpers_1f0bf8c2_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
+ if (it) o = it;
+ var i = 0;
+ return function () {
+ if (i >= o.length) return {
+ done: true
+ };
+ return {
+ done: false,
+ value: o[i++]
+ };
+ };
}
- : function (callback) {
- return setTimeout(function () { return callback(getCurrentTime()); }, defaultTimestep);
- };
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+ }
+ it = o[Symbol.iterator]();
+ return it.next.bind(it);
+}
-// CONCATENATED MODULE: ./node_modules/framesync/dist/es/create-render-step.js
-function createRenderStep(runNextFrame) {
- var toRun = [];
- var toRunNextFrame = [];
- var numToRun = 0;
- var isProcessing = false;
- var toKeepAlive = new WeakSet();
- var step = {
- schedule: function (callback, keepAlive, immediate) {
- if (keepAlive === void 0) { keepAlive = false; }
- if (immediate === void 0) { immediate = false; }
- var addToCurrentFrame = immediate && isProcessing;
- var buffer = addToCurrentFrame ? toRun : toRunNextFrame;
- if (keepAlive)
- toKeepAlive.add(callback);
- if (buffer.indexOf(callback) === -1) {
- buffer.push(callback);
- if (addToCurrentFrame && isProcessing)
- numToRun = toRun.length;
- }
- return callback;
- },
- cancel: function (callback) {
- var index = toRunNextFrame.indexOf(callback);
- if (index !== -1)
- toRunNextFrame.splice(index, 1);
- toKeepAlive.delete(callback);
- },
- process: function (frameData) {
- var _a;
- isProcessing = true;
- _a = [toRunNextFrame, toRun], toRun = _a[0], toRunNextFrame = _a[1];
- toRunNextFrame.length = 0;
- numToRun = toRun.length;
- if (numToRun) {
- for (var i = 0; i < numToRun; i++) {
- var callback = toRun[i];
- callback(frameData);
- if (toKeepAlive.has(callback)) {
- step.schedule(callback);
- runNextFrame();
- }
- }
- }
- isProcessing = false;
- },
- };
- return step;
-}
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isObject.js
+/**
+ * Checks whether `arg` is an object or not.
+ *
+ * @returns {boolean}
+ */
+function isObject_isObject(arg) {
+ return typeof arg === "object" && arg != null;
+}
-// CONCATENATED MODULE: ./node_modules/framesync/dist/es/index.js
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isPlainObject.js
-var maxElapsed = 40;
-var useDefaultElapsed = true;
-var runNextFrame = false;
-var isProcessing = false;
-var es_frame = {
- delta: 0,
- timestamp: 0
-};
-var stepsOrder = ["read", "update", "preRender", "render", "postRender"];
-var steps = /*#__PURE__*/stepsOrder.reduce(function (acc, key) {
- acc[key] = createRenderStep(function () {
- return runNextFrame = true;
- });
- return acc;
-}, {});
-var sync = /*#__PURE__*/stepsOrder.reduce(function (acc, key) {
- var step = steps[key];
- acc[key] = function (process, keepAlive, immediate) {
- if (keepAlive === void 0) {
- keepAlive = false;
- }
- if (immediate === void 0) {
- immediate = false;
- }
- if (!runNextFrame) startLoop();
- return step.schedule(process, keepAlive, immediate);
- };
- return acc;
-}, {});
-var cancelSync = /*#__PURE__*/stepsOrder.reduce(function (acc, key) {
- acc[key] = steps[key].cancel;
- return acc;
-}, {});
-var flushSync = /*#__PURE__*/stepsOrder.reduce(function (acc, key) {
- acc[key] = function () {
- return steps[key].process(es_frame);
- };
- return acc;
-}, {});
-var processStep = function (stepId) {
- return steps[stepId].process(es_frame);
-};
-var processFrame = function (timestamp) {
- runNextFrame = false;
- es_frame.delta = useDefaultElapsed ? defaultTimestep : Math.max(Math.min(timestamp - es_frame.timestamp, maxElapsed), 1);
- es_frame.timestamp = timestamp;
- isProcessing = true;
- stepsOrder.forEach(processStep);
- isProcessing = false;
- if (runNextFrame) {
- useDefaultElapsed = false;
- onNextFrame(processFrame);
- }
-};
-var startLoop = function () {
- runNextFrame = true;
- useDefaultElapsed = true;
- if (!isProcessing) onNextFrame(processFrame);
-};
-var getFrameData = function () {
- return es_frame;
-};
-/* harmony default export */ var dist_es = (sync);
+/**
+ * Checks whether `arg` is a plain object or not.
+ *
+ * @returns {boolean}
+ */
+function isPlainObject(arg) {
+ var _proto$constructor;
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/utils/elapsed.js
-function loopElapsed(elapsed, duration, delay) {
- if (delay === void 0) { delay = 0; }
- return elapsed - duration - delay;
-}
-function reverseElapsed(elapsed, duration, delay, isForwardPlayback) {
- if (delay === void 0) { delay = 0; }
- if (isForwardPlayback === void 0) { isForwardPlayback = true; }
- return isForwardPlayback
- ? loopElapsed(duration + -elapsed, duration, delay)
- : duration - (elapsed - duration) + delay;
-}
-function hasRepeatDelayElapsed(elapsed, duration, delay, isForwardPlayback) {
- return isForwardPlayback ? elapsed >= duration + delay : elapsed <= -delay;
+ if (!isObject_isObject(arg)) return false;
+ var proto = Object.getPrototypeOf(arg);
+ if (proto == null) return true;
+ return ((_proto$constructor = proto.constructor) === null || _proto$constructor === void 0 ? void 0 : _proto$constructor.toString()) === Object.toString();
}
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/index.js
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/splitProps.js
+/**
+ * Splits an object (`props`) into a tuple where the first item is an object
+ * with the passed `keys`, and the second item is an object with these keys
+ * omitted.
+ *
+ * @deprecated will be removed in version 2
+ *
+ * @example
+ * import { splitProps } from "reakit-utils";
+ *
+ * splitProps({ a: "a", b: "b" }, ["a"]); // [{ a: "a" }, { b: "b" }]
+ */
+function __deprecatedSplitProps(props, keys) {
+ var propsKeys = Object.keys(props);
+ var picked = {};
+ var omitted = {};
-var framesync = function (update) {
- var passTimestamp = function (_a) {
- var delta = _a.delta;
- return update(delta);
- };
- return {
- start: function () { return dist_es.update(passTimestamp, true); },
- stop: function () { return cancelSync.update(passTimestamp); },
- };
-};
-function animations_animate(_a) {
- var _b, _c;
- var from = _a.from, _d = _a.autoplay, autoplay = _d === void 0 ? true : _d, _e = _a.driver, driver = _e === void 0 ? framesync : _e, _f = _a.elapsed, elapsed = _f === void 0 ? 0 : _f, _g = _a.repeat, repeatMax = _g === void 0 ? 0 : _g, _h = _a.repeatType, repeatType = _h === void 0 ? "loop" : _h, _j = _a.repeatDelay, repeatDelay = _j === void 0 ? 0 : _j, onPlay = _a.onPlay, onStop = _a.onStop, onComplete = _a.onComplete, onRepeat = _a.onRepeat, onUpdate = _a.onUpdate, options = __rest(_a, ["from", "autoplay", "driver", "elapsed", "repeat", "repeatType", "repeatDelay", "onPlay", "onStop", "onComplete", "onRepeat", "onUpdate"]);
- var to = options.to;
- var driverControls;
- var repeatCount = 0;
- var computedDuration = options.duration;
- var latest;
- var isComplete = false;
- var isForwardPlayback = true;
- var interpolateFromNumber;
- var animator = detectAnimationFromOptions(options);
- if ((_c = (_b = animator).needsInterpolation) === null || _c === void 0 ? void 0 : _c.call(_b, from, to)) {
- interpolateFromNumber = interpolate([0, 100], [from, to], {
- clamp: false,
- });
- from = 0;
- to = 100;
- }
- var animation = animator(__assign(__assign({}, options), { from: from, to: to }));
- function repeat() {
- repeatCount++;
- if (repeatType === "reverse") {
- isForwardPlayback = repeatCount % 2 === 0;
- elapsed = reverseElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback);
- }
- else {
- elapsed = loopElapsed(elapsed, computedDuration, repeatDelay);
- if (repeatType === "mirror")
- animation.flipTarget();
- }
- isComplete = false;
- onRepeat && onRepeat();
- }
- function complete() {
- driverControls.stop();
- onComplete && onComplete();
- }
- function update(delta) {
- if (!isForwardPlayback)
- delta = -delta;
- elapsed += delta;
- if (!isComplete) {
- var state = animation.next(Math.max(0, elapsed));
- latest = state.value;
- if (interpolateFromNumber)
- latest = interpolateFromNumber(latest);
- isComplete = isForwardPlayback ? state.done : elapsed <= 0;
- }
- onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(latest);
- if (isComplete) {
- if (repeatCount === 0)
- computedDuration !== null && computedDuration !== void 0 ? computedDuration : (computedDuration = elapsed);
- if (repeatCount < repeatMax) {
- hasRepeatDelayElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback) && repeat();
- }
- else {
- complete();
- }
- }
- }
- function play() {
- onPlay === null || onPlay === void 0 ? void 0 : onPlay();
- driverControls = driver(update);
- driverControls.start();
+ for (var _i = 0, _propsKeys = propsKeys; _i < _propsKeys.length; _i++) {
+ var key = _propsKeys[_i];
+
+ if (keys.indexOf(key) >= 0) {
+ picked[key] = props[key];
+ } else {
+ omitted[key] = props[key];
}
- autoplay && play();
- return {
- stop: function () {
- onStop === null || onStop === void 0 ? void 0 : onStop();
- driverControls.stop();
- },
- };
+ }
+
+ return [picked, omitted];
}
+/**
+ * Splits an object (`props`) into a tuple where the first item
+ * is the `state` property, and the second item is the rest of the properties.
+ *
+ * It is also backward compatible with version 1. If `keys` are passed then
+ * splits an object (`props`) into a tuple where the first item is an object
+ * with the passed `keys`, and the second item is an object with these keys
+ * omitted.
+ *
+ * @example
+ * import { splitProps } from "reakit-utils";
+ *
+ * splitProps({ a: "a", b: "b" }, ["a"]); // [{ a: "a" }, { b: "b" }]
+ *
+ * @example
+ * import { splitProps } from "reakit-utils";
+ *
+ * splitProps({ state: { a: "a" }, b: "b" }); // [{ a: "a" }, { b: "b" }]
+ */
+function splitProps(props, keys) {
+ if (keys === void 0) {
+ keys = [];
+ }
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/velocity-per-second.js
-function velocityPerSecond(velocity, frameDuration) {
- return frameDuration ? velocity * (1000 / frameDuration) : 0;
-}
+ if (!isPlainObject(props.state)) {
+ return __deprecatedSplitProps(props, keys);
+ }
+ var _deprecatedSplitProp = __deprecatedSplitProps(props, [].concat(keys, ["state"])),
+ picked = _deprecatedSplitProp[0],
+ omitted = _deprecatedSplitProp[1];
+ var state = picked.state,
+ restPicked = es_rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(picked, ["state"]);
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/animations/inertia.js
+ return [_rollupPluginBabelHelpers_1f0bf8c2_objectSpread2(_rollupPluginBabelHelpers_1f0bf8c2_objectSpread2({}, state), restPicked), omitted];
+}
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/shallowEqual.js
+/**
+ * Compares two objects.
+ *
+ * @example
+ * import { shallowEqual } from "reakit-utils";
+ *
+ * shallowEqual({ a: "a" }, {}); // false
+ * shallowEqual({ a: "a" }, { b: "b" }); // false
+ * shallowEqual({ a: "a" }, { a: "a" }); // true
+ * shallowEqual({ a: "a" }, { a: "a", b: "b" }); // false
+ */
+function shallowEqual(objA, objB) {
+ if (objA === objB) return true;
+ if (!objA) return false;
+ if (!objB) return false;
+ if (typeof objA !== "object") return false;
+ if (typeof objB !== "object") return false;
+ var aKeys = Object.keys(objA);
+ var bKeys = Object.keys(objB);
+ var length = aKeys.length;
+ if (bKeys.length !== length) return false;
+ for (var _i = 0, _aKeys = aKeys; _i < _aKeys.length; _i++) {
+ var key = _aKeys[_i];
-function inertia_inertia(_a) {
- var _b = _a.from, from = _b === void 0 ? 0 : _b, _c = _a.velocity, velocity = _c === void 0 ? 0 : _c, min = _a.min, max = _a.max, _d = _a.power, power = _d === void 0 ? 0.8 : _d, _e = _a.timeConstant, timeConstant = _e === void 0 ? 750 : _e, _f = _a.bounceStiffness, bounceStiffness = _f === void 0 ? 500 : _f, _g = _a.bounceDamping, bounceDamping = _g === void 0 ? 10 : _g, _h = _a.restDelta, restDelta = _h === void 0 ? 1 : _h, modifyTarget = _a.modifyTarget, driver = _a.driver, onUpdate = _a.onUpdate, onComplete = _a.onComplete;
- var currentAnimation;
- function isOutOfBounds(v) {
- return (min !== undefined && v < min) || (max !== undefined && v > max);
- }
- function boundaryNearest(v) {
- if (min === undefined)
- return max;
- if (max === undefined)
- return min;
- return Math.abs(min - v) < Math.abs(max - v) ? min : max;
- }
- function startAnimation(options) {
- currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.stop();
- currentAnimation = animations_animate(__assign(__assign({}, options), { driver: driver, onUpdate: function (v) {
- var _a;
- onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(v);
- (_a = options.onUpdate) === null || _a === void 0 ? void 0 : _a.call(options, v);
- }, onComplete: onComplete }));
- }
- function startSpring(options) {
- startAnimation(__assign({ type: "spring", stiffness: bounceStiffness, damping: bounceDamping, restDelta: restDelta }, options));
- }
- if (isOutOfBounds(from)) {
- startSpring({ from: from, velocity: velocity, to: boundaryNearest(from) });
- }
- else {
- var target = power * velocity + from;
- if (typeof modifyTarget !== "undefined")
- target = modifyTarget(target);
- var boundary_1 = boundaryNearest(target);
- var heading_1 = boundary_1 === min ? -1 : 1;
- var prev_1;
- var current_1;
- var checkBoundary = function (v) {
- prev_1 = current_1;
- current_1 = v;
- velocity = velocityPerSecond(v - prev_1, getFrameData().delta);
- if ((heading_1 === 1 && v > boundary_1) ||
- (heading_1 === -1 && v < boundary_1)) {
- startSpring({ from: v, to: boundary_1, velocity: velocity });
- }
- };
- startAnimation({
- type: "decay",
- from: from,
- velocity: velocity,
- timeConstant: timeConstant,
- power: power,
- restDelta: restDelta,
- modifyTarget: modifyTarget,
- onUpdate: isOutOfBounds(target) ? checkBoundary : undefined,
- });
+ if (objA[key] !== objB[key]) {
+ return false;
}
- return {
- stop: function () { return currentAnimation === null || currentAnimation === void 0 ? void 0 : currentAnimation.stop(); },
- };
+ }
+
+ return true;
}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/time-conversion.js
-/**
- * Converts seconds to milliseconds
- *
- * @param seconds - Time in seconds.
- * @return milliseconds - Converted time in milliseconds.
- */
-var secondsToMilliseconds = function (seconds) { return seconds * 1000; };
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/normalizePropsAreEqual.js
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/easing/cubic-bezier.js
+/**
+ * This higher order functions take `propsAreEqual` function and
+ * returns a new function which normalizes the props.
+ *
+ * Normalizing in our case is making sure the `propsAreEqual` works with
+ * both version 1 (object spreading) and version 2 (state object) state passing.
+ *
+ * To achieve this, the returned function in case of a state object
+ * will spread the state object in both `prev` and `next props.
+ *
+ * Other case it just returns the function as is which makes sure
+ * that we are still backward compatible
+ */
+function normalizePropsAreEqual(propsAreEqual) {
+ if (propsAreEqual.name === "normalizePropsAreEqualInner") {
+ return propsAreEqual;
+ }
-var cubic_bezier_a = function (a1, a2) { return 1.0 - 3.0 * a2 + 3.0 * a1; };
-var cubic_bezier_b = function (a1, a2) { return 3.0 * a2 - 6.0 * a1; };
-var cubic_bezier_c = function (a1) { return 3.0 * a1; };
-var calcBezier = function (t, a1, a2) {
- return ((cubic_bezier_a(a1, a2) * t + cubic_bezier_b(a1, a2)) * t + cubic_bezier_c(a1)) * t;
-};
-var getSlope = function (t, a1, a2) {
- return 3.0 * cubic_bezier_a(a1, a2) * t * t + 2.0 * cubic_bezier_b(a1, a2) * t + cubic_bezier_c(a1);
-};
-var subdivisionPrecision = 0.0000001;
-var subdivisionMaxIterations = 10;
-function binarySubdivide(aX, aA, aB, mX1, mX2) {
- var currentX;
- var currentT;
- var i = 0;
- do {
- currentT = aA + (aB - aA) / 2.0;
- currentX = calcBezier(currentT, mX1, mX2) - aX;
- if (currentX > 0.0) {
- aB = currentT;
- }
- else {
- aA = currentT;
- }
- } while (Math.abs(currentX) > subdivisionPrecision &&
- ++i < subdivisionMaxIterations);
- return currentT;
-}
-var newtonIterations = 8;
-var newtonMinSlope = 0.001;
-function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
- for (var i = 0; i < newtonIterations; ++i) {
- var currentSlope = getSlope(aGuessT, mX1, mX2);
- if (currentSlope === 0.0) {
- return aGuessT;
- }
- var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
- aGuessT -= currentX / currentSlope;
- }
- return aGuessT;
-}
-var kSplineTableSize = 11;
-var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
-function cubicBezier(mX1, mY1, mX2, mY2) {
- if (mX1 === mY1 && mX2 === mY2)
- return linear;
- var sampleValues = new Float32Array(kSplineTableSize);
- for (var i = 0; i < kSplineTableSize; ++i) {
- sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
- }
- function getTForX(aX) {
- var intervalStart = 0.0;
- var currentSample = 1;
- var lastSample = kSplineTableSize - 1;
- for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
- intervalStart += kSampleStepSize;
- }
- --currentSample;
- var dist = (aX - sampleValues[currentSample]) /
- (sampleValues[currentSample + 1] - sampleValues[currentSample]);
- var guessForT = intervalStart + dist * kSampleStepSize;
- var initialSlope = getSlope(guessForT, mX1, mX2);
- if (initialSlope >= newtonMinSlope) {
- return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
- }
- else if (initialSlope === 0.0) {
- return guessForT;
- }
- else {
- return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
- }
+ return function normalizePropsAreEqualInner(prev, next) {
+ if (!isPlainObject(prev.state) || !isPlainObject(next.state)) {
+ return propsAreEqual(prev, next);
}
- return function (t) {
- return t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2);
- };
+
+ return propsAreEqual(_rollupPluginBabelHelpers_1f0bf8c2_objectSpread2(_rollupPluginBabelHelpers_1f0bf8c2_objectSpread2({}, prev.state), prev), _rollupPluginBabelHelpers_1f0bf8c2_objectSpread2(_rollupPluginBabelHelpers_1f0bf8c2_objectSpread2({}, next.state), next));
+ };
}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/easing.js
+;// CONCATENATED MODULE: ./node_modules/reakit-system/es/createComponent.js
+
-var easingLookup = {
- linear: linear,
- easeIn: easeIn,
- easeInOut: easeInOut,
- easeOut: easeOut,
- circIn: circIn,
- circInOut: circInOut,
- circOut: circOut,
- backIn: backIn,
- backInOut: backInOut,
- backOut: backOut,
- anticipate: anticipate,
- bounceIn: bounceIn,
- bounceInOut: bounceInOut,
- bounceOut: bounceOut,
-};
-var easingDefinitionToFunction = function (definition) {
- if (Array.isArray(definition)) {
- // If cubic bezier definition, create bezier curve
- invariant(definition.length === 4, "Cubic bezier arrays must contain four numerical values.");
- var _a = __read(definition, 4), x1 = _a[0], y1 = _a[1], x2 = _a[2], y2 = _a[3];
- return cubicBezier(x1, y1, x2, y2);
- }
- else if (typeof definition === "string") {
- // Else lookup from table
- invariant(easingLookup[definition] !== undefined, "Invalid easing type '" + definition + "'");
- return easingLookup[definition];
- }
- return definition;
-};
-var isEasingArray = function (ease) {
- return Array.isArray(ease) && typeof ease[0] !== "number";
-};
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/is-animatable.js
+function createComponent_forwardRef(component) {
+ return /*#__PURE__*/(0,external_React_.forwardRef)(component);
+}
+function memo(component, propsAreEqual) {
+ return /*#__PURE__*/(0,external_React_.memo)(component, propsAreEqual);
+}
/**
- * Check if a value is animatable. Examples:
+ * Creates a React component.
*
- * ✅: 100, "100px", "#fff"
- * ❌: "block", "url(2.jpg)"
- * @param value
+ * @example
+ * import { createComponent } from "reakit-system";
*
- * @internal
+ * const A = createComponent({ as: "a" });
+ *
+ * @param options
*/
-var isAnimatable = function (key, value) {
- // If the list of keys tat might be non-animatable grows, replace with Set
- if (key === "zIndex")
- return false;
- // If it's a number or a keyframes array, we can animate it. We might at some point
- // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this,
- // but for now lets leave it like this for performance reasons
- if (typeof value === "number" || Array.isArray(value))
- return true;
- if (typeof value === "string" && // It's animatable if we have a string
- complex.test(value) && // And it contains numbers and/or colors
- !value.startsWith("url(") // Unless it starts with "url("
- ) {
- return true;
- }
- return false;
-};
+function createComponent(_ref) {
+ var type = _ref.as,
+ useHook = _ref.useHook,
+ shouldMemo = _ref.memo,
+ _ref$propsAreEqual = _ref.propsAreEqual,
+ propsAreEqual = _ref$propsAreEqual === void 0 ? useHook === null || useHook === void 0 ? void 0 : useHook.unstable_propsAreEqual : _ref$propsAreEqual,
+ _ref$keys = _ref.keys,
+ keys = _ref$keys === void 0 ? (useHook === null || useHook === void 0 ? void 0 : useHook.__keys) || [] : _ref$keys,
+ _ref$useCreateElement = _ref.useCreateElement,
+ useCreateElement$1 = _ref$useCreateElement === void 0 ? useCreateElement : _ref$useCreateElement;
+ var Comp = function Comp(_ref2, ref) {
+ var _ref2$as = _ref2.as,
+ as = _ref2$as === void 0 ? type : _ref2$as,
+ props = _rollupPluginBabelHelpers_0c84a174_objectWithoutPropertiesLoose(_ref2, ["as"]);
+ if (useHook) {
+ var _as$render;
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/default-transitions.js
+ var _splitProps = splitProps(props, keys),
+ _options = _splitProps[0],
+ htmlProps = _splitProps[1];
+ var _useHook = useHook(_options, _rollupPluginBabelHelpers_0c84a174_objectSpread2({
+ ref: ref
+ }, htmlProps)),
+ wrapElement = _useHook.wrapElement,
+ elementProps = _rollupPluginBabelHelpers_0c84a174_objectWithoutPropertiesLoose(_useHook, ["wrapElement"]); // @ts-ignore
-var underDampedSpring = function () { return ({
- type: "spring",
- stiffness: 500,
- damping: 25,
- restDelta: 0.5,
- restSpeed: 10,
-}); };
-var criticallyDampedSpring = function (to) { return ({
- type: "spring",
- stiffness: 550,
- damping: to === 0 ? 2 * Math.sqrt(550) : 30,
- restDelta: 0.01,
- restSpeed: 10,
-}); };
-var linearTween = function () { return ({
- type: "keyframes",
- ease: "linear",
- duration: 0.3,
-}); };
-var default_transitions_keyframes = function (values) { return ({
- type: "keyframes",
- duration: 0.8,
- values: values,
-}); };
-var defaultTransitions = {
- x: underDampedSpring,
- y: underDampedSpring,
- z: underDampedSpring,
- rotate: underDampedSpring,
- rotateX: underDampedSpring,
- rotateY: underDampedSpring,
- rotateZ: underDampedSpring,
- scaleX: criticallyDampedSpring,
- scaleY: criticallyDampedSpring,
- scale: criticallyDampedSpring,
- opacity: linearTween,
- backgroundColor: linearTween,
- color: linearTween,
- default: criticallyDampedSpring,
-};
-var getDefaultTransition = function (valueKey, to) {
- var transitionFactory;
- if (isKeyframesTarget(to)) {
- transitionFactory = default_transitions_keyframes;
- }
- else {
- transitionFactory =
- defaultTransitions[valueKey] || defaultTransitions.default;
- }
- return __assign({ to: to }, transitionFactory(to));
-};
+ var asKeys = ((_as$render = as.render) === null || _as$render === void 0 ? void 0 : _as$render.__keys) || as.__keys;
+ var asOptions = asKeys && splitProps(props, asKeys)[0];
+ var allProps = asOptions ? _rollupPluginBabelHelpers_0c84a174_objectSpread2(_rollupPluginBabelHelpers_0c84a174_objectSpread2({}, elementProps), asOptions) : elementProps;
+
+ var _element = useCreateElement$1(as, allProps);
+ if (wrapElement) {
+ return wrapElement(_element);
+ }
+ return _element;
+ }
-// CONCATENATED MODULE: ./node_modules/style-value-types/dist/es/complex/filter.js
+ return useCreateElement$1(as, _rollupPluginBabelHelpers_0c84a174_objectSpread2({
+ ref: ref
+ }, props));
+ };
+ if (false) {}
+ Comp = createComponent_forwardRef(Comp);
+ if (shouldMemo) {
+ Comp = memo(Comp, propsAreEqual && normalizePropsAreEqual(propsAreEqual));
+ }
-var maxDefaults = new Set(['brightness', 'contrast', 'saturate', 'opacity']);
-function applyDefaultFilter(v) {
- var _a = v.slice(0, -1).split('('), name = _a[0], value = _a[1];
- if (name === 'drop-shadow')
- return v;
- var number = (value.match(floatRegex) || [])[0];
- if (!number)
- return v;
- var unit = value.replace(number, '');
- var defaultValue = maxDefaults.has(name) ? 1 : 0;
- if (number !== value)
- defaultValue *= 100;
- return name + '(' + defaultValue + unit + ')';
+ Comp.__keys = keys;
+ Comp.unstable_propsAreEqual = normalizePropsAreEqual(propsAreEqual || shallowEqual);
+ return Comp;
}
-var functionRegex = /([a-z-]*)\(.*?\)/g;
-var filter = __assign(__assign({}, complex), { getAnimatableNone: function (v) {
- var functions = v.match(functionRegex);
- return functions ? functions.map(applyDefaultFilter).join(' ') : v;
- } });
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/defaults.js
+;// CONCATENATED MODULE: ./node_modules/reakit-system/es/useToken.js
-
-/**
- * A map of default value types for common values
- */
-var defaultValueTypes = __assign(__assign({}, numberValueTypes), {
- // Color props
- color: color_color, backgroundColor: color_color, outlineColor: color_color, fill: color_color, stroke: color_color,
- // Border props
- borderColor: color_color, borderTopColor: color_color, borderRightColor: color_color, borderBottomColor: color_color, borderLeftColor: color_color, filter: filter, WebkitFilter: filter });
/**
- * Gets the default ValueType for the provided value key
+ * React custom hook that returns the value of any token defined in the
+ * SystemContext. It's mainly used internally in [`useOptions`](#useoptions)
+ * and [`useProps`](#useprops).
+ *
+ * @example
+ * import { SystemProvider, useToken } from "reakit-system";
+ *
+ * const system = {
+ * token: "value",
+ * };
+ *
+ * function Component(props) {
+ * const token = useToken("token", "default value");
+ * return <div {...props}>{token}</div>;
+ * }
+ *
+ * function App() {
+ * return (
+ * <SystemProvider unstable_system={system}>
+ * <Component />
+ * </SystemProvider>
+ * );
+ * }
*/
-var getDefaultValueType = function (key) { return defaultValueTypes[key]; };
+function useToken(token, defaultValue) {
+ (0,external_React_.useDebugValue)(token);
+ var context = (0,external_React_.useContext)(SystemContext);
+ return context[token] != null ? context[token] : defaultValue;
+}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.js
+;// CONCATENATED MODULE: ./node_modules/reakit-system/es/useProps.js
-function animatable_none_getAnimatableNone(key, value) {
- var _a;
- var defaultValueType = getDefaultValueType(key);
- if (defaultValueType !== filter)
- defaultValueType = complex;
- // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target
- return (_a = defaultValueType.getAnimatableNone) === null || _a === void 0 ? void 0 : _a.call(defaultValueType, value);
-}
+/**
+ * React custom hook that returns the props returned by a given
+ * `use${name}Props` in the SystemContext.
+ *
+ * @example
+ * import { SystemProvider, useProps } from "reakit-system";
+ *
+ * const system = {
+ * useAProps(options, htmlProps) {
+ * return {
+ * ...htmlProps,
+ * href: options.url,
+ * };
+ * },
+ * };
+ *
+ * function A({ url, ...htmlProps }) {
+ * const props = useProps("A", { url }, htmlProps);
+ * return <a {...props} />;
+ * }
+ *
+ * function App() {
+ * return (
+ * <SystemProvider unstable_system={system}>
+ * <A url="url">It will convert url into href in useAProps</A>
+ * </SystemProvider>
+ * );
+ * }
+ */
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/animation/utils/transitions.js
+function useProps(name, options, htmlProps) {
+ if (options === void 0) {
+ options = {};
+ }
+ if (htmlProps === void 0) {
+ htmlProps = {};
+ }
+ var hookName = "use" + name + "Props";
+ (0,external_React_.useDebugValue)(hookName);
+ var useHook = useToken(hookName);
+ if (useHook) {
+ return useHook(options, htmlProps);
+ }
+ return htmlProps;
+}
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit-system/es/useOptions.js
/**
- * Decide whether a transition is defined on a given Transition.
- * This filters out orchestration options and returns true
- * if any options are left.
- */
-function isTransitionDefined(_a) {
- _a.when; _a.delay; _a.delayChildren; _a.staggerChildren; _a.staggerDirection; _a.repeat; _a.repeatType; _a.repeatDelay; _a.from; var transition = __rest(_a, ["when", "delay", "delayChildren", "staggerChildren", "staggerDirection", "repeat", "repeatType", "repeatDelay", "from"]);
- return !!Object.keys(transition).length;
-}
-var legacyRepeatWarning = false;
-/**
- * Convert Framer Motion's Transition type into Popmotion-compatible options.
- */
-function convertTransitionToAnimationOptions(_a) {
- var ease = _a.ease, times = _a.times, yoyo = _a.yoyo, flip = _a.flip, loop = _a.loop, transition = __rest(_a, ["ease", "times", "yoyo", "flip", "loop"]);
- var options = __assign({}, transition);
- if (times)
- options["offset"] = times;
- /**
- * Convert any existing durations from seconds to milliseconds
- */
- if (transition.duration)
- options["duration"] = secondsToMilliseconds(transition.duration);
- if (transition.repeatDelay)
- options.repeatDelay = secondsToMilliseconds(transition.repeatDelay);
- /**
- * Map easing names to Popmotion's easing functions
- */
- if (ease) {
- options["ease"] = isEasingArray(ease)
- ? ease.map(easingDefinitionToFunction)
- : easingDefinitionToFunction(ease);
- }
- /**
- * Support legacy transition API
- */
- if (transition.type === "tween")
- options.type = "keyframes";
- /**
- * TODO: These options are officially removed from the API.
- */
- if (yoyo || loop || flip) {
- warning(!legacyRepeatWarning, "yoyo, loop and flip have been removed from the API. Replace with repeat and repeatType options.");
- legacyRepeatWarning = true;
- if (yoyo) {
- options.repeatType = "reverse";
- }
- else if (loop) {
- options.repeatType = "loop";
- }
- else if (flip) {
- options.repeatType = "mirror";
- }
- options.repeat = loop || yoyo || flip || transition.repeat;
- }
- /**
- * TODO: Popmotion 9 has the ability to automatically detect whether to use
- * a keyframes or spring animation, but does so by detecting velocity and other spring options.
- * It'd be good to introduce a similar thing here.
- */
- if (transition.type !== "spring")
- options.type = "keyframes";
- return options;
-}
-/**
- * Get the delay for a value by checking Transition with decreasing specificity.
- */
-function getDelayFromTransition(transition, key) {
- var _a;
- var valueTransition = getValueTransition(transition, key) || {};
- return (_a = valueTransition.delay) !== null && _a !== void 0 ? _a : 0;
-}
-function hydrateKeyframes(options) {
- if (Array.isArray(options.to) && options.to[0] === null) {
- options.to = __spreadArray([], __read(options.to));
- options.to[0] = options.from;
- }
- return options;
-}
-function getPopmotionAnimationOptions(transition, options, key) {
- var _a;
- if (Array.isArray(options.to)) {
- (_a = transition.duration) !== null && _a !== void 0 ? _a : (transition.duration = 0.8);
- }
- hydrateKeyframes(options);
- /**
- * Get a default transition if none is determined to be defined.
- */
- if (!isTransitionDefined(transition)) {
- transition = __assign(__assign({}, transition), getDefaultTransition(key, options.to));
- }
- return __assign(__assign({}, options), convertTransitionToAnimationOptions(transition));
-}
-/**
+ * React custom hook that returns the options returned by a given
+ * `use${name}Options` in the SystemContext.
*
- */
-function transitions_getAnimation(key, value, target, transition, onComplete) {
- var _a;
- var valueTransition = getValueTransition(transition, key);
- var origin = (_a = valueTransition.from) !== null && _a !== void 0 ? _a : value.get();
- var isTargetAnimatable = isAnimatable(key, target);
- if (origin === "none" && isTargetAnimatable && typeof target === "string") {
- /**
- * If we're trying to animate from "none", try and get an animatable version
- * of the target. This could be improved to work both ways.
- */
- origin = animatable_none_getAnimatableNone(key, target);
- }
- else if (isZero(origin) && typeof target === "string") {
- origin = getZeroUnit(target);
- }
- else if (!Array.isArray(target) &&
- isZero(target) &&
- typeof origin === "string") {
- target = getZeroUnit(origin);
- }
- var isOriginAnimatable = isAnimatable(key, origin);
- warning(isOriginAnimatable === isTargetAnimatable, "You are trying to animate " + key + " from \"" + origin + "\" to \"" + target + "\". " + origin + " is not an animatable value - to enable this animation set " + origin + " to a value animatable to " + target + " via the `style` property.");
- function start() {
- var options = {
- from: origin,
- to: target,
- velocity: value.getVelocity(),
- onComplete: onComplete,
- onUpdate: function (v) { return value.set(v); },
- };
- return valueTransition.type === "inertia" ||
- valueTransition.type === "decay"
- ? inertia_inertia(__assign(__assign({}, options), valueTransition))
- : animations_animate(__assign(__assign({}, getPopmotionAnimationOptions(valueTransition, options, key)), { onUpdate: function (v) {
- var _a;
- options.onUpdate(v);
- (_a = valueTransition.onUpdate) === null || _a === void 0 ? void 0 : _a.call(valueTransition, v);
- }, onComplete: function () {
- var _a;
- options.onComplete();
- (_a = valueTransition.onComplete) === null || _a === void 0 ? void 0 : _a.call(valueTransition);
- } }));
- }
- function set() {
- var _a;
- value.set(target);
- onComplete();
- (_a = valueTransition === null || valueTransition === void 0 ? void 0 : valueTransition.onComplete) === null || _a === void 0 ? void 0 : _a.call(valueTransition);
- return { stop: function () { } };
- }
- return !isOriginAnimatable ||
- !isTargetAnimatable ||
- valueTransition.type === false
- ? set
- : start;
-}
-function isZero(value) {
- return (value === 0 ||
- (typeof value === "string" &&
- parseFloat(value) === 0 &&
- value.indexOf(" ") === -1));
-}
-function getZeroUnit(potentialUnitType) {
- return typeof potentialUnitType === "number"
- ? 0
- : animatable_none_getAnimatableNone("", potentialUnitType);
-}
-function getValueTransition(transition, key) {
- return transition[key] || transition["default"] || transition;
-}
-/**
- * Start animation on a MotionValue. This function is an interface between
- * Framer Motion and Popmotion
+ * @example
+ * import React from "react";
+ * import { SystemProvider, useOptions } from "reakit-system";
*
- * @internal
+ * const system = {
+ * useAOptions(options, htmlProps) {
+ * return {
+ * ...options,
+ * url: htmlProps.href,
+ * };
+ * },
+ * };
+ *
+ * function A({ url, ...htmlProps }) {
+ * const options = useOptions("A", { url }, htmlProps);
+ * return <a href={options.url} {...htmlProps} />;
+ * }
+ *
+ * function App() {
+ * return (
+ * <SystemProvider unstable_system={system}>
+ * <A href="url">
+ * It will convert href into url in useAOptions and then url into href in A
+ * </A>
+ * </SystemProvider>
+ * );
+ * }
*/
-function transitions_startAnimation(key, value, target, transition) {
- if (transition === void 0) { transition = {}; }
- return value.start(function (onComplete) {
- var delayTimer;
- var controls;
- var animation = transitions_getAnimation(key, value, target, transition, onComplete);
- var delay = getDelayFromTransition(transition, key);
- var start = function () { return (controls = animation()); };
- if (delay) {
- delayTimer = setTimeout(start, secondsToMilliseconds(delay));
- }
- else {
- start();
- }
- return function () {
- clearTimeout(delayTimer);
- controls === null || controls === void 0 ? void 0 : controls.stop();
- };
- });
+
+function useOptions(name, options, htmlProps) {
+ if (options === void 0) {
+ options = {};
+ }
+
+ if (htmlProps === void 0) {
+ htmlProps = {};
+ }
+
+ var hookName = "use" + name + "Options";
+ (0,external_React_.useDebugValue)(hookName);
+ var useHook = useToken(hookName);
+
+ if (useHook) {
+ return _rollupPluginBabelHelpers_0c84a174_objectSpread2(_rollupPluginBabelHelpers_0c84a174_objectSpread2({}, options), useHook(options, htmlProps));
+ }
+
+ return options;
}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/is-numerical-string.js
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/toArray.js
/**
- * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1"
+ * Transforms `arg` into an array if it's not already.
+ *
+ * @example
+ * import { toArray } from "reakit-utils";
+ *
+ * toArray("a"); // ["a"]
+ * toArray(["a"]); // ["a"]
*/
-var isNumericalString = function (v) { return /^\-?\d*\.?\d+$/.test(v); };
-
-
+function toArray(arg) {
+ if (Array.isArray(arg)) {
+ return arg;
+ }
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/array.js
-function addUniqueItem(arr, item) {
- arr.indexOf(item) === -1 && arr.push(item);
-}
-function array_removeItem(arr, item) {
- var index = arr.indexOf(item);
- index > -1 && arr.splice(index, 1);
+ return typeof arg !== "undefined" ? [arg] : [];
}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/subscription-manager.js
+;// CONCATENATED MODULE: ./node_modules/reakit-system/es/createHook.js
-var subscription_manager_SubscriptionManager = /** @class */ (function () {
- function SubscriptionManager() {
- this.subscriptions = [];
- }
- SubscriptionManager.prototype.add = function (handler) {
- var _this = this;
- addUniqueItem(this.subscriptions, handler);
- return function () { return array_removeItem(_this.subscriptions, handler); };
- };
- SubscriptionManager.prototype.notify = function (a, b, c) {
- var numSubscriptions = this.subscriptions.length;
- if (!numSubscriptions)
- return;
- if (numSubscriptions === 1) {
- /**
- * If there's only a single handler we can just call it without invoking a loop.
- */
- this.subscriptions[0](a, b, c);
- }
- else {
- for (var i = 0; i < numSubscriptions; i++) {
- /**
- * Check whether the handler exists before firing as it's possible
- * the subscriptions were modified during this loop running.
- */
- var handler = this.subscriptions[i];
- handler && handler(a, b, c);
- }
- }
- };
- SubscriptionManager.prototype.getSize = function () {
- return this.subscriptions.length;
- };
- SubscriptionManager.prototype.clear = function () {
- this.subscriptions.length = 0;
- };
- return SubscriptionManager;
-}());
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/value/index.js
-var isFloat = function (value) {
- return !isNaN(parseFloat(value));
-};
/**
- * `MotionValue` is used to track the state and velocity of motion values.
+ * Creates a React custom hook that will return component props.
*
- * @public
- */
-var value_MotionValue = /** @class */ (function () {
- /**
- * @param init - The initiating value
- * @param config - Optional configuration options
- *
- * - `transformer`: A function to transform incoming values with.
- *
- * @internal
- */
- function MotionValue(init) {
- var _this = this;
- /**
- * Duration, in milliseconds, since last updating frame.
- *
- * @internal
- */
- this.timeDelta = 0;
- /**
- * Timestamp of the last time this `MotionValue` was updated.
- *
- * @internal
- */
- this.lastUpdated = 0;
- /**
- * Functions to notify when the `MotionValue` updates.
- *
- * @internal
- */
- this.updateSubscribers = new subscription_manager_SubscriptionManager();
- /**
- * Functions to notify when the velocity updates.
- *
- * @internal
- */
- this.velocityUpdateSubscribers = new subscription_manager_SubscriptionManager();
- /**
- * Functions to notify when the `MotionValue` updates and `render` is set to `true`.
- *
- * @internal
- */
- this.renderSubscribers = new subscription_manager_SubscriptionManager();
- /**
- * Tracks whether this value can output a velocity. Currently this is only true
- * if the value is numerical, but we might be able to widen the scope here and support
- * other value types.
- *
- * @internal
- */
- this.canTrackVelocity = false;
- this.updateAndNotify = function (v, render) {
- if (render === void 0) { render = true; }
- _this.prev = _this.current;
- _this.current = v;
- // Update timestamp
- var _a = getFrameData(), delta = _a.delta, timestamp = _a.timestamp;
- if (_this.lastUpdated !== timestamp) {
- _this.timeDelta = delta;
- _this.lastUpdated = timestamp;
- dist_es.postRender(_this.scheduleVelocityCheck);
- }
- // Update update subscribers
- if (_this.prev !== _this.current) {
- _this.updateSubscribers.notify(_this.current);
- }
- // Update velocity subscribers
- if (_this.velocityUpdateSubscribers.getSize()) {
- _this.velocityUpdateSubscribers.notify(_this.getVelocity());
- }
- // Update render subscribers
- if (render) {
- _this.renderSubscribers.notify(_this.current);
- }
- };
- /**
- * Schedule a velocity check for the next frame.
- *
- * This is an instanced and bound function to prevent generating a new
- * function once per frame.
- *
- * @internal
- */
- this.scheduleVelocityCheck = function () { return dist_es.postRender(_this.velocityCheck); };
- /**
- * Updates `prev` with `current` if the value hasn't been updated this frame.
- * This ensures velocity calculations return `0`.
- *
- * This is an instanced and bound function to prevent generating a new
- * function once per frame.
- *
- * @internal
- */
- this.velocityCheck = function (_a) {
- var timestamp = _a.timestamp;
- if (timestamp !== _this.lastUpdated) {
- _this.prev = _this.current;
- _this.velocityUpdateSubscribers.notify(_this.getVelocity());
- }
- };
- this.hasAnimated = false;
- this.prev = this.current = init;
- this.canTrackVelocity = isFloat(this.current);
+ * @example
+ * import { createHook } from "reakit-system";
+ *
+ * const useA = createHook({
+ * name: "A",
+ * keys: ["url"], // custom props/options keys
+ * useProps(options, htmlProps) {
+ * return {
+ * ...htmlProps,
+ * href: options.url,
+ * };
+ * },
+ * });
+ *
+ * function A({ url, ...htmlProps }) {
+ * const props = useA({ url }, htmlProps);
+ * return <a {...props} />;
+ * }
+ *
+ * @param options
+ */
+function createHook(options) {
+ var _options$useState, _composedHooks$;
+
+ var composedHooks = toArray(options.compose);
+
+ var __useOptions = function __useOptions(hookOptions, htmlProps) {
+ // Call the current hook's useOptions first
+ if (options.useOptions) {
+ hookOptions = options.useOptions(hookOptions, htmlProps);
+ } // If there's name, call useOptions from the system context
+
+
+ if (options.name) {
+ hookOptions = useOptions(options.name, hookOptions, htmlProps);
+ } // Run composed hooks useOptions
+
+
+ if (options.compose) {
+ for (var _iterator = _rollupPluginBabelHelpers_0c84a174_createForOfIteratorHelperLoose(composedHooks), _step; !(_step = _iterator()).done;) {
+ var hook = _step.value;
+ hookOptions = hook.__useOptions(hookOptions, htmlProps);
+ }
}
- /**
- * Adds a function that will be notified when the `MotionValue` is updated.
- *
- * It returns a function that, when called, will cancel the subscription.
- *
- * When calling `onChange` inside a React component, it should be wrapped with the
- * `useEffect` hook. As it returns an unsubscribe function, this should be returned
- * from the `useEffect` function to ensure you don't add duplicate subscribers..
- *
- * @library
- *
- * ```jsx
- * function MyComponent() {
- * const x = useMotionValue(0)
- * const y = useMotionValue(0)
- * const opacity = useMotionValue(1)
- *
- * useEffect(() => {
- * function updateOpacity() {
- * const maxXY = Math.max(x.get(), y.get())
- * const newOpacity = transform(maxXY, [0, 100], [1, 0])
- * opacity.set(newOpacity)
- * }
- *
- * const unsubscribeX = x.onChange(updateOpacity)
- * const unsubscribeY = y.onChange(updateOpacity)
- *
- * return () => {
- * unsubscribeX()
- * unsubscribeY()
- * }
- * }, [])
- *
- * return <Frame x={x} />
- * }
- * ```
- *
- * @motion
- *
- * ```jsx
- * export const MyComponent = () => {
- * const x = useMotionValue(0)
- * const y = useMotionValue(0)
- * const opacity = useMotionValue(1)
- *
- * useEffect(() => {
- * function updateOpacity() {
- * const maxXY = Math.max(x.get(), y.get())
- * const newOpacity = transform(maxXY, [0, 100], [1, 0])
- * opacity.set(newOpacity)
- * }
- *
- * const unsubscribeX = x.onChange(updateOpacity)
- * const unsubscribeY = y.onChange(updateOpacity)
- *
- * return () => {
- * unsubscribeX()
- * unsubscribeY()
- * }
- * }, [])
- *
- * return <motion.div style={{ x }} />
- * }
- * ```
- *
- * @internalremarks
- *
- * We could look into a `useOnChange` hook if the above lifecycle management proves confusing.
- *
- * ```jsx
- * useOnChange(x, () => {})
- * ```
- *
- * @param subscriber - A function that receives the latest value.
- * @returns A function that, when called, will cancel this subscription.
- *
- * @public
- */
- MotionValue.prototype.onChange = function (subscription) {
- return this.updateSubscribers.add(subscription);
- };
- MotionValue.prototype.clearListeners = function () {
- this.updateSubscribers.clear();
- };
- /**
- * Adds a function that will be notified when the `MotionValue` requests a render.
- *
- * @param subscriber - A function that's provided the latest value.
- * @returns A function that, when called, will cancel this subscription.
- *
- * @internal
- */
- MotionValue.prototype.onRenderRequest = function (subscription) {
- // Render immediately
- subscription(this.get());
- return this.renderSubscribers.add(subscription);
- };
- /**
- * Attaches a passive effect to the `MotionValue`.
- *
- * @internal
- */
- MotionValue.prototype.attach = function (passiveEffect) {
- this.passiveEffect = passiveEffect;
- };
- /**
- * Sets the state of the `MotionValue`.
- *
- * @remarks
- *
- * ```jsx
- * const x = useMotionValue(0)
- * x.set(10)
- * ```
- *
- * @param latest - Latest value to set.
- * @param render - Whether to notify render subscribers. Defaults to `true`
- *
- * @public
- */
- MotionValue.prototype.set = function (v, render) {
- if (render === void 0) { render = true; }
- if (!render || !this.passiveEffect) {
- this.updateAndNotify(v, render);
- }
- else {
- this.passiveEffect(v, this.updateAndNotify);
+
+ return hookOptions;
+ };
+
+ var useHook = function useHook(hookOptions, htmlProps, unstable_ignoreUseOptions) {
+ if (hookOptions === void 0) {
+ hookOptions = {};
+ }
+
+ if (htmlProps === void 0) {
+ htmlProps = {};
+ }
+
+ if (unstable_ignoreUseOptions === void 0) {
+ unstable_ignoreUseOptions = false;
+ }
+
+ // This won't execute when useHook was called from within another useHook
+ if (!unstable_ignoreUseOptions) {
+ hookOptions = __useOptions(hookOptions, htmlProps);
+ } // Call the current hook's useProps
+
+
+ if (options.useProps) {
+ htmlProps = options.useProps(hookOptions, htmlProps);
+ } // If there's name, call useProps from the system context
+
+
+ if (options.name) {
+ htmlProps = useProps(options.name, hookOptions, htmlProps);
+ }
+
+ if (options.compose) {
+ if (options.useComposeOptions) {
+ hookOptions = options.useComposeOptions(hookOptions, htmlProps);
+ }
+
+ if (options.useComposeProps) {
+ htmlProps = options.useComposeProps(hookOptions, htmlProps);
+ } else {
+ for (var _iterator2 = _rollupPluginBabelHelpers_0c84a174_createForOfIteratorHelperLoose(composedHooks), _step2; !(_step2 = _iterator2()).done;) {
+ var hook = _step2.value;
+ htmlProps = hook(hookOptions, htmlProps, true);
}
- };
- /**
- * Returns the latest state of `MotionValue`
- *
- * @returns - The latest state of `MotionValue`
- *
- * @public
- */
- MotionValue.prototype.get = function () {
- return this.current;
- };
- /**
- * @public
- */
- MotionValue.prototype.getPrevious = function () {
- return this.prev;
- };
- /**
- * Returns the latest velocity of `MotionValue`
- *
- * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
- *
- * @public
- */
- MotionValue.prototype.getVelocity = function () {
- // This could be isFloat(this.prev) && isFloat(this.current), but that would be wasteful
- return this.canTrackVelocity
- ? // These casts could be avoided if parseFloat would be typed better
- velocityPerSecond(parseFloat(this.current) -
- parseFloat(this.prev), this.timeDelta)
- : 0;
- };
- /**
- * Registers a new animation to control this `MotionValue`. Only one
- * animation can drive a `MotionValue` at one time.
- *
- * ```jsx
- * value.start()
- * ```
- *
- * @param animation - A function that starts the provided animation
- *
- * @internal
- */
- MotionValue.prototype.start = function (animation) {
- var _this = this;
- this.stop();
- return new Promise(function (resolve) {
- _this.hasAnimated = true;
- _this.stopAnimation = animation(resolve);
- }).then(function () { return _this.clearAnimation(); });
- };
- /**
- * Stop the currently active animation.
- *
- * @public
- */
- MotionValue.prototype.stop = function () {
- if (this.stopAnimation)
- this.stopAnimation();
- this.clearAnimation();
- };
- /**
- * Returns `true` if this value is currently animating.
- *
- * @public
- */
- MotionValue.prototype.isAnimating = function () {
- return !!this.stopAnimation;
- };
- MotionValue.prototype.clearAnimation = function () {
- this.stopAnimation = null;
- };
- /**
- * Destroy and clean up subscribers to this `MotionValue`.
- *
- * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
- * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
- * created a `MotionValue` via the `motionValue` function.
- *
- * @public
- */
- MotionValue.prototype.destroy = function () {
- this.updateSubscribers.clear();
- this.renderSubscribers.clear();
- this.stop();
- };
- return MotionValue;
-}());
-/**
- * @internal
- */
-function motionValue(init) {
- return new value_MotionValue(init);
-}
+ }
+ } // Remove undefined values from htmlProps
+ var finalHTMLProps = {};
+ var definedHTMLProps = htmlProps || {};
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/test.js
-/**
- * Tests a provided value against a ValueType
- */
-var testValueType = function (v) { return function (type) { return type.test(v); }; };
+ for (var prop in definedHTMLProps) {
+ if (definedHTMLProps[prop] !== undefined) {
+ finalHTMLProps[prop] = definedHTMLProps[prop];
+ }
+ }
+ return finalHTMLProps;
+ };
+ useHook.__useOptions = __useOptions;
+ var composedKeys = composedHooks.reduce(function (keys, hook) {
+ keys.push.apply(keys, hook.__keys || []);
+ return keys;
+ }, []); // It's used by createComponent to split option props (keys) and html props
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.js
-/**
- * ValueType for "auto"
- */
-var auto = {
- test: function (v) { return v === "auto"; },
- parse: function (v) { return v; },
-};
+ useHook.__keys = [].concat(composedKeys, ((_options$useState = options.useState) === null || _options$useState === void 0 ? void 0 : _options$useState.__keys) || [], options.keys || []);
+ useHook.unstable_propsAreEqual = options.propsAreEqual || ((_composedHooks$ = composedHooks[0]) === null || _composedHooks$ === void 0 ? void 0 : _composedHooks$.unstable_propsAreEqual) || shallowEqual;
+ if (false) {}
+ return useHook;
+}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.js
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/useForkRef.js
+// https://github.com/mui-org/material-ui/blob/2bcc874cf07b81202968f769cb9c2398c7c11311/packages/material-ui/src/utils/useForkRef.js
+
+function setRef(ref, value) {
+ if (value === void 0) {
+ value = null;
+ }
+
+ if (!ref) return;
+
+ if (typeof ref === "function") {
+ ref(value);
+ } else {
+ ref.current = value;
+ }
+}
/**
- * A list of value types commonly used for dimensions
- */
-var dimensionValueTypes = [numbers_number, px, percent, degrees, vw, vh, auto];
-/**
- * Tests a dimensional value against the list of dimension ValueTypes
+ * Merges up to two React Refs into a single memoized function React Ref so you
+ * can pass it to an element.
+ *
+ * @example
+ * import React from "react";
+ * import { useForkRef } from "reakit-utils";
+ *
+ * const Component = React.forwardRef((props, ref) => {
+ * const internalRef = React.useRef();
+ * return <div {...props} ref={useForkRef(internalRef, ref)} />;
+ * });
*/
-var findDimensionValueType = function (v) {
- return dimensionValueTypes.find(testValueType(v));
-};
+
+
+function useForkRef(refA, refB) {
+ return (0,external_React_.useMemo)(function () {
+ if (refA == null && refB == null) {
+ return null;
+ }
+
+ return function (value) {
+ setRef(refA, value);
+ setRef(refB, value);
+ };
+ }, [refA, refB]);
+}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/value-types/find.js
+;// CONCATENATED MODULE: ./node_modules/reakit-warning/es/useWarning.js
+function isRefObject(ref) {
+ return isObject(ref) && "current" in ref;
+}
/**
- * A list of all ValueTypes
- */
-var valueTypes = __spreadArray(__spreadArray([], __read(dimensionValueTypes)), [color_color, complex]);
-/**
- * Tests a value against the list of ValueTypes
+ * Logs `messages` to the console using `console.warn` based on a `condition`.
+ * This should be used inside components.
*/
-var findValueType = function (v) { return valueTypes.find(testValueType(v)); };
+function useWarning(condition) {
+ for (var _len = arguments.length, messages = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ messages[_key - 1] = arguments[_key];
+ }
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/setters.js
+ if (false) {}
+}
+;// CONCATENATED MODULE: ./node_modules/reakit-warning/es/index.js
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/getDocument.js
/**
- * Set VisualElement's MotionValue, creating a new MotionValue for it if
- * it doesn't exist.
+ * Returns `element.ownerDocument || document`.
*/
-function setMotionValue(visualElement, key, value) {
- if (visualElement.hasValue(key)) {
- visualElement.getValue(key).set(value);
- }
- else {
- visualElement.addValue(key, motionValue(value));
- }
-}
-function setTarget(visualElement, definition) {
- var resolved = resolveVariant(visualElement, definition);
- var _a = resolved
- ? visualElement.makeTargetAnimatable(resolved, false)
- : {}, _b = _a.transitionEnd, transitionEnd = _b === void 0 ? {} : _b; _a.transition; var target = __rest(_a, ["transitionEnd", "transition"]);
- target = __assign(__assign({}, target), transitionEnd);
- for (var key in target) {
- var value = resolveFinalValueInKeyframes(target[key]);
- setMotionValue(visualElement, key, value);
- }
+function getDocument(element) {
+ return element ? element.ownerDocument || element : document;
}
-function setVariants(visualElement, variantLabels) {
- var reversedLabels = __spreadArray([], __read(variantLabels)).reverse();
- reversedLabels.forEach(function (key) {
- var _a;
- var variant = visualElement.getVariant(key);
- variant && setTarget(visualElement, variant);
- (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
- setVariants(child, variantLabels);
- });
- });
-}
-function setters_setValues(visualElement, definition) {
- if (Array.isArray(definition)) {
- return setVariants(visualElement, definition);
- }
- else if (typeof definition === "string") {
- return setVariants(visualElement, [definition]);
- }
- else {
- setTarget(visualElement, definition);
- }
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/getWindow.js
+
+
+// Thanks to Fluent UI for doing the [research on IE11 memory leak](https://github.com/microsoft/fluentui/pull/9010#issuecomment-490768427)
+
+var _window; // Note: Accessing "window" in IE11 is somewhat expensive, and calling "typeof window"
+// hits a memory leak, whereas aliasing it and calling "typeof _window" does not.
+// Caching the window value at the file scope lets us minimize the impact.
+
+
+try {
+ _window = window;
+} catch (e) {
+ /* no-op */
}
-function checkTargetForNewValues(visualElement, target, origin) {
- var _a, _b, _c;
- var _d;
- var newValueKeys = Object.keys(target).filter(function (key) { return !visualElement.hasValue(key); });
- var numNewValues = newValueKeys.length;
- if (!numNewValues)
- return;
- for (var i = 0; i < numNewValues; i++) {
- var key = newValueKeys[i];
- var targetValue = target[key];
- var value = null;
- /**
- * If the target is a series of keyframes, we can use the first value
- * in the array. If this first value is null, we'll still need to read from the DOM.
- */
- if (Array.isArray(targetValue)) {
- value = targetValue[0];
- }
- /**
- * If the target isn't keyframes, or the first keyframe was null, we need to
- * first check if an origin value was explicitly defined in the transition as "from",
- * if not read the value from the DOM. As an absolute fallback, take the defined target value.
- */
- if (value === null) {
- value = (_b = (_a = origin[key]) !== null && _a !== void 0 ? _a : visualElement.readValue(key)) !== null && _b !== void 0 ? _b : target[key];
- }
- /**
- * If value is still undefined or null, ignore it. Preferably this would throw,
- * but this was causing issues in Framer.
- */
- if (value === undefined || value === null)
- continue;
- if (typeof value === "string" && isNumericalString(value)) {
- // If this is a number read as a string, ie "0" or "200", convert it to a number
- value = parseFloat(value);
- }
- else if (!findValueType(value) && complex.test(targetValue)) {
- value = animatable_none_getAnimatableNone(key, targetValue);
- }
- visualElement.addValue(key, motionValue(value));
- (_c = (_d = origin)[key]) !== null && _c !== void 0 ? _c : (_d[key] = value);
- visualElement.setBaseTarget(key, value);
- }
+/**
+ * Returns `element.ownerDocument.defaultView || window`.
+ */
+
+
+function getWindow(element) {
+ if (!element) {
+ return _window;
+ }
+
+ return getDocument(element).defaultView || _window;
}
-function getOriginFromTransition(key, transition) {
- if (!transition)
- return;
- var valueTransition = transition[key] || transition["default"] || transition;
- return valueTransition.from;
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/canUseDOM.js
+
+
+
+function checkIsBrowser() {
+ var _window = getWindow();
+
+ return Boolean(typeof _window !== "undefined" && _window.document && _window.document.createElement);
}
-function getOrigin(target, transition, visualElement) {
- var _a, _b;
- var origin = {};
- for (var key in target) {
- origin[key] =
- (_a = getOriginFromTransition(key, transition)) !== null && _a !== void 0 ? _a : (_b = visualElement.getValue(key)) === null || _b === void 0 ? void 0 : _b.get();
- }
- return origin;
+/**
+ * It's `true` if it is running in a browser environment or `false` if it is not (SSR).
+ *
+ * @example
+ * import { canUseDOM } from "reakit-utils";
+ *
+ * const title = canUseDOM ? document.title : "";
+ */
+
+
+var canUseDOM = checkIsBrowser();
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/useIsomorphicEffect.js
+
+
+
+
+
+/**
+ * `React.useLayoutEffect` that fallbacks to `React.useEffect` on server side
+ * rendering.
+ */
+
+var useIsomorphicEffect = !canUseDOM ? external_React_.useEffect : external_React_.useLayoutEffect;
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/useLiveRef.js
+
+
+
+
+
+
+/**
+ * A `React.Ref` that keeps track of the passed `value`.
+ */
+
+function useLiveRef(value) {
+ var ref = (0,external_React_.useRef)(value);
+ useIsomorphicEffect(function () {
+ ref.current = value;
+ });
+ return ref;
}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/animation.js
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isSelfTarget.js
+/**
+ * Returns `true` if `event.target` and `event.currentTarget` are the same.
+ */
+function isSelfTarget(event) {
+ return event.target === event.currentTarget;
+}
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/getActiveElement.js
/**
- * @internal
+ * Returns `element.ownerDocument.activeElement`.
*/
-function animateVisualElement(visualElement, definition, options) {
- if (options === void 0) { options = {}; }
- visualElement.notifyAnimationStart();
- var animation;
- if (Array.isArray(definition)) {
- var animations = definition.map(function (variant) {
- return animateVariant(visualElement, variant, options);
- });
- animation = Promise.all(animations);
- }
- else if (typeof definition === "string") {
- animation = animateVariant(visualElement, definition, options);
- }
- else {
- var resolvedDefinition = typeof definition === "function"
- ? resolveVariant(visualElement, definition, options.custom)
- : definition;
- animation = animateTarget(visualElement, resolvedDefinition, options);
- }
- return animation.then(function () {
- return visualElement.notifyAnimationComplete(definition);
- });
+
+function getActiveElement_getActiveElement(element) {
+ var _getDocument = getDocument(element),
+ activeElement = _getDocument.activeElement;
+
+ if (!(activeElement !== null && activeElement !== void 0 && activeElement.nodeName)) {
+ // In IE11, activeElement might be an empty object if we're interacting
+ // with elements inside of an iframe.
+ return null;
+ }
+
+ return activeElement;
}
-function animateVariant(visualElement, variant, options) {
- var _a;
- if (options === void 0) { options = {}; }
- var resolved = resolveVariant(visualElement, variant, options.custom);
- var _b = (resolved || {}).transition, transition = _b === void 0 ? visualElement.getDefaultTransition() || {} : _b;
- if (options.transitionOverride) {
- transition = options.transitionOverride;
- }
- /**
- * If we have a variant, create a callback that runs it as an animation.
- * Otherwise, we resolve a Promise immediately for a composable no-op.
- */
- var getAnimation = resolved
- ? function () { return animateTarget(visualElement, resolved, options); }
- : function () { return Promise.resolve(); };
- /**
- * If we have children, create a callback that runs all their animations.
- * Otherwise, we resolve a Promise immediately for a composable no-op.
- */
- var getChildAnimations = ((_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.size)
- ? function (forwardDelay) {
- if (forwardDelay === void 0) { forwardDelay = 0; }
- var _a = transition.delayChildren, delayChildren = _a === void 0 ? 0 : _a, staggerChildren = transition.staggerChildren, staggerDirection = transition.staggerDirection;
- return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options);
- }
- : function () { return Promise.resolve(); };
- /**
- * If the transition explicitly defines a "when" option, we need to resolve either
- * this animation or all children animations before playing the other.
- */
- var when = transition.when;
- if (when) {
- var _c = __read(when === "beforeChildren"
- ? [getAnimation, getChildAnimations]
- : [getChildAnimations, getAnimation], 2), first = _c[0], last = _c[1];
- return first().then(last);
- }
- else {
- return Promise.all([getAnimation(), getChildAnimations(options.delay)]);
- }
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/contains.js
+/**
+ * Similar to `Element.prototype.contains`, but a little bit faster when
+ * `element` is the same as `child`.
+ *
+ * @example
+ * import { contains } from "reakit-utils";
+ *
+ * contains(document.getElementById("parent"), document.getElementById("child"));
+ */
+function contains(parent, child) {
+ return parent === child || parent.contains(child);
}
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/hasFocusWithin.js
+
+
+
+
/**
- * @internal
+ * Checks if `element` has focus within. Elements that are referenced by
+ * `aria-activedescendant` are also considered.
+ *
+ * @example
+ * import { hasFocusWithin } from "reakit-utils";
+ *
+ * hasFocusWithin(document.getElementById("id"));
*/
-function animateTarget(visualElement, definition, _a) {
- var _b;
- var _c = _a === void 0 ? {} : _a, _d = _c.delay, delay = _d === void 0 ? 0 : _d, transitionOverride = _c.transitionOverride, type = _c.type;
- var _e = visualElement.makeTargetAnimatable(definition), _f = _e.transition, transition = _f === void 0 ? visualElement.getDefaultTransition() : _f, transitionEnd = _e.transitionEnd, target = __rest(_e, ["transition", "transitionEnd"]);
- if (transitionOverride)
- transition = transitionOverride;
- var animations = [];
- var animationTypeState = type && ((_b = visualElement.animationState) === null || _b === void 0 ? void 0 : _b.getState()[type]);
- for (var key in target) {
- var value = visualElement.getValue(key);
- var valueTarget = target[key];
- if (!value ||
- valueTarget === undefined ||
- (animationTypeState &&
- shouldBlockAnimation(animationTypeState, key))) {
- continue;
- }
- var animation = transitions_startAnimation(key, value, valueTarget, __assign({ delay: delay }, transition));
- animations.push(animation);
- }
- return Promise.all(animations).then(function () {
- transitionEnd && setTarget(visualElement, transitionEnd);
- });
+
+function hasFocusWithin(element) {
+ var activeElement = getActiveElement_getActiveElement(element);
+ if (!activeElement) return false;
+ if (contains(element, activeElement)) return true;
+ var activeDescendant = activeElement.getAttribute("aria-activedescendant");
+ if (!activeDescendant) return false;
+ if (activeDescendant === element.id) return true;
+ return !!element.querySelector("#" + activeDescendant);
}
-function animateChildren(visualElement, variant, delayChildren, staggerChildren, staggerDirection, options) {
- if (delayChildren === void 0) { delayChildren = 0; }
- if (staggerChildren === void 0) { staggerChildren = 0; }
- if (staggerDirection === void 0) { staggerDirection = 1; }
- var animations = [];
- var maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren;
- var generateStaggerDuration = staggerDirection === 1
- ? function (i) {
- if (i === void 0) { i = 0; }
- return i * staggerChildren;
- }
- : function (i) {
- if (i === void 0) { i = 0; }
- return maxStaggerDuration - i * staggerChildren;
- };
- Array.from(visualElement.variantChildren)
- .sort(sortByTreeOrder)
- .forEach(function (child, i) {
- animations.push(animateVariant(child, variant, __assign(__assign({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function () { return child.notifyAnimationComplete(variant); }));
- });
- return Promise.all(animations);
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isPortalEvent.js
+
+
+/**
+ * Returns `true` if `event` has been fired within a React Portal element.
+ */
+
+function isPortalEvent(event) {
+ return !contains(event.currentTarget, event.target);
}
-function animation_stopAnimation(visualElement) {
- visualElement.forEachValue(function (value) { return value.stop(); });
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isButton.js
+var buttonInputTypes = ["button", "color", "file", "image", "reset", "submit"];
+/**
+ * Checks whether `element` is a native HTML button element.
+ *
+ * @example
+ * import { isButton } from "reakit-utils";
+ *
+ * isButton(document.querySelector("button")); // true
+ * isButton(document.querySelector("input[type='button']")); // true
+ * isButton(document.querySelector("div")); // false
+ * isButton(document.querySelector("input[type='text']")); // false
+ * isButton(document.querySelector("div[role='button']")); // false
+ *
+ * @returns {boolean}
+ */
+
+function isButton(element) {
+ if (element.tagName === "BUTTON") return true;
+
+ if (element.tagName === "INPUT") {
+ var input = element;
+ return buttonInputTypes.indexOf(input.type) !== -1;
+ }
+
+ return false;
}
-function sortByTreeOrder(a, b) {
- return a.sortNodePosition(b);
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/dom.js
+
+
+
+
+/**
+ * Checks if a given string exists in the user agent string.
+ */
+
+function isUA(string) {
+ if (!canUseDOM) return false;
+ return window.navigator.userAgent.indexOf(string) !== -1;
}
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/matches.js
/**
- * Decide whether we should block this animation. Previously, we achieved this
- * just by checking whether the key was listed in protectedKeys, but this
- * posed problems if an animation was triggered by afterChildren and protectedKeys
- * had been set to true in the meantime.
+ * Ponyfill for `Element.prototype.matches`
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
*/
-function shouldBlockAnimation(_a, key) {
- var protectedKeys = _a.protectedKeys, needsAnimating = _a.needsAnimating;
- var shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true;
- needsAnimating[key] = false;
- return shouldBlock;
+function matches(element, selectors) {
+ if ("matches" in element) {
+ return element.matches(selectors);
+ }
+
+ if ("msMatchesSelector" in element) {
+ return element.msMatchesSelector(selectors);
+ }
+
+ return element.webkitMatchesSelector(selectors);
}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/animation-state.js
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/tabbable.js
+
+/** @module tabbable */
+var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), " + "textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], " + "iframe, object, embed, area[href], audio[controls], video[controls], " + "[contenteditable]:not([contenteditable='false'])";
+function isVisible(element) {
+ var htmlElement = element;
+ return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0;
+}
+function hasNegativeTabIndex(element) {
+ var tabIndex = parseInt(element.getAttribute("tabindex") || "0", 10);
+ return tabIndex < 0;
+}
+/**
+ * Checks whether `element` is focusable or not.
+ *
+ * @memberof tabbable
+ *
+ * @example
+ * import { isFocusable } from "reakit-utils";
+ *
+ * isFocusable(document.querySelector("input")); // true
+ * isFocusable(document.querySelector("input[tabindex='-1']")); // true
+ * isFocusable(document.querySelector("input[hidden]")); // false
+ * isFocusable(document.querySelector("input:disabled")); // false
+ */
-var variantPriorityOrder = [
- AnimationType.Animate,
- AnimationType.Hover,
- AnimationType.Tap,
- AnimationType.Drag,
- AnimationType.Focus,
- AnimationType.Exit,
-];
-var reversePriorityOrder = __spreadArray([], __read(variantPriorityOrder)).reverse();
-var numAnimationTypes = variantPriorityOrder.length;
-function animateList(visualElement) {
- return function (animations) {
- return Promise.all(animations.map(function (_a) {
- var animation = _a.animation, options = _a.options;
- return animateVisualElement(visualElement, animation, options);
- }));
- };
+function isFocusable(element) {
+ return matches(element, selector) && isVisible(element);
}
-function createAnimationState(visualElement) {
- var animate = animateList(visualElement);
- var state = createState();
- var allAnimatedKeys = {};
- var isInitialRender = true;
- /**
- * This function will be used to reduce the animation definitions for
- * each active animation type into an object of resolved values for it.
- */
- var buildResolvedTypeValues = function (acc, definition) {
- var resolved = resolveVariant(visualElement, definition);
- if (resolved) {
- resolved.transition; var transitionEnd = resolved.transitionEnd, target = __rest(resolved, ["transition", "transitionEnd"]);
- acc = __assign(__assign(__assign({}, acc), target), transitionEnd);
- }
- return acc;
- };
- function isAnimated(key) {
- return allAnimatedKeys[key] !== undefined;
- }
- /**
- * This just allows us to inject mocked animation functions
- * @internal
- */
- function setAnimateFunction(makeAnimator) {
- animate = makeAnimator(visualElement);
- }
- /**
- * When we receive new props, we need to:
- * 1. Create a list of protected keys for each type. This is a directory of
- * value keys that are currently being "handled" by types of a higher priority
- * so that whenever an animation is played of a given type, these values are
- * protected from being animated.
- * 2. Determine if an animation type needs animating.
- * 3. Determine if any values have been removed from a type and figure out
- * what to animate those to.
- */
- function animateChanges(options, changedActiveType) {
- var _a;
- var props = visualElement.getProps();
- var context = visualElement.getVariantContext(true) || {};
- /**
- * A list of animations that we'll build into as we iterate through the animation
- * types. This will get executed at the end of the function.
- */
- var animations = [];
- /**
- * Keep track of which values have been removed. Then, as we hit lower priority
- * animation types, we can check if they contain removed values and animate to that.
- */
- var removedKeys = new Set();
- /**
- * A dictionary of all encountered keys. This is an object to let us build into and
- * copy it without iteration. Each time we hit an animation type we set its protected
- * keys - the keys its not allowed to animate - to the latest version of this object.
- */
- var encounteredKeys = {};
- /**
- * If a variant has been removed at a given index, and this component is controlling
- * variant animations, we want to ensure lower-priority variants are forced to animate.
- */
- var removedVariantIndex = Infinity;
- var _loop_1 = function (i) {
- var type = reversePriorityOrder[i];
- var typeState = state[type];
- var prop = (_a = props[type]) !== null && _a !== void 0 ? _a : context[type];
- var propIsVariant = isVariantLabel(prop);
- /**
- * If this type has *just* changed isActive status, set activeDelta
- * to that status. Otherwise set to null.
- */
- var activeDelta = type === changedActiveType ? typeState.isActive : null;
- if (activeDelta === false)
- removedVariantIndex = i;
- /**
- * If this prop is an inherited variant, rather than been set directly on the
- * component itself, we want to make sure we allow the parent to trigger animations.
- *
- * TODO: Can probably change this to a !isControllingVariants check
- */
- var isInherited = prop === context[type] && prop !== props[type] && propIsVariant;
- /**
- *
- */
- if (isInherited &&
- isInitialRender &&
- visualElement.manuallyAnimateOnMount) {
- isInherited = false;
- }
- /**
- * Set all encountered keys so far as the protected keys for this type. This will
- * be any key that has been animated or otherwise handled by active, higher-priortiy types.
- */
- typeState.protectedKeys = __assign({}, encounteredKeys);
- // Check if we can skip analysing this prop early
- if (
- // If it isn't active and hasn't *just* been set as inactive
- (!typeState.isActive && activeDelta === null) ||
- // If we didn't and don't have any defined prop for this animation type
- (!prop && !typeState.prevProp) ||
- // Or if the prop doesn't define an animation
- isAnimationControls(prop) ||
- typeof prop === "boolean") {
- return "continue";
- }
- /**
- * As we go look through the values defined on this type, if we detect
- * a changed value or a value that was removed in a higher priority, we set
- * this to true and add this prop to the animation list.
- */
- var shouldAnimateType = variantsHaveChanged(typeState.prevProp, prop) ||
- // If we're making this variant active, we want to always make it active
- (type === changedActiveType &&
- typeState.isActive &&
- !isInherited &&
- propIsVariant) ||
- // If we removed a higher-priority variant (i is in reverse order)
- (i > removedVariantIndex && propIsVariant);
- /**
- * As animations can be set as variant lists, variants or target objects, we
- * coerce everything to an array if it isn't one already
- */
- var definitionList = Array.isArray(prop) ? prop : [prop];
- /**
- * Build an object of all the resolved values. We'll use this in the subsequent
- * animateChanges calls to determine whether a value has changed.
- */
- var resolvedValues = definitionList.reduce(buildResolvedTypeValues, {});
- if (activeDelta === false)
- resolvedValues = {};
- /**
- * Now we need to loop through all the keys in the prev prop and this prop,
- * and decide:
- * 1. If the value has changed, and needs animating
- * 2. If it has been removed, and needs adding to the removedKeys set
- * 3. If it has been removed in a higher priority type and needs animating
- * 4. If it hasn't been removed in a higher priority but hasn't changed, and
- * needs adding to the type's protectedKeys list.
- */
- var _b = typeState.prevResolvedValues, prevResolvedValues = _b === void 0 ? {} : _b;
- var allKeys = __assign(__assign({}, prevResolvedValues), resolvedValues);
- var markToAnimate = function (key) {
- shouldAnimateType = true;
- removedKeys.delete(key);
- typeState.needsAnimating[key] = true;
- };
- for (var key in allKeys) {
- var next = resolvedValues[key];
- var prev = prevResolvedValues[key];
- // If we've already handled this we can just skip ahead
- if (encounteredKeys.hasOwnProperty(key))
- continue;
- /**
- * If the value has changed, we probably want to animate it.
- */
- if (next !== prev) {
- /**
- * If both values are keyframes, we need to shallow compare them to
- * detect whether any value has changed. If it has, we animate it.
- */
- if (isKeyframesTarget(next) && isKeyframesTarget(prev)) {
- if (!shallowCompare(next, prev)) {
- markToAnimate(key);
- }
- else {
- /**
- * If it hasn't changed, we want to ensure it doesn't animate by
- * adding it to the list of protected keys.
- */
- typeState.protectedKeys[key] = true;
- }
- }
- else if (next !== undefined) {
- // If next is defined and doesn't equal prev, it needs animating
- markToAnimate(key);
- }
- else {
- // If it's undefined, it's been removed.
- removedKeys.add(key);
- }
- }
- else if (next !== undefined && removedKeys.has(key)) {
- /**
- * If next hasn't changed and it isn't undefined, we want to check if it's
- * been removed by a higher priority
- */
- markToAnimate(key);
- }
- else {
- /**
- * If it hasn't changed, we add it to the list of protected values
- * to ensure it doesn't get animated.
- */
- typeState.protectedKeys[key] = true;
- }
- }
- /**
- * Update the typeState so next time animateChanges is called we can compare the
- * latest prop and resolvedValues to these.
- */
- typeState.prevProp = prop;
- typeState.prevResolvedValues = resolvedValues;
- /**
- *
- */
- if (typeState.isActive) {
- encounteredKeys = __assign(__assign({}, encounteredKeys), resolvedValues);
- }
- if (isInitialRender && visualElement.blockInitialAnimation) {
- shouldAnimateType = false;
- }
- /**
- * If this is an inherited prop we want to hard-block animations
- * TODO: Test as this should probably still handle animations triggered
- * by removed values?
- */
- if (shouldAnimateType && !isInherited) {
- animations.push.apply(animations, __spreadArray([], __read(definitionList.map(function (animation) { return ({
- animation: animation,
- options: __assign({ type: type }, options),
- }); }))));
- }
- };
- /**
- * Iterate through all animation types in reverse priority order. For each, we want to
- * detect which values it's handling and whether or not they've changed (and therefore
- * need to be animated). If any values have been removed, we want to detect those in
- * lower priority props and flag for animation.
- */
- for (var i = 0; i < numAnimationTypes; i++) {
- _loop_1(i);
- }
- allAnimatedKeys = __assign({}, encounteredKeys);
- /**
- * If there are some removed value that haven't been dealt with,
- * we need to create a new animation that falls back either to the value
- * defined in the style prop, or the last read value.
- */
- if (removedKeys.size) {
- var fallbackAnimation_1 = {};
- removedKeys.forEach(function (key) {
- var fallbackTarget = visualElement.getBaseTarget(key);
- if (fallbackTarget !== undefined) {
- fallbackAnimation_1[key] = fallbackTarget;
- }
- });
- animations.push({ animation: fallbackAnimation_1 });
- }
- var shouldAnimate = Boolean(animations.length);
- if (isInitialRender &&
- props.initial === false &&
- !visualElement.manuallyAnimateOnMount) {
- shouldAnimate = false;
- }
- isInitialRender = false;
- return shouldAnimate ? animate(animations) : Promise.resolve();
- }
- /**
- * Change whether a certain animation type is active.
- */
- function setActive(type, isActive, options) {
- var _a;
- // If the active state hasn't changed, we can safely do nothing here
- if (state[type].isActive === isActive)
- return Promise.resolve();
- // Propagate active change to children
- (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); });
- state[type].isActive = isActive;
- return animateChanges(options, type);
- }
- return {
- isAnimated: isAnimated,
- animateChanges: animateChanges,
- setActive: setActive,
- setAnimateFunction: setAnimateFunction,
- getState: function () { return state; },
- };
+/**
+ * Checks whether `element` is tabbable or not.
+ *
+ * @memberof tabbable
+ *
+ * @example
+ * import { isTabbable } from "reakit-utils";
+ *
+ * isTabbable(document.querySelector("input")); // true
+ * isTabbable(document.querySelector("input[tabindex='-1']")); // false
+ * isTabbable(document.querySelector("input[hidden]")); // false
+ * isTabbable(document.querySelector("input:disabled")); // false
+ */
+
+function isTabbable(element) {
+ return isFocusable(element) && !hasNegativeTabIndex(element);
}
-function variantsHaveChanged(prev, next) {
- if (typeof next === "string") {
- return next !== prev;
- }
- else if (isVariantLabels(next)) {
- return !shallowCompare(next, prev);
- }
- return false;
+/**
+ * Returns all the focusable elements in `container`.
+ *
+ * @memberof tabbable
+ *
+ * @param {Element} container
+ *
+ * @returns {Element[]}
+ */
+
+function getAllFocusableIn(container) {
+ var allFocusable = Array.from(container.querySelectorAll(selector));
+ allFocusable.unshift(container);
+ return allFocusable.filter(isFocusable);
}
-function createTypeState(isActive) {
- if (isActive === void 0) { isActive = false; }
- return {
- isActive: isActive,
- protectedKeys: {},
- needsAnimating: {},
- prevResolvedValues: {},
- };
+/**
+ * Returns the first focusable element in `container`.
+ *
+ * @memberof tabbable
+ *
+ * @param {Element} container
+ *
+ * @returns {Element|null}
+ */
+
+function getFirstFocusableIn(container) {
+ var _getAllFocusableIn = getAllFocusableIn(container),
+ first = _getAllFocusableIn[0];
+
+ return first || null;
}
-function createState() {
- var _a;
- return _a = {},
- _a[AnimationType.Animate] = createTypeState(true),
- _a[AnimationType.Hover] = createTypeState(),
- _a[AnimationType.Tap] = createTypeState(),
- _a[AnimationType.Drag] = createTypeState(),
- _a[AnimationType.Focus] = createTypeState(),
- _a[AnimationType.Exit] = createTypeState(),
- _a;
+/**
+ * Returns all the tabbable elements in `container`, including the container
+ * itself.
+ *
+ * @memberof tabbable
+ *
+ * @param {Element} container
+ * @param fallbackToFocusable If `true`, it'll return focusable elements if there are no tabbable ones.
+ *
+ * @returns {Element[]}
+ */
+
+function getAllTabbableIn(container, fallbackToFocusable) {
+ var allFocusable = Array.from(container.querySelectorAll(selector));
+ var allTabbable = allFocusable.filter(isTabbable);
+
+ if (isTabbable(container)) {
+ allTabbable.unshift(container);
+ }
+
+ if (!allTabbable.length && fallbackToFocusable) {
+ return allFocusable;
+ }
+
+ return allTabbable;
}
+/**
+ * Returns the first tabbable element in `container`, including the container
+ * itself if it's tabbable.
+ *
+ * @memberof tabbable
+ *
+ * @param {Element} container
+ * @param fallbackToFocusable If `true`, it'll return the first focusable element if there are no tabbable ones.
+ *
+ * @returns {Element|null}
+ */
+function getFirstTabbableIn(container, fallbackToFocusable) {
+ var _getAllTabbableIn = getAllTabbableIn(container, fallbackToFocusable),
+ first = _getAllTabbableIn[0];
+ return first || null;
+}
+/**
+ * Returns the last tabbable element in `container`, including the container
+ * itself if it's tabbable.
+ *
+ * @memberof tabbable
+ *
+ * @param {Element} container
+ * @param fallbackToFocusable If `true`, it'll return the last focusable element if there are no tabbable ones.
+ *
+ * @returns {Element|null}
+ */
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/animations.js
+function getLastTabbableIn(container, fallbackToFocusable) {
+ var allTabbable = getAllTabbableIn(container, fallbackToFocusable);
+ return allTabbable[allTabbable.length - 1] || null;
+}
+/**
+ * Returns the next tabbable element in `container`.
+ *
+ * @memberof tabbable
+ *
+ * @param {Element} container
+ * @param fallbackToFocusable If `true`, it'll return the next focusable element if there are no tabbable ones.
+ *
+ * @returns {Element|null}
+ */
+function getNextTabbableIn(container, fallbackToFocusable) {
+ var activeElement = getActiveElement(container);
+ var allFocusable = getAllFocusableIn(container);
+ var index = allFocusable.indexOf(activeElement);
+ var slice = allFocusable.slice(index + 1);
+ return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null);
+}
+/**
+ * Returns the previous tabbable element in `container`.
+ *
+ * @memberof tabbable
+ *
+ * @param {Element} container
+ * @param fallbackToFocusable If `true`, it'll return the previous focusable element if there are no tabbable ones.
+ *
+ * @returns {Element|null}
+ */
+function getPreviousTabbableIn(container, fallbackToFocusable) {
+ var activeElement = getActiveElement(container);
+ var allFocusable = getAllFocusableIn(container).reverse();
+ var index = allFocusable.indexOf(activeElement);
+ var slice = allFocusable.slice(index + 1);
+ return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null);
+}
+/**
+ * Returns the closest focusable element.
+ *
+ * @memberof tabbable
+ *
+ * @param {Element} container
+ *
+ * @returns {Element|null}
+ */
+function getClosestFocusable(element) {
+ while (element && !isFocusable(element)) {
+ element = closest(element, selector);
+ }
+ return element;
+}
+;// CONCATENATED MODULE: ./node_modules/reakit/es/Role/Role.js
-var animations_animations = {
- animation: makeRenderlessComponent(function (_a) {
- var visualElement = _a.visualElement, animate = _a.animate;
- /**
- * We dynamically generate the AnimationState manager as it contains a reference
- * to the underlying animation library. We only want to load that if we load this,
- * so people can optionally code split it out using the `m` component.
- */
- visualElement.animationState || (visualElement.animationState = createAnimationState(visualElement));
- /**
- * Subscribe any provided AnimationControls to the component's VisualElement
- */
- if (isAnimationControls(animate)) {
- Object(external_React_["useEffect"])(function () { return animate.subscribe(visualElement); }, [animate]);
- }
- }),
- exit: makeRenderlessComponent(function (props) {
- var custom = props.custom, visualElement = props.visualElement;
- var _a = __read(usePresence(), 2), isPresent = _a[0], onExitComplete = _a[1];
- var presenceContext = Object(external_React_["useContext"])(PresenceContext);
- Object(external_React_["useEffect"])(function () {
- var _a, _b;
- var animation = (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(AnimationType.Exit, !isPresent, { custom: (_b = presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.custom) !== null && _b !== void 0 ? _b : custom });
- !isPresent && (animation === null || animation === void 0 ? void 0 : animation.then(onExitComplete));
- }, [isPresent]);
- }),
-};
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/is-point.js
-var isPoint = function (point) {
- return point.hasOwnProperty('x') && point.hasOwnProperty('y');
-};
+// Automatically generated
+var ROLE_KEYS = ["unstable_system"];
+var useRole = createHook({
+ name: "Role",
+ keys: ROLE_KEYS,
+ propsAreEqual: function propsAreEqual(prev, next) {
+ var prevSystem = prev.unstable_system,
+ prevProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(prev, ["unstable_system"]);
+ var nextSystem = next.unstable_system,
+ nextProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(next, ["unstable_system"]);
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/is-point-3d.js
+ if (prevSystem !== nextSystem && !shallowEqual(prevSystem, nextSystem)) {
+ return false;
+ }
+ return shallowEqual(prevProps, nextProps);
+ }
+});
+var Role = createComponent({
+ as: "div",
+ useHook: useRole
+});
-var isPoint3D = function (point) {
- return isPoint(point) && point.hasOwnProperty('z');
-};
+;// CONCATENATED MODULE: ./node_modules/reakit/es/Tabbable/Tabbable.js
-// CONCATENATED MODULE: ./node_modules/popmotion/dist/es/utils/distance.js
-var distance1D = function (a, b) { return Math.abs(a - b); };
-function distance_distance(a, b) {
- if (isNum(a) && isNum(b)) {
- return distance1D(a, b);
- }
- else if (isPoint(a) && isPoint(b)) {
- var xDelta = distance1D(a.x, b.x);
- var yDelta = distance1D(a.y, b.y);
- var zDelta = isPoint3D(a) && isPoint3D(b) ? distance1D(a.z, b.z) : 0;
- return Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2) + Math.pow(zDelta, 2));
- }
-}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/PanSession.js
@@ -20088,800 +17880,606 @@ function distance_distance(a, b) {
-/**
- * @internal
- */
-var PanSession_PanSession = /** @class */ (function () {
- function PanSession(event, handlers, _a) {
- var _this = this;
- var _b = _a === void 0 ? {} : _a, transformPagePoint = _b.transformPagePoint;
- /**
- * @internal
- */
- this.startEvent = null;
- /**
- * @internal
- */
- this.lastMoveEvent = null;
- /**
- * @internal
- */
- this.lastMoveEventInfo = null;
- /**
- * @internal
- */
- this.handlers = {};
- this.updatePoint = function () {
- if (!(_this.lastMoveEvent && _this.lastMoveEventInfo))
- return;
- var info = getPanInfo(_this.lastMoveEventInfo, _this.history);
- var isPanStarted = _this.startEvent !== null;
- // Only start panning if the offset is larger than 3 pixels. If we make it
- // any larger than this we'll want to reset the pointer history
- // on the first update to avoid visual snapping to the cursoe.
- var isDistancePastThreshold = distance_distance(info.offset, { x: 0, y: 0 }) >= 3;
- if (!isPanStarted && !isDistancePastThreshold)
- return;
- var point = info.point;
- var timestamp = getFrameData().timestamp;
- _this.history.push(__assign(__assign({}, point), { timestamp: timestamp }));
- var _a = _this.handlers, onStart = _a.onStart, onMove = _a.onMove;
- if (!isPanStarted) {
- onStart && onStart(_this.lastMoveEvent, info);
- _this.startEvent = _this.lastMoveEvent;
- }
- onMove && onMove(_this.lastMoveEvent, info);
- };
- this.handlePointerMove = function (event, info) {
- _this.lastMoveEvent = event;
- _this.lastMoveEventInfo = PanSession_transformPoint(info, _this.transformPagePoint);
- // Because Safari doesn't trigger mouseup events when it's above a `<select>`
- if (isMouseEvent(event) && event.buttons === 0) {
- _this.handlePointerUp(event, info);
- return;
- }
- // Throttle mouse move event to once per frame
- dist_es.update(_this.updatePoint, true);
- };
- this.handlePointerUp = function (event, info) {
- _this.end();
- var _a = _this.handlers, onEnd = _a.onEnd, onSessionEnd = _a.onSessionEnd;
- var panInfo = getPanInfo(PanSession_transformPoint(info, _this.transformPagePoint), _this.history);
- if (_this.startEvent && onEnd) {
- onEnd(event, panInfo);
- }
- onSessionEnd && onSessionEnd(event, panInfo);
- };
- // If we have more than one touch, don't start detecting this gesture
- if (isTouchEvent(event) && event.touches.length > 1)
- return;
- this.handlers = handlers;
- this.transformPagePoint = transformPagePoint;
- var info = extractEventInfo(event);
- var initialInfo = PanSession_transformPoint(info, this.transformPagePoint);
- var point = initialInfo.point;
- var timestamp = getFrameData().timestamp;
- this.history = [__assign(__assign({}, point), { timestamp: timestamp })];
- var onSessionStart = handlers.onSessionStart;
- onSessionStart &&
- onSessionStart(event, getPanInfo(initialInfo, this.history));
- this.removeListeners = pipe(addPointerEvent(window, "pointermove", this.handlePointerMove), addPointerEvent(window, "pointerup", this.handlePointerUp), addPointerEvent(window, "pointercancel", this.handlePointerUp));
- }
- PanSession.prototype.updateHandlers = function (handlers) {
- this.handlers = handlers;
- };
- PanSession.prototype.end = function () {
- this.removeListeners && this.removeListeners();
- cancelSync.update(this.updatePoint);
- };
- return PanSession;
-}());
-function PanSession_transformPoint(info, transformPagePoint) {
- return transformPagePoint ? { point: transformPagePoint(info.point) } : info;
+// Automatically generated
+var TABBABLE_KEYS = ["disabled", "focusable"];
+
+var isSafariOrFirefoxOnMac = isUA("Mac") && !isUA("Chrome") && (isUA("Safari") || isUA("Firefox"));
+
+function focusIfNeeded(element) {
+ if (!hasFocusWithin(element) && isFocusable(element)) {
+ element.focus();
+ }
}
-function subtractPoint(a, b) {
- return { x: a.x - b.x, y: a.y - b.y };
+
+function isNativeTabbable(element) {
+ return ["BUTTON", "INPUT", "SELECT", "TEXTAREA", "A"].includes(element.tagName);
}
-function getPanInfo(_a, history) {
- var point = _a.point;
- return {
- point: point,
- delta: subtractPoint(point, lastDevicePoint(history)),
- offset: subtractPoint(point, startDevicePoint(history)),
- velocity: PanSession_getVelocity(history, 0.1),
- };
-}
-function startDevicePoint(history) {
- return history[0];
-}
-function lastDevicePoint(history) {
- return history[history.length - 1];
-}
-function PanSession_getVelocity(history, timeDelta) {
- if (history.length < 2) {
- return { x: 0, y: 0 };
- }
- var i = history.length - 1;
- var timestampedPoint = null;
- var lastPoint = lastDevicePoint(history);
- while (i >= 0) {
- timestampedPoint = history[i];
- if (lastPoint.timestamp - timestampedPoint.timestamp >
- secondsToMilliseconds(timeDelta)) {
- break;
- }
- i--;
- }
- if (!timestampedPoint) {
- return { x: 0, y: 0 };
- }
- var time = (lastPoint.timestamp - timestampedPoint.timestamp) / 1000;
- if (time === 0) {
- return { x: 0, y: 0 };
- }
- var currentVelocity = {
- x: (lastPoint.x - timestampedPoint.x) / time,
- y: (lastPoint.y - timestampedPoint.y) / time,
- };
- if (currentVelocity.x === Infinity) {
- currentVelocity.x = 0;
- }
- if (currentVelocity.y === Infinity) {
- currentVelocity.y = 0;
- }
- return currentVelocity;
-}
-
-
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/noop.js
-function noop(any) {
- return any;
+function supportsDisabledAttribute(element) {
+ return ["BUTTON", "INPUT", "SELECT", "TEXTAREA"].includes(element.tagName);
}
+function getTabIndex(trulyDisabled, nativeTabbable, supportsDisabled, htmlTabIndex) {
+ if (trulyDisabled) {
+ if (nativeTabbable && !supportsDisabled) {
+ // Anchor, audio and video tags don't support the `disabled` attribute.
+ // We must pass tabIndex={-1} so they don't receive focus on tab.
+ return -1;
+ } // Elements that support the `disabled` attribute don't need tabIndex.
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/geometry/index.js
+ return undefined;
+ }
+ if (nativeTabbable) {
+ // If the element is enabled and it's natively tabbable, we don't need to
+ // specify a tabIndex attribute unless it's explicitly set by the user.
+ return htmlTabIndex;
+ } // If the element is enabled and is not natively tabbable, we have to
+ // fallback tabIndex={0}.
-/**
- * Bounding boxes tend to be defined as top, left, right, bottom. For various operations
- * it's easier to consider each axis individually. This function returns a bounding box
- * as a map of single-axis min/max values.
- */
-function convertBoundingBoxToAxisBox(_a) {
- var top = _a.top, left = _a.left, right = _a.right, bottom = _a.bottom;
- return {
- x: { min: left, max: right },
- y: { min: top, max: bottom },
- };
-}
-function convertAxisBoxToBoundingBox(_a) {
- var x = _a.x, y = _a.y;
- return {
- top: y.min,
- bottom: y.max,
- left: x.min,
- right: x.max,
- };
-}
-/**
- * Applies a TransformPoint function to a bounding box. TransformPoint is usually a function
- * provided by Framer to allow measured points to be corrected for device scaling. This is used
- * when measuring DOM elements and DOM event points.
- */
-function transformBoundingBox(_a, transformPoint) {
- var top = _a.top, left = _a.left, bottom = _a.bottom, right = _a.right;
- if (transformPoint === void 0) { transformPoint = noop; }
- var topLeft = transformPoint({ x: left, y: top });
- var bottomRight = transformPoint({ x: right, y: bottom });
- return {
- top: topLeft.y,
- left: topLeft.x,
- bottom: bottomRight.y,
- right: bottomRight.x,
- };
-}
-/**
- * Create an empty axis box of zero size
- */
-function axisBox() {
- return { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } };
-}
-function copyAxisBox(box) {
- return {
- x: __assign({}, box.x),
- y: __assign({}, box.y),
- };
-}
-/**
- * Create an empty box delta
- */
-var zeroDelta = {
- translate: 0,
- scale: 1,
- origin: 0,
- originPoint: 0,
-};
-function geometry_delta() {
- return {
- x: __assign({}, zeroDelta),
- y: __assign({}, zeroDelta),
- };
+ return htmlTabIndex || 0;
}
+function useDisableEvent(htmlEventRef, disabled) {
+ return (0,external_React_.useCallback)(function (event) {
+ var _htmlEventRef$current;
+ (_htmlEventRef$current = htmlEventRef.current) === null || _htmlEventRef$current === void 0 ? void 0 : _htmlEventRef$current.call(htmlEventRef, event);
+ if (event.defaultPrevented) return;
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/each-axis.js
-// Call a handler once for each axis
-function eachAxis(handler) {
- return [handler("x"), handler("y")];
+ if (disabled) {
+ event.stopPropagation();
+ event.preventDefault();
+ }
+ }, [htmlEventRef, disabled]);
}
+var useTabbable = createHook({
+ name: "Tabbable",
+ compose: useRole,
+ keys: TABBABLE_KEYS,
+ useOptions: function useOptions(options, _ref) {
+ var disabled = _ref.disabled;
+ return _objectSpread2({
+ disabled: disabled
+ }, options);
+ },
+ useProps: function useProps(options, _ref2) {
+ var htmlRef = _ref2.ref,
+ htmlTabIndex = _ref2.tabIndex,
+ htmlOnClickCapture = _ref2.onClickCapture,
+ htmlOnMouseDownCapture = _ref2.onMouseDownCapture,
+ htmlOnMouseDown = _ref2.onMouseDown,
+ htmlOnKeyPressCapture = _ref2.onKeyPressCapture,
+ htmlStyle = _ref2.style,
+ htmlProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(_ref2, ["ref", "tabIndex", "onClickCapture", "onMouseDownCapture", "onMouseDown", "onKeyPressCapture", "style"]);
+ var ref = (0,external_React_.useRef)(null);
+ var onClickCaptureRef = useLiveRef(htmlOnClickCapture);
+ var onMouseDownCaptureRef = useLiveRef(htmlOnMouseDownCapture);
+ var onMouseDownRef = useLiveRef(htmlOnMouseDown);
+ var onKeyPressCaptureRef = useLiveRef(htmlOnKeyPressCapture);
+ var trulyDisabled = !!options.disabled && !options.focusable;
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js
-
+ var _React$useState = (0,external_React_.useState)(true),
+ nativeTabbable = _React$useState[0],
+ setNativeTabbable = _React$useState[1];
+ var _React$useState2 = (0,external_React_.useState)(true),
+ supportsDisabled = _React$useState2[0],
+ setSupportsDisabled = _React$useState2[1];
-/**
- * Apply constraints to a point. These constraints are both physical along an
- * axis, and an elastic factor that determines how much to constrain the point
- * by if it does lie outside the defined parameters.
- */
-function applyConstraints(point, _a, elastic) {
- var min = _a.min, max = _a.max;
- if (min !== undefined && point < min) {
- // If we have a min point defined, and this is outside of that, constrain
- point = elastic ? mix(min, point, elastic.min) : Math.max(point, min);
- }
- else if (max !== undefined && point > max) {
- // If we have a max point defined, and this is outside of that, constrain
- point = elastic ? mix(max, point, elastic.max) : Math.min(point, max);
- }
- return point;
-}
-/**
- * Calculates a min projection point based on a pointer, pointer progress
- * within the drag target, and constraints.
- *
- * For instance if an element was 100px width, we were dragging from 0.25
- * along this axis, the pointer is at 200px, and there were no constraints,
- * we would calculate a min projection point of 175px.
- */
-function calcConstrainedMinPoint(point, length, progress, constraints, elastic) {
- // Calculate a min point for this axis and apply it to the current pointer
- var min = point - length * progress;
- return constraints ? applyConstraints(min, constraints, elastic) : min;
-}
-/**
- * Calculate constraints in terms of the viewport when defined relatively to the
- * measured axis. This is measured from the nearest edge, so a max constraint of 200
- * on an axis with a max value of 300 would return a constraint of 500 - axis length
- */
-function calcRelativeAxisConstraints(axis, min, max) {
- return {
- min: min !== undefined ? axis.min + min : undefined,
- max: max !== undefined
- ? axis.max + max - (axis.max - axis.min)
- : undefined,
- };
-}
-/**
- * Calculate constraints in terms of the viewport when
- * defined relatively to the measured bounding box.
- */
-function calcRelativeConstraints(layoutBox, _a) {
- var top = _a.top, left = _a.left, bottom = _a.bottom, right = _a.right;
- return {
- x: calcRelativeAxisConstraints(layoutBox.x, left, right),
- y: calcRelativeAxisConstraints(layoutBox.y, top, bottom),
- };
-}
-/**
- * Calculate viewport constraints when defined as another viewport-relative axis
- */
-function calcViewportAxisConstraints(layoutAxis, constraintsAxis) {
- var _a;
- var min = constraintsAxis.min - layoutAxis.min;
- var max = constraintsAxis.max - layoutAxis.max;
- // If the constraints axis is actually smaller than the layout axis then we can
- // flip the constraints
- if (constraintsAxis.max - constraintsAxis.min <
- layoutAxis.max - layoutAxis.min) {
- _a = __read([max, min], 2), min = _a[0], max = _a[1];
- }
- return {
- min: layoutAxis.min + min,
- max: layoutAxis.min + max,
- };
-}
-/**
- * Calculate viewport constraints when defined as another viewport-relative box
- */
-function calcViewportConstraints(layoutBox, constraintsBox) {
- return {
- x: calcViewportAxisConstraints(layoutBox.x, constraintsBox.x),
- y: calcViewportAxisConstraints(layoutBox.y, constraintsBox.y),
- };
-}
-/**
- * Calculate the an axis position based on two axes and a progress value.
- */
-function calcPositionFromProgress(axis, constraints, progress) {
- var axisLength = axis.max - axis.min;
- var min = mix(constraints.min, constraints.max - axisLength, progress);
- return { min: min, max: min + axisLength };
-}
-/**
- * Rebase the calculated viewport constraints relative to the layout.min point.
- */
-function rebaseAxisConstraints(layout, constraints) {
- var relativeConstraints = {};
- if (constraints.min !== undefined) {
- relativeConstraints.min = constraints.min - layout.min;
- }
- if (constraints.max !== undefined) {
- relativeConstraints.max = constraints.max - layout.min;
- }
- return relativeConstraints;
-}
-var defaultElastic = 0.35;
-/**
- * Accepts a dragElastic prop and returns resolved elastic values for each axis.
- */
-function resolveDragElastic(dragElastic) {
- if (dragElastic === false) {
- dragElastic = 0;
- }
- else if (dragElastic === true) {
- dragElastic = defaultElastic;
- }
- return {
- x: resolveAxisElastic(dragElastic, "left", "right"),
- y: resolveAxisElastic(dragElastic, "top", "bottom"),
- };
-}
-function resolveAxisElastic(dragElastic, minLabel, maxLabel) {
- return {
- min: resolvePointElastic(dragElastic, minLabel),
- max: resolvePointElastic(dragElastic, maxLabel),
- };
-}
-function resolvePointElastic(dragElastic, label) {
- var _a;
- return typeof dragElastic === "number"
- ? dragElastic
- : (_a = dragElastic[label]) !== null && _a !== void 0 ? _a : 0;
-}
+ var style = options.disabled ? _objectSpread2({
+ pointerEvents: "none"
+ }, htmlStyle) : htmlStyle;
+ useIsomorphicEffect(function () {
+ var tabbable = ref.current;
+ if (!tabbable) {
+ false ? 0 : void 0;
+ return;
+ }
+ if (!isNativeTabbable(tabbable)) {
+ setNativeTabbable(false);
+ }
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/measure.js
+ if (!supportsDisabledAttribute(tabbable)) {
+ setSupportsDisabled(false);
+ }
+ }, []);
+ var onClickCapture = useDisableEvent(onClickCaptureRef, options.disabled);
+ var onMouseDownCapture = useDisableEvent(onMouseDownCaptureRef, options.disabled);
+ var onKeyPressCapture = useDisableEvent(onKeyPressCaptureRef, options.disabled);
+ var onMouseDown = (0,external_React_.useCallback)(function (event) {
+ var _onMouseDownRef$curre;
+ (_onMouseDownRef$curre = onMouseDownRef.current) === null || _onMouseDownRef$curre === void 0 ? void 0 : _onMouseDownRef$curre.call(onMouseDownRef, event);
+ var element = event.currentTarget;
+ if (event.defaultPrevented) return; // Safari and Firefox on MacOS don't focus on buttons on mouse down
+ // like other browsers/platforms. Instead, they focus on the closest
+ // focusable ancestor element, which is ultimately the body element. So
+ // we make sure to give focus to the tabbable element on mouse down so
+ // it works consistently across browsers.
-/**
- * Measure and return the element bounding box.
- *
- * We convert the box into an AxisBox2D to make it easier to work with each axis
- * individually and programmatically.
- *
- * This function optionally accepts a transformPagePoint function which allows us to compensate
- * for, for instance, measuring the element within a scaled plane like a Framer devivce preview component.
- */
-function getBoundingBox(element, transformPagePoint) {
- var box = element.getBoundingClientRect();
- return convertBoundingBoxToAxisBox(transformBoundingBox(box, transformPagePoint));
-}
+ if (!isSafariOrFirefoxOnMac) return;
+ if (isPortalEvent(event)) return;
+ if (!isButton(element)) return; // We can't focus right away after on mouse down, otherwise it would
+ // prevent drag events from happening. So we schedule the focus to the
+ // next animation frame.
+ var raf = requestAnimationFrame(function () {
+ element.removeEventListener("mouseup", focusImmediately, true);
+ focusIfNeeded(element);
+ }); // If mouseUp happens before the next animation frame (which is common
+ // on touch screens or by just tapping the trackpad on MacBook's), we
+ // cancel the animation frame and immediately focus on the element.
+ var focusImmediately = function focusImmediately() {
+ cancelAnimationFrame(raf);
+ focusIfNeeded(element);
+ }; // By listening to the event in the capture phase, we make sure the
+ // focus event is fired before the onMouseUp and onMouseUpCapture React
+ // events, which is aligned with the default browser behavior.
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/geometry/delta-calc.js
+ element.addEventListener("mouseup", focusImmediately, {
+ once: true,
+ capture: true
+ });
+ }, []);
+ return _objectSpread2({
+ ref: useForkRef(ref, htmlRef),
+ style: style,
+ tabIndex: getTabIndex(trulyDisabled, nativeTabbable, supportsDisabled, htmlTabIndex),
+ disabled: trulyDisabled && supportsDisabled ? true : undefined,
+ "aria-disabled": options.disabled ? true : undefined,
+ onClickCapture: onClickCapture,
+ onMouseDownCapture: onMouseDownCapture,
+ onMouseDown: onMouseDown,
+ onKeyPressCapture: onKeyPressCapture
+ }, htmlProps);
+ }
+});
+var Tabbable = createComponent({
+ as: "div",
+ useHook: useTabbable
+});
-var clampProgress = function (v) { return clamp_clamp(0, 1, v); };
-/**
- * Returns true if the provided value is within maxDistance of the provided target
- */
-function isNear(value, target, maxDistance) {
- if (target === void 0) { target = 0; }
- if (maxDistance === void 0) { maxDistance = 0.01; }
- return distance_distance(value, target) < maxDistance;
-}
-function calcLength(axis) {
- return axis.max - axis.min;
-}
-/**
- * Calculate a transform origin relative to the source axis, between 0-1, that results
- * in an asthetically pleasing scale/transform needed to project from source to target.
- */
-function delta_calc_calcOrigin(source, target) {
- var origin = 0.5;
- var sourceLength = calcLength(source);
- var targetLength = calcLength(target);
- if (targetLength > sourceLength) {
- origin = progress_progress(target.min, target.max - sourceLength, source.min);
- }
- else if (sourceLength > targetLength) {
- origin = progress_progress(source.min, source.max - targetLength, target.min);
- }
- return clampProgress(origin);
-}
-/**
- * Update the AxisDelta with a transform that projects source into target.
- *
- * The transform `origin` is optional. If not provided, it'll be automatically
- * calculated based on the relative positions of the two bounding boxes.
- */
-function updateAxisDelta(delta, source, target, origin) {
- if (origin === void 0) { origin = 0.5; }
- delta.origin = origin;
- delta.originPoint = mix(source.min, source.max, delta.origin);
- delta.scale = calcLength(target) / calcLength(source);
- if (isNear(delta.scale, 1, 0.0001))
- delta.scale = 1;
- delta.translate =
- mix(target.min, target.max, delta.origin) - delta.originPoint;
- if (isNear(delta.translate))
- delta.translate = 0;
-}
-/**
- * Update the BoxDelta with a transform that projects the source into the target.
- *
- * The transform `origin` is optional. If not provided, it'll be automatically
- * calculated based on the relative positions of the two bounding boxes.
- */
-function updateBoxDelta(delta, source, target, origin) {
- updateAxisDelta(delta.x, source.x, target.x, defaultOrigin(origin.originX));
- updateAxisDelta(delta.y, source.y, target.y, defaultOrigin(origin.originY));
-}
-/**
- * Currently this only accepts numerical origins, measured as 0-1, but could
- * accept pixel values by comparing to the target axis.
- */
-function defaultOrigin(origin) {
- return typeof origin === "number" ? origin : 0.5;
-}
-function calcRelativeAxis(target, relative, parent) {
- target.min = parent.min + relative.min;
- target.max = target.min + calcLength(relative);
-}
-function calcRelativeBox(projection, parentProjection) {
- calcRelativeAxis(projection.target.x, projection.relativeTarget.x, parentProjection.target.x);
- calcRelativeAxis(projection.target.y, projection.relativeTarget.y, parentProjection.target.y);
-}
+;// CONCATENATED MODULE: ./node_modules/reakit/es/Clickable/Clickable.js
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/compare-by-depth.js
-var compareByDepth = function (a, b) {
- return a.depth - b.depth;
-};
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/utils.js
-function isProjecting(visualElement) {
- var isEnabled = visualElement.projection.isEnabled;
- return isEnabled || visualElement.shouldResetTransform();
-}
-function collectProjectingAncestors(visualElement, ancestors) {
- if (ancestors === void 0) { ancestors = []; }
- var parent = visualElement.parent;
- if (parent)
- collectProjectingAncestors(parent, ancestors);
- if (isProjecting(visualElement))
- ancestors.push(visualElement);
- return ancestors;
-}
-function collectProjectingChildren(visualElement) {
- var children = [];
- var addChild = function (child) {
- if (isProjecting(child))
- children.push(child);
- child.children.forEach(addChild);
- };
- visualElement.children.forEach(addChild);
- return children.sort(compareByDepth);
-}
-/**
- * Update the layoutState by measuring the DOM layout. This
- * should be called after resetting any layout-affecting transforms.
- */
-function updateLayoutMeasurement(visualElement) {
- if (visualElement.shouldResetTransform())
- return;
- var layoutState = visualElement.getLayoutState();
- visualElement.notifyBeforeLayoutMeasure(layoutState.layout);
- layoutState.isHydrated = true;
- layoutState.layout = visualElement.measureViewportBox();
- layoutState.layoutCorrected = copyAxisBox(layoutState.layout);
- visualElement.notifyLayoutMeasure(layoutState.layout, visualElement.prevViewportBox || layoutState.layout);
- dist_es.update(function () { return visualElement.rebaseProjectionTarget(); });
-}
-/**
- * Record the viewport box as it was before an expected mutation/re-render
- */
-function snapshotViewportBox(visualElement) {
- if (visualElement.shouldResetTransform())
- return;
- visualElement.prevViewportBox = visualElement.measureViewportBox(false);
- /**
- * Update targetBox to match the prevViewportBox. This is just to ensure
- * that targetBox is affected by scroll in the same way as the measured box
- */
- visualElement.rebaseProjectionTarget(false, visualElement.prevViewportBox);
-}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/utils.js
-function tweenAxis(target, prev, next, p) {
- target.min = mix(prev.min, next.min, p);
- target.max = mix(prev.max, next.max, p);
-}
-function calcRelativeOffsetAxis(parent, child) {
- return {
- min: child.min - parent.min,
- max: child.max - parent.min,
- };
-}
-function calcRelativeOffset(parent, child) {
- return {
- x: calcRelativeOffsetAxis(parent.x, child.x),
- y: calcRelativeOffsetAxis(parent.y, child.y),
- };
-}
-function checkIfParentHasChanged(prev, next) {
- var prevId = prev.getLayoutId();
- var nextId = next.getLayoutId();
- return prevId !== nextId || (nextId === undefined && prev !== next);
-}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/is-draggable.js
-function isDraggable(visualElement) {
- var _a = visualElement.getProps(), drag = _a.drag, _dragX = _a._dragX;
- return drag && !_dragX;
-}
+// Automatically generated
+var CLICKABLE_KEYS = ["unstable_clickOnEnter", "unstable_clickOnSpace"];
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/utils/geometry/delta-apply.js
+function isNativeClick(event) {
+ var element = event.currentTarget;
+ if (!event.isTrusted) return false; // istanbul ignore next: can't test trusted events yet
+ return isButton(element) || element.tagName === "INPUT" || element.tagName === "TEXTAREA" || element.tagName === "A" || element.tagName === "SELECT";
+}
+var useClickable = createHook({
+ name: "Clickable",
+ compose: useTabbable,
+ keys: CLICKABLE_KEYS,
+ useOptions: function useOptions(_ref) {
+ var _ref$unstable_clickOn = _ref.unstable_clickOnEnter,
+ unstable_clickOnEnter = _ref$unstable_clickOn === void 0 ? true : _ref$unstable_clickOn,
+ _ref$unstable_clickOn2 = _ref.unstable_clickOnSpace,
+ unstable_clickOnSpace = _ref$unstable_clickOn2 === void 0 ? true : _ref$unstable_clickOn2,
+ options = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(_ref, ["unstable_clickOnEnter", "unstable_clickOnSpace"]);
+ return _objectSpread2({
+ unstable_clickOnEnter: unstable_clickOnEnter,
+ unstable_clickOnSpace: unstable_clickOnSpace
+ }, options);
+ },
+ useProps: function useProps(options, _ref2) {
+ var htmlOnKeyDown = _ref2.onKeyDown,
+ htmlOnKeyUp = _ref2.onKeyUp,
+ htmlProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(_ref2, ["onKeyDown", "onKeyUp"]);
-/**
- * Reset an axis to the provided origin box.
- *
- * This is a mutative operation.
- */
-function resetAxis(axis, originAxis) {
- axis.min = originAxis.min;
- axis.max = originAxis.max;
-}
-/**
- * Reset a box to the provided origin box.
- *
- * This is a mutative operation.
- */
-function resetBox(box, originBox) {
- resetAxis(box.x, originBox.x);
- resetAxis(box.y, originBox.y);
+ var _React$useState = (0,external_React_.useState)(false),
+ active = _React$useState[0],
+ setActive = _React$useState[1];
+
+ var onKeyDownRef = useLiveRef(htmlOnKeyDown);
+ var onKeyUpRef = useLiveRef(htmlOnKeyUp);
+ var onKeyDown = (0,external_React_.useCallback)(function (event) {
+ var _onKeyDownRef$current;
+
+ (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event);
+ if (event.defaultPrevented) return;
+ if (options.disabled) return;
+ if (event.metaKey) return;
+ if (!isSelfTarget(event)) return;
+ var isEnter = options.unstable_clickOnEnter && event.key === "Enter";
+ var isSpace = options.unstable_clickOnSpace && event.key === " ";
+
+ if (isEnter || isSpace) {
+ if (isNativeClick(event)) return;
+ event.preventDefault();
+
+ if (isEnter) {
+ event.currentTarget.click();
+ } else if (isSpace) {
+ setActive(true);
+ }
+ }
+ }, [options.disabled, options.unstable_clickOnEnter, options.unstable_clickOnSpace]);
+ var onKeyUp = (0,external_React_.useCallback)(function (event) {
+ var _onKeyUpRef$current;
+
+ (_onKeyUpRef$current = onKeyUpRef.current) === null || _onKeyUpRef$current === void 0 ? void 0 : _onKeyUpRef$current.call(onKeyUpRef, event);
+ if (event.defaultPrevented) return;
+ if (options.disabled) return;
+ if (event.metaKey) return;
+ var isSpace = options.unstable_clickOnSpace && event.key === " ";
+
+ if (active && isSpace) {
+ setActive(false);
+ event.currentTarget.click();
+ }
+ }, [options.disabled, options.unstable_clickOnSpace, active]);
+ return _objectSpread2({
+ "data-active": active || undefined,
+ onKeyDown: onKeyDown,
+ onKeyUp: onKeyUp
+ }, htmlProps);
+ }
+});
+var Clickable = createComponent({
+ as: "button",
+ memo: true,
+ useHook: useClickable
+});
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit/es/getCurrentId-5aa9849e.js
+function findFirstEnabledItem(items, excludeId) {
+ if (excludeId) {
+ return items.find(function (item) {
+ return !item.disabled && item.id !== excludeId;
+ });
+ }
+
+ return items.find(function (item) {
+ return !item.disabled;
+ });
}
-/**
- * Scales a point based on a factor and an originPoint
- */
-function scalePoint(point, scale, originPoint) {
- var distanceFromOrigin = point - originPoint;
- var scaled = scale * distanceFromOrigin;
- return originPoint + scaled;
+
+function getCurrentId(options, passedId) {
+ var _findFirstEnabledItem;
+
+ if (passedId || passedId === null) {
+ return passedId;
+ }
+
+ if (options.currentId || options.currentId === null) {
+ return options.currentId;
+ }
+
+ return (_findFirstEnabledItem = findFirstEnabledItem(options.items || [])) === null || _findFirstEnabledItem === void 0 ? void 0 : _findFirstEnabledItem.id;
}
-/**
- * Applies a translate/scale delta to a point
- */
-function applyPointDelta(point, translate, scale, originPoint, boxScale) {
- if (boxScale !== undefined) {
- point = scalePoint(point, boxScale, originPoint);
- }
- return scalePoint(point, scale, originPoint) + translate;
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit/es/__keys-6742f591.js
+// Automatically generated
+var COMPOSITE_STATE_KEYS = ["baseId", "unstable_idCountRef", "setBaseId", "unstable_virtual", "rtl", "orientation", "items", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "registerItem", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget"];
+var COMPOSITE_KEYS = COMPOSITE_STATE_KEYS;
+var COMPOSITE_GROUP_KEYS = COMPOSITE_KEYS;
+var COMPOSITE_ITEM_KEYS = COMPOSITE_GROUP_KEYS;
+var COMPOSITE_ITEM_WIDGET_KEYS = (/* unused pure expression or super */ null && (COMPOSITE_ITEM_KEYS));
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit/es/userFocus-e16425e3.js
+function userFocus(element) {
+ element.userFocus = true;
+ element.focus();
+ element.userFocus = false;
}
-/**
- * Applies a translate/scale delta to an axis
- */
-function applyAxisDelta(axis, translate, scale, originPoint, boxScale) {
- if (translate === void 0) { translate = 0; }
- if (scale === void 0) { scale = 1; }
- axis.min = applyPointDelta(axis.min, translate, scale, originPoint, boxScale);
- axis.max = applyPointDelta(axis.max, translate, scale, originPoint, boxScale);
+function hasUserFocus(element) {
+ return !!element.userFocus;
}
-/**
- * Applies a translate/scale delta to a box
- */
-function applyBoxDelta(box, _a) {
- var x = _a.x, y = _a.y;
- applyAxisDelta(box.x, x.translate, x.scale, x.originPoint);
- applyAxisDelta(box.y, y.translate, y.scale, y.originPoint);
+function setUserFocus(element, value) {
+ element.userFocus = value;
}
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/isTextField.js
/**
- * Apply a transform to an axis from the latest resolved motion values.
- * This function basically acts as a bridge between a flat motion value map
- * and applyAxisDelta
+ * Check whether the given element is a text field, where text field is defined
+ * by the ability to select within the input, or that it is contenteditable.
+ *
+ * @example
+ * import { isTextField } from "reakit-utils";
+ *
+ * isTextField(document.querySelector("div")); // false
+ * isTextField(document.querySelector("input")); // true
+ * isTextField(document.querySelector("input[type='button']")); // false
+ * isTextField(document.querySelector("textarea")); // true
+ * isTextField(document.querySelector("div[contenteditable='true']")); // true
*/
-function applyAxisTransforms(final, axis, transforms, _a) {
- var _b = __read(_a, 3), key = _b[0], scaleKey = _b[1], originKey = _b[2];
- // Copy the current axis to the final axis before mutation
- final.min = axis.min;
- final.max = axis.max;
- var axisOrigin = transforms[originKey] !== undefined ? transforms[originKey] : 0.5;
- var originPoint = mix(axis.min, axis.max, axisOrigin);
- // Apply the axis delta to the final axis
- applyAxisDelta(final, transforms[key], transforms[scaleKey], originPoint, transforms.scale);
+function isTextField(element) {
+ try {
+ var isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null;
+ var isTextArea = element.tagName === "TEXTAREA";
+ var isContentEditable = element.contentEditable === "true";
+ return isTextInput || isTextArea || isContentEditable || false;
+ } catch (error) {
+ // Safari throws an exception when trying to get `selectionStart`
+ // on non-text <input> elements (which, understandably, don't
+ // have the text selection API). We catch this via a try/catch
+ // block, as opposed to a more explicit check of the element's
+ // input types, because of Safari's non-standard behavior. This
+ // also means we don't have to worry about the list of input
+ // types that support `selectionStart` changing as the HTML spec
+ // evolves over time.
+ return false;
+ }
}
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/hasFocus.js
+
+
+
/**
- * The names of the motion values we want to apply as translation, scale and origin.
- */
-var xKeys = ["x", "scaleX", "originX"];
-var yKeys = ["y", "scaleY", "originY"];
-/**
- * Apply a transform to a box from the latest resolved motion values.
+ * Checks if `element` has focus. Elements that are referenced by
+ * `aria-activedescendant` are also considered.
+ *
+ * @example
+ * import { hasFocus } from "reakit-utils";
+ *
+ * hasFocus(document.getElementById("id"));
*/
-function applyBoxTransforms(finalBox, box, transforms) {
- applyAxisTransforms(finalBox.x, box.x, transforms, xKeys);
- applyAxisTransforms(finalBox.y, box.y, transforms, yKeys);
+
+function hasFocus(element) {
+ var activeElement = getActiveElement_getActiveElement(element);
+ if (!activeElement) return false;
+ if (activeElement === element) return true;
+ var activeDescendant = activeElement.getAttribute("aria-activedescendant");
+ if (!activeDescendant) return false;
+ return activeDescendant === element.id;
}
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/ensureFocus.js
+
+
+
+
/**
- * Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse
+ * Ensures `element` will receive focus if it's not already.
+ *
+ * @example
+ * import { ensureFocus } from "reakit-utils";
+ *
+ * ensureFocus(document.activeElement); // does nothing
+ *
+ * const element = document.querySelector("input");
+ *
+ * ensureFocus(element); // focuses element
+ * ensureFocus(element, { preventScroll: true }); // focuses element preventing scroll jump
+ *
+ * function isActive(el) {
+ * return el.dataset.active === "true";
+ * }
+ *
+ * ensureFocus(document.querySelector("[data-active='true']"), { isActive }); // does nothing
+ *
+ * @returns {number} `requestAnimationFrame` call ID so it can be passed to `cancelAnimationFrame` if needed.
*/
-function removePointDelta(point, translate, scale, originPoint, boxScale) {
- point -= translate;
- point = scalePoint(point, 1 / scale, originPoint);
- if (boxScale !== undefined) {
- point = scalePoint(point, 1 / boxScale, originPoint);
- }
- return point;
+function ensureFocus(element, _temp) {
+ var _ref = _temp === void 0 ? {} : _temp,
+ preventScroll = _ref.preventScroll,
+ _ref$isActive = _ref.isActive,
+ isActive = _ref$isActive === void 0 ? hasFocus : _ref$isActive;
+
+ if (isActive(element)) return -1;
+ element.focus({
+ preventScroll: preventScroll
+ });
+ if (isActive(element)) return -1;
+ return requestAnimationFrame(function () {
+ element.focus({
+ preventScroll: preventScroll
+ });
+ });
}
-/**
- * Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse
- */
-function removeAxisDelta(axis, translate, scale, origin, boxScale) {
- if (translate === void 0) { translate = 0; }
- if (scale === void 0) { scale = 1; }
- if (origin === void 0) { origin = 0.5; }
- var originPoint = mix(axis.min, axis.max, origin) - translate;
- axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);
- axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit/es/Id/IdProvider.js
+
+
+var defaultPrefix = "id";
+function generateRandomString(prefix) {
+ if (prefix === void 0) {
+ prefix = defaultPrefix;
+ }
+
+ return "" + (prefix ? prefix + "-" : "") + Math.random().toString(32).substr(2, 6);
}
-/**
- * Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse
- * and acts as a bridge between motion values and removeAxisDelta
- */
-function removeAxisTransforms(axis, transforms, _a) {
- var _b = __read(_a, 3), key = _b[0], scaleKey = _b[1], originKey = _b[2];
- removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale);
+
+var unstable_IdContext = /*#__PURE__*/(0,external_React_.createContext)(generateRandomString);
+function unstable_IdProvider(_ref) {
+ var children = _ref.children,
+ _ref$prefix = _ref.prefix,
+ prefix = _ref$prefix === void 0 ? defaultPrefix : _ref$prefix;
+ var count = useRef(0);
+ var generateId = useCallback(function (localPrefix) {
+ if (localPrefix === void 0) {
+ localPrefix = prefix;
+ }
+
+ return "" + (localPrefix ? localPrefix + "-" : "") + ++count.current;
+ }, [prefix]);
+ return /*#__PURE__*/createElement(unstable_IdContext.Provider, {
+ value: generateId
+ }, children);
}
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit/es/Id/Id.js
+
+
+
+
+
+
+// Automatically generated
+var ID_STATE_KEYS = ["baseId", "unstable_idCountRef", "setBaseId"];
+var ID_KEYS = [].concat(ID_STATE_KEYS, ["id"]);
+
+var unstable_useId = createHook({
+ keys: ID_KEYS,
+ useOptions: function useOptions(options, htmlProps) {
+ var generateId = (0,external_React_.useContext)(unstable_IdContext);
+
+ var _React$useState = (0,external_React_.useState)(function () {
+ // This comes from useIdState
+ if (options.unstable_idCountRef) {
+ options.unstable_idCountRef.current += 1;
+ return "-" + options.unstable_idCountRef.current;
+ } // If there's no useIdState, we check if `baseId` was passed (as a prop,
+ // not from useIdState).
+
+
+ if (options.baseId) {
+ return "-" + generateId("");
+ }
+
+ return "";
+ }),
+ suffix = _React$useState[0]; // `baseId` will be the prop passed directly as a prop or via useIdState.
+ // If there's neither, then it'll fallback to Context's generateId.
+ // This generateId can result in a sequential ID (if there's a Provider)
+ // or a random string (without Provider).
+
+
+ var baseId = (0,external_React_.useMemo)(function () {
+ return options.baseId || generateId();
+ }, [options.baseId, generateId]);
+ var id = htmlProps.id || options.id || "" + baseId + suffix;
+ return _objectSpread2(_objectSpread2({}, options), {}, {
+ id: id
+ });
+ },
+ useProps: function useProps(options, htmlProps) {
+ return _objectSpread2({
+ id: options.id
+ }, htmlProps);
+ }
+});
+var unstable_Id = createComponent({
+ as: "div",
+ useHook: unstable_useId
+});
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/createEvent.js
+
+
/**
- * Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse
- * and acts as a bridge between motion values and removeAxisDelta
+ * Creates an `Event` in a way that also works on IE 11.
+ *
+ * @example
+ * import { createEvent } from "reakit-utils";
+ *
+ * const el = document.getElementById("id");
+ * el.dispatchEvent(createEvent(el, "blur", { bubbles: false }));
*/
-function removeBoxTransforms(box, transforms) {
- removeAxisTransforms(box.x, transforms, xKeys);
- removeAxisTransforms(box.y, transforms, yKeys);
+
+function createEvent(element, type, eventInit) {
+ if (typeof Event === "function") {
+ return new Event(type, eventInit);
+ } // IE 11 doesn't support Event constructors
+
+
+ var event = getDocument(element).createEvent("Event");
+ event.initEvent(type, eventInit === null || eventInit === void 0 ? void 0 : eventInit.bubbles, eventInit === null || eventInit === void 0 ? void 0 : eventInit.cancelable);
+ return event;
}
+
+
+
+;// CONCATENATED MODULE: ./node_modules/reakit-utils/es/fireEvent.js
+
+
+
/**
- * Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms
- * in a tree upon our box before then calculating how to project it into our desired viewport-relative box
+ * Creates and dispatches `Event` in a way that also works on IE 11.
*
- * This is the final nested loop within updateLayoutDelta for future refactoring
+ * @example
+ * import { fireEvent } from "reakit-utils";
+ *
+ * fireEvent(document.getElementById("id"), "blur", {
+ * bubbles: true,
+ * cancelable: true,
+ * });
*/
-function applyTreeDeltas(box, treeScale, treePath) {
- var treeLength = treePath.length;
- if (!treeLength)
- return;
- // Reset the treeScale
- treeScale.x = treeScale.y = 1;
- var node;
- var delta;
- for (var i = 0; i < treeLength; i++) {
- node = treePath[i];
- delta = node.getLayoutState().delta;
- // Incoporate each ancestor's scale into a culmulative treeScale for this component
- treeScale.x *= delta.x.scale;
- treeScale.y *= delta.y.scale;
- // Apply each ancestor's calculated delta into this component's recorded layout box
- applyBoxDelta(box, delta);
- // If this is a draggable ancestor, also incorporate the node's transform to the layout box
- if (isDraggable(node)) {
- applyBoxTransforms(box, box, node.getLatestValues());
- }
- }
+
+function fireEvent(element, type, eventInit) {
+ return element.dispatchEvent(createEvent(element, type, eventInit));
}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/convert-to-relative.js
+;// CONCATENATED MODULE: ./node_modules/reakit/es/setTextFieldValue-0a221f4e.js
+function setTextFieldValue(element, value) {
+ if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) {
+ var _Object$getOwnPropert;
+ var proto = Object.getPrototypeOf(element);
+ var setValue = (_Object$getOwnPropert = Object.getOwnPropertyDescriptor(proto, "value")) === null || _Object$getOwnPropert === void 0 ? void 0 : _Object$getOwnPropert.set;
-/**
- * Returns a boolean stating whether or not we converted the projection
- * to relative projection.
- */
-function convertToRelativeProjection(visualElement, isLayoutDrag) {
- if (isLayoutDrag === void 0) { isLayoutDrag = true; }
- var projectionParent = visualElement.getProjectionParent();
- if (!projectionParent)
- return false;
- var offset;
- if (isLayoutDrag) {
- offset = calcRelativeOffset(projectionParent.projection.target, visualElement.projection.target);
- removeBoxTransforms(offset, projectionParent.getLatestValues());
- }
- else {
- offset = calcRelativeOffset(projectionParent.getLayoutState().layout, visualElement.getLayoutState().layout);
+ if (setValue) {
+ setValue.call(element, value);
+ fireEvent(element, "input", {
+ bubbles: true
+ });
}
- eachAxis(function (axis) {
- return visualElement.setProjectionTargetAxis(axis, offset[axis].min, offset[axis].max, true);
- });
- return true;
+ }
}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/batch-layout.js
-var unresolvedJobs = new Set();
-function pushJob(stack, job, pointer) {
- if (!stack[pointer])
- stack[pointer] = [];
- stack[pointer].push(job);
-}
-function batchLayout(callback) {
- unresolvedJobs.add(callback);
- return function () { return unresolvedJobs.delete(callback); };
-}
-function flushLayout() {
- if (!unresolvedJobs.size)
- return;
- var pointer = 0;
- var reads = [[]];
- var writes = [];
- var setRead = function (job) { return pushJob(reads, job, pointer); };
- var setWrite = function (job) {
- pushJob(writes, job, pointer);
- pointer++;
- };
- /**
- * Resolve jobs into their array stacks
- */
- unresolvedJobs.forEach(function (callback) {
- callback(setRead, setWrite);
- pointer = 0;
- });
- unresolvedJobs.clear();
- /**
- * Execute jobs
- */
- var numStacks = writes.length;
- for (var i = 0; i <= numStacks; i++) {
- reads[i] && reads[i].forEach(executeJob);
- writes[i] && writes[i].forEach(executeJob);
- }
-}
-var executeJob = function (job) { return job(); };
+;// CONCATENATED MODULE: ./node_modules/reakit/es/Composite/CompositeItem.js
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js
@@ -20904,4382 +18502,3539 @@ var executeJob = function (job) { return job(); };
-var elementDragControls = new WeakMap();
-/**
- *
- */
-var lastPointerEvent;
-var VisualElementDragControls_VisualElementDragControls = /** @class */ (function () {
- function VisualElementDragControls(_a) {
- var visualElement = _a.visualElement;
- /**
- * Track whether we're currently dragging.
- *
- * @internal
- */
- this.isDragging = false;
- /**
- * The current direction of drag, or `null` if both.
- *
- * @internal
- */
- this.currentDirection = null;
- /**
- * The permitted boundaries of travel, in pixels.
- *
- * @internal
- */
- this.constraints = false;
- /**
- * The per-axis resolved elastic values.
- *
- * @internal
- */
- this.elastic = axisBox();
- /**
- * A reference to the host component's latest props.
- *
- * @internal
- */
- this.props = {};
- /**
- * @internal
- */
- this.hasMutatedConstraints = false;
- /**
- * Track the initial position of the cursor relative to the dragging element
- * when dragging starts as a value of 0-1 on each axis. We then use this to calculate
- * an ideal bounding box for the VisualElement renderer to project into every frame.
- *
- * @internal
- */
- this.cursorProgress = {
- x: 0.5,
- y: 0.5,
- };
- // When updating _dragX, or _dragY instead of the VisualElement,
- // persist their values between drag gestures.
- this.originPoint = {};
- // This is a reference to the global drag gesture lock, ensuring only one component
- // can "capture" the drag of one or both axes.
- // TODO: Look into moving this into pansession?
- this.openGlobalLock = null;
- /**
- * @internal
- */
- this.panSession = null;
- this.visualElement = visualElement;
- this.visualElement.enableLayoutProjection();
- elementDragControls.set(visualElement, this);
+
+
+
+
+function getWidget(itemElement) {
+ return itemElement.querySelector("[data-composite-item-widget]");
+}
+
+function useItem(options) {
+ return (0,external_React_.useMemo)(function () {
+ var _options$items;
+
+ return (_options$items = options.items) === null || _options$items === void 0 ? void 0 : _options$items.find(function (item) {
+ return options.id && item.id === options.id;
+ });
+ }, [options.items, options.id]);
+}
+
+function targetIsAnotherItem(event, items) {
+ if (isSelfTarget(event)) return false;
+
+ for (var _iterator = _createForOfIteratorHelperLoose(items), _step; !(_step = _iterator()).done;) {
+ var item = _step.value;
+
+ if (item.ref.current === event.target) {
+ return true;
}
- /**
- * Instantiate a PanSession for the drag gesture
- *
- * @public
- */
- VisualElementDragControls.prototype.start = function (originEvent, _a) {
- var _this = this;
- var _b = _a === void 0 ? {} : _a, _c = _b.snapToCursor, snapToCursor = _c === void 0 ? false : _c, cursorProgress = _b.cursorProgress;
- var onSessionStart = function (event) {
- var _a;
- // Stop any animations on both axis values immediately. This allows the user to throw and catch
- // the component.
- _this.stopMotion();
- /**
- * Save the initial point. We'll use this to calculate the pointer's position rather
- * than the one we receive when the gesture actually starts. By then, the pointer will
- * have already moved, and the perception will be of the pointer "slipping" across the element
- */
- var initialPoint = getViewportPointFromEvent(event).point;
- (_a = _this.cancelLayout) === null || _a === void 0 ? void 0 : _a.call(_this);
- _this.cancelLayout = batchLayout(function (read, write) {
- var ancestors = collectProjectingAncestors(_this.visualElement);
- var children = collectProjectingChildren(_this.visualElement);
- var tree = __spreadArray(__spreadArray([], __read(ancestors)), __read(children));
- var hasManuallySetCursorOrigin = false;
- /**
- * Apply a simple lock to the projection target. This ensures no animations
- * can run on the projection box while this lock is active.
- */
- _this.isLayoutDrag() && _this.visualElement.lockProjectionTarget();
- write(function () {
- tree.forEach(function (element) { return element.resetTransform(); });
- });
- read(function () {
- updateLayoutMeasurement(_this.visualElement);
- children.forEach(updateLayoutMeasurement);
- });
- write(function () {
- tree.forEach(function (element) { return element.restoreTransform(); });
- if (snapToCursor) {
- hasManuallySetCursorOrigin = _this.snapToCursor(initialPoint);
- }
- });
- read(function () {
- var isRelativeDrag = Boolean(_this.getAxisMotionValue("x") && !_this.isExternalDrag());
- if (!isRelativeDrag) {
- _this.visualElement.rebaseProjectionTarget(true, _this.visualElement.measureViewportBox(false));
- }
- _this.visualElement.scheduleUpdateLayoutProjection();
- /**
- * When dragging starts, we want to find where the cursor is relative to the bounding box
- * of the element. Every frame, we calculate a new bounding box using this relative position
- * and let the visualElement renderer figure out how to reproject the element into this bounding
- * box.
- *
- * By doing it this way, rather than applying an x/y transform directly to the element,
- * we can ensure the component always visually sticks to the cursor as we'd expect, even
- * if the DOM element itself changes layout as a result of React updates the user might
- * make based on the drag position.
- */
- var projection = _this.visualElement.projection;
- eachAxis(function (axis) {
- if (!hasManuallySetCursorOrigin) {
- var _a = projection.target[axis], min = _a.min, max = _a.max;
- _this.cursorProgress[axis] = cursorProgress
- ? cursorProgress[axis]
- : progress_progress(min, max, initialPoint[axis]);
- }
- /**
- * If we have external drag MotionValues, record their origin point. On pointermove
- * we'll apply the pan gesture offset directly to this value.
- */
- var axisValue = _this.getAxisMotionValue(axis);
- if (axisValue) {
- _this.originPoint[axis] = axisValue.get();
- }
- });
- });
- write(function () {
- flushSync.update();
- flushSync.preRender();
- flushSync.render();
- flushSync.postRender();
- });
- read(function () { return _this.resolveDragConstraints(); });
- });
- };
- var onStart = function (event, info) {
- var _a, _b, _c;
- // Attempt to grab the global drag gesture lock - maybe make this part of PanSession
- var _d = _this.props, drag = _d.drag, dragPropagation = _d.dragPropagation;
- if (drag && !dragPropagation) {
- if (_this.openGlobalLock)
- _this.openGlobalLock();
- _this.openGlobalLock = getGlobalLock(drag);
- // If we don 't have the lock, don't start dragging
- if (!_this.openGlobalLock)
- return;
- }
- flushLayout();
- // Set current drag status
- _this.isDragging = true;
- _this.currentDirection = null;
- // Fire onDragStart event
- (_b = (_a = _this.props).onDragStart) === null || _b === void 0 ? void 0 : _b.call(_a, event, info);
- (_c = _this.visualElement.animationState) === null || _c === void 0 ? void 0 : _c.setActive(AnimationType.Drag, true);
- };
- var onMove = function (event, info) {
- var _a, _b, _c, _d;
- var _e = _this.props, dragPropagation = _e.dragPropagation, dragDirectionLock = _e.dragDirectionLock;
- // If we didn't successfully receive the gesture lock, early return.
- if (!dragPropagation && !_this.openGlobalLock)
- return;
- var offset = info.offset;
- // Attempt to detect drag direction if directionLock is true
- if (dragDirectionLock && _this.currentDirection === null) {
- _this.currentDirection = getCurrentDirection(offset);
- // If we've successfully set a direction, notify listener
- if (_this.currentDirection !== null) {
- (_b = (_a = _this.props).onDirectionLock) === null || _b === void 0 ? void 0 : _b.call(_a, _this.currentDirection);
- }
- return;
- }
- // Update each point with the latest position
- _this.updateAxis("x", info.point, offset);
- _this.updateAxis("y", info.point, offset);
- // Fire onDrag event
- (_d = (_c = _this.props).onDrag) === null || _d === void 0 ? void 0 : _d.call(_c, event, info);
- // Update the last pointer event
- lastPointerEvent = event;
- };
- var onSessionEnd = function (event, info) {
- return _this.stop(event, info);
- };
- var transformPagePoint = this.props.transformPagePoint;
- this.panSession = new PanSession_PanSession(originEvent, {
- onSessionStart: onSessionStart,
- onStart: onStart,
- onMove: onMove,
- onSessionEnd: onSessionEnd,
- }, { transformPagePoint: transformPagePoint });
- };
- VisualElementDragControls.prototype.resolveDragConstraints = function () {
- var _this = this;
- var _a = this.props, dragConstraints = _a.dragConstraints, dragElastic = _a.dragElastic;
- var layout = this.visualElement.getLayoutState().layoutCorrected;
- if (dragConstraints) {
- this.constraints = isRefObject(dragConstraints)
- ? this.resolveRefConstraints(layout, dragConstraints)
- : calcRelativeConstraints(layout, dragConstraints);
- }
- else {
- this.constraints = false;
+ }
+
+ return false;
+}
+
+var useCompositeItem = createHook({
+ name: "CompositeItem",
+ compose: [useClickable, unstable_useId],
+ keys: COMPOSITE_ITEM_KEYS,
+ propsAreEqual: function propsAreEqual(prev, next) {
+ if (!next.id || prev.id !== next.id) {
+ return useClickable.unstable_propsAreEqual(prev, next);
+ }
+
+ var prevCurrentId = prev.currentId,
+ prevMoves = prev.unstable_moves,
+ prevProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(prev, ["currentId", "unstable_moves"]);
+
+ var nextCurrentId = next.currentId,
+ nextMoves = next.unstable_moves,
+ nextProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(next, ["currentId", "unstable_moves"]);
+
+ if (nextCurrentId !== prevCurrentId) {
+ if (next.id === nextCurrentId || next.id === prevCurrentId) {
+ return false;
+ }
+ } else if (prevMoves !== nextMoves) {
+ return false;
+ }
+
+ return useClickable.unstable_propsAreEqual(prevProps, nextProps);
+ },
+ useOptions: function useOptions(options) {
+ return _objectSpread2(_objectSpread2({}, options), {}, {
+ id: options.id,
+ currentId: getCurrentId(options),
+ unstable_clickOnSpace: options.unstable_hasActiveWidget ? false : options.unstable_clickOnSpace
+ });
+ },
+ useProps: function useProps(options, _ref) {
+ var _options$items2;
+
+ var htmlRef = _ref.ref,
+ _ref$tabIndex = _ref.tabIndex,
+ htmlTabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex,
+ htmlOnMouseDown = _ref.onMouseDown,
+ htmlOnFocus = _ref.onFocus,
+ htmlOnBlurCapture = _ref.onBlurCapture,
+ htmlOnKeyDown = _ref.onKeyDown,
+ htmlOnClick = _ref.onClick,
+ htmlProps = _rollupPluginBabelHelpers_1f0bf8c2_objectWithoutPropertiesLoose(_ref, ["ref", "tabIndex", "onMouseDown", "onFocus", "onBlurCapture", "onKeyDown", "onClick"]);
+
+ var ref = (0,external_React_.useRef)(null);
+ var id = options.id;
+ var trulyDisabled = options.disabled && !options.focusable;
+ var isCurrentItem = options.currentId === id;
+ var isCurrentItemRef = useLiveRef(isCurrentItem);
+ var hasFocusedComposite = (0,external_React_.useRef)(false);
+ var item = useItem(options);
+ var onMouseDownRef = useLiveRef(htmlOnMouseDown);
+ var onFocusRef = useLiveRef(htmlOnFocus);
+ var onBlurCaptureRef = useLiveRef(htmlOnBlurCapture);
+ var onKeyDownRef = useLiveRef(htmlOnKeyDown);
+ var onClickRef = useLiveRef(htmlOnClick);
+ var shouldTabIndex = !options.unstable_virtual && !options.unstable_hasActiveWidget && isCurrentItem || // We don't want to set tabIndex="-1" when using CompositeItem as a
+ // standalone component, without state props.
+ !((_options$items2 = options.items) !== null && _options$items2 !== void 0 && _options$items2.length);
+ (0,external_React_.useEffect)(function () {
+ var _options$registerItem;
+
+ if (!id) return undefined;
+ (_options$registerItem = options.registerItem) === null || _options$registerItem === void 0 ? void 0 : _options$registerItem.call(options, {
+ id: id,
+ ref: ref,
+ disabled: !!trulyDisabled
+ });
+ return function () {
+ var _options$unregisterIt;
+
+ (_options$unregisterIt = options.unregisterItem) === null || _options$unregisterIt === void 0 ? void 0 : _options$unregisterIt.call(options, id);
+ };
+ }, [id, trulyDisabled, options.registerItem, options.unregisterItem]);
+ (0,external_React_.useEffect)(function () {
+ var element = ref.current;
+
+ if (!element) {
+ false ? 0 : void 0;
+ return;
+ } // `moves` will be incremented whenever next, previous, up, down, first,
+ // last or move have been called. This means that the composite item will
+ // be focused whenever some of these functions are called. We're using
+ // isCurrentItemRef instead of isCurrentItem because we don't want to
+ // focus the item if isCurrentItem changes (and options.moves doesn't).
+
+
+ if (options.unstable_moves && isCurrentItemRef.current) {
+ userFocus(element);
+ }
+ }, [options.unstable_moves]);
+ var onMouseDown = (0,external_React_.useCallback)(function (event) {
+ var _onMouseDownRef$curre;
+
+ (_onMouseDownRef$curre = onMouseDownRef.current) === null || _onMouseDownRef$curre === void 0 ? void 0 : _onMouseDownRef$curre.call(onMouseDownRef, event);
+ setUserFocus(event.currentTarget, true);
+ }, []);
+ var onFocus = (0,external_React_.useCallback)(function (event) {
+ var _onFocusRef$current, _options$setCurrentId;
+
+ var shouldFocusComposite = hasUserFocus(event.currentTarget);
+ setUserFocus(event.currentTarget, false);
+ (_onFocusRef$current = onFocusRef.current) === null || _onFocusRef$current === void 0 ? void 0 : _onFocusRef$current.call(onFocusRef, event);
+ if (event.defaultPrevented) return;
+ if (isPortalEvent(event)) return;
+ if (!id) return;
+ if (targetIsAnotherItem(event, options.items)) return;
+ (_options$setCurrentId = options.setCurrentId) === null || _options$setCurrentId === void 0 ? void 0 : _options$setCurrentId.call(options, id); // When using aria-activedescendant, we want to make sure that the
+ // composite container receives focus, not the composite item.
+ // But we don't want to do this if the target is another focusable
+ // element inside the composite item, such as CompositeItemWidget.
+
+ if (shouldFocusComposite && options.unstable_virtual && options.baseId && isSelfTarget(event)) {
+ var target = event.target;
+ var composite = getDocument(target).getElementById(options.baseId);
+
+ if (composite) {
+ hasFocusedComposite.current = true;
+ ensureFocus(composite);
}
- this.elastic = resolveDragElastic(dragElastic);
- /**
- * If we're outputting to external MotionValues, we want to rebase the measured constraints
- * from viewport-relative to component-relative.
- */
- if (this.constraints && !this.hasMutatedConstraints) {
- eachAxis(function (axis) {
- if (_this.getAxisMotionValue(axis)) {
- _this.constraints[axis] = rebaseAxisConstraints(layout[axis], _this.constraints[axis]);
- }
- });
+ }
+ }, [id, options.items, options.setCurrentId, options.unstable_virtual, options.baseId]);
+ var onBlurCapture = (0,external_React_.useCallback)(function (event) {
+ var _onBlurCaptureRef$cur;
+
+ (_onBlurCaptureRef$cur = onBlurCaptureRef.current) === null || _onBlurCaptureRef$cur === void 0 ? void 0 : _onBlurCaptureRef$cur.call(onBlurCaptureRef, event);
+ if (event.defaultPrevented) return;
+
+ if (options.unstable_virtual && hasFocusedComposite.current) {
+ // When hasFocusedComposite is true, composite has been focused right
+ // after focusing this item. This is an intermediate blur event, so
+ // we ignore it.
+ hasFocusedComposite.current = false;
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }, [options.unstable_virtual]);
+ var onKeyDown = (0,external_React_.useCallback)(function (event) {
+ var _onKeyDownRef$current;
+
+ if (!isSelfTarget(event)) return;
+ var isVertical = options.orientation !== "horizontal";
+ var isHorizontal = options.orientation !== "vertical";
+ var isGrid = !!(item !== null && item !== void 0 && item.groupId);
+ var keyMap = {
+ ArrowUp: (isGrid || isVertical) && options.up,
+ ArrowRight: (isGrid || isHorizontal) && options.next,
+ ArrowDown: (isGrid || isVertical) && options.down,
+ ArrowLeft: (isGrid || isHorizontal) && options.previous,
+ Home: function Home() {
+ if (!isGrid || event.ctrlKey) {
+ var _options$first;
+
+ (_options$first = options.first) === null || _options$first === void 0 ? void 0 : _options$first.call(options);
+ } else {
+ var _options$previous;
+
+ (_options$previous = options.previous) === null || _options$previous === void 0 ? void 0 : _options$previous.call(options, true);
+ }
+ },
+ End: function End() {
+ if (!isGrid || event.ctrlKey) {
+ var _options$last;
+
+ (_options$last = options.last) === null || _options$last === void 0 ? void 0 : _options$last.call(options);
+ } else {
+ var _options$next;
+
+ (_options$next = options.next) === null || _options$next === void 0 ? void 0 : _options$next.call(options, true);
+ }
+ },
+ PageUp: function PageUp() {
+ if (isGrid) {
+ var _options$up;
+
+ (_options$up = options.up) === null || _options$up === void 0 ? void 0 : _options$up.call(options, true);
+ } else {
+ var _options$first2;
+
+ (_options$first2 = options.first) === null || _options$first2 === void 0 ? void 0 : _options$first2.call(options);
+ }
+ },
+ PageDown: function PageDown() {
+ if (isGrid) {
+ var _options$down;
+
+ (_options$down = options.down) === null || _options$down === void 0 ? void 0 : _options$down.call(options, true);
+ } else {
+ var _options$last2;
+
+ (_options$last2 = options.last) === null || _options$last2 === void 0 ? void 0 : _options$last2.call(options);
+ }
}
- };
- VisualElementDragControls.prototype.resolveRefConstraints = function (layoutBox, constraints) {
- var _a = this.props, onMeasureDragConstraints = _a.onMeasureDragConstraints, transformPagePoint = _a.transformPagePoint;
- var constraintsElement = constraints.current;
- invariant(constraintsElement !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
- this.constraintsBox = getBoundingBox(constraintsElement, transformPagePoint);
- var measuredConstraints = calcViewportConstraints(layoutBox, this.constraintsBox);
- /**
- * If there's an onMeasureDragConstraints listener we call it and
- * if different constraints are returned, set constraints to that
- */
- if (onMeasureDragConstraints) {
- var userConstraints = onMeasureDragConstraints(convertAxisBoxToBoundingBox(measuredConstraints));
- this.hasMutatedConstraints = !!userConstraints;
- if (userConstraints) {
- measuredConstraints = convertBoundingBoxToAxisBox(userConstraints);
- }
+ };
+ var action = keyMap[event.key];
+
+ if (action) {
+ event.preventDefault();
+ action();
+ return;
+ }
+
+ (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event);
+ if (event.defaultPrevented) return;
+
+ if (event.key.length === 1 && event.key !== " ") {
+ var widget = getWidget(event.currentTarget);
+
+ if (widget && isTextField(widget)) {
+ widget.focus();
+ setTextFieldValue(widget, "");
}
- return measuredConstraints;
- };
- VisualElementDragControls.prototype.cancelDrag = function () {
- var _a, _b;
- this.visualElement.unlockProjectionTarget();
- (_a = this.cancelLayout) === null || _a === void 0 ? void 0 : _a.call(this);
- this.isDragging = false;
- this.panSession && this.panSession.end();
- this.panSession = null;
- if (!this.props.dragPropagation && this.openGlobalLock) {
- this.openGlobalLock();
- this.openGlobalLock = null;
+ } else if (event.key === "Delete" || event.key === "Backspace") {
+ var _widget = getWidget(event.currentTarget);
+
+ if (_widget && isTextField(_widget)) {
+ event.preventDefault();
+ setTextFieldValue(_widget, "");
}
- (_b = this.visualElement.animationState) === null || _b === void 0 ? void 0 : _b.setActive(AnimationType.Drag, false);
- };
- VisualElementDragControls.prototype.stop = function (event, info) {
- var _a, _b, _c;
- (_a = this.panSession) === null || _a === void 0 ? void 0 : _a.end();
- this.panSession = null;
- var isDragging = this.isDragging;
- this.cancelDrag();
- if (!isDragging)
- return;
- var velocity = info.velocity;
- this.animateDragEnd(velocity);
- (_c = (_b = this.props).onDragEnd) === null || _c === void 0 ? void 0 : _c.call(_b, event, info);
- };
- VisualElementDragControls.prototype.snapToCursor = function (point) {
- var _this = this;
- return eachAxis(function (axis) {
- var drag = _this.props.drag;
- // If we're not dragging this axis, do an early return.
- if (!shouldDrag(axis, drag, _this.currentDirection))
- return;
- var axisValue = _this.getAxisMotionValue(axis);
- if (axisValue) {
- var box = _this.visualElement.getLayoutState().layout;
- var length_1 = box[axis].max - box[axis].min;
- var center = box[axis].min + length_1 / 2;
- var offset = point[axis] - center;
- _this.originPoint[axis] = point[axis];
- axisValue.set(offset);
- }
- else {
- _this.cursorProgress[axis] = 0.5;
- return true;
- }
- }).includes(true);
- };
- /**
- * Update the specified axis with the latest pointer information.
- */
- VisualElementDragControls.prototype.updateAxis = function (axis, point, offset) {
- var drag = this.props.drag;
- // If we're not dragging this axis, do an early return.
- if (!shouldDrag(axis, drag, this.currentDirection))
- return;
- return this.getAxisMotionValue(axis)
- ? this.updateAxisMotionValue(axis, offset)
- : this.updateVisualElementAxis(axis, point);
- };
- VisualElementDragControls.prototype.updateAxisMotionValue = function (axis, offset) {
- var axisValue = this.getAxisMotionValue(axis);
- if (!offset || !axisValue)
- return;
- var nextValue = this.originPoint[axis] + offset[axis];
- var update = this.constraints
- ? applyConstraints(nextValue, this.constraints[axis], this.elastic[axis])
- : nextValue;
- axisValue.set(update);
- };
- VisualElementDragControls.prototype.updateVisualElementAxis = function (axis, point) {
- var _a;
- // Get the actual layout bounding box of the element
- var axisLayout = this.visualElement.getLayoutState().layout[axis];
- // Calculate its current length. In the future we might want to lerp this to animate
- // between lengths if the layout changes as we change the DOM
- var axisLength = axisLayout.max - axisLayout.min;
- // Get the initial progress that the pointer sat on this axis on gesture start.
- var axisProgress = this.cursorProgress[axis];
- // Calculate a new min point based on the latest pointer position, constraints and elastic
- var min = calcConstrainedMinPoint(point[axis], axisLength, axisProgress, (_a = this.constraints) === null || _a === void 0 ? void 0 : _a[axis], this.elastic[axis]);
- // Update the axis viewport target with this new min and the length
- this.visualElement.setProjectionTargetAxis(axis, min, min + axisLength);
- };
- VisualElementDragControls.prototype.setProps = function (_a) {
- var _b = _a.drag, drag = _b === void 0 ? false : _b, _c = _a.dragDirectionLock, dragDirectionLock = _c === void 0 ? false : _c, _d = _a.dragPropagation, dragPropagation = _d === void 0 ? false : _d, _e = _a.dragConstraints, dragConstraints = _e === void 0 ? false : _e, _f = _a.dragElastic, dragElastic = _f === void 0 ? defaultElastic : _f, _g = _a.dragMomentum, dragMomentum = _g === void 0 ? true : _g, remainingProps = __rest(_a, ["drag", "dragDirectionLock", "dragPropagation", "dragConstraints", "dragElastic", "dragMomentum"]);
- this.props = __assign({ drag: drag,
- dragDirectionLock: dragDirectionLock,
- dragPropagation: dragPropagation,
- dragConstraints: dragConstraints,
- dragElastic: dragElastic,
- dragMomentum: dragMomentum }, remainingProps);
- };
- /**
- * Drag works differently depending on which props are provided.
- *
- * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.
- * - If the component will perform layout animations, we output the gesture to the component's
- * visual bounding box
- * - Otherwise, we apply the delta to the x/y motion values.
- */
- VisualElementDragControls.prototype.getAxisMotionValue = function (axis) {
- var _a = this.props, layout = _a.layout, layoutId = _a.layoutId;
- var dragKey = "_drag" + axis.toUpperCase();
- if (this.props[dragKey]) {
- return this.props[dragKey];
- }
- else if (!layout && layoutId === undefined) {
- return this.visualElement.getValue(axis, 0);
- }
- };
- VisualElementDragControls.prototype.isLayoutDrag = function () {
- return !this.getAxisMotionValue("x");
- };
- VisualElementDragControls.prototype.isExternalDrag = function () {
- var _a = this.props, _dragX = _a._dragX, _dragY = _a._dragY;
- return _dragX || _dragY;
- };
- VisualElementDragControls.prototype.animateDragEnd = function (velocity) {
- var _this = this;
- var _a = this.props, drag = _a.drag, dragMomentum = _a.dragMomentum, dragElastic = _a.dragElastic, dragTransition = _a.dragTransition;
- /**
- * Everything beyond the drag gesture should be performed with
- * relative projection so children stay in sync with their parent element.
- */
- var isRelative = convertToRelativeProjection(this.visualElement, this.isLayoutDrag() && !this.isExternalDrag());
- /**
- * If we had previously resolved constraints relative to the viewport,
- * we need to also convert those to a relative coordinate space for the animation
- */
- var constraints = this.constraints || {};
- if (isRelative &&
- Object.keys(constraints).length &&
- this.isLayoutDrag()) {
- var projectionParent = this.visualElement.getProjectionParent();
- if (projectionParent) {
- var relativeConstraints_1 = calcRelativeOffset(projectionParent.projection.targetFinal, constraints);
- eachAxis(function (axis) {
- var _a = relativeConstraints_1[axis], min = _a.min, max = _a.max;
- constraints[axis] = {
- min: isNaN(min) ? undefined : min,
- max: isNaN(max) ? undefined : max,
- };
- });
- }
- }
- var momentumAnimations = eachAxis(function (axis) {
- var _a;
- if (!shouldDrag(axis, drag, _this.currentDirection)) {
- return;
- }
- var transition = (_a = constraints === null || constraints === void 0 ? void 0 : constraints[axis]) !== null && _a !== void 0 ? _a : {};
- /**
- * Overdamp the boundary spring if `dragElastic` is disabled. There's still a frame
- * of spring animations so we should look into adding a disable spring option to `inertia`.
- * We could do something here where we affect the `bounceStiffness` and `bounceDamping`
- * using the value of `dragElastic`.
- */
- var bounceStiffness = dragElastic ? 200 : 1000000;
- var bounceDamping = dragElastic ? 40 : 10000000;
- var inertia = __assign(__assign({ type: "inertia", velocity: dragMomentum ? velocity[axis] : 0, bounceStiffness: bounceStiffness,
- bounceDamping: bounceDamping, timeConstant: 750, restDelta: 1, restSpeed: 10 }, dragTransition), transition);
- // If we're not animating on an externally-provided `MotionValue` we can use the
- // component's animation controls which will handle interactions with whileHover (etc),
- // otherwise we just have to animate the `MotionValue` itself.
- return _this.getAxisMotionValue(axis)
- ? _this.startAxisValueAnimation(axis, inertia)
- : _this.visualElement.startLayoutAnimation(axis, inertia, isRelative);
- });
- // Run all animations and then resolve the new drag constraints.
- return Promise.all(momentumAnimations).then(function () {
- var _a, _b;
- (_b = (_a = _this.props).onDragTransitionEnd) === null || _b === void 0 ? void 0 : _b.call(_a);
- });
- };
- VisualElementDragControls.prototype.stopMotion = function () {
- var _this = this;
- eachAxis(function (axis) {
- var axisValue = _this.getAxisMotionValue(axis);
- axisValue
- ? axisValue.stop()
- : _this.visualElement.stopLayoutAnimation();
- });
- };
- VisualElementDragControls.prototype.startAxisValueAnimation = function (axis, transition) {
- var axisValue = this.getAxisMotionValue(axis);
- if (!axisValue)
- return;
- var currentValue = axisValue.get();
- axisValue.set(currentValue);
- axisValue.set(currentValue); // Set twice to hard-reset velocity
- return transitions_startAnimation(axis, axisValue, 0, transition);
- };
- VisualElementDragControls.prototype.scalePoint = function () {
- var _this = this;
- var _a = this.props, drag = _a.drag, dragConstraints = _a.dragConstraints;
- if (!isRefObject(dragConstraints) || !this.constraintsBox)
- return;
- // Stop any current animations as there can be some visual glitching if we resize mid animation
- this.stopMotion();
- // Record the relative progress of the targetBox relative to the constraintsBox
- var boxProgress = { x: 0, y: 0 };
- eachAxis(function (axis) {
- boxProgress[axis] = delta_calc_calcOrigin(_this.visualElement.projection.target[axis], _this.constraintsBox[axis]);
- });
- /**
- * For each axis, calculate the current progress of the layout axis within the constraints.
- * Then, using the latest layout and constraints measurements, reposition the new layout axis
- * proportionally within the constraints.
- */
- this.updateConstraints(function () {
- eachAxis(function (axis) {
- if (!shouldDrag(axis, drag, null))
- return;
- // Calculate the position of the targetBox relative to the constraintsBox using the
- // previously calculated progress
- var _a = calcPositionFromProgress(_this.visualElement.projection.target[axis], _this.constraintsBox[axis], boxProgress[axis]), min = _a.min, max = _a.max;
- _this.visualElement.setProjectionTargetAxis(axis, min, max);
- });
- });
- /**
- * If any other draggable components are queuing the same tasks synchronously
- * this will wait until they've all been scheduled before flushing.
- */
- setTimeout(flushLayout, 1);
- };
- VisualElementDragControls.prototype.updateConstraints = function (onReady) {
- var _this = this;
- this.cancelLayout = batchLayout(function (read, write) {
- var ancestors = collectProjectingAncestors(_this.visualElement);
- write(function () {
- return ancestors.forEach(function (element) { return element.resetTransform(); });
- });
- read(function () { return updateLayoutMeasurement(_this.visualElement); });
- write(function () {
- return ancestors.forEach(function (element) { return element.restoreTransform(); });
- });
- read(function () {
- _this.resolveDragConstraints();
- });
- if (onReady)
- write(onReady);
- });
- };
- VisualElementDragControls.prototype.mount = function (visualElement) {
- var _this = this;
- var element = visualElement.getInstance();
- /**
- * Attach a pointerdown event listener on this DOM element to initiate drag tracking.
- */
- var stopPointerListener = addPointerEvent(element, "pointerdown", function (event) {
- var _a = _this.props, drag = _a.drag, _b = _a.dragListener, dragListener = _b === void 0 ? true : _b;
- drag && dragListener && _this.start(event);
- });
- /**
- * Attach a window resize listener to scale the draggable target within its defined
- * constraints as the window resizes.
- */
- var stopResizeListener = addDomEvent(window, "resize", function () {
- _this.scalePoint();
- });
- /**
- * Ensure drag constraints are resolved correctly relative to the dragging element
- * whenever its layout changes.
- */
- var stopLayoutUpdateListener = visualElement.onLayoutUpdate(function () {
- if (_this.isDragging) {
- _this.resolveDragConstraints();
- }
- });
- /**
- * If the previous component with this same layoutId was dragging at the time
- * it was unmounted, we want to continue the same gesture on this component.
- */
- var prevDragCursor = visualElement.prevDragCursor;
- if (prevDragCursor) {
- this.start(lastPointerEvent, { cursorProgress: prevDragCursor });
- }
- /**
- * Return a function that will teardown the drag gesture
- */
- return function () {
- stopPointerListener === null || stopPointerListener === void 0 ? void 0 : stopPointerListener();
- stopResizeListener === null || stopResizeListener === void 0 ? void 0 : stopResizeListener();
- stopLayoutUpdateListener === null || stopLayoutUpdateListener === void 0 ? void 0 : stopLayoutUpdateListener();
- _this.cancelDrag();
- };
- };
- return VisualElementDragControls;
-}());
-function shouldDrag(direction, drag, currentDirection) {
- return ((drag === true || drag === direction) &&
- (currentDirection === null || currentDirection === direction));
-}
-/**
- * Based on an x/y offset determine the current drag direction. If both axis' offsets are lower
- * than the provided threshold, return `null`.
- *
- * @param offset - The x/y offset from origin.
- * @param lockThreshold - (Optional) - the minimum absolute offset before we can determine a drag direction.
- */
-function getCurrentDirection(offset, lockThreshold) {
- if (lockThreshold === void 0) { lockThreshold = 10; }
- var direction = null;
- if (Math.abs(offset.y) > lockThreshold) {
- direction = "y";
- }
- else if (Math.abs(offset.x) > lockThreshold) {
- direction = "x";
- }
- return direction;
-}
-
-
+ }
+ }, [options.orientation, item, options.up, options.next, options.down, options.previous, options.first, options.last]);
+ var onClick = (0,external_React_.useCallback)(function (event) {
+ var _onClickRef$current;
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/drag/use-drag.js
+ (_onClickRef$current = onClickRef.current) === null || _onClickRef$current === void 0 ? void 0 : _onClickRef$current.call(onClickRef, event);
+ if (event.defaultPrevented) return;
+ var element = event.currentTarget;
+ var widget = getWidget(element);
+ if (widget && !hasFocusWithin(widget)) {
+ // If there's a widget inside the composite item, we make sure it's
+ // focused when pressing enter, space or clicking on the composite item.
+ widget.focus();
+ }
+ }, []);
+ return _objectSpread2({
+ ref: useForkRef(ref, htmlRef),
+ id: id,
+ tabIndex: shouldTabIndex ? htmlTabIndex : -1,
+ "aria-selected": options.unstable_virtual && isCurrentItem ? true : undefined,
+ onMouseDown: onMouseDown,
+ onFocus: onFocus,
+ onBlurCapture: onBlurCapture,
+ onKeyDown: onKeyDown,
+ onClick: onClick
+ }, htmlProps);
+ }
+});
+var CompositeItem = createComponent({
+ as: "button",
+ memo: true,
+ useHook: useCompositeItem
+});
+;// CONCATENATED MODULE: external ["wp","dom"]
+var external_wp_dom_namespaceObject = window["wp"]["dom"];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
/**
- * A hook that allows an element to be dragged.
- *
- * @internal
+ * WordPress dependencies
*/
-function useDrag(props) {
- var groupDragControls = props.dragControls, visualElement = props.visualElement;
- var transformPagePoint = Object(external_React_["useContext"])(MotionConfigContext).transformPagePoint;
- var dragControls = useConstant(function () {
- return new VisualElementDragControls_VisualElementDragControls({
- visualElement: visualElement,
- });
- });
- dragControls.setProps(__assign(__assign({}, props), { transformPagePoint: transformPagePoint }));
- // If we've been provided a DragControls for manual control over the drag gesture,
- // subscribe this component to it on mount.
- Object(external_React_["useEffect"])(function () { return groupDragControls && groupDragControls.subscribe(dragControls); }, [dragControls]);
- // Mount the drag controls with the visualElement
- Object(external_React_["useEffect"])(function () { return dragControls.mount(visualElement); }, []);
-}
-
-
-
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/gestures/use-pan-gesture.js
+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/components/build-module/popover/utils.js
+// @ts-nocheck
+/**
+ * WordPress dependencies
+ */
+/**
+ * Module constants
+ */
+const HEIGHT_OFFSET = 10; // used by the arrow and a bit of empty space
/**
+ * Utility used to compute the popover position over the xAxis
*
- * @param handlers -
- * @param ref -
- *
- * @internalremarks
- * Currently this sets new pan gesture functions every render. The memo route has been explored
- * in the past but ultimately we're still creating new functions every render. An optimisation
- * to explore is creating the pan gestures and loading them into a `ref`.
+ * @param {Object} anchorRect Anchor Rect.
+ * @param {Object} contentSize Content Size.
+ * @param {string} xAxis Desired xAxis.
+ * @param {string} corner Desired corner.
+ * @param {boolean} stickyBoundaryElement The boundary element to use when
+ * switching between sticky and normal
+ * position.
+ * @param {string} chosenYAxis yAxis to be used.
+ * @param {Element} boundaryElement Boundary element.
+ * @param {boolean} forcePosition Don't adjust position based on anchor.
+ * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis
*
- * @internal
+ * @return {Object} Popover xAxis position and constraints.
*/
-function usePanGesture(_a) {
- var onPan = _a.onPan, onPanStart = _a.onPanStart, onPanEnd = _a.onPanEnd, onPanSessionStart = _a.onPanSessionStart, visualElement = _a.visualElement;
- var hasPanEvents = onPan || onPanStart || onPanEnd || onPanSessionStart;
- var panSession = Object(external_React_["useRef"])(null);
- var transformPagePoint = Object(external_React_["useContext"])(MotionConfigContext).transformPagePoint;
- var handlers = {
- onSessionStart: onPanSessionStart,
- onStart: onPanStart,
- onMove: onPan,
- onEnd: function (event, info) {
- panSession.current = null;
- onPanEnd && onPanEnd(event, info);
- },
- };
- Object(external_React_["useEffect"])(function () {
- if (panSession.current !== null) {
- panSession.current.updateHandlers(handlers);
- }
- });
- function onPointerDown(event) {
- panSession.current = new PanSession_PanSession(event, handlers, {
- transformPagePoint: transformPagePoint,
- });
- }
- usePointerEvent(visualElement, "pointerdown", hasPanEvents && onPointerDown);
- useUnmountEffect(function () { return panSession.current && panSession.current.end(); });
-}
+function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, chosenYAxis, boundaryElement, forcePosition, forceXAlignment) {
+ const {
+ width
+ } = contentSize; // Correct xAxis for RTL support
+ if (xAxis === 'left' && (0,external_wp_i18n_namespaceObject.isRTL)()) {
+ xAxis = 'right';
+ } else if (xAxis === 'right' && (0,external_wp_i18n_namespaceObject.isRTL)()) {
+ xAxis = 'left';
+ }
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/drag.js
+ if (corner === 'left' && (0,external_wp_i18n_namespaceObject.isRTL)()) {
+ corner = 'right';
+ } else if (corner === 'right' && (0,external_wp_i18n_namespaceObject.isRTL)()) {
+ corner = 'left';
+ } // x axis alignment choices
+ const anchorMidPoint = Math.round(anchorRect.left + anchorRect.width / 2);
+ const centerAlignment = {
+ popoverLeft: anchorMidPoint,
+ contentWidth: (anchorMidPoint - width / 2 > 0 ? width / 2 : anchorMidPoint) + (anchorMidPoint + width / 2 > window.innerWidth ? window.innerWidth - anchorMidPoint : width / 2)
+ };
+ let leftAlignmentX = anchorRect.left;
+ if (corner === 'right') {
+ leftAlignmentX = anchorRect.right;
+ } else if (chosenYAxis !== 'middle' && !forceXAlignment) {
+ leftAlignmentX = anchorMidPoint;
+ }
-var drag_drag = {
- pan: makeRenderlessComponent(usePanGesture),
- drag: makeRenderlessComponent(useDrag),
-};
+ let rightAlignmentX = anchorRect.right;
+ if (corner === 'left') {
+ rightAlignmentX = anchorRect.left;
+ } else if (chosenYAxis !== 'middle' && !forceXAlignment) {
+ rightAlignmentX = anchorMidPoint;
+ }
+ const leftAlignment = {
+ popoverLeft: leftAlignmentX,
+ contentWidth: leftAlignmentX - width > 0 ? width : leftAlignmentX
+ };
+ const rightAlignment = {
+ popoverLeft: rightAlignmentX,
+ contentWidth: rightAlignmentX + width > window.innerWidth ? window.innerWidth - rightAlignmentX : width
+ }; // Choosing the x axis
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimateSharedLayout/types.js
-/**
- * @public
- */
-var Presence;
-(function (Presence) {
- Presence[Presence["Entering"] = 0] = "Entering";
- Presence[Presence["Present"] = 1] = "Present";
- Presence[Presence["Exiting"] = 2] = "Exiting";
-})(Presence || (Presence = {}));
-/**
- * @public
- */
-var VisibilityAction;
-(function (VisibilityAction) {
- VisibilityAction[VisibilityAction["Hide"] = 0] = "Hide";
- VisibilityAction[VisibilityAction["Show"] = 1] = "Show";
-})(VisibilityAction || (VisibilityAction = {}));
+ let chosenXAxis = xAxis;
+ let contentWidth = null;
+ if (!stickyBoundaryElement && !forcePosition) {
+ if (xAxis === 'center' && centerAlignment.contentWidth === width) {
+ chosenXAxis = 'center';
+ } else if (xAxis === 'left' && leftAlignment.contentWidth === width) {
+ chosenXAxis = 'left';
+ } else if (xAxis === 'right' && rightAlignment.contentWidth === width) {
+ chosenXAxis = 'right';
+ } else {
+ chosenXAxis = leftAlignment.contentWidth > rightAlignment.contentWidth ? 'left' : 'right';
+ const chosenWidth = chosenXAxis === 'left' ? leftAlignment.contentWidth : rightAlignment.contentWidth; // Limit width of the content to the viewport width
+ if (width > window.innerWidth) {
+ contentWidth = window.innerWidth;
+ } // If we can't find any alignment options that could fit
+ // our content, then let's fallback to the center of the viewport.
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.js
+ if (chosenWidth !== width) {
+ chosenXAxis = 'center';
+ centerAlignment.popoverLeft = window.innerWidth / 2;
+ }
+ }
+ }
+ let popoverLeft;
-function css_variables_conversion_isCSSVariable(value) {
- return typeof value === "string" && value.startsWith("var(--");
-}
-/**
- * Parse Framer's special CSS variable format into a CSS token and a fallback.
- *
- * ```
- * `var(--foo, #fff)` => [`--foo`, '#fff']
- * ```
- *
- * @param current
- */
-var cssVariableRegex = /var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;
-function parseCSSVariable(current) {
- var match = cssVariableRegex.exec(current);
- if (!match)
- return [,];
- var _a = __read(match, 3), token = _a[1], fallback = _a[2];
- return [token, fallback];
-}
-var maxDepth = 4;
-function getVariableValue(current, element, depth) {
- if (depth === void 0) { depth = 1; }
- invariant(depth <= maxDepth, "Max CSS variable fallback depth detected in property \"" + current + "\". This may indicate a circular fallback dependency.");
- var _a = __read(parseCSSVariable(current), 2), token = _a[0], fallback = _a[1];
- // No CSS variable detected
- if (!token)
- return;
- // Attempt to read this CSS variable off the element
- var resolved = window.getComputedStyle(element).getPropertyValue(token);
- if (resolved) {
- return resolved.trim();
- }
- else if (css_variables_conversion_isCSSVariable(fallback)) {
- // The fallback might itself be a CSS variable, in which case we attempt to resolve it too.
- return getVariableValue(fallback, element, depth + 1);
- }
- else {
- return fallback;
+ if (chosenXAxis === 'center') {
+ popoverLeft = centerAlignment.popoverLeft;
+ } else if (chosenXAxis === 'left') {
+ popoverLeft = leftAlignment.popoverLeft;
+ } else {
+ popoverLeft = rightAlignment.popoverLeft;
+ }
+
+ if (boundaryElement) {
+ popoverLeft = Math.min(popoverLeft, boundaryElement.offsetLeft + boundaryElement.offsetWidth - width); // Avoid the popover being position beyond the left boundary if the
+ // direction is left to right.
+
+ if (!(0,external_wp_i18n_namespaceObject.isRTL)()) {
+ popoverLeft = Math.max(popoverLeft, 0);
}
+ }
+
+ return {
+ xAxis: chosenXAxis,
+ popoverLeft,
+ contentWidth
+ };
}
/**
- * Resolve CSS variables from
+ * Utility used to compute the popover position over the yAxis
*
- * @internal
+ * @param {Object} anchorRect Anchor Rect.
+ * @param {Object} contentSize Content Size.
+ * @param {string} yAxis Desired yAxis.
+ * @param {string} corner Desired corner.
+ * @param {boolean} stickyBoundaryElement The boundary element to use when switching between sticky
+ * and normal position.
+ * @param {Element} anchorRef The anchor element.
+ * @param {Element} relativeOffsetTop If applicable, top offset of the relative positioned
+ * parent container.
+ * @param {boolean} forcePosition Don't adjust position based on anchor.
+ * @param {Element|null} editorWrapper Element that wraps the editor content. Used to access
+ * scroll position to determine sticky behavior.
+ * @return {Object} Popover xAxis position and constraints.
*/
-function resolveCSSVariables(visualElement, _a, transitionEnd) {
- var _b;
- var target = __rest(_a, []);
- var element = visualElement.getInstance();
- if (!(element instanceof HTMLElement))
- return { target: target, transitionEnd: transitionEnd };
- // If `transitionEnd` isn't `undefined`, clone it. We could clone `target` and `transitionEnd`
- // only if they change but I think this reads clearer and this isn't a performance-critical path.
- if (transitionEnd) {
- transitionEnd = __assign({}, transitionEnd);
- }
- // Go through existing `MotionValue`s and ensure any existing CSS variables are resolved
- visualElement.forEachValue(function (value) {
- var current = value.get();
- if (!css_variables_conversion_isCSSVariable(current))
- return;
- var resolved = getVariableValue(current, element);
- if (resolved)
- value.set(resolved);
- });
- // Cycle through every target property and resolve CSS variables. Currently
- // we only read single-var properties like `var(--foo)`, not `calc(var(--foo) + 20px)`
- for (var key in target) {
- var current = target[key];
- if (!css_variables_conversion_isCSSVariable(current))
- continue;
- var resolved = getVariableValue(current, element);
- if (!resolved)
- continue;
- // Clone target if it hasn't already been
- target[key] = resolved;
- // If the user hasn't already set this key on `transitionEnd`, set it to the unresolved
- // CSS variable. This will ensure that after the animation the component will reflect
- // changes in the value of the CSS variable.
- if (transitionEnd)
- (_b = transitionEnd[key]) !== null && _b !== void 0 ? _b : (transitionEnd[key] = current);
+
+function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition, editorWrapper) {
+ const {
+ height
+ } = contentSize;
+
+ if (stickyBoundaryElement) {
+ const stickyRect = stickyBoundaryElement.getBoundingClientRect();
+ const stickyPositionTop = stickyRect.top + height - relativeOffsetTop;
+ const stickyPositionBottom = stickyRect.bottom - height - relativeOffsetTop;
+
+ if (anchorRect.top <= stickyPositionTop) {
+ if (editorWrapper) {
+ // If a popover cannot be positioned above the anchor, even after scrolling, we must
+ // ensure we use the bottom position instead of the popover slot. This prevents the
+ // popover from always restricting block content and interaction while selected if the
+ // block is near the top of the site editor.
+ const isRoomAboveInCanvas = height + HEIGHT_OFFSET < editorWrapper.scrollTop + anchorRect.top;
+
+ if (!isRoomAboveInCanvas) {
+ return {
+ yAxis: 'bottom',
+ // If the bottom of the block is also below the bottom sticky position (ex -
+ // block is also taller than the editor window), return the bottom sticky
+ // position instead. We do this instead of the top sticky position both to
+ // allow a smooth transition and more importantly to ensure every section of
+ // the block can be free from popover obscuration at some point in the
+ // scroll position.
+ popoverTop: Math.min(anchorRect.bottom, stickyPositionBottom)
+ };
+ }
+ } // Default sticky behavior.
+
+
+ return {
+ yAxis,
+ popoverTop: Math.min(anchorRect.bottom, stickyPositionTop)
+ };
}
- return { target: target, transitionEnd: transitionEnd };
+ } // y axis alignment choices
+
+
+ let anchorMidPoint = anchorRect.top + anchorRect.height / 2;
+
+ if (corner === 'bottom') {
+ anchorMidPoint = anchorRect.bottom;
+ } else if (corner === 'top') {
+ anchorMidPoint = anchorRect.top;
+ }
+
+ const middleAlignment = {
+ popoverTop: anchorMidPoint,
+ contentHeight: (anchorMidPoint - height / 2 > 0 ? height / 2 : anchorMidPoint) + (anchorMidPoint + height / 2 > window.innerHeight ? window.innerHeight - anchorMidPoint : height / 2)
+ };
+ const topAlignment = {
+ popoverTop: anchorRect.top,
+ contentHeight: anchorRect.top - HEIGHT_OFFSET - height > 0 ? height : anchorRect.top - HEIGHT_OFFSET
+ };
+ const bottomAlignment = {
+ popoverTop: anchorRect.bottom,
+ contentHeight: anchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight ? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom : height
+ }; // Choosing the y axis
+
+ let chosenYAxis = yAxis;
+ let contentHeight = null;
+
+ if (!stickyBoundaryElement && !forcePosition) {
+ if (yAxis === 'middle' && middleAlignment.contentHeight === height) {
+ chosenYAxis = 'middle';
+ } else if (yAxis === 'top' && topAlignment.contentHeight === height) {
+ chosenYAxis = 'top';
+ } else if (yAxis === 'bottom' && bottomAlignment.contentHeight === height) {
+ chosenYAxis = 'bottom';
+ } else {
+ chosenYAxis = topAlignment.contentHeight > bottomAlignment.contentHeight ? 'top' : 'bottom';
+ const chosenHeight = chosenYAxis === 'top' ? topAlignment.contentHeight : bottomAlignment.contentHeight;
+ contentHeight = chosenHeight !== height ? chosenHeight : null;
+ }
+ }
+
+ let popoverTop;
+
+ if (chosenYAxis === 'middle') {
+ popoverTop = middleAlignment.popoverTop;
+ } else if (chosenYAxis === 'top') {
+ popoverTop = topAlignment.popoverTop;
+ } else {
+ popoverTop = bottomAlignment.popoverTop;
+ }
+
+ return {
+ yAxis: chosenYAxis,
+ popoverTop,
+ contentHeight
+ };
+}
+/**
+ * Utility used to compute the popover position and the content max width/height for a popover given
+ * its anchor rect and its content size.
+ *
+ * @param {Object} anchorRect Anchor Rect.
+ * @param {Object} contentSize Content Size.
+ * @param {string} position Position.
+ * @param {boolean} stickyBoundaryElement The boundary element to use when switching between
+ * sticky and normal position.
+ * @param {Element} anchorRef The anchor element.
+ * @param {number} relativeOffsetTop If applicable, top offset of the relative positioned
+ * parent container.
+ * @param {Element} boundaryElement Boundary element.
+ * @param {boolean} forcePosition Don't adjust position based on anchor.
+ * @param {boolean} forceXAlignment Don't adjust alignment based on YAxis
+ * @param {Element|null} editorWrapper Element that wraps the editor content. Used to access
+ * scroll position to determine sticky behavior.
+ * @return {Object} Popover position and constraints.
+ */
+
+function computePopoverPosition(anchorRect, contentSize) {
+ let position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'top';
+ let stickyBoundaryElement = arguments.length > 3 ? arguments[3] : undefined;
+ let anchorRef = arguments.length > 4 ? arguments[4] : undefined;
+ let relativeOffsetTop = arguments.length > 5 ? arguments[5] : undefined;
+ let boundaryElement = arguments.length > 6 ? arguments[6] : undefined;
+ let forcePosition = arguments.length > 7 ? arguments[7] : undefined;
+ let forceXAlignment = arguments.length > 8 ? arguments[8] : undefined;
+ let editorWrapper = arguments.length > 9 ? arguments[9] : undefined;
+ const [yAxis, xAxis = 'center', corner] = position.split(' ');
+ const yAxisPosition = computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition, editorWrapper);
+ const xAxisPosition = computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, yAxisPosition.yAxis, boundaryElement, forcePosition, forceXAlignment);
+ return { ...xAxisPosition,
+ ...yAxisPosition
+ };
}
+/**
+ * Offsets the given rect by the position of the iframe that contains the
+ * element. If the owner document is not in an iframe then it returns with the
+ * original rect. If the popover container document and the anchor document are
+ * the same, the original rect will also be returned.
+ *
+ * @param {DOMRect} rect bounds of the element
+ * @param {Document} ownerDocument document of the element
+ * @param {Element} container The popover container to position.
+ *
+ * @return {DOMRect} offsetted bounds
+ */
+
+function offsetIframe(rect, ownerDocument, container) {
+ const {
+ defaultView
+ } = ownerDocument;
+ const {
+ frameElement
+ } = defaultView;
+ if (!frameElement || ownerDocument === container.ownerDocument) {
+ return rect;
+ }
+ const iframeRect = frameElement.getBoundingClientRect();
+ return new defaultView.DOMRect(rect.left + iframeRect.left, rect.top + iframeRect.top, rect.width, rect.height);
+}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/default-scale-correctors.js
+;// 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/components/build-module/dashicon/index.js
+/**
+ * @typedef OwnProps
+ *
+ * @property {import('./types').IconKey} icon Icon name
+ * @property {string} [className] Class name
+ */
+/** @typedef {import('react').ComponentPropsWithoutRef<'span'> & OwnProps} Props */
-function pixelsToPercent(pixels, axis) {
- return (pixels / (axis.max - axis.min)) * 100;
+/**
+ * @param {Props} props
+ * @return {JSX.Element} Element
+ */
+function Dashicon(_ref) {
+ let {
+ icon,
+ className,
+ ...extraProps
+ } = _ref;
+ const iconClass = ['dashicon', 'dashicons', 'dashicons-' + icon, className].filter(Boolean).join(' ');
+ return (0,external_wp_element_namespaceObject.createElement)("span", extends_extends({
+ className: iconClass
+ }, extraProps));
}
+
+/* harmony default export */ var dashicon = (Dashicon);
+
+;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/icon/index.js
+
+
/**
- * We always correct borderRadius as a percentage rather than pixels to reduce paints.
- * For example, if you are projecting a box that is 100px wide with a 10px borderRadius
- * into a box that is 200px wide with a 20px borderRadius, that is actually a 10%
- * borderRadius in both states. If we animate between the two in pixels that will trigger
- * a paint each time. If we animate between the two in percentage we'll avoid a paint.
+ * External dependencies
*/
-function correctBorderRadius(latest, _layoutState, _a) {
- var target = _a.target;
- /**
- * If latest is a string, if it's a percentage we can return immediately as it's
- * going to be stretched appropriately. Otherwise, if it's a pixel, convert it to a number.
- */
- if (typeof latest === "string") {
- if (px.test(latest)) {
- latest = parseFloat(latest);
- }
- else {
- return latest;
- }
+// eslint-disable-next-line no-restricted-imports
+
+/**
+ * WordPress dependencies
+ */
+
+
+/**
+ * Internal dependencies
+ */
+
+
+
+function Icon(_ref) {
+ let {
+ icon = null,
+ size = 24,
+ ...additionalProps
+ } = _ref;
+
+ if ('string' === typeof icon) {
+ return (0,external_wp_element_namespaceObject.createElement)(dashicon, extends_extends({
+ icon: icon
+ }, additionalProps));
+ }
+
+ if ((0,external_wp_element_namespaceObject.isValidElement)(icon) && dashicon === icon.type) {
+ return (0,external_wp_element_namespaceObject.cloneElement)(icon, { ...additionalProps
+ });
+ }
+
+ if ('function' === typeof icon) {
+ if (icon.prototype instanceof external_wp_element_namespaceObject.Component) {
+ return (0,external_wp_element_namespaceObject.createElement)(icon, {
+ size,
+ ...additionalProps
+ });
}
- /**
- * If latest is a number, it's a pixel value. We use the current viewportBox to calculate that
- * pixel value as a percentage of each axis
- */
- var x = pixelsToPercent(latest, target.x);
- var y = pixelsToPercent(latest, target.y);
- return x + "% " + y + "%";
+
+ return icon({
+ size,
+ ...additionalProps
+ });
+ }
+
+ if (icon && (icon.type === 'svg' || icon.type === external_wp_primitives_namespaceObject.SVG)) {
+ const appliedProps = {
+ width: size,
+ height: size,
+ ...icon.props,
+ ...additionalProps
+ };
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, appliedProps);
+ }
+
+ if ((0,external_wp_element_namespaceObject.isValidElement)(icon)) {
+ return (0,external_wp_element_namespaceObject.cloneElement)(icon, {
+ // @ts-ignore Just forwarding the size prop along
+ size,
+ ...additionalProps
+ });
+ }
+
+ return icon;
}
-var varToken = "_$css";
-function correctBoxShadow(latest, _a) {
- var delta = _a.delta, treeScale = _a.treeScale;
- var original = latest;
- /**
- * We need to first strip and store CSS variables from the string.
- */
- var containsCSSVariables = latest.includes("var(");
- var cssVariables = [];
- if (containsCSSVariables) {
- latest = latest.replace(cssVariableRegex, function (match) {
- cssVariables.push(match);
- return varToken;
- });
+
+/* harmony default export */ var build_module_icon = (Icon);
+
+;// CONCATENATED MODULE: external ["wp","warning"]
+var external_wp_warning_namespaceObject = window["wp"]["warning"];
+;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/context-system-provider.js
+
+
+/**
+ * External dependencies
+ */
+
+/**
+ * WordPress dependencies
+ */
+
+
+
+const ComponentsContext = (0,external_wp_element_namespaceObject.createContext)(
+/** @type {Record<string, any>} */
+{});
+const useComponentsContext = () => (0,external_wp_element_namespaceObject.useContext)(ComponentsContext);
+/**
+ * Runs an effect only on update (i.e., ignores the first render)
+ *
+ * @param {import('react').EffectCallback} effect
+ * @param {import('react').DependencyList} deps
+ */
+
+function useUpdateEffect(effect, deps) {
+ const mounted = (0,external_wp_element_namespaceObject.useRef)(false);
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
+ if (mounted.current) {
+ return effect();
}
- var shadow = complex.parse(latest);
- // TODO: Doesn't support multiple shadows
- if (shadow.length > 5)
- return original;
- var template = complex.createTransformer(latest);
- var offset = typeof shadow[0] !== "number" ? 1 : 0;
- // Calculate the overall context scale
- var xScale = delta.x.scale * treeScale.x;
- var yScale = delta.y.scale * treeScale.y;
- shadow[0 + offset] /= xScale;
- shadow[1 + offset] /= yScale;
- /**
- * Ideally we'd correct x and y scales individually, but because blur and
- * spread apply to both we have to take a scale average and apply that instead.
- * We could potentially improve the outcome of this by incorporating the ratio between
- * the two scales.
- */
- var averageScale = mix(xScale, yScale, 0.5);
- // Blur
- if (typeof shadow[2 + offset] === "number")
- shadow[2 + offset] /= averageScale;
- // Spread
- if (typeof shadow[3 + offset] === "number")
- shadow[3 + offset] /= averageScale;
- var output = template(shadow);
- if (containsCSSVariables) {
- var i_1 = 0;
- output = output.replace(varToken, function () {
- var cssVariable = cssVariables[i_1];
- i_1++;
- return cssVariable;
- });
+
+ mounted.current = true;
+ return undefined;
+ }, deps);
+}
+/**
+ * Consolidates incoming ContextSystem values with a (potential) parent ContextSystem value.
+ *
+ * Note: This function will warn if it detects an un-memoized `value`
+ *
+ * @param {Object} props
+ * @param {Record<string, any>} props.value
+ * @return {Record<string, any>} The consolidated value.
+ */
+
+
+function useContextSystemBridge(_ref) {
+ let {
+ value
+ } = _ref;
+ const parentContext = useComponentsContext();
+ const valueRef = (0,external_wp_element_namespaceObject.useRef)(value);
+ useUpdateEffect(() => {
+ if ( // objects are equivalent
+ (0,external_lodash_namespaceObject.isEqual)(valueRef.current, value) && // but not the same reference
+ valueRef.current !== value) {
+ typeof process !== "undefined" && process.env && "production" !== "production" ? 0 : void 0;
}
- return output;
+ }, [value]); // `parentContext` will always be memoized (i.e., the result of this hook itself)
+ // or the default value from when the `ComponentsContext` was originally
+ // initialized (which will never change, it's a static variable)
+ // so this memoization will prevent `merge` and `cloneDeep` from rerunning unless
+ // the references to `value` change OR the `parentContext` has an actual material change
+ // (because again, it's guaranteed to be memoized or a static reference to the empty object
+ // so we know that the only changes for `parentContext` are material ones... i.e., why we
+ // don't have to warn in the `useUpdateEffect` hook above for `parentContext` and we only
+ // need to bother with the `value`). The `useUpdateEffect` above will ensure that we are
+ // correctly warning when the `value` isn't being properly memoized. All of that to say
+ // that this should be super safe to assume that `useMemo` will only run on actual
+ // changes to the two dependencies, therefore saving us calls to `merge` and `cloneDeep`!
+
+ const config = (0,external_wp_element_namespaceObject.useMemo)(() => {
+ return (0,external_lodash_namespaceObject.merge)((0,external_lodash_namespaceObject.cloneDeep)(parentContext), value);
+ }, [parentContext, value]);
+ return config;
}
-var borderCorrectionDefinition = {
- process: correctBorderRadius,
-};
-var defaultScaleCorrectors = {
- borderRadius: __assign(__assign({}, borderCorrectionDefinition), { applyTo: [
- "borderTopLeftRadius",
- "borderTopRightRadius",
- "borderBottomLeftRadius",
- "borderBottomRightRadius",
- ] }),
- borderTopLeftRadius: borderCorrectionDefinition,
- borderTopRightRadius: borderCorrectionDefinition,
- borderBottomLeftRadius: borderCorrectionDefinition,
- borderBottomRightRadius: borderCorrectionDefinition,
- boxShadow: {
- process: correctBoxShadow,
- },
+/**
+ * A Provider component that can modify props for connected components within
+ * the Context system.
+ *
+ * @example
+ * ```jsx
+ * <ContextSystemProvider value={{ Button: { size: 'small' }}}>
+ * <Button>...</Button>
+ * </ContextSystemProvider>
+ * ```
+ *
+ * @template {Record<string, any>} T
+ * @param {Object} options
+ * @param {import('react').ReactNode} options.children Children to render.
+ * @param {T} options.value Props to render into connected components.
+ * @return {JSX.Element} A Provider wrapped component.
+ */
+
+
+const BaseContextSystemProvider = _ref2 => {
+ let {
+ children,
+ value
+ } = _ref2;
+ const contextValue = useContextSystemBridge({
+ value
+ });
+ return (0,external_wp_element_namespaceObject.createElement)(ComponentsContext.Provider, {
+ value: contextValue
+ }, children);
};
+const ContextSystemProvider = (0,external_wp_element_namespaceObject.memo)(BaseContextSystemProvider);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/constants.js
+const REACT_TYPEOF_KEY = '$$typeof';
+const COMPONENT_NAMESPACE = 'data-wp-component';
+const CONNECTED_NAMESPACE = 'data-wp-c16t';
+const CONTEXT_COMPONENT_NAMESPACE = 'data-wp-c5tc8t';
+/**
+ * Special key where the connected namespaces are stored.
+ * This is attached to Context connected components as a static property.
+ */
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/Animate.js
+const CONNECT_STATIC_NAMESPACE = '__contextSystemKey__';
+;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/utils.js
+/**
+ * Internal dependencies
+ */
+/**
+ * Creates a dedicated context namespace HTML attribute for components.
+ * ns is short for "namespace"
+ *
+ * @example
+ * ```jsx
+ * <div {...ns('Container')} />
+ * ```
+ *
+ * @param {string} componentName The name for the component.
+ * @return {Record<string, any>} A props object with the namespaced HTML attribute.
+ */
+function getNamespace(componentName) {
+ return {
+ [COMPONENT_NAMESPACE]: componentName
+ };
+}
+/**
+ * Creates a dedicated connected context namespace HTML attribute for components.
+ * ns is short for "namespace"
+ *
+ * @example
+ * ```jsx
+ * <div {...cns()} />
+ * ```
+ *
+ * @return {Record<string, any>} A props object with the namespaced HTML attribute.
+ */
+function getConnectedNamespace() {
+ return {
+ [CONNECTED_NAMESPACE]: true
+ };
+}
+// EXTERNAL MODULE: ./node_modules/memize/index.js
+var memize = __webpack_require__(9756);
+var memize_default = /*#__PURE__*/__webpack_require__.n(memize);
+;// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/context/get-styled-class-name-from-key.js
+/**
+ * External dependencies
+ */
+/**
+ * Generates the connected component CSS className based on the namespace.
+ *
+ * @param namespace The name of the connected component.
+ * @return The generated CSS className.
+ */
+function getStyledClassName(namespace) {
+ const kebab = (0,external_lodash_namespaceObject.kebabCase)(namespace);
+ return `components-${kebab}`;
+}
+const getStyledClassNameFromKey = memize_default()(getStyledClassName);
+;// CONCATENATED MODULE: ./node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js
+/*
-var progressTarget = 1000;
-var Animate_Animate = /** @class */ (function (_super) {
- __extends(Animate, _super);
- function Animate() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- /**
- * A mutable object that tracks the target viewport box
- * for the current animation frame.
- */
- _this.frameTarget = axisBox();
- /**
- * The current animation target, we use this to check whether to start
- * a new animation or continue the existing one.
- */
- _this.currentAnimationTarget = axisBox();
- /**
- * Track whether we're animating this axis.
- */
- _this.isAnimating = {
- x: false,
- y: false,
- };
- _this.stopAxisAnimation = {
- x: undefined,
- y: undefined,
- };
- _this.isAnimatingTree = false;
- _this.animate = function (target, origin, _a) {
- if (_a === void 0) { _a = {}; }
- var originBox = _a.originBox, targetBox = _a.targetBox, visibilityAction = _a.visibilityAction, shouldStackAnimate = _a.shouldStackAnimate, onComplete = _a.onComplete, prevParent = _a.prevParent, config = __rest(_a, ["originBox", "targetBox", "visibilityAction", "shouldStackAnimate", "onComplete", "prevParent"]);
- var _b = _this.props, visualElement = _b.visualElement, layout = _b.layout;
- /**
- * Early return if we've been instructed not to animate this render.
- */
- if (shouldStackAnimate === false) {
- _this.isAnimatingTree = false;
- return _this.safeToRemove();
- }
- /**
- * Prioritise tree animations
- */
- if (_this.isAnimatingTree && shouldStackAnimate !== true) {
- return;
- }
- else if (shouldStackAnimate) {
- _this.isAnimatingTree = true;
- }
- /**
- * Allow the measured origin (prev bounding box) and target (actual layout) to be
- * overridden by the provided config.
- */
- origin = originBox || origin;
- target = targetBox || target;
- /**
- * If this element has a projecting parent, there's an opportunity to animate
- * it relatively to that parent rather than relatively to the viewport. This
- * allows us to add orchestrated animations.
- */
- var isRelative = false;
- var projectionParent = visualElement.getProjectionParent();
- if (projectionParent) {
- var prevParentViewportBox = projectionParent.prevViewportBox;
- var parentLayout = projectionParent.getLayoutState().layout;
- /**
- * If we're being provided a previous parent VisualElement by AnimateSharedLayout
- */
- if (prevParent) {
- /**
- * If we've been provided an explicit target box it means we're animating back
- * to this previous parent. So we can make a relative box by comparing to the previous
- * parent's layout
- */
- if (targetBox) {
- parentLayout = prevParent.getLayoutState().layout;
- }
- /**
- * Likewise if we've been provided an explicit origin box it means we're
- * animating out from a different element. So we should figure out where that was
- * on screen relative to the new parent element.
- */
- if (originBox &&
- !checkIfParentHasChanged(prevParent, projectionParent) &&
- prevParent.prevViewportBox) {
- prevParentViewportBox = prevParent.prevViewportBox;
- }
- }
- if (prevParentViewportBox &&
- isProvidedCorrectDataForRelativeSharedLayout(prevParent, originBox, targetBox)) {
- isRelative = true;
- origin = calcRelativeOffset(prevParentViewportBox, origin);
- target = calcRelativeOffset(parentLayout, target);
- }
- }
- var boxHasMoved = hasMoved(origin, target);
- var animations = eachAxis(function (axis) {
- var _a, _b;
- /**
- * If layout is set to "position", we can resize the origin box based on the target
- * box and only animate its position.
- */
- if (layout === "position") {
- var targetLength = target[axis].max - target[axis].min;
- origin[axis].max = origin[axis].min + targetLength;
- }
- if (visualElement.projection.isTargetLocked) {
- return;
- }
- else if (visibilityAction !== undefined) {
- visualElement.setVisibility(visibilityAction === VisibilityAction.Show);
- }
- else if (boxHasMoved) {
- // If the box has moved, animate between it's current visual state and its
- // final state
- return _this.animateAxis(axis, target[axis], origin[axis], __assign(__assign({}, config), { isRelative: isRelative }));
- }
- else {
- (_b = (_a = _this.stopAxisAnimation)[axis]) === null || _b === void 0 ? void 0 : _b.call(_a);
- // If the box has remained in the same place, immediately set the axis target
- // to the final desired state
- return visualElement.setProjectionTargetAxis(axis, target[axis].min, target[axis].max, isRelative);
- }
- });
- // Force a render to ensure there's no flash of uncorrected bounding box.
- visualElement.syncRender();
- /**
- * If this visualElement isn't present (ie it's been removed from the tree by the user but
- * kept in by the tree by AnimatePresence) then call safeToRemove when all axis animations
- * have successfully finished.
- */
- return Promise.all(animations).then(function () {
- _this.isAnimatingTree = false;
- onComplete && onComplete();
- visualElement.notifyLayoutAnimationComplete();
- });
- };
- return _this;
- }
- Animate.prototype.componentDidMount = function () {
- var _this = this;
- var visualElement = this.props.visualElement;
- visualElement.animateMotionValue = transitions_startAnimation;
- visualElement.enableLayoutProjection();
- this.unsubLayoutReady = visualElement.onLayoutUpdate(this.animate);
- visualElement.layoutSafeToRemove = function () { return _this.safeToRemove(); };
- addScaleCorrection(defaultScaleCorrectors);
- };
- Animate.prototype.componentWillUnmount = function () {
- var _this = this;
- this.unsubLayoutReady();
- eachAxis(function (axis) { var _a, _b; return (_b = (_a = _this.stopAxisAnimation)[axis]) === null || _b === void 0 ? void 0 : _b.call(_a); });
- };
- /**
- * TODO: This manually performs animations on the visualElement's layout progress
- * values. It'd be preferable to amend the startLayoutAxisAnimation
- * API to accept more custom animations like this.
- */
- Animate.prototype.animateAxis = function (axis, target, origin, _a) {
- var _this = this;
- var _b, _c;
- var _d = _a === void 0 ? {} : _a, transition = _d.transition, isRelative = _d.isRelative;
- /**
- * If we're not animating to a new target, don't run this animation
- */
- if (this.isAnimating[axis] &&
- axisIsEqual(target, this.currentAnimationTarget[axis])) {
- return;
- }
- (_c = (_b = this.stopAxisAnimation)[axis]) === null || _c === void 0 ? void 0 : _c.call(_b);
- this.isAnimating[axis] = true;
- var visualElement = this.props.visualElement;
- var frameTarget = this.frameTarget[axis];
- var layoutProgress = visualElement.getProjectionAnimationProgress()[axis];
- /**
- * Set layout progress back to 0. We set it twice to hard-reset any velocity that might
- * be re-incoporated into a subsequent spring animation.
- */
- layoutProgress.clearListeners();
- layoutProgress.set(0);
- layoutProgress.set(0);
- /**
- * Create an animation function to run once per frame. This will tween the visual bounding box from
- * origin to target using the latest progress value.
- */
- var frame = function () {
- // Convert the latest layoutProgress, which is a value from 0-1000, into a 0-1 progress
- var p = layoutProgress.get() / progressTarget;
- // Tween the axis and update the visualElement with the latest values
- tweenAxis(frameTarget, origin, target, p);
- visualElement.setProjectionTargetAxis(axis, frameTarget.min, frameTarget.max, isRelative);
- };
- // Synchronously run a frame to ensure there's no flash of the uncorrected bounding box.
- frame();
- // Create a function to stop animation on this specific axis
- var unsubscribeProgress = layoutProgress.onChange(frame);
- this.stopAxisAnimation[axis] = function () {
- _this.isAnimating[axis] = false;
- layoutProgress.stop();
- unsubscribeProgress();
- };
- this.currentAnimationTarget[axis] = target;
- var layoutTransition = transition ||
- visualElement.getDefaultTransition() ||
- defaultLayoutTransition;
- // Start the animation on this axis
- var animation = transitions_startAnimation(axis === "x" ? "layoutX" : "layoutY", layoutProgress, progressTarget, layoutTransition && getValueTransition(layoutTransition, "layout")).then(this.stopAxisAnimation[axis]);
- return animation;
- };
- Animate.prototype.safeToRemove = function () {
- var _a, _b;
- (_b = (_a = this.props).safeToRemove) === null || _b === void 0 ? void 0 : _b.call(_a);
- };
- Animate.prototype.render = function () {
- return null;
- };
- return Animate;
-}(external_React_["Component"]));
-function AnimateLayoutContextProvider(props) {
- var _a = __read(usePresence(), 2), safeToRemove = _a[1];
- return external_React_["createElement"](Animate_Animate, __assign({}, props, { safeToRemove: safeToRemove }));
-}
-function hasMoved(a, b) {
- return (!isZeroBox(a) &&
- !isZeroBox(b) &&
- (!axisIsEqual(a.x, b.x) || !axisIsEqual(a.y, b.y)));
-}
-var zeroAxis = { min: 0, max: 0 };
-function isZeroBox(a) {
- return axisIsEqual(a.x, zeroAxis) && axisIsEqual(a.y, zeroAxis);
-}
-function axisIsEqual(a, b) {
- return a.min === b.min && a.max === b.max;
-}
-var defaultLayoutTransition = {
- duration: 0.45,
- ease: [0.4, 0, 0.1, 1],
-};
-function isProvidedCorrectDataForRelativeSharedLayout(prevParent, originBox, targetBox) {
- return prevParent || (!prevParent && !(originBox || targetBox));
-}
+Based off glamor's StyleSheet, thanks Sunil ❤️
+high performance StyleSheet for css-in-js systems
+- uses multiple style tags behind the scenes for millions of rules
+- uses `insertRule` for appending in production for *much* faster performance
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/components/AnimateSharedLayout/utils/batcher.js
+// usage
+import { StyleSheet } from '@emotion/sheet'
+let styleSheet = new StyleSheet({ key: '', container: document.head })
+styleSheet.insert('#box { border: 1px solid red; }')
+- appends a css rule into the stylesheet
+styleSheet.flush()
+- empties the stylesheet of all its contents
+*/
+// $FlowFixMe
+function sheetForTag(tag) {
+ if (tag.sheet) {
+ // $FlowFixMe
+ return tag.sheet;
+ } // this weirdness brought to you by firefox
+ /* istanbul ignore next */
-/**
- * Default handlers for batching VisualElements
- */
-var defaultHandler = {
- layoutReady: function (child) { return child.notifyLayoutReady(); },
-};
-/**
- * Create a batcher to process VisualElements
- */
-function createBatcher() {
- var queue = new Set();
- return {
- add: function (child) { return queue.add(child); },
- flush: function (_a) {
- var _b = _a === void 0 ? defaultHandler : _a, layoutReady = _b.layoutReady, parent = _b.parent;
- batchLayout(function (read, write) {
- var order = Array.from(queue).sort(compareByDepth);
- var ancestors = parent
- ? collectProjectingAncestors(parent)
- : [];
- write(function () {
- var allElements = __spreadArray(__spreadArray([], __read(ancestors)), __read(order));
- allElements.forEach(function (element) { return element.resetTransform(); });
- });
- read(function () {
- order.forEach(updateLayoutMeasurement);
- });
- write(function () {
- ancestors.forEach(function (element) { return element.restoreTransform(); });
- order.forEach(layoutReady);
- });
- read(function () {
- /**
- * After all children have started animating, ensure any Entering components are set to Present.
- * If we add deferred animations (set up all animations and then start them in two loops) this
- * could be moved to the start loop. But it needs to happen after all the animations configs
- * are generated in AnimateSharedLayout as this relies on presence data
- */
- order.forEach(function (child) {
- if (child.isPresent)
- child.presence = Presence.Present;
- });
- });
- write(function () {
- /**
- * Starting these animations will have queued jobs on the frame loop. In some situations,
- * like when removing an element, these will be processed too late after the DOM is manipulated,
- * leaving a flash of incorrectly-projected content. By manually flushing these jobs
- * we ensure there's no flash.
- */
- flushSync.preRender();
- flushSync.render();
- });
- read(function () {
- /**
- * Schedule a callback at the end of the following frame to assign the latest projection
- * box to the prevViewportBox snapshot. Once global batching is in place this could be run
- * synchronously. But for now it ensures that if any nested `AnimateSharedLayout` top-level
- * child attempts to calculate its previous relative position against a prevViewportBox
- * it will be against its latest projection box instead, as the snapshot is useless beyond this
- * render.
- */
- dist_es.postRender(function () {
- return order.forEach(assignProjectionToSnapshot);
- });
- queue.clear();
- });
- });
- // TODO: Need to find a layout-synchronous way of flushing this
- flushLayout();
- },
- };
-}
-function assignProjectionToSnapshot(child) {
- child.prevViewportBox = child.projection.target;
-}
+ for (var i = 0; i < document.styleSheets.length; i++) {
+ if (document.styleSheets[i].ownerNode === tag) {
+ // $FlowFixMe
+ return document.styleSheets[i];
+ }
+ }
+}
+function createStyleElement(options) {
+ var tag = document.createElement('style');
+ tag.setAttribute('data-emotion', options.key);
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/context/SharedLayoutContext.js
+ if (options.nonce !== undefined) {
+ tag.setAttribute('nonce', options.nonce);
+ }
+ tag.appendChild(document.createTextNode(''));
+ tag.setAttribute('data-s', '');
+ return tag;
+}
+var emotion_sheet_browser_esm_StyleSheet = /*#__PURE__*/function () {
+ function StyleSheet(options) {
+ var _this = this;
-var SharedLayoutContext = Object(external_React_["createContext"])(createBatcher());
-/**
- * @internal
- */
-var FramerTreeLayoutContext = Object(external_React_["createContext"])(createBatcher());
-function isSharedLayout(context) {
- return !!context.forceUpdate;
-}
+ this._insertTag = function (tag) {
+ var before;
+ if (_this.tags.length === 0) {
+ if (_this.insertionPoint) {
+ before = _this.insertionPoint.nextSibling;
+ } else if (_this.prepend) {
+ before = _this.container.firstChild;
+ } else {
+ before = _this.before;
+ }
+ } else {
+ before = _this.tags[_this.tags.length - 1].nextSibling;
+ }
+ _this.container.insertBefore(tag, before);
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/Measure.js
+ _this.tags.push(tag);
+ };
+ this.isSpeedy = options.speedy === undefined ? "production" === 'production' : options.speedy;
+ this.tags = [];
+ this.ctr = 0;
+ this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
+ this.key = options.key;
+ this.container = options.container;
+ this.prepend = options.prepend;
+ this.insertionPoint = options.insertionPoint;
+ this.before = null;
+ }
+ var _proto = StyleSheet.prototype;
+ _proto.hydrate = function hydrate(nodes) {
+ nodes.forEach(this._insertTag);
+ };
-/**
- * This component is responsible for scheduling the measuring of the motion component
- */
-var Measure_Measure = /** @class */ (function (_super) {
- __extends(Measure, _super);
- function Measure() {
- return _super !== null && _super.apply(this, arguments) || this;
+ _proto.insert = function insert(rule) {
+ // the max length is how many rules we have per style tag, it's 65000 in speedy mode
+ // it's 1 in dev because we insert source maps that map a single rule to a location
+ // and you can only have one source map per style tag
+ if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
+ this._insertTag(createStyleElement(this));
}
- /**
- * If this is a child of a SyncContext, register the VisualElement with it on mount.
- */
- Measure.prototype.componentDidMount = function () {
- var _a = this.props, syncLayout = _a.syncLayout, framerSyncLayout = _a.framerSyncLayout, visualElement = _a.visualElement;
- isSharedLayout(syncLayout) && syncLayout.register(visualElement);
- isSharedLayout(framerSyncLayout) &&
- framerSyncLayout.register(visualElement);
- visualElement.onUnmount(function () {
- if (isSharedLayout(syncLayout)) {
- syncLayout.remove(visualElement);
- }
- if (isSharedLayout(framerSyncLayout)) {
- framerSyncLayout.remove(visualElement);
- }
- });
- };
- /**
- * If this is a child of a SyncContext, notify it that it needs to re-render. It will then
- * handle the snapshotting.
- *
- * If it is stand-alone component, add it to the batcher.
- */
- Measure.prototype.getSnapshotBeforeUpdate = function () {
- var _a = this.props, syncLayout = _a.syncLayout, visualElement = _a.visualElement;
- if (isSharedLayout(syncLayout)) {
- syncLayout.syncUpdate();
- }
- else {
- snapshotViewportBox(visualElement);
- syncLayout.add(visualElement);
- }
- return null;
- };
- Measure.prototype.componentDidUpdate = function () {
- var syncLayout = this.props.syncLayout;
- if (!isSharedLayout(syncLayout))
- syncLayout.flush();
- };
- Measure.prototype.render = function () {
- return null;
- };
- return Measure;
-}(external_React_default.a.Component));
-function MeasureContextProvider(props) {
- var syncLayout = Object(external_React_["useContext"])(SharedLayoutContext);
- var framerSyncLayout = Object(external_React_["useContext"])(FramerTreeLayoutContext);
- return (external_React_default.a.createElement(Measure_Measure, __assign({}, props, { syncLayout: syncLayout, framerSyncLayout: framerSyncLayout })));
-}
-
+ var tag = this.tags[this.tags.length - 1];
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/motion/features/layout/index.js
+ if (false) { var isImportRule; }
+ if (this.isSpeedy) {
+ var sheet = sheetForTag(tag);
+ try {
+ // this is the ultrafast version, works across browsers
+ // the big drawback is that the css won't be editable in devtools
+ sheet.insertRule(rule, sheet.cssRules.length);
+ } catch (e) {
+ if (false) {}
+ }
+ } else {
+ tag.appendChild(document.createTextNode(rule));
+ }
-var layoutAnimations = {
- measureLayout: MeasureContextProvider,
- layoutAnimation: AnimateLayoutContextProvider,
-};
+ this.ctr++;
+ };
+ _proto.flush = function flush() {
+ // $FlowFixMe
+ this.tags.forEach(function (tag) {
+ return tag.parentNode && tag.parentNode.removeChild(tag);
+ });
+ this.tags = [];
+ this.ctr = 0;
+ if (false) {}
+ };
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/state.js
+ return StyleSheet;
+}();
-var createProjectionState = function () { return ({
- isEnabled: false,
- isHydrated: false,
- isTargetLocked: false,
- target: axisBox(),
- targetFinal: axisBox(),
-}); };
-function createLayoutState() {
- return {
- isHydrated: false,
- layout: axisBox(),
- layoutCorrected: axisBox(),
- treeScale: { x: 1, y: 1 },
- delta: geometry_delta(),
- deltaFinal: geometry_delta(),
- deltaTransform: "",
- };
-}
-var zeroLayout = createLayoutState();
+;// CONCATENATED MODULE: ./node_modules/stylis/src/Utility.js
+/**
+ * @param {number}
+ * @return {number}
+ */
+var abs = Math.abs
+/**
+ * @param {number}
+ * @return {string}
+ */
+var Utility_from = String.fromCharCode
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/utils/build-projection-transform.js
+/**
+ * @param {object}
+ * @return {object}
+ */
+var Utility_assign = Object.assign
+/**
+ * @param {string} value
+ * @param {number} length
+ * @return {number}
+ */
+function hash (value, length) {
+ return (((((((length << 2) ^ Utility_charat(value, 0)) << 2) ^ Utility_charat(value, 1)) << 2) ^ Utility_charat(value, 2)) << 2) ^ Utility_charat(value, 3)
+}
/**
- * Build a transform style that takes a calculated delta between the element's current
- * space on screen and projects it into the desired space.
+ * @param {string} value
+ * @return {string}
*/
-function buildLayoutProjectionTransform(_a, treeScale, latestTransform) {
- var x = _a.x, y = _a.y;
- /**
- * The translations we use to calculate are always relative to the viewport coordinate space.
- * But when we apply scales, we also scale the coordinate space of an element and its children.
- * For instance if we have a treeScale (the culmination of all parent scales) of 0.5 and we need
- * to move an element 100 pixels, we actually need to move it 200 in within that scaled space.
- */
- var xTranslate = x.translate / treeScale.x;
- var yTranslate = y.translate / treeScale.y;
- var transform = "translate3d(" + xTranslate + "px, " + yTranslate + "px, 0) ";
- if (latestTransform) {
- var rotate = latestTransform.rotate, rotateX = latestTransform.rotateX, rotateY = latestTransform.rotateY;
- if (rotate)
- transform += "rotate(" + rotate + ") ";
- if (rotateX)
- transform += "rotateX(" + rotateX + ") ";
- if (rotateY)
- transform += "rotateY(" + rotateY + ") ";
- }
- transform += "scale(" + x.scale + ", " + y.scale + ")";
- return !latestTransform && transform === identityProjection ? "" : transform;
+function trim (value) {
+ return value.trim()
}
+
/**
- * Take the calculated delta origin and apply it as a transform string.
+ * @param {string} value
+ * @param {RegExp} pattern
+ * @return {string?}
*/
-function buildLayoutProjectionTransformOrigin(_a) {
- var deltaFinal = _a.deltaFinal;
- return deltaFinal.x.origin * 100 + "% " + deltaFinal.y.origin * 100 + "% 0";
+function match (value, pattern) {
+ return (value = pattern.exec(value)) ? value[0] : value
}
-var identityProjection = buildLayoutProjectionTransform(zeroLayout.delta, zeroLayout.treeScale, { x: 1, y: 1 });
+/**
+ * @param {string} value
+ * @param {(string|RegExp)} pattern
+ * @param {string} replacement
+ * @return {string}
+ */
+function replace (value, pattern, replacement) {
+ return value.replace(pattern, replacement)
+}
+/**
+ * @param {string} value
+ * @param {string} search
+ * @return {number}
+ */
+function indexof (value, search) {
+ return value.indexOf(search)
+}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/lifecycles.js
+/**
+ * @param {string} value
+ * @param {number} index
+ * @return {number}
+ */
+function Utility_charat (value, index) {
+ return value.charCodeAt(index) | 0
+}
+/**
+ * @param {string} value
+ * @param {number} begin
+ * @param {number} end
+ * @return {string}
+ */
+function Utility_substr (value, begin, end) {
+ return value.slice(begin, end)
+}
+/**
+ * @param {string} value
+ * @return {number}
+ */
+function Utility_strlen (value) {
+ return value.length
+}
-var lifecycles_names = [
- "LayoutMeasure",
- "BeforeLayoutMeasure",
- "LayoutUpdate",
- "ViewportBoxUpdate",
- "Update",
- "Render",
- "AnimationComplete",
- "LayoutAnimationComplete",
- "AnimationStart",
- "SetAxisTarget",
- "Unmount",
-];
-function createLifecycles() {
- var managers = lifecycles_names.map(function () { return new subscription_manager_SubscriptionManager(); });
- var propSubscriptions = {};
- var lifecycles = {
- clearAllListeners: function () { return managers.forEach(function (manager) { return manager.clear(); }); },
- updatePropListeners: function (props) {
- return lifecycles_names.forEach(function (name) {
- var _a;
- (_a = propSubscriptions[name]) === null || _a === void 0 ? void 0 : _a.call(propSubscriptions);
- var on = "on" + name;
- var propListener = props[on];
- if (propListener) {
- propSubscriptions[name] = lifecycles[on](propListener);
- }
- });
- },
- };
- managers.forEach(function (manager, i) {
- lifecycles["on" + lifecycles_names[i]] = function (handler) { return manager.add(handler); };
- lifecycles["notify" + lifecycles_names[i]] = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- return manager.notify.apply(manager, __spreadArray([], __read(args)));
- };
- });
- return lifecycles;
+/**
+ * @param {any[]} value
+ * @return {number}
+ */
+function Utility_sizeof (value) {
+ return value.length
}
+/**
+ * @param {any} value
+ * @param {any[]} array
+ * @return {any}
+ */
+function Utility_append (value, array) {
+ return array.push(value), value
+}
+/**
+ * @param {string[]} array
+ * @param {function} callback
+ * @return {string}
+ */
+function Utility_combine (array, callback) {
+ return array.map(callback).join('')
+}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/motion-values.js
+;// CONCATENATED MODULE: ./node_modules/stylis/src/Tokenizer.js
+var line = 1
+var column = 1
+var Tokenizer_length = 0
+var position = 0
+var character = 0
+var characters = ''
-function updateMotionValuesFromProps(element, next, prev) {
- var _a;
- for (var key in next) {
- var nextValue = next[key];
- var prevValue = prev[key];
- if (isMotionValue(nextValue)) {
- /**
- * If this is a motion value found in props or style, we want to add it
- * to our visual element's motion value map.
- */
- element.addValue(key, nextValue);
- }
- else if (isMotionValue(prevValue)) {
- /**
- * If we're swapping to a new motion value, create a new motion value
- * from that
- */
- element.addValue(key, motionValue(nextValue));
- }
- else if (prevValue !== nextValue) {
- /**
- * If this is a flat value that has changed, update the motion value
- * or create one if it doesn't exist. We only want to do this if we're
- * not handling the value with our animation state.
- */
- if (element.hasValue(key)) {
- var existingValue = element.getValue(key);
- // TODO: Only update values that aren't being animated or even looked at
- !existingValue.hasAnimated && existingValue.set(nextValue);
- }
- else {
- element.addValue(key, motionValue((_a = element.getStaticValue(key)) !== null && _a !== void 0 ? _a : nextValue));
- }
- }
- }
- // Handle removed values
- for (var key in prev) {
- if (next[key] === undefined)
- element.removeValue(key);
- }
- return next;
+/**
+ * @param {string} value
+ * @param {object | null} root
+ * @param {object | null} parent
+ * @param {string} type
+ * @param {string[] | string} props
+ * @param {object[] | string} children
+ * @param {number} length
+ */
+function node (value, root, parent, type, props, children, length) {
+ return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}
}
+/**
+ * @param {object} root
+ * @param {object} props
+ * @return {object}
+ */
+function copy (root, props) {
+ return Utility_assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)
+}
+/**
+ * @return {number}
+ */
+function Tokenizer_char () {
+ return character
+}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/projection.js
+/**
+ * @return {number}
+ */
+function prev () {
+ character = position > 0 ? Utility_charat(characters, --position) : 0
+ if (column--, character === 10)
+ column = 1, line--
+ return character
+}
-function updateLayoutDeltas(_a, _b, treePath, transformOrigin) {
- var delta = _a.delta, layout = _a.layout, layoutCorrected = _a.layoutCorrected, treeScale = _a.treeScale;
- var target = _b.target;
- /**
- * Reset the corrected box with the latest values from box, as we're then going
- * to perform mutative operations on it.
- */
- resetBox(layoutCorrected, layout);
- /**
- * Apply all the parent deltas to this box to produce the corrected box. This
- * is the layout box, as it will appear on screen as a result of the transforms of its parents.
- */
- applyTreeDeltas(layoutCorrected, treeScale, treePath);
- /**
- * Update the delta between the corrected box and the target box before user-set transforms were applied.
- * This will allow us to calculate the corrected borderRadius and boxShadow to compensate
- * for our layout reprojection, but still allow them to be scaled correctly by the user.
- * It might be that to simplify this we may want to accept that user-set scale is also corrected
- * and we wouldn't have to keep and calc both deltas, OR we could support a user setting
- * to allow people to choose whether these styles are corrected based on just the
- * layout reprojection or the final bounding box.
- */
- updateBoxDelta(delta, layoutCorrected, target, transformOrigin);
+/**
+ * @return {number}
+ */
+function next () {
+ character = position < Tokenizer_length ? Utility_charat(characters, position++) : 0
+
+ if (column++, character === 10)
+ column = 1, line++
+
+ return character
}
+/**
+ * @return {number}
+ */
+function peek () {
+ return Utility_charat(characters, position)
+}
+/**
+ * @return {number}
+ */
+function caret () {
+ return position
+}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/utils/flat-tree.js
+/**
+ * @param {number} begin
+ * @param {number} end
+ * @return {string}
+ */
+function slice (begin, end) {
+ return Utility_substr(characters, begin, end)
+}
+/**
+ * @param {number} type
+ * @return {number}
+ */
+function token (type) {
+ switch (type) {
+ // \0 \t \n \r \s whitespace token
+ case 0: case 9: case 10: case 13: case 32:
+ return 5
+ // ! + , / > @ ~ isolate token
+ case 33: case 43: case 44: case 47: case 62: case 64: case 126:
+ // ; { } breakpoint token
+ case 59: case 123: case 125:
+ return 4
+ // : accompanied token
+ case 58:
+ return 3
+ // " ' ( [ opening delimit token
+ case 34: case 39: case 40: case 91:
+ return 2
+ // ) ] closing delimit token
+ case 41: case 93:
+ return 1
+ }
+ return 0
+}
-var flat_tree_FlatTree = /** @class */ (function () {
- function FlatTree() {
- this.children = [];
- this.isDirty = false;
- }
- FlatTree.prototype.add = function (child) {
- addUniqueItem(this.children, child);
- this.isDirty = true;
- };
- FlatTree.prototype.remove = function (child) {
- array_removeItem(this.children, child);
- this.isDirty = true;
- };
- FlatTree.prototype.forEach = function (callback) {
- this.isDirty && this.children.sort(compareByDepth);
- this.isDirty = false;
- this.children.forEach(callback);
- };
- return FlatTree;
-}());
+/**
+ * @param {string} value
+ * @return {any[]}
+ */
+function alloc (value) {
+ return line = column = 1, Tokenizer_length = Utility_strlen(characters = value), position = 0, []
+}
+/**
+ * @param {any} value
+ * @return {any}
+ */
+function dealloc (value) {
+ return characters = '', value
+}
+/**
+ * @param {number} type
+ * @return {string}
+ */
+function delimit (type) {
+ return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
+}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/projection/relative-set.js
+/**
+ * @param {string} value
+ * @return {string[]}
+ */
+function Tokenizer_tokenize (value) {
+ return dealloc(tokenizer(alloc(value)))
+}
+/**
+ * @param {number} type
+ * @return {string}
+ */
+function whitespace (type) {
+ while (character = peek())
+ if (character < 33)
+ next()
+ else
+ break
+ return token(type) > 2 || token(character) > 3 ? '' : ' '
+}
-function setCurrentViewportBox(visualElement) {
- var projectionParent = visualElement.getProjectionParent();
- if (!projectionParent) {
- visualElement.rebaseProjectionTarget();
- return;
- }
- var relativeOffset = calcRelativeOffset(projectionParent.getLayoutState().layout, visualElement.getLayoutState().layout);
- eachAxis(function (axis) {
- visualElement.setProjectionTargetAxis(axis, relativeOffset[axis].min, relativeOffset[axis].max, true);
- });
+/**
+ * @param {string[]} children
+ * @return {string[]}
+ */
+function tokenizer (children) {
+ while (next())
+ switch (token(character)) {
+ case 0: append(identifier(position - 1), children)
+ break
+ case 2: append(delimit(character), children)
+ break
+ default: append(from(character), children)
+ }
+
+ return children
}
+/**
+ * @param {number} index
+ * @param {number} count
+ * @return {string}
+ */
+function escaping (index, count) {
+ while (--count && next())
+ // not 0-9 A-F a-f
+ if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))
+ break
+ return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))
+}
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/index.js
+/**
+ * @param {number} type
+ * @return {number}
+ */
+function delimiter (type) {
+ while (next())
+ switch (character) {
+ // ] ) " '
+ case type:
+ return position
+ // " '
+ case 34: case 39:
+ if (type !== 34 && type !== 39)
+ delimiter(character)
+ break
+ // (
+ case 40:
+ if (type === 41)
+ delimiter(type)
+ break
+ // \
+ case 92:
+ next()
+ break
+ }
+ return position
+}
+/**
+ * @param {number} type
+ * @param {number} index
+ * @return {number}
+ */
+function commenter (type, index) {
+ while (next())
+ // //
+ if (type + character === 47 + 10)
+ break
+ // /*
+ else if (type + character === 42 + 42 && peek() === 47)
+ break
+ return '/*' + slice(index, position - 1) + '*' + Utility_from(type === 47 ? type : next())
+}
+/**
+ * @param {number} index
+ * @return {string}
+ */
+function identifier (index) {
+ while (!token(peek()))
+ next()
+ return slice(index, position)
+}
+;// CONCATENATED MODULE: ./node_modules/stylis/src/Enum.js
+var MS = '-ms-'
+var MOZ = '-moz-'
+var WEBKIT = '-webkit-'
+var COMMENT = 'comm'
+var Enum_RULESET = 'rule'
+var DECLARATION = 'decl'
+var PAGE = '@page'
+var MEDIA = '@media'
+var IMPORT = '@import'
+var CHARSET = '@charset'
+var VIEWPORT = '@viewport'
+var SUPPORTS = '@supports'
+var DOCUMENT = '@document'
+var NAMESPACE = '@namespace'
+var KEYFRAMES = '@keyframes'
+var FONT_FACE = '@font-face'
+var COUNTER_STYLE = '@counter-style'
+var FONT_FEATURE_VALUES = '@font-feature-values'
+;// CONCATENATED MODULE: ./node_modules/stylis/src/Serializer.js
+/**
+ * @param {object[]} children
+ * @param {function} callback
+ * @return {string}
+ */
+function serialize (children, callback) {
+ var output = ''
+ var length = Utility_sizeof(children)
+ for (var i = 0; i < length; i++)
+ output += callback(children[i], i, children, callback) || ''
+ return output
+}
+/**
+ * @param {object} element
+ * @param {number} index
+ * @param {object[]} children
+ * @param {function} callback
+ * @return {string}
+ */
+function stringify (element, index, children, callback) {
+ switch (element.type) {
+ case IMPORT: case DECLARATION: return element.return = element.return || element.value
+ case COMMENT: return ''
+ case KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'
+ case Enum_RULESET: element.value = element.props.join(',')
+ }
+ return Utility_strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''
+}
+
+;// CONCATENATED MODULE: ./node_modules/stylis/src/Prefixer.js
+
+
+
+/**
+ * @param {string} value
+ * @param {number} length
+ * @return {string}
+ */
+function prefix (value, length) {
+ switch (hash(value, length)) {
+ // color-adjust
+ case 5103:
+ return WEBKIT + 'print-' + value + value
+ // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
+ case 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921:
+ // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
+ case 5572: case 6356: case 5844: case 3191: case 6645: case 3005:
+ // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
+ case 6391: case 5879: case 5623: case 6135: case 4599: case 4855:
+ // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
+ case 4215: case 6389: case 5109: case 5365: case 5621: case 3829:
+ return WEBKIT + value + value
+ // appearance, user-select, transform, hyphens, text-size-adjust
+ case 5349: case 4246: case 4810: case 6968: case 2756:
+ return WEBKIT + value + MOZ + value + MS + value + value
+ // flex, flex-direction
+ case 6828: case 4268:
+ return WEBKIT + value + MS + value + value
+ // order
+ case 6165:
+ return WEBKIT + value + MS + 'flex-' + value + value
+ // align-items
+ case 5187:
+ return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value
+ // align-self
+ case 5443:
+ return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value
+ // align-content
+ case 4675:
+ return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value
+ // flex-shrink
+ case 5548:
+ return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value
+ // flex-basis
+ case 5292:
+ return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value
+ // flex-grow
+ case 6060:
+ return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value
+ // transition
+ case 4554:
+ return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value
+ // cursor
+ case 6187:
+ return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value
+ // background, background-image
+ case 5495: case 3959:
+ return replace(value, /(image-set\([^]*)/, WEBKIT + '$1' + '$`$1')
+ // justify-content
+ case 4968:
+ return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value
+ // (margin|padding)-inline-(start|end)
+ case 4095: case 3583: case 4068: case 2532:
+ return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value
+ // (min|max)?(width|height|inline-size|block-size)
+ case 8116: case 7059: case 5753: case 5535:
+ case 5445: case 5701: case 4933: case 4677:
+ case 5533: case 5789: case 5021: case 4765:
+ // stretch, max-content, min-content, fill-available
+ if (Utility_strlen(value) - 1 - length > 6)
+ switch (Utility_charat(value, length + 1)) {
+ // (m)ax-content, (m)in-content
+ case 109:
+ // -
+ if (Utility_charat(value, length + 4) !== 45)
+ break
+ // (f)ill-available, (f)it-content
+ case 102:
+ return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (Utility_charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value
+ // (s)tretch
+ case 115:
+ return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value
+ }
+ break
+ // position: sticky
+ case 4949:
+ // (s)ticky?
+ if (Utility_charat(value, length + 1) !== 115)
+ break
+ // display: (flex|inline-flex)
+ case 6444:
+ switch (Utility_charat(value, Utility_strlen(value) - 3 - (~indexof(value, '!important') && 10))) {
+ // stic(k)y
+ case 107:
+ return replace(value, ':', ':' + WEBKIT) + value
+ // (inline-)?fl(e)x
+ case 101:
+ return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (Utility_charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value
+ }
+ break
+ // writing-mode
+ case 5936:
+ switch (Utility_charat(value, length + 11)) {
+ // vertical-l(r)
+ case 114:
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value
+ // vertical-r(l)
+ case 108:
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value
+ // horizontal(-)tb
+ case 45:
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value
+ }
+ return WEBKIT + value + MS + value + value
+ }
+ return value
+}
+;// CONCATENATED MODULE: ./node_modules/stylis/src/Middleware.js
-var render_visualElement = function (_a) {
- var _b = _a.treeType, treeType = _b === void 0 ? "" : _b, build = _a.build, getBaseTarget = _a.getBaseTarget, makeTargetAnimatable = _a.makeTargetAnimatable, measureViewportBox = _a.measureViewportBox, renderInstance = _a.render, readValueFromInstance = _a.readValueFromInstance, resetTransform = _a.resetTransform, restoreTransform = _a.restoreTransform, removeValueFromRenderState = _a.removeValueFromRenderState, sortNodePosition = _a.sortNodePosition, scrapeMotionValuesFromProps = _a.scrapeMotionValuesFromProps;
- return function (_a, options) {
- var parent = _a.parent, props = _a.props, presenceId = _a.presenceId, blockInitialAnimation = _a.blockInitialAnimation, visualState = _a.visualState;
- if (options === void 0) { options = {}; }
- var latestValues = visualState.latestValues, renderState = visualState.renderState;
- /**
- * The instance of the render-specific node that will be hydrated by the
- * exposed React ref. So for example, this visual element can host a
- * HTMLElement, plain object, or Three.js object. The functions provided
- * in VisualElementConfig allow us to interface with this instance.
- */
- var instance;
- /**
- * Manages the subscriptions for a visual element's lifecycle, for instance
- * onRender and onViewportBoxUpdate.
- */
- var lifecycles = createLifecycles();
- /**
- *
- */
- var projection = createProjectionState();
- /**
- * A reference to the nearest projecting parent. This is either
- * undefined if we haven't looked for the nearest projecting parent,
- * false if there is no parent performing layout projection, or a reference
- * to the projecting parent.
- */
- var projectionParent;
- /**
- * This is a reference to the visual state of the "lead" visual element.
- * Usually, this will be this visual element. But if it shares a layoutId
- * with other visual elements, only one of them will be designated lead by
- * AnimateSharedLayout. All the other visual elements will take on the visual
- * appearance of the lead while they crossfade to it.
- */
- var leadProjection = projection;
- var leadLatestValues = latestValues;
- var unsubscribeFromLeadVisualElement;
- /**
- * The latest layout measurements and calculated projections. This
- * is seperate from the target projection data in visualState as
- * many visual elements might point to the same piece of visualState as
- * a target, whereas they might each have different layouts and thus
- * projection calculations needed to project into the same viewport box.
- */
- var layoutState = createLayoutState();
- /**
- *
- */
- var crossfader;
- /**
- * Keep track of whether the viewport box has been updated since the
- * last time the layout projection was re-calculated.
- */
- var hasViewportBoxUpdated = false;
- /**
- * A map of all motion values attached to this visual element. Motion
- * values are source of truth for any given animated value. A motion
- * value might be provided externally by the component via props.
- */
- var values = new Map();
- /**
- * A map of every subscription that binds the provided or generated
- * motion values onChange listeners to this visual element.
- */
- var valueSubscriptions = new Map();
- /**
- * A reference to the previously-provided motion values as returned
- * from scrapeMotionValuesFromProps. We use the keys in here to determine
- * if any motion values need to be removed after props are updated.
- */
- var prevMotionValues = {};
- /**
- * x/y motion values that track the progress of initiated layout
- * animations.
- *
- * TODO: Target for removal
- */
- var projectionTargetProgress;
- /**
- * When values are removed from all animation props we need to search
- * for a fallback value to animate to. These values are tracked in baseTarget.
- */
- var baseTarget = __assign({}, latestValues);
- // Internal methods ========================
- /**
- * On mount, this will be hydrated with a callback to disconnect
- * this visual element from its parent on unmount.
- */
- var removeFromVariantTree;
- /**
- *
- */
- function render() {
- if (!instance)
- return;
- if (element.isProjectionReady()) {
- /**
- * Apply the latest user-set transforms to the targetBox to produce the targetBoxFinal.
- * This is the final box that we will then project into by calculating a transform delta and
- * applying it to the corrected box.
- */
- applyBoxTransforms(leadProjection.targetFinal, leadProjection.target, leadLatestValues);
- /**
- * Update the delta between the corrected box and the final target box, after
- * user-set transforms are applied to it. This will be used by the renderer to
- * create a transform style that will reproject the element from its actual layout
- * into the desired bounding box.
- */
- updateBoxDelta(layoutState.deltaFinal, layoutState.layoutCorrected, leadProjection.targetFinal, latestValues);
- }
- triggerBuild();
- renderInstance(instance, renderState);
- }
- function triggerBuild() {
- var valuesToRender = latestValues;
- if (crossfader && crossfader.isActive()) {
- var crossfadedValues = crossfader.getCrossfadeState(element);
- if (crossfadedValues)
- valuesToRender = crossfadedValues;
- }
- build(element, renderState, valuesToRender, leadProjection, layoutState, options, props);
- }
- function update() {
- lifecycles.notifyUpdate(latestValues);
- }
- function updateLayoutProjection() {
- if (!element.isProjectionReady())
- return;
- var delta = layoutState.delta, treeScale = layoutState.treeScale;
- var prevTreeScaleX = treeScale.x;
- var prevTreeScaleY = treeScale.y;
- var prevDeltaTransform = layoutState.deltaTransform;
- updateLayoutDeltas(layoutState, leadProjection, element.path, latestValues);
- hasViewportBoxUpdated &&
- element.notifyViewportBoxUpdate(leadProjection.target, delta);
- hasViewportBoxUpdated = false;
- var deltaTransform = buildLayoutProjectionTransform(delta, treeScale);
- if (deltaTransform !== prevDeltaTransform ||
- // Also compare calculated treeScale, for values that rely on this only for scale correction
- prevTreeScaleX !== treeScale.x ||
- prevTreeScaleY !== treeScale.y) {
- element.scheduleRender();
- }
- layoutState.deltaTransform = deltaTransform;
- }
- function updateTreeLayoutProjection() {
- element.layoutTree.forEach(fireUpdateLayoutProjection);
+
+
+
+
+/**
+ * @param {function[]} collection
+ * @return {function}
+ */
+function middleware (collection) {
+ var length = Utility_sizeof(collection)
+
+ return function (element, index, children, callback) {
+ var output = ''
+
+ for (var i = 0; i < length; i++)
+ output += collection[i](element, index, children, callback) || ''
+
+ return output
+ }
+}
+
+/**
+ * @param {function} callback
+ * @return {function}
+ */
+function rulesheet (callback) {
+ return function (element) {
+ if (!element.root)
+ if (element = element.return)
+ callback(element)
+ }
+}
+
+/**
+ * @param {object} element
+ * @param {number} index
+ * @param {object[]} children
+ * @param {function} callback
+ */
+function prefixer (element, index, children, callback) {
+ if (element.length > -1)
+ if (!element.return)
+ switch (element.type) {
+ case DECLARATION: element.return = prefix(element.value, element.length)
+ break
+ case KEYFRAMES:
+ return serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)
+ case Enum_RULESET:
+ if (element.length)
+ return Utility_combine(element.props, function (value) {
+ switch (match(value, /(::plac\w+|:read-\w+)/)) {
+ // :read-(only|write)
+ case ':read-only': case ':read-write':
+ return serialize([copy(element, {props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]})], callback)
+ // :placeholder
+ case '::placeholder':
+ return serialize([
+ copy(element, {props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]}),
+ copy(element, {props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]}),
+ copy(element, {props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]})
+ ], callback)
+ }
+
+ return ''
+ })
+ }
+}
+
+/**
+ * @param {object} element
+ * @param {number} index
+ * @param {object[]} children
+ */
+function namespace (element) {
+ switch (element.type) {
+ case RULESET:
+ element.props = element.props.map(function (value) {
+ return combine(tokenize(value), function (value, index, children) {
+ switch (charat(value, 0)) {
+ // \f
+ case 12:
+ return substr(value, 1, strlen(value))
+ // \0 ( + > ~
+ case 0: case 40: case 43: case 62: case 126:
+ return value
+ // :
+ case 58:
+ if (children[++index] === 'global')
+ children[index] = '', children[++index] = '\f' + substr(children[index], index = 1, -1)
+ // \s
+ case 32:
+ return index === 1 ? '' : value
+ default:
+ switch (index) {
+ case 0: element = value
+ return sizeof(children) > 1 ? '' : value
+ case index = sizeof(children) - 1: case 2:
+ return index === 2 ? value + element + element : value + element
+ default:
+ return value
+ }
+ }
+ })
+ })
+ }
+}
+
+;// CONCATENATED MODULE: ./node_modules/stylis/src/Parser.js
+
+
+
+
+/**
+ * @param {string} value
+ * @return {object[]}
+ */
+function compile (value) {
+ return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))
+}
+
+/**
+ * @param {string} value
+ * @param {object} root
+ * @param {object?} parent
+ * @param {string[]} rule
+ * @param {string[]} rules
+ * @param {string[]} rulesets
+ * @param {number[]} pseudo
+ * @param {number[]} points
+ * @param {string[]} declarations
+ * @return {object}
+ */
+function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
+ var index = 0
+ var offset = 0
+ var length = pseudo
+ var atrule = 0
+ var property = 0
+ var previous = 0
+ var variable = 1
+ var scanning = 1
+ var ampersand = 1
+ var character = 0
+ var type = ''
+ var props = rules
+ var children = rulesets
+ var reference = rule
+ var characters = type
+
+ while (scanning)
+ switch (previous = character, character = next()) {
+ // (
+ case 40:
+ if (previous != 108 && characters.charCodeAt(length - 1) == 58) {
+ if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f') != -1)
+ ampersand = -1
+ break
+ }
+ // " ' [
+ case 34: case 39: case 91:
+ characters += delimit(character)
+ break
+ // \t \n \r \s
+ case 9: case 10: case 13: case 32:
+ characters += whitespace(previous)
+ break
+ // \
+ case 92:
+ characters += escaping(caret() - 1, 7)
+ continue
+ // /
+ case 47:
+ switch (peek()) {
+ case 42: case 47:
+ Utility_append(comment(commenter(next(), caret()), root, parent), declarations)
+ break
+ default:
+ characters += '/'
+ }
+ break
+ // {
+ case 123 * variable:
+ points[index++] = Utility_strlen(characters) * ampersand
+ // } ; \0
+ case 125 * variable: case 59: case 0:
+ switch (character) {
+ // \0 }
+ case 0: case 125: scanning = 0
+ // ;
+ case 59 + offset:
+ if (property > 0 && (Utility_strlen(characters) - length))
+ Utility_append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)
+ break
+ // @ ;
+ case 59: characters += ';'
+ // { rule/at-rule
+ default:
+ Utility_append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)
+
+ if (character === 123)
+ if (offset === 0)
+ parse(characters, root, reference, reference, props, rulesets, length, points, children)
+ else
+ switch (atrule) {
+ // d m s
+ case 100: case 109: case 115:
+ parse(value, reference, reference, rule && Utility_append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)
+ break
+ default:
+ parse(characters, reference, reference, reference, [''], children, 0, points, children)
+ }
+ }
+
+ index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo
+ break
+ // :
+ case 58:
+ length = 1 + Utility_strlen(characters), property = previous
+ default:
+ if (variable < 1)
+ if (character == 123)
+ --variable
+ else if (character == 125 && variable++ == 0 && prev() == 125)
+ continue
+
+ switch (characters += Utility_from(character), character * variable) {
+ // &
+ case 38:
+ ampersand = offset > 0 ? 1 : (characters += '\f', -1)
+ break
+ // ,
+ case 44:
+ points[index++] = (Utility_strlen(characters) - 1) * ampersand, ampersand = 1
+ break
+ // @
+ case 64:
+ // -
+ if (peek() === 45)
+ characters += delimit(next())
+
+ atrule = peek(), offset = length = Utility_strlen(type = characters += identifier(caret())), character++
+ break
+ // -
+ case 45:
+ if (previous === 45 && Utility_strlen(characters) == 2)
+ variable = 0
+ }
+ }
+
+ return rulesets
+}
+
+/**
+ * @param {string} value
+ * @param {object} root
+ * @param {object?} parent
+ * @param {number} index
+ * @param {number} offset
+ * @param {string[]} rules
+ * @param {number[]} points
+ * @param {string} type
+ * @param {string[]} props
+ * @param {string[]} children
+ * @param {number} length
+ * @return {object}
+ */
+function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {
+ var post = offset - 1
+ var rule = offset === 0 ? rules : ['']
+ var size = Utility_sizeof(rule)
+
+ for (var i = 0, j = 0, k = 0; i < index; ++i)
+ for (var x = 0, y = Utility_substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
+ if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x])))
+ props[k++] = z
+
+ return node(value, root, parent, offset === 0 ? Enum_RULESET : type, props, children, length)
+}
+
+/**
+ * @param {number} value
+ * @param {object} root
+ * @param {object?} parent
+ * @return {object}
+ */
+function comment (value, root, parent) {
+ return node(value, root, parent, COMMENT, Utility_from(Tokenizer_char()), Utility_substr(value, 2, -2), 0)
+}
+
+/**
+ * @param {string} value
+ * @param {object} root
+ * @param {object?} parent
+ * @param {number} length
+ * @return {object}
+ */
+function declaration (value, root, parent, length) {
+ return node(value, root, parent, DECLARATION, Utility_substr(value, 0, length), Utility_substr(value, length + 1, -1), length)
+}
+
+;// CONCATENATED MODULE: ./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js
+
+
+
+
+
+var last = function last(arr) {
+ return arr.length ? arr[arr.length - 1] : null;
+}; // based on https://github.com/thysultan/stylis.js/blob/e6843c373ebcbbfade25ebcc23f540ed8508da0a/src/Tokenizer.js#L239-L244
+
+
+var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
+ var previous = 0;
+ var character = 0;
+
+ while (true) {
+ previous = character;
+ character = peek(); // &\f
+
+ if (previous === 38 && character === 12) {
+ points[index] = 1;
+ }
+
+ if (token(character)) {
+ break;
+ }
+
+ next();
+ }
+
+ return slice(begin, position);
+};
+
+var toRules = function toRules(parsed, points) {
+ // pretend we've started with a comma
+ var index = -1;
+ var character = 44;
+
+ do {
+ switch (token(character)) {
+ case 0:
+ // &\f
+ if (character === 38 && peek() === 12) {
+ // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
+ // stylis inserts \f after & to know when & where it should replace this sequence with the context selector
+ // and when it should just concatenate the outer and inner selectors
+ // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
+ points[index] = 1;
}
- /**
- *
- */
- function bindToMotionValue(key, value) {
- var removeOnChange = value.onChange(function (latestValue) {
- latestValues[key] = latestValue;
- props.onUpdate && dist_es.update(update, false, true);
- });
- var removeOnRenderRequest = value.onRenderRequest(element.scheduleRender);
- valueSubscriptions.set(key, function () {
- removeOnChange();
- removeOnRenderRequest();
- });
+
+ parsed[index] += identifierWithPointTracking(position - 1, points, index);
+ break;
+
+ case 2:
+ parsed[index] += delimit(character);
+ break;
+
+ case 4:
+ // comma
+ if (character === 44) {
+ // colon
+ parsed[++index] = peek() === 58 ? '&\f' : '';
+ points[index] = parsed[index].length;
+ break;
}
- /**
- * Any motion values that are provided to the element when created
- * aren't yet bound to the element, as this would technically be impure.
- * However, we iterate through the motion values and set them to the
- * initial values for this component.
- *
- * TODO: This is impure and we should look at changing this to run on mount.
- * Doing so will break some tests but this isn't neccessarily a breaking change,
- * more a reflection of the test.
- */
- var initialMotionValues = scrapeMotionValuesFromProps(props);
- for (var key in initialMotionValues) {
- var value = initialMotionValues[key];
- if (latestValues[key] !== undefined && isMotionValue(value)) {
- value.set(latestValues[key], false);
- }
- }
- /**
- * Determine what role this visual element should take in the variant tree.
- */
- var isControllingVariants = checkIfControllingVariants(props);
- var isVariantNode = checkIfVariantNode(props);
- var element = __assign(__assign({ treeType: treeType,
- /**
- * This is a mirror of the internal instance prop, which keeps
- * VisualElement type-compatible with React's RefObject.
- */
- current: null,
- /**
- * The depth of this visual element within the visual element tree.
- */
- depth: parent ? parent.depth + 1 : 0, parent: parent, children: new Set(),
- /**
- * An ancestor path back to the root visual element. This is used
- * by layout projection to quickly recurse back up the tree.
- */
- path: parent ? __spreadArray(__spreadArray([], __read(parent.path)), [parent]) : [], layoutTree: parent ? parent.layoutTree : new flat_tree_FlatTree(),
- /**
- *
- */
- presenceId: presenceId,
- projection: projection,
- /**
- * If this component is part of the variant tree, it should track
- * any children that are also part of the tree. This is essentially
- * a shadow tree to simplify logic around how to stagger over children.
- */
- variantChildren: isVariantNode ? new Set() : undefined,
- /**
- * Whether this instance is visible. This can be changed imperatively
- * by AnimateSharedLayout, is analogous to CSS's visibility in that
- * hidden elements should take up layout, and needs enacting by the configured
- * render function.
- */
- isVisible: undefined,
- /**
- * Normally, if a component is controlled by a parent's variants, it can
- * rely on that ancestor to trigger animations further down the tree.
- * However, if a component is created after its parent is mounted, the parent
- * won't trigger that mount animation so the child needs to.
- *
- * TODO: This might be better replaced with a method isParentMounted
- */
- manuallyAnimateOnMount: Boolean(parent === null || parent === void 0 ? void 0 : parent.isMounted()),
- /**
- * This can be set by AnimatePresence to force components that mount
- * at the same time as it to mount as if they have initial={false} set.
- */
- blockInitialAnimation: blockInitialAnimation,
- /**
- * Determine whether this component has mounted yet. This is mostly used
- * by variant children to determine whether they need to trigger their
- * own animations on mount.
- */
- isMounted: function () { return Boolean(instance); }, mount: function (newInstance) {
- instance = element.current = newInstance;
- element.pointTo(element);
- if (isVariantNode && parent && !isControllingVariants) {
- removeFromVariantTree = parent === null || parent === void 0 ? void 0 : parent.addVariantChild(element);
- }
- parent === null || parent === void 0 ? void 0 : parent.children.add(element);
- },
- /**
- *
- */
- unmount: function () {
- cancelSync.update(update);
- cancelSync.render(render);
- cancelSync.preRender(element.updateLayoutProjection);
- valueSubscriptions.forEach(function (remove) { return remove(); });
- element.stopLayoutAnimation();
- element.layoutTree.remove(element);
- removeFromVariantTree === null || removeFromVariantTree === void 0 ? void 0 : removeFromVariantTree();
- parent === null || parent === void 0 ? void 0 : parent.children.delete(element);
- unsubscribeFromLeadVisualElement === null || unsubscribeFromLeadVisualElement === void 0 ? void 0 : unsubscribeFromLeadVisualElement();
- lifecycles.clearAllListeners();
- },
- /**
- * Add a child visual element to our set of children.
- */
- addVariantChild: function (child) {
- var _a;
- var closestVariantNode = element.getClosestVariantNode();
- if (closestVariantNode) {
- (_a = closestVariantNode.variantChildren) === null || _a === void 0 ? void 0 : _a.add(child);
- return function () { return closestVariantNode.variantChildren.delete(child); };
- }
- },
- sortNodePosition: function (other) {
- /**
- * If these nodes aren't even of the same type we can't compare their depth.
- */
- if (!sortNodePosition || treeType !== other.treeType)
- return 0;
- return sortNodePosition(element.getInstance(), other.getInstance());
- },
- /**
- * Returns the closest variant node in the tree starting from
- * this visual element.
- */
- getClosestVariantNode: function () {
- return isVariantNode ? element : parent === null || parent === void 0 ? void 0 : parent.getClosestVariantNode();
- },
- /**
- * A method that schedules an update to layout projections throughout
- * the tree. We inherit from the parent so there's only ever one
- * job scheduled on the next frame - that of the root visual element.
- */
- scheduleUpdateLayoutProjection: parent
- ? parent.scheduleUpdateLayoutProjection
- : function () {
- return dist_es.preRender(element.updateTreeLayoutProjection, false, true);
- },
- /**
- * Expose the latest layoutId prop.
- */
- getLayoutId: function () { return props.layoutId; },
- /**
- * Returns the current instance.
- */
- getInstance: function () { return instance; },
- /**
- * Get/set the latest static values.
- */
- getStaticValue: function (key) { return latestValues[key]; }, setStaticValue: function (key, value) { return (latestValues[key] = value); },
- /**
- * Returns the latest motion value state. Currently only used to take
- * a snapshot of the visual element - perhaps this can return the whole
- * visual state
- */
- getLatestValues: function () { return latestValues; },
- /**
- * Set the visiblity of the visual element. If it's changed, schedule
- * a render to reflect these changes.
- */
- setVisibility: function (visibility) {
- if (element.isVisible === visibility)
- return;
- element.isVisible = visibility;
- element.scheduleRender();
- },
- /**
- * Make a target animatable by Popmotion. For instance, if we're
- * trying to animate width from 100px to 100vw we need to measure 100vw
- * in pixels to determine what we really need to animate to. This is also
- * pluggable to support Framer's custom value types like Color,
- * and CSS variables.
- */
- makeTargetAnimatable: function (target, canMutate) {
- if (canMutate === void 0) { canMutate = true; }
- return makeTargetAnimatable(element, target, props, canMutate);
- },
- // Motion values ========================
- /**
- * Add a motion value and bind it to this visual element.
- */
- addValue: function (key, value) {
- // Remove existing value if it exists
- if (element.hasValue(key))
- element.removeValue(key);
- values.set(key, value);
- latestValues[key] = value.get();
- bindToMotionValue(key, value);
- },
- /**
- * Remove a motion value and unbind any active subscriptions.
- */
- removeValue: function (key) {
- var _a;
- values.delete(key);
- (_a = valueSubscriptions.get(key)) === null || _a === void 0 ? void 0 : _a();
- valueSubscriptions.delete(key);
- delete latestValues[key];
- removeValueFromRenderState(key, renderState);
- },
- /**
- * Check whether we have a motion value for this key
- */
- hasValue: function (key) { return values.has(key); },
- /**
- * Get a motion value for this key. If called with a default
- * value, we'll create one if none exists.
- */
- getValue: function (key, defaultValue) {
- var value = values.get(key);
- if (value === undefined && defaultValue !== undefined) {
- value = motionValue(defaultValue);
- element.addValue(key, value);
- }
- return value;
- },
- /**
- * Iterate over our motion values.
- */
- forEachValue: function (callback) { return values.forEach(callback); },
- /**
- * If we're trying to animate to a previously unencountered value,
- * we need to check for it in our state and as a last resort read it
- * directly from the instance (which might have performance implications).
- */
- readValue: function (key) { var _a; return (_a = latestValues[key]) !== null && _a !== void 0 ? _a : readValueFromInstance(instance, key, options); },
- /**
- * Set the base target to later animate back to. This is currently
- * only hydrated on creation and when we first read a value.
- */
- setBaseTarget: function (key, value) {
- baseTarget[key] = value;
- },
- /**
- * Find the base target for a value thats been removed from all animation
- * props.
- */
- getBaseTarget: function (key) {
- if (getBaseTarget) {
- var target = getBaseTarget(props, key);
- if (target !== undefined && !isMotionValue(target))
- return target;
- }
- return baseTarget[key];
- } }, lifecycles), {
- /**
- * Build the renderer state based on the latest visual state.
- */
- build: function () {
- triggerBuild();
- return renderState;
- },
- /**
- * Schedule a render on the next animation frame.
- */
- scheduleRender: function () {
- dist_es.render(render, false, true);
- },
- /**
- * Synchronously fire render. It's prefered that we batch renders but
- * in many circumstances, like layout measurement, we need to run this
- * synchronously. However in those instances other measures should be taken
- * to batch reads/writes.
- */
- syncRender: render,
- /**
- * Update the provided props. Ensure any newly-added motion values are
- * added to our map, old ones removed, and listeners updated.
- */
- setProps: function (newProps) {
- props = newProps;
- lifecycles.updatePropListeners(newProps);
- prevMotionValues = updateMotionValuesFromProps(element, scrapeMotionValuesFromProps(props), prevMotionValues);
- }, getProps: function () { return props; },
- // Variants ==============================
- /**
- * Returns the variant definition with a given name.
- */
- getVariant: function (name) { var _a; return (_a = props.variants) === null || _a === void 0 ? void 0 : _a[name]; },
- /**
- * Returns the defined default transition on this component.
- */
- getDefaultTransition: function () { return props.transition; },
- /**
- * Used by child variant nodes to get the closest ancestor variant props.
- */
- getVariantContext: function (startAtParent) {
- if (startAtParent === void 0) { startAtParent = false; }
- if (startAtParent)
- return parent === null || parent === void 0 ? void 0 : parent.getVariantContext();
- if (!isControllingVariants) {
- var context_1 = (parent === null || parent === void 0 ? void 0 : parent.getVariantContext()) || {};
- if (props.initial !== undefined) {
- context_1.initial = props.initial;
- }
- return context_1;
- }
- var context = {};
- for (var i = 0; i < numVariantProps; i++) {
- var name_1 = variantProps[i];
- var prop = props[name_1];
- if (isVariantLabel(prop) || prop === false) {
- context[name_1] = prop;
- }
- }
- return context;
- },
- // Layout projection ==============================
- /**
- * Enable layout projection for this visual element. Won't actually
- * occur until we also have hydrated layout measurements.
- */
- enableLayoutProjection: function () {
- projection.isEnabled = true;
- element.layoutTree.add(element);
- },
- /**
- * Lock the projection target, for instance when dragging, so
- * nothing else can try and animate it.
- */
- lockProjectionTarget: function () {
- projection.isTargetLocked = true;
- },
- unlockProjectionTarget: function () {
- element.stopLayoutAnimation();
- projection.isTargetLocked = false;
- }, getLayoutState: function () { return layoutState; }, setCrossfader: function (newCrossfader) {
- crossfader = newCrossfader;
- }, isProjectionReady: function () {
- return projection.isEnabled &&
- projection.isHydrated &&
- layoutState.isHydrated;
- },
- /**
- * Start a layout animation on a given axis.
- */
- startLayoutAnimation: function (axis, transition, isRelative) {
- if (isRelative === void 0) { isRelative = false; }
- var progress = element.getProjectionAnimationProgress()[axis];
- var _a = isRelative
- ? projection.relativeTarget[axis]
- : projection.target[axis], min = _a.min, max = _a.max;
- var length = max - min;
- progress.clearListeners();
- progress.set(min);
- progress.set(min); // Set twice to hard-reset velocity
- progress.onChange(function (v) {
- element.setProjectionTargetAxis(axis, v, v + length, isRelative);
- });
- return element.animateMotionValue(axis, progress, 0, transition);
- },
- /**
- * Stop layout animations.
- */
- stopLayoutAnimation: function () {
- eachAxis(function (axis) {
- return element.getProjectionAnimationProgress()[axis].stop();
- });
- },
- /**
- * Measure the current viewport box with or without transforms.
- * Only measures axis-aligned boxes, rotate and skew must be manually
- * removed with a re-render to work.
- */
- measureViewportBox: function (withTransform) {
- if (withTransform === void 0) { withTransform = true; }
- var viewportBox = measureViewportBox(instance, options);
- if (!withTransform)
- removeBoxTransforms(viewportBox, latestValues);
- return viewportBox;
- },
- /**
- * Get the motion values tracking the layout animations on each
- * axis. Lazy init if not already created.
- */
- getProjectionAnimationProgress: function () {
- projectionTargetProgress || (projectionTargetProgress = {
- x: motionValue(0),
- y: motionValue(0),
- });
- return projectionTargetProgress;
- },
- /**
- * Update the projection of a single axis. Schedule an update to
- * the tree layout projection.
- */
- setProjectionTargetAxis: function (axis, min, max, isRelative) {
- if (isRelative === void 0) { isRelative = false; }
- var target;
- if (isRelative) {
- if (!projection.relativeTarget) {
- projection.relativeTarget = axisBox();
- }
- target = projection.relativeTarget[axis];
- }
- else {
- projection.relativeTarget = undefined;
- target = projection.target[axis];
- }
- projection.isHydrated = true;
- target.min = min;
- target.max = max;
- // Flag that we want to fire the onViewportBoxUpdate event handler
- hasViewportBoxUpdated = true;
- lifecycles.notifySetAxisTarget();
- },
- /**
- * Rebase the projection target on top of the provided viewport box
- * or the measured layout. This ensures that non-animating elements
- * don't fall out of sync differences in measurements vs projections
- * after a page scroll or other relayout.
- */
- rebaseProjectionTarget: function (force, box) {
- if (box === void 0) { box = layoutState.layout; }
- var _a = element.getProjectionAnimationProgress(), x = _a.x, y = _a.y;
- var shouldRebase = !projection.relativeTarget &&
- !projection.isTargetLocked &&
- !x.isAnimating() &&
- !y.isAnimating();
- if (force || shouldRebase) {
- eachAxis(function (axis) {
- var _a = box[axis], min = _a.min, max = _a.max;
- element.setProjectionTargetAxis(axis, min, max);
- });
- }
- },
- /**
- * Notify the visual element that its layout is up-to-date.
- * Currently Animate.tsx uses this to check whether a layout animation
- * needs to be performed.
- */
- notifyLayoutReady: function (config) {
- setCurrentViewportBox(element);
- element.notifyLayoutUpdate(layoutState.layout, element.prevViewportBox || layoutState.layout, config);
- },
- /**
- * Temporarily reset the transform of the instance.
- */
- resetTransform: function () { return resetTransform(element, instance, props); }, restoreTransform: function () { return restoreTransform(instance, renderState); }, updateLayoutProjection: updateLayoutProjection,
- updateTreeLayoutProjection: function () {
- element.layoutTree.forEach(fireResolveRelativeTargetBox);
- /**
- * Schedule the projection updates at the end of the current preRender
- * step. This will ensure that all layout trees will first resolve
- * relative projection boxes into viewport boxes, and *then*
- * update projections.
- */
- dist_es.preRender(updateTreeLayoutProjection, false, true);
- // sync.postRender(() => element.scheduleUpdateLayoutProjection())
- },
- getProjectionParent: function () {
- if (projectionParent === undefined) {
- var foundParent = false;
- // Search backwards through the tree path
- for (var i = element.path.length - 1; i >= 0; i--) {
- var ancestor = element.path[i];
- if (ancestor.projection.isEnabled) {
- foundParent = ancestor;
- break;
- }
- }
- projectionParent = foundParent;
- }
- return projectionParent;
- },
- resolveRelativeTargetBox: function () {
- var relativeParent = element.getProjectionParent();
- if (!projection.relativeTarget || !relativeParent)
- return;
- calcRelativeBox(projection, relativeParent.projection);
- if (isDraggable(relativeParent)) {
- var target = projection.target;
- applyBoxTransforms(target, target, relativeParent.getLatestValues());
- }
- },
- shouldResetTransform: function () {
- return Boolean(props._layoutResetTransform);
- },
- /**
- *
- */
- pointTo: function (newLead) {
- leadProjection = newLead.projection;
- leadLatestValues = newLead.getLatestValues();
- /**
- * Subscribe to lead component's layout animations
- */
- unsubscribeFromLeadVisualElement === null || unsubscribeFromLeadVisualElement === void 0 ? void 0 : unsubscribeFromLeadVisualElement();
- unsubscribeFromLeadVisualElement = pipe(newLead.onSetAxisTarget(element.scheduleUpdateLayoutProjection), newLead.onLayoutAnimationComplete(function () {
- var _a;
- if (element.isPresent) {
- element.presence = Presence.Present;
- }
- else {
- (_a = element.layoutSafeToRemove) === null || _a === void 0 ? void 0 : _a.call(element);
- }
- }));
- },
- // TODO: Clean this up
- isPresent: true, presence: Presence.Entering });
- return element;
- };
-};
-function fireResolveRelativeTargetBox(child) {
- child.resolveRelativeTargetBox();
-}
-function fireUpdateLayoutProjection(child) {
- child.updateLayoutProjection();
-}
-var variantProps = __spreadArray(["initial"], __read(variantPriorityOrder));
-var numVariantProps = variantProps.length;
+ // fallthrough
+ default:
+ parsed[index] += Utility_from(character);
+ }
+ } while (character = next());
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.js
+ return parsed;
+};
+var getRules = function getRules(value, points) {
+ return dealloc(toRules(alloc(value), points));
+}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
+var fixedElements = /* #__PURE__ */new WeakMap();
+var compat = function compat(element) {
+ if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
+ // negative .length indicates that this rule has been already prefixed
+ element.length < 1) {
+ return;
+ }
+ var value = element.value,
+ parent = element.parent;
+ var isImplicitRule = element.column === parent.column && element.line === parent.line;
+ while (parent.type !== 'rule') {
+ parent = parent.parent;
+ if (!parent) return;
+ } // short-circuit for the simplest case
-var positionalKeys = new Set([
- "width",
- "height",
- "top",
- "left",
- "right",
- "bottom",
- "x",
- "y",
-]);
-var isPositionalKey = function (key) { return positionalKeys.has(key); };
-var hasPositionalKey = function (target) {
- return Object.keys(target).some(isPositionalKey);
-};
-var setAndResetVelocity = function (value, to) {
- // Looks odd but setting it twice doesn't render, it'll just
- // set both prev and current to the latest value
- value.set(to, false);
- value.set(to);
-};
-var isNumOrPxType = function (v) {
- return v === numbers_number || v === px;
-};
-var BoundingBoxDimension;
-(function (BoundingBoxDimension) {
- BoundingBoxDimension["width"] = "width";
- BoundingBoxDimension["height"] = "height";
- BoundingBoxDimension["left"] = "left";
- BoundingBoxDimension["right"] = "right";
- BoundingBoxDimension["top"] = "top";
- BoundingBoxDimension["bottom"] = "bottom";
-})(BoundingBoxDimension || (BoundingBoxDimension = {}));
-var getPosFromMatrix = function (matrix, pos) {
- return parseFloat(matrix.split(", ")[pos]);
-};
-var getTranslateFromMatrix = function (pos2, pos3) { return function (_bbox, _a) {
- var transform = _a.transform;
- if (transform === "none" || !transform)
- return 0;
- var matrix3d = transform.match(/^matrix3d\((.+)\)$/);
- if (matrix3d) {
- return getPosFromMatrix(matrix3d[1], pos3);
- }
- else {
- var matrix = transform.match(/^matrix\((.+)\)$/);
- if (matrix) {
- return getPosFromMatrix(matrix[1], pos2);
- }
- else {
- return 0;
- }
- }
-}; };
-var unit_conversion_transformKeys = new Set(["x", "y", "z"]);
-var nonTranslationalTransformKeys = transformProps.filter(function (key) { return !unit_conversion_transformKeys.has(key); });
-function removeNonTranslationalTransform(visualElement) {
- var removedTransforms = [];
- nonTranslationalTransformKeys.forEach(function (key) {
- var value = visualElement.getValue(key);
- if (value !== undefined) {
- removedTransforms.push([key, value.get()]);
- value.set(key.startsWith("scale") ? 1 : 0);
- }
- });
- // Apply changes to element before measurement
- if (removedTransforms.length)
- visualElement.syncRender();
- return removedTransforms;
-}
-var positionalValues = {
- // Dimensions
- width: function (_a) {
- var x = _a.x;
- return x.max - x.min;
- },
- height: function (_a) {
- var y = _a.y;
- return y.max - y.min;
- },
- top: function (_bbox, _a) {
- var top = _a.top;
- return parseFloat(top);
- },
- left: function (_bbox, _a) {
- var left = _a.left;
- return parseFloat(left);
- },
- bottom: function (_a, _b) {
- var y = _a.y;
- var top = _b.top;
- return parseFloat(top) + (y.max - y.min);
- },
- right: function (_a, _b) {
- var x = _a.x;
- var left = _b.left;
- return parseFloat(left) + (x.max - x.min);
- },
- // Transform
- x: getTranslateFromMatrix(4, 13),
- y: getTranslateFromMatrix(5, 14),
-};
-var convertChangedValueTypes = function (target, visualElement, changedKeys) {
- var originBbox = visualElement.measureViewportBox();
- var element = visualElement.getInstance();
- var elementComputedStyle = getComputedStyle(element);
- var display = elementComputedStyle.display, top = elementComputedStyle.top, left = elementComputedStyle.left, bottom = elementComputedStyle.bottom, right = elementComputedStyle.right, transform = elementComputedStyle.transform;
- var originComputedStyle = { top: top, left: left, bottom: bottom, right: right, transform: transform };
- // If the element is currently set to display: "none", make it visible before
- // measuring the target bounding box
- if (display === "none") {
- visualElement.setStaticValue("display", target.display || "block");
- }
- // Apply the latest values (as set in checkAndConvertChangedValueTypes)
- visualElement.syncRender();
- var targetBbox = visualElement.measureViewportBox();
- changedKeys.forEach(function (key) {
- // Restore styles to their **calculated computed style**, not their actual
- // originally set style. This allows us to animate between equivalent pixel units.
- var value = visualElement.getValue(key);
- setAndResetVelocity(value, positionalValues[key](originBbox, originComputedStyle));
- target[key] = positionalValues[key](targetBbox, elementComputedStyle);
- });
- return target;
-};
-var checkAndConvertChangedValueTypes = function (visualElement, target, origin, transitionEnd) {
- if (origin === void 0) { origin = {}; }
- if (transitionEnd === void 0) { transitionEnd = {}; }
- target = __assign({}, target);
- transitionEnd = __assign({}, transitionEnd);
- var targetPositionalKeys = Object.keys(target).filter(isPositionalKey);
- // We want to remove any transform values that could affect the element's bounding box before
- // it's measured. We'll reapply these later.
- var removedTransformValues = [];
- var hasAttemptedToRemoveTransformValues = false;
- var changedValueTypeKeys = [];
- targetPositionalKeys.forEach(function (key) {
- var value = visualElement.getValue(key);
- if (!visualElement.hasValue(key))
- return;
- var from = origin[key];
- var to = target[key];
- var fromType = findDimensionValueType(from);
- var toType;
- // TODO: The current implementation of this basically throws an error
- // if you try and do value conversion via keyframes. There's probably
- // a way of doing this but the performance implications would need greater scrutiny,
- // as it'd be doing multiple resize-remeasure operations.
- if (isKeyframesTarget(to)) {
- var numKeyframes = to.length;
- for (var i = to[0] === null ? 1 : 0; i < numKeyframes; i++) {
- if (!toType) {
- toType = findDimensionValueType(to[i]);
- invariant(toType === fromType ||
- (isNumOrPxType(fromType) && isNumOrPxType(toType)), "Keyframes must be of the same dimension as the current value");
- }
- else {
- invariant(findDimensionValueType(to[i]) === toType, "All keyframes must be of the same type");
- }
- }
- }
- else {
- toType = findDimensionValueType(to);
- }
- if (fromType !== toType) {
- // If they're both just number or px, convert them both to numbers rather than
- // relying on resize/remeasure to convert (which is wasteful in this situation)
- if (isNumOrPxType(fromType) && isNumOrPxType(toType)) {
- var current = value.get();
- if (typeof current === "string") {
- value.set(parseFloat(current));
- }
- if (typeof to === "string") {
- target[key] = parseFloat(to);
- }
- else if (Array.isArray(to) && toType === px) {
- target[key] = to.map(parseFloat);
- }
- }
- else if ((fromType === null || fromType === void 0 ? void 0 : fromType.transform) &&
- (toType === null || toType === void 0 ? void 0 : toType.transform) &&
- (from === 0 || to === 0)) {
- // If one or the other value is 0, it's safe to coerce it to the
- // type of the other without measurement
- if (from === 0) {
- value.set(toType.transform(from));
- }
- else {
- target[key] = fromType.transform(to);
- }
- }
- else {
- // If we're going to do value conversion via DOM measurements, we first
- // need to remove non-positional transform values that could affect the bbox measurements.
- if (!hasAttemptedToRemoveTransformValues) {
- removedTransformValues = removeNonTranslationalTransform(visualElement);
- hasAttemptedToRemoveTransformValues = true;
- }
- changedValueTypeKeys.push(key);
- transitionEnd[key] =
- transitionEnd[key] !== undefined
- ? transitionEnd[key]
- : target[key];
- setAndResetVelocity(value, to);
- }
- }
- });
- if (changedValueTypeKeys.length) {
- var convertedTarget = convertChangedValueTypes(target, visualElement, changedValueTypeKeys);
- // If we removed transform values, reapply them before the next render
- if (removedTransformValues.length) {
- removedTransformValues.forEach(function (_a) {
- var _b = __read(_a, 2), key = _b[0], value = _b[1];
- visualElement.getValue(key).set(value);
- });
- }
- // Reapply original values
- visualElement.syncRender();
- return { target: convertedTarget, transitionEnd: transitionEnd };
- }
- else {
- return { target: target, transitionEnd: transitionEnd };
- }
-};
-/**
- * Convert value types for x/y/width/height/top/left/bottom/right
- *
- * Allows animation between `'auto'` -> `'100%'` or `0` -> `'calc(50% - 10vw)'`
- *
- * @internal
- */
-function unitConversion(visualElement, target, origin, transitionEnd) {
- return hasPositionalKey(target)
- ? checkAndConvertChangedValueTypes(visualElement, target, origin, transitionEnd)
- : { target: target, transitionEnd: transitionEnd };
-}
-
-
+ if (element.props.length === 1 && value.charCodeAt(0) !== 58
+ /* colon */
+ && !fixedElements.get(parent)) {
+ return;
+ } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
+ // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/utils/parse-dom-variant.js
+ if (isImplicitRule) {
+ return;
+ }
+ fixedElements.set(element, true);
+ var points = [];
+ var rules = getRules(value, points);
+ var parentRules = parent.props;
-/**
- * Parse a DOM variant to make it animatable. This involves resolving CSS variables
- * and ensuring animations like "20%" => "calc(50vw)" are performed in pixels.
- */
-var parseDomVariant = function (visualElement, target, origin, transitionEnd) {
- var resolved = resolveCSSVariables(visualElement, target, transitionEnd);
- target = resolved.target;
- transitionEnd = resolved.transitionEnd;
- return unitConversion(visualElement, target, origin, transitionEnd);
+ for (var i = 0, k = 0; i < rules.length; i++) {
+ for (var j = 0; j < parentRules.length; j++, k++) {
+ element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
+ }
+ }
};
+var removeLabel = function removeLabel(element) {
+ if (element.type === 'decl') {
+ var value = element.value;
+ if ( // charcode for l
+ value.charCodeAt(0) === 108 && // charcode for b
+ value.charCodeAt(2) === 98) {
+ // this ignores label
+ element["return"] = '';
+ element.value = '';
+ }
+ }
+};
+var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
+var isIgnoringComment = function isIgnoringComment(element) {
+ return !!element && element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
+};
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/html/visual-element.js
-
-
-
-
-
+var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
+ return function (element, index, children) {
+ if (element.type !== 'rule') return;
+ var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
+ if (unsafePseudoClasses && cache.compat !== true) {
+ var prevElement = index > 0 ? children[index - 1] : null;
+ if (prevElement && isIgnoringComment(last(prevElement.children))) {
+ return;
+ }
+ unsafePseudoClasses.forEach(function (unsafePseudoClass) {
+ console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
+ });
+ }
+ };
+};
+var isImportRule = function isImportRule(element) {
+ return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
+};
+var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {
+ for (var i = index - 1; i >= 0; i--) {
+ if (!isImportRule(children[i])) {
+ return true;
+ }
+ }
+ return false;
+}; // use this to remove incorrect elements from further processing
+// so they don't get handed to the `sheet` (or anything else)
+// as that could potentially lead to additional logs which in turn could be overhelming to the user
-function visual_element_getComputedStyle(element) {
- return window.getComputedStyle(element);
-}
-var htmlConfig = {
- treeType: "dom",
- readValueFromInstance: function (domElement, key) {
- if (isTransformProp(key)) {
- var defaultType = getDefaultValueType(key);
- return defaultType ? defaultType.default || 0 : 0;
- }
- else {
- var computedStyle = visual_element_getComputedStyle(domElement);
- return ((isCSSVariable(key)
- ? computedStyle.getPropertyValue(key)
- : computedStyle[key]) || 0);
- }
- },
- sortNodePosition: function (a, b) {
- /**
- * compareDocumentPosition returns a bitmask, by using the bitwise &
- * we're returning true if 2 in that bitmask is set to true. 2 is set
- * to true if b preceeds a.
- */
- return a.compareDocumentPosition(b) & 2 ? 1 : -1;
- },
- getBaseTarget: function (props, key) {
- var _a;
- return (_a = props.style) === null || _a === void 0 ? void 0 : _a[key];
- },
- measureViewportBox: function (element, _a) {
- var transformPagePoint = _a.transformPagePoint;
- return getBoundingBox(element, transformPagePoint);
- },
- /**
- * Reset the transform on the current Element. This is called as part
- * of a batched process across the entire layout tree. To remove this write
- * cycle it'd be interesting to see if it's possible to "undo" all the current
- * layout transforms up the tree in the same way this.getBoundingBoxWithoutTransforms
- * works
- */
- resetTransform: function (element, domElement, props) {
- var transformTemplate = props.transformTemplate;
- domElement.style.transform = transformTemplate
- ? transformTemplate({}, "")
- : "none";
- // Ensure that whatever happens next, we restore our transform on the next frame
- element.scheduleRender();
- },
- restoreTransform: function (instance, mutableState) {
- instance.style.transform = mutableState.style.transform;
- },
- removeValueFromRenderState: function (key, _a) {
- var vars = _a.vars, style = _a.style;
- delete vars[key];
- delete style[key];
- },
- /**
- * Ensure that HTML and Framer-specific value types like `px`->`%` and `Color`
- * can be animated by Motion.
- */
- makeTargetAnimatable: function (element, _a, _b, isMounted) {
- var transformValues = _b.transformValues;
- if (isMounted === void 0) { isMounted = true; }
- var transition = _a.transition, transitionEnd = _a.transitionEnd, target = __rest(_a, ["transition", "transitionEnd"]);
- var origin = getOrigin(target, transition || {}, element);
- /**
- * If Framer has provided a function to convert `Color` etc value types, convert them
- */
- if (transformValues) {
- if (transitionEnd)
- transitionEnd = transformValues(transitionEnd);
- if (target)
- target = transformValues(target);
- if (origin)
- origin = transformValues(origin);
- }
- if (isMounted) {
- checkTargetForNewValues(element, target, origin);
- var parsed = parseDomVariant(element, target, origin, transitionEnd);
- transitionEnd = parsed.transitionEnd;
- target = parsed.target;
- }
- return __assign({ transition: transition,
- transitionEnd: transitionEnd }, target);
- },
- scrapeMotionValuesFromProps: scrape_motion_values_scrapeMotionValuesFromProps,
- build: function (element, renderState, latestValues, projection, layoutState, options, props) {
- if (element.isVisible !== undefined) {
- renderState.style.visibility = element.isVisible
- ? "visible"
- : "hidden";
- }
- var isProjectionTranform = projection.isEnabled && layoutState.isHydrated;
- buildHTMLStyles(renderState, latestValues, projection, layoutState, options, props.transformTemplate, isProjectionTranform ? buildLayoutProjectionTransform : undefined, isProjectionTranform
- ? buildLayoutProjectionTransformOrigin
- : undefined);
- },
- render: renderHTML,
+var nullifyElement = function nullifyElement(element) {
+ element.type = '';
+ element.value = '';
+ element["return"] = '';
+ element.children = '';
+ element.props = '';
};
-var htmlVisualElement = render_visualElement(htmlConfig);
+var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {
+ if (!isImportRule(element)) {
+ return;
+ }
+ if (element.parent) {
+ console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
+ nullifyElement(element);
+ } else if (isPrependedWithRegularRules(index, children)) {
+ console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
+ nullifyElement(element);
+ }
+};
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/svg/visual-element.js
+var defaultStylisPlugins = [prefixer];
+var createCache = function createCache(options) {
+ var key = options.key;
+ if (false) {}
+ if ( key === 'css') {
+ var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
+ // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
+ // note this very very intentionally targets all style elements regardless of the key to ensure
+ // that creating a cache works inside of render of a React component
+ Array.prototype.forEach.call(ssrStyles, function (node) {
+ // we want to only move elements which have a space in the data-emotion attribute value
+ // because that indicates that it is an Emotion 11 server-side rendered style elements
+ // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
+ // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
+ // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
+ // will not result in the Emotion 10 styles being destroyed
+ var dataEmotionAttribute = node.getAttribute('data-emotion');
+ if (dataEmotionAttribute.indexOf(' ') === -1) {
+ return;
+ }
+ document.head.appendChild(node);
+ node.setAttribute('data-s', '');
+ });
+ }
+ var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
+ if (false) {}
+ var inserted = {}; // $FlowFixMe
+ var container;
+ var nodesToHydrate = [];
+ {
+ container = options.container || document.head;
+ Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
+ // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
+ document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
+ var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe
+ for (var i = 1; i < attrib.length; i++) {
+ inserted[attrib[i]] = true;
+ }
-var svgVisualElement = render_visualElement(__assign(__assign({}, htmlConfig), { getBaseTarget: function (props, key) {
- return props[key];
- },
- readValueFromInstance: function (domElement, key) {
- var _a;
- if (isTransformProp(key)) {
- return ((_a = getDefaultValueType(key)) === null || _a === void 0 ? void 0 : _a.default) || 0;
- }
- key = !camelCaseAttributes.has(key) ? camelToDash(key) : key;
- return domElement.getAttribute(key);
- },
- scrapeMotionValuesFromProps: utils_scrape_motion_values_scrapeMotionValuesFromProps,
- build: function (_element, renderState, latestValues, projection, layoutState, options, props) {
- var isProjectionTranform = projection.isEnabled && layoutState.isHydrated;
- buildSVGAttrs(renderState, latestValues, projection, layoutState, options, props.transformTemplate, isProjectionTranform ? buildLayoutProjectionTransform : undefined, isProjectionTranform
- ? buildLayoutProjectionTransformOrigin
- : undefined);
- }, render: renderSVG }));
+ nodesToHydrate.push(node);
+ });
+ }
+ var _insert;
+ var omnipresentPlugins = [compat, removeLabel];
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/create-visual-element.js
+ if (false) {}
+ {
+ var currentSheet;
+ var finalizingPlugins = [stringify, false ? 0 : rulesheet(function (rule) {
+ currentSheet.insert(rule);
+ })];
+ var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
+ var stylis = function stylis(styles) {
+ return serialize(compile(styles), serializer);
+ };
+ _insert = function insert(selector, serialized, sheet, shouldCache) {
+ currentSheet = sheet;
-var createDomVisualElement = function (Component, options) {
- return isSVGComponent(Component)
- ? svgVisualElement(options, { enableHardwareAcceleration: false })
- : htmlVisualElement(options, { enableHardwareAcceleration: true });
-};
+ if (false) {}
+ stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
+ if (shouldCache) {
+ cache.inserted[serialized.name] = true;
+ }
+ };
+ }
-// CONCATENATED MODULE: ./node_modules/framer-motion/dist/es/render/dom/motion.js
+ var cache = {
+ key: key,
+ sheet: new emotion_sheet_browser_esm_StyleSheet({
+ key: key,
+ container: container,
+ nonce: options.nonce,
+ speedy: options.speedy,
+ prepend: options.prepend,
+ insertionPoint: options.insertionPoint
+ }),
+ nonce: options.nonce,
+ inserted: inserted,
+ registered: {},
+ insert: _insert
+ };
+ cache.sheet.hydrate(nodesToHydrate);
+ return cache;
+};
+/* harmony default export */ var emotion_cache_browser_esm = (createCache);
+;// CONCATENATED MODULE: ./node_modules/@emotion/hash/dist/hash.browser.esm.js
+/* eslint-disable */
+// Inspired by https://github.com/garycourt/murmurhash-js
+// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
+function murmur2(str) {
+ // 'm' and 'r' are mixing constants generated offline.
+ // They're not really 'magic', they just happen to work well.
+ // const m = 0x5bd1e995;
+ // const r = 24;
+ // Initialize the hash
+ var h = 0; // Mix 4 bytes at a time into the hash
+ var k,
+ i = 0,
+ len = str.length;
+ for (; len >= 4; ++i, len -= 4) {
+ k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
+ k =
+ /* Math.imul(k, m): */
+ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
+ k ^=
+ /* k >>> r: */
+ k >>> 24;
+ h =
+ /* Math.imul(k, m): */
+ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
+ /* Math.imul(h, m): */
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
+ } // Handle the last few bytes of the input array
+ switch (len) {
+ case 3:
+ h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
+ case 2:
+ h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
+ case 1:
+ h ^= str.charCodeAt(i) & 0xff;
+ h =
+ /* Math.imul(h, m): */
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
+ } // Do a few final mixes of the hash to ensure the last few
+ // bytes are well-incorporated.
-var featureBundle = __assign(__assign(__assign(__assign({}, animations_animations), gestureAnimations), drag_drag), layoutAnimations);
-/**
- * HTML & SVG components, optimised for use with gestures and animation. These can be used as
- * drop-in replacements for any HTML & SVG component, all CSS & SVG properties are supported.
- *
- * @public
- */
-var motion = /*@__PURE__*/ createMotionProxy(function (Component, config) {
- return createDomMotionConfig(Component, config, featureBundle, createDomVisualElement);
-});
-/**
- * Create a DOM `motion` component with the provided string. This is primarily intended
- * as a full alternative to `motion` for consumers who have to support environments that don't
- * support `Proxy`.
- *
- * ```javascript
- * import { createDomMotionComponent } from "framer-motion"
- *
- * const motion = {
- * div: createDomMotionComponent('div')
- * }
- * ```
- *
- * @public
- */
-function createDomMotionComponent(key) {
- return createMotionComponent(createDomMotionConfig(key, { forwardMotionProps: false }, featureBundle, createDomVisualElement));
+ h ^= h >>> 13;
+ h =
+ /* Math.imul(h, m): */
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
+ return ((h ^ h >>> 15) >>> 0).toString(36);
}
+/* harmony default export */ var hash_browser_esm = (murmur2);
+;// CONCATENATED MODULE: ./node_modules/@emotion/unitless/dist/unitless.browser.esm.js
+var unitlessKeys = {
+ animationIterationCount: 1,
+ borderImageOutset: 1,
+ borderImageSlice: 1,
+ borderImageWidth: 1,
+ boxFlex: 1,
+ boxFlexGroup: 1,
+ boxOrdinalGroup: 1,
+ columnCount: 1,
+ columns: 1,
+ flex: 1,
+ flexGrow: 1,
+ flexPositive: 1,
+ flexShrink: 1,
+ flexNegative: 1,
+ flexOrder: 1,
+ gridRow: 1,
+ gridRowEnd: 1,
+ gridRowSpan: 1,
+ gridRowStart: 1,
+ gridColumn: 1,
+ gridColumnEnd: 1,
+ gridColumnSpan: 1,
+ gridColumnStart: 1,
+ msGridRow: 1,
+ msGridRowSpan: 1,
+ msGridColumn: 1,
+ msGridColumnSpan: 1,
+ fontWeight: 1,
+ lineHeight: 1,
+ opacity: 1,
+ order: 1,
+ orphans: 1,
+ tabSize: 1,
+ widows: 1,
+ zIndex: 1,
+ zoom: 1,
+ WebkitLineClamp: 1,
+ // SVG-related properties
+ fillOpacity: 1,
+ floodOpacity: 1,
+ stopOpacity: 1,
+ strokeDasharray: 1,
+ strokeDashoffset: 1,
+ strokeMiterlimit: 1,
+ strokeOpacity: 1,
+ strokeWidth: 1
+};
-// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/ui/context/context-connect.js
-var context_connect = __webpack_require__("7Jlx");
+/* harmony default export */ var unitless_browser_esm = (unitlessKeys);
-// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/view/component.js
-var view_component = __webpack_require__("q9zb");
+;// CONCATENATED MODULE: ./node_modules/@emotion/memoize/dist/emotion-memoize.browser.esm.js
+function memoize(fn) {
+ var cache = Object.create(null);
+ return function (arg) {
+ if (cache[arg] === undefined) cache[arg] = fn(arg);
+ return cache[arg];
+ };
+}
-// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/ui/context/use-context-system.js
-var use_context_system = __webpack_require__("C6yU");
+/* harmony default export */ var emotion_memoize_browser_esm = (memoize);
-// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/context.js
-/**
- * WordPress dependencies
- */
+;// CONCATENATED MODULE: ./node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js
-const FlexContext = Object(external_wp_element_["createContext"])({
- flexItemDisplay: undefined
-});
-const useFlexContext = () => Object(external_wp_element_["useContext"])(FlexContext);
-// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/styles.js
-function styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
-/**
- * External dependencies
- */
-const Flex = true ? {
- name: "zjik7",
- styles: "display:flex"
-} : undefined;
-const Item = true ? {
- name: "qgaee5",
- styles: "display:block;max-height:100%;max-width:100%;min-height:0;min-width:0"
-} : undefined;
-const block = true ? {
- name: "82a6rk",
- styles: "flex:1"
-} : undefined;
-/**
- * Workaround to optimize DOM rendering.
- * We'll enhance alignment with naive parent flex assumptions.
- *
- * Trade-off:
- * Far less DOM less. However, UI rendering is not as reliable.
- */
+var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
+var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
+var hyphenateRegex = /[A-Z]|^ms/g;
+var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
-/**
- * Improves stability of width/height rendering.
- * https://github.com/ItsJonQ/g2/pull/149
- */
+var isCustomProperty = function isCustomProperty(property) {
+ return property.charCodeAt(1) === 45;
+};
-const ItemsColumn = true ? {
- name: "13nosa1",
- styles: ">*{min-height:0;}"
-} : undefined;
-const ItemsRow = true ? {
- name: "1pwxzk4",
- styles: ">*{min-width:0;}"
-} : undefined;
+var isProcessableValue = function isProcessableValue(value) {
+ return value != null && typeof value !== 'boolean';
+};
-// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-cx.js + 2 modules
-var use_cx = __webpack_require__("h9+V");
+var processStyleName = /* #__PURE__ */emotion_memoize_browser_esm(function (styleName) {
+ return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
+});
-// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-item/hook.js
-/**
- * External dependencies
- */
+var processStyleValue = function processStyleValue(key, value) {
+ switch (key) {
+ case 'animation':
+ case 'animationName':
+ {
+ if (typeof value === 'string') {
+ return value.replace(animationRegex, function (match, p1, p2) {
+ cursor = {
+ name: p1,
+ styles: p2,
+ next: cursor
+ };
+ return p1;
+ });
+ }
+ }
+ }
-/**
- * Internal dependencies
- */
+ if (unitless_browser_esm[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
+ return value + 'px';
+ }
+ return value;
+};
+if (false) { var hyphenatedCache, hyphenPattern, msPattern, oldProcessStyleValue, contentValues, contentValuePattern; }
+function handleInterpolation(mergedProps, registered, interpolation) {
+ if (interpolation == null) {
+ return '';
+ }
+ if (interpolation.__emotion_styles !== undefined) {
+ if (false) {}
-/**
- * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexItemProps, 'div'>} props
- */
+ return interpolation;
+ }
-function useFlexItem(props) {
- const {
- className,
- display: displayProp,
- isBlock = false,
- ...otherProps
- } = Object(use_context_system["a" /* useContextSystem */])(props, 'FlexItem');
- const sx = {};
- const contextDisplay = useFlexContext().flexItemDisplay;
- sx.Base = /*#__PURE__*/Object(emotion_react_browser_esm["a" /* css */])({
- display: displayProp || contextDisplay
- }, true ? "" : undefined, true ? "" : undefined);
- const cx = Object(use_cx["a" /* useCx */])();
- const classes = cx(Item, sx.Base, isBlock && block, className);
- return { ...otherProps,
- className: classes
- };
-}
+ switch (typeof interpolation) {
+ case 'boolean':
+ {
+ return '';
+ }
-// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-block/hook.js
-/**
- * Internal dependencies
- */
+ case 'object':
+ {
+ if (interpolation.anim === 1) {
+ cursor = {
+ name: interpolation.name,
+ styles: interpolation.styles,
+ next: cursor
+ };
+ return interpolation.name;
+ }
+ if (interpolation.styles !== undefined) {
+ var next = interpolation.next;
-/**
- * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexBlockProps, 'div'>} props
- */
+ if (next !== undefined) {
+ // not the most efficient thing ever but this is a pretty rare case
+ // and there will be very few iterations of this generally
+ while (next !== undefined) {
+ cursor = {
+ name: next.name,
+ styles: next.styles,
+ next: cursor
+ };
+ next = next.next;
+ }
+ }
-function useFlexBlock(props) {
- const otherProps = Object(use_context_system["a" /* useContextSystem */])(props, 'FlexBlock');
- const flexItemProps = useFlexItem({
- isBlock: true,
- ...otherProps
- });
- return flexItemProps;
-}
+ var styles = interpolation.styles + ";";
-// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-block/component.js
+ if (false) {}
+ return styles;
+ }
+ return createStringFromObject(mergedProps, registered, interpolation);
+ }
-/**
- * Internal dependencies
- */
+ case 'function':
+ {
+ if (mergedProps !== undefined) {
+ var previousCursor = cursor;
+ var result = interpolation(mergedProps);
+ cursor = previousCursor;
+ return handleInterpolation(mergedProps, registered, result);
+ } else if (false) {}
+ break;
+ }
+ case 'string':
+ if (false) { var replaced, matched; }
-/**
- * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexBlockProps, 'div'>} props
- * @param {import('react').Ref<any>} forwardedRef
- */
+ break;
+ } // finalize string values (regular strings and functions interpolated into css calls)
-function FlexBlock(props, forwardedRef) {
- const flexBlockProps = useFlexBlock(props);
- return Object(external_wp_element_["createElement"])(view_component["a" /* default */], Object(esm_extends["a" /* default */])({}, flexBlockProps, {
- ref: forwardedRef
- }));
-}
-/**
- * `FlexBlock` is a primitive layout component that adaptively resizes content within layout containers like `Flex`.
- *
- * @example
- * ```jsx
- * <Flex>
- * <FlexBlock>...</FlexBlock>
- * </Flex>
- * ```
- */
+ if (registered == null) {
+ return interpolation;
+ }
-const ConnectedFlexBlock = Object(context_connect["a" /* contextConnect */])(FlexBlock, 'FlexBlock');
-/* harmony default export */ var flex_block_component = (ConnectedFlexBlock);
+ var cached = registered[interpolation];
+ return cached !== undefined ? cached : interpolation;
+}
-// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/flex-item/component.js
+function createStringFromObject(mergedProps, registered, obj) {
+ var string = '';
+ if (Array.isArray(obj)) {
+ for (var i = 0; i < obj.length; i++) {
+ string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
+ }
+ } else {
+ for (var _key in obj) {
+ var value = obj[_key];
+ if (typeof value !== 'object') {
+ if (registered != null && registered[value] !== undefined) {
+ string += _key + "{" + registered[value] + "}";
+ } else if (isProcessableValue(value)) {
+ string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
+ }
+ } else {
+ if (_key === 'NO_COMPONENT_SELECTOR' && "production" !== 'production') {}
-/**
- * Internal dependencies
- */
+ if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
+ for (var _i = 0; _i < value.length; _i++) {
+ if (isProcessableValue(value[_i])) {
+ string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
+ }
+ }
+ } else {
+ var interpolated = handleInterpolation(mergedProps, registered, value);
+ switch (_key) {
+ case 'animation':
+ case 'animationName':
+ {
+ string += processStyleName(_key) + ":" + interpolated + ";";
+ break;
+ }
+ default:
+ {
+ if (false) {}
-/**
- * @param {import('../../ui/context').WordPressComponentProps<import('../types').FlexItemProps, 'div'>} props
- * @param {import('react').Ref<any>} forwardedRef
- */
+ string += _key + "{" + interpolated + "}";
+ }
+ }
+ }
+ }
+ }
+ }
-function FlexItem(props, forwardedRef) {
- const flexItemProps = useFlexItem(props);
- return Object(external_wp_element_["createElement"])(view_component["a" /* default */], Object(esm_extends["a" /* default */])({}, flexItemProps, {
- ref: forwardedRef
- }));
+ return string;
}
-/**
- * `FlexItem` is a primitive layout component that aligns content within layout containers like `Flex`.
- *
- * @example
- * ```jsx
- * <Flex>
- * <FlexItem>...</FlexItem>
- * </Flex>
- * ```
- */
+var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
+var sourceMapPattern;
-const ConnectedFlexItem = Object(context_connect["a" /* contextConnect */])(FlexItem, 'FlexItem');
-/* harmony default export */ var flex_item_component = (ConnectedFlexItem);
+if (false) {} // this is the cursor for keyframes
+// keyframes are stored on the SerializedStyles object as a linked list
-// 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/components/build-module/ui/utils/use-responsive-value.js
-/**
- * WordPress dependencies
- */
+var cursor;
+var emotion_serialize_browser_esm_serializeStyles = function serializeStyles(args, registered, mergedProps) {
+ if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
+ return args[0];
+ }
-const breakpoints = ['40em', '52em', '64em'];
-const useBreakpointIndex = function () {
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- const {
- defaultIndex = 0
- } = options;
+ var stringMode = true;
+ var styles = '';
+ cursor = undefined;
+ var strings = args[0];
- if (typeof defaultIndex !== 'number') {
- throw new TypeError(`Default breakpoint index should be a number. Got: ${defaultIndex}, ${typeof defaultIndex}`);
- } else if (defaultIndex < 0 || defaultIndex > breakpoints.length - 1) {
- throw new RangeError(`Default breakpoint index out of range. Theme has ${breakpoints.length} breakpoints, got index ${defaultIndex}`);
- }
+ if (strings == null || strings.raw === undefined) {
+ stringMode = false;
+ styles += handleInterpolation(mergedProps, registered, strings);
+ } else {
+ if (false) {}
- const [value, setValue] = Object(external_wp_element_["useState"])(defaultIndex);
- Object(external_wp_element_["useEffect"])(() => {
- const getIndex = () => breakpoints.filter(bp => {
- return typeof window !== 'undefined' ? window.matchMedia(`screen and (min-width: ${bp})`).matches : false;
- }).length;
+ styles += strings[0];
+ } // we start at 1 since we've already handled the first arg
- const onResize = () => {
- const newValue = getIndex();
- if (value !== newValue) {
- setValue(newValue);
- }
- };
+ for (var i = 1; i < args.length; i++) {
+ styles += handleInterpolation(mergedProps, registered, args[i]);
- onResize();
+ if (stringMode) {
+ if (false) {}
- if (typeof window !== 'undefined') {
- window.addEventListener('resize', onResize);
+ styles += strings[i];
}
+ }
- return () => {
- if (typeof window !== 'undefined') {
- window.removeEventListener('resize', onResize);
- }
- };
- }, [value]);
- return value;
-};
-function useResponsiveValue(values) {
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- const index = useBreakpointIndex(options); // Allow calling the function with a "normal" value without having to check on the outside.
+ var sourceMap;
- if (!Array.isArray(values) && typeof values !== 'function') return values;
- const array = values || [];
- /* eslint-disable jsdoc/no-undefined-types */
+ if (false) {} // using a global regex with .exec is stateful so lastIndex has to be reset each time
- return (
- /** @type {T[]} */
- array[
- /* eslint-enable jsdoc/no-undefined-types */
- index >= array.length ? array.length - 1 : index]
- );
-}
-// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/ui/utils/space.js
-/**
- * A real number or something parsable as a number
- */
-const GRID_BASE = '4px';
-/**
- * A function that handles numbers, numeric strings, and unit values.
- *
- * When given a number or a numeric string, it will return the grid-based
- * value as a factor of GRID_BASE, defined above.
- *
- * When given a unit value or one of the named CSS values like `auto`,
- * it will simply return the value back.
- *
- * @param value A number, numeric string, or a unit value.
- */
+ labelPattern.lastIndex = 0;
+ var identifierName = '';
+ var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
-function space(value) {
- var _window$CSS, _window$CSS$supports;
+ while ((match = labelPattern.exec(styles)) !== null) {
+ identifierName += '-' + // $FlowFixMe we know it's not null
+ match[1];
+ }
- if (typeof value === 'undefined') {
- return undefined;
- } // handle empty strings, if it's the number 0 this still works
+ var name = hash_browser_esm(styles) + identifierName;
+ if (false) {}
- if (!value) {
- return '0';
- }
+ return {
+ name: name,
+ styles: styles,
+ next: cursor
+ };
+};
- const asInt = typeof value === 'number' ? value : Number(value); // test if the input has a unit, was NaN, or was one of the named CSS values (like `auto`), in which case just use that value
- if (typeof window !== 'undefined' && (_window$CSS = window.CSS) !== null && _window$CSS !== void 0 && (_window$CSS$supports = _window$CSS.supports) !== null && _window$CSS$supports !== void 0 && _window$CSS$supports.call(_window$CSS, 'margin', value.toString()) || Number.isNaN(asInt)) {
- return value.toString();
- }
- return `calc(${GRID_BASE} * ${value})`;
-}
+;// CONCATENATED MODULE: ./node_modules/@emotion/react/dist/emotion-element-699e6908.browser.esm.js
-// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/rtl.js
-/**
- * External dependencies
- */
-/**
- * WordPress dependencies
- */
-const LOWER_LEFT_REGEXP = new RegExp(/-left/g);
-const LOWER_RIGHT_REGEXP = new RegExp(/-right/g);
-const UPPER_LEFT_REGEXP = new RegExp(/Left/g);
-const UPPER_RIGHT_REGEXP = new RegExp(/Right/g);
-/**
- * Flips a CSS property from left <-> right.
- *
- * @param {string} key The CSS property name.
- *
- * @return {string} The flipped CSS property name, if applicable.
- */
-
-function getConvertedKey(key) {
- if (key === 'left') {
- return 'right';
- }
-
- if (key === 'right') {
- return 'left';
- }
-
- if (LOWER_LEFT_REGEXP.test(key)) {
- return key.replace(LOWER_LEFT_REGEXP, '-right');
- }
- if (LOWER_RIGHT_REGEXP.test(key)) {
- return key.replace(LOWER_RIGHT_REGEXP, '-left');
- }
- if (UPPER_LEFT_REGEXP.test(key)) {
- return key.replace(UPPER_LEFT_REGEXP, 'Right');
- }
- if (UPPER_RIGHT_REGEXP.test(key)) {
- return key.replace(UPPER_RIGHT_REGEXP, 'Left');
- }
+var emotion_element_699e6908_browser_esm_hasOwnProperty = {}.hasOwnProperty;
- return key;
-}
-/**
- * An incredibly basic ltr -> rtl converter for style properties
- *
- * @param {import('react').CSSProperties} ltrStyles
- *
- * @return {import('react').CSSProperties} Converted ltr -> rtl styles
- */
+var EmotionCacheContext = /* #__PURE__ */(0,external_React_.createContext)( // we're doing this to avoid preconstruct's dead code elimination in this one case
+// because this module is primarily intended for the browser and node
+// but it's also required in react native and similar environments sometimes
+// and we could have a special build just for that
+// but this is much easier and the native packages
+// might use a different theme context in the future anyway
+typeof HTMLElement !== 'undefined' ? /* #__PURE__ */emotion_cache_browser_esm({
+ key: 'css'
+}) : null);
+if (false) {}
-const convertLTRToRTL = function () {
- let ltrStyles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- return Object(external_lodash_["mapKeys"])(ltrStyles, (_value, key) => getConvertedKey(key));
+var CacheProvider = EmotionCacheContext.Provider;
+var __unsafe_useEmotionCache = function useEmotionCache() {
+ return (0,external_React_.useContext)(EmotionCacheContext);
};
-/**
- * A higher-order function that create an incredibly basic ltr -> rtl style converter for CSS objects.
- *
- * @param {import('react').CSSProperties} ltrStyles Ltr styles. Converts and renders from ltr -> rtl styles, if applicable.
- * @param {import('react').CSSProperties} [rtlStyles] Rtl styles. Renders if provided.
- *
- * @return {() => import('@emotion/react').SerializedStyles} A function to output CSS styles for Emotion's renderer
- */
-
-function rtl_rtl() {
- let ltrStyles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- let rtlStyles = arguments.length > 1 ? arguments[1] : undefined;
- return () => {
- if (rtlStyles) {
- // @ts-ignore: `css` types are wrong, it can accept an object: https://emotion.sh/docs/object-styles#with-css
- return Object(external_wp_i18n_["isRTL"])() ? /*#__PURE__*/Object(emotion_react_browser_esm["a" /* css */])(rtlStyles, true ? "" : undefined) : /*#__PURE__*/Object(emotion_react_browser_esm["a" /* css */])(ltrStyles, true ? "" : undefined);
- } // @ts-ignore: `css` types are wrong, it can accept an object: https://emotion.sh/docs/object-styles#with-css
-
-
- return Object(external_wp_i18n_["isRTL"])() ? /*#__PURE__*/Object(emotion_react_browser_esm["a" /* css */])(convertLTRToRTL(ltrStyles), true ? "" : undefined) : /*#__PURE__*/Object(emotion_react_browser_esm["a" /* css */])(ltrStyles, true ? "" : undefined);
- };
-}
-/**
- * Call this in the `useMemo` dependency array to ensure that subsequent renders will
- * cause rtl styles to update based on the `isRTL` return value even if all other dependencies
- * remain the same.
- *
- * @example
- * const styles = useMemo( () => {
- * return css`
- * ${ rtl( { marginRight: '10px' } ) }
- * `;
- * }, [ rtl.watch() ] );
- */
-rtl_rtl.watch = () => Object(external_wp_i18n_["isRTL"