Version Description
Download this release
Release Info
Developer | gutenbergplugin |
Plugin | Gutenberg |
Version | 12.6.0 |
Comparing to | |
See all releases |
Code changes from version 12.5.4 to 12.6.0
- build/block-editor/index.js +589 -259
- build/block-editor/index.min.asset.php +1 -1
- build/block-editor/index.min.js +67 -65
- build/block-editor/style-rtl.css +0 -1
build/block-editor/index.js
CHANGED
@@ -2193,7 +2193,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
2193 |
"ObserveTyping": function() { return /* reexport */ observe_typing; },
|
2194 |
"PanelColorSettings": function() { return /* reexport */ panel_color_settings; },
|
2195 |
"PlainText": function() { return /* reexport */ plain_text; },
|
2196 |
-
"PreserveScrollInReorder": function() { return /* reexport */ PreserveScrollInReorder; },
|
2197 |
"RichText": function() { return /* reexport */ rich_text; },
|
2198 |
"RichTextShortcut": function() { return /* reexport */ RichTextShortcut; },
|
2199 |
"RichTextToolbarButton": function() { return /* reexport */ RichTextToolbarButton; },
|
@@ -2242,6 +2241,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
2242 |
"__experimentalResponsiveBlockControl": function() { return /* reexport */ responsive_block_control; },
|
2243 |
"__experimentalTextDecorationControl": function() { return /* reexport */ TextDecorationControl; },
|
2244 |
"__experimentalTextTransformControl": function() { return /* reexport */ TextTransformControl; },
|
|
|
2245 |
"__experimentalUnitControl": function() { return /* reexport */ UnitControl; },
|
2246 |
"__experimentalUseBlockPreview": function() { return /* reexport */ useBlockPreview; },
|
2247 |
"__experimentalUseBorderProps": function() { return /* reexport */ useBorderProps; },
|
@@ -9935,12 +9935,14 @@ var external_wp_warning_namespaceObject = window["wp"]["warning"];
|
|
9935 |
const InspectorControlsDefault = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControls');
|
9936 |
const InspectorControlsAdvanced = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorAdvancedControls');
|
9937 |
const InspectorControlsBorder = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsBorder');
|
|
|
9938 |
const InspectorControlsDimensions = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsDimensions');
|
9939 |
const InspectorControlsTypography = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsTypography');
|
9940 |
const groups_groups = {
|
9941 |
default: InspectorControlsDefault,
|
9942 |
advanced: InspectorControlsAdvanced,
|
9943 |
border: InspectorControlsBorder,
|
|
|
9944 |
dimensions: InspectorControlsDimensions,
|
9945 |
typography: InspectorControlsTypography
|
9946 |
};
|
@@ -10018,6 +10020,57 @@ const cleanEmptyObject = object => {
|
|
10018 |
const cleanedNestedObjects = (0,external_lodash_namespaceObject.pickBy)((0,external_lodash_namespaceObject.mapValues)(object, cleanEmptyObject), external_lodash_namespaceObject.identity);
|
10019 |
return (0,external_lodash_namespaceObject.isEmpty)(cleanedNestedObjects) ? undefined : cleanedNestedObjects;
|
10020 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10021 |
//# sourceMappingURL=utils.js.map
|
10022 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inspector-controls/block-support-tools-panel.js
|
10023 |
|
@@ -10082,7 +10135,9 @@ function BlockSupportToolsPanel(_ref) {
|
|
10082 |
panelId: panelId,
|
10083 |
hasInnerWrapper: true,
|
10084 |
shouldRenderPlaceholderItems: true // Required to maintain fills ordering.
|
10085 |
-
|
|
|
|
|
10086 |
}, children);
|
10087 |
}
|
10088 |
//# sourceMappingURL=block-support-tools-panel.js.map
|
@@ -19689,7 +19744,7 @@ const wrap = function (namespace) {
|
|
19689 |
* @return {Array} converted rules.
|
19690 |
*/
|
19691 |
|
19692 |
-
const
|
19693 |
let wrapperClassName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
19694 |
return (0,external_lodash_namespaceObject.map)(styles, _ref => {
|
19695 |
let {
|
@@ -19714,7 +19769,7 @@ const transformStyles = function (styles) {
|
|
19714 |
});
|
19715 |
};
|
19716 |
|
19717 |
-
/* harmony default export */ var transform_styles = (
|
19718 |
//# sourceMappingURL=index.js.map
|
19719 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/editor-styles/index.js
|
19720 |
|
@@ -19869,7 +19924,9 @@ function AutoBlockPreview(_ref) {
|
|
19869 |
documentElement.classList.add('block-editor-block-preview__content-iframe');
|
19870 |
documentElement.style.position = 'absolute';
|
19871 |
documentElement.style.width = '100%';
|
19872 |
-
bodyElement.style.padding = __experimentalPadding + 'px';
|
|
|
|
|
19873 |
}, []),
|
19874 |
"aria-hidden": true,
|
19875 |
tabIndex: -1,
|
@@ -21326,7 +21383,9 @@ function getItemSearchRank(item, searchTerm) {
|
|
21326 |
|
21327 |
|
21328 |
if (rank !== 0 && name.startsWith('core/')) {
|
21329 |
-
rank
|
|
|
|
|
21330 |
}
|
21331 |
|
21332 |
return rank;
|
@@ -28751,7 +28810,7 @@ function BorderColorEdit(props) {
|
|
28751 |
return (_getColorObjectByAttr = getColorObjectByAttributeValues(availableColors, borderColor, customBorderColor)) === null || _getColorObjectByAttr === void 0 ? void 0 : _getColorObjectByAttr.color;
|
28752 |
}); // Detect changes in the color attributes and update the colorValue to keep the
|
28753 |
// UI in sync. This is necessary for situations when border controls interact with
|
28754 |
-
//
|
28755 |
// selections to be cleared.
|
28756 |
|
28757 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
@@ -30009,8 +30068,7 @@ function __experimentalUseGradient() {
|
|
30009 |
};
|
30010 |
}
|
30011 |
//# sourceMappingURL=use-gradient.js.map
|
30012 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/
|
30013 |
-
|
30014 |
|
30015 |
|
30016 |
/**
|
@@ -30018,243 +30076,188 @@ function __experimentalUseGradient() {
|
|
30018 |
*/
|
30019 |
|
30020 |
|
30021 |
-
/**
|
30022 |
-
* WordPress dependencies
|
30023 |
-
*/
|
30024 |
-
|
30025 |
-
|
30026 |
|
30027 |
/**
|
30028 |
-
*
|
30029 |
*/
|
30030 |
|
30031 |
|
30032 |
|
30033 |
|
|
|
30034 |
|
30035 |
-
|
30036 |
-
// 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)
|
30037 |
-
|
30038 |
-
const colorIndicatorAriaLabel = (0,external_wp_i18n_namespaceObject.__)('(%s: color %s)'); // translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)
|
30039 |
-
|
30040 |
-
|
30041 |
-
const gradientIndicatorAriaLabel = (0,external_wp_i18n_namespaceObject.__)('(%s: gradient %s)');
|
30042 |
-
|
30043 |
-
const panel_color_gradient_settings_colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients'];
|
30044 |
-
|
30045 |
-
const Indicators = _ref => {
|
30046 |
let {
|
30047 |
-
|
30048 |
-
|
30049 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30050 |
} = _ref;
|
30051 |
-
|
30052 |
-
let {
|
30053 |
-
colorValue,
|
30054 |
-
gradientValue,
|
30055 |
-
label,
|
30056 |
-
colors: availableColors,
|
30057 |
-
gradients: availableGradients
|
30058 |
-
} = _ref2;
|
30059 |
-
|
30060 |
-
if (!colorValue && !gradientValue) {
|
30061 |
-
return null;
|
30062 |
-
}
|
30063 |
-
|
30064 |
-
let ariaLabel;
|
30065 |
-
|
30066 |
-
if (colorValue) {
|
30067 |
-
const colorObject = getColorObjectByColorValue(availableColors || colors, colorValue);
|
30068 |
-
ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)(colorIndicatorAriaLabel, label.toLowerCase(), colorObject && colorObject.name || colorValue);
|
30069 |
-
} else {
|
30070 |
-
const gradientObject = __experimentalGetGradientObjectByGradientValue(availableGradients || gradients, colorValue);
|
30071 |
-
|
30072 |
-
ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)(gradientIndicatorAriaLabel, label.toLowerCase(), gradientObject && gradientObject.name || gradientValue);
|
30073 |
-
}
|
30074 |
-
|
30075 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorIndicator, {
|
30076 |
-
key: index,
|
30077 |
-
colorValue: colorValue || gradientValue,
|
30078 |
-
"aria-label": ariaLabel
|
30079 |
-
});
|
30080 |
-
});
|
30081 |
-
};
|
30082 |
-
|
30083 |
-
const PanelColorGradientSettingsInner = _ref3 => {
|
30084 |
-
let {
|
30085 |
-
className,
|
30086 |
-
colors,
|
30087 |
-
gradients,
|
30088 |
-
disableCustomColors,
|
30089 |
-
disableCustomGradients,
|
30090 |
-
children,
|
30091 |
-
settings,
|
30092 |
-
title,
|
30093 |
-
showTitle = true,
|
30094 |
-
__experimentalHasMultipleOrigins,
|
30095 |
-
__experimentalIsRenderedInSidebar,
|
30096 |
-
enableAlpha,
|
30097 |
-
...props
|
30098 |
-
} = _ref3;
|
30099 |
|
30100 |
-
if (
|
30101 |
return null;
|
30102 |
}
|
30103 |
|
30104 |
-
const
|
30105 |
-
|
30106 |
-
}, title, (0,external_wp_element_namespaceObject.createElement)(Indicators, {
|
30107 |
-
colors: colors,
|
30108 |
-
gradients: gradients,
|
30109 |
-
settings: settings
|
30110 |
-
}));
|
30111 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, _extends({
|
30112 |
-
className: classnames_default()('block-editor-panel-color-gradient-settings', className),
|
30113 |
-
title: showTitle ? titleElement : undefined
|
30114 |
-
}, props), (0,external_wp_element_namespaceObject.createElement)(ColorGradientSettingsDropdown, {
|
30115 |
-
settings: settings,
|
30116 |
-
colors,
|
30117 |
-
gradients,
|
30118 |
-
disableCustomColors,
|
30119 |
-
disableCustomGradients,
|
30120 |
-
__experimentalHasMultipleOrigins,
|
30121 |
-
__experimentalIsRenderedInSidebar,
|
30122 |
-
enableAlpha
|
30123 |
-
}), !!children && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalSpacer, {
|
30124 |
-
marginY: 4
|
30125 |
-
}), " ", children));
|
30126 |
-
};
|
30127 |
-
|
30128 |
-
const PanelColorGradientSettingsSingleSelect = props => {
|
30129 |
-
const colorGradientSettings = useCommonSingleMultipleSelects();
|
30130 |
-
colorGradientSettings.colors = useSetting('color.palette');
|
30131 |
-
colorGradientSettings.gradients = useSetting('color.gradients');
|
30132 |
-
return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsInner, _extends({}, colorGradientSettings, props));
|
30133 |
-
};
|
30134 |
-
|
30135 |
-
const PanelColorGradientSettingsMultipleSelect = props => {
|
30136 |
-
const colorGradientSettings = useMultipleOriginColorsAndGradients();
|
30137 |
-
return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsInner, _extends({}, colorGradientSettings, props));
|
30138 |
-
};
|
30139 |
|
30140 |
-
|
30141 |
-
|
30142 |
-
return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsInner, props);
|
30143 |
-
}
|
30144 |
-
|
30145 |
-
if (props.__experimentalHasMultipleOrigins) {
|
30146 |
-
return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsMultipleSelect, props);
|
30147 |
}
|
30148 |
|
30149 |
-
|
30150 |
-
|
30151 |
-
|
30152 |
-
|
30153 |
-
|
30154 |
-
|
30155 |
-
|
30156 |
-
|
30157 |
-
|
30158 |
-
|
30159 |
-
|
30160 |
-
|
30161 |
-
|
|
|
|
|
|
|
30162 |
|
30163 |
-
|
30164 |
-
|
30165 |
-
|
|
|
|
|
30166 |
|
|
|
|
|
|
|
30167 |
|
|
|
|
|
|
|
|
|
|
|
30168 |
|
|
|
|
|
|
|
|
|
|
|
30169 |
|
|
|
|
|
|
|
30170 |
|
30171 |
-
k([names, a11y]);
|
30172 |
|
30173 |
-
|
30174 |
-
|
30175 |
-
|
30176 |
-
|
30177 |
-
|
30178 |
-
textColor,
|
30179 |
-
shouldShowTransparencyWarning
|
30180 |
-
} = _ref;
|
30181 |
-
let msg = '';
|
30182 |
|
30183 |
-
if (
|
30184 |
-
|
30185 |
-
} else {
|
30186 |
-
msg = colordBackgroundColor.brightness() < colordTextColor.brightness() ? (0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read. Try using a darker background color and/or a brighter text color.') : (0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color.');
|
30187 |
} // Note: The `Notice` component can speak messages via its `spokenMessage`
|
30188 |
// prop, but the contrast checker requires granular control over when the
|
30189 |
// announcements are made. Notably, the message will be re-announced if a
|
30190 |
// new color combination is selected and the contrast is still insufficient.
|
30191 |
|
30192 |
|
30193 |
-
(0,
|
30194 |
-
const speakMsg = shouldShowTransparencyWarning ? (0,external_wp_i18n_namespaceObject.__)('Transparent text may be hard for people to read.') : (0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read.');
|
30195 |
-
(0,external_wp_a11y_namespaceObject.speak)(speakMsg);
|
30196 |
-
}, [backgroundColor, textColor]);
|
30197 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
30198 |
className: "block-editor-contrast-checker"
|
30199 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
|
30200 |
spokenMessage: null,
|
30201 |
status: "warning",
|
30202 |
isDismissible: false
|
30203 |
-
},
|
30204 |
}
|
30205 |
|
30206 |
-
|
30207 |
-
|
30208 |
-
|
30209 |
-
fallbackBackgroundColor,
|
30210 |
-
fallbackTextColor,
|
30211 |
-
fontSize,
|
30212 |
-
// font size value in pixels
|
30213 |
-
isLargeText,
|
30214 |
-
textColor,
|
30215 |
-
enableAlphaChecker = false
|
30216 |
-
} = _ref2;
|
30217 |
|
30218 |
-
if (!(backgroundColor || fallbackBackgroundColor) || !(textColor || fallbackTextColor)) {
|
30219 |
-
return null;
|
30220 |
-
}
|
30221 |
|
30222 |
-
const colordBackgroundColor = w(backgroundColor || fallbackBackgroundColor);
|
30223 |
-
const colordTextColor = w(textColor || fallbackTextColor);
|
30224 |
-
const textColorHasTransparency = colordTextColor.alpha() < 1;
|
30225 |
-
const backgroundColorHasTransparency = colordBackgroundColor.alpha() < 1;
|
30226 |
-
const hasTransparency = textColorHasTransparency || backgroundColorHasTransparency;
|
30227 |
-
const isReadable = colordTextColor.isReadable(colordBackgroundColor, {
|
30228 |
-
level: 'AA',
|
30229 |
-
size: isLargeText || isLargeText !== false && fontSize >= 24 ? 'large' : 'small'
|
30230 |
-
}); // Don't show the message if the text is readable AND there's no transparency.
|
30231 |
-
// This is the default.
|
30232 |
|
30233 |
-
|
30234 |
-
|
30235 |
-
|
30236 |
|
30237 |
-
|
30238 |
-
|
30239 |
-
|
30240 |
-
isReadable && !textColorHasTransparency) {
|
30241 |
-
return null;
|
30242 |
-
}
|
30243 |
-
}
|
30244 |
|
30245 |
-
return (0,external_wp_element_namespaceObject.createElement)(ContrastCheckerMessage, {
|
30246 |
-
backgroundColor: backgroundColor,
|
30247 |
-
textColor: textColor,
|
30248 |
-
colordBackgroundColor: colordBackgroundColor,
|
30249 |
-
colordTextColor: colordTextColor // Flag to warn about transparency only if the text is otherwise readable according to colord
|
30250 |
-
// to ensure the readability warnings take precedence.
|
30251 |
-
,
|
30252 |
-
shouldShowTransparencyWarning: isReadable && textColorHasTransparency
|
30253 |
-
});
|
30254 |
-
}
|
30255 |
|
30256 |
-
|
30257 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30258 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/color-panel.js
|
30259 |
|
30260 |
|
@@ -30262,7 +30265,6 @@ function ContrastChecker(_ref2) {
|
|
30262 |
* WordPress dependencies
|
30263 |
*/
|
30264 |
|
30265 |
-
|
30266 |
/**
|
30267 |
* Internal dependencies
|
30268 |
*/
|
@@ -30281,13 +30283,15 @@ function ColorPanel(_ref) {
|
|
30281 |
enableAlpha = false,
|
30282 |
settings,
|
30283 |
clientId,
|
30284 |
-
enableContrastChecking = true
|
30285 |
-
showTitle = true
|
30286 |
} = _ref;
|
30287 |
const [detectedBackgroundColor, setDetectedBackgroundColor] = (0,external_wp_element_namespaceObject.useState)();
|
30288 |
const [detectedColor, setDetectedColor] = (0,external_wp_element_namespaceObject.useState)();
|
|
|
30289 |
const ref = useBlockRef(clientId);
|
30290 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
|
|
|
|
30291 |
if (!enableContrastChecking) {
|
30292 |
return;
|
30293 |
}
|
@@ -30297,6 +30301,12 @@ function ColorPanel(_ref) {
|
|
30297 |
}
|
30298 |
|
30299 |
setDetectedColor(getComputedStyle(ref.current).color);
|
|
|
|
|
|
|
|
|
|
|
|
|
30300 |
let backgroundColorNode = ref.current;
|
30301 |
let backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor;
|
30302 |
|
@@ -30307,19 +30317,19 @@ function ColorPanel(_ref) {
|
|
30307 |
|
30308 |
setDetectedBackgroundColor(backgroundColor);
|
30309 |
});
|
30310 |
-
return (0,external_wp_element_namespaceObject.createElement)(inspector_controls,
|
30311 |
-
|
30312 |
-
|
30313 |
-
|
30314 |
-
|
30315 |
-
|
30316 |
-
|
30317 |
-
|
30318 |
-
}, enableContrastChecking && (0,external_wp_element_namespaceObject.createElement)(contrast_checker, {
|
30319 |
backgroundColor: detectedBackgroundColor,
|
30320 |
textColor: detectedColor,
|
30321 |
-
enableAlphaChecker: enableAlpha
|
30322 |
-
|
|
|
30323 |
}
|
30324 |
//# sourceMappingURL=color-panel.js.map
|
30325 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/color.js
|
@@ -30384,6 +30394,143 @@ const hasTextColorSupport = blockType => {
|
|
30384 |
const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY);
|
30385 |
return colorSupport && colorSupport.text !== false;
|
30386 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30387 |
/**
|
30388 |
* Filters registered block settings, extending attributes to include
|
30389 |
* `backgroundColor` and `textColor` attribute.
|
@@ -30444,7 +30591,7 @@ function color_addSaveProps(props, blockType, attributes) {
|
|
30444 |
return props;
|
30445 |
}
|
30446 |
|
30447 |
-
const hasGradient = hasGradientSupport(blockType); // I'd have
|
30448 |
|
30449 |
const {
|
30450 |
backgroundColor,
|
@@ -30468,7 +30615,7 @@ function color_addSaveProps(props, blockType, attributes) {
|
|
30468 |
return props;
|
30469 |
}
|
30470 |
/**
|
30471 |
-
* Filters registered block settings to
|
30472 |
* to apply the desired styles and classnames properly.
|
30473 |
*
|
30474 |
* @param {Object} settings Original block settings.
|
@@ -30505,10 +30652,6 @@ const getLinkColorFromAttributeValue = (colors, value) => {
|
|
30505 |
|
30506 |
return value;
|
30507 |
};
|
30508 |
-
|
30509 |
-
function immutableSet(object, path, value) {
|
30510 |
-
return (0,external_lodash_namespaceObject.setWith)(object ? (0,external_lodash_namespaceObject.clone)(object) : {}, path, value, external_lodash_namespaceObject.clone);
|
30511 |
-
}
|
30512 |
/**
|
30513 |
* Inspector control panel containing the color related configuration
|
30514 |
*
|
@@ -30648,6 +30791,7 @@ function ColorEdit(props) {
|
|
30648 |
};
|
30649 |
|
30650 |
const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web' && !gradient && !(style !== null && style !== void 0 && (_style$color6 = style.color) !== null && _style$color6 !== void 0 && _style$color6.gradient);
|
|
|
30651 |
return (0,external_wp_element_namespaceObject.createElement)(ColorPanel, {
|
30652 |
enableContrastChecking: enableContrastChecking,
|
30653 |
clientId: props.clientId,
|
@@ -30655,18 +30799,30 @@ function ColorEdit(props) {
|
|
30655 |
settings: [...(hasTextColor ? [{
|
30656 |
label: (0,external_wp_i18n_namespaceObject.__)('Text'),
|
30657 |
onColorChange: onChangeColor('text'),
|
30658 |
-
colorValue: getColorObjectByAttributeValues(allSolids, textColor, style === null || style === void 0 ? void 0 : (_style$color7 = style.color) === null || _style$color7 === void 0 ? void 0 : _style$color7.text).color
|
|
|
|
|
|
|
|
|
30659 |
}] : []), ...(hasBackgroundColor || hasGradientColor ? [{
|
30660 |
label: (0,external_wp_i18n_namespaceObject.__)('Background'),
|
30661 |
onColorChange: hasBackgroundColor ? onChangeColor('background') : undefined,
|
30662 |
colorValue: getColorObjectByAttributeValues(allSolids, backgroundColor, style === null || style === void 0 ? void 0 : (_style$color8 = style.color) === null || _style$color8 === void 0 ? void 0 : _style$color8.background).color,
|
30663 |
gradientValue,
|
30664 |
-
onGradientChange: hasGradientColor ? onChangeGradient : undefined
|
|
|
|
|
|
|
|
|
30665 |
}] : []), ...(hasLinkColor ? [{
|
30666 |
label: (0,external_wp_i18n_namespaceObject.__)('Link'),
|
30667 |
onColorChange: onChangeLinkColor,
|
30668 |
colorValue: getLinkColorFromAttributeValue(allSolids, style === null || style === void 0 ? void 0 : (_style$elements2 = style.elements) === null || _style$elements2 === void 0 ? void 0 : (_style$elements2$link = _style$elements2.link) === null || _style$elements2$link === void 0 ? void 0 : (_style$elements2$link2 = _style$elements2$link.color) === null || _style$elements2$link2 === void 0 ? void 0 : _style$elements2$link2.text),
|
30669 |
-
clearable: !!(style !== null && style !== void 0 && (_style$elements3 = style.elements) !== null && _style$elements3 !== void 0 && (_style$elements3$link = _style$elements3.link) !== null && _style$elements3$link !== void 0 && (_style$elements3$link2 = _style$elements3$link.color) !== null && _style$elements3$link2 !== void 0 && _style$elements3$link2.text)
|
|
|
|
|
|
|
|
|
30670 |
}] : [])]
|
30671 |
});
|
30672 |
}
|
@@ -30723,10 +30879,27 @@ const withColorPaletteStyles = (0,external_wp_compose_namespaceObject.createHigh
|
|
30723 |
wrapperProps: wrapperProps
|
30724 |
}));
|
30725 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30726 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/color/addAttribute', color_addAttributes);
|
30727 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/color/addSaveProps', color_addSaveProps);
|
30728 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/color/addEditProps', color_addEditProps);
|
30729 |
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/color/with-color-palette-styles', withColorPaletteStyles);
|
|
|
30730 |
//# sourceMappingURL=color.js.map
|
30731 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/font-appearance-control/index.js
|
30732 |
|
@@ -31888,10 +32061,21 @@ const withFontSizeInlineStyles = (0,external_wp_compose_namespaceObject.createHi
|
|
31888 |
};
|
31889 |
return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, newProps);
|
31890 |
}, 'withFontSizeInlineStyles');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31891 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font/addAttribute', font_size_addAttributes);
|
31892 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/font/addSaveProps', font_size_addSaveProps);
|
31893 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font/addEditProps', font_size_addEditProps);
|
31894 |
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/font-size/with-font-size-inline-styles', withFontSizeInlineStyles);
|
|
|
31895 |
//# sourceMappingURL=font-size.js.map
|
31896 |
;// CONCATENATED MODULE: ./packages/icons/build-module/library/format-underline.js
|
31897 |
|
@@ -35497,7 +35681,8 @@ function ListViewBlockSelectButton(_ref, ref) {
|
|
35497 |
onFocus,
|
35498 |
onDragStart,
|
35499 |
onDragEnd,
|
35500 |
-
draggable
|
|
|
35501 |
} = _ref;
|
35502 |
const blockInformation = useBlockDisplayInformation(clientId);
|
35503 |
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ListViewBlockSelectButton);
|
@@ -35530,7 +35715,8 @@ function ListViewBlockSelectButton(_ref, ref) {
|
|
35530 |
onDragStart: onDragStartHandler,
|
35531 |
onDragEnd: onDragEnd,
|
35532 |
draggable: draggable,
|
35533 |
-
href: `#block-${clientId}
|
|
|
35534 |
}, (0,external_wp_element_namespaceObject.createElement)(ListViewExpander, {
|
35535 |
onClick: onToggleExpanded
|
35536 |
}), (0,external_wp_element_namespaceObject.createElement)(block_icon, {
|
@@ -35578,6 +35764,7 @@ const ListViewBlockContents = (0,external_wp_element_namespaceObject.forwardRef)
|
|
35578 |
position,
|
35579 |
siblingBlockCount,
|
35580 |
level,
|
|
|
35581 |
...props
|
35582 |
} = _ref;
|
35583 |
const {
|
@@ -35622,7 +35809,8 @@ const ListViewBlockContents = (0,external_wp_element_namespaceObject.forwardRef)
|
|
35622 |
level: level,
|
35623 |
draggable: draggable,
|
35624 |
onDragStart: onDragStart,
|
35625 |
-
onDragEnd: onDragEnd
|
|
|
35626 |
}, props));
|
35627 |
});
|
35628 |
});
|
@@ -35791,7 +35979,8 @@ function ListViewBlock(_ref) {
|
|
35791 |
level: level,
|
35792 |
ref: ref,
|
35793 |
tabIndex: tabIndex,
|
35794 |
-
onFocus: onFocus
|
|
|
35795 |
}));
|
35796 |
}), hasRenderedMovers && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridCell, {
|
35797 |
className: moverCellClassName,
|
@@ -37519,6 +37708,148 @@ function ColorPaletteControl(_ref) {
|
|
37519 |
}));
|
37520 |
}
|
37521 |
//# sourceMappingURL=control.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37522 |
;// CONCATENATED MODULE: ./node_modules/react-easy-crop/node_modules/tslib/tslib.es6.js
|
37523 |
/*! *****************************************************************************
|
37524 |
Copyright (c) Microsoft Corporation.
|
@@ -40526,6 +40857,8 @@ function useRemoteUrlData(url) {
|
|
40526 |
|
40527 |
|
40528 |
function LinkPreview(_ref) {
|
|
|
|
|
40529 |
let {
|
40530 |
value,
|
40531 |
onEditClick,
|
@@ -40542,8 +40875,9 @@ function LinkPreview(_ref) {
|
|
40542 |
|
40543 |
const hasRichData = richData && Object.keys(richData).length;
|
40544 |
const displayURL = value && (0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURI)(value.url), 16) || '';
|
40545 |
-
const displayTitle = (richData === null || richData === void 0 ? void 0 : richData.title) || (value === null || value === void 0 ? void 0 : value.title) || displayURL;
|
40546 |
-
|
|
|
40547 |
let icon;
|
40548 |
|
40549 |
if (richData !== null && richData !== void 0 && richData.icon) {
|
@@ -41519,7 +41853,6 @@ URLPopover.LinkViewer = LinkViewer;
|
|
41519 |
|
41520 |
|
41521 |
|
41522 |
-
|
41523 |
/**
|
41524 |
* Internal dependencies
|
41525 |
*/
|
@@ -41570,7 +41903,6 @@ function MediaPlaceholder(_ref2) {
|
|
41570 |
addToGallery,
|
41571 |
multiple = false,
|
41572 |
handleUpload = true,
|
41573 |
-
dropZoneUIOnly,
|
41574 |
disableDropZone,
|
41575 |
disableMediaButtons,
|
41576 |
onError,
|
@@ -41864,14 +42196,7 @@ function MediaPlaceholder(_ref2) {
|
|
41864 |
return renderPlaceholder(uploadMediaLibraryButton);
|
41865 |
};
|
41866 |
|
41867 |
-
if (
|
41868 |
-
if (dropZoneUIOnly) {
|
41869 |
-
external_wp_deprecated_default()('wp.blockEditor.MediaPlaceholder dropZoneUIOnly prop', {
|
41870 |
-
since: '5.4',
|
41871 |
-
alternative: 'disableMediaButtons'
|
41872 |
-
});
|
41873 |
-
}
|
41874 |
-
|
41875 |
return (0,external_wp_element_namespaceObject.createElement)(media_upload_check, null, renderDropZone());
|
41876 |
}
|
41877 |
|
@@ -42229,7 +42554,8 @@ function getAllowedFormats(_ref) {
|
|
42229 |
|
42230 |
external_wp_deprecated_default()('wp.blockEditor.RichText formattingControls prop', {
|
42231 |
since: '5.4',
|
42232 |
-
alternative: 'allowedFormats'
|
|
|
42233 |
});
|
42234 |
return formattingControls.map(name => `core/${name}`);
|
42235 |
}
|
@@ -42365,6 +42691,8 @@ function usePasteHandler(props) {
|
|
42365 |
propsRef.current = props;
|
42366 |
return (0,external_wp_compose_namespaceObject.useRefEffect)(element => {
|
42367 |
function _onPaste(event) {
|
|
|
|
|
42368 |
const {
|
42369 |
isSelected,
|
42370 |
disableFormats,
|
@@ -42467,11 +42795,18 @@ function usePasteHandler(props) {
|
|
42467 |
text: plainText
|
42468 |
})));
|
42469 |
return;
|
42470 |
-
} //
|
42471 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42472 |
|
42473 |
|
42474 |
-
if (files && files.length && !html) {
|
42475 |
const content = (0,external_wp_blocks_namespaceObject.pasteHandler)({
|
42476 |
HTML: filePasteHandler(files),
|
42477 |
mode: 'BLOCKS',
|
@@ -43455,7 +43790,8 @@ function RichTextWrapper(_ref, forwardedRef) {
|
|
43455 |
|
43456 |
external_wp_deprecated_default()('wp.blockEditor.RichText wrapperClassName prop', {
|
43457 |
since: '5.4',
|
43458 |
-
alternative: 'className prop or create your own wrapper div'
|
|
|
43459 |
});
|
43460 |
const className = classnames_default()('block-editor-rich-text', wrapperClassName);
|
43461 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
@@ -44663,6 +44999,9 @@ const BlockInspector = _ref => {
|
|
44663 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
44664 |
className: "block-editor-block-inspector"
|
44665 |
}, (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, {
|
|
|
|
|
|
|
44666 |
__experimentalGroup: "typography",
|
44667 |
label: (0,external_wp_i18n_namespaceObject.__)('Typography')
|
44668 |
}), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, {
|
@@ -44716,6 +45055,10 @@ const BlockInspectorSingleBlock = _ref2 => {
|
|
44716 |
}), (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, 'defaultStylePicker', true) && (0,external_wp_element_namespaceObject.createElement)(DefaultStylePicker, {
|
44717 |
blockName: blockName
|
44718 |
}))), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, null), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, {
|
|
|
|
|
|
|
|
|
44719 |
__experimentalGroup: "typography",
|
44720 |
label: (0,external_wp_i18n_namespaceObject.__)('Typography')
|
44721 |
}), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, {
|
@@ -45320,19 +45663,6 @@ function ObserveTyping(_ref) {
|
|
45320 |
|
45321 |
/* harmony default export */ var observe_typing = (ObserveTyping);
|
45322 |
//# sourceMappingURL=index.js.map
|
45323 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/preserve-scroll-in-reorder/index.js
|
45324 |
-
/**
|
45325 |
-
* WordPress dependencies
|
45326 |
-
*/
|
45327 |
-
|
45328 |
-
function PreserveScrollInReorder() {
|
45329 |
-
external_wp_deprecated_default()('PreserveScrollInReorder component', {
|
45330 |
-
since: '5.4',
|
45331 |
-
hint: 'This behavior is now built-in the block list'
|
45332 |
-
});
|
45333 |
-
return null;
|
45334 |
-
}
|
45335 |
-
//# sourceMappingURL=index.js.map
|
45336 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/typewriter/index.js
|
45337 |
|
45338 |
|
@@ -45684,6 +46014,7 @@ function useNoRecursiveRenders(uniqueId) {
|
|
45684 |
|
45685 |
|
45686 |
|
|
|
45687 |
|
45688 |
|
45689 |
|
@@ -45727,7 +46058,6 @@ function useNoRecursiveRenders(uniqueId) {
|
|
45727 |
|
45728 |
|
45729 |
|
45730 |
-
|
45731 |
|
45732 |
|
45733 |
|
2193 |
"ObserveTyping": function() { return /* reexport */ observe_typing; },
|
2194 |
"PanelColorSettings": function() { return /* reexport */ panel_color_settings; },
|
2195 |
"PlainText": function() { return /* reexport */ plain_text; },
|
|
|
2196 |
"RichText": function() { return /* reexport */ rich_text; },
|
2197 |
"RichTextShortcut": function() { return /* reexport */ RichTextShortcut; },
|
2198 |
"RichTextToolbarButton": function() { return /* reexport */ RichTextToolbarButton; },
|
2241 |
"__experimentalResponsiveBlockControl": function() { return /* reexport */ responsive_block_control; },
|
2242 |
"__experimentalTextDecorationControl": function() { return /* reexport */ TextDecorationControl; },
|
2243 |
"__experimentalTextTransformControl": function() { return /* reexport */ TextTransformControl; },
|
2244 |
+
"__experimentalToolsPanelColorDropdown": function() { return /* reexport */ ToolsPanelColorDropdown; },
|
2245 |
"__experimentalUnitControl": function() { return /* reexport */ UnitControl; },
|
2246 |
"__experimentalUseBlockPreview": function() { return /* reexport */ useBlockPreview; },
|
2247 |
"__experimentalUseBorderProps": function() { return /* reexport */ useBorderProps; },
|
9935 |
const InspectorControlsDefault = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControls');
|
9936 |
const InspectorControlsAdvanced = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorAdvancedControls');
|
9937 |
const InspectorControlsBorder = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsBorder');
|
9938 |
+
const InspectorControlsColor = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsColor');
|
9939 |
const InspectorControlsDimensions = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsDimensions');
|
9940 |
const InspectorControlsTypography = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsTypography');
|
9941 |
const groups_groups = {
|
9942 |
default: InspectorControlsDefault,
|
9943 |
advanced: InspectorControlsAdvanced,
|
9944 |
border: InspectorControlsBorder,
|
9945 |
+
color: InspectorControlsColor,
|
9946 |
dimensions: InspectorControlsDimensions,
|
9947 |
typography: InspectorControlsTypography
|
9948 |
};
|
10020 |
const cleanedNestedObjects = (0,external_lodash_namespaceObject.pickBy)((0,external_lodash_namespaceObject.mapValues)(object, cleanEmptyObject), external_lodash_namespaceObject.identity);
|
10021 |
return (0,external_lodash_namespaceObject.isEmpty)(cleanedNestedObjects) ? undefined : cleanedNestedObjects;
|
10022 |
};
|
10023 |
+
function immutableSet(object, path, value) {
|
10024 |
+
return (0,external_lodash_namespaceObject.setWith)(object ? (0,external_lodash_namespaceObject.clone)(object) : {}, path, value, external_lodash_namespaceObject.clone);
|
10025 |
+
}
|
10026 |
+
function transformStyles(activeSupports, migrationPaths, result, source, index, results) {
|
10027 |
+
var _source$;
|
10028 |
+
|
10029 |
+
// If there are no active supports return early.
|
10030 |
+
if ((0,external_lodash_namespaceObject.every)(activeSupports, isActive => !isActive)) {
|
10031 |
+
return result;
|
10032 |
+
} // If the condition verifies we are probably in the presence of a wrapping transform
|
10033 |
+
// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.
|
10034 |
+
|
10035 |
+
|
10036 |
+
if (results.length === 1 && result.innerBlocks.length === source.length) {
|
10037 |
+
return result;
|
10038 |
+
} // For cases where we have a transform from one block to multiple blocks
|
10039 |
+
// or multiple blocks to one block we apply the styles of the first source block
|
10040 |
+
// to the result(s).
|
10041 |
+
|
10042 |
+
|
10043 |
+
let referenceBlockAttributes = (_source$ = source[0]) === null || _source$ === void 0 ? void 0 : _source$.attributes; // If we are in presence of transform between more than one block in the source
|
10044 |
+
// that has more than one block in the result
|
10045 |
+
// we apply the styles on source N to the result N,
|
10046 |
+
// if source N does not exists we do nothing.
|
10047 |
+
|
10048 |
+
if (results.length > 1 && source.length > 1) {
|
10049 |
+
if (source[index]) {
|
10050 |
+
var _source$index;
|
10051 |
+
|
10052 |
+
referenceBlockAttributes = (_source$index = source[index]) === null || _source$index === void 0 ? void 0 : _source$index.attributes;
|
10053 |
+
} else {
|
10054 |
+
return result;
|
10055 |
+
}
|
10056 |
+
}
|
10057 |
+
|
10058 |
+
let returnBlock = result;
|
10059 |
+
(0,external_lodash_namespaceObject.forEach)(activeSupports, (isActive, support) => {
|
10060 |
+
if (isActive) {
|
10061 |
+
migrationPaths[support].forEach(path => {
|
10062 |
+
const styleValue = (0,external_lodash_namespaceObject.get)(referenceBlockAttributes, path);
|
10063 |
+
|
10064 |
+
if (styleValue) {
|
10065 |
+
returnBlock = { ...returnBlock,
|
10066 |
+
attributes: immutableSet(returnBlock.attributes, path, styleValue)
|
10067 |
+
};
|
10068 |
+
}
|
10069 |
+
});
|
10070 |
+
}
|
10071 |
+
});
|
10072 |
+
return returnBlock;
|
10073 |
+
}
|
10074 |
//# sourceMappingURL=utils.js.map
|
10075 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inspector-controls/block-support-tools-panel.js
|
10076 |
|
10135 |
panelId: panelId,
|
10136 |
hasInnerWrapper: true,
|
10137 |
shouldRenderPlaceholderItems: true // Required to maintain fills ordering.
|
10138 |
+
,
|
10139 |
+
__experimentalFirstVisibleItemClass: "first",
|
10140 |
+
__experimentalLastVisibleItemClass: "last"
|
10141 |
}, children);
|
10142 |
}
|
10143 |
//# sourceMappingURL=block-support-tools-panel.js.map
|
19744 |
* @return {Array} converted rules.
|
19745 |
*/
|
19746 |
|
19747 |
+
const transform_styles_transformStyles = function (styles) {
|
19748 |
let wrapperClassName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
19749 |
return (0,external_lodash_namespaceObject.map)(styles, _ref => {
|
19750 |
let {
|
19769 |
});
|
19770 |
};
|
19771 |
|
19772 |
+
/* harmony default export */ var transform_styles = (transform_styles_transformStyles);
|
19773 |
//# sourceMappingURL=index.js.map
|
19774 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/editor-styles/index.js
|
19775 |
|
19924 |
documentElement.classList.add('block-editor-block-preview__content-iframe');
|
19925 |
documentElement.style.position = 'absolute';
|
19926 |
documentElement.style.width = '100%';
|
19927 |
+
bodyElement.style.padding = __experimentalPadding + 'px'; // necessary for contentResizeListener to work.
|
19928 |
+
|
19929 |
+
bodyElement.style.position = 'relative';
|
19930 |
}, []),
|
19931 |
"aria-hidden": true,
|
19932 |
tabIndex: -1,
|
21383 |
|
21384 |
|
21385 |
if (rank !== 0 && name.startsWith('core/')) {
|
21386 |
+
const isCoreBlockVariation = name !== item.id; // Give a bit better rank to "core" blocks over "core" block variations.
|
21387 |
+
|
21388 |
+
rank += isCoreBlockVariation ? 1 : 2;
|
21389 |
}
|
21390 |
|
21391 |
return rank;
|
28810 |
return (_getColorObjectByAttr = getColorObjectByAttributeValues(availableColors, borderColor, customBorderColor)) === null || _getColorObjectByAttr === void 0 ? void 0 : _getColorObjectByAttr.color;
|
28811 |
}); // Detect changes in the color attributes and update the colorValue to keep the
|
28812 |
// UI in sync. This is necessary for situations when border controls interact with
|
28813 |
+
// each other: eg, setting the border width to zero causes the color and style
|
28814 |
// selections to be cleared.
|
28815 |
|
28816 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
30068 |
};
|
30069 |
}
|
30070 |
//# sourceMappingURL=use-gradient.js.map
|
30071 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/contrast-checker/index.js
|
|
|
30072 |
|
30073 |
|
30074 |
/**
|
30076 |
*/
|
30077 |
|
30078 |
|
|
|
|
|
|
|
|
|
|
|
30079 |
|
30080 |
/**
|
30081 |
+
* WordPress dependencies
|
30082 |
*/
|
30083 |
|
30084 |
|
30085 |
|
30086 |
|
30087 |
+
k([names, a11y]);
|
30088 |
|
30089 |
+
function ContrastChecker(_ref) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30090 |
let {
|
30091 |
+
backgroundColor,
|
30092 |
+
fallbackBackgroundColor,
|
30093 |
+
fallbackTextColor,
|
30094 |
+
fallbackLinkColor,
|
30095 |
+
fontSize,
|
30096 |
+
// font size value in pixels
|
30097 |
+
isLargeText,
|
30098 |
+
textColor,
|
30099 |
+
linkColor,
|
30100 |
+
enableAlphaChecker = false
|
30101 |
} = _ref;
|
30102 |
+
const currentBackgroundColor = backgroundColor || fallbackBackgroundColor; // Must have a background color.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30103 |
|
30104 |
+
if (!currentBackgroundColor) {
|
30105 |
return null;
|
30106 |
}
|
30107 |
|
30108 |
+
const currentTextColor = textColor || fallbackTextColor;
|
30109 |
+
const currentLinkColor = linkColor || fallbackLinkColor; // Must have at least one text color.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30110 |
|
30111 |
+
if (!currentTextColor && !currentLinkColor) {
|
30112 |
+
return null;
|
|
|
|
|
|
|
|
|
|
|
30113 |
}
|
30114 |
|
30115 |
+
const textColors = [{
|
30116 |
+
color: currentTextColor,
|
30117 |
+
description: (0,external_wp_i18n_namespaceObject.__)('text color')
|
30118 |
+
}, {
|
30119 |
+
color: currentLinkColor,
|
30120 |
+
description: (0,external_wp_i18n_namespaceObject.__)('link color')
|
30121 |
+
}];
|
30122 |
+
const colordBackgroundColor = w(currentBackgroundColor);
|
30123 |
+
const backgroundColorHasTransparency = colordBackgroundColor.alpha() < 1;
|
30124 |
+
const backgroundColorBrightness = colordBackgroundColor.brightness();
|
30125 |
+
const isReadableOptions = {
|
30126 |
+
level: 'AA',
|
30127 |
+
size: isLargeText || isLargeText !== false && fontSize >= 24 ? 'large' : 'small'
|
30128 |
+
};
|
30129 |
+
let message = '';
|
30130 |
+
let speakMessage = '';
|
30131 |
|
30132 |
+
for (const item of textColors) {
|
30133 |
+
// If there is no color, go no further.
|
30134 |
+
if (!item.color) {
|
30135 |
+
continue;
|
30136 |
+
}
|
30137 |
|
30138 |
+
const colordTextColor = w(item.color);
|
30139 |
+
const isColordTextReadable = colordTextColor.isReadable(colordBackgroundColor, isReadableOptions);
|
30140 |
+
const textHasTransparency = colordTextColor.alpha() < 1; // If the contrast is not readable.
|
30141 |
|
30142 |
+
if (!isColordTextReadable) {
|
30143 |
+
// Don't show the message if the background or text is transparent.
|
30144 |
+
if (backgroundColorHasTransparency || textHasTransparency) {
|
30145 |
+
continue;
|
30146 |
+
}
|
30147 |
|
30148 |
+
message = backgroundColorBrightness < colordTextColor.brightness() ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s is a type of text color, e.g., "text color" or "link color"
|
30149 |
+
(0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s.'), item.description) : (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s is a type of text color, e.g., "text color" or "link color"
|
30150 |
+
(0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s.'), item.description);
|
30151 |
+
speakMessage = (0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read.'); // Break from the loop when we have a contrast warning.
|
30152 |
+
// These messages take priority over the transparency warning.
|
30153 |
|
30154 |
+
break;
|
30155 |
+
} // If there is no contrast warning and the text is transparent,
|
30156 |
+
// show the transparent warning if alpha check is enabled.
|
30157 |
|
|
|
30158 |
|
30159 |
+
if (textHasTransparency && enableAlphaChecker) {
|
30160 |
+
message = (0,external_wp_i18n_namespaceObject.__)('Transparent text may be hard for people to read.');
|
30161 |
+
speakMessage = (0,external_wp_i18n_namespaceObject.__)('Transparent text may be hard for people to read.');
|
30162 |
+
}
|
30163 |
+
}
|
|
|
|
|
|
|
|
|
30164 |
|
30165 |
+
if (!message) {
|
30166 |
+
return null;
|
|
|
|
|
30167 |
} // Note: The `Notice` component can speak messages via its `spokenMessage`
|
30168 |
// prop, but the contrast checker requires granular control over when the
|
30169 |
// announcements are made. Notably, the message will be re-announced if a
|
30170 |
// new color combination is selected and the contrast is still insufficient.
|
30171 |
|
30172 |
|
30173 |
+
(0,external_wp_a11y_namespaceObject.speak)(speakMessage);
|
|
|
|
|
|
|
30174 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
30175 |
className: "block-editor-contrast-checker"
|
30176 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
|
30177 |
spokenMessage: null,
|
30178 |
status: "warning",
|
30179 |
isDismissible: false
|
30180 |
+
}, message));
|
30181 |
}
|
30182 |
|
30183 |
+
/* harmony default export */ var contrast_checker = (ContrastChecker);
|
30184 |
+
//# sourceMappingURL=index.js.map
|
30185 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors-gradients/tools-panel-color-dropdown.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30186 |
|
|
|
|
|
|
|
30187 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30188 |
|
30189 |
+
/**
|
30190 |
+
* External dependencies
|
30191 |
+
*/
|
30192 |
|
30193 |
+
/**
|
30194 |
+
* WordPress dependencies
|
30195 |
+
*/
|
|
|
|
|
|
|
|
|
30196 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30197 |
|
30198 |
+
/**
|
30199 |
+
* Internal dependencies
|
30200 |
+
*/
|
30201 |
+
|
30202 |
+
|
30203 |
+
|
30204 |
+
function ToolsPanelColorDropdown(_ref) {
|
30205 |
+
var _settings$gradientVal;
|
30206 |
+
|
30207 |
+
let {
|
30208 |
+
settings,
|
30209 |
+
enableAlpha,
|
30210 |
+
...otherProps
|
30211 |
+
} = _ref;
|
30212 |
+
const colorGradientSettings = useMultipleOriginColorsAndGradients();
|
30213 |
+
const controlSettings = { ...colorGradientSettings,
|
30214 |
+
clearable: false,
|
30215 |
+
enableAlpha,
|
30216 |
+
label: settings.label,
|
30217 |
+
onColorChange: settings.onColorChange,
|
30218 |
+
onGradientChange: settings.onGradientChange,
|
30219 |
+
colorValue: settings.colorValue,
|
30220 |
+
gradientValue: settings.gradientValue
|
30221 |
+
};
|
30222 |
+
const selectedColor = (_settings$gradientVal = settings.gradientValue) !== null && _settings$gradientVal !== void 0 ? _settings$gradientVal : settings.colorValue;
|
30223 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, _extends({
|
30224 |
+
hasValue: settings.hasValue,
|
30225 |
+
label: settings.label,
|
30226 |
+
onDeselect: settings.onDeselect,
|
30227 |
+
isShownByDefault: settings.isShownByDefault,
|
30228 |
+
resetAllFilter: settings.resetAllFilter
|
30229 |
+
}, otherProps, {
|
30230 |
+
className: "block-editor-tools-panel-color-gradient-settings__item"
|
30231 |
+
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
|
30232 |
+
className: "block-editor-tools-panel-color-dropdown",
|
30233 |
+
contentClassName: "block-editor-panel-color-gradient-settings__dropdown-content",
|
30234 |
+
renderToggle: _ref2 => {
|
30235 |
+
let {
|
30236 |
+
isOpen,
|
30237 |
+
onToggle
|
30238 |
+
} = _ref2;
|
30239 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
30240 |
+
onClick: onToggle,
|
30241 |
+
"aria-expanded": isOpen,
|
30242 |
+
className: classnames_default()('block-editor-panel-color-gradient-settings__dropdown', {
|
30243 |
+
'is-open': isOpen
|
30244 |
+
})
|
30245 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
|
30246 |
+
justify: "flex-start"
|
30247 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorIndicator, {
|
30248 |
+
className: "block-editor-panel-color-gradient-settings__color-indicator",
|
30249 |
+
colorValue: selectedColor
|
30250 |
+
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.FlexItem, null, settings.label)));
|
30251 |
+
},
|
30252 |
+
renderContent: () => (0,external_wp_element_namespaceObject.createElement)(control, _extends({
|
30253 |
+
showTitle: false,
|
30254 |
+
__experimentalHasMultipleOrigins: true,
|
30255 |
+
__experimentalIsRenderedInSidebar: true,
|
30256 |
+
enableAlpha: true
|
30257 |
+
}, controlSettings))
|
30258 |
+
}));
|
30259 |
+
}
|
30260 |
+
//# sourceMappingURL=tools-panel-color-dropdown.js.map
|
30261 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/color-panel.js
|
30262 |
|
30263 |
|
30265 |
* WordPress dependencies
|
30266 |
*/
|
30267 |
|
|
|
30268 |
/**
|
30269 |
* Internal dependencies
|
30270 |
*/
|
30283 |
enableAlpha = false,
|
30284 |
settings,
|
30285 |
clientId,
|
30286 |
+
enableContrastChecking = true
|
|
|
30287 |
} = _ref;
|
30288 |
const [detectedBackgroundColor, setDetectedBackgroundColor] = (0,external_wp_element_namespaceObject.useState)();
|
30289 |
const [detectedColor, setDetectedColor] = (0,external_wp_element_namespaceObject.useState)();
|
30290 |
+
const [detectedLinkColor, setDetectedLinkColor] = (0,external_wp_element_namespaceObject.useState)();
|
30291 |
const ref = useBlockRef(clientId);
|
30292 |
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
30293 |
+
var _ref$current;
|
30294 |
+
|
30295 |
if (!enableContrastChecking) {
|
30296 |
return;
|
30297 |
}
|
30301 |
}
|
30302 |
|
30303 |
setDetectedColor(getComputedStyle(ref.current).color);
|
30304 |
+
const firstLinkElement = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.querySelector('a');
|
30305 |
+
|
30306 |
+
if (firstLinkElement && !!firstLinkElement.innerText) {
|
30307 |
+
setDetectedLinkColor(getComputedStyle(firstLinkElement).color);
|
30308 |
+
}
|
30309 |
+
|
30310 |
let backgroundColorNode = ref.current;
|
30311 |
let backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor;
|
30312 |
|
30317 |
|
30318 |
setDetectedBackgroundColor(backgroundColor);
|
30319 |
});
|
30320 |
+
return (0,external_wp_element_namespaceObject.createElement)(inspector_controls, {
|
30321 |
+
__experimentalGroup: "color"
|
30322 |
+
}, settings.map((setting, index) => (0,external_wp_element_namespaceObject.createElement)(ToolsPanelColorDropdown, {
|
30323 |
+
key: index,
|
30324 |
+
settings: setting,
|
30325 |
+
panelId: clientId,
|
30326 |
+
enableAlpha: enableAlpha
|
30327 |
+
})), enableContrastChecking && (0,external_wp_element_namespaceObject.createElement)(contrast_checker, {
|
|
|
30328 |
backgroundColor: detectedBackgroundColor,
|
30329 |
textColor: detectedColor,
|
30330 |
+
enableAlphaChecker: enableAlpha,
|
30331 |
+
linkColor: detectedLinkColor
|
30332 |
+
}));
|
30333 |
}
|
30334 |
//# sourceMappingURL=color-panel.js.map
|
30335 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/color.js
|
30394 |
const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY);
|
30395 |
return colorSupport && colorSupport.text !== false;
|
30396 |
};
|
30397 |
+
/**
|
30398 |
+
* Checks whether a color has been set either with a named preset color in
|
30399 |
+
* a top level block attribute or as a custom value within the style attribute
|
30400 |
+
* object.
|
30401 |
+
*
|
30402 |
+
* @param {string} name Name of the color to check.
|
30403 |
+
* @return {boolean} Whether or not a color has a value.
|
30404 |
+
*/
|
30405 |
+
|
30406 |
+
|
30407 |
+
const hasColor = name => props => {
|
30408 |
+
var _props$attributes$sty9, _props$attributes$sty10;
|
30409 |
+
|
30410 |
+
if (name === 'background') {
|
30411 |
+
var _props$attributes$sty, _props$attributes$sty2, _props$attributes$sty3, _props$attributes$sty4;
|
30412 |
+
|
30413 |
+
return !!props.attributes.backgroundColor || !!((_props$attributes$sty = props.attributes.style) !== null && _props$attributes$sty !== void 0 && (_props$attributes$sty2 = _props$attributes$sty.color) !== null && _props$attributes$sty2 !== void 0 && _props$attributes$sty2.background) || !!props.attributes.gradient || !!((_props$attributes$sty3 = props.attributes.style) !== null && _props$attributes$sty3 !== void 0 && (_props$attributes$sty4 = _props$attributes$sty3.color) !== null && _props$attributes$sty4 !== void 0 && _props$attributes$sty4.gradient);
|
30414 |
+
}
|
30415 |
+
|
30416 |
+
if (name === 'link') {
|
30417 |
+
var _props$attributes$sty5, _props$attributes$sty6, _props$attributes$sty7, _props$attributes$sty8;
|
30418 |
+
|
30419 |
+
return !!((_props$attributes$sty5 = props.attributes.style) !== null && _props$attributes$sty5 !== void 0 && (_props$attributes$sty6 = _props$attributes$sty5.elements) !== null && _props$attributes$sty6 !== void 0 && (_props$attributes$sty7 = _props$attributes$sty6.link) !== null && _props$attributes$sty7 !== void 0 && (_props$attributes$sty8 = _props$attributes$sty7.color) !== null && _props$attributes$sty8 !== void 0 && _props$attributes$sty8.text);
|
30420 |
+
}
|
30421 |
+
|
30422 |
+
return !!props.attributes[`${name}Color`] || !!((_props$attributes$sty9 = props.attributes.style) !== null && _props$attributes$sty9 !== void 0 && (_props$attributes$sty10 = _props$attributes$sty9.color) !== null && _props$attributes$sty10 !== void 0 && _props$attributes$sty10[name]);
|
30423 |
+
};
|
30424 |
+
/**
|
30425 |
+
* Clears a single color property from a style object.
|
30426 |
+
*
|
30427 |
+
* @param {Array} path Path to color property to clear within styles object.
|
30428 |
+
* @param {Object} style Block attributes style object.
|
30429 |
+
* @return {Object} Styles with the color property omitted.
|
30430 |
+
*/
|
30431 |
+
|
30432 |
+
|
30433 |
+
const clearColorFromStyles = (path, style) => cleanEmptyObject(immutableSet(style, path, undefined));
|
30434 |
+
/**
|
30435 |
+
* Resets the block attributes for text color.
|
30436 |
+
*
|
30437 |
+
* @param {Object} props Current block props.
|
30438 |
+
* @param {Object} props.attributes Block attributes.
|
30439 |
+
* @param {Function} props.setAttributes Block's setAttributes prop used to apply reset.
|
30440 |
+
*/
|
30441 |
+
|
30442 |
+
|
30443 |
+
const resetTextColor = _ref => {
|
30444 |
+
let {
|
30445 |
+
attributes,
|
30446 |
+
setAttributes
|
30447 |
+
} = _ref;
|
30448 |
+
setAttributes({
|
30449 |
+
textColor: undefined,
|
30450 |
+
style: clearColorFromStyles(['color', 'text'], attributes.style)
|
30451 |
+
});
|
30452 |
+
};
|
30453 |
+
/**
|
30454 |
+
* Clears text color related properties from supplied attributes.
|
30455 |
+
*
|
30456 |
+
* @param {Object} attributes Block attributes.
|
30457 |
+
* @return {Object} Update block attributes with text color properties omitted.
|
30458 |
+
*/
|
30459 |
+
|
30460 |
+
|
30461 |
+
const resetAllTextFilter = attributes => ({
|
30462 |
+
textColor: undefined,
|
30463 |
+
style: clearColorFromStyles(['color', 'text'], attributes.style)
|
30464 |
+
});
|
30465 |
+
/**
|
30466 |
+
* Resets the block attributes for link color.
|
30467 |
+
*
|
30468 |
+
* @param {Object} props Current block props.
|
30469 |
+
* @param {Object} props.attributes Block attributes.
|
30470 |
+
* @param {Function} props.setAttributes Block's setAttributes prop used to apply reset.
|
30471 |
+
*/
|
30472 |
+
|
30473 |
+
|
30474 |
+
const resetLinkColor = _ref2 => {
|
30475 |
+
let {
|
30476 |
+
attributes,
|
30477 |
+
setAttributes
|
30478 |
+
} = _ref2;
|
30479 |
+
const path = ['elements', 'link', 'color', 'text'];
|
30480 |
+
setAttributes({
|
30481 |
+
style: clearColorFromStyles(path, attributes.style)
|
30482 |
+
});
|
30483 |
+
};
|
30484 |
+
/**
|
30485 |
+
* Clears link color related properties from supplied attributes.
|
30486 |
+
*
|
30487 |
+
* @param {Object} attributes Block attributes.
|
30488 |
+
* @return {Object} Update block attributes with link color properties omitted.
|
30489 |
+
*/
|
30490 |
+
|
30491 |
+
|
30492 |
+
const resetAllLinkFilter = attributes => ({
|
30493 |
+
style: clearColorFromStyles(['elements', 'link', 'color', 'text'], attributes.style)
|
30494 |
+
});
|
30495 |
+
/**
|
30496 |
+
* Clears all background color related properties including gradients from
|
30497 |
+
* supplied block attributes.
|
30498 |
+
*
|
30499 |
+
* @param {Object} attributes Block attributes.
|
30500 |
+
* @return {Object} Block attributes with background and gradient omitted.
|
30501 |
+
*/
|
30502 |
+
|
30503 |
+
|
30504 |
+
const clearBackgroundAndGradient = attributes => {
|
30505 |
+
var _attributes$style;
|
30506 |
+
|
30507 |
+
return {
|
30508 |
+
backgroundColor: undefined,
|
30509 |
+
gradient: undefined,
|
30510 |
+
style: { ...attributes.style,
|
30511 |
+
color: { ...((_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : _attributes$style.color),
|
30512 |
+
background: undefined,
|
30513 |
+
gradient: undefined
|
30514 |
+
}
|
30515 |
+
}
|
30516 |
+
};
|
30517 |
+
};
|
30518 |
+
/**
|
30519 |
+
* Resets the block attributes for both background color and gradient.
|
30520 |
+
*
|
30521 |
+
* @param {Object} props Current block props.
|
30522 |
+
* @param {Object} props.attributes Block attributes.
|
30523 |
+
* @param {Function} props.setAttributes Block's setAttributes prop used to apply reset.
|
30524 |
+
*/
|
30525 |
+
|
30526 |
+
|
30527 |
+
const resetBackgroundAndGradient = _ref3 => {
|
30528 |
+
let {
|
30529 |
+
attributes,
|
30530 |
+
setAttributes
|
30531 |
+
} = _ref3;
|
30532 |
+
setAttributes(clearBackgroundAndGradient(attributes));
|
30533 |
+
};
|
30534 |
/**
|
30535 |
* Filters registered block settings, extending attributes to include
|
30536 |
* `backgroundColor` and `textColor` attribute.
|
30591 |
return props;
|
30592 |
}
|
30593 |
|
30594 |
+
const hasGradient = hasGradientSupport(blockType); // I'd have preferred to avoid the "style" attribute usage here
|
30595 |
|
30596 |
const {
|
30597 |
backgroundColor,
|
30615 |
return props;
|
30616 |
}
|
30617 |
/**
|
30618 |
+
* Filters registered block settings to extend the block edit wrapper
|
30619 |
* to apply the desired styles and classnames properly.
|
30620 |
*
|
30621 |
* @param {Object} settings Original block settings.
|
30652 |
|
30653 |
return value;
|
30654 |
};
|
|
|
|
|
|
|
|
|
30655 |
/**
|
30656 |
* Inspector control panel containing the color related configuration
|
30657 |
*
|
30791 |
};
|
30792 |
|
30793 |
const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web' && !gradient && !(style !== null && style !== void 0 && (_style$color6 = style.color) !== null && _style$color6 !== void 0 && _style$color6.gradient);
|
30794 |
+
const defaultColorControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [COLOR_SUPPORT_KEY, '__experimentalDefaultControls']);
|
30795 |
return (0,external_wp_element_namespaceObject.createElement)(ColorPanel, {
|
30796 |
enableContrastChecking: enableContrastChecking,
|
30797 |
clientId: props.clientId,
|
30799 |
settings: [...(hasTextColor ? [{
|
30800 |
label: (0,external_wp_i18n_namespaceObject.__)('Text'),
|
30801 |
onColorChange: onChangeColor('text'),
|
30802 |
+
colorValue: getColorObjectByAttributeValues(allSolids, textColor, style === null || style === void 0 ? void 0 : (_style$color7 = style.color) === null || _style$color7 === void 0 ? void 0 : _style$color7.text).color,
|
30803 |
+
isShownByDefault: defaultColorControls === null || defaultColorControls === void 0 ? void 0 : defaultColorControls.text,
|
30804 |
+
hasValue: () => hasColor('text')(props),
|
30805 |
+
onDeselect: () => resetTextColor(props),
|
30806 |
+
resetAllFilter: resetAllTextFilter
|
30807 |
}] : []), ...(hasBackgroundColor || hasGradientColor ? [{
|
30808 |
label: (0,external_wp_i18n_namespaceObject.__)('Background'),
|
30809 |
onColorChange: hasBackgroundColor ? onChangeColor('background') : undefined,
|
30810 |
colorValue: getColorObjectByAttributeValues(allSolids, backgroundColor, style === null || style === void 0 ? void 0 : (_style$color8 = style.color) === null || _style$color8 === void 0 ? void 0 : _style$color8.background).color,
|
30811 |
gradientValue,
|
30812 |
+
onGradientChange: hasGradientColor ? onChangeGradient : undefined,
|
30813 |
+
isShownByDefault: defaultColorControls === null || defaultColorControls === void 0 ? void 0 : defaultColorControls.background,
|
30814 |
+
hasValue: () => hasColor('background')(props),
|
30815 |
+
onDeselect: () => resetBackgroundAndGradient(props),
|
30816 |
+
resetAllFilter: clearBackgroundAndGradient
|
30817 |
}] : []), ...(hasLinkColor ? [{
|
30818 |
label: (0,external_wp_i18n_namespaceObject.__)('Link'),
|
30819 |
onColorChange: onChangeLinkColor,
|
30820 |
colorValue: getLinkColorFromAttributeValue(allSolids, style === null || style === void 0 ? void 0 : (_style$elements2 = style.elements) === null || _style$elements2 === void 0 ? void 0 : (_style$elements2$link = _style$elements2.link) === null || _style$elements2$link === void 0 ? void 0 : (_style$elements2$link2 = _style$elements2$link.color) === null || _style$elements2$link2 === void 0 ? void 0 : _style$elements2$link2.text),
|
30821 |
+
clearable: !!(style !== null && style !== void 0 && (_style$elements3 = style.elements) !== null && _style$elements3 !== void 0 && (_style$elements3$link = _style$elements3.link) !== null && _style$elements3$link !== void 0 && (_style$elements3$link2 = _style$elements3$link.color) !== null && _style$elements3$link2 !== void 0 && _style$elements3$link2.text),
|
30822 |
+
isShownByDefault: defaultColorControls === null || defaultColorControls === void 0 ? void 0 : defaultColorControls.link,
|
30823 |
+
hasValue: () => hasColor('link')(props),
|
30824 |
+
onDeselect: () => resetLinkColor(props),
|
30825 |
+
resetAllFilter: resetAllLinkFilter
|
30826 |
}] : [])]
|
30827 |
});
|
30828 |
}
|
30879 |
wrapperProps: wrapperProps
|
30880 |
}));
|
30881 |
});
|
30882 |
+
const MIGRATION_PATHS = {
|
30883 |
+
linkColor: [['style', 'elements', 'link', 'color', 'text']],
|
30884 |
+
textColor: [['textColor'], ['style', 'color', 'text']],
|
30885 |
+
backgroundColor: [['backgroundColor'], ['style', 'color', 'background']],
|
30886 |
+
gradient: [['gradient'], ['style', 'color', 'gradient']]
|
30887 |
+
};
|
30888 |
+
function addTransforms(result, source, index, results) {
|
30889 |
+
const destinationBlockType = result.name;
|
30890 |
+
const activeSupports = {
|
30891 |
+
linkColor: hasLinkColorSupport(destinationBlockType),
|
30892 |
+
textColor: hasTextColorSupport(destinationBlockType),
|
30893 |
+
backgroundColor: hasBackgroundColorSupport(destinationBlockType),
|
30894 |
+
gradient: hasGradientSupport(destinationBlockType)
|
30895 |
+
};
|
30896 |
+
return transformStyles(activeSupports, MIGRATION_PATHS, result, source, index, results);
|
30897 |
+
}
|
30898 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/color/addAttribute', color_addAttributes);
|
30899 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/color/addSaveProps', color_addSaveProps);
|
30900 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/color/addEditProps', color_addEditProps);
|
30901 |
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/color/with-color-palette-styles', withColorPaletteStyles);
|
30902 |
+
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/color/addTransforms', addTransforms);
|
30903 |
//# sourceMappingURL=color.js.map
|
30904 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/font-appearance-control/index.js
|
30905 |
|
32061 |
};
|
32062 |
return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, newProps);
|
32063 |
}, 'withFontSizeInlineStyles');
|
32064 |
+
const font_size_MIGRATION_PATHS = {
|
32065 |
+
fontSize: [['fontSize'], ['style', 'typography', 'fontSize']]
|
32066 |
+
};
|
32067 |
+
function font_size_addTransforms(result, source, index, results) {
|
32068 |
+
const destinationBlockType = result.name;
|
32069 |
+
const activeSupports = {
|
32070 |
+
fontSize: (0,external_wp_blocks_namespaceObject.hasBlockSupport)(destinationBlockType, FONT_SIZE_SUPPORT_KEY)
|
32071 |
+
};
|
32072 |
+
return transformStyles(activeSupports, font_size_MIGRATION_PATHS, result, source, index, results);
|
32073 |
+
}
|
32074 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font/addAttribute', font_size_addAttributes);
|
32075 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/font/addSaveProps', font_size_addSaveProps);
|
32076 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font/addEditProps', font_size_addEditProps);
|
32077 |
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/font-size/with-font-size-inline-styles', withFontSizeInlineStyles);
|
32078 |
+
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/font-size/addTransforms', font_size_addTransforms);
|
32079 |
//# sourceMappingURL=font-size.js.map
|
32080 |
;// CONCATENATED MODULE: ./packages/icons/build-module/library/format-underline.js
|
32081 |
|
35681 |
onFocus,
|
35682 |
onDragStart,
|
35683 |
onDragEnd,
|
35684 |
+
draggable,
|
35685 |
+
isExpanded
|
35686 |
} = _ref;
|
35687 |
const blockInformation = useBlockDisplayInformation(clientId);
|
35688 |
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ListViewBlockSelectButton);
|
35715 |
onDragStart: onDragStartHandler,
|
35716 |
onDragEnd: onDragEnd,
|
35717 |
draggable: draggable,
|
35718 |
+
href: `#block-${clientId}`,
|
35719 |
+
"aria-expanded": isExpanded
|
35720 |
}, (0,external_wp_element_namespaceObject.createElement)(ListViewExpander, {
|
35721 |
onClick: onToggleExpanded
|
35722 |
}), (0,external_wp_element_namespaceObject.createElement)(block_icon, {
|
35764 |
position,
|
35765 |
siblingBlockCount,
|
35766 |
level,
|
35767 |
+
isExpanded,
|
35768 |
...props
|
35769 |
} = _ref;
|
35770 |
const {
|
35809 |
level: level,
|
35810 |
draggable: draggable,
|
35811 |
onDragStart: onDragStart,
|
35812 |
+
onDragEnd: onDragEnd,
|
35813 |
+
isExpanded: isExpanded
|
35814 |
}, props));
|
35815 |
});
|
35816 |
});
|
35979 |
level: level,
|
35980 |
ref: ref,
|
35981 |
tabIndex: tabIndex,
|
35982 |
+
onFocus: onFocus,
|
35983 |
+
isExpanded: isExpanded
|
35984 |
}));
|
35985 |
}), hasRenderedMovers && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridCell, {
|
35986 |
className: moverCellClassName,
|
37708 |
}));
|
37709 |
}
|
37710 |
//# sourceMappingURL=control.js.map
|
37711 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors-gradients/panel-color-gradient-settings.js
|
37712 |
+
|
37713 |
+
|
37714 |
+
|
37715 |
+
/**
|
37716 |
+
* External dependencies
|
37717 |
+
*/
|
37718 |
+
|
37719 |
+
|
37720 |
+
/**
|
37721 |
+
* WordPress dependencies
|
37722 |
+
*/
|
37723 |
+
|
37724 |
+
|
37725 |
+
|
37726 |
+
/**
|
37727 |
+
* Internal dependencies
|
37728 |
+
*/
|
37729 |
+
|
37730 |
+
|
37731 |
+
|
37732 |
+
|
37733 |
+
|
37734 |
+
|
37735 |
+
// 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)
|
37736 |
+
|
37737 |
+
const colorIndicatorAriaLabel = (0,external_wp_i18n_namespaceObject.__)('(%s: color %s)'); // translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)
|
37738 |
+
|
37739 |
+
|
37740 |
+
const gradientIndicatorAriaLabel = (0,external_wp_i18n_namespaceObject.__)('(%s: gradient %s)');
|
37741 |
+
|
37742 |
+
const panel_color_gradient_settings_colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients'];
|
37743 |
+
|
37744 |
+
const Indicators = _ref => {
|
37745 |
+
let {
|
37746 |
+
colors,
|
37747 |
+
gradients,
|
37748 |
+
settings
|
37749 |
+
} = _ref;
|
37750 |
+
return settings.map((_ref2, index) => {
|
37751 |
+
let {
|
37752 |
+
colorValue,
|
37753 |
+
gradientValue,
|
37754 |
+
label,
|
37755 |
+
colors: availableColors,
|
37756 |
+
gradients: availableGradients
|
37757 |
+
} = _ref2;
|
37758 |
+
|
37759 |
+
if (!colorValue && !gradientValue) {
|
37760 |
+
return null;
|
37761 |
+
}
|
37762 |
+
|
37763 |
+
let ariaLabel;
|
37764 |
+
|
37765 |
+
if (colorValue) {
|
37766 |
+
const colorObject = getColorObjectByColorValue(availableColors || colors, colorValue);
|
37767 |
+
ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)(colorIndicatorAriaLabel, label.toLowerCase(), colorObject && colorObject.name || colorValue);
|
37768 |
+
} else {
|
37769 |
+
const gradientObject = __experimentalGetGradientObjectByGradientValue(availableGradients || gradients, colorValue);
|
37770 |
+
|
37771 |
+
ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)(gradientIndicatorAriaLabel, label.toLowerCase(), gradientObject && gradientObject.name || gradientValue);
|
37772 |
+
}
|
37773 |
+
|
37774 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ColorIndicator, {
|
37775 |
+
key: index,
|
37776 |
+
colorValue: colorValue || gradientValue,
|
37777 |
+
"aria-label": ariaLabel
|
37778 |
+
});
|
37779 |
+
});
|
37780 |
+
};
|
37781 |
+
|
37782 |
+
const PanelColorGradientSettingsInner = _ref3 => {
|
37783 |
+
let {
|
37784 |
+
className,
|
37785 |
+
colors,
|
37786 |
+
gradients,
|
37787 |
+
disableCustomColors,
|
37788 |
+
disableCustomGradients,
|
37789 |
+
children,
|
37790 |
+
settings,
|
37791 |
+
title,
|
37792 |
+
showTitle = true,
|
37793 |
+
__experimentalHasMultipleOrigins,
|
37794 |
+
__experimentalIsRenderedInSidebar,
|
37795 |
+
enableAlpha,
|
37796 |
+
...props
|
37797 |
+
} = _ref3;
|
37798 |
+
|
37799 |
+
if ((0,external_lodash_namespaceObject.isEmpty)(colors) && (0,external_lodash_namespaceObject.isEmpty)(gradients) && disableCustomColors && disableCustomGradients && (0,external_lodash_namespaceObject.every)(settings, setting => (0,external_lodash_namespaceObject.isEmpty)(setting.colors) && (0,external_lodash_namespaceObject.isEmpty)(setting.gradients) && (setting.disableCustomColors === undefined || setting.disableCustomColors) && (setting.disableCustomGradients === undefined || setting.disableCustomGradients))) {
|
37800 |
+
return null;
|
37801 |
+
}
|
37802 |
+
|
37803 |
+
const titleElement = (0,external_wp_element_namespaceObject.createElement)("span", {
|
37804 |
+
className: "block-editor-panel-color-gradient-settings__panel-title"
|
37805 |
+
}, title, (0,external_wp_element_namespaceObject.createElement)(Indicators, {
|
37806 |
+
colors: colors,
|
37807 |
+
gradients: gradients,
|
37808 |
+
settings: settings
|
37809 |
+
}));
|
37810 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, _extends({
|
37811 |
+
className: classnames_default()('block-editor-panel-color-gradient-settings', className),
|
37812 |
+
title: showTitle ? titleElement : undefined
|
37813 |
+
}, props), (0,external_wp_element_namespaceObject.createElement)(ColorGradientSettingsDropdown, {
|
37814 |
+
settings: settings,
|
37815 |
+
colors,
|
37816 |
+
gradients,
|
37817 |
+
disableCustomColors,
|
37818 |
+
disableCustomGradients,
|
37819 |
+
__experimentalHasMultipleOrigins,
|
37820 |
+
__experimentalIsRenderedInSidebar,
|
37821 |
+
enableAlpha
|
37822 |
+
}), !!children && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalSpacer, {
|
37823 |
+
marginY: 4
|
37824 |
+
}), " ", children));
|
37825 |
+
};
|
37826 |
+
|
37827 |
+
const PanelColorGradientSettingsSingleSelect = props => {
|
37828 |
+
const colorGradientSettings = useCommonSingleMultipleSelects();
|
37829 |
+
colorGradientSettings.colors = useSetting('color.palette');
|
37830 |
+
colorGradientSettings.gradients = useSetting('color.gradients');
|
37831 |
+
return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsInner, _extends({}, colorGradientSettings, props));
|
37832 |
+
};
|
37833 |
+
|
37834 |
+
const PanelColorGradientSettingsMultipleSelect = props => {
|
37835 |
+
const colorGradientSettings = useMultipleOriginColorsAndGradients();
|
37836 |
+
return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsInner, _extends({}, colorGradientSettings, props));
|
37837 |
+
};
|
37838 |
+
|
37839 |
+
const PanelColorGradientSettings = props => {
|
37840 |
+
if ((0,external_lodash_namespaceObject.every)(panel_color_gradient_settings_colorsAndGradientKeys, key => props.hasOwnProperty(key))) {
|
37841 |
+
return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsInner, props);
|
37842 |
+
}
|
37843 |
+
|
37844 |
+
if (props.__experimentalHasMultipleOrigins) {
|
37845 |
+
return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsMultipleSelect, props);
|
37846 |
+
}
|
37847 |
+
|
37848 |
+
return (0,external_wp_element_namespaceObject.createElement)(PanelColorGradientSettingsSingleSelect, props);
|
37849 |
+
};
|
37850 |
+
|
37851 |
+
/* harmony default export */ var panel_color_gradient_settings = (PanelColorGradientSettings);
|
37852 |
+
//# sourceMappingURL=panel-color-gradient-settings.js.map
|
37853 |
;// CONCATENATED MODULE: ./node_modules/react-easy-crop/node_modules/tslib/tslib.es6.js
|
37854 |
/*! *****************************************************************************
|
37855 |
Copyright (c) Microsoft Corporation.
|
40857 |
|
40858 |
|
40859 |
function LinkPreview(_ref) {
|
40860 |
+
var _value$url;
|
40861 |
+
|
40862 |
let {
|
40863 |
value,
|
40864 |
onEditClick,
|
40875 |
|
40876 |
const hasRichData = richData && Object.keys(richData).length;
|
40877 |
const displayURL = value && (0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURI)(value.url), 16) || '';
|
40878 |
+
const displayTitle = (richData === null || richData === void 0 ? void 0 : richData.title) || (value === null || value === void 0 ? void 0 : value.title) || displayURL; // url can be undefined if the href attribute is unset
|
40879 |
+
|
40880 |
+
const isEmptyURL = !(value !== null && value !== void 0 && (_value$url = value.url) !== null && _value$url !== void 0 && _value$url.length);
|
40881 |
let icon;
|
40882 |
|
40883 |
if (richData !== null && richData !== void 0 && richData.icon) {
|
41853 |
|
41854 |
|
41855 |
|
|
|
41856 |
/**
|
41857 |
* Internal dependencies
|
41858 |
*/
|
41903 |
addToGallery,
|
41904 |
multiple = false,
|
41905 |
handleUpload = true,
|
|
|
41906 |
disableDropZone,
|
41907 |
disableMediaButtons,
|
41908 |
onError,
|
42196 |
return renderPlaceholder(uploadMediaLibraryButton);
|
42197 |
};
|
42198 |
|
42199 |
+
if (disableMediaButtons) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42200 |
return (0,external_wp_element_namespaceObject.createElement)(media_upload_check, null, renderDropZone());
|
42201 |
}
|
42202 |
|
42554 |
|
42555 |
external_wp_deprecated_default()('wp.blockEditor.RichText formattingControls prop', {
|
42556 |
since: '5.4',
|
42557 |
+
alternative: 'allowedFormats',
|
42558 |
+
version: '6.2'
|
42559 |
});
|
42560 |
return formattingControls.map(name => `core/${name}`);
|
42561 |
}
|
42691 |
propsRef.current = props;
|
42692 |
return (0,external_wp_compose_namespaceObject.useRefEffect)(element => {
|
42693 |
function _onPaste(event) {
|
42694 |
+
var _html;
|
42695 |
+
|
42696 |
const {
|
42697 |
isSelected,
|
42698 |
disableFormats,
|
42795 |
text: plainText
|
42796 |
})));
|
42797 |
return;
|
42798 |
+
} // Process any attached files, unless we detect Microsoft Office as
|
42799 |
+
// the source.
|
42800 |
+
//
|
42801 |
+
// When content is copied from Microsoft Office, an image of the
|
42802 |
+
// content is rendered and attached to the clipboard along with the
|
42803 |
+
// plain-text and HTML content. This artifact is a distraction from
|
42804 |
+
// the relevant clipboard data, so we ignore it.
|
42805 |
+
//
|
42806 |
+
// Props https://github.com/pubpub/pubpub/commit/2f933277a15a263a1ab4bbd36b96d3a106544aec
|
42807 |
|
42808 |
|
42809 |
+
if (files && files.length && !((_html = html) !== null && _html !== void 0 && _html.includes('xmlns:o="urn:schemas-microsoft-com:office:office'))) {
|
42810 |
const content = (0,external_wp_blocks_namespaceObject.pasteHandler)({
|
42811 |
HTML: filePasteHandler(files),
|
42812 |
mode: 'BLOCKS',
|
43790 |
|
43791 |
external_wp_deprecated_default()('wp.blockEditor.RichText wrapperClassName prop', {
|
43792 |
since: '5.4',
|
43793 |
+
alternative: 'className prop or create your own wrapper div',
|
43794 |
+
version: '6.2'
|
43795 |
});
|
43796 |
const className = classnames_default()('block-editor-rich-text', wrapperClassName);
|
43797 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
44999 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
45000 |
className: "block-editor-block-inspector"
|
45001 |
}, (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, {
|
45002 |
+
__experimentalGroup: "color",
|
45003 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Color')
|
45004 |
+
}), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, {
|
45005 |
__experimentalGroup: "typography",
|
45006 |
label: (0,external_wp_i18n_namespaceObject.__)('Typography')
|
45007 |
}), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, {
|
45055 |
}), (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, 'defaultStylePicker', true) && (0,external_wp_element_namespaceObject.createElement)(DefaultStylePicker, {
|
45056 |
blockName: blockName
|
45057 |
}))), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, null), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, {
|
45058 |
+
__experimentalGroup: "color",
|
45059 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Color'),
|
45060 |
+
className: "color-block-support-panel__inner-wrapper"
|
45061 |
+
}), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, {
|
45062 |
__experimentalGroup: "typography",
|
45063 |
label: (0,external_wp_i18n_namespaceObject.__)('Typography')
|
45064 |
}), (0,external_wp_element_namespaceObject.createElement)(inspector_controls.Slot, {
|
45663 |
|
45664 |
/* harmony default export */ var observe_typing = (ObserveTyping);
|
45665 |
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45666 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/typewriter/index.js
|
45667 |
|
45668 |
|
46014 |
|
46015 |
|
46016 |
|
46017 |
+
|
46018 |
|
46019 |
|
46020 |
|
46058 |
|
46059 |
|
46060 |
|
|
|
46061 |
|
46062 |
|
46063 |
|
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-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' => '
|
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-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' => 'c5186062116522d9f09dd17ad7f6a9ad');
|
build/block-editor/index.min.js
CHANGED
@@ -1,93 +1,95 @@
|
|
1 |
-
!function(){var e={9367: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)},4184: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)}()},1934: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()}))]}},5913:function(e,t){"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=n.callback;"function"==typeof n&&(l=n,n={}),this.options=n;var i=this;function s(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(t),count:t.length}]);function f(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],f=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var h=d&&d.newPos+1<a,g=m&&0<=f&&f<c;if(h||g){if(!h||g&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),f=i.extractCommon(l,t,e,n),l.newPos+1>=a&&f+1>=c)return s(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();f()||e()}),0)}();else for(;u<=d;){var h=f();if(h)return h}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},7630: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(5913))&&o.__esModule?o:{default:o}).default)},9010:function(e,t,n){"use strict";var o=n(4657);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),h=o.outerHeight(e),g=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+g-(S.left+w)+d,top:f.top+h-(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+g-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:f.top+h-(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)))}},4979:function(e,t,n){"use strict";e.exports=n(9010)},4657: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 h(e){return null!=e&&e==e.window}var g={};function v(e,t,n){if(h(e))return"width"===t?g.viewportWidth(e):g.viewportHeight(e);if(9===e.nodeType)return"width"===t?g.docWidth(e):g.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(c(e),d(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?1:-1);var s=void 0!==r||l,a=r||i;if(-1===n)return s?a-f(e,["border","padding"],o):i;if(s){var u=2===n?-f(e,["border"],o):f(e,["margin"],o);return a+(1===n?0:u)}return i+f(e,p.slice(n),o)}u(["Width","Height"],(function(e){g["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],g["viewport"+e](n))},g["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var b={position:"absolute",visibility:"hidden",display:"block"};function k(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=v.apply(void 0,n):m(e,b,(function(){t=v.apply(void 0,n)})),t}function _(e,t,o){var r=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):c(e,t);for(var l in t)t.hasOwnProperty(l)&&_(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);g["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];g[e]=function(t,o){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:h,each:u,css:_,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(h(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(h(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},g)},5717: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}},8303:function(e,t,n){var o=n(1934);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML=" ","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},2703:function(e,t,n){"use strict";var o=n(414);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}},5697:function(e,t,n){e.exports=n(2703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4857: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(5697),c=n(9367),u=n(8303),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}))}))},4042:function(e,t,n){"use strict";var o=n(4857);t.Z=o.TextareaAutosize},3692:function(e){var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function o(e,t,n){var o=[],i=[],u=!0;return function e(d){var p=n?r(d):d,m={},f=!0,h={node:p,node_:d,path:[].concat(o),parent:i[i.length-1],parents:i,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){h.isRoot||(h.parent.node[h.key]=e),h.node=e,t&&(f=!1)},delete:function(e){delete h.parent.node[h.key],e&&(f=!1)},remove:function(e){s(h.parent.node)?h.parent.node.splice(h.key,1):delete h.parent.node[h.key],e&&(f=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){f=!1}};if(!u)return h;function g(){if("object"==typeof h.node&&null!==h.node){h.keys&&h.node_===h.node||(h.keys=l(h.node)),h.isLeaf=0==h.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){h.circular=i[e];break}}else h.isLeaf=!0,h.keys=null;h.notLeaf=!h.isLeaf,h.notRoot=!h.isRoot}g();var v=t.call(h,h.node);return void 0!==v&&h.update&&h.update(v),m.before&&m.before.call(h,h.node),f?("object"!=typeof h.node||null===h.node||h.circular||(i.push(h),g(),a(h.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(h,h.node[t],t);var l=e(h.node[t]);n&&c.call(h.node,t)&&(h.node[t]=l.node),l.isLast=r==h.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(h,l),o.pop()})),i.pop()),m.after&&m.after.call(h,h.node),h):h}(e).node}function r(e){if("object"==typeof e&&null!==e){var t;if(s(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if("[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 Mg},AlignmentToolbar:function(){return Rg},Autocomplete:function(){return Og},BlockAlignmentControl:function(){return zo},BlockAlignmentToolbar:function(){return Vo},BlockBreadcrumb:function(){return Gg},BlockColorsStyleSelector:function(){return Kg},BlockContextProvider:function(){return ir},BlockControls:function(){return Yn},BlockEdit:function(){return ur},BlockEditorKeyboardShortcuts:function(){return a_},BlockEditorProvider:function(){return $a},BlockFormatControls:function(){return qn},BlockIcon:function(){return Ga},BlockInspector:function(){return r_},BlockList:function(){return fm},BlockMover:function(){return Zd},BlockNavigationDropdown:function(){return fv},BlockPreview:function(){return mu},BlockSelectionClearer:function(){return qa},BlockSettingsMenu:function(){return Hp},BlockSettingsMenuControls:function(){return Op},BlockStyles:function(){return bv},BlockTitle:function(){return Dd},BlockToolbar:function(){return Gp},BlockTools:function(){return l_},BlockVerticalAlignmentControl:function(){return zv},BlockVerticalAlignmentToolbar:function(){return Vv},ButtonBlockAppender:function(){return Bd},ButtonBlockerAppender:function(){return wd},ColorPalette:function(){return Gv},ColorPaletteControl:function(){return Uv},ContrastChecker:function(){return kf},CopyHandler:function(){return Bp},DefaultBlockAppender:function(){return Cd},FontSizePicker:function(){return Qf},InnerBlocks:function(){return um},Inserter:function(){return Ed},InspectorAdvancedControls:function(){return Jo},InspectorControls:function(){return er},JustifyContentControl:function(){return go},JustifyToolbar:function(){return vo},LineHeightControl:function(){return Lf},MediaPlaceholder:function(){return ok},MediaReplaceFlow:function(){return Qb},MediaUpload:function(){return Zb},MediaUploadCheck:function(){return Xb},MultiSelectScrollIntoView:function(){return c_},NavigableToolbar:function(){return Vd},ObserveTyping:function(){return m_},PanelColorSettings:function(){return rk},PlainText:function(){return Nk},PreserveScrollInReorder:function(){return f_},RichText:function(){return Ik},RichTextShortcut:function(){return Rk},RichTextToolbarButton:function(){return Lk},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return Qk},ToolSelector:function(){return Ok},Typewriter:function(){return b_},URLInput:function(){return Ib},URLInputButton:function(){return Hk},URLPopover:function(){return tk},Warning:function(){return pr},WritingFlow:function(){return rc},__experimentalBlockAlignmentMatrixControl:function(){return Vg},__experimentalBlockContentOverlay:function(){return Ug},__experimentalBlockFullHeightAligmentControl:function(){return zg},__experimentalBlockPatternSetup:function(){return Nv},__experimentalBlockVariationPicker:function(){return _v},__experimentalBlockVariationTransforms:function(){return Mv},__experimentalBorderRadiusControl:function(){return Um},__experimentalBorderStyleControl:function(){return Ym},__experimentalColorGradientControl:function(){return _m},__experimentalColorGradientSettingsDropdown:function(){return ym},__experimentalDuotoneControl:function(){return Jh},__experimentalFontAppearanceControl:function(){return Rf},__experimentalFontFamilyControl:function(){return Wf},__experimentalGetBorderClassesAndStyles:function(){return pg},__experimentalGetColorClassesAndStyles:function(){return fg},__experimentalGetGradientClass:function(){return rf},__experimentalGetGradientObjectByGradientValue:function(){return sf},__experimentalGetMatchingVariation:function(){return Pv},__experimentalGetSpacingClassesAndStyles:function(){return vg},__experimentalImageEditingProvider:function(){return db},__experimentalImageEditor:function(){return yb},__experimentalImageSizeControl:function(){return Cb},__experimentalImageURLInputUI:function(){return Yk},__experimentalLayoutStyle:function(){return Mo},__experimentalLetterSpacingControl:function(){return kh},__experimentalLibrary:function(){return i_},__experimentalLinkControl:function(){return Kb},__experimentalLinkControlSearchInput:function(){return zb},__experimentalLinkControlSearchItem:function(){return Nb},__experimentalLinkControlSearchResults:function(){return Rb},__experimentalListView:function(){return pv},__experimentalPanelColorGradientSettings:function(){return vf},__experimentalPreviewOptions:function(){return Zk},__experimentalResponsiveBlockControl:function(){return Mk},__experimentalTextDecorationControl:function(){return sh},__experimentalTextTransformControl:function(){return hh},__experimentalUnitControl:function(){return Fk},__experimentalUseBlockPreview:function(){return fu},__experimentalUseBorderProps:function(){return mg},__experimentalUseColorProps:function(){return gg},__experimentalUseCustomSides:function(){return Hh},__experimentalUseGradient:function(){return cf},__experimentalUseNoRecursiveRenders:function(){return E_},__experimentalUseResizeCanvas:function(){return Xk},__unstableBlockSettingsMenuFirstItem:function(){return Mp},__unstableEditorStyles:function(){return cu},__unstableIframe:function(){return sc},__unstableInserterMenuExtension:function(){return dd},__unstableRichTextInputEvent:function(){return Ak},__unstableUseBlockSelectionClearer:function(){return Ka},__unstableUseClipboardHandler:function(){return wp},__unstableUseMouseMoveTypingReset:function(){return d_},__unstableUseTypewriter:function(){return v_},__unstableUseTypingObserver:function(){return p_},createCustomColorsHOC:function(){return Eg},getColorClassName:function(){return Bm},getColorObjectByAttributeValues:function(){return Sm},getColorObjectByColorValue:function(){return wm},getFontSize:function(){return Yf},getFontSizeClass:function(){return Xf},getFontSizeObjectByValue:function(){return Zf},getGradientSlugByValue:function(){return af},getGradientValueBySlug:function(){return lf},getPxFromCssUnit:function(){return L_},store:function(){return zn},storeConfig:function(){return Fn},transformStyles:function(){return iu},useBlockDisplayInformation:function(){return Ad},useBlockEditContext:function(){return Un},useBlockProps:function(){return Pa},useCachedTruthy:function(){return bg},useInnerBlocksProps:function(){return cm},useSetting:function(){return mo},validateThemeColors:function(){return C_},validateThemeGradients:function(){return S_},withColorContext:function(){return Hv},withColors:function(){return Cg},withFontSizes:function(){return wg}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return xt},__experimentalGetAllowedBlocks:function(){return at},__experimentalGetAllowedPatterns:function(){return pt},__experimentalGetBlockListSettingsForBlocks:function(){return bt},__experimentalGetDirectInsertBlock:function(){return ct},__experimentalGetLastBlockAttributeChanges:function(){return yt},__experimentalGetParsedPattern:function(){return ut},__experimentalGetPatternTransformItems:function(){return ft},__experimentalGetPatternsByBlockTypes:function(){return mt},__experimentalGetReusableBlockTitle:function(){return kt},__unstableGetBlockWithoutInnerBlocks:function(){return W},__unstableGetClientIdWithClientIdsTree:function(){return j},__unstableGetClientIdsTree:function(){return K},__unstableIsLastBlockChangeIgnored:function(){return _t},areInnerBlocksControlled:function(){return It},canInsertBlockType:function(){return qe},canInsertBlocks:function(){return Ye},canMoveBlock:function(){return Qe},canMoveBlocks:function(){return Je},canRemoveBlock:function(){return Ze},canRemoveBlocks:function(){return Xe},didAutomaticChange:function(){return wt},getAdjacentBlockClientId:function(){return pe},getBlock:function(){return U},getBlockAttributes:function(){return G},getBlockCount:function(){return Q},getBlockHierarchyRootClientId:function(){return ue},getBlockIndex:function(){return Ie},getBlockInsertionPoint:function(){return He},getBlockListSettings:function(){return ht},getBlockMode:function(){return Le},getBlockName:function(){return V},getBlockOrder:function(){return Be},getBlockParents:function(){return ae},getBlockParentsByBlockName:function(){return ce},getBlockRootClientId:function(){return se},getBlockSelectionEnd:function(){return ne},getBlockSelectionStart:function(){return te},getBlockTransformItems:function(){return it},getBlocks:function(){return $},getBlocksByClientId:function(){return X},getClientIdsOfDescendants:function(){return q},getClientIdsWithDescendants:function(){return Y},getDraggedBlockClientIds:function(){return Oe},getFirstMultiSelectedBlockClientId:function(){return ke},getGlobalBlockCount:function(){return Z},getInserterItems:function(){return lt},getLastMultiSelectedBlockClientId:function(){return _e},getLowestCommonAncestorWithSelectedBlock:function(){return de},getMultiSelectedBlockClientIds:function(){return ve},getMultiSelectedBlocks:function(){return be},getMultiSelectedBlocksEndClientId:function(){return we},getMultiSelectedBlocksStartClientId:function(){return Se},getNextBlockClientId:function(){return fe},getPreviousBlockClientId:function(){return me},getSelectedBlock:function(){return ie},getSelectedBlockClientId:function(){return le},getSelectedBlockClientIds:function(){return ge},getSelectedBlockCount:function(){return oe},getSelectedBlocksInitialCaretPosition:function(){return he},getSelectionEnd:function(){return ee},getSelectionStart:function(){return J},getSettings:function(){return gt},getTemplate:function(){return We},getTemplateLock:function(){return $e},hasBlockMovingClientId:function(){return St},hasInserterItems:function(){return st},hasMultiSelection:function(){return Pe},hasSelectedBlock:function(){return re},hasSelectedInnerBlock:function(){return Te},isAncestorBeingDragged:function(){return ze},isAncestorMultiSelected:function(){return Ce},isBlockBeingDragged:function(){return Fe},isBlockHighlighted:function(){return Bt},isBlockInsertionPointVisible:function(){return Ge},isBlockMultiSelected:function(){return Ee},isBlockSelected:function(){return xe},isBlockValid:function(){return H},isBlockWithinSelection:function(){return Ne},isCaretWithinFormattedText:function(){return Ve},isDraggingBlocks:function(){return De},isFirstMultiSelectedBlock:function(){return ye},isLastBlockChangePersistent:function(){return vt},isMultiSelecting:function(){return Me},isNavigationMode:function(){return Ct},isSelectionEnabled:function(){return Re},isTyping:function(){return Ae},isValidTemplate:function(){return Ue},wasBlockJustInserted:function(){return Tt}});var t={};n.r(t),n.d(t,{__unstableMarkAutomaticChange:function(){return xn},__unstableMarkLastChangeAsPersistent:function(){return Bn},__unstableMarkNextChangeAsNotPersistent:function(){return In},__unstableSaveReusableBlock:function(){return wn},clearSelectedBlock:function(){return jt},duplicateBlocks:function(){return Pn},enterFormattedText:function(){return bn},exitFormattedText:function(){return kn},flashBlock:function(){return An},hideInsertionPoint:function(){return ln},insertAfterBlock:function(){return Rn},insertBeforeBlock:function(){return Mn},insertBlock:function(){return nn},insertBlocks:function(){return on},insertDefaultBlock:function(){return En},mergeBlocks:function(){return cn},moveBlockToPosition:function(){return tn},moveBlocksDown:function(){return Qt},moveBlocksToPosition:function(){return en},moveBlocksUp:function(){return Jt},multiSelect:function(){return $t},receiveBlocks:function(){return Ot},removeBlock:function(){return dn},removeBlocks:function(){return un},replaceBlock:function(){return Zt},replaceBlocks:function(){return Yt},replaceInnerBlocks:function(){return pn},resetBlocks:function(){return Lt},resetSelection:function(){return Dt},selectBlock:function(){return Vt},selectNextBlock:function(){return Gt},selectPreviousBlock:function(){return Ht},selectionChange:function(){return yn},setBlockMovingClientId:function(){return Nn},setHasControlledInnerBlocks:function(){return Dn},setNavigationMode:function(){return Tn},setTemplateValidity:function(){return sn},showInsertionPoint:function(){return rn},startDraggingBlocks:function(){return gn},startMultiSelect:function(){return Ut},startTyping:function(){return fn},stopDraggingBlocks:function(){return vn},stopMultiSelect:function(){return Wt},stopTyping:function(){return hn},synchronizeTemplate:function(){return an},toggleBlockHighlight:function(){return Ln},toggleBlockMode:function(){return mn},toggleSelection:function(){return Kt},updateBlock:function(){return zt},updateBlockAttributes:function(){return Ft},updateBlockListSettings:function(){return Cn},updateSettings:function(){return Sn},validateBlocksToTemplate:function(){return At}});var r=window.wp.blocks,l=window.wp.hooks;function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).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(4184),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")},h=window.wp.i18n;const g={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,h.__)("Black"),slug:"black",color:"#000000"},{name:(0,h.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,h.__)("White"),slug:"white",color:"#ffffff"},{name:(0,h.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,h.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,h.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,h.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,h.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,h.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,h.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,h.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,h.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,h._x)("Small","font size name"),size:13,slug:"small"},{name:(0,h._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,h._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,h._x)("Large","font size name"),size:36,slug:"large"},{name:(0,h._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,h.__)("Thumbnail")},{slug:"medium",name:(0,h.__)("Medium")},{slug:"large",name:(0,h.__)("Large")},{slug:"full",name:(0,h.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__unstableGalleryWithImageBlocks:!1,gradients:[{name:(0,h.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,h.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,h.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,h.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,h.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,h.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,h.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,h.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,h.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,h.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,h.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,h.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__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;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||["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]:g,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:l}=n,i=(0,m.select)(r.store).getActiveBlockVariation(l,o);let s=null!=i&&i.name?`${l}/${i.name}`:l;const a={name:s};return"core/block"===l&&(a.ref=o.ref,s+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[s]:{time:t.time,count:e.insertUsage[s]?e.insertUsage[s].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(e,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return null},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":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&&It(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||z}const j=D(((e,t)=>({clientId:t,innerBlocks:K(e,t)})),(e=>[e.blocks.order])),K=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Be(e,t),(t=>j(e,t)))}),(e=>[e.blocks.order])),q=(e,t)=>(0,u.flatMap)(t,(t=>{const n=Be(e,t);return[...n,...q(e,n)]})),Y=D((e=>{const t=Be(e);return[...t,...q(e,t)]}),(e=>[e.blocks.order])),Z=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])),X=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 Q(e,t){return Be(e,t).length}function J(e){return e.selection.selectionStart}function ee(e){return e.selection.selectionEnd}function te(e){return e.selection.selectionStart.clientId}function ne(e){return e.selection.selectionEnd.clientId}function oe(e){return ve(e).length||(e.selection.selectionStart.clientId?1:0)}function re(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function le(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ie(e){const t=le(e);return t?U(e,t):null}function se(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const ae=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),ce=D((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=ae(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:V(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function ue(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function de(e,t){const n=le(e),o=[...ae(e,t),t],r=[...ae(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function pe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=le(e)),void 0===t&&(t=n<0?ke(e):_e(e)),!t)return null;const o=se(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),s=i+1*n;return s<0||s===l.length?null:l[s]}function me(e,t){return pe(e,t,-1)}function fe(e,t){return pe(e,t,1)}function he(e){return e.initialPosition}const ge=D((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return z;if(t.clientId===n.clientId)return[t.clientId];const o=se(e,t.clientId);if(null===o)return z;const r=Be(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?z:ge(e)}const be=D((e=>{const t=ve(e);return t.length?t.map((t=>U(e,t))):z}),(e=>[...ge.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function ke(e){return(0,u.first)(ve(e))||null}function _e(e){return(0,u.last)(ve(e))||null}function ye(e,t){return ke(e)===t}function Ee(e,t){return-1!==ve(e).indexOf(t)}const Ce=D(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=se(e,n),o=Ee(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Se(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function we(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Be(e,t){return e.blocks.order[t||""]||z}function Ie(e,t){return Be(e,se(e,t)).indexOf(t)}function xe(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Te(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Be(e,t),(t=>xe(e,t)||Ee(e,t)||n&&Te(e,t,n)))}function Ne(e,t){if(!t)return!1;const n=ve(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Pe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Me(e){return e.isMultiSelecting}function Re(e){return e.isSelectionEnabled}function Le(e,t){return e.blocksMode[t]||"visual"}function Ae(e){return e.isTyping}function De(e){return!!e.draggedBlocks.length}function Oe(e){return e.draggedBlocks}function Fe(e,t){return e.draggedBlocks.includes(t)}function ze(e,t){if(!De(e))return!1;const n=ae(e,t);return(0,u.some)(n,(t=>Fe(e,t)))}function Ve(e){return e.isCaretWithinFormattedText}function He(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=se(e,l)||void 0,n=Ie(e,r.clientId)+1):n=Be(e).length,{rootClientId:t,index:n}}function Ge(e){return null!==e.insertionPoint}function Ue(e){return e.template.isValid}function We(e){return e.settings.template}function $e(e,t){if(!t)return e.settings.templateLock;const n=ht(e,t);return n?n.templateLock:null}const je=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},Ke=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,r.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=gt(e),s=je(i,t,!0);if(!s)return!1;const a=!!$e(e,o);if(a)return!1;const c=ht(e,o);if(o&&void 0===c)return!1;const u=null==c?void 0:c.allowedBlocks,d=je(u,t),p=n.parent,m=V(e,o),f=je(p,m),h=null===d&&null===f||!0===d||!0===f;return h?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",h,n,o,{getBlock:U.bind(null,e),getBlockParentsByBlockName:ce.bind(null,e)}):h},qe=D(Ke,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function Ye(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>qe(e,V(e,t),n)))}function Ze(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=!!$e(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function Xe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Ze(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;const{lock:r}=o,l="all"===$e(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function Je(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Qe(e,t,n)))}function et(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const tt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&Ke(e,t.name,n),nt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=et(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:ot(r,l)}},ot=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},rt=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,u.some)(X(e,Y(e)),{name:t.name}));const{time:i,count:s=0}=et(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:ot(i,s)};if("transform"===n)return a;const c=(0,r.getBlockVariations)(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},lt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=rt(e,{buildScope:"inserter"}),o=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,l=t=>{let n=F;if("web"===s.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,l=(0,r.getBlockType)(t+o);l&&(n=l.icon)}}const l=`core/block/${t.id}`,{time:i,count:a=0}=et(e,l)||{},c=ot(i,a);return{id:l,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}},i=(0,r.getBlockTypes)().filter((n=>tt(e,n,t))).map(n),a=Ke(e,"core/block",t)?Et(e).map(l):[],c=i.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=nt(e,n);t.push(...o.map(r))}return t}),[]),u=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=c.reduce(u,{core:[],noncore:[]}),m=[...d,...p];return[...m,...a]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Et(e),(0,r.getBlockTypes)()])),it=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=rt(e,{buildScope:"transform"}),l=(0,r.getBlockTypes)().filter((t=>tt(e,t,n))).map(o),i=(0,u.mapKeys)(l,(e=>{let{name:t}=e;return t})),s=(0,r.getPossibleBlockTransformations)(t).reduce(((e,t)=>(i[null==t?void 0:t.name]&&e.push(i[t.name]),e)),[]),a=(0,u.orderBy)(s,(e=>i[e.name].frecency),"desc");return a}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),st=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>tt(e,n,t)));if(n)return!0;const o=Ke(e,"core/block",t)&&Et(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Et(e),(0,r.getBlockTypes)()])),at=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>tt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),ct=D((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(U(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),ut=D(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content)}:null}),(e=>[e.settings.__experimentalBlockPatterns])),dt=D((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=gt(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return ut(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(!je(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}))}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),pt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=dt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return qe(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),mt=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return z;const o=pt(e,n),r=Array.isArray(t)?t:[t];return o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}))}),((e,t)=>[...pt.getDependants(e,t)])),ft=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return z;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||It(e,n)})))return z;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return mt(e,o,n)}),((e,t)=>[...mt.getDependants(e,t)]));function ht(e,t){return e.blockListSettings[t]}function gt(e){return e.settings}function vt(e){return e.blocks.isPersistentChange}const bt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),kt=D(((e,t)=>{var n;const o=(0,u.find)(Et(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Et(e)]));function _t(e){return e.blocks.isIgnoredChange}function yt(e){return e.lastBlockAttributesChange}function Et(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:z}function Ct(e){return e.isNavigationMode}function St(e){return e.hasBlockMovingClientId}function wt(e){return!!e.automaticChangeStatus}function Bt(e,t){return e.highlightedBlock===t}function It(e,t){return!!e.blocks.controlledInnerBlocks[t]}const xt=D(((e,t)=>{if(!t.length)return null;const n=le(e);if(t.includes(V(e,n)))return n;const o=ve(e),r=ce(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Tt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Nt=window.wp.a11y,Pt=window.wp.richText,Mt=window.wp.deprecated,Rt=n.n(Mt);const Lt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(At(e))},At=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getTemplate(),i=n.getTemplateLock(),s=!l||"all"!==i||(0,r.doBlocksMatchTemplate)(e,l);if(s!==n.isValidTemplate())return o.setTemplateValidity(s),s};function Dt(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Ot(e){return Rt()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Ft(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function zt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Vt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Ht=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Gt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Ut(){return{type:"START_MULTI_SELECT"}}function Wt(){return{type:"STOP_MULTI_SELECT"}}const $t=(e,t)=>n=>{let{select:o,dispatch:r}=n;if(o.getBlockRootClientId(e)!==o.getBlockRootClientId(t))return;r({type:"MULTI_SELECT",start:e,end:t});const l=o.getSelectedBlockCount();(0,Nt.speak)((0,h.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
-
(0,h._n)("%s block selected.","%s blocks selected.",l),l),"assertive")};function jt(){return{type:"CLEAR_SELECTED_BLOCK"}}function Kt(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function qt(e,t){var n,o;const l=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,r.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!l[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:i={}}=e,s=l[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}const Yt=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0;return l=>{let{select:i,dispatch:s}=l;e=(0,u.castArray)(e),t=qt((0,u.castArray)(t),i.getSettings());const a=i.getBlockRootClientId((0,u.first)(e));for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function Zt(e,t){return Yt(e,t)}const Xt=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},Qt=Xt("MOVE_BLOCKS_DOWN"),Jt=Xt("MOVE_BLOCKS_UP"),en=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return r=>{let{select:l,dispatch:i}=r;if(l.canMoveBlocks(e,t)){if(t!==n){if(!l.canRemoveBlocks(e,t))return;if(!l.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function tn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return en([e],t,n,o)}function nn(e,t,n,o,r){return on([e],t,n,o,0,r)}const on=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;(0,u.isObject)(r)&&(l=r,r=0,Rt()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=qt((0,u.castArray)(e),s.getSettings());const c=[];for(const t of e)s.canInsertBlockType(t.name,n)&&c.push(t);c.length&&a({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function rn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function ln(){return{type:"HIDE_INSERTION_POINT"}}function sn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const an=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),l=t.getTemplate(),i=(0,r.synchronizeBlocksWithTemplate)(o,l);n.resetBlocks(i)},cn=(e,t)=>n=>{let{select:o,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[s,a]=i,c=o.getBlock(s),d=(0,r.getBlockType)(c.name);if(d&&!d.merge)return void l.selectBlock(c.clientId);const p=o.getBlock(a),m=(0,r.getBlockType)(p.name),{clientId:f,attributeKey:h,offset:g}=o.getSelectionStart(),v=(f===s?d:m).attributes[h],b=(f===s||f===a)&&void 0!==h&&void 0!==g&&!!v;v||("number"==typeof h?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof h):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const k=(0,r.cloneBlock)(c),_=(0,r.cloneBlock)(p);if(b){const e=f===s?k:_,t=e.attributes[h],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=v,l=(0,Pt.insert)((0,Pt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),"",g,g);e.attributes[h]=(0,Pt.toHTMLString)({value:l,multilineTag:n,preserveWhiteSpace:r})}const y=c.name===p.name?[_]:(0,r.switchToBlockType)(_,c.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=(0,u.findKey)(E,(e=>"string"==typeof e&&-1!==e.indexOf(""))),t=E[e],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=d.attributes[e],i=(0,Pt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),s=i.text.indexOf(""),a=(0,Pt.remove)(i,s,s+1),p=(0,Pt.toHTMLString)({value:a,multilineTag:n,preserveWhiteSpace:r});E[e]=p,l.selectionChange(c.clientId,e,s,s)}l.replaceBlocks([c.clientId,p.clientId],[{...c,attributes:{...c.attributes,...E}},...y.slice(1)],0)},un=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=(0,u.castArray)(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function dn(e,t){return un([e],t)}function pn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function mn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function fn(){return{type:"START_TYPING"}}function hn(){return{type:"STOP_TYPING"}}function gn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function vn(){return{type:"STOP_DRAGGING_BLOCKS"}}function bn(){return{type:"ENTER_FORMATTED_TEXT"}}function kn(){return{type:"EXIT_FORMATTED_TEXT"}}function yn(e,t,n,o){return{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}}function En(e,t,n){const o=(0,r.getDefaultBlockName)();if(o)return nn((0,r.createBlock)(o,e),n,t)}function Cn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Sn(e){return{type:"UPDATE_SETTINGS",settings:e}}function wn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Bn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function In(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const xn=()=>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"})}))},Tn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?(0,Nt.speak)((0,h.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):(0,Nt.speak)((0,h.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Nn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Nt.speak)((0,h.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},Pn=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))}},Mn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l)},Rn=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 Ln(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const An=e=>async t=>{let{dispatch:n}=t;n(Ln(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Ln(e,!1))};function Dn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const On="core/block-editor",Fn={reducer:M,selectors:e,actions:t,__experimentalUseThunks:!0},zn=(0,m.createReduxStore)(On,{...Fn,persist:["preferences"]});(0,m.registerStore)(On,{...Fn,persist:["preferences"]});const Vn={name:"",isSelected:!1},Hn=(0,s.createContext)(Vn),{Provider:Gn}=Hn;function Un(){return(0,s.useContext)(Hn)}function Wn(){const{isSelected:e,clientId:t,name:n}=Un();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(zn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function $n(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=Wn(),{clientId:o}=Un(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(zn),{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 jn(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 Kn=$n;Kn.Slot=jn;const qn=e=>(0,s.createElement)($n,i({group:"inline"},e));qn.Slot=e=>(0,s.createElement)(jn,i({group:"inline"},e));var Yn=Kn,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"})),Xn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),Qn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),Jn=(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"})),eo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),to=(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"})),no=(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"})),oo=(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"})),ro=(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"})),lo=(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"})),io=(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"})),so=(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 ao(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const co=["color","border","typography","spacing"],uo={"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},po={"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 mo(e){const{name:t}=Un();return(0,m.useSelect)((n=>{var o;if(co.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(zn).getSettings(),i=(e=>po[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=uo[i]?uo[i](l):void 0;return void 0!==m?m:"typography.dropCap"===i||void 0}),[t,e])}const fo={left:no,center:oo,right:ro,"space-between":lo};var ho=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?fo[r]:fo.left,d=[{name:"left",icon:no,title:(0,h.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:oo,title:(0,h.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:ro,title:(0,h.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:lo,title:(0,h.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,f=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,h.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};function go(e){return(0,s.createElement)(ho,i({},e,{isToolbar:!1}))}function vo(e){return(0,s.createElement)(ho,i({},e,{isToolbar:!0}))}const bo={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},ko={left:"flex-start",right:"flex-end",center:"center"},_o=["wrap","nowrap"];var yo={name:"flex",label:(0,h.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n}=e;const{allowOrientation:o=!0}=t;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Flex,null,(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Eo,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,o&&(0,s.createElement)(So,{layout:t,onChange:n}))),(0,s.createElement)(Co,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;return null!=o&&o.allowSwitching?null:(0,s.createElement)(Yn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Eo,{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!==mo("spacing.blockGap"),c=null!==(t=null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap)&&void 0!==t?t:"var( --wp--style--block-gap, 0.5em )",u=bo[r.justifyContent]||bo.left,d=_o.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: ${ko[r.justifyContent]||ko.left};\n\t\t`;return(0,s.createElement)("style",null,`\n\t\t\t\t${ao(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tgap: ${a?c:"0.5em"};\n\t\t\t\t\tflex-wrap: ${d};\n\t\t\t\t\t${"horizontal"===i?p:m}\n\t\t\t\t}\n\n\t\t\t\t${ao(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 Eo(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)(go,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:no,label:(0,h.__)("Justify items left")},{value:"center",icon:oo,label:(0,h.__)("Justify items center")},{value:"right",icon:ro,label:(0,h.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:lo,label:(0,h.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,h.__)("Justification")),(0,s.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(p.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function Co(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function So(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal"}=t;return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},(0,s.createElement)("legend",null,(0,h.__)("Orientation")),(0,s.createElement)(p.Button,{label:"horizontal",icon:io,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:"vertical",icon:so,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var wo=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})};const Bo=[{name:"default",label:(0,h.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:l}),(0,s.createElement)(wo,{icon:Qn})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:l}),(0,s.createElement)(wo,{icon:eo}))),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,s.createElement)(p.Button,{variant:"secondary",isSmall:!0,disabled:!r&&!o,onClick:()=>n({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,h.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,h.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function(e){var t,n;let{selector:o,layout:r={},style:l}=e;const{contentSize:i,wideSize:a}=r,c=null!==mo("spacing.blockGap"),u=null!==(t=null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap)&&void 0!==t?t:"var( --wp--style--block-gap )";let d=i||a?`\n\t\t\t\t\t${ao(o,"> *")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:a};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\n\t\t\t\t\t${ao(o,'> [data-align="wide"]')} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\n\t\t\t\t\t${ao(o,'> [data-align="full"]')} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return d+=`\n\t\t\t${ao(o,'> [data-align="left"]')} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-right: 2em;\n\t\t\t}\n\n\t\t\t${ao(o,'> [data-align="right"]')} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-left: 2em;\n\t\t\t}\n\n\t\t`,c&&(d+=`\n\t\t\t\t${ao(o,"> *")} {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\tmargin-bottom: 0;\n\t\t\t\t}\n\t\t\t\t${ao(o,"> * + *")} {\n\t\t\t\t\tmargin-top: ${u};\n\t\t\t\t}\n\t\t\t`),(0,s.createElement)("style",null,d)},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(
|
4 |
// translators: %s: container size (i.e. 600px etc)
|
5 |
-
o.none=(0,
|
6 |
// translators: %s: container size (i.e. 600px etc)
|
7 |
-
o.wide=(0,h.sprintf)((0,h.__)("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}},yo];function Io(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Bo.find((t=>t.name===e))}const xo={type:"default"},To=(0,s.createContext)(xo),No=To.Provider;function Po(){return(0,s.useContext)(To)}function Mo(e){let{layout:t={},...n}=e;const o=Io(t.type);return o?(0,s.createElement)(o.save,i({layout:t},n)):null}const Ro=["none","left","center","right","wide","full"],Lo=["wide","full"];function Ao(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ro;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=Po(),r=Io(null==o?void 0:o.type),l=r.getAlignments(o);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==r.name)return[];const{alignments:i=Ro}=o,s=e.filter((e=>(o.alignments||t||!Lo.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const Do={none:{icon:Zn,title:(0,h.__)("None")},left:{icon:Xn,title:(0,h.__)("Align left")},center:{icon:Qn,title:(0,h.__)("Align center")},right:{icon:Jn,title:(0,h.__)("Align right")},wide:{icon:eo,title:(0,h.__)("Wide width")},full:{icon:to,title:(0,h.__)("Full width")}},Oo={isAlternate:!0};var Fo=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=Ao(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Do[t],m=Do.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,g={popoverProps:Oo,icon:d?d.icon:m.icon,label:(0,h.__)("Align"),toggleProps:{describedBy:(0,h.__)("Change alignment")}},v=r||s.Platform.isNative?{isCollapsed:r?l:void 0,controls:a.map((e=>{let{name:n}=e;return{...Do[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{children:e=>{let{onClose:n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},a.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=Do[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(p.MenuItem,{key:o,icon:l,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{u(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,s.createElement)(f,i({},g,v))};function zo(e){return(0,s.createElement)(Fo,i({},e,{isToolbar:!1}))}function Vo(e){return(0,s.createElement)(Fo,i({},e,{isToolbar:!0}))}const Ho=["left","center","right","wide","full"],Go=["wide","full"];function Uo(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?Ho.filter((t=>e.includes(t))):!0===e?[...Ho]:[],!o||!0===e&&!n?(0,u.without)(t,...Go):t}const Wo=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Ao(Uo((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)(Yn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(zo,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const l=(0,r.getBlockType)(t.name);(null==l||null===(n=l.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:o})),(0,s.createElement)(e,t))}),"withToolbarControls"),$o=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=Ao(Uo((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0)));if(void 0===l)return(0,s.createElement)(e,t);let c=t.wrapperProps;return a.some((e=>e.name===l))&&(c={...c,"data-align":l}),(0,s.createElement)(e,i({},t,{wrapperProps:c}))}));(0,l.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){return(0,u.has)(e.attributes,["align","type"])||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Ho,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",$o),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Wo),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Uo((0,r.getBlockSupport)(t,"align"),(0,r.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,l.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return(0,u.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e})),window.wp.warning;var jo={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),border:(0,p.createSlotFill)("InspectorControlsBorder"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function Ko(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=Wn(),l=null===(t=jo[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const qo=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,qo),u.identity);return(0,u.isEmpty)(t)?void 0:t};function Yo(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(zn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(zn),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:qo(r.style)},t[n]=r})),r(n,t,!0)}),[qo,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},t)}function Zo(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 Xo(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=jo[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)(Yo,{group:n,label:o},(0,s.createElement)(Zo,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const Qo=Ko;Qo.Slot=Xo;const Jo=e=>(0,s.createElement)(Ko,i({},e,{__experimentalGroup:"advanced"}));Jo.Slot=e=>(0,s.createElement)(Xo,i({},e,{__experimentalGroup:"advanced"})),Jo.slotName="InspectorAdvancedControls";var er=Qo;const tr=/[\s#]/g,nr=(0,d.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===s.Platform.OS,o=(0,s.createElement)(p.TextControl,{className:"html-anchor-control",label:(0,h.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,h.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,s.createElement)(p.ExternalLink,{href:(0,h.__)("https://wordpress.org/support/article/page-jumps/")},(0,h.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,h.__)("Add an anchor"),onChange:e=>{e=e.replace(tr,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(er,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(er,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Heading settings")},o)))}return(0,s.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return(0,u.has)(e.attributes,["anchor","type"])||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:{type:"string",source:"attribute",attribute:"id",selector:"*"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",nr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const or=(0,d.createHigherOrderComponent)((e=>t=>(0,r.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(er,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,h.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,h.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,r.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",or),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,r.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=(0,u.uniq)([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));var rr=window.wp.dom;const lr=(0,s.createContext)({});function ir(e){let{value:t,children:n}=e;const o=(0,s.useContext)(lr),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(lr.Provider,{value:r,children:n})}var sr=lr;const ar={};var cr=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(sr),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):ar),[o,l]);if(!o)return null;const d=o.edit||o.save;if(o.apiVersion>1)return(0,s.createElement)(d,i({},e,{context:a}));const p=(0,r.hasBlockSupport)(o,"className",!0)?(0,r.getBlockDefaultClassName)(n):null,m=c()(p,t.className);return(0,s.createElement)(d,i({},e,{context:a,className:m}))}));function ur(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(Gn,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(cr,e))}var dr=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),pr=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,s.createElement)("div",{className:c()(t,"block-editor-warning")},(0,s.createElement)("div",{className:"block-editor-warning__contents"},(0,s.createElement)("p",{className:"block-editor-warning__message"},o),(s.Children.count(n)>0||r)&&(0,s.createElement)("div",{className:"block-editor-warning__actions"},s.Children.count(n)>0&&s.Children.map(n,((e,t)=>(0,s.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,s.createElement)(p.DropdownMenu,{className:"block-editor-warning__secondary",icon:dr,label:(0,h.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(p.MenuGroup,null,r.map(((e,t)=>(0,s.createElement)(p.MenuItem,{onClick:e.onClick,key:t},e.title)))))))))},mr=n(7630);function fr(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,s.createElement)("div",{className:i},(0,s.createElement)("div",{className:"block-editor-block-compare__content"},(0,s.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,s.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,s.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,s.createElement)(s.RawHTML,null,(0,rr.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var hr=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const a=(d=l(t),(0,u.castArray)(d).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,f=a,(0,mr.Kx)(m,f).map(((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,s.createElement)("span",{key:t,className:n},e.value)})));var m,f;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(fr,{title:(0,h.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,h.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(fr,{title:(0,h.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))};const gr=e=>(0,r.rawHandler)({HTML:e.originalContent});var vr=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(zn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(zn);return{convertToClassic(){o(n.clientId,(e=>(0,r.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,r.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,gr(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,r.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:l,block:i}=e;const a=!!(0,r.getBlockType)("core/html"),[c,u]=(0,s.useState)(!1),d=(0,s.useCallback)((()=>u(!0)),[]),m=(0,s.useCallback)((()=>u(!1)),[]),f=(0,s.useMemo)((()=>[{
|
8 |
// translators: Button to fix block content
|
9 |
-
title:(0,
|
10 |
-
(0,h.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(hr,{block:i,onKeep:t,onConvert:n,convertor:gr,convertButtonText:(0,h.__)("Convert to Blocks")})))}));const br=(0,s.createElement)(pr,{className:"block-editor-block-list__block-crash-warning"},(0,h.__)("This block has encountered an error and cannot be previewed."));var kr=()=>br;class _r extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}var yr=_r,Er=n(4042),Cr=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(zn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(zn);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(Er.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,r.getBlockType)(l.name);if(!e)return;const s=(0,r.getBlockAttributes)(e,n,l.attributes),a=n||(0,r.getSaveContent)(e,s),c=!n||(0,r.isValidBlockContent)(e,s,a);i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let Sr=zr();const wr=e=>Ar(e,Sr);let Br=zr();wr.write=e=>Ar(e,Br);let Ir=zr();wr.onStart=e=>Ar(e,Ir);let xr=zr();wr.onFrame=e=>Ar(e,xr);let Tr=zr();wr.onFinish=e=>Ar(e,Tr);let Nr=[];wr.setTimeout=(e,t)=>{let n=wr.now()+t,o=()=>{let e=Nr.findIndex((e=>e.cancel==o));~e&&Nr.splice(e,1),Hr.count-=~e?1:0},r={time:n,handler:e,cancel:o};return Nr.splice(Pr(n),0,r),Hr.count+=1,Dr(),r};let Pr=e=>~(~Nr.findIndex((t=>t.time>e))||~Nr.length);wr.cancel=e=>{Sr.delete(e),Br.delete(e)},wr.sync=e=>{Lr=!0,wr.batchedUpdates(e),Lr=!1},wr.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,wr.onStart(n)}return o.handler=e,o.cancel=()=>{Ir.delete(n),t=null},o};let Mr="undefined"!=typeof window?window.requestAnimationFrame:()=>{};wr.use=e=>Mr=e,wr.now="undefined"!=typeof performance?()=>performance.now():Date.now,wr.batchedUpdates=e=>e(),wr.catch=console.error,wr.frameLoop="always",wr.advance=()=>{"demand"!==wr.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Fr()};let Rr=-1,Lr=!1;function Ar(e,t){Lr?(t.delete(e),e(0)):(t.add(e),Dr())}function Dr(){Rr<0&&(Rr=0,"demand"!==wr.frameLoop&&Mr(Or))}function Or(){~Rr&&(Mr(Or),wr.batchedUpdates(Fr))}function Fr(){let e=Rr;Rr=wr.now();let t=Pr(Rr);t&&(Vr(Nr.splice(0,t),(e=>e.handler())),Hr.count-=t),Ir.flush(),Sr.flush(e?Math.min(64,Rr-e):16.667),xr.flush(),Br.flush(),Tr.flush()}function zr(){let e=new Set,t=e;return{add(n){Hr.count+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Hr.count-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Hr.count-=t.size,Vr(t,(t=>t(n)&&e.add(t))),Hr.count+=e.size,t=e)}}}function Vr(e,t){e.forEach((e=>{try{t(e)}catch(e){wr.catch(e)}}))}const Hr={count:0,clear(){Rr=-1,Nr=[],Ir=zr(),Sr=zr(),xr=zr(),Br=zr(),Tr=zr(),Hr.count=0}};var Gr=n(9196),Ur=n.n(Gr);function Wr(){}const $r={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function jr(e,t){if($r.arr(e)){if(!$r.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}const Kr=(e,t)=>e.forEach(t);function qr(e,t,n){for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const Yr=e=>$r.und(e)?[]:$r.arr(e)?e:[e];function Zr(e,t){if(e.size){const n=Array.from(e);e.clear(),Kr(n,t)}}const Xr=(e,...t)=>Zr(e,(e=>e(...t)));let Qr,Jr,el=null,tl=!1,nl=Wr;var ol=Object.freeze({__proto__:null,get createStringInterpolator(){return Qr},get to(){return Jr},get colors(){return el},get skipAnimation(){return tl},get willAdvance(){return nl},assign:e=>{e.to&&(Jr=e.to),e.now&&(wr.now=e.now),void 0!==e.colors&&(el=e.colors),null!=e.skipAnimation&&(tl=e.skipAnimation),e.createStringInterpolator&&(Qr=e.createStringInterpolator),e.requestAnimationFrame&&wr.use(e.requestAnimationFrame),e.batchedUpdates&&(wr.batchedUpdates=e.batchedUpdates),e.willAdvance&&(nl=e.willAdvance),e.frameLoop&&(wr.frameLoop=e.frameLoop)}});const rl=new Set;let ll=[],il=[],sl=0;const al={get idle(){return!rl.size&&!ll.length},start(e){sl>e.priority?(rl.add(e),wr.onStart(cl)):(ul(e),wr(pl))},advance:pl,sort(e){if(sl)wr.onFrame((()=>al.sort(e)));else{const t=ll.indexOf(e);~t&&(ll.splice(t,1),dl(e))}},clear(){ll=[],rl.clear()}};function cl(){rl.forEach(ul),rl.clear(),wr(pl)}function ul(e){ll.includes(e)||dl(e)}function dl(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 pl(e){const t=il;for(let n=0;n<ll.length;n++){const o=ll[n];sl=o.priority,o.idle||(nl(o),o.advance(e),o.idle||t.push(o))}return sl=0,il=ll,il.length=0,ll=t,ll.length>0}const ml="[-+]?\\d*\\.?\\d+",fl=ml+"%";function hl(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const gl=new RegExp("rgb"+hl(ml,ml,ml)),vl=new RegExp("rgba"+hl(ml,ml,ml,ml)),bl=new RegExp("hsl"+hl(ml,fl,fl)),kl=new RegExp("hsla"+hl(ml,fl,fl,ml)),_l=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,yl=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,El=/^#([0-9a-fA-F]{6})$/,Cl=/^#([0-9a-fA-F]{8})$/;function Sl(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function wl(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=Sl(r,o,e+1/3),i=Sl(r,o,e),s=Sl(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function Bl(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Il(e){return(parseFloat(e)%360+360)%360/360}function xl(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Tl(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Nl(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=El.exec(e))?parseInt(t[1]+"ff",16)>>>0:el&&void 0!==el[e]?el[e]:(t=gl.exec(e))?(Bl(t[1])<<24|Bl(t[2])<<16|Bl(t[3])<<8|255)>>>0:(t=vl.exec(e))?(Bl(t[1])<<24|Bl(t[2])<<16|Bl(t[3])<<8|xl(t[4]))>>>0:(t=_l.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Cl.exec(e))?parseInt(t[1],16)>>>0:(t=yl.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=bl.exec(e))?(255|wl(Il(t[1]),Tl(t[2]),Tl(t[3])))>>>0:(t=kl.exec(e))?(wl(Il(t[1]),Tl(t[2]),Tl(t[3]))|xl(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 Pl=(e,t,n)=>{if($r.fun(e))return e;if($r.arr(e))return Pl({range:e,output:t,extrapolate:n});if($r.str(e.output[0]))return Qr(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 Ml(){return(Ml=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 Rl=Symbol.for("FluidValue.get"),Ll=Symbol.for("FluidValue.observers"),Al=e=>Boolean(e&&e[Rl]),Dl=e=>e&&e[Rl]?e[Rl]():e,Ol=e=>e[Ll]||null;function Fl(e,t){let n=e[Ll];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class zl{constructor(e){if(this[Rl]=void 0,this[Ll]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Vl(this,e)}}const Vl=(e,t)=>Ul(e,Rl,t);function Hl(e,t){if(e[Rl]){let n=e[Ll];n||Ul(e,Ll,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Gl(e,t){let n=e[Ll];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Ll]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const Ul=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Wl=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,$l=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;let jl;const Kl=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,ql=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Yl=e=>{jl||(jl=el?new RegExp(`(${Object.keys(el).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Dl(e).replace($l,Nl).replace(jl,Nl))),n=t.map((e=>e.match(Wl).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=>Pl(Ml({},e,{output:t}))));return e=>{let n=0;return t[0].replace(Wl,(()=>String(o[n++](e)))).replace(Kl,ql)}},Zl="react-spring: ",Xl=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Zl}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Ql=Xl(console.warn),Jl=Xl(console.warn);function ei(e){return $r.str(e)&&("#"==e[0]||/\d/.test(e)||e in(el||{}))}const ti=e=>(0,Gr.useEffect)(e,ni),ni=[];function oi(){const e=(0,Gr.useState)()[1],t=(0,Gr.useState)(ri)[0];return ti(t.unmount),()=>{t.current&&e({})}}function ri(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function li(e){const t=(0,Gr.useRef)();return(0,Gr.useEffect)((()=>{t.current=e})),t.current}const ii="undefined"!=typeof window&&window.document&&window.document.createElement?Gr.useLayoutEffect:Gr.useEffect,si=Symbol.for("Animated:node"),ai=e=>e&&e[si],ci=(e,t)=>{return n=e,o=si,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},ui=e=>e&&e[si]&&e[si].getPayload();class di{constructor(){this.payload=void 0,ci(this,this)}getPayload(){return this.payload||[]}}class pi extends di{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,$r.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new pi(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return $r.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,$r.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class mi extends pi{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Pl({output:[e,e]})}static create(e){return new mi(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if($r.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=Pl({output:[this.getValue(),e]})),this._value=0,super.reset()}}const fi={dependencies:null};class hi extends di{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return qr(this.source,((n,o)=>{var r;(r=n)&&r[si]===r?t[o]=n.getValue(e):Al(n)?t[o]=Dl(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Kr(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return qr(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){fi.dependencies&&Al(e)&&fi.dependencies.add(e);const t=ui(e);t&&Kr(t,(e=>this.add(e)))}}class gi extends hi{constructor(e){super(e)}static create(e){return new gi(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(vi)),!0)}}function vi(e){return(ei(e)?mi:pi).create(e)}function bi(e){const t=ai(e);return t?t.constructor:$r.arr(e)?gi:ei(e)?mi:pi}function ki(){return(ki=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 _i=(e,t)=>{const n=!$r.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Gr.forwardRef)(((o,r)=>{const l=(0,Gr.useRef)(null),i=n&&(0,Gr.useCallback)((e=>{l.current=function(e,t){return e&&($r.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return fi.dependencies=n,e.style&&(e=ki({},e,{style:t.createAnimatedStyle(e.style)})),e=new hi(e),fi.dependencies=null,[e,n]}(o,t),c=oi(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new yi(u,a),p=(0,Gr.useRef)();ii((()=>{const e=p.current;p.current=d,Kr(a,(e=>Hl(e,d))),e&&(Kr(e.deps,(t=>Gl(t,e))),wr.cancel(e.update))})),(0,Gr.useEffect)(u,[]),ti((()=>()=>{const e=p.current;Kr(e.deps,(t=>Gl(t,e)))}));const m=t.getComponentProps(s.getValue());return Gr.createElement(e,ki({},m,{ref:i}))}))};class yi{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&wr.write(this.update)}}const Ei=Symbol.for("AnimatedComponent"),Ci=e=>$r.str(e)?e:e&&$r.str(e.displayName)?e.displayName:$r.fun(e)&&e.name||null;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)}function wi(e,...t){return $r.fun(e)?e(...t):e}const Bi=(e,t)=>!0===e||!!(t&&e&&($r.fun(e)?e(t):Yr(e).includes(t))),Ii=(e,t)=>$r.obj(e)?t&&e[t]:e,xi=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Ti=e=>e,Ni=(e,t=Ti)=>{let n=Pi;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const r of n){const n=t(e[r],r);$r.und(n)||(o[r]=n)}return o},Pi=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Mi={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 Ri(e){const t=function(e){const t={};let n=0;if(qr(e,((e,o)=>{Mi[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return qr(e,((e,o)=>o in t||(n[o]=e))),n}return Si({},e)}function Li(e){return e=Dl(e),$r.arr(e)?e.map(Li):ei(e)?ol.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Ai(e){for(const t in e)return!0;return!1}function Di(e){return $r.fun(e)||$r.arr(e)&&$r.obj(e[0])}function Oi(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Fi(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const zi=Si({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class Vi{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,zi)}}function Hi(e,t){if($r.und(t.decay)){const n=!$r.und(t.tension)||!$r.und(t.friction);!n&&$r.und(t.frequency)&&$r.und(t.damping)&&$r.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Gi=[];class Ui{constructor(){this.changed=!1,this.values=Gi,this.toValues=null,this.fromValues=Gi,this.to=void 0,this.from=void 0,this.config=new Vi,this.immediate=!1}}function Wi(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=Bi(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)f();else{$r.und(n.pause)||(r.paused=Bi(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Bi(e,t)),c=wi(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-wr.now()}function m(){c>0?(u=wr.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(Si({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const $i=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?qi(e.get()):t.every((e=>e.noop))?ji(e.get()):Ki(e.get(),t.every((e=>e.finished))),ji=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Ki=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),qi=e=>({value:e,cancelled:!0,finished:!1});function Yi(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=Ni(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)&&qi(o)||r!==n.asyncId&&Ki(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new Xi,i=new Qi;return(async()=>{if(ol.skipAnimation)throw Zi(n),i.result=Ki(o,!1),d(i),i;m(l);const s=$r.obj(e)?Si({},e):Si({},t,{to:e});s.parentId=r,qr(c,((e,t)=>{$r.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let h;if(ol.skipAnimation)return Zi(n),Ki(o,!1);try{let t;t=$r.arr(e)?(async e=>{for(const t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(u),p]),h=Ki(o.get(),!0,!1)}catch(e){if(e instanceof Xi)h=e.result;else{if(!(e instanceof Qi))throw e;h=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return $r.fun(i)&&wr.batchedUpdates((()=>{i(h,o,o.item)})),h})():a}function Zi(e,t){Zr(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Xi 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 Qi extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Ji=e=>e instanceof ts;let es=1;class ts extends zl{constructor(...e){super(...e),this.id=es++,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=ai(this);return e&&e.getValue()}to(...e){return ol.to(this,e)}interpolate(...e){return Ql(`${Zl}The "interpolate" function is deprecated in v9 (use "to" instead)`),ol.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){Fl(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||al.sort(this),Fl(this,{type:"priority",parent:this,priority:e})}}const ns=Symbol.for("SpringPhase"),os=e=>(1&e[ns])>0,rs=e=>(2&e[ns])>0,ls=e=>(4&e[ns])>0,is=(e,t)=>t?e[ns]|=3:e[ns]&=-3,ss=(e,t)=>t?e[ns]|=4:e[ns]&=-5;class as extends ts{constructor(e,t){if(super(),this.key=void 0,this.animation=new Ui,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,!$r.und(e)||!$r.und(t)){const n=$r.obj(e)?Si({},e):Si({},t,{from:e});$r.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(rs(this)||this._state.asyncTo)||ls(this)}get goal(){return Dl(this.animation.to)}get velocity(){const e=ai(this);return e instanceof pi?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return os(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=ui(o.to);!i&&Al(o.to)&&(l=Yr(Dl(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==mi?1:i?i[a].lastPosition:l[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,r.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],l=null!=s.v0?s.v0:s.v0=$r.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if($r.und(r.duration))if(r.decay){const e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*t);d=n+l/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<.1,i=l*o}else{i=null==s.lastVelocity?l:s.lastVelocity;const t=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=r.restVelocity||t/10,a=r.clamp?0:r.bounce,p=!$r.und(a),m=n==c?s.v0>0:n<c;let f,h=!1;const g=1,v=Math.ceil(e/g);for(let e=0;e<v&&(f=Math.abs(i)>o,f||(u=Math.abs(c-d)<=t,!u));++e)p&&(h=d==c||d>c==m,h&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*g,d+=i*g}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,s.durationProgress>0&&(s.elapsedTime=r.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+r.easing(o)*(c-n),i=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,r.round)&&(n=!0)}));const s=ai(this),a=s.getValue();if(t){const e=Dl(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 wr.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;wr.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return $r.und(e)?(n=this.queue||[],this.queue=[]):n=[$r.obj(e)?e:Si({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>$i(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Zi(this._state,e&&this._lastCallId),wr.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:o}=e;n=$r.obj(n)?n[t]:n,(null==n||Di(n))&&(n=void 0),o=$r.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return os(this)||(e.reverse&&([n,o]=[o,n]),o=Dl(o),$r.und(o)?ai(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Si({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Ni(n,((e,t)=>/^on/.test(t)?Ii(e,o):e))),hs(this,n,"onProps"),gs(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 Wi(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{ls(this)||(ss(this,!0),Xr(i.pauseQueue),gs(this,"onPause",Ki(this,cs(this,this.animation.to)),this))},resume:()=>{ls(this)&&(ss(this,!1),rs(this)&&this._resume(),Xr(i.resumeQueue),gs(this,"onResume",Ki(this,cs(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=us(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(qi(this));const o=!$r.und(e.to),r=!$r.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(qi(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!r||o||t.default&&!$r.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!jr(d,c);p&&(s.from=d),d=Dl(d);const m=!jr(u,a);m&&this._focus(u);const f=Di(t.to),{config:h}=s,{decay:g,velocity:v}=h;(o||r)&&(h.velocity=0),t.config&&!f&&function(e,t,n){n&&(Hi(n=Si({},n),t),t=Si({},n,t)),Hi(e,t),Object.assign(e,t);for(const t in zi)null==e[t]&&(e[t]=zi[t]);let{mass:o,frequency:r,damping:l}=e;$r.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(h,wi(t.config,l),t.config!==i.config?wi(i.config,l):void 0);let b=ai(this);if(!b||$r.und(u))return n(Ki(this,!0));const k=$r.und(t.reset)?r&&!t.default:!$r.und(d)&&Bi(t.reset,l),_=k?d:this.get(),y=Li(u),E=$r.num(y)||$r.arr(y)||ei(y),C=!f&&(!E||Bi(i.immediate||t.immediate,l));if(m){const e=bi(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=Al(u),B=!1;if(!w){const e=k||!os(this)&&p;(m||e)&&(B=jr(Li(_),y),w=!B),(jr(s.immediate,C)||C)&&jr(h.decay,g)&&jr(h.velocity,v)||(w=!0)}if(B&&rs(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!f&&((w||Al(a))&&(s.values=b.getPayload(),s.toValues=Al(u)?null:S==mi?[1]:Yr(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;Kr(fs,(e=>hs(this,t,e)));const o=Ki(this,cs(this,a));Xr(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&wr.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?wi(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),f?n(Yi(t.to,t,this._state,this)):w?this._start():rs(this)&&!m?this._pendingCalls.add(n):n(ji(_))}_focus(e){const t=this.animation;e!==t.to&&(Ol(this)&&this._detach(),t.to=e,Ol(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Al(t)&&(Hl(t,this),Ji(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Al(e)&&Gl(e,this)}_set(e,t=!0){const n=Dl(e);if(!$r.und(n)){const e=ai(this);if(!e||!jr(n,e.getValue())){const o=bi(n);e&&e.constructor==o?e.setValue(n):ci(this,o.create(n)),e&&wr.batchedUpdates((()=>{this._onChange(n,t)}))}}return ai(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,gs(this,"onStart",Ki(this,cs(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),wi(this.animation.onChange,e,this)),wi(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;ai(this).reset(Dl(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),rs(this)||(is(this,!0),ls(this)||this._resume())}_resume(){ol.skipAnimation?this.finish():al.start(this)}_stop(e,t){if(rs(this)){is(this,!1);const n=this.animation;Kr(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Fl(this,{type:"idle",parent:this});const o=t?qi(this.get()):Ki(this.get(),cs(this,null!=e?e:n.to));Xr(this._pendingCalls,o),n.changed&&(n.changed=!1,gs(this,"onRest",o,this))}}}function cs(e,t){const n=Li(t);return jr(Li(e.get()),n)}function us(e,t=e.loop,n=e.to){let o=wi(t);if(o){const r=!0!==o&&Ri(o),l=(r||e).reverse,i=!r||r.reset;return ds(Si({},e,{loop:t,default:!1,pause:void 0,to:!l||Di(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function ds(e){const{to:t,from:n}=e=Ri(e),o=new Set;return $r.obj(t)&&ms(t,o),$r.obj(n)&&ms(n,o),e.keys=o.size?Array.from(o):null,e}function ps(e){const t=ds(e);return $r.und(t.default)&&(t.default=Ni(t)),t}function ms(e,t){qr(e,((e,n)=>null!=e&&t.add(n)))}const fs=["onStart","onRest","onChange","onPause","onResume"];function hs(e,t,n){e.animation[n]=t[n]!==xi(t,n)?Ii(t[n],e.key):void 0}function gs(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 vs=["onStart","onChange","onRest"];let bs=1;class ks{constructor(e,t){this.id=bs++,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(Si({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];$r.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(ds(e)),this}start(e){let{queue:t}=this;return e?t=Yr(e).map(ds):this.queue=[],this._flush?this._flush(this,t):(Bs(this,t),_s(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Kr(Yr(t),(t=>n[t].stop(!!e)))}else Zi(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if($r.und(e))this.start({pause:!0});else{const t=this.springs;Kr(Yr(e),(e=>t[e].pause()))}return this}resume(e){if($r.und(e))this.start({pause:!1});else{const t=this.springs;Kr(Yr(e),(e=>t[e].resume()))}return this}each(e){qr(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,Zr(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&&Zr(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,Zr(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)}wr.onFrame(this._onFrame)}}function _s(e,t){return Promise.all(t.map((t=>ys(e,t)))).then((t=>$i(e,t)))}async function ys(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=$r.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=$r.arr(r)||$r.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Kr(vs,(n=>{const o=t[n];if($r.fun(o)){const r=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));const d=e._state;t.pause===!d.paused?(d.paused=t.pause,Xr(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===xi(t,"cancel");(u||m&&d.asyncId)&&p.push(Wi(++e._lastAsyncId,{props:t,state:d,actions:{pause:Wr,resume:Wr,start(t,n){m?(Zi(d,e._lastAsyncId),n(qi(e))):(t.onRest=s,n(Yi(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=$i(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=us(t,i,r);if(n)return Bs(e,[n]),ys(e,n,!0)}return a&&wr.batchedUpdates((()=>a(f,e,e.item))),f}function Es(e,t){const n=Si({},e.springs);return t&&Kr(Yr(t),(e=>{$r.und(e.keys)&&(e=ds(e)),$r.obj(e.to)||(e=Si({},e,{to:void 0})),ws(n,e,(e=>Ss(e)))})),Cs(e,n),n}function Cs(e,t){qr(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Hl(t,e))}))}function Ss(e,t){const n=new as;return n.key=e,t&&Hl(n,t),n}function ws(e,t,n){t.keys&&Kr(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Bs(e,t){Kr(t,(t=>{ws(e.springs,t,(t=>Ss(t,e)))}))}const Is=["children"],xs=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,Is);const o=(0,Gr.useContext)(Ts),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Gr.useState)((()=>({inputs:t,result:e()}))),o=(0,Gr.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,Gr.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=Ts;return Gr.createElement(i,{value:n},t)},Ts=(Ns=xs,Ps={},Object.assign(Ns,Gr.createContext(Ps)),Ns.Provider._context=Ns,Ns.Consumer._context=Ns,Ns);var Ns,Ps;xs.Provider=Ts.Provider,xs.Consumer=Ts.Consumer;const Ms=()=>{const e=[],t=function(t){Jl(`${Zl}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);const o=[];return Kr(e,((e,r)=>{if($r.und(t))o.push(e.start());else{const l=n(t,e,r);l&&o.push(e.start(l))}})),o};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){const n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return Kr(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Kr(e,(e=>e.resume(...arguments))),this},t.set=function(t){Kr(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Kr(e,((e,o)=>{if($r.und(t))n.push(e.start());else{const r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return Kr(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Kr(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return $r.fun(e)?e(n,t):e};return t._getProps=n,t};function Rs(e,t,n){const o=$r.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Gr.useMemo)((()=>o||3==arguments.length?Ms():void 0),[]),l=(0,Gr.useRef)(0),i=oi(),s=(0,Gr.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Es(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?_s(e,t):new Promise((o=>{Cs(e,n),s.queue.push((()=>{o(_s(e,t))})),i()}))}})),[]),a=(0,Gr.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 ks(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=ps(n))}}(0,Gr.useMemo)((()=>{Kr(a.current.slice(e,u),(e=>{Oi(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,Gr.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Es(e,c[t]))),m=(0,Gr.useContext)(xs),f=li(m),h=m!==f&&Ai(m);ii((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Kr(e,(e=>e()))),Kr(a.current,((e,t)=>{null==r||r.add(e),h&&e.start({default:m});const n=c[t];n&&(Fi(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),ti((()=>()=>{Kr(s.ctrls,(e=>e.stop(!0)))}));const g=p.map((e=>Si({},e)));return r?[g,r]:g}let Ls;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Ls||(Ls={}));class As extends ts{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Pl(...t);const n=this._get(),o=bi(n);ci(this,o.create(n))}advance(e){const t=this._get();jr(t,this.get())||(ai(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Os(this._active)&&Fs(this)}_get(){const e=$r.arr(this.source)?this.source.map(Dl):Yr(Dl(this.source));return this.calc(...e)}_start(){this.idle&&!Os(this._active)&&(this.idle=!1,Kr(ui(this),(e=>{e.done=!1})),ol.skipAnimation?(wr.batchedUpdates((()=>this.advance())),Fs(this)):al.start(this))}_attach(){let e=1;Kr(Yr(this.source),(t=>{Al(t)&&Hl(t,this),Ji(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Kr(Yr(this.source),(e=>{Al(e)&&Gl(e,this)})),this._active.clear(),Fs(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=Yr(this.source).reduce(((e,t)=>Math.max(e,(Ji(t)?t.priority:0)+1)),0))}}function Ds(e){return!1!==e.idle}function Os(e){return!e.size||Array.from(e).every(Ds)}function Fs(e){e.idle||(e.idle=!0,Kr(ui(e),(e=>{e.done=!0})),Fl(e,{type:"idle",parent:e}))}ol.assign({createStringInterpolator:Yl,to:(e,t)=>new As(e,t)}),al.advance;var zs=window.ReactDOM;function Vs(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 Hs=["style","children","scrollTop","scrollLeft"],Gs=/^--/;function Us(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Gs.test(e)||$s.hasOwnProperty(e)&&$s[e]?(""+t).trim():t+"px"}const Ws={};let $s={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 js=["Webkit","Ms","Moz","O"];$s=Object.keys($s).reduce(((e,t)=>(js.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),$s);const Ks=["x","y","z"],qs=/^(matrix|translate|scale|rotate|skew)/,Ys=/^(translate)/,Zs=/^(rotate|skew)/,Xs=(e,t)=>$r.num(e)&&0!==e?e+t:e,Qs=(e,t)=>$r.arr(e)?e.every((e=>Qs(e,t))):$r.num(e)?e===t:parseFloat(e)===t;class Js extends hi{constructor(e){let{x:t,y:n,z:o}=e,r=Vs(e,Ks);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Xs(e,"px"))).join(",")})`,Qs(e,0)]))),qr(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(qs.test(t)){if(delete r[t],$r.und(e))return;const n=Ys.test(t)?"px":Zs.test(t)?"deg":"";l.push(Yr(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Xs(r,n)})`,Qs(r,0)]:e=>[`${t}(${e.map((e=>Xs(e,n))).join(",")})`,Qs(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new ea(l,i)),super(r)}}class ea extends zl{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Kr(this.inputs,((n,o)=>{const r=Dl(n[0]),[l,i]=this.transforms[o]($r.arr(r)?r:n.map(Dl));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Kr(this.inputs,(e=>Kr(e,(e=>Al(e)&&Hl(e,this)))))}observerRemoved(e){0==e&&Kr(this.inputs,(e=>Kr(e,(e=>Al(e)&&Gl(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Fl(this,e)}}const ta=["scrollTop","scrollLeft"];ol.assign({batchedUpdates:zs.unstable_batchedUpdates,createStringInterpolator:Yl,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 na=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new hi(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Ci(e)||"Anonymous";return(e=$r.str(e)?l[e]||(l[e]=_i(e,r)):e[Ei]||(e[Ei]=_i(e,r))).displayName=`Animated(${t})`,e};return qr(e,((t,n)=>{$r.arr(e)&&(n=Ci(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=Vs(o,Hs),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:Ws[t]||(Ws[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=Us(t,r[t]);Gs.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 Js(e),getComponentProps:e=>Vs(e,ta)}).animated,oa=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)(oa,0),[u,p]=(0,s.useReducer)(oa,0),[m,f]=(0,s.useState)({x:0,y:0}),h=(0,s.useMemo)((()=>l.current?ra(l.current):null),[r]),g=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,rr.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);function v(e){let{value:n}=e,{x:o,y:r}=n;o=Math.round(o),r=Math.round(r),o===v.x&&r===v.y||(function(e){let{x:n,y:o}=e;if(!l.current)return;const r=0===n&&0===o;l.current.style.transformOrigin=r?"":"center",l.current.style.transform=r?"":`translate3d(${n}px,${o}px,0)`,l.current.style.zIndex=!t||r?"":"1",g()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!h)return;if(i)return void g();l.current.style.transform="";const e=ra(l.current);c(),f({x:Math.round(h.left-e.left),y:Math.round(h.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=$r.fun(e),[[o],r]=Rs(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 ia=".block-editor-block-list__block",sa=".block-list-appender";function aa(e,t){return t.closest([ia,sa].join(","))===e}function ca(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isMultiSelecting:o,isNavigationMode:r,isBlockSelected:l}=t(zn);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;aa(t.current,l)?(0,rr.placeCaretAtHorizontalEdge)(l,r):t.current.focus()}),[n]),t}function ua(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function da(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(zn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",ua),t.addEventListener("mouseover",ua),()=>{t.removeEventListener("mouseout",ua),t.removeEventListener("mouseover",ua),t.classList.remove("is-hovered")}}),[e])}function pa(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(zn),{__experimentalSpotlightEntityBlocks:m,outlineMode:f}=a(),h=n(e),g=l(e),v=s(e),b=u(e,!0),k=p(m);return c()({"is-selected":g,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":h,"has-child-selected":b,"has-active-entity":k,"is-active-entity":k===e,"remove-outline":g&&f&&d()})}),[e])}function ma(e){return(0,m.useSelect)((t=>{const n=t(zn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function fa(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(zn),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 ha(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(zn);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 ga(e){const{isBlockSelected:t}=(0,m.useSelect)(zn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((r=>{function l(l){t(e)?l.target.isContentEditable||o(e):aa(r,l.target)&&n(e)}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var va=window.wp.keycodes;function ba(e){const t=(0,m.useSelect)((t=>t(zn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(zn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(zn);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!==va.ENTER&&s!==va.BACKSPACE&&s!==va.DELETE||a!==i||(0,rr.isTextField)(a)||(t.preventDefault(),s===va.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function ka(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(zn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(zn);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 _a=n(4979),ya=n.n(_a);function Ea(e){const t=(0,s.useRef)(),n=(0,m.useSelect)((t=>{const{isBlockSelected:n,getBlockSelectionEnd:o}=t(zn);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&&ya()(e,o,{onlyScrollIfNeeded:!0})}),[n]),t}const Ca=(0,s.createContext)({refs:new Map,callbacks:new Map});function Sa(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(Ca.Provider,{value:n},t)}function wa(e){const{refs:t,callbacks:n}=(0,s.useContext)(Ca),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 Ba(e){const{refs:t}=(0,s.useContext)(Ca),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 Ia(e){const{callbacks:t}=(0,s.useContext)(Ca),n=Ba(e),[o,r]=(0,s.useState)(null);return(0,s.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function xa(e,t){Array.from(e.closest(".is-root-container").querySelectorAll(".rich-text")).forEach((e=>{t?e.setAttribute("contenteditable",!0):e.removeAttribute("contenteditable")}))}function Ta(e){const{startMultiSelect:t,stopMultiSelect:n,multiSelect:o,selectBlock:r}=(0,m.useDispatch)(zn),{isSelectionEnabled:l,isBlockSelected:i,getBlockParents:s,getBlockSelectionStart:a,hasMultiSelection:c}=(0,m.useSelect)(zn);return(0,d.useRefEffect)((u=>{const{ownerDocument:d}=u,{defaultView:p}=d;let m,f;function h(t){let{isSelectionEnd:n}=t;const l=p.getSelection();if(!l.rangeCount||l.isCollapsed)return void xa(u,!0);const i=function(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(ia);return t?t.id.slice("block-".length):void 0}(l.focusNode);if(e===i){if(r(e),n&&(xa(u,!0),l.rangeCount)){const{commonAncestorContainer:e}=l.getRangeAt(0);m.contains(e)&&m.focus()}}else{const t=[...s(e),e],n=[...s(i),i],r=Math.min(t.length,n.length)-1;o(t[r],n[r])}}function g(){d.removeEventListener("selectionchange",h),p.removeEventListener("mouseup",g),f=p.requestAnimationFrame((()=>{h({isSelectionEnd:!0}),n()}))}function v(n){let{buttons:o}=n;1===o&&l()&&i(e)&&(m=d.activeElement,t(),d.addEventListener("selectionchange",h),p.addEventListener("mouseup",g),xa(u,!1))}function b(t){if(l()&&0===t.button)if(t.shiftKey){const n=a(),r=s(n);if(n&&n!==e&&(null==r||!r.includes(e))){const l=[...r,n],i=[...s(e),e],a=Math.min(l.length,i.length)-1,c=l[a],d=i[a];c!==d&&(xa(u,!1),o(c,d),t.preventDefault())}}else c()&&r(e)}return u.addEventListener("mousedown",b),u.addEventListener("mouseleave",v),()=>{u.removeEventListener("mousedown",b),u.removeEventListener("mouseleave",v),d.removeEventListener("selectionchange",h),p.removeEventListener("mouseup",g),p.cancelAnimationFrame(f)}}),[e,t,n,o,r,l,i,s])}function Na(){const e=(0,s.useContext)(pm);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Pa(){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)(Ma),{index:a,mode:u,name:p,blockApiVersion:f,blockTitle:g,isPartOfSelection:v,adjustScrolling:b,enableAnimation:k}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:o,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(zn),p=a(n),m=c(n)||u(n),f=l(n),h=(0,r.getBlockType)(f);return{index:t(n),mode:o(n),name:f,blockApiVersion:(null==h?void 0:h.apiVersion)||1,blockTitle:null==h?void 0:h.title,isPartOfSelection:p||m,adjustScrolling:p||d(n),enableAnimation:!i()&&s()<=200}}),[n]),_=(0,h.sprintf)((0,h.__)("Block: %s"),g),y="html"!==u||t?"":"-visual",E=(0,d.useMergeRefs)([e.ref,ca(n),Ea(n),wa(n),ga(n),Ta(n),ba(n),ka(n),da(),Na(),la({isSelected:v,adjustScrolling:b,enableAnimation:k,triggerAnimationOnChange:a})]),C=Un();return f<2&&n===C.clientId&&"undefined"!=typeof process&&process.env,{...l,...e,ref:E,id:`block-${n}${y}`,tabIndex:0,role:"document","aria-label":_,"data-block":n,"data-type":p,"data-title":g,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,pa(n),ma(n),fa(n),ha(n)),style:{...l.style,...e.style}}}Pa.save=r.__unstableGetBlockProps;const Ma=(0,s.createContext)();function Ra(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",Pa(o,{__unstableIsHtml:n}),t)}const La=(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(zn),d=a(n),p=r(n),m=s(o),f=c(n,o),h=u(n,o),{name:g,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:f,canMove:h,block:d,name:g,attributes:v,isValid:b,isSelected:p}})),Aa=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(zn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(zn),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(zn),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(zn);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 Da=(0,d.compose)(d.pure,La,Aa,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){let{mode:t,isLocked:n,canRemove:o,clientId:l,isSelected:i,isSelectionEnabled:a,className:d,name:p,isValid:f,attributes:h,wrapperProps:g,setAttributes:v,onReplace:b,onInsertBlocksAfter:k,onMerge:_,toggleSelection:y}=e;const{removeBlock:E}=(0,m.useDispatch)(zn),C=(0,s.useCallback)((()=>E(l)),[l]);let S=(0,s.createElement)(ur,{name:p,isSelected:i,attributes:h,setAttributes:v,insertBlocksAfter:n?void 0:k,onReplace:o?b:void 0,onRemove:o?C:void 0,mergeBlocks:o?_:void 0,clientId:l,isSelectionEnabled:a,toggleSelection:y});const w=(0,r.getBlockType)(p);null!=w&&w.getEditWrapperProps&&(g=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&t.style&&(n.style={...e.style,...t.style}),n}(g,w.getEditWrapperProps(h)));const B=g&&!!g["data-align"];let I;if(B&&(S=(0,s.createElement)("div",{className:"wp-block","data-align":g["data-align"]},S)),f)I="html"===t?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},S),(0,s.createElement)(Ra,{isHtml:!0},(0,s.createElement)(Cr,{clientId:l}))):(null==w?void 0:w.apiVersion)>1?S:(0,s.createElement)(Ra,g,S);else{const e=(0,r.getSaveContent)(w,h);I=(0,s.createElement)(Ra,{className:"has-warning"},(0,s.createElement)(vr,{clientId:l}),(0,s.createElement)(s.RawHTML,null,(0,rr.safeHTML)(e)))}const x={clientId:l,className:d,wrapperProps:(0,u.omit)(g,["data-align"]),isAligned:B},T=(0,s.useMemo)((()=>x),Object.values(x));return(0,s.createElement)(Ma.Provider,{value:T},(0,s.createElement)(yr,{fallback:(0,s.createElement)(Ra,{className:"has-warning"},(0,s.createElement)(kr,null))},I))})),Oa=window.wp.htmlEntities,Fa=(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 za=[(0,s.createInterpolateElement)((0,h.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,h.__)("Drag files into the editor to automatically insert media blocks."),(0,h.__)("Change a block's type by pressing the block icon on the toolbar.")];var Va=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*za.length));return(0,s.createElement)(p.Tip,null,za[e])},Ha=(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"})),Ga=(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:Ha});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)})),Ua=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(Rt()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(Ga,{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 Wa(e){let{clientId:t=null,value:n,selection:o,onChange:l=u.noop,onInput:i=u.noop}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:f,__unstableMarkNextChangeAsNotPersistent:h}=a.dispatch(zn),{getBlockName:g,getBlocks:v}=a.select(zn),b=(0,m.useSelect)((e=>!t||e(zn).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(h(),t?a.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),h(),p(t,e)})):(_.current&&(k.current.incoming=n),c(n)))},E=(0,s.useRef)(i),C=(0,s.useRef)(l);(0,s.useEffect)((()=>{E.current=i,C.current=l}),[i,l]),(0,s.useEffect)((()=>{k.current.outgoing.includes(n)?(0,u.last)(k.current.outgoing)===n&&(k.current.outgoing=[]):v(t)!==n&&(k.current.outgoing=[],y(),o&&d(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{b||(k.current.outgoing=[],y())}),[b]),(0,s.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=a.select(zn);let s=v(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===g(t))return;if(t&&!i(t))return;const a=r(),d=v(t),p=d!==s;if(s=d,p&&(k.current.incoming||l()))return k.current.incoming=null,void(c=a);(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 $a=(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(On,Fn),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)(zn);return(0,s.useEffect)((()=>{o(n)}),[n]),Wa(e),(0,s.createElement)(Sa,null,t)}));function ja(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)(fm,null)))}function Ka(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(zn),{clearSelectedBlock:n}=(0,m.useDispatch)(zn);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 qa(e){return(0,s.createElement)("div",i({ref:Ka()},e))}function Ya(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 Za(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r}=e(zn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r()}}function Xa(){const{isMultiSelecting:e,multiSelectedBlockClientIds:t,hasMultiSelection:n,selectedBlockClientId:o}=(0,m.useSelect)(Za,[]),r=Ba(o),l=Ba((0,u.first)(t)),i=Ba((0,u.last)(t));return(0,d.useRefEffect)((s=>{const{ownerDocument:a}=s,{defaultView:c}=a;if(!n||e){if(!o||e)return;const t=c.getSelection();if(t.rangeCount&&!t.isCollapsed){const e=r.current,{startContainer:n,endContainer:o}=t.getRangeAt(0);!e||e.contains(n)&&e.contains(o)||t.removeAllRanges()}return}const{length:u}=t;if(u<2)return;if(!l.current||!i.current)return;s.focus();const d=c.getSelection(),p=a.createRange(),m=Ya(l.current,"start"),f=Ya(i.current,"end");var h;h=s,Array.from(h.querySelectorAll(".rich-text:not( .editor-post-title__input )")).forEach((e=>{e.removeAttribute("contenteditable")})),p.setStartBefore(m),p.setEndAfter(f),d.removeAllRanges(),d.addRange(p)}),[n,e,t,o])}function Qa(e){const{tagName:t}=e;return"INPUT"===t||"BUTTON"===t||"SELECT"===t||"TEXTAREA"===t}function Ja(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 ec(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksStartClientId:t,getMultiSelectedBlocksEndClientId:n,getPreviousBlockClientId:o,getNextBlockClientId:r,getFirstMultiSelectedBlockClientId:l,getLastMultiSelectedBlockClientId:i,getSettings:s,hasMultiSelection:a}=(0,m.useSelect)(zn),{multiSelect:c,selectBlock:u}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((d=>{let p;function m(){p=null}function f(l){const i=e(),s=t(),a=n(),d=o(a||i),p=r(a||i),m=l?d:p;m&&(s===m?u(m):c(s||i,m))}function h(e){const t=l(),n=i(),o=e?t:n;o&&u(o)}function g(t){const{keyCode:l,target:i}=t,c=l===va.UP,u=l===va.DOWN,m=l===va.LEFT,g=l===va.RIGHT,v=c||m,b=m||g,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:h)(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===va.UP||t===va.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:I}=s(),x=e();if(y){const e=n(),l=o(e||x),s=r(e||x);(v&&l||!v&&s)&&function(e,t){const n=Ja(e,t,d);return!n||!function(e,t){return e.closest(ia)===t.closest(ia)}(e,n)}(i,v)&&C(i,v)&&(f(v),t.preventDefault())}else if(k&&(0,rr.isVerticalEdge)(i,v)&&!I){const e=Ja(i,v,d,!0);e&&((0,rr.placeCaretAtVerticalEdge)(e,v,p),t.preventDefault())}else if(b&&w.getSelection().isCollapsed&&(0,rr.isHorizontalEdge)(i,B)&&!I){const e=Ja(i,B,d);(0,rr.placeCaretAtHorizontalEdge)(e,v),t.preventDefault()}}return d.addEventListener("mousedown",m),d.addEventListener("keydown",g),()=>{d.removeEventListener("mousedown",m),d.removeEventListener("keydown",g)}}),[])}var tc=window.wp.keyboardShortcuts;function nc(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(zn),{multiSelect:o}=(0,m.useDispatch)(zn),r=(0,tc.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;if(!(0,rr.isEntirelySelected)(l.target))return;const i=t(),[s]=i,a=n(s);let c=e(a);i.length===c.length&&(c=e(n(a)));const d=(0,u.first)(c),p=(0,u.last)(c);d!==p&&(o(d,p),l.preventDefault())}return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}}),[])}function oc(){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)(zn),{setNavigationMode:a}=(0,m.useDispatch)(zn),c=(0,m.useSelect)((e=>e(zn).isNavigationMode()),[])?void 0:"0",u=(0,s.useRef)();function p(t){if(u.current)u.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";rr.focus.tabbable[n](t.target).focus()}}const f=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),h=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),g=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===va.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==va.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(Qa(e.target)&&Qa(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!==va.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",i=rr.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:f}=m;return f.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[f,(0,d.useMergeRefs)([e,g]),h]}(),o=(0,m.useSelect)((e=>e(zn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,Xa(),nc(),ec(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,o)return e.setAttribute("aria-label",(0,h.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var rc=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=oc();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 lc="editor-styles-wrapper";function ic(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var sc=(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,g]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=ic(null==a?void 0:a.styles),_=ic(null==a?void 0:a.scripts),y=Ka(),[E,C,S]=oc(),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),g(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()}))}),[]),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(`.${lc}`)||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,h.__)("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()(lc,...v)},(0,s.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&S)})),ac={grad:.9,turn:360,rad:360/(2*Math.PI)},cc=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},uc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},dc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},pc=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},mc=function(e){return{r:dc(e.r,0,255),g:dc(e.g,0,255),b:dc(e.b,0,255),a:dc(e.a)}},fc=function(e){return{r:uc(e.r),g:uc(e.g),b:uc(e.b),a:uc(e.a,3)}},hc=/^#([0-9a-f]{3,8})$/i,gc=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},vc=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}},bc=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}},kc=function(e){return{h:pc(e.h),s:dc(e.s,0,100),l:dc(e.l,0,100),a:dc(e.a)}},_c=function(e){return{h:uc(e.h),s:uc(e.s),l:uc(e.l),a:uc(e.a,3)}},yc=function(e){return bc((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},Ec=function(e){return{h:(t=vc(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},Cc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Sc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,wc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Bc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ic={string:[[function(e){var t=hc.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?uc(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?uc(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=wc.exec(e)||Bc.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:mc({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=Cc.exec(e)||Sc.exec(e);if(!t)return null;var n,o,r=kc({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(ac[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return yc(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 cc(t)&&cc(n)&&cc(o)?mc({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(!cc(t)||!cc(n)||!cc(o))return null;var i=kc({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return yc(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!cc(t)||!cc(n)||!cc(o))return null;var i=function(e){return{h:pc(e.h),s:dc(e.s,0,100),v:dc(e.v,0,100),a:dc(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return bc(i)},"hsv"]]},xc=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]},Tc=function(e,t){var n=Ec(e);return{h:n.h,s:dc(n.s+100*t,0,100),l:n.l,a:n.a}},Nc=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Pc=function(e,t){var n=Ec(e);return{h:n.h,s:n.s,l:dc(n.l+100*t,0,100),a:n.a}},Mc=function(){function e(e){this.parsed=function(e){return"string"==typeof e?xc(e.trim(),Ic.string):"object"==typeof e&&null!==e?xc(e,Ic.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 uc(Nc(this.rgba),2)},e.prototype.isDark=function(){return Nc(this.rgba)<.5},e.prototype.isLight=function(){return Nc(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?gc(uc(255*r)):"","#"+gc(t)+gc(n)+gc(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 _c(Ec(this.rgba))},e.prototype.toHslString=function(){return t=(e=_c(Ec(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=vc(this.rgba),{h:uc(e.h),s:uc(e.s),v:uc(e.v),a:uc(e.a,3)};var e},e.prototype.invert=function(){return Rc({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),Rc(Tc(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Rc(Tc(this.rgba,-e))},e.prototype.grayscale=function(){return Rc(Tc(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Rc(Pc(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Rc(Pc(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?Rc({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):uc(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Ec(this.rgba);return"number"==typeof e?Rc({h:e,s:t.s,l:t.l,a:t.a}):uc(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Rc(e).toHex()},e}(),Rc=function(e){return e instanceof Mc?e:new Mc(e)},Lc=[],Ac=function(e){e.forEach((function(e){Lc.indexOf(e)<0&&(e(Mc,Ic),Lc.push(e))}))};function Dc(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 Oc=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Fc=function(e){return.2126*Oc(e.r)+.7152*Oc(e.g)+.0722*Oc(e.b)};function zc(e){e.prototype.luminance=function(){return e=Fc(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=Fc(l))>(a=Fc(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 Vc=n(3692),Hc=n.n(Vc);const Gc=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Uc(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=h();)!1!==t&&e.push(t);return e}function h(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return a("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function g(){const e=p(/^([^{]+)/);if(e)return Wc(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=Wc(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Gc,""),value:n?Wc(n[0]).replace(Gc,""):""});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=Wc(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:Wc(t[1]),media:Wc(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Wc(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=Wc(t[1]),o=Wc(t[2]);if(!c())return a("@document missing '{'");const r=f().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):a("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=g()||[];if(!c())return a("@page missing '{'");let n,o=f();for(;n=v();)o.push(n),o=o.concat(f());return u()?e({type:"page",selectors:t,declarations:o}):a("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return a("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):a("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return a("@font-face missing '{'");let t,n=f();for(;t=v();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=g();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return $c(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function Wc(e){return e?e.replace(/^\s+|\s+$/g,""):""}function $c(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){$c(e,o)})):n&&"object"==typeof n&&$c(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var jc=n(5717),Kc=n.n(jc),qc=Yc;function Yc(e){this.options=e||{}}Yc.prototype.emit=function(e){return e},Yc.prototype.visit=function(e){return this[e.type](e)},Yc.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 Zc=Xc;function Xc(e){qc.call(this,e)}Kc()(Xc,qc),Xc.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Xc.prototype.comment=function(e){return this.emit("",e.position)},Xc.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Xc.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Xc.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("}")},Xc.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Xc.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Xc.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Xc.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Xc.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Xc.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("}")},Xc.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Xc.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Xc.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Xc.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("}"):""},Xc.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var Qc=Jc;function Jc(e){e=e||{},qc.call(this,e),this.indentation=e.indent}Kc()(Jc,qc),Jc.prototype.compile=function(e){return this.stylesheet(e)},Jc.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Jc.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Jc.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Jc.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}")},Jc.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}")},Jc.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Jc.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Jc.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}")},Jc.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)+"}")},Jc.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")},Jc.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}")},Jc.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}")},Jc.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}")},Jc.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Jc.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()+"}"):""},Jc.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Jc.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var eu=function(e,t){try{const r=Uc(e);return n=Hc().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new Zc(o):new Qc(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function tu(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 nu(e,t){return new URL(e,t).toString()}var ou=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]};tu(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+nu(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 ru=/^(body|html|:root).*$/;var lu=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(ru)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},iu=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(lu(t)),o&&r.push(ou(o)),r.length?eu(n,(0,d.compose)(r)):n}))};const su=".editor-styles-wrapper";function au(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(su);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=Rc(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function cu(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>iu(t,su)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:au(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}let uu;Ac([Dc,zc]);const du=2e3;var pu=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(zn).getSettings();return{styles:t.styles,assets:t.__unstableResolvedAssets}}),[]),u=(0,s.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:a),[a]);uu=uu||(0,d.pure)(fm);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>du?du*f:void 0}},(0,s.createElement)(sc,{head:(0,s.createElement)(cu,{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"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:i,pointerEvents:"none",maxHeight:du}},l,(0,s.createElement)(uu,{renderAppender:!1}))))},mu=(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(zn).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)($a,{value:c,settings:a},r?(0,s.createElement)(ja,{onClick:l}):(0,s.createElement)(pu,{viewportWidth:o,__experimentalPadding:n})):null}));function fu(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(zn).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)($a,{value:p,settings:a},(0,s.createElement)(gm,{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 hu=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)(mu,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=d.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:d.example?(0,r.getBlockFromExample)(o.name,{attributes:{...d.example.attributes,...u},innerBlocks:d.example.innerBlocks}):(0,r.createBlock)(l,u)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,h.__)("No Preview Available."))),!p&&(0,s.createElement)(Ua,{title:i,icon:a,description:c}))},gu=(0,s.createContext)(),vu=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(gu);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)}))})),bu=(0,s.createElement)(O.SVG,{width:"18",height:"18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18"},(0,s.createElement)(O.Path,{d:"M5 4h2V2H5v2zm6-2v2h2V2h-2zm-6 8h2V8H5v2zm6 0h2V8h-2v2zm-6 6h2v-2H5v2zm6 0h2v-2h-2v2z"}));function ku(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)(Ga,{icon:n}):(0,h.sprintf)(
|
11 |
/* translators: %d: Number of blocks. */
|
12 |
-
(0,
|
13 |
/* translators: %s: block pattern title. */
|
14 |
-
(0,
|
15 |
-
(0,
|
16 |
/* translators: %d: number of patterns. %s: block pattern search query */
|
17 |
-
(0,
|
18 |
/* translators: %d: number of results. */
|
19 |
-
(0,
|
20 |
/* translators: %d: number of results. */
|
21 |
-
(0,
|
22 |
/* translators: Blocks tab title in the block inserter. */
|
23 |
-
title:(0,
|
24 |
/* translators: Patterns tab title in the block inserter. */
|
25 |
-
title:(0,
|
26 |
/* translators: Reusable blocks tab title in the block inserter. */
|
27 |
-
title:(0,
|
28 |
-
(0,
|
29 |
-
(0,
|
30 |
-
(0,h._x)("Add %s","directly add the only allowed block"),d):(0,h._x)("Add block","Generic label for block inserter button");const f=!m;let g=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":f?"true":void 0,"aria-expanded":f?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(wo,{icon:Fa}));return(f||m)&&(g=(0,s.createElement)(p.Tooltip,{text:n},g)),g},isAppender:!0})}const wd=(0,s.forwardRef)(((e,t)=>(Rt()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Sd(e,t))));var Bd=(0,s.forwardRef)(Sd),Id=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(zn);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)(Cd,{rootClientId:n}):(0,s.createElement)(Bd,{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 xd(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 Td=(0,s.createContext)();function Nd(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(zn),l=(0,s.useContext)(Td),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:f,rootClientId:g,isInserterShown:v}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(zn),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=Ia(u),k=Ia(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,h.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,h.isRTL)()?{top:t?t.bottom:n.top,left:t?t.right:n.right,right:t?t.left:n.left,bottom:n?n.top:t.bottom,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.right:n.right,bottom:n?n.top:t.bottom,ownerDocument:e}:(0,h.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:n?n.right:t.left,bottom:t?t.bottom:n.bottom,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:n?n.left:t.right,bottom:t?t.bottom:n.bottom,ownerDocument:e}}),[b,k]),C=xd(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+"--"+g},(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)(Ed,{position:"bottom center",clientId:f,rootClientId:g,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Pd(e){let{children:t,__unstablePopoverSlot:n,__unstableContentRef:o}=e;const r=(0,m.useSelect)((e=>e(zn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(Td.Provider,{value:(0,s.useRef)(!1)},r&&(0,s.createElement)(Nd,{__unstablePopoverSlot:n,__unstableContentRef:o}),t)}function Md(){const e=(0,s.useContext)(Td),t=(0,m.useSelect)((e=>e(zn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(zn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(zn);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(),h=t.clientY-f.top,g=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>h||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>g));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;if(null===(s=v.parentElement)||void 0===s?void 0:s.closest(".block-editor-block-content-overlay.overlay-active"))return;const b=v.id.slice("block-".length);if(!b)return;if(a().includes(b))return;const k=v.getBoundingClientRect();if("horizontal"===m&&(t.clientY>k.bottom||t.clientY<k.top)||"vertical"===m&&(t.clientX>k.right||t.clientX<k.left))return void(l()&&p());const _=r(b);0!==_?u(d,_,{__unstableWithInserter:!0}):l()&&p()}}),[e,n,o,r,l,i,u,p,a])}const Rd="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Ld="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Ad(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(zn),{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 Dd(e){let{clientId:t}=e;const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=e(zn),i=n(t);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(t),name:i,reusableBlockTitle:s&&l(o(t).ref)}}),[t]),i=Ad(t);if(!o||!i)return null;const s=(0,r.getBlockType)(o),a=s?(0,r.__experimentalGetBlockLabel)(s,n):null,c=l||a;return c&&c!==s.title?(0,u.truncate)(c,{length:35}):i.title}var Od=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(zn),s=o(n[0]),a=s?l(s):null,c=i(n[0]);return{srcRootClientId:s,isDraggable:"all"!==a,icon:null===(t=(0,r.getBlockType)(c))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[f,h,g]=function(){const e=(0,s.useRef)(null),t=(0,s.useRef)(null),n=(0,s.useRef)(null),o=(0,s.useRef)(null);return(0,s.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,s.useCallback)((r=>{e.current=r.clientY,n.current=(0,rr.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,s.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0)/e;t.current=25*n}else if(o.clientY<l){const e=Math.max(l-50,0),n=Math.max(l-i-50,0)/e;t.current=-25*n}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,m.useDispatch)(zn);if((0,s.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(p.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,f(e),l&&l()},onDragOver:h,onDragEnd:()=>{b(),d.current=!1,g(),i&&i()},__experimentalDragComponent:(0,s.createElement)(ku,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},Fd=function(e){let{clientId:t,rootClientId:n,blockElement:o}=e;const l=Ad(t),a=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(zn),a=l(t),{name:c,attributes:u}=r(t);return{index:a,name:c,attributes:u,blockMovingMode:i(),orientation:null===(o=s(n))||void 0===o?void 0:o.orientation}}),[t,n]),{index:u,name:d,attributes:f,blockMovingMode:g,orientation:v}=a,{setNavigationMode:b,removeBlock:k}=(0,m.useDispatch)(zn),_=(0,s.useRef)(),y=(0,r.getBlockType)(d),E=(0,r.__experimentalGetAccessibleBlockLabel)(y,f,u+1,v);(0,s.useEffect)((()=>{_.current.focus(),(0,Nt.speak)(E)}),[E]);const{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(zn),{selectBlock:M,clearSelectedBlock:R,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(zn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!g}),O=(0,h.__)("Drag");return(0,s.createElement)("div",{className:D},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Ga,{icon:null==l?void 0:l.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Od,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:bu,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===va.UP,l=n===va.DOWN,i=n===va.LEFT,s=n===va.RIGHT,a=n===va.TAB,c=n===va.ESCAPE,u=n===va.ENTER,d=n===va.SPACE,p=e.shiftKey;if(n===va.BACKSPACE||n===va.DELETE)return k(t),void e.preventDefault();const m=I(),f=x(),h=T(f||m),g=N(f||m),v=a&&p||r,b=a&&!p||l,_=i,y=s;let E;if(v)E=h;else if(b)E=g;else if(_){var D;E=null!==(D=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)(Dd,{clientId:t})))))};function zd(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var Vd=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const a=(0,s.useRef)(),c=function(e){const[t,n]=(0,s.useState)(!0),o=(0,s.useCallback)((()=>{const t=!rr.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||Rt()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,s.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(a);return 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,tc.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=zd(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=zd(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)},Hd=(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"})),Gd=(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"})),Ud=(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"})),Wd=(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 $d=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?Hd:Gd:Ud:"down"===e?"horizontal"===t?(0,h.isRTL)()?Gd:Hd:Wd:null,jd=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move right"):(0,h.__)("Move left"):(0,h.__)("Move up"):"down"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move left"):(0,h.__)("Move right"):(0,h.__)("Move down"):null,Kd=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const f=(0,d.useInstanceId)(Kd),g=(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(zn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),f=t(p),h=t((0,u.last)(d)),g=s(m),v=a(p),b=0===f,k=h===g.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:f,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,m.useDispatch)(zn),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:$d(o,C),label:jd(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,h.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,h.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;return r<0&&n?(0,h.__)("Blocks cannot be moved up as they are already at the top"):r>0&&o?(0,h.__)("Blocks cannot be moved down as they are already at the bottom"):r<0&&!n?(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
31 |
-
(0,
|
32 |
-
(0,
|
33 |
-
(0,
|
34 |
-
(0,
|
35 |
-
(0,
|
36 |
-
(0,
|
37 |
-
(0,
|
38 |
-
(0,
|
39 |
-
(0,
|
40 |
-
(0,
|
41 |
-
(0,
|
42 |
-
(0,
|
43 |
-
(0,
|
44 |
-
(0,
|
45 |
-
(0,
|
46 |
/* translators: %s: Name of the block's parent. */
|
47 |
-
(0,
|
48 |
/* translators: %s: block title. */
|
49 |
-
(0,
|
50 |
/* translators: %d: number of blocks. */
|
51 |
-
(0,
|
52 |
-
(0,
|
53 |
-
(0,
|
54 |
-
(0,
|
55 |
-
(0,
|
56 |
/* translators: %s: block name */
|
57 |
-
(0,
|
58 |
-
/* translators: accessibility text for the block toolbar */,"aria-label":(0,h.__)("Block tools")},o),(0,s.createElement)(Gp,{hideDragHandle:n}))};function Wp(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isCaretWithinFormattedText:l,getSettings:i,getLastMultiSelectedBlockClientId:s}=e(zn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),isCaretWithinFormattedText:l(),hasMultiSelection:o(),hasFixedToolbar:i().hasFixedToolbar,lastClientId:s()}}function $p(e){let{clientId:t,rootClientId:n,isValid:o,isEmptyDefaultBlock:r,capturingClientId:l,__unstablePopoverSlot:i,__unstableContentRef:a}=e;const{isNavigationMode:u,isMultiSelecting:f,isTyping:h,isCaretWithinFormattedText:g,hasMultiSelection:v,hasFixedToolbar:b,lastClientId:k}=(0,m.useSelect)(Wp,[]),_=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(zn);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)(zn),I=!h&&!u&&r&&o,x=u,T=!u&&!b&&y&&!I&&!f&&(!h||g),N=!(u||T||b||r);(0,tc.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=Ia(t),R=Ia(k),L=Ia(l),A=xd(a);if(!(x||T||E||I))return null;let D=M;if(!D)return null;l&&(D=L);let O=D;if(v){if(!R)return null;O={top:D,bottom:R}}const F=I?"top left right":"top right left",{ownerDocument:z}=D,V=I?void 0:z.defaultView.frameElement||(0,rr.getScrollContainer)(D)||z.body;return(0,s.createElement)(p.Popover,{ref:A,noArrow:!0,animate:!1,position:F,focusOnMount:!1,anchorRef:O,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":_}),__unstableStickyBoundaryElement:V,__unstableSlotName:i||null,__unstableBoundaryParent:!0,__unstableObserveElement:D,shouldAnchorIncludePadding:!0,__unstableEditorCanvasWrapper:null==a?void 0:a.current},(T||E)&&(0,s.createElement)("div",{onFocus:function(){w(!0)},onBlur:function(){w(!1)},tabIndex:-1,className:c()("block-editor-block-list__block-popover-inserter",{"is-visible":S})},(0,s.createElement)(Ed,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(T||E)&&(0,s.createElement)(Up,{focusOnMount:E,__experimentalInitialIndex:P.current,__experimentalOnIndexChange:e=>{P.current=e},key:t}),x&&(0,s.createElement)(Fd,{clientId:t,rootClientId:n,blockElement:D}),I&&(0,s.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,s.createElement)(Ed,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function jp(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(zn),a=t()||n();if(!a)return;const{name:c,attributes:d={},isValid:p}=l(a)||{},m=i(a),f=s(m),h=(0,u.find)(m,(e=>{var t;return null===(t=f[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isValid:p,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:h}}function Kp(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(jp,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u}=o;return i?(0,s.createElement)($p,{clientId:r,rootClientId:l,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function qp(e){let{children:t}=e;const n=(0,s.useContext)(Td),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(Rt()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(Pd,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(Kp,{__unstablePopoverSlot:"block-toolbar"}),t))}var Yp=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Un();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Zp=Yp((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(Bd,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),Xp=(0,d.compose)([Yp,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(zn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(Cd,{rootClientId:t})})),Qp=window.wp.isShallowEqual,Jp=n.n(Qp);const em=new WeakMap;function tm(e,t){const n=(0,m.useSelect)((e=>e(zn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(zn),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(zn),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 nm(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 om(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=nm(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function rm(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,h.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=om(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function lm(){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(zn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(zn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(zn),a=tm(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=rm(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 im(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:h,orientation:g,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(zn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(zn).getBlockRootClientId(e);return{blockListSettings:t(zn).getBlockListSettings(e),parentLock:t(zn).getTemplateLock(n)}}),[e]),p=(0,s.useMemo)((()=>t),t);(0,s.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===r?d:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=Io(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),Jp()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,g,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(zn),{replaceInnerBlocks:i}=(0,m.useDispatch)(zn),a=(0,m.useSelect)((t=>t(zn).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(zn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){em.has(t)||em.set(t,new WeakMap);const n=em.get(t);if(!n.has(e)){const o=(0,u.mapValues)(t.providesContext,(t=>e[t]));n.set(e,o)}return n.get(e)}(n.attributes,o)}),[t]);return(0,s.createElement)(ir,{value:k},(0,s.createElement)(gm,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function sm(e){return Wa(e),(0,s.createElement)(im,e)}const am=(0,s.forwardRef)(((e,t)=>{const n=cm({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function cm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=Un(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:a}=(0,m.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,isNavigationMode:s}=e(zn),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,lm({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?sm:im;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)(gm,t)}}cm.save=r.__unstableGetInnerBlocksProps,am.DefaultBlockAppender=Xp,am.ButtonBlockAppender=Zp,am.Content=()=>cm.save().children;var um=am;const dm=(0,s.createContext)(),pm=(0,s.createContext)();function mm(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(zn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),p=cm({ref:(0,d.useMergeRefs)([Ka(),Md(),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)(dm.Provider,{value:o},(0,s.createElement)("div",p))}function fm(e){return function(){const e=(0,m.useSelect)((e=>e(zn).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(zn).__experimentalGetParsedPattern(e[n].name),t=Rd(o))};return t=Rd(o),()=>Ld(t)}),[e])}(),(0,s.createElement)(qp,null,(0,s.createElement)(Gn,{value:Vn},(0,s.createElement)(mm,e)))}function hm(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=xo}=e;const[i,a]=(0,s.useState)(new Set),c=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{a((t=>{const n=new Set(t);for(const t of e){const e=t.target.getAttribute("data-block");n[t.isIntersecting?"add":"delete"](e)}return n}))}))}),[a]),{order:u,selectedBlocks:d}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o}=e(zn);return{order:t(n),selectedBlocks:o()}}),[n]);return(0,s.createElement)(No,{value:l},(0,s.createElement)(pm.Provider,{value:c},u.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,s.createElement)(Da,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,s.createElement)(Id,{tagName:r,rootClientId:n,renderAppender:o}))}function gm(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(hm,e))}fm.__unstableElementContext=dm;const vm=["colors","disableCustomColors","gradients","disableCustomGradients"];function bm(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:f,colorValue:g,gradientValue:v,clearable:b,showTitle:k=!0,enableAlpha:_}=e;const y=m&&(!(0,u.isEmpty)(t)||!o),E=f&&(!(0,u.isEmpty)(n)||!r),[C,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",null,(0,s.createElement)(p.__experimentalVStack,{spacing:1},k&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(p.BaseControl.VisualLabel,null,d))),y&&E&&(0,s.createElement)(p.__experimentalToggleGroupControl,{value:C,onChange:S,label:(0,h.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,h.__)("Solid")}),(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,h.__)("Gradient")})),("color"===C||!E)&&(0,s.createElement)(p.ColorPalette,{value:g,onChange:E?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b,enableAlpha:_}),("gradient"===C||!y)&&(0,s.createElement)(p.GradientPicker,{value:v,onChange:y?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b})))):null}function km(e){const t={};return t.colors=mo("color.palette"),t.gradients=mo("color.gradients"),t.disableCustomColors=!mo("color.custom"),t.disableCustomGradients=!mo("color.customGradient"),(0,s.createElement)(bm,i({},t,e))}var _m=function(e){return(0,u.every)(vm,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(bm,e):(0,s.createElement)(km,e)};function ym(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)(_m,i({showTitle:!1,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d},e))}))))}function Em(){return{disableCustomColors:!mo("color.custom"),disableCustomGradients:!mo("color.customGradient")}}function Cm(){const e=Em(),t=mo("color.palette.custom"),n=mo("color.palette.theme"),o=mo("color.palette.default"),r=mo("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,h._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=mo("color.gradients.custom"),i=mo("color.gradients.theme"),a=mo("color.gradients.default"),c=mo("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}Ac([Dc,zc]);const Sm=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},wm=(e,t)=>(0,u.find)(e,{color:t});function Bm(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}const Im=[];function xm(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=Cm(),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=Sm(l,t,a))||void 0===e?void 0:e.color}));(0,s.useEffect)((()=>{var e;u(null===(e=Sm(l,t,a))||void 0===e?void 0:e.color)}),[t,a,l]);const d=[{label:(0,h.__)("Color"),onColorChange:e=>{u(e);const t=wm(l,e),r={...n,border:{...null==n?void 0:n.border,color:null!=t&&t.slug?void 0:e}},i=null!=t&&t.slug?t.slug:void 0;o({style:qo(r),borderColor:i})},colorValue:c,clearable:!1}];return(0,s.createElement)(ym,i({settings:d,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function Tm(e,t,n){var o;if(!ef(t,"color")||tf(t))return e;const{borderColor:r,style:l}=n,i=Bm("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 Nm=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const{name:r,attributes:l}=t,{borderColor:a}=l,c=mo("color.palette")||Im;if(!ef(r,"color")||tf(r))return(0,s.createElement)(e,t);const u={borderColor:a?null===(n=Sm(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 Pm(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Mm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,p.__experimentalParseUnit)(e))),n=t.map((e=>e[0])),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=Pm(o),i=0===r||r?`${r}${l}`:null;return i}function Rm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Mm(e),n=isNaN(parseFloat(t));return n}function Lm(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Am(e){let{onChange:t,values:n,...o}=e;const r=Mm(n),l=Lm(n)&&Rm(n),a=l?(0,h.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,h.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return ef(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Tm),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!ef(e,"color")||tf(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Tm(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Nm);const Dm={topLeft:(0,h.__)("Top left"),topRight:(0,h.__)("Top right"),bottomLeft:(0,h.__)("Bottom left"),bottomRight:(0,h.__)("Bottom right")};function Om(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(Dm).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 Fm=(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"})),zm=(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 Vm(e){let{isLinked:t,...n}=e;const o=t?(0,h.__)("Unlink Radii"):(0,h.__)("Link Radii");return(0,s.createElement)(p.Tooltip,{text:o},(0,s.createElement)(p.Button,i({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?Fm:zm,iconSize:16,"aria-label":o})))}const Hm={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},Gm={px:100,em:20,rem:20};function Um(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!Lm(n)||!Rm(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["px","em","rem"]}),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e){const[,t]=(0,p.__experimentalParseUnit)(e);return t||"px"}return Pm(Object.values(e).map((e=>{const[,t]=(0,p.__experimentalParseUnit)(e);return t})))||"px"}(n),a=l&&l.find((e=>e.value===i)),c=(null==a?void 0:a.step)||1,[u]=(0,p.__experimentalParseUnit)(Mm(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,h.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Am,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,unit:i,units:l}),(0,s.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:u,min:0,max:Gm[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(Om,{min:0,onChange:t,values:n||Hm,units:l}),(0,s.createElement)(Vm,{onClick:()=>r(!o),isLinked:o})))}function Wm(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Um,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=qo(t)),o({style:t})}})}var $m=(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"})),jm=(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"})),Km=(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 qm=[{label:(0,h.__)("Solid"),icon:$m,value:"solid"},{label:(0,h.__)("Dashed"),icon:jm,value:"dashed"},{label:(0,h.__)("Dotted"),icon:Km,value:"dotted"}];function Ym(e){let{onChange:t,value:n}=e;return(0,s.createElement)("fieldset",{className:"components-border-style-control"},(0,s.createElement)("legend",null,(0,h.__)("Style")),(0,s.createElement)("div",{className:"components-border-style-control__buttons"},qm.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 Zm=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Ym,{value:null==n||null===(t=n.border)||void 0===t?void 0:t.style,onChange:e=>{const t={...n,border:{...null==n?void 0:n.border,style:e}};o({style:qo(t)})}})},Xm=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)(),g=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["px","em","rem"]});return(0,s.createElement)(p.__experimentalUnitControl,{value:r,label:(0,h.__)("Width"),min:0,onChange:e=>{let s={...n,border:{...null==n?void 0:n.border,width:e}},p=t;const h=0===parseFloat(e),g=0===parseFloat(r);h&&!g&&(d(t),f(l),c(i),p=void 0,s.border.color=void 0,s.border.style="none"),!h&&g&&("none"===i&&(s.border.style=a),void 0===t&&(p=u,s.border.color=m)),void 0!==e&&""!==e||(s=qo(s)),o({borderColor:p,style:s})},units:g})},Qm="__experimentalBorder";function Jm(e){const{clientId:t}=e,n=nf(e),o=ef(e.name),l=mo("border.color")&&ef(e.name,"color"),i=mo("border.radius")&&ef(e.name,"radius"),a=mo("border.style")&&ef(e.name,"style"),c=mo("border.width")&&ef(e.name,"width");if(n||!o)return null;const u=(0,r.getBlockSupport)(e.name,[Qm,"__experimentalDefaultControls"]),d=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)(er,{__experimentalGroup:"border"},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.border)||void 0===n||!n.width)}(e),label:(0,h.__)("Width"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:of(o,"width")})}(e),isShownByDefault:null==u?void 0:u.width,resetAllFilter:d("width"),panelId:t},(0,s.createElement)(Xm,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.border)||void 0===n||!n.style)}(e),label:(0,h.__)("Style"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:of(o,"style")})}(e),isShownByDefault:null==u?void 0:u.style,resetAllFilter:d("style"),panelId:t},(0,s.createElement)(Zm,e)),l&&(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,h.__)("Color"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({borderColor:void 0,style:of(o,"color")})}(e),isShownByDefault:null==u?void 0:u.color,resetAllFilter:d("color",{borderColor:void 0}),panelId:t},(0,s.createElement)(xm,e)),i&&(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,h.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:of(o,"radius")})}(e),isShownByDefault:null==u?void 0:u.radius,resetAllFilter:d("radius"),panelId:t},(0,s.createElement)(Wm,e)))}function ef(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,Qm);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 tf(e){const t=(0,r.getBlockSupport)(e,Qm);return null==t?void 0:t.__experimentalSkipSerialization}const nf=()=>[!mo("border.color"),!mo("border.radius"),!mo("border.style"),!mo("border.width")].every(Boolean);function of(e,t){return qo({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function rf(e){if(e)return`has-${e}-gradient-background`}function lf(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function sf(e,t){return(0,u.find)(e,["gradient",t])}function af(e,t){const n=sf(e,t);return n&&n.slug}function cf(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Un(),o=mo("color.gradients.custom"),r=mo("color.gradients.theme"),l=mo("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(zn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(zn),d=(0,s.useCallback)((o=>{const r=af(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=rf(a);let f;return f=a?lf(i,a):c,{gradientClass:p,gradientValue:f,setGradient:d}}
|
59 |
-
|
60 |
-
const uf=(0,h.__)("(%s: color %s)"),df=(0,h.__)("(%s: gradient %s)"),pf=["colors","disableCustomColors","gradients","disableCustomGradients"],mf=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=wm(c||t,l);r=(0,h.sprintf)(uf,a.toLowerCase(),e&&e.name||l)}else{const e=sf(u||n,l);r=(0,h.sprintf)(df,a.toLowerCase(),e&&e.name||i)}return(0,s.createElement)(p.ColorIndicator,{key:o,colorValue:l||i,"aria-label":r})}))},ff=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:a,settings:d,title:m,showTitle:f=!0,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:g,enableAlpha:v,...b}=e;if((0,u.isEmpty)(n)&&(0,u.isEmpty)(o)&&r&&l&&(0,u.every)(d,(e=>(0,u.isEmpty)(e.colors)&&(0,u.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients))))return null;const k=(0,s.createElement)("span",{className:"block-editor-panel-color-gradient-settings__panel-title"},m,(0,s.createElement)(mf,{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)(ym,{settings:d,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:h,__experimentalIsRenderedInSidebar:g,enableAlpha:v}),!!a&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalSpacer,{marginY:4})," ",a))},hf=e=>{const t=Em();return t.colors=mo("color.palette"),t.gradients=mo("color.gradients"),(0,s.createElement)(ff,i({},t,e))},gf=e=>{const t=Cm();return(0,s.createElement)(ff,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)
|
61 |
-
var vf=e=>(0,u.every)(pf,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(ff,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(gf,e):(0,s.createElement)(hf,e);function bf(e){let{colordBackgroundColor:t,colordTextColor:n,backgroundColor:o,textColor:r,shouldShowTransparencyWarning:l}=e,i="";return i=l?(0,h.__)("Transparent text may be hard for people to read."):t.brightness()<n.brightness()?(0,h.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter text color."):(0,h.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color."),(0,s.useEffect)((()=>{const e=l?(0,h.__)("Transparent text may be hard for people to read."):(0,h.__)("This color combination may be hard for people to read.");(0,Nt.speak)(e)}),[o,r]),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(p.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},i))}Ac([Dc,zc]);var kf=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fontSize:r,isLargeText:l,textColor:i,enableAlphaChecker:a=!1}=e;if(!t&&!n||!i&&!o)return null;const c=Rc(t||n),u=Rc(i||o),d=u.alpha()<1,p=c.alpha()<1,m=d||p,f=u.isReadable(c,{level:"AA",size:l||!1!==l&&r>=24?"large":"small"});return f&&!m||m&&(!a||f&&!d)?null:(0,s.createElement)(bf,{backgroundColor:t,textColor:i,colordBackgroundColor:c,colordTextColor:u,shouldShowTransparencyWarning:f&&d})};function _f(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function yf(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0,showTitle:l=!0}=e;const[i,a]=(0,s.useState)(),[c,u]=(0,s.useState)(),d=Ba(o);return(0,s.useEffect)((()=>{if(!r)return;if(!d.current)return;u(_f(d.current).color);let e=d.current,t=_f(e).backgroundColor;for(;"rgba(0, 0, 0, 0)"===t&&e.parentNode&&e.parentNode.nodeType===e.parentNode.ELEMENT_NODE;)e=e.parentNode,t=_f(e).backgroundColor;a(t)})),(0,s.createElement)(er,null,(0,s.createElement)(vf,{title:(0,h.__)("Color"),initialOpen:!1,settings:n,showTitle:l,enableAlpha:t,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},r&&(0,s.createElement)(kf,{backgroundColor:i,textColor:c,enableAlphaChecker:t})))}const Ef="color",Cf=e=>{const t=(0,r.getBlockSupport)(e,Ef);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Sf=e=>{const t=(0,r.getBlockSupport)(e,Ef);return null==t?void 0:t.__experimentalSkipSerialization},wf=e=>{const t=(0,r.getBlockSupport)(e,Ef);return(0,u.isObject)(t)&&!!t.gradients};function Bf(e,t,n){var o,r,l,i,s,a;if(!Cf(t)||Sf(t))return e;const u=wf(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,h=Bm("background-color",d),g=rf(m),v=Bm("color",p),b=c()(e.className,v,g,{[h]:!(u&&null!=f&&null!==(o=f.color)&&void 0!==o&&o.gradient||!h),"has-text-color":p||(null==f||null===(r=f.color)||void 0===r?void 0:r.text),"has-background":d||(null==f||null===(l=f.color)||void 0===l?void 0:l.background)||u&&(m||(null==f||null===(i=f.color)||void 0===i?void 0:i.gradient)),"has-link-color":null==f||null===(s=f.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color});return e.className=b||void 0,e}const If=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Sm(e,n[1]).color:t};function xf(e){var t,n,o,l,i,a,c,d,p;const{name:m,attributes:f}=e,g=mo("color.palette.custom"),v=mo("color.palette.theme"),b=mo("color.palette.default"),k=(0,s.useMemo)((()=>[...g||[],...v||[],...b||[]]),[g,v,b]),_=mo("color.gradients.custom"),y=mo("color.gradients.theme"),E=mo("color.gradients.default"),C=(0,s.useMemo)((()=>[..._||[],...y||[],...E||[]]),[_,y,E]),S=mo("color.custom"),w=mo("color.customGradient"),B=mo("color.background"),I=mo("color.link"),x=mo("color.text"),T=S||!v||(null==v?void 0:v.length)>0,N=w||!y||(null==y?void 0:y.length)>0,P=(0,s.useRef)(f);if((0,s.useEffect)((()=>{P.current=f}),[f]),!Cf(m))return null;const M=(e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,Ef);return(0,u.isObject)(t)&&!!t.link})(m)&&I&&T,R=(e=>{const t=(0,r.getBlockSupport)(e,Ef);return t&&!1!==t.text})(m)&&x&&T,L=(e=>{const t=(0,r.getBlockSupport)(e,Ef);return t&&!1!==t.background})(m)&&B&&T,A=wf(m)&&N;if(!(M||R||L||A))return null;const{style:D,textColor:O,backgroundColor:F,gradient:z}=f;let V;if(A&&z)V=lf(C,z);else if(A){var H;V=null==D||null===(H=D.color)||void 0===H?void 0:H.gradient}const G=t=>n=>{var o,r;const l=wm(k,n),i=t+"Color",s={...P.current.style,color:{...null===(o=P.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=l&&l.slug?void 0:n}},a=null!=l&&l.slug?l.slug:void 0,c={style:qo(s),[i]:a};e.setAttributes(c),P.current={...P.current,...c}},U=!("web"!==s.Platform.OS||z||null!=D&&null!==(t=D.color)&&void 0!==t&&t.gradient);return(0,s.createElement)(yf,{enableContrastChecking:U,clientId:e.clientId,enableAlpha:!0,settings:[...R?[{label:(0,h.__)("Text"),onColorChange:G("text"),colorValue:Sm(k,O,null==D||null===(n=D.color)||void 0===n?void 0:n.text).color}]:[],...L||A?[{label:(0,h.__)("Background"),onColorChange:L?G("background"):void 0,colorValue:Sm(k,F,null==D||null===(o=D.color)||void 0===o?void 0:o.background).color,gradientValue:V,onGradientChange:A?t=>{const n=af(C,t);let o;if(n){var r,l,i;const e={...null===(r=P.current)||void 0===r?void 0:r.style,color:{...null===(l=P.current)||void 0===l||null===(i=l.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:qo(e),gradient:n}}else{var s,a,c;const e={...null===(s=P.current)||void 0===s?void 0:s.style,color:{...null===(a=P.current)||void 0===a||null===(c=a.style)||void 0===c?void 0:c.color,gradient:t}};o={style:qo(e),gradient:void 0}}e.setAttributes(o),P.current={...P.current,...o}}:void 0}]:[],...M?[{label:(0,h.__)("Link"),onColorChange:t=>{const n=wm(k,t),o=null!=n&&n.slug?`var:preset|color|${n.slug}`:t,r=qo(function(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},["elements","link","color","text"],n,u.clone)}(D,0,o));e.setAttributes({style:r})},colorValue:If(k,null==D||null===(l=D.elements)||void 0===l||null===(i=l.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==D||null===(c=D.elements)||void 0===c||null===(d=c.link)||void 0===d||null===(p=d.color)||void 0===p||!p.text)}]:[]]})}const Tf=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=mo("color.palette.custom")||[],u=mo("color.palette.theme")||[],d=mo("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!Cf(o)||Sf(o))return(0,s.createElement)(e,t);const m={};var f,h;a&&(m.color=null===(f=Sm(p,a))||void 0===f?void 0:f.color),l&&(m.backgroundColor=null===(h=Sm(p,l))||void 0===h?void 0:h.color);let g=t.wrapperProps;return g={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:g}))}));(0,l.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return Cf(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),wf(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Bf),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!Cf(e)||Sf(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Bf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",Tf);const Nf=[{name:(0,h._x)("Regular","font style"),value:"normal"},{name:(0,h._x)("Italic","font style"),value:"italic"}],Pf=[{name:(0,h._x)("Thin","font weight"),value:"100"},{name:(0,h._x)("Extra Light","font weight"),value:"200"},{name:(0,h._x)("Light","font weight"),value:"300"},{name:(0,h._x)("Regular","font weight"),value:"400"},{name:(0,h._x)("Medium","font weight"),value:"500"},{name:(0,h._x)("Semi Bold","font weight"),value:"600"},{name:(0,h._x)("Bold","font weight"),value:"700"},{name:(0,h._x)("Extra Bold","font weight"),value:"800"},{name:(0,h._x)("Black","font weight"),value:"900"}],Mf=(e,t)=>e?t?(0,h.__)("Appearance"):(0,h.__)("Font style"):(0,h.__)("Font weight");function Rf(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=Mf(n,o),c={key:"default",name:(0,h.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,s.useMemo)((()=>n&&o?(()=>{const e=[c];return Nf.forEach((t=>{let{name:n,value:o}=t;Pf.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,h.sprintf)(
|
62 |
/* translators: 1: Font weight name. 2: Font style name. */
|
63 |
-
(0,
|
64 |
-
(0,
|
65 |
-
(0,
|
66 |
-
(0,h.__)("Currently selected font weight: %s"),d.name):(0,h.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}function Lf(e){let{value:t,onChange:n}=e;const o=function(e){return void 0!==e&&""!==e}(t),r=o?t:"";return(0,s.createElement)("div",{className:"block-editor-line-height-control"},(0,s.createElement)(p.TextControl,{autoComplete:"off",onKeyDown:e=>{const{keyCode:t}=e;t!==va.ZERO||o||(e.preventDefault(),n("0"))},onChange:e=>{if(o)return void n(e);let t=e;switch(e){case"0.1":t=1.6;break;case"0":t=1.4}n(t)},label:(0,h.__)("Line height"),placeholder:1.5,step:.1,type:"number",value:r,min:0}))}const Af="typography.lineHeight";function Df(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Lf,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:qo(t)})}})}function Of(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Af)||t}const Ff="typography.__experimentalFontStyle",zf="typography.__experimentalFontWeight";function Vf(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Hf(e),i=!Gf(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)(Rf,{onChange:e=>{r({style:qo({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function Hf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Ff),n=mo("typography.fontStyle");return!t||!n}function Gf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,zf),n=mo("typography.fontWeight");return!t||!n}function Uf(e){const t=Hf(e),n=Gf(e);return t&&n}function Wf(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=mo("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,h.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,s.createElement)(p.SelectControl,i({label:(0,h.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const $f="typography.__experimentalFontFamily";function jf(e,t,n){if(!(0,r.hasBlockSupport)(t,$f))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;if(null==n||!n.fontFamily)return e;const o=new(ap())(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 Kf(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=mo("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)(Wf,{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 qf(e){let{name:t}=e;const n=mo("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,$f)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,$f)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",jf),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,$f))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),jf(o,e,n)},e}));const Yf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Zf(e,t){return(0,u.find)(e,{size:t})||{size:t}}function Xf(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var Qf=function(e){const t=mo("typography.fontSizes"),n=!mo("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const Jf="typography.fontSize";function eh(e,t,n){if(!(0,r.hasBlockSupport)(t,Jf))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;const o=new(ap())(e.className);o.add(Xf(n.fontSize));const l=o.value;return e.className=l||void 0,e}function th(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=mo("typography.fontSizes"),a=Yf(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)(Qf,{onChange:e=>{const t=Zf(i,e).slug;l({style:qo({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function nh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=mo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,Jf)||!n}const oh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=mo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,Jf)||(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=Yf(l,a,null==c||null===(o=c.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...u,style:{fontSize:d,...null==u?void 0:u.style}}};return(0,s.createElement)(e,p)}),"withFontSizeInlineStyles");(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Jf)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",eh),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Jf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),eh(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",oh);var rh=(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"})),lh=(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 ih=[{name:(0,h.__)("Underline"),value:"underline",icon:rh},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:lh}];function sh(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,h.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},ih.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 ah="typography.__experimentalTextDecoration";function ch(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(sh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function uh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,ah),n=mo("typography.textDecoration");return t||!n}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:"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"})),ph=(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"})),mh=(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 fh=[{name:(0,h.__)("Uppercase"),value:"uppercase",icon:dh},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:ph},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:mh}];function hh(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,h.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},fh.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 gh="typography.__experimentalTextTransform";function vh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(hh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function bh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,gh),n=mo("typography.textTransform");return t||!n}function kh(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["px","em","rem"],defaultValues:{px:"2",em:".2",rem:".2"}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const _h="typography.__experimentalLetterSpacing";function yh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(kh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function Eh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,_h),n=mo("typography.letterSpacing");return t||!n}const Ch="typography",Sh=[Af,Jf,Ff,zf,$f,ah,gh,_h];function wh(e){const{clientId:t}=e,n=qf(e),o=nh(e),l=Uf(e),i=Of(e),a=uh(e),c=bh(e),u=Eh(e),d=!Hf(e),m=!Gf(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Uf(e),nh(e),Of(e),qf(e),uh(e),bh(e),Eh(e)];return t.filter(Boolean).length===t.length}(e),g=Bh(e.name);if(f||!g)return null;const v=(0,r.getBlockSupport)(e.name,[Ch,"__experimentalDefaultControls"]),b=e=>t=>{var n;return{...t,style:{...t.style,typography:{...null===(n=t.style)||void 0===n?void 0:n.typography,[e]:void 0}}}};return(0,s.createElement)(er,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,h.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==v?void 0:v.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,s.createElement)(Kf,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{fontSize:n,style:o}=e.attributes;return!!n||!(null==o||null===(t=o.typography)||void 0===t||!t.fontSize)}(e),label:(0,h.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:qo({...o,typography:{...null==o?void 0:o.typography,fontSize:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontSize,resetAllFilter:e=>{var t;return{...e,fontSize:void 0,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontSize:void 0}}}},panelId:t},(0,s.createElement)(th,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:Mf(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontAppearance,resetAllFilter:e=>{var t;return{...e,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontStyle:void 0,fontWeight:void 0}}}},panelId:t},(0,s.createElement)(Vf,e)),!i&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.lineHeight)}(e),label:(0,h.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.lineHeight,resetAllFilter:b("lineHeight"),panelId:t},(0,s.createElement)(Df,e)),!a&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textDecoration)}(e),label:(0,h.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textDecoration,resetAllFilter:b("textDecoration"),panelId:t},(0,s.createElement)(ch,e)),!c&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e),label:(0,h.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textTransform,resetAllFilter:b("textTransform"),panelId:t},(0,s.createElement)(vh,e)),!u&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.letterSpacing)}(e),label:(0,h.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==v?void 0:v.letterSpacing,resetAllFilter:b("letterSpacing"),panelId:t},(0,s.createElement)(yh,e)))}const Bh=e=>Sh.some((t=>(0,r.hasBlockSupport)(e,t)));function Ih(e){const t=(0,r.getBlockSupport)(e,Dh);return!!(!0===t||null!=t&&t.blockGap)}function xh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.blockGap");return!Ih(e)||t}function Th(e){var t;const{clientId:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=Ba(n);return xh(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:e=>{var t;const n={...o,spacing:{...null==o?void 0:o.spacing,blockGap:e}};r({style:qo(n)});const l=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var s;i.current&&l&&(null===(s=i.current.parentNode)||void 0===s||s.replaceChild(i.current,i.current))},units:l,value:null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap})),native:null})}function Nh(e){const t=(0,r.getBlockSupport)(e,Dh);return!!(!0===t||null!=t&&t.margin)}function Ph(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.margin"),n=!Gh(e,"margin");return!Nh(e)||t||n}function Mh(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=Hh(n,"margin"),a=i&&i.some((e=>Fh.includes(e)));return Ph(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:qo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:qo(t)})},label:(0,h.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Rh(e){const t=(0,r.getBlockSupport)(e,Dh);return!!(!0===t||null!=t&&t.padding)}function Lh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.padding"),n=!Gh(e,"padding");return!Rh(e)||t||n}function Ah(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=Hh(n,"padding"),a=i&&i.some((e=>Fh.includes(e)));return Lh(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:qo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:qo(t)})},label:(0,h.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const Dh="spacing",Oh=["top","right","bottom","left"],Fh=["vertical","horizontal"];function zh(e){const t=xh(e),n=Lh(e),o=Ph(e),l=Vh(e),i=(a=e.name,"web"===s.Platform.OS&&(Ih(a)||Rh(a)||Nh(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[Dh,"__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)(er,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,h.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:u("padding"),isShownByDefault:null==c?void 0:c.padding,panelId:e.clientId},(0,s.createElement)(Ah,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,h.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:u("margin"),isShownByDefault:null==c?void 0:c.margin,panelId:e.clientId},(0,s.createElement)(Mh,e)),!t&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,h.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:u("blockGap"),isShownByDefault:null==c?void 0:c.blockGap,panelId:e.clientId},(0,s.createElement)(Th,e)))}const Vh=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=xh(e),n=Lh(e),o=Ph(e);return t&&n&&o};function Hh(e,t){const n=(0,r.getBlockSupport)(e,Dh);if(n&&"boolean"!=typeof n[t])return n[t]}function Gh(e,t){const n=Hh(e,t);return!(n&&n.some((e=>Oh.includes(e)))&&n.some((e=>Fh.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}const Uh=[...Sh,Qm,Ef,Dh],Wh=e=>Uh.some((t=>(0,r.hasBlockSupport)(e,t))),$h="var:";function jh(e){return(0,u.startsWith)(e,$h)?`var(--wp--${e.slice($h.length).split("|").join("--")})`:e}function Kh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};return Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(0,u.first)(l)){const r=(0,u.get)(e,l);i&&!(0,u.isString)(r)?Object.entries(i).forEach((e=>{const[t,o]=e,l=(0,u.get)(r,[o]);l&&(n[t]=jh(l))})):t.includes(l.join("."))||(n[o]=jh((0,u.get)(e,l)))}})),n}const qh={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[Ef],"typography.__experimentalSkipSerialization":[Ch],[`${Dh}.__experimentalSkipSerialization`]:["spacing"]},Yh={...qh,[`${Dh}`]:["spacing.blockGap"]};function Zh(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Yh;if(!Wh(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={...Kh(l),...e.style},e}const Xh=(0,d.createHigherOrderComponent)((e=>t=>{const n=Wn();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(xf,t),(0,s.createElement)(wh,t),(0,s.createElement)(Jm,t),(0,s.createElement)(zh,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Qh=(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=Kh(t);return(0,u.isEmpty)(o)?"":[`.${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(a,null===(o=t.attributes.style)||void 0===o?void 0:o.elements),m=(0,s.useContext)(fm.__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 Wh(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Zh),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Wh(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Zh(o,e,n,qh)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Xh),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Qh);var Jh=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}=e;return(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,h.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==va.DOWN||(e.preventDefault(),n())},label:(0,h.__)("Apply duotone filter"),icon:(0,s.createElement)(p.DuotoneSwatch,{values:l})})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,h.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(p.DuotonePicker,{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}))})};const eg=[];function tg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Rc(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 ng(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 og(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=mo("color.duotone")||eg,a=mo("color.palette")||eg,c=!mo("color.custom"),u=!mo("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(Yn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Jh,{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})}}))}Ac([Dc]);const rg=(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)(og,t))}),"withDuotoneControls"),lg=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!u)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),f=c()(null==t?void 0:t.className,p),h=(0,s.useContext)(fm.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,h&&(0,s.createPortal)((0,s.createElement)(ng,{selector:m,id:p,values:tg(u)}),h),(0,s.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",rg),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",lg);const ig="__experimentalLayout";function sg(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=mo("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,ig,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:g}=c;if(!d)return null;const v=l||g||{},{inherit:b=!1,type:k="default"}=v;if("default"===k&&!a)return null;const _=Io(k),y=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(er,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Layout")},f&&!!i&&(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Inherit default layout"),checked:!!b,onChange:()=>t({layout:{inherit:!b}})}),!b&&u&&(0,s.createElement)(ag,{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 ag(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Bo.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const cg=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,ig)&&(0,s.createElement)(sg,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),ug=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,ig),a=(0,d.useInstanceId)(e),u=mo("layout")||{},p=(0,s.useContext)(fm.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,ig)||{},h=null!=m&&m.inherit?u:m||f||{},g=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l});return(0,s.createElement)(s.Fragment,null,l&&p&&(0,s.createPortal)((0,s.createElement)(Mo,{selector:`.wp-container-${a}`,layout:h,style:null==o?void 0:o.style}),p),(0,s.createElement)(e,i({},t,{className:g})))}));(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,ig)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",ug),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",cg);const dg=[];function pg(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},l=Bm("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:Kh({border:r})}}function mg(e){const t=mo("color.palette")||dg,n=pg(e);if(e.borderColor){const o=Sm(t,e.borderColor);n.style.borderColor=o.color}return n}function fg(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Bm("background-color",s),m=Bm("color",a),f=rf(u),h=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!h&&!!p,"has-text-color":a||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":s||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:Kh({color:(null==d?void 0:d.color)||{}})}}const hg={};function gg(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=mo("color.palette.custom")||[],l=mo("color.palette.theme")||[],i=mo("color.palette.default")||[],a=mo("color.gradients")||hg,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=fg(e);if(t){const e=Sm(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=lf(u,o)),n){const e=Sm(c,n);d.style.color=e.color}return d}function vg(e){const{style:t}=e;return{style:Kh({spacing:(null==t?void 0:t.spacing)||{}})}}function bg(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const kg=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),_g=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=mo("color.palette.custom"),o=mo("color.palette.theme"),r=mo("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function yg(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=Rc(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=wm(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=Sm(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:Bm(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Eg(e){return function(){const t=kg(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(yg(o,t),"withCustomColors")}}function Cg(){const e=_g();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(yg(n,e),"withColors")}const Sg=[];var wg=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=mo("typography.fontSizes")||Sg;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=Yf(r,l,n[t]);return e[o]={...i,class:Xf(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},Bg=(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"})),Ig=(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"})),xg=(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 Tg=[{icon:Bg,title:(0,h.__)("Align text left"),align:"left"},{icon:Ig,title:(0,h.__)("Align text center"),align:"center"},{icon:xg,title:(0,h.__)("Align text right"),align:"right"}],Ng={position:"bottom right",isAlternate:!0};var Pg=function(e){let{value:t,onChange:n,alignmentControls:o=Tg,label:r=(0,h.__)("Align"),describedBy:l=(0,h.__)("Change text alignment"),isCollapsed:a=!0,isToolbar:c}=e;function d(e){return()=>n(t===e?void 0:e)}const m=(0,u.find)(o,(e=>e.align===t)),f=c?p.ToolbarGroup:p.ToolbarDropdownMenu,g=c?{isCollapsed:a}:{};return(0,s.createElement)(f,i({icon:m?m.icon:(0,h.isRTL)()?xg:Bg,label:r,toggleProps:{describedBy:l},popoverProps:Ng,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},g))};function Mg(e){return(0,s.createElement)(Pg,i({},e,{isToolbar:!1}))}function Rg(e){return(0,s.createElement)(Pg,i({},e,{isToolbar:!0}))}var Lg={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(zn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=Iu(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?Xu(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)(Ga,{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))}}};const Ag=[];function Dg(e){let{completers:t=Ag}=e;const{name:n}=Un();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Lg])),(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 Og=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:Dg(e)}))},Fg=(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"})),zg=function(e){let{isActive:t,label:n=(0,h.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:Fg,label:n,onClick:()=>o(!t),disabled:r})},Vg=function(e){const{label:t=(0,h.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o}),i="block-editor-block-alignment-matrix-control",a=`${i}__popover`;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:i,popoverProps:{className:a,isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,s.createElement)(p.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==va.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},Hg=(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"})),Gg=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(zn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(zn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,h.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,h.__)("Block breadcrumb")},(0,s.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,s.createElement)(wo,{icon:Hg,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)(Dd,{clientId:e})),(0,s.createElement)(wo,{icon:Hg,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Dd,{clientId:r})))};function Ug(e){let{clientId:t,tagName:n="div",wrapperProps:o,className:r}=e;const[l,a]=(0,s.useState)(!0),[u,d]=(0,s.useState)(!1),{isParentSelected:p,hasChildSelected:f,isDraggingBlocks:h,isParentHighlighted:g}=(0,m.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l}=e(zn);return{isParentSelected:n(t),hasChildSelected:o(t,!0),isDraggingBlocks:r(),isParentHighlighted:l(t)}}),[t]),v=c()("block-editor-block-content-overlay",null==o?void 0:o.className,r,{"overlay-active":l,"parent-highlighted":g,"is-dragging-blocks":h});return(0,s.useEffect)((()=>{p||f||l||a(!0),p&&!u&&l&&a(!1),f&&l&&a(!1)}),[p,f,l,u]),(0,s.createElement)(n,i({},o,{className:v,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onMouseUp:l?()=>a(!1):void 0}),null==o?void 0:o.children)}const Wg=()=>(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"})),$g=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)(Wg,null)))},jg=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,h.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==va.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)($g,null)))}))}};var Kg=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:jg(n),renderContent:()=>t})},qg=(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 Yg=na(p.__experimentalTreeGridRow);function Zg(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)(Yg,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function Xg(e){let{onClick:t}=e;return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,s.createElement)(wo,{icon:Hg}))}var Qg=(0,s.forwardRef)((function e(t,n){let{className:o,block:{clientId:r},isSelected:l,onClick:i,onToggleExpanded:a,position:u,siblingBlockCount:m,level:f,tabIndex:g,onFocus:v,onDragStart:b,onDragEnd:k,draggable:_}=t;const y=Ad(r),E=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,C=((e,t,n)=>(0,h.sprintf)(
|
67 |
/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
|
68 |
-
(0,
|
69 |
-
(0,
|
70 |
-
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var fv=(0,s.forwardRef)((function(e,t){let{isDisabled:n,__experimentalFeatures:o,...r}=e;const l=(0,m.useSelect)((e=>!!e(zn).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)(mv,i({},r,{innerRef:t,isOpen:n,onToggle:o,isEnabled:l}))},renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,h.__)("List view")),(0,s.createElement)(pv,{showNestedBlocks:!0,__experimentalFeatures:o}))})}));function hv(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=cp(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)(hu,{item:i,isStylePreview:!0})}function gv(e){let{children:t,scope:n,...o}=e;return(0,s.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,s.createElement)("div",o,t))}function vv(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}),[h,g]=(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)}),[h]),!i||0===i.length)return null;const _=(0,u.debounce)(g,250),y=e=>{l(e),o(null),g(null),_.cancel()},E=e=>{var t;h!==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=>{va.ENTER!==t.keyCode&&va.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))}))),h&&!k&&(0,s.createElement)(gv,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>E(null)},(0,s.createElement)(hv,{activeStyle:a,className:f,genericPreviewBlock:m,style:h})))}vv.Slot=function(e){let{scope:t}=e;return(0,s.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var bv=vv,kv=(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"})),_v=function(e){let{icon:t=kv,label:n=(0,h.__)("Choose variation"),instructions:o=(0,h.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const a=c()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,s.createElement)(p.Placeholder,{icon:t,label:n,instructions:o,className:a},(0,s.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,h.__)("Block variations")},r.map((e=>(0,s.createElement)("li",{key:e.name},(0,s.createElement)(p.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,s.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title))))),i&&(0,s.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,s.createElement)(p.Button,{variant:"link",onClick:()=>l()},(0,h.__)("Skip"))))},yv=(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 Ev="carousel",Cv="grid",Sv=e=>{let{onStartBlank:t,onBlockPatternSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},(0,s.createElement)(p.Button,{onClick:t},(0,h.__)("Start blank")),(0,s.createElement)(p.Button,{variant:"primary",onClick:n},(0,h.__)("Choose")))},wv=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:Gd,label:(0,h.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:Hd,label:(0,h.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var Bv=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a,onStartBlank:c}=e;const u=t===Ev,d=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:to,label:(0,h.__)("Carousel view"),onClick:()=>n(Ev),isPressed:u}),(0,s.createElement)(p.Button,{icon:yv,label:(0,h.__)("Grid view"),onClick:()=>n(Cv),isPressed:t===Cv}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},u&&(0,s.createElement)(wv,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),d,u&&(0,s.createElement)(Sv,{onBlockPatternSelect:a,onStartBlank:c}))};const Iv=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===Ev){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)(Tv,{className:e.get(n)||"",key:t.name,pattern:t})))))}return(0,s.createElement)(p.__unstableComposite,i({},l,{role:"listbox",className:a,"aria-label":(0,h.__)("Patterns list")}),o.map((e=>(0,s.createElement)(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)(mu,{blocks:l,viewportWidth:u}),(0,s.createElement)("div",{className:`${r}__item-title`},a)),!!c&&(0,s.createElement)(p.VisuallyHidden,{id:m},c))}function Tv(e){let{className:t,pattern:n}=e;const{blocks:o,title:r,description:l}=n,i=(0,d.useInstanceId)(Tv,"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)(mu,{blocks:o,__experimentalLive:!0}),!!l&&(0,s.createElement)(p.VisuallyHidden,{id:i},l))}var Nv=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:l,onBlockPatternSelect:i}=e;const[a,c]=(0,s.useState)(Ev),[u,d]=(0,s.useState)(0),[p,f]=(0,s.useState)(!1),{replaceBlock:h}=(0,m.useDispatch)(zn),g=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(zn),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(t,n,o);if(null==g||!g.length||p)return l;const v=i||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));h(t,n)});return(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${a}`},(0,s.createElement)(Bv,{viewMode:a,setViewMode:c,activeSlide:u,totalSlides:g.length,handleNext:()=>{d((e=>e+1))},handlePrevious:()=>{d((e=>e-1))},onBlockPatternSelect:()=>{v(g[u].blocks)},onStartBlank:()=>{f(!0)}}),(0,s.createElement)(Iv,{viewMode:a,activeSlide:u,patterns:g,onBlockPatternSelect:v}))};const Pv=(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 Mv=function(e){let{blockClientId:t}=e;const[n,o]=(0,s.useState)(),{updateBlockAttributes:l}=(0,m.useDispatch)(zn),{variations:i,blockAttributes:a}=(0,m.useSelect)((e=>{const{getBlockVariations:n}=e(r.store),{getBlockName:o,getBlockAttributes:l}=e(zn),i=t&&o(t);return{variations:i&&n(i,"transform"),blockAttributes:l(t)}}),[t]);if((0,s.useEffect)((()=>{var e;o(null===(e=Pv(a,i))||void 0===e?void 0:e.name)}),[a,i]),null==i||!i.length)return null;const c=i.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}})),u=e=>{l(t,{...i.find((t=>{let{name:n}=t;return n===e})).attributes})},d="block-editor-block-variation-transforms";return(0,s.createElement)(p.DropdownMenu,{className:d,label:(0,h.__)("Transform to variation"),text:(0,h.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${d}__popover`},icon:Wd,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 Rv=(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"})),Lv=(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"})),Av={top:{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,h._x)("Align top","Block vertical alignment setting")},center:{icon:Lv,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Rv,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},Dv=["top","center","bottom"],Ov={isAlternate:!0};var Fv=function(e){let{value:t,onChange:n,controls:o=Dv,isCollapsed:r=!0,isToolbar:l}=e;const a=Av[t],c=Av.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:Ov,icon:a?a.icon:c.icon,label:(0,h._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...Av[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};function zv(e){return(0,s.createElement)(Fv,i({},e,{isToolbar:!1}))}function Vv(e){return(0,s.createElement)(Fv,i({},e,{isToolbar:!0}))}var Hv=(0,d.createHigherOrderComponent)((e=>t=>{const n=mo("color.palette"),o=!mo("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"),Gv=Hv(p.ColorPalette);function Uv(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(_m,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var Wv=function(e,t){return(Wv=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)},$v=function(){return($v=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 jv(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 Kv(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:qv(e.x,i,n.width,o),y:qv(e.y,s,n.height,o)}}function qv(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function Yv(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function Zv(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function Xv(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?Qv:Jv,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:$v($v({},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 Qv(e,t){return Math.min(e,Math.max(0,t))}function Jv(e,t){return t}function eb(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 tb(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function nb(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=[nb(0,0,o,r,n),nb(e,0,o,r,n),nb(e,t,o,r,n),nb(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 rb(){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 lb=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=eb(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:jv(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=$v({},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?Kv(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?Kv(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=Xv(n.props.restrictPosition?Kv(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?Kv(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}Wv(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=Yv(n,o),this.lastPinchRotation=Zv(n,o),this.onDragStart(tb(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=tb(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=Yv(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=Zv(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,h=p.mediaStyle,g=t.classes,v=g.containerClassName,b=g.cropAreaClassName,k=g.mediaClassName;return Ur().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:rb("reactEasyCrop_Container",v)},n?Ur().createElement("img",$v({alt:"",className:rb("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:$v($v({},h),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&Ur().createElement("video",$v({autoPlay:!0,loop:!0,muted:!0,className:rb("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:$v($v({},h),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&Ur().createElement("div",{style:$v($v({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:rb("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}(Ur().Component);const ib={position:"bottom right",isAlternate:!0};var sb=window.wp.apiFetch,ab=n.n(sb);const cb=(0,s.createContext)({}),ub=()=>(0,s.useContext)(cb);function db(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,h]=(0,s.useState)(),[g,v]=(0,s.useState)(),[b,k]=(0,s.useState)(),_=(0,s.useCallback)((()=>{d({x:0,y:0}),m(100),h(0),v(n/o),k(n/o)}),[n,o,d,m,h,v,k]),y=(0,s.useCallback)((()=>{const e=(f+90)%360;let r=n/o;if(f%180==90&&(r=o/n),0===e)return i(),h(e),v(1/g),void d({x:-u.y*r,y:u.x*r});const s=new window.Image;s.src=t,s.onload=function(t){const n=document.createElement("canvas");let o=0,l=0;e%180?(n.width=t.target.height,n.height=t.target.width):(n.width=t.target.width,n.height=t.target.height),90!==e&&180!==e||(o=n.width),270!==e&&180!==e||(l=n.height);const s=n.getContext("2d");s.translate(o,l),s.rotate(e*Math.PI/180),s.drawImage(t.target,0,0),n.toBlob((t=>{i(URL.createObjectURL(t)),h(e),v(1/g),d({x:-u.y*r,y:u.x*r})}))};const a=(0,l.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof a&&(s.crossOrigin=a)}),[f,n,o,i,h,v,d]);return(0,s.useMemo)((()=>({editedUrl:r,setEditedUrl:i,crop:a,setCrop:c,position:u,setPosition:d,zoom:p,setZoom:m,rotation:f,setRotation:h,rotateClockwise:y,aspect:g,setAspect:v,defaultAspect:b,initializeTransformValues:_})),[r,i,a,c,u,d,p,m,f,h,y,g,v,b,_])}(e),{initializeTransformValues:o}=n;return(0,s.useEffect)((()=>{t&&o()}),[t,o]),n}({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)(Mu.store),[p,f]=(0,s.useState)(!1),g=(0,s.useCallback)((()=>{f(!1),u()}),[f,u]),v=(0,s.useCallback)((()=>{f(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,ab()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{c({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,h.sprintf)(
|
|
|
|
|
|
|
71 |
/* translators: 1. Error message */
|
72 |
-
(0,h.__)("Could not edit image. %s"),e.message),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{f(!1),u()}))}),[f,t,n,o,r,l,i,c,d,f,u]);return(0,s.useMemo)((()=>({isInProgress:p,apply:v,cancel:g})),[p,v,g])}({id:t,url:n,onSaveImage:c,onFinishEditing:a,...d}),f=(0,s.useMemo)((()=>({...d,...p})),[d,p]);return(0,s.createElement)(cb.Provider,{value:f},u)}function pb(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;const{isInProgress:a,editedUrl:u,position:d,zoom:m,aspect:f,setPosition:h,setCrop:g,setZoom:v,rotation:b}=ub();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)(lb,{image:u||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:f,onCropChange:h,onCropComplete:e=>{g(e)},onZoomChange:e=>{v(100*e)}}),a&&(0,s.createElement)(p.Spinner,null))}var mb=(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 fb(){const{isInProgress:e,zoom:t,setZoom:n}=ub();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:ib,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(p.ToolbarButton,{icon:mb,label:(0,h.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,h.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var 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 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 gb(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?ip:void 0},t)})))}function vb(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=ub();return(0,s.createElement)(p.DropdownMenu,{icon:hb,label:(0,h.__)("Aspect Ratio"),popoverProps:ib,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(gb,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("Original"),aspect:l},{title:(0,h.__)("Square"),aspect:1}]}),(0,s.createElement)(gb,{label:(0,h.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("16:10"),aspect:1.6},{title:(0,h.__)("16:9"),aspect:16/9},{title:(0,h.__)("4:3"),aspect:4/3},{title:(0,h.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(gb,{label:(0,h.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,h.__)("10:16"),aspect:.625},{title:(0,h.__)("9:16"),aspect:9/16},{title:(0,h.__)("3:4"),aspect:3/4},{title:(0,h.__)("2:3"),aspect:2/3}]}))}))}var bb=(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 kb(){const{isInProgress:e,rotateClockwise:t}=ub();return(0,s.createElement)(p.ToolbarButton,{icon:bb,label:(0,h.__)("Rotate"),onClick:t,disabled:e})}function _b(){const{isInProgress:e,apply:t,cancel:n}=ub();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,h.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,h.__)("Cancel")))}function yb(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)(pb,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,s.createElement)(Yn,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(fb,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(vb,{toggleProps:e}))),(0,s.createElement)(kb,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(_b,null))))}const Eb=[25,50,75,100];function Cb(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:a,onChange:c,onChangeImage:d=u.noop}=e;const{currentHeight:m,currentWidth:f,updateDimension:g,updateDimensions:v}=function(e,t,n,o,r){var l,i;const[a,c]=(0,s.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,s.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,s.useEffect)((()=>{void 0===t&&void 0!==o&&c(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,s.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&c(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{"width"===e?c(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),c(null!=t?t:o),r({height:e,width:t})}}}(a,i,n,t,c);return(0,s.createElement)(s.Fragment,null,!(0,u.isEmpty)(o)&&(0,s.createElement)(p.SelectControl,{label:(0,h.__)("Image size"),value:l,options:o,onChange:d}),r&&(0,s.createElement)("div",{className:"block-editor-image-size-control"},(0,s.createElement)("p",{className:"block-editor-image-size-control__row"},(0,h.__)("Image dimensions")),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,h.__)("Width"),value:f,min:1,onChange:e=>g("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,h.__)("Height"),value:m,min:1,onChange:e=>g("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,h.__)("Image size presets")},Eb.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=f===o&&m===r;return(0,s.createElement)(p.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>v(r,o)},e,"%")}))),(0,s.createElement)(p.Button,{isSmall:!0,onClick:()=>v()},(0,h.__)("Reset")))))}var Sb=(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"})),wb=e=>{let{value:t,onChange:n=u.noop,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,s.createElement)(p.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,s.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,h.__)("Currently selected link settings")),l)};class Bb 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,ya()(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,id.isURL)(t)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const l=n(t,{isInitialSuggestions:r});l.then((e=>{this.suggestionsRequest===l&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,h.sprintf)(
|
73 |
/* translators: %s: number of results. */
|
74 |
-
(0,
|
75 |
/* translators: %s: search term. */
|
76 |
-
(0,
|
77 |
/* translators: %s: search term. */
|
78 |
-
(0,h.__)('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&&Pb===e.type?(0,s.createElement)(xb,{searchTerm:o,buttonText:g,onClick:()=>r(e),key:e.type,itemProps:a(e,t),isSelected:t===d}):Pb===e.type?null:(0,s.createElement)(Nb,{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 Lb(e){const t=(0,u.startsWith)(e,"#");return(0,id.isURL)(e)||e&&e.includes("www.")||t}const Ab=()=>Promise.resolve([]),Db=e=>{let t="URL";const n=(0,id.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,id.prependHTTP)(e):e,type:t}])};const Ob=()=>Promise.resolve([]),Fb=(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:g=u.noop,showSuggestions:v=!0,renderSuggestions:b=(e=>(0,s.createElement)(Rb,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(zn);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?Db:Ab;return(0,s.useCallback)(((t,s)=>{let{isInitialSuggestions:a}=s;return Lb(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||Lb(e)||!r?c:c.concat({title:e,url:e,type:Pb})})(t,{...e,isInitialSuggestions:a},r,i,n,o,l)}),[i,r,n])}(E,_,a,C),I=v?k||B:Ob,x=(0,d.useInstanceId)(Fb),[T,N]=(0,s.useState)(),P=async e=>{let t=e;if(Pb!==e.type)(_||t&&Object.keys(t).length>=1)&&g({...(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&&g(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)(Ib,{label:w?"URL":void 0,className:M,value:n,onChange:(e,t)=>{f(e),N(t)},placeholder:null!=i?i:(0,h.__)("Search or type url"),__experimentalRenderSuggestions:v?e=>b({...e,instanceId:x,withCreateSuggestion:a,currentInputValue:n,createSuggestionButtonText:S,suggestionsQuery:E,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),P(t)}}):null,__experimentalFetchLinkSuggestions:I,__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 zb=Fb,Vb=(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"})),Hb=(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:Gb,Fill:Ub}=(0,p.createSlotFill)("BlockEditorLinkControlViewer");function Wb(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 $b(e){let{value:t,onEditClick:n,hasRichPreviews:o=!1,hasUnlinkControl:r=!1,onRemove:l}=e;const i=o?null==t?void 0:t.url:null,{richData:a,isFetching:u}=function(e){const[t,n]=(0,s.useReducer)(Wb,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);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}(i),d=a&&Object.keys(a).length,f=t&&(0,id.filterURLForDisplay)((0,id.safeDecodeURI)(t.url),16)||"",g=(null==a?void 0:a.title)||(null==t?void 0:t.title)||f,v=!t.url.length;let b;return b=null!=a&&a.icon?(0,s.createElement)("img",{src:null==a?void 0:a.icon,alt:""}):v?(0,s.createElement)(wo,{icon:Vb,size:32}):(0,s.createElement)(wo,{icon:Tb}),(0,s.createElement)("div",{"aria-label":(0,h.__)("Currently selected"),"aria-selected":"true",className:c()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":d,"is-fetching":!!u,"is-preview":!0,"is-error":v})},(0,s.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:c()("block-editor-link-control__search-item-icon",{"is-image":null==a?void 0:a.icon})},b),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-details"},v?(0,s.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,h.__)("Link is empty")):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ExternalLink,{className:"block-editor-link-control__search-item-title",href:t.url},(0,rr.__unstableStripHTML)(g)),(null==t?void 0:t.url)&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-info"},f)))),(0,s.createElement)(p.Button,{icon:Hb,label:(0,h.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:n,iconSize:24}),r&&(0,s.createElement)(p.Button,{icon:zm,label:(0,h.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:l,iconSize:24}),(0,s.createElement)(Gb,{fillProps:t})),(d&&((null==a?void 0:a.image)||(null==a?void 0:a.description))||u)&&(0,s.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==a?void 0:a.image)||u)&&(0,s.createElement)("div",{"aria-hidden":!(null!=a&&a.image),className:c()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=a&&a.image)})},(null==a?void 0:a.image)&&(0,s.createElement)("img",{src:null==a?void 0:a.image,alt:""})),((null==a?void 0:a.description)||u)&&(0,s.createElement)("div",{"aria-hidden":!(null!=a&&a.description),className:c()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=a&&a.description)})},(null==a?void 0:a.description)&&(0,s.createElement)(p.__experimentalText,{truncate:!0,numberOfLines:"2"},a.description))))}function jb(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=Mb,onChange:a=u.noop,onRemove:d,noDirectEntry:m=!1,showSuggestions:f=!0,showInitialSuggestions:g,forceIsEditingLink:v,createSuggestion:b,withCreateSuggestion:k,inputValue:_="",suggestionsQuery:y={},noURLSuggestion:E=!1,createSuggestionButtonText:C,hasRichPreviews:S=!1,hasTextControl:w=!1,renderControlBottom:B=null}=e;void 0===k&&b&&(k=!0);const I=(0,s.useRef)(!0),x=(0,s.useRef)(),T=(0,s.useRef)(),[N,P]=(0,s.useState)((null==l?void 0:l.url)||""),[M,R]=(0,s.useState)((null==l?void 0:l.title)||""),L=_||N,[A,D]=(0,s.useState)(void 0!==v?v:!l||!l.url),O=(0,s.useRef)(!1),F=!(null!=L&&null!==(t=L.trim())&&void 0!==t&&t.length);function z(){var e;O.current=!(null===(e=x.current)||void 0===e||!e.contains(x.current.ownerDocument.activeElement)),D(!1)}(0,s.useEffect)((()=>{void 0!==v&&v!==A&&D(v)}),[v]),(0,s.useEffect)((()=>{if(I.current)return void(I.current=!1);const e=null!=T&&T.current?1:0;(rr.focus.focusable.find(x.current)[e]||x.current).focus(),O.current=!1}),[A]),(0,s.useEffect)((()=>{null!=l&&l.title&&l.title!==M&&R(l.title),null!=l&&l.url&&P(l.url)}),[l]);const{createPage:V,isCreatingPage:H,errorMessage: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,h.__)("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:x,className:"block-editor-link-control"},H&&(0,s.createElement)("div",{className:"block-editor-link-control__loading"},(0,s.createElement)(p.Spinner,null)," ",(0,h.__)("Creating"),"…"),(A||!l)&&!H&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:c()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":j})},j&&(0,s.createElement)(p.TextControl,{ref:T,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:M,onChange:R,onKeyDown:e=>{const{keyCode:t}=e;t!==va.ENTER||F||(e.preventDefault(),U())}}),(0,s.createElement)(zb,{currentLink:l,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:L,withCreateSuggestion:k,onCreateSuggestion:V,onChange:P,onSelect:e=>{a({...e,title:M||(null==e?void 0:e.title)}),z()},showInitialSuggestions:g,allowDirectEntry:!m,showSuggestions:f,suggestionsQuery:y,withURLSuggestion:!E,createSuggestionButtonText:C,useLabel:j},(0,s.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,s.createElement)(p.Button,{onClick:U,label:(0,h.__)("Submit"),icon:Sb,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)($b,{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)(wb,{value:l,settings:i,onChange:a})),B&&B())}jb.ViewerFill=Ub;var Kb=jb,qb=(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"})),Yb=(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"})),Zb=(0,p.withFilters)("editor.MediaUpload")((()=>null)),Xb=function(e){let{fallback:t=null,children:n}=e;return(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return!!t().mediaUpload}),[])?n:t},Qb=(0,d.compose)([(0,m.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Mu.store);return{createNotice:t,removeNotice:n}})),(0,p.withFilters)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:o,allowedTypes:r,accept:l,onSelect:i,onSelectURL:a,onFilesUpload:c=u.noop,onCloseModal:d=u.noop,name:f=(0,h.__)("Replace"),createNotice:g,removeNotice:v,children:b,multiple:k=!1,addToGallery:_,handleUpload:y=!0}=e;const[E,C]=(0,s.useState)(t),S=(0,m.useSelect)((e=>e(zn).getSettings().mediaUpload),[]),w=(0,s.createRef)(),B=(0,u.uniqueId)("block-editor/media-replace-flow/error-notice/"),I=e=>{const t=document.createElement("div");t.innerHTML=(0,s.renderToString)(e);const n=t.textContent||t.innerText||"";setTimeout((()=>{g("error",n,{speak:!0,id:B,isDismissible:!0})}),1e3)},x=(e,t)=>{t(),C(e.url),i(e),(0,Nt.speak)((0,h.__)("The media file has been replaced")),v(B)},T=e=>{e.keyCode===va.DOWN&&(e.preventDefault(),e.target.click())},N=k&&!(!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:w,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:T},f)},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)(Zb,{gallery:N,addToGallery:_,multiple:k,value:k?o:n,onSelect:e=>x(e,t),allowedTypes:r,onClose:d,render:e=>{let{open:t}=e;return(0,s.createElement)(p.MenuItem,{icon:qb,onClick:t},(0,h.__)("Open Media Library"))}}),(0,s.createElement)(Xb,null,(0,s.createElement)(p.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!y)return t(),i(n);c(n),S({allowedTypes:r,filesList:n,onFileChange:e=>{let[n]=e;x(n,t)},onError:I})})(e,t)},accept:l,multiple:k,render:e=>{let{openFileDialog:t}=e;return(0,s.createElement)(p.MenuItem,{icon:Yb,onClick:()=>{t()}},(0,h.__)("Upload"))}})),b),a&&(0,s.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,s.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,h.__)("Current media URL:")),(0,s.createElement)(Kb,{value:{url:E},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;C(t),a(t),w.current.focus()}})))}})}));function Jb(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,id.filterURLForDisplay)((0,id.safeDecodeURI)(t))):(0,s.createElement)("span",{className:r})}function ek(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:Wd,label:(0,h.__)("Link settings"),onClick:()=>{u(!c)},"aria-expanded":c})),d&&(0,s.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},o())),t&&!d&&(0,s.createElement)("div",{className:"block-editor-url-popover__additional-controls"},t))}ek.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:o,value:r,...l}=e;return(0,s.createElement)("form",i({className:c()("block-editor-url-popover__link-editor",n)},l),(0,s.createElement)(Ib,{value:r,onChange:o,autocompleteRef:t}),(0,s.createElement)(p.Button,{icon:Sb,label:(0,h.__)("Apply"),type:"submit"}))},ek.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:o,url:r,urlLabel:l,...a}=e;return(0,s.createElement)("div",i({className:c()("block-editor-url-popover__link-viewer",t)},a),(0,s.createElement)(Jb,{url:r,urlLabel:l,className:n}),o&&(0,s.createElement)(p.Button,{icon:Hb,label:(0,h.__)("Edit"),onClick:o}))};var tk=ek;const nk=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,s.createElement)(tk,{onClose:r},(0,s.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o},(0,s.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,h.__)("URL"),placeholder:(0,h.__)("Paste or type URL"),onChange:n,value:t}),(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:Sb,label:(0,h.__)("Apply"),type:"submit"})))};var ok=(0,p.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:l={},mediaPreview:i,notices:a,isAppender:d,accept:f,addToGallery:g,multiple:v=!1,handleUpload:b=!0,dropZoneUIOnly:k,disableDropZone:_,disableMediaButtons:y,onError:E,onSelect:C,onCancel:S,onSelectURL:w,onDoubleClick:B,onFilesPreUpload:I=u.noop,onHTMLDrop:x=u.noop,onClose:T=u.noop,children:N,mediaLibraryButton:P,placeholder:M,style:R}=e;const L=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return t().mediaUpload}),[]),[A,D]=(0,s.useState)(""),[O,F]=(0,s.useState)(!1);(0,s.useEffect)((()=>{var e;D(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const z=e=>{D(e.target.value)},V=()=>{F(!0)},H=()=>{F(!1)},G=e=>{e.preventDefault(),A&&w&&(w(A),H())},U=e=>{if(!b)return C(e);let o;if(I(e),v)if(g){let e=[];o=n=>{const o=(null!=t?t:[]).filter((t=>t.id?!e.some((e=>{let{id:n}=e;return Number(n)===Number(t.id)})):!e.some((e=>{let{urlSlug:n}=e;return t.url.includes(n)}))));C(o.concat(n)),e=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=C;else o=e=>{let[t]=e;return C(t)};L({allowedTypes:n,filesList:e,onFileChange:o,onError:E})},W=e=>{U(e.target.files)},$=null!=M?M:e=>{let{instructions:t,title:u}=l;if(L||w||(t=(0,h.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===u){const e=null!=n?n:[],[o]=e,r=1===e.length,l=r&&"audio"===o,i=r&&"image"===o,s=r&&"video"===o;void 0===t&&L&&(t=(0,h.__)("Upload a media file or pick one from your media library."),l?t=(0,h.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?t=(0,h.__)("Upload an image file, pick one from your media library, or add one with a URL."):s&&(t=(0,h.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===u&&(u=(0,h.__)("Media"),l?u=(0,h.__)("Audio"):i?u=(0,h.__)("Image"):s&&(u=(0,h.__)("Video")))}const m=c()("block-editor-media-placeholder",o,{"is-appender":d});return(0,s.createElement)(p.Placeholder,{icon:r,label:u,instructions:t,className:m,notices:a,onDoubleClick:B,preview:i,style:R},e,N)},j=()=>_?null:(0,s.createElement)(p.DropZone,{onFilesDrop:U,onHTMLDrop:x}),K=()=>S&&(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,h.__)("Cancel"),variant:"link",onClick:S},(0,h.__)("Cancel")),q=()=>w&&(0,s.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__button",onClick:V,isPressed:O,variant:"tertiary"},(0,h.__)("Insert from URL")),O&&(0,s.createElement)(nk,{src:A,onChange:z,onSubmit:G,onClose:H}));return k||y?(k&&Rt()("wp.blockEditor.MediaPlaceholder dropZoneUIOnly prop",{since:"5.4",alternative:"disableMediaButtons"}),(0,s.createElement)(Xb,null,j())):(0,s.createElement)(Xb,{fallback:$(q())},(()=>{const e=null!=P?P:e=>{let{open:t}=e;return(0,s.createElement)(p.Button,{variant:"tertiary",onClick:()=>{t()}},(0,h.__)("Media Library"))},o=(0,s.createElement)(Zb,{addToGallery:g,gallery:v&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:v,onSelect:C,onClose:T,allowedTypes:n,value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(L&&d)return(0,s.createElement)(s.Fragment,null,j(),(0,s.createElement)(p.FormFileUpload,{onChange:W,accept:f,multiple:v,render:e=>{let{openFileDialog:t}=e;const n=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,h.__)("Upload")),o,q(),K());return $(n)}}));if(L){const e=(0,s.createElement)(s.Fragment,null,j(),(0,s.createElement)(p.FormFileUpload,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:W,accept:f,multiple:v},(0,h.__)("Upload")),o,q(),K());return $(e)}return $(o)})())})),rk=e=>{let{colorSettings:t,...n}=e;const o=t.map((e=>{if(!e)return e;const{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}}));return(0,s.createElement)(vf,i({settings:o,gradients:[],disableCustomGradients:!0},n))};const lk={position:"bottom right",isAlternate:!0};var ik=()=>(0,s.createElement)(s.Fragment,null,["bold","italic","link"].map((e=>(0,s.createElement)(p.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,s.createElement)(p.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((e=>{let[{props:t}]=e;return t})).some((e=>{let{isActive:t}=e;return t}));return(0,s.createElement)(p.ToolbarItem,null,(n=>(0,s.createElement)(p.DropdownMenu,{icon:Wd
|
79 |
-
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,h.__)("More"),toggleProps:{...n,className:c()(n.className,{"is-pressed":t}),describedBy:(0,h.__)("Displays more block tools")},controls:(0,u.orderBy)(e.map((e=>{let[{props:t}]=e;return t})),"title"),popoverProps:lk})))}))),sk=e=>{let{inline:t,anchorRef:n}=e;return t?(0,s.createElement)(p.Popover,{noArrow:!0,position:"top center",focusOnMount:!1,anchorRef:n,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,s.createElement)("div",{className:"block-editor-rich-text__inline-format-toolbar-group"},(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(ik,null)))):(0,s.createElement)(Yn,{group:"inline"},(0,s.createElement)(ik,null))};function ak(){const{didAutomaticChange:e,getSettings:t}=(0,m.useSelect)(zn);return(0,d.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;n.defaultPrevented||o!==va.DELETE&&o!==va.BACKSPACE&&o!==va.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}function ck(e){return e.filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)})).map((e=>`<img src="${(0,Cp.createBlobURL)(e)}">`)).join("")}var uk=window.wp.shortcode;function dk(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function pk(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function mk(e){let{allowedFormats:t,formattingControls:n,disableFormats:o}=e;return o?mk.EMPTY_ARRAY:t||n?t||(Rt()("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats"}),n.map((e=>`core/${e}`))):void 0}function fk(e){let{value:t,pastedBlocks:n=[],onReplace:o,onSplit:r,onSplitMiddle:l,multilineTag:i}=e;if(!o||!r)return;const s=[],[a,c]=(0,Pt.split)(t),u=n.length>0;let d=-1;const p=(0,Pt.isEmpty)(a)&&!(0,Pt.isEmpty)(c);u&&(0,Pt.isEmpty)(a)||(s.push(r((0,Pt.toHTMLString)({value:a,multilineTag:i}),!p)),d+=1),u?(s.push(...n),d+=n.length):l&&s.push(l()),(u||l)&&(0,Pt.isEmpty)(c)||s.push(r((0,Pt.toHTMLString)({value:c,multilineTag:i}),p)),o(s,u?d:1,u?-1:0)}function hk(e,t){return t?(0,Pt.replace)(e,/\n+/g,Pt.__UNSTABLE_LINE_SEPARATOR):(0,Pt.replace)(e,new RegExp(Pt.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function gk(e){const t=(0,s.useRef)(e);return t.current=e,(0,d.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:l,value:i,formatTypes:s,tagName:a,onReplace:c,onSplit:u,onSplitMiddle:d,__unstableEmbedURLOnPaste:p,multilineTag:m,preserveWhiteSpace:f,pastePlainText:h}=t.current;if(!n)return void e.preventDefault();const{clipboardData:g}=e;let v="",b="";try{v=g.getData("text/plain"),b=g.getData("text/html")}catch(e){try{b=g.getData("Text")}catch(e){return}}if(b=function(e){return e.replace(/.*<!--StartFragment-->/s,"").replace(/<!--EndFragment-->.*/s,"")}(b),b=function(e){const t="<meta charset='utf-8'>";return e.startsWith(t)?e.slice(t.length):e}(b),e.preventDefault(),window.console.log("Received HTML:\n\n",b),window.console.log("Received plain text:\n\n",v),o)return void l((0,Pt.insert)(i,v));const k=s.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===i&&(e=n(i,{html:b,plainText:v})),e}),i);if(k!==i)return void l(k);const _=[...(0,rr.getFilesFromDataTransfer)(g)];if("true"===g.getData("rich-text")){const e=g.getData("rich-text-multi-line-tag")||void 0;let t=(0,Pt.create)({html:b,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:f});return t=hk(t,!!m),dk(t,i.activeFormats),void l((0,Pt.insert)(i,t))}if(h)return void l((0,Pt.insert)(i,(0,Pt.create)({text:v})));if(_&&_.length&&!b){const e=(0,r.pasteHandler)({HTML:ck(_),mode:"BLOCKS",tagName:a,preserveWhiteSpace:f});return window.console.log("Received items:\n\n",_),void(c&&(0,Pt.isEmpty)(i)?c(e):fk({value:i,pastedBlocks:e,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}let y=c&&u?"AUTO":"INLINE";var E;"AUTO"===y&&(0,Pt.isEmpty)(i)&&(E=v,(0,uk.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,Pt.isEmpty)(i)&&(0,id.isURL)(v.trim())&&(y="BLOCKS");const C=(0,r.pasteHandler)({HTML:b,plainText:v,mode:y,tagName:a,preserveWhiteSpace:f});if("string"==typeof C){let e=(0,Pt.create)({html:C});e=hk(e,!!m),dk(e,i.activeFormats),l((0,Pt.insert)(i,e))}else C.length>0&&(c&&(0,Pt.isEmpty)(i)?c(C,C.length-1,-1):fk({value:i,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}function vk(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,m.useDispatch)(zn),o=(0,s.useRef)(e);return o.current=e,(0,d.useRefEffect)((e=>{function l(){const{value:e,onReplace:t}=o.current;if(!t)return;const{start:l,text:i}=e;if(" "!==i.slice(l-1,l))return;const s=i.slice(0,l).trim(),a=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"prefix"===t})),c=(0,r.findTransform)(a,(e=>{let{prefix:t}=e;return s===t}));if(!c)return;const u=(0,Pt.toHTMLString)({value:(0,Pt.slice)(e,l,i.length)});t([c.transform(u)]),n()}function i(e){const{inputType:r,type:i}=e,{value:s,onChange:a,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==r&&"compositionend"!==i)return;c&&l&&l();const d=u.reduce(((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e}),function(e){const t="tales of gutenberg",{start:n,text:o}=e;return n<t.length||o.slice(n-t.length,n).toLowerCase()!==t?e:(0,Pt.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(s));d!==s&&(t(),a({...d,activeFormats:s.activeFormats}),n())}return e.addEventListener("input",i),e.addEventListener("compositionend",i),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function bk(e){const{__unstableMarkAutomaticChange:t}=(0,m.useDispatch)(zn),n=(0,s.useRef)(e);return n.current=e,(0,d.useRefEffect)((e=>{function o(e){if(e.defaultPrevented)return;const{removeEditorOnlyFormats:o,value:l,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c,onChange:u,disableLineBreaks:d,onSplitAtEnd:p}=n.current;if(e.keyCode!==va.ENTER)return;e.preventDefault();const m={...l};m.formats=o(l);const f=i&&s;if(i){const e=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"enter"===t})),n=(0,r.findTransform)(e,(e=>e.regExp.test(m.text)));n&&(i([n.transform({content:m.text})]),t())}if(c)e.shiftKey?d||u((0,Pt.insert)(m,"\n")):f&&(0,Pt.__unstableIsEmptyLine)(m)?fk({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c}):u((0,Pt.__unstableInsertLineSeparator)(m));else{const{text:t,start:n,end:o}=m,r=p&&n===o&&o===t.length;e.shiftKey||!f&&!r?d||u((0,Pt.insert)(m,"\n")):!f&&r?p():f&&fk({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function kk(e){return e(Pt.store).getFormatTypes()}mk.EMPTY_ARRAY=[];const _k=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function yk(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function Ek(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function Ck(e){let{formatTypes:t,onChange:n,onFocus:o,value:r,forwardedRef:l}=e;return t.map((e=>{const{name:t,edit:i}=e;if(!i)return null;const a=(0,Pt.getActiveFormat)(r,t);let c=void 0!==a;const d=(0,Pt.getActiveObject)(r),p=void 0!==d&&d.type===t;if("core/link"===t&&!(0,Pt.isCollapsed)(r)){const e=r.formats,t=(0,u.find)(e[r.start],{type:"core/link"}),n=(0,u.find)(e[r.end-1],{type:"core/link"});t&&n&&t===n||(c=!1)}return(0,s.createElement)(i,{key:t,isActive:c,activeAttributes:c&&a.attributes||{},isObjectActive:p,activeObjectAttributes:p&&d.attributes||{},value:r,onChange:n,onFocus:o,contentRef:l})}))}const Sk=(0,s.createContext)(),wk=(0,s.createContext)(),Bk=(0,s.forwardRef)((function e(t,n){let{children:o,tagName:l="div",value:a="",onChange:f,isSelected:h,multiline:g,inlineToolbar:v,wrapperClassName:b,autocompleters:k,onReplace:_,placeholder:y,allowedFormats:E,formattingControls:C,withoutInteractiveFormatting:S,onRemove:w,onMerge:B,onSplit:I,__unstableOnSplitAtEnd:x,__unstableOnSplitMiddle:T,identifier:N,preserveWhiteSpace:P,__unstablePastePlainText:M,__unstableEmbedURLOnPaste:R,__unstableDisableFormats:L,disableLineBreaks:A,unstableOnFocus:D,__unstableAllowPrefixTransformations:O,...F}=t;const z=(0,d.useInstanceId)(e);N=N||z,F=function(e){return(0,u.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef"])}(F);const V=(0,s.useRef)(),{clientId:H}=Un(),{selectionStart:G,selectionEnd:U,isSelected:W,disabled:$}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n,isMultiSelecting:o,hasMultiSelection:r}=e(zn),l=t(),i=n();let s;return void 0===h?s=l.clientId===H&&l.attributeKey===N:h&&(s=l.clientId===H),{selectionStart:s?l.offset:void 0,selectionEnd:s?i.offset:void 0,isSelected:s,disabled:o()||r()}})),{selectionChange:j}=(0,m.useDispatch)(zn),K=pk(g),q=mk({allowedFormats:E,formattingControls:C,disableFormats:L}),Y=!q||q.length>0;let Z=a,X=f;Array.isArray(a)&&(Z=r.children.toHTML(a),X=e=>f(r.children.fromDOM((0,Pt.__unstableCreateElement)(document,e).childNodes)));const Q=(0,s.useCallback)(((e,t)=>{j(H,N,e,t)}),[H,N]),{formatTypes:J,prepareHandlers:ee,valueHandlers:te,changeHandlers:ne,dependencies:oe}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:o,allowedFormats:r}=e;const l=(0,m.useSelect)(kk,[]),i=(0,s.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&_k.has(n))}))),[l,r,_k]),a=(0,m.useSelect)((e=>i.reduce(((o,r)=>(r.__experimentalGetPropsForEditableTreePreparation&&(o[r.name]=r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t})),o)),{})),[i,t,n]),c=(0,m.useDispatch)(),u=[],d=[],p=[],f=[];return i.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const o=a[e.name],r=e.__experimentalCreatePrepareEditableTree(o,{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(r):u.push(r);for(const e in o)f.push(o[e])}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(c,{richTextIdentifier:n,blockClientId:t})),p.push(e.__experimentalCreateOnChangeEditableValue({...a[e.name]||{},...o},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:i,prepareHandlers:u,valueHandlers:d,changeHandlers:p,dependencies:f}}({clientId:H,identifier:N,withoutInteractiveFormatting:S,allowedFormats:q});function re(e){return J.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,Pt.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:le,onChange:ie,ref:se}=(0,Pt.__unstableUseRichText)({value:Z,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;X(e),Object.values(ne).forEach((e=>{e(n,o)}))},selectionStart:G,selectionEnd:U,onSelectionChange:Q,placeholder:y,__unstableIsSelected:W,__unstableMultilineTag:K,__unstableDisableFormats:L,preserveWhiteSpace:P,__unstableDependencies:[...oe,l],__unstableAfterParse:function(e){return te.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:re,__unstableAddInvisibleFormats:function(e){return ee.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ae=function(e){return(0,p.__unstableUseAutocompleteProps)({...e,completers:Dg(e)})}({onReplace:_,completers:k,record:le,onChange:ie});!function(e){let{value:t}=e;const n=t.activeFormats&&!!t.activeFormats.length,{isCaretWithinFormattedText:o}=(0,m.useSelect)(zn),{enterFormattedText:r,exitFormattedText:l}=(0,m.useDispatch)(zn);(0,s.useEffect)((()=>{n?o()||r():o()&&l()}),[n])}({value:le}),function(e){let{html:t,value:n}=e;const o=(0,s.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:l}=(0,m.useDispatch)(zn);(0,s.useLayoutEffect)((()=>{if(o.current){if(o.current!==n.text){const e=window.setTimeout((()=>{l()}),1e3);return o.current=n.text,()=>{window.clearTimeout(e)}}l()}else o.current=n.text}),[t,r])}({html:Z,value:le});const ce=(0,s.useRef)(new Set),ue=(0,s.useRef)(new Set);function de(){V.current.focus()}const pe=l,me=(0,s.createElement)(s.Fragment,null,W&&(0,s.createElement)(Sk.Provider,{value:ce},(0,s.createElement)(wk.Provider,{value:ue},(0,s.createElement)(p.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:le,onChange:ie,onFocus:de}),(0,s.createElement)(Ck,{value:le,onChange:ie,onFocus:de,formatTypes:J,forwardedRef:V})))),W&&Y&&(0,s.createElement)(sk,{inline:v,anchorRef:V.current}),(0,s.createElement)(pe,i({role:"textbox","aria-multiline":!0,"aria-label":y},F,ae,{ref:(0,d.useMergeRefs)([ae.ref,F.ref,se,vk({value:le,onChange:ie,__unstableAllowPrefixTransformations:O,formatTypes:J,onReplace:_}),(0,d.useRefEffect)((e=>{function t(e){(va.isKeyboardEvent.primary(e,"z")||va.isKeyboardEvent.primary(e,"y")||va.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),yk(ce),Ek(ue),ak(),gk({isSelected:W,disableFormats:L,onChange:ie,value:le,formatTypes:J,tagName:l,onReplace:_,onSplit:I,onSplitMiddle:T,__unstableEmbedURLOnPaste:R,multilineTag:K,preserveWhiteSpace:P,pastePlainText:M}),bk({removeEditorOnlyFormats:re,value:le,onReplace:_,onSplit:I,onSplitMiddle:T,multilineTag:K,onChange:ie,disableLineBreaks:A,onSplitAtEnd:x}),V,n]),contentEditable:!$||void 0,suppressContentEditableWarning:!$,className:c()("block-editor-rich-text__editable",F.className,"rich-text"),onFocus:D,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===va.DELETE||t===va.BACKSPACE)){const{start:n,end:o,text:r}=le,l=t===va.BACKSPACE,i=le.activeFormats&&!!le.activeFormats.length;if(!(0,Pt.isCollapsed)(le)||i||l&&0!==n||!l&&o!==r.length)return;B&&B(!l),w&&(0,Pt.isEmpty)(le)&&l&&w(!l),e.preventDefault()}}})));if(!b)return me;Rt()("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div"});const fe=c()("block-editor-rich-text",b);return(0,s.createElement)("div",{className:fe},me)}));Bk.Content=e=>{let{value:t,tagName:n,multiline:o,...l}=e;Array.isArray(t)&&(t=r.children.toHTML(t));const i=pk(o);!t&&i&&(t=`<${i}></${i}>`);const a=(0,s.createElement)(s.RawHTML,null,t);return n?(0,s.createElement)(n,(0,u.omit)(l,["format"]),a):a},Bk.isEmpty=e=>!e||0===e.length;var Ik=Bk;const xk=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Ik,i({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));xk.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,s.createElement)(n,o,t)};var Tk=xk,Nk=(0,s.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,s.createElement)(Tk,i({ref:t},o));const{className:r,onChange:l,...a}=o;return(0,s.createElement)(Er.Z,i({ref:t,className:c()("block-editor-plain-text",r),onChange:e=>l(e.target.value)},a))}));function Pk(e){let{property:t,viewport:n,desc:o}=e;const r=(0,d.useInstanceId)(Pk),l=o||(0,h.sprintf)(
|
80 |
/* translators: 1: property name. 2: viewport name. */
|
81 |
-
(0,
|
82 |
/* translators: 'Label. Used to signify a layout property (eg: margin, padding) will apply uniformly to all screensizes.' */
|
83 |
-
label:(0,
|
84 |
/* translators: 'Toggle control label. Should the property be the same across all screen sizes or unique per screen size.'. %s property value for the control (eg: margin, padding...etc) */
|
85 |
-
(0,
|
86 |
-
/* translators: 'Help text for the responsive mode toggle control.' */return(0,s.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,s.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,s.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,s.createElement)(p.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:m,checked:!a,onChange:r,help:f}),(0,s.createElement)("div",{className:c()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&
|
87 |
-
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,
|
88 |
/* translators: button label text should, if possible, be under 16 characters. */
|
89 |
-
children:(0,
|
90 |
/* translators: %d: number of blocks */
|
91 |
-
(0,
|
92 |
/* translators: %d: number of words */
|
93 |
-
(0,h._n)("%d word","%d words",n),n))))}));function t_(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:o,styles:l}=(0,m.useSelect)((e=>{var n,o;const l=e(zn).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==l||null===(n=l.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(o=null==l?void 0:l.onChange)&&void 0!==o?o:null,styles:e(r.store).getBlockStyles(t)}}),[t]),i=(0,s.useMemo)((()=>[{label:(0,h.__)("Not set"),value:""},...l.map((e=>{let{label:t,name:n}=e;return{label:t,value:n}}))]),[l]),a=(0,s.useMemo)((()=>{var e;return null===(e=up(l))||void 0===e?void 0:e.name}),[l]),c=(0,s.useCallback)((e=>{o(t,e)}),[t,o]);return n&&n!==a?o&&(0,s.createElement)("div",{className:"default-style-picker__default-switcher"},(0,s.createElement)(p.SelectControl,{options:i,value:n||"",label:(0,h.__)("Default Style"),onChange:c})):null}const n_=e=>{let{clientId:t,blockName:n,hasBlockStyles:o}=e;const l=Ad(t);return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(Ua,l),(0,s.createElement)(Mv,{blockClientId:t}),o&&(0,s.createElement)("div",null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Styles")},(0,s.createElement)(bv,{scope:"core/block-inspector",clientId:t}),(0,r.hasBlockSupport)(n,"defaultStylePicker",!0)&&(0,s.createElement)(t_,{blockName:n}))),(0,s.createElement)(er.Slot,null),(0,s.createElement)(er.Slot,{__experimentalGroup:"typography",label:(0,h.__)("Typography")}),(0,s.createElement)(er.Slot,{__experimentalGroup:"dimensions",label:(0,h.__)("Dimensions")}),(0,s.createElement)(er.Slot,{__experimentalGroup:"border",label:(0,h.__)("Border")}),(0,s.createElement)("div",null,(0,s.createElement)(o_,null)),(0,s.createElement)(Qk,{key:"back"}))},o_=()=>{const e=(0,p.__experimentalUseSlot)(Jo.slotName);return Boolean(e.fills&&e.fills.length)?(0,s.createElement)(p.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,h.__)("Advanced"),initialOpen:!1},(0,s.createElement)(er.Slot,{__experimentalGroup:"advanced"})):null};var r_=e=>{let{showNoBlockSelectedMessage:t=!0}=e;const{count:n,hasBlockStyles:o,selectedBlockName:l,selectedBlockClientId:i,blockType:a}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o}=e(zn),{getBlockStyles:l}=e(r.store),i=t(),s=i&&o(i),a=s&&(0,r.getBlockType)(s),c=s&&l(s);return{count:n(),selectedBlockClientId:i,selectedBlockName:s,blockType:a,hasBlockStyles:c&&c.length>0}}),[]);if(n>1)return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(e_,null),(0,s.createElement)(er.Slot,null),(0,s.createElement)(er.Slot,{__experimentalGroup:"typography",label:(0,h.__)("Typography")}),(0,s.createElement)(er.Slot,{__experimentalGroup:"dimensions",label:(0,h.__)("Dimensions")}),(0,s.createElement)(er.Slot,{__experimentalGroup:"border",label:(0,h.__)("Border")}));const c=l===(0,r.getUnregisteredTypeHandlerName)();return a&&i&&!c?(0,s.createElement)(n_,{clientId:i,blockName:a.name,hasBlockStyles:o}):t?(0,s.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,h.__)("No block selected.")):null};function l_(e){let{children:t,__unstableContentRef:n,...o}=e;const r=(0,d.useViewportMatch)("medium"),l=(0,m.useSelect)((e=>e(zn).getSettings().hasFixedToolbar),[]),a=(0,tc.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:c,getBlockRootClientId:f}=(0,m.useSelect)(zn),{duplicateBlocks:h,removeBlocks:g,insertAfterBlock:v,insertBeforeBlock:b,clearSelectedBlock:k,moveBlocksUp:_,moveBlocksDown:y}=(0,m.useDispatch)(zn);return(0,s.createElement)("div",i({},o,{onKeyDown:function(e){if(a("core/block-editor/move-up",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));_(t,n)}}else if(a("core/block-editor/move-down",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));y(t,n)}}else if(a("core/block-editor/duplicate",e)){const t=c();t.length&&(e.preventDefault(),h(t))}else if(a("core/block-editor/remove",e)){const t=c();t.length&&(e.preventDefault(),g(t))}else if(a("core/block-editor/insert-after",e)){const t=c();t.length&&(e.preventDefault(),v((0,u.last)(t)))}else if(a("core/block-editor/insert-before",e)){const t=c();t.length&&(e.preventDefault(),b((0,u.first)(t)))}else if(a("core/block-editor/delete-multi-selection",e)){if(["INPUT","TEXTAREA"].includes(e.target.nodeName)||e.defaultPrevented)return;const t=c();t.length>1&&(e.preventDefault(),g(t))}else a("core/block-editor/unselect",e)&&c().length>1&&(e.preventDefault(),k(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges())}}),(0,s.createElement)(Pd,{__unstableContentRef:n},(l||!r)&&(0,s.createElement)(Up,{isFixed:!0}),(0,s.createElement)(Kp,{__unstableContentRef:n}),(0,s.createElement)(p.Popover.Slot,{name:"block-toolbar",ref:xd(n)}),t,(0,s.createElement)(p.Popover.Slot,{name:"__unstable-block-tools-after",ref:xd(n)})))}var i_=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:a,__experimentalFilterValue:c,onSelect:d=u.noop,shouldFocusBlock:p=!1}=e;const f=(0,m.useSelect)((e=>{const{getBlockRootClientId:t}=e(zn);return n||t(o)||void 0}),[o,n]);return(0,s.createElement)(bd,{onSelect:d,rootClientId:f,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalInsertionIndex:a,__experimentalFilterValue:c,shouldFocusBlock:p,ref:t})}));function s_(){return null}s_.Register=function(){const{registerShortcut:e}=(0,m.useDispatch)(tc.store);return(0,s.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,h.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,h.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,h.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,h.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,h.__)("Remove multiple selected blocks."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,h.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,h.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,h.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,h.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,h.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var a_=s_;function c_(){return Rt()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const u_=new Set([va.UP,va.RIGHT,va.DOWN,va.LEFT,va.ENTER,va.BACKSPACE]);function d_(){const e=(0,m.useSelect)((e=>e(zn).isTyping()),[]),{stopTyping:t}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,l;function i(e){const{clientX:n,clientY:o}=e;r&&l&&(r!==n||l!==o)&&t(),r=n,l=o}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}}),[e,t])}function p_(){const e=(0,m.useSelect)((e=>e(zn).isTyping())),{startTyping:t,stopTyping:n}=(0,m.useDispatch)(zn),o=d_(),r=(0,d.useRefEffect)((o=>{const{ownerDocument:r}=o,{defaultView:l}=r;if(e){let e;function t(t){const{target:o}=t;e=l.setTimeout((()=>{(0,rr.isTextField)(o)||n()}))}function i(e){const{keyCode:t}=e;t!==va.ESCAPE&&t!==va.TAB||n()}function s(){const e=l.getSelection();e.rangeCount>0&&e.getRangeAt(0).collapsed||n()}return o.addEventListener("focus",t),o.addEventListener("keydown",i),r.addEventListener("selectionchange",s),()=>{l.clearTimeout(e),o.removeEventListener("focus",t),o.removeEventListener("keydown",i),r.removeEventListener("selectionchange",s)}}function i(e){const{type:n,target:r}=e;(0,rr.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&u_.has(t)}(e))&&t()}return o.addEventListener("keypress",i),o.addEventListener("keydown",i),()=>{o.removeEventListener("keypress",i),o.removeEventListener("keydown",i)}}),[e,t,n]);return(0,d.useMergeRefs)([o,r])}var m_=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:p_()},t)};function f_(){return Rt()("PreserveScrollInReorder component",{since:"5.4",hint:"This behavior is now built-in the block list"}),null}const h_=-1!==window.navigator.userAgent.indexOf("Trident"),g_=new Set([va.UP,va.DOWN,va.LEFT,va.RIGHT]);function v_(){const e=(0,m.useSelect)((e=>e(zn).hasSelectedBlock()),[]);return(0,d.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,l,i;function s(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function a(e){l&&o.cancelAnimationFrame(l),l=o.requestAnimationFrame((()=>{c(e),l=null}))}function c(e){let{keyCode:r}=e;if(!m())return;const l=(0,rr.computeCaretRect)(o);if(!l)return;if(!i)return void(i=l);if(g_.has(r))return void(i=l);const s=l.top-i.top;if(0===s)return;const a=(0,rr.getScrollContainer)(t);if(!a)return;const c=a===n.body,u=c?o.scrollY:a.scrollTop,d=c?0:a.getBoundingClientRect().top,p=c?i.top/o.innerHeight:(i.top-d)/(o.innerHeight-d);if(0===u&&p<.75&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=l);const f=c?o.innerHeight:a.clientHeight;i.top+i.height>d+f||i.top<d?i=l:c?o.scrollBy(0,s):a.scrollTop+=s}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){m()&&(i=(0,rr.computeCaretRect)(o))}function m(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",s,!0),o.addEventListener("resize",s,!0),t.addEventListener("keydown",a),t.addEventListener("keyup",c),t.addEventListener("mousedown",u),t.addEventListener("touchstart",u),()=>{o.removeEventListener("scroll",s,!0),o.removeEventListener("resize",s,!0),t.removeEventListener("keydown",a),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(l)}}),[e])}var b_=h_?e=>e.children:function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:v_(),className:"block-editor__typewriter"},t)};const k_=(0,s.createContext)({});function y_(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}function E_(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=(0,s.useContext)(k_),{name:r}=Un();n=n||r;const l=Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e)),i=(0,s.useMemo)((()=>y_(o,n,e)),[o,n,e]),a=(0,s.useCallback)((e=>{let{children:t}=e;return(0,s.createElement)(k_.Provider,{value:i},t)}),[i]);return[l,a]}function C_(e){if(void 0===e)e=v.colors;else{const t=e.filter((e=>e.color));0===t.length?e=v.colors:t.length<e.length&&(e=t)}return e}function S_(e){if(void 0===e)e=v.gradients;else{const t=e.filter((e=>e.gradient));0===t.length?e=v.gradients:t.length<e.length&&(e=t)}return e}function w_(e){const t=null==e?void 0:e.trim().match(/^(0?[-.]?\d*\.?\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/);return isNaN(e)||isNaN(parseFloat(e))?t?{value:parseFloat(t[1])||t[1],unit:t[2]}:{value:e,unit:void 0}:{value:parseFloat(e),unit:"px"}}function B_(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>w_(P_(e,t)).value)).filter(Boolean);switch(n[0]){case"min":return Math.min(...o)+"px";case"max":return Math.max(...o)+"px";case"clamp":return 3!==o.length?null:o[1]<o[0]?o[0]+"px":o[1]>o[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function I_(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=B_(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return w_(e)}function x_(e){for(let t=0;t<e.length;t++)if(["+","-","/","*"].includes(e[t]))return!0;return!1}function T_(e){let t=!1;const n=e.split(/[+-/*/]/g).filter(Boolean);for(const o of n){const n=w_(P_(o));if(!parseFloat(n.value)){t=!0;break}e=e.replace(o,n.value)}return t?null:(o=e,Function(`'use strict'; return (${o})`)()).toFixed(0)+"px";var o}function N_(e,t){const n=.01,o=Object.assign({},{fontSize:16,lineHeight:16,width:375,height:812,type:"font"},t),r={em:o.fontSize,rem:o.fontSize,vh:o.height*n,vw:o.width*n,vmin:(o.width<o.height?o.width:o.height)*n,vmax:(o.width>o.height?o.width:o.height)*n,"%":("font"===o.type?o.fontSize:o.width)*n,ch:8,ex:7.15625,lh:o.lineHeight},l={in:96,cm:37.79527559055118,mm:3.7795275590551185,pt:1.3333333333333333,pc:16,px:1,Q:.9448818897637794};return r[e.unit]?(r[e.unit]*e.value).toFixed(0)+"px":l[e.unit]?(l[e.unit]*e.value).toFixed(0)+"px":null}function P_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isFinite(e))return e.toFixed(0)+"px";if(void 0===e)return null;let n=w_(e);return n.unit||(n=I_(e)),x_(e)&&!n.unit?T_(e):N_(n,t)}const M_={};function R_(e){let t="";return e.hasOwnProperty("fontSize")&&(t=":"+e.width),e.hasOwnProperty("lineHeight")&&(t=":"+e.lineHeight),e.hasOwnProperty("width")&&(t=":"+e.width),e.hasOwnProperty("height")&&(t=":"+e.height),e.hasOwnProperty("type")&&(t=":"+e.type),t}var L_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e+R_(t);return M_[n]||(M_[n]=P_(e,t)),M_[n]}}(),(window.wp=window.wp||{}).blockEditor=o}();
|
1 |
+
!function(){var e={9367: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)},4184: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)}()},1934: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()}))]}},5913: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("")}}},7630: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(5913))&&o.__esModule?o:{default:o}).default)},9010:function(e,t,n){"use strict";var o=n(4657);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)))}},4979:function(e,t,n){"use strict";e.exports=n(9010)},4657: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)},5717: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}},8303:function(e,t,n){var o=n(1934);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML=" ","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},2703:function(e,t,n){"use strict";var o=n(414);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}},5697:function(e,t,n){e.exports=n(2703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4857: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(5697),c=n(9367),u=n(8303),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}))}))},4042:function(e,t,n){"use strict";var o=n(4857);t.Z=o.TextareaAutosize},3692: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 Dh},AlignmentToolbar:function(){return Oh},Autocomplete:function(){return Hh},BlockAlignmentControl:function(){return zo},BlockAlignmentToolbar:function(){return Vo},BlockBreadcrumb:function(){return jh},BlockColorsStyleSelector:function(){return Zh},BlockContextProvider:function(){return ar},BlockControls:function(){return Yn},BlockEdit:function(){return pr},BlockEditorKeyboardShortcuts:function(){return y_},BlockEditorProvider:function(){return Ka},BlockFormatControls:function(){return qn},BlockIcon:function(){return Wa},BlockInspector:function(){return h_},BlockList:function(){return hm},BlockMover:function(){return Qd},BlockNavigationDropdown:function(){return bv},BlockPreview:function(){return gu},BlockSelectionClearer:function(){return Xa},BlockSettingsMenu:function(){return Up},BlockSettingsMenuControls:function(){return zp},BlockStyles:function(){return Ev},BlockTitle:function(){return Fd},BlockToolbar:function(){return Wp},BlockTools:function(){return v_},BlockVerticalAlignmentControl:function(){return Uv},BlockVerticalAlignmentToolbar:function(){return Wv},ButtonBlockAppender:function(){return Id},ButtonBlockerAppender:function(){return xd},ColorPalette:function(){return jv},ColorPaletteControl:function(){return Kv},ContrastChecker:function(){return pf},CopyHandler:function(){return Ip},DefaultBlockAppender:function(){return wd},FontSizePicker:function(){return tg},InnerBlocks:function(){return pm},Inserter:function(){return Sd},InspectorAdvancedControls:function(){return tr},InspectorControls:function(){return nr},JustifyContentControl:function(){return ho},JustifyToolbar:function(){return vo},LineHeightControl:function(){return Of},MediaPlaceholder:function(){return gk},MediaReplaceFlow:function(){return uk},MediaUpload:function(){return ak},MediaUploadCheck:function(){return ck},MultiSelectScrollIntoView:function(){return E_},NavigableToolbar:function(){return Gd},ObserveTyping:function(){return B_},PanelColorSettings:function(){return hk},PlainText:function(){return Gk},RichText:function(){return zk},RichTextShortcut:function(){return $k},RichTextToolbarButton:function(){return jk},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return u_},ToolSelector:function(){return Yk},Typewriter:function(){return N_},URLInput:function(){return zb},URLInputButton:function(){return Jk},URLPopover:function(){return mk},Warning:function(){return fr},WritingFlow:function(){return ic},__experimentalBlockAlignmentMatrixControl:function(){return Wh},__experimentalBlockContentOverlay:function(){return Kh},__experimentalBlockFullHeightAligmentControl:function(){return Uh},__experimentalBlockPatternSetup:function(){return Lv},__experimentalBlockVariationPicker:function(){return Sv},__experimentalBlockVariationTransforms:function(){return Dv},__experimentalBorderRadiusControl:function(){return $m},__experimentalBorderStyleControl:function(){return Zm},__experimentalColorGradientControl:function(){return Em},__experimentalColorGradientSettingsDropdown:function(){return Cm},__experimentalDuotoneControl:function(){return oh},__experimentalFontAppearanceControl:function(){return Df},__experimentalFontFamilyControl:function(){return Kf},__experimentalGetBorderClassesAndStyles:function(){return hh},__experimentalGetColorClassesAndStyles:function(){return bh},__experimentalGetGradientClass:function(){return sf},__experimentalGetGradientObjectByGradientValue:function(){return cf},__experimentalGetMatchingVariation:function(){return Av},__experimentalGetSpacingClassesAndStyles:function(){return yh},__experimentalImageEditingProvider:function(){return Cb},__experimentalImageEditor:function(){return Rb},__experimentalImageSizeControl:function(){return Ab},__experimentalImageURLInputUI:function(){return s_},__experimentalLayoutStyle:function(){return Mo},__experimentalLetterSpacingControl:function(){return Cg},__experimentalLibrary:function(){return b_},__experimentalLinkControl:function(){return lk},__experimentalLinkControlSearchInput:function(){return Zb},__experimentalLinkControlSearchItem:function(){return Gb},__experimentalLinkControlSearchResults:function(){return $b},__experimentalListView:function(){return hv},__experimentalPanelColorGradientSettings:function(){return tb},__experimentalPreviewOptions:function(){return a_},__experimentalResponsiveBlockControl:function(){return Wk},__experimentalTextDecorationControl:function(){return dg},__experimentalTextTransformControl:function(){return kg},__experimentalToolsPanelColorDropdown:function(){return mf},__experimentalUnitControl:function(){return Xk},__experimentalUseBlockPreview:function(){return hu},__experimentalUseBorderProps:function(){return vh},__experimentalUseColorProps:function(){return _h},__experimentalUseCustomSides:function(){return $g},__experimentalUseGradient:function(){return df},__experimentalUseNoRecursiveRenders:function(){return R_},__experimentalUseResizeCanvas:function(){return c_},__unstableBlockSettingsMenuFirstItem:function(){return Lp},__unstableEditorStyles:function(){return du},__unstableIframe:function(){return cc},__unstableInserterMenuExtension:function(){return md},__unstableRichTextInputEvent:function(){return Kk},__unstableUseBlockSelectionClearer:function(){return Ya},__unstableUseClipboardHandler:function(){return xp},__unstableUseMouseMoveTypingReset:function(){return S_},__unstableUseTypewriter:function(){return T_},__unstableUseTypingObserver:function(){return w_},createCustomColorsHOC:function(){return Bh},getColorClassName:function(){return Im},getColorObjectByAttributeValues:function(){return Bm},getColorObjectByColorValue:function(){return xm},getFontSize:function(){return Qf},getFontSizeClass:function(){return eg},getFontSizeObjectByValue:function(){return Jf},getGradientSlugByValue:function(){return uf},getGradientValueBySlug:function(){return af},getPxFromCssUnit:function(){return $_},store:function(){return zn},storeConfig:function(){return Fn},transformStyles:function(){return au},useBlockDisplayInformation:function(){return Od},useBlockEditContext:function(){return Un},useBlockProps:function(){return Ra},useCachedTruthy:function(){return Eh},useInnerBlocksProps:function(){return dm},useSetting:function(){return mo},validateThemeColors:function(){return L_},validateThemeGradients:function(){return A_},withColorContext:function(){return $v},withColors:function(){return xh},withFontSizes:function(){return Th}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return It},__experimentalGetAllowedBlocks:function(){return at},__experimentalGetAllowedPatterns:function(){return pt},__experimentalGetBlockListSettingsForBlocks:function(){return bt},__experimentalGetDirectInsertBlock:function(){return ct},__experimentalGetLastBlockAttributeChanges:function(){return yt},__experimentalGetParsedPattern:function(){return ut},__experimentalGetPatternTransformItems:function(){return ft},__experimentalGetPatternsByBlockTypes:function(){return mt},__experimentalGetReusableBlockTitle:function(){return kt},__unstableGetBlockWithoutInnerBlocks:function(){return W},__unstableGetClientIdWithClientIdsTree:function(){return j},__unstableGetClientIdsTree:function(){return K},__unstableIsLastBlockChangeIgnored:function(){return _t},areInnerBlocksControlled:function(){return xt},canInsertBlockType:function(){return qe},canInsertBlocks:function(){return Ye},canMoveBlock:function(){return Qe},canMoveBlocks:function(){return Je},canRemoveBlock:function(){return Xe},canRemoveBlocks:function(){return Ze},didAutomaticChange:function(){return wt},getAdjacentBlockClientId:function(){return pe},getBlock:function(){return U},getBlockAttributes:function(){return G},getBlockCount:function(){return Q},getBlockHierarchyRootClientId:function(){return ue},getBlockIndex:function(){return xe},getBlockInsertionPoint:function(){return He},getBlockListSettings:function(){return gt},getBlockMode:function(){return Le},getBlockName:function(){return V},getBlockOrder:function(){return Be},getBlockParents:function(){return ae},getBlockParentsByBlockName:function(){return ce},getBlockRootClientId:function(){return se},getBlockSelectionEnd:function(){return ne},getBlockSelectionStart:function(){return te},getBlockTransformItems:function(){return it},getBlocks:function(){return $},getBlocksByClientId:function(){return Z},getClientIdsOfDescendants:function(){return q},getClientIdsWithDescendants:function(){return Y},getDraggedBlockClientIds:function(){return Oe},getFirstMultiSelectedBlockClientId:function(){return ke},getGlobalBlockCount:function(){return X},getInserterItems:function(){return lt},getLastMultiSelectedBlockClientId:function(){return _e},getLowestCommonAncestorWithSelectedBlock:function(){return de},getMultiSelectedBlockClientIds:function(){return ve},getMultiSelectedBlocks:function(){return be},getMultiSelectedBlocksEndClientId:function(){return we},getMultiSelectedBlocksStartClientId:function(){return Se},getNextBlockClientId:function(){return fe},getPreviousBlockClientId:function(){return me},getSelectedBlock:function(){return ie},getSelectedBlockClientId:function(){return le},getSelectedBlockClientIds:function(){return he},getSelectedBlockCount:function(){return oe},getSelectedBlocksInitialCaretPosition:function(){return ge},getSelectionEnd:function(){return ee},getSelectionStart:function(){return J},getSettings:function(){return ht},getTemplate:function(){return We},getTemplateLock:function(){return $e},hasBlockMovingClientId:function(){return St},hasInserterItems:function(){return st},hasMultiSelection:function(){return Pe},hasSelectedBlock:function(){return re},hasSelectedInnerBlock:function(){return Te},isAncestorBeingDragged:function(){return ze},isAncestorMultiSelected:function(){return Ce},isBlockBeingDragged:function(){return Fe},isBlockHighlighted:function(){return Bt},isBlockInsertionPointVisible:function(){return Ge},isBlockMultiSelected:function(){return Ee},isBlockSelected:function(){return Ie},isBlockValid:function(){return H},isBlockWithinSelection:function(){return Ne},isCaretWithinFormattedText:function(){return Ve},isDraggingBlocks:function(){return De},isFirstMultiSelectedBlock:function(){return ye},isLastBlockChangePersistent:function(){return vt},isMultiSelecting:function(){return Me},isNavigationMode:function(){return Ct},isSelectionEnabled:function(){return Re},isTyping:function(){return Ae},isValidTemplate:function(){return Ue},wasBlockJustInserted:function(){return Tt}});var t={};n.r(t),n.d(t,{__unstableMarkAutomaticChange:function(){return In},__unstableMarkLastChangeAsPersistent:function(){return Bn},__unstableMarkNextChangeAsNotPersistent:function(){return xn},__unstableSaveReusableBlock:function(){return wn},clearSelectedBlock:function(){return jt},duplicateBlocks:function(){return Pn},enterFormattedText:function(){return bn},exitFormattedText:function(){return kn},flashBlock:function(){return An},hideInsertionPoint:function(){return ln},insertAfterBlock:function(){return Rn},insertBeforeBlock:function(){return Mn},insertBlock:function(){return nn},insertBlocks:function(){return on},insertDefaultBlock:function(){return En},mergeBlocks:function(){return cn},moveBlockToPosition:function(){return tn},moveBlocksDown:function(){return Qt},moveBlocksToPosition:function(){return en},moveBlocksUp:function(){return Jt},multiSelect:function(){return $t},receiveBlocks:function(){return Ot},removeBlock:function(){return dn},removeBlocks:function(){return un},replaceBlock:function(){return Xt},replaceBlocks:function(){return Yt},replaceInnerBlocks:function(){return pn},resetBlocks:function(){return Lt},resetSelection:function(){return Dt},selectBlock:function(){return Vt},selectNextBlock:function(){return Gt},selectPreviousBlock:function(){return Ht},selectionChange:function(){return yn},setBlockMovingClientId:function(){return Nn},setHasControlledInnerBlocks:function(){return Dn},setNavigationMode:function(){return Tn},setTemplateValidity:function(){return sn},showInsertionPoint:function(){return rn},startDraggingBlocks:function(){return hn},startMultiSelect:function(){return Ut},startTyping:function(){return fn},stopDraggingBlocks:function(){return vn},stopMultiSelect:function(){return Wt},stopTyping:function(){return gn},synchronizeTemplate:function(){return an},toggleBlockHighlight:function(){return Ln},toggleBlockMode:function(){return mn},toggleSelection:function(){return Kt},updateBlock:function(){return zt},updateBlockAttributes:function(){return Ft},updateBlockListSettings:function(){return Cn},updateSettings:function(){return Sn},validateBlocksToTemplate:function(){return At}});var r=window.wp.blocks,l=window.wp.hooks;function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).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(4184),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:[],__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||["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&&xt(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||z}const j=D(((e,t)=>({clientId:t,innerBlocks:K(e,t)})),(e=>[e.blocks.order])),K=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Be(e,t),(t=>j(e,t)))}),(e=>[e.blocks.order])),q=(e,t)=>(0,u.flatMap)(t,(t=>{const n=Be(e,t);return[...n,...q(e,n)]})),Y=D((e=>{const t=Be(e);return[...t,...q(e,t)]}),(e=>[e.blocks.order])),X=D(((e,t)=>{const n=Y(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),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 Q(e,t){return Be(e,t).length}function J(e){return e.selection.selectionStart}function ee(e){return e.selection.selectionEnd}function te(e){return e.selection.selectionStart.clientId}function ne(e){return e.selection.selectionEnd.clientId}function oe(e){return ve(e).length||(e.selection.selectionStart.clientId?1:0)}function re(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function le(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ie(e){const t=le(e);return t?U(e,t):null}function se(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const ae=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),ce=D((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=ae(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:V(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function ue(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function de(e,t){const n=le(e),o=[...ae(e,t),t],r=[...ae(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function pe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=le(e)),void 0===t&&(t=n<0?ke(e):_e(e)),!t)return null;const o=se(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),s=i+1*n;return s<0||s===l.length?null:l[s]}function me(e,t){return pe(e,t,-1)}function fe(e,t){return pe(e,t,1)}function ge(e){return e.initialPosition}const he=D((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return z;if(t.clientId===n.clientId)return[t.clientId];const o=se(e,t.clientId);if(null===o)return z;const r=Be(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?z:he(e)}const be=D((e=>{const t=ve(e);return t.length?t.map((t=>U(e,t))):z}),(e=>[...he.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function ke(e){return(0,u.first)(ve(e))||null}function _e(e){return(0,u.last)(ve(e))||null}function ye(e,t){return ke(e)===t}function Ee(e,t){return-1!==ve(e).indexOf(t)}const Ce=D(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=se(e,n),o=Ee(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Se(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function we(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Be(e,t){return e.blocks.order[t||""]||z}function xe(e,t){return Be(e,se(e,t)).indexOf(t)}function Ie(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Te(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Be(e,t),(t=>Ie(e,t)||Ee(e,t)||n&&Te(e,t,n)))}function Ne(e,t){if(!t)return!1;const n=ve(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Pe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Me(e){return e.isMultiSelecting}function Re(e){return e.isSelectionEnabled}function Le(e,t){return e.blocksMode[t]||"visual"}function Ae(e){return e.isTyping}function De(e){return!!e.draggedBlocks.length}function Oe(e){return e.draggedBlocks}function Fe(e,t){return e.draggedBlocks.includes(t)}function ze(e,t){if(!De(e))return!1;const n=ae(e,t);return(0,u.some)(n,(t=>Fe(e,t)))}function Ve(e){return e.isCaretWithinFormattedText}function He(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=se(e,l)||void 0,n=xe(e,r.clientId)+1):n=Be(e).length,{rootClientId:t,index:n}}function Ge(e){return null!==e.insertionPoint}function Ue(e){return e.template.isValid}function We(e){return e.settings.template}function $e(e,t){if(!t)return e.settings.templateLock;const n=gt(e,t);return n?n.templateLock:null}const je=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},Ke=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,r.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=ht(e),s=je(i,t,!0);if(!s)return!1;const a=!!$e(e,o);if(a)return!1;const c=gt(e,o);if(o&&void 0===c)return!1;const u=null==c?void 0:c.allowedBlocks,d=je(u,t),p=n.parent,m=V(e,o),f=je(p,m),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:ce.bind(null,e)}):g},qe=D(Ke,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function Ye(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>qe(e,V(e,t),n)))}function Xe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=G(e,t);if(null===o)return!0;const{lock:r}=o,l=!!$e(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function Ze(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Xe(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;const{lock:r}=o,l="all"===$e(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function Je(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>Qe(e,t,n)))}function et(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const tt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&Ke(e,t.name,n),nt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=et(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:ot(r,l)}},ot=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},rt=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,u.some)(Z(e,Y(e)),{name:t.name}));const{time:i,count:s=0}=et(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:ot(i,s)};if("transform"===n)return a;const c=(0,r.getBlockVariations)(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},lt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=rt(e,{buildScope:"inserter"}),o=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,l=t=>{let n=F;if("web"===s.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,l=(0,r.getBlockType)(t+o);l&&(n=l.icon)}}const l=`core/block/${t.id}`,{time:i,count:a=0}=et(e,l)||{},c=ot(i,a);return{id:l,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}},i=(0,r.getBlockTypes)().filter((n=>tt(e,n,t))).map(n),a=Ke(e,"core/block",t)?Et(e).map(l):[],c=i.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=nt(e,n);t.push(...o.map(r))}return t}),[]),u=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=c.reduce(u,{core:[],noncore:[]}),m=[...d,...p];return[...m,...a]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Et(e),(0,r.getBlockTypes)()])),it=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=rt(e,{buildScope:"transform"}),l=(0,r.getBlockTypes)().filter((t=>tt(e,t,n))).map(o),i=(0,u.mapKeys)(l,(e=>{let{name:t}=e;return t})),s=(0,r.getPossibleBlockTransformations)(t).reduce(((e,t)=>(i[null==t?void 0:t.name]&&e.push(i[t.name]),e)),[]),a=(0,u.orderBy)(s,(e=>i[e.name].frecency),"desc");return a}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),st=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>tt(e,n,t)));if(n)return!0;const o=Ke(e,"core/block",t)&&Et(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Et(e),(0,r.getBlockTypes)()])),at=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>tt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),ct=D((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(U(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),ut=D(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content)}:null}),(e=>[e.settings.__experimentalBlockPatterns])),dt=D((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=ht(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return ut(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(!je(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}))}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),pt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=dt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return qe(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),mt=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return z;const o=pt(e,n),r=Array.isArray(t)?t:[t];return o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}))}),((e,t)=>[...pt.getDependants(e,t)])),ft=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return z;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||xt(e,n)})))return z;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return mt(e,o,n)}),((e,t)=>[...mt.getDependants(e,t)]));function gt(e,t){return e.blockListSettings[t]}function ht(e){return e.settings}function vt(e){return e.blocks.isPersistentChange}const bt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),kt=D(((e,t)=>{var n;const o=(0,u.find)(Et(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Et(e)]));function _t(e){return e.blocks.isIgnoredChange}function yt(e){return e.lastBlockAttributesChange}function Et(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:z}function Ct(e){return e.isNavigationMode}function St(e){return e.hasBlockMovingClientId}function wt(e){return!!e.automaticChangeStatus}function Bt(e,t){return e.highlightedBlock===t}function xt(e,t){return!!e.blocks.controlledInnerBlocks[t]}const It=D(((e,t)=>{if(!t.length)return null;const n=le(e);if(t.includes(V(e,n)))return n;const o=ve(e),r=ce(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Tt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Nt=window.wp.a11y,Pt=window.wp.richText,Mt=window.wp.deprecated,Rt=n.n(Mt);const Lt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(At(e))},At=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getTemplate(),i=n.getTemplateLock(),s=!l||"all"!==i||(0,r.doBlocksMatchTemplate)(e,l);if(s!==n.isValidTemplate())return o.setTemplateValidity(s),s};function Dt(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Ot(e){return Rt()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Ft(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function zt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Vt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Ht=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Gt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Ut(){return{type:"START_MULTI_SELECT"}}function Wt(){return{type:"STOP_MULTI_SELECT"}}const $t=(e,t)=>n=>{let{select:o,dispatch:r}=n;if(o.getBlockRootClientId(e)!==o.getBlockRootClientId(t))return;r({type:"MULTI_SELECT",start:e,end:t});const l=o.getSelectedBlockCount();(0,Nt.speak)((0,g.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
+
(0,g._n)("%s block selected.","%s blocks selected.",l),l),"assertive")};function jt(){return{type:"CLEAR_SELECTED_BLOCK"}}function Kt(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function qt(e,t){var n,o;const l=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,r.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!l[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:i={}}=e,s=l[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}const Yt=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0;return l=>{let{select:i,dispatch:s}=l;e=(0,u.castArray)(e),t=qt((0,u.castArray)(t),i.getSettings());const a=i.getBlockRootClientId((0,u.first)(e));for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function Xt(e,t){return Yt(e,t)}const Zt=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},Qt=Zt("MOVE_BLOCKS_DOWN"),Jt=Zt("MOVE_BLOCKS_UP"),en=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return r=>{let{select:l,dispatch:i}=r;if(l.canMoveBlocks(e,t)){if(t!==n){if(!l.canRemoveBlocks(e,t))return;if(!l.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function tn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return en([e],t,n,o)}function nn(e,t,n,o,r){return on([e],t,n,o,0,r)}const on=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;(0,u.isObject)(r)&&(l=r,r=0,Rt()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=qt((0,u.castArray)(e),s.getSettings());const c=[];for(const t of e)s.canInsertBlockType(t.name,n)&&c.push(t);c.length&&a({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function rn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function ln(){return{type:"HIDE_INSERTION_POINT"}}function sn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const an=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),l=t.getTemplate(),i=(0,r.synchronizeBlocksWithTemplate)(o,l);n.resetBlocks(i)},cn=(e,t)=>n=>{let{select:o,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[s,a]=i,c=o.getBlock(s),d=(0,r.getBlockType)(c.name);if(d&&!d.merge)return void l.selectBlock(c.clientId);const p=o.getBlock(a),m=(0,r.getBlockType)(p.name),{clientId:f,attributeKey: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,Pt.insert)((0,Pt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),"",h,h);e.attributes[g]=(0,Pt.toHTMLString)({value:l,multilineTag:n,preserveWhiteSpace:r})}const y=c.name===p.name?[_]:(0,r.switchToBlockType)(_,c.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=(0,u.findKey)(E,(e=>"string"==typeof e&&-1!==e.indexOf(""))),t=E[e],{multiline:n,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:r}=d.attributes[e],i=(0,Pt.create)({html:t,multilineTag:n,multilineWrapperTags:o,preserveWhiteSpace:r}),s=i.text.indexOf(""),a=(0,Pt.remove)(i,s,s+1),p=(0,Pt.toHTMLString)({value:a,multilineTag:n,preserveWhiteSpace:r});E[e]=p,l.selectionChange(c.clientId,e,s,s)}l.replaceBlocks([c.clientId,p.clientId],[{...c,attributes:{...c.attributes,...E}},...y.slice(1)],0)},un=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=(0,u.castArray)(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function dn(e,t){return un([e],t)}function pn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function mn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function fn(){return{type:"START_TYPING"}}function gn(){return{type:"STOP_TYPING"}}function hn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function vn(){return{type:"STOP_DRAGGING_BLOCKS"}}function bn(){return{type:"ENTER_FORMATTED_TEXT"}}function kn(){return{type:"EXIT_FORMATTED_TEXT"}}function yn(e,t,n,o){return{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}}function En(e,t,n){const o=(0,r.getDefaultBlockName)();if(o)return nn((0,r.createBlock)(o,e),n,t)}function Cn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Sn(e){return{type:"UPDATE_SETTINGS",settings:e}}function wn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Bn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function xn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const In=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Tn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?(0,Nt.speak)((0,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,Nt.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Nn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Nt.speak)((0,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."))}},Pn=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))}},Mn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l)},Rn=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 Ln(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const An=e=>async t=>{let{dispatch:n}=t;n(Ln(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Ln(e,!1))};function Dn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const On="core/block-editor",Fn={reducer:M,selectors:e,actions:t,__experimentalUseThunks:!0},zn=(0,m.createReduxStore)(On,{...Fn,persist:["preferences"]});(0,m.registerStore)(On,{...Fn,persist:["preferences"]});const Vn={name:"",isSelected:!1},Hn=(0,s.createContext)(Vn),{Provider:Gn}=Hn;function Un(){return(0,s.useContext)(Hn)}function Wn(){const{isSelected:e,clientId:t,name:n}=Un();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(zn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function $n(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=Wn(),{clientId:o}=Un(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(zn),{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 jn(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 Kn=$n;Kn.Slot=jn;const qn=e=>(0,s.createElement)($n,i({group:"inline"},e));qn.Slot=e=>(0,s.createElement)(jn,i({group:"inline"},e));var Yn=Kn,Xn=(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"})),Zn=(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"})),Qn=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),Jn=(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"})),eo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),to=(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"})),no=(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"})),oo=(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"})),ro=(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"})),lo=(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"})),io=(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"})),so=(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 ao(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const co=["color","border","typography","spacing"],uo={"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},po={"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 mo(e){const{name:t}=Un();return(0,m.useSelect)((n=>{var o;if(co.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(zn).getSettings(),i=(e=>po[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=uo[i]?uo[i](l):void 0;return void 0!==m?m:"typography.dropCap"===i||void 0}),[t,e])}const fo={left:no,center:oo,right:ro,"space-between":lo};var go=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?fo[r]:fo.left,d=[{name:"left",icon:no,title:(0,g.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:oo,title:(0,g.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:ro,title:(0,g.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:lo,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 ho(e){return(0,s.createElement)(go,i({},e,{isToolbar:!1}))}function vo(e){return(0,s.createElement)(go,i({},e,{isToolbar:!0}))}const bo={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},ko={left:"flex-start",right:"flex-end",center:"center"},_o=["wrap","nowrap"];var yo={name:"flex",label:(0,g.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n}=e;const{allowOrientation:o=!0}=t;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Flex,null,(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Eo,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,o&&(0,s.createElement)(So,{layout:t,onChange:n}))),(0,s.createElement)(Co,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;return null!=o&&o.allowSwitching?null:(0,s.createElement)(Yn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Eo,{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!==mo("spacing.blockGap"),c=null!==(t=null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap)&&void 0!==t?t:"var( --wp--style--block-gap, 0.5em )",u=bo[r.justifyContent]||bo.left,d=_o.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: ${ko[r.justifyContent]||ko.left};\n\t\t`;return(0,s.createElement)("style",null,`\n\t\t\t\t${ao(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tgap: ${a?c:"0.5em"};\n\t\t\t\t\tflex-wrap: ${d};\n\t\t\t\t\t${"horizontal"===i?p:m}\n\t\t\t\t}\n\n\t\t\t\t${ao(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 Eo(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===l&&a.push("space-between"),o)return(0,s.createElement)(ho,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:no,label:(0,g.__)("Justify items left")},{value:"center",icon:oo,label:(0,g.__)("Justify items center")},{value:"right",icon:ro,label:(0,g.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:lo,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 Co(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 So(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:io,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:"vertical",icon:so,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var wo=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})};const Bo=[{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:mo("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)(wo,{icon:Qn})),(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)(wo,{icon:eo}))),(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!==mo("spacing.blockGap"),u=null!==(t=null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap)&&void 0!==t?t:"var( --wp--style--block-gap )";let d=i||a?`\n\t\t\t\t\t${ao(o,"> *")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:a};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\n\t\t\t\t\t${ao(o,'> [data-align="wide"]')} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\n\t\t\t\t\t${ao(o,'> [data-align="full"]')} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return d+=`\n\t\t\t${ao(o,'> [data-align="left"]')} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-right: 2em;\n\t\t\t}\n\n\t\t\t${ao(o,'> [data-align="right"]')} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-left: 2em;\n\t\t\t}\n\n\t\t`,c&&(d+=`\n\t\t\t\t${ao(o,"> *")} {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\tmargin-bottom: 0;\n\t\t\t\t}\n\t\t\t\t${ao(o,"> * + *")} {\n\t\t\t\t\tmargin-top: ${u};\n\t\t\t\t}\n\t\t\t`),(0,s.createElement)("style",null,d)},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;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}},yo];function xo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Bo.find((t=>t.name===e))}const Io={type:"default"},To=(0,s.createContext)(Io),No=To.Provider;function Po(){return(0,s.useContext)(To)}function Mo(e){let{layout:t={},...n}=e;const o=xo(t.type);return o?(0,s.createElement)(o.save,i({layout:t},n)):null}const Ro=["none","left","center","right","wide","full"],Lo=["wide","full"];function Ao(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ro;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=Po(),r=xo(null==o?void 0:o.type),l=r.getAlignments(o);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==r.name)return[];const{alignments:i=Ro}=o,s=e.filter((e=>(o.alignments||t||!Lo.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const Do={none:{icon:Xn,title:(0,g.__)("None")},left:{icon:Zn,title:(0,g.__)("Align left")},center:{icon:Qn,title:(0,g.__)("Align center")},right:{icon:Jn,title:(0,g.__)("Align right")},wide:{icon:eo,title:(0,g.__)("Wide width")},full:{icon:to,title:(0,g.__)("Full width")}},Oo={isAlternate:!0};var Fo=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=Ao(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Do[t],m=Do.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,h={popoverProps:Oo,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{...Do[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{children:e=>{let{onClose:n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},a.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=Do[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(p.MenuItem,{key:o,icon:l,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{u(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,s.createElement)(f,i({},h,v))};function zo(e){return(0,s.createElement)(Fo,i({},e,{isToolbar:!1}))}function Vo(e){return(0,s.createElement)(Fo,i({},e,{isToolbar:!0}))}const Ho=["left","center","right","wide","full"],Go=["wide","full"];function Uo(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?Ho.filter((t=>e.includes(t))):!0===e?[...Ho]:[],!o||!0===e&&!n?(0,u.without)(t,...Go):t}const Wo=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Ao(Uo((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)(Yn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(zo,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const l=(0,r.getBlockType)(t.name);(null==l||null===(n=l.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:o})),(0,s.createElement)(e,t))}),"withToolbarControls"),$o=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=Ao(Uo((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0)));if(void 0===l)return(0,s.createElement)(e,t);let c=t.wrapperProps;return a.some((e=>e.name===l))&&(c={...c,"data-align":l}),(0,s.createElement)(e,i({},t,{wrapperProps:c}))}));(0,l.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){return(0,u.has)(e.attributes,["align","type"])||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Ho,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",$o),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Wo),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Uo((0,r.getBlockSupport)(t,"align"),(0,r.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,l.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return(0,u.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e})),window.wp.warning;var jo={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),border:(0,p.createSlotFill)("InspectorControlsBorder"),color:(0,p.createSlotFill)("InspectorControlsColor"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function Ko(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=Wn(),l=null===(t=jo[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const qo=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,qo),u.identity);return(0,u.isEmpty)(t)?void 0:t};function Yo(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function Xo(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:Yo(c.attributes,e,t)})}))})),c}function Zo(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(zn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(zn),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:qo(r.style)},t[n]=r})),r(n,t,!0)}),[qo,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 Qo(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 Jo(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=jo[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)(Zo,{group:n,label:o},(0,s.createElement)(Qo,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const er=Ko;er.Slot=Jo;const tr=e=>(0,s.createElement)(Ko,i({},e,{__experimentalGroup:"advanced"}));tr.Slot=e=>(0,s.createElement)(Jo,i({},e,{__experimentalGroup:"advanced"})),tr.slotName="InspectorAdvancedControls";var nr=er;const or=/[\s#]/g,rr=(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(or,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(nr,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(nr,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:{type:"string",source:"attribute",attribute:"id",selector:"*"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",rr),(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 lr=(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)(nr,{__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",lr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,r.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=(0,u.uniq)([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));var ir=window.wp.dom;const sr=(0,s.createContext)({});function ar(e){let{value:t,children:n}=e;const o=(0,s.useContext)(sr),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(sr.Provider,{value:r,children:n})}var cr=sr;const ur={};var dr=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(cr),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):ur),[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 pr(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(Gn,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(dr,e))}var mr=(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"})),fr=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:mr,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(7630);function hr(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,ir.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 vr=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)(hr,{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)(hr,{title:(0,g.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))};const br=e=>(0,r.rawHandler)({HTML:e.originalContent});var kr=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(zn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(zn);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,br(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)(fr,{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)(vr,{block:i,onKeep:t,onConvert:n,convertor:br,convertButtonText:(0,g.__)("Convert to Blocks")})))}));const _r=(0,s.createElement)(fr,{className:"block-editor-block-list__block-crash-warning"},(0,g.__)("This block has encountered an error and cannot be previewed."));var yr=()=>_r;class Er 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 Cr=Er,Sr=n(4042),wr=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(zn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(zn);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(Sr.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,r.getBlockType)(l.name);if(!e)return;const s=(0,r.getBlockAttributes)(e,n,l.attributes),a=n||(0,r.getSaveContent)(e,s),c=!n||(0,r.isValidBlockContent)(e,s,a);i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let Br=Hr();const xr=e=>Or(e,Br);let Ir=Hr();xr.write=e=>Or(e,Ir);let Tr=Hr();xr.onStart=e=>Or(e,Tr);let Nr=Hr();xr.onFrame=e=>Or(e,Nr);let Pr=Hr();xr.onFinish=e=>Or(e,Pr);let Mr=[];xr.setTimeout=(e,t)=>{let n=xr.now()+t,o=()=>{let e=Mr.findIndex((e=>e.cancel==o));~e&&Mr.splice(e,1),Ur.count-=~e?1:0},r={time:n,handler:e,cancel:o};return Mr.splice(Rr(n),0,r),Ur.count+=1,Fr(),r};let Rr=e=>~(~Mr.findIndex((t=>t.time>e))||~Mr.length);xr.cancel=e=>{Br.delete(e),Ir.delete(e)},xr.sync=e=>{Dr=!0,xr.batchedUpdates(e),Dr=!1},xr.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,xr.onStart(n)}return o.handler=e,o.cancel=()=>{Tr.delete(n),t=null},o};let Lr="undefined"!=typeof window?window.requestAnimationFrame:()=>{};xr.use=e=>Lr=e,xr.now="undefined"!=typeof performance?()=>performance.now():Date.now,xr.batchedUpdates=e=>e(),xr.catch=console.error,xr.frameLoop="always",xr.advance=()=>{"demand"!==xr.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Vr()};let Ar=-1,Dr=!1;function Or(e,t){Dr?(t.delete(e),e(0)):(t.add(e),Fr())}function Fr(){Ar<0&&(Ar=0,"demand"!==xr.frameLoop&&Lr(zr))}function zr(){~Ar&&(Lr(zr),xr.batchedUpdates(Vr))}function Vr(){let e=Ar;Ar=xr.now();let t=Rr(Ar);t&&(Gr(Mr.splice(0,t),(e=>e.handler())),Ur.count-=t),Tr.flush(),Br.flush(e?Math.min(64,Ar-e):16.667),Nr.flush(),Ir.flush(),Pr.flush()}function Hr(){let e=new Set,t=e;return{add(n){Ur.count+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Ur.count-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Ur.count-=t.size,Gr(t,(t=>t(n)&&e.add(t))),Ur.count+=e.size,t=e)}}}function Gr(e,t){e.forEach((e=>{try{t(e)}catch(e){xr.catch(e)}}))}const Ur={count:0,clear(){Ar=-1,Mr=[],Tr=Hr(),Br=Hr(),Nr=Hr(),Ir=Hr(),Pr=Hr(),Ur.count=0}};var Wr=n(9196),$r=n.n(Wr);function jr(){}const Kr={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 qr(e,t){if(Kr.arr(e)){if(!Kr.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 Yr=(e,t)=>e.forEach(t);function Xr(e,t,n){for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const Zr=e=>Kr.und(e)?[]:Kr.arr(e)?e:[e];function Qr(e,t){if(e.size){const n=Array.from(e);e.clear(),Yr(n,t)}}const Jr=(e,...t)=>Qr(e,(e=>e(...t)));let el,tl,nl=null,ol=!1,rl=jr;var ll=Object.freeze({__proto__:null,get createStringInterpolator(){return el},get to(){return tl},get colors(){return nl},get skipAnimation(){return ol},get willAdvance(){return rl},assign:e=>{e.to&&(tl=e.to),e.now&&(xr.now=e.now),void 0!==e.colors&&(nl=e.colors),null!=e.skipAnimation&&(ol=e.skipAnimation),e.createStringInterpolator&&(el=e.createStringInterpolator),e.requestAnimationFrame&&xr.use(e.requestAnimationFrame),e.batchedUpdates&&(xr.batchedUpdates=e.batchedUpdates),e.willAdvance&&(rl=e.willAdvance),e.frameLoop&&(xr.frameLoop=e.frameLoop)}});const il=new Set;let sl=[],al=[],cl=0;const ul={get idle(){return!il.size&&!sl.length},start(e){cl>e.priority?(il.add(e),xr.onStart(dl)):(pl(e),xr(fl))},advance:fl,sort(e){if(cl)xr.onFrame((()=>ul.sort(e)));else{const t=sl.indexOf(e);~t&&(sl.splice(t,1),ml(e))}},clear(){sl=[],il.clear()}};function dl(){il.forEach(pl),il.clear(),xr(fl)}function pl(e){sl.includes(e)||ml(e)}function ml(e){sl.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(sl),0,e)}function fl(e){const t=al;for(let n=0;n<sl.length;n++){const o=sl[n];cl=o.priority,o.idle||(rl(o),o.advance(e),o.idle||t.push(o))}return cl=0,al=sl,al.length=0,sl=t,sl.length>0}const gl="[-+]?\\d*\\.?\\d+",hl=gl+"%";function vl(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const bl=new RegExp("rgb"+vl(gl,gl,gl)),kl=new RegExp("rgba"+vl(gl,gl,gl,gl)),_l=new RegExp("hsl"+vl(gl,hl,hl)),yl=new RegExp("hsla"+vl(gl,hl,hl,gl)),El=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Cl=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Sl=/^#([0-9a-fA-F]{6})$/,wl=/^#([0-9a-fA-F]{8})$/;function Bl(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 xl(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=Bl(r,o,e+1/3),i=Bl(r,o,e),s=Bl(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function Il(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Tl(e){return(parseFloat(e)%360+360)%360/360}function Nl(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Pl(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Ml(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Sl.exec(e))?parseInt(t[1]+"ff",16)>>>0:nl&&void 0!==nl[e]?nl[e]:(t=bl.exec(e))?(Il(t[1])<<24|Il(t[2])<<16|Il(t[3])<<8|255)>>>0:(t=kl.exec(e))?(Il(t[1])<<24|Il(t[2])<<16|Il(t[3])<<8|Nl(t[4]))>>>0:(t=El.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=wl.exec(e))?parseInt(t[1],16)>>>0:(t=Cl.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=_l.exec(e))?(255|xl(Tl(t[1]),Pl(t[2]),Pl(t[3])))>>>0:(t=yl.exec(e))?(xl(Tl(t[1]),Pl(t[2]),Pl(t[3]))|Nl(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 Rl=(e,t,n)=>{if(Kr.fun(e))return e;if(Kr.arr(e))return Rl({range:e,output:t,extrapolate:n});if(Kr.str(e.output[0]))return el(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 Ll(){return(Ll=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 Al=Symbol.for("FluidValue.get"),Dl=Symbol.for("FluidValue.observers"),Ol=e=>Boolean(e&&e[Al]),Fl=e=>e&&e[Al]?e[Al]():e,zl=e=>e[Dl]||null;function Vl(e,t){let n=e[Dl];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Hl{constructor(e){if(this[Al]=void 0,this[Dl]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Gl(this,e)}}const Gl=(e,t)=>$l(e,Al,t);function Ul(e,t){if(e[Al]){let n=e[Dl];n||$l(e,Dl,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Wl(e,t){let n=e[Dl];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Dl]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const $l=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),jl=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Kl=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;let ql;const Yl=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Xl=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Zl=e=>{ql||(ql=nl?new RegExp(`(${Object.keys(nl).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Fl(e).replace(Kl,Ml).replace(ql,Ml))),n=t.map((e=>e.match(jl).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=>Rl(Ll({},e,{output:t}))));return e=>{let n=0;return t[0].replace(jl,(()=>String(o[n++](e)))).replace(Yl,Xl)}},Ql="react-spring: ",Jl=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Ql}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},ei=Jl(console.warn),ti=Jl(console.warn);function ni(e){return Kr.str(e)&&("#"==e[0]||/\d/.test(e)||e in(nl||{}))}const oi=e=>(0,Wr.useEffect)(e,ri),ri=[];function li(){const e=(0,Wr.useState)()[1],t=(0,Wr.useState)(ii)[0];return oi(t.unmount),()=>{t.current&&e({})}}function ii(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function si(e){const t=(0,Wr.useRef)();return(0,Wr.useEffect)((()=>{t.current=e})),t.current}const ai="undefined"!=typeof window&&window.document&&window.document.createElement?Wr.useLayoutEffect:Wr.useEffect,ci=Symbol.for("Animated:node"),ui=e=>e&&e[ci],di=(e,t)=>{return n=e,o=ci,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},pi=e=>e&&e[ci]&&e[ci].getPayload();class mi{constructor(){this.payload=void 0,di(this,this)}getPayload(){return this.payload||[]}}class fi extends mi{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,Kr.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new fi(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Kr.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,Kr.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class gi extends fi{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Rl({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(Kr.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=Rl({output:[this.getValue(),e]})),this._value=0,super.reset()}}const hi={dependencies:null};class vi extends mi{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Xr(this.source,((n,o)=>{var r;(r=n)&&r[ci]===r?t[o]=n.getValue(e):Ol(n)?t[o]=Fl(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Yr(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Xr(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){hi.dependencies&&Ol(e)&&hi.dependencies.add(e);const t=pi(e);t&&Yr(t,(e=>this.add(e)))}}class bi extends vi{constructor(e){super(e)}static create(e){return new bi(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(ki)),!0)}}function ki(e){return(ni(e)?gi:fi).create(e)}function _i(e){const t=ui(e);return t?t.constructor:Kr.arr(e)?bi:ni(e)?gi:fi}function yi(){return(yi=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 Ei=(e,t)=>{const n=!Kr.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Wr.forwardRef)(((o,r)=>{const l=(0,Wr.useRef)(null),i=n&&(0,Wr.useCallback)((e=>{l.current=function(e,t){return e&&(Kr.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return hi.dependencies=n,e.style&&(e=yi({},e,{style:t.createAnimatedStyle(e.style)})),e=new vi(e),hi.dependencies=null,[e,n]}(o,t),c=li(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new Ci(u,a),p=(0,Wr.useRef)();ai((()=>{const e=p.current;p.current=d,Yr(a,(e=>Ul(e,d))),e&&(Yr(e.deps,(t=>Wl(t,e))),xr.cancel(e.update))})),(0,Wr.useEffect)(u,[]),oi((()=>()=>{const e=p.current;Yr(e.deps,(t=>Wl(t,e)))}));const m=t.getComponentProps(s.getValue());return Wr.createElement(e,yi({},m,{ref:i}))}))};class Ci{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&xr.write(this.update)}}const Si=Symbol.for("AnimatedComponent"),wi=e=>Kr.str(e)?e:e&&Kr.str(e.displayName)?e.displayName:Kr.fun(e)&&e.name||null;function Bi(){return(Bi=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 xi(e,...t){return Kr.fun(e)?e(...t):e}const Ii=(e,t)=>!0===e||!!(t&&e&&(Kr.fun(e)?e(t):Zr(e).includes(t))),Ti=(e,t)=>Kr.obj(e)?t&&e[t]:e,Ni=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Pi=e=>e,Mi=(e,t=Pi)=>{let n=Ri;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);Kr.und(n)||(o[r]=n)}return o},Ri=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Li={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 Ai(e){const t=function(e){const t={};let n=0;if(Xr(e,((e,o)=>{Li[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Xr(e,((e,o)=>o in t||(n[o]=e))),n}return Bi({},e)}function Di(e){return e=Fl(e),Kr.arr(e)?e.map(Di):ni(e)?ll.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Oi(e){for(const t in e)return!0;return!1}function Fi(e){return Kr.fun(e)||Kr.arr(e)&&Kr.obj(e[0])}function zi(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Vi(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const Hi=Bi({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class Gi{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,Hi)}}function Ui(e,t){if(Kr.und(t.decay)){const n=!Kr.und(t.tension)||!Kr.und(t.friction);!n&&Kr.und(t.frequency)&&Kr.und(t.damping)&&Kr.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Wi=[];class $i{constructor(){this.changed=!1,this.values=Wi,this.toValues=null,this.fromValues=Wi,this.to=void 0,this.from=void 0,this.config=new Gi,this.immediate=!1}}function ji(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=Ii(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)f();else{Kr.und(n.pause)||(r.paused=Ii(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Ii(e,t)),c=xi(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-xr.now()}function m(){c>0?(u=xr.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(Bi({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const Ki=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Xi(e.get()):t.every((e=>e.noop))?qi(e.get()):Yi(e.get(),t.every((e=>e.finished))),qi=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Yi=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Xi=e=>({value:e,cancelled:!0,finished:!1});function Zi(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=Mi(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)&&Xi(o)||r!==n.asyncId&&Yi(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new Ji,i=new es;return(async()=>{if(ll.skipAnimation)throw Qi(n),i.result=Yi(o,!1),d(i),i;m(l);const s=Kr.obj(e)?Bi({},e):Bi({},t,{to:e});s.parentId=r,Xr(c,((e,t)=>{Kr.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(ll.skipAnimation)return Qi(n),Yi(o,!1);try{let t;t=Kr.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=Yi(o.get(),!0,!1)}catch(e){if(e instanceof Ji)g=e.result;else{if(!(e instanceof es))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 Kr.fun(i)&&xr.batchedUpdates((()=>{i(g,o,o.item)})),g})():a}function Qi(e,t){Qr(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Ji 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 es extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const ts=e=>e instanceof os;let ns=1;class os extends Hl{constructor(...e){super(...e),this.id=ns++,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=ui(this);return e&&e.getValue()}to(...e){return ll.to(this,e)}interpolate(...e){return ei(`${Ql}The "interpolate" function is deprecated in v9 (use "to" instead)`),ll.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){Vl(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||ul.sort(this),Vl(this,{type:"priority",parent:this,priority:e})}}const rs=Symbol.for("SpringPhase"),ls=e=>(1&e[rs])>0,is=e=>(2&e[rs])>0,ss=e=>(4&e[rs])>0,as=(e,t)=>t?e[rs]|=3:e[rs]&=-3,cs=(e,t)=>t?e[rs]|=4:e[rs]&=-5;class us extends os{constructor(e,t){if(super(),this.key=void 0,this.animation=new $i,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,!Kr.und(e)||!Kr.und(t)){const n=Kr.obj(e)?Bi({},e):Bi({},t,{from:e});Kr.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(is(this)||this._state.asyncTo)||ss(this)}get goal(){return Fl(this.animation.to)}get velocity(){const e=ui(this);return e instanceof fi?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return ls(this)}get isAnimating(){return is(this)}get isPaused(){return ss(this)}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=pi(o.to);!i&&Ol(o.to)&&(l=Zr(Fl(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=Kr.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(Kr.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=!Kr.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=ui(this),a=s.getValue();if(t){const e=Fl(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 xr.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(is(this)){const{to:e,config:t}=this.animation;xr.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 Kr.und(e)?(n=this.queue||[],this.queue=[]):n=[Kr.obj(e)?e:Bi({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Ki(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Qi(this._state,e&&this._lastCallId),xr.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=Kr.obj(n)?n[t]:n,(null==n||Fi(n))&&(n=void 0),o=Kr.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return ls(this)||(e.reverse&&([n,o]=[o,n]),o=Fl(o),Kr.und(o)?ui(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Bi({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Mi(n,((e,t)=>/^on/.test(t)?Ti(e,o):e))),vs(this,n,"onProps"),bs(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 ji(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{ss(this)||(cs(this,!0),Jr(i.pauseQueue),bs(this,"onPause",Yi(this,ds(this,this.animation.to)),this))},resume:()=>{ss(this)&&(cs(this,!1),is(this)&&this._resume(),Jr(i.resumeQueue),bs(this,"onResume",Yi(this,ds(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=ps(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Xi(this));const o=!Kr.und(e.to),r=!Kr.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Xi(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&&!Kr.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!qr(d,c);p&&(s.from=d),d=Fl(d);const m=!qr(u,a);m&&this._focus(u);const f=Fi(t.to),{config:g}=s,{decay:h,velocity:v}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&(Ui(n=Bi({},n),t),t=Bi({},n,t)),Ui(e,t),Object.assign(e,t);for(const t in Hi)null==e[t]&&(e[t]=Hi[t]);let{mass:o,frequency:r,damping:l}=e;Kr.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,xi(t.config,l),t.config!==i.config?xi(i.config,l):void 0);let b=ui(this);if(!b||Kr.und(u))return n(Yi(this,!0));const k=Kr.und(t.reset)?r&&!t.default:!Kr.und(d)&&Ii(t.reset,l),_=k?d:this.get(),y=Di(u),E=Kr.num(y)||Kr.arr(y)||ni(y),C=!f&&(!E||Ii(i.immediate||t.immediate,l));if(m){const e=_i(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=Ol(u),B=!1;if(!w){const e=k||!ls(this)&&p;(m||e)&&(B=qr(Di(_),y),w=!B),(qr(s.immediate,C)||C)&&qr(g.decay,h)&&qr(g.velocity,v)||(w=!0)}if(B&&is(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!f&&((w||Ol(a))&&(s.values=b.getPayload(),s.toValues=Ol(u)?null:S==gi?[1]:Zr(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;Yr(hs,(e=>vs(this,t,e)));const o=Yi(this,ds(this,a));Jr(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&xr.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?xi(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),f?n(Zi(t.to,t,this._state,this)):w?this._start():is(this)&&!m?this._pendingCalls.add(n):n(qi(_))}_focus(e){const t=this.animation;e!==t.to&&(zl(this)&&this._detach(),t.to=e,zl(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Ol(t)&&(Ul(t,this),ts(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Ol(e)&&Wl(e,this)}_set(e,t=!0){const n=Fl(e);if(!Kr.und(n)){const e=ui(this);if(!e||!qr(n,e.getValue())){const o=_i(n);e&&e.constructor==o?e.setValue(n):di(this,o.create(n)),e&&xr.batchedUpdates((()=>{this._onChange(n,t)}))}}return ui(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,bs(this,"onStart",Yi(this,ds(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),xi(this.animation.onChange,e,this)),xi(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;ui(this).reset(Fl(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),is(this)||(as(this,!0),ss(this)||this._resume())}_resume(){ll.skipAnimation?this.finish():ul.start(this)}_stop(e,t){if(is(this)){as(this,!1);const n=this.animation;Yr(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Vl(this,{type:"idle",parent:this});const o=t?Xi(this.get()):Yi(this.get(),ds(this,null!=e?e:n.to));Jr(this._pendingCalls,o),n.changed&&(n.changed=!1,bs(this,"onRest",o,this))}}}function ds(e,t){const n=Di(t);return qr(Di(e.get()),n)}function ps(e,t=e.loop,n=e.to){let o=xi(t);if(o){const r=!0!==o&&Ai(o),l=(r||e).reverse,i=!r||r.reset;return ms(Bi({},e,{loop:t,default:!1,pause:void 0,to:!l||Fi(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function ms(e){const{to:t,from:n}=e=Ai(e),o=new Set;return Kr.obj(t)&&gs(t,o),Kr.obj(n)&&gs(n,o),e.keys=o.size?Array.from(o):null,e}function fs(e){const t=ms(e);return Kr.und(t.default)&&(t.default=Mi(t)),t}function gs(e,t){Xr(e,((e,n)=>null!=e&&t.add(n)))}const hs=["onStart","onRest","onChange","onPause","onResume"];function vs(e,t,n){e.animation[n]=t[n]!==Ni(t,n)?Ti(t[n],e.key):void 0}function bs(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 ks=["onStart","onChange","onRest"];let _s=1;class ys{constructor(e,t){this.id=_s++,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(Bi({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];Kr.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(ms(e)),this}start(e){let{queue:t}=this;return e?t=Zr(e).map(ms):this.queue=[],this._flush?this._flush(this,t):(Is(this,t),Es(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Yr(Zr(t),(t=>n[t].stop(!!e)))}else Qi(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Kr.und(e))this.start({pause:!0});else{const t=this.springs;Yr(Zr(e),(e=>t[e].pause()))}return this}resume(e){if(Kr.und(e))this.start({pause:!1});else{const t=this.springs;Yr(Zr(e),(e=>t[e].resume()))}return this}each(e){Xr(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,Qr(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&&Qr(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,Qr(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)}xr.onFrame(this._onFrame)}}function Es(e,t){return Promise.all(t.map((t=>Cs(e,t)))).then((t=>Ki(e,t)))}async function Cs(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=Kr.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Kr.arr(r)||Kr.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Yr(ks,(n=>{const o=t[n];if(Kr.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,Jr(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===Ni(t,"cancel");(u||m&&d.asyncId)&&p.push(ji(++e._lastAsyncId,{props:t,state:d,actions:{pause:jr,resume:jr,start(t,n){m?(Qi(d,e._lastAsyncId),n(Xi(e))):(t.onRest=s,n(Zi(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=Ki(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=ps(t,i,r);if(n)return Is(e,[n]),Cs(e,n,!0)}return a&&xr.batchedUpdates((()=>a(f,e,e.item))),f}function Ss(e,t){const n=Bi({},e.springs);return t&&Yr(Zr(t),(e=>{Kr.und(e.keys)&&(e=ms(e)),Kr.obj(e.to)||(e=Bi({},e,{to:void 0})),xs(n,e,(e=>Bs(e)))})),ws(e,n),n}function ws(e,t){Xr(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Ul(t,e))}))}function Bs(e,t){const n=new us;return n.key=e,t&&Ul(n,t),n}function xs(e,t,n){t.keys&&Yr(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Is(e,t){Yr(t,(t=>{xs(e.springs,t,(t=>Bs(t,e)))}))}const Ts=["children"],Ns=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,Ts);const o=(0,Wr.useContext)(Ps),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Wr.useState)((()=>({inputs:t,result:e()}))),o=(0,Wr.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,Wr.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=Ps;return Wr.createElement(i,{value:n},t)},Ps=(Ms=Ns,Rs={},Object.assign(Ms,Wr.createContext(Rs)),Ms.Provider._context=Ms,Ms.Consumer._context=Ms,Ms);var Ms,Rs;Ns.Provider=Ps.Provider,Ns.Consumer=Ps.Consumer;const Ls=()=>{const e=[],t=function(t){ti(`${Ql}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 Yr(e,((e,r)=>{if(Kr.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 Yr(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Yr(e,(e=>e.resume(...arguments))),this},t.set=function(t){Yr(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Yr(e,((e,o)=>{if(Kr.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 Yr(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Yr(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Kr.fun(e)?e(n,t):e};return t._getProps=n,t};function As(e,t,n){const o=Kr.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Wr.useMemo)((()=>o||3==arguments.length?Ls():void 0),[]),l=(0,Wr.useRef)(0),i=li(),s=(0,Wr.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Ss(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Es(e,t):new Promise((o=>{ws(e,n),s.queue.push((()=>{o(Es(e,t))})),i()}))}})),[]),a=(0,Wr.useRef)([...s.ctrls]),c=[],u=si(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new ys(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=fs(n))}}(0,Wr.useMemo)((()=>{Yr(a.current.slice(e,u),(e=>{zi(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,Wr.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Ss(e,c[t]))),m=(0,Wr.useContext)(Ns),f=si(m),g=m!==f&&Oi(m);ai((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Yr(e,(e=>e()))),Yr(a.current,((e,t)=>{null==r||r.add(e),g&&e.start({default:m});const n=c[t];n&&(Vi(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),oi((()=>()=>{Yr(s.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>Bi({},e)));return r?[h,r]:h}let Ds;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Ds||(Ds={}));class Os extends os{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Rl(...t);const n=this._get(),o=_i(n);di(this,o.create(n))}advance(e){const t=this._get();qr(t,this.get())||(ui(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&zs(this._active)&&Vs(this)}_get(){const e=Kr.arr(this.source)?this.source.map(Fl):Zr(Fl(this.source));return this.calc(...e)}_start(){this.idle&&!zs(this._active)&&(this.idle=!1,Yr(pi(this),(e=>{e.done=!1})),ll.skipAnimation?(xr.batchedUpdates((()=>this.advance())),Vs(this)):ul.start(this))}_attach(){let e=1;Yr(Zr(this.source),(t=>{Ol(t)&&Ul(t,this),ts(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Yr(Zr(this.source),(e=>{Ol(e)&&Wl(e,this)})),this._active.clear(),Vs(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=Zr(this.source).reduce(((e,t)=>Math.max(e,(ts(t)?t.priority:0)+1)),0))}}function Fs(e){return!1!==e.idle}function zs(e){return!e.size||Array.from(e).every(Fs)}function Vs(e){e.idle||(e.idle=!0,Yr(pi(e),(e=>{e.done=!0})),Vl(e,{type:"idle",parent:e}))}ll.assign({createStringInterpolator:Zl,to:(e,t)=>new Os(e,t)}),ul.advance;var Hs=window.ReactDOM;function Gs(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 Us=["style","children","scrollTop","scrollLeft"],Ws=/^--/;function $s(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Ws.test(e)||Ks.hasOwnProperty(e)&&Ks[e]?(""+t).trim():t+"px"}const js={};let Ks={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 qs=["Webkit","Ms","Moz","O"];Ks=Object.keys(Ks).reduce(((e,t)=>(qs.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Ks);const Ys=["x","y","z"],Xs=/^(matrix|translate|scale|rotate|skew)/,Zs=/^(translate)/,Qs=/^(rotate|skew)/,Js=(e,t)=>Kr.num(e)&&0!==e?e+t:e,ea=(e,t)=>Kr.arr(e)?e.every((e=>ea(e,t))):Kr.num(e)?e===t:parseFloat(e)===t;class ta extends vi{constructor(e){let{x:t,y:n,z:o}=e,r=Gs(e,Ys);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Js(e,"px"))).join(",")})`,ea(e,0)]))),Xr(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(Xs.test(t)){if(delete r[t],Kr.und(e))return;const n=Zs.test(t)?"px":Qs.test(t)?"deg":"";l.push(Zr(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Js(r,n)})`,ea(r,0)]:e=>[`${t}(${e.map((e=>Js(e,n))).join(",")})`,ea(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new na(l,i)),super(r)}}class na extends Hl{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 Yr(this.inputs,((n,o)=>{const r=Fl(n[0]),[l,i]=this.transforms[o](Kr.arr(r)?r:n.map(Fl));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Yr(this.inputs,(e=>Yr(e,(e=>Ol(e)&&Ul(e,this)))))}observerRemoved(e){0==e&&Yr(this.inputs,(e=>Yr(e,(e=>Ol(e)&&Wl(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Vl(this,e)}}const oa=["scrollTop","scrollLeft"];ll.assign({batchedUpdates:Hs.unstable_batchedUpdates,createStringInterpolator:Zl,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 ra=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new vi(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=wi(e)||"Anonymous";return(e=Kr.str(e)?l[e]||(l[e]=Ei(e,r)):e[Si]||(e[Si]=Ei(e,r))).displayName=`Animated(${t})`,e};return Xr(e,((t,n)=>{Kr.arr(e)&&(n=wi(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=Gs(o,Us),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:js[t]||(js[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=$s(t,r[t]);Ws.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 ta(e),getComponentProps:e=>Gs(e,oa)}).animated,la=e=>e+1,ia=e=>({top:e.offsetTop,left:e.offsetLeft});var sa=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)(la,0),[u,p]=(0,s.useReducer)(la,0),[m,f]=(0,s.useState)({x:0,y:0}),g=(0,s.useMemo)((()=>l.current?ia(l.current):null),[r]),h=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,ir.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=ia(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=Kr.fun(e),[[o],r]=As(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",ca=".block-list-appender";function ua(e,t){return t.closest([aa,ca].join(","))===e}function da(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isMultiSelecting:o,isNavigationMode:r,isBlockSelected:l}=t(zn);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=ir.focus.tabbable.find(t.current).filter((e=>(0,ir.isTextField)(e))),r=-1===n,l=(r?u.last:u.first)(o)||t.current;ua(t.current,l)?(0,ir.placeCaretAtHorizontalEdge)(l,r):t.current.focus()}),[n]),t}function pa(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function ma(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(zn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",pa),t.addEventListener("mouseover",pa),()=>{t.removeEventListener("mouseout",pa),t.removeEventListener("mouseover",pa),t.classList.remove("is-hovered")}}),[e])}function fa(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(zn),{__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 ga(e){return(0,m.useSelect)((t=>{const n=t(zn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function ha(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(zn),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 va(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(zn);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 ba(e){const{isBlockSelected:t}=(0,m.useSelect)(zn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((r=>{function l(l){t(e)?l.target.isContentEditable||o(e):ua(r,l.target)&&n(e)}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var ka=window.wp.keycodes;function _a(e){const t=(0,m.useSelect)((t=>t(zn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(zn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(zn);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!==ka.ENTER&&s!==ka.BACKSPACE&&s!==ka.DELETE||a!==i||(0,ir.isTextField)(a)||(t.preventDefault(),s===ka.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function ya(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(zn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(zn);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 Ea=n(4979),Ca=n.n(Ea);function Sa(e){const t=(0,s.useRef)(),n=(0,m.useSelect)((t=>{const{isBlockSelected:n,getBlockSelectionEnd:o}=t(zn);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,ir.getScrollContainer)(e)||e.ownerDocument.defaultView;o&&Ca()(e,o,{onlyScrollIfNeeded:!0})}),[n]),t}const wa=(0,s.createContext)({refs:new Map,callbacks:new Map});function Ba(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(wa.Provider,{value:n},t)}function xa(e){const{refs:t,callbacks:n}=(0,s.useContext)(wa),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 Ia(e){const{refs:t}=(0,s.useContext)(wa),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 Ta(e){const{callbacks:t}=(0,s.useContext)(wa),n=Ia(e),[o,r]=(0,s.useState)(null);return(0,s.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function Na(e,t){Array.from(e.closest(".is-root-container").querySelectorAll(".rich-text")).forEach((e=>{t?e.setAttribute("contenteditable",!0):e.removeAttribute("contenteditable")}))}function Pa(e){const{startMultiSelect:t,stopMultiSelect:n,multiSelect:o,selectBlock:r}=(0,m.useDispatch)(zn),{isSelectionEnabled:l,isBlockSelected:i,getBlockParents:s,getBlockSelectionStart:a,hasMultiSelection:c}=(0,m.useSelect)(zn);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 Na(u,!0);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&&(Na(u,!0),l.rangeCount)){const{commonAncestorContainer:e}=l.getRangeAt(0);m.contains(e)&&m.focus()}}else{const t=[...s(e),e],n=[...s(i),i],r=Math.min(t.length,n.length)-1;o(t[r],n[r])}}function 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),Na(u,!1))}function b(t){if(l()&&0===t.button)if(t.shiftKey){const n=a(),r=s(n);if(n&&n!==e&&(null==r||!r.includes(e))){const l=[...r,n],i=[...s(e),e],a=Math.min(l.length,i.length)-1,c=l[a],d=i[a];c!==d&&(Na(u,!1),o(c,d),t.preventDefault())}}else c()&&r(e)}return u.addEventListener("mousedown",b),u.addEventListener("mouseleave",v),()=>{u.removeEventListener("mousedown",b),u.removeEventListener("mouseleave",v),d.removeEventListener("selectionchange",g),p.removeEventListener("mouseup",h),p.cancelAnimationFrame(f)}}),[e,t,n,o,r,l,i,s])}function Ma(){const e=(0,s.useContext)(fm);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Ra(){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)(La),{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(zn),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,da(n),Sa(n),xa(n),ba(n),Pa(n),_a(n),ya(n),ma(),Ma(),sa({isSelected:v,adjustScrolling:b,enableAnimation:k,triggerAnimationOnChange:a})]),C=Un();return f<2&&n===C.clientId&&"undefined"!=typeof process&&process.env,{...l,...e,ref:E,id:`block-${n}${y}`,tabIndex:0,role:"document","aria-label":_,"data-block":n,"data-type":p,"data-title":h,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,fa(n),ga(n),ha(n),va(n)),style:{...l.style,...e.style}}}Ra.save=r.__unstableGetBlockProps;const La=(0,s.createContext)();function Aa(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",Ra(o,{__unstableIsHtml:n}),t)}const Da=(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(zn),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}})),Oa=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(zn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(zn),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(zn),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(zn);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 Fa=(0,d.compose)(d.pure,Da,Oa,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){let{mode:t,isLocked:n,canRemove:o,clientId:l,isSelected:i,isSelectionEnabled:a,className:d,name:p,isValid:f,attributes:g,wrapperProps:h,setAttributes:v,onReplace:b,onInsertBlocksAfter:k,onMerge:_,toggleSelection:y}=e;const{removeBlock:E}=(0,m.useDispatch)(zn),C=(0,s.useCallback)((()=>E(l)),[l]);let S=(0,s.createElement)(pr,{name:p,isSelected:i,attributes:g,setAttributes:v,insertBlocksAfter:n?void 0:k,onReplace:o?b:void 0,onRemove:o?C:void 0,mergeBlocks:o?_:void 0,clientId:l,isSelectionEnabled:a,toggleSelection:y});const w=(0,r.getBlockType)(p);null!=w&&w.getEditWrapperProps&&(h=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}(h,w.getEditWrapperProps(g)));const B=h&&!!h["data-align"];let x;if(B&&(S=(0,s.createElement)("div",{className:"wp-block","data-align":h["data-align"]},S)),f)x="html"===t?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},S),(0,s.createElement)(Aa,{isHtml:!0},(0,s.createElement)(wr,{clientId:l}))):(null==w?void 0:w.apiVersion)>1?S:(0,s.createElement)(Aa,h,S);else{const e=(0,r.getSaveContent)(w,g);x=(0,s.createElement)(Aa,{className:"has-warning"},(0,s.createElement)(kr,{clientId:l}),(0,s.createElement)(s.RawHTML,null,(0,ir.safeHTML)(e)))}const I={clientId:l,className:d,wrapperProps:(0,u.omit)(h,["data-align"]),isAligned:B},T=(0,s.useMemo)((()=>I),Object.values(I));return(0,s.createElement)(La.Provider,{value:T},(0,s.createElement)(Cr,{fallback:(0,s.createElement)(Aa,{className:"has-warning"},(0,s.createElement)(yr,null))},x))})),za=window.wp.htmlEntities,Va=(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 Ha=[(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 Ga=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*Ha.length));return(0,s.createElement)(p.Tip,null,Ha[e])},Ua=(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"})),Wa=(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:Ua});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)})),$a=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(Rt()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(Wa,{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 ja(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(zn),{getBlockName:h,getBlocks:v}=a.select(zn),b=(0,m.useSelect)((e=>!t||e(zn).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(zn);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 Ka=(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(On,Fn),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)(zn);return(0,s.useEffect)((()=>{o(n)}),[n]),ja(e),(0,s.createElement)(Ba,null,t)}));function qa(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)(hm,null)))}function Ya(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(zn),{clearSelectedBlock:n}=(0,m.useDispatch)(zn);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 Xa(e){return(0,s.createElement)("div",i({ref:Ya()},e))}function Za(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 Qa(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r}=e(zn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r()}}function Ja(){const{isMultiSelecting:e,multiSelectedBlockClientIds:t,hasMultiSelection:n,selectedBlockClientId:o}=(0,m.useSelect)(Qa,[]),r=Ia(o),l=Ia((0,u.first)(t)),i=Ia((0,u.last)(t));return(0,d.useRefEffect)((s=>{const{ownerDocument:a}=s,{defaultView:c}=a;if(!n||e){if(!o||e)return;const t=c.getSelection();if(t.rangeCount&&!t.isCollapsed){const e=r.current,{startContainer:n,endContainer:o}=t.getRangeAt(0);!e||e.contains(n)&&e.contains(o)||t.removeAllRanges()}return}const{length:u}=t;if(u<2)return;if(!l.current||!i.current)return;s.focus();const d=c.getSelection(),p=a.createRange(),m=Za(l.current,"start"),f=Za(i.current,"end");var g;g=s,Array.from(g.querySelectorAll(".rich-text:not( .editor-post-title__input )")).forEach((e=>{e.removeAttribute("contenteditable")})),p.setStartBefore(m),p.setEndAfter(f),d.removeAllRanges(),d.addRange(p)}),[n,e,t,o])}function ec(e){const{tagName:t}=e;return"INPUT"===t||"BUTTON"===t||"SELECT"===t||"TEXTAREA"===t}function tc(e,t,n,o){let r,l=ir.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(!ir.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 nc(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksStartClientId:t,getMultiSelectedBlocksEndClientId:n,getPreviousBlockClientId:o,getNextBlockClientId:r,getFirstMultiSelectedBlockClientId:l,getLastMultiSelectedBlockClientId:i,getSettings:s,hasMultiSelection:a}=(0,m.useSelect)(zn),{multiSelect:c,selectBlock:u}=(0,m.useDispatch)(zn);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===ka.UP,u=l===ka.DOWN,m=l===ka.LEFT,h=l===ka.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?ir.isVerticalEdge:ir.isHorizontalEdge,{ownerDocument:S}=d,{defaultView:w}=S;if(a())return void(_&&((y?f:g)(v),t.preventDefault()));if(k?p||(p=(0,ir.computeCaretRect)(w)):p=null,t.defaultPrevented)return;if(!_)return;if(!function(e,t,n){if((t===ka.UP||t===ka.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(i,l,E))return;const B=(0,ir.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=tc(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,ir.isVerticalEdge)(i,v)&&!x){const e=tc(i,v,d,!0);e&&((0,ir.placeCaretAtVerticalEdge)(e,v,p),t.preventDefault())}else if(b&&w.getSelection().isCollapsed&&(0,ir.isHorizontalEdge)(i,B)&&!x){const e=tc(i,B,d);(0,ir.placeCaretAtHorizontalEdge)(e,v),t.preventDefault()}}return d.addEventListener("mousedown",m),d.addEventListener("keydown",h),()=>{d.removeEventListener("mousedown",m),d.removeEventListener("keydown",h)}}),[])}var oc=window.wp.keyboardShortcuts;function rc(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(zn),{multiSelect:o}=(0,m.useDispatch)(zn),r=(0,oc.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;if(!(0,ir.isEntirelySelected)(l.target))return;const i=t(),[s]=i,a=n(s);let c=e(a);i.length===c.length&&(c=e(n(a)));const d=(0,u.first)(c),p=(0,u.last)(c);d!==p&&(o(d,p),l.preventDefault())}return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}}),[])}function lc(){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)(zn),{setNavigationMode:a}=(0,m.useDispatch)(zn),c=(0,m.useSelect)((e=>e(zn).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";ir.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===ka.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==ka.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(ec(e.target)&&ec(ir.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!==ka.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=ir.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(zn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,Ja(),rc(),nc(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,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]=lc();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 sc="editor-styles-wrapper";function ac(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var cc=(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=ac(null==a?void 0:a.styles),_=ac(null==a?void 0:a.scripts),y=Ya(),[E,C,S]=lc(),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(`.${sc}`)||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()(sc,...v)},(0,s.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&S)})),uc={grad:.9,turn:360,rad:360/(2*Math.PI)},dc=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},pc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},mc=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},fc=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},gc=function(e){return{r:mc(e.r,0,255),g:mc(e.g,0,255),b:mc(e.b,0,255),a:mc(e.a)}},hc=function(e){return{r:pc(e.r),g:pc(e.g),b:pc(e.b),a:pc(e.a,3)}},vc=/^#([0-9a-f]{3,8})$/i,bc=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},kc=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}},_c=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}},yc=function(e){return{h:fc(e.h),s:mc(e.s,0,100),l:mc(e.l,0,100),a:mc(e.a)}},Ec=function(e){return{h:pc(e.h),s:pc(e.s),l:pc(e.l),a:pc(e.a,3)}},Cc=function(e){return _c((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},Sc=function(e){return{h:(t=kc(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},wc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Bc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,xc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ic=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Tc={string:[[function(e){var t=vc.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?pc(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?pc(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=xc.exec(e)||Ic.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:gc({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=wc.exec(e)||Bc.exec(e);if(!t)return null;var n,o,r=yc({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(uc[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Cc(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 dc(t)&&dc(n)&&dc(o)?gc({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(!dc(t)||!dc(n)||!dc(o))return null;var i=yc({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return Cc(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!dc(t)||!dc(n)||!dc(o))return null;var i=function(e){return{h:fc(e.h),s:mc(e.s,0,100),v:mc(e.v,0,100),a:mc(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return _c(i)},"hsv"]]},Nc=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]},Pc=function(e,t){var n=Sc(e);return{h:n.h,s:mc(n.s+100*t,0,100),l:n.l,a:n.a}},Mc=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Rc=function(e,t){var n=Sc(e);return{h:n.h,s:n.s,l:mc(n.l+100*t,0,100),a:n.a}},Lc=function(){function e(e){this.parsed=function(e){return"string"==typeof e?Nc(e.trim(),Tc.string):"object"==typeof e&&null!==e?Nc(e,Tc.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 pc(Mc(this.rgba),2)},e.prototype.isDark=function(){return Mc(this.rgba)<.5},e.prototype.isLight=function(){return Mc(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=hc(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?bc(pc(255*r)):"","#"+bc(t)+bc(n)+bc(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return hc(this.rgba)},e.prototype.toRgbString=function(){return t=(e=hc(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 Ec(Sc(this.rgba))},e.prototype.toHslString=function(){return t=(e=Ec(Sc(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=kc(this.rgba),{h:pc(e.h),s:pc(e.s),v:pc(e.v),a:pc(e.a,3)};var e},e.prototype.invert=function(){return Ac({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),Ac(Pc(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Ac(Pc(this.rgba,-e))},e.prototype.grayscale=function(){return Ac(Pc(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Ac(Rc(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Ac(Rc(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?Ac({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):pc(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Sc(this.rgba);return"number"==typeof e?Ac({h:e,s:t.s,l:t.l,a:t.a}):pc(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Ac(e).toHex()},e}(),Ac=function(e){return e instanceof Lc?e:new Lc(e)},Dc=[],Oc=function(e){e.forEach((function(e){Dc.indexOf(e)<0&&(e(Lc,Tc),Dc.push(e))}))};function Fc(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 zc=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Vc=function(e){return.2126*zc(e.r)+.7152*zc(e.g)+.0722*zc(e.b)};function Hc(e){e.prototype.luminance=function(){return e=Vc(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=Vc(l))>(a=Vc(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 Gc=n(3692),Uc=n.n(Gc);const Wc=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function $c(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 jc(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=jc(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Wc,""),value:n?jc(n[0]).replace(Wc,""):""});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=jc(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:jc(t[1]),media:jc(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=jc(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=jc(t[1]),o=jc(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 Kc(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function jc(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Kc(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){Kc(e,o)})):n&&"object"==typeof n&&Kc(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var qc=n(5717),Yc=n.n(qc),Xc=Zc;function Zc(e){this.options=e||{}}Zc.prototype.emit=function(e){return e},Zc.prototype.visit=function(e){return this[e.type](e)},Zc.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 Qc=Jc;function Jc(e){Xc.call(this,e)}Yc()(Jc,Xc),Jc.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Jc.prototype.comment=function(e){return this.emit("",e.position)},Jc.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Jc.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Jc.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("}")},Jc.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Jc.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Jc.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Jc.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Jc.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Jc.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("}")},Jc.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Jc.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Jc.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Jc.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("}"):""},Jc.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var eu=tu;function tu(e){e=e||{},Xc.call(this,e),this.indentation=e.indent}Yc()(tu,Xc),tu.prototype.compile=function(e){return this.stylesheet(e)},tu.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},tu.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},tu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},tu.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}")},tu.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}")},tu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},tu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},tu.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}")},tu.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)+"}")},tu.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")},tu.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}")},tu.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}")},tu.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}")},tu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},tu.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()+"}"):""},tu.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},tu.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var nu=function(e,t){try{const r=$c(e);return n=Uc().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new Qc(o):new eu(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function ou(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 ru(e,t){return new URL(e,t).toString()}var lu=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]};ou(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+ru(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 su=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},au=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(su(t)),o&&r.push(lu(o)),r.length?nu(n,(0,d.compose)(r)):n}))};const cu=".editor-styles-wrapper";function uu(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(cu);let l;if(r)l=n.getComputedStyle(r,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),l=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=Ac(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function du(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>au(t,cu)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:uu(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}let pu;Oc([Fc,Hc]);const mu=2e3;var fu=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(zn).getSettings();return{styles:t.styles,assets:t.__unstableResolvedAssets}}),[]),u=(0,s.useMemo)((()=>a?[...a,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:a),[a]);pu=pu||(0,d.pure)(hm);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>mu?mu*f:void 0}},(0,s.createElement)(cc,{head:(0,s.createElement)(du,{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:mu}},l,(0,s.createElement)(pu,{renderAppender:!1}))))},gu=(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(zn).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)(Ka,{value:c,settings:a},r?(0,s.createElement)(qa,{onClick:l}):(0,s.createElement)(fu,{viewportWidth:o,__experimentalPadding:n})):null}));function hu(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(zn).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)(Ka,{value:p,settings:a},(0,s.createElement)(bm,{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 vu=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)(gu,{__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)($a,{title:i,icon:a,description:c}))},bu=(0,s.createContext)(),ku=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(bu);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)}))})),_u=(0,s.createElement)(O.SVG,{width:"18",height:"18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18"},(0,s.createElement)(O.Path,{d:"M5 4h2V2H5v2zm6-2v2h2V2h-2zm-6 8h2V8H5v2zm6 0h2V8h-2v2zm-6 6h2v-2H5v2zm6 0h2v-2h-2v2z"}));function yu(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)(Wa,{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)(Wa,{icon:_u})))))}var Eu=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)(yu,{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 Cu(){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 Su=(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)(Eu,{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)(ku,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,Cu()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===ka.ENTER&&(e.preventDefault(),l(o,Cu()?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)(Wa,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},o.title)))}))})),wu=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,Nt.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))})),Bu=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(bu);return(0,s.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),xu=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(wu,{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)(Bu,{key:t},e.map(((e,l)=>(0,s.createElement)(Su,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a,isFirst:0===t&&0===l})))))),l)},Iu=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))},Tu=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(zn),{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])]},Nu=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(bu.Provider,{value:n},t)};const Pu=[];var Mu=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,c]=Tu(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:Pu);return(0,s.createElement)(Nu,null,(0,s.createElement)("div",null,r&&!!p.length&&(0,s.createElement)(Iu,{title:(0,g._x)("Most used","blocks")},(0,s.createElement)(xu,{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)(Iu,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(xu,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(Iu,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,g.__)("Uncategorized")},(0,s.createElement)(xu,{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)(Iu,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(xu,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))},Ru=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"))))},Lu=window.wp.notices,Au=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(zn);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(Lu.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 Du(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)(Du)}`;return(0,s.createElement)(Eu,{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)(gu,{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 Ou(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Fu=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)(Du,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(Ou,{key:e.name}))))};function zu(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 Vu(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 Hu=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)(Vu,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(zu,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},Gu=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(wo,{className:"block-editor-inserter__no-results-icon",icon:Ua}),(0,s.createElement)("p",null,(0,g.__)("No results found.")))},Uu=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(zn),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(zn),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)(zn),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,Nt.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 Wu=e=>e.name||"",$u=e=>e.title,ju=e=>e.description||"",Ku=e=>e.keywords||[],qu=e=>e.category,Yu=()=>null;function Xu(){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 Zu=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(Xu(e))},Qu=(e,t)=>(0,u.differenceWith)(e,Zu(t),((e,t)=>t.includes(e))),Ju=(e,t,n,o)=>0===Zu(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=Zu(t);if(0===o.length)return e;const r=e.map((e=>[e,td(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 td(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Wu,getTitle:r=$u,getDescription:l=ju,getKeywords:i=Ku,getCategory:s=qu,getCollection:a=Yu}=n,c=o(e),d=r(e),p=l(e),m=i(e),f=s(e),g=a(e),h=Xu(t),v=Xu(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===Qu(t,e).length&&(b+=10)}return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}function nd(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 od=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Nt.speak,500),[l,i]=Uu({shouldFocusBlock:!0}),[a,,c]=Au(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)(nd,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(Nu,null,!f&&(0,s.createElement)(Gu,null),f&&(0,s.createElement)(Fu,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function rd(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)(Hu,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,s.createElement)(od,{filterValue:o,selectedCategory:l,patternCategories:n}))}var ld=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)(rd,n))};function id(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=Au(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)(Fu,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}var sd=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,s.useState)(!1),[a,c]=Au(),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,!l&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ru,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),(0,s.createElement)(id,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d})),l&&(0,s.createElement)(ld,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},ad=window.wp.url;function cd(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=Tu(o,n),i=(0,s.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,s.createElement)(Gu,null):(0,s.createElement)(Iu,{title:(0,g.__)("Reusable blocks")},(0,s.createElement)(xu,{items:i,onSelect:l,onHover:t,label:(0,g.__)("Reusable blocks")}))}var ud=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(cd,{onHover:o,onInsert:n,rootClientId:t}),(0,s.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,s.createElement)("a",{className:"block-editor-inserter__manage-reusable-blocks",href:(0,ad.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,g.__)("Manage Reusable blocks"))))};const{Fill:dd,Slot:pd}=(0,p.createSlotFill)("__unstableInserterMenuExtension");dd.Slot=pd;var md=dd;const fd=[];var gd=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}=e;const b=(0,d.useDebounce)(Nt.speak,500),[k,_]=Uu({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[y,E,C,S]=Tu(k,_),[w,,B]=Au(_,k),x=(0,s.useMemo)((()=>{const e=Ju((0,u.orderBy)(y,["frecency"],["desc"]),E,C,t);return void 0!==m?e.slice(0,m):e}),[t,y,E,C,m]),I=(0,s.useMemo)((()=>{const e=ed(w,t);return void 0!==c?e.slice(0,c):e}),[t,w,c]);(0,s.useEffect)((()=>{if(!t)return;const e=x.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);b(n)}),[t,b]);const T=(0,d.useAsyncList)(x,{step:9}),N=(0,d.useAsyncList)(T.length===x.length?I:fd),P=!(0,u.isEmpty)(x)||!(0,u.isEmpty)(I);return(0,s.createElement)(Nu,null,!f&&!P&&(0,s.createElement)(Gu,null),!!x.length&&(0,s.createElement)(Iu,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("Blocks"))},(0,s.createElement)(xu,{items:T,onSelect:S,onHover:o,label:(0,g.__)("Blocks"),isDraggable:h})),!!x.length&&!!I.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),!!I.length&&(0,s.createElement)(Iu,{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)(Fu,{shownPatterns:N,blockPatterns:I,onClickPattern:B,isDraggable:h}))),f&&(0,s.createElement)(md.Slot,{fillProps:{onSelect:S,onHover:o,filterValue:t,hasItems:P,rootClientId:k}},(e=>e.length?e:P?null:(0,s.createElement)(Gu,null))))};const hd={name:"blocks",
|
22 |
/* translators: Blocks tab title in the block inserter. */
|
23 |
+
title:(0,g.__)("Blocks")},vd={name:"patterns",
|
24 |
/* translators: Patterns tab title in the block inserter. */
|
25 |
+
title:(0,g.__)("Patterns")},bd={name:"reusable",
|
26 |
/* translators: Reusable blocks tab title in the block inserter. */
|
27 |
+
title:(0,g.__)("Reusable")};var kd=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,s.useMemo)((()=>{const e=[hd];return n&&e.push(vd),o&&e.push(bd),e}),[hd,n,vd,o,bd]);return(0,s.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)},_d=(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]=Uu({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(zn);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)(Mu,{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)(Ga,null)))),[y,B,I,f,c,a]),P=(0,s.useMemo)((()=>(0,s.createElement)(sd,{rootClientId:y,onInsert:x,onClickCategory:T,selectedCategory:k})),[y,x,T,k]),M=(0,s.useMemo)((()=>(0,s.createElement)(ud,{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)(gd,{filterValue:f,onSelect:i,onHover:I,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!f&&(S||w)&&(0,s.createElement)(kd,{showPatterns:S,showReusableBlocks:w},R),!f&&!S&&!w&&N)),a&&v&&(0,s.createElement)(vu,{item:v}))}));function yd(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r}=e;const[l,i]=(0,s.useState)(""),[a,u]=Uu({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[d]=Tu(a,u),[f]=Au(u,a),h=f.length&&!!l,v=h&&f.length>6||d.length>6,{setInserterIsOpened:b,insertionIndex:k}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(zn),l=n(o);return{setInserterIsOpened:t().__experimentalSetIsInserterOpened,insertionIndex:-1===l?r():l}}),[o,n]);return(0,s.useEffect)((()=>{b&&b(!1)}),[b]),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":v,"has-expand":b})},v&&(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",value:l,onChange:e=>{i(e)},label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(gd,{filterValue:l,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:h?2:0,maxBlockTypes:6,isDraggable:!1})),b&&(0,s.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{b({rootClientId:n,insertionIndex:k,filterValue:l})},"aria-label":(0,g.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,g.__)("Browse all")))}const Ed=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:Va,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 Cd 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=Ed}=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)(yd,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r}):(0,s.createElement)(_d,{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 Sd=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{getBlockRootClientId:l,hasInserterItems:i,__experimentalGetAllowedBlocks:s,__experimentalGetDirectInsertBlock:a}=e(zn),{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(zn);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(zn);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(zn);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,Nt.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(Cd),wd=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(zn),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(zn);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,za.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=>{ka.ENTER!==e.keyCode&&ka.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(Sd,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Bd(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,s.createElement)(Sd,{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)(wo,{icon:Va}));return(f||m)&&(h=(0,s.createElement)(p.Tooltip,{text:n},h)),h},isAppender:!0})}const xd=(0,s.forwardRef)(((e,t)=>(Rt()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Bd(e,t))));var Id=(0,s.forwardRef)(Bd),Td=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(zn);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)(wd,{rootClientId:n}):(0,s.createElement)(Id,{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 Nd(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 Pd=(0,s.createContext)();function Md(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(zn),l=(0,s.useContext)(Pd),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(zn),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=Ta(u),k=Ta(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=Nd(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)(Sd,{position:"bottom center",clientId:f,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Rd(e){let{children:t,__unstablePopoverSlot:n,__unstableContentRef:o}=e;const r=(0,m.useSelect)((e=>e(zn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(Pd.Provider,{value:(0,s.useRef)(!1)},r&&(0,s.createElement)(Md,{__unstablePopoverSlot:n,__unstableContentRef:o}),t)}function Ld(){const e=(0,s.useContext)(Pd),t=(0,m.useSelect)((e=>e(zn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(zn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(zn);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 Ad="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Dd="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Od(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(zn),{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 Fd(e){let{clientId:t}=e;const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=e(zn),i=n(t);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(t),name:i,reusableBlockTitle:s&&l(o(t).ref)}}),[t]),i=Od(t);if(!o||!i)return null;const s=(0,r.getBlockType)(o),a=s?(0,r.__experimentalGetBlockLabel)(s,n):null,c=l||a;return c&&c!==s.title?(0,u.truncate)(c,{length:35}):i.title}var zd=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(zn),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,ir.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)(zn);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)(yu,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},Vd=function(e){let{clientId:t,rootClientId:n,blockElement:o}=e;const l=Od(t),a=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(zn),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)(zn),_=(0,s.useRef)(),y=(0,r.getBlockType)(d),E=(0,r.__experimentalGetAccessibleBlockLabel)(y,f,u+1,v);(0,s.useEffect)((()=>{_.current.focus(),(0,Nt.speak)(E)}),[E]);const{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:x,getMultiSelectedBlocksEndClientId:I,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(zn),{selectBlock:M,clearSelectedBlock:R,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(zn),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)(Wa,{icon:null==l?void 0:l.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(zd,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:_u,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===ka.UP,l=n===ka.DOWN,i=n===ka.LEFT,s=n===ka.RIGHT,a=n===ka.TAB,c=n===ka.ESCAPE,u=n===ka.ENTER,d=n===ka.SPACE,p=e.shiftKey;if(n===ka.BACKSPACE||n===ka.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=ir.focus.tabbable.findNext(t)}while(t&&o.contains(t));t||(t=o.ownerDocument.defaultView.frameElement,t=ir.focus.tabbable.findNext(t))}else t=ir.focus.tabbable.findPrevious(o);t&&(e.preventDefault(),t.focus(),R())}},label:E,className:"block-selection-button_select-button"},(0,s.createElement)(Fd,{clientId:t})))))};function Hd(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var Gd=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=!ir.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||Rt()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,s.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(a);return 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]=ir.focus.tabbable.find(e);t&&t.focus()}(e.current)}),[]);(0,oc.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=Hd(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=Hd(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)},Ud=(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"})),Wd=(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"})),$d=(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"})),jd=(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 Kd=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?Ud:Wd:$d:"down"===e?"horizontal"===t?(0,g.isRTL)()?Wd:Ud:jd:null,qd=(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,Yd=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const f=(0,d.useInstanceId)(Yd),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(zn),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)(zn),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:Kd(o,C),label:qd(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
|
34 |
+
(0,g.__)("Move %1$s block from position %2$d down to position %3$d"),t,s,s+1);if("left"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
35 |
+
(0,g.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s+1);if("right"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
36 |
+
(0,g.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s+1)}if(l>0&&r){const e=a("down");if("down"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
37 |
+
(0,g.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
38 |
+
(0,g.__)("Block %1$s is at the end 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)
|
39 |
+
(0,g.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=a("up");if("up"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
40 |
+
(0,g.__)("Move %1$s block from position %2$d up to position %3$d"),t,s,s-1);if("left"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
41 |
+
(0,g.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s-1);if("right"===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)))})),Xd=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Yd,i({direction:"up",ref:t},e)))),Zd=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Yd,i({direction:"down",ref:t},e))));var Qd=(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(zn),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)(zd,{clientIds:o,cloneClassname:"block-editor-block-mover__drag-clone"},(e=>(0,s.createElement)(p.Button,i({icon:_u,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)(Xd,i({clientIds:o},e)))),(0,s.createElement)(p.ToolbarItem,{onFocus:h,onBlur:v},(e=>(0,s.createElement)(Zd,i({clientIds:o},e))))))}));const{clearTimeout:Jd,setTimeout:ep}=window,tp=200;function np(e){let{ref:t,isFocused:n,debounceTimeout:o=tp,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&&Jd&&Jd(e)};return(0,s.useEffect)((()=>()=>d()),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),a.current=ep((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function op(e){let{ref:t,debounceTimeout:n=tp,onChange:o=u.noop}=e;const[r,l]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=np({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 rp(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(zn),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(zn),{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=Od(n),c=(0,s.useRef)(),{gestures:u}=op({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)(Wa,{icon:a.icon})}))}var lp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"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 ip(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)(gu,{viewportWidth:500,blocks:t})))))}var sp=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)(ip,{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)(Wa,{icon:n,showColors:!0}),l)})))},ap=(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"})),cp=window.wp.tokenList,up=n.n(cp);function dp(e,t,n){const o=new(up())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function pp(e){return(0,u.find)(e,"isDefault")}function mp(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:a}=(0,m.useSelect)((e=>{const{getBlock:n}=e(zn),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)(zn),d=function(e){return e&&0!==e.length?pp(e)?e:[{name:"default",label:(0,g._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(up())(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=dp(a,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:f,className:a}}function fp(e){let{clientId:t,onSwitch:n=u.noop}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=mp({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?ap:null,onClick:()=>o(e)},(0,s.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function gp(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)(fp,{clientId:o,onSwitch:n}))}const hp=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=hp(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 bp(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)(kp,{patterns:t,onSelect:n})))))}function kp(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)(_p,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function _p(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(_p,`${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)(gu,{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 yp=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=hp(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)(bp,{patterns:a,onSelect:o}),(0,s.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),i(!l)},icon:Ud},(0,g.__)("Patterns"))):null};const Ep=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(zn),l=Od(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(zn),{getBlockStyles:c,getBlockType:d}=e(r.store),{canRemoveBlocks:p}=e(zn),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:lp;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)(Wa,{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)(Wa,{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)(Fd,{clientId:t}))),toggleProps:{describedBy:E,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:l}=e;return C&&(0,s.createElement)("div",{className:"block-editor-block-switcher__container"},_&&(0,s.createElement)(yp,{blocks:n,patterns:h,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,s.createElement)(sp,{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)(gp,{hoveredBlock:n[0],onSwitch:l}))})))))};var Cp=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(zn).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)(Ep,{clientIds:t,blocks:n})},Sp=(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"})),wp=window.wp.blob;function Bp(){const{getBlockName:e}=(0,m.useSelect)(zn),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(Lu.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 xp(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o}=(0,m.useSelect)(zn),{flashBlock:l,removeBlocks:i,replaceBlocks:s}=(0,m.useDispatch)(zn),a=Bp();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,ir.documentHasUncollapsedSelection)(t):(0,ir.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,ir.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!o&&(o=r.map((e=>`<img src="${(0,wp.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 Ip=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:xp()},t)};function Tp(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,m.useSelect)(zn),{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)(zn),T=Bp();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 Np=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(zn),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(zn).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)})),Pp=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(zn).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(zn).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:Mp,Slot:Rp}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Mp.Slot=Rp;var Lp=Mp;function Ap(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(zn);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}const{Fill:Dp,Slot:Op}=(0,p.createSlotFill)("BlockSettingsMenuControls");function Fp(e){let{...t}=e;return(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(Dp,t))}Fp.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:o,selectedClientIds:l}=(0,m.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o}=e(zn),r=null!==n?n:o();return{selectedBlocks:(0,u.map)((0,u.compact)(t(r)),(e=>e.name)),selectedClientIds:r}}),[n]),a=function(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}=(0,m.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:l,getSelectedBlockClientIds:i}=e(zn),{getGroupingBlockName:s}=e(r.store),a=i(),c=s(),u=l(c,null!=a&&a.length?n(a[0]):void 0),d=o(a),p=1===d.length&&(null===(t=d[0])||void 0===t?void 0:t.name)===c;return{clientIds:a,isGroupable:u&&d.length&&!p,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}}(),{isGroupable:c,isUngroupable:d}=a,f=c||d;return(0,s.createElement)(Op,{fillProps:{...t,selectedBlocks:o,selectedClientIds:l}},(e=>{if((null==e?void 0:e.length)>0||f)return(0,s.createElement)(p.MenuGroup,null,e,(0,s.createElement)(Ap,i({},a,{onClose:null==t?void 0:t.onClose})))}))};var zp=Fp;const Vp={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function Hp(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 Gp=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...l}=e;const a=(0,u.castArray)(t),c=a.length,d=a[0],{onlyBlock:f,title:h}=(0,m.useSelect)((e=>{var t;const{getBlockCount:n,getBlockName:o}=e(zn),{getBlockType:l}=e(r.store);return{onlyBlock:1===n(),title:null===(t=l(o(d)))||void 0===t?void 0:t.title}}),[d]),v=(0,m.useSelect)((e=>{const{getShortcutRepresentation:t}=e(oc.store);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),b=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:u.noop,[n]),k=(0,g.sprintf)(
|
56 |
/* translators: %s: block name */
|
57 |
+
(0,g.__)("Remove %s"),h),_=1===c?k:(0,g.__)("Remove blocks");return(0,s.createElement)(Tp,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:a,canRemove:m,onDuplicate:h,onInsertAfter:k,onInsertBefore:y,onRemove:E,onCopy:C,onMoveTo:S,blocks:w}=e;return(0,s.createElement)(p.DropdownMenu,i({icon:Sp,label:(0,g.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Vp,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(Lp.Slot,{fillProps:{onClose:l}}),1===c&&(0,s.createElement)(Pp,{clientId:d}),(0,s.createElement)(Hp,{blocks:w,onCopy:C}),n&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,h,b),shortcut:v.duplicate},(0,g.__)("Duplicate")),r&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,y),shortcut:v.insertBefore},(0,g.__)("Insert before")),(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,k),shortcut:v.insertAfter},(0,g.__)("Insert after"))),a&&!f&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,S)},(0,g.__)("Move to")),1===c&&(0,s.createElement)(Np,{clientId:d,onToggle:l})),(0,s.createElement)(zp.Slot,{fillProps:{onClose:l},clientIds:t}),"function"==typeof o?o({onClose:l}):s.Children.map((e=>(0,s.cloneElement)(e,{onClose:l}))),m&&(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,E,b),shortcut:v.remove},_)))}))}))},Up=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Gp,i({clientIds:t,toggleProps:e},n)))))};function Wp(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(zn),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)(zn),v=(0,s.useRef)(),{showMovers:b,gestures:k}=op({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)(rp,{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)(Cp,{clientIds:n}),(0,s.createElement)(Qd,{clientIds:n,hideDragHandle:t||u}))),E&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Yn.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Yn.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Yn.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Yn.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Yn.Slot,{group:"other",className:"block-editor-block-toolbar__slot"})),(0,s.createElement)(Up,{clientIds:n}))}var $p=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(zn),{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)(Gd,i({focusOnMount:t,className:d
|
58 |
+
/* translators: accessibility text for the block toolbar */,"aria-label":(0,g.__)("Block tools")},o),(0,s.createElement)(Wp,{hideDragHandle:n}))};function jp(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,isCaretWithinFormattedText:l,getSettings:i,getLastMultiSelectedBlockClientId:s}=e(zn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),isCaretWithinFormattedText:l(),hasMultiSelection:o(),hasFixedToolbar:i().hasFixedToolbar,lastClientId:s()}}function Kp(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)(jp,[]),_=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(zn);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)(zn),x=!g&&!u&&r&&o,I=u,T=!u&&!b&&y&&!x&&!f&&(!g||h),N=!(u||T||b||r);(0,oc.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=Ta(t),R=Ta(k),L=Ta(l),A=Nd(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,ir.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)(Sd,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),(T||E)&&(0,s.createElement)($p,{focusOnMount:E,__experimentalInitialIndex:P.current,__experimentalOnIndexChange:e=>{P.current=e},key:t}),I&&(0,s.createElement)(Vd,{clientId:t,rootClientId:n,blockElement:D}),x&&(0,s.createElement)("div",{className:"block-editor-block-list__empty-block-inserter"},(0,s.createElement)(Sd,{position:"bottom right",rootClientId:n,clientId:t,__experimentalIsQuick:!0})))}function qp(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(zn),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 Yp(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(qp,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u}=o;return i?(0,s.createElement)(Kp,{clientId:r,rootClientId:l,isValid:a,isEmptyDefaultBlock:c,capturingClientId:u,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Xp(e){let{children:t}=e;const n=(0,s.useContext)(Pd),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(Rt()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(Rd,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(Yp,{__unstablePopoverSlot:"block-toolbar"}),t))}var Zp=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=Un();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Qp=Zp((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(Id,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),Jp=(0,d.compose)([Zp,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(zn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(wd,{rootClientId:t})})),em=window.wp.isShallowEqual,tm=n.n(em);const nm=new WeakMap;function om(e,t){const n=(0,m.useSelect)((e=>e(zn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(zn),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(zn),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,ir.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?p(t):d(e)}}function rm(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 lm(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=rm(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function im(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]=lm(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function sm(){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(zn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(zn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(zn),a=om(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=im(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 am(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)(zn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(zn).getBlockRootClientId(e);return{blockListSettings:t(zn).getBlockListSettings(e),parentLock:t(zn).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=xo(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),tm()(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)(zn),{replaceInnerBlocks:i}=(0,m.useDispatch)(zn),a=(0,m.useSelect)((t=>t(zn).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(zn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){nm.has(t)||nm.set(t,new WeakMap);const n=nm.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)(bm,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function cm(e){return ja(e),(0,s.createElement)(am,e)}const um=(0,s.forwardRef)(((e,t)=>{const n=dm({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function dm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=Un(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:a}=(0,m.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,isNavigationMode:s}=e(zn),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,sm({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?cm:am;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)(bm,t)}}dm.save=r.__unstableGetInnerBlocksProps,um.DefaultBlockAppender=Jp,um.ButtonBlockAppender=Qp,um.Content=()=>dm.save().children;var pm=um;const mm=(0,s.createContext)(),fm=(0,s.createContext)();function gm(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(zn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),p=dm({ref:(0,d.useMergeRefs)([Ya(),Ld(),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)(mm.Provider,{value:o},(0,s.createElement)("div",p))}function hm(e){return function(){const e=(0,m.useSelect)((e=>e(zn).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(zn).__experimentalGetParsedPattern(e[n].name),t=Ad(o))};return t=Ad(o),()=>Dd(t)}),[e])}(),(0,s.createElement)(Xp,null,(0,s.createElement)(Gn,{value:Vn},(0,s.createElement)(gm,e)))}function vm(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=Io}=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(zn);return{order:t(n),selectedBlocks:o()}}),[n]);return(0,s.createElement)(No,{value:l},(0,s.createElement)(fm.Provider,{value:c},u.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,s.createElement)(Fa,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,s.createElement)(Td,{tagName:r,rootClientId:n,renderAppender:o}))}function bm(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(vm,e))}hm.__unstableElementContext=mm;const km=["colors","disableCustomColors","gradients","disableCustomGradients"];function _m(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",null,(0,s.createElement)(p.__experimentalVStack,{spacing:1},k&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(p.BaseControl.VisualLabel,null,d))),y&&E&&(0,s.createElement)(p.__experimentalToggleGroupControl,{value:C,onChange: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 ym(e){const t={};return t.colors=mo("color.palette"),t.gradients=mo("color.gradients"),t.disableCustomColors=!mo("color.custom"),t.disableCustomGradients=!mo("color.customGradient"),(0,s.createElement)(_m,i({},t,e))}var Em=function(e){return(0,u.every)(km,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(_m,e):(0,s.createElement)(ym,e)};function Cm(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)(Em,i({showTitle:!1,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d},e))}))))}function Sm(){return{disableCustomColors:!mo("color.custom"),disableCustomGradients:!mo("color.customGradient")}}function wm(){const e=Sm(),t=mo("color.palette.custom"),n=mo("color.palette.theme"),o=mo("color.palette.default"),r=mo("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=mo("color.gradients.custom"),i=mo("color.gradients.theme"),a=mo("color.gradients.default"),c=mo("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}Oc([Fc,Hc]);const Bm=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},xm=(e,t)=>(0,u.find)(e,{color:t});function Im(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}const Tm=[];function Nm(e){const{attributes:{borderColor:t,style:n},setAttributes:o}=e,r=wm(),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=Bm(l,t,a))||void 0===e?void 0:e.color}));(0,s.useEffect)((()=>{var e;u(null===(e=Bm(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=xm(l,e),r={...n,border:{...null==n?void 0:n.border,color:null!=t&&t.slug?void 0:e}},i=null!=t&&t.slug?t.slug:void 0;o({style:qo(r),borderColor:i})},colorValue:c,clearable:!1}];return(0,s.createElement)(Cm,i({settings:d,disableCustomColors:!0,disableCustomGradients:!0,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},r))}function Pm(e,t,n){var o;if(!nf(t,"color")||of(t))return e;const{borderColor:r,style:l}=n,i=Im("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 Mm=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const{name:r,attributes:l}=t,{borderColor:a}=l,c=mo("color.palette")||Tm;if(!nf(r,"color")||of(r))return(0,s.createElement)(e,t);const u={borderColor:a?null===(n=Bm(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 Rm(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Lm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,p.__experimentalParseUnit)(e))),n=t.map((e=>e[0])),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=Rm(o),i=0===r||r?`${r}${l}`:null;return i}function Am(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Lm(e),n=isNaN(parseFloat(t));return n}function Dm(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Om(e){let{onChange:t,values:n,...o}=e;const r=Lm(n),l=Dm(n)&&Am(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 nf(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Pm),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!nf(e,"color")||of(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Pm(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Mm);const Fm={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function zm(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(Fm).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 Vm=(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"})),Hm=(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 Gm(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?Vm:Hm,iconSize:16,"aria-label":o})))}const Um={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},Wm={px:100,em:20,rem:20};function $m(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!Dm(n)||!Am(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["px","em","rem"]}),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e){const[,t]=(0,p.__experimentalParseUnit)(e);return t||"px"}return Rm(Object.values(e).map((e=>{const[,t]=(0,p.__experimentalParseUnit)(e);return t})))||"px"}(n),a=l&&l.find((e=>e.value===i)),c=(null==a?void 0:a.step)||1,[u]=(0,p.__experimentalParseUnit)(Lm(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)(Om,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,unit:i,units:l}),(0,s.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:u,min:0,max:Wm[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(zm,{min:0,onChange:t,values:n||Um,units:l}),(0,s.createElement)(Gm,{onClick:()=>r(!o),isLinked:o})))}function jm(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)($m,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=qo(t)),o({style:t})}})}var Km=(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"})),qm=(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"})),Ym=(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 Xm=[{label:(0,g.__)("Solid"),icon:Km,value:"solid"},{label:(0,g.__)("Dashed"),icon:qm,value:"dashed"},{label:(0,g.__)("Dotted"),icon:Ym,value:"dotted"}];function Zm(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"},Xm.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 Qm=e=>{var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Zm,{value:null==n||null===(t=n.border)||void 0===t?void 0:t.style,onChange:e=>{const t={...n,border:{...null==n?void 0:n.border,style:e}};o({style:qo(t)})}})},Jm=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:mo("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=qo(s)),o({borderColor:p,style:s})},units:h})},ef="__experimentalBorder";function tf(e){const{clientId:t}=e,n=rf(e),o=nf(e.name),l=mo("border.color")&&nf(e.name,"color"),i=mo("border.radius")&&nf(e.name,"radius"),a=mo("border.style")&&nf(e.name,"style"),c=mo("border.width")&&nf(e.name,"width");if(n||!o)return null;const u=(0,r.getBlockSupport)(e.name,[ef,"__experimentalDefaultControls"]),d=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)(nr,{__experimentalGroup:"border"},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.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:lf(o,"width")})}(e),isShownByDefault:null==u?void 0:u.width,resetAllFilter:d("width"),panelId:t},(0,s.createElement)(Jm,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.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:lf(o,"style")})}(e),isShownByDefault:null==u?void 0:u.style,resetAllFilter:d("style"),panelId:t},(0,s.createElement)(Qm,e)),l&&(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:lf(o,"color")})}(e),isShownByDefault:null==u?void 0:u.color,resetAllFilter:d("color",{borderColor:void 0}),panelId:t},(0,s.createElement)(Nm,e)),i&&(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:lf(o,"radius")})}(e),isShownByDefault:null==u?void 0:u.radius,resetAllFilter:d("radius"),panelId:t},(0,s.createElement)(jm,e)))}function nf(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,ef);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 of(e){const t=(0,r.getBlockSupport)(e,ef);return null==t?void 0:t.__experimentalSkipSerialization}const rf=()=>[!mo("border.color"),!mo("border.radius"),!mo("border.style"),!mo("border.width")].every(Boolean);function lf(e,t){return qo({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function sf(e){if(e)return`has-${e}-gradient-background`}function af(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function cf(e,t){return(0,u.find)(e,["gradient",t])}function uf(e,t){const n=cf(e,t);return n&&n.slug}function df(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=Un(),o=mo("color.gradients.custom"),r=mo("color.gradients.theme"),l=mo("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(zn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(zn),d=(0,s.useCallback)((o=>{const r=uf(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=sf(a);let f;return f=a?af(i,a):c,{gradientClass:p,gradientValue:f,setGradient:d}}Oc([Fc,Hc]);var pf=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=Ac(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=Ac(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"
|
59 |
+
(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"
|
60 |
+
(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,Nt.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 mf(e){var t;let{settings:n,enableAlpha:o,...r}=e;const l={...wm(),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)(Em,i({showTitle:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},l))}))}function ff(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function gf(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=Ia(o);return(0,s.useEffect)((()=>{var e;if(!r)return;if(!p.current)return;c(ff(p.current).color);const t=null===(e=p.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&d(ff(t).color);let n=p.current,o=ff(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=ff(n).backgroundColor;i(o)})),(0,s.createElement)(nr,{__experimentalGroup:"color"},n.map(((e,n)=>(0,s.createElement)(mf,{key:n,settings:e,panelId:o,enableAlpha:t}))),r&&(0,s.createElement)(pf,{backgroundColor:l,textColor:a,enableAlphaChecker:t,linkColor:u}))}const hf="color",vf=e=>{const t=(0,r.getBlockSupport)(e,hf);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},bf=e=>{const t=(0,r.getBlockSupport)(e,hf);return null==t?void 0:t.__experimentalSkipSerialization},kf=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,hf);return(0,u.isObject)(t)&&!!t.link},_f=e=>{const t=(0,r.getBlockSupport)(e,hf);return(0,u.isObject)(t)&&!!t.gradients},yf=e=>{const t=(0,r.getBlockSupport)(e,hf);return t&&!1!==t.background},Ef=e=>{const t=(0,r.getBlockSupport)(e,hf);return t&&!1!==t.text},Cf=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])},Sf=(e,t)=>qo(Yo(t,e,void 0)),wf=e=>({textColor:void 0,style:Sf(["color","text"],e.style)}),Bf=e=>({style:Sf(["elements","link","color","text"],e.style)}),xf=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 If(e,t,n){var o,r,l,i,s,a;if(!vf(t)||bf(t))return e;const u=_f(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,g=Im("background-color",d),h=sf(m),v=Im("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 Tf=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Bm(e,n[1]).color:t};function Nf(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,f=mo("color.palette.custom"),h=mo("color.palette.theme"),v=mo("color.palette.default"),b=(0,s.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=mo("color.gradients.custom"),_=mo("color.gradients.theme"),y=mo("color.gradients.default"),E=(0,s.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=mo("color.custom"),S=mo("color.customGradient"),w=mo("color.background"),B=mo("color.link"),x=mo("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]),!vf(p))return null;const P=kf(p)&&B&&I,M=Ef(p)&&x&&I,R=yf(p)&&w&&I,L=_f(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=af(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=xm(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:qo(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,[hf,"__experimentalDefaultControls"]);return(0,s.createElement)(gf,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,g.__)("Text"),onColorChange:H("text"),colorValue:Bm(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,hasValue:()=>Cf("text")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({textColor:void 0,style:Sf(["color","text"],t.style)})})(e),resetAllFilter:wf}]:[],...R||L?[{label:(0,g.__)("Background"),onColorChange:R?H("background"):void 0,colorValue:Bm(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:L?t=>{const n=uf(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:qo(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:qo(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,hasValue:()=>Cf("background")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n(xf(t))})(e),resetAllFilter:xf}]:[],...P?[{label:(0,g.__)("Link"),onColorChange:t=>{const n=xm(b,t),o=null!=n&&n.slug?`var:preset|color|${n.slug}`:t,r=qo(Yo(A,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:Tf(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:()=>Cf("link")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({style:Sf(["elements","link","color","text"],t.style)})})(e),resetAllFilter:Bf}]:[]]})}const Pf=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=mo("color.palette.custom")||[],u=mo("color.palette.theme")||[],d=mo("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!vf(o)||bf(o))return(0,s.createElement)(e,t);const m={};var f,g;a&&(m.color=null===(f=Bm(p,a))||void 0===f?void 0:f.color),l&&(m.backgroundColor=null===(g=Bm(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}))})),Mf={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 vf(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),_f(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",If),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!vf(e)||bf(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),If(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",Pf),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return Xo({linkColor:kf(r),textColor:Ef(r),backgroundColor:yf(r),gradient:_f(r)},Mf,e,t,n,o)}));const Rf=[{name:(0,g._x)("Regular","font style"),value:"normal"},{name:(0,g._x)("Italic","font style"),value:"italic"}],Lf=[{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"}],Af=(e,t)=>e?t?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight");function Df(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=Af(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 Rf.forEach((t=>{let{name:n,value:o}=t;Lf.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,g.sprintf)(
|
|
|
61 |
/* translators: 1: Font weight name. 2: Font style name. */
|
62 |
+
(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 Rf.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 Lf.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.
|
63 |
+
(0,g.__)("Currently selected font appearance: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font style.
|
64 |
+
(0,g.__)("Currently selected font style: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font weight.
|
65 |
+
(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 Of(e){let{value:t,onChange:n}=e;const o=function(e){return void 0!==e&&""!==e}(t),r=o?t:"";return(0,s.createElement)("div",{className:"block-editor-line-height-control"},(0,s.createElement)(p.TextControl,{autoComplete:"off",onKeyDown:e=>{const{keyCode:t}=e;t!==ka.ZERO||o||(e.preventDefault(),n("0"))},onChange:e=>{if(o)return void n(e);let t=e;switch(e){case"0.1":t=1.6;break;case"0":t=1.4}n(t)},label:(0,g.__)("Line height"),placeholder:1.5,step:.1,type:"number",value:r,min:0}))}const Ff="typography.lineHeight";function zf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Of,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:qo(t)})}})}function Vf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Ff)||t}const Hf="typography.__experimentalFontStyle",Gf="typography.__experimentalFontWeight";function Uf(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Wf(e),i=!$f(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)(Df,{onChange:e=>{r({style:qo({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function Wf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Hf),n=mo("typography.fontStyle");return!t||!n}function $f(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Gf),n=mo("typography.fontWeight");return!t||!n}function jf(e){const t=Wf(e),n=$f(e);return t&&n}function Kf(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=mo("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 qf="typography.__experimentalFontFamily";function Yf(e,t,n){if(!(0,r.hasBlockSupport)(t,qf))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;if(null==n||!n.fontFamily)return e;const o=new(up())(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 Xf(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=mo("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)(Kf,{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 Zf(e){let{name:t}=e;const n=mo("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,qf)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,qf)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Yf),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,qf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Yf(o,e,n)},e}));const Qf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Jf(e,t){return(0,u.find)(e,{size:t})||{size:t}}function eg(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var tg=function(e){const t=mo("typography.fontSizes"),n=!mo("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const ng="typography.fontSize";function og(e,t,n){if(!(0,r.hasBlockSupport)(t,ng))return e;if((0,r.hasBlockSupport)(t,"typography.__experimentalSkipSerialization"))return e;const o=new(up())(e.className);o.add(eg(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=mo("typography.fontSizes"),a=Qf(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)(tg,{onChange:e=>{const t=Jf(i,e).slug;l({style:qo({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function lg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=mo("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,ng)||!n}const ig=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=mo("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,ng)||(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=Qf(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"),sg={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,ng)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",og),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,ng))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/font-size/with-font-size-inline-styles",ig),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return Xo({fontSize:(0,r.hasBlockSupport)(l,ng)},sg,e,t,n,o)}));var ag=(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"})),cg=(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 ug=[{name:(0,g.__)("Underline"),value:"underline",icon:ag},{name:(0,g.__)("Strikethrough"),value:"line-through",icon:cg}];function dg(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"},ug.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 pg="typography.__experimentalTextDecoration";function mg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(dg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function fg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,pg),n=mo("typography.textDecoration");return t||!n}var gg=(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"})),hg=(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"})),vg=(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 bg=[{name:(0,g.__)("Uppercase"),value:"uppercase",icon:gg},{name:(0,g.__)("Lowercase"),value:"lowercase",icon:hg},{name:(0,g.__)("Capitalize"),value:"capitalize",icon:vg}];function kg(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"},bg.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 _g="typography.__experimentalTextTransform";function yg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(kg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function Eg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,_g),n=mo("typography.textTransform");return t||!n}function Cg(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("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 Sg="typography.__experimentalLetterSpacing";function wg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Cg,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:qo({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function Bg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Sg),n=mo("typography.letterSpacing");return t||!n}const xg="typography",Ig=[Ff,ng,Hf,Gf,qf,pg,_g,Sg];function Tg(e){const{clientId:t}=e,n=Zf(e),o=lg(e),l=jf(e),i=Vf(e),a=fg(e),c=Eg(e),u=Bg(e),d=!Wf(e),m=!$f(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[jf(e),lg(e),Vf(e),Zf(e),fg(e),Eg(e),Bg(e)];return t.filter(Boolean).length===t.length}(e),h=Ng(e.name);if(f||!h)return null;const v=(0,r.getBlockSupport)(e.name,[xg,"__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)(nr,{__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)(Xf,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:qo({...o,typography:{...null==o?void 0:o.typography,fontSize:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontSize,resetAllFilter:e=>{var t;return{...e,fontSize:void 0,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontSize:void 0}}}},panelId:t},(0,s.createElement)(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:Af(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:qo({...o,typography:{...null==o?void 0:o.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontAppearance,resetAllFilter:e=>{var t;return{...e,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontStyle:void 0,fontWeight:void 0}}}},panelId:t},(0,s.createElement)(Uf,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:qo({...o,typography:{...null==o?void 0:o.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.lineHeight,resetAllFilter:b("lineHeight"),panelId:t},(0,s.createElement)(zf,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:qo({...o,typography:{...null==o?void 0:o.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textDecoration,resetAllFilter:b("textDecoration"),panelId:t},(0,s.createElement)(mg,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:qo({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textTransform,resetAllFilter:b("textTransform"),panelId:t},(0,s.createElement)(yg,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:qo({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==v?void 0:v.letterSpacing,resetAllFilter:b("letterSpacing"),panelId:t},(0,s.createElement)(wg,e)))}const Ng=e=>Ig.some((t=>(0,r.hasBlockSupport)(e,t)));function Pg(e){const t=(0,r.getBlockSupport)(e,Vg);return!!(!0===t||null!=t&&t.blockGap)}function Mg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.blockGap");return!Pg(e)||t}function Rg(e){var t;const{clientId:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=Ia(n);return Mg(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:e=>{var t;const n={...o,spacing:{...null==o?void 0:o.spacing,blockGap:e}};r({style:qo(n)});const l=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var s;i.current&&l&&(null===(s=i.current.parentNode)||void 0===s||s.replaceChild(i.current,i.current))},units:l,value:null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap})),native:null})}function Lg(e){const t=(0,r.getBlockSupport)(e,Vg);return!!(!0===t||null!=t&&t.margin)}function Ag(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.margin"),n=!jg(e,"margin");return!Lg(e)||t||n}function Dg(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=$g(n,"margin"),a=i&&i.some((e=>Gg.includes(e)));return Ag(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:qo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:qo(t)})},label:(0,g.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Og(e){const t=(0,r.getBlockSupport)(e,Vg);return!!(!0===t||null!=t&&t.padding)}function Fg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!mo("spacing.padding"),n=!jg(e,"padding");return!Og(e)||t||n}function zg(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"]}),i=$g(n,"padding"),a=i&&i.some((e=>Gg.includes(e)));return Fg(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:qo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:qo(t)})},label:(0,g.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const Vg="spacing",Hg=["top","right","bottom","left"],Gg=["vertical","horizontal"];function Ug(e){const t=Mg(e),n=Fg(e),o=Ag(e),l=Wg(e),i=(a=e.name,"web"===s.Platform.OS&&(Pg(a)||Og(a)||Lg(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[Vg,"__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)(nr,{__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:qo({...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)(zg,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:qo({...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)(Dg,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)(Rg,e)))}const Wg=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Mg(e),n=Fg(e),o=Ag(e);return t&&n&&o};function $g(e,t){const n=(0,r.getBlockSupport)(e,Vg);if(n&&"boolean"!=typeof n[t])return n[t]}function jg(e,t){const n=$g(e,t);return!(n&&n.some((e=>Hg.includes(e)))&&n.some((e=>Gg.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}const Kg=[...Ig,ef,hf,Vg],qg=e=>Kg.some((t=>(0,r.hasBlockSupport)(e,t))),Yg="var:";function Xg(e){return(0,u.startsWith)(e,Yg)?`var(--wp--${e.slice(Yg.length).split("|").join("--")})`:e}function Zg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};return Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(0,u.first)(l)){const r=(0,u.get)(e,l);i&&!(0,u.isString)(r)?Object.entries(i).forEach((e=>{const[t,o]=e,l=(0,u.get)(r,[o]);l&&(n[t]=Xg(l))})):t.includes(l.join("."))||(n[o]=Xg((0,u.get)(e,l)))}})),n}const Qg={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[hf],"typography.__experimentalSkipSerialization":[xg],[`${Vg}.__experimentalSkipSerialization`]:["spacing"]},Jg={...Qg,[`${Vg}`]:["spacing.blockGap"]};function eh(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Jg;if(!qg(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={...Zg(l),...e.style},e}const th=(0,d.createHigherOrderComponent)((e=>t=>{const n=Wn();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Nf,t),(0,s.createElement)(Tg,t),(0,s.createElement)(tf,t),(0,s.createElement)(Ug,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),nh=(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=Zg(t);return(0,u.isEmpty)(o)?"":[`.${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(a,null===(o=t.attributes.style)||void 0===o?void 0:o.elements),m=(0,s.useContext)(hm.__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 qg(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",eh),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!qg(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),eh(o,e,n,Qg)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",th),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",nh);var oh=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!==ka.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 rh=[];function lh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Ac(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 ih(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 sh(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=mo("color.duotone")||rh,a=mo("color.palette")||rh,c=!mo("color.custom"),u=!mo("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(Yn,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(oh,{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})}}))}Oc([Fc]);const ah=(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)(sh,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)(hm.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,g&&(0,s.createPortal)((0,s.createElement)(ih,{selector:m,id:p,values:lh(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",ah),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",ch);const uh="__experimentalLayout";function dh(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=mo("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,uh,{}),{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 _=xo(k),y=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(nr,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)(ph,{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 ph(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Bo.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const mh=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,uh)&&(0,s.createElement)(dh,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),fh=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,uh),a=(0,d.useInstanceId)(e),u=mo("layout")||{},p=(0,s.useContext)(hm.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,uh)||{},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)(Mo,{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,uh)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",fh),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",mh);const gh=[];function hh(e){var t;let{borderColor:n,style:o}=e;const r=(null==o?void 0:o.border)||{},l=Im("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:Zg({border:r})}}function vh(e){const t=mo("color.palette")||gh,n=hh(e);if(e.borderColor){const o=Bm(t,e.borderColor);n.style.borderColor=o.color}return n}function bh(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=Im("background-color",s),m=Im("color",a),f=sf(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:Zg({color:(null==d?void 0:d.color)||{}})}}const kh={};function _h(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=mo("color.palette.custom")||[],l=mo("color.palette.theme")||[],i=mo("color.palette.default")||[],a=mo("color.gradients")||kh,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=bh(e);if(t){const e=Bm(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=af(u,o)),n){const e=Bm(c,n);d.style.color=e.color}return d}function yh(e){const{style:t}=e;return{style:Zg({spacing:(null==t?void 0:t.spacing)||{}})}}function Eh(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const Ch=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),Sh=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=mo("color.palette.custom"),o=mo("color.palette.theme"),r=mo("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function wh(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=Ac(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=xm(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=Bm(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:Im(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function Bh(e){return function(){const t=Ch(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(wh(o,t),"withCustomColors")}}function xh(){const e=Sh();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(wh(n,e),"withColors")}const Ih=[];var Th=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=mo("typography.fontSizes")||Ih;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=Qf(r,l,n[t]);return e[o]={...i,class:eg(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},Nh=(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"})),Ph=(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"})),Mh=(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 Rh=[{icon:Nh,title:(0,g.__)("Align text left"),align:"left"},{icon:Ph,title:(0,g.__)("Align text center"),align:"center"},{icon:Mh,title:(0,g.__)("Align text right"),align:"right"}],Lh={position:"bottom right",isAlternate:!0};var Ah=function(e){let{value:t,onChange:n,alignmentControls:o=Rh,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)()?Mh:Nh,label:r,toggleProps:{describedBy:l},popoverProps:Lh,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 Dh(e){return(0,s.createElement)(Ah,i({},e,{isToolbar:!1}))}function Oh(e){return(0,s.createElement)(Ah,i({},e,{isToolbar:!0}))}var Fh={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(zn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=Tu(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?Ju(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)(Wa,{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))}}};const zh=[];function Vh(e){let{completers:t=zh}=e;const{name:n}=Un();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Fh])),(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 Hh=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:Vh(e)}))},Gh=(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"})),Uh=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:Gh,label:n,onClick:()=>o(!t),disabled:r})},Wh=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!==ka.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},$h=(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"})),jh=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(zn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(zn),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)(wo,{icon:$h,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)(Fd,{clientId:e})),(0,s.createElement)(wo,{icon:$h,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Fd,{clientId:r})))};function Kh(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(zn);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 qh=()=>(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"})),Yh=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)(qh,null)))},Xh=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!==ka.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(Yh,null)))}))}};var Zh=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:Xh(n),renderContent:()=>t})},Qh=(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 Jh=ra(p.__experimentalTreeGridRow);function ev(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=sa({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(Jh,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function tv(e){let{onClick:t}=e;return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,s.createElement)(wo,{icon:$h}))}var nv=(0,s.forwardRef)((function e(t,n){let{className:o,block:{clientId:r},isSelected:l,onClick:i,onToggleExpanded:a,position:u,siblingBlockCount:m,level:f,tabIndex:h,onFocus:v,onDragStart:b,onDragEnd:k,draggable:_,isExpanded:y}=t;const E=Od(r),C=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,S=((e,t,n)=>(0,g.sprintf)(
|
66 |
/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
|
67 |
+
(0,g.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(u,m,f);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",o),onClick:i,onKeyDown:function(e){e.keyCode!==ka.ENTER&&e.keyCode!==ka.SPACE||(e.preventDefault(),i(e))},"aria-describedby":C,ref:n,tabIndex:h,onFocus:v,onDragStart:e=>{e.dataTransfer.clearData(),b(e)},onDragEnd:k,draggable:_,href:`#block-${r}`,"aria-expanded":y},(0,s.createElement)(tv,{onClick:a}),(0,s.createElement)(Wa,{icon:null==E?void 0:E.icon,showColors:!0}),(0,s.createElement)(Fd,{clientId:r}),(null==E?void 0:E.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},E.anchor),l&&(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("(selected block)"))),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:C},S))})),ov=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,isExpanded:p,...f}=e;const{clientId:g}=r,{blockMovingClientId:h,selectedBlockInBlockEditor:v}=(0,m.useSelect)((e=>{const{getBlockRootClientId:t,hasBlockMovingClientId:n,getSelectedBlockClientId:o}=e(zn);return{rootClientId:t(g)||"",blockMovingClientId:n(),selectedBlockInBlockEditor:o()}}),[g]),b=h&&v===g,k=c()("block-editor-list-view-block-contents",{"is-dropping-before":b});return(0,s.createElement)(zd,{clientIds:[r.clientId]},(e=>{let{draggable:c,onDragStart:m,onDragEnd:g}=e;return(0,s.createElement)(nv,i({ref:t,className:k,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:g,isExpanded:p},f))}))}));const rv=(0,s.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),lv=()=>(0,s.useContext)(rv);var iv=(0,s.memo)((function(e){let{block:t,isDragged:n,isSelected:o,isBranchSelected:r,selectBlock:l,position:i,level:a,rowCount:u,siblingBlockCount:d,showBlockMovers:f,path:h,isExpanded:v}=e;const b=(0,s.useRef)(null),[k,_]=(0,s.useState)(!1),{clientId:y}=t,{toggleBlockHighlight:E}=(0,m.useDispatch)(zn),{__experimentalFeatures:C,__experimentalPersistentListViewFeatures:S,__experimentalHideContainerBlockActions:w,isTreeGridMounted:B,expand:x,collapse:I}=lv(),T=f&&d>0,N=c()("block-editor-list-view-block__mover-cell",{"is-visible":k||o}),P=c()("block-editor-list-view-block__menu-cell",{"is-visible":k||o});(0,s.useEffect)((()=>{S&&!B&&o&&b.current.focus()}),[]);const M=S?E:()=>{},R=(0,s.useCallback)((()=>{_(!0),M(y,!0)}),[y,_,M]),L=(0,s.useCallback)((()=>{_(!1),M(y,!1)}),[y,_,M]),A=(0,s.useCallback)((e=>{e.stopPropagation(),l(y)}),[y,l]),D=(0,s.useCallback)((e=>{e.stopPropagation(),!0===v?I(y):!1===v&&x(y)}),[y,x,I,v]),O=C&&(!w||w&&a>1),F=C&&!O;let z;T?z=2:F&&(z=3);const V=c()({"is-selected":o,"is-branch-selected":S&&r,"is-dragging":n,"has-single-cell":F}),H=Od(y),G=(0,g.sprintf)(// translators: %s: The title of the block.
|
68 |
+
(0,g.__)("Options for %s block"),H.title);return(0,s.createElement)(ev,{className:V,onMouseEnter:R,onMouseLeave:L,onFocus:R,onBlur:L,level:a,position:i,rowCount:u,path:h,id:`list-view-block-${y}`,"data-block":y,isExpanded:v},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:z,ref:b},(e=>{let{ref:n,tabIndex:r,onFocus:l}=e;return(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(ov,{block:t,onClick:A,onToggleExpanded:D,isSelected:o,position:i,siblingBlockCount:d,level:a,ref:n,tabIndex:r,onFocus:l,isExpanded:v}))})),T&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalTreeGridCell,{className:N,withoutGridItem:!0},(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Xd,{orientation:"vertical",clientIds:[y],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)(Zd,{orientation:"vertical",clientIds:[y],ref:t,tabIndex:n,onFocus:o})})))),O&&(0,s.createElement)(p.__experimentalTreeGridCell,{className:P},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Gp,{clientIds:[y],icon:Sp,label:G,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:A})})))}));function sv(e,t,n){var o;return(null==n?void 0:n.includes(e.clientId))?0:null===(o=t[e.clientId])||void 0===o||o?1+e.innerBlocks.reduce(av(t,n),0):1}const av=(e,t)=>(n,o)=>{var r;return(null==t?void 0:t.includes(o.clientId))?n:(null===(r=e[o.clientId])||void 0===r||r)&&o.innerBlocks.length>0?n+sv(o,e,t):n+1};function cv(e){const{blocks:t,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,selectedClientIds:l,level:i=1,path:a="",isBranchSelected:c=!1,listPosition:d=0,fixedListWindow:p}=e,{expandedState:f,draggedClientIds:g,__experimentalPersistentListViewFeatures:h}=lv(),v=(0,u.compact)(t),b=v.length;let k=d;return(0,s.createElement)(s.Fragment,null,v.map(((e,t)=>{var d;const{clientId:_,innerBlocks:y}=e;t>0&&(k+=sv(v[t-1],f,g));const E=h,{itemInView:C}=p,S=!E||C(k),w=t+1,B=a.length>0?`${a}_${w}`:`${w}`,x=r&&!!y&&!!y.length,I=x?null===(d=f[_])||void 0===d||d:void 0,T=!(null==g||!g.includes(_)),N=T||S,P=((e,t)=>(0,u.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e)(_,l),M=c||P&&x;return(0,s.createElement)(m.AsyncModeProvider,{key:_,value:!P},N&&(0,s.createElement)(iv,{block:e,selectBlock:n,isSelected:P,isBranchSelected:M,isDragged:T,level:i,position:w,rowCount:b,siblingBlockCount:b,showBlockMovers:o,path:B,isExpanded:I,listPosition:k}),!N&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),x&&I&&!T&&(0,s.createElement)(cv,{blocks:y,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,level:i+1,path:B,listPosition:k+1,fixedListWindow:p,isBranchSelected:M,selectedClientIds:l}))})))}cv.defaultProps={selectBlock:()=>{}};var uv=(0,s.memo)(cv);function dv(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 fv=()=>{},gv=(e,t)=>{switch(t.type){case"expand":return{...e,[t.clientId]:!0};case"collapse":return{...e,[t.clientId]:!1};default:return e}};var hv=(0,s.forwardRef)((function(e,t){let{blocks:n,onSelect:o=fv,__experimentalFeatures:r,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,showNestedBlocks:c,showBlockMovers:u,...f}=e;const{clientIdsTree:h,draggedClientIds:v,selectedClientIds:b}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(zn);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(n),{selectBlock:k}=(0,m.useDispatch)(zn),{visibleBlockCount:_}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(zn),o=(null==v?void 0:v.length)>0?n(v).length+1:0;return{visibleBlockCount:t()-o}}),[v]),y=(0,s.useCallback)((e=>{k(e),o(e)}),[k,o]),[E,C]=(0,s.useReducer)(gv,{}),{ref:S,target:w}=function(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(zn),[l,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=l||{},u=om(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]=lm(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}}(),B=(0,s.useRef)(),x=(0,d.useMergeRefs)([B,S,t]),I=(0,s.useRef)(!1);(0,s.useEffect)((()=>{I.current=!0}),[]);const[T]=(0,d.__experimentalUseFixedWindowList)(B,36,_,{useWindowing:l,windowOverscan:40}),N=(0,s.useCallback)((e=>{e&&C({type:"expand",clientId:e})}),[C]),P=(0,s.useCallback)((e=>{e&&C({type:"collapse",clientId:e})}),[C]),M=(0,s.useCallback)((e=>{var t;N(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[N]),R=(0,s.useCallback)((e=>{var t;P(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[P]),L=(0,s.useMemo)((()=>({__experimentalFeatures:r,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,isTreeGridMounted:I.current,draggedClientIds:v,expandedState:E,expand:N,collapse:P})),[r,l,a,I.current,v,E,N,P]);return(0,s.createElement)(m.AsyncModeProvider,{value:!0},(0,s.createElement)(dv,{listViewRef:B,blockDropTarget:w}),(0,s.createElement)(p.__experimentalTreeGrid,{className:"block-editor-list-view-tree","aria-label":(0,g.__)("Block navigation structure"),ref:x,onCollapseRow:R,onExpandRow:M},(0,s.createElement)(rv.Provider,{value:L},(0,s.createElement)(uv,i({blocks:h,selectBlock:y,showNestedBlocks:c,showBlockMovers:u,fixedListWindow:T,selectedClientIds:b},f)))))}));function vv(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,s.createElement)(p.Button,i({},l,{ref:r,icon:Qh,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0
|
69 |
+
/* 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 bv=(0,s.forwardRef)((function(e,t){let{isDisabled:n,__experimentalFeatures:o,...r}=e;const l=(0,m.useSelect)((e=>!!e(zn).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)(vv,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)(hv,{showNestedBlocks:!0,__experimentalFeatures:o}))})}));function kv(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=dp(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)(vu,{item:i,isStylePreview:!0})}function _v(e){let{children:t,scope:n,...o}=e;return(0,s.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,s.createElement)("div",o,t))}function yv(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}=mp({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=>{ka.ENTER!==t.keyCode&&ka.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)(_v,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>E(null)},(0,s.createElement)(kv,{activeStyle:a,className:f,genericPreviewBlock:m,style:g})))}yv.Slot=function(e){let{scope:t}=e;return(0,s.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var Ev=yv,Cv=(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"})),Sv=function(e){let{icon:t=Cv,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"))))},wv=(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 Bv="carousel",xv="grid",Iv=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")))},Tv=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:Wd,label:(0,g.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:Ud,label:(0,g.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var Nv=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a,onStartBlank:c}=e;const u=t===Bv,d=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:to,label:(0,g.__)("Carousel view"),onClick:()=>n(Bv),isPressed:u}),(0,s.createElement)(p.Button,{icon:wv,label:(0,g.__)("Grid view"),onClick:()=>n(xv),isPressed:t===xv}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},u&&(0,s.createElement)(Tv,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),d,u&&(0,s.createElement)(Iv,{onBlockPatternSelect:a,onStartBlank:c}))};const Pv=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===Bv){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)(Rv,{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)(Mv,{key:e.name,pattern:e,onSelect:r,composite:l}))))};function Mv(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)(Mv,`${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)(gu,{blocks:l,viewportWidth:u}),(0,s.createElement)("div",{className:`${r}__item-title`},a)),!!c&&(0,s.createElement)(p.VisuallyHidden,{id:m},c))}function Rv(e){let{className:t,pattern:n}=e;const{blocks:o,title:r,description:l}=n,i=(0,d.useInstanceId)(Rv,"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)(gu,{blocks:o,__experimentalLive:!0}),!!l&&(0,s.createElement)(p.VisuallyHidden,{id:i},l))}var Lv=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:l,onBlockPatternSelect:i}=e;const[a,c]=(0,s.useState)(Bv),[u,d]=(0,s.useState)(0),[p,f]=(0,s.useState)(!1),{replaceBlock:g}=(0,m.useDispatch)(zn),h=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(zn),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)(Nv,{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)(Pv,{viewMode:a,activeSlide:u,patterns:h,onBlockPatternSelect:v}))};const Av=(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 Dv=function(e){let{blockClientId:t}=e;const[n,o]=(0,s.useState)(),{updateBlockAttributes:l}=(0,m.useDispatch)(zn),{variations:i,blockAttributes:a}=(0,m.useSelect)((e=>{const{getBlockVariations:n}=e(r.store),{getBlockName:o,getBlockAttributes:l}=e(zn),i=t&&o(t);return{variations:i&&n(i,"transform"),blockAttributes:l(t)}}),[t]);if((0,s.useEffect)((()=>{var e;o(null===(e=Av(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:jd,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 Ov=(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"})),Fv=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),zv={top:{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,g._x)("Align top","Block vertical alignment setting")},center:{icon:Fv,title:(0,g._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Ov,title:(0,g._x)("Align bottom","Block vertical alignment setting")}},Vv=["top","center","bottom"],Hv={isAlternate:!0};var Gv=function(e){let{value:t,onChange:n,controls:o=Vv,isCollapsed:r=!0,isToolbar:l}=e;const a=zv[t],c=zv.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:Hv,icon:a?a.icon:c.icon,label:(0,g._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...zv[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};function Uv(e){return(0,s.createElement)(Gv,i({},e,{isToolbar:!1}))}function Wv(e){return(0,s.createElement)(Gv,i({},e,{isToolbar:!0}))}var $v=(0,d.createHigherOrderComponent)((e=>t=>{const n=mo("color.palette"),o=!mo("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"),jv=$v(p.ColorPalette);function Kv(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(Em,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}
|
70 |
+
// 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)
|
71 |
+
const qv=(0,g.__)("(%s: color %s)"),Yv=(0,g.__)("(%s: gradient %s)"),Xv=["colors","disableCustomColors","gradients","disableCustomGradients"],Zv=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=xm(c||t,l);r=(0,g.sprintf)(qv,a.toLowerCase(),e&&e.name||l)}else{const e=cf(u||n,l);r=(0,g.sprintf)(Yv,a.toLowerCase(),e&&e.name||i)}return(0,s.createElement)(p.ColorIndicator,{key:o,colorValue:l||i,"aria-label":r})}))},Qv=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)(Zv,{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)(Cm,{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))},Jv=e=>{const t=Sm();return t.colors=mo("color.palette"),t.gradients=mo("color.gradients"),(0,s.createElement)(Qv,i({},t,e))},eb=e=>{const t=wm();return(0,s.createElement)(Qv,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)
|
72 |
+
var tb=e=>(0,u.every)(Xv,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Qv,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(eb,e):(0,s.createElement)(Jv,e),nb=function(e,t){return(nb=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)},ob=function(){return(ob=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 rb(e,t,n,o){void 0===o&&(o=0);var r=gb(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 lb(e,t,n,o,r){void 0===r&&(r=0);var l=gb(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 sb(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function ab(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function cb(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?ub:db,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:ob(ob({},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 ub(e,t){return Math.min(e,Math.max(0,t))}function db(e,t){return t}function pb(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 mb(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function fb(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 gb(e,t,n){var o=e/2,r=t/2,l=[fb(0,0,o,r,n),fb(e,0,o,r,n),fb(e,t,o,r,n),fb(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 hb(){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 vb=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=pb(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:rb(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=ob({},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?lb(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?lb(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=cb(n.props.restrictPosition?lb(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?lb(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}nb(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=sb(n,o),this.lastPinchRotation=ab(n,o),this.onDragStart(mb(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=mb(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=sb(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=ab(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 $r().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:hb("reactEasyCrop_Container",v)},n?$r().createElement("img",ob({alt:"",className:hb("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:ob(ob({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&$r().createElement("video",ob({autoPlay:!0,loop:!0,muted:!0,className:hb("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:ob(ob({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&$r().createElement("div",{style:ob(ob({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:hb("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}($r().Component);const bb={position:"bottom right",isAlternate:!0};var kb=window.wp.apiFetch,_b=n.n(kb);const yb=(0,s.createContext)({}),Eb=()=>(0,s.useContext)(yb);function Cb(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)(Lu.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,_b()({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)(
|
73 |
/* translators: 1. Error message */
|
74 |
+
(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)(yb.Provider,{value:f},u)}function Sb(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}=Eb();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)(vb,{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 wb=(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 Bb(){const{isInProgress:e,zoom:t,setZoom:n}=Eb();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:bb,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(p.ToolbarButton,{icon:wb,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 xb=(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 Ib(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?ap:void 0},t)})))}function Tb(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=Eb();return(0,s.createElement)(p.DropdownMenu,{icon:xb,label:(0,g.__)("Aspect Ratio"),popoverProps:bb,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ib,{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)(Ib,{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)(Ib,{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 Nb=(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 Pb(){const{isInProgress:e,rotateClockwise:t}=Eb();return(0,s.createElement)(p.ToolbarButton,{icon:Nb,label:(0,g.__)("Rotate"),onClick:t,disabled:e})}function Mb(){const{isInProgress:e,apply:t,cancel:n}=Eb();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 Rb(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)(Sb,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,s.createElement)(Yn,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Bb,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Tb,{toggleProps:e}))),(0,s.createElement)(Pb,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Mb,null))))}const Lb=[25,50,75,100];function Ab(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")},Lb.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 Db=(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"})),Ob=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 Fb 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,Ca()(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,ad.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)(
|
75 |
/* translators: %s: number of results. */
|
76 |
+
(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 ka.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case ka.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case ka.ENTER:this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case ka.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case ka.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case ka.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,g.__)("Link selected.")));break;case ka.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 zb=(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(zn);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(Fb),Vb=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)(
|
77 |
/* translators: %s: search term. */
|
78 |
+
(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)(wo,{className:"block-editor-link-control__search-item-icon",icon:Va}),(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},Hb=(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"})),Gb=e=>{let{itemProps:t,suggestion:n,isSelected:o=!1,onClick:r,isURL:l=!1,searchTerm:a="",shouldShowType:u=!1}=e;return(0,s.createElement)(p.Button,i({},t,{onClick:r,className:c()("block-editor-link-control__search-item",{"is-selected":o,"is-url":l,"is-entity":!l})}),l&&(0,s.createElement)(wo,{className:"block-editor-link-control__search-item-icon",icon:Hb}),(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,ad.filterURLForDisplay)((0,ad.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 Ub="__CREATE__",Wb=[{id:"opensInNewTab",title:(0,g.__)("Open in new tab")}];function $b(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)(
|
79 |
/* translators: %s: search term. */
|
80 |
+
(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&&Ub===e.type?(0,s.createElement)(Vb,{searchTerm:o,buttonText:h,onClick:()=>r(e),key:e.type,itemProps:a(e,t),isSelected:t===d}):Ub===e.type?null:(0,s.createElement)(Gb,{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 jb(e){const t=(0,u.startsWith)(e,"#");return(0,ad.isURL)(e)||e&&e.includes("www.")||t}const Kb=()=>Promise.resolve([]),qb=e=>{let t="URL";const n=(0,ad.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,ad.prependHTTP)(e):e,type:t}])};const Yb=()=>Promise.resolve([]),Xb=(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)($b,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(zn);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?qb:Kb;return(0,s.useCallback)(((t,s)=>{let{isInitialSuggestions:a}=s;return jb(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||jb(e)||!r?c:c.concat({title:e,url:e,type:Ub})})(t,{...e,isInitialSuggestions:a},r,i,n,o,l)}),[i,r,n])}(E,_,a,C),x=v?k||B:Yb,I=(0,d.useInstanceId)(Xb),[T,N]=(0,s.useState)(),P=async e=>{let t=e;if(Ub!==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)(zb,{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 Zb=Xb,Qb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M12 3.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"})),Jb=(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:ek,Fill:tk}=(0,p.createSlotFill)("BlockEditorLinkControlViewer");function nk(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 ok(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)(nk,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);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,ad.filterURLForDisplay)((0,ad.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)(wo,{icon:Qb,size:32}):(0,s.createElement)(wo,{icon:Hb}),(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,ir.__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:Jb,label:(0,g.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),l&&(0,s.createElement)(p.Button,{icon:Hm,label:(0,g.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:i,iconSize:24}),(0,s.createElement)(ek,{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 rk(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=Wb,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;(ir.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!==ka.ENTER||F||(e.preventDefault(),U())}}),(0,s.createElement)(Zb,{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:Db,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)(ok,{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)(Ob,{value:l,settings:i,onChange:a})),B&&B())}rk.ViewerFill=tk;var lk=rk,ik=(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"})),sk=(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"})),ak=(0,p.withFilters)("editor.MediaUpload")((()=>null)),ck=function(e){let{fallback:t=null,children:n}=e;return(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return!!t().mediaUpload}),[])?n:t},uk=(0,d.compose)([(0,m.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Lu.store);return{createNotice:t,removeNotice:n}})),(0,p.withFilters)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:o,allowedTypes:r,accept:l,onSelect:i,onSelectURL:a,onFilesUpload:c=u.noop,onCloseModal:d=u.noop,name:f=(0,g.__)("Replace"),createNotice:h,removeNotice:v,children:b,multiple:k=!1,addToGallery:_,handleUpload:y=!0}=e;const[E,C]=(0,s.useState)(t),S=(0,m.useSelect)((e=>e(zn).getSettings().mediaUpload),[]),w=(0,s.createRef)(),B=(0,u.uniqueId)("block-editor/media-replace-flow/error-notice/"),x=e=>{const t=document.createElement("div");t.innerHTML=(0,s.renderToString)(e);const n=t.textContent||t.innerText||"";setTimeout((()=>{h("error",n,{speak:!0,id:B,isDismissible:!0})}),1e3)},I=(e,t)=>{t(),C(e.url),i(e),(0,Nt.speak)((0,g.__)("The media file has been replaced")),v(B)},T=e=>{e.keyCode===ka.DOWN&&(e.preventDefault(),e.target.click())},N=k&&!(!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:w,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:T},f)},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)(ak,{gallery:N,addToGallery:_,multiple:k,value:k?o:n,onSelect:e=>I(e,t),allowedTypes:r,onClose:d,render:e=>{let{open:t}=e;return(0,s.createElement)(p.MenuItem,{icon:ik,onClick:t},(0,g.__)("Open Media Library"))}}),(0,s.createElement)(ck,null,(0,s.createElement)(p.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!y)return t(),i(n);c(n),S({allowedTypes:r,filesList:n,onFileChange:e=>{let[n]=e;I(n,t)},onError:x})})(e,t)},accept:l,multiple:k,render:e=>{let{openFileDialog:t}=e;return(0,s.createElement)(p.MenuItem,{icon:sk,onClick:()=>{t()}},(0,g.__)("Upload"))}})),b),a&&(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)(lk,{value:{url:E},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;C(t),a(t),w.current.focus()}})))}})}));function dk(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,ad.filterURLForDisplay)((0,ad.safeDecodeURI)(t))):(0,s.createElement)("span",{className:r})}function pk(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:jd,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))}pk.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:o,value:r,...l}=e;return(0,s.createElement)("form",i({className:c()("block-editor-url-popover__link-editor",n)},l),(0,s.createElement)(zb,{value:r,onChange:o,autocompleteRef:t}),(0,s.createElement)(p.Button,{icon:Db,label:(0,g.__)("Apply"),type:"submit"}))},pk.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:o,url:r,urlLabel:l,...a}=e;return(0,s.createElement)("div",i({className:c()("block-editor-url-popover__link-viewer",t)},a),(0,s.createElement)(dk,{url:r,urlLabel:l,className:n}),o&&(0,s.createElement)(p.Button,{icon:Jb,label:(0,g.__)("Edit"),onClick:o}))};var mk=pk;const fk=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,s.createElement)(mk,{onClose:r},(0,s.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o},(0,s.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,g.__)("URL"),placeholder:(0,g.__)("Paste or type URL"),onChange:n,value:t}),(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:Db,label:(0,g.__)("Apply"),type:"submit"})))};var gk=(0,p.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:l={},mediaPreview:i,notices:a,isAppender:d,accept:f,addToGallery:h,multiple:v=!1,handleUpload:b=!0,disableDropZone:k,disableMediaButtons:_,onError:y,onSelect:E,onCancel:C,onSelectURL:S,onDoubleClick:w,onFilesPreUpload:B=u.noop,onHTMLDrop:x=u.noop,onClose:I=u.noop,children:T,mediaLibraryButton:N,placeholder:P,style:M}=e;const R=(0,m.useSelect)((e=>{const{getSettings:t}=e(zn);return t().mediaUpload}),[]),[L,A]=(0,s.useState)(""),[D,O]=(0,s.useState)(!1);(0,s.useEffect)((()=>{var e;A(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const F=e=>{A(e.target.value)},z=()=>{O(!0)},V=()=>{O(!1)},H=e=>{e.preventDefault(),L&&S&&(S(L),V())},G=e=>{if(!b)return E(e);let o;if(B(e),v)if(h){let e=[];o=n=>{const o=(null!=t?t:[]).filter((t=>t.id?!e.some((e=>{let{id:n}=e;return Number(n)===Number(t.id)})):!e.some((e=>{let{urlSlug:n}=e;return t.url.includes(n)}))));E(o.concat(n)),e=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=E;else o=e=>{let[t]=e;return E(t)};R({allowedTypes:n,filesList:e,onFileChange:o,onError:y})},U=e=>{G(e.target.files)},W=null!=P?P:e=>{let{instructions:t,title:u}=l;if(R||S||(t=(0,g.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===u){const e=null!=n?n:[],[o]=e,r=1===e.length,l=r&&"audio"===o,i=r&&"image"===o,s=r&&"video"===o;void 0===t&&R&&(t=(0,g.__)("Upload a media file or pick one from your media library."),l?t=(0,g.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?t=(0,g.__)("Upload an image file, pick one from your media library, or add one with a URL."):s&&(t=(0,g.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===u&&(u=(0,g.__)("Media"),l?u=(0,g.__)("Audio"):i?u=(0,g.__)("Image"):s&&(u=(0,g.__)("Video")))}const m=c()("block-editor-media-placeholder",o,{"is-appender":d});return(0,s.createElement)(p.Placeholder,{icon:r,label:u,instructions:t,className:m,notices:a,onDoubleClick:w,preview:i,style:M},e,T)},$=()=>k?null:(0,s.createElement)(p.DropZone,{onFilesDrop:G,onHTMLDrop:x}),j=()=>C&&(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,g.__)("Cancel"),variant:"link",onClick:C},(0,g.__)("Cancel")),K=()=>S&&(0,s.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__button",onClick:z,isPressed:D,variant:"tertiary"},(0,g.__)("Insert from URL")),D&&(0,s.createElement)(fk,{src:L,onChange:F,onSubmit:H,onClose:V}));return _?(0,s.createElement)(ck,null,$()):(0,s.createElement)(ck,{fallback:W(K())},(()=>{const e=null!=N?N:e=>{let{open:t}=e;return(0,s.createElement)(p.Button,{variant:"tertiary",onClick:()=>{t()}},(0,g.__)("Media Library"))},o=(0,s.createElement)(ak,{addToGallery:h,gallery:v&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:v,onSelect:E,onClose:I,allowedTypes:n,value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(R&&d)return(0,s.createElement)(s.Fragment,null,$(),(0,s.createElement)(p.FormFileUpload,{onChange:U,accept:f,multiple:v,render:e=>{let{openFileDialog:t}=e;const n=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,g.__)("Upload")),o,K(),j());return W(n)}}));if(R){const e=(0,s.createElement)(s.Fragment,null,$(),(0,s.createElement)(p.FormFileUpload,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:U,accept:f,multiple:v},(0,g.__)("Upload")),o,K(),j());return W(e)}return W(o)})())})),hk=e=>{let{colorSettings:t,...n}=e;const o=t.map((e=>{if(!e)return e;const{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}}));return(0,s.createElement)(tb,i({settings:o,gradients:[],disableCustomGradients:!0},n))};const vk={position:"bottom right",isAlternate:!0};var bk=()=>(0,s.createElement)(s.Fragment,null,["bold","italic","link"].map((e=>(0,s.createElement)(p.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,s.createElement)(p.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((e=>{let[{props:t}]=e;return t})).some((e=>{let{isActive:t}=e;return t}));return(0,s.createElement)(p.ToolbarItem,null,(n=>(0,s.createElement)(p.DropdownMenu,{icon:jd
|
81 |
+
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("More"),toggleProps:{...n,className:c()(n.className,{"is-pressed":t}),describedBy:(0,g.__)("Displays more block tools")},controls:(0,u.orderBy)(e.map((e=>{let[{props:t}]=e;return t})),"title"),popoverProps:vk})))}))),kk=e=>{let{inline:t,anchorRef:n}=e;return t?(0,s.createElement)(p.Popover,{noArrow:!0,position:"top center",focusOnMount:!1,anchorRef:n,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,s.createElement)("div",{className:"block-editor-rich-text__inline-format-toolbar-group"},(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(bk,null)))):(0,s.createElement)(Yn,{group:"inline"},(0,s.createElement)(bk,null))};function _k(){const{didAutomaticChange:e,getSettings:t}=(0,m.useSelect)(zn);return(0,d.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;n.defaultPrevented||o!==ka.DELETE&&o!==ka.BACKSPACE&&o!==ka.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}function yk(e){return e.filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)})).map((e=>`<img src="${(0,wp.createBlobURL)(e)}">`)).join("")}var Ek=window.wp.shortcode;function Ck(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function Sk(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function wk(e){let{allowedFormats:t,formattingControls:n,disableFormats:o}=e;return o?wk.EMPTY_ARRAY:t||n?t||(Rt()("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats",version:"6.2"}),n.map((e=>`core/${e}`))):void 0}function Bk(e){let{value:t,pastedBlocks:n=[],onReplace:o,onSplit:r,onSplitMiddle:l,multilineTag:i}=e;if(!o||!r)return;const s=[],[a,c]=(0,Pt.split)(t),u=n.length>0;let d=-1;const p=(0,Pt.isEmpty)(a)&&!(0,Pt.isEmpty)(c);u&&(0,Pt.isEmpty)(a)||(s.push(r((0,Pt.toHTMLString)({value:a,multilineTag:i}),!p)),d+=1),u?(s.push(...n),d+=n.length):l&&s.push(l()),(u||l)&&(0,Pt.isEmpty)(c)||s.push(r((0,Pt.toHTMLString)({value:c,multilineTag:i}),p)),o(s,u?d:1,u?-1:0)}function xk(e,t){return t?(0,Pt.replace)(e,/\n+/g,Pt.__UNSTABLE_LINE_SEPARATOR):(0,Pt.replace)(e,new RegExp(Pt.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function Ik(e){const t=(0,s.useRef)(e);return t.current=e,(0,d.useRefEffect)((e=>{function n(e){var n;const{isSelected:o,disableFormats:l,onChange:i,value:s,formatTypes:a,tagName:c,onReplace:u,onSplit:d,onSplitMiddle:p,__unstableEmbedURLOnPaste:m,multilineTag:f,preserveWhiteSpace:g,pastePlainText:h}=t.current;if(!o)return void e.preventDefault();const{clipboardData:v}=e;let b="",k="";try{b=v.getData("text/plain"),k=v.getData("text/html")}catch(e){try{k=v.getData("Text")}catch(e){return}}if(k=function(e){return e.replace(/.*<!--StartFragment-->/s,"").replace(/<!--EndFragment-->.*/s,"")}(k),k=function(e){const t="<meta charset='utf-8'>";return e.startsWith(t)?e.slice(t.length):e}(k),e.preventDefault(),window.console.log("Received HTML:\n\n",k),window.console.log("Received plain text:\n\n",b),l)return void i((0,Pt.insert)(s,b));const _=a.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===s&&(e=n(s,{html:k,plainText:b})),e}),s);if(_!==s)return void i(_);const y=[...(0,ir.getFilesFromDataTransfer)(v)];if("true"===v.getData("rich-text")){const e=v.getData("rich-text-multi-line-tag")||void 0;let t=(0,Pt.create)({html:k,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:g});return t=xk(t,!!f),Ck(t,s.activeFormats),void i((0,Pt.insert)(s,t))}if(h)return void i((0,Pt.insert)(s,(0,Pt.create)({text:b})));if(y&&y.length&&(null===(n=k)||void 0===n||!n.includes('xmlns:o="urn:schemas-microsoft-com:office:office'))){const e=(0,r.pasteHandler)({HTML:yk(y),mode:"BLOCKS",tagName:c,preserveWhiteSpace:g});return window.console.log("Received items:\n\n",y),void(u&&(0,Pt.isEmpty)(s)?u(e):Bk({value:s,pastedBlocks:e,onReplace:u,onSplit:d,onSplitMiddle:p,multilineTag:f}))}let E=u&&d?"AUTO":"INLINE";var C;"AUTO"===E&&(0,Pt.isEmpty)(s)&&(C=b,(0,Ek.regexp)(".*").test(C))&&(E="BLOCKS"),m&&(0,Pt.isEmpty)(s)&&(0,ad.isURL)(b.trim())&&(E="BLOCKS");const S=(0,r.pasteHandler)({HTML:k,plainText:b,mode:E,tagName:c,preserveWhiteSpace:g});if("string"==typeof S){let e=(0,Pt.create)({html:S});e=xk(e,!!f),Ck(e,s.activeFormats),i((0,Pt.insert)(s,e))}else S.length>0&&(u&&(0,Pt.isEmpty)(s)?u(S,S.length-1,-1):Bk({value:s,pastedBlocks:S,onReplace:u,onSplit:d,onSplitMiddle:p,multilineTag:f}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}function Tk(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,m.useDispatch)(zn),o=(0,s.useRef)(e);return o.current=e,(0,d.useRefEffect)((e=>{function l(){const{value:e,onReplace:t}=o.current;if(!t)return;const{start:l,text:i}=e;if(" "!==i.slice(l-1,l))return;const s=i.slice(0,l).trim(),a=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"prefix"===t})),c=(0,r.findTransform)(a,(e=>{let{prefix:t}=e;return s===t}));if(!c)return;const u=(0,Pt.toHTMLString)({value:(0,Pt.slice)(e,l,i.length)});t([c.transform(u)]),n()}function i(e){const{inputType:r,type:i}=e,{value:s,onChange:a,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==r&&"compositionend"!==i)return;c&&l&&l();const d=u.reduce(((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e}),function(e){const t="tales of gutenberg",{start:n,text:o}=e;return n<t.length||o.slice(n-t.length,n).toLowerCase()!==t?e:(0,Pt.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(s));d!==s&&(t(),a({...d,activeFormats:s.activeFormats}),n())}return e.addEventListener("input",i),e.addEventListener("compositionend",i),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function Nk(e){const{__unstableMarkAutomaticChange:t}=(0,m.useDispatch)(zn),n=(0,s.useRef)(e);return n.current=e,(0,d.useRefEffect)((e=>{function o(e){if(e.defaultPrevented)return;const{removeEditorOnlyFormats:o,value:l,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c,onChange:u,disableLineBreaks:d,onSplitAtEnd:p}=n.current;if(e.keyCode!==ka.ENTER)return;e.preventDefault();const m={...l};m.formats=o(l);const f=i&&s;if(i){const e=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"enter"===t})),n=(0,r.findTransform)(e,(e=>e.regExp.test(m.text)));n&&(i([n.transform({content:m.text})]),t())}if(c)e.shiftKey?d||u((0,Pt.insert)(m,"\n")):f&&(0,Pt.__unstableIsEmptyLine)(m)?Bk({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c}):u((0,Pt.__unstableInsertLineSeparator)(m));else{const{text:t,start:n,end:o}=m,r=p&&n===o&&o===t.length;e.shiftKey||!f&&!r?d||u((0,Pt.insert)(m,"\n")):!f&&r?p():f&&Bk({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function Pk(e){return e(Pt.store).getFormatTypes()}wk.EMPTY_ARRAY=[];const Mk=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function Rk(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function Lk(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function Ak(e){let{formatTypes:t,onChange:n,onFocus:o,value:r,forwardedRef:l}=e;return t.map((e=>{const{name:t,edit:i}=e;if(!i)return null;const a=(0,Pt.getActiveFormat)(r,t);let c=void 0!==a;const d=(0,Pt.getActiveObject)(r),p=void 0!==d&&d.type===t;if("core/link"===t&&!(0,Pt.isCollapsed)(r)){const e=r.formats,t=(0,u.find)(e[r.start],{type:"core/link"}),n=(0,u.find)(e[r.end-1],{type:"core/link"});t&&n&&t===n||(c=!1)}return(0,s.createElement)(i,{key:t,isActive:c,activeAttributes:c&&a.attributes||{},isObjectActive:p,activeObjectAttributes:p&&d.attributes||{},value:r,onChange:n,onFocus:o,contentRef:l})}))}const Dk=(0,s.createContext)(),Ok=(0,s.createContext)(),Fk=(0,s.forwardRef)((function e(t,n){let{children:o,tagName:l="div",value:a="",onChange:f,isSelected:g,multiline:h,inlineToolbar:v,wrapperClassName:b,autocompleters:k,onReplace:_,placeholder:y,allowedFormats:E,formattingControls:C,withoutInteractiveFormatting:S,onRemove:w,onMerge:B,onSplit:x,__unstableOnSplitAtEnd:I,__unstableOnSplitMiddle:T,identifier:N,preserveWhiteSpace:P,__unstablePastePlainText:M,__unstableEmbedURLOnPaste:R,__unstableDisableFormats:L,disableLineBreaks:A,unstableOnFocus:D,__unstableAllowPrefixTransformations:O,...F}=t;const z=(0,d.useInstanceId)(e);N=N||z,F=function(e){return(0,u.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef"])}(F);const V=(0,s.useRef)(),{clientId:H}=Un(),{selectionStart:G,selectionEnd:U,isSelected:W,disabled:$}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n,isMultiSelecting:o,hasMultiSelection:r}=e(zn),l=t(),i=n();let s;return void 0===g?s=l.clientId===H&&l.attributeKey===N:g&&(s=l.clientId===H),{selectionStart:s?l.offset:void 0,selectionEnd:s?i.offset:void 0,isSelected:s,disabled:o()||r()}})),{selectionChange:j}=(0,m.useDispatch)(zn),K=Sk(h),q=wk({allowedFormats:E,formattingControls:C,disableFormats:L}),Y=!q||q.length>0;let X=a,Z=f;Array.isArray(a)&&(X=r.children.toHTML(a),Z=e=>f(r.children.fromDOM((0,Pt.__unstableCreateElement)(document,e).childNodes)));const Q=(0,s.useCallback)(((e,t)=>{j(H,N,e,t)}),[H,N]),{formatTypes:J,prepareHandlers:ee,valueHandlers:te,changeHandlers:ne,dependencies:oe}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:o,allowedFormats:r}=e;const l=(0,m.useSelect)(Pk,[]),i=(0,s.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&Mk.has(n))}))),[l,r,Mk]),a=(0,m.useSelect)((e=>i.reduce(((o,r)=>(r.__experimentalGetPropsForEditableTreePreparation&&(o[r.name]=r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t})),o)),{})),[i,t,n]),c=(0,m.useDispatch)(),u=[],d=[],p=[],f=[];return i.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const o=a[e.name],r=e.__experimentalCreatePrepareEditableTree(o,{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(r):u.push(r);for(const e in o)f.push(o[e])}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(c,{richTextIdentifier:n,blockClientId:t})),p.push(e.__experimentalCreateOnChangeEditableValue({...a[e.name]||{},...o},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:i,prepareHandlers:u,valueHandlers:d,changeHandlers:p,dependencies:f}}({clientId:H,identifier:N,withoutInteractiveFormatting:S,allowedFormats:q});function re(e){return J.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,Pt.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:le,onChange:ie,ref:se}=(0,Pt.__unstableUseRichText)({value:X,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;Z(e),Object.values(ne).forEach((e=>{e(n,o)}))},selectionStart:G,selectionEnd:U,onSelectionChange:Q,placeholder:y,__unstableIsSelected:W,__unstableMultilineTag:K,__unstableDisableFormats:L,preserveWhiteSpace:P,__unstableDependencies:[...oe,l],__unstableAfterParse:function(e){return te.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:re,__unstableAddInvisibleFormats:function(e){return ee.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ae=function(e){return(0,p.__unstableUseAutocompleteProps)({...e,completers:Vh(e)})}({onReplace:_,completers:k,record:le,onChange:ie});!function(e){let{value:t}=e;const n=t.activeFormats&&!!t.activeFormats.length,{isCaretWithinFormattedText:o}=(0,m.useSelect)(zn),{enterFormattedText:r,exitFormattedText:l}=(0,m.useDispatch)(zn);(0,s.useEffect)((()=>{n?o()||r():o()&&l()}),[n])}({value:le}),function(e){let{html:t,value:n}=e;const o=(0,s.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:l}=(0,m.useDispatch)(zn);(0,s.useLayoutEffect)((()=>{if(o.current){if(o.current!==n.text){const e=window.setTimeout((()=>{l()}),1e3);return o.current=n.text,()=>{window.clearTimeout(e)}}l()}else o.current=n.text}),[t,r])}({html:X,value:le});const ce=(0,s.useRef)(new Set),ue=(0,s.useRef)(new Set);function de(){V.current.focus()}const pe=l,me=(0,s.createElement)(s.Fragment,null,W&&(0,s.createElement)(Dk.Provider,{value:ce},(0,s.createElement)(Ok.Provider,{value:ue},(0,s.createElement)(p.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:le,onChange:ie,onFocus:de}),(0,s.createElement)(Ak,{value:le,onChange:ie,onFocus:de,formatTypes:J,forwardedRef:V})))),W&&Y&&(0,s.createElement)(kk,{inline:v,anchorRef:V.current}),(0,s.createElement)(pe,i({role:"textbox","aria-multiline":!0,"aria-label":y},F,ae,{ref:(0,d.useMergeRefs)([ae.ref,F.ref,se,Tk({value:le,onChange:ie,__unstableAllowPrefixTransformations:O,formatTypes:J,onReplace:_}),(0,d.useRefEffect)((e=>{function t(e){(ka.isKeyboardEvent.primary(e,"z")||ka.isKeyboardEvent.primary(e,"y")||ka.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),Rk(ce),Lk(ue),_k(),Ik({isSelected:W,disableFormats:L,onChange:ie,value:le,formatTypes:J,tagName:l,onReplace:_,onSplit:x,onSplitMiddle:T,__unstableEmbedURLOnPaste:R,multilineTag:K,preserveWhiteSpace:P,pastePlainText:M}),Nk({removeEditorOnlyFormats:re,value:le,onReplace:_,onSplit:x,onSplitMiddle:T,multilineTag:K,onChange:ie,disableLineBreaks:A,onSplitAtEnd:I}),V,n]),contentEditable:!$||void 0,suppressContentEditableWarning:!$,className:c()("block-editor-rich-text__editable",F.className,"rich-text"),onFocus:D,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===ka.DELETE||t===ka.BACKSPACE)){const{start:n,end:o,text:r}=le,l=t===ka.BACKSPACE,i=le.activeFormats&&!!le.activeFormats.length;if(!(0,Pt.isCollapsed)(le)||i||l&&0!==n||!l&&o!==r.length)return;B&&B(!l),w&&(0,Pt.isEmpty)(le)&&l&&w(!l),e.preventDefault()}}})));if(!b)return me;Rt()("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div",version:"6.2"});const fe=c()("block-editor-rich-text",b);return(0,s.createElement)("div",{className:fe},me)}));Fk.Content=e=>{let{value:t,tagName:n,multiline:o,...l}=e;Array.isArray(t)&&(t=r.children.toHTML(t));const i=Sk(o);!t&&i&&(t=`<${i}></${i}>`);const a=(0,s.createElement)(s.RawHTML,null,t);return n?(0,s.createElement)(n,(0,u.omit)(l,["format"]),a):a},Fk.isEmpty=e=>!e||0===e.length;var zk=Fk;const Vk=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(zk,i({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));Vk.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,s.createElement)(n,o,t)};var Hk=Vk,Gk=(0,s.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,s.createElement)(Hk,i({ref:t},o));const{className:r,onChange:l,...a}=o;return(0,s.createElement)(Sr.Z,i({ref:t,className:c()("block-editor-plain-text",r),onChange:e=>l(e.target.value)},a))}));function Uk(e){let{property:t,viewport:n,desc:o}=e;const r=(0,d.useInstanceId)(Uk),l=o||(0,g.sprintf)(
|
82 |
/* translators: 1: property name. 2: viewport name. */
|
83 |
+
(0,g._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),t,n.label);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("span",{"aria-describedby":`rbc-desc-${r}`},n.label),(0,s.createElement)(p.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`},l))}var Wk=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:l,renderResponsiveControls:i,isResponsive:a=!1,defaultLabel:u={id:"all",
|
84 |
/* translators: 'Label. Used to signify a layout property (eg: margin, padding) will apply uniformly to all screensizes.' */
|
85 |
+
label:(0,g.__)("All")},viewports:d=[{id:"small",label:(0,g.__)("Small screens")},{id:"medium",label:(0,g.__)("Medium screens")},{id:"large",label:(0,g.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const m=o||(0,g.sprintf)(
|
86 |
/* translators: 'Toggle control label. Should the property be the same across all screen sizes or unique per screen size.'. %s property value for the control (eg: margin, padding...etc) */
|
87 |
+
(0,g.__)("Use the same %s on all screensizes."),n),f=(0,g.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),h=l((0,s.createElement)(Uk,{property:n,viewport:u}),u);
|
88 |
+
/* translators: 'Help text for the responsive mode toggle control.' */return(0,s.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,s.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,s.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,s.createElement)(p.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:m,checked:!a,onChange:r,help:f}),(0,s.createElement)("div",{className:c()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&h,a&&(i?i(d):d.map((e=>(0,s.createElement)(s.Fragment,{key:e.id},l((0,s.createElement)(Uk,{property:n,viewport:e}),e))))))))};function $k(e){let{character:t,type:n,onUse:o}=e;const r=(0,s.useContext)(Dk),l=(0,s.useRef)();return l.current=o,(0,s.useEffect)((()=>{function e(e){ka.isKeyboardEvent[n](e,t)&&(l.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}}),[t,n]),null}function jk(e){let t,{name:n,shortcutType:o,shortcutCharacter:r,...l}=e,a="RichText.ToolbarControls";return n&&(a+=`.${n}`),o&&r&&(t=ka.displayShortcut[o](r)),(0,s.createElement)(p.Fill,{name:a},(0,s.createElement)(p.ToolbarButton,i({},l,{shortcut:t})))}function Kk(e){let{inputType:t,onInput:n}=e;const o=(0,s.useContext)(Ok),r=(0,s.useRef)();return r.current=n,(0,s.useEffect)((()=>{function e(e){e.inputType===t&&(r.current(),e.preventDefault())}return o.current.add(e),()=>{o.current.delete(e)}}),[t]),null}const qk=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z"}));var Yk=(0,s.forwardRef)((function(e,t){const n=(0,m.useSelect)((e=>e(zn).isNavigationMode()),[]),{setNavigationMode:o}=(0,m.useDispatch)(zn),r=e=>{o("edit"!==e)};return(0,s.createElement)(p.Dropdown,{renderToggle:o=>{let{isOpen:r,onToggle:l}=o;return(0,s.createElement)(p.Button,i({},e,{ref:t,icon:n?qk:Jb,"aria-expanded":r,"aria-haspopup":"true",onClick:l
|
89 |
+
/* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("Tools")}))},position:"bottom right",renderContent:()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{role:"menu","aria-label":(0,g.__)("Tools")},(0,s.createElement)(p.MenuItemsChoice,{value:n?"select":"edit",onSelect:r,choices:[{value:"edit",label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(wo,{icon:Jb}),(0,g.__)("Edit"))},{value:"select",label:(0,s.createElement)(s.Fragment,null,qk,(0,g.__)("Select"))}]})),(0,s.createElement)("div",{className:"block-editor-tool-selector__help"},(0,g.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function Xk(e){let{units:t,...n}=e;const o=(0,p.__experimentalUseCustomUnits)({availableUnits:mo("spacing.units")||["%","px","em","rem","vw"],units:t});return(0,s.createElement)(p.__experimentalUnitControl,i({units:o},n))}var Zk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));class Qk extends s.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.submitLink=this.submitLink.bind(this),this.state={expanded:!1}}toggle(){this.setState({expanded:!this.state.expanded})}submitLink(e){e.preventDefault(),this.toggle()}render(){const{url:e,onChange:t}=this.props,{expanded:n}=this.state,o=e?(0,g.__)("Edit link"):(0,g.__)("Insert link");return(0,s.createElement)("div",{className:"block-editor-url-input__button"},(0,s.createElement)(p.Button,{icon:Vm,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,s.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},(0,s.createElement)("div",{className:"block-editor-url-input__button-modal-line"},(0,s.createElement)(p.Button,{className:"block-editor-url-input__back",icon:Zk,label:(0,g.__)("Close"),onClick:this.toggle}),(0,s.createElement)(zb,{value:e||"",onChange:t}),(0,s.createElement)(p.Button,{icon:Db,label:(0,g.__)("Submit"),type:"submit"}))))}}var Jk=Qk,e_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));const t_="none",n_="custom",o_="media",r_="attachment",l_=["noreferrer","noopener"],i_=(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,s.createElement)(p.Path,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,s.createElement)(p.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),s_=e=>{let{linkDestination:t,onChangeUrl:n,url:o,mediaType:r="image",mediaUrl:l,mediaLink:i,linkTarget:a,linkClass:c,rel:d}=e;const[m,f]=(0,s.useState)(!1),h=(0,s.useCallback)((()=>{f(!0)})),[v,b]=(0,s.useState)(!1),[k,_]=(0,s.useState)(null),y=(0,s.useRef)(null),E=(0,s.useCallback)((()=>{t!==o_&&t!==r_||_(""),b(!0)})),C=(0,s.useCallback)((()=>{b(!1)})),S=(0,s.useCallback)((()=>{_(null),C(),f(!1)})),w=e=>{let t=e;return void 0===e||(0,u.isEmpty)(t)||(0,u.isEmpty)(t)||((0,u.each)(l_,(e=>{const n=new RegExp("\\b"+e+"\\b","gi");t=t.replace(n,"")})),t!==e&&(t=t.trim()),(0,u.isEmpty)(t)&&(t=void 0)),t},B=(0,s.useCallback)((()=>e=>{const t=y.current;t&&t.contains(e.target)||(f(!1),_(null),C())})),x=(0,s.useCallback)((()=>e=>{if(k){var t;const e=(null===(t=T().find((e=>e.url===k)))||void 0===t?void 0:t.linkDestination)||n_;n({href:k,linkDestination:e})}C(),_(null),e.preventDefault()})),I=(0,s.useCallback)((()=>{n({linkDestination:t_,href:""})})),T=()=>{const e=[{linkDestination:o_,title:(0,g.__)("Media File"),url:"image"===r?l:void 0,icon:i_}];return"image"===r&&i&&e.push({linkDestination:r_,title:(0,g.__)("Attachment Page"),url:"image"===r?i:void 0,icon:(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,s.createElement)(p.Path,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},N=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Open in new tab"),onChange:e=>{const t=(e=>{const t=e?"_blank":void 0;let n;return n=t||d?w(d):void 0,{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===a}),(0,s.createElement)(p.TextControl,{label:(0,g.__)("Link Rel"),value:w(d)||"",onChange:e=>{n({rel:e})}}),(0,s.createElement)(p.TextControl,{label:(0,g.__)("Link CSS Class"),value:c||"",onChange:e=>{n({linkClass:e})}})),P=null!==k?k:o,M=((0,u.find)(T(),["linkDestination",t])||{}).title;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{icon:Vm,className:"components-toolbar__control",label:o?(0,g.__)("Edit link"):(0,g.__)("Insert link"),"aria-expanded":m,onClick:h}),m&&(0,s.createElement)(mk,{onFocusOutside:B(),onClose:S,renderSettings:()=>N,additionalControls:!P&&(0,s.createElement)(p.NavigableMenu,null,(0,u.map)(T(),(e=>(0,s.createElement)(p.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{_(null),(e=>{const t=T();let o;o=e?((0,u.find)(t,(t=>t.url===e))||{linkDestination:n_}).linkDestination:t_,n({linkDestination:o,href:e})})(e.url),C()}},e.title))))},(!o||v)&&(0,s.createElement)(mk.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:P,onChangeInputValue:_,onSubmit:x(),autocompleteRef:y}),o&&!v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(mk.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:E,urlLabel:M}),(0,s.createElement)(p.Button,{icon:e_,label:(0,g.__)("Remove link"),onClick:I}))))};function a_(e){let{children:t,className:n,isEnabled:o=!0,deviceType:r,setDeviceType:l}=e;if((0,d.useViewportMatch)("small","<"))return null;const i={className:c()(n,"block-editor-post-preview__dropdown-content"),position:"bottom left"},a={variant:"tertiary",className:"block-editor-post-preview__button-toggle",disabled:!o,
|
90 |
/* translators: button label text should, if possible, be under 16 characters. */
|
91 |
+
children:(0,g.__)("Preview")};return(0,s.createElement)(p.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:i,toggleProps:a,icon:null},(()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Desktop"),icon:"Desktop"===r&&ap},(0,g.__)("Desktop")),(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Tablet"),icon:"Tablet"===r&&ap},(0,g.__)("Tablet")),(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Mobile"),icon:"Mobile"===r&&ap},(0,g.__)("Mobile"))),t)))}function c_(e){const[t,n]=(0,s.useState)(window.innerWidth);(0,s.useEffect)((()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e]);const o=e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=360;break;default:return null}return n<t?n:t};return(e=>{const t="Mobile"===e?"768px":"1024px";switch(e){case"Tablet":case"Mobile":return{width:o(e),margin:(window.innerHeight<800?36:72)+"px auto",height:t,borderRadius:"2px 2px 2px 2px",border:"1px solid #ddd",overflowY:"auto"};default:return null}})(e)}var u_=(0,m.withSelect)((e=>({selectedBlockClientId:e(zn).getBlockSelectionStart()})))((e=>{let{selectedBlockClientId:t}=e;const n=Ia(t);return t?(0,s.createElement)(p.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},(0,g.__)("Skip to the selected block")):null})),d_=window.wp.wordcount,p_=(0,m.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(zn);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=(0,d_.count)((0,r.serialize)(t),"words");return(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,s.createElement)(Wa,{icon:lp,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,g.sprintf)(
|
92 |
/* translators: %d: number of blocks */
|
93 |
+
(0,g._n)("%d block","%d blocks",t.length),t.length)),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,g.sprintf)(
|
94 |
/* translators: %d: number of words */
|
95 |
+
(0,g._n)("%d word","%d words",n),n))))}));function m_(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:o,styles:l}=(0,m.useSelect)((e=>{var n,o;const l=e(zn).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==l||null===(n=l.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(o=null==l?void 0:l.onChange)&&void 0!==o?o:null,styles:e(r.store).getBlockStyles(t)}}),[t]),i=(0,s.useMemo)((()=>[{label:(0,g.__)("Not set"),value:""},...l.map((e=>{let{label:t,name:n}=e;return{label:t,value:n}}))]),[l]),a=(0,s.useMemo)((()=>{var e;return null===(e=pp(l))||void 0===e?void 0:e.name}),[l]),c=(0,s.useCallback)((e=>{o(t,e)}),[t,o]);return n&&n!==a?o&&(0,s.createElement)("div",{className:"default-style-picker__default-switcher"},(0,s.createElement)(p.SelectControl,{options:i,value:n||"",label:(0,g.__)("Default Style"),onChange:c})):null}const f_=e=>{let{clientId:t,blockName:n,hasBlockStyles:o}=e;const l=Od(t);return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)($a,l),(0,s.createElement)(Dv,{blockClientId:t}),o&&(0,s.createElement)("div",null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Styles")},(0,s.createElement)(Ev,{scope:"core/block-inspector",clientId:t}),(0,r.hasBlockSupport)(n,"defaultStylePicker",!0)&&(0,s.createElement)(m_,{blockName:n}))),(0,s.createElement)(nr.Slot,null),(0,s.createElement)(nr.Slot,{__experimentalGroup:"color",label:(0,g.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,s.createElement)(nr.Slot,{__experimentalGroup:"typography",label:(0,g.__)("Typography")}),(0,s.createElement)(nr.Slot,{__experimentalGroup:"dimensions",label:(0,g.__)("Dimensions")}),(0,s.createElement)(nr.Slot,{__experimentalGroup:"border",label:(0,g.__)("Border")}),(0,s.createElement)("div",null,(0,s.createElement)(g_,null)),(0,s.createElement)(u_,{key:"back"}))},g_=()=>{const e=(0,p.__experimentalUseSlot)(tr.slotName);return Boolean(e.fills&&e.fills.length)?(0,s.createElement)(p.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,g.__)("Advanced"),initialOpen:!1},(0,s.createElement)(nr.Slot,{__experimentalGroup:"advanced"})):null};var h_=e=>{let{showNoBlockSelectedMessage:t=!0}=e;const{count:n,hasBlockStyles:o,selectedBlockName:l,selectedBlockClientId:i,blockType:a}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o}=e(zn),{getBlockStyles:l}=e(r.store),i=t(),s=i&&o(i),a=s&&(0,r.getBlockType)(s),c=s&&l(s);return{count:n(),selectedBlockClientId:i,selectedBlockName:s,blockType:a,hasBlockStyles:c&&c.length>0}}),[]);if(n>1)return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(p_,null),(0,s.createElement)(nr.Slot,null),(0,s.createElement)(nr.Slot,{__experimentalGroup:"color",label:(0,g.__)("Color")}),(0,s.createElement)(nr.Slot,{__experimentalGroup:"typography",label:(0,g.__)("Typography")}),(0,s.createElement)(nr.Slot,{__experimentalGroup:"dimensions",label:(0,g.__)("Dimensions")}),(0,s.createElement)(nr.Slot,{__experimentalGroup:"border",label:(0,g.__)("Border")}));const c=l===(0,r.getUnregisteredTypeHandlerName)();return a&&i&&!c?(0,s.createElement)(f_,{clientId:i,blockName:a.name,hasBlockStyles:o}):t?(0,s.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,g.__)("No block selected.")):null};function v_(e){let{children:t,__unstableContentRef:n,...o}=e;const r=(0,d.useViewportMatch)("medium"),l=(0,m.useSelect)((e=>e(zn).getSettings().hasFixedToolbar),[]),a=(0,oc.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:c,getBlockRootClientId:f}=(0,m.useSelect)(zn),{duplicateBlocks:g,removeBlocks:h,insertAfterBlock:v,insertBeforeBlock:b,clearSelectedBlock:k,moveBlocksUp:_,moveBlocksDown:y}=(0,m.useDispatch)(zn);return(0,s.createElement)("div",i({},o,{onKeyDown:function(e){if(a("core/block-editor/move-up",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));_(t,n)}}else if(a("core/block-editor/move-down",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));y(t,n)}}else if(a("core/block-editor/duplicate",e)){const t=c();t.length&&(e.preventDefault(),g(t))}else if(a("core/block-editor/remove",e)){const t=c();t.length&&(e.preventDefault(),h(t))}else if(a("core/block-editor/insert-after",e)){const t=c();t.length&&(e.preventDefault(),v((0,u.last)(t)))}else if(a("core/block-editor/insert-before",e)){const t=c();t.length&&(e.preventDefault(),b((0,u.first)(t)))}else if(a("core/block-editor/delete-multi-selection",e)){if(["INPUT","TEXTAREA"].includes(e.target.nodeName)||e.defaultPrevented)return;const t=c();t.length>1&&(e.preventDefault(),h(t))}else a("core/block-editor/unselect",e)&&c().length>1&&(e.preventDefault(),k(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges())}}),(0,s.createElement)(Rd,{__unstableContentRef:n},(l||!r)&&(0,s.createElement)($p,{isFixed:!0}),(0,s.createElement)(Yp,{__unstableContentRef:n}),(0,s.createElement)(p.Popover.Slot,{name:"block-toolbar",ref:Nd(n)}),t,(0,s.createElement)(p.Popover.Slot,{name:"__unstable-block-tools-after",ref:Nd(n)})))}var b_=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:a,__experimentalFilterValue:c,onSelect:d=u.noop,shouldFocusBlock:p=!1}=e;const f=(0,m.useSelect)((e=>{const{getBlockRootClientId:t}=e(zn);return n||t(o)||void 0}),[o,n]);return(0,s.createElement)(_d,{onSelect:d,rootClientId:f,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalInsertionIndex:a,__experimentalFilterValue:c,shouldFocusBlock:p,ref:t})}));function k_(){return null}k_.Register=function(){const{registerShortcut:e}=(0,m.useDispatch)(oc.store);return(0,s.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,g.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,g.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,g.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,g.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,g.__)("Remove multiple selected blocks."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,g.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,g.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,g.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,g.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,g.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var y_=k_;function E_(){return Rt()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const C_=new Set([ka.UP,ka.RIGHT,ka.DOWN,ka.LEFT,ka.ENTER,ka.BACKSPACE]);function S_(){const e=(0,m.useSelect)((e=>e(zn).isTyping()),[]),{stopTyping:t}=(0,m.useDispatch)(zn);return(0,d.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,l;function i(e){const{clientX:n,clientY:o}=e;r&&l&&(r!==n||l!==o)&&t(),r=n,l=o}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}}),[e,t])}function w_(){const e=(0,m.useSelect)((e=>e(zn).isTyping())),{startTyping:t,stopTyping:n}=(0,m.useDispatch)(zn),o=S_(),r=(0,d.useRefEffect)((o=>{const{ownerDocument:r}=o,{defaultView:l}=r;if(e){let e;function t(t){const{target:o}=t;e=l.setTimeout((()=>{(0,ir.isTextField)(o)||n()}))}function i(e){const{keyCode:t}=e;t!==ka.ESCAPE&&t!==ka.TAB||n()}function s(){const e=l.getSelection();e.rangeCount>0&&e.getRangeAt(0).collapsed||n()}return o.addEventListener("focus",t),o.addEventListener("keydown",i),r.addEventListener("selectionchange",s),()=>{l.clearTimeout(e),o.removeEventListener("focus",t),o.removeEventListener("keydown",i),r.removeEventListener("selectionchange",s)}}function i(e){const{type:n,target:r}=e;(0,ir.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&C_.has(t)}(e))&&t()}return o.addEventListener("keypress",i),o.addEventListener("keydown",i),()=>{o.removeEventListener("keypress",i),o.removeEventListener("keydown",i)}}),[e,t,n]);return(0,d.useMergeRefs)([o,r])}var B_=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:w_()},t)};const x_=-1!==window.navigator.userAgent.indexOf("Trident"),I_=new Set([ka.UP,ka.DOWN,ka.LEFT,ka.RIGHT]);function T_(){const e=(0,m.useSelect)((e=>e(zn).hasSelectedBlock()),[]);return(0,d.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,l,i;function s(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function a(e){l&&o.cancelAnimationFrame(l),l=o.requestAnimationFrame((()=>{c(e),l=null}))}function c(e){let{keyCode:r}=e;if(!m())return;const l=(0,ir.computeCaretRect)(o);if(!l)return;if(!i)return void(i=l);if(I_.has(r))return void(i=l);const s=l.top-i.top;if(0===s)return;const a=(0,ir.getScrollContainer)(t);if(!a)return;const c=a===n.body,u=c?o.scrollY:a.scrollTop,d=c?0:a.getBoundingClientRect().top,p=c?i.top/o.innerHeight:(i.top-d)/(o.innerHeight-d);if(0===u&&p<.75&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=l);const f=c?o.innerHeight:a.clientHeight;i.top+i.height>d+f||i.top<d?i=l:c?o.scrollBy(0,s):a.scrollTop+=s}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){m()&&(i=(0,ir.computeCaretRect)(o))}function m(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",s,!0),o.addEventListener("resize",s,!0),t.addEventListener("keydown",a),t.addEventListener("keyup",c),t.addEventListener("mousedown",u),t.addEventListener("touchstart",u),()=>{o.removeEventListener("scroll",s,!0),o.removeEventListener("resize",s,!0),t.removeEventListener("keydown",a),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),o.cancelAnimationFrame(r),o.cancelAnimationFrame(l)}}),[e])}var N_=x_?e=>e.children:function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:T_(),className:"block-editor__typewriter"},t)};const P_=(0,s.createContext)({});function M_(e,t,n){const o={...e,[t]:e[t]?new Set(e[t]):new Set};return o[t].add(n),o}function R_(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const o=(0,s.useContext)(P_),{name:r}=Un();n=n||r;const l=Boolean(null===(t=o[n])||void 0===t?void 0:t.has(e)),i=(0,s.useMemo)((()=>M_(o,n,e)),[o,n,e]),a=(0,s.useCallback)((e=>{let{children:t}=e;return(0,s.createElement)(P_.Provider,{value:i},t)}),[i]);return[l,a]}function L_(e){if(void 0===e)e=v.colors;else{const t=e.filter((e=>e.color));0===t.length?e=v.colors:t.length<e.length&&(e=t)}return e}function A_(e){if(void 0===e)e=v.gradients;else{const t=e.filter((e=>e.gradient));0===t.length?e=v.gradients:t.length<e.length&&(e=t)}return e}function D_(e){const t=null==e?void 0:e.trim().match(/^(0?[-.]?\d*\.?\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/);return isNaN(e)||isNaN(parseFloat(e))?t?{value:parseFloat(t[1])||t[1],unit:t[2]}:{value:e,unit:void 0}:{value:parseFloat(e),unit:"px"}}function O_(e,t){const n=e.split(/[(),]/g).filter(Boolean),o=n.slice(1).map((e=>D_(G_(e,t)).value)).filter(Boolean);switch(n[0]){case"min":return Math.min(...o)+"px";case"max":return Math.max(...o)+"px";case"clamp":return 3!==o.length?null:o[1]<o[0]?o[0]+"px":o[1]>o[2]?o[2]+"px":o[1]+"px";case"calc":return o[0]+"px"}}function F_(e){for(;;){const t=e,n=/(max|min|calc|clamp)\(([^()]*)\)/g.exec(e)||[];if(n[0]){const t=O_(n[0]);e=e.replace(n[0],t)}if(e===t||parseFloat(e))break}return D_(e)}function z_(e){for(let t=0;t<e.length;t++)if(["+","-","/","*"].includes(e[t]))return!0;return!1}function V_(e){let t=!1;const n=e.split(/[+-/*/]/g).filter(Boolean);for(const o of n){const n=D_(G_(o));if(!parseFloat(n.value)){t=!0;break}e=e.replace(o,n.value)}return t?null:(o=e,Function(`'use strict'; return (${o})`)()).toFixed(0)+"px";var o}function H_(e,t){const n=.01,o=Object.assign({},{fontSize:16,lineHeight:16,width:375,height:812,type:"font"},t),r={em:o.fontSize,rem:o.fontSize,vh:o.height*n,vw:o.width*n,vmin:(o.width<o.height?o.width:o.height)*n,vmax:(o.width>o.height?o.width:o.height)*n,"%":("font"===o.type?o.fontSize:o.width)*n,ch:8,ex:7.15625,lh:o.lineHeight},l={in:96,cm:37.79527559055118,mm:3.7795275590551185,pt:1.3333333333333333,pc:16,px:1,Q:.9448818897637794};return r[e.unit]?(r[e.unit]*e.value).toFixed(0)+"px":l[e.unit]?(l[e.unit]*e.value).toFixed(0)+"px":null}function G_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isFinite(e))return e.toFixed(0)+"px";if(void 0===e)return null;let n=D_(e);return n.unit||(n=F_(e)),z_(e)&&!n.unit?V_(e):H_(n,t)}const U_={};function W_(e){let t="";return e.hasOwnProperty("fontSize")&&(t=":"+e.width),e.hasOwnProperty("lineHeight")&&(t=":"+e.lineHeight),e.hasOwnProperty("width")&&(t=":"+e.width),e.hasOwnProperty("height")&&(t=":"+e.height),e.hasOwnProperty("type")&&(t=":"+e.type),t}var $_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e+W_(t);return U_[n]||(U_[n]=G_(e,t)),U_[n]}}(),(window.wp=window.wp||{}).blockEditor=o}();
|
build/block-editor/style-rtl.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color--rgb:0,124,186;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-10--rgb:0,107,161;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-theme-color-darker-20--rgb:0,90,135;--wp-admin-border-width-focus:2px}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){:root{--wp-admin-border-width-focus:1.5px}}.block-editor-autocompleters__block{white-space:nowrap}.block-editor-autocompleters__block .block-editor-block-icon{margin-left:8px}.block-editor-block-alignment-control__menu-group .components-menu-item__info{margin-top:0}.block-editor-block-alignment-matrix-control__popover .components-popover__content{min-width:0;width:auto}.block-editor-block-alignment-matrix-control__popover .components-popover__content>div{padding:8px}.block-editor-block-icon{align-items:center;display:flex;height:24px;justify-content:center;width:24px}.block-editor-block-icon.has-colors svg{fill:currentColor}@media (forced-colors:active){.block-editor-block-icon.has-colors svg{fill:CanvasText}}.block-editor-block-icon svg{max-height:24px;max-width:24px;min-height:20px;min-width:20px}.block-editor-block-inspector p{margin-top:0}.block-editor-block-inspector h2,.block-editor-block-inspector h3{color:#1e1e1e;font-size:13px;margin-bottom:1.5em}.block-editor-block-inspector .components-base-control{margin-bottom:24px}.block-editor-block-inspector .components-base-control:last-child{margin-bottom:8px}.block-editor-block-inspector .components-panel__body{border:none;border-top:1px solid #e0e0e0}.block-editor-block-inspector .block-editor-block-card{padding:16px}.block-editor-block-inspector__no-blocks{background:#fff;display:block;font-size:13px;padding:32px 16px;text-align:center}.block-editor-block-styles .block-editor-block-list__block{margin:0}.block-editor-block-list__layout{position:relative}.block-editor-block-list__layout.is-navigate-mode{cursor:default}.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted:after,.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:after,.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-hovered:after,.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected:after{border-radius:1px;bottom:1px;box-shadow:0 0 0 1px var(--wp-admin-theme-color);content:"";left:1px;outline:2px solid transparent;pointer-events:none;position:absolute;right:1px;top:1px;z-index:1}.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted:after,.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:after,.is-dark-theme .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-hovered:after,.is-dark-theme .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected:after{box-shadow:0 0 0 1px #fff}.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted .components-placeholder ::selection,.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected .components-placeholder ::selection,.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-hovered .components-placeholder ::selection,.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected .components-placeholder ::selection{background:transparent}.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-hovered:not(.is-selected):after{box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.block-editor-block-list__layout .block-editor-block-list__block.is-highlighted:after{box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:1px solid transparent}.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected:after,.block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.has-child-selected,.block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected:after{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:2px solid transparent}.block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected:before{border-radius:2px;border-top:4px solid #ccc;content:"";left:0;pointer-events:none;position:absolute;right:0;top:-14px;transition:border-color .1s linear,border-style .1s linear,box-shadow .1s linear;z-index:0}.block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected:after{content:none}.block-editor-block-list__layout .is-block-moving-mode.can-insert-moving-block.block-editor-block-list__block.is-selected:before{border-color:var(--wp-admin-theme-color)}.is-block-moving-mode.block-editor-block-list__block-selection-button{font-size:1px;height:1px;opacity:0;padding:0}.block-editor-block-list__layout .block-editor-block-list__block{overflow-wrap:break-word;position:relative}.block-editor-block-list__layout .block-editor-block-list__block .reusable-block-edit-panel *{z-index:1}.block-editor-block-list__layout .block-editor-block-list__block .components-placeholder .components-with-notices-ui{margin:-10px 0 12px}.block-editor-block-list__layout .block-editor-block-list__block .components-with-notices-ui{margin:0 0 12px;width:100%}.block-editor-block-list__layout .block-editor-block-list__block .components-with-notices-ui .components-notice{margin-left:0;margin-right:0}.block-editor-block-list__layout .block-editor-block-list__block .components-with-notices-ui .components-notice .components-notice__content{font-size:13px}.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus{outline:none}.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus:after{border-radius:1px;bottom:1px;box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);content:"";left:1px;outline:2px solid transparent;pointer-events:none;position:absolute;right:1px;top:1px;z-index:1}.is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus:after{box-shadow:0 0 0 var(--wp-admin-border-width-focus) #fff}.block-editor-block-list__layout .block-editor-block-list__block:after{border-radius:2px;bottom:0;box-shadow:0 0 0 var(--wp-admin-border-width-focus) transparent;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0}.block-editor-block-list__layout .block-editor-block-list__block.has-warning{min-height:48px}.block-editor-block-list__layout .block-editor-block-list__block.has-warning>*{pointer-events:none;-webkit-user-select:none;user-select:none}.block-editor-block-list__layout .block-editor-block-list__block.has-warning .block-editor-warning{pointer-events:all}.block-editor-block-list__layout .block-editor-block-list__block.has-warning:after{background-color:hsla(0,0%,100%,.4);border-radius:2px;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.block-editor-block-list__layout .block-editor-block-list__block.has-warning.is-multi-selected:after{background-color:transparent}.block-editor-block-list__layout .block-editor-block-list__block.is-reusable>.block-editor-inner-blocks>.block-editor-block-list__layout.has-overlay:after{display:none}.block-editor-block-list__layout .block-editor-block-list__block.is-reusable>.block-editor-inner-blocks>.block-editor-block-list__layout.has-overlay .block-editor-block-list__layout.has-overlay:after{display:block}.block-editor-block-list__layout .block-editor-block-list__block.is-reusable.has-child-selected:after{box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.block-editor-block-list__layout .block-editor-block-list__block[data-clear=true]{float:none}.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-hovered{cursor:default}.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-hovered:after{border-radius:1px;bottom:1px;box-shadow:0 0 0 1px var(--wp-admin-theme-color);left:1px;right:1px;top:1px}.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected{cursor:unset}.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected:after{border-radius:1px;bottom:1px;box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);left:1px;right:1px;top:1px}.is-outline-mode .block-editor-block-list__block:not(.remove-outline).is-selected:focus:after{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.is-focus-mode .block-editor-block-list__block:not(.has-child-selected){opacity:.5;transition:opacity .1s linear}@media (prefers-reduced-motion:reduce){.is-focus-mode .block-editor-block-list__block:not(.has-child-selected){transition-delay:0s;transition-duration:0s}}.is-focus-mode .block-editor-block-list__block:not(.has-child-selected) .block-editor-block-list__block,.is-focus-mode .block-editor-block-list__block:not(.has-child-selected).is-multi-selected,.is-focus-mode .block-editor-block-list__block:not(.has-child-selected).is-selected{opacity:1}.is-root-container:not(.is-focus-mode) .block-editor-block-list__block.has-active-entity{opacity:.5;transition:opacity .1s linear}@media (prefers-reduced-motion:reduce){.is-root-container:not(.is-focus-mode) .block-editor-block-list__block.has-active-entity{transition-delay:0s;transition-duration:0s}}.is-root-container:not(.is-focus-mode) .block-editor-block-list__block.has-active-entity.has-child-selected,.is-root-container:not(.is-focus-mode) .block-editor-block-list__block.has-active-entity.is-active-entity,.is-root-container:not(.is-focus-mode) .block-editor-block-list__block.has-active-entity.is-active-entity .block-editor-block-list__block,.is-root-container:not(.is-focus-mode) .block-editor-block-list__block.has-active-entity .is-active-entity .block-editor-block-list__block,.is-root-container:not(.is-focus-mode) .block-editor-block-list__block.has-active-entity:not(.has-child-selected) .block-editor-block-list__block{opacity:1}.wp-block[data-align=left]>*,.wp-block[data-align=right]>*{z-index:21}.wp-site-blocks>[data-align=left]{float:right;margin-left:2em}.wp-site-blocks>[data-align=right]{float:left;margin-right:2em}.wp-site-blocks>[data-align=center]{justify-content:center;margin-left:auto;margin-right:auto}.block-editor-block-list .block-editor-inserter{cursor:move;cursor:grab;margin:8px}@keyframes block-editor-inserter__toggle__fade-in-animation{0%{opacity:0}to{opacity:1}}.wp-block .block-list-appender .block-editor-inserter__toggle{animation:block-editor-inserter__toggle__fade-in-animation .1s ease;animation-fill-mode:forwards}@media (prefers-reduced-motion:reduce){.wp-block .block-list-appender .block-editor-inserter__toggle{animation-delay:0s;animation-duration:1ms}}.block-editor-block-list__block:not(.is-selected):not(.has-child-selected) .block-editor-default-block-appender{display:none}.block-editor-block-list__block:not(.is-selected):not(.has-child-selected) .block-editor-default-block-appender .block-editor-inserter__toggle{opacity:0;transform:scale(0)}.block-editor-block-list__block .block-editor-block-list__block-html-textarea{border:none;border-radius:2px;box-shadow:inset 0 0 0 1px #1e1e1e;display:block;font-family:Menlo,Consolas,monaco,monospace;font-size:15px;line-height:1.5;margin:0;outline:none;overflow:hidden;padding:12px;resize:none;transition:padding .2s linear;width:100%}@media (prefers-reduced-motion:reduce){.block-editor-block-list__block .block-editor-block-list__block-html-textarea{transition-delay:0s;transition-duration:0s}}.block-editor-block-list__block .block-editor-block-list__block-html-textarea:focus{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.block-editor-block-list__block .block-editor-warning{position:relative;z-index:5}.block-editor-block-list__block .block-editor-warning.block-editor-block-list__block-crash-warning{margin-bottom:auto}.block-editor-block-list__insertion-point{position:absolute}.block-editor-block-list__insertion-point-indicator{background:var(--wp-admin-theme-color);position:absolute}.block-editor-block-list__insertion-point.is-vertical>.block-editor-block-list__insertion-point-indicator{height:1px;top:50%}.block-editor-block-list__insertion-point.is-horizontal>.block-editor-block-list__insertion-point-indicator{left:0;right:50%;top:0;width:1px}.block-editor-block-list__insertion-point-inserter{display:none;justify-content:center;position:absolute;right:calc(50% - 12px);top:calc(50% - 12px)}@media (min-width:480px){.block-editor-block-list__insertion-point-inserter{display:flex}}.block-editor-block-list__block-popover-inserter{margin-bottom:14px;position:absolute;top:-9999em}.block-editor-block-list__block-popover-inserter.is-visible{position:static}.block-editor-block-list__block-popover-inserter .block-editor-inserter__toggle.components-button.has-icon,.block-editor-block-list__empty-block-inserter .block-editor-inserter__toggle.components-button.has-icon,.block-editor-block-list__insertion-point-inserter .block-editor-inserter__toggle.components-button.has-icon,.block-editor-default-block-appender .block-editor-inserter__toggle.components-button.has-icon{background:#1e1e1e;border-radius:2px;color:#fff;height:24px;min-width:24px;padding:0}.block-editor-block-list__block-popover-inserter .block-editor-inserter__toggle.components-button.has-icon:hover,.block-editor-block-list__empty-block-inserter .block-editor-inserter__toggle.components-button.has-icon:hover,.block-editor-block-list__insertion-point-inserter .block-editor-inserter__toggle.components-button.has-icon:hover,.block-editor-default-block-appender .block-editor-inserter__toggle.components-button.has-icon:hover{background:var(--wp-admin-theme-color);color:#fff}.block-editor-block-list__insertion-point-inserter .block-editor-inserter__toggle.components-button.has-icon{background:var(--wp-admin-theme-color)}.block-editor-block-list__insertion-point-inserter .block-editor-inserter__toggle.components-button.has-icon:hover{background:#1e1e1e}.block-editor-block-contextual-toolbar{background-color:#fff;border:1px solid #1e1e1e;border-radius:2px;display:inline-flex}.block-editor-block-contextual-toolbar .block-editor-block-toolbar .components-toolbar,.block-editor-block-contextual-toolbar .block-editor-block-toolbar .components-toolbar-group{border-left-color:#1e1e1e}.block-editor-block-contextual-toolbar.is-fixed{border:none;border-bottom:1px solid #e0e0e0;border-radius:0;display:block;min-height:48px;position:sticky;top:0;width:100%;z-index:31}.block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar .components-toolbar,.block-editor-block-contextual-toolbar.is-fixed .block-editor-block-toolbar .components-toolbar-group{border-left-color:#e0e0e0}.block-editor-block-contextual-toolbar .block-editor-block-mover-button{overflow:hidden}.block-editor-block-contextual-toolbar .block-editor-block-mover.is-horizontal .block-editor-block-mover-button.block-editor-block-mover-button{min-width:24px;width:24px}.block-editor-block-contextual-toolbar .block-editor-block-mover.is-horizontal .block-editor-block-mover-button.block-editor-block-mover-button svg{min-width:24px}.block-editor-block-contextual-toolbar .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover-button:focus:before{min-width:0;right:0!important;width:100%}@media (min-width:600px){.block-editor-block-contextual-toolbar .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover-button.is-up-button svg{top:5px}.block-editor-block-contextual-toolbar .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover-button.is-down-button svg{bottom:5px}}.block-editor-block-list__block-selection-button{background-color:#1e1e1e;border-radius:2px;display:inline-flex;font-size:13px;height:48px;padding:0 12px;z-index:22}.block-editor-block-list__block-selection-button .block-editor-block-list__block-selection-button__content{align-items:center;display:inline-flex;margin:auto}.block-editor-block-list__block-selection-button .block-editor-block-list__block-selection-button__content>.components-flex__item{margin-left:6px}.block-editor-block-list__block-selection-button .components-button.has-icon.block-selection-button_drag-handle{cursor:grab;height:24px;margin-right:-2px;min-width:24px;padding:0}.block-editor-block-list__block-selection-button .components-button.has-icon.block-selection-button_drag-handle svg{min-height:18px;min-width:18px}.block-editor-block-list__block-selection-button .block-editor-block-icon{color:#fff;font-size:13px;height:48px}.block-editor-block-list__block-selection-button .components-button{color:#fff;display:flex;height:48px;min-width:36px}.block-editor-block-list__block-selection-button .components-button:focus{border:none;box-shadow:none}.block-editor-block-list__block-selection-button .components-button:active{color:#fff}.block-editor-block-list__block-selection-button .block-selection-button_select-button.components-button{padding:0}.block-editor-block-list__insertion-point-popover.is-without-arrow{pointer-events:none;position:absolute;z-index:28}.block-editor-block-list__insertion-point-popover.is-without-arrow *{pointer-events:none}.block-editor-block-list__insertion-point-popover.is-without-arrow .is-with-inserter,.block-editor-block-list__insertion-point-popover.is-without-arrow .is-with-inserter *{pointer-events:all}.block-editor-block-list__insertion-point-popover.is-without-arrow .components-popover__content.components-popover__content{background:none;border:none;box-shadow:none;margin-right:0;overflow-y:visible}@keyframes hide-during-dragging{to{position:fixed;transform:translate(-9999px,9999px)}}.components-popover.block-editor-block-list__block-popover{position:absolute;z-index:31}.components-popover.block-editor-block-list__block-popover .components-popover__content{background:none;border:none;box-shadow:none;margin:0!important;min-width:auto;overflow-y:visible;pointer-events:none;width:max-content}.components-popover.block-editor-block-list__block-popover .components-popover__content .block-editor-block-contextual-toolbar,.components-popover.block-editor-block-list__block-popover .components-popover__content .block-editor-block-list__block-selection-button,.components-popover.block-editor-block-list__block-popover .components-popover__content .block-editor-block-list__empty-block-inserter{pointer-events:all}.components-popover.block-editor-block-list__block-popover .components-popover__content .block-editor-block-contextual-toolbar,.components-popover.block-editor-block-list__block-popover .components-popover__content .block-editor-block-list__block-selection-button{margin-bottom:12px;margin-top:12px}.components-popover.block-editor-block-list__block-popover.is-insertion-point-visible{visibility:hidden}.is-dragging-components-draggable .components-popover.block-editor-block-list__block-popover{animation:hide-during-dragging 1ms linear forwards;opacity:0}.is-dragging-components-draggable .components-tooltip{display:none}.is-vertical .block-list-appender{margin-left:auto;margin-right:12px;margin-top:12px;width:24px}.block-list-appender>.block-editor-inserter{display:block}.block-editor-block-list__block:not(.is-selected):not(.has-child-selected):not(.block-editor-block-list__layout) .block-editor-block-list__layout>.block-list-appender .block-list-appender__toggle{opacity:0;transform:scale(0)}.block-editor-block-breadcrumb{list-style:none;margin:0;padding:0}.block-editor-block-breadcrumb li{display:inline-flex;margin:0}.block-editor-block-breadcrumb li .block-editor-block-breadcrumb__separator{fill:currentColor;margin-left:-4px;margin-right:-4px;transform:scaleX(-1)}.block-editor-block-breadcrumb li:last-child .block-editor-block-breadcrumb__separator{display:none}.block-editor-block-breadcrumb__button.components-button{height:24px;line-height:24px;padding:0;position:relative}.block-editor-block-breadcrumb__button.components-button:hover:not(:disabled){box-shadow:none;text-decoration:underline}.block-editor-block-breadcrumb__button.components-button:focus{box-shadow:none}.block-editor-block-breadcrumb__button.components-button:focus:before{border-radius:2px;bottom:1px;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);content:"";display:block;left:1px;position:absolute;right:1px;top:1px}.block-editor-block-breadcrumb__current{cursor:default}.block-editor-block-breadcrumb__button.components-button,.block-editor-block-breadcrumb__current{color:#1e1e1e;font-size:inherit;padding:0 8px}.block-editor-block-card{align-items:flex-start;display:flex}.block-editor-block-card__content{flex-grow:1;margin-bottom:4px}.block-editor-block-card__title{font-weight:500}.block-editor-block-card__title.block-editor-block-card__title{line-height:24px;margin:0 0 4px}.block-editor-block-card__description{font-size:13px}.block-editor-block-card .block-editor-block-icon{flex:0 0 24px;height:24px;margin-left:12px;margin-right:0;width:24px}.block-editor-block-compare{height:auto}.block-editor-block-compare__wrapper{display:flex;padding-bottom:16px}.block-editor-block-compare__wrapper>div{display:flex;flex-direction:column;justify-content:space-between;max-width:600px;min-width:200px;padding:0 0 0 16px;width:50%}.block-editor-block-compare__wrapper>div button{float:left}.block-editor-block-compare__wrapper .block-editor-block-compare__converted{border-right:1px solid #ddd;padding-left:0;padding-right:15px}.block-editor-block-compare__wrapper .block-editor-block-compare__html{border-bottom:1px solid #ddd;color:#1e1e1e;font-family:Menlo,Consolas,monaco,monospace;font-size:12px;line-height:1.7;padding-bottom:15px}.block-editor-block-compare__wrapper .block-editor-block-compare__html span{background-color:#e6ffed;padding-bottom:3px;padding-top:3px}.block-editor-block-compare__wrapper .block-editor-block-compare__html span.block-editor-block-compare__added{background-color:#acf2bd}.block-editor-block-compare__wrapper .block-editor-block-compare__html span.block-editor-block-compare__removed{background-color:#cc1818}.block-editor-block-compare__wrapper .block-editor-block-compare__preview{padding:16px 0 0}.block-editor-block-compare__wrapper .block-editor-block-compare__preview p{font-size:12px;margin-top:0}.block-editor-block-compare__wrapper .block-editor-block-compare__action{margin-top:16px}.block-editor-block-compare__wrapper .block-editor-block-compare__heading{font-size:1em;font-weight:400;margin:.67em 0}.block-editor-block-content-overlay.overlay-active:before{background:transparent;border:none;border-radius:2px;content:"";height:100%;pointer-events:none;position:absolute;right:0;top:0;width:100%;z-index:10}.block-editor-block-content-overlay.parent-highlighted.overlay-active:before,.block-editor-block-content-overlay:hover:not(.is-dragging-blocks).overlay-active:before{background:rgba(var(--wp-admin-theme-color--rgb),.1);box-shadow:0 0 0 1px var(--wp-admin-theme-color) inset}.block-editor-block-content-overlay.overlay-active:not(.is-dragging-blocks) *{pointer-events:none}.block-editor-block-content-overlay.is-dragging-blocks{box-shadow:0 0 0 1px var(--wp-admin-theme-color)}.block-editor-block-draggable-chip-wrapper{position:absolute;right:0;top:-24px}.block-editor-block-draggable-chip{background-color:#1e1e1e;border-radius:2px;box-shadow:0 6px 8px rgba(0,0,0,.3);color:#fff;cursor:grabbing;display:inline-flex;height:48px;padding:0 13px;-webkit-user-select:none;user-select:none}.block-editor-block-draggable-chip svg{fill:currentColor}.block-editor-block-draggable-chip .block-editor-block-draggable-chip__content{justify-content:flex-start;margin:auto}.block-editor-block-draggable-chip .block-editor-block-draggable-chip__content>.components-flex__item{margin-left:6px}.block-editor-block-draggable-chip .block-editor-block-draggable-chip__content>.components-flex__item:last-child{margin-left:0}.block-editor-block-draggable-chip .block-editor-block-draggable-chip__content .block-editor-block-icon svg{min-height:18px;min-width:18px}.block-editor-block-draggable-chip .components-flex__item{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px}.block-editor-block-list__layout .is-dragging{background-color:currentColor!important;border-radius:2px!important;opacity:.05!important;pointer-events:none!important}.block-editor-block-list__layout .is-dragging::selection{background:transparent!important}.block-editor-block-list__layout .is-dragging:after{content:none!important}.block-editor-block-mobile-toolbar{border-left:1px solid #ddd;display:flex;flex-direction:row}.block-editor-block-mobile-toolbar .block-editor-block-mover-button{align-items:center;border-radius:2px;height:36px;justify-content:center;margin:0;padding:3px;width:36px}.block-editor-block-mobile-toolbar .block-editor-block-mover-button .dashicon{margin:auto}.block-editor-block-mobile-toolbar .block-editor-block-mover{display:flex;margin-left:auto}.block-editor-block-mobile-toolbar .block-editor-block-mover .block-editor-block-mover-button{float:right}.block-editor-block-mover-button__description{display:none}.block-editor-block-mover-button.has-icon{padding:0}.block-editor-block-mover{display:inline-flex;flex-direction:row}.block-editor-block-mover .block-editor-block-mover__move-button-container,.block-editor-block-mover .components-toolbar{border-left:none!important;flex:1;flex-direction:row}@media (min-width:600px){.block-editor-block-mover .block-editor-block-mover__move-button-container,.block-editor-block-mover .components-toolbar{flex-direction:column}}.block-editor-block-mover.is-horizontal .block-editor-block-mover__move-button-container,.block-editor-block-mover.is-horizontal .components-toolbar{flex-direction:row}.block-editor-block-mover .block-editor-block-mover-button.block-editor-block-mover-button{min-width:36px;padding-left:0;padding-right:0}@media (min-width:600px){.block-editor-block-mover .block-editor-block-mover-button{height:24px;padding-left:11px!important;padding-right:6px!important;width:42px}.block-editor-block-mover .block-editor-block-mover-button.block-editor-block-mover-button{min-width:42px}.block-editor-block-mover .block-editor-block-mover-button:before{left:8px!important;right:8px!important}}.block-editor-block-mover .block-editor-block-mover__drag-handle{cursor:grab;min-width:24px!important;padding:0!important;width:24px}.block-editor-block-mover .block-editor-block-mover__drag-handle:focus:before{left:0!important;right:0!important}@media (min-width:600px){.block-editor-block-mover .components-toolbar-group .block-editor-block-mover-button,.block-editor-block-mover .components-toolbar .block-editor-block-mover-button{margin:0 0 0 auto}.block-editor-block-mover .components-toolbar-group .block-editor-block-mover-button.is-up-button:before,.block-editor-block-mover .components-toolbar .block-editor-block-mover-button.is-up-button:before{bottom:0;height:calc(100% - 1px)}.block-editor-block-mover .components-toolbar-group .block-editor-block-mover-button.is-down-button:before,.block-editor-block-mover .components-toolbar .block-editor-block-mover-button.is-down-button:before{height:calc(100% - 1px);top:0}}.block-editor-block-mover.is-horizontal .block-editor-block-mover-button.has-icon{height:48px;padding-left:0;padding-right:0;width:24px}.block-editor-block-mover.is-horizontal .block-editor-block-mover-button.has-icon:before{bottom:1px;height:auto;min-width:0;top:1px;width:auto}.block-editor-block-mover.is-horizontal .block-editor-block-mover-button.is-up-button.has-icon svg{margin-bottom:0;margin-left:-8px;margin-right:0}.block-editor-block-mover.is-horizontal .block-editor-block-mover-button.is-up-button.has-icon:before{left:0!important;right:0!important}.block-editor-block-mover.is-horizontal .block-editor-block-mover-button.is-down-button.has-icon svg{margin-left:0;margin-right:-8px;margin-top:0}.block-editor-block-mover.is-horizontal .block-editor-block-mover-button.is-down-button.has-icon:before{left:0!important;right:0!important;width:calc(100% + 1px)}.block-editor-block-navigation__container{min-width:280px}.block-editor-block-navigation__label{color:#757575;font-size:11px;font-weight:500;margin:0 0 12px;text-transform:uppercase}.block-editor-block-parent-selector{background:#fff;border-radius:2px}.block-editor-block-parent-selector .block-editor-block-parent-selector__button{border:1px solid #1e1e1e;border-radius:2px;height:48px;width:48px}.block-editor-block-patterns-list__list-item{cursor:pointer;margin-bottom:24px}.block-editor-block-patterns-list__list-item.is-placeholder{min-height:100px}.block-editor-block-patterns-list__list-item[draggable=true] .block-editor-block-preview__container{cursor:grab}.block-editor-block-patterns-list__item{height:100%}.block-editor-block-patterns-list__item .block-editor-block-preview__container{align-items:center;border:1px solid #f0f0f0;border-radius:2px;display:flex;overflow:hidden}.block-editor-block-patterns-list__item .block-editor-block-patterns-list__item-title{font-size:12px;padding-top:8px;text-align:center}.block-editor-block-patterns-list__item:hover .block-editor-block-preview__container{border:1px solid var(--wp-admin-theme-color)}.block-editor-block-patterns-list__item:focus .block-editor-block-preview__container{box-shadow:inset 0 0 0 1px #fff,0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:2px solid transparent}.block-editor-block-patterns-list__item:focus .block-editor-block-patterns-list__item-title,.block-editor-block-patterns-list__item:hover .block-editor-block-patterns-list__item-title{color:var(--wp-admin-theme-color)}.block-editor-block-preview__container{overflow:hidden;position:relative;width:100%}.block-editor-block-preview__container .block-editor-block-preview__content{margin:0;min-height:auto;overflow:visible;right:0;text-align:initial;top:0;transform-origin:top right}.block-editor-block-preview__container .block-editor-block-preview__content .block-editor-block-drop-zone,.block-editor-block-preview__container .block-editor-block-preview__content .block-editor-block-list__insertion-point,.block-editor-block-preview__container .block-editor-block-preview__content .block-list-appender,.block-editor-block-preview__container .block-editor-block-preview__content .reusable-block-indicator,.block-editor-block-preview__content-iframe .block-list-appender{display:none}.block-editor-block-preview__live-content *{pointer-events:none}.block-editor-block-preview__live-content .block-list-appender{display:none}.block-editor-block-preview__live-content .components-button:disabled{opacity:1}.block-editor-block-preview__live-content .block-editor-block-list__block[data-empty=true],.block-editor-block-preview__live-content .components-placeholder{display:none}.block-editor-block-settings-menu__popover .components-dropdown-menu__menu{padding:0}.block-editor-block-styles+.default-style-picker__default-switcher{margin-top:16px}.block-editor-block-styles__preview-panel{display:none;left:16px;position:absolute;right:auto;z-index:90}@media (min-width:782px){.block-editor-block-styles__preview-panel{display:block}}.block-editor-block-styles__preview-panel .block-editor-inserter__preview-container{left:auto;position:static;right:auto;top:auto}.block-editor-block-styles__preview-panel .block-editor-block-card__title.block-editor-block-card__title{margin:0}.block-editor-block-styles__preview-panel .block-editor-block-icon{display:none}.block-editor-block-styles__variants{display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between}.block-editor-block-styles__variants .block-editor-block-styles__item{box-shadow:inset 0 0 0 1px #ccc;color:#2f2f2f;display:inline-block;width:calc(50% - 4px)}.block-editor-block-styles__variants .block-editor-block-styles__item:focus,.block-editor-block-styles__variants .block-editor-block-styles__item:hover{box-shadow:inset 0 0 0 2px var(--wp-admin-theme-color);color:var(--wp-admin-theme-color)}.block-editor-block-styles__variants .block-editor-block-styles__item.is-active,.block-editor-block-styles__variants .block-editor-block-styles__item.is-active:hover{background-color:#2f2f2f;box-shadow:none}.block-editor-block-styles__variants .block-editor-block-styles__item.is-active .block-editor-block-styles__item-text,.block-editor-block-styles__variants .block-editor-block-styles__item.is-active:hover .block-editor-block-styles__item-text{color:#fff}.block-editor-block-styles__variants .block-editor-block-styles__item.is-active:focus{box-shadow:inset 0 0 0 1px #fff,0 0 0 2px var(--wp-admin-theme-color)}.block-editor-block-styles__block-preview-container,.block-editor-block-styles__block-preview-container *{box-sizing:border-box!important}.block-editor-block-switcher,.block-editor-block-switcher__no-switcher-icon,.block-editor-block-switcher__toggle{position:relative}.components-button.block-editor-block-switcher__no-switcher-icon,.components-button.block-editor-block-switcher__toggle{display:block;height:48px;margin:0}.components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-icon,.components-button.block-editor-block-switcher__toggle .block-editor-block-icon{margin:auto}.block-editor-block-switcher__toggle-text{margin-right:8px}.show-icon-labels .block-editor-block-switcher__toggle-text{display:none}.show-icon-labels .block-editor-block-toolbar .block-editor-block-switcher .components-button.has-icon:after{font-size:14px}.block-editor-block-switcher__popover{margin-right:6px}.components-button.block-editor-block-switcher__no-switcher-icon{width:48px}.components-button.block-editor-block-switcher__no-switcher-icon .block-editor-blocks-icon{margin-left:auto;margin-right:auto}.components-button.block-editor-block-switcher__no-switcher-icon:disabled{opacity:1}.components-button.block-editor-block-switcher__no-switcher-icon:disabled,.components-button.block-editor-block-switcher__no-switcher-icon:disabled .block-editor-block-icon.has-colors{color:#1e1e1e}.block-editor-block-toolbar .components-toolbar-group .components-button.block-editor-block-switcher__no-switcher-icon.has-icon.has-icon .block-editor-block-icon,.block-editor-block-toolbar .components-toolbar-group .components-button.block-editor-block-switcher__toggle.has-icon.has-icon .block-editor-block-icon,.block-editor-block-toolbar .components-toolbar .components-button.block-editor-block-switcher__no-switcher-icon.has-icon.has-icon .block-editor-block-icon,.block-editor-block-toolbar .components-toolbar .components-button.block-editor-block-switcher__toggle.has-icon.has-icon .block-editor-block-icon{align-items:center;display:flex;height:100%;margin:0 auto;min-width:100%;position:relative}.block-editor-block-toolbar .components-toolbar-group .components-button.block-editor-block-switcher__no-switcher-icon.has-icon.has-icon:before,.block-editor-block-toolbar .components-toolbar-group .components-button.block-editor-block-switcher__toggle.has-icon.has-icon:before,.block-editor-block-toolbar .components-toolbar .components-button.block-editor-block-switcher__no-switcher-icon.has-icon.has-icon:before,.block-editor-block-toolbar .components-toolbar .components-button.block-editor-block-switcher__toggle.has-icon.has-icon:before{bottom:8px;left:8px;right:8px;top:8px}.components-popover.block-editor-block-switcher__popover .components-popover__content{min-width:300px}.components-popover.block-editor-block-switcher__popover .components-popover__content>div{background:#fff;display:flex;min-width:auto;padding:0}.components-popover.block-editor-block-switcher__popover .components-popover__content>div .components-menu-group{margin:0}.block-editor-block-switcher__popover .components-popover__content .block-editor-block-styles{margin:0 -3px}.block-editor-block-switcher__popover .components-popover__content .components-panel__body{border:0;position:relative;z-index:1}.block-editor-block-switcher__popover .components-popover__content .components-panel__body+.components-panel__body{border-top:1px solid #e0e0e0}.block-editor-block-switcher__popover__preview__parent .block-editor-block-switcher__popover__preview__container{position:absolute;right:calc(100% + 32px);top:-12px}.block-editor-block-switcher__preview__popover{display:none}.block-editor-block-switcher__preview__popover.components-popover{margin-right:4px;margin-top:11px}@media (min-width:782px){.block-editor-block-switcher__preview__popover{display:block}}.block-editor-block-switcher__preview__popover .components-popover__content{background:#fff;border:1px solid #1e1e1e;border-radius:2px;box-shadow:none}.block-editor-block-switcher__preview__popover .block-editor-block-switcher__preview{height:auto;max-height:500px;padding:16px;width:300px}.block-editor-block-switcher__preview-title{color:#757575;font-size:11px;font-weight:500;margin-bottom:12px;text-transform:uppercase}.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon{width:48px}.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon,.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle{height:48px}.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-icon,.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-switcher__transform,.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle .block-editor-block-icon,.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle .block-editor-block-switcher__transform{height:48px;width:48px}.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__no-switcher-icon .block-editor-block-switcher__transform,.block-editor-block-contextual-toolbar .components-button.block-editor-block-switcher__toggle .block-editor-block-switcher__transform{padd
|
|