: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
onSubmit = post_publish_button_noop,
isSavingNonPostEntityChanges,
const isButtonDisabled = (isSaving || !isSaveable || isPostSavingLocked || !isPublishable && !forceIsDirty) && (!hasNonPostEntityChanges || isSavingNonPostEntityChanges);
const isToggleDisabled = (isPublished || isSaving || !isSaveable || !isPublishable && !forceIsDirty) && (!hasNonPostEntityChanges || isSavingNonPostEntityChanges);
// If the new status has not changed explicitely, we derive it from
// other factors, like having a publish action, etc.. We need to preserve
// this because it affects when to show the pre and post publish panels.
// If it has changed though explicitely, we need to respect that.
let publishStatus = 'publish';
if (postStatusHasChanged) {
publishStatus = postStatus;
} else if (!hasPublishAction) {
publishStatus = 'pending';
} else if (visibility === 'private') {
publishStatus = 'private';
} else if (isBeingScheduled) {
publishStatus = 'future';
const onClickButton = () => {
savePostStatus(publishStatus);
// Callback to open the publish panel.
const onClickToggle = () => {
'aria-disabled': isButtonDisabled,
className: 'editor-post-publish-button',
isBusy: !isAutoSaving && isSaving,
onClick: this.createOnClick(onClickButton)
'aria-disabled': isToggleDisabled,
className: 'editor-post-publish-panel__toggle',
isBusy: isSaving && isPublished,
onClick: this.createOnClick(onClickToggle)
const componentProps = isToggle ? toggleProps : buttonProps;
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
className: `${componentProps.className} editor-post-publish-button__button`,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PublishButtonLabel, {})
/* harmony default export */ const post_publish_button = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)(select => {
var _getCurrentPost$_link;
isEditedPostBeingScheduled,
isSavingNonPostEntityChanges,
isSaving: isSavingPost(),
isAutoSaving: isAutosavingPost(),
isBeingScheduled: isEditedPostBeingScheduled(),
visibility: getEditedPostVisibility(),
isSaveable: isEditedPostSaveable(),
isPostSavingLocked: isPostSavingLocked(),
isPublishable: isEditedPostPublishable(),
isPublished: isCurrentPostPublished(),
hasPublishAction: (_getCurrentPost$_link = getCurrentPost()._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false,
postType: getCurrentPostType(),
postId: getCurrentPostId(),
postStatus: getEditedPostAttribute('status'),
postStatusHasChanged: getPostEdits()?.status,
hasNonPostEntityChanges: hasNonPostEntityChanges(),
isSavingNonPostEntityChanges: isSavingNonPostEntityChanges()
}), (0,external_wp_data_namespaceObject.withDispatch)(dispatch => {
} = dispatch(store_store);
savePostStatus: status => {
})])(PostPublishButton));
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/wordpress.js
const wordpress = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
xmlns: "http://www.w3.org/2000/svg",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"
/* harmony default export */ const library_wordpress = (wordpress);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-visibility/utils.js
const visibilityOptions = {
label: (0,external_wp_i18n_namespaceObject.__)('Public'),
info: (0,external_wp_i18n_namespaceObject.__)('Visible to everyone.')
label: (0,external_wp_i18n_namespaceObject.__)('Private'),
info: (0,external_wp_i18n_namespaceObject.__)('Only visible to site admins and editors.')
label: (0,external_wp_i18n_namespaceObject.__)('Password protected'),
info: (0,external_wp_i18n_namespaceObject.__)('Only those with the password can view this post.')
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-visibility/index.js
* Allows users to set the visibility of a post.
* @param {Object} props The component props.
* @param {Function} props.onClose Function to call when the popover is closed.
* @return {JSX.Element} The rendered component.
function PostVisibility({
const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostVisibility);
} = (0,external_wp_data_namespaceObject.useSelect)(select => ({
status: select(store_store).getEditedPostAttribute('status'),
visibility: select(store_store).getEditedPostVisibility(),
password: select(store_store).getEditedPostAttribute('password')
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
const [hasPassword, setHasPassword] = (0,external_wp_element_namespaceObject.useState)(!!password);
const [showPrivateConfirmDialog, setShowPrivateConfirmDialog] = (0,external_wp_element_namespaceObject.useState)(false);
const setPublic = () => {
status: visibility === 'private' ? 'draft' : status,
const setPrivate = () => {
setShowPrivateConfirmDialog(true);
const confirmPrivate = () => {
setShowPrivateConfirmDialog(false);
const handleDialogCancel = () => {
setShowPrivateConfirmDialog(false);
const setPasswordProtected = () => {
status: visibility === 'private' ? 'draft' : status,
const updatePassword = event => {
password: event.target.value
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "editor-post-visibility",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
title: (0,external_wp_i18n_namespaceObject.__)('Visibility'),
help: (0,external_wp_i18n_namespaceObject.__)('Control how this post is viewed.'),
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", {
className: "editor-post-visibility__fieldset",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
children: (0,external_wp_i18n_namespaceObject.__)('Visibility')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostVisibilityChoice, {
label: visibilityOptions.public.label,
info: visibilityOptions.public.info,
checked: visibility === 'public' && !hasPassword,
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostVisibilityChoice, {
label: visibilityOptions.private.label,
info: visibilityOptions.private.info,
checked: visibility === 'private',
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostVisibilityChoice, {
label: visibilityOptions.password.label,
info: visibilityOptions.password.info,
onChange: setPasswordProtected
}), hasPassword && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "editor-post-visibility__password",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
htmlFor: `editor-post-visibility__password-input-${instanceId}`,
children: (0,external_wp_i18n_namespaceObject.__)('Create password')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
className: "editor-post-visibility__password-input",
id: `editor-post-visibility__password-input-${instanceId}`,
onChange: updatePassword,
placeholder: (0,external_wp_i18n_namespaceObject.__)('Use a secure password')
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, {
isOpen: showPrivateConfirmDialog,
onConfirm: confirmPrivate,
onCancel: handleDialogCancel,
confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Publish'),
children: (0,external_wp_i18n_namespaceObject.__)('Would you like to privately publish this post now?')
function PostVisibilityChoice({
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "editor-post-visibility__choice",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", {
name: `editor-post-visibility__setting-${instanceId}`,
id: `editor-post-${value}-${instanceId}`,
"aria-describedby": `editor-post-${value}-${instanceId}-description`,
className: "editor-post-visibility__radio",
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("label", {
htmlFor: `editor-post-${value}-${instanceId}`,
className: "editor-post-visibility__label",
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
id: `editor-post-${value}-${instanceId}-description`,
className: "editor-post-visibility__info",
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-visibility/label.js
* Returns the label for the current post visibility setting.
* @return {string} Post visibility label.
function PostVisibilityLabel() {
return usePostVisibilityLabel();
* Get the label for the current post visibility setting.
* @return {string} Post visibility label.
function usePostVisibilityLabel() {
const visibility = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getEditedPostVisibility());
return visibilityOptions[visibility]?.label;
;// CONCATENATED MODULE: ./node_modules/date-fns/toDate.mjs
* @category Common Helpers
* @summary Convert the given argument to an instance of Date.
* Convert the given argument to an instance of Date.
* If the argument is an instance of Date, the function returns its clone.
* If the argument is a number, it is treated as a timestamp.
* If the argument is none of the above, the function returns Invalid Date.
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @param argument - The value to convert
* @returns The parsed date in the local time zone
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
* //=> Tue Feb 11 2014 11:30:30
* // Convert the timestamp to date:
* const result = toDate(1392098430000)
* //=> Tue Feb 11 2014 11:30:30
function toDate(argument) {
const argStr = Object.prototype.toString.call(argument);
argument instanceof Date ||
(typeof argument === "object" && argStr === "[object Date]")
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
return new argument.constructor(+argument);
typeof argument === "number" ||
argStr === "[object Number]" ||
typeof argument === "string" ||
argStr === "[object String]"
// TODO: Can we get rid of as?
return new Date(argument);
// TODO: Can we get rid of as?
// Fallback for modularized imports:
/* harmony default export */ const date_fns_toDate = ((/* unused pure expression or super */ null && (toDate)));
;// CONCATENATED MODULE: ./node_modules/date-fns/startOfMonth.mjs
* @category Month Helpers
* @summary Return the start of a month for the given date.
* Return the start of a month for the given date.
* The result will be in the local timezone.
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @param date - The original date
* @returns The start of a month
* // The start of a month for 2 September 2014 11:55:00:
* const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
* //=> Mon Sep 01 2014 00:00:00
function startOfMonth(date) {
const _date = toDate(date);
_date.setHours(0, 0, 0, 0);
// Fallback for modularized imports:
/* harmony default export */ const date_fns_startOfMonth = ((/* unused pure expression or super */ null && (startOfMonth)));
;// CONCATENATED MODULE: ./node_modules/date-fns/endOfMonth.mjs
* @category Month Helpers
* @summary Return the end of a month for the given date.
* Return the end of a month for the given date.
* The result will be in the local timezone.
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @param date - The original date
* @returns The end of a month
* // The end of a month for 2 September 2014 11:55:00:
* const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
* //=> Tue Sep 30 2014 23:59:59.999
function endOfMonth(date) {
const _date = toDate(date);
const month = _date.getMonth();
_date.setFullYear(_date.getFullYear(), month + 1, 0);
_date.setHours(23, 59, 59, 999);
// Fallback for modularized imports:
/* harmony default export */ const date_fns_endOfMonth = ((/* unused pure expression or super */ null && (endOfMonth)));
;// CONCATENATED MODULE: ./node_modules/date-fns/constants.mjs
* @summary Useful constants
* Collection of useful date constants.
* The constants could be imported from `date-fns/constants`:
* import { maxTime, minTime } from "./constants/date-fns/constants";
* function isAllowedTime(time) {
* return time <= maxTime && time >= minTime;