var instanceId = Object(external_wp_compose_["useInstanceId"])(font_size_picker_FontSizePicker);
var options = Object(external_wp_element_["useMemo"])(function () {
return getSelectOptions(fontSizes, disableCustomFontSizes);
}, [fontSizes, disableCustomFontSizes]);
var selectedFontSizeSlug = getSelectValueFromFontSize(fontSizes, value);
var fontSizePickerNumberId = "components-font-size-picker__number#".concat(instanceId);
return Object(external_wp_element_["createElement"])("fieldset", Object(esm_extends["a" /* default */])({
className: "components-font-size-picker"
}), Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], {
}, Object(external_wp_i18n_["__"])('Font size')), Object(external_wp_element_["createElement"])("div", {
className: "components-font-size-picker__controls"
}, fontSizes.length > 0 && Object(external_wp_element_["createElement"])(CustomSelectControl, {
className: 'components-font-size-picker__select',
label: Object(external_wp_i18n_["__"])('Font size'),
value: options.find(function (option) {
return option.key === selectedFontSizeSlug;
onChange: function onChange(_ref2) {
var selectedItem = _ref2.selectedItem;
_onChange(selectedItem.size);
_onChange(Number(selectedItem.size));
}), !withSlider && !disableCustomFontSizes && Object(external_wp_element_["createElement"])("div", {
className: "components-font-size-picker__number-container"
}, Object(external_wp_element_["createElement"])("label", {
htmlFor: fontSizePickerNumberId
}, Object(external_wp_i18n_["__"])('Custom')), Object(external_wp_element_["createElement"])("input", {
id: fontSizePickerNumberId,
className: "components-font-size-picker__number",
onChange: function onChange(event) {
if (!event.target.value && event.target.value !== 0) {
_onChange(event.target.value + 'px');
_onChange(Number(event.target.value));
"aria-label": Object(external_wp_i18n_["__"])('Custom'),
value: isPixelValue && noUnitsValue || ''
})), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
className: "components-color-palette__clear",
disabled: value === undefined,
onClick: function onClick() {
}, Object(external_wp_i18n_["__"])('Reset'))), withSlider && Object(external_wp_element_["createElement"])(range_control, {
className: "components-font-size-picker__custom-input",
label: Object(external_wp_i18n_["__"])('Custom Size'),
value: isPixelValue && noUnitsValue || '',
initialPosition: fallbackFontSize,
onChange: function onChange(newValue) {
_onChange(hasUnits ? newValue + 'px' : newValue);
beforeIcon: text_color["a" /* default */],
afterIcon: text_color["a" /* default */]
/* harmony default export */ var font_size_picker = (next_withNextComponent(font_size_picker_FontSizePicker));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-file-upload/index.js
function FormFileUpload(_ref) {
var accept = _ref.accept,
children = _ref.children,
_ref$multiple = _ref.multiple,
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
onChange = _ref.onChange,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["accept", "children", "multiple", "onChange", "render"]);
var ref = Object(external_wp_element_["useRef"])();
var openFileDialog = function openFileDialog() {
var ui = render ? render({
openFileDialog: openFileDialog
}) : Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], Object(esm_extends["a" /* default */])({
return Object(external_wp_element_["createElement"])("div", {
className: "components-form-file-upload"
}, ui, Object(external_wp_element_["createElement"])("input", {
/* harmony default export */ var form_file_upload = (FormFileUpload);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-toggle/index.js
function FormToggle(_ref) {
var className = _ref.className,
disabled = _ref.disabled,
_ref$onChange = _ref.onChange,
onChange = _ref$onChange === void 0 ? external_lodash_["noop"] : _ref$onChange,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["className", "checked", "id", "disabled", "onChange"]);
var wrapperClasses = classnames_default()('components-form-toggle', className, {
return Object(external_wp_element_["createElement"])("span", {
className: wrapperClasses
}, Object(external_wp_element_["createElement"])("input", Object(esm_extends["a" /* default */])({
className: "components-form-toggle__input",
}, props)), Object(external_wp_element_["createElement"])("span", {
className: "components-form-toggle__track"
}), Object(external_wp_element_["createElement"])("span", {
className: "components-form-toggle__thumb"
/* harmony default export */ var form_toggle = (FormToggle);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
var esm_typeof = __webpack_require__("U8pU");
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-token-field/token.js
displayTransform = _ref.displayTransform,
_ref$isBorderless = _ref.isBorderless,
isBorderless = _ref$isBorderless === void 0 ? false : _ref$isBorderless,
_ref$disabled = _ref.disabled,
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
_ref$onClickRemove = _ref.onClickRemove,
onClickRemove = _ref$onClickRemove === void 0 ? external_lodash_["noop"] : _ref$onClickRemove,
onMouseEnter = _ref.onMouseEnter,
onMouseLeave = _ref.onMouseLeave,
messages = _ref.messages,
termPosition = _ref.termPosition,
termsCount = _ref.termsCount;
var instanceId = Object(external_wp_compose_["useInstanceId"])(Token);
var tokenClasses = classnames_default()('components-form-token-field__token', {
'is-error': 'error' === status,
'is-success': 'success' === status,
'is-validating': 'validating' === status,
'is-borderless': isBorderless,
var onClick = function onClick() {
var transformedValue = displayTransform(value);
var termPositionAndCount = Object(external_wp_i18n_["sprintf"])(
/* translators: 1: term name, 2: term position in a set of terms, 3: total term set count. */
Object(external_wp_i18n_["__"])('%1$s (%2$s of %3$s)'), transformedValue, termPosition, termsCount);
return Object(external_wp_element_["createElement"])("span", {
onMouseEnter: onMouseEnter,
onMouseLeave: onMouseLeave,
}, Object(external_wp_element_["createElement"])("span", {
className: "components-form-token-field__token-text",
id: "components-form-token-field__token-text-".concat(instanceId)
}, Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], {
}, termPositionAndCount), Object(external_wp_element_["createElement"])("span", {
}, transformedValue)), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
className: "components-form-token-field__remove-token",
icon: close_small["a" /* default */],
onClick: !disabled && onClick,
"aria-describedby": "components-form-token-field__token-text-".concat(instanceId)
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-token-field/index.js
function form_token_field_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function form_token_field_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { form_token_field_ownKeys(Object(source), true).forEach(function (key) { Object(esm_defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { form_token_field_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function form_token_field_createSuper(Derived) { var hasNativeReflectConstruct = form_token_field_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
function form_token_field_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var form_token_field_initialState = {
incompleteTokenValue: '',
selectedSuggestionIndex: -1,
selectedSuggestionScroll: false
var form_token_field_FormTokenField = /*#__PURE__*/function (_Component) {
Object(inherits["a" /* default */])(FormTokenField, _Component);
var _super = form_token_field_createSuper(FormTokenField);
function FormTokenField() {
Object(classCallCheck["a" /* default */])(this, FormTokenField);
_this = _super.apply(this, arguments);
_this.state = form_token_field_initialState;
_this.onKeyDown = _this.onKeyDown.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.onKeyPress = _this.onKeyPress.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.onFocus = _this.onFocus.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.onBlur = _this.onBlur.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.deleteTokenBeforeInput = _this.deleteTokenBeforeInput.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.deleteTokenAfterInput = _this.deleteTokenAfterInput.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.addCurrentToken = _this.addCurrentToken.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.onContainerTouched = _this.onContainerTouched.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.renderToken = _this.renderToken.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.onTokenClickRemove = _this.onTokenClickRemove.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.onSuggestionHovered = _this.onSuggestionHovered.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.onSuggestionSelected = _this.onSuggestionSelected.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.onInputChange = _this.onInputChange.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.bindInput = _this.bindInput.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.bindTokensAndInput = _this.bindTokensAndInput.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.updateSuggestions = _this.updateSuggestions.bind(Object(assertThisInitialized["a" /* default */])(_this));
Object(createClass["a" /* default */])(FormTokenField, [{
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
// Make sure to focus the input when the isActive state is true.
if (this.state.isActive && !this.input.hasFocus()) {
var _this$props = this.props,
suggestions = _this$props.suggestions,
value = _this$props.value;
var suggestionsDidUpdate = !external_wp_isShallowEqual_default()(suggestions, prevProps.suggestions);
if (suggestionsDidUpdate || value !== prevProps.value) {
this.updateSuggestions(suggestionsDidUpdate);
value: function bindInput(ref) {
key: "bindTokensAndInput",
value: function bindTokensAndInput(ref) {
this.tokensAndInput = ref;
value: function onFocus(event) {
// If focus is on the input or on the container, set the isActive state to true.
if (this.input.hasFocus() || event.target === this.tokensAndInput) {
* Otherwise, focus is on one of the token "remove" buttons and we
* set the isActive state to false to prevent the input to be
* re-focused, see componentDidUpdate().
if ('function' === typeof this.props.onFocus) {
this.props.onFocus(event);
value: function onBlur() {
if (this.inputHasValidValue()) {
this.setState(form_token_field_initialState);
value: function onKeyDown(event) {
var preventDefault = false;
case external_wp_keycodes_["BACKSPACE"]:
preventDefault = this.handleDeleteKey(this.deleteTokenBeforeInput);
case external_wp_keycodes_["ENTER"]:
preventDefault = this.addCurrentToken();
case external_wp_keycodes_["LEFT"]:
preventDefault = this.handleLeftArrowKey();
case external_wp_keycodes_["UP"]:
preventDefault = this.handleUpArrowKey();
case external_wp_keycodes_["RIGHT"]:
preventDefault = this.handleRightArrowKey();
case external_wp_keycodes_["DOWN"]:
preventDefault = this.handleDownArrowKey();
case external_wp_keycodes_["DELETE"]:
preventDefault = this.handleDeleteKey(this.deleteTokenAfterInput);
case external_wp_keycodes_["SPACE"]:
if (this.props.tokenizeOnSpace) {
preventDefault = this.addCurrentToken();
case external_wp_keycodes_["ESCAPE"]:
preventDefault = this.handleEscapeKey(event);
value: function onKeyPress(event) {
var preventDefault = false;
switch (event.charCode) {
preventDefault = this.handleCommaKey();
key: "onContainerTouched",
value: function onContainerTouched(event) {
// Prevent clicking/touching the tokensAndInput container from blurring
// the input and adding the current token.
if (event.target === this.tokensAndInput && this.state.isActive) {
key: "onTokenClickRemove",
value: function onTokenClickRemove(event) {
this.deleteToken(event.value);
key: "onSuggestionHovered",
value: function onSuggestionHovered(suggestion) {
var index = this.getMatchingSuggestions().indexOf(suggestion);
selectedSuggestionIndex: index,
selectedSuggestionScroll: false