Gutenberg - Version 13.0.0

Version Description

Download this release

Release Info

Developer gutenbergplugin
Plugin Icon 128x128 Gutenberg
Version 13.0.0
Comparing to
See all releases

Code changes from version 12.9.0 to 13.0.0

README.md CHANGED
@@ -41,9 +41,13 @@ Review the [Create a Block tutorial](/docs/getting-started/create-block/README.m
41
 
42
  ### Contribute to Gutenberg
43
 
44
- Gutenberg is an open-source project and welcomes all contributors from code to design, from documentation to triage. The project is built by many contributors and volunteers and we'd love your help building it.
45
 
46
- See the [Contributors Handbook](https://developer.wordpress.org/block-editor/contributors/) for all the details on how you can contribute. See [CONTRIBUTING.md](https://github.com/WordPress/gutenberg/blob/HEAD/CONTRIBUTING.md) for the contributing guidelines.
 
 
 
 
47
 
48
  As with all WordPress projects, we want to ensure a welcoming environment for everyone. With that in mind, all contributors are expected to follow our [Code of Conduct](https://github.com/WordPress/gutenberg/blob/HEAD/CODE_OF_CONDUCT.md).
49
 
41
 
42
  ### Contribute to Gutenberg
43
 
44
+ Gutenberg is an open-source project and welcomes all contributors from code to design, and from documentation to triage. The project is built by many contributors and volunteers and we'd love your help building it.
45
 
46
+ See the [Contributors Handbook](https://developer.wordpress.org/block-editor/contributors/) for all the details on how you can contribute.
47
+
48
+ To get up and running quickly with **code contribution** see [Getting Started With Code Contribution](/docs/contributors/code/getting-started-with-code-contribution.md). Also check out the other resources available on the [Code Contributions](/docs/contributors/code/README.md) page.
49
+
50
+ In whichever way you wish to contribute please be sure to read the [Contributing Guidelines](https://github.com/WordPress/gutenberg/blob/HEAD/CONTRIBUTING.md) first.
51
 
52
  As with all WordPress projects, we want to ensure a welcoming environment for everyone. With that in mind, all contributors are expected to follow our [Code of Conduct](https://github.com/WordPress/gutenberg/blob/HEAD/CODE_OF_CONDUCT.md).
53
 
build/block-editor/index.js CHANGED
@@ -2163,7 +2163,7 @@ __webpack_require__.d(__webpack_exports__, {
2163
  "BlockSettingsMenuControls": function() { return /* reexport */ block_settings_menu_controls; },
2164
  "BlockStyles": function() { return /* reexport */ block_styles; },
2165
  "BlockTitle": function() { return /* reexport */ BlockTitle; },
2166
- "BlockToolbar": function() { return /* reexport */ BlockToolbar; },
2167
  "BlockTools": function() { return /* reexport */ BlockTools; },
2168
  "BlockVerticalAlignmentControl": function() { return /* reexport */ BlockVerticalAlignmentControl; },
2169
  "BlockVerticalAlignmentToolbar": function() { return /* reexport */ BlockVerticalAlignmentToolbar; },
@@ -2181,7 +2181,7 @@ __webpack_require__.d(__webpack_exports__, {
2181
  "InspectorControls": function() { return /* reexport */ inspector_controls; },
2182
  "JustifyContentControl": function() { return /* reexport */ JustifyContentControl; },
2183
  "JustifyToolbar": function() { return /* reexport */ JustifyToolbar; },
2184
- "LineHeightControl": function() { return /* reexport */ LineHeightControl; },
2185
  "MediaPlaceholder": function() { return /* reexport */ media_placeholder; },
2186
  "MediaReplaceFlow": function() { return /* reexport */ media_replace_flow; },
2187
  "MediaUpload": function() { return /* reexport */ media_upload; },
@@ -2250,7 +2250,9 @@ __webpack_require__.d(__webpack_exports__, {
2250
  "__experimentalUseGradient": function() { return /* reexport */ __experimentalUseGradient; },
2251
  "__experimentalUseNoRecursiveRenders": function() { return /* reexport */ useNoRecursiveRenders; },
2252
  "__experimentalUseResizeCanvas": function() { return /* reexport */ useResizeCanvas; },
 
2253
  "__unstableBlockSettingsMenuFirstItem": function() { return /* reexport */ block_settings_menu_first_item; },
 
2254
  "__unstableEditorStyles": function() { return /* reexport */ EditorStyles; },
2255
  "__unstableIframe": function() { return /* reexport */ iframe; },
2256
  "__unstableInserterMenuExtension": function() { return /* reexport */ inserter_menu_extension; },
@@ -2302,8 +2304,12 @@ __webpack_require__.d(selectors_namespaceObject, {
2302
  "__unstableGetBlockWithoutInnerBlocks": function() { return __unstableGetBlockWithoutInnerBlocks; },
2303
  "__unstableGetClientIdWithClientIdsTree": function() { return __unstableGetClientIdWithClientIdsTree; },
2304
  "__unstableGetClientIdsTree": function() { return __unstableGetClientIdsTree; },
 
 
2305
  "__unstableIsLastBlockChangeIgnored": function() { return __unstableIsLastBlockChangeIgnored; },
 
2306
  "areInnerBlocksControlled": function() { return areInnerBlocksControlled; },
 
2307
  "canInsertBlockType": function() { return canInsertBlockType; },
2308
  "canInsertBlocks": function() { return canInsertBlocks; },
2309
  "canLockBlockType": function() { return canLockBlockType; },
@@ -2385,10 +2391,13 @@ __webpack_require__.d(selectors_namespaceObject, {
2385
  var actions_namespaceObject = {};
2386
  __webpack_require__.r(actions_namespaceObject);
2387
  __webpack_require__.d(actions_namespaceObject, {
 
 
2388
  "__unstableMarkAutomaticChange": function() { return __unstableMarkAutomaticChange; },
2389
  "__unstableMarkLastChangeAsPersistent": function() { return __unstableMarkLastChangeAsPersistent; },
2390
  "__unstableMarkNextChangeAsNotPersistent": function() { return __unstableMarkNextChangeAsNotPersistent; },
2391
  "__unstableSaveReusableBlock": function() { return __unstableSaveReusableBlock; },
 
2392
  "clearSelectedBlock": function() { return clearSelectedBlock; },
2393
  "duplicateBlocks": function() { return duplicateBlocks; },
2394
  "enterFormattedText": function() { return enterFormattedText; },
@@ -2541,13 +2550,13 @@ const PREFERENCES_DEFAULTS = {
2541
  * @property {boolean} keepCaretInsideBlock Whether caret should move between blocks in edit mode
2542
  * @property {string} bodyPlaceholder Empty post placeholder
2543
  * @property {string} titlePlaceholder Empty title placeholder
 
2544
  * @property {boolean} codeEditingEnabled Whether or not the user can switch to the code editor
 
2545
  * @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.
2546
  * @property {boolean} __experimentalBlockDirectory Whether the user has enabled the Block Directory
2547
  * @property {Array} __experimentalBlockPatterns Array of objects representing the block patterns
2548
  * @property {Array} __experimentalBlockPatternCategories Array of objects representing the block pattern categories
2549
- * @property {boolean} __experimentalGenerateAnchors Enable/Disable auto anchor generation for Heading blocks
2550
- * @property {boolean} __experimentalCanLockBlocks Whether the user can manage Block Lock state
2551
  * @property {boolean} __unstableGalleryWithImageBlocks Whether the user has enabled the refactored gallery block which uses InnerBlocks
2552
  */
2553
 
@@ -2654,15 +2663,16 @@ const SETTINGS_DEFAULTS = {
2654
  maxUploadFileSize: 0,
2655
  // List of allowed mime types and file extensions.
2656
  allowedMimeTypes: null,
 
 
2657
  __experimentalCanUserUseUnfilteredHTML: false,
2658
  __experimentalBlockDirectory: false,
2659
  __mobileEnablePageTemplates: false,
2660
  __experimentalBlockPatterns: [],
2661
  __experimentalBlockPatternCategories: [],
2662
  __experimentalSpotlightEntityBlocks: [],
2663
- __experimentalGenerateAnchors: false,
2664
- __experimentalCanLockBlocks: true,
2665
  __unstableGalleryWithImageBlocks: false,
 
2666
  // gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.
2667
  // The setting is only kept for backward compatibility purposes.
2668
  gradients: [{
@@ -3897,24 +3907,31 @@ function selectionHelper() {
3897
 
3898
 
3899
  function selection() {
3900
- var _state$selectionStart, _state$selectionEnd;
3901
 
3902
  let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3903
  let action = arguments.length > 1 ? arguments[1] : undefined;
3904
 
3905
  switch (action.type) {
3906
  case 'SELECTION_CHANGE':
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3907
  return {
3908
- selectionStart: {
3909
- clientId: action.clientId,
3910
- attributeKey: action.attributeKey,
3911
- offset: action.startOffset
3912
- },
3913
- selectionEnd: {
3914
- clientId: action.clientId,
3915
- attributeKey: action.attributeKey,
3916
- offset: action.endOffset
3917
- }
3918
  };
3919
 
3920
  case 'RESET_SELECTION':
@@ -3932,6 +3949,11 @@ function selection() {
3932
  start,
3933
  end
3934
  } = action;
 
 
 
 
 
3935
  return {
3936
  selectionStart: {
3937
  clientId: start
@@ -3942,8 +3964,8 @@ function selection() {
3942
  };
3943
 
3944
  case 'RESET_BLOCKS':
3945
- const startClientId = state === null || state === void 0 ? void 0 : (_state$selectionStart = state.selectionStart) === null || _state$selectionStart === void 0 ? void 0 : _state$selectionStart.clientId;
3946
- 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.
3947
 
3948
  if (!startClientId && !endClientId) {
3949
  return state;
@@ -4732,6 +4754,29 @@ const symbol = (0,external_wp_element_namespaceObject.createElement)(external_wp
4732
  }));
4733
  /* harmony default export */ var library_symbol = (symbol);
4734
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4735
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/store/selectors.js
4736
  /**
4737
  * External dependencies
@@ -4746,6 +4791,13 @@ const symbol = (0,external_wp_element_namespaceObject.createElement)(external_wp
4746
 
4747
 
4748
 
 
 
 
 
 
 
 
4749
  /**
4750
  * A block selection object.
4751
  *
@@ -4917,8 +4969,9 @@ const __unstableGetClientIdsTree = rememo(function (state) {
4917
  return (0,external_lodash_namespaceObject.map)(getBlockOrder(state, rootClientId), clientId => __unstableGetClientIdWithClientIdsTree(state, clientId));
4918
  }, state => [state.blocks.order]);
4919
  /**
4920
- * Returns an array containing the clientIds of all descendants
4921
- * of the blocks given.
 
4922
  *
4923
  * @param {Object} state Global application state.
4924
  * @param {Array} clientIds Array of blocks to inspect.
@@ -4926,13 +4979,21 @@ const __unstableGetClientIdsTree = rememo(function (state) {
4926
  * @return {Array} ids of descendants.
4927
  */
4928
 
4929
- const getClientIdsOfDescendants = (state, clientIds) => (0,external_lodash_namespaceObject.flatMap)(clientIds, clientId => {
4930
- const descendants = getBlockOrder(state, clientId);
4931
- return [...descendants, ...getClientIdsOfDescendants(state, descendants)];
4932
- });
 
 
 
 
 
 
 
4933
  /**
4934
- * Returns an array containing the clientIds of the top-level blocks
4935
- * and their descendants of any depth (for nested blocks).
 
4936
  *
4937
  * @param {Object} state Global application state.
4938
  *
@@ -4940,8 +5001,13 @@ const getClientIdsOfDescendants = (state, clientIds) => (0,external_lodash_names
4940
  */
4941
 
4942
  const getClientIdsWithDescendants = rememo(state => {
4943
- const topLevelIds = getBlockOrder(state);
4944
- return [...topLevelIds, ...getClientIdsOfDescendants(state, topLevelIds)];
 
 
 
 
 
4945
  }, state => [state.blocks.order]);
4946
  /**
4947
  * Returns the total number of blocks, or the total number of blocks with a specific name in a post.
@@ -5560,6 +5626,139 @@ function getMultiSelectedBlocksEndClientId(state) {
5560
 
5561
  return selectionEnd.clientId || null;
5562
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5563
  /**
5564
  * Returns an array containing all block client IDs in the editor in the order
5565
  * they appear. Optionally accepts a root client ID of the block list for which
@@ -5952,7 +6151,15 @@ const canInsertBlockTypeUnmemoized = function (state, blockName) {
5952
  const blockAllowedParentBlocks = blockType.parent;
5953
  const parentName = getBlockName(state, rootClientId);
5954
  const hasBlockAllowedParent = checkAllowList(blockAllowedParentBlocks, parentName);
5955
- const canInsert = hasParentAllowedBlock === null && hasBlockAllowedParent === null || hasParentAllowedBlock === true || hasBlockAllowedParent === true;
 
 
 
 
 
 
 
 
5956
 
5957
  if (!canInsert) {
5958
  return canInsert;
@@ -6027,7 +6234,7 @@ function canRemoveBlock(state, clientId) {
6027
  const {
6028
  lock
6029
  } = attributes;
6030
- const parentIsLocked = !!getTemplateLock(state, rootClientId); // If we don't have a lock on the blockType level, we differ to the parent templateLock.
6031
 
6032
  if (lock === undefined || (lock === null || lock === void 0 ? void 0 : lock.remove) === undefined) {
6033
  return !parentIsLocked;
@@ -6071,7 +6278,7 @@ function canMoveBlock(state, clientId) {
6071
  const {
6072
  lock
6073
  } = attributes;
6074
- const parentIsLocked = getTemplateLock(state, rootClientId) === 'all'; // If we don't have a lock on the blockType level, we differ to the parent templateLock.
6075
 
6076
  if (lock === undefined || (lock === null || lock === void 0 ? void 0 : lock.move) === undefined) {
6077
  return !parentIsLocked;
@@ -6094,6 +6301,28 @@ function canMoveBlocks(state, clientIds) {
6094
  let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
6095
  return clientIds.every(clientId => canMoveBlock(state, clientId, rootClientId));
6096
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6097
  /**
6098
  * Determines if the given block type can be locked/unlocked by a user.
6099
  *
@@ -6106,12 +6335,12 @@ function canMoveBlocks(state, clientIds) {
6106
  function canLockBlockType(state, nameOrType) {
6107
  var _state$settings;
6108
 
6109
- if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, '__experimentalLock', true)) {
6110
  return false;
6111
  } // Use block editor settings as the default value.
6112
 
6113
 
6114
- return !!((_state$settings = state.settings) !== null && _state$settings !== void 0 && _state$settings.__experimentalCanLockBlocks);
6115
  }
6116
  /**
6117
  * Returns information about how recently and frequently a block has been inserted.
@@ -6441,7 +6670,10 @@ const getInserterItems = rememo(function (state) {
6441
  */
6442
 
6443
  const getBlockTransformItems = rememo(function (state, blocks) {
 
 
6444
  let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
 
6445
  const buildBlockTypeTransformItem = buildBlockTypeItem(state, {
6446
  buildScope: 'transform'
6447
  });
@@ -6451,16 +6683,26 @@ const getBlockTransformItems = rememo(function (state, blocks) {
6451
  name
6452
  } = _ref5;
6453
  return name;
6454
- });
 
 
 
 
 
 
 
 
 
6455
  const possibleTransforms = (0,external_wp_blocks_namespaceObject.getPossibleBlockTransformations)(blocks).reduce((accumulator, block) => {
6456
- if (itemsByName[block === null || block === void 0 ? void 0 : block.name]) {
 
 
6457
  accumulator.push(itemsByName[block.name]);
6458
  }
6459
 
6460
  return accumulator;
6461
  }, []);
6462
- const possibleBlockTransformations = (0,external_lodash_namespaceObject.orderBy)(possibleTransforms, block => itemsByName[block.name].frecency, 'desc');
6463
- return possibleBlockTransformations;
6464
  }, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId, state.preferences.insertUsage, state.settings.allowedBlockTypes, state.settings.templateLock, (0,external_wp_blocks_namespaceObject.getBlockTypes)()]);
6465
  /**
6466
  * Determines whether there are items to show in the inserter.
@@ -6944,8 +7186,6 @@ function wasBlockJustInserted(state, clientId, source) {
6944
 
6945
  ;// CONCATENATED MODULE: external ["wp","a11y"]
6946
  var external_wp_a11y_namespaceObject = window["wp"]["a11y"];
6947
- ;// CONCATENATED MODULE: external ["wp","richText"]
6948
- var external_wp_richText_namespaceObject = window["wp"]["richText"];
6949
  ;// CONCATENATED MODULE: external ["wp","deprecated"]
6950
  var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
6951
  var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
@@ -6963,6 +7203,11 @@ var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external
6963
 
6964
 
6965
 
 
 
 
 
 
6966
  /**
6967
  * Action which will insert a default block insert action if there
6968
  * are no other blocks at the root of the editor. This action should be used
@@ -7052,6 +7297,15 @@ const validateBlocksToTemplate = blocks => _ref3 => {
7052
  * text value. See `wp.richText.create`.
7053
  */
7054
 
 
 
 
 
 
 
 
 
 
7055
  /* eslint-disable jsdoc/valid-types */
7056
 
7057
  /**
@@ -7547,7 +7801,7 @@ const insertBlocks = function (blocks, index, rootClientId) {
7547
  * @param {?string} rootClientId Optional root client ID of block list on
7548
  * which to insert.
7549
  * @param {?number} index Index at which block should be inserted.
7550
- * @param {Object} __unstableOptions Wether or not to show an inserter button.
7551
  *
7552
  * @return {Object} Action object.
7553
  */
@@ -7609,6 +7863,229 @@ const synchronizeTemplate = () => _ref11 => {
7609
  const updatedBlockList = (0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)(blocks, template);
7610
  dispatch.resetBlocks(updatedBlockList);
7611
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7612
  /**
7613
  * Action that merges two blocks.
7614
  *
@@ -7616,11 +8093,11 @@ const synchronizeTemplate = () => _ref11 => {
7616
  * @param {string} secondBlockClientId Client ID of the second block to merge.
7617
  */
7618
 
7619
- const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref12 => {
7620
  let {
7621
  select,
7622
  dispatch
7623
- } = _ref12;
7624
  const blocks = [firstBlockClientId, secondBlockClientId];
7625
  dispatch({
7626
  type: 'MERGE_BLOCKS',
@@ -7668,21 +8145,13 @@ const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref12 => {
7668
  if (canRestoreTextSelection) {
7669
  const selectedBlock = clientId === clientIdA ? cloneA : cloneB;
7670
  const html = selectedBlock.attributes[attributeKey];
7671
- const {
7672
- multiline: multilineTag,
7673
- __unstableMultilineWrapperTags: multilineWrapperTags,
7674
- __unstablePreserveWhiteSpace: preserveWhiteSpace
7675
- } = attributeDefinition;
7676
  const value = (0,external_wp_richText_namespaceObject.insert)((0,external_wp_richText_namespaceObject.create)({
7677
  html,
7678
- multilineTag,
7679
- multilineWrapperTags,
7680
- preserveWhiteSpace
7681
  }), START_OF_SELECTED_AREA, offset, offset);
7682
  selectedBlock.attributes[attributeKey] = (0,external_wp_richText_namespaceObject.toHTMLString)({
7683
  value,
7684
- multilineTag,
7685
- preserveWhiteSpace
7686
  });
7687
  } // We can only merge blocks with similar types
7688
  // thus, we transform the block to merge first.
@@ -7700,23 +8169,15 @@ const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref12 => {
7700
  if (canRestoreTextSelection) {
7701
  const newAttributeKey = (0,external_lodash_namespaceObject.findKey)(updatedAttributes, v => typeof v === 'string' && v.indexOf(START_OF_SELECTED_AREA) !== -1);
7702
  const convertedHtml = updatedAttributes[newAttributeKey];
7703
- const {
7704
- multiline: multilineTag,
7705
- __unstableMultilineWrapperTags: multilineWrapperTags,
7706
- __unstablePreserveWhiteSpace: preserveWhiteSpace
7707
- } = blockAType.attributes[newAttributeKey];
7708
  const convertedValue = (0,external_wp_richText_namespaceObject.create)({
7709
  html: convertedHtml,
7710
- multilineTag,
7711
- multilineWrapperTags,
7712
- preserveWhiteSpace
7713
  });
7714
  const newOffset = convertedValue.text.indexOf(START_OF_SELECTED_AREA);
7715
  const newValue = (0,external_wp_richText_namespaceObject.remove)(convertedValue, newOffset, newOffset + 1);
7716
  const newHtml = (0,external_wp_richText_namespaceObject.toHTMLString)({
7717
  value: newValue,
7718
- multilineTag,
7719
- preserveWhiteSpace
7720
  });
7721
  updatedAttributes[newAttributeKey] = newHtml;
7722
  dispatch.selectionChange(blockA.clientId, newAttributeKey, newOffset, newOffset);
@@ -7740,11 +8201,11 @@ const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref12 => {
7740
 
7741
  const removeBlocks = function (clientIds) {
7742
  let selectPrevious = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
7743
- return _ref13 => {
7744
  let {
7745
  select,
7746
  dispatch
7747
- } = _ref13;
7748
 
7749
  if (!clientIds || !clientIds.length) {
7750
  return;
@@ -7900,21 +8361,28 @@ function exitFormattedText() {
7900
  /**
7901
  * Action that changes the position of the user caret.
7902
  *
7903
- * @param {string} clientId The selected block client ID.
7904
- * @param {string} attributeKey The selected block attribute key.
7905
- * @param {number} startOffset The start offset.
7906
- * @param {number} endOffset The end offset.
7907
  *
7908
  * @return {Object} Action object.
7909
  */
7910
 
7911
  function selectionChange(clientId, attributeKey, startOffset, endOffset) {
 
 
 
 
 
 
 
 
 
 
7912
  return {
7913
  type: 'SELECTION_CHANGE',
7914
- clientId,
7915
- attributeKey,
7916
- startOffset,
7917
- endOffset
7918
  };
7919
  }
7920
  /**
@@ -7926,10 +8394,10 @@ function selectionChange(clientId, attributeKey, startOffset, endOffset) {
7926
  * @param {?number} index Optional index where to insert the default block.
7927
  */
7928
 
7929
- const insertDefaultBlock = (attributes, rootClientId, index) => _ref14 => {
7930
  let {
7931
  dispatch
7932
- } = _ref14;
7933
  // Abort if there is no default block type (if it has been unregistered).
7934
  const defaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)();
7935
 
@@ -8018,10 +8486,10 @@ function __unstableMarkNextChangeAsNotPersistent() {
8018
  * selection changes have been recorded.
8019
  */
8020
 
8021
- const __unstableMarkAutomaticChange = () => _ref15 => {
8022
  let {
8023
  dispatch
8024
- } = _ref15;
8025
  dispatch({
8026
  type: 'MARK_AUTOMATIC_CHANGE'
8027
  });
@@ -8042,10 +8510,10 @@ const __unstableMarkAutomaticChange = () => _ref15 => {
8042
 
8043
  const setNavigationMode = function () {
8044
  let isNavigationMode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
8045
- return _ref16 => {
8046
  let {
8047
  dispatch
8048
- } = _ref16;
8049
  dispatch({
8050
  type: 'SET_NAVIGATION_MODE',
8051
  isNavigationMode
@@ -8066,10 +8534,10 @@ const setNavigationMode = function () {
8066
 
8067
  const setBlockMovingClientId = function () {
8068
  let hasBlockMovingClientId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
8069
- return _ref17 => {
8070
  let {
8071
  dispatch
8072
- } = _ref17;
8073
  dispatch({
8074
  type: 'SET_BLOCK_MOVING_MODE',
8075
  hasBlockMovingClientId
@@ -8089,11 +8557,11 @@ const setBlockMovingClientId = function () {
8089
 
8090
  const duplicateBlocks = function (clientIds) {
8091
  let updateSelection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
8092
- return _ref18 => {
8093
  let {
8094
  select,
8095
  dispatch
8096
- } = _ref18;
8097
 
8098
  if (!clientIds || !clientIds.length) {
8099
  return;
@@ -8131,11 +8599,11 @@ const duplicateBlocks = function (clientIds) {
8131
  * @param {string} clientId
8132
  */
8133
 
8134
- const insertBeforeBlock = clientId => _ref19 => {
8135
  let {
8136
  select,
8137
  dispatch
8138
- } = _ref19;
8139
 
8140
  if (!clientId) {
8141
  return;
@@ -8157,11 +8625,11 @@ const insertBeforeBlock = clientId => _ref19 => {
8157
  * @param {string} clientId
8158
  */
8159
 
8160
- const insertAfterBlock = clientId => _ref20 => {
8161
  let {
8162
  select,
8163
  dispatch
8164
- } = _ref20;
8165
 
8166
  if (!clientId) {
8167
  return;
@@ -8197,10 +8665,10 @@ function toggleBlockHighlight(clientId, isHighlighted) {
8197
  * @param {string} clientId Target block client ID.
8198
  */
8199
 
8200
- const flashBlock = clientId => async _ref21 => {
8201
  let {
8202
  dispatch
8203
- } = _ref21;
8204
  dispatch(toggleBlockHighlight(clientId, true));
8205
  await new Promise(resolve => setTimeout(resolve, 150));
8206
  dispatch(toggleBlockHighlight(clientId, false));
@@ -9032,6 +9500,11 @@ function InspectorControlsFill(_ref) {
9032
  * External dependencies
9033
  */
9034
 
 
 
 
 
 
9035
  /**
9036
  * Removed falsy values from nested object.
9037
  *
@@ -9098,6 +9571,27 @@ function transformStyles(activeSupports, migrationPaths, result, source, index,
9098
  });
9099
  return returnBlock;
9100
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9101
 
9102
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inspector-controls/block-support-tools-panel.js
9103
 
@@ -9763,36 +10257,36 @@ function hasGapValue(props) {
9763
  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;
9764
  }
9765
  /**
9766
- * Returns a BoxControl object value from a given blockGap style.
9767
  * The string check is for backwards compatibility before Gutenberg supported
9768
  * split gap values (row and column) and the value was a string n + unit.
9769
  *
9770
- * @param {string? | Object?} rawBlockGapValue A style object.
9771
- * @return {Object?} A value to pass to the BoxControl component.
9772
  */
9773
 
9774
- function getGapValueFromStyle(rawBlockGapValue) {
9775
- if (!rawBlockGapValue) {
9776
- return rawBlockGapValue;
9777
  }
9778
 
9779
- const isValueString = typeof rawBlockGapValue === 'string';
9780
  return {
9781
- top: isValueString ? rawBlockGapValue : rawBlockGapValue === null || rawBlockGapValue === void 0 ? void 0 : rawBlockGapValue.top,
9782
- left: isValueString ? rawBlockGapValue : rawBlockGapValue === null || rawBlockGapValue === void 0 ? void 0 : rawBlockGapValue.left
9783
  };
9784
  }
9785
  /**
9786
  * Returns a CSS value for the `gap` property from a given blockGap style.
9787
  *
9788
- * @param {string? | Object?} blockGapValue A style object.
9789
  * @param {string?} defaultValue A default gap value.
9790
  * @return {string|null} The concatenated gap value (row and column).
9791
  */
9792
 
9793
  function getGapCSSValue(blockGapValue) {
9794
  let defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '0';
9795
- const blockGapBoxControlValue = getGapValueFromStyle(blockGapValue);
9796
 
9797
  if (!blockGapBoxControlValue) {
9798
  return null;
@@ -9870,13 +10364,21 @@ function GapEdit(props) {
9870
  return null;
9871
  }
9872
 
 
 
9873
  const onChange = next => {
9874
  var _window;
9875
 
 
 
 
 
 
 
 
9876
  const newStyle = { ...style,
9877
  spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing),
9878
- blockGap: { ...getGapValueFromStyle(next)
9879
- }
9880
  }
9881
  };
9882
  setAttributes({
@@ -9894,8 +10396,7 @@ function GapEdit(props) {
9894
  }
9895
  };
9896
 
9897
- const splitOnAxis = sides && sides.some(side => AXIAL_SIDES.includes(side));
9898
- const gapValue = getGapValueFromStyle(style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap); // The BoxControl component expects a full complement of side values.
9899
  // Gap row and column values translate to top/bottom and left/right respectively.
9900
 
9901
  const boxControlGapValue = splitOnAxis ? { ...gapValue,
@@ -9925,6 +10426,132 @@ function GapEdit(props) {
9925
  });
9926
  }
9927
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9928
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/justify-content-control/ui.js
9929
 
9930
 
@@ -10001,7 +10628,7 @@ function JustifyContentUI(_ref) {
10001
  }, extraProps));
10002
  }
10003
 
10004
- /* harmony default export */ var ui = (JustifyContentUI);
10005
 
10006
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/justify-content-control/index.js
10007
 
@@ -10011,16 +10638,24 @@ function JustifyContentUI(_ref) {
10011
  * Internal dependencies
10012
  */
10013
 
10014
- function JustifyContentControl(props) {
10015
- return (0,external_wp_element_namespaceObject.createElement)(ui, _extends({}, props, {
 
10016
  isToolbar: false
10017
  }));
10018
- }
10019
- function JustifyToolbar(props) {
10020
- return (0,external_wp_element_namespaceObject.createElement)(ui, _extends({}, props, {
 
10021
  isToolbar: true
10022
  }));
10023
- }
 
 
 
 
 
 
10024
 
10025
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/layouts/flex.js
10026
 
@@ -10038,6 +10673,7 @@ function JustifyToolbar(props) {
10038
 
10039
 
10040
 
 
10041
  // Used with the default, horizontal flex orientation.
10042
 
10043
  const justifyContentMap = {
@@ -10052,6 +10688,11 @@ const alignItemsMap = {
10052
  right: 'flex-end',
10053
  center: 'center'
10054
  };
 
 
 
 
 
10055
  const flexWrapOptions = ['wrap', 'nowrap'];
10056
  /* harmony default export */ var flex = ({
10057
  name: 'flex',
@@ -10087,6 +10728,9 @@ const flexWrapOptions = ['wrap', 'nowrap'];
10087
  return null;
10088
  }
10089
 
 
 
 
10090
  return (0,external_wp_element_namespaceObject.createElement)(block_controls, {
10091
  group: "block",
10092
  __experimentalShareWithChildBlocks: true
@@ -10094,27 +10738,35 @@ const flexWrapOptions = ['wrap', 'nowrap'];
10094
  layout: layout,
10095
  onChange: onChange,
10096
  isToolbar: true
 
 
 
 
10097
  }));
10098
  },
10099
  save: function FlexLayoutStyle(_ref3) {
10100
- var _getGapCSSValue, _style$spacing;
10101
 
10102
  let {
10103
  selector,
10104
  layout,
10105
- style
 
10106
  } = _ref3;
10107
  const {
10108
  orientation = 'horizontal'
10109
  } = layout;
10110
  const blockGapSupport = useSetting('spacing.blockGap');
10111
- const hasBlockGapStylesSupport = blockGapSupport !== null;
10112
- const blockGapValue = (_getGapCSSValue = getGapCSSValue(style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap, '0.5em')) !== null && _getGapCSSValue !== void 0 ? _getGapCSSValue : 'var( --wp--style--block-gap, 0.5em )';
 
 
10113
  const justifyContent = justifyContentMap[layout.justifyContent] || justifyContentMap.left;
10114
  const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : 'wrap';
 
10115
  const rowOrientation = `
10116
  flex-direction: row;
10117
- align-items: center;
10118
  justify-content: ${justifyContent};
10119
  `;
10120
  const alignItems = alignItemsMap[layout.justifyContent] || alignItemsMap.left;
@@ -10149,12 +10801,58 @@ const flexWrapOptions = ['wrap', 'nowrap'];
10149
 
10150
  });
10151
 
10152
- function FlexLayoutJustifyContentControl(_ref4) {
10153
  let {
10154
  layout,
10155
  onChange,
10156
  isToolbar = false
10157
  } = _ref4;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10158
  const {
10159
  justifyContent = 'left',
10160
  orientation = 'horizontal'
@@ -10208,12 +10906,12 @@ function FlexLayoutJustifyContentControl(_ref4) {
10208
 
10209
  return (0,external_wp_element_namespaceObject.createElement)("fieldset", {
10210
  className: "block-editor-hooks__flex-layout-justification-controls"
10211
- }, (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 => {
10212
  let {
10213
  value,
10214
  icon,
10215
  label
10216
- } = _ref5;
10217
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
10218
  key: value,
10219
  label: label,
@@ -10224,11 +10922,11 @@ function FlexLayoutJustifyContentControl(_ref4) {
10224
  })));
10225
  }
10226
 
10227
- function FlexWrapControl(_ref6) {
10228
  let {
10229
  layout,
10230
  onChange
10231
- } = _ref6;
10232
  const {
10233
  flexWrap = 'wrap'
10234
  } = layout;
@@ -10243,11 +10941,11 @@ function FlexWrapControl(_ref6) {
10243
  });
10244
  }
10245
 
10246
- function OrientationControl(_ref7) {
10247
  let {
10248
  layout,
10249
  onChange
10250
- } = _ref7;
10251
  const {
10252
  orientation = 'horizontal'
10253
  } = layout;
@@ -10318,6 +11016,7 @@ function Icon(_ref) {
10318
 
10319
 
10320
 
 
10321
  /* harmony default export */ var flow = ({
10322
  name: 'default',
10323
  label: (0,external_wp_i18n_namespaceObject.__)('Flow'),
@@ -10386,12 +11085,13 @@ function Icon(_ref) {
10386
  return null;
10387
  },
10388
  save: function DefaultLayoutStyle(_ref2) {
10389
- var _style$spacing, _blockGapStyleValue$t;
10390
 
10391
  let {
10392
  selector,
10393
  layout = {},
10394
- style
 
10395
  } = _ref2;
10396
  const {
10397
  contentSize,
@@ -10399,8 +11099,10 @@ function Icon(_ref) {
10399
  } = layout;
10400
  const blockGapSupport = useSetting('spacing.blockGap');
10401
  const hasBlockGapStylesSupport = blockGapSupport !== null;
10402
- const blockGapStyleValue = getGapValueFromStyle(style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap);
10403
- const blockGapValue = (_blockGapStyleValue$t = blockGapStyleValue === null || blockGapStyleValue === void 0 ? void 0 : blockGapStyleValue.top) !== null && _blockGapStyleValue$t !== void 0 ? _blockGapStyleValue$t : 'var( --wp--style--block-gap )';
 
 
10404
  let output = !!contentSize || !!wideSize ? `
10405
  ${appendSelectors(selector, '> :where(:not(.alignleft):not(.alignright))')} {
10406
  max-width: ${contentSize !== null && contentSize !== void 0 ? contentSize : wideSize};
@@ -10619,10 +11321,10 @@ function LayoutStyle(_ref) {
10619
 
10620
 
10621
 
10622
- const DEFAULT_CONTROLS = ['none', 'left', 'center', 'right', 'wide', 'full'];
10623
  const WIDE_CONTROLS = ['wide', 'full'];
10624
  function useAvailableAlignments() {
10625
- let controls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_CONTROLS;
10626
 
10627
  // Always add the `none` option if not exists.
10628
  if (!controls.includes('none')) {
@@ -10668,7 +11370,7 @@ function useAvailableAlignments() {
10668
  }
10669
 
10670
  const {
10671
- alignments: availableAlignments = DEFAULT_CONTROLS
10672
  } = layout;
10673
  const enabledControls = controls.filter(control => (layout.alignments || // Ignore the global wideAlignment check if the layout explicitely defines alignments.
10674
  wideControlsEnabled || !WIDE_CONTROLS.includes(control)) && availableAlignments.includes(control)).map(enabledControl => ({
@@ -10704,10 +11406,10 @@ function useAvailableAlignments() {
10704
  */
10705
 
10706
 
10707
- const BLOCK_ALIGNMENTS_CONTROLS = {
10708
  none: {
10709
  icon: align_none,
10710
- title: (0,external_wp_i18n_namespaceObject.__)('None')
10711
  },
10712
  left: {
10713
  icon: position_left,
@@ -10730,8 +11432,8 @@ const BLOCK_ALIGNMENTS_CONTROLS = {
10730
  title: (0,external_wp_i18n_namespaceObject.__)('Full width')
10731
  }
10732
  };
10733
- const DEFAULT_CONTROL = 'none';
10734
- const POPOVER_PROPS = {
10735
  isAlternate: true
10736
  };
10737
 
@@ -10754,11 +11456,11 @@ function BlockAlignmentUI(_ref) {
10754
  onChange([value, 'none'].includes(align) ? undefined : align);
10755
  }
10756
 
10757
- const activeAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[value];
10758
- const defaultAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[DEFAULT_CONTROL];
10759
  const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu;
10760
  const commonProps = {
10761
- popoverProps: POPOVER_PROPS,
10762
  icon: activeAlignmentControl ? activeAlignmentControl.icon : defaultAlignmentControl.icon,
10763
  label: (0,external_wp_i18n_namespaceObject.__)('Align'),
10764
  toggleProps: {
@@ -10771,7 +11473,7 @@ function BlockAlignmentUI(_ref) {
10771
  let {
10772
  name: controlName
10773
  } = _ref2;
10774
- return { ...BLOCK_ALIGNMENTS_CONTROLS[controlName],
10775
  isActive: value === controlName || !value && controlName === 'none',
10776
  role: isCollapsed ? 'menuitemradio' : undefined,
10777
  onClick: () => onChangeAlignment(controlName)
@@ -10792,7 +11494,7 @@ function BlockAlignmentUI(_ref) {
10792
  const {
10793
  icon,
10794
  title
10795
- } = BLOCK_ALIGNMENTS_CONTROLS[controlName]; // If no value is provided, mark as selected the `none` option.
10796
 
10797
  const isSelected = controlName === value || !value && controlName === 'none';
10798
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
@@ -10826,16 +11528,24 @@ function BlockAlignmentUI(_ref) {
10826
  * Internal dependencies
10827
  */
10828
 
10829
- function BlockAlignmentControl(props) {
 
10830
  return (0,external_wp_element_namespaceObject.createElement)(block_alignment_control_ui, _extends({}, props, {
10831
  isToolbar: false
10832
  }));
10833
- }
10834
- function BlockAlignmentToolbar(props) {
 
10835
  return (0,external_wp_element_namespaceObject.createElement)(block_alignment_control_ui, _extends({}, props, {
10836
  isToolbar: true
10837
  }));
10838
- }
 
 
 
 
 
 
10839
 
10840
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/align.js
10841
 
@@ -11448,12 +12158,26 @@ const padding = {
11448
  };
11449
  /* harmony default export */ var styles_padding = (padding);
11450
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11451
  ;// CONCATENATED MODULE: ./packages/style-engine/build-module/styles/index.js
11452
  /**
11453
  * Internal dependencies
11454
  */
11455
 
11456
- const styleDefinitions = [styles_padding];
 
11457
 
11458
  ;// CONCATENATED MODULE: ./packages/style-engine/build-module/index.js
11459
  /**
@@ -16263,6 +16987,7 @@ function useMovingAnimation(_ref) {
16263
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/utils/dom.js
16264
  const BLOCK_SELECTOR = '.block-editor-block-list__block';
16265
  const APPENDER_SELECTOR = '.block-list-appender';
 
16266
  /**
16267
  * Returns true if two elements are contained within the same block.
16268
  *
@@ -16287,7 +17012,7 @@ function isInSameBlock(a, b) {
16287
  */
16288
 
16289
  function isInsideRootBlock(blockElement, element) {
16290
- const parentBlock = element.closest([BLOCK_SELECTOR, APPENDER_SELECTOR].join(','));
16291
  return parentBlock === blockElement;
16292
  }
16293
  /**
@@ -16320,199 +17045,6 @@ function getBlockClientId(node) {
16320
  return blockNode.id.slice('block-'.length);
16321
  }
16322
 
16323
- ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-list/use-block-props/use-multi-selection.js
16324
- /**
16325
- * WordPress dependencies
16326
- */
16327
-
16328
-
16329
- /**
16330
- * Internal dependencies
16331
- */
16332
-
16333
-
16334
-
16335
- /**
16336
- * Sets the `contenteditable` wrapper element to `value`.
16337
- *
16338
- * @param {HTMLElement} node Block element.
16339
- * @param {boolean} value `contentEditable` value (true or false)
16340
- */
16341
-
16342
- function setContentEditableWrapper(node, value) {
16343
- // Since `closest` considers `node` as a candidate, use `parentElement`.
16344
- node.parentElement.closest('[contenteditable]').contentEditable = value;
16345
- }
16346
- /**
16347
- * Sets a multi-selection based on the native selection across blocks.
16348
- *
16349
- * @param {string} clientId Block client ID.
16350
- */
16351
-
16352
- function useMultiSelection(clientId) {
16353
- const {
16354
- startMultiSelect,
16355
- stopMultiSelect,
16356
- multiSelect,
16357
- selectBlock
16358
- } = (0,external_wp_data_namespaceObject.useDispatch)(store);
16359
- const {
16360
- isSelectionEnabled,
16361
- isBlockSelected,
16362
- getBlockParents,
16363
- getBlockSelectionStart,
16364
- hasMultiSelection
16365
- } = (0,external_wp_data_namespaceObject.useSelect)(store);
16366
- return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
16367
- const {
16368
- ownerDocument
16369
- } = node;
16370
- const {
16371
- defaultView
16372
- } = ownerDocument;
16373
- let anchorElement;
16374
- let rafId;
16375
-
16376
- function onSelectionChange(_ref) {
16377
- let {
16378
- isSelectionEnd
16379
- } = _ref;
16380
- const selection = defaultView.getSelection(); // If no selection is found, end multi selection and disable the
16381
- // contentEditable wrapper.
16382
-
16383
- if (!selection.rangeCount || selection.isCollapsed) {
16384
- setContentEditableWrapper(node, false);
16385
- return;
16386
- }
16387
-
16388
- const endClientId = getBlockClientId(selection.focusNode);
16389
- const isSingularSelection = clientId === endClientId;
16390
-
16391
- if (isSingularSelection) {
16392
- selectBlock(clientId); // If the selection is complete (on mouse up), and no
16393
- // multiple blocks have been selected, set focus back to the
16394
- // anchor element. if the anchor element contains the
16395
- // selection. Additionally, the contentEditable wrapper can
16396
- // now be disabled again.
16397
-
16398
- if (isSelectionEnd) {
16399
- setContentEditableWrapper(node, false);
16400
-
16401
- if (selection.rangeCount) {
16402
- const {
16403
- commonAncestorContainer
16404
- } = selection.getRangeAt(0);
16405
-
16406
- if (anchorElement.contains(commonAncestorContainer)) {
16407
- anchorElement.focus();
16408
- }
16409
- }
16410
- }
16411
- } else {
16412
- const startPath = [...getBlockParents(clientId), clientId];
16413
- const endPath = [...getBlockParents(endClientId), endClientId];
16414
- const depth = Math.min(startPath.length, endPath.length) - 1;
16415
- multiSelect(startPath[depth], endPath[depth]);
16416
- }
16417
- }
16418
-
16419
- function onSelectionEnd() {
16420
- ownerDocument.removeEventListener('selectionchange', onSelectionChange); // Equivalent to attaching the listener once.
16421
-
16422
- defaultView.removeEventListener('mouseup', onSelectionEnd); // The browser selection won't have updated yet at this point,
16423
- // so wait until the next animation frame to get the browser
16424
- // selection.
16425
-
16426
- rafId = defaultView.requestAnimationFrame(() => {
16427
- onSelectionChange({
16428
- isSelectionEnd: true
16429
- });
16430
- stopMultiSelect();
16431
- });
16432
- }
16433
-
16434
- function onMouseLeave(_ref2) {
16435
- let {
16436
- buttons
16437
- } = _ref2;
16438
-
16439
- // The primary button must be pressed to initiate selection.
16440
- // See https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
16441
- if (buttons !== 1) {
16442
- return;
16443
- }
16444
-
16445
- if (!isSelectionEnabled() || !isBlockSelected(clientId)) {
16446
- return;
16447
- }
16448
-
16449
- anchorElement = ownerDocument.activeElement;
16450
- startMultiSelect(); // `onSelectionStart` is called after `mousedown` and
16451
- // `mouseleave` (from a block). The selection ends when
16452
- // `mouseup` happens anywhere in the window.
16453
-
16454
- ownerDocument.addEventListener('selectionchange', onSelectionChange);
16455
- defaultView.addEventListener('mouseup', onSelectionEnd); // Allow cross contentEditable selection by temporarily making
16456
- // all content editable. We can't rely on using the store and
16457
- // React because re-rending happens too slowly. We need to be
16458
- // able to select across instances immediately.
16459
-
16460
- setContentEditableWrapper(node, true);
16461
- }
16462
-
16463
- function onMouseDown(event) {
16464
- // The main button.
16465
- // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
16466
- if (!isSelectionEnabled() || event.button !== 0) {
16467
- return;
16468
- }
16469
-
16470
- if (event.shiftKey) {
16471
- const blockSelectionStart = getBlockSelectionStart(); // By checking `blockSelectionStart` to be set, we handle the
16472
- // case where we select a single block. We also have to check
16473
- // the selectionEnd (clientId) not to be included in the
16474
- // `blockSelectionStart`'s parents because the click event is
16475
- // propagated.
16476
-
16477
- const startParents = getBlockParents(blockSelectionStart);
16478
-
16479
- if (blockSelectionStart && blockSelectionStart !== clientId && !(startParents !== null && startParents !== void 0 && startParents.includes(clientId))) {
16480
- const startPath = [...startParents, blockSelectionStart];
16481
- const endPath = [...getBlockParents(clientId), clientId];
16482
- const depth = Math.min(startPath.length, endPath.length) - 1;
16483
- const start = startPath[depth];
16484
- const end = endPath[depth]; // Handle the case of having selected a parent block and
16485
- // then shift+click on a child.
16486
-
16487
- if (start !== end) {
16488
- setContentEditableWrapper(node, true);
16489
- multiSelect(start, end);
16490
- event.preventDefault();
16491
- }
16492
- }
16493
- } else if (hasMultiSelection()) {
16494
- // Allow user to escape out of a multi-selection to a
16495
- // singular selection of a block via click. This is handled
16496
- // here since focus handling excludes blocks when there is
16497
- // multiselection, as focus can be incurred by starting a
16498
- // multiselection (focus moved to first block's multi-
16499
- // controls).
16500
- selectBlock(clientId);
16501
- }
16502
- }
16503
-
16504
- node.addEventListener('mousedown', onMouseDown);
16505
- node.addEventListener('mouseleave', onMouseLeave);
16506
- return () => {
16507
- node.removeEventListener('mousedown', onMouseDown);
16508
- node.removeEventListener('mouseleave', onMouseLeave);
16509
- ownerDocument.removeEventListener('selectionchange', onSelectionChange);
16510
- defaultView.removeEventListener('mouseup', onSelectionEnd);
16511
- defaultView.cancelAnimationFrame(rafId);
16512
- };
16513
- }, [clientId, startMultiSelect, stopMultiSelect, multiSelect, selectBlock, isSelectionEnabled, isBlockSelected, getBlockParents]);
16514
- }
16515
-
16516
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-list/use-block-props/use-focus-first-element.js
16517
  /**
16518
  * External dependencies
@@ -16531,7 +17063,6 @@ function useMultiSelection(clientId) {
16531
 
16532
 
16533
 
16534
-
16535
  /** @typedef {import('@wordpress/element').RefObject} RefObject */
16536
 
16537
  /**
@@ -16547,7 +17078,6 @@ function useInitialPosition(clientId) {
16547
  return (0,external_wp_data_namespaceObject.useSelect)(select => {
16548
  const {
16549
  getSelectedBlocksInitialCaretPosition,
16550
- isMultiSelecting,
16551
  isNavigationMode,
16552
  isBlockSelected
16553
  } = select(store);
@@ -16556,7 +17086,7 @@ function useInitialPosition(clientId) {
16556
  return;
16557
  }
16558
 
16559
- if (isMultiSelecting() || isNavigationMode()) {
16560
  return;
16561
  } // If there's no initial position, return 0 to focus the start.
16562
 
@@ -16564,13 +17094,6 @@ function useInitialPosition(clientId) {
16564
  return getSelectedBlocksInitialCaretPosition();
16565
  }, [clientId]);
16566
  }
16567
-
16568
- function isFormElement(element) {
16569
- const {
16570
- tagName
16571
- } = element;
16572
- return tagName === 'INPUT' || tagName === 'BUTTON' || tagName === 'SELECT' || tagName === 'TEXTAREA';
16573
- }
16574
  /**
16575
  * Transitions focus to the block or inner tabbable when the block becomes
16576
  * selected and an initial position is set.
@@ -16584,7 +17107,16 @@ function isFormElement(element) {
16584
  function useFocusFirstElement(clientId) {
16585
  const ref = (0,external_wp_element_namespaceObject.useRef)();
16586
  const initialPosition = useInitialPosition(clientId);
 
 
 
 
16587
  (0,external_wp_element_namespaceObject.useEffect)(() => {
 
 
 
 
 
16588
  if (initialPosition === undefined || initialPosition === null) {
16589
  return;
16590
  }
@@ -16614,19 +17146,17 @@ function useFocusFirstElement(clientId) {
16614
  } // Check to see if element is focussable before a generic caret insert.
16615
 
16616
 
16617
- if (!target.getAttribute('contenteditable')) {
16618
- const focusElement = external_wp_dom_namespaceObject.focus.tabbable.findNext(target); // Make sure focusElement is valid, form field, and within the current target element.
16619
- // Ensure is not block inserter trigger, don't want to focus that in the event of the group block which doesn't contain any other focussable elements.
16620
 
16621
- if (focusElement && isFormElement(focusElement) && target.contains(focusElement) && !focusElement.classList.contains('block-editor-button-block-appender')) {
16622
  focusElement.focus();
16623
  return;
16624
  }
16625
  }
16626
 
16627
- setContentEditableWrapper(ref.current, false);
16628
  (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(target, isReverse);
16629
- }, [initialPosition]);
16630
  return ref;
16631
  }
16632
 
@@ -16907,8 +17437,14 @@ function useFocusHandler(clientId) {
16907
  * @param {FocusEvent} event Focus event.
16908
  */
16909
  function onFocus(event) {
16910
- // Check synchronously because a non-selected block might be
 
 
 
 
16911
  // getting data through `useSelect` asynchronously.
 
 
16912
  if (isBlockSelected(clientId)) {
16913
  // Potentially change selection away from rich text.
16914
  if (!event.target.isContentEditable) {
@@ -17075,73 +17611,6 @@ function useNavModeExit(clientId) {
17075
  }, [clientId, isNavigationMode, isBlockSelected, setNavigationMode]);
17076
  }
17077
 
17078
- // EXTERNAL MODULE: ./node_modules/dom-scroll-into-view/lib/index.js
17079
- var dom_scroll_into_view_lib = __webpack_require__(5425);
17080
- var lib_default = /*#__PURE__*/__webpack_require__.n(dom_scroll_into_view_lib);
17081
- ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-list/use-block-props/use-scroll-into-view.js
17082
- /**
17083
- * External dependencies
17084
- */
17085
-
17086
- /**
17087
- * WordPress dependencies
17088
- */
17089
-
17090
- /**
17091
- * WordPress dependencies
17092
- */
17093
-
17094
-
17095
-
17096
-
17097
- /**
17098
- * Internal dependencies
17099
- */
17100
-
17101
-
17102
- function useScrollIntoView(clientId) {
17103
- const ref = (0,external_wp_element_namespaceObject.useRef)();
17104
- const isSelectionEnd = (0,external_wp_data_namespaceObject.useSelect)(select => {
17105
- const {
17106
- isBlockSelected,
17107
- getBlockSelectionEnd
17108
- } = select(store);
17109
- return isBlockSelected(clientId) || getBlockSelectionEnd() === clientId;
17110
- }, [clientId]); // Note that we can't use `useRefEffect` here, since an element change does
17111
- // not mean we can scroll. `isSelectionEnd` should be the sole dependency,
17112
- // while with `useRefEffect`, the element is a dependency as well.
17113
-
17114
- (0,external_wp_element_namespaceObject.useEffect)(() => {
17115
- if (!isSelectionEnd) {
17116
- return;
17117
- }
17118
-
17119
- const extentNode = ref.current;
17120
-
17121
- if (!extentNode) {
17122
- return;
17123
- } // If the block is focused, the browser will already have scrolled into
17124
- // view if necessary.
17125
-
17126
-
17127
- if (extentNode.contains(extentNode.ownerDocument.activeElement)) {
17128
- return;
17129
- }
17130
-
17131
- 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
17132
- // and thus there's no need to try to scroll into view.
17133
-
17134
- if (!scrollContainer) {
17135
- return;
17136
- }
17137
-
17138
- lib_default()(extentNode, scrollContainer, {
17139
- onlyScrollIfNeeded: true
17140
- });
17141
- }, [isSelectionEnd]);
17142
- return ref;
17143
- }
17144
-
17145
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-list/use-block-props/use-intersection-observer.js
17146
  /**
17147
  * WordPress dependencies
@@ -17199,8 +17668,6 @@ function useIntersectionObserver() {
17199
 
17200
 
17201
 
17202
-
17203
-
17204
  /**
17205
  * If the block count exceeds the threshold, we disable the reordering animation
17206
  * to avoid laginess.
@@ -17274,8 +17741,7 @@ function useBlockProps() {
17274
 
17275
  const blockLabel = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Block: %s'), blockTitle);
17276
  const htmlSuffix = mode === 'html' && !__unstableIsHtml ? '-visual' : '';
17277
- const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([props.ref, useFocusFirstElement(clientId), // Must happen after focus because we check for focus in the block.
17278
- useScrollIntoView(clientId), useBlockRefProvider(clientId), useFocusHandler(clientId), useMultiSelection(clientId), useEventHandlers(clientId), useNavModeExit(clientId), useIsHovered(), useIntersectionObserver(), use_moving_animation({
17279
  isSelected: isPartOfSelection,
17280
  adjustScrolling,
17281
  enableAnimation,
@@ -17743,6 +18209,10 @@ function BlockIcon(_ref) {
17743
  })
17744
  }, renderedIcon);
17745
  }
 
 
 
 
17746
 
17747
  /* harmony default export */ var block_icon = ((0,external_wp_element_namespaceObject.memo)(BlockIcon));
17748
 
@@ -18228,28 +18698,6 @@ function BlockSelectionClearer(props) {
18228
 
18229
 
18230
 
18231
- /**
18232
- * Returns for the deepest node at the start or end of a container node. Ignores
18233
- * any text nodes that only contain HTML formatting whitespace.
18234
- *
18235
- * @param {Element} node Container to search.
18236
- * @param {string} type 'start' or 'end'.
18237
- */
18238
-
18239
- function getDeepestNode(node, type) {
18240
- const child = type === 'start' ? 'firstChild' : 'lastChild';
18241
- const sibling = type === 'start' ? 'nextSibling' : 'previousSibling';
18242
-
18243
- while (node[child]) {
18244
- node = node[child];
18245
-
18246
- while (node.nodeType === node.TEXT_NODE && /^[ \t\n]*$/.test(node.data) && node[sibling]) {
18247
- node = node[sibling];
18248
- }
18249
- }
18250
-
18251
- return node;
18252
- }
18253
 
18254
  function selector(select) {
18255
  const {
@@ -18257,24 +18705,27 @@ function selector(select) {
18257
  getMultiSelectedBlockClientIds,
18258
  hasMultiSelection,
18259
  getSelectedBlockClientId,
18260
- getSelectedBlocksInitialCaretPosition
 
18261
  } = select(store);
18262
  return {
18263
  isMultiSelecting: isMultiSelecting(),
18264
  multiSelectedBlockClientIds: getMultiSelectedBlockClientIds(),
18265
  hasMultiSelection: hasMultiSelection(),
18266
  selectedBlockClientId: getSelectedBlockClientId(),
18267
- initialPosition: getSelectedBlocksInitialCaretPosition()
 
18268
  };
18269
  }
18270
 
18271
- function use_multi_selection_useMultiSelection() {
18272
  const {
18273
  initialPosition,
18274
  isMultiSelecting,
18275
  multiSelectedBlockClientIds,
18276
  hasMultiSelection,
18277
- selectedBlockClientId
 
18278
  } = (0,external_wp_data_namespaceObject.useSelect)(selector, []);
18279
  const selectedRef = useBlockRef(selectedBlockClientId); // These must be in the right DOM order.
18280
 
@@ -18327,11 +18778,9 @@ function use_multi_selection_useMultiSelection() {
18327
 
18328
  if (length < 2) {
18329
  return;
18330
- } // The block refs might not be immediately available
18331
- // when dragging blocks into another block.
18332
-
18333
 
18334
- if (!startRef.current || !endRef.current) {
18335
  return;
18336
  } // Allow cross contentEditable selection by temporarily making
18337
  // all content editable. We can't rely on using the store and
@@ -18342,19 +18791,21 @@ function use_multi_selection_useMultiSelection() {
18342
  node.contentEditable = true; // For some browsers, like Safari, it is important that focus happens
18343
  // BEFORE selection.
18344
 
18345
- node.focus();
 
 
 
 
 
 
18346
  const selection = defaultView.getSelection();
18347
  const range = ownerDocument.createRange(); // These must be in the right DOM order.
18348
- // The most stable way to select the whole block contents is to start
18349
- // and end at the deepest points.
18350
 
18351
- const startNode = getDeepestNode(startRef.current, 'start');
18352
- const endNode = getDeepestNode(endRef.current, 'end');
18353
- range.setStartBefore(startNode);
18354
- range.setEndAfter(endNode);
18355
  selection.removeAllRanges();
18356
  selection.addRange(range);
18357
- }, [hasMultiSelection, isMultiSelecting, multiSelectedBlockClientIds, selectedBlockClientId, initialPosition]);
18358
  }
18359
 
18360
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/writing-flow/use-tab-nav.js
@@ -18373,14 +18824,6 @@ function use_multi_selection_useMultiSelection() {
18373
  */
18374
 
18375
 
18376
-
18377
- function use_tab_nav_isFormElement(element) {
18378
- const {
18379
- tagName
18380
- } = element;
18381
- return tagName === 'INPUT' || tagName === 'BUTTON' || tagName === 'SELECT' || tagName === 'TEXTAREA';
18382
- }
18383
-
18384
  function useTabNav() {
18385
  const container = (0,external_wp_element_namespaceObject.useRef)();
18386
  const focusCaptureBeforeRef = (0,external_wp_element_namespaceObject.useRef)();
@@ -18470,7 +18913,7 @@ function useTabNav() {
18470
  // future they can be rendered in an iframe or shadow DOM.
18471
 
18472
 
18473
- if ((use_tab_nav_isFormElement(event.target) || event.target.getAttribute('data-block') === getSelectedBlockClientId()) && use_tab_nav_isFormElement(external_wp_dom_namespaceObject.focus.tabbable[direction](event.target))) {
18474
  return;
18475
  }
18476
 
@@ -18657,19 +19100,12 @@ function getClosestTabbable(target, isReverse, containerElement, onlyVertical) {
18657
  function useArrowNav() {
18658
  const {
18659
  getSelectedBlockClientId,
18660
- getMultiSelectedBlocksStartClientId,
18661
  getMultiSelectedBlocksEndClientId,
18662
  getPreviousBlockClientId,
18663
  getNextBlockClientId,
18664
- getFirstMultiSelectedBlockClientId,
18665
- getLastMultiSelectedBlockClientId,
18666
  getSettings,
18667
  hasMultiSelection
18668
  } = (0,external_wp_data_namespaceObject.useSelect)(store);
18669
- const {
18670
- multiSelect,
18671
- selectBlock
18672
- } = (0,external_wp_data_namespaceObject.useDispatch)(store);
18673
  return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
18674
  // Here a DOMRect is stored while moving the caret vertically so
18675
  // vertical position of the start position can be restored. This is to
@@ -18679,33 +19115,6 @@ function useArrowNav() {
18679
  function onMouseDown() {
18680
  verticalRect = null;
18681
  }
18682
-
18683
- function expandSelection(isReverse) {
18684
- const selectedBlockClientId = getSelectedBlockClientId();
18685
- const selectionStartClientId = getMultiSelectedBlocksStartClientId();
18686
- const selectionEndClientId = getMultiSelectedBlocksEndClientId();
18687
- const selectionBeforeEndClientId = getPreviousBlockClientId(selectionEndClientId || selectedBlockClientId);
18688
- const selectionAfterEndClientId = getNextBlockClientId(selectionEndClientId || selectedBlockClientId);
18689
- const nextSelectionEndClientId = isReverse ? selectionBeforeEndClientId : selectionAfterEndClientId;
18690
-
18691
- if (nextSelectionEndClientId) {
18692
- if (selectionStartClientId === nextSelectionEndClientId) {
18693
- selectBlock(nextSelectionEndClientId);
18694
- } else {
18695
- multiSelect(selectionStartClientId || selectedBlockClientId, nextSelectionEndClientId);
18696
- }
18697
- }
18698
- }
18699
-
18700
- function moveSelection(isReverse) {
18701
- const selectedFirstClientId = getFirstMultiSelectedBlockClientId();
18702
- const selectedLastClientId = getLastMultiSelectedBlockClientId();
18703
- const focusedBlockClientId = isReverse ? selectedFirstClientId : selectedLastClientId;
18704
-
18705
- if (focusedBlockClientId) {
18706
- selectBlock(focusedBlockClientId);
18707
- }
18708
- }
18709
  /**
18710
  * Returns true if the given target field is the last in its block which
18711
  * can be considered for tab transition. For example, in a block with
@@ -18748,12 +19157,6 @@ function useArrowNav() {
18748
  } = ownerDocument;
18749
 
18750
  if (hasMultiSelection()) {
18751
- if (isNav) {
18752
- const action = isShift ? expandSelection : moveSelection;
18753
- action(isReverse);
18754
- event.preventDefault();
18755
- }
18756
-
18757
  return;
18758
  } // When presing any key other than up or down, the initial vertical
18759
  // position must ALWAYS be reset. The vertical position is saved so
@@ -18801,10 +19204,9 @@ function useArrowNav() {
18801
 
18802
  if ( // Ensure that there is a target block.
18803
  (isReverse && selectionBeforeEndClientId || !isReverse && selectionAfterEndClientId) && isTabbableEdge(target, isReverse) && isNavEdge(target, isReverse)) {
18804
- // Shift key is down, and there is multi selection or we're
18805
- // at the end of the current block.
18806
- expandSelection(isReverse);
18807
- event.preventDefault();
18808
  }
18809
  } else if (isVertical && (0,external_wp_dom_namespaceObject.isVerticalEdge)(target, isReverse) && !keepCaretInsideBlock) {
18810
  const closestTabbable = getClosestTabbable(target, isReverse, node, true);
@@ -18898,6 +19300,445 @@ function useSelectAll() {
18898
  }, []);
18899
  }
18900
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18901
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/writing-flow/index.js
18902
 
18903
 
@@ -18923,10 +19764,14 @@ function useSelectAll() {
18923
 
18924
 
18925
 
 
 
 
 
18926
  function useWritingFlow() {
18927
  const [before, ref, after] = useTabNav();
18928
  const hasMultiSelection = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).hasMultiSelection(), []);
18929
- return [before, (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, use_multi_selection_useMultiSelection(), useSelectAll(), useArrowNav(), (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
18930
  node.tabIndex = -1;
18931
  node.contentEditable = hasMultiSelection;
18932
 
@@ -19176,16 +20021,11 @@ function Iframe(_ref3, ref) {
19176
  documentElement.removeChild(contentDocument.head);
19177
  documentElement.removeChild(contentDocument.body);
19178
  return true;
19179
- }
19180
-
19181
- if (setDocumentIfReady()) {
19182
- return;
19183
- } // Document is not immediately loaded in Firefox.
19184
 
19185
 
19186
- node.addEventListener('load', () => {
19187
- setDocumentIfReady();
19188
- });
19189
  }, []);
19190
  const headRef = (0,external_wp_compose_namespaceObject.useRefEffect)(element => {
19191
  scripts.reduce((promise, script) => promise.then(() => loadScript(element, script)), Promise.resolve()).finally(() => {
@@ -19228,7 +20068,9 @@ function Iframe(_ref3, ref) {
19228
  }), head);
19229
  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, {
19230
  ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, setRef]),
19231
- tabIndex: tabIndex,
 
 
19232
  title: (0,external_wp_i18n_namespaceObject.__)('Editor canvas')
19233
  }), 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", {
19234
  ref: headRef
@@ -20767,7 +21609,8 @@ const MAX_HEIGHT = 2000;
20767
  function AutoBlockPreview(_ref) {
20768
  let {
20769
  viewportWidth,
20770
- __experimentalPadding
 
20771
  } = _ref;
20772
  const [containerResizeListener, {
20773
  width: containerWidth
@@ -20806,7 +21649,8 @@ function AutoBlockPreview(_ref) {
20806
  style: {
20807
  transform: `scale(${scale})`,
20808
  height: contentHeight * scale,
20809
- maxHeight: contentHeight > MAX_HEIGHT ? MAX_HEIGHT * scale : undefined
 
20810
  }
20811
  }, (0,external_wp_element_namespaceObject.createElement)(iframe, {
20812
  head: (0,external_wp_element_namespaceObject.createElement)(EditorStyles, {
@@ -20835,7 +21679,8 @@ function AutoBlockPreview(_ref) {
20835
  pointerEvents: 'none',
20836
  // This is a catch-all max-height for patterns.
20837
  // See: https://github.com/WordPress/gutenberg/pull/38175.
20838
- maxHeight: MAX_HEIGHT
 
20839
  }
20840
  }, contentResizeListener, (0,external_wp_element_namespaceObject.createElement)(MemoizedBlockList, {
20841
  renderAppender: false
@@ -20874,7 +21719,8 @@ function BlockPreview(_ref) {
20874
  __experimentalPadding = 0,
20875
  viewportWidth = 1200,
20876
  __experimentalLive = false,
20877
- __experimentalOnClick
 
20878
  } = _ref;
20879
  const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings(), []);
20880
  const settings = (0,external_wp_element_namespaceObject.useMemo)(() => {
@@ -20896,7 +21742,8 @@ function BlockPreview(_ref) {
20896
  onClick: __experimentalOnClick
20897
  }) : (0,external_wp_element_namespaceObject.createElement)(auto, {
20898
  viewportWidth: viewportWidth,
20899
- __experimentalPadding: __experimentalPadding
 
20900
  }));
20901
  }
20902
  /**
@@ -23796,7 +24643,12 @@ function BlockListAppender(_ref) {
23796
  // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
23797
  , {
23798
  tabIndex: -1,
23799
- className: classnames_default()('block-list-appender wp-block', className) // The appender exists to let you add the first Paragraph before
 
 
 
 
 
23800
  // any is inserted. To that end, this appender should visually be
23801
  // presented as a block. That means theme CSS should style it as if
23802
  // it were an empty paragraph block. That means a `wp-block` class to
@@ -24494,7 +25346,7 @@ function useBlockDisplayInformation(clientId) {
24494
  * useBlockDisplayTitle( 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1', 17 );
24495
  * ```
24496
  *
24497
- * @param {string} clientId Client ID of block.
24498
  * @param {number|undefined} maximumLength The maximum length that the block title string may be before truncated.
24499
  * @return {?string} Block title.
24500
  */
@@ -24565,8 +25417,8 @@ function useBlockDisplayTitle(clientId, maximumLength) {
24565
  * <BlockTitle clientId="afd1cb17-2c08-4e7a-91be-007ba7ddc3a1" maximumLength={ 17 }/>
24566
  * ```
24567
  *
24568
- * @param {Object} props
24569
- * @param {string} props.clientId Client ID of block.
24570
  * @param {number|undefined} props.maximumLength The maximum length that the block title string may be before truncated.
24571
  *
24572
  * @return {JSX.Element} Block title.
@@ -24698,16 +25550,15 @@ const BlockDraggable = _ref => {
24698
  var _getBlockType;
24699
 
24700
  const {
 
24701
  getBlockRootClientId,
24702
- getTemplateLock,
24703
  getBlockName
24704
  } = select(store);
24705
  const rootClientId = getBlockRootClientId(clientIds[0]);
24706
- const templateLock = rootClientId ? getTemplateLock(rootClientId) : null;
24707
  const blockName = getBlockName(clientIds[0]);
24708
  return {
24709
  srcRootClientId: rootClientId,
24710
- isDraggable: 'all' !== templateLock,
24711
  icon: (_getBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.icon
24712
  };
24713
  }, [clientIds]);
@@ -25644,6 +26495,10 @@ function BlockMover(_ref) {
25644
  clientIds: clientIds
25645
  }, itemProps)))));
25646
  }
 
 
 
 
25647
 
25648
  /* harmony default export */ var block_mover = ((0,external_wp_data_namespaceObject.withSelect)((select, _ref2) => {
25649
  var _getBlockListSettings;
@@ -25956,20 +26811,20 @@ function BlockParentSelector() {
25956
  }));
25957
  }
25958
 
25959
- ;// CONCATENATED MODULE: ./packages/icons/build-module/library/stack.js
25960
 
25961
 
25962
  /**
25963
  * WordPress dependencies
25964
  */
25965
 
25966
- const stack = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
25967
  xmlns: "http://www.w3.org/2000/svg",
25968
  viewBox: "0 0 24 24"
25969
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
25970
  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"
25971
  }));
25972
- /* harmony default export */ var library_stack = (stack);
25973
 
25974
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-switcher/preview-block-popover.js
25975
 
@@ -26714,7 +27569,7 @@ const BlockSwitcherDropdownMenu = _ref => {
26714
  })).length === 1; // When selection consists of blocks of multiple types, display an
26715
  // appropriate icon to communicate the non-uniformity.
26716
 
26717
- _icon = isSelectionOfSameType ? (_getBlockType = getBlockType(firstBlockName)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.icon : library_stack;
26718
  }
26719
 
26720
  return {
@@ -26742,10 +27597,15 @@ const BlockSwitcherDropdownMenu = _ref => {
26742
  disabled: true,
26743
  className: "block-editor-block-switcher__no-switcher-icon",
26744
  title: blockTitle,
26745
- icon: (0,external_wp_element_namespaceObject.createElement)(block_icon, {
26746
  icon: icon,
26747
  showColors: true
26748
- })
 
 
 
 
 
26749
  }));
26750
  }
26751
 
@@ -26825,6 +27685,18 @@ const BlockSwitcher = _ref4 => {
26825
  };
26826
  /* harmony default export */ var block_switcher = (BlockSwitcher);
26827
 
 
 
 
 
 
 
 
 
 
 
 
 
26828
  ;// CONCATENATED MODULE: ./packages/icons/build-module/library/more-vertical.js
26829
 
26830
 
@@ -26979,12 +27851,17 @@ function useClipboardHandler() {
26979
  getBlocksByClientId,
26980
  getSelectedBlockClientIds,
26981
  hasMultiSelection,
26982
- getSettings
 
 
 
26983
  } = (0,external_wp_data_namespaceObject.useSelect)(store);
26984
  const {
26985
  flashBlock,
26986
  removeBlocks,
26987
- replaceBlocks
 
 
26988
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
26989
  const notifyCopy = useNotifyCopy();
26990
  return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
@@ -27019,20 +27896,49 @@ function useClipboardHandler() {
27019
  const eventDefaultPrevented = event.defaultPrevented;
27020
  event.preventDefault();
27021
 
 
 
 
 
 
 
27022
  if (event.type === 'copy' || event.type === 'cut') {
27023
  if (selectedBlockClientIds.length === 1) {
27024
  flashBlock(selectedBlockClientIds[0]);
27025
- }
 
27026
 
27027
- notifyCopy(event.type, selectedBlockClientIds);
27028
- const blocks = getBlocksByClientId(selectedBlockClientIds);
27029
- const serialized = (0,external_wp_blocks_namespaceObject.serialize)(blocks);
27030
- event.clipboardData.setData('text/plain', serialized);
27031
- event.clipboardData.setData('text/html', serialized);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27032
  }
27033
 
27034
  if (event.type === 'cut') {
27035
- removeBlocks(selectedBlockClientIds);
 
 
 
 
 
 
 
27036
  } else if (event.type === 'paste') {
27037
  if (eventDefaultPrevented) {
27038
  // This was likely already handled in rich-text/use-paste-handler.js.
@@ -27075,6 +27981,10 @@ function CopyHandler(_ref) {
27075
  ref: useClipboardHandler()
27076
  }, children);
27077
  }
 
 
 
 
27078
 
27079
  /* harmony default export */ var copy_handler = (CopyHandler);
27080
 
@@ -27367,6 +28277,7 @@ __unstableBlockSettingsMenuFirstItem.Slot = block_settings_menu_first_item_Slot;
27367
 
27368
 
27369
 
 
27370
  function ConvertToGroupButton(_ref) {
27371
  let {
27372
  clientIds,
@@ -27533,20 +28444,50 @@ const lock = (0,external_wp_element_namespaceObject.createElement)(external_wp_p
27533
  }));
27534
  /* harmony default export */ var library_lock = (lock);
27535
 
27536
- ;// CONCATENATED MODULE: ./packages/icons/build-module/library/trash.js
 
 
 
 
 
 
 
27537
 
27538
 
27539
  /**
27540
- * WordPress dependencies
 
 
 
 
 
 
27541
  */
27542
 
27543
- const trash = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
27544
- xmlns: "http://www.w3.org/2000/svg",
27545
- viewBox: "0 0 24 24"
27546
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
27547
- d: "M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z"
27548
- }));
27549
- /* harmony default export */ var library_trash = (trash);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27550
 
27551
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-lock/modal.js
27552
 
@@ -27560,12 +28501,14 @@ const trash = (0,external_wp_element_namespaceObject.createElement)(external_wp_
27560
 
27561
 
27562
 
 
27563
  /**
27564
  * Internal dependencies
27565
  */
27566
 
27567
 
27568
 
 
27569
  function BlockLockModal(_ref) {
27570
  let {
27571
  clientId,
@@ -27576,18 +28519,19 @@ function BlockLockModal(_ref) {
27576
  remove: false
27577
  });
27578
  const {
 
27579
  canMove,
27580
  canRemove
 
 
 
27581
  } = (0,external_wp_data_namespaceObject.useSelect)(select => {
27582
  const {
27583
- canMoveBlock,
27584
- canRemoveBlock,
27585
- getBlockRootClientId
27586
  } = select(store);
27587
- const rootClientId = getBlockRootClientId(clientId);
27588
  return {
27589
- canMove: canMoveBlock(clientId, rootClientId),
27590
- canRemove: canRemoveBlock(clientId, rootClientId)
27591
  };
27592
  }, [clientId]);
27593
  const {
@@ -27598,20 +28542,14 @@ function BlockLockModal(_ref) {
27598
  (0,external_wp_element_namespaceObject.useEffect)(() => {
27599
  setLock({
27600
  move: !canMove,
27601
- remove: !canRemove
 
 
 
27602
  });
27603
- }, [canMove, canRemove]);
27604
  const isAllChecked = Object.values(lock).every(Boolean);
27605
- let ariaChecked;
27606
-
27607
- if (isAllChecked) {
27608
- ariaChecked = 'true';
27609
- } else if (Object.values(lock).some(Boolean)) {
27610
- ariaChecked = 'mixed';
27611
- } else {
27612
- ariaChecked = 'false';
27613
- }
27614
-
27615
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
27616
  title: (0,external_wp_i18n_namespaceObject.sprintf)(
27617
  /* translators: %s: Name of the block. */
@@ -27637,18 +28575,31 @@ function BlockLockModal(_ref) {
27637
  id: instanceId
27638
  }, (0,external_wp_i18n_namespaceObject.__)('Lock all')),
27639
  checked: isAllChecked,
27640
- "aria-checked": ariaChecked,
27641
  onChange: newValue => setLock({
27642
  move: newValue,
27643
- remove: newValue
 
 
 
27644
  })
27645
  }), (0,external_wp_element_namespaceObject.createElement)("ul", {
27646
  className: "block-editor-block-lock-modal__checklist"
27647
- }, (0,external_wp_element_namespaceObject.createElement)("li", {
 
 
 
 
 
 
 
 
 
 
27648
  className: "block-editor-block-lock-modal__checklist-item"
27649
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
27650
  label: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_i18n_namespaceObject.__)('Disable movement'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
27651
- icon: drag_handle
27652
  })),
27653
  checked: lock.move,
27654
  onChange: move => setLock(prevLock => ({ ...prevLock,
@@ -27658,7 +28609,7 @@ function BlockLockModal(_ref) {
27658
  className: "block-editor-block-lock-modal__checklist-item"
27659
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
27660
  label: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_i18n_namespaceObject.__)('Prevent removal'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
27661
- icon: library_trash
27662
  })),
27663
  checked: lock.remove,
27664
  onChange: remove => setLock(prevLock => ({ ...prevLock,
@@ -27687,7 +28638,6 @@ function BlockLockModal(_ref) {
27687
 
27688
 
27689
 
27690
-
27691
  /**
27692
  * Internal dependencies
27693
  */
@@ -27699,25 +28649,12 @@ function BlockLockMenuItem(_ref) {
27699
  clientId
27700
  } = _ref;
27701
  const {
27702
- canLockBlock,
27703
  isLocked
27704
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
27705
- const {
27706
- canMoveBlock,
27707
- canRemoveBlock,
27708
- canLockBlockType,
27709
- getBlockName,
27710
- getBlockRootClientId
27711
- } = select(store);
27712
- const rootClientId = getBlockRootClientId(clientId);
27713
- return {
27714
- canLockBlock: canLockBlockType(getBlockName(clientId)),
27715
- isLocked: !canMoveBlock(clientId, rootClientId) || !canRemoveBlock(clientId, rootClientId)
27716
- };
27717
- }, [clientId]);
27718
  const [isModalOpen, toggleModal] = (0,external_wp_element_namespaceObject.useReducer)(isActive => !isActive, false);
27719
 
27720
- if (!canLockBlock) {
27721
  return null;
27722
  }
27723
 
@@ -27855,6 +28792,8 @@ BlockSettingsMenuControls.Slot = BlockSettingsMenuControlsSlot;
27855
 
27856
 
27857
 
 
 
27858
  const block_settings_dropdown_POPOVER_PROPS = {
27859
  className: 'block-editor-block-settings-menu__popover',
27860
  position: 'bottom right',
@@ -27883,19 +28822,31 @@ function BlockSettingsDropdown(_ref2) {
27883
  const count = blockClientIds.length;
27884
  const firstBlockClientId = blockClientIds[0];
27885
  const {
 
 
27886
  onlyBlock,
 
27887
  previousBlockClientId,
27888
  nextBlockClientId,
27889
  selectedBlockClientIds
27890
  } = (0,external_wp_data_namespaceObject.useSelect)(select => {
27891
  const {
27892
  getBlockCount,
 
 
27893
  getPreviousBlockClientId,
27894
  getNextBlockClientId,
27895
- getSelectedBlockClientIds
 
27896
  } = select(store);
 
 
 
27897
  return {
 
 
27898
  onlyBlock: 1 === getBlockCount(),
 
27899
  previousBlockClientId: getPreviousBlockClientId(firstBlockClientId),
27900
  nextBlockClientId: getNextBlockClientId(firstBlockClientId),
27901
  selectedBlockClientIds: getSelectedBlockClientIds()
@@ -27912,6 +28863,10 @@ function BlockSettingsDropdown(_ref2) {
27912
  insertBefore: getShortcutRepresentation('core/block-editor/insert-before')
27913
  };
27914
  }, []);
 
 
 
 
27915
  const updateSelectionAfterDuplicate = (0,external_wp_element_namespaceObject.useCallback)(__experimentalSelectBlock ? async clientIdsPromise => {
27916
  const ids = await clientIdsPromise;
27917
 
@@ -27934,7 +28889,24 @@ function BlockSettingsDropdown(_ref2) {
27934
  const label = (0,external_wp_i18n_namespaceObject.sprintf)(
27935
  /* translators: %s: block name */
27936
  (0,external_wp_i18n_namespaceObject.__)('Remove %s'), blockTitle);
27937
- const removeBlockLabel = count === 1 ? label : (0,external_wp_i18n_namespaceObject.__)('Remove blocks');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27938
  return (0,external_wp_element_namespaceObject.createElement)(BlockActions, {
27939
  clientIds: clientIds,
27940
  __experimentalUpdateSelection: !__experimentalSelectBlock
@@ -27966,7 +28938,15 @@ function BlockSettingsDropdown(_ref2) {
27966
  fillProps: {
27967
  onClose
27968
  }
27969
- }), count === 1 && (0,external_wp_element_namespaceObject.createElement)(block_html_convert_button, {
 
 
 
 
 
 
 
 
27970
  clientId: firstBlockClientId
27971
  }), (0,external_wp_element_namespaceObject.createElement)(CopyMenuItem, {
27972
  blocks: blocks,
@@ -28038,7 +29018,6 @@ function BlockSettingsMenu(_ref) {
28038
 
28039
 
28040
 
28041
-
28042
  /**
28043
  * Internal dependencies
28044
  */
@@ -28052,29 +29031,18 @@ function BlockLockToolbar(_ref) {
28052
  } = _ref;
28053
  const blockInformation = useBlockDisplayInformation(clientId);
28054
  const {
 
28055
  canMove,
28056
  canRemove,
28057
- canLockBlock
28058
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
28059
- const {
28060
- canLockBlockType,
28061
- getBlockName,
28062
- canMoveBlock,
28063
- canRemoveBlock
28064
- } = select(store);
28065
- return {
28066
- canMove: canMoveBlock(clientId),
28067
- canRemove: canRemoveBlock(clientId),
28068
- canLockBlock: canLockBlockType(getBlockName(clientId))
28069
- };
28070
- }, [clientId]);
28071
  const [isModalOpen, toggleModal] = (0,external_wp_element_namespaceObject.useReducer)(isActive => !isActive, false);
28072
 
28073
- if (!canLockBlock) {
28074
  return null;
28075
  }
28076
 
28077
- if (canMove && canRemove) {
28078
  return null;
28079
  }
28080
 
@@ -28092,6 +29060,152 @@ function BlockLockToolbar(_ref) {
28092
  }));
28093
  }
28094
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28095
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-toolbar/index.js
28096
 
28097
 
@@ -28121,7 +29235,11 @@ function BlockLockToolbar(_ref) {
28121
 
28122
 
28123
 
28124
- function BlockToolbar(_ref) {
 
 
 
 
28125
  let {
28126
  hideDragHandle
28127
  } = _ref;
@@ -28212,7 +29330,7 @@ function BlockToolbar(_ref) {
28212
  }), (0,external_wp_element_namespaceObject.createElement)(block_mover, {
28213
  clientIds: blockClientIds,
28214
  hideDragHandle: hideDragHandle || hasReducedUI
28215
- }))), shouldShowVisualToolbar && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(block_controls.Slot, {
28216
  group: "parent",
28217
  className: "block-editor-block-toolbar__slot"
28218
  }), (0,external_wp_element_namespaceObject.createElement)(block_controls.Slot, {
@@ -28226,10 +29344,18 @@ function BlockToolbar(_ref) {
28226
  }), (0,external_wp_element_namespaceObject.createElement)(block_controls.Slot, {
28227
  group: "other",
28228
  className: "block-editor-block-toolbar__slot"
28229
- })), (0,external_wp_element_namespaceObject.createElement)(block_settings_menu, {
 
 
28230
  clientIds: blockClientIds
28231
  }));
28232
- }
 
 
 
 
 
 
28233
 
28234
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-tools/block-contextual-toolbar.js
28235
 
@@ -28303,7 +29429,7 @@ function BlockContextualToolbar(_ref) {
28303
  /* translators: accessibility text for the block toolbar */
28304
  ,
28305
  "aria-label": (0,external_wp_i18n_namespaceObject.__)('Block tools')
28306
- }, props), (0,external_wp_element_namespaceObject.createElement)(BlockToolbar, {
28307
  hideDragHandle: isFixed
28308
  }));
28309
  }
@@ -30253,7 +31379,7 @@ function addAttributes(settings) {
30253
  function border_color_addSaveProps(props, blockType, attributes) {
30254
  var _style$border2;
30255
 
30256
- if (!hasBorderSupport(blockType, 'color') || shouldSkipSerialization(blockType)) {
30257
  return props;
30258
  }
30259
 
@@ -30282,7 +31408,7 @@ function border_color_addSaveProps(props, blockType, attributes) {
30282
 
30283
 
30284
  function addEditProps(settings) {
30285
- if (!hasBorderSupport(settings, 'color') || shouldSkipSerialization(settings)) {
30286
  return settings;
30287
  }
30288
 
@@ -30322,7 +31448,7 @@ const withBorderColorPaletteStyles = (0,external_wp_compose_namespaceObject.crea
30322
  } = attributes;
30323
  const colors = useSetting('color.palette') || border_color_EMPTY_ARRAY;
30324
 
30325
- if (!hasBorderSupport(name, 'color') || shouldSkipSerialization(name)) {
30326
  return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, props);
30327
  }
30328
 
@@ -31231,18 +32357,6 @@ function hasBorderSupport(blockName) {
31231
 
31232
  return !!(support !== null && support !== void 0 && support[feature]);
31233
  }
31234
- /**
31235
- * Check whether serialization of border classes and styles should be skipped.
31236
- *
31237
- * @param {string|Object} blockType Block name or block type object.
31238
- *
31239
- * @return {boolean} Whether serialization of border properties should occur.
31240
- */
31241
-
31242
- function shouldSkipSerialization(blockType) {
31243
- const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, BORDER_SUPPORT_KEY);
31244
- return support === null || support === void 0 ? void 0 : support.__experimentalSkipSerialization;
31245
- }
31246
  /**
31247
  * Returns a new style object where the specified border attribute has been
31248
  * removed.
@@ -31489,6 +32603,10 @@ function ContrastChecker(_ref) {
31489
  isDismissible: false
31490
  }, message));
31491
  }
 
 
 
 
31492
 
31493
  /* harmony default export */ var contrast_checker = (ContrastChecker);
31494
 
@@ -31676,11 +32794,6 @@ const hasColorSupport = blockType => {
31676
  return colorSupport && (colorSupport.link === true || colorSupport.gradient === true || colorSupport.background !== false || colorSupport.text !== false);
31677
  };
31678
 
31679
- const color_shouldSkipSerialization = blockType => {
31680
- const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY);
31681
- return colorSupport === null || colorSupport === void 0 ? void 0 : colorSupport.__experimentalSkipSerialization;
31682
- };
31683
-
31684
  const hasLinkColorSupport = blockType => {
31685
  if (external_wp_element_namespaceObject.Platform.OS !== 'web') {
31686
  return false;
@@ -31897,7 +33010,7 @@ function color_addAttributes(settings) {
31897
  function color_addSaveProps(props, blockType, attributes) {
31898
  var _style$color, _style$color2, _style$color3, _style$color4, _style$elements, _style$elements$link;
31899
 
31900
- if (!hasColorSupport(blockType) || color_shouldSkipSerialization(blockType)) {
31901
  return props;
31902
  }
31903
 
@@ -31909,17 +33022,23 @@ function color_addSaveProps(props, blockType, attributes) {
31909
  gradient,
31910
  style
31911
  } = attributes;
31912
- const backgroundClass = getColorClassName('background-color', backgroundColor);
31913
 
31914
- const gradientClass = __experimentalGetGradientClass(gradient);
 
 
31915
 
31916
- const textClass = getColorClassName('color', textColor);
 
 
 
 
 
31917
  const newClassName = classnames_default()(props.className, textClass, gradientClass, {
31918
  // Don't apply the background class if there's a custom gradient.
31919
- [backgroundClass]: (!hasGradient || !(style !== null && style !== void 0 && (_style$color = style.color) !== null && _style$color !== void 0 && _style$color.gradient)) && !!backgroundClass,
31920
- '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),
31921
- '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)),
31922
- '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
31923
  });
31924
  props.className = newClassName ? newClassName : undefined;
31925
  return props;
@@ -31934,7 +33053,7 @@ function color_addSaveProps(props, blockType, attributes) {
31934
  */
31935
 
31936
  function color_addEditProps(settings) {
31937
- if (!hasColorSupport(settings) || color_shouldSkipSerialization(settings)) {
31938
  return settings;
31939
  }
31940
 
@@ -32161,19 +33280,19 @@ const withColorPaletteStyles = (0,external_wp_compose_namespaceObject.createHigh
32161
  const defaultPalette = useSetting('color.palette.default') || [];
32162
  const colors = (0,external_wp_element_namespaceObject.useMemo)(() => [...(userPalette || []), ...(themePalette || []), ...(defaultPalette || [])], [userPalette, themePalette, defaultPalette]);
32163
 
32164
- if (!hasColorSupport(name) || color_shouldSkipSerialization(name)) {
32165
  return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, props);
32166
  }
32167
 
32168
  const extraStyles = {};
32169
 
32170
- if (textColor) {
32171
  var _getColorObjectByAttr;
32172
 
32173
  extraStyles.color = (_getColorObjectByAttr = getColorObjectByAttributeValues(colors, textColor)) === null || _getColorObjectByAttr === void 0 ? void 0 : _getColorObjectByAttr.color;
32174
  }
32175
 
32176
- if (backgroundColor) {
32177
  var _getColorObjectByAttr2;
32178
 
32179
  extraStyles.backgroundColor = (_getColorObjectByAttr2 = getColorObjectByAttributeValues(colors, backgroundColor)) === null || _getColorObjectByAttr2 === void 0 ? void 0 : _getColorObjectByAttr2.color;
@@ -32459,7 +33578,8 @@ function isLineHeightDefined(lineHeight) {
32459
  */
32460
 
32461
 
32462
- function LineHeightControl(_ref) {
 
32463
  let {
32464
  value: lineHeight,
32465
  onChange,
@@ -32545,7 +33665,13 @@ function LineHeightControl(_ref) {
32545
  value: value,
32546
  min: 0
32547
  }));
32548
- }
 
 
 
 
 
 
32549
 
32550
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/line-height.js
32551
 
@@ -32591,7 +33717,7 @@ function LineHeightEdit(props) {
32591
  });
32592
  };
32593
 
32594
- return (0,external_wp_element_namespaceObject.createElement)(LineHeightControl, {
32595
  __unstableInputWidth: "100%",
32596
  __nextHasNoMarginBottom: true,
32597
  value: style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.lineHeight,
@@ -32890,6 +34016,8 @@ function FontFamilyControl(_ref) {
32890
 
32891
 
32892
 
 
 
32893
  const FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';
32894
  /**
32895
  * Filters registered block settings, extending attributes to include
@@ -32930,7 +34058,7 @@ function font_family_addSaveProps(props, blockType, attributes) {
32930
  return props;
32931
  }
32932
 
32933
- if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'typography.__experimentalSkipSerialization')) {
32934
  return props;
32935
  }
32936
 
@@ -33149,6 +34277,10 @@ function FontSizePicker(props) {
33149
  disableCustomFontSizes: disableCustomFontSizes
33150
  }));
33151
  }
 
 
 
 
33152
 
33153
  /* harmony default export */ var font_size_picker = (FontSizePicker);
33154
 
@@ -33169,6 +34301,7 @@ function FontSizePicker(props) {
33169
 
33170
 
33171
 
 
33172
  const FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';
33173
  /**
33174
  * Filters registered block settings, extending attributes to include
@@ -33211,7 +34344,7 @@ function font_size_addSaveProps(props, blockType, attributes) {
33211
  return props;
33212
  }
33213
 
33214
- if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'typography.__experimentalSkipSerialization')) {
33215
  return props;
33216
  } // Use TokenList to dedupe classes.
33217
 
@@ -33376,7 +34509,7 @@ const withFontSizeInlineStyles = (0,external_wp_compose_namespaceObject.createHi
33376
  // doesn't already have an inline font size,
33377
  // and does have a class to extract the font size from.
33378
 
33379
- 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) {
33380
  return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, props);
33381
  }
33382
 
@@ -34128,6 +35261,7 @@ function useIsTypographyDisabled() {
34128
 
34129
 
34130
 
 
34131
  const styleSupportKeys = [...TYPOGRAPHY_SUPPORT_KEYS, BORDER_SUPPORT_KEY, COLOR_SUPPORT_KEY, SPACING_SUPPORT_KEY];
34132
 
34133
  const hasStyleSupport = blockType => styleSupportKeys.some(key => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, key));
@@ -34268,6 +35402,21 @@ const skipSerializationPathsEdit = {
34268
  const skipSerializationPathsSave = { ...skipSerializationPathsEdit,
34269
  [`${SPACING_SUPPORT_KEY}`]: ['spacing.blockGap']
34270
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34271
  /**
34272
  * Override props assigned to save component to inject the CSS variables definition.
34273
  *
@@ -34290,9 +35439,18 @@ function style_addSaveProps(props, blockType, attributes) {
34290
  style
34291
  } = attributes;
34292
  (0,external_lodash_namespaceObject.forEach)(skipPaths, (path, indicator) => {
34293
- if ((0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, indicator)) {
 
 
34294
  style = (0,external_lodash_namespaceObject.omit)(style, path);
34295
  }
 
 
 
 
 
 
 
34296
  });
34297
  props.style = { ...getInlineStyles(style),
34298
  ...props.style
@@ -34350,9 +35508,14 @@ const withBlockControls = (0,external_wp_compose_namespaceObject.createHigherOrd
34350
  const withElementsStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => {
34351
  var _props$attributes$sty, _props$attributes$sty2;
34352
 
34353
- const elements = (_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : _props$attributes$sty.elements;
34354
  const blockElementsContainerIdentifier = `wp-elements-${(0,external_wp_compose_namespaceObject.useInstanceId)(BlockListBlock)}`;
34355
- const styles = compileElementsStyles(blockElementsContainerIdentifier, (_props$attributes$sty2 = props.attributes.style) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.elements);
 
 
 
 
 
 
34356
  const element = (0,external_wp_element_namespaceObject.useContext)(BlockList.__unstableElementContext);
34357
  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", {
34358
  dangerouslySetInnerHTML: {
@@ -34789,8 +35952,12 @@ function LayoutPanel(_ref) {
34789
 
34790
  if (!allowEditing) {
34791
  return null;
34792
- }
 
 
 
34793
 
 
34794
  const usedLayout = layout || defaultBlockLayout || {};
34795
  const {
34796
  inherit = false,
@@ -34820,7 +35987,7 @@ function LayoutPanel(_ref) {
34820
 
34821
  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, {
34822
  title: (0,external_wp_i18n_namespaceObject.__)('Layout')
34823
- }, allowInheriting && !!defaultThemeLayout && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
34824
  label: (0,external_wp_i18n_namespaceObject.__)('Inherit default layout'),
34825
  checked: !!inherit,
34826
  onChange: () => setAttributes({
@@ -34930,6 +36097,7 @@ const withLayoutStyles = (0,external_wp_compose_namespaceObject.createHigherOrde
34930
  [`wp-container-${id}`]: shouldRenderLayoutStyles
34931
  });
34932
  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, {
 
34933
  selector: `.wp-container-${id}`,
34934
  layout: usedLayout,
34935
  style: attributes === null || attributes === void 0 ? void 0 : attributes.style
@@ -35580,13 +36748,13 @@ const alignLeft = (0,external_wp_element_namespaceObject.createElement)(external
35580
  * WordPress dependencies
35581
  */
35582
 
35583
- const alignCenter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
35584
  xmlns: "http://www.w3.org/2000/svg",
35585
  viewBox: "0 0 24 24"
35586
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
35587
  d: "M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"
35588
  }));
35589
- /* harmony default export */ var align_center = (alignCenter);
35590
 
35591
  ;// CONCATENATED MODULE: ./packages/icons/build-module/library/align-right.js
35592
 
@@ -35631,7 +36799,7 @@ const DEFAULT_ALIGNMENT_CONTROLS = [{
35631
  title: (0,external_wp_i18n_namespaceObject.__)('Align text right'),
35632
  align: 'right'
35633
  }];
35634
- const ui_POPOVER_PROPS = {
35635
  position: 'bottom right',
35636
  isAlternate: true
35637
  };
@@ -35668,7 +36836,7 @@ function AlignmentUI(_ref) {
35668
  toggleProps: {
35669
  describedBy
35670
  },
35671
- popoverProps: ui_POPOVER_PROPS,
35672
  controls: alignmentControls.map(control => {
35673
  const {
35674
  align
@@ -35693,16 +36861,24 @@ function AlignmentUI(_ref) {
35693
  * Internal dependencies
35694
  */
35695
 
35696
- function AlignmentControl(props) {
 
35697
  return (0,external_wp_element_namespaceObject.createElement)(alignment_control_ui, _extends({}, props, {
35698
  isToolbar: false
35699
  }));
35700
- }
35701
- function AlignmentToolbar(props) {
 
35702
  return (0,external_wp_element_namespaceObject.createElement)(alignment_control_ui, _extends({}, props, {
35703
  isToolbar: true
35704
  }));
35705
- }
 
 
 
 
 
 
35706
 
35707
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/autocompleters/block.js
35708
 
@@ -36245,6 +37421,7 @@ function BlockContentOverlay(_ref) {
36245
  const [isOverlayActive, setIsOverlayActive] = (0,external_wp_element_namespaceObject.useState)(true);
36246
  const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false);
36247
  const {
 
36248
  isParentSelected,
36249
  hasChildSelected,
36250
  isDraggingBlocks,
@@ -36254,9 +37431,11 @@ function BlockContentOverlay(_ref) {
36254
  isBlockSelected,
36255
  hasSelectedInnerBlock,
36256
  isDraggingBlocks: _isDraggingBlocks,
36257
- isBlockHighlighted
 
36258
  } = select(store);
36259
  return {
 
36260
  isParentSelected: isBlockSelected(clientId),
36261
  hasChildSelected: hasSelectedInnerBlock(clientId, true),
36262
  isDraggingBlocks: _isDraggingBlocks(),
@@ -36269,7 +37448,13 @@ function BlockContentOverlay(_ref) {
36269
  'is-dragging-blocks': isDraggingBlocks
36270
  });
36271
  (0,external_wp_element_namespaceObject.useEffect)(() => {
36272
- // Reenable when blocks are not in use.
 
 
 
 
 
 
36273
  if (!isParentSelected && !hasChildSelected && !isOverlayActive) {
36274
  setIsOverlayActive(true);
36275
  } // Disable if parent selected by another means (such as list view).
@@ -36287,7 +37472,7 @@ function BlockContentOverlay(_ref) {
36287
  if (hasChildSelected && isOverlayActive) {
36288
  setIsOverlayActive(false);
36289
  }
36290
- }, [isParentSelected, hasChildSelected, isOverlayActive, isHovered]); // Disabled because the overlay div doesn't actually have a role or functionality
36291
  // as far as the a11y is concerned. We're just catching the first click so that
36292
  // the block can be selected without interacting with its contents.
36293
 
@@ -36297,7 +37482,7 @@ function BlockContentOverlay(_ref) {
36297
  className: classes,
36298
  onMouseEnter: () => setIsHovered(true),
36299
  onMouseLeave: () => setIsHovered(false),
36300
- onMouseUp: isOverlayActive ? () => setIsOverlayActive(false) : undefined
36301
  }), wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.children);
36302
  }
36303
  /* eslint-enable jsx-a11y/no-static-element-interactions */
@@ -36502,6 +37687,8 @@ function ListViewExpander(_ref) {
36502
 
36503
 
36504
 
 
 
36505
  /**
36506
  * Internal dependencies
36507
  */
@@ -36526,14 +37713,17 @@ function ListViewBlockSelectButton(_ref, ref) {
36526
  onDragEnd,
36527
  draggable
36528
  } = _ref;
36529
- const blockInformation = useBlockDisplayInformation(clientId); // The `href` attribute triggers the browser's native HTML drag operations.
 
 
 
36530
  // When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html.
36531
  // We need to clear any HTML drag data to prevent `pasteHandler` from firing
36532
  // inside the `useOnBlockDrop` hook.
36533
 
36534
  const onDragStartHandler = event => {
36535
  event.dataTransfer.clearData();
36536
- onDragStart(event);
36537
  };
36538
 
36539
  function onKeyDownHandler(event) {
@@ -36559,12 +37749,18 @@ function ListViewBlockSelectButton(_ref, ref) {
36559
  }), (0,external_wp_element_namespaceObject.createElement)(block_icon, {
36560
  icon: blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon,
36561
  showColors: true
36562
- }), (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
 
 
36563
  clientId: clientId,
36564
  maximumLength: 35
36565
- }), (blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.anchor) && (0,external_wp_element_namespaceObject.createElement)("span", {
36566
  className: "block-editor-list-view-block-select-button__anchor"
36567
- }, blockInformation.anchor)));
 
 
 
 
36568
  }
36569
 
36570
  /* harmony default export */ var block_select_button = ((0,external_wp_element_namespaceObject.forwardRef)(ListViewBlockSelectButton));
@@ -36746,6 +37942,7 @@ function getCommonDepthClientIds(startId, endId, startParents, endParents) {
36746
 
36747
 
36748
 
 
36749
  function ListViewBlock(_ref) {
36750
  let {
36751
  block,
@@ -36768,15 +37965,27 @@ function ListViewBlock(_ref) {
36768
  const {
36769
  clientId
36770
  } = block;
 
 
36771
  const {
36772
  toggleBlockHighlight
36773
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
36774
  const blockInformation = useBlockDisplayInformation(clientId);
 
 
 
36775
  const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ListViewBlock);
36776
  const descriptionId = `list-view-block-select-button__${instanceId}`;
36777
  const blockPositionDescription = getBlockPositionDescription(position, siblingBlockCount, level);
36778
- const blockAriaLabel = blockInformation ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The title of the block. This string indicates a link to select the block.
36779
- (0,external_wp_i18n_namespaceObject.__)('%s link'), blockInformation.title) : (0,external_wp_i18n_namespaceObject.__)('Link');
 
 
 
 
 
 
 
36780
  const settingsAriaLabel = blockInformation ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The title of the block.
36781
  (0,external_wp_i18n_namespaceObject.__)('Options for %s block'), blockInformation.title) : (0,external_wp_i18n_namespaceObject.__)('Options');
36782
  const {
@@ -36793,7 +38002,7 @@ function ListViewBlock(_ref) {
36793
  'is-visible': isHovered || isSelected
36794
  });
36795
  const listViewBlockSettingsClassName = classnames_default()('block-editor-list-view-block__menu-cell', {
36796
- 'is-visible': isHovered || isSelected
36797
  }); // If ListView has experimental features related to the Persistent List View,
36798
  // only focus the selected list item on mount; otherwise the list would always
36799
  // try to steal the focus from the editor canvas.
@@ -36843,6 +38052,8 @@ function ListViewBlock(_ref) {
36843
 
36844
  const classes = classnames_default()({
36845
  'is-selected': isSelected,
 
 
36846
  'is-branch-selected': withExperimentalPersistentListViewFeatures && isBranchSelected,
36847
  'is-dragging': isDragged,
36848
  'has-single-cell': hideBlockActions
@@ -37038,7 +38249,7 @@ function ListViewBranch(props) {
37038
  isBranchSelected = false,
37039
  listPosition = 0,
37040
  fixedListWindow,
37041
- expandNested = true
37042
  } = props;
37043
  const {
37044
  expandedState,
@@ -38238,7 +39449,7 @@ const Actions = _ref => {
38238
  } = _ref;
38239
  return (0,external_wp_element_namespaceObject.createElement)("div", {
38240
  className: "block-editor-block-pattern-setup__actions"
38241
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
38242
  onClick: onStartBlank
38243
  }, (0,external_wp_i18n_namespaceObject.__)('Start blank')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
38244
  variant: "primary",
@@ -38366,7 +39577,8 @@ const SetupContent = _ref => {
38366
  viewMode,
38367
  activeSlide,
38368
  patterns,
38369
- onBlockPatternSelect
 
38370
  } = _ref;
38371
  const composite = (0,external_wp_components_namespaceObject.__unstableUseCompositeState)();
38372
  const containerClass = 'block-editor-block-pattern-setup__container';
@@ -38374,17 +39586,28 @@ const SetupContent = _ref => {
38374
  if (viewMode === VIEWMODES.carousel) {
38375
  const slideClass = new Map([[activeSlide, 'active-slide'], [activeSlide - 1, 'previous-slide'], [activeSlide + 1, 'next-slide']]);
38376
  return (0,external_wp_element_namespaceObject.createElement)("div", {
 
 
 
 
 
38377
  className: containerClass
38378
  }, (0,external_wp_element_namespaceObject.createElement)("ul", {
38379
  className: "carousel-container"
38380
  }, patterns.map((pattern, index) => (0,external_wp_element_namespaceObject.createElement)(BlockPatternSlide, {
38381
  className: slideClass.get(index) || '',
38382
  key: pattern.name,
38383
- pattern: pattern
38384
- }))));
 
38385
  }
38386
 
38387
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableComposite, _extends({}, composite, {
 
 
 
 
 
38388
  role: "listbox",
38389
  className: containerClass,
38390
  "aria-label": (0,external_wp_i18n_namespaceObject.__)('Patterns list')
@@ -38393,7 +39616,7 @@ const SetupContent = _ref => {
38393
  pattern: pattern,
38394
  onSelect: onBlockPatternSelect,
38395
  composite: composite
38396
- })));
38397
  };
38398
 
38399
  function block_pattern_setup_BlockPattern(_ref2) {
@@ -38405,7 +39628,6 @@ function block_pattern_setup_BlockPattern(_ref2) {
38405
  const baseClassName = 'block-editor-block-pattern-setup-list';
38406
  const {
38407
  blocks,
38408
- title,
38409
  description,
38410
  viewportWidth = 700
38411
  } = pattern;
@@ -38423,9 +39645,7 @@ function block_pattern_setup_BlockPattern(_ref2) {
38423
  }), (0,external_wp_element_namespaceObject.createElement)(block_preview, {
38424
  blocks: blocks,
38425
  viewportWidth: viewportWidth
38426
- }), (0,external_wp_element_namespaceObject.createElement)("div", {
38427
- className: `${baseClassName}__item-title`
38428
- }, title)), !!description && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
38429
  id: descriptionId
38430
  }, description));
38431
  }
@@ -38433,7 +39653,8 @@ function block_pattern_setup_BlockPattern(_ref2) {
38433
  function BlockPatternSlide(_ref3) {
38434
  let {
38435
  className,
38436
- pattern
 
38437
  } = _ref3;
38438
  const {
38439
  blocks,
@@ -38447,7 +39668,7 @@ function BlockPatternSlide(_ref3) {
38447
  "aria-describedby": description ? descriptionId : undefined
38448
  }, (0,external_wp_element_namespaceObject.createElement)(block_preview, {
38449
  blocks: blocks,
38450
- __experimentalLive: true
38451
  }), !!description && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
38452
  id: descriptionId
38453
  }, description));
@@ -38468,6 +39689,9 @@ const BlockPatternSetup = _ref4 => {
38468
  replaceBlock
38469
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
38470
  const patterns = use_patterns_setup(clientId, blockName, filterPatternsFn);
 
 
 
38471
 
38472
  if (!(patterns !== null && patterns !== void 0 && patterns.length) || showBlank) {
38473
  return startBlankComponent;
@@ -38479,9 +39703,18 @@ const BlockPatternSetup = _ref4 => {
38479
  };
38480
 
38481
  const onPatternSelectCallback = onBlockPatternSelect || onBlockPatternSelectDefault;
38482
- return (0,external_wp_element_namespaceObject.createElement)("div", {
 
 
 
38483
  className: `block-editor-block-pattern-setup view-mode-${viewMode}`
38484
- }, (0,external_wp_element_namespaceObject.createElement)(setup_toolbar, {
 
 
 
 
 
 
38485
  viewMode: viewMode,
38486
  setViewMode: setViewMode,
38487
  activeSlide: activeSlide,
@@ -38495,52 +39728,12 @@ const BlockPatternSetup = _ref4 => {
38495
  onBlockPatternSelect: () => {
38496
  onPatternSelectCallback(patterns[activeSlide].blocks);
38497
  },
38498
- onStartBlank: () => {
38499
- setShowBlank(true);
38500
- }
38501
- }), (0,external_wp_element_namespaceObject.createElement)(SetupContent, {
38502
- viewMode: viewMode,
38503
- activeSlide: activeSlide,
38504
- patterns: patterns,
38505
- onBlockPatternSelect: onPatternSelectCallback
38506
- }));
38507
  };
38508
 
38509
  /* harmony default export */ var block_pattern_setup = (BlockPatternSetup);
38510
 
38511
- ;// CONCATENATED MODULE: ./packages/block-editor/build-module/utils/block-variation-transforms.js
38512
- /**
38513
- * External dependencies
38514
- */
38515
-
38516
- /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
38517
-
38518
- /**
38519
- * Matches the provided block variations with a block's attributes. If no match
38520
- * or more than one matches are found it returns `undefined`. If a single match is
38521
- * found it returns it.
38522
- *
38523
- * This is a simple implementation for now as it takes into account only the attributes
38524
- * of a block variation and not `InnerBlocks`.
38525
- *
38526
- * @param {Object} blockAttributes - The block attributes to try to find a match.
38527
- * @param {WPBlockVariation[]} variations - A list of block variations to test for a match.
38528
- * @return {?WPBlockVariation} - If a match is found returns it. If not or more than one matches are found returns `undefined`.
38529
- */
38530
-
38531
- const __experimentalGetMatchingVariation = (blockAttributes, variations) => {
38532
- if (!variations || !blockAttributes) return;
38533
- const matches = variations.filter(_ref => {
38534
- let {
38535
- attributes
38536
- } = _ref;
38537
- if (!attributes || !Object.keys(attributes).length) return false;
38538
- return (0,external_lodash_namespaceObject.isMatch)(blockAttributes, attributes);
38539
- });
38540
- if (matches.length !== 1) return;
38541
- return matches[0];
38542
- };
38543
-
38544
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-variation-transforms/index.js
38545
 
38546
 
@@ -38559,76 +39752,63 @@ const __experimentalGetMatchingVariation = (blockAttributes, variations) => {
38559
 
38560
 
38561
 
38562
-
38563
- function __experimentalBlockVariationTransforms(_ref) {
38564
  let {
38565
- blockClientId
 
 
 
38566
  } = _ref;
38567
- const [selectedValue, setSelectedValue] = (0,external_wp_element_namespaceObject.useState)();
38568
- const {
38569
- updateBlockAttributes
38570
- } = (0,external_wp_data_namespaceObject.useDispatch)(store);
38571
- const {
38572
- variations,
38573
- blockAttributes
38574
- } = (0,external_wp_data_namespaceObject.useSelect)(select => {
38575
- const {
38576
- getBlockVariations
38577
- } = select(external_wp_blocks_namespaceObject.store);
38578
- const {
38579
- getBlockName,
38580
- getBlockAttributes
38581
- } = select(store);
38582
- const blockName = blockClientId && getBlockName(blockClientId);
38583
- return {
38584
- variations: blockName && getBlockVariations(blockName, 'transform'),
38585
- blockAttributes: getBlockAttributes(blockClientId)
38586
- };
38587
- }, [blockClientId]);
38588
- (0,external_wp_element_namespaceObject.useEffect)(() => {
38589
- var _getMatchingVariation;
38590
 
38591
- setSelectedValue((_getMatchingVariation = __experimentalGetMatchingVariation(blockAttributes, variations)) === null || _getMatchingVariation === void 0 ? void 0 : _getMatchingVariation.name);
38592
- }, [blockAttributes, variations]);
38593
- if (!(variations !== null && variations !== void 0 && variations.length)) return null;
38594
- const selectOptions = variations.map(_ref2 => {
 
 
 
 
38595
  let {
38596
  name,
38597
  title,
38598
  description
38599
- } = _ref2;
38600
  return {
38601
  value: name,
38602
  label: title,
38603
  info: description
38604
  };
38605
  });
38606
-
38607
- const onSelectVariation = variationName => {
38608
- updateBlockAttributes(blockClientId, { ...variations.find(_ref3 => {
38609
- let {
38610
- name
38611
- } = _ref3;
38612
- return name === variationName;
38613
- }).attributes
38614
- });
38615
- };
38616
-
38617
- const baseClass = 'block-editor-block-variation-transforms';
38618
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
38619
- className: baseClass,
38620
  label: (0,external_wp_i18n_namespaceObject.__)('Transform to variation'),
38621
  text: (0,external_wp_i18n_namespaceObject.__)('Transform to variation'),
38622
  popoverProps: {
38623
  position: 'bottom center',
38624
- className: `${baseClass}__popover`
38625
  },
38626
  icon: chevron_down,
38627
  toggleProps: {
38628
  iconPosition: 'right'
38629
  }
38630
  }, () => (0,external_wp_element_namespaceObject.createElement)("div", {
38631
- className: `${baseClass}__container`
38632
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItemsChoice, {
38633
  choices: selectOptions,
38634
  value: selectedValue,
@@ -38636,126 +39816,67 @@ function __experimentalBlockVariationTransforms(_ref) {
38636
  }))));
38637
  }
38638
 
38639
- /* harmony default export */ var block_variation_transforms = (__experimentalBlockVariationTransforms);
38640
-
38641
- ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-vertical-alignment-control/icons.js
38642
-
38643
-
38644
- /**
38645
- * WordPress dependencies
38646
- */
38647
-
38648
- const alignBottom = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
38649
- xmlns: "http://www.w3.org/2000/svg",
38650
- viewBox: "0 0 24 24"
38651
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
38652
- d: "M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"
38653
- }));
38654
- const icons_alignCenter = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
38655
- xmlns: "http://www.w3.org/2000/svg",
38656
- viewBox: "0 0 24 24"
38657
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
38658
- d: "M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"
38659
- }));
38660
- const alignTop = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
38661
- xmlns: "http://www.w3.org/2000/svg",
38662
- viewBox: "0 0 24 24"
38663
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
38664
- d: "M9 20h6V9H9v11zM4 4v1.5h16V4H4z"
38665
- }));
38666
-
38667
- ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-vertical-alignment-control/ui.js
38668
-
38669
-
38670
-
38671
- /**
38672
- * WordPress dependencies
38673
- */
38674
-
38675
-
38676
- /**
38677
- * Internal dependencies
38678
- */
38679
-
38680
-
38681
- const ui_BLOCK_ALIGNMENTS_CONTROLS = {
38682
- top: {
38683
- icon: alignTop,
38684
- title: (0,external_wp_i18n_namespaceObject._x)('Align top', 'Block vertical alignment setting')
38685
- },
38686
- center: {
38687
- icon: icons_alignCenter,
38688
- title: (0,external_wp_i18n_namespaceObject._x)('Align middle', 'Block vertical alignment setting')
38689
- },
38690
- bottom: {
38691
- icon: alignBottom,
38692
- title: (0,external_wp_i18n_namespaceObject._x)('Align bottom', 'Block vertical alignment setting')
38693
- }
38694
- };
38695
- const ui_DEFAULT_CONTROLS = ['top', 'center', 'bottom'];
38696
- const ui_DEFAULT_CONTROL = 'top';
38697
- const block_vertical_alignment_control_ui_POPOVER_PROPS = {
38698
- isAlternate: true
38699
- };
38700
-
38701
- function BlockVerticalAlignmentUI(_ref) {
38702
  let {
38703
- value,
38704
- onChange,
38705
- controls = ui_DEFAULT_CONTROLS,
38706
- isCollapsed = true,
38707
- isToolbar
38708
- } = _ref;
38709
-
38710
- function applyOrUnset(align) {
38711
- return () => onChange(value === align ? undefined : align);
38712
- }
38713
-
38714
- const activeAlignment = ui_BLOCK_ALIGNMENTS_CONTROLS[value];
38715
- const defaultAlignmentControl = ui_BLOCK_ALIGNMENTS_CONTROLS[ui_DEFAULT_CONTROL];
38716
- const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu;
38717
- const extraProps = isToolbar ? {
38718
- isCollapsed
38719
- } : {};
38720
- return (0,external_wp_element_namespaceObject.createElement)(UIComponent, _extends({
38721
- popoverProps: block_vertical_alignment_control_ui_POPOVER_PROPS,
38722
- icon: activeAlignment ? activeAlignment.icon : defaultAlignmentControl.icon,
38723
- label: (0,external_wp_i18n_namespaceObject._x)('Change vertical alignment', 'Block vertical alignment setting label'),
38724
- controls: controls.map(control => {
38725
- return { ...ui_BLOCK_ALIGNMENTS_CONTROLS[control],
38726
- isActive: value === control,
38727
- role: isCollapsed ? 'menuitemradio' : undefined,
38728
- onClick: applyOrUnset(control)
38729
- };
38730
- })
38731
- }, extraProps));
38732
- }
38733
- /**
38734
- * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-vertical-alignment-toolbar/README.md
38735
- */
38736
-
38737
-
38738
- /* harmony default export */ var block_vertical_alignment_control_ui = (BlockVerticalAlignmentUI);
38739
-
38740
- ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-vertical-alignment-control/index.js
38741
 
 
 
 
 
 
 
 
 
 
38742
 
 
 
 
 
 
 
 
 
 
38743
 
38744
- /**
38745
- * Internal dependencies
38746
- */
38747
 
38748
- function BlockVerticalAlignmentControl(props) {
38749
- return (0,external_wp_element_namespaceObject.createElement)(block_vertical_alignment_control_ui, _extends({}, props, {
38750
- isToolbar: false
38751
- }));
38752
- }
38753
- function BlockVerticalAlignmentToolbar(props) {
38754
- return (0,external_wp_element_namespaceObject.createElement)(block_vertical_alignment_control_ui, _extends({}, props, {
38755
- isToolbar: true
38756
- }));
38757
  }
38758
 
 
 
38759
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/color-palette/with-color-context.js
38760
 
38761
 
@@ -40889,6 +42010,9 @@ const LinkControlSettingsDrawer = _ref => {
40889
 
40890
  /* harmony default export */ var settings_drawer = (LinkControlSettingsDrawer);
40891
 
 
 
 
40892
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/url-input/index.js
40893
 
40894
 
@@ -42876,6 +44000,10 @@ const MediaReplaceFlow = _ref => {
42876
  }
42877
  });
42878
  };
 
 
 
 
42879
 
42880
  /* harmony default export */ var media_replace_flow = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withDispatch)(dispatch => {
42881
  const {
@@ -43832,10 +44960,20 @@ function splitValue(_ref) {
43832
 
43833
  if (!onReplace || !onSplit) {
43834
  return;
43835
- }
 
43836
 
 
 
 
 
 
 
 
 
 
43837
  const blocks = [];
43838
- const [before, after] = (0,external_wp_richText_namespaceObject.split)(value);
43839
  const hasPastedBlocks = pastedBlocks.length > 0;
43840
  let lastPastedBlockIndex = -1; // Consider the after value to be the original it is not empty and the
43841
  // before value *is* empty.
@@ -44171,6 +45309,10 @@ function preventEventDiscovery(value) {
44171
  }
44172
 
44173
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/rich-text/use-input-rules.js
 
 
 
 
44174
  /**
44175
  * WordPress dependencies
44176
  */
@@ -44179,11 +45321,36 @@ function preventEventDiscovery(value) {
44179
 
44180
 
44181
 
 
44182
  /**
44183
  * Internal dependencies
44184
  */
44185
 
44186
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44187
 
44188
  function useInputRules(props) {
44189
  const {
@@ -44196,7 +45363,8 @@ function useInputRules(props) {
44196
  function inputRule() {
44197
  const {
44198
  value,
44199
- onReplace
 
44200
  } = propsRef.current;
44201
 
44202
  if (!onReplace) {
@@ -44232,9 +45400,10 @@ function useInputRules(props) {
44232
  }
44233
 
44234
  const content = (0,external_wp_richText_namespaceObject.toHTMLString)({
44235
- value: (0,external_wp_richText_namespaceObject.slice)(value, start, text.length)
44236
  });
44237
  const block = transformation.transform(content);
 
44238
  onReplace([block]);
44239
 
44240
  __unstableMarkAutomaticChange();
@@ -44605,6 +45774,46 @@ function useInputEvents(inputEvents) {
44605
  }, []);
44606
  }
44607
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44608
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/rich-text/format-edit.js
44609
 
44610
 
@@ -44714,6 +45923,7 @@ function FormatEdit(_ref) {
44714
 
44715
 
44716
 
 
44717
  const keyboardShortcutContext = (0,external_wp_element_namespaceObject.createContext)();
44718
  const inputEventContext = (0,external_wp_element_namespaceObject.createContext)();
44719
  /**
@@ -44778,7 +45988,7 @@ function RichTextWrapper(_ref, forwardedRef) {
44778
  let isSelected;
44779
 
44780
  if (originalIsSelected === undefined) {
44781
- isSelected = selectionStart.clientId === clientId && selectionStart.attributeKey === identifier;
44782
  } else if (originalIsSelected) {
44783
  isSelected = selectionStart.clientId === clientId;
44784
  }
@@ -44818,7 +46028,26 @@ function RichTextWrapper(_ref, forwardedRef) {
44818
  }
44819
 
44820
  const onSelectionChange = (0,external_wp_element_namespaceObject.useCallback)((start, end) => {
44821
- selectionChange(clientId, identifier, start, end);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44822
  }, [clientId, identifier]);
44823
  const {
44824
  formatTypes,
@@ -44971,7 +46200,8 @@ function RichTextWrapper(_ref, forwardedRef) {
44971
  onChange,
44972
  __unstableAllowPrefixTransformations,
44973
  formatTypes,
44974
- onReplace
 
44975
  }), useRemoveBrowserShortcuts(), useShortcuts(keyboardShortcuts), useInputEvents(inputEvents), useUndoAutomaticChange(), usePasteHandler({
44976
  isSelected,
44977
  disableFormats,
@@ -44996,7 +46226,7 @@ function RichTextWrapper(_ref, forwardedRef) {
44996
  onChange,
44997
  disableLineBreaks,
44998
  onSplitAtEnd
44999
- }), anchorRef]),
45000
  contentEditable: true,
45001
  suppressContentEditableWarning: true,
45002
  className: classnames_default()('block-editor-rich-text__editable', props.className, 'rich-text'),
@@ -46006,6 +47236,10 @@ const SkipToSelectedBlock = _ref => {
46006
  onClick: onClick
46007
  }, (0,external_wp_i18n_namespaceObject.__)('Skip to the selected block')) : null;
46008
  };
 
 
 
 
46009
 
46010
  /* harmony default export */ var skip_to_selected_block = ((0,external_wp_data_namespaceObject.withSelect)(select => {
46011
  return {
@@ -46041,7 +47275,7 @@ function MultiSelectionInspector(_ref) {
46041
  return (0,external_wp_element_namespaceObject.createElement)("div", {
46042
  className: "block-editor-multi-selection-inspector__card"
46043
  }, (0,external_wp_element_namespaceObject.createElement)(block_icon, {
46044
- icon: library_stack,
46045
  showColors: true
46046
  }), (0,external_wp_element_namespaceObject.createElement)("div", {
46047
  className: "block-editor-multi-selection-inspector__card-content"
@@ -46204,7 +47438,8 @@ const BlockInspector = _ref => {
46204
  className: "block-editor-block-inspector"
46205
  }, (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, {
46206
  __experimentalGroup: "color",
46207
- label: (0,external_wp_i18n_namespaceObject.__)('Color')
 
46208
  }), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, {
46209
  __experimentalGroup: "typography",
46210
  label: (0,external_wp_i18n_namespaceObject.__)('Typography')
@@ -46292,6 +47527,10 @@ const AdvancedControls = () => {
46292
  __experimentalGroup: "advanced"
46293
  }));
46294
  };
 
 
 
 
46295
 
46296
  /* harmony default export */ var block_inspector = (BlockInspector);
46297
 
@@ -46398,22 +47637,6 @@ function BlockTools(_ref) {
46398
  event.preventDefault();
46399
  insertBeforeBlock((0,external_lodash_namespaceObject.first)(clientIds));
46400
  }
46401
- } else if (isMatch('core/block-editor/delete-multi-selection', event)) {
46402
- /**
46403
- * Check if the target element is a text area, input or
46404
- * event.defaultPrevented and return early. In all these
46405
- * cases backspace could be handled elsewhere.
46406
- */
46407
- if (['INPUT', 'TEXTAREA'].includes(event.target.nodeName) || event.defaultPrevented) {
46408
- return;
46409
- }
46410
-
46411
- const clientIds = getSelectedBlockClientIds();
46412
-
46413
- if (clientIds.length > 1) {
46414
- event.preventDefault();
46415
- removeBlocks(clientIds);
46416
- }
46417
  } else if (isMatch('core/block-editor/unselect', event)) {
46418
  const clientIds = getSelectedBlockClientIds();
46419
 
@@ -46556,7 +47779,7 @@ function KeyboardShortcutsRegister() {
46556
  registerShortcut({
46557
  name: 'core/block-editor/delete-multi-selection',
46558
  category: 'block',
46559
- description: (0,external_wp_i18n_namespaceObject.__)('Remove multiple selected blocks.'),
46560
  keyCombination: {
46561
  character: 'del'
46562
  },
@@ -47262,6 +48485,8 @@ function useNoRecursiveRenders(uniqueId) {
47262
 
47263
 
47264
 
 
 
47265
 
47266
 
47267
 
@@ -47285,6 +48510,39 @@ function useNoRecursiveRenders(uniqueId) {
47285
 
47286
 
47287
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47288
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/utils/parse-css-unit-to-px.js
47289
  /**
47290
  * Converts string to object { value, unit }.
2163
  "BlockSettingsMenuControls": function() { return /* reexport */ block_settings_menu_controls; },
2164
  "BlockStyles": function() { return /* reexport */ block_styles; },
2165
  "BlockTitle": function() { return /* reexport */ BlockTitle; },
2166
+ "BlockToolbar": function() { return /* reexport */ block_toolbar; },
2167
  "BlockTools": function() { return /* reexport */ BlockTools; },
2168
  "BlockVerticalAlignmentControl": function() { return /* reexport */ BlockVerticalAlignmentControl; },
2169
  "BlockVerticalAlignmentToolbar": function() { return /* reexport */ BlockVerticalAlignmentToolbar; },
2181
  "InspectorControls": function() { return /* reexport */ inspector_controls; },
2182
  "JustifyContentControl": function() { return /* reexport */ JustifyContentControl; },
2183
  "JustifyToolbar": function() { return /* reexport */ JustifyToolbar; },
2184
+ "LineHeightControl": function() { return /* reexport */ line_height_control; },
2185
  "MediaPlaceholder": function() { return /* reexport */ media_placeholder; },
2186
  "MediaReplaceFlow": function() { return /* reexport */ media_replace_flow; },
2187
  "MediaUpload": function() { return /* reexport */ media_upload; },
2250
  "__experimentalUseGradient": function() { return /* reexport */ __experimentalUseGradient; },
2251
  "__experimentalUseNoRecursiveRenders": function() { return /* reexport */ useNoRecursiveRenders; },
2252
  "__experimentalUseResizeCanvas": function() { return /* reexport */ useResizeCanvas; },
2253
+ "__unstableBlockNameContext": function() { return /* reexport */ block_name_context; },
2254
  "__unstableBlockSettingsMenuFirstItem": function() { return /* reexport */ block_settings_menu_first_item; },
2255
+ "__unstableBlockToolbarLastItem": function() { return /* reexport */ block_toolbar_last_item; },
2256
  "__unstableEditorStyles": function() { return /* reexport */ EditorStyles; },
2257
  "__unstableIframe": function() { return /* reexport */ iframe; },
2258
  "__unstableInserterMenuExtension": function() { return /* reexport */ inserter_menu_extension; },
2304
  "__unstableGetBlockWithoutInnerBlocks": function() { return __unstableGetBlockWithoutInnerBlocks; },
2305
  "__unstableGetClientIdWithClientIdsTree": function() { return __unstableGetClientIdWithClientIdsTree; },
2306
  "__unstableGetClientIdsTree": function() { return __unstableGetClientIdsTree; },
2307
+ "__unstableGetSelectedBlocksWithPartialSelection": function() { return __unstableGetSelectedBlocksWithPartialSelection; },
2308
+ "__unstableIsFullySelected": function() { return __unstableIsFullySelected; },
2309
  "__unstableIsLastBlockChangeIgnored": function() { return __unstableIsLastBlockChangeIgnored; },
2310
+ "__unstableIsSelectionMergeable": function() { return __unstableIsSelectionMergeable; },
2311
  "areInnerBlocksControlled": function() { return areInnerBlocksControlled; },
2312
+ "canEditBlock": function() { return canEditBlock; },
2313
  "canInsertBlockType": function() { return canInsertBlockType; },
2314
  "canInsertBlocks": function() { return canInsertBlocks; },
2315
  "canLockBlockType": function() { return canLockBlockType; },
2391
  var actions_namespaceObject = {};
2392
  __webpack_require__.r(actions_namespaceObject);
2393
  __webpack_require__.d(actions_namespaceObject, {
2394
+ "__unstableDeleteSelection": function() { return __unstableDeleteSelection; },
2395
+ "__unstableExpandSelection": function() { return __unstableExpandSelection; },
2396
  "__unstableMarkAutomaticChange": function() { return __unstableMarkAutomaticChange; },
2397
  "__unstableMarkLastChangeAsPersistent": function() { return __unstableMarkLastChangeAsPersistent; },
2398
  "__unstableMarkNextChangeAsNotPersistent": function() { return __unstableMarkNextChangeAsNotPersistent; },
2399
  "__unstableSaveReusableBlock": function() { return __unstableSaveReusableBlock; },
2400
+ "__unstableSplitSelection": function() { return __unstableSplitSelection; },
2401
  "clearSelectedBlock": function() { return clearSelectedBlock; },
2402
  "duplicateBlocks": function() { return duplicateBlocks; },
2403
  "enterFormattedText": function() { return enterFormattedText; },
2550
  * @property {boolean} keepCaretInsideBlock Whether caret should move between blocks in edit mode
2551
  * @property {string} bodyPlaceholder Empty post placeholder
2552
  * @property {string} titlePlaceholder Empty title placeholder
2553
+ * @property {boolean} canLockBlocks Whether the user can manage Block Lock state
2554
  * @property {boolean} codeEditingEnabled Whether or not the user can switch to the code editor
2555
+ * @property {boolean} generateAnchors Enable/Disable auto anchor generation for Heading blocks
2556
  * @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.
2557
  * @property {boolean} __experimentalBlockDirectory Whether the user has enabled the Block Directory
2558
  * @property {Array} __experimentalBlockPatterns Array of objects representing the block patterns
2559
  * @property {Array} __experimentalBlockPatternCategories Array of objects representing the block pattern categories
 
 
2560
  * @property {boolean} __unstableGalleryWithImageBlocks Whether the user has enabled the refactored gallery block which uses InnerBlocks
2561
  */
2562
 
2663
  maxUploadFileSize: 0,
2664
  // List of allowed mime types and file extensions.
2665
  allowedMimeTypes: null,
2666
+ // Allows to disable block locking interface.
2667
+ canLockBlocks: true,
2668
  __experimentalCanUserUseUnfilteredHTML: false,
2669
  __experimentalBlockDirectory: false,
2670
  __mobileEnablePageTemplates: false,
2671
  __experimentalBlockPatterns: [],
2672
  __experimentalBlockPatternCategories: [],
2673
  __experimentalSpotlightEntityBlocks: [],
 
 
2674
  __unstableGalleryWithImageBlocks: false,
2675
+ generateAnchors: false,
2676
  // gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.
2677
  // The setting is only kept for backward compatibility purposes.
2678
  gradients: [{
3907
 
3908
 
3909
  function selection() {
3910
+ var _state$selectionStart, _state$selectionEnd, _state$selectionStart2, _state$selectionEnd2;
3911
 
3912
  let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3913
  let action = arguments.length > 1 ? arguments[1] : undefined;
3914
 
3915
  switch (action.type) {
3916
  case 'SELECTION_CHANGE':
3917
+ if (action.clientId) {
3918
+ return {
3919
+ selectionStart: {
3920
+ clientId: action.clientId,
3921
+ attributeKey: action.attributeKey,
3922
+ offset: action.startOffset
3923
+ },
3924
+ selectionEnd: {
3925
+ clientId: action.clientId,
3926
+ attributeKey: action.attributeKey,
3927
+ offset: action.endOffset
3928
+ }
3929
+ };
3930
+ }
3931
+
3932
  return {
3933
+ selectionStart: action.start || state.selectionStart,
3934
+ selectionEnd: action.end || state.selectionEnd
 
 
 
 
 
 
 
 
3935
  };
3936
 
3937
  case 'RESET_SELECTION':
3949
  start,
3950
  end
3951
  } = action;
3952
+
3953
+ if (start === ((_state$selectionStart = state.selectionStart) === null || _state$selectionStart === void 0 ? void 0 : _state$selectionStart.clientId) && end === ((_state$selectionEnd = state.selectionEnd) === null || _state$selectionEnd === void 0 ? void 0 : _state$selectionEnd.clientId)) {
3954
+ return state;
3955
+ }
3956
+
3957
  return {
3958
  selectionStart: {
3959
  clientId: start
3964
  };
3965
 
3966
  case 'RESET_BLOCKS':
3967
+ const startClientId = state === null || state === void 0 ? void 0 : (_state$selectionStart2 = state.selectionStart) === null || _state$selectionStart2 === void 0 ? void 0 : _state$selectionStart2.clientId;
3968
+ const endClientId = state === null || state === void 0 ? void 0 : (_state$selectionEnd2 = state.selectionEnd) === null || _state$selectionEnd2 === void 0 ? void 0 : _state$selectionEnd2.clientId; // Do nothing if there's no selected block.
3969
 
3970
  if (!startClientId && !endClientId) {
3971
  return state;
4754
  }));
4755
  /* harmony default export */ var library_symbol = (symbol);
4756
 
4757
+ ;// CONCATENATED MODULE: external ["wp","richText"]
4758
+ var external_wp_richText_namespaceObject = window["wp"]["richText"];
4759
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/store/utils.js
4760
+ /**
4761
+ * Helper function that maps attribute definition properties to the
4762
+ * ones used by RichText utils like `create, toHTMLString, etc..`.
4763
+ *
4764
+ * @param {Object} attributeDefinition A block's attribute definition object.
4765
+ * @return {Object} The mapped object.
4766
+ */
4767
+ function mapRichTextSettings(attributeDefinition) {
4768
+ const {
4769
+ multiline: multilineTag,
4770
+ __unstableMultilineWrapperTags: multilineWrapperTags,
4771
+ __unstablePreserveWhiteSpace: preserveWhiteSpace
4772
+ } = attributeDefinition;
4773
+ return {
4774
+ multilineTag,
4775
+ multilineWrapperTags,
4776
+ preserveWhiteSpace
4777
+ };
4778
+ }
4779
+
4780
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/store/selectors.js
4781
  /**
4782
  * External dependencies
4791
 
4792
 
4793
 
4794
+
4795
+
4796
+ /**
4797
+ * Internal dependencies
4798
+ */
4799
+
4800
+
4801
  /**
4802
  * A block selection object.
4803
  *
4969
  return (0,external_lodash_namespaceObject.map)(getBlockOrder(state, rootClientId), clientId => __unstableGetClientIdWithClientIdsTree(state, clientId));
4970
  }, state => [state.blocks.order]);
4971
  /**
4972
+ * Returns an array containing the clientIds of all descendants of the blocks
4973
+ * given. Returned ids are ordered first by the order of the ids given, then
4974
+ * by the order that they appear in the editor.
4975
  *
4976
  * @param {Object} state Global application state.
4977
  * @param {Array} clientIds Array of blocks to inspect.
4979
  * @return {Array} ids of descendants.
4980
  */
4981
 
4982
+ const getClientIdsOfDescendants = rememo((state, clientIds) => {
4983
+ const collectedIds = [];
4984
+
4985
+ for (const givenId of clientIds) {
4986
+ for (const descendantId of getBlockOrder(state, givenId)) {
4987
+ collectedIds.push(descendantId, ...getClientIdsOfDescendants(state, [descendantId]));
4988
+ }
4989
+ }
4990
+
4991
+ return collectedIds;
4992
+ }, state => [state.blocks.order]);
4993
  /**
4994
+ * Returns an array containing the clientIds of the top-level blocks and
4995
+ * their descendants of any depth (for nested blocks). Ids are returned
4996
+ * in the same order that they appear in the editor.
4997
  *
4998
  * @param {Object} state Global application state.
4999
  *
5001
  */
5002
 
5003
  const getClientIdsWithDescendants = rememo(state => {
5004
+ const collectedIds = [];
5005
+
5006
+ for (const topLevelId of getBlockOrder(state)) {
5007
+ collectedIds.push(topLevelId, ...getClientIdsOfDescendants(state, [topLevelId]));
5008
+ }
5009
+
5010
+ return collectedIds;
5011
  }, state => [state.blocks.order]);
5012
  /**
5013
  * Returns the total number of blocks, or the total number of blocks with a specific name in a post.
5626
 
5627
  return selectionEnd.clientId || null;
5628
  }
5629
+ /**
5630
+ * Returns true if the selection is not partial.
5631
+ *
5632
+ * @param {Object} state Editor state.
5633
+ *
5634
+ * @return {boolean} Whether the selection is mergeable.
5635
+ */
5636
+
5637
+ function __unstableIsFullySelected(state) {
5638
+ const selectionAnchor = getSelectionStart(state);
5639
+ const selectionFocus = getSelectionEnd(state);
5640
+ return !selectionAnchor.attributeKey && !selectionFocus.attributeKey && typeof selectionAnchor.offset === 'undefined' && typeof selectionFocus.offset === 'undefined';
5641
+ }
5642
+ /**
5643
+ * Check whether the selection is mergeable.
5644
+ *
5645
+ * @param {Object} state Editor state.
5646
+ * @param {boolean} isForward Whether to merge forwards.
5647
+ *
5648
+ * @return {boolean} Whether the selection is mergeable.
5649
+ */
5650
+
5651
+ function __unstableIsSelectionMergeable(state, isForward) {
5652
+ const selectionAnchor = getSelectionStart(state);
5653
+ const selectionFocus = getSelectionEnd(state); // It's not mergeable if the start and end are within the same block.
5654
+
5655
+ if (selectionAnchor.clientId === selectionFocus.clientId) return false; // It's not mergeable if there's no rich text selection.
5656
+
5657
+ if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === 'undefined' || typeof selectionFocus.offset === 'undefined') return false;
5658
+ const anchorRootClientId = getBlockRootClientId(state, selectionAnchor.clientId);
5659
+ const focusRootClientId = getBlockRootClientId(state, selectionFocus.clientId); // It's not mergeable if the selection doesn't start and end in the same
5660
+ // block list. Maybe in the future it should be allowed.
5661
+
5662
+ if (anchorRootClientId !== focusRootClientId) {
5663
+ return false;
5664
+ }
5665
+
5666
+ const blockOrder = getBlockOrder(state, anchorRootClientId);
5667
+ const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId);
5668
+ const focusIndex = blockOrder.indexOf(selectionFocus.clientId); // Reassign selection start and end based on order.
5669
+
5670
+ let selectionStart, selectionEnd;
5671
+
5672
+ if (anchorIndex > focusIndex) {
5673
+ selectionStart = selectionFocus;
5674
+ selectionEnd = selectionAnchor;
5675
+ } else {
5676
+ selectionStart = selectionAnchor;
5677
+ selectionEnd = selectionFocus;
5678
+ }
5679
+
5680
+ const targetBlockClientId = isForward ? selectionEnd.clientId : selectionStart.clientId;
5681
+ const blockToMergeClientId = isForward ? selectionStart.clientId : selectionEnd.clientId;
5682
+ const targetBlock = getBlock(state, targetBlockClientId);
5683
+ const targetBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(targetBlock.name);
5684
+ if (!targetBlockType.merge) return false;
5685
+ const blockToMerge = getBlock(state, blockToMergeClientId); // It's mergeable if the blocks are of the same type.
5686
+
5687
+ if (blockToMerge.name === targetBlock.name) return true; // If the blocks are of a different type, try to transform the block being
5688
+ // merged into the same type of block.
5689
+
5690
+ const blocksToMerge = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blockToMerge, targetBlock.name);
5691
+ return blocksToMerge && blocksToMerge.length;
5692
+ }
5693
+ /**
5694
+ * Get partial selected blocks with their content updated
5695
+ * based on the selection.
5696
+ *
5697
+ * @param {Object} state Editor state.
5698
+ *
5699
+ * @return {Object[]} Updated partial selected blocks.
5700
+ */
5701
+
5702
+ const __unstableGetSelectedBlocksWithPartialSelection = state => {
5703
+ const selectionAnchor = getSelectionStart(state);
5704
+ const selectionFocus = getSelectionEnd(state);
5705
+
5706
+ if (selectionAnchor.clientId === selectionFocus.clientId) {
5707
+ return EMPTY_ARRAY;
5708
+ } // Can't split if the selection is not set.
5709
+
5710
+
5711
+ if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === 'undefined' || typeof selectionFocus.offset === 'undefined') {
5712
+ return EMPTY_ARRAY;
5713
+ }
5714
+
5715
+ const anchorRootClientId = getBlockRootClientId(state, selectionAnchor.clientId);
5716
+ const focusRootClientId = getBlockRootClientId(state, selectionFocus.clientId); // It's not splittable if the selection doesn't start and end in the same
5717
+ // block list. Maybe in the future it should be allowed.
5718
+
5719
+ if (anchorRootClientId !== focusRootClientId) {
5720
+ return EMPTY_ARRAY;
5721
+ }
5722
+
5723
+ const blockOrder = getBlockOrder(state, anchorRootClientId);
5724
+ const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId);
5725
+ const focusIndex = blockOrder.indexOf(selectionFocus.clientId); // Reassign selection start and end based on order.
5726
+
5727
+ const [selectionStart, selectionEnd] = anchorIndex > focusIndex ? [selectionFocus, selectionAnchor] : [selectionAnchor, selectionFocus];
5728
+ const blockA = getBlock(state, selectionStart.clientId);
5729
+ const blockAType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockA.name);
5730
+ const blockB = getBlock(state, selectionEnd.clientId);
5731
+ const blockBType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockB.name);
5732
+ const htmlA = blockA.attributes[selectionStart.attributeKey];
5733
+ const htmlB = blockB.attributes[selectionEnd.attributeKey];
5734
+ const attributeDefinitionA = blockAType.attributes[selectionStart.attributeKey];
5735
+ const attributeDefinitionB = blockBType.attributes[selectionEnd.attributeKey];
5736
+ let valueA = (0,external_wp_richText_namespaceObject.create)({
5737
+ html: htmlA,
5738
+ ...mapRichTextSettings(attributeDefinitionA)
5739
+ });
5740
+ let valueB = (0,external_wp_richText_namespaceObject.create)({
5741
+ html: htmlB,
5742
+ ...mapRichTextSettings(attributeDefinitionB)
5743
+ });
5744
+ valueA = (0,external_wp_richText_namespaceObject.remove)(valueA, 0, selectionStart.offset);
5745
+ valueB = (0,external_wp_richText_namespaceObject.remove)(valueB, selectionEnd.offset, valueB.text.length);
5746
+ return [{ ...blockA,
5747
+ attributes: { ...blockA.attributes,
5748
+ [selectionStart.attributeKey]: (0,external_wp_richText_namespaceObject.toHTMLString)({
5749
+ value: valueA,
5750
+ ...mapRichTextSettings(attributeDefinitionA)
5751
+ })
5752
+ }
5753
+ }, { ...blockB,
5754
+ attributes: { ...blockB.attributes,
5755
+ [selectionEnd.attributeKey]: (0,external_wp_richText_namespaceObject.toHTMLString)({
5756
+ value: valueB,
5757
+ ...mapRichTextSettings(attributeDefinitionB)
5758
+ })
5759
+ }
5760
+ }];
5761
+ };
5762
  /**
5763
  * Returns an array containing all block client IDs in the editor in the order
5764
  * they appear. Optionally accepts a root client ID of the block list for which
6151
  const blockAllowedParentBlocks = blockType.parent;
6152
  const parentName = getBlockName(state, rootClientId);
6153
  const hasBlockAllowedParent = checkAllowList(blockAllowedParentBlocks, parentName);
6154
+ let hasBlockAllowedAncestor = true;
6155
+ const blockAllowedAncestorBlocks = blockType.ancestor;
6156
+
6157
+ if (blockAllowedAncestorBlocks) {
6158
+ const ancestors = [rootClientId, ...getBlockParents(state, rootClientId)];
6159
+ hasBlockAllowedAncestor = (0,external_lodash_namespaceObject.some)(ancestors, ancestorClientId => checkAllowList(blockAllowedAncestorBlocks, getBlockName(state, ancestorClientId)));
6160
+ }
6161
+
6162
+ const canInsert = hasBlockAllowedAncestor && (hasParentAllowedBlock === null && hasBlockAllowedParent === null || hasParentAllowedBlock === true || hasBlockAllowedParent === true);
6163
 
6164
  if (!canInsert) {
6165
  return canInsert;
6234
  const {
6235
  lock
6236
  } = attributes;
6237
+ const parentIsLocked = !!getTemplateLock(state, rootClientId); // If we don't have a lock on the blockType level, we defer to the parent templateLock.
6238
 
6239
  if (lock === undefined || (lock === null || lock === void 0 ? void 0 : lock.remove) === undefined) {
6240
  return !parentIsLocked;
6278
  const {
6279
  lock
6280
  } = attributes;
6281
+ const parentIsLocked = getTemplateLock(state, rootClientId) === 'all'; // If we don't have a lock on the blockType level, we defer to the parent templateLock.
6282
 
6283
  if (lock === undefined || (lock === null || lock === void 0 ? void 0 : lock.move) === undefined) {
6284
  return !parentIsLocked;
6301
  let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
6302
  return clientIds.every(clientId => canMoveBlock(state, clientId, rootClientId));
6303
  }
6304
+ /**
6305
+ * Determines if the given block is allowed to be edited.
6306
+ *
6307
+ * @param {Object} state Editor state.
6308
+ * @param {string} clientId The block client Id.
6309
+ *
6310
+ * @return {boolean} Whether the given block is allowed to be edited.
6311
+ */
6312
+
6313
+ function canEditBlock(state, clientId) {
6314
+ const attributes = getBlockAttributes(state, clientId);
6315
+
6316
+ if (attributes === null) {
6317
+ return true;
6318
+ }
6319
+
6320
+ const {
6321
+ lock
6322
+ } = attributes; // When the edit is true, we cannot edit the block.
6323
+
6324
+ return !(lock !== null && lock !== void 0 && lock.edit);
6325
+ }
6326
  /**
6327
  * Determines if the given block type can be locked/unlocked by a user.
6328
  *
6335
  function canLockBlockType(state, nameOrType) {
6336
  var _state$settings;
6337
 
6338
+ if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, 'lock', true)) {
6339
  return false;
6340
  } // Use block editor settings as the default value.
6341
 
6342
 
6343
+ return !!((_state$settings = state.settings) !== null && _state$settings !== void 0 && _state$settings.canLockBlocks);
6344
  }
6345
  /**
6346
  * Returns information about how recently and frequently a block has been inserted.
6670
  */
6671
 
6672
  const getBlockTransformItems = rememo(function (state, blocks) {
6673
+ var _itemsByName$sourceBl;
6674
+
6675
  let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
6676
+ const [sourceBlock] = blocks;
6677
  const buildBlockTypeTransformItem = buildBlockTypeItem(state, {
6678
  buildScope: 'transform'
6679
  });
6683
  name
6684
  } = _ref5;
6685
  return name;
6686
+ }); // Consider unwraping the highest priority.
6687
+
6688
+ itemsByName['*'] = {
6689
+ frecency: +Infinity,
6690
+ id: '*',
6691
+ isDisabled: false,
6692
+ name: '*',
6693
+ title: (0,external_wp_i18n_namespaceObject.__)('Unwrap'),
6694
+ icon: (_itemsByName$sourceBl = itemsByName[sourceBlock.name]) === null || _itemsByName$sourceBl === void 0 ? void 0 : _itemsByName$sourceBl.icon
6695
+ };
6696
  const possibleTransforms = (0,external_wp_blocks_namespaceObject.getPossibleBlockTransformations)(blocks).reduce((accumulator, block) => {
6697
+ if (block === '*') {
6698
+ accumulator.push(itemsByName['*']);
6699
+ } else if (itemsByName[block === null || block === void 0 ? void 0 : block.name]) {
6700
  accumulator.push(itemsByName[block.name]);
6701
  }
6702
 
6703
  return accumulator;
6704
  }, []);
6705
+ return (0,external_lodash_namespaceObject.orderBy)(possibleTransforms, block => itemsByName[block.name].frecency, 'desc');
 
6706
  }, (state, rootClientId) => [state.blockListSettings[rootClientId], state.blocks.byClientId, state.preferences.insertUsage, state.settings.allowedBlockTypes, state.settings.templateLock, (0,external_wp_blocks_namespaceObject.getBlockTypes)()]);
6707
  /**
6708
  * Determines whether there are items to show in the inserter.
7186
 
7187
  ;// CONCATENATED MODULE: external ["wp","a11y"]
7188
  var external_wp_a11y_namespaceObject = window["wp"]["a11y"];
 
 
7189
  ;// CONCATENATED MODULE: external ["wp","deprecated"]
7190
  var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
7191
  var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
7203
 
7204
 
7205
 
7206
+ /**
7207
+ * Internal dependencies
7208
+ */
7209
+
7210
+
7211
  /**
7212
  * Action which will insert a default block insert action if there
7213
  * are no other blocks at the root of the editor. This action should be used
7297
  * text value. See `wp.richText.create`.
7298
  */
7299
 
7300
+ /**
7301
+ * A selection object.
7302
+ *
7303
+ * @typedef {Object} WPSelection
7304
+ *
7305
+ * @property {WPBlockSelection} start The selection start.
7306
+ * @property {WPBlockSelection} end The selection end.
7307
+ */
7308
+
7309
  /* eslint-disable jsdoc/valid-types */
7310
 
7311
  /**
7801
  * @param {?string} rootClientId Optional root client ID of block list on
7802
  * which to insert.
7803
  * @param {?number} index Index at which block should be inserted.
7804
+ * @param {Object} __unstableOptions Whether or not to show an inserter button.
7805
  *
7806
  * @return {Object} Action object.
7807
  */
7863
  const updatedBlockList = (0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)(blocks, template);
7864
  dispatch.resetBlocks(updatedBlockList);
7865
  };
7866
+ /**
7867
+ * Delete the current selection.
7868
+ *
7869
+ * @param {boolean} isForward
7870
+ */
7871
+
7872
+ const __unstableDeleteSelection = isForward => _ref12 => {
7873
+ let {
7874
+ registry,
7875
+ select,
7876
+ dispatch
7877
+ } = _ref12;
7878
+ const selectionAnchor = select.getSelectionStart();
7879
+ const selectionFocus = select.getSelectionEnd();
7880
+ if (selectionAnchor.clientId === selectionFocus.clientId) return; // It's not mergeable if there's no rich text selection.
7881
+
7882
+ if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === 'undefined' || typeof selectionFocus.offset === 'undefined') return false;
7883
+ const anchorRootClientId = select.getBlockRootClientId(selectionAnchor.clientId);
7884
+ const focusRootClientId = select.getBlockRootClientId(selectionFocus.clientId); // It's not mergeable if the selection doesn't start and end in the same
7885
+ // block list. Maybe in the future it should be allowed.
7886
+
7887
+ if (anchorRootClientId !== focusRootClientId) {
7888
+ return;
7889
+ }
7890
+
7891
+ const blockOrder = select.getBlockOrder(anchorRootClientId);
7892
+ const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId);
7893
+ const focusIndex = blockOrder.indexOf(selectionFocus.clientId); // Reassign selection start and end based on order.
7894
+
7895
+ let selectionStart, selectionEnd;
7896
+
7897
+ if (anchorIndex > focusIndex) {
7898
+ selectionStart = selectionFocus;
7899
+ selectionEnd = selectionAnchor;
7900
+ } else {
7901
+ selectionStart = selectionAnchor;
7902
+ selectionEnd = selectionFocus;
7903
+ }
7904
+
7905
+ const targetSelection = isForward ? selectionEnd : selectionStart;
7906
+ const targetBlock = select.getBlock(targetSelection.clientId);
7907
+ const targetBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(targetBlock.name);
7908
+
7909
+ if (!targetBlockType.merge) {
7910
+ return;
7911
+ }
7912
+
7913
+ const selectionA = selectionStart;
7914
+ const selectionB = selectionEnd;
7915
+ const blockA = select.getBlock(selectionA.clientId);
7916
+ const blockAType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockA.name);
7917
+ const blockB = select.getBlock(selectionB.clientId);
7918
+ const blockBType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockB.name);
7919
+ const htmlA = blockA.attributes[selectionA.attributeKey];
7920
+ const htmlB = blockB.attributes[selectionB.attributeKey];
7921
+ const attributeDefinitionA = blockAType.attributes[selectionA.attributeKey];
7922
+ const attributeDefinitionB = blockBType.attributes[selectionB.attributeKey];
7923
+ let valueA = (0,external_wp_richText_namespaceObject.create)({
7924
+ html: htmlA,
7925
+ ...mapRichTextSettings(attributeDefinitionA)
7926
+ });
7927
+ let valueB = (0,external_wp_richText_namespaceObject.create)({
7928
+ html: htmlB,
7929
+ ...mapRichTextSettings(attributeDefinitionB)
7930
+ }); // A robust way to retain selection position through various transforms
7931
+ // is to insert a special character at the position and then recover it.
7932
+
7933
+ const START_OF_SELECTED_AREA = '\u0086';
7934
+ valueA = (0,external_wp_richText_namespaceObject.remove)(valueA, selectionA.offset, valueA.text.length);
7935
+ valueB = (0,external_wp_richText_namespaceObject.insert)(valueB, START_OF_SELECTED_AREA, 0, selectionB.offset); // Clone the blocks so we don't manipulate the original.
7936
+
7937
+ const cloneA = (0,external_wp_blocks_namespaceObject.cloneBlock)(blockA, {
7938
+ [selectionA.attributeKey]: (0,external_wp_richText_namespaceObject.toHTMLString)({
7939
+ value: valueA,
7940
+ ...mapRichTextSettings(attributeDefinitionA)
7941
+ })
7942
+ });
7943
+ const cloneB = (0,external_wp_blocks_namespaceObject.cloneBlock)(blockB, {
7944
+ [selectionB.attributeKey]: (0,external_wp_richText_namespaceObject.toHTMLString)({
7945
+ value: valueB,
7946
+ ...mapRichTextSettings(attributeDefinitionB)
7947
+ })
7948
+ });
7949
+ const followingBlock = isForward ? cloneA : cloneB; // We can only merge blocks with similar types
7950
+ // thus, we transform the block to merge first
7951
+
7952
+ const blocksWithTheSameType = blockA.name === blockB.name ? [followingBlock] : (0,external_wp_blocks_namespaceObject.switchToBlockType)(followingBlock, targetBlockType.name); // If the block types can not match, do nothing
7953
+
7954
+ if (!blocksWithTheSameType || !blocksWithTheSameType.length) {
7955
+ return;
7956
+ }
7957
+
7958
+ let updatedAttributes;
7959
+
7960
+ if (isForward) {
7961
+ const blockToMerge = blocksWithTheSameType.pop();
7962
+ updatedAttributes = targetBlockType.merge(blockToMerge.attributes, cloneB.attributes);
7963
+ } else {
7964
+ const blockToMerge = blocksWithTheSameType.shift();
7965
+ updatedAttributes = targetBlockType.merge(cloneA.attributes, blockToMerge.attributes);
7966
+ }
7967
+
7968
+ const newAttributeKey = (0,external_lodash_namespaceObject.findKey)(updatedAttributes, v => typeof v === 'string' && v.indexOf(START_OF_SELECTED_AREA) !== -1);
7969
+ const convertedHtml = updatedAttributes[newAttributeKey];
7970
+ const convertedValue = (0,external_wp_richText_namespaceObject.create)({
7971
+ html: convertedHtml,
7972
+ ...mapRichTextSettings(targetBlockType.attributes[newAttributeKey])
7973
+ });
7974
+ const newOffset = convertedValue.text.indexOf(START_OF_SELECTED_AREA);
7975
+ const newValue = (0,external_wp_richText_namespaceObject.remove)(convertedValue, newOffset, newOffset + 1);
7976
+ const newHtml = (0,external_wp_richText_namespaceObject.toHTMLString)({
7977
+ value: newValue,
7978
+ ...mapRichTextSettings(targetBlockType.attributes[newAttributeKey])
7979
+ });
7980
+ updatedAttributes[newAttributeKey] = newHtml;
7981
+ const selectedBlockClientIds = select.getSelectedBlockClientIds();
7982
+ const replacement = [...(isForward ? blocksWithTheSameType : []), { // Preserve the original client ID.
7983
+ ...targetBlock,
7984
+ attributes: { ...targetBlock.attributes,
7985
+ ...updatedAttributes
7986
+ }
7987
+ }, ...(isForward ? [] : blocksWithTheSameType)];
7988
+ registry.batch(() => {
7989
+ dispatch.selectionChange(targetBlock.clientId, newAttributeKey, newOffset, newOffset);
7990
+ dispatch.replaceBlocks(selectedBlockClientIds, replacement, 0, // If we don't pass the `indexToSelect` it will default to the last block.
7991
+ select.getSelectedBlocksInitialCaretPosition());
7992
+ });
7993
+ };
7994
+ /**
7995
+ * Split the current selection.
7996
+ */
7997
+
7998
+ const __unstableSplitSelection = () => _ref13 => {
7999
+ let {
8000
+ select,
8001
+ dispatch
8002
+ } = _ref13;
8003
+ const selectionAnchor = select.getSelectionStart();
8004
+ const selectionFocus = select.getSelectionEnd();
8005
+ if (selectionAnchor.clientId === selectionFocus.clientId) return; // Can't split if the selection is not set.
8006
+
8007
+ if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === 'undefined' || typeof selectionFocus.offset === 'undefined') return;
8008
+ const anchorRootClientId = select.getBlockRootClientId(selectionAnchor.clientId);
8009
+ const focusRootClientId = select.getBlockRootClientId(selectionFocus.clientId); // It's not splittable if the selection doesn't start and end in the same
8010
+ // block list. Maybe in the future it should be allowed.
8011
+
8012
+ if (anchorRootClientId !== focusRootClientId) {
8013
+ return;
8014
+ }
8015
+
8016
+ const blockOrder = select.getBlockOrder(anchorRootClientId);
8017
+ const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId);
8018
+ const focusIndex = blockOrder.indexOf(selectionFocus.clientId); // Reassign selection start and end based on order.
8019
+
8020
+ let selectionStart, selectionEnd;
8021
+
8022
+ if (anchorIndex > focusIndex) {
8023
+ selectionStart = selectionFocus;
8024
+ selectionEnd = selectionAnchor;
8025
+ } else {
8026
+ selectionStart = selectionAnchor;
8027
+ selectionEnd = selectionFocus;
8028
+ }
8029
+
8030
+ const selectionA = selectionStart;
8031
+ const selectionB = selectionEnd;
8032
+ const blockA = select.getBlock(selectionA.clientId);
8033
+ const blockAType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockA.name);
8034
+ const blockB = select.getBlock(selectionB.clientId);
8035
+ const blockBType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockB.name);
8036
+ const htmlA = blockA.attributes[selectionA.attributeKey];
8037
+ const htmlB = blockB.attributes[selectionB.attributeKey];
8038
+ const attributeDefinitionA = blockAType.attributes[selectionA.attributeKey];
8039
+ const attributeDefinitionB = blockBType.attributes[selectionB.attributeKey];
8040
+ let valueA = (0,external_wp_richText_namespaceObject.create)({
8041
+ html: htmlA,
8042
+ ...mapRichTextSettings(attributeDefinitionA)
8043
+ });
8044
+ let valueB = (0,external_wp_richText_namespaceObject.create)({
8045
+ html: htmlB,
8046
+ ...mapRichTextSettings(attributeDefinitionB)
8047
+ });
8048
+ valueA = (0,external_wp_richText_namespaceObject.remove)(valueA, selectionA.offset, valueA.text.length);
8049
+ valueB = (0,external_wp_richText_namespaceObject.remove)(valueB, 0, selectionB.offset);
8050
+ dispatch.replaceBlocks(select.getSelectedBlockClientIds(), [{ // Preserve the original client ID.
8051
+ ...blockA,
8052
+ attributes: { ...blockA.attributes,
8053
+ [selectionA.attributeKey]: (0,external_wp_richText_namespaceObject.toHTMLString)({
8054
+ value: valueA,
8055
+ ...mapRichTextSettings(attributeDefinitionA)
8056
+ })
8057
+ }
8058
+ }, (0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()), { // Preserve the original client ID.
8059
+ ...blockB,
8060
+ attributes: { ...blockB.attributes,
8061
+ [selectionB.attributeKey]: (0,external_wp_richText_namespaceObject.toHTMLString)({
8062
+ value: valueB,
8063
+ ...mapRichTextSettings(attributeDefinitionB)
8064
+ })
8065
+ }
8066
+ }], 1, // If we don't pass the `indexToSelect` it will default to the last block.
8067
+ select.getSelectedBlocksInitialCaretPosition());
8068
+ };
8069
+ /**
8070
+ * Expand the selection to cover the entire blocks, removing partial selection.
8071
+ */
8072
+
8073
+ const __unstableExpandSelection = () => _ref14 => {
8074
+ let {
8075
+ select,
8076
+ dispatch
8077
+ } = _ref14;
8078
+ const selectionAnchor = select.getSelectionStart();
8079
+ const selectionFocus = select.getSelectionEnd();
8080
+ dispatch.selectionChange({
8081
+ start: {
8082
+ clientId: selectionAnchor.clientId
8083
+ },
8084
+ end: {
8085
+ clientId: selectionFocus.clientId
8086
+ }
8087
+ });
8088
+ };
8089
  /**
8090
  * Action that merges two blocks.
8091
  *
8093
  * @param {string} secondBlockClientId Client ID of the second block to merge.
8094
  */
8095
 
8096
+ const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref15 => {
8097
  let {
8098
  select,
8099
  dispatch
8100
+ } = _ref15;
8101
  const blocks = [firstBlockClientId, secondBlockClientId];
8102
  dispatch({
8103
  type: 'MERGE_BLOCKS',
8145
  if (canRestoreTextSelection) {
8146
  const selectedBlock = clientId === clientIdA ? cloneA : cloneB;
8147
  const html = selectedBlock.attributes[attributeKey];
 
 
 
 
 
8148
  const value = (0,external_wp_richText_namespaceObject.insert)((0,external_wp_richText_namespaceObject.create)({
8149
  html,
8150
+ ...mapRichTextSettings(attributeDefinition)
 
 
8151
  }), START_OF_SELECTED_AREA, offset, offset);
8152
  selectedBlock.attributes[attributeKey] = (0,external_wp_richText_namespaceObject.toHTMLString)({
8153
  value,
8154
+ ...mapRichTextSettings(attributeDefinition)
 
8155
  });
8156
  } // We can only merge blocks with similar types
8157
  // thus, we transform the block to merge first.
8169
  if (canRestoreTextSelection) {
8170
  const newAttributeKey = (0,external_lodash_namespaceObject.findKey)(updatedAttributes, v => typeof v === 'string' && v.indexOf(START_OF_SELECTED_AREA) !== -1);
8171
  const convertedHtml = updatedAttributes[newAttributeKey];
 
 
 
 
 
8172
  const convertedValue = (0,external_wp_richText_namespaceObject.create)({
8173
  html: convertedHtml,
8174
+ ...mapRichTextSettings(blockAType.attributes[newAttributeKey])
 
 
8175
  });
8176
  const newOffset = convertedValue.text.indexOf(START_OF_SELECTED_AREA);
8177
  const newValue = (0,external_wp_richText_namespaceObject.remove)(convertedValue, newOffset, newOffset + 1);
8178
  const newHtml = (0,external_wp_richText_namespaceObject.toHTMLString)({
8179
  value: newValue,
8180
+ ...mapRichTextSettings(blockAType.attributes[newAttributeKey])
 
8181
  });
8182
  updatedAttributes[newAttributeKey] = newHtml;
8183
  dispatch.selectionChange(blockA.clientId, newAttributeKey, newOffset, newOffset);
8201
 
8202
  const removeBlocks = function (clientIds) {
8203
  let selectPrevious = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
8204
+ return _ref16 => {
8205
  let {
8206
  select,
8207
  dispatch
8208
+ } = _ref16;
8209
 
8210
  if (!clientIds || !clientIds.length) {
8211
  return;
8361
  /**
8362
  * Action that changes the position of the user caret.
8363
  *
8364
+ * @param {string|WPSelection} clientId The selected block client ID.
8365
+ * @param {string} attributeKey The selected block attribute key.
8366
+ * @param {number} startOffset The start offset.
8367
+ * @param {number} endOffset The end offset.
8368
  *
8369
  * @return {Object} Action object.
8370
  */
8371
 
8372
  function selectionChange(clientId, attributeKey, startOffset, endOffset) {
8373
+ if (typeof clientId === 'string') {
8374
+ return {
8375
+ type: 'SELECTION_CHANGE',
8376
+ clientId,
8377
+ attributeKey,
8378
+ startOffset,
8379
+ endOffset
8380
+ };
8381
+ }
8382
+
8383
  return {
8384
  type: 'SELECTION_CHANGE',
8385
+ ...clientId
 
 
 
8386
  };
8387
  }
8388
  /**
8394
  * @param {?number} index Optional index where to insert the default block.
8395
  */
8396
 
8397
+ const insertDefaultBlock = (attributes, rootClientId, index) => _ref17 => {
8398
  let {
8399
  dispatch
8400
+ } = _ref17;
8401
  // Abort if there is no default block type (if it has been unregistered).
8402
  const defaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)();
8403
 
8486
  * selection changes have been recorded.
8487
  */
8488
 
8489
+ const __unstableMarkAutomaticChange = () => _ref18 => {
8490
  let {
8491
  dispatch
8492
+ } = _ref18;
8493
  dispatch({
8494
  type: 'MARK_AUTOMATIC_CHANGE'
8495
  });
8510
 
8511
  const setNavigationMode = function () {
8512
  let isNavigationMode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
8513
+ return _ref19 => {
8514
  let {
8515
  dispatch
8516
+ } = _ref19;
8517
  dispatch({
8518
  type: 'SET_NAVIGATION_MODE',
8519
  isNavigationMode
8534
 
8535
  const setBlockMovingClientId = function () {
8536
  let hasBlockMovingClientId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
8537
+ return _ref20 => {
8538
  let {
8539
  dispatch
8540
+ } = _ref20;
8541
  dispatch({
8542
  type: 'SET_BLOCK_MOVING_MODE',
8543
  hasBlockMovingClientId
8557
 
8558
  const duplicateBlocks = function (clientIds) {
8559
  let updateSelection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
8560
+ return _ref21 => {
8561
  let {
8562
  select,
8563
  dispatch
8564
+ } = _ref21;
8565
 
8566
  if (!clientIds || !clientIds.length) {
8567
  return;
8599
  * @param {string} clientId
8600
  */
8601
 
8602
+ const insertBeforeBlock = clientId => _ref22 => {
8603
  let {
8604
  select,
8605
  dispatch
8606
+ } = _ref22;
8607
 
8608
  if (!clientId) {
8609
  return;
8625
  * @param {string} clientId
8626
  */
8627
 
8628
+ const insertAfterBlock = clientId => _ref23 => {
8629
  let {
8630
  select,
8631
  dispatch
8632
+ } = _ref23;
8633
 
8634
  if (!clientId) {
8635
  return;
8665
  * @param {string} clientId Target block client ID.
8666
  */
8667
 
8668
+ const flashBlock = clientId => async _ref24 => {
8669
  let {
8670
  dispatch
8671
+ } = _ref24;
8672
  dispatch(toggleBlockHighlight(clientId, true));
8673
  await new Promise(resolve => setTimeout(resolve, 150));
8674
  dispatch(toggleBlockHighlight(clientId, false));
9500
  * External dependencies
9501
  */
9502
 
9503
+ /**
9504
+ * WordPress dependencies
9505
+ */
9506
+
9507
+
9508
  /**
9509
  * Removed falsy values from nested object.
9510
  *
9571
  });
9572
  return returnBlock;
9573
  }
9574
+ /**
9575
+ * Check whether serialization of specific block support feature or set should
9576
+ * be skipped.
9577
+ *
9578
+ * @param {string|Object} blockType Block name or block type object.
9579
+ * @param {string} featureSet Name of block support feature set.
9580
+ * @param {string} feature Name of the individual feature to check.
9581
+ *
9582
+ * @return {boolean} Whether serialization should occur.
9583
+ */
9584
+
9585
+ function shouldSkipSerialization(blockType, featureSet, feature) {
9586
+ const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, featureSet);
9587
+ const skipSerialization = support === null || support === void 0 ? void 0 : support.__experimentalSkipSerialization;
9588
+
9589
+ if (Array.isArray(skipSerialization)) {
9590
+ return skipSerialization.includes(feature);
9591
+ }
9592
+
9593
+ return skipSerialization;
9594
+ }
9595
 
9596
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inspector-controls/block-support-tools-panel.js
9597
 
10257
  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;
10258
  }
10259
  /**
10260
+ * Returns a BoxControl object value from a given blockGap style value.
10261
  * The string check is for backwards compatibility before Gutenberg supported
10262
  * split gap values (row and column) and the value was a string n + unit.
10263
  *
10264
+ * @param {string? | Object?} blockGapValue A block gap string or axial object value, e.g., '10px' or { top: '10px', left: '10px'}.
10265
+ * @return {Object|null} A value to pass to the BoxControl component.
10266
  */
10267
 
10268
+ function getGapBoxControlValueFromStyle(blockGapValue) {
10269
+ if (!blockGapValue) {
10270
+ return null;
10271
  }
10272
 
10273
+ const isValueString = typeof blockGapValue === 'string';
10274
  return {
10275
+ top: isValueString ? blockGapValue : blockGapValue === null || blockGapValue === void 0 ? void 0 : blockGapValue.top,
10276
+ left: isValueString ? blockGapValue : blockGapValue === null || blockGapValue === void 0 ? void 0 : blockGapValue.left
10277
  };
10278
  }
10279
  /**
10280
  * Returns a CSS value for the `gap` property from a given blockGap style.
10281
  *
10282
+ * @param {string? | Object?} blockGapValue A block gap string or axial object value, e.g., '10px' or { top: '10px', left: '10px'}.
10283
  * @param {string?} defaultValue A default gap value.
10284
  * @return {string|null} The concatenated gap value (row and column).
10285
  */
10286
 
10287
  function getGapCSSValue(blockGapValue) {
10288
  let defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '0';
10289
+ const blockGapBoxControlValue = getGapBoxControlValueFromStyle(blockGapValue);
10290
 
10291
  if (!blockGapBoxControlValue) {
10292
  return null;
10364
  return null;
10365
  }
10366
 
10367
+ const splitOnAxis = sides && sides.some(side => AXIAL_SIDES.includes(side));
10368
+
10369
  const onChange = next => {
10370
  var _window;
10371
 
10372
+ let blockGap = next; // If splitOnAxis activated we need to return a BoxControl object to the BoxControl component.
10373
+
10374
+ if (!!next && splitOnAxis) {
10375
+ blockGap = { ...getGapBoxControlValueFromStyle(next)
10376
+ };
10377
+ }
10378
+
10379
  const newStyle = { ...style,
10380
  spacing: { ...(style === null || style === void 0 ? void 0 : style.spacing),
10381
+ blockGap
 
10382
  }
10383
  };
10384
  setAttributes({
10396
  }
10397
  };
10398
 
10399
+ const gapValue = getGapBoxControlValueFromStyle(style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap); // The BoxControl component expects a full complement of side values.
 
10400
  // Gap row and column values translate to top/bottom and left/right respectively.
10401
 
10402
  const boxControlGapValue = splitOnAxis ? { ...gapValue,
10426
  });
10427
  }
10428
 
10429
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-vertical-alignment-control/icons.js
10430
+
10431
+
10432
+ /**
10433
+ * WordPress dependencies
10434
+ */
10435
+
10436
+ const alignBottom = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
10437
+ xmlns: "http://www.w3.org/2000/svg",
10438
+ viewBox: "0 0 24 24"
10439
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
10440
+ d: "M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"
10441
+ }));
10442
+ const alignCenter = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
10443
+ xmlns: "http://www.w3.org/2000/svg",
10444
+ viewBox: "0 0 24 24"
10445
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
10446
+ d: "M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"
10447
+ }));
10448
+ const alignTop = (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
10449
+ xmlns: "http://www.w3.org/2000/svg",
10450
+ viewBox: "0 0 24 24"
10451
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Path, {
10452
+ d: "M9 20h6V9H9v11zM4 4v1.5h16V4H4z"
10453
+ }));
10454
+
10455
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-vertical-alignment-control/ui.js
10456
+
10457
+
10458
+
10459
+ /**
10460
+ * WordPress dependencies
10461
+ */
10462
+
10463
+
10464
+ /**
10465
+ * Internal dependencies
10466
+ */
10467
+
10468
+
10469
+ const BLOCK_ALIGNMENTS_CONTROLS = {
10470
+ top: {
10471
+ icon: alignTop,
10472
+ title: (0,external_wp_i18n_namespaceObject._x)('Align top', 'Block vertical alignment setting')
10473
+ },
10474
+ center: {
10475
+ icon: alignCenter,
10476
+ title: (0,external_wp_i18n_namespaceObject._x)('Align middle', 'Block vertical alignment setting')
10477
+ },
10478
+ bottom: {
10479
+ icon: alignBottom,
10480
+ title: (0,external_wp_i18n_namespaceObject._x)('Align bottom', 'Block vertical alignment setting')
10481
+ }
10482
+ };
10483
+ const DEFAULT_CONTROLS = ['top', 'center', 'bottom'];
10484
+ const DEFAULT_CONTROL = 'top';
10485
+ const POPOVER_PROPS = {
10486
+ isAlternate: true
10487
+ };
10488
+
10489
+ function BlockVerticalAlignmentUI(_ref) {
10490
+ let {
10491
+ value,
10492
+ onChange,
10493
+ controls = DEFAULT_CONTROLS,
10494
+ isCollapsed = true,
10495
+ isToolbar
10496
+ } = _ref;
10497
+
10498
+ function applyOrUnset(align) {
10499
+ return () => onChange(value === align ? undefined : align);
10500
+ }
10501
+
10502
+ const activeAlignment = BLOCK_ALIGNMENTS_CONTROLS[value];
10503
+ const defaultAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[DEFAULT_CONTROL];
10504
+ const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu;
10505
+ const extraProps = isToolbar ? {
10506
+ isCollapsed
10507
+ } : {};
10508
+ return (0,external_wp_element_namespaceObject.createElement)(UIComponent, _extends({
10509
+ popoverProps: POPOVER_PROPS,
10510
+ icon: activeAlignment ? activeAlignment.icon : defaultAlignmentControl.icon,
10511
+ label: (0,external_wp_i18n_namespaceObject._x)('Change vertical alignment', 'Block vertical alignment setting label'),
10512
+ controls: controls.map(control => {
10513
+ return { ...BLOCK_ALIGNMENTS_CONTROLS[control],
10514
+ isActive: value === control,
10515
+ role: isCollapsed ? 'menuitemradio' : undefined,
10516
+ onClick: applyOrUnset(control)
10517
+ };
10518
+ })
10519
+ }, extraProps));
10520
+ }
10521
+ /**
10522
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-vertical-alignment-toolbar/README.md
10523
+ */
10524
+
10525
+
10526
+ /* harmony default export */ var ui = (BlockVerticalAlignmentUI);
10527
+
10528
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-vertical-alignment-control/index.js
10529
+
10530
+
10531
+
10532
+ /**
10533
+ * Internal dependencies
10534
+ */
10535
+
10536
+
10537
+ const BlockVerticalAlignmentControl = props => {
10538
+ return (0,external_wp_element_namespaceObject.createElement)(ui, _extends({}, props, {
10539
+ isToolbar: false
10540
+ }));
10541
+ };
10542
+
10543
+ const BlockVerticalAlignmentToolbar = props => {
10544
+ return (0,external_wp_element_namespaceObject.createElement)(ui, _extends({}, props, {
10545
+ isToolbar: true
10546
+ }));
10547
+ };
10548
+ /**
10549
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-vertical-alignment-control/README.md
10550
+ */
10551
+
10552
+
10553
+
10554
+
10555
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/justify-content-control/ui.js
10556
 
10557
 
10628
  }, extraProps));
10629
  }
10630
 
10631
+ /* harmony default export */ var justify_content_control_ui = (JustifyContentUI);
10632
 
10633
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/justify-content-control/index.js
10634
 
10638
  * Internal dependencies
10639
  */
10640
 
10641
+
10642
+ const JustifyContentControl = props => {
10643
+ return (0,external_wp_element_namespaceObject.createElement)(justify_content_control_ui, _extends({}, props, {
10644
  isToolbar: false
10645
  }));
10646
+ };
10647
+
10648
+ const JustifyToolbar = props => {
10649
+ return (0,external_wp_element_namespaceObject.createElement)(justify_content_control_ui, _extends({}, props, {
10650
  isToolbar: true
10651
  }));
10652
+ };
10653
+ /**
10654
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/justify-content-control/README.md
10655
+ */
10656
+
10657
+
10658
+
10659
 
10660
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/layouts/flex.js
10661
 
10673
 
10674
 
10675
 
10676
+
10677
  // Used with the default, horizontal flex orientation.
10678
 
10679
  const justifyContentMap = {
10688
  right: 'flex-end',
10689
  center: 'center'
10690
  };
10691
+ const verticalAlignmentMap = {
10692
+ top: 'flex-start',
10693
+ center: 'center',
10694
+ bottom: 'flex-end'
10695
+ };
10696
  const flexWrapOptions = ['wrap', 'nowrap'];
10697
  /* harmony default export */ var flex = ({
10698
  name: 'flex',
10728
  return null;
10729
  }
10730
 
10731
+ const {
10732
+ allowVerticalAlignment = true
10733
+ } = layoutBlockSupport;
10734
  return (0,external_wp_element_namespaceObject.createElement)(block_controls, {
10735
  group: "block",
10736
  __experimentalShareWithChildBlocks: true
10738
  layout: layout,
10739
  onChange: onChange,
10740
  isToolbar: true
10741
+ }), allowVerticalAlignment && (layout === null || layout === void 0 ? void 0 : layout.orientation) !== 'vertical' && (0,external_wp_element_namespaceObject.createElement)(FlexLayoutVerticalAlignmentControl, {
10742
+ layout: layout,
10743
+ onChange: onChange,
10744
+ isToolbar: true
10745
  }));
10746
  },
10747
  save: function FlexLayoutStyle(_ref3) {
10748
+ var _style$spacing, _style$spacing2;
10749
 
10750
  let {
10751
  selector,
10752
  layout,
10753
+ style,
10754
+ blockName
10755
  } = _ref3;
10756
  const {
10757
  orientation = 'horizontal'
10758
  } = layout;
10759
  const blockGapSupport = useSetting('spacing.blockGap');
10760
+ const hasBlockGapStylesSupport = blockGapSupport !== null; // If a block's block.json skips serialization for spacing or spacing.blockGap,
10761
+ // don't apply the user-defined value to the styles.
10762
+
10763
+ const blockGapValue = style !== null && style !== void 0 && (_style$spacing = style.spacing) !== null && _style$spacing !== void 0 && _style$spacing.blockGap && !shouldSkipSerialization(blockName, 'spacing', 'blockGap') ? getGapCSSValue(style === null || style === void 0 ? void 0 : (_style$spacing2 = style.spacing) === null || _style$spacing2 === void 0 ? void 0 : _style$spacing2.blockGap, '0.5em') : 'var( --wp--style--block-gap, 0.5em )';
10764
  const justifyContent = justifyContentMap[layout.justifyContent] || justifyContentMap.left;
10765
  const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : 'wrap';
10766
+ const verticalAlignment = verticalAlignmentMap[layout.verticalAlignment] || verticalAlignmentMap.center;
10767
  const rowOrientation = `
10768
  flex-direction: row;
10769
+ align-items: ${verticalAlignment};
10770
  justify-content: ${justifyContent};
10771
  `;
10772
  const alignItems = alignItemsMap[layout.justifyContent] || alignItemsMap.left;
10801
 
10802
  });
10803
 
10804
+ function FlexLayoutVerticalAlignmentControl(_ref4) {
10805
  let {
10806
  layout,
10807
  onChange,
10808
  isToolbar = false
10809
  } = _ref4;
10810
+ const {
10811
+ verticalAlignment = verticalAlignmentMap.center
10812
+ } = layout;
10813
+
10814
+ const onVerticalAlignmentChange = value => {
10815
+ onChange({ ...layout,
10816
+ verticalAlignment: value
10817
+ });
10818
+ };
10819
+
10820
+ if (isToolbar) {
10821
+ return (0,external_wp_element_namespaceObject.createElement)(BlockVerticalAlignmentControl, {
10822
+ onChange: onVerticalAlignmentChange,
10823
+ value: verticalAlignment
10824
+ });
10825
+ }
10826
+
10827
+ const verticalAlignmentOptions = [{
10828
+ value: 'flex-start',
10829
+ label: (0,external_wp_i18n_namespaceObject.__)('Align items top')
10830
+ }, {
10831
+ value: 'center',
10832
+ label: (0,external_wp_i18n_namespaceObject.__)('Align items center')
10833
+ }, {
10834
+ value: 'flex-end',
10835
+ label: (0,external_wp_i18n_namespaceObject.__)('Align items bottom')
10836
+ }];
10837
+ return (0,external_wp_element_namespaceObject.createElement)("fieldset", {
10838
+ className: "block-editor-hooks__flex-layout-vertical-alignment-control"
10839
+ }, (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_i18n_namespaceObject.__)('Vertical alignment')), (0,external_wp_element_namespaceObject.createElement)("div", null, verticalAlignmentOptions.map((value, icon, label) => {
10840
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
10841
+ key: value,
10842
+ label: label,
10843
+ icon: icon,
10844
+ isPressed: verticalAlignment === value,
10845
+ onClick: () => onVerticalAlignmentChange(value)
10846
+ });
10847
+ })));
10848
+ }
10849
+
10850
+ function FlexLayoutJustifyContentControl(_ref5) {
10851
+ let {
10852
+ layout,
10853
+ onChange,
10854
+ isToolbar = false
10855
+ } = _ref5;
10856
  const {
10857
  justifyContent = 'left',
10858
  orientation = 'horizontal'
10906
 
10907
  return (0,external_wp_element_namespaceObject.createElement)("fieldset", {
10908
  className: "block-editor-hooks__flex-layout-justification-controls"
10909
+ }, (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_i18n_namespaceObject.__)('Justification')), (0,external_wp_element_namespaceObject.createElement)("div", null, justificationOptions.map(_ref6 => {
10910
  let {
10911
  value,
10912
  icon,
10913
  label
10914
+ } = _ref6;
10915
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
10916
  key: value,
10917
  label: label,
10922
  })));
10923
  }
10924
 
10925
+ function FlexWrapControl(_ref7) {
10926
  let {
10927
  layout,
10928
  onChange
10929
+ } = _ref7;
10930
  const {
10931
  flexWrap = 'wrap'
10932
  } = layout;
10941
  });
10942
  }
10943
 
10944
+ function OrientationControl(_ref8) {
10945
  let {
10946
  layout,
10947
  onChange
10948
+ } = _ref8;
10949
  const {
10950
  orientation = 'horizontal'
10951
  } = layout;
11016
 
11017
 
11018
 
11019
+
11020
  /* harmony default export */ var flow = ({
11021
  name: 'default',
11022
  label: (0,external_wp_i18n_namespaceObject.__)('Flow'),
11085
  return null;
11086
  },
11087
  save: function DefaultLayoutStyle(_ref2) {
11088
+ var _style$spacing;
11089
 
11090
  let {
11091
  selector,
11092
  layout = {},
11093
+ style,
11094
+ blockName
11095
  } = _ref2;
11096
  const {
11097
  contentSize,
11099
  } = layout;
11100
  const blockGapSupport = useSetting('spacing.blockGap');
11101
  const hasBlockGapStylesSupport = blockGapSupport !== null;
11102
+ const blockGapStyleValue = getGapBoxControlValueFromStyle(style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap); // If a block's block.json skips serialization for spacing or
11103
+ // spacing.blockGap, don't apply the user-defined value to the styles.
11104
+
11105
+ const blockGapValue = blockGapStyleValue !== null && blockGapStyleValue !== void 0 && blockGapStyleValue.top && !shouldSkipSerialization(blockName, 'spacing', 'blockGap') ? blockGapStyleValue === null || blockGapStyleValue === void 0 ? void 0 : blockGapStyleValue.top : 'var( --wp--style--block-gap )';
11106
  let output = !!contentSize || !!wideSize ? `
11107
  ${appendSelectors(selector, '> :where(:not(.alignleft):not(.alignright))')} {
11108
  max-width: ${contentSize !== null && contentSize !== void 0 ? contentSize : wideSize};
11321
 
11322
 
11323
 
11324
+ const use_available_alignments_DEFAULT_CONTROLS = ['none', 'left', 'center', 'right', 'wide', 'full'];
11325
  const WIDE_CONTROLS = ['wide', 'full'];
11326
  function useAvailableAlignments() {
11327
+ let controls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : use_available_alignments_DEFAULT_CONTROLS;
11328
 
11329
  // Always add the `none` option if not exists.
11330
  if (!controls.includes('none')) {
11370
  }
11371
 
11372
  const {
11373
+ alignments: availableAlignments = use_available_alignments_DEFAULT_CONTROLS
11374
  } = layout;
11375
  const enabledControls = controls.filter(control => (layout.alignments || // Ignore the global wideAlignment check if the layout explicitely defines alignments.
11376
  wideControlsEnabled || !WIDE_CONTROLS.includes(control)) && availableAlignments.includes(control)).map(enabledControl => ({
11406
  */
11407
 
11408
 
11409
+ const ui_BLOCK_ALIGNMENTS_CONTROLS = {
11410
  none: {
11411
  icon: align_none,
11412
+ title: (0,external_wp_i18n_namespaceObject._x)('None', 'Alignment option')
11413
  },
11414
  left: {
11415
  icon: position_left,
11432
  title: (0,external_wp_i18n_namespaceObject.__)('Full width')
11433
  }
11434
  };
11435
+ const ui_DEFAULT_CONTROL = 'none';
11436
+ const ui_POPOVER_PROPS = {
11437
  isAlternate: true
11438
  };
11439
 
11456
  onChange([value, 'none'].includes(align) ? undefined : align);
11457
  }
11458
 
11459
+ const activeAlignmentControl = ui_BLOCK_ALIGNMENTS_CONTROLS[value];
11460
+ const defaultAlignmentControl = ui_BLOCK_ALIGNMENTS_CONTROLS[ui_DEFAULT_CONTROL];
11461
  const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu;
11462
  const commonProps = {
11463
+ popoverProps: ui_POPOVER_PROPS,
11464
  icon: activeAlignmentControl ? activeAlignmentControl.icon : defaultAlignmentControl.icon,
11465
  label: (0,external_wp_i18n_namespaceObject.__)('Align'),
11466
  toggleProps: {
11473
  let {
11474
  name: controlName
11475
  } = _ref2;
11476
+ return { ...ui_BLOCK_ALIGNMENTS_CONTROLS[controlName],
11477
  isActive: value === controlName || !value && controlName === 'none',
11478
  role: isCollapsed ? 'menuitemradio' : undefined,
11479
  onClick: () => onChangeAlignment(controlName)
11494
  const {
11495
  icon,
11496
  title
11497
+ } = ui_BLOCK_ALIGNMENTS_CONTROLS[controlName]; // If no value is provided, mark as selected the `none` option.
11498
 
11499
  const isSelected = controlName === value || !value && controlName === 'none';
11500
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
11528
  * Internal dependencies
11529
  */
11530
 
11531
+
11532
+ const BlockAlignmentControl = props => {
11533
  return (0,external_wp_element_namespaceObject.createElement)(block_alignment_control_ui, _extends({}, props, {
11534
  isToolbar: false
11535
  }));
11536
+ };
11537
+
11538
+ const BlockAlignmentToolbar = props => {
11539
  return (0,external_wp_element_namespaceObject.createElement)(block_alignment_control_ui, _extends({}, props, {
11540
  isToolbar: true
11541
  }));
11542
+ };
11543
+ /**
11544
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-alignment-control/README.md
11545
+ */
11546
+
11547
+
11548
+
11549
 
11550
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/align.js
11551
 
12158
  };
12159
  /* harmony default export */ var styles_padding = (padding);
12160
 
12161
+ ;// CONCATENATED MODULE: ./packages/style-engine/build-module/styles/margin.js
12162
+ /**
12163
+ * Internal dependencies
12164
+ */
12165
+
12166
+ const margin = {
12167
+ name: 'margin',
12168
+ generate: (style, options) => {
12169
+ return generateBoxRules(style, options, ['spacing', 'margin'], 'margin');
12170
+ }
12171
+ };
12172
+ /* harmony default export */ var styles_margin = (margin);
12173
+
12174
  ;// CONCATENATED MODULE: ./packages/style-engine/build-module/styles/index.js
12175
  /**
12176
  * Internal dependencies
12177
  */
12178
 
12179
+
12180
+ const styleDefinitions = [styles_margin, styles_padding];
12181
 
12182
  ;// CONCATENATED MODULE: ./packages/style-engine/build-module/index.js
12183
  /**
16987
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/utils/dom.js
16988
  const BLOCK_SELECTOR = '.block-editor-block-list__block';
16989
  const APPENDER_SELECTOR = '.block-list-appender';
16990
+ const BLOCK_APPENDER_CLASS = '.block-editor-button-block-appender';
16991
  /**
16992
  * Returns true if two elements are contained within the same block.
16993
  *
17012
  */
17013
 
17014
  function isInsideRootBlock(blockElement, element) {
17015
+ const parentBlock = element.closest([BLOCK_SELECTOR, APPENDER_SELECTOR, BLOCK_APPENDER_CLASS].join(','));
17016
  return parentBlock === blockElement;
17017
  }
17018
  /**
17045
  return blockNode.id.slice('block-'.length);
17046
  }
17047
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17048
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-list/use-block-props/use-focus-first-element.js
17049
  /**
17050
  * External dependencies
17063
 
17064
 
17065
 
 
17066
  /** @typedef {import('@wordpress/element').RefObject} RefObject */
17067
 
17068
  /**
17078
  return (0,external_wp_data_namespaceObject.useSelect)(select => {
17079
  const {
17080
  getSelectedBlocksInitialCaretPosition,
 
17081
  isNavigationMode,
17082
  isBlockSelected
17083
  } = select(store);
17086
  return;
17087
  }
17088
 
17089
+ if (isNavigationMode()) {
17090
  return;
17091
  } // If there's no initial position, return 0 to focus the start.
17092
 
17094
  return getSelectedBlocksInitialCaretPosition();
17095
  }, [clientId]);
17096
  }
 
 
 
 
 
 
 
17097
  /**
17098
  * Transitions focus to the block or inner tabbable when the block becomes
17099
  * selected and an initial position is set.
17107
  function useFocusFirstElement(clientId) {
17108
  const ref = (0,external_wp_element_namespaceObject.useRef)();
17109
  const initialPosition = useInitialPosition(clientId);
17110
+ const {
17111
+ isBlockSelected,
17112
+ isMultiSelecting
17113
+ } = (0,external_wp_data_namespaceObject.useSelect)(store);
17114
  (0,external_wp_element_namespaceObject.useEffect)(() => {
17115
+ // Check if the block is still selected at the time this effect runs.
17116
+ if (!isBlockSelected(clientId) || isMultiSelecting()) {
17117
+ return;
17118
+ }
17119
+
17120
  if (initialPosition === undefined || initialPosition === null) {
17121
  return;
17122
  }
17146
  } // Check to see if element is focussable before a generic caret insert.
17147
 
17148
 
17149
+ if (!ref.current.getAttribute('contenteditable')) {
17150
+ const focusElement = external_wp_dom_namespaceObject.focus.tabbable.findNext(ref.current); // Make sure focusElement is valid, contained in the same block, and a form field.
 
17151
 
17152
+ if (focusElement && isInsideRootBlock(ref.current, focusElement) && (0,external_wp_dom_namespaceObject.isFormElement)(focusElement)) {
17153
  focusElement.focus();
17154
  return;
17155
  }
17156
  }
17157
 
 
17158
  (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(target, isReverse);
17159
+ }, [initialPosition, clientId]);
17160
  return ref;
17161
  }
17162
 
17437
  * @param {FocusEvent} event Focus event.
17438
  */
17439
  function onFocus(event) {
17440
+ // When the whole editor is editable, let writing flow handle
17441
+ // selection.
17442
+ if (node.parentElement.closest('[contenteditable="true"]')) {
17443
+ return;
17444
+ } // Check synchronously because a non-selected block might be
17445
  // getting data through `useSelect` asynchronously.
17446
+
17447
+
17448
  if (isBlockSelected(clientId)) {
17449
  // Potentially change selection away from rich text.
17450
  if (!event.target.isContentEditable) {
17611
  }, [clientId, isNavigationMode, isBlockSelected, setNavigationMode]);
17612
  }
17613
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17614
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-list/use-block-props/use-intersection-observer.js
17615
  /**
17616
  * WordPress dependencies
17668
 
17669
 
17670
 
 
 
17671
  /**
17672
  * If the block count exceeds the threshold, we disable the reordering animation
17673
  * to avoid laginess.
17741
 
17742
  const blockLabel = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Block: %s'), blockTitle);
17743
  const htmlSuffix = mode === 'html' && !__unstableIsHtml ? '-visual' : '';
17744
+ const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([props.ref, useFocusFirstElement(clientId), useBlockRefProvider(clientId), useFocusHandler(clientId), useEventHandlers(clientId), useNavModeExit(clientId), useIsHovered(), useIntersectionObserver(), use_moving_animation({
 
17745
  isSelected: isPartOfSelection,
17746
  adjustScrolling,
17747
  enableAnimation,
18209
  })
18210
  }, renderedIcon);
18211
  }
18212
+ /**
18213
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-icon/README.md
18214
+ */
18215
+
18216
 
18217
  /* harmony default export */ var block_icon = ((0,external_wp_element_namespaceObject.memo)(BlockIcon));
18218
 
18698
 
18699
 
18700
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18701
 
18702
  function selector(select) {
18703
  const {
18705
  getMultiSelectedBlockClientIds,
18706
  hasMultiSelection,
18707
  getSelectedBlockClientId,
18708
+ getSelectedBlocksInitialCaretPosition,
18709
+ __unstableIsFullySelected
18710
  } = select(store);
18711
  return {
18712
  isMultiSelecting: isMultiSelecting(),
18713
  multiSelectedBlockClientIds: getMultiSelectedBlockClientIds(),
18714
  hasMultiSelection: hasMultiSelection(),
18715
  selectedBlockClientId: getSelectedBlockClientId(),
18716
+ initialPosition: getSelectedBlocksInitialCaretPosition(),
18717
+ isFullSelection: __unstableIsFullySelected()
18718
  };
18719
  }
18720
 
18721
+ function useMultiSelection() {
18722
  const {
18723
  initialPosition,
18724
  isMultiSelecting,
18725
  multiSelectedBlockClientIds,
18726
  hasMultiSelection,
18727
+ selectedBlockClientId,
18728
+ isFullSelection
18729
  } = (0,external_wp_data_namespaceObject.useSelect)(selector, []);
18730
  const selectedRef = useBlockRef(selectedBlockClientId); // These must be in the right DOM order.
18731
 
18778
 
18779
  if (length < 2) {
18780
  return;
18781
+ }
 
 
18782
 
18783
+ if (!isFullSelection) {
18784
  return;
18785
  } // Allow cross contentEditable selection by temporarily making
18786
  // all content editable. We can't rely on using the store and
18791
  node.contentEditable = true; // For some browsers, like Safari, it is important that focus happens
18792
  // BEFORE selection.
18793
 
18794
+ node.focus(); // The block refs might not be immediately available
18795
+ // when dragging blocks into another block.
18796
+
18797
+ if (!startRef.current || !endRef.current) {
18798
+ return;
18799
+ }
18800
+
18801
  const selection = defaultView.getSelection();
18802
  const range = ownerDocument.createRange(); // These must be in the right DOM order.
 
 
18803
 
18804
+ range.setStartBefore(startRef.current);
18805
+ range.setEndAfter(endRef.current);
 
 
18806
  selection.removeAllRanges();
18807
  selection.addRange(range);
18808
+ }, [hasMultiSelection, isMultiSelecting, multiSelectedBlockClientIds, selectedBlockClientId, initialPosition, isFullSelection]);
18809
  }
18810
 
18811
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/writing-flow/use-tab-nav.js
18824
  */
18825
 
18826
 
 
 
 
 
 
 
 
 
18827
  function useTabNav() {
18828
  const container = (0,external_wp_element_namespaceObject.useRef)();
18829
  const focusCaptureBeforeRef = (0,external_wp_element_namespaceObject.useRef)();
18913
  // future they can be rendered in an iframe or shadow DOM.
18914
 
18915
 
18916
+ if (((0,external_wp_dom_namespaceObject.isFormElement)(event.target) || event.target.getAttribute('data-block') === getSelectedBlockClientId()) && (0,external_wp_dom_namespaceObject.isFormElement)(external_wp_dom_namespaceObject.focus.tabbable[direction](event.target))) {
18917
  return;
18918
  }
18919
 
19100
  function useArrowNav() {
19101
  const {
19102
  getSelectedBlockClientId,
 
19103
  getMultiSelectedBlocksEndClientId,
19104
  getPreviousBlockClientId,
19105
  getNextBlockClientId,
 
 
19106
  getSettings,
19107
  hasMultiSelection
19108
  } = (0,external_wp_data_namespaceObject.useSelect)(store);
 
 
 
 
19109
  return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
19110
  // Here a DOMRect is stored while moving the caret vertically so
19111
  // vertical position of the start position can be restored. This is to
19115
  function onMouseDown() {
19116
  verticalRect = null;
19117
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19118
  /**
19119
  * Returns true if the given target field is the last in its block which
19120
  * can be considered for tab transition. For example, in a block with
19157
  } = ownerDocument;
19158
 
19159
  if (hasMultiSelection()) {
 
 
 
 
 
 
19160
  return;
19161
  } // When presing any key other than up or down, the initial vertical
19162
  // position must ALWAYS be reset. The vertical position is saved so
19204
 
19205
  if ( // Ensure that there is a target block.
19206
  (isReverse && selectionBeforeEndClientId || !isReverse && selectionAfterEndClientId) && isTabbableEdge(target, isReverse) && isNavEdge(target, isReverse)) {
19207
+ node.contentEditable = true; // Firefox doesn't automatically move focus.
19208
+
19209
+ node.focus();
 
19210
  }
19211
  } else if (isVertical && (0,external_wp_dom_namespaceObject.isVerticalEdge)(target, isReverse) && !keepCaretInsideBlock) {
19212
  const closestTabbable = getClosestTabbable(target, isReverse, node, true);
19300
  }, []);
19301
  }
19302
 
19303
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/writing-flow/use-drag-selection.js
19304
+ /**
19305
+ * WordPress dependencies
19306
+ */
19307
+
19308
+
19309
+ /**
19310
+ * Internal dependencies
19311
+ */
19312
+
19313
+
19314
+ /**
19315
+ * Sets the `contenteditable` wrapper element to `value`.
19316
+ *
19317
+ * @param {HTMLElement} node Block element.
19318
+ * @param {boolean} value `contentEditable` value (true or false)
19319
+ */
19320
+
19321
+ function setContentEditableWrapper(node, value) {
19322
+ node.contentEditable = value; // Firefox doesn't automatically move focus.
19323
+
19324
+ if (value) node.focus();
19325
+ }
19326
+ /**
19327
+ * Sets a multi-selection based on the native selection across blocks.
19328
+ */
19329
+
19330
+
19331
+ function useDragSelection() {
19332
+ const {
19333
+ startMultiSelect,
19334
+ stopMultiSelect
19335
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store);
19336
+ const {
19337
+ isSelectionEnabled,
19338
+ hasMultiSelection
19339
+ } = (0,external_wp_data_namespaceObject.useSelect)(store);
19340
+ return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
19341
+ const {
19342
+ ownerDocument
19343
+ } = node;
19344
+ const {
19345
+ defaultView
19346
+ } = ownerDocument;
19347
+ let anchorElement;
19348
+ let rafId;
19349
+
19350
+ function onMouseUp() {
19351
+ stopMultiSelect(); // Equivalent to attaching the listener once.
19352
+
19353
+ defaultView.removeEventListener('mouseup', onMouseUp); // The browser selection won't have updated yet at this point,
19354
+ // so wait until the next animation frame to get the browser
19355
+ // selection.
19356
+
19357
+ rafId = defaultView.requestAnimationFrame(() => {
19358
+ if (hasMultiSelection()) {
19359
+ return;
19360
+ } // If the selection is complete (on mouse up), and no
19361
+ // multiple blocks have been selected, set focus back to the
19362
+ // anchor element. if the anchor element contains the
19363
+ // selection. Additionally, the contentEditable wrapper can
19364
+ // now be disabled again.
19365
+
19366
+
19367
+ setContentEditableWrapper(node, false);
19368
+ const selection = defaultView.getSelection();
19369
+
19370
+ if (selection.rangeCount) {
19371
+ const {
19372
+ commonAncestorContainer
19373
+ } = selection.getRangeAt(0);
19374
+
19375
+ if (anchorElement.contains(commonAncestorContainer)) {
19376
+ anchorElement.focus();
19377
+ }
19378
+ }
19379
+ });
19380
+ }
19381
+
19382
+ function onMouseLeave(_ref) {
19383
+ let {
19384
+ buttons,
19385
+ target
19386
+ } = _ref;
19387
+
19388
+ // The primary button must be pressed to initiate selection.
19389
+ // See https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
19390
+ if (buttons !== 1) {
19391
+ return;
19392
+ } // Check the attribute, not the contentEditable attribute. All
19393
+ // child elements of the content editable wrapper are editable
19394
+ // and return true for this property. We only want to start
19395
+ // multi selecting when the mouse leaves the wrapper.
19396
+
19397
+
19398
+ if (!target.getAttribute('contenteditable')) {
19399
+ return;
19400
+ }
19401
+
19402
+ if (!isSelectionEnabled()) {
19403
+ return;
19404
+ }
19405
+
19406
+ anchorElement = ownerDocument.activeElement;
19407
+ startMultiSelect(); // `onSelectionStart` is called after `mousedown` and
19408
+ // `mouseleave` (from a block). The selection ends when
19409
+ // `mouseup` happens anywhere in the window.
19410
+
19411
+ defaultView.addEventListener('mouseup', onMouseUp); // Allow cross contentEditable selection by temporarily making
19412
+ // all content editable. We can't rely on using the store and
19413
+ // React because re-rending happens too slowly. We need to be
19414
+ // able to select across instances immediately.
19415
+
19416
+ setContentEditableWrapper(node, true);
19417
+ }
19418
+
19419
+ node.addEventListener('mouseout', onMouseLeave);
19420
+ return () => {
19421
+ node.removeEventListener('mouseout', onMouseLeave);
19422
+ defaultView.removeEventListener('mouseup', onMouseUp);
19423
+ defaultView.cancelAnimationFrame(rafId);
19424
+ };
19425
+ }, [startMultiSelect, stopMultiSelect, isSelectionEnabled, hasMultiSelection]);
19426
+ }
19427
+
19428
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/writing-flow/use-selection-observer.js
19429
+ /**
19430
+ * WordPress dependencies
19431
+ */
19432
+
19433
+
19434
+ /**
19435
+ * Internal dependencies
19436
+ */
19437
+
19438
+
19439
+
19440
+ /**
19441
+ * Extract the selection start node from the selection. When the anchor node is
19442
+ * not a text node, the selection offset is the index of a child node.
19443
+ *
19444
+ * @param {Selection} selection The selection.
19445
+ *
19446
+ * @return {Element} The selection start node.
19447
+ */
19448
+
19449
+ function extractSelectionStartNode(selection) {
19450
+ const {
19451
+ anchorNode,
19452
+ anchorOffset
19453
+ } = selection;
19454
+
19455
+ if (anchorNode.nodeType === anchorNode.TEXT_NODE) {
19456
+ return anchorNode;
19457
+ }
19458
+
19459
+ return anchorNode.childNodes[anchorOffset];
19460
+ }
19461
+ /**
19462
+ * Extract the selection end node from the selection. When the focus node is not
19463
+ * a text node, the selection offset is the index of a child node. The selection
19464
+ * reaches up to but excluding that child node.
19465
+ *
19466
+ * @param {Selection} selection The selection.
19467
+ *
19468
+ * @return {Element} The selection start node.
19469
+ */
19470
+
19471
+
19472
+ function extractSelectionEndNode(selection) {
19473
+ const {
19474
+ focusNode,
19475
+ focusOffset
19476
+ } = selection;
19477
+
19478
+ if (focusNode.nodeType === focusNode.TEXT_NODE) {
19479
+ return focusNode;
19480
+ }
19481
+
19482
+ return focusNode.childNodes[focusOffset - 1];
19483
+ }
19484
+
19485
+ function findDepth(a, b) {
19486
+ let depth = 0;
19487
+
19488
+ while (a[depth] === b[depth]) {
19489
+ depth++;
19490
+ }
19491
+
19492
+ return depth;
19493
+ }
19494
+ /**
19495
+ * Sets the `contenteditable` wrapper element to `value`.
19496
+ *
19497
+ * @param {HTMLElement} node Block element.
19498
+ * @param {boolean} value `contentEditable` value (true or false)
19499
+ */
19500
+
19501
+
19502
+ function use_selection_observer_setContentEditableWrapper(node, value) {
19503
+ node.contentEditable = value; // Firefox doesn't automatically move focus.
19504
+
19505
+ if (value) node.focus();
19506
+ }
19507
+ /**
19508
+ * Sets a multi-selection based on the native selection across blocks.
19509
+ */
19510
+
19511
+
19512
+ function useSelectionObserver() {
19513
+ const {
19514
+ multiSelect,
19515
+ selectBlock,
19516
+ selectionChange
19517
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store);
19518
+ const {
19519
+ getBlockParents
19520
+ } = (0,external_wp_data_namespaceObject.useSelect)(store);
19521
+ return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
19522
+ const {
19523
+ ownerDocument
19524
+ } = node;
19525
+ const {
19526
+ defaultView
19527
+ } = ownerDocument;
19528
+
19529
+ function onSelectionChange() {
19530
+ const selection = defaultView.getSelection(); // If no selection is found, end multi selection and disable the
19531
+ // contentEditable wrapper.
19532
+
19533
+ if (!selection.rangeCount || selection.isCollapsed) {
19534
+ use_selection_observer_setContentEditableWrapper(node, false);
19535
+ return;
19536
+ }
19537
+
19538
+ const clientId = getBlockClientId(extractSelectionStartNode(selection));
19539
+ const endClientId = getBlockClientId(extractSelectionEndNode(selection));
19540
+ const isSingularSelection = clientId === endClientId;
19541
+
19542
+ if (isSingularSelection) {
19543
+ selectBlock(clientId);
19544
+ } else {
19545
+ const startPath = [...getBlockParents(clientId), clientId];
19546
+ const endPath = [...getBlockParents(endClientId), endClientId];
19547
+ const depth = findDepth(startPath, endPath);
19548
+ multiSelect(startPath[depth], endPath[depth]);
19549
+ }
19550
+ }
19551
+
19552
+ function addListeners() {
19553
+ ownerDocument.addEventListener('selectionchange', onSelectionChange);
19554
+ defaultView.addEventListener('mouseup', onSelectionChange);
19555
+ }
19556
+
19557
+ function removeListeners() {
19558
+ ownerDocument.removeEventListener('selectionchange', onSelectionChange);
19559
+ defaultView.removeEventListener('mouseup', onSelectionChange);
19560
+ }
19561
+
19562
+ function resetListeners() {
19563
+ removeListeners();
19564
+ addListeners();
19565
+ }
19566
+
19567
+ addListeners(); // We must allow rich text to set selection first. This ensures that
19568
+ // our `selectionchange` listener is always reset to be called after
19569
+ // the rich text one.
19570
+
19571
+ node.addEventListener('focusin', resetListeners);
19572
+ return () => {
19573
+ removeListeners();
19574
+ node.removeEventListener('focusin', resetListeners);
19575
+ };
19576
+ }, [multiSelect, selectBlock, selectionChange, getBlockParents]);
19577
+ }
19578
+
19579
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/writing-flow/use-click-selection.js
19580
+ /**
19581
+ * WordPress dependencies
19582
+ */
19583
+
19584
+
19585
+ /**
19586
+ * Internal dependencies
19587
+ */
19588
+
19589
+
19590
+
19591
+ function useClickSelection() {
19592
+ const {
19593
+ multiSelect,
19594
+ selectBlock
19595
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store);
19596
+ const {
19597
+ isSelectionEnabled,
19598
+ getBlockParents,
19599
+ getBlockSelectionStart,
19600
+ hasMultiSelection
19601
+ } = (0,external_wp_data_namespaceObject.useSelect)(store);
19602
+ return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
19603
+ function onMouseDown(event) {
19604
+ // The main button.
19605
+ // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
19606
+ if (!isSelectionEnabled() || event.button !== 0) {
19607
+ return;
19608
+ }
19609
+
19610
+ const startClientId = getBlockSelectionStart();
19611
+ const clickedClientId = getBlockClientId(event.target);
19612
+
19613
+ if (event.shiftKey) {
19614
+ if (startClientId !== clickedClientId) {
19615
+ node.contentEditable = true; // Firefox doesn't automatically move focus.
19616
+
19617
+ node.focus();
19618
+ }
19619
+ } else if (hasMultiSelection()) {
19620
+ // Allow user to escape out of a multi-selection to a
19621
+ // singular selection of a block via click. This is handled
19622
+ // here since focus handling excludes blocks when there is
19623
+ // multiselection, as focus can be incurred by starting a
19624
+ // multiselection (focus moved to first block's multi-
19625
+ // controls).
19626
+ selectBlock(clickedClientId);
19627
+ }
19628
+ }
19629
+
19630
+ node.addEventListener('mousedown', onMouseDown);
19631
+ return () => {
19632
+ node.removeEventListener('mousedown', onMouseDown);
19633
+ };
19634
+ }, [multiSelect, selectBlock, isSelectionEnabled, getBlockParents, getBlockSelectionStart, hasMultiSelection]);
19635
+ }
19636
+
19637
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/writing-flow/use-input.js
19638
+ /**
19639
+ * WordPress dependencies
19640
+ */
19641
+
19642
+
19643
+
19644
+
19645
+ /**
19646
+ * Internal dependencies
19647
+ */
19648
+
19649
+
19650
+ /**
19651
+ * Handles input for selections across blocks.
19652
+ */
19653
+
19654
+ function useInput() {
19655
+ const {
19656
+ __unstableIsFullySelected,
19657
+ getSelectedBlockClientIds,
19658
+ __unstableIsSelectionMergeable,
19659
+ hasMultiSelection
19660
+ } = (0,external_wp_data_namespaceObject.useSelect)(store);
19661
+ const {
19662
+ replaceBlocks,
19663
+ __unstableSplitSelection,
19664
+ removeBlocks,
19665
+ __unstableDeleteSelection,
19666
+ __unstableExpandSelection
19667
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store);
19668
+ return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
19669
+ function onKeyDown(event) {
19670
+ if (event.defaultPrevented) {
19671
+ return;
19672
+ }
19673
+
19674
+ if (!hasMultiSelection()) {
19675
+ return;
19676
+ }
19677
+
19678
+ if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER) {
19679
+ node.contentEditable = false;
19680
+ event.preventDefault();
19681
+
19682
+ if (__unstableIsFullySelected()) {
19683
+ replaceBlocks(getSelectedBlockClientIds(), (0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()));
19684
+ } else {
19685
+ __unstableSplitSelection();
19686
+ }
19687
+ } else if (event.keyCode === external_wp_keycodes_namespaceObject.BACKSPACE || event.keyCode === external_wp_keycodes_namespaceObject.DELETE) {
19688
+ node.contentEditable = false;
19689
+ event.preventDefault();
19690
+
19691
+ if (__unstableIsFullySelected()) {
19692
+ removeBlocks(getSelectedBlockClientIds());
19693
+ } else if (__unstableIsSelectionMergeable()) {
19694
+ __unstableDeleteSelection(event.keyCode === external_wp_keycodes_namespaceObject.DELETE);
19695
+ } else {
19696
+ __unstableExpandSelection();
19697
+ }
19698
+ } else if ( // If key.length is longer than 1, it's a control key that doesn't
19699
+ // input anything.
19700
+ event.key.length === 1 && !(event.metaKey || event.ctrlKey)) {
19701
+ node.contentEditable = false;
19702
+
19703
+ if (__unstableIsSelectionMergeable()) {
19704
+ __unstableDeleteSelection(event.keyCode === external_wp_keycodes_namespaceObject.DELETE);
19705
+ } else {
19706
+ event.preventDefault(); // Safari does not stop default behaviour with either
19707
+ // event.preventDefault() or node.contentEditable = false, so
19708
+ // remove the selection to stop browser manipulation.
19709
+
19710
+ node.ownerDocument.defaultView.getSelection().removeAllRanges();
19711
+ }
19712
+ }
19713
+ }
19714
+
19715
+ function onCompositionStart(event) {
19716
+ if (!hasMultiSelection()) {
19717
+ return;
19718
+ }
19719
+
19720
+ node.contentEditable = false;
19721
+
19722
+ if (__unstableIsSelectionMergeable()) {
19723
+ __unstableDeleteSelection();
19724
+ } else {
19725
+ event.preventDefault(); // Safari does not stop default behaviour with either
19726
+ // event.preventDefault() or node.contentEditable = false, so
19727
+ // remove the selection to stop browser manipulation.
19728
+
19729
+ node.ownerDocument.defaultView.getSelection().removeAllRanges();
19730
+ }
19731
+ }
19732
+
19733
+ node.addEventListener('keydown', onKeyDown);
19734
+ node.addEventListener('compositionstart', onCompositionStart);
19735
+ return () => {
19736
+ node.removeEventListener('keydown', onKeyDown);
19737
+ node.removeEventListener('compositionstart', onCompositionStart);
19738
+ };
19739
+ }, []);
19740
+ }
19741
+
19742
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/writing-flow/index.js
19743
 
19744
 
19764
 
19765
 
19766
 
19767
+
19768
+
19769
+
19770
+
19771
  function useWritingFlow() {
19772
  const [before, ref, after] = useTabNav();
19773
  const hasMultiSelection = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).hasMultiSelection(), []);
19774
+ return [before, (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, useInput(), useDragSelection(), useSelectionObserver(), useClickSelection(), useMultiSelection(), useSelectAll(), useArrowNav(), (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
19775
  node.tabIndex = -1;
19776
  node.contentEditable = hasMultiSelection;
19777
 
20021
  documentElement.removeChild(contentDocument.head);
20022
  documentElement.removeChild(contentDocument.body);
20023
  return true;
20024
+ } // Document set with srcDoc is not immediately ready.
 
 
 
 
20025
 
20026
 
20027
+ node.addEventListener('load', setDocumentIfReady);
20028
+ return () => node.removeEventListener('load', setDocumentIfReady);
 
20029
  }, []);
20030
  const headRef = (0,external_wp_compose_namespaceObject.useRefEffect)(element => {
20031
  scripts.reduce((promise, script) => promise.then(() => loadScript(element, script)), Promise.resolve()).finally(() => {
20068
  }), head);
20069
  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, {
20070
  ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, setRef]),
20071
+ tabIndex: tabIndex // Correct doctype is required to enable rendering in standards mode
20072
+ ,
20073
+ srcDoc: "<!doctype html>",
20074
  title: (0,external_wp_i18n_namespaceObject.__)('Editor canvas')
20075
  }), 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", {
20076
  ref: headRef
21609
  function AutoBlockPreview(_ref) {
21610
  let {
21611
  viewportWidth,
21612
+ __experimentalPadding,
21613
+ __experimentalMinHeight
21614
  } = _ref;
21615
  const [containerResizeListener, {
21616
  width: containerWidth
21649
  style: {
21650
  transform: `scale(${scale})`,
21651
  height: contentHeight * scale,
21652
+ maxHeight: contentHeight > MAX_HEIGHT ? MAX_HEIGHT * scale : undefined,
21653
+ minHeight: __experimentalMinHeight
21654
  }
21655
  }, (0,external_wp_element_namespaceObject.createElement)(iframe, {
21656
  head: (0,external_wp_element_namespaceObject.createElement)(EditorStyles, {
21679
  pointerEvents: 'none',
21680
  // This is a catch-all max-height for patterns.
21681
  // See: https://github.com/WordPress/gutenberg/pull/38175.
21682
+ maxHeight: MAX_HEIGHT,
21683
+ minHeight: scale < 1 && __experimentalMinHeight ? __experimentalMinHeight / scale : __experimentalMinHeight
21684
  }
21685
  }, contentResizeListener, (0,external_wp_element_namespaceObject.createElement)(MemoizedBlockList, {
21686
  renderAppender: false
21719
  __experimentalPadding = 0,
21720
  viewportWidth = 1200,
21721
  __experimentalLive = false,
21722
+ __experimentalOnClick,
21723
+ __experimentalMinHeight
21724
  } = _ref;
21725
  const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings(), []);
21726
  const settings = (0,external_wp_element_namespaceObject.useMemo)(() => {
21742
  onClick: __experimentalOnClick
21743
  }) : (0,external_wp_element_namespaceObject.createElement)(auto, {
21744
  viewportWidth: viewportWidth,
21745
+ __experimentalPadding: __experimentalPadding,
21746
+ __experimentalMinHeight: __experimentalMinHeight
21747
  }));
21748
  }
21749
  /**
24643
  // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
24644
  , {
24645
  tabIndex: -1,
24646
+ className: classnames_default()('block-list-appender wp-block', className) // Needed in case the whole editor is content editable (for multi
24647
+ // selection). It fixes an edge case where ArrowDown and ArrowRight
24648
+ // should collapse the selection to the end of that selection and
24649
+ // not into the appender.
24650
+ ,
24651
+ contentEditable: false // The appender exists to let you add the first Paragraph before
24652
  // any is inserted. To that end, this appender should visually be
24653
  // presented as a block. That means theme CSS should style it as if
24654
  // it were an empty paragraph block. That means a `wp-block` class to
25346
  * useBlockDisplayTitle( 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1', 17 );
25347
  * ```
25348
  *
25349
+ * @param {string} clientId Client ID of block.
25350
  * @param {number|undefined} maximumLength The maximum length that the block title string may be before truncated.
25351
  * @return {?string} Block title.
25352
  */
25417
  * <BlockTitle clientId="afd1cb17-2c08-4e7a-91be-007ba7ddc3a1" maximumLength={ 17 }/>
25418
  * ```
25419
  *
25420
+ * @param {Object} props
25421
+ * @param {string} props.clientId Client ID of block.
25422
  * @param {number|undefined} props.maximumLength The maximum length that the block title string may be before truncated.
25423
  *
25424
  * @return {JSX.Element} Block title.
25550
  var _getBlockType;
25551
 
25552
  const {
25553
+ canMoveBlocks,
25554
  getBlockRootClientId,
 
25555
  getBlockName
25556
  } = select(store);
25557
  const rootClientId = getBlockRootClientId(clientIds[0]);
 
25558
  const blockName = getBlockName(clientIds[0]);
25559
  return {
25560
  srcRootClientId: rootClientId,
25561
+ isDraggable: canMoveBlocks(clientIds, rootClientId),
25562
  icon: (_getBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.icon
25563
  };
25564
  }, [clientIds]);
26495
  clientIds: clientIds
26496
  }, itemProps)))));
26497
  }
26498
+ /**
26499
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-mover/README.md
26500
+ */
26501
+
26502
 
26503
  /* harmony default export */ var block_mover = ((0,external_wp_data_namespaceObject.withSelect)((select, _ref2) => {
26504
  var _getBlockListSettings;
26811
  }));
26812
  }
26813
 
26814
+ ;// CONCATENATED MODULE: ./packages/icons/build-module/library/copy.js
26815
 
26816
 
26817
  /**
26818
  * WordPress dependencies
26819
  */
26820
 
26821
+ const copy = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
26822
  xmlns: "http://www.w3.org/2000/svg",
26823
  viewBox: "0 0 24 24"
26824
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
26825
  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"
26826
  }));
26827
+ /* harmony default export */ var library_copy = (copy);
26828
 
26829
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-switcher/preview-block-popover.js
26830
 
27569
  })).length === 1; // When selection consists of blocks of multiple types, display an
27570
  // appropriate icon to communicate the non-uniformity.
27571
 
27572
+ _icon = isSelectionOfSameType ? (_getBlockType = getBlockType(firstBlockName)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.icon : library_copy;
27573
  }
27574
 
27575
  return {
27597
  disabled: true,
27598
  className: "block-editor-block-switcher__no-switcher-icon",
27599
  title: blockTitle,
27600
+ icon: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(block_icon, {
27601
  icon: icon,
27602
  showColors: true
27603
+ }), (isReusable || isTemplate) && (0,external_wp_element_namespaceObject.createElement)("span", {
27604
+ className: "block-editor-block-switcher__toggle-text"
27605
+ }, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
27606
+ clientId: clientIds,
27607
+ maximumLength: 35
27608
+ })))
27609
  }));
27610
  }
27611
 
27685
  };
27686
  /* harmony default export */ var block_switcher = (BlockSwitcher);
27687
 
27688
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-toolbar/block-toolbar-last-item.js
27689
+ /**
27690
+ * WordPress dependencies
27691
+ */
27692
+
27693
+ const {
27694
+ Fill: __unstableBlockToolbarLastItem,
27695
+ Slot: block_toolbar_last_item_Slot
27696
+ } = (0,external_wp_components_namespaceObject.createSlotFill)('__unstableBlockToolbarLastItem');
27697
+ __unstableBlockToolbarLastItem.Slot = block_toolbar_last_item_Slot;
27698
+ /* harmony default export */ var block_toolbar_last_item = (__unstableBlockToolbarLastItem);
27699
+
27700
  ;// CONCATENATED MODULE: ./packages/icons/build-module/library/more-vertical.js
27701
 
27702
 
27851
  getBlocksByClientId,
27852
  getSelectedBlockClientIds,
27853
  hasMultiSelection,
27854
+ getSettings,
27855
+ __unstableIsFullySelected,
27856
+ __unstableIsSelectionMergeable,
27857
+ __unstableGetSelectedBlocksWithPartialSelection
27858
  } = (0,external_wp_data_namespaceObject.useSelect)(store);
27859
  const {
27860
  flashBlock,
27861
  removeBlocks,
27862
+ replaceBlocks,
27863
+ __unstableDeleteSelection,
27864
+ __unstableExpandSelection
27865
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
27866
  const notifyCopy = useNotifyCopy();
27867
  return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
27896
  const eventDefaultPrevented = event.defaultPrevented;
27897
  event.preventDefault();
27898
 
27899
+ const isFullySelected = __unstableIsFullySelected();
27900
+
27901
+ const isSelectionMergeable = __unstableIsSelectionMergeable();
27902
+
27903
+ const expandSelectionIsNeeded = !isFullySelected && !isSelectionMergeable;
27904
+
27905
  if (event.type === 'copy' || event.type === 'cut') {
27906
  if (selectedBlockClientIds.length === 1) {
27907
  flashBlock(selectedBlockClientIds[0]);
27908
+ } // If we have a partial selection that is not mergeable, just
27909
+ // expand the selection to the whole blocks.
27910
 
27911
+
27912
+ if (expandSelectionIsNeeded) {
27913
+ __unstableExpandSelection();
27914
+ } else {
27915
+ notifyCopy(event.type, selectedBlockClientIds);
27916
+ let blocks; // Check if we have partial selection.
27917
+
27918
+ if (isFullySelected) {
27919
+ blocks = getBlocksByClientId(selectedBlockClientIds);
27920
+ } else {
27921
+ const [head, tail] = __unstableGetSelectedBlocksWithPartialSelection();
27922
+
27923
+ const inBetweenBlocks = getBlocksByClientId(selectedBlockClientIds.slice(1, selectedBlockClientIds.length - 1));
27924
+ blocks = [head, ...inBetweenBlocks, tail];
27925
+ }
27926
+
27927
+ const serialized = (0,external_wp_blocks_namespaceObject.serialize)(blocks);
27928
+ event.clipboardData.setData('text/plain', serialized);
27929
+ event.clipboardData.setData('text/html', serialized);
27930
+ }
27931
  }
27932
 
27933
  if (event.type === 'cut') {
27934
+ // We need to also check if at the start we needed to
27935
+ // expand the selection, as in this point we might have
27936
+ // programmatically fully selected the blocks above.
27937
+ if (isFullySelected && !expandSelectionIsNeeded) {
27938
+ removeBlocks(selectedBlockClientIds);
27939
+ } else {
27940
+ __unstableDeleteSelection();
27941
+ }
27942
  } else if (event.type === 'paste') {
27943
  if (eventDefaultPrevented) {
27944
  // This was likely already handled in rich-text/use-paste-handler.js.
27981
  ref: useClipboardHandler()
27982
  }, children);
27983
  }
27984
+ /**
27985
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/copy-handler/README.md
27986
+ */
27987
+
27988
 
27989
  /* harmony default export */ var copy_handler = (CopyHandler);
27990
 
28277
 
28278
 
28279
 
28280
+
28281
  function ConvertToGroupButton(_ref) {
28282
  let {
28283
  clientIds,
28444
  }));
28445
  /* harmony default export */ var library_lock = (lock);
28446
 
28447
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-lock/use-block-lock.js
28448
+ /**
28449
+ * WordPress dependencies
28450
+ */
28451
+
28452
+ /**
28453
+ * Internal dependencies
28454
+ */
28455
 
28456
 
28457
  /**
28458
+ * Return details about the block lock status.
28459
+ *
28460
+ * @param {string} clientId The block client Id.
28461
+ * @param {boolean} checkParent Optional. The status is derived from the parent `templateLock`
28462
+ * when the current block's lock state isn't defined.
28463
+ *
28464
+ * @return {Object} Block lock status
28465
  */
28466
 
28467
+ function useBlockLock(clientId) {
28468
+ let checkParent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
28469
+ return (0,external_wp_data_namespaceObject.useSelect)(select => {
28470
+ const {
28471
+ canEditBlock,
28472
+ canMoveBlock,
28473
+ canRemoveBlock,
28474
+ canLockBlockType,
28475
+ getBlockName,
28476
+ getBlockRootClientId
28477
+ } = select(store);
28478
+ const rootClientId = checkParent ? getBlockRootClientId(clientId) : null;
28479
+ const canEdit = canEditBlock(clientId);
28480
+ const canMove = canMoveBlock(clientId, rootClientId);
28481
+ const canRemove = canRemoveBlock(clientId, rootClientId);
28482
+ return {
28483
+ canEdit,
28484
+ canMove,
28485
+ canRemove,
28486
+ canLock: canLockBlockType(getBlockName(clientId)),
28487
+ isLocked: !canEdit || !canMove || !canRemove
28488
+ };
28489
+ }, [clientId, checkParent]);
28490
+ }
28491
 
28492
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-lock/modal.js
28493
 
28501
 
28502
 
28503
 
28504
+
28505
  /**
28506
  * Internal dependencies
28507
  */
28508
 
28509
 
28510
 
28511
+
28512
  function BlockLockModal(_ref) {
28513
  let {
28514
  clientId,
28519
  remove: false
28520
  });
28521
  const {
28522
+ canEdit,
28523
  canMove,
28524
  canRemove
28525
+ } = useBlockLock(clientId, true);
28526
+ const {
28527
+ isReusable
28528
  } = (0,external_wp_data_namespaceObject.useSelect)(select => {
28529
  const {
28530
+ getBlockName
 
 
28531
  } = select(store);
28532
+ const blockName = getBlockName(clientId);
28533
  return {
28534
+ isReusable: (0,external_wp_blocks_namespaceObject.isReusableBlock)((0,external_wp_blocks_namespaceObject.getBlockType)(blockName))
 
28535
  };
28536
  }, [clientId]);
28537
  const {
28542
  (0,external_wp_element_namespaceObject.useEffect)(() => {
28543
  setLock({
28544
  move: !canMove,
28545
+ remove: !canRemove,
28546
+ ...(isReusable ? {
28547
+ edit: !canEdit
28548
+ } : {})
28549
  });
28550
+ }, [canEdit, canMove, canRemove, isReusable]);
28551
  const isAllChecked = Object.values(lock).every(Boolean);
28552
+ const isMixed = Object.values(lock).some(Boolean) && !isAllChecked;
 
 
 
 
 
 
 
 
 
28553
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
28554
  title: (0,external_wp_i18n_namespaceObject.sprintf)(
28555
  /* translators: %s: Name of the block. */
28575
  id: instanceId
28576
  }, (0,external_wp_i18n_namespaceObject.__)('Lock all')),
28577
  checked: isAllChecked,
28578
+ indeterminate: isMixed,
28579
  onChange: newValue => setLock({
28580
  move: newValue,
28581
+ remove: newValue,
28582
+ ...(isReusable ? {
28583
+ edit: newValue
28584
+ } : {})
28585
  })
28586
  }), (0,external_wp_element_namespaceObject.createElement)("ul", {
28587
  className: "block-editor-block-lock-modal__checklist"
28588
+ }, isReusable && (0,external_wp_element_namespaceObject.createElement)("li", {
28589
+ className: "block-editor-block-lock-modal__checklist-item"
28590
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
28591
+ label: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_i18n_namespaceObject.__)('Restrict editing'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
28592
+ icon: lock.edit ? library_lock : library_unlock
28593
+ })),
28594
+ checked: !!lock.edit,
28595
+ onChange: edit => setLock(prevLock => ({ ...prevLock,
28596
+ edit
28597
+ }))
28598
+ })), (0,external_wp_element_namespaceObject.createElement)("li", {
28599
  className: "block-editor-block-lock-modal__checklist-item"
28600
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
28601
  label: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_i18n_namespaceObject.__)('Disable movement'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
28602
+ icon: lock.move ? library_lock : library_unlock
28603
  })),
28604
  checked: lock.move,
28605
  onChange: move => setLock(prevLock => ({ ...prevLock,
28609
  className: "block-editor-block-lock-modal__checklist-item"
28610
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CheckboxControl, {
28611
  label: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_i18n_namespaceObject.__)('Prevent removal'), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
28612
+ icon: lock.remove ? library_lock : library_unlock
28613
  })),
28614
  checked: lock.remove,
28615
  onChange: remove => setLock(prevLock => ({ ...prevLock,
28638
 
28639
 
28640
 
 
28641
  /**
28642
  * Internal dependencies
28643
  */
28649
  clientId
28650
  } = _ref;
28651
  const {
28652
+ canLock,
28653
  isLocked
28654
+ } = useBlockLock(clientId, true);
 
 
 
 
 
 
 
 
 
 
 
 
 
28655
  const [isModalOpen, toggleModal] = (0,external_wp_element_namespaceObject.useReducer)(isActive => !isActive, false);
28656
 
28657
+ if (!canLock) {
28658
  return null;
28659
  }
28660
 
28792
 
28793
 
28794
 
28795
+
28796
+
28797
  const block_settings_dropdown_POPOVER_PROPS = {
28798
  className: 'block-editor-block-settings-menu__popover',
28799
  position: 'bottom right',
28822
  const count = blockClientIds.length;
28823
  const firstBlockClientId = blockClientIds[0];
28824
  const {
28825
+ firstParentClientId,
28826
+ hasReducedUI,
28827
  onlyBlock,
28828
+ parentBlockType,
28829
  previousBlockClientId,
28830
  nextBlockClientId,
28831
  selectedBlockClientIds
28832
  } = (0,external_wp_data_namespaceObject.useSelect)(select => {
28833
  const {
28834
  getBlockCount,
28835
+ getBlockName,
28836
+ getBlockParents,
28837
  getPreviousBlockClientId,
28838
  getNextBlockClientId,
28839
+ getSelectedBlockClientIds,
28840
+ getSettings
28841
  } = select(store);
28842
+ const parents = getBlockParents(firstBlockClientId);
28843
+ const _firstParentClientId = parents[parents.length - 1];
28844
+ const parentBlockName = getBlockName(_firstParentClientId);
28845
  return {
28846
+ firstParentClientId: _firstParentClientId,
28847
+ hasReducedUI: getSettings().hasReducedUI,
28848
  onlyBlock: 1 === getBlockCount(),
28849
+ parentBlockType: (0,external_wp_blocks_namespaceObject.getBlockType)(parentBlockName),
28850
  previousBlockClientId: getPreviousBlockClientId(firstBlockClientId),
28851
  nextBlockClientId: getNextBlockClientId(firstBlockClientId),
28852
  selectedBlockClientIds: getSelectedBlockClientIds()
28863
  insertBefore: getShortcutRepresentation('core/block-editor/insert-before')
28864
  };
28865
  }, []);
28866
+ const {
28867
+ selectBlock,
28868
+ toggleBlockHighlight
28869
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store);
28870
  const updateSelectionAfterDuplicate = (0,external_wp_element_namespaceObject.useCallback)(__experimentalSelectBlock ? async clientIdsPromise => {
28871
  const ids = await clientIdsPromise;
28872
 
28889
  const label = (0,external_wp_i18n_namespaceObject.sprintf)(
28890
  /* translators: %s: block name */
28891
  (0,external_wp_i18n_namespaceObject.__)('Remove %s'), blockTitle);
28892
+ const removeBlockLabel = count === 1 ? label : (0,external_wp_i18n_namespaceObject.__)('Remove blocks'); // Allows highlighting the parent block outline when focusing or hovering
28893
+ // the parent block selector within the child.
28894
+
28895
+ const selectParentButtonRef = (0,external_wp_element_namespaceObject.useRef)();
28896
+ const {
28897
+ gestures: showParentOutlineGestures
28898
+ } = useShowMoversGestures({
28899
+ ref: selectParentButtonRef,
28900
+
28901
+ onChange(isFocused) {
28902
+ if (isFocused && hasReducedUI) {
28903
+ return;
28904
+ }
28905
+
28906
+ toggleBlockHighlight(firstParentClientId, isFocused);
28907
+ }
28908
+
28909
+ });
28910
  return (0,external_wp_element_namespaceObject.createElement)(BlockActions, {
28911
  clientIds: clientIds,
28912
  __experimentalUpdateSelection: !__experimentalSelectBlock
28938
  fillProps: {
28939
  onClose
28940
  }
28941
+ }), firstParentClientId !== undefined && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, _extends({}, showParentOutlineGestures, {
28942
+ ref: selectParentButtonRef,
28943
+ icon: (0,external_wp_element_namespaceObject.createElement)(block_icon, {
28944
+ icon: parentBlockType.icon
28945
+ }),
28946
+ onClick: () => selectBlock(firstParentClientId)
28947
+ }), (0,external_wp_i18n_namespaceObject.sprintf)(
28948
+ /* translators: %s: Name of the block's parent. */
28949
+ (0,external_wp_i18n_namespaceObject.__)('Select parent block (%s)'), parentBlockType.title)), count === 1 && (0,external_wp_element_namespaceObject.createElement)(block_html_convert_button, {
28950
  clientId: firstBlockClientId
28951
  }), (0,external_wp_element_namespaceObject.createElement)(CopyMenuItem, {
28952
  blocks: blocks,
29018
 
29019
 
29020
 
 
29021
  /**
29022
  * Internal dependencies
29023
  */
29031
  } = _ref;
29032
  const blockInformation = useBlockDisplayInformation(clientId);
29033
  const {
29034
+ canEdit,
29035
  canMove,
29036
  canRemove,
29037
+ canLock
29038
+ } = useBlockLock(clientId);
 
 
 
 
 
 
 
 
 
 
 
 
29039
  const [isModalOpen, toggleModal] = (0,external_wp_element_namespaceObject.useReducer)(isActive => !isActive, false);
29040
 
29041
+ if (!canLock) {
29042
  return null;
29043
  }
29044
 
29045
+ if (canEdit && canMove && canRemove) {
29046
  return null;
29047
  }
29048
 
29060
  }));
29061
  }
29062
 
29063
+ ;// CONCATENATED MODULE: ./packages/icons/build-module/library/group.js
29064
+
29065
+
29066
+ /**
29067
+ * WordPress dependencies
29068
+ */
29069
+
29070
+ const group_group = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
29071
+ viewBox: "0 0 24 24",
29072
+ xmlns: "http://www.w3.org/2000/svg"
29073
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
29074
+ 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"
29075
+ }));
29076
+ /* harmony default export */ var library_group = (group_group);
29077
+
29078
+ ;// CONCATENATED MODULE: ./packages/icons/build-module/library/row.js
29079
+
29080
+
29081
+ /**
29082
+ * WordPress dependencies
29083
+ */
29084
+
29085
+ const row = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
29086
+ xmlns: "http://www.w3.org/2000/svg",
29087
+ viewBox: "0 0 24 24"
29088
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
29089
+ d: "M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"
29090
+ }));
29091
+ /* harmony default export */ var library_row = (row);
29092
+
29093
+ ;// CONCATENATED MODULE: ./packages/icons/build-module/library/stack.js
29094
+
29095
+
29096
+ /**
29097
+ * WordPress dependencies
29098
+ */
29099
+
29100
+ const stack = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
29101
+ xmlns: "http://www.w3.org/2000/svg",
29102
+ viewBox: "0 0 24 24"
29103
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
29104
+ d: "M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"
29105
+ }));
29106
+ /* harmony default export */ var library_stack = (stack);
29107
+
29108
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/convert-to-group-buttons/toolbar.js
29109
+
29110
+
29111
+ /**
29112
+ * WordPress dependencies
29113
+ */
29114
+
29115
+
29116
+
29117
+
29118
+
29119
+ /**
29120
+ * Internal dependencies
29121
+ */
29122
+
29123
+
29124
+
29125
+ const layouts = {
29126
+ group: undefined,
29127
+ row: {
29128
+ type: 'flex',
29129
+ flexWrap: 'nowrap'
29130
+ },
29131
+ stack: {
29132
+ type: 'flex',
29133
+ orientation: 'vertical'
29134
+ }
29135
+ };
29136
+
29137
+ function BlockGroupToolbar() {
29138
+ const {
29139
+ blocksSelection,
29140
+ clientIds,
29141
+ groupingBlockName,
29142
+ isGroupable
29143
+ } = useConvertToGroupButtonProps();
29144
+ const {
29145
+ replaceBlocks
29146
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store);
29147
+ const {
29148
+ canRemove
29149
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
29150
+ const {
29151
+ canRemoveBlocks
29152
+ } = select(store);
29153
+ return {
29154
+ canRemove: canRemoveBlocks(clientIds)
29155
+ };
29156
+ }, [clientIds]);
29157
+
29158
+ const onConvertToGroup = function () {
29159
+ let layout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'group';
29160
+ const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocksSelection, groupingBlockName);
29161
+
29162
+ if (newBlocks && newBlocks.length > 0) {
29163
+ // Because the block is not in the store yet we can't use
29164
+ // updateBlockAttributes so need to manually update attributes.
29165
+ newBlocks[0].attributes.layout = layouts[layout];
29166
+ replaceBlocks(clientIds, newBlocks);
29167
+ }
29168
+ };
29169
+
29170
+ const onConvertToRow = () => onConvertToGroup('row');
29171
+
29172
+ const onConvertToStack = () => onConvertToGroup('stack'); // Don't render the button if the current selection cannot be grouped.
29173
+ // A good example is selecting multiple button blocks within a Buttons block:
29174
+ // The group block is not a valid child of Buttons, so we should not show the button.
29175
+ // Any blocks that are locked against removal also cannot be grouped.
29176
+
29177
+
29178
+ if (!isGroupable || !canRemove) {
29179
+ return null;
29180
+ }
29181
+
29182
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
29183
+ icon: library_group,
29184
+ label: (0,external_wp_i18n_namespaceObject._x)('Group', 'verb'),
29185
+ onClick: onConvertToGroup
29186
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
29187
+ icon: library_row,
29188
+ label: (0,external_wp_i18n_namespaceObject._x)('Row', 'single horizontal line'),
29189
+ onClick: onConvertToRow
29190
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
29191
+ icon: library_stack,
29192
+ label: (0,external_wp_i18n_namespaceObject._x)('Stack', 'verb'),
29193
+ onClick: onConvertToStack
29194
+ }));
29195
+ }
29196
+
29197
+ /* harmony default export */ var toolbar = (BlockGroupToolbar);
29198
+
29199
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-toolbar/block-name-context.js
29200
+ /**
29201
+ * WordPress dependencies
29202
+ */
29203
+
29204
+
29205
+ const __unstableBlockNameContext = (0,external_wp_element_namespaceObject.createContext)('');
29206
+
29207
+ /* harmony default export */ var block_name_context = (__unstableBlockNameContext);
29208
+
29209
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-toolbar/index.js
29210
 
29211
 
29235
 
29236
 
29237
 
29238
+
29239
+
29240
+
29241
+
29242
+ const BlockToolbar = _ref => {
29243
  let {
29244
  hideDragHandle
29245
  } = _ref;
29330
  }), (0,external_wp_element_namespaceObject.createElement)(block_mover, {
29331
  clientIds: blockClientIds,
29332
  hideDragHandle: hideDragHandle || hasReducedUI
29333
+ }))), shouldShowVisualToolbar && isMultiToolbar && (0,external_wp_element_namespaceObject.createElement)(toolbar, null), shouldShowVisualToolbar && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(block_controls.Slot, {
29334
  group: "parent",
29335
  className: "block-editor-block-toolbar__slot"
29336
  }), (0,external_wp_element_namespaceObject.createElement)(block_controls.Slot, {
29344
  }), (0,external_wp_element_namespaceObject.createElement)(block_controls.Slot, {
29345
  group: "other",
29346
  className: "block-editor-block-toolbar__slot"
29347
+ }), (0,external_wp_element_namespaceObject.createElement)(block_name_context.Provider, {
29348
+ value: blockType === null || blockType === void 0 ? void 0 : blockType.name
29349
+ }, (0,external_wp_element_namespaceObject.createElement)(block_toolbar_last_item.Slot, null))), (0,external_wp_element_namespaceObject.createElement)(block_settings_menu, {
29350
  clientIds: blockClientIds
29351
  }));
29352
+ };
29353
+ /**
29354
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-toolbar/README.md
29355
+ */
29356
+
29357
+
29358
+ /* harmony default export */ var block_toolbar = (BlockToolbar);
29359
 
29360
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-tools/block-contextual-toolbar.js
29361
 
29429
  /* translators: accessibility text for the block toolbar */
29430
  ,
29431
  "aria-label": (0,external_wp_i18n_namespaceObject.__)('Block tools')
29432
+ }, props), (0,external_wp_element_namespaceObject.createElement)(block_toolbar, {
29433
  hideDragHandle: isFixed
29434
  }));
29435
  }
31379
  function border_color_addSaveProps(props, blockType, attributes) {
31380
  var _style$border2;
31381
 
31382
+ if (!hasBorderSupport(blockType, 'color') || shouldSkipSerialization(blockType, BORDER_SUPPORT_KEY, 'color')) {
31383
  return props;
31384
  }
31385
 
31408
 
31409
 
31410
  function addEditProps(settings) {
31411
+ if (!hasBorderSupport(settings, 'color') || shouldSkipSerialization(settings, BORDER_SUPPORT_KEY, 'color')) {
31412
  return settings;
31413
  }
31414
 
31448
  } = attributes;
31449
  const colors = useSetting('color.palette') || border_color_EMPTY_ARRAY;
31450
 
31451
+ if (!hasBorderSupport(name, 'color') || shouldSkipSerialization(name, BORDER_SUPPORT_KEY, 'color')) {
31452
  return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, props);
31453
  }
31454
 
32357
 
32358
  return !!(support !== null && support !== void 0 && support[feature]);
32359
  }
 
 
 
 
 
 
 
 
 
 
 
 
32360
  /**
32361
  * Returns a new style object where the specified border attribute has been
32362
  * removed.
32603
  isDismissible: false
32604
  }, message));
32605
  }
32606
+ /**
32607
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/contrast-checker/README.md
32608
+ */
32609
+
32610
 
32611
  /* harmony default export */ var contrast_checker = (ContrastChecker);
32612
 
32794
  return colorSupport && (colorSupport.link === true || colorSupport.gradient === true || colorSupport.background !== false || colorSupport.text !== false);
32795
  };
32796
 
 
 
 
 
 
32797
  const hasLinkColorSupport = blockType => {
32798
  if (external_wp_element_namespaceObject.Platform.OS !== 'web') {
32799
  return false;
33010
  function color_addSaveProps(props, blockType, attributes) {
33011
  var _style$color, _style$color2, _style$color3, _style$color4, _style$elements, _style$elements$link;
33012
 
33013
+ if (!hasColorSupport(blockType) || shouldSkipSerialization(blockType, COLOR_SUPPORT_KEY)) {
33014
  return props;
33015
  }
33016
 
33022
  gradient,
33023
  style
33024
  } = attributes;
 
33025
 
33026
+ const shouldSerialize = feature => !shouldSkipSerialization(blockType, COLOR_SUPPORT_KEY, feature); // Primary color classes must come before the `has-text-color`,
33027
+ // `has-background` and `has-link-color` classes to maintain backwards
33028
+ // compatibility and avoid block invalidations.
33029
 
33030
+
33031
+ const textClass = shouldSerialize('text') ? getColorClassName('color', textColor) : undefined;
33032
+ const gradientClass = shouldSerialize('gradients') ? __experimentalGetGradientClass(gradient) : undefined;
33033
+ const backgroundClass = shouldSerialize('background') ? getColorClassName('background-color', backgroundColor) : undefined;
33034
+ const serializeHasBackground = shouldSerialize('background') || shouldSerialize('gradients');
33035
+ const hasBackground = backgroundColor || (style === null || style === void 0 ? void 0 : (_style$color = style.color) === null || _style$color === void 0 ? void 0 : _style$color.background) || hasGradient && (gradient || (style === null || style === void 0 ? void 0 : (_style$color2 = style.color) === null || _style$color2 === void 0 ? void 0 : _style$color2.gradient));
33036
  const newClassName = classnames_default()(props.className, textClass, gradientClass, {
33037
  // Don't apply the background class if there's a custom gradient.
33038
+ [backgroundClass]: (!hasGradient || !(style !== null && style !== void 0 && (_style$color3 = style.color) !== null && _style$color3 !== void 0 && _style$color3.gradient)) && !!backgroundClass,
33039
+ 'has-text-color': shouldSerialize('text') && (textColor || (style === null || style === void 0 ? void 0 : (_style$color4 = style.color) === null || _style$color4 === void 0 ? void 0 : _style$color4.text)),
33040
+ 'has-background': serializeHasBackground && hasBackground,
33041
+ 'has-link-color': shouldSerialize('link') && (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)
33042
  });
33043
  props.className = newClassName ? newClassName : undefined;
33044
  return props;
33053
  */
33054
 
33055
  function color_addEditProps(settings) {
33056
+ if (!hasColorSupport(settings) || shouldSkipSerialization(settings, COLOR_SUPPORT_KEY)) {
33057
  return settings;
33058
  }
33059
 
33280
  const defaultPalette = useSetting('color.palette.default') || [];
33281
  const colors = (0,external_wp_element_namespaceObject.useMemo)(() => [...(userPalette || []), ...(themePalette || []), ...(defaultPalette || [])], [userPalette, themePalette, defaultPalette]);
33282
 
33283
+ if (!hasColorSupport(name) || shouldSkipSerialization(name, COLOR_SUPPORT_KEY)) {
33284
  return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, props);
33285
  }
33286
 
33287
  const extraStyles = {};
33288
 
33289
+ if (textColor && !shouldSkipSerialization(name, COLOR_SUPPORT_KEY, 'text')) {
33290
  var _getColorObjectByAttr;
33291
 
33292
  extraStyles.color = (_getColorObjectByAttr = getColorObjectByAttributeValues(colors, textColor)) === null || _getColorObjectByAttr === void 0 ? void 0 : _getColorObjectByAttr.color;
33293
  }
33294
 
33295
+ if (backgroundColor && !shouldSkipSerialization(name, COLOR_SUPPORT_KEY, 'background')) {
33296
  var _getColorObjectByAttr2;
33297
 
33298
  extraStyles.backgroundColor = (_getColorObjectByAttr2 = getColorObjectByAttributeValues(colors, backgroundColor)) === null || _getColorObjectByAttr2 === void 0 ? void 0 : _getColorObjectByAttr2.color;
33578
  */
33579
 
33580
 
33581
+
33582
+ const LineHeightControl = _ref => {
33583
  let {
33584
  value: lineHeight,
33585
  onChange,
33665
  value: value,
33666
  min: 0
33667
  }));
33668
+ };
33669
+ /**
33670
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/line-height-control/README.md
33671
+ */
33672
+
33673
+
33674
+ /* harmony default export */ var line_height_control = (LineHeightControl);
33675
 
33676
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/line-height.js
33677
 
33717
  });
33718
  };
33719
 
33720
+ return (0,external_wp_element_namespaceObject.createElement)(line_height_control, {
33721
  __unstableInputWidth: "100%",
33722
  __nextHasNoMarginBottom: true,
33723
  value: style === null || style === void 0 ? void 0 : (_style$typography = style.typography) === null || _style$typography === void 0 ? void 0 : _style$typography.lineHeight,
34016
 
34017
 
34018
 
34019
+
34020
+
34021
  const FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';
34022
  /**
34023
  * Filters registered block settings, extending attributes to include
34058
  return props;
34059
  }
34060
 
34061
+ if (shouldSkipSerialization(blockType, TYPOGRAPHY_SUPPORT_KEY, 'fontFamily')) {
34062
  return props;
34063
  }
34064
 
34277
  disableCustomFontSizes: disableCustomFontSizes
34278
  }));
34279
  }
34280
+ /**
34281
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/font-sizes/README.md
34282
+ */
34283
+
34284
 
34285
  /* harmony default export */ var font_size_picker = (FontSizePicker);
34286
 
34301
 
34302
 
34303
 
34304
+
34305
  const FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';
34306
  /**
34307
  * Filters registered block settings, extending attributes to include
34344
  return props;
34345
  }
34346
 
34347
+ if (shouldSkipSerialization(blockType, TYPOGRAPHY_SUPPORT_KEY, 'fontSize')) {
34348
  return props;
34349
  } // Use TokenList to dedupe classes.
34350
 
34509
  // doesn't already have an inline font size,
34510
  // and does have a class to extract the font size from.
34511
 
34512
+ if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, FONT_SIZE_SUPPORT_KEY) || shouldSkipSerialization(blockName, TYPOGRAPHY_SUPPORT_KEY, 'fontSize') || !fontSize || style !== null && style !== void 0 && (_style$typography4 = style.typography) !== null && _style$typography4 !== void 0 && _style$typography4.fontSize) {
34513
  return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, props);
34514
  }
34515
 
35261
 
35262
 
35263
 
35264
+
35265
  const styleSupportKeys = [...TYPOGRAPHY_SUPPORT_KEYS, BORDER_SUPPORT_KEY, COLOR_SUPPORT_KEY, SPACING_SUPPORT_KEY];
35266
 
35267
  const hasStyleSupport = blockType => styleSupportKeys.some(key => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, key));
35402
  const skipSerializationPathsSave = { ...skipSerializationPathsEdit,
35403
  [`${SPACING_SUPPORT_KEY}`]: ['spacing.blockGap']
35404
  };
35405
+ /**
35406
+ * A dictionary used to normalize feature names between support flags, style
35407
+ * object properties and __experimentSkipSerialization configuration arrays.
35408
+ *
35409
+ * This allows not having to provide a migration for a support flag and possible
35410
+ * backwards compatibility bridges, while still achieving consistency between
35411
+ * the support flag and the skip serialization array.
35412
+ *
35413
+ * @constant
35414
+ * @type {Record<string, string>}
35415
+ */
35416
+
35417
+ const renamedFeatures = {
35418
+ gradients: 'gradient'
35419
+ };
35420
  /**
35421
  * Override props assigned to save component to inject the CSS variables definition.
35422
  *
35439
  style
35440
  } = attributes;
35441
  (0,external_lodash_namespaceObject.forEach)(skipPaths, (path, indicator) => {
35442
+ const skipSerialization = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, indicator);
35443
+
35444
+ if (skipSerialization === true) {
35445
  style = (0,external_lodash_namespaceObject.omit)(style, path);
35446
  }
35447
+
35448
+ if (Array.isArray(skipSerialization)) {
35449
+ skipSerialization.forEach(featureName => {
35450
+ const feature = renamedFeatures[featureName] || featureName;
35451
+ style = (0,external_lodash_namespaceObject.omit)(style, [[...path, feature]]);
35452
+ });
35453
+ }
35454
  });
35455
  props.style = { ...getInlineStyles(style),
35456
  ...props.style
35508
  const withElementsStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => {
35509
  var _props$attributes$sty, _props$attributes$sty2;
35510
 
 
35511
  const blockElementsContainerIdentifier = `wp-elements-${(0,external_wp_compose_namespaceObject.useInstanceId)(BlockListBlock)}`;
35512
+ const skipLinkColorSerialization = shouldSkipSerialization(props.name, COLOR_SUPPORT_KEY, 'link'); // The Elements API only supports link colors for now,
35513
+ // hence the specific omission of `link` in the elements styles.
35514
+ // This might need to be refactored or removed if the Elements API
35515
+ // changes or `link` supports styles beyond `color`.
35516
+
35517
+ const elements = skipLinkColorSerialization ? (0,external_lodash_namespaceObject.omit)((_props$attributes$sty = props.attributes.style) === null || _props$attributes$sty === void 0 ? void 0 : _props$attributes$sty.elements, ['link']) : (_props$attributes$sty2 = props.attributes.style) === null || _props$attributes$sty2 === void 0 ? void 0 : _props$attributes$sty2.elements;
35518
+ const styles = compileElementsStyles(blockElementsContainerIdentifier, elements);
35519
  const element = (0,external_wp_element_namespaceObject.useContext)(BlockList.__unstableElementContext);
35520
  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", {
35521
  dangerouslySetInnerHTML: {
35952
 
35953
  if (!allowEditing) {
35954
  return null;
35955
+ } // Only show the inherit toggle if it's supported,
35956
+ // a default theme layout is set (e.g. one that provides `contentSize` and/or `wideSize` values),
35957
+ // and that the default / flow layout type is in use, as this is the only one that supports inheritance.
35958
+
35959
 
35960
+ const showInheritToggle = !!(allowInheriting && !!defaultThemeLayout && (!(layout !== null && layout !== void 0 && layout.type) || (layout === null || layout === void 0 ? void 0 : layout.type) === 'default' || layout !== null && layout !== void 0 && layout.inherit));
35961
  const usedLayout = layout || defaultBlockLayout || {};
35962
  const {
35963
  inherit = false,
35987
 
35988
  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, {
35989
  title: (0,external_wp_i18n_namespaceObject.__)('Layout')
35990
+ }, showInheritToggle && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
35991
  label: (0,external_wp_i18n_namespaceObject.__)('Inherit default layout'),
35992
  checked: !!inherit,
35993
  onChange: () => setAttributes({
36097
  [`wp-container-${id}`]: shouldRenderLayoutStyles
36098
  });
36099
  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, {
36100
+ blockName: name,
36101
  selector: `.wp-container-${id}`,
36102
  layout: usedLayout,
36103
  style: attributes === null || attributes === void 0 ? void 0 : attributes.style
36748
  * WordPress dependencies
36749
  */
36750
 
36751
+ const align_center_alignCenter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
36752
  xmlns: "http://www.w3.org/2000/svg",
36753
  viewBox: "0 0 24 24"
36754
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
36755
  d: "M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"
36756
  }));
36757
+ /* harmony default export */ var align_center = (align_center_alignCenter);
36758
 
36759
  ;// CONCATENATED MODULE: ./packages/icons/build-module/library/align-right.js
36760
 
36799
  title: (0,external_wp_i18n_namespaceObject.__)('Align text right'),
36800
  align: 'right'
36801
  }];
36802
+ const alignment_control_ui_POPOVER_PROPS = {
36803
  position: 'bottom right',
36804
  isAlternate: true
36805
  };
36836
  toggleProps: {
36837
  describedBy
36838
  },
36839
+ popoverProps: alignment_control_ui_POPOVER_PROPS,
36840
  controls: alignmentControls.map(control => {
36841
  const {
36842
  align
36861
  * Internal dependencies
36862
  */
36863
 
36864
+
36865
+ const AlignmentControl = props => {
36866
  return (0,external_wp_element_namespaceObject.createElement)(alignment_control_ui, _extends({}, props, {
36867
  isToolbar: false
36868
  }));
36869
+ };
36870
+
36871
+ const AlignmentToolbar = props => {
36872
  return (0,external_wp_element_namespaceObject.createElement)(alignment_control_ui, _extends({}, props, {
36873
  isToolbar: true
36874
  }));
36875
+ };
36876
+ /**
36877
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/alignment-control/README.md
36878
+ */
36879
+
36880
+
36881
+
36882
 
36883
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/autocompleters/block.js
36884
 
37421
  const [isOverlayActive, setIsOverlayActive] = (0,external_wp_element_namespaceObject.useState)(true);
37422
  const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false);
37423
  const {
37424
+ canEdit,
37425
  isParentSelected,
37426
  hasChildSelected,
37427
  isDraggingBlocks,
37431
  isBlockSelected,
37432
  hasSelectedInnerBlock,
37433
  isDraggingBlocks: _isDraggingBlocks,
37434
+ isBlockHighlighted,
37435
+ canEditBlock
37436
  } = select(store);
37437
  return {
37438
+ canEdit: canEditBlock(clientId),
37439
  isParentSelected: isBlockSelected(clientId),
37440
  hasChildSelected: hasSelectedInnerBlock(clientId, true),
37441
  isDraggingBlocks: _isDraggingBlocks(),
37448
  'is-dragging-blocks': isDraggingBlocks
37449
  });
37450
  (0,external_wp_element_namespaceObject.useEffect)(() => {
37451
+ // The overlay is always active when editing is locked.
37452
+ if (!canEdit) {
37453
+ setIsOverlayActive(true);
37454
+ return;
37455
+ } // Reenable when blocks are not in use.
37456
+
37457
+
37458
  if (!isParentSelected && !hasChildSelected && !isOverlayActive) {
37459
  setIsOverlayActive(true);
37460
  } // Disable if parent selected by another means (such as list view).
37472
  if (hasChildSelected && isOverlayActive) {
37473
  setIsOverlayActive(false);
37474
  }
37475
+ }, [isParentSelected, hasChildSelected, isOverlayActive, isHovered, canEdit]); // Disabled because the overlay div doesn't actually have a role or functionality
37476
  // as far as the a11y is concerned. We're just catching the first click so that
37477
  // the block can be selected without interacting with its contents.
37478
 
37482
  className: classes,
37483
  onMouseEnter: () => setIsHovered(true),
37484
  onMouseLeave: () => setIsHovered(false),
37485
+ onMouseUp: isOverlayActive && canEdit ? () => setIsOverlayActive(false) : undefined
37486
  }), wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.children);
37487
  }
37488
  /* eslint-enable jsx-a11y/no-static-element-interactions */
37687
 
37688
 
37689
 
37690
+
37691
+
37692
  /**
37693
  * Internal dependencies
37694
  */
37713
  onDragEnd,
37714
  draggable
37715
  } = _ref;
37716
+ const blockInformation = useBlockDisplayInformation(clientId);
37717
+ const {
37718
+ isLocked
37719
+ } = useBlockLock(clientId); // The `href` attribute triggers the browser's native HTML drag operations.
37720
  // When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html.
37721
  // We need to clear any HTML drag data to prevent `pasteHandler` from firing
37722
  // inside the `useOnBlockDrop` hook.
37723
 
37724
  const onDragStartHandler = event => {
37725
  event.dataTransfer.clearData();
37726
+ onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(event);
37727
  };
37728
 
37729
  function onKeyDownHandler(event) {
37749
  }), (0,external_wp_element_namespaceObject.createElement)(block_icon, {
37750
  icon: blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon,
37751
  showColors: true
37752
+ }), (0,external_wp_element_namespaceObject.createElement)("span", {
37753
+ className: "block-editor-list-view-block-select-button__title"
37754
+ }, (0,external_wp_element_namespaceObject.createElement)(BlockTitle, {
37755
  clientId: clientId,
37756
  maximumLength: 35
37757
+ })), (blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.anchor) && (0,external_wp_element_namespaceObject.createElement)("span", {
37758
  className: "block-editor-list-view-block-select-button__anchor"
37759
+ }, blockInformation.anchor), isLocked && (0,external_wp_element_namespaceObject.createElement)("span", {
37760
+ className: "block-editor-list-view-block-select-button__lock"
37761
+ }, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
37762
+ icon: library_lock
37763
+ }))));
37764
  }
37765
 
37766
  /* harmony default export */ var block_select_button = ((0,external_wp_element_namespaceObject.forwardRef)(ListViewBlockSelectButton));
37942
 
37943
 
37944
 
37945
+
37946
  function ListViewBlock(_ref) {
37947
  let {
37948
  block,
37965
  const {
37966
  clientId
37967
  } = block;
37968
+ const isFirstSelectedBlock = isSelected && selectedClientIds[0] === clientId;
37969
+ const isLastSelectedBlock = isSelected && selectedClientIds[selectedClientIds.length - 1] === clientId;
37970
  const {
37971
  toggleBlockHighlight
37972
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
37973
  const blockInformation = useBlockDisplayInformation(clientId);
37974
+ const {
37975
+ isLocked
37976
+ } = useBlockLock(clientId);
37977
  const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ListViewBlock);
37978
  const descriptionId = `list-view-block-select-button__${instanceId}`;
37979
  const blockPositionDescription = getBlockPositionDescription(position, siblingBlockCount, level);
37980
+
37981
+ let blockAriaLabel = (0,external_wp_i18n_namespaceObject.__)('Link');
37982
+
37983
+ if (blockInformation) {
37984
+ blockAriaLabel = isLocked ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The title of the block. This string indicates a link to select the locked block.
37985
+ (0,external_wp_i18n_namespaceObject.__)('%s link (locked)'), blockInformation.title) : (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The title of the block. This string indicates a link to select the block.
37986
+ (0,external_wp_i18n_namespaceObject.__)('%s link'), blockInformation.title);
37987
+ }
37988
+
37989
  const settingsAriaLabel = blockInformation ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The title of the block.
37990
  (0,external_wp_i18n_namespaceObject.__)('Options for %s block'), blockInformation.title) : (0,external_wp_i18n_namespaceObject.__)('Options');
37991
  const {
38002
  'is-visible': isHovered || isSelected
38003
  });
38004
  const listViewBlockSettingsClassName = classnames_default()('block-editor-list-view-block__menu-cell', {
38005
+ 'is-visible': isHovered || isFirstSelectedBlock
38006
  }); // If ListView has experimental features related to the Persistent List View,
38007
  // only focus the selected list item on mount; otherwise the list would always
38008
  // try to steal the focus from the editor canvas.
38052
 
38053
  const classes = classnames_default()({
38054
  'is-selected': isSelected,
38055
+ 'is-first-selected': isFirstSelectedBlock,
38056
+ 'is-last-selected': isLastSelectedBlock,
38057
  'is-branch-selected': withExperimentalPersistentListViewFeatures && isBranchSelected,
38058
  'is-dragging': isDragged,
38059
  'has-single-cell': hideBlockActions
38249
  isBranchSelected = false,
38250
  listPosition = 0,
38251
  fixedListWindow,
38252
+ expandNested
38253
  } = props;
38254
  const {
38255
  expandedState,
39449
  } = _ref;
39450
  return (0,external_wp_element_namespaceObject.createElement)("div", {
39451
  className: "block-editor-block-pattern-setup__actions"
39452
+ }, onStartBlank && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
39453
  onClick: onStartBlank
39454
  }, (0,external_wp_i18n_namespaceObject.__)('Start blank')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
39455
  variant: "primary",
39577
  viewMode,
39578
  activeSlide,
39579
  patterns,
39580
+ onBlockPatternSelect,
39581
+ height
39582
  } = _ref;
39583
  const composite = (0,external_wp_components_namespaceObject.__unstableUseCompositeState)();
39584
  const containerClass = 'block-editor-block-pattern-setup__container';
39586
  if (viewMode === VIEWMODES.carousel) {
39587
  const slideClass = new Map([[activeSlide, 'active-slide'], [activeSlide - 1, 'previous-slide'], [activeSlide + 1, 'next-slide']]);
39588
  return (0,external_wp_element_namespaceObject.createElement)("div", {
39589
+ className: "block-editor-block-pattern-setup__carousel",
39590
+ style: {
39591
+ height
39592
+ }
39593
+ }, (0,external_wp_element_namespaceObject.createElement)("div", {
39594
  className: containerClass
39595
  }, (0,external_wp_element_namespaceObject.createElement)("ul", {
39596
  className: "carousel-container"
39597
  }, patterns.map((pattern, index) => (0,external_wp_element_namespaceObject.createElement)(BlockPatternSlide, {
39598
  className: slideClass.get(index) || '',
39599
  key: pattern.name,
39600
+ pattern: pattern,
39601
+ minHeight: height
39602
+ })))));
39603
  }
39604
 
39605
+ return (0,external_wp_element_namespaceObject.createElement)("div", {
39606
+ style: {
39607
+ height
39608
+ },
39609
+ className: "block-editor-block-pattern-setup__grid"
39610
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableComposite, _extends({}, composite, {
39611
  role: "listbox",
39612
  className: containerClass,
39613
  "aria-label": (0,external_wp_i18n_namespaceObject.__)('Patterns list')
39616
  pattern: pattern,
39617
  onSelect: onBlockPatternSelect,
39618
  composite: composite
39619
+ }))));
39620
  };
39621
 
39622
  function block_pattern_setup_BlockPattern(_ref2) {
39628
  const baseClassName = 'block-editor-block-pattern-setup-list';
39629
  const {
39630
  blocks,
 
39631
  description,
39632
  viewportWidth = 700
39633
  } = pattern;
39645
  }), (0,external_wp_element_namespaceObject.createElement)(block_preview, {
39646
  blocks: blocks,
39647
  viewportWidth: viewportWidth
39648
+ })), !!description && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
 
 
39649
  id: descriptionId
39650
  }, description));
39651
  }
39653
  function BlockPatternSlide(_ref3) {
39654
  let {
39655
  className,
39656
+ pattern,
39657
+ minHeight
39658
  } = _ref3;
39659
  const {
39660
  blocks,
39668
  "aria-describedby": description ? descriptionId : undefined
39669
  }, (0,external_wp_element_namespaceObject.createElement)(block_preview, {
39670
  blocks: blocks,
39671
+ __experimentalMinHeight: minHeight
39672
  }), !!description && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
39673
  id: descriptionId
39674
  }, description));
39689
  replaceBlock
39690
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
39691
  const patterns = use_patterns_setup(clientId, blockName, filterPatternsFn);
39692
+ const [contentResizeListener, {
39693
+ height: contentHeight
39694
+ }] = (0,external_wp_compose_namespaceObject.useResizeObserver)();
39695
 
39696
  if (!(patterns !== null && patterns !== void 0 && patterns.length) || showBlank) {
39697
  return startBlankComponent;
39703
  };
39704
 
39705
  const onPatternSelectCallback = onBlockPatternSelect || onBlockPatternSelectDefault;
39706
+ const onStartBlank = startBlankComponent ? () => {
39707
+ setShowBlank(true);
39708
+ } : undefined;
39709
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, contentResizeListener, (0,external_wp_element_namespaceObject.createElement)("div", {
39710
  className: `block-editor-block-pattern-setup view-mode-${viewMode}`
39711
+ }, (0,external_wp_element_namespaceObject.createElement)(SetupContent, {
39712
+ viewMode: viewMode,
39713
+ activeSlide: activeSlide,
39714
+ patterns: patterns,
39715
+ onBlockPatternSelect: onPatternSelectCallback,
39716
+ height: contentHeight - 2 * 60
39717
+ }), (0,external_wp_element_namespaceObject.createElement)(setup_toolbar, {
39718
  viewMode: viewMode,
39719
  setViewMode: setViewMode,
39720
  activeSlide: activeSlide,
39728
  onBlockPatternSelect: () => {
39729
  onPatternSelectCallback(patterns[activeSlide].blocks);
39730
  },
39731
+ onStartBlank: onStartBlank
39732
+ })));
 
 
 
 
 
 
 
39733
  };
39734
 
39735
  /* harmony default export */ var block_pattern_setup = (BlockPatternSetup);
39736
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39737
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-variation-transforms/index.js
39738
 
39739
 
39752
 
39753
 
39754
 
39755
+ function VariationsButtons(_ref) {
 
39756
  let {
39757
+ className,
39758
+ onSelectVariation,
39759
+ selectedValue,
39760
+ variations
39761
  } = _ref;
39762
+ return (0,external_wp_element_namespaceObject.createElement)("fieldset", {
39763
+ className: className
39764
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
39765
+ as: "legend"
39766
+ }, (0,external_wp_i18n_namespaceObject.__)('Transform to variation')), variations.map(variation => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
39767
+ key: variation.name,
39768
+ icon: variation.icon,
39769
+ isPressed: selectedValue === variation.name,
39770
+ label: selectedValue === variation.name ? variation.title : (0,external_wp_i18n_namespaceObject.sprintf)(
39771
+ /* translators: %s: Name of the block variation */
39772
+ (0,external_wp_i18n_namespaceObject.__)('Transform to %s'), variation.title),
39773
+ onClick: () => onSelectVariation(variation.name),
39774
+ "aria-label": variation.title,
39775
+ showTooltip: true
39776
+ })));
39777
+ }
 
 
 
 
 
 
 
39778
 
39779
+ function VariationsDropdown(_ref2) {
39780
+ let {
39781
+ className,
39782
+ onSelectVariation,
39783
+ selectedValue,
39784
+ variations
39785
+ } = _ref2;
39786
+ const selectOptions = variations.map(_ref3 => {
39787
  let {
39788
  name,
39789
  title,
39790
  description
39791
+ } = _ref3;
39792
  return {
39793
  value: name,
39794
  label: title,
39795
  info: description
39796
  };
39797
  });
 
 
 
 
 
 
 
 
 
 
 
 
39798
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
39799
+ className: className,
39800
  label: (0,external_wp_i18n_namespaceObject.__)('Transform to variation'),
39801
  text: (0,external_wp_i18n_namespaceObject.__)('Transform to variation'),
39802
  popoverProps: {
39803
  position: 'bottom center',
39804
+ className: `${className}__popover`
39805
  },
39806
  icon: chevron_down,
39807
  toggleProps: {
39808
  iconPosition: 'right'
39809
  }
39810
  }, () => (0,external_wp_element_namespaceObject.createElement)("div", {
39811
+ className: `${className}__container`
39812
  }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItemsChoice, {
39813
  choices: selectOptions,
39814
  value: selectedValue,
39816
  }))));
39817
  }
39818
 
39819
+ function __experimentalBlockVariationTransforms(_ref4) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39820
  let {
39821
+ blockClientId
39822
+ } = _ref4;
39823
+ const {
39824
+ updateBlockAttributes
39825
+ } = (0,external_wp_data_namespaceObject.useDispatch)(store);
39826
+ const {
39827
+ activeBlockVariation,
39828
+ variations
39829
+ } = (0,external_wp_data_namespaceObject.useSelect)(select => {
39830
+ const {
39831
+ getActiveBlockVariation,
39832
+ getBlockVariations
39833
+ } = select(external_wp_blocks_namespaceObject.store);
39834
+ const {
39835
+ getBlockName,
39836
+ getBlockAttributes
39837
+ } = select(store);
39838
+ const name = blockClientId && getBlockName(blockClientId);
39839
+ return {
39840
+ activeBlockVariation: getActiveBlockVariation(name, getBlockAttributes(blockClientId)),
39841
+ variations: name && getBlockVariations(name, 'transform')
39842
+ };
39843
+ }, [blockClientId]);
39844
+ const selectedValue = activeBlockVariation === null || activeBlockVariation === void 0 ? void 0 : activeBlockVariation.name; // Check if each variation has a unique icon.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39845
 
39846
+ const hasUniqueIcons = (0,external_wp_element_namespaceObject.useMemo)(() => {
39847
+ const variationIcons = new Set();
39848
+ variations.forEach(variation => {
39849
+ if (variation.icon) {
39850
+ variationIcons.add(variation.icon);
39851
+ }
39852
+ });
39853
+ return variationIcons.size === variations.length;
39854
+ }, [variations]);
39855
 
39856
+ const onSelectVariation = variationName => {
39857
+ updateBlockAttributes(blockClientId, { ...variations.find(_ref5 => {
39858
+ let {
39859
+ name
39860
+ } = _ref5;
39861
+ return name === variationName;
39862
+ }).attributes
39863
+ });
39864
+ };
39865
 
39866
+ const baseClass = 'block-editor-block-variation-transforms'; // Skip rendering if there are no variations
 
 
39867
 
39868
+ if (!(variations !== null && variations !== void 0 && variations.length)) return null;
39869
+ const Component = hasUniqueIcons ? VariationsButtons : VariationsDropdown;
39870
+ return (0,external_wp_element_namespaceObject.createElement)(Component, {
39871
+ className: baseClass,
39872
+ onSelectVariation: onSelectVariation,
39873
+ selectedValue: selectedValue,
39874
+ variations: variations
39875
+ });
 
39876
  }
39877
 
39878
+ /* harmony default export */ var block_variation_transforms = (__experimentalBlockVariationTransforms);
39879
+
39880
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/color-palette/with-color-context.js
39881
 
39882
 
42010
 
42011
  /* harmony default export */ var settings_drawer = (LinkControlSettingsDrawer);
42012
 
42013
+ // EXTERNAL MODULE: ./node_modules/dom-scroll-into-view/lib/index.js
42014
+ var dom_scroll_into_view_lib = __webpack_require__(5425);
42015
+ var lib_default = /*#__PURE__*/__webpack_require__.n(dom_scroll_into_view_lib);
42016
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/url-input/index.js
42017
 
42018
 
44000
  }
44001
  });
44002
  };
44003
+ /**
44004
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-replace-flow/README.md
44005
+ */
44006
+
44007
 
44008
  /* harmony default export */ var media_replace_flow = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withDispatch)(dispatch => {
44009
  const {
44960
 
44961
  if (!onReplace || !onSplit) {
44962
  return;
44963
+ } // Ensure the value has a selection. This might happen when trying to split
44964
+ // an empty value before there was a `selectionchange` event.
44965
 
44966
+
44967
+ const {
44968
+ start = 0,
44969
+ end = 0
44970
+ } = value;
44971
+ const valueWithEnsuredSelection = { ...value,
44972
+ start,
44973
+ end
44974
+ };
44975
  const blocks = [];
44976
+ const [before, after] = (0,external_wp_richText_namespaceObject.split)(valueWithEnsuredSelection);
44977
  const hasPastedBlocks = pastedBlocks.length > 0;
44978
  let lastPastedBlockIndex = -1; // Consider the after value to be the original it is not empty and the
44979
  // before value *is* empty.
45309
  }
45310
 
45311
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/rich-text/use-input-rules.js
45312
+ /**
45313
+ * External dependencies
45314
+ */
45315
+
45316
  /**
45317
  * WordPress dependencies
45318
  */
45321
 
45322
 
45323
 
45324
+
45325
  /**
45326
  * Internal dependencies
45327
  */
45328
 
45329
 
45330
+ // A robust way to retain selection position through various
45331
+ // transforms is to insert a special character at the position and
45332
+ // then recover it.
45333
+
45334
+ const START_OF_SELECTED_AREA = '\u0086';
45335
+
45336
+ function findSelection(blocks) {
45337
+ let i = blocks.length;
45338
+
45339
+ while (i--) {
45340
+ const attributeKey = (0,external_lodash_namespaceObject.findKey)(blocks[i].attributes, v => typeof v === 'string' && v.indexOf(START_OF_SELECTED_AREA) !== -1);
45341
+
45342
+ if (attributeKey) {
45343
+ blocks[i].attributes[attributeKey] = blocks[i].attributes[attributeKey].replace(START_OF_SELECTED_AREA, '');
45344
+ return blocks[i].clientId;
45345
+ }
45346
+
45347
+ const nestedSelection = findSelection(blocks[i].innerBlocks);
45348
+
45349
+ if (nestedSelection) {
45350
+ return nestedSelection;
45351
+ }
45352
+ }
45353
+ }
45354
 
45355
  function useInputRules(props) {
45356
  const {
45363
  function inputRule() {
45364
  const {
45365
  value,
45366
+ onReplace,
45367
+ selectionChange
45368
  } = propsRef.current;
45369
 
45370
  if (!onReplace) {
45400
  }
45401
 
45402
  const content = (0,external_wp_richText_namespaceObject.toHTMLString)({
45403
+ value: (0,external_wp_richText_namespaceObject.insert)(value, START_OF_SELECTED_AREA, 0, start)
45404
  });
45405
  const block = transformation.transform(content);
45406
+ selectionChange(findSelection([block]));
45407
  onReplace([block]);
45408
 
45409
  __unstableMarkAutomaticChange();
45774
  }, []);
45775
  }
45776
 
45777
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/rich-text/use-firefox-compat.js
45778
+ /**
45779
+ * WordPress dependencies
45780
+ */
45781
+
45782
+
45783
+ /**
45784
+ * Internal dependencies
45785
+ */
45786
+
45787
+
45788
+ function useFirefoxCompat() {
45789
+ const {
45790
+ isMultiSelecting
45791
+ } = (0,external_wp_data_namespaceObject.useSelect)(store);
45792
+ return (0,external_wp_compose_namespaceObject.useRefEffect)(element => {
45793
+ function onFocus() {
45794
+ if (!isMultiSelecting()) {
45795
+ return;
45796
+ } // This is a little hack to work around focus issues with nested
45797
+ // editable elements in Firefox. For some reason the editable child
45798
+ // element sometimes regains focus, while it should not be focusable
45799
+ // and focus should remain on the editable parent element.
45800
+ // To do: try to find the cause of the shifting focus.
45801
+
45802
+
45803
+ const parentEditable = element.parentElement.closest('[contenteditable="true"]');
45804
+
45805
+ if (parentEditable) {
45806
+ parentEditable.focus();
45807
+ }
45808
+ }
45809
+
45810
+ element.addEventListener('focus', onFocus);
45811
+ return () => {
45812
+ element.removeEventListener('focus', onFocus);
45813
+ };
45814
+ }, []);
45815
+ }
45816
+
45817
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/rich-text/format-edit.js
45818
 
45819
 
45923
 
45924
 
45925
 
45926
+
45927
  const keyboardShortcutContext = (0,external_wp_element_namespaceObject.createContext)();
45928
  const inputEventContext = (0,external_wp_element_namespaceObject.createContext)();
45929
  /**
45988
  let isSelected;
45989
 
45990
  if (originalIsSelected === undefined) {
45991
+ isSelected = selectionStart.clientId === clientId && selectionEnd.clientId === clientId && selectionStart.attributeKey === identifier;
45992
  } else if (originalIsSelected) {
45993
  isSelected = selectionStart.clientId === clientId;
45994
  }
46028
  }
46029
 
46030
  const onSelectionChange = (0,external_wp_element_namespaceObject.useCallback)((start, end) => {
46031
+ const selection = {};
46032
+ const unset = start === undefined && end === undefined;
46033
+
46034
+ if (typeof start === 'number' || unset) {
46035
+ selection.start = {
46036
+ clientId,
46037
+ attributeKey: identifier,
46038
+ offset: start
46039
+ };
46040
+ }
46041
+
46042
+ if (typeof end === 'number' || unset) {
46043
+ selection.end = {
46044
+ clientId,
46045
+ attributeKey: identifier,
46046
+ offset: end
46047
+ };
46048
+ }
46049
+
46050
+ selectionChange(selection);
46051
  }, [clientId, identifier]);
46052
  const {
46053
  formatTypes,
46200
  onChange,
46201
  __unstableAllowPrefixTransformations,
46202
  formatTypes,
46203
+ onReplace,
46204
+ selectionChange
46205
  }), useRemoveBrowserShortcuts(), useShortcuts(keyboardShortcuts), useInputEvents(inputEvents), useUndoAutomaticChange(), usePasteHandler({
46206
  isSelected,
46207
  disableFormats,
46226
  onChange,
46227
  disableLineBreaks,
46228
  onSplitAtEnd
46229
+ }), useFirefoxCompat(), anchorRef]),
46230
  contentEditable: true,
46231
  suppressContentEditableWarning: true,
46232
  className: classnames_default()('block-editor-rich-text__editable', props.className, 'rich-text'),
47236
  onClick: onClick
47237
  }, (0,external_wp_i18n_namespaceObject.__)('Skip to the selected block')) : null;
47238
  };
47239
+ /**
47240
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/skip-to-selected-block/README.md
47241
+ */
47242
+
47243
 
47244
  /* harmony default export */ var skip_to_selected_block = ((0,external_wp_data_namespaceObject.withSelect)(select => {
47245
  return {
47275
  return (0,external_wp_element_namespaceObject.createElement)("div", {
47276
  className: "block-editor-multi-selection-inspector__card"
47277
  }, (0,external_wp_element_namespaceObject.createElement)(block_icon, {
47278
+ icon: library_copy,
47279
  showColors: true
47280
  }), (0,external_wp_element_namespaceObject.createElement)("div", {
47281
  className: "block-editor-multi-selection-inspector__card-content"
47438
  className: "block-editor-block-inspector"
47439
  }, (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, {
47440
  __experimentalGroup: "color",
47441
+ label: (0,external_wp_i18n_namespaceObject.__)('Color'),
47442
+ className: "color-block-support-panel__inner-wrapper"
47443
  }), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, {
47444
  __experimentalGroup: "typography",
47445
  label: (0,external_wp_i18n_namespaceObject.__)('Typography')
47527
  __experimentalGroup: "advanced"
47528
  }));
47529
  };
47530
+ /**
47531
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-inspector/README.md
47532
+ */
47533
+
47534
 
47535
  /* harmony default export */ var block_inspector = (BlockInspector);
47536
 
47637
  event.preventDefault();
47638
  insertBeforeBlock((0,external_lodash_namespaceObject.first)(clientIds));
47639
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47640
  } else if (isMatch('core/block-editor/unselect', event)) {
47641
  const clientIds = getSelectedBlockClientIds();
47642
 
47779
  registerShortcut({
47780
  name: 'core/block-editor/delete-multi-selection',
47781
  category: 'block',
47782
+ description: (0,external_wp_i18n_namespaceObject.__)('Delete selection.'),
47783
  keyCombination: {
47784
  character: 'del'
47785
  },
48485
 
48486
 
48487
 
48488
+
48489
+
48490
 
48491
 
48492
 
48510
 
48511
 
48512
 
48513
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/utils/block-variation-transforms.js
48514
+ /**
48515
+ * External dependencies
48516
+ */
48517
+
48518
+ /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
48519
+
48520
+ /**
48521
+ * Matches the provided block variations with a block's attributes. If no match
48522
+ * or more than one matches are found it returns `undefined`. If a single match is
48523
+ * found it returns it.
48524
+ *
48525
+ * This is a simple implementation for now as it takes into account only the attributes
48526
+ * of a block variation and not `InnerBlocks`.
48527
+ *
48528
+ * @param {Object} blockAttributes - The block attributes to try to find a match.
48529
+ * @param {WPBlockVariation[]} variations - A list of block variations to test for a match.
48530
+ * @return {?WPBlockVariation} - If a match is found returns it. If not or more than one matches are found returns `undefined`.
48531
+ */
48532
+
48533
+ const __experimentalGetMatchingVariation = (blockAttributes, variations) => {
48534
+ if (!variations || !blockAttributes) return;
48535
+ const matches = variations.filter(_ref => {
48536
+ let {
48537
+ attributes
48538
+ } = _ref;
48539
+ if (!attributes || !Object.keys(attributes).length) return false;
48540
+ return (0,external_lodash_namespaceObject.isMatch)(blockAttributes, attributes);
48541
+ });
48542
+ if (matches.length !== 1) return;
48543
+ return matches[0];
48544
+ };
48545
+
48546
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/utils/parse-css-unit-to-px.js
48547
  /**
48548
  * Converts string to object { value, unit }.
build/block-editor/index.min.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '73b4e25425d2a14f5ce43f2885c33e78');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '019325bda5acdd5ffa843a51bfdb5cbc');
build/block-editor/index.min.js CHANGED
@@ -1,33 +1,33 @@
1
- !function(){var e={6411:function(e,t){var n,o;void 0===(o="function"==typeof(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&&d()},s=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",s,!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",s,!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:s,update:d}),"vertical"===(a=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===a.resize&&(e.style.resize="horizontal"),t="content-box"===a.boxSizing?-(parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)):parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),isNaN(t)&&(t=0),d()}var a;function c(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 o=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+t+"px",n=e.clientWidth,o.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),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),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)})),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})?n.apply(t,[e,t]):n)||(e.exports=o)},4403:function(e,t){var n;!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 g=d&&d.newPos+1<a,h=m&&0<=f&&f<c;if(g||h){if(!g||h&&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 g=f();if(g)return g}},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=!(!p||!t.frameElement),f=o.offset(e),g=o.outerHeight(e),h=o.outerWidth(e),v=void 0,b=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0,S=void 0,w=void 0,B=void 0;m&&(t=t.document.scrollingElement||t.document.body),p||m?(C=t,B=o.height(C),w=o.width(C),S={left:o.scrollLeft(C),top:o.scrollTop(C)},y={left:f.left-S.left-c,top:f.top-S.top-a},E={left:f.left+h-(S.left+w)+d,top:f.top+g-(S.top+B)+u},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:f.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:f.left+h-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:f.top+g-(v.top+b+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||E.top>0?!0===i?o.scrollTop(t,_.top+y.top):!1===i?o.scrollTop(t,_.top+E.top):y.top<0?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top):l||((i=void 0===i||!!i)?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top)),r&&(y.left<0||E.left>0?!0===s?o.scrollLeft(t,_.left+y.left):!1===s?o.scrollLeft(t,_.left+E.left):y.left<0?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.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)$/,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;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function g(e){return null!=e&&e==e.window}var h={};function v(e,t,n){if(g(e))return"width"===t?h.viewportWidth(e):h.viewportHeight(e);if(9===e.nodeType)return"width"===t?h.docWidth(e):h.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){h["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],h["viewport"+e](n))},h["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);h["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];h[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=f(t,["padding","border"],n)),_(t,e,o)):void 0}})),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:g,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(g(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(g(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},h)},8575:function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,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="&nbsp;","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}},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,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 __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),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,g={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){g.isRoot||(g.parent.node[g.key]=e),g.node=e,t&&(f=!1)},delete:function(e){delete g.parent.node[g.key],e&&(f=!1)},remove:function(e){s(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.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 g;function h(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=l(g.node)),g.isLeaf=0==g.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){g.circular=i[e];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}h();var v=t.call(g,g.node);return void 0!==v&&g.update&&g.update(v),m.before&&m.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(i.push(g),h(),a(g.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(g,g.node[t],t);var l=e(g.node[t]);n&&c.call(g.node,t)&&(g.node[t]=l.node),l.isLast=r==g.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(g,l),o.pop()})),i.pop()),m.after&&m.after.call(g,g.node),g):g}(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("[object RegExp]"===i(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 Xh},AlignmentToolbar:function(){return Qh},Autocomplete:function(){return iv},BlockAlignmentControl:function(){return _r},BlockAlignmentToolbar:function(){return yr},BlockBreadcrumb:function(){return dv},BlockColorsStyleSelector:function(){return hv},BlockContextProvider:function(){return Ar},BlockControls:function(){return Qn},BlockEdit:function(){return zr},BlockEditorKeyboardShortcuts:function(){return H_},BlockEditorProvider:function(){return gc},BlockFormatControls:function(){return Xn},BlockIcon:function(){return pc},BlockInspector:function(){return O_},BlockList:function(){return jm},BlockMover:function(){return yp},BlockNavigationDropdown:function(){return Dv},BlockPreview:function(){return Ou},BlockSelectionClearer:function(){return bc},BlockSettingsMenu:function(){return bm},BlockSettingsMenuControls:function(){return fm},BlockStyles:function(){return Vv},BlockTitle:function(){return sp},BlockToolbar:function(){return _m},BlockTools:function(){return F_},BlockVerticalAlignmentControl:function(){return sb},BlockVerticalAlignmentToolbar:function(){return ab},ButtonBlockAppender:function(){return Xd},ButtonBlockerAppender:function(){return Yd},ColorPalette:function(){return ub},ColorPaletteControl:function(){return db},ContrastChecker:function(){return Hf},CopyHandler:function(){return Zp},DefaultBlockAppender:function(){return Kd},FontSizePicker:function(){return Ng},InnerBlocks:function(){return Gm},Inserter:function(){return jd},InspectorAdvancedControls:function(){return No},InspectorControls:function(){return Po},JustifyContentControl:function(){return Qo},JustifyToolbar:function(){return Zo},LineHeightControl:function(){return pg},MediaPlaceholder:function(){return Ak},MediaReplaceFlow:function(){return Nk},MediaUpload:function(){return Ik},MediaUploadCheck:function(){return Tk},MultiSelectScrollIntoView:function(){return G_},NavigableToolbar:function(){return dp},ObserveTyping:function(){return j_},PanelColorSettings:function(){return Dk},PlainText:function(){return a_},RichText:function(){return l_},RichTextShortcut:function(){return d_},RichTextToolbarButton:function(){return p_},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return P_},ToolSelector:function(){return g_},Typewriter:function(){return X_},URLInput:function(){return lk},URLInputButton:function(){return k_},URLPopover:function(){return Rk},Warning:function(){return Hr},WritingFlow:function(){return Ic},__experimentalBlockAlignmentMatrixControl:function(){return cv},__experimentalBlockContentOverlay:function(){return pv},__experimentalBlockFullHeightAligmentControl:function(){return av},__experimentalBlockPatternSetup:function(){return Zv},__experimentalBlockPatternsList:function(){return id},__experimentalBlockVariationPicker:function(){return Gv},__experimentalBlockVariationTransforms:function(){return eb},__experimentalBorderRadiusControl:function(){return Ef},__experimentalBorderStyleControl:function(){return If},__experimentalColorGradientControl:function(){return Zm},__experimentalColorGradientSettingsDropdown:function(){return Jm},__experimentalDateFormatPicker:function(){return fb},__experimentalDuotoneControl:function(){return hh},__experimentalFontAppearanceControl:function(){return dg},__experimentalFontFamilyControl:function(){return Eg},__experimentalGetBorderClassesAndStyles:function(){return Nh},__experimentalGetColorClassesAndStyles:function(){return Mh},__experimentalGetGradientClass:function(){return Df},__experimentalGetGradientObjectByGradientValue:function(){return Ff},__experimentalGetMatchingVariation:function(){return Jv},__experimentalGetSpacingClassesAndStyles:function(){return Ah},__experimentalImageEditingProvider:function(){return Ub},__experimentalImageEditor:function(){return Jb},__experimentalImageSizeControl:function(){return tk},__experimentalImageURLInputUI:function(){return I_},__experimentalLayoutStyle:function(){return mr},__experimentalLetterSpacingControl:function(){return Zg},__experimentalLibrary:function(){return z_},__experimentalLinkControl:function(){return wk},__experimentalLinkControlSearchInput:function(){return vk},__experimentalLinkControlSearchItem:function(){return ak},__experimentalLinkControlSearchResults:function(){return dk},__experimentalListView:function(){return Lv},__experimentalPanelColorGradientSettings:function(){return Cb},__experimentalPreviewOptions:function(){return T_},__experimentalResponsiveBlockControl:function(){return u_},__experimentalTextDecorationControl:function(){return Vg},__experimentalTextTransformControl:function(){return qg},__experimentalToolsPanelColorDropdown:function(){return Gf},__experimentalUnitControl:function(){return h_},__experimentalUseBlockPreview:function(){return Fu},__experimentalUseBorderProps:function(){return Ph},__experimentalUseColorProps:function(){return Lh},__experimentalUseCustomSides:function(){return Uo},__experimentalUseGradient:function(){return Vf},__experimentalUseNoRecursiveRenders:function(){return J_},__experimentalUseResizeCanvas:function(){return N_},__unstableBlockSettingsMenuFirstItem:function(){return rm},__unstableEditorStyles:function(){return Ru},__unstableIframe:function(){return Pc},__unstableInserterMenuExtension:function(){return Ad},__unstableRichTextInputEvent:function(){return m_},__unstableUseBlockSelectionClearer:function(){return vc},__unstableUseClipboardHandler:function(){return Qp},__unstableUseMouseMoveTypingReset:function(){return W_},__unstableUseTypewriter:function(){return Y_},__unstableUseTypingObserver:function(){return $_},createCustomColorsHOC:function(){return Vh},getColorClassName:function(){return rf},getColorObjectByAttributeValues:function(){return nf},getColorObjectByColorValue:function(){return of},getFontSize:function(){return xg},getFontSizeClass:function(){return Tg},getFontSizeObjectByValue:function(){return Ig},getGradientSlugByValue:function(){return zf},getGradientValueBySlug:function(){return Of},getPxFromCssUnit:function(){return cy},store:function(){return Hn},storeConfig:function(){return Vn},transformStyles:function(){return Nu},useBlockDisplayInformation:function(){return lp},useBlockEditContext:function(){return $n},useBlockProps:function(){return tc},useCachedTruthy:function(){return Dh},useInnerBlocksProps:function(){return Hm},useSetting:function(){return _o},withColorContext:function(){return cb},withColors:function(){return Hh},withFontSizes:function(){return Uh}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return Nt},__experimentalGetAllowedBlocks:function(){return ut},__experimentalGetAllowedPatterns:function(){return ft},__experimentalGetBlockListSettingsForBlocks:function(){return _t},__experimentalGetDirectInsertBlock:function(){return dt},__experimentalGetGlobalBlocksByName:function(){return Q},__experimentalGetLastBlockAttributeChanges:function(){return Ct},__experimentalGetParsedPattern:function(){return pt},__experimentalGetPatternTransformItems:function(){return ht},__experimentalGetPatternsByBlockTypes:function(){return gt},__experimentalGetReusableBlockTitle:function(){return yt},__unstableGetBlockWithoutInnerBlocks:function(){return W},__unstableGetClientIdWithClientIdsTree:function(){return j},__unstableGetClientIdsTree:function(){return K},__unstableIsLastBlockChangeIgnored:function(){return Et},areInnerBlocksControlled:function(){return Tt},canInsertBlockType:function(){return Ye},canInsertBlocks:function(){return Xe},canLockBlockType:function(){return tt},canMoveBlock:function(){return Je},canMoveBlocks:function(){return et},canRemoveBlock:function(){return Qe},canRemoveBlocks:function(){return Ze},didAutomaticChange:function(){return xt},getAdjacentBlockClientId:function(){return me},getBlock:function(){return U},getBlockAttributes:function(){return G},getBlockCount:function(){return J},getBlockHierarchyRootClientId:function(){return de},getBlockIndex:function(){return Ie},getBlockInsertionPoint:function(){return Ge},getBlockListSettings:function(){return vt},getBlockMode:function(){return Ae},getBlockName:function(){return V},getBlockOrder:function(){return xe},getBlockParents:function(){return ce},getBlockParentsByBlockName:function(){return ue},getBlockRootClientId:function(){return ae},getBlockSelectionEnd:function(){return oe},getBlockSelectionStart:function(){return ne},getBlockTransformItems:function(){return at},getBlocks:function(){return $},getBlocksByClientId:function(){return Z},getClientIdsOfDescendants:function(){return q},getClientIdsWithDescendants:function(){return Y},getDraggedBlockClientIds:function(){return Fe},getFirstMultiSelectedBlockClientId:function(){return _e},getGlobalBlockCount:function(){return X},getInserterItems:function(){return st},getLastMultiSelectedBlockClientId:function(){return ye},getLowestCommonAncestorWithSelectedBlock:function(){return pe},getMultiSelectedBlockClientIds:function(){return be},getMultiSelectedBlocks:function(){return ke},getMultiSelectedBlocksEndClientId:function(){return Be},getMultiSelectedBlocksStartClientId:function(){return we},getNextBlockClientId:function(){return ge},getPreviousBlockClientId:function(){return fe},getSelectedBlock:function(){return se},getSelectedBlockClientId:function(){return ie},getSelectedBlockClientIds:function(){return ve},getSelectedBlockCount:function(){return re},getSelectedBlocksInitialCaretPosition:function(){return he},getSelectionEnd:function(){return te},getSelectionStart:function(){return ee},getSettings:function(){return bt},getTemplate:function(){return $e},getTemplateLock:function(){return je},hasBlockMovingClientId:function(){return Bt},hasInserterItems:function(){return ct},hasMultiSelection:function(){return Me},hasSelectedBlock:function(){return le},hasSelectedInnerBlock:function(){return Ne},isAncestorBeingDragged:function(){return Ve},isAncestorMultiSelected:function(){return Se},isBlockBeingDragged:function(){return ze},isBlockHighlighted:function(){return It},isBlockInsertionPointVisible:function(){return Ue},isBlockMultiSelected:function(){return Ce},isBlockSelected:function(){return Te},isBlockValid:function(){return H},isBlockWithinSelection:function(){return Pe},isCaretWithinFormattedText:function(){return He},isDraggingBlocks:function(){return Oe},isFirstMultiSelectedBlock:function(){return Ee},isLastBlockChangePersistent:function(){return kt},isMultiSelecting:function(){return Re},isNavigationMode:function(){return wt},isSelectionEnabled:function(){return Le},isTyping:function(){return De},isValidTemplate:function(){return We},wasBlockJustInserted:function(){return Pt}});var t={};n.r(t),n.d(t,{__unstableMarkAutomaticChange:function(){return Nn},__unstableMarkLastChangeAsPersistent:function(){return In},__unstableMarkNextChangeAsNotPersistent:function(){return Tn},__unstableSaveReusableBlock:function(){return xn},clearSelectedBlock:function(){return qt},duplicateBlocks:function(){return Rn},enterFormattedText:function(){return yn},exitFormattedText:function(){return En},flashBlock:function(){return On},hideInsertionPoint:function(){return an},insertAfterBlock:function(){return An},insertBeforeBlock:function(){return Ln},insertBlock:function(){return rn},insertBlocks:function(){return ln},insertDefaultBlock:function(){return Sn},mergeBlocks:function(){return dn},moveBlockToPosition:function(){return on},moveBlocksDown:function(){return en},moveBlocksToPosition:function(){return nn},moveBlocksUp:function(){return tn},multiSelect:function(){return Kt},receiveBlocks:function(){return zt},removeBlock:function(){return mn},removeBlocks:function(){return pn},replaceBlock:function(){return Zt},replaceBlocks:function(){return Qt},replaceInnerBlocks:function(){return fn},resetBlocks:function(){return Dt},resetSelection:function(){return Ft},selectBlock:function(){return Gt},selectNextBlock:function(){return Wt},selectPreviousBlock:function(){return Ut},selectionChange:function(){return Cn},setBlockMovingClientId:function(){return Mn},setHasControlledInnerBlocks:function(){return Fn},setNavigationMode:function(){return Pn},setTemplateValidity:function(){return cn},showInsertionPoint:function(){return sn},startDraggingBlocks:function(){return bn},startMultiSelect:function(){return $t},startTyping:function(){return hn},stopDraggingBlocks:function(){return kn},stopMultiSelect:function(){return jt},stopTyping:function(){return vn},synchronizeTemplate:function(){return un},toggleBlockHighlight:function(){return Dn},toggleBlockMode:function(){return gn},toggleSelection:function(){return Yt},updateBlock:function(){return Ht},updateBlockAttributes:function(){return Vt},updateBlockListSettings:function(){return wn},updateSettings:function(){return Bn},validateBlocksToTemplate:function(){return Ot}});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}).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,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")},g=window.wp.i18n;const h={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,g.__)("Black"),slug:"black",color:"#000000"},{name:(0,g.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,g.__)("White"),slug:"white",color:"#ffffff"},{name:(0,g.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,g.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,g.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,g.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,g.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,g.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,g.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,g.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,g.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,g._x)("Small","font size name"),size:13,slug:"small"},{name:(0,g._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,g._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,g._x)("Large","font size name"),size:36,slug:"large"},{name:(0,g._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,g.__)("Thumbnail")},{slug:"medium",name:(0,g.__)("Medium")},{slug:"large",name:(0,g.__)("Large")},{slug:"full",name:(0,g.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__experimentalGenerateAnchors:!1,__experimentalCanLockBlocks:!0,__unstableGalleryWithImageBlocks:!1,gradients:[{name:(0,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,g.__)("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,g.__)("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,g.__)("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,g.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,g.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};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 S(e){return E(e,(e=>e.attributes))}function w(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 x(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 I=(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=x(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=x(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=x(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=B(o,n.blocks);o.tree=x(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=x(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=x(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=x(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=x(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=x(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:S(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:!w(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,...S(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),...S(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:I,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;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||["MULTI_SELECT","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;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]:v,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]:h,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":return n.blocks.length?{clientId:n.blocks[0].clientId,source:null===(e=n.meta)||void 0===e?void 0:e.source}:t;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(!(i=o=e[t])||"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,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 G(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function U(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:G(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function $(e,t){var n;const o=t&&Tt(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)(xe(e,t),(t=>j(e,t)))}),(e=>[e.blocks.order])),q=(e,t)=>(0,u.flatMap)(t,(t=>{const n=xe(e,t);return[...n,...q(e,n)]})),Y=D((e=>{const t=xe(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)=>{if(!t)return z;const n=Y(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:z}),(e=>[e.blocks.order,e.blocks.byClientId])),Z=D(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>U(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function J(e,t){return xe(e,t).length}function ee(e){return e.selection.selectionStart}function te(e){return e.selection.selectionEnd}function ne(e){return e.selection.selectionStart.clientId}function oe(e){return e.selection.selectionEnd.clientId}function re(e){return be(e).length||(e.selection.selectionStart.clientId?1:0)}function le(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ie(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function se(e){const t=ie(e);return t?U(e,t):null}function ae(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const ce=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])),ue=D((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=ce(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 de(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function pe(e,t){const n=ie(e),o=[...ce(e,t),t],r=[...ce(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 me(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ie(e)),void 0===t&&(t=n<0?_e(e):ye(e)),!t)return null;const o=ae(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 fe(e,t){return me(e,t,-1)}function ge(e,t){return me(e,t,1)}function he(e){return e.initialPosition}const ve=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=ae(e,t.clientId);if(null===o)return z;const r=xe(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 be(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?z:ve(e)}const ke=D((e=>{const t=be(e);return t.length?t.map((t=>U(e,t))):z}),(e=>[...ve.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function _e(e){return(0,u.first)(be(e))||null}function ye(e){return(0,u.last)(be(e))||null}function Ee(e,t){return _e(e)===t}function Ce(e,t){return-1!==be(e).indexOf(t)}const Se=D(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=ae(e,n),o=Ce(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 Be(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function xe(e,t){return e.blocks.order[t||""]||z}function Ie(e,t){return xe(e,ae(e,t)).indexOf(t)}function Te(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Ne(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(xe(e,t),(t=>Te(e,t)||Ce(e,t)||n&&Ne(e,t,n)))}function Pe(e,t){if(!t)return!1;const n=be(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Me(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Re(e){return e.isMultiSelecting}function Le(e){return e.isSelectionEnabled}function Ae(e,t){return e.blocksMode[t]||"visual"}function De(e){return e.isTyping}function Oe(e){return!!e.draggedBlocks.length}function Fe(e){return e.draggedBlocks}function ze(e,t){return e.draggedBlocks.includes(t)}function Ve(e,t){if(!Oe(e))return!1;const n=ce(e,t);return(0,u.some)(n,(t=>ze(e,t)))}function He(e){return e.isCaretWithinFormattedText}function Ge(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=ae(e,l)||void 0,n=Ie(e,r.clientId)+1):n=xe(e).length,{rootClientId:t,index:n}}function Ue(e){return null!==e.insertionPoint}function We(e){return e.template.isValid}function $e(e){return e.settings.template}function je(e,t){if(!t)return e.settings.templateLock;const n=vt(e,t);return n?n.templateLock:null}const Ke=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},qe=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}=bt(e),s=Ke(i,t,!0);if(!s)return!1;const a=!!je(e,o);if(a)return!1;const c=vt(e,o);if(o&&void 0===c)return!1;const u=null==c?void 0:c.allowedBlocks,d=Ke(u,t),p=n.parent,m=V(e,o),f=Ke(p,m),g=null===d&&null===f||!0===d||!0===f;return g?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",g,n,o,{getBlock:U.bind(null,e),getBlockParentsByBlockName:ue.bind(null,e)}):g},Ye=D(qe,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function Xe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Ye(e,V(e,t),n)))}function Qe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=G(e,t);if(null===o)return!0;const{lock:r}=o,l=!!je(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function Ze(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Qe(e,t,n)))}function Je(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=G(e,t);if(null===o)return;const{lock:r}=o,l="all"===je(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function et(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Je(e,t,n)))}function tt(e,t){var n;return!!(0,r.hasBlockSupport)(t,"__experimentalLock",!0)&&!(null===(n=e.settings)||void 0===n||!n.__experimentalCanLockBlocks)}function nt(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 ot=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&qe(e,t.name,n),rt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=nt(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:lt(r,l)}},lt=(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}},it=(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)(Z(e,Y(e)),{name:t.name}));const{time:i,count:s=0}=nt(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:lt(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}}},st=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=it(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}=nt(e,l)||{},c=lt(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=>ot(e,n,t))).map(n),a=qe(e,"core/block",t)?St(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=rt(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,St(e),(0,r.getBlockTypes)()])),at=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=it(e,{buildScope:"transform"}),l=(0,r.getBlockTypes)().filter((t=>ot(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)()])),ct=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>ot(e,n,t)));if(n)return!0;const o=qe(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),(0,r.getBlockTypes)()])),ut=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=>ot(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),dt=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(U(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),pt=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,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),mt=D((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=bt(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return pt(e,n)})).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(!Ke(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])),ft=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=mt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return Ye(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),gt=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return z;const o=ft(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)=>[...ft.getDependants(e,t)])),ht=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||Tt(e,n)})))return z;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return gt(e,o,n)}),((e,t)=>[...gt.getDependants(e,t)]));function vt(e,t){return e.blockListSettings[t]}function bt(e){return e.settings}function kt(e){return e.blocks.isPersistentChange}const _t=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])),yt=D(((e,t)=>{var n;const o=(0,u.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 Et(e){return e.blocks.isIgnoredChange}function Ct(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:z}function wt(e){return e.isNavigationMode}function Bt(e){return e.hasBlockMovingClientId}function xt(e){return!!e.automaticChangeStatus}function It(e,t){return e.highlightedBlock===t}function Tt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Nt=D(((e,t)=>{if(!t.length)return null;const n=ie(e);if(t.includes(V(e,n)))return n;const o=be(e),r=ue(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Pt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Mt=window.wp.a11y,Rt=window.wp.richText,Lt=window.wp.deprecated,At=n.n(Lt);const Dt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Ot(e))},Ot=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 Ft(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function zt(e){return At()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Vt(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 Ht(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Gt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Ut=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Wt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function $t(){return{type:"START_MULTI_SELECT"}}function jt(){return{type:"STOP_MULTI_SELECT"}}const Kt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:r,dispatch:l}=o;if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;l({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,Mt.speak)((0,g.sprintf)(
2
  /* translators: %s: number of selected blocks */
3
- (0,g._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function qt(){return{type:"CLEAR_SELECTED_BLOCK"}}function Yt(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function Xt(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 Qt=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=Xt((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 Zt(e,t){return Qt(e,t)}const Jt=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},en=Jt("MOVE_BLOCKS_DOWN"),tn=Jt("MOVE_BLOCKS_UP"),nn=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 on(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 nn([e],t,n,o)}function rn(e,t,n,o,r){return ln([e],t,n,o,0,r)}const ln=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,At()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=Xt((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 sn(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 an(){return{type:"HIDE_INSERTION_POINT"}}function cn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const un=()=>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)},dn=(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:g,offset:h}=o.getSelectionStart(),v=(f===s?d:m).attributes[g],b=(f===s||f===a)&&void 0!==g&&void 0!==h&&!!v;v||("number"==typeof g?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 g):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[g],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=v,l=(0,Rt.insert)((0,Rt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),"†",h,h);e.attributes[g]=(0,Rt.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,Rt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),s=i.text.indexOf("†"),a=(0,Rt.remove)(i,s,s+1),p=(0,Rt.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)},pn=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 mn(e,t){return pn([e],t)}function fn(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 gn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function hn(){return{type:"START_TYPING"}}function vn(){return{type:"STOP_TYPING"}}function bn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function kn(){return{type:"STOP_DRAGGING_BLOCKS"}}function yn(){return{type:"ENTER_FORMATTED_TEXT"}}function En(){return{type:"EXIT_FORMATTED_TEXT"}}function Cn(e,t,n,o){return{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}}const Sn=(e,t,n)=>o=>{let{dispatch:l}=o;const i=(0,r.getDefaultBlockName)();if(!i)return;const s=(0,r.createBlock)(i,e);return l.insertBlock(s,n,t)};function wn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Bn(e){return{type:"UPDATE_SETTINGS",settings:e}}function xn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function In(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Tn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Nn=()=>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"})}))},Pn=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,Mt.speak)((0,g.__)("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,Mt.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Mn=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,Mt.speak)((0,g.__)("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."))}},Rn=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;if(i.map((e=>e.name)).some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),a=o.getBlockIndex((0,u.last)((0,u.castArray)(e))),c=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(c,a+1,s,t),c.length>1&&t&&l.multiSelect((0,u.first)(c).clientId,(0,u.last)(c).clientId),c.map((e=>e.clientId))}},Ln=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)},An=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 Dn(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const On=e=>async t=>{let{dispatch:n}=t;n(Dn(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Dn(e,!1))};function Fn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const zn="core/block-editor",Vn={reducer:M,selectors:e,actions:t},Hn=(0,m.createReduxStore)(zn,{...Vn,persist:["preferences"]});(0,m.registerStore)(zn,{...Vn,persist:["preferences"]});const Gn={name:"",isSelected:!1},Un=(0,s.createContext)(Gn),{Provider:Wn}=Un;function $n(){return(0,s.useContext)(Un)}function jn(){const{isSelected:e,clientId:t,name:n}=$n();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(Hn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function Kn(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=jn(),{clientId:o}=$n(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(Hn),{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 qn(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 Yn=Kn;Yn.Slot=qn;const Xn=e=>(0,s.createElement)(Kn,i({group:"inline"},e));Xn.Slot=e=>(0,s.createElement)(qn,i({group:"inline"},e));var Qn=Yn,Zn=(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"})),Jn=(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"})),eo=(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"})),to=(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"})),no=(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"})),oo=(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"})),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 9v6h11V9H9zM4 20h1.5V4H4v16z"})),lo=(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"})),io=(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"})),so=(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"})),ao=(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"})),co=(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 uo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const po=(0,s.createContext)({refs:new Map,callbacks:new Map});function mo(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(po.Provider,{value:n},t)}function fo(e){const{refs:t,callbacks:n}=(0,s.useContext)(po),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 go(e){const{refs:t}=(0,s.useContext)(po),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 ho(e){const{callbacks:t}=(0,s.useContext)(po),n=go(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}const vo=["color","border","typography","spacing"],bo={"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},ko={"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 _o(e){const{name:t}=$n();return(0,m.useSelect)((n=>{var o;if(vo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(Hn).getSettings(),i=(e=>ko[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=bo[i]?bo[i](l):void 0;return void 0!==m?m:"typography.dropCap"===i||void 0}),[t,e])}window.wp.warning;var yo={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),border:(0,p.createSlotFill)("InspectorControlsBorder"),color:(0,p.createSlotFill)("InspectorControlsColor"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function Eo(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=jn(),l=null===(t=yo[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 Co=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,Co),u.identity);return(0,u.isEmpty)(t)?void 0:t};function So(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function wo(e,t,n,o,r,l){var i;if((0,u.every)(e,(e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var a;s=null===(a=o[r])||void 0===a?void 0:a.attributes}let c=n;return(0,u.forEach)(e,((e,n)=>{e&&t[n].forEach((e=>{const t=(0,u.get)(s,e);t&&(c={...c,attributes:So(c.attributes,e,t)})}))})),c}function Bo(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(Hn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(Hn),u=a(),d=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=c()?i():[u];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:Co(r.style)},t[n]=r})),r(n,t,!0)}),[Co,l,i,c,u,r]);return(0,s.createElement)(p.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},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,bubblesVirtually:!0}))}function Io(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=yo[n])||void 0===t?void 0:t.Slot,a=(0,p.__experimentalUseSlot)(null==l?void 0:l.__unstableName);return l&&a?Boolean(a.fills&&a.fills.length)?o?(0,s.createElement)(Bo,{group:n,label:o},(0,s.createElement)(xo,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const To=Eo;To.Slot=Io;const No=e=>(0,s.createElement)(Eo,i({},e,{__experimentalGroup:"advanced"}));No.Slot=e=>(0,s.createElement)(Io,i({},e,{__experimentalGroup:"advanced"})),No.slotName="InspectorAdvancedControls";var Po=To;function Mo(e){const t=(0,r.getBlockSupport)(e,Fo);return!!(!0===t||null!=t&&t.margin)}function Ro(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!_o("spacing.margin"),n=!Wo(e,"margin");return!Mo(e)||t||n}function Lo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:_o("spacing.units")||["%","px","em","rem","vw"]}),i=Uo(n,"margin"),a=i&&i.some((e=>Vo.includes(e)));return Ro(e)?null: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:Co(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:Co(t)})},label:(0,g.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Ao(e){const t=(0,r.getBlockSupport)(e,Fo);return!!(!0===t||null!=t&&t.padding)}function Do(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!_o("spacing.padding"),n=!Wo(e,"padding");return!Ao(e)||t||n}function Oo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:_o("spacing.units")||["%","px","em","rem","vw"]}),i=Uo(n,"padding"),a=i&&i.some((e=>Vo.includes(e)));return Do(e)?null: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:Co(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:Co(t)})},label:(0,g.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const Fo="spacing",zo=["top","right","bottom","left"],Vo=["vertical","horizontal"];function Ho(e){const t=Ko(e),n=Do(e),o=Ro(e),l=Go(e),i=(a=e.name,"web"===s.Platform.OS&&($o(a)||Ao(a)||Mo(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[Fo,"__experimentalDefaultControls"]),u=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)(Po,{__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,g.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Co({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:u("padding"),isShownByDefault:null==c?void 0:c.padding,panelId:e.clientId},(0,s.createElement)(Oo,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,g.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Co({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:u("margin"),isShownByDefault:null==c?void 0:c.margin,panelId:e.clientId},(0,s.createElement)(Lo,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,g.__)("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:u("blockGap"),isShownByDefault:null==c?void 0:c.blockGap,panelId:e.clientId},(0,s.createElement)(qo,e)))}const Go=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Ko(e),n=Do(e),o=Ro(e);return t&&n&&o};function Uo(e,t){const n=(0,r.getBlockSupport)(e,Fo);if(n&&"boolean"!=typeof n[t])return n[t]}function Wo(e,t){const n=Uo(e,t);return!(n&&n.some((e=>zo.includes(e)))&&n.some((e=>Vo.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function $o(e){const t=(0,r.getBlockSupport)(e,Fo);return!!(!0===t||null!=t&&t.blockGap)}function jo(e){if(!e)return e;const t="string"==typeof e;return{top:t?e:null==e?void 0:e.top,left:t?e:null==e?void 0:e.left}}function Ko(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!_o("spacing.blockGap");return!$o(e)||t}function qo(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=(0,p.__experimentalUseCustomUnits)({availableUnits:_o("spacing.units")||["%","px","em","rem","vw"]}),a=Uo(r,"blockGap"),c=go(n);if(Ko(e))return null;const u=e=>{var t;const n={...o,spacing:{...null==o?void 0:o.spacing,blockGap:{...jo(e)}}};l({style:Co(n)});const r=(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 i;c.current&&r&&(null===(i=c.current.parentNode)||void 0===i||i.replaceChild(c.current,c.current))},d=a&&a.some((e=>Vo.includes(e))),m=jo(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),f=d?{...m,right:null==m?void 0:m.left,bottom:null==m?void 0:m.top}:null==m?void 0:m.top;return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,d?(0,s.createElement)(p.__experimentalBoxControl,{label:(0,g.__)("Block spacing"),min:0,onChange:u,units:i,sides:a,values:f,allowReset:!1,splitOnAxis:d}):(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:u,units:i,value:f})),native:null})}const Yo={left:ro,center:lo,right:io,"space-between":so};var Xo=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?Yo[r]:Yo.left,d=[{name:"left",icon:ro,title:(0,g.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:lo,title:(0,g.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:io,title:(0,g.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:so,title:(0,g.__)("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,g.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};function Qo(e){return(0,s.createElement)(Xo,i({},e,{isToolbar:!1}))}function Zo(e){return(0,s.createElement)(Xo,i({},e,{isToolbar:!0}))}const Jo={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},er={left:"flex-start",right:"flex-end",center:"center"},tr=["wrap","nowrap"];var nr={name:"flex",label:(0,g.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Flex,null,(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(or,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,r&&(0,s.createElement)(lr,{layout:t,onChange:n}))),(0,s.createElement)(rr,{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)(or,{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!==_o("spacing.blockGap"),c=null!==(t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=jo(e);if(!n)return null;const o=(null==n?void 0:n.top)||t,r=(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"))&&void 0!==t?t:"var( --wp--style--block-gap, 0.5em )",u=Jo[r.justifyContent]||Jo.left,d=tr.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: ${er[r.justifyContent]||er.left};\n\t\t`;return(0,s.createElement)("style",null,`\n\t\t\t\t${uo(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-wrap: ${d};\n\t\t\t\t\tgap: ${a?c:"0.5em"};\n\t\t\t\t\t${"horizontal"===i?p:m}\n\t\t\t\t}\n\n\t\t\t\t${uo(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 or(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)(Qo,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:ro,label:(0,g.__)("Justify items left")},{value:"center",icon:lo,label:(0,g.__)("Justify items center")},{value:"right",icon:io,label:(0,g.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:so,label:(0,g.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,g.__)("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 rr(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function lr(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,g.__)("Orientation")),(0,s.createElement)(p.Button,{label:"horizontal",icon:ao,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:"vertical",icon:co,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var ir=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})};const sr=[{name:"default",label:(0,g.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:_o("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,g.__)("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)(ir,{icon:eo})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("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)(ir,{icon:no}))),(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,g.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,g.__)("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!==_o("spacing.blockGap"),u=jo(null==l||null===(t=l.spacing)||void 0===t?void 0:t.blockGap),d=null!==(n=null==u?void 0:u.top)&&void 0!==n?n:"var( --wp--style--block-gap )";let p=i||a?`\n\t\t\t\t\t${uo(o,"> :where(:not(.alignleft):not(.alignright))")} {\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\t\t\t\t\t${uo(o,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\t\t\t\t\t${uo(o,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return p+=`\n\t\t\t${uo(o,"> .alignleft")} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-inline-start: 0;\n\t\t\t\tmargin-inline-end: 2em;\n\t\t\t}\n\t\t\t${uo(o,"> .alignright")} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-inline-start: 2em;\n\t\t\t\tmargin-inline-end: 0;\n\t\t\t}\n\n\t\t\t${uo(o,"> .aligncenter")} {\n\t\t\t\tmargin-left: auto !important;\n\t\t\t\tmargin-right: auto !important;\n\t\t\t}\n\t\t`,c&&(p+=`\n\t\t\t\t${uo(o,"> *")} {\n\t\t\t\t\tmargin-block-start: 0;\n\t\t\t\t\tmargin-block-end: 0;\n\t\t\t\t}\n\t\t\t\t${uo(o,"> * + *")} {\n\t\t\t\t\tmargin-block-start: ${d};\n\t\t\t\t}\n\t\t\t`),(0,s.createElement)("style",null,p)},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(
4
  // translators: %s: container size (i.e. 600px etc)
5
  o.none=(0,g.sprintf)((0,g.__)("Max %s wide"),t)),r.test(n)&&(
6
  // translators: %s: container size (i.e. 600px etc)
7
- o.wide=(0,g.sprintf)((0,g.__)("Max %s wide"),n)),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}},nr];function ar(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return sr.find((t=>t.name===e))}const cr={type:"default"},ur=(0,s.createContext)(cr),dr=ur.Provider;function pr(){return(0,s.useContext)(ur)}function mr(e){let{layout:t={},...n}=e;const o=ar(t.type);return o?(0,s.createElement)(o.save,i({layout:t},n)):null}const fr=["none","left","center","right","wide","full"],gr=["wide","full"];function hr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fr;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Hn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=pr(),r=ar(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=fr}=o,s=e.filter((e=>(o.alignments||t||!gr.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const vr={none:{icon:Zn,title:(0,g.__)("None")},left:{icon:Jn,title:(0,g.__)("Align left")},center:{icon:eo,title:(0,g.__)("Align center")},right:{icon:to,title:(0,g.__)("Align right")},wide:{icon:no,title:(0,g.__)("Wide width")},full:{icon:oo,title:(0,g.__)("Full width")}},br={isAlternate:!0};var kr=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=hr(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=vr[t],m=vr.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,h={popoverProps:br,icon:d?d.icon:m.icon,label:(0,g.__)("Align"),toggleProps:{describedBy:(0,g.__)("Change alignment")}},v=r||s.Platform.isNative?{isCollapsed:r?l:void 0,controls:a.map((e=>{let{name:n}=e;return{...vr[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}=vr[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({},h,v))};function _r(e){return(0,s.createElement)(kr,i({},e,{isToolbar:!1}))}function yr(e){return(0,s.createElement)(kr,i({},e,{isToolbar:!0}))}const Er=["left","center","right","wide","full"],Cr=["wide","full"];function Sr(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)?Er.filter((t=>e.includes(t))):!0===e?[...Er]:[],!o||!0===e&&!n?(0,u.without)(t,...Cr):t}const wr=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=hr(Sr((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)(_r,{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"),Br=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=hr(Sr((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:[...Er,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",Br),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",wr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Sr((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}));const xr=/[\s#]/g,Ir={type:"string",source:"attribute",attribute:"id",selector:"*"},Tr=(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,g.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,g.__)("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,g.__)("https://wordpress.org/support/article/page-jumps/")},(0,g.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,g.__)("Add an anchor"),onChange:e=>{e=e.replace(xr,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(Po,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(Po,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("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:Ir}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Tr),(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 Nr=(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)(Po,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,g.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,g.__)("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",Nr),(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.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,r.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var l;const o=null===(l=t[n])||void 0===l?void 0:l.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return 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}));const Pr=[{name:"padding",generate:(e,t)=>function(e,t,n,o){const r=(0,u.get)(e,["spacing","padding"]);if(!r)return[];const l=[];if("string"==typeof r)l.push({selector:t.selector,key:o,value:r});else{const e=["top","right","bottom","left"].reduce(((e,n)=>{const o=(0,u.get)(r,[n]);return o&&e.push({selector:t.selector,key:`padding${(0,u.upperFirst)(n)}`,value:o}),e}),[]);l.push(...e)}return l}(e,t,0,"padding")}];function Mr(e,t){const n=[];return Pr.forEach((o=>{n.push(...o.generate(e,t))})),n}var Rr=window.wp.dom;const Lr=(0,s.createContext)({});function Ar(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 Dr=Lr;const Or={};var Fr=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(Dr),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):Or),[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 zr(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(Wn,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(Fr,e))}var Vr=(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"})),Hr=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:Vr,label:(0,g.__)("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)))))))))},Gr=n(1973);function Ur(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 Wr=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,Gr.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)(Ur,{title:(0,g.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,g.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(Ur,{title:(0,g.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))};const $r=e=>(0,r.rawHandler)({HTML:e.originalContent});var jr=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(Hn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(Hn);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,$r(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)((()=>[{
8
  // translators: Button to fix block content
9
- title:(0,g._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,g.__)("Convert to HTML"),onClick:t},{title:(0,g.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Hr,{actions:[(0,s.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,g.__)("Attempt Block Recovery"))],secondaryActions:f},(0,g.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(p.Modal,{title:// translators: Dialog title to fix block content
10
- (0,g.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(Wr,{block:i,onKeep:t,onConvert:n,convertor:$r,convertButtonText:(0,g.__)("Convert to Blocks")})))}));const Kr=(0,s.createElement)(Hr,{className:"block-editor-block-list__block-crash-warning"},(0,g.__)("This block has encountered an error and cannot be previewed."));var qr=()=>Kr;class Yr 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 Xr=Yr,Qr=n(773),Zr=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(Hn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(Hn);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(Qr.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.validateBlock)({...l,attributes:s,originalContent:a}):[!0];i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let Jr=fl();const el=e=>ul(e,Jr);let tl=fl();el.write=e=>ul(e,tl);let nl=fl();el.onStart=e=>ul(e,nl);let ol=fl();el.onFrame=e=>ul(e,ol);let rl=fl();el.onFinish=e=>ul(e,rl);let ll=[];el.setTimeout=(e,t)=>{let n=el.now()+t,o=()=>{let e=ll.findIndex((e=>e.cancel==o));~e&&ll.splice(e,1),hl.count-=~e?1:0},r={time:n,handler:e,cancel:o};return ll.splice(il(n),0,r),hl.count+=1,dl(),r};let il=e=>~(~ll.findIndex((t=>t.time>e))||~ll.length);el.cancel=e=>{Jr.delete(e),tl.delete(e)},el.sync=e=>{cl=!0,el.batchedUpdates(e),cl=!1},el.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,el.onStart(n)}return o.handler=e,o.cancel=()=>{nl.delete(n),t=null},o};let sl="undefined"!=typeof window?window.requestAnimationFrame:()=>{};el.use=e=>sl=e,el.now="undefined"!=typeof performance?()=>performance.now():Date.now,el.batchedUpdates=e=>e(),el.catch=console.error,el.frameLoop="always",el.advance=()=>{"demand"!==el.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):ml()};let al=-1,cl=!1;function ul(e,t){cl?(t.delete(e),e(0)):(t.add(e),dl())}function dl(){al<0&&(al=0,"demand"!==el.frameLoop&&sl(pl))}function pl(){~al&&(sl(pl),el.batchedUpdates(ml))}function ml(){let e=al;al=el.now();let t=il(al);t&&(gl(ll.splice(0,t),(e=>e.handler())),hl.count-=t),nl.flush(),Jr.flush(e?Math.min(64,al-e):16.667),ol.flush(),tl.flush(),rl.flush()}function fl(){let e=new Set,t=e;return{add(n){hl.count+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(hl.count-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,hl.count-=t.size,gl(t,(t=>t(n)&&e.add(t))),hl.count+=e.size,t=e)}}}function gl(e,t){e.forEach((e=>{try{t(e)}catch(e){el.catch(e)}}))}const hl={count:0,clear(){al=-1,ll=[],nl=fl(),Jr=fl(),ol=fl(),tl=fl(),rl=fl(),hl.count=0}};var vl=n(9196),bl=n.n(vl);function kl(){}const _l={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 yl(e,t){if(_l.arr(e)){if(!_l.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 El=(e,t)=>e.forEach(t);function Cl(e,t,n){for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const Sl=e=>_l.und(e)?[]:_l.arr(e)?e:[e];function wl(e,t){if(e.size){const n=Array.from(e);e.clear(),El(n,t)}}const Bl=(e,...t)=>wl(e,(e=>e(...t)));let xl,Il,Tl=null,Nl=!1,Pl=kl;var Ml=Object.freeze({__proto__:null,get createStringInterpolator(){return xl},get to(){return Il},get colors(){return Tl},get skipAnimation(){return Nl},get willAdvance(){return Pl},assign:e=>{e.to&&(Il=e.to),e.now&&(el.now=e.now),void 0!==e.colors&&(Tl=e.colors),null!=e.skipAnimation&&(Nl=e.skipAnimation),e.createStringInterpolator&&(xl=e.createStringInterpolator),e.requestAnimationFrame&&el.use(e.requestAnimationFrame),e.batchedUpdates&&(el.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Pl=e.willAdvance),e.frameLoop&&(el.frameLoop=e.frameLoop)}});const Rl=new Set;let Ll=[],Al=[],Dl=0;const Ol={get idle(){return!Rl.size&&!Ll.length},start(e){Dl>e.priority?(Rl.add(e),el.onStart(Fl)):(zl(e),el(Hl))},advance:Hl,sort(e){if(Dl)el.onFrame((()=>Ol.sort(e)));else{const t=Ll.indexOf(e);~t&&(Ll.splice(t,1),Vl(e))}},clear(){Ll=[],Rl.clear()}};function Fl(){Rl.forEach(zl),Rl.clear(),el(Hl)}function zl(e){Ll.includes(e)||Vl(e)}function Vl(e){Ll.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(Ll),0,e)}function Hl(e){const t=Al;for(let n=0;n<Ll.length;n++){const o=Ll[n];Dl=o.priority,o.idle||(Pl(o),o.advance(e),o.idle||t.push(o))}return Dl=0,Al=Ll,Al.length=0,Ll=t,Ll.length>0}const Gl="[-+]?\\d*\\.?\\d+",Ul=Gl+"%";function Wl(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const $l=new RegExp("rgb"+Wl(Gl,Gl,Gl)),jl=new RegExp("rgba"+Wl(Gl,Gl,Gl,Gl)),Kl=new RegExp("hsl"+Wl(Gl,Ul,Ul)),ql=new RegExp("hsla"+Wl(Gl,Ul,Ul,Gl)),Yl=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Xl=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Ql=/^#([0-9a-fA-F]{6})$/,Zl=/^#([0-9a-fA-F]{8})$/;function Jl(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 ei(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=Jl(r,o,e+1/3),i=Jl(r,o,e),s=Jl(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function ti(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function ni(e){return(parseFloat(e)%360+360)%360/360}function oi(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function ri(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function li(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Ql.exec(e))?parseInt(t[1]+"ff",16)>>>0:Tl&&void 0!==Tl[e]?Tl[e]:(t=$l.exec(e))?(ti(t[1])<<24|ti(t[2])<<16|ti(t[3])<<8|255)>>>0:(t=jl.exec(e))?(ti(t[1])<<24|ti(t[2])<<16|ti(t[3])<<8|oi(t[4]))>>>0:(t=Yl.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Zl.exec(e))?parseInt(t[1],16)>>>0:(t=Xl.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|ei(ni(t[1]),ri(t[2]),ri(t[3])))>>>0:(t=ql.exec(e))?(ei(ni(t[1]),ri(t[2]),ri(t[3]))|oi(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 ii=(e,t,n)=>{if(_l.fun(e))return e;if(_l.arr(e))return ii({range:e,output:t,extrapolate:n});if(_l.str(e.output[0]))return xl(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)}return o===r?o:t===n?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,c)}(e,l[t],l[t+1],r[t],r[t+1],a,i,s,o.map)}};function si(){return(si=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 ai=Symbol.for("FluidValue.get"),ci=Symbol.for("FluidValue.observers"),ui=e=>Boolean(e&&e[ai]),di=e=>e&&e[ai]?e[ai]():e,pi=e=>e[ci]||null;function mi(e,t){let n=e[ci];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class fi{constructor(e){if(this[ai]=void 0,this[ci]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");gi(this,e)}}const gi=(e,t)=>bi(e,ai,t);function hi(e,t){if(e[ai]){let n=e[ci];n||bi(e,ci,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function vi(e,t){let n=e[ci];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[ci]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const bi=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),ki=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_i=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;let yi;const Ei=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Ci=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Si=e=>{yi||(yi=Tl?new RegExp(`(${Object.keys(Tl).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>di(e).replace(_i,li).replace(yi,li))),n=t.map((e=>e.match(ki).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=>ii(si({},e,{output:t}))));return e=>{let n=0;return t[0].replace(ki,(()=>String(o[n++](e)))).replace(Ei,Ci)}},wi="react-spring: ",Bi=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${wi}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},xi=Bi(console.warn),Ii=Bi(console.warn);function Ti(e){return _l.str(e)&&("#"==e[0]||/\d/.test(e)||e in(Tl||{}))}const Ni=e=>(0,vl.useEffect)(e,Pi),Pi=[];function Mi(){const e=(0,vl.useState)()[1],t=(0,vl.useState)(Ri)[0];return Ni(t.unmount),()=>{t.current&&e({})}}function Ri(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function Li(e){const t=(0,vl.useRef)();return(0,vl.useEffect)((()=>{t.current=e})),t.current}const Ai="undefined"!=typeof window&&window.document&&window.document.createElement?vl.useLayoutEffect:vl.useEffect,Di=Symbol.for("Animated:node"),Oi=e=>e&&e[Di],Fi=(e,t)=>{return n=e,o=Di,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},zi=e=>e&&e[Di]&&e[Di].getPayload();class Vi{constructor(){this.payload=void 0,Fi(this,this)}getPayload(){return this.payload||[]}}class Hi extends Vi{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,_l.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Hi(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return _l.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,_l.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class Gi extends Hi{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=ii({output:[e,e]})}static create(e){return new Gi(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(_l.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=ii({output:[this.getValue(),e]})),this._value=0,super.reset()}}const Ui={dependencies:null};class Wi extends Vi{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Cl(this.source,((n,o)=>{var r;(r=n)&&r[Di]===r?t[o]=n.getValue(e):ui(n)?t[o]=di(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&El(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Cl(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Ui.dependencies&&ui(e)&&Ui.dependencies.add(e);const t=zi(e);t&&El(t,(e=>this.add(e)))}}class $i extends Wi{constructor(e){super(e)}static create(e){return new $i(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(ji)),!0)}}function ji(e){return(Ti(e)?Gi:Hi).create(e)}function Ki(e){const t=Oi(e);return t?t.constructor:_l.arr(e)?$i:Ti(e)?Gi:Hi}function qi(){return(qi=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 Yi=(e,t)=>{const n=!_l.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,vl.forwardRef)(((o,r)=>{const l=(0,vl.useRef)(null),i=n&&(0,vl.useCallback)((e=>{l.current=function(e,t){return e&&(_l.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return Ui.dependencies=n,e.style&&(e=qi({},e,{style:t.createAnimatedStyle(e.style)})),e=new Wi(e),Ui.dependencies=null,[e,n]}(o,t),c=Mi(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new Xi(u,a),p=(0,vl.useRef)();Ai((()=>{const e=p.current;p.current=d,El(a,(e=>hi(e,d))),e&&(El(e.deps,(t=>vi(t,e))),el.cancel(e.update))})),(0,vl.useEffect)(u,[]),Ni((()=>()=>{const e=p.current;El(e.deps,(t=>vi(t,e)))}));const m=t.getComponentProps(s.getValue());return vl.createElement(e,qi({},m,{ref:i}))}))};class Xi{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&el.write(this.update)}}const Qi=Symbol.for("AnimatedComponent"),Zi=e=>_l.str(e)?e:e&&_l.str(e.displayName)?e.displayName:_l.fun(e)&&e.name||null;function Ji(){return(Ji=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 es(e,...t){return _l.fun(e)?e(...t):e}const ts=(e,t)=>!0===e||!!(t&&e&&(_l.fun(e)?e(t):Sl(e).includes(t))),ns=(e,t)=>_l.obj(e)?t&&e[t]:e,os=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,rs=e=>e,ls=(e,t=rs)=>{let n=is;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);_l.und(n)||(o[r]=n)}return o},is=["config","onProps","onStart","onChange","onPause","onResume","onRest"],ss={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 as(e){const t=function(e){const t={};let n=0;if(Cl(e,((e,o)=>{ss[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Cl(e,((e,o)=>o in t||(n[o]=e))),n}return Ji({},e)}function cs(e){return e=di(e),_l.arr(e)?e.map(cs):Ti(e)?Ml.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function us(e){for(const t in e)return!0;return!1}function ds(e){return _l.fun(e)||_l.arr(e)&&_l.obj(e[0])}function ps(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function ms(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const fs=Ji({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class gs{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,fs)}}function hs(e,t){if(_l.und(t.decay)){const n=!_l.und(t.tension)||!_l.und(t.friction);!n&&_l.und(t.frequency)&&_l.und(t.damping)&&_l.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const vs=[];class bs{constructor(){this.changed=!1,this.values=vs,this.toValues=null,this.fromValues=vs,this.to=void 0,this.from=void 0,this.config=new gs,this.immediate=!1}}function ks(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=ts(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)f();else{_l.und(n.pause)||(r.paused=ts(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||ts(e,t)),c=es(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-el.now()}function m(){c>0?(u=el.setTimeout(f,c),r.pauseQueue.add(p),r.timeouts.add(u)):f()}function f(){r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(Ji({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const _s=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Cs(e.get()):t.every((e=>e.noop))?ys(e.get()):Es(e.get(),t.every((e=>e.finished))),ys=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Es=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Cs=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=ls(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)&&Cs(o)||r!==n.asyncId&&Es(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new Bs,i=new xs;return(async()=>{if(Ml.skipAnimation)throw ws(n),i.result=Es(o,!1),d(i),i;m(l);const s=_l.obj(e)?Ji({},e):Ji({},t,{to:e});s.parentId=r,Cl(c,((e,t)=>{_l.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 g;if(Ml.skipAnimation)return ws(n),Es(o,!1);try{let t;t=_l.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]),g=Es(o.get(),!0,!1)}catch(e){if(e instanceof Bs)g=e.result;else{if(!(e instanceof xs))throw e;g=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return _l.fun(i)&&el.batchedUpdates((()=>{i(g,o,o.item)})),g})():a}function ws(e,t){wl(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Bs 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 xs extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Is=e=>e instanceof Ns;let Ts=1;class Ns extends fi{constructor(...e){super(...e),this.id=Ts++,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=Oi(this);return e&&e.getValue()}to(...e){return Ml.to(this,e)}interpolate(...e){return xi(`${wi}The "interpolate" function is deprecated in v9 (use "to" instead)`),Ml.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){mi(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Ol.sort(this),mi(this,{type:"priority",parent:this,priority:e})}}const Ps=Symbol.for("SpringPhase"),Ms=e=>(1&e[Ps])>0,Rs=e=>(2&e[Ps])>0,Ls=e=>(4&e[Ps])>0,As=(e,t)=>t?e[Ps]|=3:e[Ps]&=-3,Ds=(e,t)=>t?e[Ps]|=4:e[Ps]&=-5;class Os extends Ns{constructor(e,t){if(super(),this.key=void 0,this.animation=new bs,this.queue=void 0,this.defaultProps={},this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!_l.und(e)||!_l.und(t)){const n=_l.obj(e)?Ji({},e):Ji({},t,{from:e});_l.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Rs(this)||this._state.asyncTo)||Ls(this)}get goal(){return di(this.animation.to)}get velocity(){const e=Oi(this);return e instanceof Hi?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Ms(this)}get isAnimating(){return Rs(this)}get isPaused(){return Ls(this)}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=zi(o.to);!i&&ui(o.to)&&(l=Sl(di(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==Gi?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=_l.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(_l.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=!_l.und(a),m=n==c?s.v0>0:n<c;let f,g=!1;const h=1,v=Math.ceil(e/h);for(let e=0;e<v&&(f=Math.abs(i)>o,f||(u=Math.abs(c-d)<=t,!u));++e)p&&(g=d==c||d>c==m,g&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*h,d+=i*h}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=Oi(this),a=s.getValue();if(t){const e=di(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 el.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Rs(this)){const{to:e,config:t}=this.animation;el.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 _l.und(e)?(n=this.queue||[],this.queue=[]):n=[_l.obj(e)?e:Ji({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>_s(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),ws(this._state,e&&this._lastCallId),el.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=_l.obj(n)?n[t]:n,(null==n||ds(n))&&(n=void 0),o=_l.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return Ms(this)||(e.reverse&&([n,o]=[o,n]),o=di(o),_l.und(o)?Oi(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Ji({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,ls(n,((e,t)=>/^on/.test(t)?ns(e,o):e))),Ws(this,n,"onProps"),$s(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 ks(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{Ls(this)||(Ds(this,!0),Bl(i.pauseQueue),$s(this,"onPause",Es(this,Fs(this,this.animation.to)),this))},resume:()=>{Ls(this)&&(Ds(this,!1),Rs(this)&&this._resume(),Bl(i.resumeQueue),$s(this,"onResume",Es(this,Fs(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=zs(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Cs(this));const o=!_l.und(e.to),r=!_l.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Cs(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&&!_l.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!yl(d,c);p&&(s.from=d),d=di(d);const m=!yl(u,a);m&&this._focus(u);const f=ds(t.to),{config:g}=s,{decay:h,velocity:v}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&(hs(n=Ji({},n),t),t=Ji({},n,t)),hs(e,t),Object.assign(e,t);for(const t in fs)null==e[t]&&(e[t]=fs[t]);let{mass:o,frequency:r,damping:l}=e;_l.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)}(g,es(t.config,l),t.config!==i.config?es(i.config,l):void 0);let b=Oi(this);if(!b||_l.und(u))return n(Es(this,!0));const k=_l.und(t.reset)?r&&!t.default:!_l.und(d)&&ts(t.reset,l),_=k?d:this.get(),y=cs(u),E=_l.num(y)||_l.arr(y)||Ti(y),C=!f&&(!E||ts(i.immediate||t.immediate,l));if(m){const e=Ki(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 S=b.constructor;let w=ui(u),B=!1;if(!w){const e=k||!Ms(this)&&p;(m||e)&&(B=yl(cs(_),y),w=!B),(yl(s.immediate,C)||C)&&yl(g.decay,h)&&yl(g.velocity,v)||(w=!0)}if(B&&Rs(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!f&&((w||ui(a))&&(s.values=b.getPayload(),s.toValues=ui(u)?null:S==Gi?[1]:Sl(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;El(Us,(e=>Ws(this,t,e)));const o=Es(this,Fs(this,a));Bl(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&el.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?es(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),f?n(Ss(t.to,t,this._state,this)):w?this._start():Rs(this)&&!m?this._pendingCalls.add(n):n(ys(_))}_focus(e){const t=this.animation;e!==t.to&&(pi(this)&&this._detach(),t.to=e,pi(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;ui(t)&&(hi(t,this),Is(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;ui(e)&&vi(e,this)}_set(e,t=!0){const n=di(e);if(!_l.und(n)){const e=Oi(this);if(!e||!yl(n,e.getValue())){const o=Ki(n);e&&e.constructor==o?e.setValue(n):Fi(this,o.create(n)),e&&el.batchedUpdates((()=>{this._onChange(n,t)}))}}return Oi(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,$s(this,"onStart",Es(this,Fs(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),es(this.animation.onChange,e,this)),es(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Oi(this).reset(di(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Rs(this)||(As(this,!0),Ls(this)||this._resume())}_resume(){Ml.skipAnimation?this.finish():Ol.start(this)}_stop(e,t){if(Rs(this)){As(this,!1);const n=this.animation;El(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),mi(this,{type:"idle",parent:this});const o=t?Cs(this.get()):Es(this.get(),Fs(this,null!=e?e:n.to));Bl(this._pendingCalls,o),n.changed&&(n.changed=!1,$s(this,"onRest",o,this))}}}function Fs(e,t){const n=cs(t);return yl(cs(e.get()),n)}function zs(e,t=e.loop,n=e.to){let o=es(t);if(o){const r=!0!==o&&as(o),l=(r||e).reverse,i=!r||r.reset;return Vs(Ji({},e,{loop:t,default:!1,pause:void 0,to:!l||ds(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function Vs(e){const{to:t,from:n}=e=as(e),o=new Set;return _l.obj(t)&&Gs(t,o),_l.obj(n)&&Gs(n,o),e.keys=o.size?Array.from(o):null,e}function Hs(e){const t=Vs(e);return _l.und(t.default)&&(t.default=ls(t)),t}function Gs(e,t){Cl(e,((e,n)=>null!=e&&t.add(n)))}const Us=["onStart","onRest","onChange","onPause","onResume"];function Ws(e,t,n){e.animation[n]=t[n]!==os(t,n)?ns(t[n],e.key):void 0}function $s(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 js=["onStart","onChange","onRest"];let Ks=1;class qs{constructor(e,t){this.id=Ks++,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(Ji({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle))}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];_l.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Vs(e)),this}start(e){let{queue:t}=this;return e?t=Sl(e).map(Vs):this.queue=[],this._flush?this._flush(this,t):(ta(this,t),Ys(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;El(Sl(t),(t=>n[t].stop(!!e)))}else ws(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(_l.und(e))this.start({pause:!0});else{const t=this.springs;El(Sl(e),(e=>t[e].pause()))}return this}resume(e){if(_l.und(e))this.start({pause:!1});else{const t=this.springs;El(Sl(e),(e=>t[e].resume()))}return this}each(e){Cl(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,wl(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&&wl(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,wl(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)}el.onFrame(this._onFrame)}}function Ys(e,t){return Promise.all(t.map((t=>Xs(e,t)))).then((t=>_s(e,t)))}async function Xs(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=_l.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=_l.arr(r)||_l.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):El(js,(n=>{const o=t[n];if(_l.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,Bl(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===os(t,"cancel");(u||m&&d.asyncId)&&p.push(ks(++e._lastAsyncId,{props:t,state:d,actions:{pause:kl,resume:kl,start(t,n){m?(ws(d,e._lastAsyncId),n(Cs(e))):(t.onRest=s,n(Ss(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=_s(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=zs(t,i,r);if(n)return ta(e,[n]),Xs(e,n,!0)}return a&&el.batchedUpdates((()=>a(f,e,e.item))),f}function Qs(e,t){const n=Ji({},e.springs);return t&&El(Sl(t),(e=>{_l.und(e.keys)&&(e=Vs(e)),_l.obj(e.to)||(e=Ji({},e,{to:void 0})),ea(n,e,(e=>Js(e)))})),Zs(e,n),n}function Zs(e,t){Cl(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,hi(t,e))}))}function Js(e,t){const n=new Os;return n.key=e,t&&hi(n,t),n}function ea(e,t,n){t.keys&&El(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function ta(e,t){El(t,(t=>{ea(e.springs,t,(t=>Js(t,e)))}))}const na=["children"],oa=e=>{let{children:t}=e,n=function(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}(e,na);const o=(0,vl.useContext)(ra),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,vl.useState)((()=>({inputs:t,result:e()}))),o=(0,vl.useRef)(),r=o.current;let l=r;return l?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))||(l={inputs:t,result:e()}):l=n,(0,vl.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=ra;return vl.createElement(i,{value:n},t)},ra=(la=oa,ia={},Object.assign(la,vl.createContext(ia)),la.Provider._context=la,la.Consumer._context=la,la);var la,ia;oa.Provider=ra.Provider,oa.Consumer=ra.Consumer;const sa=()=>{const e=[],t=function(t){Ii(`${wi}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 El(e,((e,r)=>{if(_l.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 El(e,(e=>e.pause(...arguments))),this},t.resume=function(){return El(e,(e=>e.resume(...arguments))),this},t.set=function(t){El(e,(e=>e.set(t)))},t.start=function(t){const n=[];return El(e,((e,o)=>{if(_l.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 El(e,(e=>e.stop(...arguments))),this},t.update=function(t){return El(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return _l.fun(e)?e(n,t):e};return t._getProps=n,t};function aa(e,t,n){const o=_l.fun(t)&&t;o&&!n&&(n=[]);const r=(0,vl.useMemo)((()=>o||3==arguments.length?sa():void 0),[]),l=(0,vl.useRef)(0),i=Mi(),s=(0,vl.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Qs(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Ys(e,t):new Promise((o=>{Zs(e,n),s.queue.push((()=>{o(Ys(e,t))})),i()}))}})),[]),a=(0,vl.useRef)([...s.ctrls]),c=[],u=Li(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new qs(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=Hs(n))}}(0,vl.useMemo)((()=>{El(a.current.slice(e,u),(e=>{ps(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,vl.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Qs(e,c[t]))),m=(0,vl.useContext)(oa),f=Li(m),g=m!==f&&us(m);Ai((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],El(e,(e=>e()))),El(a.current,((e,t)=>{null==r||r.add(e),g&&e.start({default:m});const n=c[t];n&&(ms(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Ni((()=>()=>{El(s.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>Ji({},e)));return r?[h,r]:h}let ca;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(ca||(ca={}));class ua extends Ns{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=ii(...t);const n=this._get(),o=Ki(n);Fi(this,o.create(n))}advance(e){const t=this._get();yl(t,this.get())||(Oi(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&pa(this._active)&&ma(this)}_get(){const e=_l.arr(this.source)?this.source.map(di):Sl(di(this.source));return this.calc(...e)}_start(){this.idle&&!pa(this._active)&&(this.idle=!1,El(zi(this),(e=>{e.done=!1})),Ml.skipAnimation?(el.batchedUpdates((()=>this.advance())),ma(this)):Ol.start(this))}_attach(){let e=1;El(Sl(this.source),(t=>{ui(t)&&hi(t,this),Is(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){El(Sl(this.source),(e=>{ui(e)&&vi(e,this)})),this._active.clear(),ma(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=Sl(this.source).reduce(((e,t)=>Math.max(e,(Is(t)?t.priority:0)+1)),0))}}function da(e){return!1!==e.idle}function pa(e){return!e.size||Array.from(e).every(da)}function ma(e){e.idle||(e.idle=!0,El(zi(e),(e=>{e.done=!0})),mi(e,{type:"idle",parent:e}))}Ml.assign({createStringInterpolator:Si,to:(e,t)=>new ua(e,t)}),Ol.advance;var fa=window.ReactDOM;function ga(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 ha=["style","children","scrollTop","scrollLeft"],va=/^--/;function ba(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||va.test(e)||_a.hasOwnProperty(e)&&_a[e]?(""+t).trim():t+"px"}const ka={};let _a={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 ya=["Webkit","Ms","Moz","O"];_a=Object.keys(_a).reduce(((e,t)=>(ya.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),_a);const Ea=["x","y","z"],Ca=/^(matrix|translate|scale|rotate|skew)/,Sa=/^(translate)/,wa=/^(rotate|skew)/,Ba=(e,t)=>_l.num(e)&&0!==e?e+t:e,xa=(e,t)=>_l.arr(e)?e.every((e=>xa(e,t))):_l.num(e)?e===t:parseFloat(e)===t;class Ia extends Wi{constructor(e){let{x:t,y:n,z:o}=e,r=ga(e,Ea);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Ba(e,"px"))).join(",")})`,xa(e,0)]))),Cl(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(Ca.test(t)){if(delete r[t],_l.und(e))return;const n=Sa.test(t)?"px":wa.test(t)?"deg":"";l.push(Sl(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Ba(r,n)})`,xa(r,0)]:e=>[`${t}(${e.map((e=>Ba(e,n))).join(",")})`,xa(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new Ta(l,i)),super(r)}}class Ta extends fi{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 El(this.inputs,((n,o)=>{const r=di(n[0]),[l,i]=this.transforms[o](_l.arr(r)?r:n.map(di));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&El(this.inputs,(e=>El(e,(e=>ui(e)&&hi(e,this)))))}observerRemoved(e){0==e&&El(this.inputs,(e=>El(e,(e=>ui(e)&&vi(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),mi(this,e)}}const Na=["scrollTop","scrollLeft"];Ml.assign({batchedUpdates:fa.unstable_batchedUpdates,createStringInterpolator:Si,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 Pa=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new Wi(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Zi(e)||"Anonymous";return(e=_l.str(e)?l[e]||(l[e]=Yi(e,r)):e[Qi]||(e[Qi]=Yi(e,r))).displayName=`Animated(${t})`,e};return Cl(e,((t,n)=>{_l.arr(e)&&(n=Zi(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=ga(o,ha),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:ka[t]||(ka[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=ba(t,r[t]);va.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 Ia(e),getComponentProps:e=>ga(e,Na)}).animated,Ma=e=>e+1,Ra=e=>({top:e.offsetTop,left:e.offsetLeft});var La=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)(Ma,0),[u,p]=(0,s.useReducer)(Ma,0),[m,f]=(0,s.useState)({x:0,y:0}),g=(0,s.useMemo)((()=>l.current?Ra(l.current):null),[r]),h=(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",h()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!g)return;if(i)return void h();l.current.style.transform="";const e=Ra(l.current);c(),f({x:Math.round(g.left-e.left),y:Math.round(g.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=_l.fun(e),[[o],r]=aa(1,n?e:[e],n?t||[]:t)}({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 Aa=".block-editor-block-list__block",Da=".block-list-appender";function Oa(e,t){return t.closest([Aa,Da].join(","))===e}function Fa(e,t){e.parentElement.closest("[contenteditable]").contentEditable=t}function za(e){const{startMultiSelect:t,stopMultiSelect:n,multiSelect:o,selectBlock:r}=(0,m.useDispatch)(Hn),{isSelectionEnabled:l,isBlockSelected:i,getBlockParents:s,getBlockSelectionStart:a,hasMultiSelection:c}=(0,m.useSelect)(Hn);return(0,d.useRefEffect)((u=>{const{ownerDocument:d}=u,{defaultView:p}=d;let m,f;function g(t){let{isSelectionEnd:n}=t;const l=p.getSelection();if(!l.rangeCount||l.isCollapsed)return void Fa(u,!1);const i=function(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(Aa);return t?t.id.slice("block-".length):void 0}(l.focusNode);if(e===i){if(r(e),n&&(Fa(u,!1),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 h(){d.removeEventListener("selectionchange",g),p.removeEventListener("mouseup",h),f=p.requestAnimationFrame((()=>{g({isSelectionEnd:!0}),n()}))}function v(n){let{buttons:o}=n;1===o&&l()&&i(e)&&(m=d.activeElement,t(),d.addEventListener("selectionchange",g),p.addEventListener("mouseup",h),Fa(u,!0))}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&&(Fa(u,!0),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",g),p.removeEventListener("mouseup",h),p.cancelAnimationFrame(f)}}),[e,t,n,o,r,l,i,s])}function Va(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isMultiSelecting:o,isNavigationMode:r,isBlockSelected:l}=t(Hn);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;if(Oa(t.current,l)){if(!l.getAttribute("contenteditable")){const e=Rr.focus.tabbable.findNext(l);if(e&&function(e){const{tagName:t}=e;return"INPUT"===t||"BUTTON"===t||"SELECT"===t||"TEXTAREA"===t}(e)&&l.contains(e)&&!e.classList.contains("block-editor-button-block-appender"))return void e.focus()}Fa(t.current,!1),(0,Rr.placeCaretAtHorizontalEdge)(l,r)}else t.current.focus()}),[n]),t}function Ha(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function Ga(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(Hn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",Ha),t.addEventListener("mouseover",Ha),()=>{t.removeEventListener("mouseout",Ha),t.removeEventListener("mouseover",Ha),t.classList.remove("is-hovered")}}),[e])}function Ua(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(Hn),{__experimentalSpotlightEntityBlocks:m,outlineMode:f}=a(),g=n(e),h=l(e),v=s(e),b=u(e,!0),k=p(m);return c()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":g,"has-child-selected":b,"has-active-entity":k,"is-active-entity":k===e,"remove-outline":h&&f&&d()})}),[e])}function Wa(e){return(0,m.useSelect)((t=>{const n=t(Hn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function $a(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(Hn),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 ja(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(Hn);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 Ka(e){const{isBlockSelected:t}=(0,m.useSelect)(Hn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(Hn);return(0,d.useRefEffect)((r=>{function l(l){t(e)?l.target.isContentEditable||o(e):Oa(r,l.target)&&n(e)}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var qa=window.wp.keycodes;function Ya(e){const t=(0,m.useSelect)((t=>t(Hn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(Hn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(Hn);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!==qa.ENTER&&s!==qa.BACKSPACE&&s!==qa.DELETE||a!==i||(0,Rr.isTextField)(a)||(t.preventDefault(),s===qa.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function Xa(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(Hn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(Hn);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 Qa=n(5425),Za=n.n(Qa);function Ja(e){const t=(0,s.useRef)(),n=(0,m.useSelect)((t=>{const{isBlockSelected:n,getBlockSelectionEnd:o}=t(Hn);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&&Za()(e,o,{onlyScrollIfNeeded:!0})}),[n]),t}function ec(){const e=(0,s.useContext)(Wm);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function tc(){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)(nc),{index:a,mode:u,name:p,blockApiVersion:f,blockTitle:h,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(Hn),p=a(n),m=c(n)||u(n),f=l(n),g=(0,r.getBlockType)(f);return{index:t(n),mode:o(n),name:f,blockApiVersion:(null==g?void 0:g.apiVersion)||1,blockTitle:null==g?void 0:g.title,isPartOfSelection:p||m,adjustScrolling:p||d(n),enableAnimation:!i()&&s()<=200}}),[n]),_=(0,g.sprintf)((0,g.__)("Block: %s"),h),y="html"!==u||t?"":"-visual",E=(0,d.useMergeRefs)([e.ref,Va(n),Ja(n),fo(n),Ka(n),za(n),Ya(n),Xa(n),Ga(),ec(),La({isSelected:v,adjustScrolling:b,enableAnimation:k,triggerAnimationOnChange:a})]),C=$n();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":h,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,Ua(n),Wa(n),$a(n),ja(n)),style:{...l.style,...e.style}}}tc.save=r.__unstableGetBlockProps;const nc=(0,s.createContext)();function oc(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",tc(o,{__unstableIsHtml:n}),t)}const rc=(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(Hn),d=a(n),p=r(n),m=s(o),f=c(n,o),g=u(n,o),{name:h,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:f,canMove:g,block:d,name:h,attributes:v,isValid:b,isSelected:p}})),lc=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(Hn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(Hn),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(Hn),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(Hn);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 ic=(0,d.compose)(d.pure,rc,lc,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:l,canRemove:i,clientId:a,isSelected:d,isSelectionEnabled:p,className:f,name:g,isValid:h,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const S=(0,m.useSelect)((e=>{const{getSettings:t}=e(Hn);return t().supportsLayout}),[]),{removeBlock:w}=(0,m.useDispatch)(Hn),B=(0,s.useCallback)((()=>w(a)),[a]);let x=(0,s.createElement)(zr,{name:g,isSelected:d,attributes:v,setAttributes:k,insertBlocksAfter:l?void 0:y,onReplace:i?_:void 0,onRemove:i?B:void 0,mergeBlocks:i?E:void 0,clientId:a,isSelectionEnabled:p,toggleSelection:C});const I=(0,r.getBlockType)(g);null!=I&&I.getEditWrapperProps&&(b=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}(b,I.getEditWrapperProps(v)));const T=b&&!!b["data-align"]&&!S;let N;if(T&&(x=(0,s.createElement)("div",{className:"wp-block","data-align":b["data-align"]},x)),h)N="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},x),(0,s.createElement)(oc,{isHtml:!0},(0,s.createElement)(Zr,{clientId:a}))):(null==I?void 0:I.apiVersion)>1?x:(0,s.createElement)(oc,b,x);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(I,v);N=(0,s.createElement)(oc,{className:"has-warning"},(0,s.createElement)(jr,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,Rr.safeHTML)(e)))}const P={clientId:a,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&S?c()(f,`align${b["data-align"]}`):f,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},M=(0,s.useMemo)((()=>P),Object.values(P));return(0,s.createElement)(nc.Provider,{value:M},(0,s.createElement)(Xr,{fallback:(0,s.createElement)(oc,{className:"has-warning"},(0,s.createElement)(qr,null))},N))})),sc=window.wp.htmlEntities,ac=(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 cc=[(0,s.createInterpolateElement)((0,g.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,g.__)("Drag files into the editor to automatically insert media blocks."),(0,g.__)("Change a block's type by pressing the block icon on the toolbar.")];var uc=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*cc.length));return(0,s.createElement)(p.Tip,null,cc[e])},dc=(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"})),pc=(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:dc});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)})),mc=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(At()("`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)(pc,{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 fc(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:g}=a.dispatch(Hn),{getBlockName:h,getBlocks:v}=a.select(Hn),b=(0,m.useSelect)((e=>!t||e(Hn).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(g(),t?a.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),g(),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(Hn);let s=v(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===h(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);(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 gc=(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(zn,Vn),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)(Hn);return(0,s.useEffect)((()=>{o(n)}),[n]),fc(e),(0,s.createElement)(mo,null,t)}));function hc(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)(jm,null)))}function vc(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(Hn),{clearSelectedBlock:n}=(0,m.useDispatch)(Hn);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 bc(e){return(0,s.createElement)("div",i({ref:vc()},e))}function kc(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 _c(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l}=e(Hn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l()}}function yc(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r}=(0,m.useSelect)(_c,[]),l=go(r),i=go((0,u.first)(n)),s=go((0,u.last)(n));return(0,d.useRefEffect)((a=>{const{ownerDocument:c}=a,{defaultView:u}=c;if(null==e)return;if(!o||t){if(!r||t)return;const e=u.getSelection();if(e.rangeCount&&!e.isCollapsed){const t=l.current,{startContainer:n,endContainer:o}=e.getRangeAt(0);!t||t.contains(n)&&t.contains(o)||e.removeAllRanges()}return}const{length:d}=n;if(d<2)return;if(!i.current||!s.current)return;a.contentEditable=!0,a.focus();const p=u.getSelection(),m=c.createRange(),f=kc(i.current,"start"),g=kc(s.current,"end");m.setStartBefore(f),m.setEndAfter(g),p.removeAllRanges(),p.addRange(m)}),[o,t,n,r,e])}function Ec(e){const{tagName:t}=e;return"INPUT"===t||"BUTTON"===t||"SELECT"===t||"TEXTAREA"===t}function Cc(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 Sc(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksStartClientId:t,getMultiSelectedBlocksEndClientId:n,getPreviousBlockClientId:o,getNextBlockClientId:r,getFirstMultiSelectedBlockClientId:l,getLastMultiSelectedBlockClientId:i,getSettings:s,hasMultiSelection:a}=(0,m.useSelect)(Hn),{multiSelect:c,selectBlock:u}=(0,m.useDispatch)(Hn);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 g(e){const t=l(),n=i(),o=e?t:n;o&&u(o)}function h(t){const{keyCode:l,target:i}=t,c=l===qa.UP,u=l===qa.DOWN,m=l===qa.LEFT,h=l===qa.RIGHT,v=c||m,b=m||h,k=c||u,_=b||k,y=t.shiftKey,E=y||t.ctrlKey||t.altKey||t.metaKey,C=k?Rr.isVerticalEdge:Rr.isHorizontalEdge,{ownerDocument:S}=d,{defaultView:w}=S;if(a())return void(_&&((y?f:g)(v),t.preventDefault()));if(k?p||(p=(0,Rr.computeCaretRect)(w)):p=null,t.defaultPrevented)return;if(!_)return;if(!function(e,t,n){if((t===qa.UP||t===qa.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(i,l,E))return;const B=(0,Rr.isRTL)(i)?!v:v,{keepCaretInsideBlock:x}=s(),I=e();if(y){const e=n(),l=o(e||I),s=r(e||I);(v&&l||!v&&s)&&function(e,t){const n=Cc(e,t,d);return!n||!function(e,t){return e.closest(Aa)===t.closest(Aa)}(e,n)}(i,v)&&C(i,v)&&(f(v),t.preventDefault())}else if(k&&(0,Rr.isVerticalEdge)(i,v)&&!x){const e=Cc(i,v,d,!0);e&&((0,Rr.placeCaretAtVerticalEdge)(e,v,p),t.preventDefault())}else if(b&&w.getSelection().isCollapsed&&(0,Rr.isHorizontalEdge)(i,B)&&!x){const e=Cc(i,B,d);(0,Rr.placeCaretAtHorizontalEdge)(e,v),t.preventDefault()}}return d.addEventListener("mousedown",m),d.addEventListener("keydown",h),()=>{d.removeEventListener("mousedown",m),d.removeEventListener("keydown",h)}}),[])}var wc=window.wp.keyboardShortcuts;function Bc(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(Hn),{multiSelect:o}=(0,m.useDispatch)(Hn),r=(0,wc.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;const i=t();if(i.length<2&&!(0,Rr.isEntirelySelected)(l.target))return;const[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 xc(){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)(Hn),{setNavigationMode:a}=(0,m.useDispatch)(Hn),c=(0,m.useSelect)((e=>e(Hn).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}),g=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),h=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===qa.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==qa.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if((Ec(e.target)||e.target.getAttribute("data-block")===l())&&Ec(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!==qa.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,h]),g]}(),o=(0,m.useSelect)((e=>e(Hn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,yc(),Bc(),Sc(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,g.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var Ic=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=xc();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 Tc="editor-styles-wrapper";function Nc(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var Pc=(0,s.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:a,...u}=e;const[,m]=(0,s.useReducer)((()=>({}))),[f,h]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=Nc(null==a?void 0:a.styles),_=Nc(null==a?void 0:a.scripts),y=vc(),[E,C,S]=xc(),w=(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),h(t),y(r),b(Array.from(n.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}t()||e.addEventListener("load",(()=>{t()}))}),[]),B=(0,d.useRefEffect)((e=>{_.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((()=>{m()}))}),[]),x=(0,d.useMergeRefs)([n,y,C]);return(0,s.useEffect)((()=>{var e;f&&(e=f,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(`.${Tc}`)||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))}})))}),[f]),r=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"body{margin:0}"),k.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})})),r),(0,s.createElement)(s.Fragment,null,l>=0&&E,(0,s.createElement)("iframe",i({},u,{ref:(0,d.useMergeRefs)([t,w]),tabIndex:l,title:(0,g.__)("Editor canvas")}),f&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:x,className:c()(Tc,...v)},(0,s.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&S)})),Mc={grad:.9,turn:360,rad:360/(2*Math.PI)},Rc=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Lc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Ac=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Dc=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Oc=function(e){return{r:Ac(e.r,0,255),g:Ac(e.g,0,255),b:Ac(e.b,0,255),a:Ac(e.a)}},Fc=function(e){return{r:Lc(e.r),g:Lc(e.g),b:Lc(e.b),a:Lc(e.a,3)}},zc=/^#([0-9a-f]{3,8})$/i,Vc=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Hc=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}},Gc=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}},Uc=function(e){return{h:Dc(e.h),s:Ac(e.s,0,100),l:Ac(e.l,0,100),a:Ac(e.a)}},Wc=function(e){return{h:Lc(e.h),s:Lc(e.s),l:Lc(e.l),a:Lc(e.a,3)}},$c=function(e){return Gc((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},jc=function(e){return{h:(t=Hc(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},Kc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,qc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Yc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Xc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Qc={string:[[function(e){var t=zc.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?Lc(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?Lc(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Yc.exec(e)||Xc.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Oc({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=Kc.exec(e)||qc.exec(e);if(!t)return null;var n,o,r=Uc({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Mc[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return $c(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 Rc(t)&&Rc(n)&&Rc(o)?Oc({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(!Rc(t)||!Rc(n)||!Rc(o))return null;var i=Uc({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return $c(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!Rc(t)||!Rc(n)||!Rc(o))return null;var i=function(e){return{h:Dc(e.h),s:Ac(e.s,0,100),v:Ac(e.v,0,100),a:Ac(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Gc(i)},"hsv"]]},Zc=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]},Jc=function(e,t){var n=jc(e);return{h:n.h,s:Ac(n.s+100*t,0,100),l:n.l,a:n.a}},eu=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},tu=function(e,t){var n=jc(e);return{h:n.h,s:n.s,l:Ac(n.l+100*t,0,100),a:n.a}},nu=function(){function e(e){this.parsed=function(e){return"string"==typeof e?Zc(e.trim(),Qc.string):"object"==typeof e&&null!==e?Zc(e,Qc.object):[null,void 0]}(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 Lc(eu(this.rgba),2)},e.prototype.isDark=function(){return eu(this.rgba)<.5},e.prototype.isLight=function(){return eu(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=Fc(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?Vc(Lc(255*r)):"","#"+Vc(t)+Vc(n)+Vc(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return Fc(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Fc(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 Wc(jc(this.rgba))},e.prototype.toHslString=function(){return t=(e=Wc(jc(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=Hc(this.rgba),{h:Lc(e.h),s:Lc(e.s),v:Lc(e.v),a:Lc(e.a,3)};var e},e.prototype.invert=function(){return ou({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),ou(Jc(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),ou(Jc(this.rgba,-e))},e.prototype.grayscale=function(){return ou(Jc(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),ou(tu(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),ou(tu(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?ou({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Lc(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=jc(this.rgba);return"number"==typeof e?ou({h:e,s:t.s,l:t.l,a:t.a}):Lc(t.h)},e.prototype.isEqual=function(e){return this.toHex()===ou(e).toHex()},e}(),ou=function(e){return e instanceof nu?e:new nu(e)},ru=[],lu=function(e){e.forEach((function(e){ru.indexOf(e)<0&&(e(nu,Qc),ru.push(e))}))};function iu(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 su=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},au=function(e){return.2126*su(e.r)+.7152*su(e.g)+.0722*su(e.b)};function cu(e){e.prototype.luminance=function(){return e=au(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=au(l))>(a=au(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 uu=n(3124),du=n.n(uu);const pu=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function mu(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=S()||w());)!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=g();)!1!==t&&e.push(t);return e}function g(){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 h(){const e=p(/^([^{]+)/);if(e)return fu(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=fu(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(pu,""),value:n?fu(n[0]).replace(pu,""):""});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 S(){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=fu(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:fu(t[1]),media:fu(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=fu(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=fu(t[1]),o=fu(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=h()||[];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 w(){const e=l(),t=h();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return gu(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function fu(e){return e?e.replace(/^\s+|\s+$/g,""):""}function gu(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){gu(e,o)})):n&&"object"==typeof n&&gu(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var hu=n(8575),vu=n.n(hu),bu=ku;function ku(e){this.options=e||{}}ku.prototype.emit=function(e){return e},ku.prototype.visit=function(e){return this[e.type](e)},ku.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 _u=yu;function yu(e){bu.call(this,e)}vu()(yu,bu),yu.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},yu.prototype.comment=function(e){return this.emit("",e.position)},yu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},yu.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},yu.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("}")},yu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},yu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},yu.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},yu.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},yu.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},yu.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("}")},yu.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},yu.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},yu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},yu.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("}"):""},yu.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var Eu=Cu;function Cu(e){e=e||{},bu.call(this,e),this.indentation=e.indent}vu()(Cu,bu),Cu.prototype.compile=function(e){return this.stylesheet(e)},Cu.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Cu.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Cu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Cu.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}")},Cu.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}")},Cu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Cu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Cu.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}")},Cu.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)+"}")},Cu.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")},Cu.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}")},Cu.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}")},Cu.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}")},Cu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Cu.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()+"}"):""},Cu.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Cu.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var Su=function(e,t){try{const r=mu(e);return n=du().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new _u(o):new Eu(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function wu(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 xu=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]};wu(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 Iu=/^(body|html|:root).*$/;var Tu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>"rule"===n.type?{...n,selectors:n.selectors.map((n=>t.includes(n.trim())?n:n.match(Iu)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},Nu=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(Tu(t)),o&&r.push(xu(o)),r.length?Su(n,(0,d.compose)(r)):n}))};const Pu=".editor-styles-wrapper";function Mu(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(Pu);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=ou(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function Ru(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>Nu(t,Pu)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:Mu(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}let Lu;lu([iu,cu]);const Au=2e3;var Du=function(e){let{viewportWidth:t,__experimentalPadding:n}=e;const[o,{width:r}]=(0,d.useResizeObserver)(),[l,{height:i}]=(0,d.useResizeObserver)(),{styles:a,assets:c}=(0,m.useSelect)((e=>{const t=e(Hn).getSettings();return{styles:t.styles,assets:t.__unstableResolvedAssets}}),[]),u=(0,s.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:a),[a]);Lu=Lu||(0,d.pure)(jm);const f=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(${f})`,height:i*f,maxHeight:i>Au?Au*f:void 0}},(0,s.createElement)(Pc,{head:(0,s.createElement)(Ru,{styles:u}),assets: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:Au}},l,(0,s.createElement)(Lu,{renderAppender:!1}))))},Ou=(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(Hn).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)(gc,{value:c,settings:a},r?(0,s.createElement)(hc,{onClick:l}):(0,s.createElement)(Du,{viewportWidth:o,__experimentalPadding:n})):null}));function Fu(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(Hn).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)(gc,{value:p,settings:a},(0,s.createElement)(qm,{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 zu=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)(Ou,{__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,g.__)("No Preview Available."))),!p&&(0,s.createElement)(mc,{title:i,icon:a,description:c}))},Vu=(0,s.createContext)(),Hu=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(Vu);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)}))})),Gu=(0,s.createElement)(O.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Uu(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)(pc,{icon:n}):(0,g.sprintf)(
11
  /* translators: %d: Number of blocks. */
12
- (0,g._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(pc,{icon:Gu})))))}var Wu=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)(Uu,{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 $u(){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 ju=(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)(Wu,{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)(Hu,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,$u()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===qa.ENTER&&(e.preventDefault(),l(o,$u()?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)(pc,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},o.title)))}))})),Ku=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,Mt.speak)((0,g.__)("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))})),qu=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(Vu);return(0,s.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),Yu=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(Ku,{className:"block-editor-block-types-list","aria-label":i},function(e,t){const n=[];for(let t=0,o=e.length;t<o;t+=3)n.push(e.slice(t,t+3));return n}(t).map(((e,t)=>(0,s.createElement)(qu,{key:t},e.map(((e,l)=>(0,s.createElement)(ju,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a,isFirst:0===t&&0===l})))))),l)},Xu=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))},Qu=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(Hn),{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])]},Zu=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(Vu.Provider,{value:n},t)};const Ju=[];var ed=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,c]=Qu(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]),h=(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:Ju);return(0,s.createElement)(Zu,null,(0,s.createElement)("div",null,r&&!!p.length&&(0,s.createElement)(Xu,{title:(0,g._x)("Most used","blocks")},(0,s.createElement)(Yu,{items:p,onSelect:c,onHover:o,label:(0,g._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=f[e.slug];return t&&t.length?(0,s.createElement)(Xu,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(Yu,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(Xu,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,g.__)("Uncategorized")},(0,s.createElement)(Yu,{items:m,onSelect:c,onHover:o,label:(0,g.__)("Uncategorized")})),(0,u.map)(_,(e=>{let[t,n]=e;const r=h[t];return r&&r.length?(0,s.createElement)(Xu,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(Yu,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))},td=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,g.__)("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,g.__)("Explore all patterns"),onClick:()=>r()},(0,g._x)("Explore","Label for showing all block patterns"))))},nd=window.wp.notices,od=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Hn);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(nd.store);return[o,n,(0,s.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,g.sprintf)(
13
  /* translators: %s: block pattern title. */
14
- (0,g.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function rd(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)(rd)}`;return(0,s.createElement)(Wu,{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)(Ou,{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 ld(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var id=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:a=(0,g.__)("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)(rd,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(ld,{key:e.name}))))};function sd(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 ad(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,g.__)("Search for patterns"),placeholder:(0,g.__)("Search")}))}var cd=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)(ad,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(sd,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},ud=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(ir,{className:"block-editor-inserter__no-results-icon",icon:dc}),(0,s.createElement)("p",null,(0,g.__)("No results found.")))},dd=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(Hn),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(Hn),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:h,showInsertionPoint:v,hideInsertionPoint:b}=(0,m.useDispatch)(Hn),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):h(e,p,d,!0,a||n?0:null,t);const s=(0,g.sprintf)(// translators: %d: the name of the block that has been added
15
- (0,g._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,Mt.speak)(s),i&&i()}),[l,c,f,h,d,p,i,a]),_=(0,s.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]};const pd=e=>e.name||"",md=e=>e.title,fd=e=>e.description||"",gd=e=>e.keywords||[],hd=e=>e.category,vd=()=>null;function bd(){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 kd=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(bd(e))},_d=(e,t)=>(0,u.differenceWith)(e,kd(t),((e,t)=>t.includes(e))),yd=(e,t,n,o)=>0===kd(o).length?e:Ed(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}}),Ed=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=kd(t);if(0===o.length)return e;const r=e.map((e=>[e,Cd(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 Cd(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=pd,getTitle:r=md,getDescription:l=fd,getKeywords:i=gd,getCategory:s=hd,getCollection:a=vd}=n,c=o(e),d=r(e),p=l(e),m=i(e),f=s(e),g=a(e),h=bd(t),v=bd(d);let b=0;if(h===v)b+=30;else if(v.startsWith(h))b+=20;else{const e=[c,d,p,...m,f,g].join(" "),t=(0,u.words)(h);0===_d(t,e).length&&(b+=10)}return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}function Sd(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,g.sprintf)(
16
  /* translators: %d: number of patterns. %s: block pattern search query */
17
- (0,g._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var wd=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Mt.speak,500),[l,i]=dd({shouldFocusBlock:!0}),[a,,c]=od(i,l),u=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?Ed(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,g.sprintf)(
18
  /* translators: %d: number of results. */
19
- (0,g._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)(Sd,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(Zu,null,!f&&(0,s.createElement)(ud,null),f&&(0,s.createElement)(id,{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)(cd,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,s.createElement)(wd,{filterValue:o,selectedCategory:l,patternCategories:n}))}var xd=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(p.Modal,{title:(0,g.__)("Patterns"),closeLabel:(0,g.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(Bd,n))};function Id(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=od(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)(id,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}var Td=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,s.useState)(!1),[a,c]=od(),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,g._x)("Uncategorized")}),e}),[a,c]),p=r||d[0];return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(td,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,s.createElement)(Id,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,s.createElement)(xd,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},Nd=window.wp.url;function Pd(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=Qu(o,n),i=(0,s.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,s.createElement)(ud,null):(0,s.createElement)(Xu,{title:(0,g.__)("Reusable blocks")},(0,s.createElement)(Yu,{items:i,onSelect:l,onHover:t,label:(0,g.__)("Reusable blocks")}))}var Md=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Pd,{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,Nd.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,g.__)("Manage Reusable blocks"))))};const{Fill:Rd,Slot:Ld}=(0,p.createSlotFill)("__unstableInserterMenuExtension");Rd.Slot=Ld;var Ad=Rd;const Dd=[];var Od=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:h=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const k=(0,d.useDebounce)(Mt.speak,500),[_,y]=dd({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[E,C,S,w]=Qu(_,y),[B,,x]=od(y,_),I=(0,s.useMemo)((()=>{if(0===c)return[];const e=Ed(B,t);return void 0!==c?e.slice(0,c):e}),[t,B,c]);let T=m;b&&I.length>2&&(T=0);const N=(0,s.useMemo)((()=>{if(0===T)return[];const e=yd((0,u.orderBy)(E,["frecency"],["desc"]),C,S,t);return void 0!==T?e.slice(0,T):e}),[t,E,C,S,m]);(0,s.useEffect)((()=>{if(!t)return;const e=N.length+I.length,n=(0,g.sprintf)(
20
  /* translators: %d: number of results. */
21
- (0,g._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,d.useAsyncList)(N,{step:9}),M=(0,d.useAsyncList)(P.length===N.length?I:Dd),R=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(I),L=!!N.length&&(0,s.createElement)(Xu,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("Blocks"))},(0,s.createElement)(Yu,{items:P,onSelect:w,onHover:o,label:(0,g.__)("Blocks"),isDraggable:h})),A=!!I.length&&(0,s.createElement)(Xu,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(id,{shownPatterns:M,blockPatterns:I,onClickPattern:x,isDraggable:h})));return(0,s.createElement)(Zu,null,!f&&!R&&(0,s.createElement)(ud,null),b?A:L,!!N.length&&!!I.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?L:A,f&&(0,s.createElement)(Ad.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:R,rootClientId:_}},(e=>e.length?e:R?null:(0,s.createElement)(ud,null))))};const Fd={name:"blocks",
22
  /* translators: Blocks tab title in the block inserter. */
23
- title:(0,g.__)("Blocks")},zd={name:"patterns",
24
  /* translators: Patterns tab title in the block inserter. */
25
- title:(0,g.__)("Patterns")},Vd={name:"reusable",
26
  /* translators: Reusable blocks tab title in the block inserter. */
27
- title:(0,g.__)("Reusable")};var Hd=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,s.useMemo)((()=>{const e=[Fd];return n&&e.push(zd),o&&e.push(Vd),e}),[Fd,n,zd,o,Vd]);return(0,s.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)},Gd=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:a,showMostUsedBlocks:c,__experimentalFilterValue:u="",shouldFocusBlock:d=!0}=e;const[f,h]=(0,s.useState)(u),[v,b]=(0,s.useState)(null),[k,_]=(0,s.useState)(null),[y,E,C]=dd({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:d}),{showPatterns:S,hasReusableBlocks:w}=(0,m.useSelect)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Hn);return{showPatterns:!!n(y).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[y]),B=(0,s.useCallback)(((e,t,n)=>{E(e,t,n),i()}),[E,i]),x=(0,s.useCallback)(((e,t)=>{E(e,{patternName:t}),i()}),[E,i]),I=(0,s.useCallback)((e=>{C(!!e),b(e)}),[C,b]),T=(0,s.useCallback)((e=>{_(e)}),[_]),N=(0,s.useMemo)((()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__block-list"},(0,s.createElement)(ed,{rootClientId:y,onInsert:B,onHover:I,showMostUsedBlocks:c})),a&&(0,s.createElement)("div",{className:"block-editor-inserter__tips"},(0,s.createElement)(p.VisuallyHidden,{as:"h2"},(0,g.__)("A tip for using the block editor")),(0,s.createElement)(uc,null)))),[y,B,I,f,c,a]),P=(0,s.useMemo)((()=>(0,s.createElement)(Td,{rootClientId:y,onInsert:x,onClickCategory:T,selectedCategory:k})),[y,x,T,k]),M=(0,s.useMemo)((()=>(0,s.createElement)(Md,{rootClientId:y,onInsert:B,onHover:I})),[y,B,I]),R=(0,s.useCallback)((e=>"blocks"===e.name?N:"patterns"===e.name?P:M),[N,P,M]),L=(0,s.useRef)();return(0,s.useImperativeHandle)(t,(()=>({focusSearch:()=>{L.current.focus()}}))),(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=>{v&&b(null),h(e)},value:f,label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search"),ref:L}),!!f&&(0,s.createElement)(Od,{filterValue:f,onSelect:i,onHover:I,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!f&&(S||w)&&(0,s.createElement)(Hd,{showPatterns:S,showReusableBlocks:w},R),!f&&!S&&!w&&N)),a&&v&&(0,s.createElement)(zu,{item:v}))}));function Ud(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r}=e;const[l,i]=(0,s.useState)(""),[a,u]=dd({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[d]=Qu(a,u),[f]=od(u,a),{setInserterIsOpened:h,insertionIndex:v,prioritizePatterns:b}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:r,getBlockCount:l}=e(Hn),i=t(),s=r(o),a=l();return{setInserterIsOpened:i.__experimentalSetIsInserterOpened,prioritizePatterns:i.__experimentalPreferPatternsOnRoot&&!n&&s>0&&(s<a||0===a),insertionIndex:-1===s?a:s}}),[o,n]),k=f.length&&(!!l||b),_=k&&f.length>6||d.length>6;(0,s.useEffect)((()=>{h&&h(!1)}),[h]);let y=0;return k&&(y=b?4:2),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":h})},_&&(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",value:l,onChange:e=>{i(e)},label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(Od,{filterValue:l,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:b})),h&&(0,s.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{h({rootClientId:n,insertionIndex:v,filterValue:l})},"aria-label":(0,g.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,g.__)("Browse all")))}const Wd=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:a,toggleProps:c={}}=e;t=a?(0,g.sprintf)(// translators: %s: the name of the block when there is only one
28
- (0,g._x)("Add %s","directly add the only allowed block"),l):(0,g._x)("Add block","Generic label for block inserter button");const{onClick:u,...d}=c;return(0,s.createElement)(p.Button,i({icon:ac,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 $d 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=Wd}=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)(Ud,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r}):(0,s.createElement)(Gd,{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||n?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,g.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}var jd=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{getBlockRootClientId:l,hasInserterItems:i,__experimentalGetAllowedBlocks:s,__experimentalGetDirectInsertBlock:a}=e(Hn),{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&&!c)return;const{insertBlock:d}=e(Hn);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(Hn);if(!e||!l&&!n)return{};const i={};let s={};if(l){const e=t(l),n=t(r(l));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(s=(null==n?void 0:n.attributes)||{})}else{var a;const e=t(n);if(null!=e&&null!==(a=e.innerBlocks)&&void 0!==a&&a.length){const t=e.innerBlocks[e.innerBlocks.length-1];c&&(null==c?void 0:c.name)===t.name&&(s=t.attributes)}}return e.forEach((e=>{s.hasOwnProperty(e)&&(i[e]=s[e])})),i}(c.attributesToCopy);p=(0,r.createBlock)(c.name,{...c.attributes||{},...e})}else p=(0,r.createBlock)(a.name);d(p,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:r,getBlockRootClientId:s}=o(Hn);if(l)return e(l);const a=t();return!i&&a&&s(a)===n?e(a)+1:r(n).length}(),n),u&&u();const m=(0,g.sprintf)(// translators: %s: the name of the block that has been added
29
- (0,g.__)("%s block added"),a.title);(0,Mt.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])($d),Kd=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(Hn),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,m.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(Hn);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:r,rootClientId:l}=e;if(t)return null;const i=(0,sc.decodeEntities)(r)||(0,g.__)("Type / to choose a block");return(0,s.createElement)("div",{"data-root-client-id":l||"",className:c()("block-editor-default-block-appender",{"has-visible-prompt":o})},(0,s.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,g.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{qa.ENTER!==e.keyCode&&qa.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(jd,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function qd(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,s.createElement)(jd,{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,g.sprintf)(// translators: %s: the name of the block when there is only one
30
- (0,g._x)("Add %s","directly add the only allowed block"),d):(0,g._x)("Add block","Generic label for block inserter button");const f=!m;let h=(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)(ir,{icon:ac}));return(f||m)&&(h=(0,s.createElement)(p.Tooltip,{text:n},h)),h},isAppender:!0})}const Yd=(0,s.forwardRef)(((e,t)=>(At()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),qd(e,t))));var Xd=(0,s.forwardRef)(qd),Qd=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(Hn);return{isLocked:!!l(n),canInsertDefaultBlock:o((0,r.getDefaultBlockName)(),n),selectedBlockClientId:i()}}))((function(e){let t,{rootClientId:n,canInsertDefaultBlock:o,isLocked:r,renderAppender:l,className:i,selectedBlockClientId:a,tagName:u="div"}=e;if(r||!1===l)return null;if(l)t=(0,s.createElement)(l,null);else{if(a!==n&&(n||a))return null;t=o?(0,s.createElement)(Kd,{rootClientId:n}):(0,s.createElement)(Xd,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,s.createElement)(u,{tabIndex:-1,className:c()("block-list-appender wp-block",i),"data-block":!0},t)}));function Zd(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 Jd=(0,s.createContext)();function ep(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(Hn),l=(0,s.useContext)(Jd),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:f,rootClientId:h,isInserterShown:v}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(Hn),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}}),[]),b=ho(u),k=ho(f),_="vertical"===a,y=(0,s.useMemo)((()=>{if(!b&&!k)return{};const e=b?b.getBoundingClientRect():null,t=k?k.getBoundingClientRect():null;if(_)return{width:b?b.offsetWidth:k.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,g.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:b?b.offsetHeight:k.offsetHeight}}),[b,k]),E=(0,s.useCallback)((()=>{if(!b&&!k)return{};const{ownerDocument:e}=b||k,t=b?b.getBoundingClientRect():null,n=k?k.getBoundingClientRect():null;return _?(0,g.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,g.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}}),[b,k]),C=Zd(n),S=(0,d.useReducedMotion)(),w=c()("block-editor-block-list__insertion-point","is-"+a),B=b&&k&&v,x={start:{..._?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{..._?{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:{..._?{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:S?1:0},rest:{scale:1,transition:{delay:.2}}};return(0,s.createElement)(p.Popover,{ref:C,noArrow:!0,animate:!1,getAnchorRect:E,focusOnMount:!1,className:"block-editor-block-list__insertion-point-popover",__unstableSlotName:t||null,key:f+"--"+h},(0,s.createElement)(p.__unstableMotion.div,{layout:!S,initial:S?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&f&&o(f,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(w,{"is-with-inserter":B}),onHoverEnd:function(e){e.target!==i.current||l.current||r()},style:y},(0,s.createElement)(p.__unstableMotion.div,{variants:x,className:"block-editor-block-list__insertion-point-indicator"}),B&&(0,s.createElement)(p.__unstableMotion.div,{variants:I,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(jd,{position:"bottom center",clientId:f,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function tp(e){let{children:t,__unstablePopoverSlot:n,__unstableContentRef:o}=e;const r=(0,m.useSelect)((e=>e(Hn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(Jd.Provider,{value:(0,s.useRef)(!1)},r&&(0,s.createElement)(ep,{__unstablePopoverSlot:n,__unstableContentRef:o}),t)}function np(){const e=(0,s.useContext)(Jd),t=(0,m.useSelect)((e=>e(Hn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(Hn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(Hn);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")),c(d))return;const m=(null===(o=n(d))||void 0===o?void 0:o.orientation)||"vertical",f=t.target.getBoundingClientRect(),g=t.clientY-f.top,h=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>g||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>h));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 op="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,rp="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function lp(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(Hn),{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 ip(e,t){const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=t(Hn),i=n(e);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(e),name:i,reusableBlockTitle:s&&l(o(e).ref)}}),[e]),i=lp(e);if(!o||!i)return null;const s=(0,r.getBlockType)(o),a=s?(0,r.__experimentalGetBlockLabel)(s,n):null,c=l||a,d=c&&c!==s.title?c:i.title;return t&&t>0?(0,u.truncate)(d,{length:t}):d}function sp(e){let{clientId:t,maximumLength:n}=e;return ip(t,n)}var ap=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(Hn),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,g,h]=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)(Hn);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:g,onDragEnd:()=>{b(),d.current=!1,h(),i&&i()},__experimentalDragComponent:(0,s.createElement)(Uu,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},cp=function(e){let{clientId:t,rootClientId:n,blockElement:o}=e;const l=lp(t),a=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(Hn),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:h,orientation:v}=a,{setNavigationMode:b,removeBlock:k}=(0,m.useDispatch)(Hn),_=(0,s.useRef)(),y=(0,r.getBlockType)(d),E=(0,r.__experimentalGetAccessibleBlockLabel)(y,f,u+1,v);(0,s.useEffect)((()=>{_.current.focus(),(0,Mt.speak)(E)}),[E]);const{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:x,getMultiSelectedBlocksEndClientId:I,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(Hn),{selectBlock:M,clearSelectedBlock:R,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(Hn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!h}),O=(0,g.__)("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)(pc,{icon:null==l?void 0:l.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(ap,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:Gu,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===qa.UP,l=n===qa.DOWN,i=n===qa.LEFT,s=n===qa.RIGHT,a=n===qa.TAB,c=n===qa.ESCAPE,u=n===qa.ENTER,d=n===qa.SPACE,p=e.shiftKey;if(n===qa.BACKSPACE||n===qa.DELETE)return k(t),void e.preventDefault();const m=x(),f=I(),g=T(f||m),h=N(f||m),v=a&&p||r,b=a&&!p||l,_=i,y=s;let E;if(v)E=g;else if(b)E=h;else if(_){var D;E=null!==(D=w(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=w(F),t=w(m),n=S(F);let o=S(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;if(b){t=o;do{t=Rr.focus.tabbable.findNext(t)}while(t&&o.contains(t));t||(t=o.ownerDocument.defaultView.frameElement,t=Rr.focus.tabbable.findNext(t))}else t=Rr.focus.tabbable.findPrevious(o);t&&(e.preventDefault(),t.focus(),R())}},label:E,className:"block-selection-button_select-button"},(0,s.createElement)(sp,{clientId:t,maximumLength:35})))))};function up(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var dp=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||At()("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 function(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,wc.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=up(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=up(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}(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)},pp=(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"})),mp=(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"})),fp=(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"})),gp=(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"}));const hp=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?pp:mp:fp:"down"===e?"horizontal"===t?(0,g.isRTL)()?mp:pp:gp:null,vp=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move right"):(0,g.__)("Move left"):(0,g.__)("Move up"):"down"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move left"):(0,g.__)("Move right"):(0,g.__)("Move down"):null,bp=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const f=(0,d.useInstanceId)(bp),h=(0,u.castArray)(n).length,{blockType:v,isDisabled:b,rootClientId:k,isFirst:_,isLast:y,firstIndex:E,orientation:C="vertical"}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:i,getBlockOrder:s,getBlock:a,getBlockListSettings:c}=e(Hn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),f=t(p),g=t((0,u.last)(d)),h=s(m),v=a(p),b=0===f,k=g===h.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:S,moveBlocksUp:w}=(0,m.useDispatch)(Hn),B="up"===o?w:S,x=`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:hp(o,C),label:vp(o,C),"aria-describedby":x},a,{onClick:b?null:e=>{B(n,k),a.onClick&&a.onClick(e)},"aria-disabled":b})),(0,s.createElement)("span",{id:x,className:"block-editor-block-mover-button__description"},function(e,t,n,o,r,l,i){const s=n+1,a=e=>"up"===e?"horizontal"===i?(0,g.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,g.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;return r<0&&n?(0,g.__)("Blocks cannot be moved up as they are already at the top"):r>0&&o?(0,g.__)("Blocks cannot be moved down as they are already at the bottom"):r<0&&!n?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
31
  (0,g._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):r>0&&!o?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
32
  (0,g._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):void 0}(e,n,o,r,l);if(o&&r)return(0,g.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
33
  (0,g.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=a("down");if("down"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
@@ -42,64 +42,69 @@ title:(0,g.__)("Reusable")};var Hd=function(e){let{children:t,showPatterns:n=!1,
42
  (0,g.__)("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,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
43
  (0,g.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
44
  (0,g.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
45
- (0,g.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(h,v&&v.title,E,_,y,"up"===o?-1:1,C)))})),kp=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(bp,i({direction:"up",ref:t},e)))),_p=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(bp,i({direction:"down",ref:t},e))));var yp=(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(Hn),p=(0,u.castArray)(o),m=(0,u.first)(p),f=l(m),g=d((0,u.first)(p)),h=i(m),v=0===h,b=i((0,u.last)(p))===c(g).length-1;return{blockType:f?(0,r.getBlockType)(f.name):null,canMove:a(o,g),rootClientId:g,firstIndex:h,isFirst:v,isLast:b,orientation:null===(n=s(g))||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),h=()=>f(!0),v=()=>f(!1);if(!r||t&&n&&!a)return null;const b=(0,g.__)("Drag");return(0,s.createElement)("div",{className:c()("block-editor-block-mover",{"is-visible":m||!l,"is-horizontal":"horizontal"===u})},!d&&(0,s.createElement)(ap,{clientIds:o,cloneClassname:"block-editor-block-mover__drag-clone"},(e=>(0,s.createElement)(p.Button,i({icon:Gu,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:h,onBlur:v},(e=>(0,s.createElement)(kp,i({clientIds:o},e)))),(0,s.createElement)(p.ToolbarItem,{onFocus:h,onBlur:v},(e=>(0,s.createElement)(_p,i({clientIds:o},e))))))}));const{clearTimeout:Ep,setTimeout:Cp}=window,Sp=200;function wp(e){let{ref:t,isFocused:n,debounceTimeout:o=Sp,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=a.current;e&&Ep&&Ep(e)};return(0,s.useEffect)((()=>()=>{c(!1),d()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),a.current=Cp((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function Bp(e){let{ref:t,debounceTimeout:n=Sp,onChange:o=u.noop}=e;const[r,l]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=wp({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 xp(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(Hn),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(Hn),{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=lp(n),c=(0,s.useRef)(),{gestures:u}=Bp({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,g.sprintf)(
46
  /* translators: %s: Name of the block's parent. */
47
- (0,g.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(pc,{icon:a.icon})}))}var Ip=(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 Tp(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,g.__)("Preview")),(0,s.createElement)(Ou,{viewportWidth:500,blocks:t})))))}var Np=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,g.__)("Transform to"),className:t},i&&(0,s.createElement)(Tp,{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)(pc,{icon:n,showColors:!0}),l)})))},Pp=(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"})),Mp=window.wp.tokenList,Rp=n.n(Mp);function Lp(e,t,n){const o=new(Rp())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function Ap(e){return(0,u.find)(e,"isDefault")}function Dp(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:a}=(0,m.useSelect)((e=>{const{getBlock:n}=e(Hn),o=n(t);if(!o)return{};const l=(0,r.getBlockType)(o.name),{getBlockStyles:i}=e(r.store);return{block:o,blockType:l,styles:i(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:c}=(0,m.useDispatch)(Hn),d=function(e){return e&&0!==e.length?Ap(e)?e:[{name:"default",label:(0,g._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(Rp())(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")}(d,a),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])}(l,i);return{onSelect:e=>{const o=Lp(a,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:f,className:a}}function Op(e){let{clientId:t,onSwitch:n=u.noop}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=Dp({clientId:t,onSwitch:n});return r&&0!==r.length?(0,s.createElement)(s.Fragment,null,r.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.MenuItem,{key:e.name,icon:l.name===e.name?Pp:null,onClick:()=>o(e)},(0,s.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Fp(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(Op,{clientId:o,onSwitch:n}))}const zp=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=zp(e,t,n);if(o)return o}}},Vp=(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}};function Hp(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,g.__)("Preview")),(0,s.createElement)(Gp,{patterns:t,onSelect:n})))))}function Gp(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,g.__)("Patterns list")}),t.map((e=>(0,s.createElement)(Up,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Up(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(Up,`${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)(Ou,{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 Wp=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[l,i]=(0,s.useState)(!1),a=((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=zp(r,t.name,o);if(n){e=!0,o.add(n.clientId),Vp(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]))(n,t);return a.length?(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},l&&(0,s.createElement)(Hp,{patterns:a,onSelect:o}),(0,s.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),i(!l)},icon:pp},(0,g.__)("Patterns"))):null};const $p=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(Hn),l=lp(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,blockTitle:f,patterns:h}=(0,m.useSelect)((e=>{var o;const{getBlockRootClientId:i,getBlockTransformItems:s,__experimentalGetPatternTransformItems:a}=e(Hn),{getBlockStyles:c,getBlockType:d}=e(r.store),{canRemoveBlocks:p}=e(Hn),m=i((0,u.castArray)(t)[0]),[{name:f}]=n,g=1===n.length,h=g&&c(f);let v;var b;g?v=null==l?void 0:l.icon: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:Ip;return{possibleBlockTransformations:s(n,m),canRemove:p(t,m),hasBlockStyles:!(null==h||!h.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==h||!h.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)(pc,{icon:d,showColors:!0})}));const y=f,E=1===n.length?(0,g.sprintf)(
48
  /* translators: %s: block title. */
49
  (0,g.__)("%s: Change block type or style"),f):(0,g.sprintf)(
50
  /* translators: %d: number of blocks. */
51
- (0,g._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)(pc,{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)(sp,{clientId:t,maximumLength:35}))),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)(Wp,{blocks:n,patterns:h,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,s.createElement)(Np,{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)(Fp,{hoveredBlock:n[0],onSwitch:l}))})))))};var jp=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(Hn).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)($p,{clientIds:t,blocks:n})},Kp=(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"})),qp=window.wp.blob;function Yp(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;return 1!==(null===(n=t.match(e))||void 0===n?void 0:n.length)}return!1}function Xp(){const{getBlockName:e}=(0,m.useSelect)(Hn),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(nd.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,g.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph".
52
  (0,g.__)('Copied "%s" to clipboard.'),s):(0,g.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
53
  (0,g.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,g.sprintf)(// Translators: %d: Number of blocks being copied.
54
  (0,g._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,g.sprintf)(// Translators: %d: Number of blocks being cut.
55
- (0,g._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function Qp(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o}=(0,m.useSelect)(Hn),{flashBlock:l,removeBlocks:i,replaceBlocks:s}=(0,m.useDispatch)(Hn),a=Xp();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|webp)$/.test(t)}));return r.length&&!Yp(r,o)&&(o=r.map((e=>`<img src="${(0,qp.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 Zp=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:Qp()},t)};function Jp(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,m.useSelect)(Hn),{getDefaultBlockName:d,getGroupingBlockName:p}=(0,m.useSelect)(r.store),f=s(t),g=i(t[0]),h=(0,u.every)(f,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,g))),v=l(d(),g),b=a(t,g),k=c(t,g),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:S,flashBlock:w,setBlockMovingClientId:B,setNavigationMode:x,selectBlock:I}=(0,m.useDispatch)(Hn),T=Xp();return n({canDuplicate:h,canInsertDefaultBlock:v,canMove:b,canRemove:k,rootClientId:g,blocks:f,onDuplicate:()=>E(t,o),onRemove:()=>_(t,o),onInsertBefore(){S((0,u.first)((0,u.castArray)(t)))},onInsertAfter(){C((0,u.last)((0,u.castArray)(t)))},onMoveTo(){x(!0),I(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&&w(e[0]),T("copy",e)}})}var em=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(Hn),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(Hn).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,g.__)("Edit as HTML"):(0,g.__)("Edit visually");return(0,s.createElement)(p.MenuItem,{onClick:o},!l&&a)})),tm=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(Hn).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(Hn).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,g.__)("Convert to Blocks");return(0,s.createElement)(p.MenuItem,{onClick:n},!o&&r)}));const{Fill:nm,Slot:om}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");nm.Slot=om;var rm=nm;function lm(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(Hn);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,g._x)("Group","verb")),o&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),a()}},(0,g._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}var im=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"})),sm=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"})),am=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20 5h-5.7c0-1.3-1-2.3-2.3-2.3S9.7 3.7 9.7 5H4v2h1.5v.3l1.7 11.1c.1 1 1 1.7 2 1.7h5.7c1 0 1.8-.7 2-1.7l1.7-11.1V7H20V5zm-3.2 2l-1.7 11.1c0 .1-.1.2-.3.2H9.1c-.1 0-.3-.1-.3-.2L7.2 7h9.6z"}));function cm(e){let{clientId:t,onClose:n}=e;const[o,r]=(0,s.useState)({move:!1,remove:!1}),{canMove:l,canRemove:i}=(0,m.useSelect)((e=>{const{canMoveBlock:n,canRemoveBlock:o,getBlockRootClientId:r}=e(Hn),l=r(t);return{canMove:n(t,l),canRemove:o(t,l)}}),[t]),{updateBlockAttributes:a}=(0,m.useDispatch)(Hn),c=lp(t),u=(0,d.useInstanceId)(cm,"block-editor-block-lock-modal__options-title");(0,s.useEffect)((()=>{r({move:!l,remove:!i})}),[l,i]);const f=Object.values(o).every(Boolean);let h;return h=f?"true":Object.values(o).some(Boolean)?"mixed":"false",(0,s.createElement)(p.Modal,{title:(0,g.sprintf)(
56
  /* translators: %s: Name of the block. */
57
- (0,g.__)("Lock %s"),c.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,g.__)("Close"),onRequestClose:n},(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),a([t],{lock:o}),n()}},(0,s.createElement)("p",null,(0,g.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("div",{role:"group","aria-labelledby":u,className:"block-editor-block-lock-modal__options"},(0,s.createElement)(p.CheckboxControl,{className:"block-editor-block-lock-modal__options-title",label:(0,s.createElement)("span",{id:u},(0,g.__)("Lock all")),checked:f,"aria-checked":h,onChange:e=>r({move:e,remove:e})}),(0,s.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Disable movement"),(0,s.createElement)(p.Icon,{icon:Gu})),checked:o.move,onChange:e=>r((t=>({...t,move:e})))})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Prevent removal"),(0,s.createElement)(p.Icon,{icon:am})),checked:o.remove,onChange:e=>r((t=>({...t,remove:e})))})))),(0,s.createElement)(p.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"tertiary",onClick:n},(0,g.__)("Cancel"))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"primary",type:"submit"},(0,g.__)("Apply"))))))}function um(e){let{clientId:t}=e;const{canLockBlock:n,isLocked:o}=(0,m.useSelect)((e=>{const{canMoveBlock:n,canRemoveBlock:o,canLockBlockType:r,getBlockName:l,getBlockRootClientId:i}=e(Hn),s=i(t);return{canLockBlock:r(l(t)),isLocked:!n(t,s)||!o(t,s)}}),[t]),[r,l]=(0,s.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,g.__)("Unlock"):(0,g.__)("Lock");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{icon:o?im:sm,onClick:l},i),r&&(0,s.createElement)(cm,{clientId:t,onClose:l}))}const{Fill:dm,Slot:pm}=(0,p.createSlotFill)("BlockSettingsMenuControls");function mm(e){let{...t}=e;return(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(dm,t))}mm.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:o,selectedClientIds:l,canRemove:a}=(0,m.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(Hn),l=null!==n?n:o();return{selectedBlocks:(0,u.map)((0,u.compact)(t(l)),(e=>e.name)),selectedClientIds:l,canRemove:r(l)}}),[n]),c=1===l.length,d=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(Hn),{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,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}}(),{isGroupable:f,isUngroupable:g}=d,h=(f||g)&&a;return(0,s.createElement)(pm,{fillProps:{...t,selectedBlocks:o,selectedClientIds:l}},(e=>!(null!=e&&e.length)>0&&!h&&!c?null:(0,s.createElement)(p.MenuGroup,null,c&&(0,s.createElement)(um,{clientId:l[0]}),e,h&&(0,s.createElement)(lm,i({},d,{onClose:null==t?void 0:t.onClose})))))};var fm=mm;const gm={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function hm(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,g.__)("Copy"))}var vm=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...r}=e;const l=(0,u.castArray)(t),a=l.length,c=l[0],{onlyBlock:d,previousBlockClientId:f,nextBlockClientId:h,selectedBlockClientIds:v}=(0,m.useSelect)((e=>{const{getBlockCount:t,getPreviousBlockClientId:n,getNextBlockClientId:o,getSelectedBlockClientIds:r}=e(Hn);return{onlyBlock:1===t(),previousBlockClientId:n(c),nextBlockClientId:o(c),selectedBlockClientIds:r()}}),[c]),b=(0,m.useSelect)((e=>{const{getShortcutRepresentation:t}=e(wc.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")}}),[]),k=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:u.noop,[n]),_=ip(c,25),y=(0,s.useCallback)(n?()=>{const e=f||h;e&&v.includes(c)&&!v.includes(e)&&n(e)}:u.noop,[n,f,h,v]),E=(0,g.sprintf)(
58
  /* translators: %s: block name */
59
- (0,g.__)("Remove %s"),_),C=1===a?E:(0,g.__)("Remove blocks");return(0,s.createElement)(Jp,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:l,canMove:m,canRemove:f,onDuplicate:h,onInsertAfter:v,onInsertBefore:_,onRemove:E,onCopy:S,onMoveTo:w,blocks:B}=e;return(0,s.createElement)(p.DropdownMenu,i({icon:Kp,label:(0,g.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:gm,noIcons:!0},r),(e=>{let{onClose:r}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(rm.Slot,{fillProps:{onClose:r}}),1===a&&(0,s.createElement)(tm,{clientId:c}),(0,s.createElement)(hm,{blocks:B,onCopy:S}),n&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(r,h,k),shortcut:b.duplicate},(0,g.__)("Duplicate")),l&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(r,_),shortcut:b.insertBefore},(0,g.__)("Insert before")),(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(r,v),shortcut:b.insertAfter},(0,g.__)("Insert after"))),m&&!d&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(r,w)},(0,g.__)("Move to")),1===a&&(0,s.createElement)(em,{clientId:c,onToggle:r})),(0,s.createElement)(fm.Slot,{fillProps:{onClose:r},clientIds:t}),"function"==typeof o?o({onClose:r}):s.Children.map((e=>(0,s.cloneElement)(e,{onClose:r}))),f&&(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(r,E,y),shortcut:b.remove},C)))}))}))},bm=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(vm,i({clientIds:t,toggleProps:e},n)))))};function km(e){let{clientId:t}=e;const n=lp(t),{canMove:o,canRemove:r,canLockBlock:l}=(0,m.useSelect)((e=>{const{canLockBlockType:n,getBlockName:o,canMoveBlock:r,canRemoveBlock:l}=e(Hn);return{canMove:r(t),canRemove:l(t),canLockBlock:n(o(t))}}),[t]),[i,a]=(0,s.useReducer)((e=>!e),!1);return l?o&&r?null:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,s.createElement)(p.ToolbarButton,{icon:sm,label:(0,g.sprintf)(
 
 
60
  /* translators: %s: block name */
61
- (0,g.__)("Unlock %s"),n.title),onClick:a})),i&&(0,s.createElement)(cm,{clientId:t,onClose:a})):null}function _m(e){let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:a,hasReducedUI:u,isValid:f,isVisual:g}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:s}=e(Hn),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:h}=(0,m.useDispatch)(Hn),v=(0,s.useRef)(),{showMovers:b,gestures:k}=Bp({ref:v,onChange(e){e&&u||h(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&&g,C=n.length>1,S=c()("block-editor-block-toolbar",y&&"is-showing-movers");return(0,s.createElement)("div",{className:S},!C&&!_&&(0,s.createElement)(xp,{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)(jp,{clientIds:n}),!C&&(0,s.createElement)(km,{clientId:n[0]}),(0,s.createElement)(yp,{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)(bm,{clientIds:n}))}var ym=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(Hn),{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)(dp,i({focusOnMount:t,className:d
62
- /* translators: accessibility text for the block toolbar */,"aria-label":(0,g.__)("Block tools")},o),(0,s.createElement)(_m,{hideDragHandle:n}))};function Em(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isCaretWithinFormattedText:l,getSettings:i,getLastMultiSelectedBlockClientId:s}=e(Hn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),isCaretWithinFormattedText:l(),hasMultiSelection:o(),hasFixedToolbar:i().hasFixedToolbar,lastClientId:s()}}function Cm(e){let{clientId:t,rootClientId:n,isValid:o,isEmptyDefaultBlock:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:a}=e;const{isNavigationMode:u,isMultiSelecting:f,isTyping:g,isCaretWithinFormattedText:h,hasMultiSelection:v,hasFixedToolbar:b,lastClientId:k}=(0,m.useSelect)(Em,[]),_=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(Hn);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),[S,w]=(0,s.useState)(!1),{stopTyping:B}=(0,m.useDispatch)(Hn),x=!g&&!u&&r&&o,I=u,T=!u&&!b&&y&&!x&&!f&&(!g||h),N=!(u||T||b||r);(0,wc.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=ho(t),R=ho(k),L=ho(l),A=Zd(a);if(!(I||T||E||x))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=x?"top left right":"top right left",{ownerDocument:z}=D,V=x?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(){w(!0)},onBlur:function(){w(!1)},tabIndex:-1,className:c()("block-editor-block-list__block-popover-inserter",{"is-visible":S})},(0,s.createElement)(jd,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(T||E)&&(0,s.createElement)(ym,{focusOnMount:E,__experimentalInitialIndex:P.current,__experimentalOnIndexChange:e=>{P.current=e},key:t}),I&&(0,s.createElement)(cp,{clientId:t,rootClientId:n,blockElement:D}),x&&(0,s.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,s.createElement)(jd,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function Sm(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(Hn),a=t()||n();if(!a)return;const{name:c,attributes:d={},isValid:p}=l(a)||{},m=i(a),f=s(m),g=(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:g}}function wm(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(Sm,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u}=o;return i?(0,s.createElement)(Cm,{clientId:r,rootClientId:l,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Bm(e){let{children:t}=e;const n=(0,s.useContext)(Jd),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(At()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(tp,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(wm,{__unstablePopoverSlot:"block-toolbar"}),t))}var xm=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=$n();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Im=xm((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(Xd,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),Tm=(0,d.compose)([xm,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(Hn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(Kd,{rootClientId:t})})),Nm=window.wp.isShallowEqual,Pm=n.n(Nm);const Mm=new WeakMap;function Rm(e,t){const n=(0,m.useSelect)((e=>e(Hn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(Hn),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(Hn),d=function(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)}}}(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");n?f(n):t.length?p(t):d(e)}}function Lm(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 Am(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=Lm(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function Dm(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,g.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=Am(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function Om(){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(Hn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(Hn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(Hn),a=Rm(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=Dm(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 Fm(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:g,orientation:h,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(Hn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(Hn).getBlockRootClientId(e);return{blockListSettings:t(Hn).getBlockListSettings(e),parentLock:t(Hn).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=ar(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),Pm()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,h,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(Hn),{replaceInnerBlocks:i}=(0,m.useDispatch)(Hn),a=(0,m.useSelect)((t=>t(Hn).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(Hn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){Mm.has(t)||Mm.set(t,new WeakMap);const n=Mm.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)(Ar,{value:k},(0,s.createElement)(qm,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function zm(e){return fc(e),(0,s.createElement)(Fm,e)}const Vm=(0,s.forwardRef)(((e,t)=>{const n=Hm({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function Hm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=$n(),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(Hn),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,Om({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?zm:Fm;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)(qm,t)}}Hm.save=r.__unstableGetInnerBlocksProps,Vm.DefaultBlockAppender=Tm,Vm.ButtonBlockAppender=Im,Vm.Content=()=>Hm.save().children;var Gm=Vm;const Um=(0,s.createContext)(),Wm=(0,s.createContext)();function $m(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(Hn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),p=Hm({ref:(0,d.useMergeRefs)([vc(),np(),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)(Um.Provider,{value:o},(0,s.createElement)("div",p))}function jm(e){return function(){const e=(0,m.useSelect)((e=>e(Hn).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(Hn).__experimentalGetParsedPattern(e[n].name),t=op(o))};return t=op(o),()=>rp(t)}),[e])}(),(0,s.createElement)(Bm,null,(0,s.createElement)(Wn,{value:Gn},(0,s.createElement)($m,e)))}function Km(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=cr}=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(Hn);return{order:t(n),selectedBlocks:o()}}),[n]);return(0,s.createElement)(dr,{value:l},(0,s.createElement)(Wm.Provider,{value:c},u.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,s.createElement)(ic,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,s.createElement)(Qd,{tagName:r,rootClientId:n,renderAppender:o}))}function qm(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(Km,e))}jm.__unstableElementContext=Um;const Ym=["colors","disableCustomColors","gradients","disableCustomGradients"];function Xm(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:f,colorValue:h,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,S]=(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",{className:"block-editor-color-gradient-control__fieldset"},(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:S,label:(0,g.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,g.__)("Solid")}),(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,g.__)("Gradient")})),("color"===C||!E)&&(0,s.createElement)(p.ColorPalette,{value:h,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 Qm(e){const t={};return t.colors=_o("color.palette"),t.gradients=_o("color.gradients"),t.disableCustomColors=!_o("color.custom"),t.disableCustomGradients=!_o("color.customGradient"),(0,s.createElement)(Xm,i({},t,e))}var Zm=function(e){return(0,u.every)(Ym,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Xm,e):(0,s.createElement)(Qm,e)};function Jm(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)=>e&&(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)(Zm,i({showTitle:!1,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d},e))}))))}function ef(){return{disableCustomColors:!_o("color.custom"),disableCustomGradients:!_o("color.customGradient")}}function tf(){const e=ef(),t=_o("color.palette.custom"),n=_o("color.palette.theme"),o=_o("color.palette.default"),r=_o("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,g._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=_o("color.gradients.custom"),i=_o("color.gradients.theme"),a=_o("color.gradients.default"),c=_o("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,g._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}lu([iu,cu]);const nf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},of=(e,t)=>(0,u.find)(e,{color:t});function rf(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}const lf=[];function sf(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=tf(),l=r.colors.reduce(((e,t)=>e.concat(t.colors)),[]),{color:a}=(null==n?void 0:n.border)||{},[c,u]=(0,s.useState)((()=>{var e;return null===(e=nf(l,t,a))||void 0===e?void 0:e.color}));(0,s.useEffect)((()=>{var e;u(null===(e=nf(l,t,a))||void 0===e?void 0:e.color)}),[t,a,l]);const d=[{label:(0,g.__)("Color"),onColorChange:e=>{u(e);const t=of(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:Co(r),borderColor:i})},colorValue:c,clearable:!1}];return(0,s.createElement)(Jm,i({settings:d,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function af(e,t,n){var o;if(!Rf(t,"color")||Lf(t))return e;const{borderColor:r,style:l}=n,i=rf("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 cf=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const{name:r,attributes:l}=t,{borderColor:a}=l,c=_o("color.palette")||lf;if(!Rf(r,"color")||Lf(r))return(0,s.createElement)(e,t);const u={borderColor:a?null===(n=nf(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 uf(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function df(){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.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=uf(o),i=0===r||r?`${r}${l}`:void 0;return i}function pf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=df(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function mf(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function ff(e){let{onChange:t,values:n,...o}=e;const r=df(n),l=mf(n)&&pf(n),a=l?(0,g.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,g.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Rf(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",af),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Rf(e,"color")||Lf(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),af(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",cf);const gf={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function hf(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(gf).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 vf=(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"})),bf=(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 kf(e){let{isLinked:t,...n}=e;const o=t?(0,g.__)("Unlink Radii"):(0,g.__)("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?vf:bf,iconSize:16,"aria-label":o})))}const _f={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},yf={px:100,em:20,rem:20};function Ef(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!mf(n)||!pf(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:_o("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.__experimentalParseQuantityAndUnitFromRawValue)(e);return t||"px"}return uf(Object.values(e).map((e=>{const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t})))||"px"}(n),a=l&&l.find((e=>e.value===i)),c=(null==a?void 0:a.step)||1,[u]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(df(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,g.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ff,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,units:l}),(0,s.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:yf[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(hf,{min:0,onChange:t,values:n||_f,units:l}),(0,s.createElement)(kf,{onClick:()=>r(!o),isLinked:o})))}function Cf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Ef,{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=Co(t)),o({style:t})}})}var Sf=(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"})),wf=(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"})),Bf=(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 xf=[{label:(0,g.__)("Solid"),icon:Sf,value:"solid"},{label:(0,g.__)("Dashed"),icon:wf,value:"dashed"},{label:(0,g.__)("Dotted"),icon:Bf,value:"dotted"}];function If(e){let{onChange:t,value:n}=e;return(0,s.createElement)("fieldset",{className:"components-border-style-control"},(0,s.createElement)("legend",null,(0,g.__)("Style")),(0,s.createElement)("div",{className:"components-border-style-control__buttons"},xf.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 Tf=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(If,{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:Co(t)})}})},Nf=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)(),[m,f]=(0,s.useState)(),h=(0,p.__experimentalUseCustomUnits)({availableUnits:_o("spacing.units")||["px","em","rem"]});return(0,s.createElement)(p.__experimentalUnitControl,{value:r,label:(0,g.__)("Width"),min:0,onChange:e=>{let s={...n,border:{...null==n?void 0:n.border,width:e}},p=t;const g=0===parseFloat(e),h=0===parseFloat(r);g&&!h&&(d(t),f(l),c(i),p=void 0,s.border.color=void 0,s.border.style="none"),!g&&h&&("none"===i&&(s.border.style=a),void 0===t&&(p=u,s.border.color=m)),void 0!==e&&""!==e||(s=Co(s)),o({borderColor:p,style:s})},units:h})},Pf="__experimentalBorder";function Mf(e){const{clientId:t}=e,n=_o("border.color")&&Rf(e.name,"color"),o=_o("border.radius")&&Rf(e.name,"radius"),l=_o("border.style")&&Rf(e.name,"style"),i=_o("border.width")&&Rf(e.name,"width");if([!n,!o,!l,!i].every(Boolean))return null;const a=(0,r.getBlockSupport)(e.name,[Pf,"__experimentalDefaultControls"]),c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{var o;return{...n,...t,style:{...n.style,border:{...null===(o=n.style)||void 0===o?void 0:o.border,[e]:void 0}}}}};return(0,s.createElement)(Po,{__experimentalGroup:"border"},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.border)||void 0===n||!n.width)}(e),label:(0,g.__)("Width"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Af(o,"width")})}(e),isShownByDefault:null==a?void 0:a.width,resetAllFilter:c("width"),panelId:t},(0,s.createElement)(Nf,e)),l&&(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.border)||void 0===n||!n.style)}(e),label:(0,g.__)("Style"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Af(o,"style")})}(e),isShownByDefault:null==a?void 0:a.style,resetAllFilter:c("style"),panelId:t},(0,s.createElement)(Tf,e)),n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{attributes:{borderColor:n,style:o}}=e;return!!n||!(null==o||null===(t=o.border)||void 0===t||!t.color)}(e),label:(0,g.__)("Color"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({borderColor:void 0,style:Af(o,"color")})}(e),isShownByDefault:null==a?void 0:a.color,resetAllFilter:c("color",{borderColor:void 0}),panelId:t},(0,s.createElement)(sf,e)),o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,g.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Af(o,"radius")})}(e),isShownByDefault:null==a?void 0:a.radius,resetAllFilter:c("radius"),panelId:t},(0,s.createElement)(Cf,e)))}function Rf(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,Pf);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 Lf(e){const t=(0,r.getBlockSupport)(e,Pf);return null==t?void 0:t.__experimentalSkipSerialization}function Af(e,t){return Co({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Df(e){if(e)return`has-${e}-gradient-background`}function Of(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function Ff(e,t){return(0,u.find)(e,["gradient",t])}function zf(e,t){const n=Ff(e,t);return n&&n.slug}function Vf(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=$n(),o=_o("color.gradients.custom"),r=_o("color.gradients.theme"),l=_o("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(Hn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(Hn),d=(0,s.useCallback)((o=>{const r=zf(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=Df(a);let f;return f=a?Of(i,a):c,{gradientClass:p,gradientValue:f,setGradient:d}}lu([iu,cu]);var Hf=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:a,linkColor:c,enableAlphaChecker:u=!1}=e;const d=t||n;if(!d)return null;const m=a||o,f=c||r;if(!m&&!f)return null;const h=[{color:m,description:(0,g.__)("text color")},{color:f,description:(0,g.__)("link color")}],v=ou(d),b=v.alpha()<1,k=v.brightness(),_={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of h){if(!e.color)continue;const t=ou(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
63
  (0,g.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
64
- (0,g.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,g.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,g.__)("Transparent text may be hard for people to read."),E=(0,g.__)("Transparent text may be hard for people to read."))}return y?((0,Mt.speak)(E),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(p.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function Gf(e){var t;let{settings:n,enableAlpha:o,...r}=e;const l={...tf(),clearable:!1,enableAlpha:o,label:n.label,onColorChange:n.onColorChange,onGradientChange:n.onGradientChange,colorValue:n.colorValue,gradientValue:n.gradientValue},a=null!==(t=n.gradientValue)&&void 0!==t?t:n.colorValue;return(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:n.hasValue,label:n.label,onDeselect:n.onDeselect,isShownByDefault:n.isShownByDefault,resetAllFilter:n.resetAllFilter},r,{className:"block-editor-tools-panel-color-gradient-settings__item"}),(0,s.createElement)(p.Dropdown,{className:"block-editor-tools-panel-color-dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:e=>{let{isOpen:t,onToggle:o}=e;return(0,s.createElement)(p.Button,{onClick:o,"aria-expanded":t,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":t})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:a}),(0,s.createElement)(p.FlexItem,null,n.label)))},renderContent:()=>(0,s.createElement)(Zm,i({showTitle:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},l))}))}function Uf(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function Wf(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)(),p=go(o);return(0,s.useEffect)((()=>{var e;if(!r)return;if(!p.current)return;c(Uf(p.current).color);const t=null===(e=p.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&d(Uf(t).color);let n=p.current,o=Uf(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=Uf(n).backgroundColor;i(o)})),(0,s.createElement)(Po,{__experimentalGroup:"color"},n.map(((e,n)=>(0,s.createElement)(Gf,{key:n,settings:e,panelId:o,enableAlpha:t}))),r&&(0,s.createElement)(Hf,{backgroundColor:l,textColor:a,enableAlphaChecker:t,linkColor:u}))}const $f="color",jf=e=>{const t=(0,r.getBlockSupport)(e,$f);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Kf=e=>{const t=(0,r.getBlockSupport)(e,$f);return null==t?void 0:t.__experimentalSkipSerialization},qf=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,$f);return(0,u.isObject)(t)&&!!t.link},Yf=e=>{const t=(0,r.getBlockSupport)(e,$f);return(0,u.isObject)(t)&&!!t.gradients},Xf=e=>{const t=(0,r.getBlockSupport)(e,$f);return t&&!1!==t.background},Qf=e=>{const t=(0,r.getBlockSupport)(e,$f);return t&&!1!==t.text},Zf=e=>t=>{var n,o,r,l,i,s,a,c,u,d;return"background"===e?!!(t.attributes.backgroundColor||null!==(r=t.attributes.style)&&void 0!==r&&null!==(l=r.color)&&void 0!==l&&l.background||t.attributes.gradient||null!==(i=t.attributes.style)&&void 0!==i&&null!==(s=i.color)&&void 0!==s&&s.gradient):"link"===e?!(null===(a=t.attributes.style)||void 0===a||null===(c=a.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text):!!t.attributes[`${e}Color`]||!(null===(n=t.attributes.style)||void 0===n||null===(o=n.color)||void 0===o||!o[e])},Jf=(e,t)=>Co(So(t,e,void 0)),eg=e=>({textColor:void 0,style:Jf(["color","text"],e.style)}),tg=e=>({style:Jf(["elements","link","color","text"],e.style)}),ng=e=>{var t;return{backgroundColor:void 0,gradient:void 0,style:{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,background:void 0,gradient:void 0}}}};function og(e,t,n){var o,r,l,i,s,a;if(!jf(t)||Kf(t))return e;const u=Yf(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,g=rf("background-color",d),h=Df(m),v=rf("color",p),b=c()(e.className,v,h,{[g]:!(u&&null!=f&&null!==(o=f.color)&&void 0!==o&&o.gradient||!g),"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 rg=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?nf(e,n[1]).color:t};function lg(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,f=_o("color.palette.custom"),h=_o("color.palette.theme"),v=_o("color.palette.default"),b=(0,s.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=_o("color.gradients.custom"),_=_o("color.gradients.theme"),y=_o("color.gradients.default"),E=(0,s.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=_o("color.custom"),S=_o("color.customGradient"),w=_o("color.background"),B=_o("color.link"),x=_o("color.text"),I=C||!h||(null==h?void 0:h.length)>0,T=S||!_||(null==_?void 0:_.length)>0,N=(0,s.useRef)(m);if((0,s.useEffect)((()=>{N.current=m}),[m]),!jf(p))return null;const P=qf(p)&&B&&I,M=Qf(p)&&x&&I,R=Xf(p)&&w&&I,L=Yf(p)&&T;if(!(P||M||R||L))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(L&&F)z=Of(E,F);else if(L){var V;z=null==A||null===(V=A.color)||void 0===V?void 0:V.gradient}const H=t=>n=>{var o,r;const l=of(b,n),i=t+"Color",s={...N.current.style,color:{...null===(o=N.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:Co(s),[i]:a};e.setAttributes(c),N.current={...N.current,...c}},G=!("web"!==s.Platform.OS||F||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient),U=(0,r.getBlockSupport)(e.name,[$f,"__experimentalDefaultControls"]);return(0,s.createElement)(Wf,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,g.__)("Text"),onColorChange:H("text"),colorValue:nf(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,hasValue:()=>Zf("text")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({textColor:void 0,style:Jf(["color","text"],t.style)})})(e),resetAllFilter:eg}]:[],...R||L?[{label:(0,g.__)("Background"),onColorChange:R?H("background"):void 0,colorValue:nf(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:L?t=>{const n=zf(E,t);let o;if(n){var r,l,i;const e={...null===(r=N.current)||void 0===r?void 0:r.style,color:{...null===(l=N.current)||void 0===l||null===(i=l.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:Co(e),gradient:n}}else{var s,a,c;const e={...null===(s=N.current)||void 0===s?void 0:s.style,color:{...null===(a=N.current)||void 0===a||null===(c=a.style)||void 0===c?void 0:c.color,gradient:t}};o={style:Co(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,hasValue:()=>Zf("background")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n(ng(t))})(e),resetAllFilter:ng}]:[],...P?[{label:(0,g.__)("Link"),onColorChange:t=>{const n=of(b,t),o=null!=n&&n.slug?`var:preset|color|${n.slug}`:t,r=Co(So(A,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:rg(b,null==A||null===(l=A.elements)||void 0===l||null===(i=l.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==A||null===(c=A.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text),isShownByDefault:null==U?void 0:U.link,hasValue:()=>Zf("link")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({style:Jf(["elements","link","color","text"],t.style)})})(e),resetAllFilter:tg}]:[]]})}const ig=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=_o("color.palette.custom")||[],u=_o("color.palette.theme")||[],d=_o("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!jf(o)||Kf(o))return(0,s.createElement)(e,t);const m={};var f,g;a&&(m.color=null===(f=nf(p,a))||void 0===f?void 0:f.color),l&&(m.backgroundColor=null===(g=nf(p,l))||void 0===g?void 0:g.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:h}))})),sg={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,l.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return jf(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Yf(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",og),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!jf(e)||Kf(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),og(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",ig),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return wo({linkColor:qf(r),textColor:Qf(r),backgroundColor:Xf(r),gradient:Yf(r)},sg,e,t,n,o)}));const ag=[{name:(0,g._x)("Regular","font style"),value:"normal"},{name:(0,g._x)("Italic","font style"),value:"italic"}],cg=[{name:(0,g._x)("Thin","font weight"),value:"100"},{name:(0,g._x)("Extra Light","font weight"),value:"200"},{name:(0,g._x)("Light","font weight"),value:"300"},{name:(0,g._x)("Regular","font weight"),value:"400"},{name:(0,g._x)("Medium","font weight"),value:"500"},{name:(0,g._x)("Semi Bold","font weight"),value:"600"},{name:(0,g._x)("Bold","font weight"),value:"700"},{name:(0,g._x)("Extra Bold","font weight"),value:"800"},{name:(0,g._x)("Black","font weight"),value:"900"}],ug=(e,t)=>e?t?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight");function dg(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=ug(n,o),c={key:"default",name:(0,g.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,s.useMemo)((()=>n&&o?(()=>{const e=[c];return ag.forEach((t=>{let{name:n,value:o}=t;cg.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,g.sprintf)(
65
  /* translators: 1: Font weight name. 2: Font style name. */
66
- (0,g.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return ag.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 cg.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,g.sprintf)(// translators: %s: Currently selected font appearance.
67
  (0,g.__)("Currently selected font appearance: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font style.
68
  (0,g.__)("Currently selected font style: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font weight.
69
- (0,g.__)("Currently selected font weight: %s"),d.name):(0,g.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}function pg(e){let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px"}=e;const l=function(e){return void 0!==e&&""!==e}(t),i=l?t:"";o||At()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const a=o?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:a},(0,s.createElement)(p.__experimentalNumberControl,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),r=((e,t)=>{if(l)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,g.__)("Line height"),placeholder:1.5,step:.1,value:i,min:0}))}const mg="typography.lineHeight";function fg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(pg,{__unstableInputWidth:"100%",__nextHasNoMarginBottom:!0,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:Co(t)})}})}function gg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!_o("typography.lineHeight");return!(0,r.hasBlockSupport)(e,mg)||t}const hg="typography.__experimentalFontStyle",vg="typography.__experimentalFontWeight";function bg(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!kg(e),i=!_g(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)(dg,{onChange:e=>{r({style:Co({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function kg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,hg),n=_o("typography.fontStyle");return!t||!n}function _g(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,vg),n=_o("typography.fontWeight");return!t||!n}function yg(e){const t=kg(e),n=_g(e);return t&&n}function Eg(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=_o("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,g.__)("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,g.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const Cg="typography.__experimentalFontFamily";function Sg(e,t,n){if(!(0,r.hasBlockSupport)(t,Cg))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;if(null==n||!n.fontFamily)return e;const o=new(Rp())(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 wg(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=_o("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)(Eg,{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 Bg(e){let{name:t}=e;const n=_o("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Cg)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Cg)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Sg),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Cg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Sg(o,e,n)},e}));const xg=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Ig(e,t){return(0,u.find)(e,{size:t})||{size:t}}function Tg(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var Ng=function(e){const t=_o("typography.fontSizes"),n=!_o("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const Pg="typography.fontSize";function Mg(e,t,n){if(!(0,r.hasBlockSupport)(t,Pg))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;const o=new(Rp())(e.className);o.add(Tg(n.fontSize));const l=o.value;return e.className=l||void 0,e}function Rg(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=_o("typography.fontSizes"),a=xg(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)(Ng,{onChange:e=>{const t=Ig(i,e).slug;l({style:Co({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function Lg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=_o("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,Pg)||!n}const Ag=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=_o("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,Pg)||(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=xg(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"),Dg={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Pg)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Mg),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Pg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Mg(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",Ag),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return wo({fontSize:(0,r.hasBlockSupport)(l,Pg)},Dg,e,t,n,o)}));var Og=(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"})),Fg=(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 zg=[{name:(0,g.__)("Underline"),value:"underline",icon:Og},{name:(0,g.__)("Strikethrough"),value:"line-through",icon:Fg}];function Vg(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,g.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},zg.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 Hg="typography.__experimentalTextDecoration";function Gg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Vg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:Co({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function Ug(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Hg),n=_o("typography.textDecoration");return t||!n}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:"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"})),$g=(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"})),jg=(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 Kg=[{name:(0,g.__)("Uppercase"),value:"uppercase",icon:Wg},{name:(0,g.__)("Lowercase"),value:"lowercase",icon:$g},{name:(0,g.__)("Capitalize"),value:"capitalize",icon:jg}];function qg(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,g.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},Kg.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 Yg="typography.__experimentalTextTransform";function Xg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(qg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:Co({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function Qg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Yg),n=_o("typography.textTransform");return t||!n}function Zg(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:_o("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const Jg="typography.__experimentalLetterSpacing";function eh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Zg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:Co({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function th(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Jg),n=_o("typography.letterSpacing");return t||!n}const nh="typography",oh=[mg,Pg,hg,vg,Cg,Hg,Yg,Jg];function rh(e){const{clientId:t}=e,n=Bg(e),o=Lg(e),l=yg(e),i=gg(e),a=Ug(e),c=Qg(e),u=th(e),d=!kg(e),m=!_g(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[yg(e),Lg(e),gg(e),Bg(e),Ug(e),Qg(e),th(e)];return t.filter(Boolean).length===t.length}(e),h=lh(e.name);if(f||!h)return null;const v=(0,r.getBlockSupport)(e.name,[nh,"__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)(Po,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,g.__)("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)(wg,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,g.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:Co({...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)(Rg,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:ug(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Co({...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)(bg,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,g.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Co({...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)(fg,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,g.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Co({...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)(Gg,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,g.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Co({...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)(Xg,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,g.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Co({...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)(eh,e)))}const lh=e=>oh.some((t=>(0,r.hasBlockSupport)(e,t))),ih=[...oh,Pf,$f,Fo],sh=e=>ih.some((t=>(0,r.hasBlockSupport)(e,t))),ah="var:";function ch(e){return(0,u.startsWith)(e,ah)?`var(--wp--${e.slice(ah.length).split("|").join("--")})`:e}function uh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};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 s=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&!(0,u.isString)(s)?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(s,[o]);r&&(n[t]=ch(r))})):t.includes(l.join("."))||(n[o]=ch((0,u.get)(e,l))))}}));const o=Mr(e,{selector:"self"});return o.forEach((e=>{if("self"!==e.selector)throw"This style can't be added as inline style";n[e.key]=e.value})),n}const dh={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[$f],"typography.__experimentalSkipSerialization":[nh],[`${Fo}.__experimentalSkipSerialization`]:["spacing"]},ph={...dh,[`${Fo}`]:["spacing.blockGap"]};function mh(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ph;if(!sh(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={...uh(l),...e.style},e}const fh=(0,d.createHigherOrderComponent)((e=>t=>{const n=jn();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(lg,t),(0,s.createElement)(rh,t),(0,s.createElement)(Mf,t),(0,s.createElement)(Ho,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),gh=(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=uh(t);return(0,u.isEmpty)(o)?"":[`.editor-styles-wrapper .${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)(jm.__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 sh(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",mh),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!sh(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),mh(o,e,n,dh)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",fh),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",gh);var hh=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,g.__)("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!==qa.DOWN||(e.preventDefault(),n())},label:(0,g.__)("Apply duotone filter"),icon:(0,s.createElement)(p.DuotoneSwatch,{values:l})})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,g.__)("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 vh=[];function bh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=ou(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 kh(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 _h(e){let{presetSetting:t,defaultSetting:n}=e;const o=!_o(n),r=_o(`${t}.custom`)||vh,l=_o(`${t}.theme`)||vh,i=_o(`${t}.default`)||vh;return(0,s.useMemo)((()=>[...r,...l,...o?vh:i]),[o,r,l,i])}function yh(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=_h({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=_h({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!_o("color.custom"),u=!_o("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)(hh,{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})}}))}lu([iu]);const Eh=(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)(yh,t))}),"withDuotoneControls"),Ch=(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),g=(0,s.useContext)(jm.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,g&&(0,s.createPortal)((0,s.createElement)(kh,{selector:m,id:p,values:bh(u)}),g),(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",Eh),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Ch);const Sh="__experimentalLayout";function wh(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=_o("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(Hn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,Sh,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:h}=c;if(!d)return null;const v=l||h||{},{inherit:b=!1,type:k="default"}=v;if("default"===k&&!a)return null;const _=ar(k),y=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Po,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Layout")},f&&!!i&&(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Inherit default layout"),checked:!!b,onChange:()=>t({layout:{inherit:!b}})}),!b&&u&&(0,s.createElement)(Bh,{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 Bh(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,sr.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const xh=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Sh)&&(0,s.createElement)(wh,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),Ih=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,Sh),a=(0,d.useInstanceId)(e),u=_o("layout")||{},p=(0,s.useContext)(jm.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,Sh)||{},g=null!=m&&m.inherit?u:m||f||{},h=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)(mr,{selector:`.wp-container-${a}`,layout:g,style:null==o?void 0:o.style}),p),(0,s.createElement)(e,i({},t,{className:h})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,Sh)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",Ih),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",xh);const Th=[];function Nh(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},l=rf("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:uh({border:r})}}function Ph(e){const t=_o("color.palette")||Th,n=Nh(e);if(e.borderColor){const o=nf(t,e.borderColor);n.style.borderColor=o.color}return n}function Mh(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=rf("background-color",s),m=rf("color",a),f=Df(u),g=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!g&&!!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:uh({color:(null==d?void 0:d.color)||{}})}}const Rh={};function Lh(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=_o("color.palette.custom")||[],l=_o("color.palette.theme")||[],i=_o("color.palette.default")||[],a=_o("color.gradients")||Rh,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=Mh(e);if(t){const e=nf(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=Of(u,o)),n){const e=nf(c,n);d.style.color=e.color}return d}function Ah(e){const{style:t}=e;return{style:uh({spacing:(null==t?void 0:t.spacing)||{}})}}function Dh(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const Oh=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),Fh=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=_o("color.palette.custom"),o=_o("color.palette.theme"),r=_o("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function zh(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=ou(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=of(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=nf(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:rf(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Vh(e){return function(){const t=Oh(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(zh(o,t),"withCustomColors")}}function Hh(){const e=Fh();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(zh(n,e),"withColors")}const Gh=[];var Uh=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=_o("typography.fontSizes")||Gh;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=xg(r,l,n[t]);return e[o]={...i,class:Tg(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},Wh=(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"})),$h=(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"})),jh=(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 Kh=[{icon:Wh,title:(0,g.__)("Align text left"),align:"left"},{icon:$h,title:(0,g.__)("Align text center"),align:"center"},{icon:jh,title:(0,g.__)("Align text right"),align:"right"}],qh={position:"bottom right",isAlternate:!0};var Yh=function(e){let{value:t,onChange:n,alignmentControls:o=Kh,label:r=(0,g.__)("Align"),describedBy:l=(0,g.__)("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,h=c?{isCollapsed:a}:{};return(0,s.createElement)(f,i({icon:m?m.icon:(0,g.isRTL)()?jh:Wh,label:r,toggleProps:{describedBy:l},popoverProps:qh,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},h))};function Xh(e){return(0,s.createElement)(Yh,i({},e,{isToolbar:!1}))}function Qh(e){return(0,s.createElement)(Yh,i({},e,{isToolbar:!0}))}var Zh={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(Hn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=Qu(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?yd(o,r,l,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]);return[(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)(pc,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i])]},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))}}},Jh=window.wp.apiFetch,ev=n.n(Jh),tv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),nv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})),ov={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await ev()({path:(0,Nd.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ir,{key:"icon",icon:"page"===e.subtype?tv:nv}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)};const rv=[];function lv(e){let{completers:t=rv}=e;const{name:n}=$n();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Zh,ov])),(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 iv=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:lv(e)}))},sv=(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"})),av=function(e){let{isActive:t,label:n=(0,g.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:sv,label:n,onClick:()=>o(!t),disabled:r})},cv=function(e){const{label:t=(0,g.__)("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!==qa.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},uv=(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"})),dv=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(Hn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(Hn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,g.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,g.__)("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)(ir,{icon:uv,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)(sp,{clientId:e,maximumLength:35})),(0,s.createElement)(ir,{icon:uv,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(sp,{clientId:r,maximumLength:35})))};function pv(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:g,isParentHighlighted:h}=(0,m.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l}=e(Hn);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":h,"is-dragging-blocks":g});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 mv=()=>(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"})),fv=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)(mv,null)))},gv=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,g.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==qa.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(fv,null)))}))}};var hv=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:gv(n),renderContent:()=>t})},vv=(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 bv=Pa(p.__experimentalTreeGridRow);function kv(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=La({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(bv,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function _v(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)(ir,{icon:uv}))}var yv=(0,s.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:a,onDragStart:u,onDragEnd:d,draggable:m}=e;const f=lp(o);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==qa.ENTER&&e.keyCode!==qa.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),u(e)},onDragEnd:d,draggable:m,href:`#block-${o}`,"aria-hidden":!0},(0,s.createElement)(_v,{onClick:l}),(0,s.createElement)(pc,{icon:null==f?void 0:f.icon,showColors:!0}),(0,s.createElement)(sp,{clientId:o,maximumLength:35}),(null==f?void 0:f.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},f.anchor)))})),Ev=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,isExpanded:p,selectedClientIds:f,...g}=e;const{clientId:h}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,m.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(Hn);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[h]),k=v&&b===h,_=c()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=f.includes(h)?f:[h];return(0,s.createElement)(ap,{clientIds:y},(e=>{let{draggable:c,onDragStart:m,onDragEnd:f}=e;return(0,s.createElement)(yv,i({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:f,isExpanded:p},g))}))}));const Cv=(0,s.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),Sv=()=>(0,s.useContext)(Cv);var wv=(0,s.memo)((function e(t){let{block:n,isDragged:o,isSelected:r,isBranchSelected:l,selectBlock:i,position:a,level:u,rowCount:f,siblingBlockCount:h,showBlockMovers:v,path:b,isExpanded:k,selectedClientIds:_,preventAnnouncement:y}=t;const E=(0,s.useRef)(null),[C,S]=(0,s.useState)(!1),{clientId:w}=n,{toggleBlockHighlight:B}=(0,m.useDispatch)(Hn),x=lp(w),I=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,T=((e,t,n)=>(0,g.sprintf)(
70
  /* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
71
- (0,g.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(a,h,u),N=x?(0,g.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the block.
72
- (0,g.__)("%s link"),x.title):(0,g.__)("Link"),P=x?(0,g.sprintf)(// translators: %s: The title of the block.
73
- (0,g.__)("Options for %s block"),x.title):(0,g.__)("Options"),{__experimentalFeatures:M,__experimentalPersistentListViewFeatures:R,__experimentalHideContainerBlockActions:L,isTreeGridMounted:A,expand:D,collapse:O}=Sv(),F=v&&h>0,z=c()("block-editor-list-view-block__mover-cell",{"is-visible":C||r}),V=c()("block-editor-list-view-block__menu-cell",{"is-visible":C||r});(0,s.useEffect)((()=>{R&&!A&&r&&E.current.focus()}),[]);const H=R?B:()=>{},G=(0,s.useCallback)((()=>{S(!0),H(w,!0)}),[w,S,H]),U=(0,s.useCallback)((()=>{S(!1),H(w,!1)}),[w,S,H]),W=(0,s.useCallback)((e=>{i(e,w),e.preventDefault()}),[w,i]),$=(0,s.useCallback)((e=>{i(void 0,e)}),[i]),j=(0,s.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?O(w):!1===k&&D(w)}),[w,D,O,k]),K=M&&(!L||L&&u>1),q=M&&!K;let Y;F?Y=2:q&&(Y=3);const X=c()({"is-selected":r,"is-branch-selected":R&&l,"is-dragging":o,"has-single-cell":q}),Q=_.includes(w)?_:[w];return(0,s.createElement)(kv,{className:X,onMouseEnter:G,onMouseLeave:U,onFocus:G,onBlur:U,level:u,position:a,rowCount:f,path:b,id:`list-view-block-${w}`,"data-block":w,isExpanded:k,"aria-selected":!!r},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Y,ref:E,"aria-label":N,"aria-selected":!!r,"aria-expanded":k,"aria-describedby":I},(e=>{let{ref:t,tabIndex:o,onFocus:l}=e;return(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(Ev,{block:n,onClick:W,onToggleExpanded:j,isSelected:r,position:a,siblingBlockCount:h,level:u,ref:t,tabIndex:o,onFocus:l,isExpanded:k,selectedClientIds:_,preventAnnouncement:y}),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:I},T))})),F&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalTreeGridCell,{className:z,withoutGridItem:!0},(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(kp,{orientation:"vertical",clientIds:[w],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)(_p,{orientation:"vertical",clientIds:[w],ref:t,tabIndex:n,onFocus:o})})))),K&&(0,s.createElement)(p.__experimentalTreeGridCell,{className:V,"aria-selected":!!r},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(vm,{clientIds:Q,icon:Kp,label:P,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:$})})))}));function Bv(e,t,n,o){var r;return(null==n?void 0:n.includes(e.clientId))?0:(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(xv(t,n,o),0):1}const xv=(e,t,n)=>(o,r)=>{var l;return(null==t?void 0:t.includes(r.clientId))?o:(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+Bv(r,e,t,n):o+1};function Iv(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,expandNested:f=!0}=e,{expandedState:g,draggedClientIds:h,__experimentalPersistentListViewFeatures:v}=Sv(),b=(0,u.compact)(t),k=b.length;let _=d;return(0,s.createElement)(s.Fragment,null,b.map(((e,t)=>{var d;const{clientId:y,innerBlocks:E}=e;t>0&&(_+=Bv(b[t-1],g,h,f));const C=v,{itemInView:S}=p,w=!C||S(_),B=t+1,x=a.length>0?`${a}_${B}`:`${B}`,I=r&&!!E&&!!E.length,T=I?null!==(d=g[y])&&void 0!==d?d:f:void 0,N=!(null==h||!h.includes(y)),P=N||w,M=((e,t)=>(0,u.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e)(y,l),R=c||M&&I;return(0,s.createElement)(m.AsyncModeProvider,{key:y,value:!M},P&&(0,s.createElement)(wv,{block:e,selectBlock:n,isSelected:M,isBranchSelected:R,isDragged:N,level:i,position:B,rowCount:k,siblingBlockCount:k,showBlockMovers:o,path:x,isExpanded:T,listPosition:_,selectedClientIds:l}),!P&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),I&&T&&!N&&(0,s.createElement)(Iv,{blocks:E,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,level:i+1,path:x,listPosition:_+1,fixedListWindow:p,isBranchSelected:R,selectedClientIds:l,expandNested:f}))})))}Iv.defaultProps={selectBlock:()=>{}};var Tv=(0,s.memo)(Iv);function Nv(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,a]=(0,s.useMemo)((()=>t.current?[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 Pv(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const Mv=["top","bottom"];const Rv=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var Lv=(0,s.forwardRef)((function(e,t){let{blocks:n,__experimentalFeatures:o,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,showNestedBlocks:c,showBlockMovers:f,id:h,expandNested:v=!1,...b}=e;const{clientIdsTree:k,draggedClientIds:_,selectedClientIds:y}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(Hn);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(n),{visibleBlockCount:E}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(Hn),o=(null==_?void 0:_.length)>0?n(_).length+1:0;return{visibleBlockCount:t()-o}}),[_]),{updateBlockSelection:C}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,m.useDispatch)(Hn),{getBlockName:o,getBlockParents:l,getBlockSelectionStart:i,getBlockSelectionEnd:a,getSelectedBlockClientIds:c,hasMultiSelection:d,hasSelectedBlock:p}=(0,m.useSelect)(Hn),{getBlockType:f}=(0,m.useSelect)(r.store);return{updateBlockSelection:(0,s.useCallback)((async(r,s,a)=>{if(null==r||!r.shiftKey)return await e(),void n(s);r.preventDefault();const m="keydown"===r.type&&(r.keyCode===qa.UP||r.keyCode===qa.DOWN||r.keyCode===qa.HOME||r.keyCode===qa.END);if(!m&&!p()&&!d())return void n(s,null);const h=c(),v=[...l(s),s];m&&!h.some((e=>v.includes(e)))&&await e();let b=i(),k=s;m&&(p()||d()||(b=s),a&&(k=a));const _=l(b),y=l(k),{start:E,end:C}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(b,k,_,y);await t(E,C,null);const S=c();if((r.keyCode===qa.HOME||r.keyCode===qa.END)&&S.length>1)return;const w=(0,u.difference)(h,S);let B;if(1===w.length){var x;const e=null===(x=f(o(w[0])))||void 0===x?void 0:x.title;e&&(B=(0,g.sprintf)(
 
74
  /* translators: %s: block name */
75
  (0,g.__)("%s deselected."),e))}else w.length>1&&(B=(0,g.sprintf)(
76
  /* translators: %s: number of deselected blocks */
77
- (0,g.__)("%s blocks deselected."),w.length));B&&(0,Mt.speak)(B)}),[e,o,f,l,i,a,c,d,p,t,n])}}(),[S,w]=(0,s.useReducer)(Rv,{}),{ref:B,target:x}=function(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(Hn),[l,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=l||{},u=Rm(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]=Am(t,s,Mv),u=Pv(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}}(),I=(0,s.useRef)(),T=(0,d.useMergeRefs)([I,B,t]),N=(0,s.useRef)(!1),{setSelectedTreeId:P}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,s.useState)(null),{selectedBlockParentClientIds:l}=(0,m.useSelect)((e=>{const{getBlockParents:n}=e(Hn);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,s.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:y[0],setExpandedState:w}),M=(0,s.useCallback)(((e,t)=>{C(e,t),P(t)}),[P,C]);(0,s.useEffect)((()=>{N.current=!0}),[]);const[R]=(0,d.__experimentalUseFixedWindowList)(I,36,E,{useWindowing:l,windowOverscan:40}),L=(0,s.useCallback)((e=>{e&&w({type:"expand",clientIds:[e]})}),[w]),A=(0,s.useCallback)((e=>{e&&w({type:"collapse",clientIds:[e]})}),[w]),D=(0,s.useCallback)((e=>{var t;L(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[L]),O=(0,s.useCallback)((e=>{var t;A(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[A]),F=(0,s.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&C(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(r=n.dataset)||void 0===r?void 0:r.block)}),[C]),z=(0,s.useMemo)((()=>({__experimentalFeatures:o,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,isTreeGridMounted:N.current,draggedClientIds:_,expandedState:S,expand:L,collapse:A})),[o,l,a,N.current,_,S,L,A]);return(0,s.createElement)(m.AsyncModeProvider,{value:!0},(0,s.createElement)(Nv,{listViewRef:I,blockDropTarget:x}),(0,s.createElement)(p.__experimentalTreeGrid,{id:h,className:"block-editor-list-view-tree","aria-label":(0,g.__)("Block navigation structure"),ref:T,onCollapseRow:O,onExpandRow:D,onFocusRow:F},(0,s.createElement)(Cv.Provider,{value:z},(0,s.createElement)(Tv,i({blocks:k,selectBlock:M,showNestedBlocks:c,showBlockMovers:f,fixedListWindow:R,selectedClientIds:y,expandNested:v},b)))))}));function Av(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,s.createElement)(p.Button,i({},l,{ref:r,icon:vv,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0
78
- /* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var Dv=(0,s.forwardRef)((function(e,t){let{isDisabled:n,__experimentalFeatures:o,...r}=e;const l=(0,m.useSelect)((e=>!!e(Hn).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)(Av,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,g.__)("List view")),(0,s.createElement)(Lv,{showNestedBlocks:!0,__experimentalFeatures:o}))})}));function Ov(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=Lp(o,r,n),i=(0,s.useMemo)((()=>({...t,title:n.label||n.name,description:n.description,initialAttributes:{...t.attributes,className:l+" block-editor-block-styles__block-preview-container"}})),[t,l]);return(0,s.createElement)(zu,{item:i,isStylePreview:!0})}function Fv(e){let{children:t,scope:n,...o}=e;return(0,s.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,s.createElement)("div",o,t))}function zv(e){let{clientId:t,onSwitch:n=u.noop,onHoverClassName:o=u.noop,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:a,genericPreviewBlock:m,className:f}=Dp({clientId:t,onSwitch:n}),[g,h]=(0,s.useState)(null),[v,b]=(0,s.useState)(0),k=(0,d.useViewportMatch)("medium","<");if((0,s.useLayoutEffect)((()=>{const e=document.querySelector(".interface-interface-skeleton__content"),t=(null==e?void 0:e.scrollTop)||0;b(t+16)}),[g]),!i||0===i.length)return null;const _=(0,u.debounce)(h,250),y=e=>{l(e),o(null),h(null),_.cancel()},E=e=>{var t;g!==e?(_(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):_.cancel()};return(0,s.createElement)("div",{className:"block-editor-block-styles"},(0,s.createElement)("div",{className:"block-editor-block-styles__variants"},i.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.Button,{className:c()("block-editor-block-styles__item",{"is-active":a.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>E(e),onFocus:()=>E(e),onMouseLeave:()=>E(null),onBlur:()=>E(null),onKeyDown:t=>{qa.ENTER!==t.keyCode&&qa.SPACE!==t.keyCode||(t.preventDefault(),y(e))},onClick:()=>y(e),role:"button",tabIndex:"0"},(0,s.createElement)(p.__experimentalText,{as:"span",limit:12,ellipsizeMode:"tail",className:"block-editor-block-styles__item-text",truncate:!0},t))}))),g&&!k&&(0,s.createElement)(Fv,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>E(null)},(0,s.createElement)(Ov,{activeStyle:a,className:f,genericPreviewBlock:m,style:g})))}zv.Slot=function(e){let{scope:t}=e;return(0,s.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var Vv=zv,Hv=(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"})),Gv=function(e){let{icon:t=Hv,label:n=(0,g.__)("Choose variation"),instructions:o=(0,g.__)("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,g.__)("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,g.__)("Skip"))))},Uv=(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 Wv="carousel",$v="grid",jv=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,g.__)("Start blank")),(0,s.createElement)(p.Button,{variant:"primary",onClick:n},(0,g.__)("Choose")))},Kv=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:mp,label:(0,g.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:pp,label:(0,g.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var qv=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a,onStartBlank:c}=e;const u=t===Wv,d=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:oo,label:(0,g.__)("Carousel view"),onClick:()=>n(Wv),isPressed:u}),(0,s.createElement)(p.Button,{icon:Uv,label:(0,g.__)("Grid view"),onClick:()=>n($v),isPressed:t===$v}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},u&&(0,s.createElement)(Kv,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),d,u&&(0,s.createElement)(jv,{onBlockPatternSelect:a,onStartBlank:c}))};const Yv=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===Wv){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)(Qv,{className:e.get(n)||"",key:t.name,pattern:t})))))}return(0,s.createElement)(p.__unstableComposite,i({},l,{role:"listbox",className:a,"aria-label":(0,g.__)("Patterns list")}),o.map((e=>(0,s.createElement)(Xv,{key:e.name,pattern:e,onSelect:r,composite:l}))))};function Xv(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)(Xv,`${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)(Ou,{blocks:l,viewportWidth:u}),(0,s.createElement)("div",{className:`${r}__item-title`},a)),!!c&&(0,s.createElement)(p.VisuallyHidden,{id:m},c))}function Qv(e){let{className:t,pattern:n}=e;const{blocks:o,title:r,description:l}=n,i=(0,d.useInstanceId)(Qv,"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)(Ou,{blocks:o,__experimentalLive:!0}),!!l&&(0,s.createElement)(p.VisuallyHidden,{id:i},l))}var Zv=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:l,onBlockPatternSelect:i}=e;const[a,c]=(0,s.useState)(Wv),[u,d]=(0,s.useState)(0),[p,f]=(0,s.useState)(!1),{replaceBlock:g}=(0,m.useDispatch)(Hn),h=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(Hn),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(t,n,o);if(null==h||!h.length||p)return l;const v=i||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));g(t,n)});return(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${a}`},(0,s.createElement)(qv,{viewMode:a,setViewMode:c,activeSlide:u,totalSlides:h.length,handleNext:()=>{d((e=>e+1))},handlePrevious:()=>{d((e=>e-1))},onBlockPatternSelect:()=>{v(h[u].blocks)},onStartBlank:()=>{f(!0)}}),(0,s.createElement)(Yv,{viewMode:a,activeSlide:u,patterns:h,onBlockPatternSelect:v}))};const Jv=(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 eb=function(e){let{blockClientId:t}=e;const[n,o]=(0,s.useState)(),{updateBlockAttributes:l}=(0,m.useDispatch)(Hn),{variations:i,blockAttributes:a}=(0,m.useSelect)((e=>{const{getBlockVariations:n}=e(r.store),{getBlockName:o,getBlockAttributes:l}=e(Hn),i=t&&o(t);return{variations:i&&n(i,"transform"),blockAttributes:l(t)}}),[t]);if((0,s.useEffect)((()=>{var e;o(null===(e=Jv(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,g.__)("Transform to variation"),text:(0,g.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${d}__popover`},icon:gp,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 tb=(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"})),nb=(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"})),ob={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,g._x)("Align top","Block vertical alignment setting")},center:{icon:nb,title:(0,g._x)("Align middle","Block vertical alignment setting")},bottom:{icon:tb,title:(0,g._x)("Align bottom","Block vertical alignment setting")}},rb=["top","center","bottom"],lb={isAlternate:!0};var ib=function(e){let{value:t,onChange:n,controls:o=rb,isCollapsed:r=!0,isToolbar:l}=e;const a=ob[t],c=ob.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:lb,icon:a?a.icon:c.icon,label:(0,g._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...ob[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};function sb(e){return(0,s.createElement)(ib,i({},e,{isToolbar:!1}))}function ab(e){return(0,s.createElement)(ib,i({},e,{isToolbar:!0}))}var cb=(0,d.createHigherOrderComponent)((e=>t=>{const n=_o("color.palette"),o=!_o("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"),ub=cb(p.ColorPalette);function db(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(Zm,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var pb=window.wp.date;const mb=new Date(2022,0,25);function fb(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,s.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Date format")),(0,s.createElement)(p.ToggleControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Default format"),(0,s.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,pb.dateI18n)(n,mb))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,s.createElement)(gb,{format:t,onChange:o}))}function gb(e){var t;let{format:n,onChange:o}=e;const r=(0,u.uniq)(["Y-m-d",(0,g._x)("n/j/Y","short date format"),(0,g._x)("n/j/Y g:i A","short date format with time"),(0,g._x)("M j, Y","medium date format"),(0,g._x)("M j, Y g:i A","medium date format with time"),(0,g._x)("F j, Y","long date format")]),l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,pb.dateI18n)(e,mb),format:e}))),i={key:"custom",name:(0,g.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,g.__)("Enter your own date format")},[a,c]=(0,s.useState)((()=>!!n&&!r.includes(n)));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.BaseControl,{className:"block-editor-date-format-picker__custom-format-select-control"},(0,s.createElement)(p.CustomSelectControl,{label:(0,g.__)("Choose a format"),options:[...l,i],value:a?i:null!==(t=l.find((e=>e.format===n)))&&void 0!==t?t:i,onChange:e=>{let{selectedItem:t}=e;t===i?c(!0):(c(!1),o(t.format))}})),a&&(0,s.createElement)(p.TextControl,{label:(0,g.__)("Custom format"),hideLabelFromVision:!0,help:(0,s.createInterpolateElement)((0,g.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,s.createElement)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}
 
 
79
  // 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)
80
- const hb=(0,g.__)("(%s: color %s)"),vb=(0,g.__)("(%s: gradient %s)"),bb=["colors","disableCustomColors","gradients","disableCustomGradients"],kb=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=of(c||t,l);r=(0,g.sprintf)(hb,a.toLowerCase(),e&&e.name||l)}else{const e=Ff(u||n,l);r=(0,g.sprintf)(vb,a.toLowerCase(),e&&e.name||i)}return(0,s.createElement)(p.ColorIndicator,{key:o,colorValue:l||i,"aria-label":r})}))},_b=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:a,settings:d,title:m,showTitle:f=!0,__experimentalHasMultipleOrigins:g,__experimentalIsRenderedInSidebar:h,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)(kb,{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)(Jm,{settings:d,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:g,__experimentalIsRenderedInSidebar:h,enableAlpha:v}),!!a&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalSpacer,{marginY:4})," ",a))},yb=e=>{const t=ef();return t.colors=_o("color.palette"),t.gradients=_o("color.gradients"),(0,s.createElement)(_b,i({},t,e))},Eb=e=>{const t=tf();return(0,s.createElement)(_b,i({},t,e))};// 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)
81
- var Cb=e=>(0,u.every)(bb,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(_b,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(Eb,e):(0,s.createElement)(yb,e),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)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},wb=function(){return(wb=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)};function Bb(e,t,n,o){void 0===o&&(o=0);var r=Ob(e,t,o),l=r.width,i=r.height;return e>=t*n&&l>t*n?{width:t*n,height:t}:l>t*n?{width:e,height:e/n}:l>i*n?{width:i*n,height:i}:{width:l,height:l/n}}function xb(e,t,n,o,r){void 0===r&&(r=0);var l=Ob(t.width,t.height,r),i=l.width,s=l.height;return{x:Ib(e.x,i,n.width,o),y:Ib(e.y,s,n.height,o)}}function Ib(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function Tb(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Nb(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Pb(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?Mb:Rb,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:wb(wb({},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 Mb(e,t){return Math.min(e,Math.max(0,t))}function Rb(e,t){return t}function Lb(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 Ab(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function Db(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 Ob(e,t,n){var o=e/2,r=t/2,l=[Db(0,0,o,r,n),Db(e,0,o,r,n),Db(e,t,o,r,n),Db(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]})));return{width:s-i,height:Math.max.apply(Math,l.map((function(e){return e[1]})))-a}}function Fb(){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 zb=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=Lb(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=n.imageRef||n.videoRef;if(l){n.mediaSize={width:l.offsetWidth,height:l.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 i=n.props.cropSize?n.props.cropSize:Bb(l.offsetWidth,l.offsetHeight,n.props.aspect,n.props.rotation);n.setState({cropSize:i},n.recomputeCropPosition)}n.containerRef&&(n.containerRect=n.containerRef.getBoundingClientRect())},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){e.preventDefault(),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=wb({},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?xb(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=n.props.zoom-e.deltaY*n.props.zoomSpeed/200;n.setNewZoom(r,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?xb(i,n.mediaSize,n.state.cropSize,l,n.props.rotation):i;n.props.onCropChange(s),n.props.onZoomChange(l)}},n.emitCropData=function(){if(n.state.cropSize){var e=Pb(n.props.restrictPosition?xb(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),t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?xb(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 __(){this.constructor=e}Sb(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(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}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\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 will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\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(){window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&this.styleRef.remove(),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():e.cropSize!==this.props.cropSize&&this.computeSizes(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent())},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=Tb(n,o),this.lastPinchRotation=Nb(n,o),this.onDragStart(Ab(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=Ab(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=Tb(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=Nb(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.crop,i=l.x,s=l.y,a=t.rotation,c=t.zoom,u=t.cropShape,d=t.showGrid,p=t.style,m=p.containerStyle,f=p.cropAreaStyle,g=p.mediaStyle,h=t.classes,v=h.containerClassName,b=h.cropAreaClassName,k=h.mediaClassName;return bl().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:Fb("reactEasyCrop_Container",v)},n?bl().createElement("img",wb({alt:"",className:Fb("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:wb(wb({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&bl().createElement("video",wb({autoPlay:!0,loop:!0,muted:!0,className:Fb("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:wb(wb({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&bl().createElement("div",{style:wb(wb({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Fb("reactEasyCrop_CropArea","round"===u&&"reactEasyCrop_CropAreaRound",d&&"reactEasyCrop_CropAreaGrid",b)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",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}(bl().Component);const Vb={position:"bottom right",isAlternate:!0};const Hb=(0,s.createContext)({}),Gb=()=>(0,s.useContext)(Hb);function Ub(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:i,onFinishEditing:a,onSaveImage:c,children:u}=e;const d=function(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,g]=(0,s.useState)(),[h,v]=(0,s.useState)(),[b,k]=(0,s.useState)(),_=(0,s.useCallback)((()=>{d({x:0,y:0}),m(100),g(0),v(n/o),k(n/o)}),[n,o,d,m,g,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(),g(e),v(1/h),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)),g(e),v(1/h),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,g,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:g,rotateClockwise:y,aspect:h,setAspect:v,defaultAspect:b,initializeTransformValues:_})),[r,i,a,c,u,d,p,m,f,g,y,h,v,b,_])}(e),{initializeTransformValues:o}=n;return(0,s.useEffect)((()=>{t&&o()}),[t,o]),n}({url:n,naturalWidth:o,naturalHeight:r},i),p=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)(nd.store),[p,f]=(0,s.useState)(!1),h=(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,ev()({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,g.sprintf)(
82
  /* translators: 1. Error message */
83
- (0,g.__)("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:h})),[p,v,h])}({id:t,url:n,onSaveImage:c,onFinishEditing:a,...d}),f=(0,s.useMemo)((()=>({...d,...p})),[d,p]);return(0,s.createElement)(Hb.Provider,{value:f},u)}function Wb(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:g,setCrop:h,setZoom:v,rotation:b}=Gb();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)(zb,{image:u||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:f,onCropChange:g,onCropComplete:e=>{h(e)},onZoomChange:e=>{v(100*e)}}),a&&(0,s.createElement)(p.Spinner,null))}var $b=(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 jb(){const{isInProgress:e,zoom:t,setZoom:n}=Gb();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:Vb,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(p.ToolbarButton,{icon:$b,label:(0,g.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,g.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var Kb=(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 qb(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?Pp:void 0},t)})))}function Yb(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=Gb();return(0,s.createElement)(p.DropdownMenu,{icon:Kb,label:(0,g.__)("Aspect Ratio"),popoverProps:Vb,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(qb,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("Original"),aspect:l},{title:(0,g.__)("Square"),aspect:1}]}),(0,s.createElement)(qb,{label:(0,g.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("16:10"),aspect:1.6},{title:(0,g.__)("16:9"),aspect:16/9},{title:(0,g.__)("4:3"),aspect:4/3},{title:(0,g.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(qb,{label:(0,g.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("10:16"),aspect:.625},{title:(0,g.__)("9:16"),aspect:9/16},{title:(0,g.__)("3:4"),aspect:3/4},{title:(0,g.__)("2:3"),aspect:2/3}]}))}))}var Xb=(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 Qb(){const{isInProgress:e,rotateClockwise:t}=Gb();return(0,s.createElement)(p.ToolbarButton,{icon:Xb,label:(0,g.__)("Rotate"),onClick:t,disabled:e})}function Zb(){const{isInProgress:e,apply:t,cancel:n}=Gb();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,g.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,g.__)("Cancel")))}function Jb(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)(Wb,{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)(jb,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Yb,{toggleProps:e}))),(0,s.createElement)(Qb,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Zb,null))))}const ek=[25,50,75,100];function tk(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:h,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,g.__)("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,g.__)("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,g.__)("Width"),value:f,min:1,onChange:e=>h("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,g.__)("Height"),value:m,min:1,onChange:e=>h("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,g.__)("Image size presets")},ek.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,g.__)("Reset")))))}var nk=(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"})),ok=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,g.__)("Currently selected link settings")),l)};class rk 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,Za()(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,Nd.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,g.sprintf)(
84
  /* translators: %s: number of results. */
85
- (0,g._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,g.__)("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 qa.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case qa.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case qa.ENTER:this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case qa.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case qa.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case qa.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,g.__)("Link selected.")));break;case qa.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,g.__)("Paste URL or type to search"),__experimentalRenderControl:l,value:i=""}=this.props,{loading:a,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:m,suggestionOptionIdPrefix:f}=this.state,h={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,g.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==d?`${f}-${d}`:void 0,ref:this.inputRef};return l?l(h,v,a):(0,s.createElement)(p.BaseControl,h,(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,g={id:d,ref:this.autocompleteRef,role:"listbox"},h=(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:g,buildSuggestionItemProps:h,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({},g,{className:c()("block-editor-url-input__suggestions",`${e}__suggestions`)}),l.map(((e,t)=>(0,s.createElement)(p.Button,i({},h(0,t),{key:e.id,className:c()("block-editor-url-input__suggestion",{"is-selected":t===a}),onClick:()=>this.handleOnClick(e)}),e.title))))):null}}var lk=(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(Hn);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(rk),ik=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,g.sprintf)(
86
  /* translators: %s: search term. */
87
- (0,g.__)("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)(ir,{className:"block-editor-link-control__search-item-icon",icon:ac}),(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},sk=(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"})),ak=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)(ir,{className:"block-editor-link-control__search-item-icon",icon:sk}),(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,Nd.filterURLForDisplay)((0,Nd.safeDecodeURI)(n.url))||""),l&&(0,g.__)("Press ENTER to add this link"))),u&&n.type&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-type"},function(e){return e.isFrontPage?"front page":"post_tag"===e.type?"tag":e.type}(n)))};const ck="__CREATE__",uk=[{id:"opensInNewTab",title:(0,g.__)("Open in new tab")}];function dk(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:l,buildSuggestionItemProps:a,suggestions:u,selectedSuggestion:d,isLoading:m,isInitialSuggestions:f,createSuggestionButtonText:h,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}`,S=f?(0,g.__)("Recently updated"):(0,g.sprintf)(
88
  /* translators: %s: search term. */
89
- (0,g.__)('Search results for "%s"'),o),w=(0,s.createElement)(f?s.Fragment:p.VisuallyHidden,{},(0,s.createElement)("span",{className:"block-editor-link-control__search-results-label",id:C},S));return(0,s.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},w,(0,s.createElement)("div",i({},l,{className:b,"aria-labelledby":C}),u.map(((e,t)=>y&&ck===e.type?(0,s.createElement)(ik,{searchTerm:o,buttonText:h,onClick:()=>r(e),key:e.type,itemProps:a(e,t),isSelected:t===d}):ck===e.type?null:(0,s.createElement)(ak,{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,isFrontPage:null==e?void 0:e.isFrontPage})))))}function pk(e){const t=(0,u.startsWith)(e,"#");return(0,Nd.isURL)(e)||e&&e.includes("www.")||t}const mk=()=>Promise.resolve([]),fk=e=>{let t="URL";const n=(0,Nd.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,Nd.prependHTTP)(e):e,type:t}])};const gk=()=>Promise.resolve([]),hk=(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:f=u.noop,onSelect:h=u.noop,showSuggestions:v=!0,renderSuggestions:b=(e=>(0,s.createElement)(dk,e)),fetchSuggestions:k=null,allowDirectEntry:_=!0,showInitialSuggestions:y=!1,suggestionsQuery:E={},withURLSuggestion:C=!0,createSuggestionButtonText:S,useLabel:w=!1}=e;const B=function(e,t,n,o){const{fetchSearchSuggestions:r,pageOnFront:l}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Hn);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?fk:mk;return(0,s.useCallback)(((t,s)=>{let{isInitialSuggestions:a}=s;return pk(t)?i(t,{isInitialSuggestions:a}):(async(e,t,n,o,r,l,i)=>{const{isInitialSuggestions:s}=t;let a=!1,c=await Promise.all([n(e,t),o(e)]);c[0]=c[0].map((e=>Number(e.id)===i?(a=!0,e.isFrontPage=!0,e):e));const u=!e.includes(" ");return c=!a&&u&&l&&!s?c[0].concat(c[1]):c[0],s||pk(e)||!r?c:c.concat({title:e,url:e,type:ck})})(t,{...e,isInitialSuggestions:a},r,i,n,o,l)}),[i,r,n])}(E,_,a,C),x=v?k||B:gk,I=(0,d.useInstanceId)(hk),[T,N]=(0,s.useState)(),P=async e=>{let t=e;if(ck!==e.type)(_||t&&Object.keys(t).length>=1)&&h({...(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&&h(t)}catch(e){}},M=c()(l,{"has-no-label":!w});return(0,s.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,s.createElement)(lk,{label:w?"URL":void 0,className:M,value:n,onChange:(e,t)=>{f(e),N(t)},placeholder:null!=i?i:(0,g.__)("Search or type url"),__experimentalRenderSuggestions:v?e=>b({...e,instanceId:I,withCreateSuggestion:a,currentInputValue:n,createSuggestionButtonText:S,suggestionsQuery:E,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),P(t)}}):null,__experimentalFetchLinkSuggestions:x,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:y,onSubmit:(e,t)=>{var o;const r=e||T;r||null!=n&&null!==(o=n.trim())&&void 0!==o&&o.length?P(r||{url:n}):t.preventDefault()},ref:t}),o)}));var vk=hk,bk=(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"})),kk=(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:_k,Fill:yk}=(0,p.createSlotFill)("BlockEditorLinkControlViewer");function Ek(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}`)}}function Ck(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}=function(e){const[t,n]=(0,s.useReducer)(Ek,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Hn);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}(a),f=u&&Object.keys(u).length,h=n&&(0,Nd.filterURLForDisplay)((0,Nd.safeDecodeURI)(n.url),16)||"",v=(null==u?void 0:u.title)||(null==n?void 0:n.title)||h,b=!(null!=n&&null!==(t=n.url)&&void 0!==t&&t.length);let k;return k=null!=u&&u.icon?(0,s.createElement)("img",{src:null==u?void 0:u.icon,alt:""}):b?(0,s.createElement)(ir,{icon:bk,size:32}):(0,s.createElement)(ir,{icon:sk}),(0,s.createElement)("div",{"aria-label":(0,g.__)("Currently selected"),"aria-selected":"true",className:c()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":f,"is-fetching":!!d,"is-preview":!0,"is-error":b})},(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})},k),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-details"},b?(0,s.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,g.__)("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)(v)),(null==n?void 0:n.url)&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-info"},h)))),(0,s.createElement)(p.Button,{icon:kk,label:(0,g.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),l&&(0,s.createElement)(p.Button,{icon:bf,label:(0,g.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:i,iconSize:24}),(0,s.createElement)(_k,{fillProps:n})),(f&&((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))))}function Sk(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=uk,onChange:a=u.noop,onRemove:d,noDirectEntry:m=!1,showSuggestions:f=!0,showInitialSuggestions:h,forceIsEditingLink:v,createSuggestion:b,withCreateSuggestion:k,inputValue:_="",suggestionsQuery:y={},noURLSuggestion:E=!1,createSuggestionButtonText:C,hasRichPreviews:S=!1,hasTextControl:w=!1,renderControlBottom:B=null}=e;void 0===k&&b&&(k=!0);const x=(0,s.useRef)(!0),I=(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=I.current)||void 0===e||!e.contains(I.current.ownerDocument.activeElement)),D(!1)}(0,s.useEffect)((()=>{void 0!==v&&v!==A&&D(v)}),[v]),(0,s.useEffect)((()=>{if(x.current)return void(x.current=!1);const e=null!=T&&T.current?1:0;(Rr.focus.focusable.find(I.current)[e]||I.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:G}=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=(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}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,g.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(b),U=()=>{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&&w;return(0,s.createElement)("div",{tabIndex:-1,ref:I,className:"block-editor-link-control"},H&&(0,s.createElement)("div",{className:"block-editor-link-control__loading"},(0,s.createElement)(p.Spinner,null)," ",(0,g.__)("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!==qa.ENTER||F||(e.preventDefault(),U())}}),(0,s.createElement)(vk,{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:h,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:U,label:(0,g.__)("Submit"),icon:nk,className:"block-editor-link-control__search-submit",disabled:F})))),G&&(0,s.createElement)(p.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},G)),l&&!A&&!H&&(0,s.createElement)(Ck,{key:null==l?void 0:l.url,value:l,onEditClick:()=>D(!0),hasRichPreviews:S,hasUnlinkControl:W,onRemove:d}),$&&(0,s.createElement)("div",{className:"block-editor-link-control__tools"},(0,s.createElement)(ok,{value:l,settings:i,onChange:a})),B&&B())}Sk.ViewerFill=yk;var wk=Sk,Bk=(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"})),xk=(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"})),Ik=(0,p.withFilters)("editor.MediaUpload")((()=>null)),Tk=function(e){let{fallback:t=null,children:n}=e;return(0,m.useSelect)((e=>{const{getSettings:t}=e(Hn);return!!t().mediaUpload}),[])?n:t},Nk=(0,d.compose)([(0,m.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(nd.store);return{createNotice:t,removeNotice:n}})),(0,p.withFilters)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:o,allowedTypes:r,accept:l,onError:i,onSelect:a,onSelectURL:c,onFilesUpload:d=u.noop,onCloseModal:f=u.noop,name:h=(0,g.__)("Replace"),createNotice:v,removeNotice:b,children:k,multiple:_=!1,addToGallery:y,handleUpload:E=!0}=e;const[C,S]=(0,s.useState)(t),w=(0,m.useSelect)((e=>e(Hn).getSettings().mediaUpload),[]),B=(0,s.useRef)(),x=(0,u.uniqueId)("block-editor/media-replace-flow/error-notice/"),I=e=>{const t=(0,Rr.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{v("error",t,{speak:!0,id:x,isDismissible:!0})}),1e3)},T=(e,t)=>{t(),S(null==e?void 0:e.url),a(e),(0,Mt.speak)((0,g.__)("The media file has been replaced")),b(x)},N=e=>{e.keyCode===qa.DOWN&&(e.preventDefault(),e.target.click())},P=_&&!(!r||0===r.length)&&r.every((e=>"image"===e||e.startsWith("image/")));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:B,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:N},h)},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)(Ik,{gallery:P,addToGallery:y,multiple:_,value:_?o:n,onSelect:e=>T(e,t),allowedTypes:r,onClose:f,render:e=>{let{open:t}=e;return(0,s.createElement)(p.MenuItem,{icon:Bk,onClick:t},(0,g.__)("Open Media Library"))}}),(0,s.createElement)(Tk,null,(0,s.createElement)(p.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!E)return t(),a(n);d(n),w({allowedTypes:r,filesList:n,onFileChange:e=>{let[n]=e;T(n,t)},onError:I})})(e,t)},accept:l,multiple:_,render:e=>{let{openFileDialog:t}=e;return(0,s.createElement)(p.MenuItem,{icon:xk,onClick:()=>{t()}},(0,g.__)("Upload"))}})),k),c&&(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,g.__)("Current media URL:")),(0,s.createElement)(wk,{value:{url:C},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;S(t),c(t),B.current.focus()}})))}})}));function Pk(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,Nd.filterURLForDisplay)((0,Nd.safeDecodeURI)(t))):(0,s.createElement)("span",{className:r})}function Mk(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:gp,label:(0,g.__)("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))}Mk.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeI
1
+ !function(){var e={6411:function(e,t){var n,o;void 0===(o="function"==typeof(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&&d()},s=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",s,!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",s,!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:s,update:d}),"vertical"===(a=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===a.resize&&(e.style.resize="horizontal"),t="content-box"===a.boxSizing?-(parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)):parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),isNaN(t)&&(t=0),d()}var a;function c(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 o=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+t+"px",n=e.clientWidth,o.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),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),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)})),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})?n.apply(t,[e,t]):n)||(e.exports=o)},4403:function(e,t){var n;!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 g=d&&d.newPos+1<a,h=m&&0<=f&&f<c;if(g||h){if(!g||h&&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 g=f();if(g)return g}},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=!(!p||!t.frameElement),f=o.offset(e),g=o.outerHeight(e),h=o.outerWidth(e),v=void 0,b=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0,S=void 0,w=void 0,B=void 0;m&&(t=t.document.scrollingElement||t.document.body),p||m?(C=t,B=o.height(C),w=o.width(C),S={left:o.scrollLeft(C),top:o.scrollTop(C)},y={left:f.left-S.left-c,top:f.top-S.top-a},E={left:f.left+h-(S.left+w)+d,top:f.top+g-(S.top+B)+u},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:f.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:f.left+h-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:f.top+g-(v.top+b+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||E.top>0?!0===i?o.scrollTop(t,_.top+y.top):!1===i?o.scrollTop(t,_.top+E.top):y.top<0?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top):l||((i=void 0===i||!!i)?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top)),r&&(y.left<0||E.left>0?!0===s?o.scrollLeft(t,_.left+y.left):!1===s?o.scrollLeft(t,_.left+E.left):y.left<0?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.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)$/,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;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function g(e){return null!=e&&e==e.window}var h={};function v(e,t,n){if(g(e))return"width"===t?h.viewportWidth(e):h.viewportHeight(e);if(9===e.nodeType)return"width"===t?h.docWidth(e):h.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){h["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],h["viewport"+e](n))},h["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);h["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];h[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=f(t,["padding","border"],n)),_(t,e,o)):void 0}})),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:g,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(g(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(g(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},h)},8575:function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,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="&nbsp;","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}},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,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 __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),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,g={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){g.isRoot||(g.parent.node[g.key]=e),g.node=e,t&&(f=!1)},delete:function(e){delete g.parent.node[g.key],e&&(f=!1)},remove:function(e){s(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.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 g;function h(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=l(g.node)),g.isLeaf=0==g.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){g.circular=i[e];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}h();var v=t.call(g,g.node);return void 0!==v&&g.update&&g.update(v),m.before&&m.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(i.push(g),h(),a(g.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(g,g.node[t],t);var l=e(g.node[t]);n&&c.call(g.node,t)&&(g.node[t]=l.node),l.isLast=r==g.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(g,l),o.pop()})),i.pop()),m.after&&m.after.call(g,g.node),g):g}(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("[object RegExp]"===i(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 wv},AlignmentToolbar:function(){return Bv},Autocomplete:function(){return Av},BlockAlignmentControl:function(){return zr},BlockAlignmentToolbar:function(){return Vr},BlockBreadcrumb:function(){return Vv},BlockColorsStyleSelector:function(){return $v},BlockContextProvider:function(){return tl},BlockControls:function(){return lo},BlockEdit:function(){return ll},BlockEditorKeyboardShortcuts:function(){return my},BlockEditorProvider:function(){return Mc},BlockFormatControls:function(){return ro},BlockIcon:function(){return Tc},BlockInspector:function(){return cy},BlockList:function(){return Cf},BlockMover:function(){return Hp},BlockNavigationDropdown:function(){return db},BlockPreview:function(){return od},BlockSelectionClearer:function(){return Ac},BlockSettingsMenu:function(){return Gm},BlockSettingsMenuControls:function(){return Fm},BlockStyles:function(){return gb},BlockTitle:function(){return Ip},BlockToolbar:function(){return Qm},BlockTools:function(){return uy},BlockVerticalAlignmentControl:function(){return ur},BlockVerticalAlignmentToolbar:function(){return dr},ButtonBlockAppender:function(){return hp},ButtonBlockerAppender:function(){return gp},ColorPalette:function(){return Mb},ColorPaletteControl:function(){return Rb},ContrastChecker:function(){return hg},CopyHandler:function(){return ym},DefaultBlockAppender:function(){return mp},FontSizePicker:function(){return rh},InnerBlocks:function(){return kf},Inserter:function(){return pp},InspectorAdvancedControls:function(){return zo},InspectorControls:function(){return Vo},JustifyContentControl:function(){return fr},JustifyToolbar:function(){return gr},LineHeightControl:function(){return Vg},MediaPlaceholder:function(){return l_},MediaReplaceFlow:function(){return e_},MediaUpload:function(){return Zk},MediaUploadCheck:function(){return Jk},MultiSelectScrollIntoView:function(){return fy},NavigableToolbar:function(){return Pp},ObserveTyping:function(){return by},PanelColorSettings:function(){return i_},PlainText:function(){return A_},RichText:function(){return M_},RichTextShortcut:function(){return F_},RichTextToolbarButton:function(){return z_},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return oy},ToolSelector:function(){return G_},Typewriter:function(){return Ey},URLInput:function(){return Tk},URLInputButton:function(){return j_},URLPopover:function(){return o_},Warning:function(){return sl},WritingFlow:function(){return qc},__experimentalBlockAlignmentMatrixControl:function(){return Fv},__experimentalBlockContentOverlay:function(){return Hv},__experimentalBlockFullHeightAligmentControl:function(){return Ov},__experimentalBlockPatternSetup:function(){return Ib},__experimentalBlockPatternsList:function(){return Bd},__experimentalBlockVariationPicker:function(){return vb},__experimentalBlockVariationTransforms:function(){return Nb},__experimentalBorderRadiusControl:function(){return Zf},__experimentalBorderStyleControl:function(){return rg},__experimentalColorGradientControl:function(){return Tf},__experimentalColorGradientSettingsDropdown:function(){return Nf},__experimentalDateFormatPicker:function(){return Db},__experimentalDuotoneControl:function(){return $h},__experimentalFontAppearanceControl:function(){return zg},__experimentalFontFamilyControl:function(){return Qg},__experimentalGetBorderClassesAndStyles:function(){return lv},__experimentalGetColorClassesAndStyles:function(){return sv},__experimentalGetGradientClass:function(){return dg},__experimentalGetGradientObjectByGradientValue:function(){return mg},__experimentalGetMatchingVariation:function(){return By},__experimentalGetSpacingClassesAndStyles:function(){return uv},__experimentalImageEditingProvider:function(){return dk},__experimentalImageEditor:function(){return yk},__experimentalImageSizeControl:function(){return Ck},__experimentalImageURLInputUI:function(){return ey},__experimentalLayoutStyle:function(){return Mr},__experimentalLetterSpacingControl:function(){return Bh},__experimentalLibrary:function(){return dy},__experimentalLinkControl:function(){return Yk},__experimentalLinkControlSearchInput:function(){return Hk},__experimentalLinkControlSearchItem:function(){return Mk},__experimentalLinkControlSearchResults:function(){return Ak},__experimentalListView:function(){return cb},__experimentalPanelColorGradientSettings:function(){return $b},__experimentalPreviewOptions:function(){return ty},__experimentalResponsiveBlockControl:function(){return O_},__experimentalTextDecorationControl:function(){return fh},__experimentalTextTransformControl:function(){return Eh},__experimentalToolsPanelColorDropdown:function(){return vg},__experimentalUnitControl:function(){return U_},__experimentalUseBlockPreview:function(){return rd},__experimentalUseBorderProps:function(){return iv},__experimentalUseColorProps:function(){return cv},__experimentalUseCustomSides:function(){return Zo},__experimentalUseGradient:function(){return gg},__experimentalUseNoRecursiveRenders:function(){return wy},__experimentalUseResizeCanvas:function(){return ny},__unstableBlockNameContext:function(){return Ym},__unstableBlockSettingsMenuFirstItem:function(){return Im},__unstableBlockToolbarLastItem:function(){return gm},__unstableEditorStyles:function(){return Ju},__unstableIframe:function(){return Xc},__unstableInserterMenuExtension:function(){return tp},__unstableRichTextInputEvent:function(){return V_},__unstableUseBlockSelectionClearer:function(){return Lc},__unstableUseClipboardHandler:function(){return _m},__unstableUseMouseMoveTypingReset:function(){return hy},__unstableUseTypewriter:function(){return yy},__unstableUseTypingObserver:function(){return vy},createCustomColorsHOC:function(){return gv},getColorClassName:function(){return Af},getColorObjectByAttributeValues:function(){return Rf},getColorObjectByColorValue:function(){return Lf},getFontSize:function(){return th},getFontSizeClass:function(){return oh},getFontSizeObjectByValue:function(){return nh},getGradientSlugByValue:function(){return fg},getGradientValueBySlug:function(){return pg},getPxFromCssUnit:function(){return Dy},store:function(){return Yn},storeConfig:function(){return qn},transformStyles:function(){return Qu},useBlockDisplayInformation:function(){return wp},useBlockEditContext:function(){return Jn},useBlockProps:function(){return bc},useCachedTruthy:function(){return dv},useInnerBlocksProps:function(){return bf},useSetting:function(){return xo},withColorContext:function(){return Pb},withColors:function(){return hv},withFontSizes:function(){return bv}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return Dt},__experimentalGetAllowedBlocks:function(){return ht},__experimentalGetAllowedPatterns:function(){return _t},__experimentalGetBlockListSettingsForBlocks:function(){return Bt},__experimentalGetDirectInsertBlock:function(){return vt},__experimentalGetGlobalBlocksByName:function(){return J},__experimentalGetLastBlockAttributeChanges:function(){return Tt},__experimentalGetParsedPattern:function(){return bt},__experimentalGetPatternTransformItems:function(){return Et},__experimentalGetPatternsByBlockTypes:function(){return yt},__experimentalGetReusableBlockTitle:function(){return It},__unstableGetBlockWithoutInnerBlocks:function(){return j},__unstableGetClientIdWithClientIdsTree:function(){return q},__unstableGetClientIdsTree:function(){return Y},__unstableGetSelectedBlocksWithPartialSelection:function(){return Pe},__unstableIsFullySelected:function(){return Te},__unstableIsLastBlockChangeIgnored:function(){return xt},__unstableIsSelectionMergeable:function(){return Ne},areInnerBlocksControlled:function(){return At},canEditBlock:function(){return it},canInsertBlockType:function(){return et},canInsertBlocks:function(){return tt},canLockBlockType:function(){return st},canMoveBlock:function(){return rt},canMoveBlocks:function(){return lt},canRemoveBlock:function(){return nt},canRemoveBlocks:function(){return ot},didAutomaticChange:function(){return Rt},getAdjacentBlockClientId:function(){return ge},getBlock:function(){return $},getBlockAttributes:function(){return W},getBlockCount:function(){return te},getBlockHierarchyRootClientId:function(){return me},getBlockIndex:function(){return Re},getBlockInsertionPoint:function(){return Ke},getBlockListSettings:function(){return Ct},getBlockMode:function(){return Ve},getBlockName:function(){return G},getBlockOrder:function(){return Me},getBlockParents:function(){return de},getBlockParentsByBlockName:function(){return pe},getBlockRootClientId:function(){return ue},getBlockSelectionEnd:function(){return le},getBlockSelectionStart:function(){return re},getBlockTransformItems:function(){return ft},getBlocks:function(){return K},getBlocksByClientId:function(){return ee},getClientIdsOfDescendants:function(){return Q},getClientIdsWithDescendants:function(){return X},getDraggedBlockClientIds:function(){return Ue},getFirstMultiSelectedBlockClientId:function(){return Ee},getGlobalBlockCount:function(){return Z},getInserterItems:function(){return mt},getLastMultiSelectedBlockClientId:function(){return Ce},getLowestCommonAncestorWithSelectedBlock:function(){return fe},getMultiSelectedBlockClientIds:function(){return _e},getMultiSelectedBlocks:function(){return ye},getMultiSelectedBlocksEndClientId:function(){return xe},getMultiSelectedBlocksStartClientId:function(){return Ie},getNextBlockClientId:function(){return ve},getPreviousBlockClientId:function(){return he},getSelectedBlock:function(){return ce},getSelectedBlockClientId:function(){return ae},getSelectedBlockClientIds:function(){return ke},getSelectedBlockCount:function(){return ie},getSelectedBlocksInitialCaretPosition:function(){return be},getSelectionEnd:function(){return oe},getSelectionStart:function(){return ne},getSettings:function(){return St},getTemplate:function(){return Qe},getTemplateLock:function(){return Xe},hasBlockMovingClientId:function(){return Mt},hasInserterItems:function(){return gt},hasMultiSelection:function(){return Oe},hasSelectedBlock:function(){return se},hasSelectedInnerBlock:function(){return Ae},isAncestorBeingDragged:function(){return $e},isAncestorMultiSelected:function(){return Be},isBlockBeingDragged:function(){return We},isBlockHighlighted:function(){return Lt},isBlockInsertionPointVisible:function(){return qe},isBlockMultiSelected:function(){return we},isBlockSelected:function(){return Le},isBlockValid:function(){return U},isBlockWithinSelection:function(){return De},isCaretWithinFormattedText:function(){return je},isDraggingBlocks:function(){return Ge},isFirstMultiSelectedBlock:function(){return Se},isLastBlockChangePersistent:function(){return wt},isMultiSelecting:function(){return Fe},isNavigationMode:function(){return Pt},isSelectionEnabled:function(){return ze},isTyping:function(){return He},isValidTemplate:function(){return Ye},wasBlockJustInserted:function(){return Ot}});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:function(){return hn},__unstableExpandSelection:function(){return bn},__unstableMarkAutomaticChange:function(){return Fn},__unstableMarkLastChangeAsPersistent:function(){return Dn},__unstableMarkNextChangeAsNotPersistent:function(){return On},__unstableSaveReusableBlock:function(){return An},__unstableSplitSelection:function(){return vn},clearSelectedBlock:function(){return Jt},duplicateBlocks:function(){return Hn},enterFormattedText:function(){return Tn},exitFormattedText:function(){return Nn},flashBlock:function(){return $n},hideInsertionPoint:function(){return mn},insertAfterBlock:function(){return Un},insertBeforeBlock:function(){return Gn},insertBlock:function(){return un},insertBlocks:function(){return dn},insertDefaultBlock:function(){return Mn},mergeBlocks:function(){return kn},moveBlockToPosition:function(){return cn},moveBlocksDown:function(){return ln},moveBlocksToPosition:function(){return an},moveBlocksUp:function(){return sn},multiSelect:function(){return Zt},receiveBlocks:function(){return Wt},removeBlock:function(){return En},removeBlocks:function(){return yn},replaceBlock:function(){return on},replaceBlocks:function(){return nn},replaceInnerBlocks:function(){return Cn},resetBlocks:function(){return Ht},resetSelection:function(){return Ut},selectBlock:function(){return Kt},selectNextBlock:function(){return Yt},selectPreviousBlock:function(){return qt},selectionChange:function(){return Pn},setBlockMovingClientId:function(){return Vn},setHasControlledInnerBlocks:function(){return jn},setNavigationMode:function(){return zn},setTemplateValidity:function(){return fn},showInsertionPoint:function(){return pn},startDraggingBlocks:function(){return In},startMultiSelect:function(){return Qt},startTyping:function(){return wn},stopDraggingBlocks:function(){return xn},stopMultiSelect:function(){return Xt},stopTyping:function(){return Bn},synchronizeTemplate:function(){return gn},toggleBlockHighlight:function(){return Wn},toggleBlockMode:function(){return Sn},toggleSelection:function(){return en},updateBlock:function(){return jt},updateBlockAttributes:function(){return $t},updateBlockListSettings:function(){return Rn},updateSettings:function(){return Ln},validateBlocksToTemplate:function(){return Gt}});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}).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,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")},g=window.wp.i18n;const h={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,g.__)("Black"),slug:"black",color:"#000000"},{name:(0,g.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,g.__)("White"),slug:"white",color:"#ffffff"},{name:(0,g.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,g.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,g.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,g.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,g.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,g.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,g.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,g.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,g.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,g._x)("Small","font size name"),size:13,slug:"small"},{name:(0,g._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,g._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,g._x)("Large","font size name"),size:36,slug:"large"},{name:(0,g._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,g.__)("Thumbnail")},{slug:"medium",name:(0,g.__)("Medium")},{slug:"large",name:(0,g.__)("Large")},{slug:"full",name:(0,g.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__unstableGalleryWithImageBlocks:!1,generateAnchors:!1,gradients:[{name:(0,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,g.__)("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,g.__)("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,g.__)("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,g.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,g.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};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 S(e){return E(e,(e=>e.attributes))}function w(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:S(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:!w(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,...S(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),...S(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,n,o;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"SELECTION_CHANGE":return l.clientId?{selectionStart:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.startOffset},selectionEnd:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.endOffset}}:{selectionStart:l.start||r.selectionStart,selectionEnd:l.end||r.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:s}=l;return{selectionStart:i,selectionEnd:s};case"MULTI_SELECT":const{start:a,end:c}=l;return a===(null===(e=r.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=r.selectionEnd)||void 0===t?void 0:t.clientId)?r:{selectionStart:{clientId:a},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==r||null===(n=r.selectionStart)||void 0===n?void 0:n.clientId,d=null==r||null===(o=r.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return r;if(!l.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!l.blocks.some((e=>e.clientId===d)))return{...r,selectionEnd:r.selectionStart}}return{selectionStart:T(r.selectionStart,l),selectionEnd:T(r.selectionEnd,l)}},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||["MULTI_SELECT","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;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]:v,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]:h,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":return n.blocks.length?{clientId:n.blocks[0].clientId,source:null===(e=n.meta)||void 0===e?void 0:e.source}:t;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(!(i=o=e[t])||"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,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"})),z=window.wp.richText;function V(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const H=[];function G(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 U(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function W(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function $(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const j=D(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:W(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function K(e,t){var n;const o=t&&At(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||H}const q=D(((e,t)=>({clientId:t,innerBlocks:Y(e,t)})),(e=>[e.blocks.order])),Y=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Me(e,t),(t=>q(e,t)))}),(e=>[e.blocks.order])),Q=D(((e,t)=>{const n=[];for(const o of t)for(const t of Me(e,o))n.push(t,...Q(e,[t]));return n}),(e=>[e.blocks.order])),X=D((e=>{const t=[];for(const n of Me(e))t.push(n,...Q(e,[n]));return t}),(e=>[e.blocks.order])),Z=D(((e,t)=>{const n=X(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])),J=D(((e,t)=>{if(!t)return H;const n=X(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:H}),(e=>[e.blocks.order,e.blocks.byClientId])),ee=D(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>$(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function te(e,t){return Me(e,t).length}function ne(e){return e.selection.selectionStart}function oe(e){return e.selection.selectionEnd}function re(e){return e.selection.selectionStart.clientId}function le(e){return e.selection.selectionEnd.clientId}function ie(e){return _e(e).length||(e.selection.selectionStart.clientId?1:0)}function se(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ae(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ce(e){const t=ae(e);return t?$(e,t):null}function ue(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const de=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])),pe=D((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=de(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:G(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 me(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function fe(e,t){const n=ae(e),o=[...de(e,t),t],r=[...de(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 ge(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ae(e)),void 0===t&&(t=n<0?Ee(e):Ce(e)),!t)return null;const o=ue(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 he(e,t){return ge(e,t,-1)}function ve(e,t){return ge(e,t,1)}function be(e){return e.initialPosition}const ke=D((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return H;if(t.clientId===n.clientId)return[t.clientId];const o=ue(e,t.clientId);if(null===o)return H;const r=Me(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 _e(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?H:ke(e)}const ye=D((e=>{const t=_e(e);return t.length?t.map((t=>$(e,t))):H}),(e=>[...ke.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ee(e){return(0,u.first)(_e(e))||null}function Ce(e){return(0,u.last)(_e(e))||null}function Se(e,t){return Ee(e)===t}function we(e,t){return-1!==_e(e).indexOf(t)}const Be=D(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=ue(e,n),o=we(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Ie(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function xe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Te(e){const t=ne(e),n=oe(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Ne(e,t){const n=ne(e),o=oe(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const l=ue(e,n.clientId);if(l!==ue(e,o.clientId))return!1;const i=Me(e,l);let s,a;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(s=o,a=n):(s=n,a=o);const c=t?a.clientId:s.clientId,u=t?s.clientId:a.clientId,d=$(e,c);if(!(0,r.getBlockType)(d.name).merge)return!1;const p=$(e,u);if(p.name===d.name)return!0;const m=(0,r.switchToBlockType)(p,d.name);return m&&m.length}const Pe=e=>{const t=ne(e),n=oe(e);if(t.clientId===n.clientId)return H;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return H;const o=ue(e,t.clientId);if(o!==ue(e,n.clientId))return H;const l=Me(e,o),i=l.indexOf(t.clientId),s=l.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=$(e,a.clientId),d=(0,r.getBlockType)(u.name),p=$(e,c.clientId),m=(0,r.getBlockType)(p.name),f=u.attributes[a.attributeKey],g=p.attributes[c.attributeKey],h=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,z.create)({html:f,...V(h)}),k=(0,z.create)({html:g,...V(v)});return b=(0,z.remove)(b,0,a.offset),k=(0,z.remove)(k,c.offset,k.text.length),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,z.toHTMLString)({value:b,...V(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,z.toHTMLString)({value:k,...V(v)})}}]};function Me(e,t){return e.blocks.order[t||""]||H}function Re(e,t){return Me(e,ue(e,t)).indexOf(t)}function Le(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Ae(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Me(e,t),(t=>Le(e,t)||we(e,t)||n&&Ae(e,t,n)))}function De(e,t){if(!t)return!1;const n=_e(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 Fe(e){return e.isMultiSelecting}function ze(e){return e.isSelectionEnabled}function Ve(e,t){return e.blocksMode[t]||"visual"}function He(e){return e.isTyping}function Ge(e){return!!e.draggedBlocks.length}function Ue(e){return e.draggedBlocks}function We(e,t){return e.draggedBlocks.includes(t)}function $e(e,t){if(!Ge(e))return!1;const n=de(e,t);return(0,u.some)(n,(t=>We(e,t)))}function je(e){return e.isCaretWithinFormattedText}function Ke(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=ue(e,l)||void 0,n=Re(e,r.clientId)+1):n=Me(e).length,{rootClientId:t,index:n}}function qe(e){return null!==e.insertionPoint}function Ye(e){return e.template.isValid}function Qe(e){return e.settings.template}function Xe(e,t){if(!t)return e.settings.templateLock;const n=Ct(e,t);return n?n.templateLock:null}const Ze=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},Je=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}=St(e),s=Ze(i,t,!0);if(!s)return!1;const a=!!Xe(e,o);if(a)return!1;const c=Ct(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=Ze(d,t),m=n.parent,f=G(e,o),g=Ze(m,f);let h=!0;const v=n.ancestor;if(v){const t=[o,...de(e,o)];h=(0,u.some)(t,(t=>Ze(v,G(e,t))))}const b=h&&(null===p&&null===g||!0===p||!0===g);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:$.bind(null,e),getBlockParentsByBlockName:pe.bind(null,e)}):b},et=D(Je,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function tt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>et(e,G(e,t),n)))}function nt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=W(e,t);if(null===o)return!0;const{lock:r}=o,l=!!Xe(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function ot(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>nt(e,t,n)))}function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=W(e,t);if(null===o)return;const{lock:r}=o,l="all"===Xe(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>rt(e,t,n)))}function it(e,t){const n=W(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function st(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function at(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 ct=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&Je(e,t.name,n),ut=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=at(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:dt(r,l)}},dt=(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}},pt=(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)(ee(e,X(e)),{name:t.name}));const{time:i,count:s=0}=at(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:dt(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}}},mt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=pt(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}=at(e,l)||{},c=dt(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=>ct(e,n,t))).map(n),a=Je(e,"core/block",t)?Nt(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=ut(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,Nt(e),(0,r.getBlockTypes)()])),ft=D((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const[l]=t,i=pt(e,{buildScope:"transform"}),s=(0,r.getBlockTypes)().filter((t=>ct(e,t,o))).map(i),a=(0,u.mapKeys)(s,(e=>{let{name:t}=e;return t}));a["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,g.__)("Unwrap"),icon:null===(n=a[l.name])||void 0===n?void 0:n.icon};const c=(0,r.getPossibleBlockTransformations)(t).reduce(((e,t)=>("*"===t?e.push(a["*"]):a[null==t?void 0:t.name]&&e.push(a[t.name]),e)),[]);return(0,u.orderBy)(c,(e=>a[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),gt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>ct(e,n,t)));if(n)return!0;const o=Je(e,"core/block",t)&&Nt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Nt(e),(0,r.getBlockTypes)()])),ht=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=>ct(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),vt=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($(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),bt=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,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),kt=D((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=St(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return bt(e,n)})).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(!Ze(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])),_t=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=kt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return et(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),yt=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return H;const o=_t(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)=>[..._t.getDependants(e,t)])),Et=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return H;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||At(e,n)})))return H;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return yt(e,o,n)}),((e,t)=>[...yt.getDependants(e,t)]));function Ct(e,t){return e.blockListSettings[t]}function St(e){return e.settings}function wt(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])),It=D(((e,t)=>{var n;const o=(0,u.find)(Nt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Nt(e)]));function xt(e){return e.blocks.isIgnoredChange}function Tt(e){return e.lastBlockAttributesChange}function Nt(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:H}function Pt(e){return e.isNavigationMode}function Mt(e){return e.hasBlockMovingClientId}function Rt(e){return!!e.automaticChangeStatus}function Lt(e,t){return e.highlightedBlock===t}function At(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Dt=D(((e,t)=>{if(!t.length)return null;const n=ae(e);if(t.includes(G(e,n)))return n;const o=_e(e),r=pe(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Ot(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Ft=window.wp.a11y,zt=window.wp.deprecated,Vt=n.n(zt);const Ht=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Gt(e))},Gt=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 Ut(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Wt(e){return Vt()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function $t(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 jt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Kt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const qt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Yt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Qt(){return{type:"START_MULTI_SELECT"}}function Xt(){return{type:"STOP_MULTI_SELECT"}}const Zt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:r,dispatch:l}=o;if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;l({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,Ft.speak)((0,g.sprintf)(
2
  /* translators: %s: number of selected blocks */
3
+ (0,g._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function Jt(){return{type:"CLEAR_SELECTED_BLOCK"}}function en(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function tn(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 nn=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=tn((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 on(e,t){return nn(e,t)}const rn=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},ln=rn("MOVE_BLOCKS_DOWN"),sn=rn("MOVE_BLOCKS_UP"),an=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 cn(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 an([e],t,n,o)}function un(e,t,n,o,r){return dn([e],t,n,o,0,r)}const dn=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,Vt()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=tn((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 pn(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 mn(){return{type:"HIDE_INSERTION_POINT"}}function fn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const gn=()=>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)},hn=e=>t=>{let{registry:n,select:o,dispatch:l}=t;const i=o.getSelectionStart(),s=o.getSelectionEnd();if(i.clientId===s.clientId)return;if(!i.attributeKey||!s.attributeKey||void 0===i.offset||void 0===s.offset)return!1;const a=o.getBlockRootClientId(i.clientId);if(a!==o.getBlockRootClientId(s.clientId))return;const c=o.getBlockOrder(a);let d,p;c.indexOf(i.clientId)>c.indexOf(s.clientId)?(d=s,p=i):(d=i,p=s);const m=e?p:d,f=o.getBlock(m.clientId),g=(0,r.getBlockType)(f.name);if(!g.merge)return;const h=d,v=p,b=o.getBlock(h.clientId),k=(0,r.getBlockType)(b.name),_=o.getBlock(v.clientId),y=(0,r.getBlockType)(_.name),E=b.attributes[h.attributeKey],C=_.attributes[v.attributeKey],S=k.attributes[h.attributeKey],w=y.attributes[v.attributeKey];let B=(0,z.create)({html:E,...V(S)}),I=(0,z.create)({html:C,...V(w)});B=(0,z.remove)(B,h.offset,B.text.length),I=(0,z.insert)(I,"†",0,v.offset);const x=(0,r.cloneBlock)(b,{[h.attributeKey]:(0,z.toHTMLString)({value:B,...V(S)})}),T=(0,r.cloneBlock)(_,{[v.attributeKey]:(0,z.toHTMLString)({value:I,...V(w)})}),N=e?x:T,P=b.name===_.name?[N]:(0,r.switchToBlockType)(N,g.name);if(!P||!P.length)return;let M;if(e){const e=P.pop();M=g.merge(e.attributes,T.attributes)}else{const e=P.shift();M=g.merge(x.attributes,e.attributes)}const R=(0,u.findKey)(M,(e=>"string"==typeof e&&-1!==e.indexOf("†"))),L=M[R],A=(0,z.create)({html:L,...V(g.attributes[R])}),D=A.text.indexOf("†"),O=(0,z.remove)(A,D,D+1),F=(0,z.toHTMLString)({value:O,...V(g.attributes[R])});M[R]=F;const H=o.getSelectedBlockClientIds(),G=[...e?P:[],{...f,attributes:{...f.attributes,...M}},...e?[]:P];n.batch((()=>{l.selectionChange(f.clientId,R,D,D),l.replaceBlocks(H,G,0,o.getSelectedBlocksInitialCaretPosition())}))},vn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),l=t.getSelectionEnd();if(o.clientId===l.clientId)return;if(!o.attributeKey||!l.attributeKey||void 0===o.offset||void 0===l.offset)return;const i=t.getBlockRootClientId(o.clientId);if(i!==t.getBlockRootClientId(l.clientId))return;const s=t.getBlockOrder(i);let a,c;s.indexOf(o.clientId)>s.indexOf(l.clientId)?(a=l,c=o):(a=o,c=l);const u=a,d=c,p=t.getBlock(u.clientId),m=(0,r.getBlockType)(p.name),f=t.getBlock(d.clientId),g=(0,r.getBlockType)(f.name),h=p.attributes[u.attributeKey],v=f.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=g.attributes[d.attributeKey];let _=(0,z.create)({html:h,...V(b)}),y=(0,z.create)({html:v,...V(k)});_=(0,z.remove)(_,u.offset,_.text.length),y=(0,z.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,z.toHTMLString)({value:_,...V(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...f,attributes:{...f.attributes,[d.attributeKey]:(0,z.toHTMLString)({value:y,...V(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},bn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},kn=(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:g,offset:h}=o.getSelectionStart(),v=(f===s?d:m).attributes[g],b=(f===s||f===a)&&void 0!==g&&void 0!==h&&!!v;v||("number"==typeof g?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 g):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[g],n=(0,z.insert)((0,z.create)({html:t,...V(v)}),"†",h,h);e.attributes[g]=(0,z.toHTMLString)({value:n,...V(v)})}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],n=(0,z.create)({html:t,...V(d.attributes[e])}),o=n.text.indexOf("†"),r=(0,z.remove)(n,o,o+1),i=(0,z.toHTMLString)({value:r,...V(d.attributes[e])});E[e]=i,l.selectionChange(c.clientId,e,o,o)}l.replaceBlocks([c.clientId,p.clientId],[{...c,attributes:{...c.attributes,...E}},...y.slice(1)],0)},yn=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 En(e,t){return yn([e],t)}function Cn(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 Sn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function wn(){return{type:"START_TYPING"}}function Bn(){return{type:"STOP_TYPING"}}function In(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function xn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Tn(){return{type:"ENTER_FORMATTED_TEXT"}}function Nn(){return{type:"EXIT_FORMATTED_TEXT"}}function Pn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Mn=(e,t,n)=>o=>{let{dispatch:l}=o;const i=(0,r.getDefaultBlockName)();if(!i)return;const s=(0,r.createBlock)(i,e);return l.insertBlock(s,n,t)};function Rn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Ln(e){return{type:"UPDATE_SETTINGS",settings:e}}function An(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Dn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function On(){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"})}))},zn=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,Ft.speak)((0,g.__)("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,Ft.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Vn=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,Ft.speak)((0,g.__)("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."))}},Hn=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;if(i.map((e=>e.name)).some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),a=o.getBlockIndex((0,u.last)((0,u.castArray)(e))),c=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(c,a+1,s,t),c.length>1&&t&&l.multiSelect((0,u.first)(c).clientId,(0,u.last)(c).clientId),c.map((e=>e.clientId))}},Gn=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)},Un=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 Wn(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const $n=e=>async t=>{let{dispatch:n}=t;n(Wn(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Wn(e,!1))};function jn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const Kn="core/block-editor",qn={reducer:M,selectors:e,actions:t},Yn=(0,m.createReduxStore)(Kn,{...qn,persist:["preferences"]});(0,m.registerStore)(Kn,{...qn,persist:["preferences"]});const Qn={name:"",isSelected:!1},Xn=(0,s.createContext)(Qn),{Provider:Zn}=Xn;function Jn(){return(0,s.useContext)(Xn)}function eo(){const{isSelected:e,clientId:t,name:n}=Jn();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(Yn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function to(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=eo(),{clientId:o}=Jn(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(Yn),{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 no(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 oo=to;oo.Slot=no;const ro=e=>(0,s.createElement)(to,i({group:"inline"},e));ro.Slot=e=>(0,s.createElement)(no,i({group:"inline"},e));var lo=oo,io=(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"})),so=(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"})),ao=(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"})),co=(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"})),uo=(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"})),po=(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"})),mo=(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"})),fo=(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"})),go=(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"})),ho=(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"})),vo=(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"})),bo=(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 ko(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const _o=(0,s.createContext)({refs:new Map,callbacks:new Map});function yo(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(_o.Provider,{value:n},t)}function Eo(e){const{refs:t,callbacks:n}=(0,s.useContext)(_o),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 Co(e){const{refs:t}=(0,s.useContext)(_o),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 So(e){const{callbacks:t}=(0,s.useContext)(_o),n=Co(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}const wo=["color","border","typography","spacing"],Bo={"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},Io={"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 xo(e){const{name:t}=Jn();return(0,m.useSelect)((n=>{var o;if(wo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(Yn).getSettings(),i=(e=>Io[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=Bo[i]?Bo[i](l):void 0;return void 0!==m?m:"typography.dropCap"===i||void 0}),[t,e])}window.wp.warning;var To={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),border:(0,p.createSlotFill)("InspectorControlsBorder"),color:(0,p.createSlotFill)("InspectorControlsColor"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function No(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=eo(),l=null===(t=To[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 Po=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,Po),u.identity);return(0,u.isEmpty)(t)?void 0:t};function Mo(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function Ro(e,t,n,o,r,l){var i;if((0,u.every)(e,(e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var a;s=null===(a=o[r])||void 0===a?void 0:a.attributes}let c=n;return(0,u.forEach)(e,((e,n)=>{e&&t[n].forEach((e=>{const t=(0,u.get)(s,e);t&&(c={...c,attributes:Mo(c.attributes,e,t)})}))})),c}function Lo(e,t,n){const o=(0,r.getBlockSupport)(e,t),l=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(l)?l.includes(n):l}function Ao(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(Yn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(Yn),u=a(),d=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=c()?i():[u];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:Po(r.style)},t[n]=r})),r(n,t,!0)}),[Po,l,i,c,u,r]);return(0,s.createElement)(p.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Do(e){let{Slot:t,...n}=e;const o=(0,s.useContext)(p.__experimentalToolsPanelContext);return(0,s.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function Oo(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=To[n])||void 0===t?void 0:t.Slot,a=(0,p.__experimentalUseSlot)(null==l?void 0:l.__unstableName);return l&&a?Boolean(a.fills&&a.fills.length)?o?(0,s.createElement)(Ao,{group:n,label:o},(0,s.createElement)(Do,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const Fo=No;Fo.Slot=Oo;const zo=e=>(0,s.createElement)(No,i({},e,{__experimentalGroup:"advanced"}));zo.Slot=e=>(0,s.createElement)(Oo,i({},e,{__experimentalGroup:"advanced"})),zo.slotName="InspectorAdvancedControls";var Vo=Fo;function Ho(e){const t=(0,r.getBlockSupport)(e,Ko);return!!(!0===t||null!=t&&t.margin)}function Go(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!xo("spacing.margin"),n=!Jo(e,"margin");return!Ho(e)||t||n}function Uo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:xo("spacing.units")||["%","px","em","rem","vw"]}),i=Zo(n,"margin"),a=i&&i.some((e=>Yo.includes(e)));return Go(e)?null: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:Po(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:Po(t)})},label:(0,g.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Wo(e){const t=(0,r.getBlockSupport)(e,Ko);return!!(!0===t||null!=t&&t.padding)}function $o(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!xo("spacing.padding"),n=!Jo(e,"padding");return!Wo(e)||t||n}function jo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:xo("spacing.units")||["%","px","em","rem","vw"]}),i=Zo(n,"padding"),a=i&&i.some((e=>Yo.includes(e)));return $o(e)?null: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:Po(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:Po(t)})},label:(0,g.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const Ko="spacing",qo=["top","right","bottom","left"],Yo=["vertical","horizontal"];function Qo(e){const t=nr(e),n=$o(e),o=Go(e),l=Xo(e),i=(a=e.name,"web"===s.Platform.OS&&(er(a)||Wo(a)||Ho(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[Ko,"__experimentalDefaultControls"]),u=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)(Vo,{__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,g.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Po({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:u("padding"),isShownByDefault:null==c?void 0:c.padding,panelId:e.clientId},(0,s.createElement)(jo,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,g.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Po({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:u("margin"),isShownByDefault:null==c?void 0:c.margin,panelId:e.clientId},(0,s.createElement)(Uo,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,g.__)("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:u("blockGap"),isShownByDefault:null==c?void 0:c.blockGap,panelId:e.clientId},(0,s.createElement)(or,e)))}const Xo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=nr(e),n=$o(e),o=Go(e);return t&&n&&o};function Zo(e,t){const n=(0,r.getBlockSupport)(e,Ko);if(n&&"boolean"!=typeof n[t])return n[t]}function Jo(e,t){const n=Zo(e,t);return!(n&&n.some((e=>qo.includes(e)))&&n.some((e=>Yo.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function er(e){const t=(0,r.getBlockSupport)(e,Ko);return!!(!0===t||null!=t&&t.blockGap)}function tr(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:null==e?void 0:e.top,left:t?e:null==e?void 0:e.left}}function nr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!xo("spacing.blockGap");return!er(e)||t}function or(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=(0,p.__experimentalUseCustomUnits)({availableUnits:xo("spacing.units")||["%","px","em","rem","vw"]}),a=Zo(r,"blockGap"),c=Co(n);if(nr(e))return null;const u=a&&a.some((e=>Yo.includes(e))),d=e=>{var t;let n=e;e&&u&&(n={...tr(e)});const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:Po(r)});const i=(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;c.current&&i&&(null===(s=c.current.parentNode)||void 0===s||s.replaceChild(c.current,c.current))},m=tr(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),f=u?{...m,right:null==m?void 0:m.left,bottom:null==m?void 0:m.top}:null==m?void 0:m.top;return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,u?(0,s.createElement)(p.__experimentalBoxControl,{label:(0,g.__)("Block spacing"),min:0,onChange:d,units:i,sides:a,values:f,allowReset:!1,splitOnAxis:u}):(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:d,units:i,value:f})),native:null})}const rr=(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"})),lr=(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"})),ir={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,g._x)("Align top","Block vertical alignment setting")},center:{icon:lr,title:(0,g._x)("Align middle","Block vertical alignment setting")},bottom:{icon:rr,title:(0,g._x)("Align bottom","Block vertical alignment setting")}},sr=["top","center","bottom"],ar={isAlternate:!0};var cr=function(e){let{value:t,onChange:n,controls:o=sr,isCollapsed:r=!0,isToolbar:l}=e;const a=ir[t],c=ir.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:ar,icon:a?a.icon:c.icon,label:(0,g._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...ir[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};const ur=e=>(0,s.createElement)(cr,i({},e,{isToolbar:!1})),dr=e=>(0,s.createElement)(cr,i({},e,{isToolbar:!0})),pr={left:mo,center:fo,right:go,"space-between":ho};var mr=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?pr[r]:pr.left,d=[{name:"left",icon:mo,title:(0,g.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:fo,title:(0,g.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:go,title:(0,g.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:ho,title:(0,g.__)("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,g.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};const fr=e=>(0,s.createElement)(mr,i({},e,{isToolbar:!1})),gr=e=>(0,s.createElement)(mr,i({},e,{isToolbar:!0})),hr={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},vr={left:"flex-start",right:"flex-end",center:"center"},br={top:"flex-start",center:"center",bottom:"flex-end"},kr=["wrap","nowrap"];var _r={name:"flex",label:(0,g.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Flex,null,(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Er,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,r&&(0,s.createElement)(Sr,{layout:t,onChange:n}))),(0,s.createElement)(Cr,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;if(null!=o&&o.allowSwitching)return null;const{allowVerticalAlignment:r=!0}=o;return(0,s.createElement)(lo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Er,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(yr,{layout:t,onChange:n,isToolbar:!0}))},save:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i}=e;const{orientation:a="horizontal"}=r,c=null!==xo("spacing.blockGap"),u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!Lo(i,"spacing","blockGap")?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=tr(e);if(!n)return null;const o=(null==n?void 0:n.top)||t,r=(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):"var( --wp--style--block-gap, 0.5em )",d=hr[r.justifyContent]||hr.left,p=kr.includes(r.flexWrap)?r.flexWrap:"wrap",m=`\n\t\tflex-direction: row;\n\t\talign-items: ${br[r.verticalAlignment]||br.center};\n\t\tjustify-content: ${d};\n\t\t`,f=`\n\t\tflex-direction: column;\n\t\talign-items: ${vr[r.justifyContent]||vr.left};\n\t\t`;return(0,s.createElement)("style",null,`\n\t\t\t\t${ko(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-wrap: ${p};\n\t\t\t\t\tgap: ${c?u:"0.5em"};\n\t\t\t\t\t${"horizontal"===a?m:f}\n\t\t\t\t}\n\n\t\t\t\t${ko(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 yr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=br.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(ur,{onChange:l,value:r});const i=[{value:"flex-start",label:(0,g.__)("Align items top")},{value:"center",label:(0,g.__)("Align items center")},{value:"flex-end",label:(0,g.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,g.__)("Vertical alignment")),(0,s.createElement)("div",null,i.map(((e,t,n)=>(0,s.createElement)(p.Button,{key:e,label:n,icon:t,isPressed:r===e,onClick:()=>l(e)})))))}function Er(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)(fr,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:mo,label:(0,g.__)("Justify items left")},{value:"center",icon:fo,label:(0,g.__)("Justify items center")},{value:"right",icon:go,label:(0,g.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:ho,label:(0,g.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,g.__)("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 Cr(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function Sr(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,g.__)("Orientation")),(0,s.createElement)(p.Button,{label:"horizontal",icon:vo,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:"vertical",icon:bo,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var wr=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})};const Br=[{name:"default",label:(0,g.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:xo("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,g.__)("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)(wr,{icon:ao})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("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)(wr,{icon:uo}))),(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,g.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,g.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function(e){var t;let{selector:n,layout:o={},style:r,blockName:l}=e;const{contentSize:i,wideSize:a}=o,c=null!==xo("spacing.blockGap"),u=tr(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap),d=null!=u&&u.top&&!Lo(l,"spacing","blockGap")?null==u?void 0:u.top:"var( --wp--style--block-gap )";let p=i||a?`\n\t\t\t\t\t${ko(n,"> :where(:not(.alignleft):not(.alignright))")} {\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\t\t\t\t\t${ko(n,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\t\t\t\t\t${ko(n,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return p+=`\n\t\t\t${ko(n,"> .alignleft")} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-inline-start: 0;\n\t\t\t\tmargin-inline-end: 2em;\n\t\t\t}\n\t\t\t${ko(n,"> .alignright")} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-inline-start: 2em;\n\t\t\t\tmargin-inline-end: 0;\n\t\t\t}\n\n\t\t\t${ko(n,"> .aligncenter")} {\n\t\t\t\tmargin-left: auto !important;\n\t\t\t\tmargin-right: auto !important;\n\t\t\t}\n\t\t`,c&&(p+=`\n\t\t\t\t${ko(n,"> *")} {\n\t\t\t\t\tmargin-block-start: 0;\n\t\t\t\t\tmargin-block-end: 0;\n\t\t\t\t}\n\t\t\t\t${ko(n,"> * + *")} {\n\t\t\t\t\tmargin-block-start: ${d};\n\t\t\t\t}\n\t\t\t`),(0,s.createElement)("style",null,p)},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(
4
  // translators: %s: container size (i.e. 600px etc)
5
  o.none=(0,g.sprintf)((0,g.__)("Max %s wide"),t)),r.test(n)&&(
6
  // translators: %s: container size (i.e. 600px etc)
7
+ o.wide=(0,g.sprintf)((0,g.__)("Max %s wide"),n)),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}},_r];function Ir(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Br.find((t=>t.name===e))}const xr={type:"default"},Tr=(0,s.createContext)(xr),Nr=Tr.Provider;function Pr(){return(0,s.useContext)(Tr)}function Mr(e){let{layout:t={},...n}=e;const o=Ir(t.type);return o?(0,s.createElement)(o.save,i({layout:t},n)):null}const Rr=["none","left","center","right","wide","full"],Lr=["wide","full"];function Ar(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rr;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Yn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=Pr(),r=Ir(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=Rr}=o,s=e.filter((e=>(o.alignments||t||!Lr.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const Dr={none:{icon:io,title:(0,g._x)("None","Alignment option")},left:{icon:so,title:(0,g.__)("Align left")},center:{icon:ao,title:(0,g.__)("Align center")},right:{icon:co,title:(0,g.__)("Align right")},wide:{icon:uo,title:(0,g.__)("Wide width")},full:{icon:po,title:(0,g.__)("Full width")}},Or={isAlternate:!0};var Fr=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=Ar(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Dr[t],m=Dr.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,h={popoverProps:Or,icon:d?d.icon:m.icon,label:(0,g.__)("Align"),toggleProps:{describedBy:(0,g.__)("Change alignment")}},v=r||s.Platform.isNative?{isCollapsed:r?l:void 0,controls:a.map((e=>{let{name:n}=e;return{...Dr[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}=Dr[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({},h,v))};const zr=e=>(0,s.createElement)(Fr,i({},e,{isToolbar:!1})),Vr=e=>(0,s.createElement)(Fr,i({},e,{isToolbar:!0})),Hr=["left","center","right","wide","full"],Gr=["wide","full"];function Ur(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)?Hr.filter((t=>e.includes(t))):!0===e?[...Hr]:[],!o||!0===e&&!n?(0,u.without)(t,...Gr):t}const Wr=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Ar(Ur((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)(lo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(zr,{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"),$r=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=Ar(Ur((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:[...Hr,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",$r),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Wr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Ur((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}));const jr=/[\s#]/g,Kr={type:"string",source:"attribute",attribute:"id",selector:"*"},qr=(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,g.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,g.__)("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,g.__)("https://wordpress.org/support/article/page-jumps/")},(0,g.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,g.__)("Add an anchor"),onChange:e=>{e=e.replace(jr,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(Vo,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(Vo,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("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:Kr}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",qr),(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 Yr=(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)(Vo,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,g.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,g.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");function Qr(e,t,n,o){const r=(0,u.get)(e,n);if(!r)return[];const l=[];if("string"==typeof r)l.push({selector:t.selector,key:o,value:r});else{const e=["top","right","bottom","left"].reduce(((e,n)=>{const l=(0,u.get)(r,[n]);return l&&e.push({selector:t.selector,key:`${o}${(0,u.upperFirst)(n)}`,value:l}),e}),[]);l.push(...e)}return l}(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",Yr),(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.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,r.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var l;const o=null===(l=t[n])||void 0===l?void 0:l.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return 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}));const Xr=[{name:"margin",generate:(e,t)=>Qr(e,t,["spacing","margin"],"margin")},{name:"padding",generate:(e,t)=>Qr(e,t,["spacing","padding"],"padding")}];function Zr(e,t){const n=[];return Xr.forEach((o=>{n.push(...o.generate(e,t))})),n}var Jr=window.wp.dom;const el=(0,s.createContext)({});function tl(e){let{value:t,children:n}=e;const o=(0,s.useContext)(el),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(el.Provider,{value:r,children:n})}var nl=el;const ol={};var rl=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(nl),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):ol),[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 ll(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(Zn,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(rl,e))}var il=(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"})),sl=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:il,label:(0,g.__)("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)))))))))},al=n(1973);function cl(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,Jr.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 ul=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,al.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)(cl,{title:(0,g.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,g.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(cl,{title:(0,g.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))};const dl=e=>(0,r.rawHandler)({HTML:e.originalContent});var pl=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(Yn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(Yn);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,dl(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)((()=>[{
8
  // translators: Button to fix block content
9
+ title:(0,g._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,g.__)("Convert to HTML"),onClick:t},{title:(0,g.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(sl,{actions:[(0,s.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,g.__)("Attempt Block Recovery"))],secondaryActions:f},(0,g.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(p.Modal,{title:// translators: Dialog title to fix block content
10
+ (0,g.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(ul,{block:i,onKeep:t,onConvert:n,convertor:dl,convertButtonText:(0,g.__)("Convert to Blocks")})))}));const ml=(0,s.createElement)(sl,{className:"block-editor-block-list__block-crash-warning"},(0,g.__)("This block has encountered an error and cannot be previewed."));var fl=()=>ml;class gl 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 hl=gl,vl=n(773),bl=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(Yn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(Yn);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(vl.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.validateBlock)({...l,attributes:s,originalContent:a}):[!0];i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let kl=Ll();const _l=e=>Nl(e,kl);let yl=Ll();_l.write=e=>Nl(e,yl);let El=Ll();_l.onStart=e=>Nl(e,El);let Cl=Ll();_l.onFrame=e=>Nl(e,Cl);let Sl=Ll();_l.onFinish=e=>Nl(e,Sl);let wl=[];_l.setTimeout=(e,t)=>{let n=_l.now()+t,o=()=>{let e=wl.findIndex((e=>e.cancel==o));~e&&wl.splice(e,1),Dl.count-=~e?1:0},r={time:n,handler:e,cancel:o};return wl.splice(Bl(n),0,r),Dl.count+=1,Pl(),r};let Bl=e=>~(~wl.findIndex((t=>t.time>e))||~wl.length);_l.cancel=e=>{kl.delete(e),yl.delete(e)},_l.sync=e=>{Tl=!0,_l.batchedUpdates(e),Tl=!1},_l.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,_l.onStart(n)}return o.handler=e,o.cancel=()=>{El.delete(n),t=null},o};let Il="undefined"!=typeof window?window.requestAnimationFrame:()=>{};_l.use=e=>Il=e,_l.now="undefined"!=typeof performance?()=>performance.now():Date.now,_l.batchedUpdates=e=>e(),_l.catch=console.error,_l.frameLoop="always",_l.advance=()=>{"demand"!==_l.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Rl()};let xl=-1,Tl=!1;function Nl(e,t){Tl?(t.delete(e),e(0)):(t.add(e),Pl())}function Pl(){xl<0&&(xl=0,"demand"!==_l.frameLoop&&Il(Ml))}function Ml(){~xl&&(Il(Ml),_l.batchedUpdates(Rl))}function Rl(){let e=xl;xl=_l.now();let t=Bl(xl);t&&(Al(wl.splice(0,t),(e=>e.handler())),Dl.count-=t),El.flush(),kl.flush(e?Math.min(64,xl-e):16.667),Cl.flush(),yl.flush(),Sl.flush()}function Ll(){let e=new Set,t=e;return{add(n){Dl.count+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Dl.count-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Dl.count-=t.size,Al(t,(t=>t(n)&&e.add(t))),Dl.count+=e.size,t=e)}}}function Al(e,t){e.forEach((e=>{try{t(e)}catch(e){_l.catch(e)}}))}const Dl={count:0,clear(){xl=-1,wl=[],El=Ll(),kl=Ll(),Cl=Ll(),yl=Ll(),Sl=Ll(),Dl.count=0}};var Ol=n(9196),Fl=n.n(Ol);function zl(){}const Vl={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 Hl(e,t){if(Vl.arr(e)){if(!Vl.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 Gl=(e,t)=>e.forEach(t);function Ul(e,t,n){for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const Wl=e=>Vl.und(e)?[]:Vl.arr(e)?e:[e];function $l(e,t){if(e.size){const n=Array.from(e);e.clear(),Gl(n,t)}}const jl=(e,...t)=>$l(e,(e=>e(...t)));let Kl,ql,Yl=null,Ql=!1,Xl=zl;var Zl=Object.freeze({__proto__:null,get createStringInterpolator(){return Kl},get to(){return ql},get colors(){return Yl},get skipAnimation(){return Ql},get willAdvance(){return Xl},assign:e=>{e.to&&(ql=e.to),e.now&&(_l.now=e.now),void 0!==e.colors&&(Yl=e.colors),null!=e.skipAnimation&&(Ql=e.skipAnimation),e.createStringInterpolator&&(Kl=e.createStringInterpolator),e.requestAnimationFrame&&_l.use(e.requestAnimationFrame),e.batchedUpdates&&(_l.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Xl=e.willAdvance),e.frameLoop&&(_l.frameLoop=e.frameLoop)}});const Jl=new Set;let ei=[],ti=[],ni=0;const oi={get idle(){return!Jl.size&&!ei.length},start(e){ni>e.priority?(Jl.add(e),_l.onStart(ri)):(li(e),_l(si))},advance:si,sort(e){if(ni)_l.onFrame((()=>oi.sort(e)));else{const t=ei.indexOf(e);~t&&(ei.splice(t,1),ii(e))}},clear(){ei=[],Jl.clear()}};function ri(){Jl.forEach(li),Jl.clear(),_l(si)}function li(e){ei.includes(e)||ii(e)}function ii(e){ei.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(ei),0,e)}function si(e){const t=ti;for(let n=0;n<ei.length;n++){const o=ei[n];ni=o.priority,o.idle||(Xl(o),o.advance(e),o.idle||t.push(o))}return ni=0,ti=ei,ti.length=0,ei=t,ei.length>0}const ai="[-+]?\\d*\\.?\\d+",ci=ai+"%";function ui(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const di=new RegExp("rgb"+ui(ai,ai,ai)),pi=new RegExp("rgba"+ui(ai,ai,ai,ai)),mi=new RegExp("hsl"+ui(ai,ci,ci)),fi=new RegExp("hsla"+ui(ai,ci,ci,ai)),gi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,vi=/^#([0-9a-fA-F]{6})$/,bi=/^#([0-9a-fA-F]{8})$/;function ki(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 _i(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=ki(r,o,e+1/3),i=ki(r,o,e),s=ki(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function yi(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Ei(e){return(parseFloat(e)%360+360)%360/360}function Ci(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Si(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function wi(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=vi.exec(e))?parseInt(t[1]+"ff",16)>>>0:Yl&&void 0!==Yl[e]?Yl[e]:(t=di.exec(e))?(yi(t[1])<<24|yi(t[2])<<16|yi(t[3])<<8|255)>>>0:(t=pi.exec(e))?(yi(t[1])<<24|yi(t[2])<<16|yi(t[3])<<8|Ci(t[4]))>>>0:(t=gi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=bi.exec(e))?parseInt(t[1],16)>>>0:(t=hi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=mi.exec(e))?(255|_i(Ei(t[1]),Si(t[2]),Si(t[3])))>>>0:(t=fi.exec(e))?(_i(Ei(t[1]),Si(t[2]),Si(t[3]))|Ci(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 Bi=(e,t,n)=>{if(Vl.fun(e))return e;if(Vl.arr(e))return Bi({range:e,output:t,extrapolate:n});if(Vl.str(e.output[0]))return Kl(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)}return o===r?o:t===n?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,c)}(e,l[t],l[t+1],r[t],r[t+1],a,i,s,o.map)}};function Ii(){return(Ii=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 xi=Symbol.for("FluidValue.get"),Ti=Symbol.for("FluidValue.observers"),Ni=e=>Boolean(e&&e[xi]),Pi=e=>e&&e[xi]?e[xi]():e,Mi=e=>e[Ti]||null;function Ri(e,t){let n=e[Ti];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Li{constructor(e){if(this[xi]=void 0,this[Ti]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Ai(this,e)}}const Ai=(e,t)=>Fi(e,xi,t);function Di(e,t){if(e[xi]){let n=e[Ti];n||Fi(e,Ti,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Oi(e,t){let n=e[Ti];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Ti]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Fi=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),zi=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Vi=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;let Hi;const Gi=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Ui=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Wi=e=>{Hi||(Hi=Yl?new RegExp(`(${Object.keys(Yl).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Pi(e).replace(Vi,wi).replace(Hi,wi))),n=t.map((e=>e.match(zi).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=>Bi(Ii({},e,{output:t}))));return e=>{let n=0;return t[0].replace(zi,(()=>String(o[n++](e)))).replace(Gi,Ui)}},$i="react-spring: ",ji=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${$i}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Ki=ji(console.warn),qi=ji(console.warn);function Yi(e){return Vl.str(e)&&("#"==e[0]||/\d/.test(e)||e in(Yl||{}))}const Qi=e=>(0,Ol.useEffect)(e,Xi),Xi=[];function Zi(){const e=(0,Ol.useState)()[1],t=(0,Ol.useState)(Ji)[0];return Qi(t.unmount),()=>{t.current&&e({})}}function Ji(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function es(e){const t=(0,Ol.useRef)();return(0,Ol.useEffect)((()=>{t.current=e})),t.current}const ts="undefined"!=typeof window&&window.document&&window.document.createElement?Ol.useLayoutEffect:Ol.useEffect,ns=Symbol.for("Animated:node"),os=e=>e&&e[ns],rs=(e,t)=>{return n=e,o=ns,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},ls=e=>e&&e[ns]&&e[ns].getPayload();class is{constructor(){this.payload=void 0,rs(this,this)}getPayload(){return this.payload||[]}}class ss extends is{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,Vl.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new ss(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Vl.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,Vl.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class as extends ss{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Bi({output:[e,e]})}static create(e){return new as(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Vl.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=Bi({output:[this.getValue(),e]})),this._value=0,super.reset()}}const cs={dependencies:null};class us extends is{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Ul(this.source,((n,o)=>{var r;(r=n)&&r[ns]===r?t[o]=n.getValue(e):Ni(n)?t[o]=Pi(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Gl(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Ul(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){cs.dependencies&&Ni(e)&&cs.dependencies.add(e);const t=ls(e);t&&Gl(t,(e=>this.add(e)))}}class ds extends us{constructor(e){super(e)}static create(e){return new ds(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(ps)),!0)}}function ps(e){return(Yi(e)?as:ss).create(e)}function ms(e){const t=os(e);return t?t.constructor:Vl.arr(e)?ds:Yi(e)?as:ss}function fs(){return(fs=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 gs=(e,t)=>{const n=!Vl.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Ol.forwardRef)(((o,r)=>{const l=(0,Ol.useRef)(null),i=n&&(0,Ol.useCallback)((e=>{l.current=function(e,t){return e&&(Vl.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return cs.dependencies=n,e.style&&(e=fs({},e,{style:t.createAnimatedStyle(e.style)})),e=new us(e),cs.dependencies=null,[e,n]}(o,t),c=Zi(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new hs(u,a),p=(0,Ol.useRef)();ts((()=>{const e=p.current;p.current=d,Gl(a,(e=>Di(e,d))),e&&(Gl(e.deps,(t=>Oi(t,e))),_l.cancel(e.update))})),(0,Ol.useEffect)(u,[]),Qi((()=>()=>{const e=p.current;Gl(e.deps,(t=>Oi(t,e)))}));const m=t.getComponentProps(s.getValue());return Ol.createElement(e,fs({},m,{ref:i}))}))};class hs{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&_l.write(this.update)}}const vs=Symbol.for("AnimatedComponent"),bs=e=>Vl.str(e)?e:e&&Vl.str(e.displayName)?e.displayName:Vl.fun(e)&&e.name||null;function ks(){return(ks=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 _s(e,...t){return Vl.fun(e)?e(...t):e}const ys=(e,t)=>!0===e||!!(t&&e&&(Vl.fun(e)?e(t):Wl(e).includes(t))),Es=(e,t)=>Vl.obj(e)?t&&e[t]:e,Cs=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Ss=e=>e,ws=(e,t=Ss)=>{let n=Bs;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);Vl.und(n)||(o[r]=n)}return o},Bs=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Is={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 xs(e){const t=function(e){const t={};let n=0;if(Ul(e,((e,o)=>{Is[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Ul(e,((e,o)=>o in t||(n[o]=e))),n}return ks({},e)}function Ts(e){return e=Pi(e),Vl.arr(e)?e.map(Ts):Yi(e)?Zl.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Ns(e){for(const t in e)return!0;return!1}function Ps(e){return Vl.fun(e)||Vl.arr(e)&&Vl.obj(e[0])}function Ms(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Rs(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const Ls=ks({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class As{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,Ls)}}function Ds(e,t){if(Vl.und(t.decay)){const n=!Vl.und(t.tension)||!Vl.und(t.friction);!n&&Vl.und(t.frequency)&&Vl.und(t.damping)&&Vl.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Os=[];class Fs{constructor(){this.changed=!1,this.values=Os,this.toValues=null,this.fromValues=Os,this.to=void 0,this.from=void 0,this.config=new As,this.immediate=!1}}function zs(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=ys(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)f();else{Vl.und(n.pause)||(r.paused=ys(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||ys(e,t)),c=_s(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-_l.now()}function m(){c>0?(u=_l.setTimeout(f,c),r.pauseQueue.add(p),r.timeouts.add(u)):f()}function f(){r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(ks({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const Vs=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Us(e.get()):t.every((e=>e.noop))?Hs(e.get()):Gs(e.get(),t.every((e=>e.finished))),Hs=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Gs=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Us=e=>({value:e,cancelled:!0,finished:!1});function Ws(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=ws(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)&&Us(o)||r!==n.asyncId&&Gs(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new js,i=new Ks;return(async()=>{if(Zl.skipAnimation)throw $s(n),i.result=Gs(o,!1),d(i),i;m(l);const s=Vl.obj(e)?ks({},e):ks({},t,{to:e});s.parentId=r,Ul(c,((e,t)=>{Vl.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 g;if(Zl.skipAnimation)return $s(n),Gs(o,!1);try{let t;t=Vl.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]),g=Gs(o.get(),!0,!1)}catch(e){if(e instanceof js)g=e.result;else{if(!(e instanceof Ks))throw e;g=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return Vl.fun(i)&&_l.batchedUpdates((()=>{i(g,o,o.item)})),g})():a}function $s(e,t){$l(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class js 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 Ks extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const qs=e=>e instanceof Qs;let Ys=1;class Qs extends Li{constructor(...e){super(...e),this.id=Ys++,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=os(this);return e&&e.getValue()}to(...e){return Zl.to(this,e)}interpolate(...e){return Ki(`${$i}The "interpolate" function is deprecated in v9 (use "to" instead)`),Zl.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){Ri(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||oi.sort(this),Ri(this,{type:"priority",parent:this,priority:e})}}const Xs=Symbol.for("SpringPhase"),Zs=e=>(1&e[Xs])>0,Js=e=>(2&e[Xs])>0,ea=e=>(4&e[Xs])>0,ta=(e,t)=>t?e[Xs]|=3:e[Xs]&=-3,na=(e,t)=>t?e[Xs]|=4:e[Xs]&=-5;class oa extends Qs{constructor(e,t){if(super(),this.key=void 0,this.animation=new Fs,this.queue=void 0,this.defaultProps={},this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Vl.und(e)||!Vl.und(t)){const n=Vl.obj(e)?ks({},e):ks({},t,{from:e});Vl.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Js(this)||this._state.asyncTo)||ea(this)}get goal(){return Pi(this.animation.to)}get velocity(){const e=os(this);return e instanceof ss?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Zs(this)}get isAnimating(){return Js(this)}get isPaused(){return ea(this)}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=ls(o.to);!i&&Ni(o.to)&&(l=Wl(Pi(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==as?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=Vl.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(Vl.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=!Vl.und(a),m=n==c?s.v0>0:n<c;let f,g=!1;const h=1,v=Math.ceil(e/h);for(let e=0;e<v&&(f=Math.abs(i)>o,f||(u=Math.abs(c-d)<=t,!u));++e)p&&(g=d==c||d>c==m,g&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*h,d+=i*h}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=os(this),a=s.getValue();if(t){const e=Pi(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 _l.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Js(this)){const{to:e,config:t}=this.animation;_l.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 Vl.und(e)?(n=this.queue||[],this.queue=[]):n=[Vl.obj(e)?e:ks({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Vs(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),$s(this._state,e&&this._lastCallId),_l.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=Vl.obj(n)?n[t]:n,(null==n||Ps(n))&&(n=void 0),o=Vl.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return Zs(this)||(e.reverse&&([n,o]=[o,n]),o=Pi(o),Vl.und(o)?os(this)||this._set(n):this._set(o)),r}_update(e,t){let n=ks({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,ws(n,((e,t)=>/^on/.test(t)?Es(e,o):e))),ua(this,n,"onProps"),da(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 zs(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{ea(this)||(na(this,!0),jl(i.pauseQueue),da(this,"onPause",Gs(this,ra(this,this.animation.to)),this))},resume:()=>{ea(this)&&(na(this,!1),Js(this)&&this._resume(),jl(i.resumeQueue),da(this,"onResume",Gs(this,ra(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=la(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Us(this));const o=!Vl.und(e.to),r=!Vl.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Us(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&&!Vl.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Hl(d,c);p&&(s.from=d),d=Pi(d);const m=!Hl(u,a);m&&this._focus(u);const f=Ps(t.to),{config:g}=s,{decay:h,velocity:v}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&(Ds(n=ks({},n),t),t=ks({},n,t)),Ds(e,t),Object.assign(e,t);for(const t in Ls)null==e[t]&&(e[t]=Ls[t]);let{mass:o,frequency:r,damping:l}=e;Vl.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)}(g,_s(t.config,l),t.config!==i.config?_s(i.config,l):void 0);let b=os(this);if(!b||Vl.und(u))return n(Gs(this,!0));const k=Vl.und(t.reset)?r&&!t.default:!Vl.und(d)&&ys(t.reset,l),_=k?d:this.get(),y=Ts(u),E=Vl.num(y)||Vl.arr(y)||Yi(y),C=!f&&(!E||ys(i.immediate||t.immediate,l));if(m){const e=ms(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 S=b.constructor;let w=Ni(u),B=!1;if(!w){const e=k||!Zs(this)&&p;(m||e)&&(B=Hl(Ts(_),y),w=!B),(Hl(s.immediate,C)||C)&&Hl(g.decay,h)&&Hl(g.velocity,v)||(w=!0)}if(B&&Js(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!f&&((w||Ni(a))&&(s.values=b.getPayload(),s.toValues=Ni(u)?null:S==as?[1]:Wl(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;Gl(ca,(e=>ua(this,t,e)));const o=Gs(this,ra(this,a));jl(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&_l.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?_s(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),f?n(Ws(t.to,t,this._state,this)):w?this._start():Js(this)&&!m?this._pendingCalls.add(n):n(Hs(_))}_focus(e){const t=this.animation;e!==t.to&&(Mi(this)&&this._detach(),t.to=e,Mi(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Ni(t)&&(Di(t,this),qs(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Ni(e)&&Oi(e,this)}_set(e,t=!0){const n=Pi(e);if(!Vl.und(n)){const e=os(this);if(!e||!Hl(n,e.getValue())){const o=ms(n);e&&e.constructor==o?e.setValue(n):rs(this,o.create(n)),e&&_l.batchedUpdates((()=>{this._onChange(n,t)}))}}return os(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,da(this,"onStart",Gs(this,ra(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),_s(this.animation.onChange,e,this)),_s(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;os(this).reset(Pi(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Js(this)||(ta(this,!0),ea(this)||this._resume())}_resume(){Zl.skipAnimation?this.finish():oi.start(this)}_stop(e,t){if(Js(this)){ta(this,!1);const n=this.animation;Gl(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Ri(this,{type:"idle",parent:this});const o=t?Us(this.get()):Gs(this.get(),ra(this,null!=e?e:n.to));jl(this._pendingCalls,o),n.changed&&(n.changed=!1,da(this,"onRest",o,this))}}}function ra(e,t){const n=Ts(t);return Hl(Ts(e.get()),n)}function la(e,t=e.loop,n=e.to){let o=_s(t);if(o){const r=!0!==o&&xs(o),l=(r||e).reverse,i=!r||r.reset;return ia(ks({},e,{loop:t,default:!1,pause:void 0,to:!l||Ps(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function ia(e){const{to:t,from:n}=e=xs(e),o=new Set;return Vl.obj(t)&&aa(t,o),Vl.obj(n)&&aa(n,o),e.keys=o.size?Array.from(o):null,e}function sa(e){const t=ia(e);return Vl.und(t.default)&&(t.default=ws(t)),t}function aa(e,t){Ul(e,((e,n)=>null!=e&&t.add(n)))}const ca=["onStart","onRest","onChange","onPause","onResume"];function ua(e,t,n){e.animation[n]=t[n]!==Cs(t,n)?Es(t[n],e.key):void 0}function da(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 pa=["onStart","onChange","onRest"];let ma=1;class fa{constructor(e,t){this.id=ma++,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(ks({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle))}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];Vl.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(ia(e)),this}start(e){let{queue:t}=this;return e?t=Wl(e).map(ia):this.queue=[],this._flush?this._flush(this,t):(ya(this,t),ga(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Gl(Wl(t),(t=>n[t].stop(!!e)))}else $s(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Vl.und(e))this.start({pause:!0});else{const t=this.springs;Gl(Wl(e),(e=>t[e].pause()))}return this}resume(e){if(Vl.und(e))this.start({pause:!1});else{const t=this.springs;Gl(Wl(e),(e=>t[e].resume()))}return this}each(e){Ul(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,$l(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&&$l(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,$l(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)}_l.onFrame(this._onFrame)}}function ga(e,t){return Promise.all(t.map((t=>ha(e,t)))).then((t=>Vs(e,t)))}async function ha(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=Vl.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Vl.arr(r)||Vl.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Gl(pa,(n=>{const o=t[n];if(Vl.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,jl(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===Cs(t,"cancel");(u||m&&d.asyncId)&&p.push(zs(++e._lastAsyncId,{props:t,state:d,actions:{pause:zl,resume:zl,start(t,n){m?($s(d,e._lastAsyncId),n(Us(e))):(t.onRest=s,n(Ws(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=Vs(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=la(t,i,r);if(n)return ya(e,[n]),ha(e,n,!0)}return a&&_l.batchedUpdates((()=>a(f,e,e.item))),f}function va(e,t){const n=ks({},e.springs);return t&&Gl(Wl(t),(e=>{Vl.und(e.keys)&&(e=ia(e)),Vl.obj(e.to)||(e=ks({},e,{to:void 0})),_a(n,e,(e=>ka(e)))})),ba(e,n),n}function ba(e,t){Ul(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Di(t,e))}))}function ka(e,t){const n=new oa;return n.key=e,t&&Di(n,t),n}function _a(e,t,n){t.keys&&Gl(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function ya(e,t){Gl(t,(t=>{_a(e.springs,t,(t=>ka(t,e)))}))}const Ea=["children"],Ca=e=>{let{children:t}=e,n=function(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}(e,Ea);const o=(0,Ol.useContext)(Sa),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Ol.useState)((()=>({inputs:t,result:e()}))),o=(0,Ol.useRef)(),r=o.current;let l=r;return l?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))||(l={inputs:t,result:e()}):l=n,(0,Ol.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=Sa;return Ol.createElement(i,{value:n},t)},Sa=(wa=Ca,Ba={},Object.assign(wa,Ol.createContext(Ba)),wa.Provider._context=wa,wa.Consumer._context=wa,wa);var wa,Ba;Ca.Provider=Sa.Provider,Ca.Consumer=Sa.Consumer;const Ia=()=>{const e=[],t=function(t){qi(`${$i}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 Gl(e,((e,r)=>{if(Vl.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 Gl(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Gl(e,(e=>e.resume(...arguments))),this},t.set=function(t){Gl(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Gl(e,((e,o)=>{if(Vl.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 Gl(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Gl(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Vl.fun(e)?e(n,t):e};return t._getProps=n,t};function xa(e,t,n){const o=Vl.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Ol.useMemo)((()=>o||3==arguments.length?Ia():void 0),[]),l=(0,Ol.useRef)(0),i=Zi(),s=(0,Ol.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=va(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?ga(e,t):new Promise((o=>{ba(e,n),s.queue.push((()=>{o(ga(e,t))})),i()}))}})),[]),a=(0,Ol.useRef)([...s.ctrls]),c=[],u=es(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new fa(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=sa(n))}}(0,Ol.useMemo)((()=>{Gl(a.current.slice(e,u),(e=>{Ms(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,Ol.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>va(e,c[t]))),m=(0,Ol.useContext)(Ca),f=es(m),g=m!==f&&Ns(m);ts((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Gl(e,(e=>e()))),Gl(a.current,((e,t)=>{null==r||r.add(e),g&&e.start({default:m});const n=c[t];n&&(Rs(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Qi((()=>()=>{Gl(s.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>ks({},e)));return r?[h,r]:h}let Ta;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Ta||(Ta={}));class Na extends Qs{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Bi(...t);const n=this._get(),o=ms(n);rs(this,o.create(n))}advance(e){const t=this._get();Hl(t,this.get())||(os(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Ma(this._active)&&Ra(this)}_get(){const e=Vl.arr(this.source)?this.source.map(Pi):Wl(Pi(this.source));return this.calc(...e)}_start(){this.idle&&!Ma(this._active)&&(this.idle=!1,Gl(ls(this),(e=>{e.done=!1})),Zl.skipAnimation?(_l.batchedUpdates((()=>this.advance())),Ra(this)):oi.start(this))}_attach(){let e=1;Gl(Wl(this.source),(t=>{Ni(t)&&Di(t,this),qs(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Gl(Wl(this.source),(e=>{Ni(e)&&Oi(e,this)})),this._active.clear(),Ra(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=Wl(this.source).reduce(((e,t)=>Math.max(e,(qs(t)?t.priority:0)+1)),0))}}function Pa(e){return!1!==e.idle}function Ma(e){return!e.size||Array.from(e).every(Pa)}function Ra(e){e.idle||(e.idle=!0,Gl(ls(e),(e=>{e.done=!0})),Ri(e,{type:"idle",parent:e}))}Zl.assign({createStringInterpolator:Wi,to:(e,t)=>new Na(e,t)}),oi.advance;var La=window.ReactDOM;function Aa(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 Da=["style","children","scrollTop","scrollLeft"],Oa=/^--/;function Fa(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Oa.test(e)||Va.hasOwnProperty(e)&&Va[e]?(""+t).trim():t+"px"}const za={};let Va={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 Ha=["Webkit","Ms","Moz","O"];Va=Object.keys(Va).reduce(((e,t)=>(Ha.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Va);const Ga=["x","y","z"],Ua=/^(matrix|translate|scale|rotate|skew)/,Wa=/^(translate)/,$a=/^(rotate|skew)/,ja=(e,t)=>Vl.num(e)&&0!==e?e+t:e,Ka=(e,t)=>Vl.arr(e)?e.every((e=>Ka(e,t))):Vl.num(e)?e===t:parseFloat(e)===t;class qa extends us{constructor(e){let{x:t,y:n,z:o}=e,r=Aa(e,Ga);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>ja(e,"px"))).join(",")})`,Ka(e,0)]))),Ul(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(Ua.test(t)){if(delete r[t],Vl.und(e))return;const n=Wa.test(t)?"px":$a.test(t)?"deg":"";l.push(Wl(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${ja(r,n)})`,Ka(r,0)]:e=>[`${t}(${e.map((e=>ja(e,n))).join(",")})`,Ka(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new Ya(l,i)),super(r)}}class Ya extends Li{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 Gl(this.inputs,((n,o)=>{const r=Pi(n[0]),[l,i]=this.transforms[o](Vl.arr(r)?r:n.map(Pi));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Gl(this.inputs,(e=>Gl(e,(e=>Ni(e)&&Di(e,this)))))}observerRemoved(e){0==e&&Gl(this.inputs,(e=>Gl(e,(e=>Ni(e)&&Oi(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Ri(this,e)}}const Qa=["scrollTop","scrollLeft"];Zl.assign({batchedUpdates:La.unstable_batchedUpdates,createStringInterpolator:Wi,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 Xa=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new us(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=bs(e)||"Anonymous";return(e=Vl.str(e)?l[e]||(l[e]=gs(e,r)):e[vs]||(e[vs]=gs(e,r))).displayName=`Animated(${t})`,e};return Ul(e,((t,n)=>{Vl.arr(e)&&(n=bs(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=Aa(o,Da),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:za[t]||(za[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=Fa(t,r[t]);Oa.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 qa(e),getComponentProps:e=>Aa(e,Qa)}).animated,Za=e=>e+1,Ja=e=>({top:e.offsetTop,left:e.offsetLeft});var ec=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)(Za,0),[u,p]=(0,s.useReducer)(Za,0),[m,f]=(0,s.useState)({x:0,y:0}),g=(0,s.useMemo)((()=>l.current?Ja(l.current):null),[r]),h=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Jr.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",h()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!g)return;if(i)return void h();l.current.style.transform="";const e=Ja(l.current);c(),f({x:Math.round(g.left-e.left),y:Math.round(g.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=Vl.fun(e),[[o],r]=xa(1,n?e:[e],n?t||[]:t)}({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 tc=".block-editor-block-list__block",nc=".block-list-appender",oc=".block-editor-button-block-appender";function rc(e,t){return t.closest([tc,nc,oc].join(","))===e}function lc(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(tc);return t?t.id.slice("block-".length):void 0}function ic(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isNavigationMode:o,isBlockSelected:r}=t(Yn);if(r(e)&&!o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,m.useSelect)(Yn);return(0,s.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(t.current.contains(l.activeElement))return;const i=Jr.focus.tabbable.find(t.current).filter((e=>(0,Jr.isTextField)(e))),s=-1===n,a=(s?u.last:u.first)(i)||t.current;if(rc(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=Jr.focus.tabbable.findNext(t.current);if(e&&rc(t.current,e)&&(0,Jr.isFormElement)(e))return void e.focus()}(0,Jr.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function sc(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function ac(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(Yn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",sc),t.addEventListener("mouseover",sc),()=>{t.removeEventListener("mouseout",sc),t.removeEventListener("mouseover",sc),t.classList.remove("is-hovered")}}),[e])}function cc(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(Yn),{__experimentalSpotlightEntityBlocks:m,outlineMode:f}=a(),g=n(e),h=l(e),v=s(e),b=u(e,!0),k=p(m);return c()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":g,"has-child-selected":b,"has-active-entity":k,"is-active-entity":k===e,"remove-outline":h&&f&&d()})}),[e])}function uc(e){return(0,m.useSelect)((t=>{const n=t(Yn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function dc(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(Yn),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 pc(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(Yn);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 mc(e){const{isBlockSelected:t}=(0,m.useSelect)(Yn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(Yn);return(0,d.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):rc(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var fc=window.wp.keycodes;function gc(e){const t=(0,m.useSelect)((t=>t(Yn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(Yn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(Yn);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!==fc.ENTER&&s!==fc.BACKSPACE&&s!==fc.DELETE||a!==i||(0,Jr.isTextField)(a)||(t.preventDefault(),s===fc.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function hc(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(Yn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(Yn);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])}function vc(){const e=(0,s.useContext)(yf);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function bc(){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)(kc),{index:a,mode:u,name:p,blockApiVersion:f,blockTitle:h,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(Yn),p=a(n),m=c(n)||u(n),f=l(n),g=(0,r.getBlockType)(f);return{index:t(n),mode:o(n),name:f,blockApiVersion:(null==g?void 0:g.apiVersion)||1,blockTitle:null==g?void 0:g.title,isPartOfSelection:p||m,adjustScrolling:p||d(n),enableAnimation:!i()&&s()<=200}}),[n]),_=(0,g.sprintf)((0,g.__)("Block: %s"),h),y="html"!==u||t?"":"-visual",E=(0,d.useMergeRefs)([e.ref,ic(n),Eo(n),mc(n),gc(n),hc(n),ac(),vc(),ec({isSelected:v,adjustScrolling:b,enableAnimation:k,triggerAnimationOnChange:a})]),C=Jn();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":h,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,cc(n),uc(n),dc(n),pc(n)),style:{...l.style,...e.style}}}bc.save=r.__unstableGetBlockProps;const kc=(0,s.createContext)();function _c(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",bc(o,{__unstableIsHtml:n}),t)}const yc=(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(Yn),d=a(n),p=r(n),m=s(o),f=c(n,o),g=u(n,o),{name:h,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:f,canMove:g,block:d,name:h,attributes:v,isValid:b,isSelected:p}})),Ec=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(Yn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(Yn),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(Yn),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(Yn);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 Cc=(0,d.compose)(d.pure,yc,Ec,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:l,canRemove:i,clientId:a,isSelected:d,isSelectionEnabled:p,className:f,name:g,isValid:h,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const S=(0,m.useSelect)((e=>{const{getSettings:t}=e(Yn);return t().supportsLayout}),[]),{removeBlock:w}=(0,m.useDispatch)(Yn),B=(0,s.useCallback)((()=>w(a)),[a]);let I=(0,s.createElement)(ll,{name:g,isSelected:d,attributes:v,setAttributes:k,insertBlocksAfter:l?void 0:y,onReplace:i?_:void 0,onRemove:i?B:void 0,mergeBlocks:i?E:void 0,clientId:a,isSelectionEnabled:p,toggleSelection:C});const x=(0,r.getBlockType)(g);null!=x&&x.getEditWrapperProps&&(b=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}(b,x.getEditWrapperProps(v)));const T=b&&!!b["data-align"]&&!S;let N;if(T&&(I=(0,s.createElement)("div",{className:"wp-block","data-align":b["data-align"]},I)),h)N="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},I),(0,s.createElement)(_c,{isHtml:!0},(0,s.createElement)(bl,{clientId:a}))):(null==x?void 0:x.apiVersion)>1?I:(0,s.createElement)(_c,b,I);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(x,v);N=(0,s.createElement)(_c,{className:"has-warning"},(0,s.createElement)(pl,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,Jr.safeHTML)(e)))}const P={clientId:a,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&S?c()(f,`align${b["data-align"]}`):f,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},M=(0,s.useMemo)((()=>P),Object.values(P));return(0,s.createElement)(kc.Provider,{value:M},(0,s.createElement)(hl,{fallback:(0,s.createElement)(_c,{className:"has-warning"},(0,s.createElement)(fl,null))},N))})),Sc=window.wp.htmlEntities,wc=(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 Bc=[(0,s.createInterpolateElement)((0,g.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,g.__)("Drag files into the editor to automatically insert media blocks."),(0,g.__)("Change a block's type by pressing the block icon on the toolbar.")];var Ic=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*Bc.length));return(0,s.createElement)(p.Tip,null,Bc[e])},xc=(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"})),Tc=(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:xc});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)})),Nc=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(Vt()("`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)(Tc,{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 Pc(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:g}=a.dispatch(Yn),{getBlockName:h,getBlocks:v}=a.select(Yn),b=(0,m.useSelect)((e=>!t||e(Yn).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(g(),t?a.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),g(),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(Yn);let s=v(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===h(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);(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 Mc=(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(Kn,qn),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)(Yn);return(0,s.useEffect)((()=>{o(n)}),[n]),Pc(e),(0,s.createElement)(yo,null,t)}));function Rc(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)(Cf,null)))}function Lc(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(Yn),{clearSelectedBlock:n}=(0,m.useDispatch)(Yn);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 Ac(e){return(0,s.createElement)("div",i({ref:Lc()},e))}function Dc(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(Yn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function Oc(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,m.useSelect)(Dc,[]),i=Co(r),s=Co((0,u.first)(n)),a=Co((0,u.last)(n));return(0,d.useRefEffect)((c=>{const{ownerDocument:u}=c,{defaultView:d}=u;if(null==e)return;if(!o||t){if(!r||t)return;const e=d.getSelection();if(e.rangeCount&&!e.isCollapsed){const t=i.current,{startContainer:n,endContainer:o}=e.getRangeAt(0);!t||t.contains(n)&&t.contains(o)||e.removeAllRanges()}return}const{length:p}=n;if(p<2)return;if(!l)return;if(c.contentEditable=!0,c.focus(),!s.current||!a.current)return;const m=d.getSelection(),f=u.createRange();f.setStartBefore(s.current),f.setEndAfter(a.current),m.removeAllRanges(),m.addRange(f)}),[o,t,n,r,e,l])}function Fc(e,t,n,o){let r,l=Jr.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(!Jr.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 zc(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksEndClientId:t,getPreviousBlockClientId:n,getNextBlockClientId:o,getSettings:r,hasMultiSelection:l}=(0,m.useSelect)(Yn);return(0,d.useRefEffect)((i=>{let s;function a(){s=null}function c(a){const{keyCode:c,target:u}=a,d=c===fc.UP,p=c===fc.DOWN,m=c===fc.LEFT,f=c===fc.RIGHT,g=d||m,h=m||f,v=d||p,b=h||v,k=a.shiftKey,_=k||a.ctrlKey||a.altKey||a.metaKey,y=v?Jr.isVerticalEdge:Jr.isHorizontalEdge,{ownerDocument:E}=i,{defaultView:C}=E;if(l())return;if(v?s||(s=(0,Jr.computeCaretRect)(C)):s=null,a.defaultPrevented)return;if(!b)return;if(!function(e,t,n){if((t===fc.UP||t===fc.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(u,c,_))return;const S=(0,Jr.isRTL)(u)?!g:g,{keepCaretInsideBlock:w}=r(),B=e();if(k){const e=t(),r=n(e||B),l=o(e||B);(g&&r||!g&&l)&&function(e,t){const n=Fc(e,t,i);return!n||!function(e,t){return e.closest(tc)===t.closest(tc)}(e,n)}(u,g)&&y(u,g)&&(i.contentEditable=!0,i.focus())}else if(v&&(0,Jr.isVerticalEdge)(u,g)&&!w){const e=Fc(u,g,i,!0);e&&((0,Jr.placeCaretAtVerticalEdge)(e,g,s),a.preventDefault())}else if(h&&C.getSelection().isCollapsed&&(0,Jr.isHorizontalEdge)(u,S)&&!w){const e=Fc(u,S,i);(0,Jr.placeCaretAtHorizontalEdge)(e,g),a.preventDefault()}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}var Vc=window.wp.keyboardShortcuts;function Hc(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(Yn),{multiSelect:o}=(0,m.useDispatch)(Yn),r=(0,Vc.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;const i=t();if(i.length<2&&!(0,Jr.isEntirelySelected)(l.target))return;const[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 Gc(e,t){e.contentEditable=t,t&&e.focus()}function Uc(){const{startMultiSelect:e,stopMultiSelect:t}=(0,m.useDispatch)(Yn),{isSelectionEnabled:n,hasMultiSelection:o}=(0,m.useSelect)(Yn);return(0,d.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l;let s,a;function c(){t(),i.removeEventListener("mouseup",c),a=i.requestAnimationFrame((()=>{if(o())return;Gc(r,!1);const e=i.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);s.contains(t)&&s.focus()}}))}function u(t){let{buttons:o,target:a}=t;1===o&&a.getAttribute("contenteditable")&&n()&&(s=l.activeElement,e(),i.addEventListener("mouseup",c),Gc(r,!0))}return r.addEventListener("mouseout",u),()=>{r.removeEventListener("mouseout",u),i.removeEventListener("mouseup",c),i.cancelAnimationFrame(a)}}),[e,t,n,o])}function Wc(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,m.useDispatch)(Yn),{getBlockParents:o}=(0,m.useSelect)(Yn);return(0,d.useRefEffect)((n=>{const{ownerDocument:r}=n,{defaultView:l}=r;function i(){const r=l.getSelection();if(!r.rangeCount||r.isCollapsed)return void function(e,t){e.contentEditable=false}(n);const i=lc(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n]}(r)),s=lc(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n-1]}(r));if(i===s)t(i);else{const t=[...o(i),i],n=[...o(s),s],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}}function s(){r.addEventListener("selectionchange",i),l.addEventListener("mouseup",i)}function a(){r.removeEventListener("selectionchange",i),l.removeEventListener("mouseup",i)}function c(){a(),s()}return s(),n.addEventListener("focusin",c),()=>{a(),n.removeEventListener("focusin",c)}}),[e,t,n,o])}function $c(){const{multiSelect:e,selectBlock:t}=(0,m.useDispatch)(Yn),{isSelectionEnabled:n,getBlockParents:o,getBlockSelectionStart:r,hasMultiSelection:l}=(0,m.useSelect)(Yn);return(0,d.useRefEffect)((e=>{function o(o){if(!n()||0!==o.button)return;const i=r(),s=lc(o.target);o.shiftKey?i!==s&&(e.contentEditable=!0,e.focus()):l()&&t(s)}return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[e,t,n,o,r,l])}function jc(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,m.useSelect)(Yn),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,m.useDispatch)(Yn);return(0,d.useRefEffect)((u=>{function d(d){d.defaultPrevented||o()&&(d.keyCode===fc.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===fc.BACKSPACE||d.keyCode===fc.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===fc.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===fc.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function p(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("keydown",d),u.addEventListener("compositionstart",p),()=>{u.removeEventListener("keydown",d),u.removeEventListener("compositionstart",p)}}),[])}function Kc(){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)(Yn),{setNavigationMode:a}=(0,m.useDispatch)(Yn),c=(0,m.useSelect)((e=>e(Yn).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";Jr.focus.tabbable[n](t.target).focus()}}const f=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),g=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),h=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===fc.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==fc.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,Jr.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,Jr.isFormElement)(Jr.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!==fc.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=Jr.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,h]),g]}(),o=(0,m.useSelect)((e=>e(Yn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,jc(),Uc(),Wc(),$c(),Oc(),Hc(),zc(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,g.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var qc=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=Kc();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 Yc="editor-styles-wrapper";function Qc(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var Xc=(0,s.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:a,...u}=e;const[,m]=(0,s.useReducer)((()=>({}))),[f,h]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=Qc(null==a?void 0:a.styles),_=Qc(null==a?void 0:a.scripts),y=Lc(),[E,C,S]=Kc(),w=(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),h(t),y(r),b(Array.from(n.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}return e.addEventListener("load",t),()=>e.removeEventListener("load",t)}),[]),B=(0,d.useRefEffect)((e=>{_.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((()=>{m()}))}),[]),I=(0,d.useMergeRefs)([n,y,C]);return(0,s.useEffect)((()=>{var e;f&&(e=f,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(`.${Yc}`)||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))}})))}),[f]),r=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"body{margin:0}"),k.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})})),r),(0,s.createElement)(s.Fragment,null,l>=0&&E,(0,s.createElement)("iframe",i({},u,{ref:(0,d.useMergeRefs)([t,w]),tabIndex:l,srcDoc:"<!doctype html>",title:(0,g.__)("Editor canvas")}),f&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:I,className:c()(Yc,...v)},(0,s.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&S)})),Zc={grad:.9,turn:360,rad:360/(2*Math.PI)},Jc=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},eu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},tu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},nu=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},ou=function(e){return{r:tu(e.r,0,255),g:tu(e.g,0,255),b:tu(e.b,0,255),a:tu(e.a)}},ru=function(e){return{r:eu(e.r),g:eu(e.g),b:eu(e.b),a:eu(e.a,3)}},lu=/^#([0-9a-f]{3,8})$/i,iu=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},su=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}},au=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}},cu=function(e){return{h:nu(e.h),s:tu(e.s,0,100),l:tu(e.l,0,100),a:tu(e.a)}},uu=function(e){return{h:eu(e.h),s:eu(e.s),l:eu(e.l),a:eu(e.a,3)}},du=function(e){return au((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},pu=function(e){return{h:(t=su(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},mu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,fu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,vu={string:[[function(e){var t=lu.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?eu(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?eu(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=gu.exec(e)||hu.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ou({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=mu.exec(e)||fu.exec(e);if(!t)return null;var n,o,r=cu({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Zc[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return du(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 Jc(t)&&Jc(n)&&Jc(o)?ou({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(!Jc(t)||!Jc(n)||!Jc(o))return null;var i=cu({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return du(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!Jc(t)||!Jc(n)||!Jc(o))return null;var i=function(e){return{h:nu(e.h),s:tu(e.s,0,100),v:tu(e.v,0,100),a:tu(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return au(i)},"hsv"]]},bu=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]},ku=function(e,t){var n=pu(e);return{h:n.h,s:tu(n.s+100*t,0,100),l:n.l,a:n.a}},_u=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},yu=function(e,t){var n=pu(e);return{h:n.h,s:n.s,l:tu(n.l+100*t,0,100),a:n.a}},Eu=function(){function e(e){this.parsed=function(e){return"string"==typeof e?bu(e.trim(),vu.string):"object"==typeof e&&null!==e?bu(e,vu.object):[null,void 0]}(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 eu(_u(this.rgba),2)},e.prototype.isDark=function(){return _u(this.rgba)<.5},e.prototype.isLight=function(){return _u(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=ru(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?iu(eu(255*r)):"","#"+iu(t)+iu(n)+iu(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return ru(this.rgba)},e.prototype.toRgbString=function(){return t=(e=ru(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 uu(pu(this.rgba))},e.prototype.toHslString=function(){return t=(e=uu(pu(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=su(this.rgba),{h:eu(e.h),s:eu(e.s),v:eu(e.v),a:eu(e.a,3)};var e},e.prototype.invert=function(){return Cu({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),Cu(ku(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Cu(ku(this.rgba,-e))},e.prototype.grayscale=function(){return Cu(ku(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Cu(yu(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Cu(yu(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?Cu({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):eu(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=pu(this.rgba);return"number"==typeof e?Cu({h:e,s:t.s,l:t.l,a:t.a}):eu(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Cu(e).toHex()},e}(),Cu=function(e){return e instanceof Eu?e:new Eu(e)},Su=[],wu=function(e){e.forEach((function(e){Su.indexOf(e)<0&&(e(Eu,vu),Su.push(e))}))};function Bu(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 Iu=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},xu=function(e){return.2126*Iu(e.r)+.7152*Iu(e.g)+.0722*Iu(e.b)};function Tu(e){e.prototype.luminance=function(){return e=xu(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=xu(l))>(a=xu(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),Pu=n.n(Nu);const Mu=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Ru(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=S()||w());)!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=g();)!1!==t&&e.push(t);return e}function g(){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 h(){const e=p(/^([^{]+)/);if(e)return Lu(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=Lu(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Mu,""),value:n?Lu(n[0]).replace(Mu,""):""});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 S(){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=Lu(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:Lu(t[1]),media:Lu(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Lu(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=Lu(t[1]),o=Lu(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=h()||[];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 w(){const e=l(),t=h();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return Au(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function Lu(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Au(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){Au(e,o)})):n&&"object"==typeof n&&Au(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Du=n(8575),Ou=n.n(Du),Fu=zu;function zu(e){this.options=e||{}}zu.prototype.emit=function(e){return e},zu.prototype.visit=function(e){return this[e.type](e)},zu.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 Vu=Hu;function Hu(e){Fu.call(this,e)}Ou()(Hu,Fu),Hu.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Hu.prototype.comment=function(e){return this.emit("",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("{")+this.mapVisit(e.rules)+this.emit("}")},Hu.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("}")},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("{")+this.mapVisit(e.rules)+this.emit("}")},Hu.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Hu.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Hu.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("}")},Hu.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Hu.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Hu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Hu.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("}"):""},Hu.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var Gu=Uu;function Uu(e){e=e||{},Fu.call(this,e),this.indentation=e.indent}Ou()(Uu,Fu),Uu.prototype.compile=function(e){return this.stylesheet(e)},Uu.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Uu.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Uu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Uu.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}")},Uu.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}")},Uu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Uu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Uu.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}")},Uu.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)+"}")},Uu.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")},Uu.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}")},Uu.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}")},Uu.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}")},Uu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Uu.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()+"}"):""},Uu.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Uu.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var Wu=function(e,t){try{const r=Ru(e);return n=Pu().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new Vu(o):new Gu(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function $u(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 ju(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]};$u(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+ju(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 qu=/^(body|html|:root).*$/;var Yu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>"rule"===n.type?{...n,selectors:n.selectors.map((n=>t.includes(n.trim())?n:n.match(qu)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},Qu=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?Wu(n,(0,d.compose)(r)):n}))};const Xu=".editor-styles-wrapper";function Zu(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(Xu);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=Cu(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function Ju(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>Qu(t,Xu)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:Zu(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}let ed;wu([Bu,Tu]);const td=2e3;var nd=function(e){let{viewportWidth:t,__experimentalPadding:n,__experimentalMinHeight:o}=e;const[r,{width:l}]=(0,d.useResizeObserver)(),[i,{height:a}]=(0,d.useResizeObserver)(),{styles:c,assets:u}=(0,m.useSelect)((e=>{const t=e(Yn).getSettings();return{styles:t.styles,assets:t.__unstableResolvedAssets}}),[]),f=(0,s.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]);ed=ed||(0,d.pure)(Cf);const g=l/t;return(0,s.createElement)("div",{className:"block-editor-block-preview__container"},r,(0,s.createElement)(p.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${g})`,height:a*g,maxHeight:a>td?td*g:void 0,minHeight:o}},(0,s.createElement)(Xc,{head:(0,s.createElement)(Ju,{styles:f}),assets:u,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:a,pointerEvents:"none",maxHeight:td,minHeight:g<1&&o?o/g:o}},i,(0,s.createElement)(ed,{renderAppender:!1}))))},od=(0,s.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:r=!1,__experimentalOnClick:l,__experimentalMinHeight:i}=e;const a=(0,m.useSelect)((e=>e(Yn).getSettings()),[]),c=(0,s.useMemo)((()=>{const e={...a};return e.__experimentalBlockPatterns=[],e}),[a]),d=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(Mc,{value:d,settings:c},r?(0,s.createElement)(Rc,{onClick:l}):(0,s.createElement)(nd,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function rd(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(Yn).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)(Mc,{value:p,settings:a},(0,s.createElement)(wf,{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 ld=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)(od,{__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,g.__)("No Preview Available."))),!p&&(0,s.createElement)(Nc,{title:i,icon:a,description:c}))},id=(0,s.createContext)(),sd=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(id);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)}))})),ad=(0,s.createElement)(O.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function cd(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)(Tc,{icon:n}):(0,g.sprintf)(
11
  /* translators: %d: Number of blocks. */
12
+ (0,g._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Tc,{icon:ad})))))}var ud=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)(cd,{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 dd(){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 pd=(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)(ud,{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)(sd,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,dd()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===fc.ENTER&&(e.preventDefault(),l(o,dd()?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)(Tc,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},o.title)))}))})),md=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,Ft.speak)((0,g.__)("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))})),fd=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(id);return(0,s.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),gd=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(md,{className:"block-editor-block-types-list","aria-label":i},function(e,t){const n=[];for(let t=0,o=e.length;t<o;t+=3)n.push(e.slice(t,t+3));return n}(t).map(((e,t)=>(0,s.createElement)(fd,{key:t},e.map(((e,l)=>(0,s.createElement)(pd,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a,isFirst:0===t&&0===l})))))),l)},hd=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))},vd=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(Yn),{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])]},bd=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(id.Provider,{value:n},t)};const kd=[];var _d=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,c]=vd(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]),h=(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:kd);return(0,s.createElement)(bd,null,(0,s.createElement)("div",null,r&&!!p.length&&(0,s.createElement)(hd,{title:(0,g._x)("Most used","blocks")},(0,s.createElement)(gd,{items:p,onSelect:c,onHover:o,label:(0,g._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=f[e.slug];return t&&t.length?(0,s.createElement)(hd,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(gd,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(hd,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,g.__)("Uncategorized")},(0,s.createElement)(gd,{items:m,onSelect:c,onHover:o,label:(0,g.__)("Uncategorized")})),(0,u.map)(_,(e=>{let[t,n]=e;const r=h[t];return r&&r.length?(0,s.createElement)(hd,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(gd,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))},yd=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,g.__)("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,g.__)("Explore all patterns"),onClick:()=>r()},(0,g._x)("Explore","Label for showing all block patterns"))))},Ed=window.wp.notices,Cd=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Yn);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(Ed.store);return[o,n,(0,s.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,g.sprintf)(
13
  /* translators: %s: block pattern title. */
14
+ (0,g.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function Sd(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)(Sd)}`;return(0,s.createElement)(ud,{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)(od,{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 wd(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Bd=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:a=(0,g.__)("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)(Sd,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(wd,{key:e.name}))))};function Id(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 xd(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,g.__)("Search for patterns"),placeholder:(0,g.__)("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)(xd,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(Id,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},Nd=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(wr,{className:"block-editor-inserter__no-results-icon",icon:xc}),(0,s.createElement)("p",null,(0,g.__)("No results found.")))},Pd=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(Yn),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(Yn),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:h,showInsertionPoint:v,hideInsertionPoint:b}=(0,m.useDispatch)(Yn),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):h(e,p,d,!0,a||n?0:null,t);const s=(0,g.sprintf)(// translators: %d: the name of the block that has been added
15
+ (0,g._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,Ft.speak)(s),i&&i()}),[l,c,f,h,d,p,i,a]),_=(0,s.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]};const Md=e=>e.name||"",Rd=e=>e.title,Ld=e=>e.description||"",Ad=e=>e.keywords||[],Dd=e=>e.category,Od=()=>null;function Fd(){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 zd=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(Fd(e))},Vd=(e,t)=>(0,u.differenceWith)(e,zd(t),((e,t)=>t.includes(e))),Hd=(e,t,n,o)=>0===zd(o).length?e:Gd(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}}),Gd=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=zd(t);if(0===o.length)return e;const r=e.map((e=>[e,Ud(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 Ud(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Md,getTitle:r=Rd,getDescription:l=Ld,getKeywords:i=Ad,getCategory:s=Dd,getCollection:a=Od}=n,c=o(e),d=r(e),p=l(e),m=i(e),f=s(e),g=a(e),h=Fd(t),v=Fd(d);let b=0;if(h===v)b+=30;else if(v.startsWith(h))b+=20;else{const e=[c,d,p,...m,f,g].join(" "),t=(0,u.words)(h);0===Vd(t,e).length&&(b+=10)}return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}function Wd(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,g.sprintf)(
16
  /* translators: %d: number of patterns. %s: block pattern search query */
17
+ (0,g._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var $d=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Ft.speak,500),[l,i]=Pd({shouldFocusBlock:!0}),[a,,c]=Cd(i,l),u=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?Gd(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,g.sprintf)(
18
  /* translators: %d: number of results. */
19
+ (0,g._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)(Wd,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(bd,null,!f&&(0,s.createElement)(Nd,null),f&&(0,s.createElement)(Bd,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function jd(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)($d,{filterValue:o,selectedCategory:l,patternCategories:n}))}var Kd=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(p.Modal,{title:(0,g.__)("Patterns"),closeLabel:(0,g.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(jd,n))};function qd(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=Cd(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)(Bd,{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]=Cd(),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,g._x)("Uncategorized")}),e}),[a,c]),p=r||d[0];return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(yd,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,s.createElement)(qd,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,s.createElement)(Kd,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},Qd=window.wp.url;function Xd(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=vd(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)(hd,{title:(0,g.__)("Reusable blocks")},(0,s.createElement)(gd,{items:i,onSelect:l,onHover:t,label:(0,g.__)("Reusable blocks")}))}var Zd=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xd,{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,Qd.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,g.__)("Manage Reusable blocks"))))};const{Fill:Jd,Slot:ep}=(0,p.createSlotFill)("__unstableInserterMenuExtension");Jd.Slot=ep;var tp=Jd;const np=[];var op=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:h=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const k=(0,d.useDebounce)(Ft.speak,500),[_,y]=Pd({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[E,C,S,w]=vd(_,y),[B,,I]=Cd(y,_),x=(0,s.useMemo)((()=>{if(0===c)return[];const e=Gd(B,t);return void 0!==c?e.slice(0,c):e}),[t,B,c]);let T=m;b&&x.length>2&&(T=0);const N=(0,s.useMemo)((()=>{if(0===T)return[];const e=Hd((0,u.orderBy)(E,["frecency"],["desc"]),C,S,t);return void 0!==T?e.slice(0,T):e}),[t,E,C,S,m]);(0,s.useEffect)((()=>{if(!t)return;const e=N.length+x.length,n=(0,g.sprintf)(
20
  /* translators: %d: number of results. */
21
+ (0,g._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,d.useAsyncList)(N,{step:9}),M=(0,d.useAsyncList)(P.length===N.length?x:np),R=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(x),L=!!N.length&&(0,s.createElement)(hd,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("Blocks"))},(0,s.createElement)(gd,{items:P,onSelect:w,onHover:o,label:(0,g.__)("Blocks"),isDraggable:h})),A=!!x.length&&(0,s.createElement)(hd,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(Bd,{shownPatterns:M,blockPatterns:x,onClickPattern:I,isDraggable:h})));return(0,s.createElement)(bd,null,!f&&!R&&(0,s.createElement)(Nd,null),b?A:L,!!N.length&&!!x.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?L:A,f&&(0,s.createElement)(tp.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:R,rootClientId:_}},(e=>e.length?e:R?null:(0,s.createElement)(Nd,null))))};const rp={name:"blocks",
22
  /* translators: Blocks tab title in the block inserter. */
23
+ title:(0,g.__)("Blocks")},lp={name:"patterns",
24
  /* translators: Patterns tab title in the block inserter. */
25
+ title:(0,g.__)("Patterns")},ip={name:"reusable",
26
  /* translators: Reusable blocks tab title in the block inserter. */
27
+ title:(0,g.__)("Reusable")};var sp=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,s.useMemo)((()=>{const e=[rp];return n&&e.push(lp),o&&e.push(ip),e}),[rp,n,lp,o,ip]);return(0,s.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)},ap=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:a,showMostUsedBlocks:c,__experimentalFilterValue:u="",shouldFocusBlock:d=!0}=e;const[f,h]=(0,s.useState)(u),[v,b]=(0,s.useState)(null),[k,_]=(0,s.useState)(null),[y,E,C]=Pd({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:d}),{showPatterns:S,hasReusableBlocks:w}=(0,m.useSelect)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Yn);return{showPatterns:!!n(y).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[y]),B=(0,s.useCallback)(((e,t,n)=>{E(e,t,n),i()}),[E,i]),I=(0,s.useCallback)(((e,t)=>{E(e,{patternName:t}),i()}),[E,i]),x=(0,s.useCallback)((e=>{C(!!e),b(e)}),[C,b]),T=(0,s.useCallback)((e=>{_(e)}),[_]),N=(0,s.useMemo)((()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__block-list"},(0,s.createElement)(_d,{rootClientId:y,onInsert:B,onHover:x,showMostUsedBlocks:c})),a&&(0,s.createElement)("div",{className:"block-editor-inserter__tips"},(0,s.createElement)(p.VisuallyHidden,{as:"h2"},(0,g.__)("A tip for using the block editor")),(0,s.createElement)(Ic,null)))),[y,B,x,f,c,a]),P=(0,s.useMemo)((()=>(0,s.createElement)(Yd,{rootClientId:y,onInsert:I,onClickCategory:T,selectedCategory:k})),[y,I,T,k]),M=(0,s.useMemo)((()=>(0,s.createElement)(Zd,{rootClientId:y,onInsert:B,onHover:x})),[y,B,x]),R=(0,s.useCallback)((e=>"blocks"===e.name?N:"patterns"===e.name?P:M),[N,P,M]),L=(0,s.useRef)();return(0,s.useImperativeHandle)(t,(()=>({focusSearch:()=>{L.current.focus()}}))),(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=>{v&&b(null),h(e)},value:f,label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search"),ref:L}),!!f&&(0,s.createElement)(op,{filterValue:f,onSelect:i,onHover:x,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!f&&(S||w)&&(0,s.createElement)(sp,{showPatterns:S,showReusableBlocks:w},R),!f&&!S&&!w&&N)),a&&v&&(0,s.createElement)(ld,{item:v}))}));function cp(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r}=e;const[l,i]=(0,s.useState)(""),[a,u]=Pd({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[d]=vd(a,u),[f]=Cd(u,a),{setInserterIsOpened:h,insertionIndex:v,prioritizePatterns:b}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:r,getBlockCount:l}=e(Yn),i=t(),s=r(o),a=l();return{setInserterIsOpened:i.__experimentalSetIsInserterOpened,prioritizePatterns:i.__experimentalPreferPatternsOnRoot&&!n&&s>0&&(s<a||0===a),insertionIndex:-1===s?a:s}}),[o,n]),k=f.length&&(!!l||b),_=k&&f.length>6||d.length>6;(0,s.useEffect)((()=>{h&&h(!1)}),[h]);let y=0;return k&&(y=b?4:2),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":h})},_&&(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",value:l,onChange:e=>{i(e)},label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(op,{filterValue:l,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:b})),h&&(0,s.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{h({rootClientId:n,insertionIndex:v,filterValue:l})},"aria-label":(0,g.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,g.__)("Browse all")))}const up=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:a,toggleProps:c={}}=e;t=a?(0,g.sprintf)(// translators: %s: the name of the block when there is only one
28
+ (0,g._x)("Add %s","directly add the only allowed block"),l):(0,g._x)("Add block","Generic label for block inserter button");const{onClick:u,...d}=c;return(0,s.createElement)(p.Button,i({icon:wc,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 dp 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=up}=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)(cp,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r}):(0,s.createElement)(ap,{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||n?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,g.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}var pp=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{getBlockRootClientId:l,hasInserterItems:i,__experimentalGetAllowedBlocks:s,__experimentalGetDirectInsertBlock:a}=e(Yn),{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&&!c)return;const{insertBlock:d}=e(Yn);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(Yn);if(!e||!l&&!n)return{};const i={};let s={};if(l){const e=t(l),n=t(r(l));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(s=(null==n?void 0:n.attributes)||{})}else{var a;const e=t(n);if(null!=e&&null!==(a=e.innerBlocks)&&void 0!==a&&a.length){const t=e.innerBlocks[e.innerBlocks.length-1];c&&(null==c?void 0:c.name)===t.name&&(s=t.attributes)}}return e.forEach((e=>{s.hasOwnProperty(e)&&(i[e]=s[e])})),i}(c.attributesToCopy);p=(0,r.createBlock)(c.name,{...c.attributes||{},...e})}else p=(0,r.createBlock)(a.name);d(p,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:r,getBlockRootClientId:s}=o(Yn);if(l)return e(l);const a=t();return!i&&a&&s(a)===n?e(a)+1:r(n).length}(),n),u&&u();const m=(0,g.sprintf)(// translators: %s: the name of the block that has been added
29
+ (0,g.__)("%s block added"),a.title);(0,Ft.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(dp),mp=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(Yn),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,m.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(Yn);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:r,rootClientId:l}=e;if(t)return null;const i=(0,Sc.decodeEntities)(r)||(0,g.__)("Type / to choose a block");return(0,s.createElement)("div",{"data-root-client-id":l||"",className:c()("block-editor-default-block-appender",{"has-visible-prompt":o})},(0,s.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,g.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{fc.ENTER!==e.keyCode&&fc.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(pp,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function fp(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,s.createElement)(pp,{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,g.sprintf)(// translators: %s: the name of the block when there is only one
30
+ (0,g._x)("Add %s","directly add the only allowed block"),d):(0,g._x)("Add block","Generic label for block inserter button");const f=!m;let h=(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)(wr,{icon:wc}));return(f||m)&&(h=(0,s.createElement)(p.Tooltip,{text:n},h)),h},isAppender:!0})}const gp=(0,s.forwardRef)(((e,t)=>(Vt()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),fp(e,t))));var hp=(0,s.forwardRef)(fp),vp=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(Yn);return{isLocked:!!l(n),canInsertDefaultBlock:o((0,r.getDefaultBlockName)(),n),selectedBlockClientId:i()}}))((function(e){let t,{rootClientId:n,canInsertDefaultBlock:o,isLocked:r,renderAppender:l,className:i,selectedBlockClientId:a,tagName:u="div"}=e;if(r||!1===l)return null;if(l)t=(0,s.createElement)(l,null);else{if(a!==n&&(n||a))return null;t=o?(0,s.createElement)(mp,{rootClientId:n}):(0,s.createElement)(hp,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,s.createElement)(u,{tabIndex:-1,className:c()("block-list-appender wp-block",i),contentEditable:!1,"data-block":!0},t)}));function bp(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 kp=(0,s.createContext)();function _p(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(Yn),l=(0,s.useContext)(kp),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:f,rootClientId:h,isInserterShown:v}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(Yn),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}}),[]),b=So(u),k=So(f),_="vertical"===a,y=(0,s.useMemo)((()=>{if(!b&&!k)return{};const e=b?b.getBoundingClientRect():null,t=k?k.getBoundingClientRect():null;if(_)return{width:b?b.offsetWidth:k.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,g.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:b?b.offsetHeight:k.offsetHeight}}),[b,k]),E=(0,s.useCallback)((()=>{if(!b&&!k)return{};const{ownerDocument:e}=b||k,t=b?b.getBoundingClientRect():null,n=k?k.getBoundingClientRect():null;return _?(0,g.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,g.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}}),[b,k]),C=bp(n),S=(0,d.useReducedMotion)(),w=c()("block-editor-block-list__insertion-point","is-"+a),B=b&&k&&v,I={start:{..._?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{..._?{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:{..._?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},x={start:{scale:S?1:0},rest:{scale:1,transition:{delay:.2}}};return(0,s.createElement)(p.Popover,{ref:C,noArrow:!0,animate:!1,getAnchorRect:E,focusOnMount:!1,className:"block-editor-block-list__insertion-point-popover",__unstableSlotName:t||null,key:f+"--"+h},(0,s.createElement)(p.__unstableMotion.div,{layout:!S,initial:S?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&f&&o(f,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(w,{"is-with-inserter":B}),onHoverEnd:function(e){e.target!==i.current||l.current||r()},style:y},(0,s.createElement)(p.__unstableMotion.div,{variants:I,className:"block-editor-block-list__insertion-point-indicator"}),B&&(0,s.createElement)(p.__unstableMotion.div,{variants:x,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(pp,{position:"bottom center",clientId:f,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function yp(e){let{children:t,__unstablePopoverSlot:n,__unstableContentRef:o}=e;const r=(0,m.useSelect)((e=>e(Yn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(kp.Provider,{value:(0,s.useRef)(!1)},r&&(0,s.createElement)(_p,{__unstablePopoverSlot:n,__unstableContentRef:o}),t)}function Ep(){const e=(0,s.useContext)(kp),t=(0,m.useSelect)((e=>e(Yn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(Yn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(Yn);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")),c(d))return;const m=(null===(o=n(d))||void 0===o?void 0:o.orientation)||"vertical",f=t.target.getBoundingClientRect(),g=t.clientY-f.top,h=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>g||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>h));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 Cp="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Sp="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function wp(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(Yn),{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 Bp(e,t){const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=t(Yn),i=n(e);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(e),name:i,reusableBlockTitle:s&&l(o(e).ref)}}),[e]),i=wp(e);if(!o||!i)return null;const s=(0,r.getBlockType)(o),a=s?(0,r.__experimentalGetBlockLabel)(s,n):null,c=l||a,d=c&&c!==s.title?c:i.title;return t&&t>0?(0,u.truncate)(d,{length:t}):d}function Ip(e){let{clientId:t,maximumLength:n}=e;return Bp(t,n)}var xp=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{canMoveBlocks:o,getBlockRootClientId:l,getBlockName:i}=e(Yn),s=l(n[0]),a=i(n[0]);return{srcRootClientId:s,isDraggable:o(n,s),icon:null===(t=(0,r.getBlockType)(a))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[f,g,h]=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,Jr.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)(Yn);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:g,onDragEnd:()=>{b(),d.current=!1,h(),i&&i()},__experimentalDragComponent:(0,s.createElement)(cd,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},Tp=function(e){let{clientId:t,rootClientId:n,blockElement:o}=e;const l=wp(t),a=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(Yn),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:h,orientation:v}=a,{setNavigationMode:b,removeBlock:k}=(0,m.useDispatch)(Yn),_=(0,s.useRef)(),y=(0,r.getBlockType)(d),E=(0,r.__experimentalGetAccessibleBlockLabel)(y,f,u+1,v);(0,s.useEffect)((()=>{_.current.focus(),(0,Ft.speak)(E)}),[E]);const{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(Yn),{selectBlock:M,clearSelectedBlock:R,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(Yn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!h}),O=(0,g.__)("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)(Tc,{icon:null==l?void 0:l.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(xp,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:ad,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===fc.UP,l=n===fc.DOWN,i=n===fc.LEFT,s=n===fc.RIGHT,a=n===fc.TAB,c=n===fc.ESCAPE,u=n===fc.ENTER,d=n===fc.SPACE,p=e.shiftKey;if(n===fc.BACKSPACE||n===fc.DELETE)return k(t),void e.preventDefault();const m=I(),f=x(),g=T(f||m),h=N(f||m),v=a&&p||r,b=a&&!p||l,_=i,y=s;let E;if(v)E=g;else if(b)E=h;else if(_){var D;E=null!==(D=w(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=w(F),t=w(m),n=S(F);let o=S(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;if(b){t=o;do{t=Jr.focus.tabbable.findNext(t)}while(t&&o.contains(t));t||(t=o.ownerDocument.defaultView.frameElement,t=Jr.focus.tabbable.findNext(t))}else t=Jr.focus.tabbable.findPrevious(o);t&&(e.preventDefault(),t.focus(),R())}},label:E,className:"block-selection-button_select-button"},(0,s.createElement)(Ip,{clientId:t,maximumLength:35})))))};function Np(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var Pp=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=!Jr.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||Vt()("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 function(e,t,n,o,r){const[l]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!function(e){const[t]=Jr.focus.tabbable.find(e);t&&t.focus()}(e.current)}),[]);(0,Vc.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=Np(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=Np(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}(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)},Mp=(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"})),Rp=(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"})),Lp=(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"})),Ap=(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"}));const Dp=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?Mp:Rp:Lp:"down"===e?"horizontal"===t?(0,g.isRTL)()?Rp:Mp:Ap:null,Op=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move right"):(0,g.__)("Move left"):(0,g.__)("Move up"):"down"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move left"):(0,g.__)("Move right"):(0,g.__)("Move down"):null,Fp=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const f=(0,d.useInstanceId)(Fp),h=(0,u.castArray)(n).length,{blockType:v,isDisabled:b,rootClientId:k,isFirst:_,isLast:y,firstIndex:E,orientation:C="vertical"}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:i,getBlockOrder:s,getBlock:a,getBlockListSettings:c}=e(Yn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),f=t(p),g=t((0,u.last)(d)),h=s(m),v=a(p),b=0===f,k=g===h.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:S,moveBlocksUp:w}=(0,m.useDispatch)(Yn),B="up"===o?w:S,I=`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:Dp(o,C),label:Op(o,C),"aria-describedby":I},a,{onClick:b?null:e=>{B(n,k),a.onClick&&a.onClick(e)},"aria-disabled":b})),(0,s.createElement)("span",{id:I,className:"block-editor-block-mover-button__description"},function(e,t,n,o,r,l,i){const s=n+1,a=e=>"up"===e?"horizontal"===i?(0,g.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,g.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;return r<0&&n?(0,g.__)("Blocks cannot be moved up as they are already at the top"):r>0&&o?(0,g.__)("Blocks cannot be moved down as they are already at the bottom"):r<0&&!n?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
31
  (0,g._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):r>0&&!o?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
32
  (0,g._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):void 0}(e,n,o,r,l);if(o&&r)return(0,g.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
33
  (0,g.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=a("down");if("down"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
42
  (0,g.__)("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,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
43
  (0,g.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
44
  (0,g.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
45
+ (0,g.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(h,v&&v.title,E,_,y,"up"===o?-1:1,C)))})),zp=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Fp,i({direction:"up",ref:t},e)))),Vp=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Fp,i({direction:"down",ref:t},e))));var Hp=(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(Yn),p=(0,u.castArray)(o),m=(0,u.first)(p),f=l(m),g=d((0,u.first)(p)),h=i(m),v=0===h,b=i((0,u.last)(p))===c(g).length-1;return{blockType:f?(0,r.getBlockType)(f.name):null,canMove:a(o,g),rootClientId:g,firstIndex:h,isFirst:v,isLast:b,orientation:null===(n=s(g))||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),h=()=>f(!0),v=()=>f(!1);if(!r||t&&n&&!a)return null;const b=(0,g.__)("Drag");return(0,s.createElement)("div",{className:c()("block-editor-block-mover",{"is-visible":m||!l,"is-horizontal":"horizontal"===u})},!d&&(0,s.createElement)(xp,{clientIds:o,cloneClassname:"block-editor-block-mover__drag-clone"},(e=>(0,s.createElement)(p.Button,i({icon:ad,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:h,onBlur:v},(e=>(0,s.createElement)(zp,i({clientIds:o},e)))),(0,s.createElement)(p.ToolbarItem,{onFocus:h,onBlur:v},(e=>(0,s.createElement)(Vp,i({clientIds:o},e))))))}));const{clearTimeout:Gp,setTimeout:Up}=window,Wp=200;function $p(e){let{ref:t,isFocused:n,debounceTimeout:o=Wp,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=a.current;e&&Gp&&Gp(e)};return(0,s.useEffect)((()=>()=>{c(!1),d()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),a.current=Up((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function jp(e){let{ref:t,debounceTimeout:n=Wp,onChange:o=u.noop}=e;const[r,l]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=$p({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 Kp(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(Yn),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(Yn),{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=wp(n),c=(0,s.useRef)(),{gestures:u}=jp({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,g.sprintf)(
46
  /* translators: %s: Name of the block's parent. */
47
+ (0,g.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(Tc,{icon:a.icon})}))}var qp=(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 Yp(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,g.__)("Preview")),(0,s.createElement)(od,{viewportWidth:500,blocks:t})))))}var Qp=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,g.__)("Transform to"),className:t},i&&(0,s.createElement)(Yp,{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)(Tc,{icon:n,showColors:!0}),l)})))},Xp=(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"})),Zp=window.wp.tokenList,Jp=n.n(Zp);function em(e,t,n){const o=new(Jp())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function tm(e){return(0,u.find)(e,"isDefault")}function nm(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:a}=(0,m.useSelect)((e=>{const{getBlock:n}=e(Yn),o=n(t);if(!o)return{};const l=(0,r.getBlockType)(o.name),{getBlockStyles:i}=e(r.store);return{block:o,blockType:l,styles:i(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:c}=(0,m.useDispatch)(Yn),d=function(e){return e&&0!==e.length?tm(e)?e:[{name:"default",label:(0,g._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(Jp())(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")}(d,a),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])}(l,i);return{onSelect:e=>{const o=em(a,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:f,className:a}}function om(e){let{clientId:t,onSwitch:n=u.noop}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=nm({clientId:t,onSwitch:n});return r&&0!==r.length?(0,s.createElement)(s.Fragment,null,r.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.MenuItem,{key:e.name,icon:l.name===e.name?Xp:null,onClick:()=>o(e)},(0,s.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function rm(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(om,{clientId:o,onSwitch:n}))}const lm=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=lm(e,t,n);if(o)return o}}},im=(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}};function sm(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,g.__)("Preview")),(0,s.createElement)(am,{patterns:t,onSelect:n})))))}function am(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,g.__)("Patterns list")}),t.map((e=>(0,s.createElement)(cm,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function cm(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(cm,`${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)(od,{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 um=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[l,i]=(0,s.useState)(!1),a=((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=lm(r,t.name,o);if(n){e=!0,o.add(n.clientId),im(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]))(n,t);return a.length?(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},l&&(0,s.createElement)(sm,{patterns:a,onSelect:o}),(0,s.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),i(!l)},icon:Mp},(0,g.__)("Patterns"))):null};const dm=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(Yn),l=wp(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,blockTitle:f,patterns:h}=(0,m.useSelect)((e=>{var o;const{getBlockRootClientId:i,getBlockTransformItems:s,__experimentalGetPatternTransformItems:a}=e(Yn),{getBlockStyles:c,getBlockType:d}=e(r.store),{canRemoveBlocks:p}=e(Yn),m=i((0,u.castArray)(t)[0]),[{name:f}]=n,g=1===n.length,h=g&&c(f);let v;var b;g?v=null==l?void 0:l.icon: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:qp;return{possibleBlockTransformations:s(n,m),canRemove:p(t,m),hasBlockStyles:!(null==h||!h.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==h||!h.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)(s.Fragment,null,(0,s.createElement)(Tc,{icon:d,showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,s.createElement)(Ip,{clientId:t,maximumLength:35})))}));const y=f,E=1===n.length?(0,g.sprintf)(
48
  /* translators: %s: block title. */
49
  (0,g.__)("%s: Change block type or style"),f):(0,g.sprintf)(
50
  /* translators: %d: number of blocks. */
51
+ (0,g._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)(Tc,{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)(Ip,{clientId:t,maximumLength:35}))),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)(um,{blocks:n,patterns:h,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,s.createElement)(Qp,{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)(rm,{hoveredBlock:n[0],onSwitch:l}))})))))};var pm=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(Yn).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)(dm,{clientIds:t,blocks:n})};const{Fill:mm,Slot:fm}=(0,p.createSlotFill)("__unstableBlockToolbarLastItem");mm.Slot=fm;var gm=mm,hm=(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"})),vm=window.wp.blob;function bm(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;return 1!==(null===(n=t.match(e))||void 0===n?void 0:n.length)}return!1}function km(){const{getBlockName:e}=(0,m.useSelect)(Yn),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(Ed.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,g.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph".
52
  (0,g.__)('Copied "%s" to clipboard.'),s):(0,g.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
53
  (0,g.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,g.sprintf)(// Translators: %d: Number of blocks being copied.
54
  (0,g._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,g.sprintf)(// Translators: %d: Number of blocks being cut.
55
+ (0,g._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function _m(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:l,__unstableIsSelectionMergeable:i,__unstableGetSelectedBlocksWithPartialSelection:s}=(0,m.useSelect)(Yn),{flashBlock:a,removeBlocks:c,replaceBlocks:u,__unstableDeleteSelection:p,__unstableExpandSelection:f}=(0,m.useDispatch)(Yn),g=km();return(0,d.useRefEffect)((d=>{function m(m){const h=t();if(0===h.length)return;if(!n()){const{target:e}=m,{ownerDocument:t}=e;if("copy"===m.type||"cut"===m.type?(0,Jr.documentHasUncollapsedSelection)(t):(0,Jr.documentHasSelection)(t))return}if(!d.contains(m.target.ownerDocument.activeElement))return;const v=m.defaultPrevented;m.preventDefault();const b=l(),k=i(),_=!b&&!k;if("copy"===m.type||"cut"===m.type)if(1===h.length&&a(h[0]),_)f();else{let t;if(g(m.type,h),b)t=e(h);else{const[n,o]=s();t=[n,...e(h.slice(1,h.length-1)),o]}const n=(0,r.serialize)(t);m.clipboardData.setData("text/plain",n),m.clipboardData.setData("text/html",n)}if("cut"===m.type)b&&!_?c(h):p();else if("paste"===m.type){if(v)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,Jr.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!bm(r,o)&&(o=r.map((e=>`<img src="${(0,vm.createBlobURL)(e)}">`)).join(""),n=""),{html:o,plainText:n}}(m),l=(0,r.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});u(h,l,l.length-1,-1)}}return d.ownerDocument.addEventListener("copy",m),d.ownerDocument.addEventListener("cut",m),d.ownerDocument.addEventListener("paste",m),()=>{d.ownerDocument.removeEventListener("copy",m),d.ownerDocument.removeEventListener("cut",m),d.ownerDocument.removeEventListener("paste",m)}}),[])}var ym=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:_m()},t)};function Em(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,m.useSelect)(Yn),{getDefaultBlockName:d,getGroupingBlockName:p}=(0,m.useSelect)(r.store),f=s(t),g=i(t[0]),h=(0,u.every)(f,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,g))),v=l(d(),g),b=a(t,g),k=c(t,g),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:S,flashBlock:w,setBlockMovingClientId:B,setNavigationMode:I,selectBlock:x}=(0,m.useDispatch)(Yn),T=km();return n({canDuplicate:h,canInsertDefaultBlock:v,canMove:b,canRemove:k,rootClientId:g,blocks:f,onDuplicate:()=>E(t,o),onRemove:()=>_(t,o),onInsertBefore(){S((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&&w(e[0]),T("copy",e)}})}var Cm=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(Yn),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(Yn).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,g.__)("Edit as HTML"):(0,g.__)("Edit visually");return(0,s.createElement)(p.MenuItem,{onClick:o},!l&&a)})),Sm=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(Yn).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(Yn).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,g.__)("Convert to Blocks");return(0,s.createElement)(p.MenuItem,{onClick:n},!o&&r)}));const{Fill:wm,Slot:Bm}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");wm.Slot=Bm;var Im=wm;function xm(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(Yn);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,g._x)("Group","verb")),o&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),a()}},(0,g._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function Tm(){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(Yn),{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,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}}var Nm=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"})),Pm=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"}));function Mm(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,m.useSelect)((n=>{const{canEditBlock:o,canMoveBlock:r,canRemoveBlock:l,canLockBlockType:i,getBlockName:s,getBlockRootClientId:a}=n(Yn),c=t?a(e):null,u=o(e),d=r(e,c),p=l(e,c);return{canEdit:u,canMove:d,canRemove:p,canLock:i(s(e)),isLocked:!u||!d||!p}}),[e,t])}function Rm(e){let{clientId:t,onClose:n}=e;const[o,l]=(0,s.useState)({move:!1,remove:!1}),{canEdit:i,canMove:a,canRemove:c}=Mm(t,!0),{isReusable:u}=(0,m.useSelect)((e=>{const{getBlockName:n}=e(Yn),o=n(t);return{isReusable:(0,r.isReusableBlock)((0,r.getBlockType)(o))}}),[t]),{updateBlockAttributes:f}=(0,m.useDispatch)(Yn),h=wp(t),v=(0,d.useInstanceId)(Rm,"block-editor-block-lock-modal__options-title");(0,s.useEffect)((()=>{l({move:!a,remove:!c,...u?{edit:!i}:{}})}),[i,a,c,u]);const b=Object.values(o).every(Boolean),k=Object.values(o).some(Boolean)&&!b;return(0,s.createElement)(p.Modal,{title:(0,g.sprintf)(
56
  /* translators: %s: Name of the block. */
57
+ (0,g.__)("Lock %s"),h.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,g.__)("Close"),onRequestClose:n},(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),f([t],{lock:o}),n()}},(0,s.createElement)("p",null,(0,g.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("div",{role:"group","aria-labelledby":v,className:"block-editor-block-lock-modal__options"},(0,s.createElement)(p.CheckboxControl,{className:"block-editor-block-lock-modal__options-title",label:(0,s.createElement)("span",{id:v},(0,g.__)("Lock all")),checked:b,indeterminate:k,onChange:e=>l({move:e,remove:e,...u?{edit:e}:{}})}),(0,s.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},u&&(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Restrict editing"),(0,s.createElement)(p.Icon,{icon:o.edit?Pm:Nm})),checked:!!o.edit,onChange:e=>l((t=>({...t,edit:e})))})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Disable movement"),(0,s.createElement)(p.Icon,{icon:o.move?Pm:Nm})),checked:o.move,onChange:e=>l((t=>({...t,move:e})))})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Prevent removal"),(0,s.createElement)(p.Icon,{icon:o.remove?Pm:Nm})),checked:o.remove,onChange:e=>l((t=>({...t,remove:e})))})))),(0,s.createElement)(p.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"tertiary",onClick:n},(0,g.__)("Cancel"))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"primary",type:"submit"},(0,g.__)("Apply"))))))}function Lm(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=Mm(t,!0),[r,l]=(0,s.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,g.__)("Unlock"):(0,g.__)("Lock");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{icon:o?Nm:Pm,onClick:l},i),r&&(0,s.createElement)(Rm,{clientId:t,onClose:l}))}const{Fill:Am,Slot:Dm}=(0,p.createSlotFill)("BlockSettingsMenuControls");function Om(e){let{...t}=e;return(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(Am,t))}Om.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:o,selectedClientIds:r,canRemove:l}=(0,m.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(Yn),l=null!==n?n:o();return{selectedBlocks:(0,u.map)((0,u.compact)(t(l)),(e=>e.name)),selectedClientIds:l,canRemove:r(l)}}),[n]),a=1===r.length,c=Tm(),{isGroupable:d,isUngroupable:f}=c,g=(d||f)&&l;return(0,s.createElement)(Dm,{fillProps:{...t,selectedBlocks:o,selectedClientIds:r}},(e=>!(null!=e&&e.length)>0&&!g&&!a?null:(0,s.createElement)(p.MenuGroup,null,a&&(0,s.createElement)(Lm,{clientId:r[0]}),e,g&&(0,s.createElement)(xm,i({},c,{onClose:null==t?void 0:t.onClose})))))};var Fm=Om;const zm={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function Vm(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,g.__)("Copy"))}var Hm=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...l}=e;const a=(0,u.castArray)(t),c=a.length,d=a[0],{firstParentClientId:f,hasReducedUI:h,onlyBlock:v,parentBlockType:b,previousBlockClientId:k,nextBlockClientId:_,selectedBlockClientIds:y}=(0,m.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockParents:o,getPreviousBlockClientId:l,getNextBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a}=e(Yn),c=o(d),u=c[c.length-1],p=n(u);return{firstParentClientId:u,hasReducedUI:a().hasReducedUI,onlyBlock:1===t(),parentBlockType:(0,r.getBlockType)(p),previousBlockClientId:l(d),nextBlockClientId:i(d),selectedBlockClientIds:s()}}),[d]),E=(0,m.useSelect)((e=>{const{getShortcutRepresentation:t}=e(Vc.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")}}),[]),{selectBlock:C,toggleBlockHighlight:S}=(0,m.useDispatch)(Yn),w=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:u.noop,[n]),B=Bp(d,25),I=(0,s.useCallback)(n?()=>{const e=k||_;e&&y.includes(d)&&!y.includes(e)&&n(e)}:u.noop,[n,k,_,y]),x=(0,g.sprintf)(
58
  /* translators: %s: block name */
59
+ (0,g.__)("Remove %s"),B),T=1===c?x:(0,g.__)("Remove blocks"),N=(0,s.useRef)(),{gestures:P}=jp({ref:N,onChange(e){e&&h||S(f,e)}});return(0,s.createElement)(Em,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:a,canRemove:m,onDuplicate:h,onInsertAfter:k,onInsertBefore:_,onRemove:y,onCopy:S,onMoveTo:B,blocks:x}=e;return(0,s.createElement)(p.DropdownMenu,i({icon:hm,label:(0,g.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:zm,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(Im.Slot,{fillProps:{onClose:l}}),void 0!==f&&(0,s.createElement)(p.MenuItem,i({},P,{ref:N,icon:(0,s.createElement)(Tc,{icon:b.icon}),onClick:()=>C(f)}),(0,g.sprintf)(
60
+ /* translators: %s: Name of the block's parent. */
61
+ (0,g.__)("Select parent block (%s)"),b.title)),1===c&&(0,s.createElement)(Sm,{clientId:d}),(0,s.createElement)(Vm,{blocks:x,onCopy:S}),n&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,h,w),shortcut:E.duplicate},(0,g.__)("Duplicate")),r&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,_),shortcut:E.insertBefore},(0,g.__)("Insert before")),(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,k),shortcut:E.insertAfter},(0,g.__)("Insert after"))),a&&!v&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,B)},(0,g.__)("Move to")),1===c&&(0,s.createElement)(Cm,{clientId:d,onToggle:l})),(0,s.createElement)(Fm.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,y,I),shortcut:E.remove},T)))}))}))},Gm=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Hm,i({clientIds:t,toggleProps:e},n)))))};function Um(e){let{clientId:t}=e;const n=wp(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=Mm(t),[a,c]=(0,s.useReducer)((e=>!e),!1);return i?o&&r&&l?null:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,s.createElement)(p.ToolbarButton,{icon:Pm,label:(0,g.sprintf)(
62
  /* translators: %s: block name */
63
+ (0,g.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(Rm,{clientId:t,onClose:c})):null}var Wm=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.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"})),$m=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"})),jm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"}));const Km={group:void 0,row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var qm=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=Tm(),{replaceBlocks:l}=(0,m.useDispatch)(Yn),{canRemove:i}=(0,m.useSelect)((e=>{const{canRemoveBlocks:n}=e(Yn);return{canRemove:n(t)}}),[t]),a=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"group";const i=(0,r.switchToBlockType)(e,n);i&&i.length>0&&(i[0].attributes.layout=Km[o],l(t,i))};return o&&i?(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{icon:Wm,label:(0,g._x)("Group","verb"),onClick:a}),(0,s.createElement)(p.ToolbarButton,{icon:$m,label:(0,g._x)("Row","single horizontal line"),onClick:()=>a("row")}),(0,s.createElement)(p.ToolbarButton,{icon:jm,label:(0,g._x)("Stack","verb"),onClick:()=>a("stack")})):null},Ym=(0,s.createContext)(""),Qm=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:a,hasReducedUI:u,isValid:f,isVisual:g}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:s}=e(Yn),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:h}=(0,m.useDispatch)(Yn),v=(0,s.useRef)(),{showMovers:b,gestures:k}=jp({ref:v,onChange(e){e&&u||h(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&&g,C=n.length>1,S=c()("block-editor-block-toolbar",y&&"is-showing-movers");return(0,s.createElement)("div",{className:S},!C&&!_&&(0,s.createElement)(Kp,{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)(pm,{clientIds:n}),!C&&(0,s.createElement)(Um,{clientId:n[0]}),(0,s.createElement)(Hp,{clientIds:n,hideDragHandle:t||u}))),E&&C&&(0,s.createElement)(qm,null),E&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(lo.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(lo.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(lo.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(lo.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(lo.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Ym.Provider,{value:null==l?void 0:l.name},(0,s.createElement)(gm.Slot,null))),(0,s.createElement)(Gm,{clientIds:n}))},Xm=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(Yn),{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)(Pp,i({focusOnMount:t,className:d
64
+ /* translators: accessibility text for the block toolbar */,"aria-label":(0,g.__)("Block tools")},o),(0,s.createElement)(Qm,{hideDragHandle:n}))};function Zm(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isCaretWithinFormattedText:l,getSettings:i,getLastMultiSelectedBlockClientId:s}=e(Yn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),isCaretWithinFormattedText:l(),hasMultiSelection:o(),hasFixedToolbar:i().hasFixedToolbar,lastClientId:s()}}function Jm(e){let{clientId:t,rootClientId:n,isValid:o,isEmptyDefaultBlock:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:a}=e;const{isNavigationMode:u,isMultiSelecting:f,isTyping:g,isCaretWithinFormattedText:h,hasMultiSelection:v,hasFixedToolbar:b,lastClientId:k}=(0,m.useSelect)(Zm,[]),_=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(Yn);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),[S,w]=(0,s.useState)(!1),{stopTyping:B}=(0,m.useDispatch)(Yn),I=!g&&!u&&r&&o,x=u,T=!u&&!b&&y&&!I&&!f&&(!g||h),N=!(u||T||b||r);(0,Vc.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=So(t),R=So(k),L=So(l),A=bp(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,Jr.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(){w(!0)},onBlur:function(){w(!1)},tabIndex:-1,className:c()("block-editor-block-list__block-popover-inserter",{"is-visible":S})},(0,s.createElement)(pp,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(T||E)&&(0,s.createElement)(Xm,{focusOnMount:E,__experimentalInitialIndex:P.current,__experimentalOnIndexChange:e=>{P.current=e},key:t}),x&&(0,s.createElement)(Tp,{clientId:t,rootClientId:n,blockElement:D}),I&&(0,s.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,s.createElement)(pp,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function ef(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(Yn),a=t()||n();if(!a)return;const{name:c,attributes:d={},isValid:p}=l(a)||{},m=i(a),f=s(m),g=(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:g}}function tf(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(ef,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u}=o;return i?(0,s.createElement)(Jm,{clientId:r,rootClientId:l,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function nf(e){let{children:t}=e;const n=(0,s.useContext)(kp),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(Vt()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(yp,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(tf,{__unstablePopoverSlot:"block-toolbar"}),t))}var of=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Jn();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),rf=of((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(hp,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),lf=(0,d.compose)([of,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(Yn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(mp,{rootClientId:t})})),sf=window.wp.isShallowEqual,af=n.n(sf);const cf=new WeakMap;function uf(e,t){const n=(0,m.useSelect)((e=>e(Yn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(Yn),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(Yn),d=function(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)}}}(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,Jr.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?p(t):d(e)}}function df(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 pf(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=df(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function mf(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,g.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=pf(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function ff(){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(Yn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(Yn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(Yn),a=uf(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=mf(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 gf(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:g,orientation:h,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(Yn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(Yn).getBlockRootClientId(e);return{blockListSettings:t(Yn).getBlockListSettings(e),parentLock:t(Yn).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=Ir(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),af()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,h,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(Yn),{replaceInnerBlocks:i}=(0,m.useDispatch)(Yn),a=(0,m.useSelect)((t=>t(Yn).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(Yn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){cf.has(t)||cf.set(t,new WeakMap);const n=cf.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)(tl,{value:k},(0,s.createElement)(wf,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function hf(e){return Pc(e),(0,s.createElement)(gf,e)}const vf=(0,s.forwardRef)(((e,t)=>{const n=bf({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function bf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=Jn(),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(Yn),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,ff({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?hf:gf;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)(wf,t)}}bf.save=r.__unstableGetInnerBlocksProps,vf.DefaultBlockAppender=lf,vf.ButtonBlockAppender=rf,vf.Content=()=>bf.save().children;var kf=vf;const _f=(0,s.createContext)(),yf=(0,s.createContext)();function Ef(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(Yn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),p=bf({ref:(0,d.useMergeRefs)([Lc(),Ep(),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)(_f.Provider,{value:o},(0,s.createElement)("div",p))}function Cf(e){return function(){const e=(0,m.useSelect)((e=>e(Yn).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(Yn).__experimentalGetParsedPattern(e[n].name),t=Cp(o))};return t=Cp(o),()=>Sp(t)}),[e])}(),(0,s.createElement)(nf,null,(0,s.createElement)(Zn,{value:Qn},(0,s.createElement)(Ef,e)))}function Sf(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=xr}=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(Yn);return{order:t(n),selectedBlocks:o()}}),[n]);return(0,s.createElement)(Nr,{value:l},(0,s.createElement)(yf.Provider,{value:c},u.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,s.createElement)(Cc,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,s.createElement)(vp,{tagName:r,rootClientId:n,renderAppender:o}))}function wf(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(Sf,e))}Cf.__unstableElementContext=_f;const Bf=["colors","disableCustomColors","gradients","disableCustomGradients"];function If(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:f,colorValue:h,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,S]=(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",{className:"block-editor-color-gradient-control__fieldset"},(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:S,label:(0,g.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,g.__)("Solid")}),(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,g.__)("Gradient")})),("color"===C||!E)&&(0,s.createElement)(p.ColorPalette,{value:h,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 xf(e){const t={};return t.colors=xo("color.palette"),t.gradients=xo("color.gradients"),t.disableCustomColors=!xo("color.custom"),t.disableCustomGradients=!xo("color.customGradient"),(0,s.createElement)(If,i({},t,e))}var Tf=function(e){return(0,u.every)(Bf,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(If,e):(0,s.createElement)(xf,e)};function Nf(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)=>e&&(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)(Tf,i({showTitle:!1,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d},e))}))))}function Pf(){return{disableCustomColors:!xo("color.custom"),disableCustomGradients:!xo("color.customGradient")}}function Mf(){const e=Pf(),t=xo("color.palette.custom"),n=xo("color.palette.theme"),o=xo("color.palette.default"),r=xo("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,g._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=xo("color.gradients.custom"),i=xo("color.gradients.theme"),a=xo("color.gradients.default"),c=xo("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,g._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}wu([Bu,Tu]);const Rf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Lf=(e,t)=>(0,u.find)(e,{color:t});function Af(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}const Df=[];function Of(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=Mf(),l=r.colors.reduce(((e,t)=>e.concat(t.colors)),[]),{color:a}=(null==n?void 0:n.border)||{},[c,u]=(0,s.useState)((()=>{var e;return null===(e=Rf(l,t,a))||void 0===e?void 0:e.color}));(0,s.useEffect)((()=>{var e;u(null===(e=Rf(l,t,a))||void 0===e?void 0:e.color)}),[t,a,l]);const d=[{label:(0,g.__)("Color"),onColorChange:e=>{u(e);const t=Lf(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:Po(r),borderColor:i})},colorValue:c,clearable:!1}];return(0,s.createElement)(Nf,i({settings:d,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function Ff(e,t,n){var o;if(!cg(t,"color")||Lo(t,sg,"color"))return e;const{borderColor:r,style:l}=n,i=Af("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 zf=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const{name:r,attributes:l}=t,{borderColor:a}=l,c=xo("color.palette")||Df;if(!cg(r,"color")||Lo(r,sg,"color"))return(0,s.createElement)(e,t);const u={borderColor:a?null===(n=Rf(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 Vf(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Hf(){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.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=Vf(o),i=0===r||r?`${r}${l}`:void 0;return i}function Gf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Hf(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function Uf(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Wf(e){let{onChange:t,values:n,...o}=e;const r=Hf(n),l=Uf(n)&&Gf(n),a=l?(0,g.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,g.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return cg(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Ff),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!cg(e,"color")||Lo(e,sg,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Ff(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",zf);const $f={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function jf(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($f).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 Kf=(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"})),qf=(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 Yf(e){let{isLinked:t,...n}=e;const o=t?(0,g.__)("Unlink Radii"):(0,g.__)("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?Kf:qf,iconSize:16,"aria-label":o})))}const Qf={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},Xf={px:100,em:20,rem:20};function Zf(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!Uf(n)||!Gf(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:xo("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.__experimentalParseQuantityAndUnitFromRawValue)(e);return t||"px"}return Vf(Object.values(e).map((e=>{const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t})))||"px"}(n),a=l&&l.find((e=>e.value===i)),c=(null==a?void 0:a.step)||1,[u]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(Hf(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,g.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Wf,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,units:l}),(0,s.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:Xf[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(jf,{min:0,onChange:t,values:n||Qf,units:l}),(0,s.createElement)(Yf,{onClick:()=>r(!o),isLinked:o})))}function Jf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Zf,{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=Po(t)),o({style:t})}})}var eg=(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"})),tg=(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"})),ng=(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 og=[{label:(0,g.__)("Solid"),icon:eg,value:"solid"},{label:(0,g.__)("Dashed"),icon:tg,value:"dashed"},{label:(0,g.__)("Dotted"),icon:ng,value:"dotted"}];function rg(e){let{onChange:t,value:n}=e;return(0,s.createElement)("fieldset",{className:"components-border-style-control"},(0,s.createElement)("legend",null,(0,g.__)("Style")),(0,s.createElement)("div",{className:"components-border-style-control__buttons"},og.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 lg=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(rg,{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:Po(t)})}})},ig=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)(),[m,f]=(0,s.useState)(),h=(0,p.__experimentalUseCustomUnits)({availableUnits:xo("spacing.units")||["px","em","rem"]});return(0,s.createElement)(p.__experimentalUnitControl,{value:r,label:(0,g.__)("Width"),min:0,onChange:e=>{let s={...n,border:{...null==n?void 0:n.border,width:e}},p=t;const g=0===parseFloat(e),h=0===parseFloat(r);g&&!h&&(d(t),f(l),c(i),p=void 0,s.border.color=void 0,s.border.style="none"),!g&&h&&("none"===i&&(s.border.style=a),void 0===t&&(p=u,s.border.color=m)),void 0!==e&&""!==e||(s=Po(s)),o({borderColor:p,style:s})},units:h})},sg="__experimentalBorder";function ag(e){const{clientId:t}=e,n=xo("border.color")&&cg(e.name,"color"),o=xo("border.radius")&&cg(e.name,"radius"),l=xo("border.style")&&cg(e.name,"style"),i=xo("border.width")&&cg(e.name,"width");if([!n,!o,!l,!i].every(Boolean))return null;const a=(0,r.getBlockSupport)(e.name,[sg,"__experimentalDefaultControls"]),c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{var o;return{...n,...t,style:{...n.style,border:{...null===(o=n.style)||void 0===o?void 0:o.border,[e]:void 0}}}}};return(0,s.createElement)(Vo,{__experimentalGroup:"border"},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.border)||void 0===n||!n.width)}(e),label:(0,g.__)("Width"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:ug(o,"width")})}(e),isShownByDefault:null==a?void 0:a.width,resetAllFilter:c("width"),panelId:t},(0,s.createElement)(ig,e)),l&&(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.border)||void 0===n||!n.style)}(e),label:(0,g.__)("Style"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:ug(o,"style")})}(e),isShownByDefault:null==a?void 0:a.style,resetAllFilter:c("style"),panelId:t},(0,s.createElement)(lg,e)),n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{attributes:{borderColor:n,style:o}}=e;return!!n||!(null==o||null===(t=o.border)||void 0===t||!t.color)}(e),label:(0,g.__)("Color"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({borderColor:void 0,style:ug(o,"color")})}(e),isShownByDefault:null==a?void 0:a.color,resetAllFilter:c("color",{borderColor:void 0}),panelId:t},(0,s.createElement)(Of,e)),o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,g.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:ug(o,"radius")})}(e),isShownByDefault:null==a?void 0:a.radius,resetAllFilter:c("radius"),panelId:t},(0,s.createElement)(Jf,e)))}function cg(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,sg);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 ug(e,t){return Po({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function dg(e){if(e)return`has-${e}-gradient-background`}function pg(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function mg(e,t){return(0,u.find)(e,["gradient",t])}function fg(e,t){const n=mg(e,t);return n&&n.slug}function gg(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Jn(),o=xo("color.gradients.custom"),r=xo("color.gradients.theme"),l=xo("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(Yn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(Yn),d=(0,s.useCallback)((o=>{const r=fg(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=dg(a);let f;return f=a?pg(i,a):c,{gradientClass:p,gradientValue:f,setGradient:d}}wu([Bu,Tu]);var hg=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:a,linkColor:c,enableAlphaChecker:u=!1}=e;const d=t||n;if(!d)return null;const m=a||o,f=c||r;if(!m&&!f)return null;const h=[{color:m,description:(0,g.__)("text color")},{color:f,description:(0,g.__)("link color")}],v=Cu(d),b=v.alpha()<1,k=v.brightness(),_={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of h){if(!e.color)continue;const t=Cu(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
65
  (0,g.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
66
+ (0,g.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,g.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,g.__)("Transparent text may be hard for people to read."),E=(0,g.__)("Transparent text may be hard for people to read."))}return y?((0,Ft.speak)(E),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(p.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function vg(e){var t;let{settings:n,enableAlpha:o,...r}=e;const l={...Mf(),clearable:!1,enableAlpha:o,label:n.label,onColorChange:n.onColorChange,onGradientChange:n.onGradientChange,colorValue:n.colorValue,gradientValue:n.gradientValue},a=null!==(t=n.gradientValue)&&void 0!==t?t:n.colorValue;return(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:n.hasValue,label:n.label,onDeselect:n.onDeselect,isShownByDefault:n.isShownByDefault,resetAllFilter:n.resetAllFilter},r,{className:"block-editor-tools-panel-color-gradient-settings__item"}),(0,s.createElement)(p.Dropdown,{className:"block-editor-tools-panel-color-dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:e=>{let{isOpen:t,onToggle:o}=e;return(0,s.createElement)(p.Button,{onClick:o,"aria-expanded":t,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":t})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:a}),(0,s.createElement)(p.FlexItem,null,n.label)))},renderContent:()=>(0,s.createElement)(Tf,i({showTitle:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},l))}))}function bg(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function kg(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)(),p=Co(o);return(0,s.useEffect)((()=>{var e;if(!r)return;if(!p.current)return;c(bg(p.current).color);const t=null===(e=p.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&d(bg(t).color);let n=p.current,o=bg(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=bg(n).backgroundColor;i(o)})),(0,s.createElement)(Vo,{__experimentalGroup:"color"},n.map(((e,n)=>(0,s.createElement)(vg,{key:n,settings:e,panelId:o,enableAlpha:t}))),r&&(0,s.createElement)(hg,{backgroundColor:l,textColor:a,enableAlphaChecker:t,linkColor:u}))}const _g="color",yg=e=>{const t=(0,r.getBlockSupport)(e,_g);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Eg=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,_g);return(0,u.isObject)(t)&&!!t.link},Cg=e=>{const t=(0,r.getBlockSupport)(e,_g);return(0,u.isObject)(t)&&!!t.gradients},Sg=e=>{const t=(0,r.getBlockSupport)(e,_g);return t&&!1!==t.background},wg=e=>{const t=(0,r.getBlockSupport)(e,_g);return t&&!1!==t.text},Bg=e=>t=>{var n,o,r,l,i,s,a,c,u,d;return"background"===e?!!(t.attributes.backgroundColor||null!==(r=t.attributes.style)&&void 0!==r&&null!==(l=r.color)&&void 0!==l&&l.background||t.attributes.gradient||null!==(i=t.attributes.style)&&void 0!==i&&null!==(s=i.color)&&void 0!==s&&s.gradient):"link"===e?!(null===(a=t.attributes.style)||void 0===a||null===(c=a.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text):!!t.attributes[`${e}Color`]||!(null===(n=t.attributes.style)||void 0===n||null===(o=n.color)||void 0===o||!o[e])},Ig=(e,t)=>Po(Mo(t,e,void 0)),xg=e=>({textColor:void 0,style:Ig(["color","text"],e.style)}),Tg=e=>({style:Ig(["elements","link","color","text"],e.style)}),Ng=e=>{var t;return{backgroundColor:void 0,gradient:void 0,style:{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,background:void 0,gradient:void 0}}}};function Pg(e,t,n){var o,r,l,i,s,a;if(!yg(t)||Lo(t,_g))return e;const u=Cg(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,g=e=>!Lo(t,_g,e),h=g("text")?Af("color",p):void 0,v=g("gradients")?dg(m):void 0,b=g("background")?Af("background-color",d):void 0,k=g("background")||g("gradients"),_=d||(null==f||null===(o=f.color)||void 0===o?void 0:o.background)||u&&(m||(null==f||null===(r=f.color)||void 0===r?void 0:r.gradient)),y=c()(e.className,h,v,{[b]:!(u&&null!=f&&null!==(l=f.color)&&void 0!==l&&l.gradient||!b),"has-text-color":g("text")&&(p||(null==f||null===(i=f.color)||void 0===i?void 0:i.text)),"has-background":k&&_,"has-link-color":g("link")&&(null==f||null===(s=f.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color)});return e.className=y||void 0,e}const Mg=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Rf(e,n[1]).color:t};function Rg(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,f=xo("color.palette.custom"),h=xo("color.palette.theme"),v=xo("color.palette.default"),b=(0,s.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=xo("color.gradients.custom"),_=xo("color.gradients.theme"),y=xo("color.gradients.default"),E=(0,s.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=xo("color.custom"),S=xo("color.customGradient"),w=xo("color.background"),B=xo("color.link"),I=xo("color.text"),x=C||!h||(null==h?void 0:h.length)>0,T=S||!_||(null==_?void 0:_.length)>0,N=(0,s.useRef)(m);if((0,s.useEffect)((()=>{N.current=m}),[m]),!yg(p))return null;const P=Eg(p)&&B&&x,M=wg(p)&&I&&x,R=Sg(p)&&w&&x,L=Cg(p)&&T;if(!(P||M||R||L))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(L&&F)z=pg(E,F);else if(L){var V;z=null==A||null===(V=A.color)||void 0===V?void 0:V.gradient}const H=t=>n=>{var o,r;const l=Lf(b,n),i=t+"Color",s={...N.current.style,color:{...null===(o=N.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:Po(s),[i]:a};e.setAttributes(c),N.current={...N.current,...c}},G=!("web"!==s.Platform.OS||F||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient),U=(0,r.getBlockSupport)(e.name,[_g,"__experimentalDefaultControls"]);return(0,s.createElement)(kg,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,g.__)("Text"),onColorChange:H("text"),colorValue:Rf(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,hasValue:()=>Bg("text")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({textColor:void 0,style:Ig(["color","text"],t.style)})})(e),resetAllFilter:xg}]:[],...R||L?[{label:(0,g.__)("Background"),onColorChange:R?H("background"):void 0,colorValue:Rf(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:L?t=>{const n=fg(E,t);let o;if(n){var r,l,i;const e={...null===(r=N.current)||void 0===r?void 0:r.style,color:{...null===(l=N.current)||void 0===l||null===(i=l.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:Po(e),gradient:n}}else{var s,a,c;const e={...null===(s=N.current)||void 0===s?void 0:s.style,color:{...null===(a=N.current)||void 0===a||null===(c=a.style)||void 0===c?void 0:c.color,gradient:t}};o={style:Po(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,hasValue:()=>Bg("background")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n(Ng(t))})(e),resetAllFilter:Ng}]:[],...P?[{label:(0,g.__)("Link"),onColorChange:t=>{const n=Lf(b,t),o=null!=n&&n.slug?`var:preset|color|${n.slug}`:t,r=Po(Mo(A,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:Mg(b,null==A||null===(l=A.elements)||void 0===l||null===(i=l.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==A||null===(c=A.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text),isShownByDefault:null==U?void 0:U.link,hasValue:()=>Bg("link")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({style:Ig(["elements","link","color","text"],t.style)})})(e),resetAllFilter:Tg}]:[]]})}const Lg=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=xo("color.palette.custom")||[],u=xo("color.palette.theme")||[],d=xo("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!yg(o)||Lo(o,_g))return(0,s.createElement)(e,t);const m={};var f,g;a&&!Lo(o,_g,"text")&&(m.color=null===(f=Rf(p,a))||void 0===f?void 0:f.color),l&&!Lo(o,_g,"background")&&(m.backgroundColor=null===(g=Rf(p,l))||void 0===g?void 0:g.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:h}))})),Ag={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,l.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return yg(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Cg(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Pg),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!yg(e)||Lo(e,_g))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Pg(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",Lg),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return Ro({linkColor:Eg(r),textColor:wg(r),backgroundColor:Sg(r),gradient:Cg(r)},Ag,e,t,n,o)}));const Dg=[{name:(0,g._x)("Regular","font style"),value:"normal"},{name:(0,g._x)("Italic","font style"),value:"italic"}],Og=[{name:(0,g._x)("Thin","font weight"),value:"100"},{name:(0,g._x)("Extra Light","font weight"),value:"200"},{name:(0,g._x)("Light","font weight"),value:"300"},{name:(0,g._x)("Regular","font weight"),value:"400"},{name:(0,g._x)("Medium","font weight"),value:"500"},{name:(0,g._x)("Semi Bold","font weight"),value:"600"},{name:(0,g._x)("Bold","font weight"),value:"700"},{name:(0,g._x)("Extra Bold","font weight"),value:"800"},{name:(0,g._x)("Black","font weight"),value:"900"}],Fg=(e,t)=>e?t?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight");function zg(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=Fg(n,o),c={key:"default",name:(0,g.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,s.useMemo)((()=>n&&o?(()=>{const e=[c];return Dg.forEach((t=>{let{name:n,value:o}=t;Og.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,g.sprintf)(
67
  /* translators: 1: Font weight name. 2: Font style name. */
68
+ (0,g.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return Dg.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 Og.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,g.sprintf)(// translators: %s: Currently selected font appearance.
69
  (0,g.__)("Currently selected font appearance: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font style.
70
  (0,g.__)("Currently selected font style: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font weight.
71
+ (0,g.__)("Currently selected font weight: %s"),d.name):(0,g.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}var Vg=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px"}=e;const l=function(e){return void 0!==e&&""!==e}(t),i=l?t:"";o||Vt()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const a=o?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:a},(0,s.createElement)(p.__experimentalNumberControl,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),r=((e,t)=>{if(l)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,g.__)("Line height"),placeholder:1.5,step:.1,value:i,min:0}))};const Hg="typography.lineHeight";function Gg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Vg,{__unstableInputWidth:"100%",__nextHasNoMarginBottom:!0,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:Po(t)})}})}function Ug(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!xo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Hg)||t}const Wg="typography.__experimentalFontStyle",$g="typography.__experimentalFontWeight";function jg(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Kg(e),i=!qg(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)(zg,{onChange:e=>{r({style:Po({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function Kg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Wg),n=xo("typography.fontStyle");return!t||!n}function qg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,$g),n=xo("typography.fontWeight");return!t||!n}function Yg(e){const t=Kg(e),n=qg(e);return t&&n}function Qg(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=xo("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,g.__)("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,g.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const Xg="typography.__experimentalFontFamily";function Zg(e,t,n){if(!(0,r.hasBlockSupport)(t,Xg))return e;if(Lo(t,Nh,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(Jp())(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 Jg(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=xo("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)(Qg,{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 eh(e){let{name:t}=e;const n=xo("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Xg)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Xg)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Zg),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Xg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Zg(o,e,n)},e}));const th=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function nh(e,t){return(0,u.find)(e,{size:t})||{size:t}}function oh(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var rh=function(e){const t=xo("typography.fontSizes"),n=!xo("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const lh="typography.fontSize";function ih(e,t,n){if(!(0,r.hasBlockSupport)(t,lh))return e;if(Lo(t,Nh,"fontSize"))return e;const o=new(Jp())(e.className);o.add(oh(n.fontSize));const l=o.value;return e.className=l||void 0,e}function sh(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=xo("typography.fontSizes"),a=th(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)(rh,{onChange:e=>{const t=nh(i,e).slug;l({style:Po({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function ah(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=xo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,lh)||!n}const ch=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=xo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,lh)||Lo(i,Nh,"fontSize")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=th(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"),uh={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,lh)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",ih),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,lh))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),ih(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",ch),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return Ro({fontSize:(0,r.hasBlockSupport)(l,lh)},uh,e,t,n,o)}));var dh=(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"})),ph=(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 mh=[{name:(0,g.__)("Underline"),value:"underline",icon:dh},{name:(0,g.__)("Strikethrough"),value:"line-through",icon:ph}];function fh(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,g.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},mh.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 gh="typography.__experimentalTextDecoration";function hh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(fh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:Po({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function vh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,gh),n=xo("typography.textDecoration");return t||!n}var bh=(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"})),kh=(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"})),_h=(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 yh=[{name:(0,g.__)("Uppercase"),value:"uppercase",icon:bh},{name:(0,g.__)("Lowercase"),value:"lowercase",icon:kh},{name:(0,g.__)("Capitalize"),value:"capitalize",icon:_h}];function Eh(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,g.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},yh.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 Ch="typography.__experimentalTextTransform";function Sh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Eh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:Po({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function wh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Ch),n=xo("typography.textTransform");return t||!n}function Bh(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:xo("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const Ih="typography.__experimentalLetterSpacing";function xh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Bh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:Po({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function Th(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Ih),n=xo("typography.letterSpacing");return t||!n}const Nh="typography",Ph=[Hg,lh,Wg,$g,Xg,gh,Ch,Ih];function Mh(e){const{clientId:t}=e,n=eh(e),o=ah(e),l=Yg(e),i=Ug(e),a=vh(e),c=wh(e),u=Th(e),d=!Kg(e),m=!qg(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Yg(e),ah(e),Ug(e),eh(e),vh(e),wh(e),Th(e)];return t.filter(Boolean).length===t.length}(e),h=Rh(e.name);if(f||!h)return null;const v=(0,r.getBlockSupport)(e.name,[Nh,"__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)(Vo,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,g.__)("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)(Jg,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,g.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:Po({...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)(sh,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:Fg(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Po({...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)(jg,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,g.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Po({...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)(Gg,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,g.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Po({...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)(hh,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,g.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Po({...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)(Sh,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,g.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Po({...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)(xh,e)))}const Rh=e=>Ph.some((t=>(0,r.hasBlockSupport)(e,t))),Lh=[...Ph,sg,_g,Ko],Ah=e=>Lh.some((t=>(0,r.hasBlockSupport)(e,t))),Dh="var:";function Oh(e){return(0,u.startsWith)(e,Dh)?`var(--wp--${e.slice(Dh.length).split("|").join("--")})`:e}function Fh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};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 s=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&!(0,u.isString)(s)?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(s,[o]);r&&(n[t]=Oh(r))})):t.includes(l.join("."))||(n[o]=Oh((0,u.get)(e,l))))}}));const o=Zr(e,{selector:"self"});return o.forEach((e=>{if("self"!==e.selector)throw"This style can't be added as inline style";n[e.key]=e.value})),n}const zh={[`${sg}.__experimentalSkipSerialization`]:["border"],"color.__experimentalSkipSerialization":[_g],[`${Nh}.__experimentalSkipSerialization`]:[Nh],[`${Ko}.__experimentalSkipSerialization`]:["spacing"]},Vh={...zh,[`${Ko}`]:["spacing.blockGap"]},Hh={gradients:"gradient"};function Gh(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Vh;if(!Ah(t))return e;let{style:l}=n;return(0,u.forEach)(o,((e,n)=>{const o=(0,r.getBlockSupport)(t,n);!0===o&&(l=(0,u.omit)(l,e)),Array.isArray(o)&&o.forEach((t=>{const n=Hh[t]||t;l=(0,u.omit)(l,[[...e,n]])}))})),e.style={...Fh(l),...e.style},e}const Uh=(0,d.createHigherOrderComponent)((e=>t=>{const n=eo();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Rg,t),(0,s.createElement)(Mh,t),(0,s.createElement)(ag,t),(0,s.createElement)(Qo,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Wh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,a=Lo(t.name,_g,"link")?(0,u.omit)(null===(n=t.attributes.style)||void 0===n?void 0:n.elements,["link"]):null===(o=t.attributes.style)||void 0===o?void 0:o.elements,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,u.map)(t,((t,n)=>{const o=Fh(t);return(0,u.isEmpty)(o)?"":[`.editor-styles-wrapper .${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(l,a),m=(0,s.useContext)(Cf.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,a&&m&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,s.createElement)(e,i({},t,{className:a?c()(t.className,l):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Ah(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Gh),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Ah(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Gh(o,e,n,zh)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Uh),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Wh);var $h=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,g.__)("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!==fc.DOWN||(e.preventDefault(),n())},label:(0,g.__)("Apply duotone filter"),icon:(0,s.createElement)(p.DuotoneSwatch,{values:l})})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,g.__)("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 jh=[];function Kh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Cu(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 qh(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 Yh(e){let{presetSetting:t,defaultSetting:n}=e;const o=!xo(n),r=xo(`${t}.custom`)||jh,l=xo(`${t}.theme`)||jh,i=xo(`${t}.default`)||jh;return(0,s.useMemo)((()=>[...r,...l,...o?jh:i]),[o,r,l,i])}function Qh(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=Yh({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=Yh({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!xo("color.custom"),u=!xo("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(lo,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)($h,{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})}}))}wu([Bu]);const Xh=(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)(Qh,t))}),"withDuotoneControls"),Zh=(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),g=(0,s.useContext)(Cf.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,g&&(0,s.createPortal)((0,s.createElement)(qh,{selector:m,id:p,values:Kh(u)}),g),(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",Xh),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Zh);const Jh="__experimentalLayout";function ev(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=xo("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(Yn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,Jh,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:h}=c;if(!d)return null;const v=!(!f||!i||null!=l&&l.type&&"default"!==(null==l?void 0:l.type)&&(null==l||!l.inherit)),b=l||h||{},{inherit:k=!1,type:_="default"}=b;if("default"===_&&!a)return null;const y=Ir(_),E=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Vo,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Layout")},v&&(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Inherit default layout"),checked:!!k,onChange:()=>t({layout:{inherit:!k}})}),!k&&u&&(0,s.createElement)(tv,{type:_,onChange:e=>t({layout:{type:e}})}),!k&&y&&(0,s.createElement)(y.inspectorControls,{layout:b,onChange:E,layoutBlockSupport:c}))),!k&&y&&(0,s.createElement)(y.toolBarControls,{layout:b,onChange:E,layoutBlockSupport:c}))}function tv(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Br.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const nv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Jh)&&(0,s.createElement)(ev,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),ov=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,Jh),a=(0,d.useInstanceId)(e),u=xo("layout")||{},p=(0,s.useContext)(Cf.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,Jh)||{},g=null!=m&&m.inherit?u:m||f||{},h=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)(Mr,{blockName:n,selector:`.wp-container-${a}`,layout:g,style:null==o?void 0:o.style}),p),(0,s.createElement)(e,i({},t,{className:h})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,Jh)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",ov),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",nv);const rv=[];function lv(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},l=Af("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:Fh({border:r})}}function iv(e){const t=xo("color.palette")||rv,n=lv(e);if(e.borderColor){const o=Rf(t,e.borderColor);n.style.borderColor=o.color}return n}function sv(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Af("background-color",s),m=Af("color",a),f=dg(u),g=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!g&&!!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:Fh({color:(null==d?void 0:d.color)||{}})}}const av={};function cv(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=xo("color.palette.custom")||[],l=xo("color.palette.theme")||[],i=xo("color.palette.default")||[],a=xo("color.gradients")||av,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=sv(e);if(t){const e=Rf(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=pg(u,o)),n){const e=Rf(c,n);d.style.color=e.color}return d}function uv(e){const{style:t}=e;return{style:Fh({spacing:(null==t?void 0:t.spacing)||{}})}}function dv(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const pv=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),mv=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=xo("color.palette.custom"),o=xo("color.palette.theme"),r=xo("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function fv(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=Cu(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=Lf(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=Rf(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:Af(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function gv(e){return function(){const t=pv(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(fv(o,t),"withCustomColors")}}function hv(){const e=mv();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(fv(n,e),"withColors")}const vv=[];var bv=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=xo("typography.fontSizes")||vv;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=th(r,l,n[t]);return e[o]={...i,class:oh(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},kv=(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"})),_v=(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"})),yv=(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 Ev=[{icon:kv,title:(0,g.__)("Align text left"),align:"left"},{icon:_v,title:(0,g.__)("Align text center"),align:"center"},{icon:yv,title:(0,g.__)("Align text right"),align:"right"}],Cv={position:"bottom right",isAlternate:!0};var Sv=function(e){let{value:t,onChange:n,alignmentControls:o=Ev,label:r=(0,g.__)("Align"),describedBy:l=(0,g.__)("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,h=c?{isCollapsed:a}:{};return(0,s.createElement)(f,i({icon:m?m.icon:(0,g.isRTL)()?yv:kv,label:r,toggleProps:{describedBy:l},popoverProps:Cv,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},h))};const wv=e=>(0,s.createElement)(Sv,i({},e,{isToolbar:!1})),Bv=e=>(0,s.createElement)(Sv,i({},e,{isToolbar:!0}));var Iv={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(Yn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=vd(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?Hd(o,r,l,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]);return[(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)(Tc,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i])]},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))}}},xv=window.wp.apiFetch,Tv=n.n(xv),Nv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),Pv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})),Mv={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await Tv()({path:(0,Qd.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(wr,{key:"icon",icon:"page"===e.subtype?Nv:Pv}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)};const Rv=[];function Lv(e){let{completers:t=Rv}=e;const{name:n}=Jn();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Iv,Mv])),(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 Av=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:Lv(e)}))},Dv=(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"})),Ov=function(e){let{isActive:t,label:n=(0,g.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:Dv,label:n,onClick:()=>o(!t),disabled:r})},Fv=function(e){const{label:t=(0,g.__)("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!==fc.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},zv=(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"})),Vv=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(Yn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(Yn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,g.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,g.__)("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)(wr,{icon:zv,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)(Ip,{clientId:e,maximumLength:35})),(0,s.createElement)(wr,{icon:zv,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Ip,{clientId:r,maximumLength:35})))};function Hv(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),{canEdit:p,isParentSelected:f,hasChildSelected:g,isDraggingBlocks:h,isParentHighlighted:v}=(0,m.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l,canEditBlock:i}=e(Yn);return{canEdit:i(t),isParentSelected:n(t),hasChildSelected:o(t,!0),isDraggingBlocks:r(),isParentHighlighted:l(t)}}),[t]),b=c()("block-editor-block-content-overlay",null==o?void 0:o.className,r,{"overlay-active":l,"parent-highlighted":v,"is-dragging-blocks":h});return(0,s.useEffect)((()=>{p?(f||g||l||a(!0),f&&!u&&l&&a(!1),g&&l&&a(!1)):a(!0)}),[f,g,l,u,p]),(0,s.createElement)(n,i({},o,{className:b,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onMouseUp:l&&p?()=>a(!1):void 0}),null==o?void 0:o.children)}const Gv=()=>(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"})),Uv=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)(Gv,null)))},Wv=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,g.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==fc.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(Uv,null)))}))}};var $v=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:Wv(n),renderContent:()=>t})},jv=(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 Kv=Xa(p.__experimentalTreeGridRow);function qv(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=ec({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(Kv,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function Yv(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)(wr,{icon:zv}))}var Qv=(0,s.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:a,onDragStart:u,onDragEnd:d,draggable:m}=e;const f=wp(o),{isLocked:g}=Mm(o);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==fc.ENTER&&e.keyCode!==fc.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==u||u(e)},onDragEnd:d,draggable:m,href:`#block-${o}`,"aria-hidden":!0},(0,s.createElement)(Yv,{onClick:l}),(0,s.createElement)(Tc,{icon:null==f?void 0:f.icon,showColors:!0}),(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,s.createElement)(Ip,{clientId:o,maximumLength:35})),(null==f?void 0:f.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},f.anchor),g&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,s.createElement)(wr,{icon:Pm}))))})),Xv=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,isExpanded:p,selectedClientIds:f,...g}=e;const{clientId:h}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,m.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(Yn);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[h]),k=v&&b===h,_=c()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=f.includes(h)?f:[h];return(0,s.createElement)(xp,{clientIds:y},(e=>{let{draggable:c,onDragStart:m,onDragEnd:f}=e;return(0,s.createElement)(Qv,i({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:f,isExpanded:p},g))}))}));const Zv=(0,s.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),Jv=()=>(0,s.useContext)(Zv);var eb=(0,s.memo)((function e(t){let{block:n,isDragged:o,isSelected:r,isBranchSelected:l,selectBlock:i,position:a,level:u,rowCount:f,siblingBlockCount:h,showBlockMovers:v,path:b,isExpanded:k,selectedClientIds:_,preventAnnouncement:y}=t;const E=(0,s.useRef)(null),[C,S]=(0,s.useState)(!1),{clientId:w}=n,B=r&&_[0]===w,I=r&&_[_.length-1]===w,{toggleBlockHighlight:x}=(0,m.useDispatch)(Yn),T=wp(w),{isLocked:N}=Mm(w),P=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,M=((e,t,n)=>(0,g.sprintf)(
72
  /* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
73
+ (0,g.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(a,h,u);let R=(0,g.__)("Link");T&&(R=N?(0,g.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the locked block.
74
+ (0,g.__)("%s link (locked)"),T.title):(0,g.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the block.
75
+ (0,g.__)("%s link"),T.title));const L=T?(0,g.sprintf)(// translators: %s: The title of the block.
76
+ (0,g.__)("Options for %s block"),T.title):(0,g.__)("Options"),{__experimentalFeatures:A,__experimentalPersistentListViewFeatures:D,__experimentalHideContainerBlockActions:O,isTreeGridMounted:F,expand:z,collapse:V}=Jv(),H=v&&h>0,G=c()("block-editor-list-view-block__mover-cell",{"is-visible":C||r}),U=c()("block-editor-list-view-block__menu-cell",{"is-visible":C||B});(0,s.useEffect)((()=>{D&&!F&&r&&E.current.focus()}),[]);const W=D?x:()=>{},$=(0,s.useCallback)((()=>{S(!0),W(w,!0)}),[w,S,W]),j=(0,s.useCallback)((()=>{S(!1),W(w,!1)}),[w,S,W]),K=(0,s.useCallback)((e=>{i(e,w),e.preventDefault()}),[w,i]),q=(0,s.useCallback)((e=>{i(void 0,e)}),[i]),Y=(0,s.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?V(w):!1===k&&z(w)}),[w,z,V,k]),Q=A&&(!O||O&&u>1),X=A&&!Q;let Z;H?Z=2:X&&(Z=3);const J=c()({"is-selected":r,"is-first-selected":B,"is-last-selected":I,"is-branch-selected":D&&l,"is-dragging":o,"has-single-cell":X}),ee=_.includes(w)?_:[w];return(0,s.createElement)(qv,{className:J,onMouseEnter:$,onMouseLeave:j,onFocus:$,onBlur:j,level:u,position:a,rowCount:f,path:b,id:`list-view-block-${w}`,"data-block":w,isExpanded:k,"aria-selected":!!r},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Z,ref:E,"aria-label":R,"aria-selected":!!r,"aria-expanded":k,"aria-describedby":P},(e=>{let{ref:t,tabIndex:o,onFocus:l}=e;return(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(Xv,{block:n,onClick:K,onToggleExpanded:Y,isSelected:r,position:a,siblingBlockCount:h,level:u,ref:t,tabIndex:o,onFocus:l,isExpanded:k,selectedClientIds:_,preventAnnouncement:y}),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:P},M))})),H&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalTreeGridCell,{className:G,withoutGridItem:!0},(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(zp,{orientation:"vertical",clientIds:[w],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)(Vp,{orientation:"vertical",clientIds:[w],ref:t,tabIndex:n,onFocus:o})})))),Q&&(0,s.createElement)(p.__experimentalTreeGridCell,{className:U,"aria-selected":!!r},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Hm,{clientIds:ee,icon:hm,label:L,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:q})})))}));function tb(e,t,n,o){var r;return(null==n?void 0:n.includes(e.clientId))?0:(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(nb(t,n,o),0):1}const nb=(e,t,n)=>(o,r)=>{var l;return(null==t?void 0:t.includes(r.clientId))?o:(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+tb(r,e,t,n):o+1};function ob(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,expandNested:f}=e,{expandedState:g,draggedClientIds:h,__experimentalPersistentListViewFeatures:v}=Jv(),b=(0,u.compact)(t),k=b.length;let _=d;return(0,s.createElement)(s.Fragment,null,b.map(((e,t)=>{var d;const{clientId:y,innerBlocks:E}=e;t>0&&(_+=tb(b[t-1],g,h,f));const C=v,{itemInView:S}=p,w=!C||S(_),B=t+1,I=a.length>0?`${a}_${B}`:`${B}`,x=r&&!!E&&!!E.length,T=x?null!==(d=g[y])&&void 0!==d?d:f:void 0,N=!(null==h||!h.includes(y)),P=N||w,M=((e,t)=>(0,u.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e)(y,l),R=c||M&&x;return(0,s.createElement)(m.AsyncModeProvider,{key:y,value:!M},P&&(0,s.createElement)(eb,{block:e,selectBlock:n,isSelected:M,isBranchSelected:R,isDragged:N,level:i,position:B,rowCount:k,siblingBlockCount:k,showBlockMovers:o,path:I,isExpanded:T,listPosition:_,selectedClientIds:l}),!P&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),x&&T&&!N&&(0,s.createElement)(ob,{blocks:E,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,level:i+1,path:I,listPosition:_+1,fixedListWindow:p,isBranchSelected:R,selectedClientIds:l,expandNested:f}))})))}ob.defaultProps={selectBlock:()=>{}};var rb=(0,s.memo)(ob);function lb(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,a]=(0,s.useMemo)((()=>t.current?[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 ib(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const sb=["top","bottom"];const ab=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var cb=(0,s.forwardRef)((function(e,t){let{blocks:n,__experimentalFeatures:o,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,showNestedBlocks:c,showBlockMovers:f,id:h,expandNested:v=!1,...b}=e;const{clientIdsTree:k,draggedClientIds:_,selectedClientIds:y}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(Yn);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(n),{visibleBlockCount:E}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(Yn),o=(null==_?void 0:_.length)>0?n(_).length+1:0;return{visibleBlockCount:t()-o}}),[_]),{updateBlockSelection:C}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,m.useDispatch)(Yn),{getBlockName:o,getBlockParents:l,getBlockSelectionStart:i,getBlockSelectionEnd:a,getSelectedBlockClientIds:c,hasMultiSelection:d,hasSelectedBlock:p}=(0,m.useSelect)(Yn),{getBlockType:f}=(0,m.useSelect)(r.store);return{updateBlockSelection:(0,s.useCallback)((async(r,s,a)=>{if(null==r||!r.shiftKey)return await e(),void n(s);r.preventDefault();const m="keydown"===r.type&&(r.keyCode===fc.UP||r.keyCode===fc.DOWN||r.keyCode===fc.HOME||r.keyCode===fc.END);if(!m&&!p()&&!d())return void n(s,null);const h=c(),v=[...l(s),s];m&&!h.some((e=>v.includes(e)))&&await e();let b=i(),k=s;m&&(p()||d()||(b=s),a&&(k=a));const _=l(b),y=l(k),{start:E,end:C}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(b,k,_,y);await t(E,C,null);const S=c();if((r.keyCode===fc.HOME||r.keyCode===fc.END)&&S.length>1)return;const w=(0,u.difference)(h,S);let B;if(1===w.length){var I;const e=null===(I=f(o(w[0])))||void 0===I?void 0:I.title;e&&(B=(0,g.sprintf)(
77
  /* translators: %s: block name */
78
  (0,g.__)("%s deselected."),e))}else w.length>1&&(B=(0,g.sprintf)(
79
  /* translators: %s: number of deselected blocks */
80
+ (0,g.__)("%s blocks deselected."),w.length));B&&(0,Ft.speak)(B)}),[e,o,f,l,i,a,c,d,p,t,n])}}(),[S,w]=(0,s.useReducer)(ab,{}),{ref:B,target:I}=function(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(Yn),[l,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=l||{},u=uf(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]=pf(t,s,sb),u=ib(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}}(),x=(0,s.useRef)(),T=(0,d.useMergeRefs)([x,B,t]),N=(0,s.useRef)(!1),{setSelectedTreeId:P}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,s.useState)(null),{selectedBlockParentClientIds:l}=(0,m.useSelect)((e=>{const{getBlockParents:n}=e(Yn);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,s.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:y[0],setExpandedState:w}),M=(0,s.useCallback)(((e,t)=>{C(e,t),P(t)}),[P,C]);(0,s.useEffect)((()=>{N.current=!0}),[]);const[R]=(0,d.__experimentalUseFixedWindowList)(x,36,E,{useWindowing:l,windowOverscan:40}),L=(0,s.useCallback)((e=>{e&&w({type:"expand",clientIds:[e]})}),[w]),A=(0,s.useCallback)((e=>{e&&w({type:"collapse",clientIds:[e]})}),[w]),D=(0,s.useCallback)((e=>{var t;L(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[L]),O=(0,s.useCallback)((e=>{var t;A(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[A]),F=(0,s.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&C(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(r=n.dataset)||void 0===r?void 0:r.block)}),[C]),z=(0,s.useMemo)((()=>({__experimentalFeatures:o,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,isTreeGridMounted:N.current,draggedClientIds:_,expandedState:S,expand:L,collapse:A})),[o,l,a,N.current,_,S,L,A]);return(0,s.createElement)(m.AsyncModeProvider,{value:!0},(0,s.createElement)(lb,{listViewRef:x,blockDropTarget:I}),(0,s.createElement)(p.__experimentalTreeGrid,{id:h,className:"block-editor-list-view-tree","aria-label":(0,g.__)("Block navigation structure"),ref:T,onCollapseRow:O,onExpandRow:D,onFocusRow:F},(0,s.createElement)(Zv.Provider,{value:z},(0,s.createElement)(rb,i({blocks:k,selectBlock:M,showNestedBlocks:c,showBlockMovers:f,fixedListWindow:R,selectedClientIds:y,expandNested:v},b)))))}));function ub(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,s.createElement)(p.Button,i({},l,{ref:r,icon:jv,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0
81
+ /* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var db=(0,s.forwardRef)((function(e,t){let{isDisabled:n,__experimentalFeatures:o,...r}=e;const l=(0,m.useSelect)((e=>!!e(Yn).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)(ub,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,g.__)("List view")),(0,s.createElement)(cb,{showNestedBlocks:!0,__experimentalFeatures:o}))})}));function pb(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=em(o,r,n),i=(0,s.useMemo)((()=>({...t,title:n.label||n.name,description:n.description,initialAttributes:{...t.attributes,className:l+" block-editor-block-styles__block-preview-container"}})),[t,l]);return(0,s.createElement)(ld,{item:i,isStylePreview:!0})}function mb(e){let{children:t,scope:n,...o}=e;return(0,s.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,s.createElement)("div",o,t))}function fb(e){let{clientId:t,onSwitch:n=u.noop,onHoverClassName:o=u.noop,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:a,genericPreviewBlock:m,className:f}=nm({clientId:t,onSwitch:n}),[g,h]=(0,s.useState)(null),[v,b]=(0,s.useState)(0),k=(0,d.useViewportMatch)("medium","<");if((0,s.useLayoutEffect)((()=>{const e=document.querySelector(".interface-interface-skeleton__content"),t=(null==e?void 0:e.scrollTop)||0;b(t+16)}),[g]),!i||0===i.length)return null;const _=(0,u.debounce)(h,250),y=e=>{l(e),o(null),h(null),_.cancel()},E=e=>{var t;g!==e?(_(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):_.cancel()};return(0,s.createElement)("div",{className:"block-editor-block-styles"},(0,s.createElement)("div",{className:"block-editor-block-styles__variants"},i.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.Button,{className:c()("block-editor-block-styles__item",{"is-active":a.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>E(e),onFocus:()=>E(e),onMouseLeave:()=>E(null),onBlur:()=>E(null),onKeyDown:t=>{fc.ENTER!==t.keyCode&&fc.SPACE!==t.keyCode||(t.preventDefault(),y(e))},onClick:()=>y(e),role:"button",tabIndex:"0"},(0,s.createElement)(p.__experimentalText,{as:"span",limit:12,ellipsizeMode:"tail",className:"block-editor-block-styles__item-text",truncate:!0},t))}))),g&&!k&&(0,s.createElement)(mb,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>E(null)},(0,s.createElement)(pb,{activeStyle:a,className:f,genericPreviewBlock:m,style:g})))}fb.Slot=function(e){let{scope:t}=e;return(0,s.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var gb=fb,hb=(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"})),vb=function(e){let{icon:t=hb,label:n=(0,g.__)("Choose variation"),instructions:o=(0,g.__)("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,g.__)("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,g.__)("Skip"))))},bb=(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 kb="carousel",_b="grid",yb=e=>{let{onStartBlank:t,onBlockPatternSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},t&&(0,s.createElement)(p.Button,{onClick:t},(0,g.__)("Start blank")),(0,s.createElement)(p.Button,{variant:"primary",onClick:n},(0,g.__)("Choose")))},Eb=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:Rp,label:(0,g.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:Mp,label:(0,g.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var Cb=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a,onStartBlank:c}=e;const u=t===kb,d=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:po,label:(0,g.__)("Carousel view"),onClick:()=>n(kb),isPressed:u}),(0,s.createElement)(p.Button,{icon:bb,label:(0,g.__)("Grid view"),onClick:()=>n(_b),isPressed:t===_b}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},u&&(0,s.createElement)(Eb,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),d,u&&(0,s.createElement)(yb,{onBlockPatternSelect:a,onStartBlank:c}))};const Sb=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r,height:l}=e;const a=(0,p.__unstableUseCompositeState)(),c="block-editor-block-pattern-setup__container";if(t===kb){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__carousel",style:{height:l}},(0,s.createElement)("div",{className:c},(0,s.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,s.createElement)(Bb,{className:e.get(n)||"",key:t.name,pattern:t,minHeight:l}))))))}return(0,s.createElement)("div",{style:{height:l},className:"block-editor-block-pattern-setup__grid"},(0,s.createElement)(p.__unstableComposite,i({},a,{role:"listbox",className:c,"aria-label":(0,g.__)("Patterns list")}),o.map((e=>(0,s.createElement)(wb,{key:e.name,pattern:e,onSelect:r,composite:a})))))};function wb(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,description:a,viewportWidth:c=700}=t,u=(0,d.useInstanceId)(wb,`${r}__item-description`);return(0,s.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?u:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,s.createElement)(od,{blocks:l,viewportWidth:c})),!!a&&(0,s.createElement)(p.VisuallyHidden,{id:u},a))}function Bb(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,a=(0,d.useInstanceId)(Bb,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":i?a:void 0},(0,s.createElement)(od,{blocks:r,__experimentalMinHeight:o}),!!i&&(0,s.createElement)(p.VisuallyHidden,{id:a},i))}var Ib=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:l,onBlockPatternSelect:i}=e;const[a,c]=(0,s.useState)(kb),[u,p]=(0,s.useState)(0),[f,g]=(0,s.useState)(!1),{replaceBlock:h}=(0,m.useDispatch)(Yn),v=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(Yn),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(t,n,o),[b,{height:k}]=(0,d.useResizeObserver)();if(null==v||!v.length||f)return l;const _=i||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));h(t,n)}),y=l?()=>{g(!0)}:void 0;return(0,s.createElement)(s.Fragment,null,b,(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${a}`},(0,s.createElement)(Sb,{viewMode:a,activeSlide:u,patterns:v,onBlockPatternSelect:_,height:k-120}),(0,s.createElement)(Cb,{viewMode:a,setViewMode:c,activeSlide:u,totalSlides:v.length,handleNext:()=>{p((e=>e+1))},handlePrevious:()=>{p((e=>e-1))},onBlockPatternSelect:()=>{_(v[u].blocks)},onStartBlank:y})))};function xb(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,s.createElement)("fieldset",{className:t},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Transform to variation")),r.map((e=>(0,s.createElement)(p.Button,{key:e.name,icon:e.icon,isPressed:o===e.name,label:o===e.name?e.title:(0,g.sprintf)(
82
+ /* translators: %s: Name of the block variation */
83
+ (0,g.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function Tb(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;const l=r.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}}));return(0,s.createElement)(p.DropdownMenu,{className:t,label:(0,g.__)("Transform to variation"),text:(0,g.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:Ap,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${t}__container`},(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}var Nb=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,m.useDispatch)(Yn),{activeBlockVariation:o,variations:l}=(0,m.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(r.store),{getBlockName:l,getBlockAttributes:i}=e(Yn),s=t&&l(t);return{activeBlockVariation:n(s,i(t)),variations:s&&o(s,"transform")}}),[t]),i=null==o?void 0:o.name,a=(0,s.useMemo)((()=>{const e=new Set;return l.forEach((t=>{t.icon&&e.add(t.icon)})),e.size===l.length}),[l]);if(null==l||!l.length)return null;const c=a?xb:Tb;return(0,s.createElement)(c,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...l.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:i,variations:l})},Pb=(0,d.createHigherOrderComponent)((e=>t=>{const n=xo("color.palette"),o=!xo("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"),Mb=Pb(p.ColorPalette);function Rb(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(Tf,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var Lb=window.wp.date;const Ab=new Date(2022,0,25);function Db(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,s.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Date format")),(0,s.createElement)(p.ToggleControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Default format"),(0,s.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,Lb.dateI18n)(n,Ab))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,s.createElement)(Ob,{format:t,onChange:o}))}function Ob(e){var t;let{format:n,onChange:o}=e;const r=(0,u.uniq)(["Y-m-d",(0,g._x)("n/j/Y","short date format"),(0,g._x)("n/j/Y g:i A","short date format with time"),(0,g._x)("M j, Y","medium date format"),(0,g._x)("M j, Y g:i A","medium date format with time"),(0,g._x)("F j, Y","long date format")]),l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,Lb.dateI18n)(e,Ab),format:e}))),i={key:"custom",name:(0,g.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,g.__)("Enter your own date format")},[a,c]=(0,s.useState)((()=>!!n&&!r.includes(n)));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.BaseControl,{className:"block-editor-date-format-picker__custom-format-select-control"},(0,s.createElement)(p.CustomSelectControl,{label:(0,g.__)("Choose a format"),options:[...l,i],value:a?i:null!==(t=l.find((e=>e.format===n)))&&void 0!==t?t:i,onChange:e=>{let{selectedItem:t}=e;t===i?c(!0):(c(!1),o(t.format))}})),a&&(0,s.createElement)(p.TextControl,{label:(0,g.__)("Custom format"),hideLabelFromVision:!0,help:(0,s.createInterpolateElement)((0,g.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,s.createElement)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}
84
  // 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)
85
+ const Fb=(0,g.__)("(%s: color %s)"),zb=(0,g.__)("(%s: gradient %s)"),Vb=["colors","disableCustomColors","gradients","disableCustomGradients"],Hb=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=Lf(c||t,l);r=(0,g.sprintf)(Fb,a.toLowerCase(),e&&e.name||l)}else{const e=mg(u||n,l);r=(0,g.sprintf)(zb,a.toLowerCase(),e&&e.name||i)}return(0,s.createElement)(p.ColorIndicator,{key:o,colorValue:l||i,"aria-label":r})}))},Gb=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:a,settings:d,title:m,showTitle:f=!0,__experimentalHasMultipleOrigins:g,__experimentalIsRenderedInSidebar:h,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)(Hb,{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)(Nf,{settings:d,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:g,__experimentalIsRenderedInSidebar:h,enableAlpha:v}),!!a&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalSpacer,{marginY:4})," ",a))},Ub=e=>{const t=Pf();return t.colors=xo("color.palette"),t.gradients=xo("color.gradients"),(0,s.createElement)(Gb,i({},t,e))},Wb=e=>{const t=Mf();return(0,s.createElement)(Gb,i({},t,e))};// 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)
86
+ var $b=e=>(0,u.every)(Vb,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Gb,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(Wb,e):(0,s.createElement)(Ub,e),jb=function(e,t){return(jb=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])})(e,t)},Kb=function(){return(Kb=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)};function qb(e,t,n,o){void 0===o&&(o=0);var r=lk(e,t,o),l=r.width,i=r.height;return e>=t*n&&l>t*n?{width:t*n,height:t}:l>t*n?{width:e,height:e/n}:l>i*n?{width:i*n,height:i}:{width:l,height:l/n}}function Yb(e,t,n,o,r){void 0===r&&(r=0);var l=lk(t.width,t.height,r),i=l.width,s=l.height;return{x:Qb(e.x,i,n.width,o),y:Qb(e.y,s,n.height,o)}}function Qb(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function Xb(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Zb(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Jb(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?ek:tk,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:Kb(Kb({},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 ek(e,t){return Math.min(e,Math.max(0,t))}function tk(e,t){return t}function nk(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 ok(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function rk(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 lk(e,t,n){var o=e/2,r=t/2,l=[rk(0,0,o,r,n),rk(e,0,o,r,n),rk(e,t,o,r,n),rk(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]})));return{width:s-i,height:Math.max.apply(Math,l.map((function(e){return e[1]})))-a}}function ik(){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 sk=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=nk(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=n.imageRef||n.videoRef;if(l){n.mediaSize={width:l.offsetWidth,height:l.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 i=n.props.cropSize?n.props.cropSize:qb(l.offsetWidth,l.offsetHeight,n.props.aspect,n.props.rotation);n.setState({cropSize:i},n.recomputeCropPosition)}n.containerRef&&(n.containerRect=n.containerRef.getBoundingClientRect())},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){e.preventDefault(),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=Kb({},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?Yb(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=n.props.zoom-e.deltaY*n.props.zoomSpeed/200;n.setNewZoom(r,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?Yb(i,n.mediaSize,n.state.cropSize,l,n.props.rotation):i;n.props.onCropChange(s),n.props.onZoomChange(l)}},n.emitCropData=function(){if(n.state.cropSize){var e=Jb(n.props.restrictPosition?Yb(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),t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?Yb(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 __(){this.constructor=e}jb(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(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}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\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 will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\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(){window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&this.styleRef.remove(),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():e.cropSize!==this.props.cropSize&&this.computeSizes(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent())},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=Xb(n,o),this.lastPinchRotation=Zb(n,o),this.onDragStart(ok(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=ok(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=Xb(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=Zb(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.crop,i=l.x,s=l.y,a=t.rotation,c=t.zoom,u=t.cropShape,d=t.showGrid,p=t.style,m=p.containerStyle,f=p.cropAreaStyle,g=p.mediaStyle,h=t.classes,v=h.containerClassName,b=h.cropAreaClassName,k=h.mediaClassName;return Fl().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:ik("reactEasyCrop_Container",v)},n?Fl().createElement("img",Kb({alt:"",className:ik("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:Kb(Kb({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&Fl().createElement("video",Kb({autoPlay:!0,loop:!0,muted:!0,className:ik("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:Kb(Kb({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&Fl().createElement("div",{style:Kb(Kb({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:ik("reactEasyCrop_CropArea","round"===u&&"reactEasyCrop_CropAreaRound",d&&"reactEasyCrop_CropAreaGrid",b)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",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}(Fl().Component);const ak={position:"bottom right",isAlternate:!0};const ck=(0,s.createContext)({}),uk=()=>(0,s.useContext)(ck);function dk(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:i,onFinishEditing:a,onSaveImage:c,children:u}=e;const d=function(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,g]=(0,s.useState)(),[h,v]=(0,s.useState)(),[b,k]=(0,s.useState)(),_=(0,s.useCallback)((()=>{d({x:0,y:0}),m(100),g(0),v(n/o),k(n/o)}),[n,o,d,m,g,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(),g(e),v(1/h),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)),g(e),v(1/h),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,g,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:g,rotateClockwise:y,aspect:h,setAspect:v,defaultAspect:b,initializeTransformValues:_})),[r,i,a,c,u,d,p,m,f,g,y,h,v,b,_])}(e),{initializeTransformValues:o}=n;return(0,s.useEffect)((()=>{t&&o()}),[t,o]),n}({url:n,naturalWidth:o,naturalHeight:r},i),p=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)(Ed.store),[p,f]=(0,s.useState)(!1),h=(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,Tv()({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,g.sprintf)(
87
  /* translators: 1. Error message */
88
+ (0,g.__)("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:h})),[p,v,h])}({id:t,url:n,onSaveImage:c,onFinishEditing:a,...d}),f=(0,s.useMemo)((()=>({...d,...p})),[d,p]);return(0,s.createElement)(ck.Provider,{value:f},u)}function pk(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:g,setCrop:h,setZoom:v,rotation:b}=uk();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)(sk,{image:u||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:f,onCropChange:g,onCropComplete:e=>{h(e)},onZoomChange:e=>{v(100*e)}}),a&&(0,s.createElement)(p.Spinner,null))}var mk=(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 fk(){const{isInProgress:e,zoom:t,setZoom:n}=uk();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:ak,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(p.ToolbarButton,{icon:mk,label:(0,g.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,g.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var gk=(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 hk(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?Xp:void 0},t)})))}function vk(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=uk();return(0,s.createElement)(p.DropdownMenu,{icon:gk,label:(0,g.__)("Aspect Ratio"),popoverProps:ak,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(hk,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("Original"),aspect:l},{title:(0,g.__)("Square"),aspect:1}]}),(0,s.createElement)(hk,{label:(0,g.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("16:10"),aspect:1.6},{title:(0,g.__)("16:9"),aspect:16/9},{title:(0,g.__)("4:3"),aspect:4/3},{title:(0,g.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(hk,{label:(0,g.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("10:16"),aspect:.625},{title:(0,g.__)("9:16"),aspect:9/16},{title:(0,g.__)("3:4"),aspect:3/4},{title:(0,g.__)("2:3"),aspect:2/3}]}))}))}var bk=(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 kk(){const{isInProgress:e,rotateClockwise:t}=uk();return(0,s.createElement)(p.ToolbarButton,{icon:bk,label:(0,g.__)("Rotate"),onClick:t,disabled:e})}function _k(){const{isInProgress:e,apply:t,cancel:n}=uk();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,g.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,g.__)("Cancel")))}function yk(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)(pk,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,s.createElement)(lo,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(fk,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(vk,{toggleProps:e}))),(0,s.createElement)(kk,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(_k,null))))}const Ek=[25,50,75,100];function Ck(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:h,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,g.__)("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,g.__)("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,g.__)("Width"),value:f,min:1,onChange:e=>h("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,g.__)("Height"),value:m,min:1,onChange:e=>h("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,g.__)("Image size presets")},Ek.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,g.__)("Reset")))))}var Sk=(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"})),wk=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,g.__)("Currently selected link settings")),l)},Bk=n(5425),Ik=n.n(Bk);class xk 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,Ik()(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,Qd.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,g.sprintf)(
89
  /* translators: %s: number of results. */
90
+ (0,g._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,g.__)("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 fc.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case fc.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case fc.ENTER:this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case fc.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case fc.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case fc.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,g.__)("Link selected.")));break;case fc.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,g.__)("Paste URL or type to search"),__experimentalRenderControl:l,value:i=""}=this.props,{loading:a,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:m,suggestionOptionIdPrefix:f}=this.state,h={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,g.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==d?`${f}-${d}`:void 0,ref:this.inputRef};return l?l(h,v,a):(0,s.createElement)(p.BaseControl,h,(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,g={id:d,ref:this.autocompleteRef,role:"listbox"},h=(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:g,buildSuggestionItemProps:h,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({},g,{className:c()("block-editor-url-input__suggestions",`${e}__suggestions`)}),l.map(((e,t)=>(0,s.createElement)(p.Button,i({},h(0,t),{key:e.id,className:c()("block-editor-url-input__suggestion",{"is-selected":t===a}),onClick:()=>this.handleOnClick(e)}),e.title))))):null}}var Tk=(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(Yn);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(xk),Nk=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,g.sprintf)(
91
  /* translators: %s: search term. */
92
+ (0,g.__)("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)(wr,{className:"block-editor-link-control__search-item-icon",icon:wc}),(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},Pk=(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"})),Mk=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)(wr,{className:"block-editor-link-control__search-item-icon",icon:Pk}),(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,Qd.filterURLForDisplay)((0,Qd.safeDecodeURI)(n.url))||""),l&&(0,g.__)("Press ENTER to add this link"))),u&&n.type&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-type"},function(e){return e.isFrontPage?"front page":"post_tag"===e.type?"tag":e.type}(n)))};const Rk="__CREATE__",Lk=[{id:"opensInNewTab",title:(0,g.__)("Open in new tab")}];function Ak(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:l,buildSuggestionItemProps:a,suggestions:u,selectedSuggestion:d,isLoading:m,isInitialSuggestions:f,createSuggestionButtonText:h,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}`,S=f?(0,g.__)("Recently updated"):(0,g.sprintf)(
93
  /* translators: %s: search term. */