[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/js/dist/ -> edit-post.js (source)

   1  /******/ (() => { // webpackBootstrap
   2  /******/     "use strict";
   3  /******/     // The require scope
   4  /******/     var __webpack_require__ = {};
   5  /******/     
   6  /************************************************************************/
   7  /******/     /* webpack/runtime/compat get default export */
   8  /******/     (() => {
   9  /******/         // getDefaultExport function for compatibility with non-harmony modules
  10  /******/         __webpack_require__.n = (module) => {
  11  /******/             var getter = module && module.__esModule ?
  12  /******/                 () => (module['default']) :
  13  /******/                 () => (module);
  14  /******/             __webpack_require__.d(getter, { a: getter });
  15  /******/             return getter;
  16  /******/         };
  17  /******/     })();
  18  /******/     
  19  /******/     /* webpack/runtime/define property getters */
  20  /******/     (() => {
  21  /******/         // define getter functions for harmony exports
  22  /******/         __webpack_require__.d = (exports, definition) => {
  23  /******/             for(var key in definition) {
  24  /******/                 if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  25  /******/                     Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  26  /******/                 }
  27  /******/             }
  28  /******/         };
  29  /******/     })();
  30  /******/     
  31  /******/     /* webpack/runtime/hasOwnProperty shorthand */
  32  /******/     (() => {
  33  /******/         __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  34  /******/     })();
  35  /******/     
  36  /******/     /* webpack/runtime/make namespace object */
  37  /******/     (() => {
  38  /******/         // define __esModule on exports
  39  /******/         __webpack_require__.r = (exports) => {
  40  /******/             if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  41  /******/                 Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  42  /******/             }
  43  /******/             Object.defineProperty(exports, '__esModule', { value: true });
  44  /******/         };
  45  /******/     })();
  46  /******/     
  47  /************************************************************************/
  48  var __webpack_exports__ = {};
  49  // ESM COMPAT FLAG
  50  __webpack_require__.r(__webpack_exports__);
  51  
  52  // EXPORTS
  53  __webpack_require__.d(__webpack_exports__, {
  54    PluginBlockSettingsMenuItem: () => (/* reexport */ PluginBlockSettingsMenuItem),
  55    PluginDocumentSettingPanel: () => (/* reexport */ PluginDocumentSettingPanel),
  56    PluginMoreMenuItem: () => (/* reexport */ PluginMoreMenuItem),
  57    PluginPostPublishPanel: () => (/* reexport */ PluginPostPublishPanel),
  58    PluginPostStatusInfo: () => (/* reexport */ PluginPostStatusInfo),
  59    PluginPrePublishPanel: () => (/* reexport */ PluginPrePublishPanel),
  60    PluginSidebar: () => (/* reexport */ PluginSidebar),
  61    PluginSidebarMoreMenuItem: () => (/* reexport */ PluginSidebarMoreMenuItem),
  62    __experimentalFullscreenModeClose: () => (/* reexport */ fullscreen_mode_close),
  63    __experimentalMainDashboardButton: () => (/* binding */ __experimentalMainDashboardButton),
  64    __experimentalPluginPostExcerpt: () => (/* reexport */ __experimentalPluginPostExcerpt),
  65    initializeEditor: () => (/* binding */ initializeEditor),
  66    reinitializeEditor: () => (/* binding */ reinitializeEditor),
  67    store: () => (/* reexport */ store)
  68  });
  69  
  70  // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/actions.js
  71  var actions_namespaceObject = {};
  72  __webpack_require__.r(actions_namespaceObject);
  73  __webpack_require__.d(actions_namespaceObject, {
  74    __experimentalSetPreviewDeviceType: () => (__experimentalSetPreviewDeviceType),
  75    __unstableCreateTemplate: () => (__unstableCreateTemplate),
  76    closeGeneralSidebar: () => (closeGeneralSidebar),
  77    closeModal: () => (closeModal),
  78    closePublishSidebar: () => (closePublishSidebar),
  79    hideBlockTypes: () => (hideBlockTypes),
  80    initializeMetaBoxes: () => (initializeMetaBoxes),
  81    metaBoxUpdatesFailure: () => (metaBoxUpdatesFailure),
  82    metaBoxUpdatesSuccess: () => (metaBoxUpdatesSuccess),
  83    openGeneralSidebar: () => (openGeneralSidebar),
  84    openModal: () => (openModal),
  85    openPublishSidebar: () => (openPublishSidebar),
  86    removeEditorPanel: () => (removeEditorPanel),
  87    requestMetaBoxUpdates: () => (requestMetaBoxUpdates),
  88    setAvailableMetaBoxesPerLocation: () => (setAvailableMetaBoxesPerLocation),
  89    setIsEditingTemplate: () => (setIsEditingTemplate),
  90    setIsInserterOpened: () => (setIsInserterOpened),
  91    setIsListViewOpened: () => (setIsListViewOpened),
  92    showBlockTypes: () => (showBlockTypes),
  93    switchEditorMode: () => (switchEditorMode),
  94    toggleDistractionFree: () => (toggleDistractionFree),
  95    toggleEditorPanelEnabled: () => (toggleEditorPanelEnabled),
  96    toggleEditorPanelOpened: () => (toggleEditorPanelOpened),
  97    toggleFeature: () => (toggleFeature),
  98    toggleFullscreenMode: () => (toggleFullscreenMode),
  99    togglePinnedPluginItem: () => (togglePinnedPluginItem),
 100    togglePublishSidebar: () => (togglePublishSidebar),
 101    updatePreferredStyleVariations: () => (updatePreferredStyleVariations)
 102  });
 103  
 104  // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/selectors.js
 105  var selectors_namespaceObject = {};
 106  __webpack_require__.r(selectors_namespaceObject);
 107  __webpack_require__.d(selectors_namespaceObject, {
 108    __experimentalGetInsertionPoint: () => (__experimentalGetInsertionPoint),
 109    __experimentalGetPreviewDeviceType: () => (__experimentalGetPreviewDeviceType),
 110    areMetaBoxesInitialized: () => (areMetaBoxesInitialized),
 111    getActiveGeneralSidebarName: () => (getActiveGeneralSidebarName),
 112    getActiveMetaBoxLocations: () => (getActiveMetaBoxLocations),
 113    getAllMetaBoxes: () => (getAllMetaBoxes),
 114    getEditedPostTemplate: () => (getEditedPostTemplate),
 115    getEditorMode: () => (getEditorMode),
 116    getHiddenBlockTypes: () => (getHiddenBlockTypes),
 117    getMetaBoxesPerLocation: () => (getMetaBoxesPerLocation),
 118    getPreference: () => (getPreference),
 119    getPreferences: () => (getPreferences),
 120    hasMetaBoxes: () => (hasMetaBoxes),
 121    isEditingTemplate: () => (isEditingTemplate),
 122    isEditorPanelEnabled: () => (isEditorPanelEnabled),
 123    isEditorPanelOpened: () => (isEditorPanelOpened),
 124    isEditorPanelRemoved: () => (isEditorPanelRemoved),
 125    isEditorSidebarOpened: () => (isEditorSidebarOpened),
 126    isFeatureActive: () => (isFeatureActive),
 127    isInserterOpened: () => (isInserterOpened),
 128    isListViewOpened: () => (isListViewOpened),
 129    isMetaBoxLocationActive: () => (isMetaBoxLocationActive),
 130    isMetaBoxLocationVisible: () => (isMetaBoxLocationVisible),
 131    isModalActive: () => (isModalActive),
 132    isPluginItemPinned: () => (isPluginItemPinned),
 133    isPluginSidebarOpened: () => (isPluginSidebarOpened),
 134    isPublishSidebarOpened: () => (isPublishSidebarOpened),
 135    isSavingMetaBoxes: () => (selectors_isSavingMetaBoxes)
 136  });
 137  
 138  ;// external ["wp","blocks"]
 139  const external_wp_blocks_namespaceObject = window["wp"]["blocks"];
 140  ;// external ["wp","blockLibrary"]
 141  const external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"];
 142  ;// external ["wp","deprecated"]
 143  const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
 144  var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
 145  ;// external ["wp","element"]
 146  const external_wp_element_namespaceObject = window["wp"]["element"];
 147  ;// external ["wp","data"]
 148  const external_wp_data_namespaceObject = window["wp"]["data"];
 149  ;// external ["wp","preferences"]
 150  const external_wp_preferences_namespaceObject = window["wp"]["preferences"];
 151  ;// external ["wp","widgets"]
 152  const external_wp_widgets_namespaceObject = window["wp"]["widgets"];
 153  ;// external ["wp","editor"]
 154  const external_wp_editor_namespaceObject = window["wp"]["editor"];
 155  ;// ./node_modules/clsx/dist/clsx.mjs
 156  function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx);
 157  ;// external ["wp","blockEditor"]
 158  const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"];
 159  ;// external ["wp","plugins"]
 160  const external_wp_plugins_namespaceObject = window["wp"]["plugins"];
 161  ;// external ["wp","i18n"]
 162  const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
 163  ;// external ["wp","primitives"]
 164  const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
 165  ;// external "ReactJSXRuntime"
 166  const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
 167  ;// ./node_modules/@wordpress/icons/build-module/library/chevron-up.js
 168  /**
 169   * WordPress dependencies
 170   */
 171  
 172  
 173  const chevronUp = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
 174    viewBox: "0 0 24 24",
 175    xmlns: "http://www.w3.org/2000/svg",
 176    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
 177      d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"
 178    })
 179  });
 180  /* harmony default export */ const chevron_up = (chevronUp);
 181  
 182  ;// ./node_modules/@wordpress/icons/build-module/library/chevron-down.js
 183  /**
 184   * WordPress dependencies
 185   */
 186  
 187  
 188  const chevronDown = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
 189    viewBox: "0 0 24 24",
 190    xmlns: "http://www.w3.org/2000/svg",
 191    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
 192      d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"
 193    })
 194  });
 195  /* harmony default export */ const chevron_down = (chevronDown);
 196  
 197  ;// external ["wp","notices"]
 198  const external_wp_notices_namespaceObject = window["wp"]["notices"];
 199  ;// external ["wp","commands"]
 200  const external_wp_commands_namespaceObject = window["wp"]["commands"];
 201  ;// external ["wp","coreCommands"]
 202  const external_wp_coreCommands_namespaceObject = window["wp"]["coreCommands"];
 203  ;// external ["wp","url"]
 204  const external_wp_url_namespaceObject = window["wp"]["url"];
 205  ;// external ["wp","htmlEntities"]
 206  const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
 207  ;// external ["wp","coreData"]
 208  const external_wp_coreData_namespaceObject = window["wp"]["coreData"];
 209  ;// external ["wp","components"]
 210  const external_wp_components_namespaceObject = window["wp"]["components"];
 211  ;// external ["wp","compose"]
 212  const external_wp_compose_namespaceObject = window["wp"]["compose"];
 213  ;// ./node_modules/@wordpress/icons/build-module/library/wordpress.js
 214  /**
 215   * WordPress dependencies
 216   */
 217  
 218  
 219  const wordpress = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
 220    xmlns: "http://www.w3.org/2000/svg",
 221    viewBox: "-2 -2 24 24",
 222    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
 223      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"
 224    })
 225  });
 226  /* harmony default export */ const library_wordpress = (wordpress);
 227  
 228  ;// ./node_modules/@wordpress/edit-post/build-module/components/back-button/fullscreen-mode-close.js
 229  /**
 230   * External dependencies
 231   */
 232  
 233  
 234  /**
 235   * WordPress dependencies
 236   */
 237  
 238  
 239  
 240  
 241  
 242  
 243  
 244  
 245  
 246  function FullscreenModeClose({
 247    showTooltip,
 248    icon,
 249    href,
 250    initialPost
 251  }) {
 252    var _postType$labels$view;
 253    const {
 254      isRequestingSiteIcon,
 255      postType,
 256      siteIconUrl
 257    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
 258      const {
 259        getCurrentPostType
 260      } = select(external_wp_editor_namespaceObject.store);
 261      const {
 262        getEntityRecord,
 263        getPostType,
 264        isResolving
 265      } = select(external_wp_coreData_namespaceObject.store);
 266      const siteData = getEntityRecord('root', '__unstableBase', undefined) || {};
 267      const _postType = initialPost?.type || getCurrentPostType();
 268      return {
 269        isRequestingSiteIcon: isResolving('getEntityRecord', ['root', '__unstableBase', undefined]),
 270        postType: getPostType(_postType),
 271        siteIconUrl: siteData.site_icon_url
 272      };
 273    }, []);
 274    const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)();
 275    if (!postType) {
 276      return null;
 277    }
 278    let buttonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
 279      size: "36px",
 280      icon: library_wordpress
 281    });
 282    const effect = {
 283      expand: {
 284        scale: 1.25,
 285        transition: {
 286          type: 'tween',
 287          duration: '0.3'
 288        }
 289      }
 290    };
 291    if (siteIconUrl) {
 292      buttonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.img, {
 293        variants: !disableMotion && effect,
 294        alt: (0,external_wp_i18n_namespaceObject.__)('Site Icon'),
 295        className: "edit-post-fullscreen-mode-close_site-icon",
 296        src: siteIconUrl
 297      });
 298    }
 299    if (isRequestingSiteIcon) {
 300      buttonIcon = null;
 301    }
 302  
 303    // Override default icon if custom icon is provided via props.
 304    if (icon) {
 305      buttonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
 306        size: "36px",
 307        icon: icon
 308      });
 309    }
 310    const classes = dist_clsx('edit-post-fullscreen-mode-close', {
 311      'has-icon': siteIconUrl
 312    });
 313    const buttonHref = href !== null && href !== void 0 ? href : (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
 314      post_type: postType.slug
 315    });
 316    const buttonLabel = (_postType$labels$view = postType?.labels?.view_items) !== null && _postType$labels$view !== void 0 ? _postType$labels$view : (0,external_wp_i18n_namespaceObject.__)('Back');
 317    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, {
 318      whileHover: "expand",
 319      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
 320        __next40pxDefaultSize: true,
 321        className: classes,
 322        href: buttonHref,
 323        label: buttonLabel,
 324        showTooltip: showTooltip,
 325        children: buttonIcon
 326      })
 327    });
 328  }
 329  /* harmony default export */ const fullscreen_mode_close = (FullscreenModeClose);
 330  
 331  ;// external ["wp","privateApis"]
 332  const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
 333  ;// ./node_modules/@wordpress/edit-post/build-module/lock-unlock.js
 334  /**
 335   * WordPress dependencies
 336   */
 337  
 338  const {
 339    lock,
 340    unlock
 341  } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-post');
 342  
 343  ;// ./node_modules/@wordpress/edit-post/build-module/components/back-button/index.js
 344  /**
 345   * WordPress dependencies
 346   */
 347  
 348  
 349  
 350  /**
 351   * Internal dependencies
 352   */
 353  
 354  
 355  
 356  const {
 357    BackButton: BackButtonFill
 358  } = unlock(external_wp_editor_namespaceObject.privateApis);
 359  const slideX = {
 360    hidden: {
 361      x: '-100%'
 362    },
 363    distractionFreeInactive: {
 364      x: 0
 365    },
 366    hover: {
 367      x: 0,
 368      transition: {
 369        type: 'tween',
 370        delay: 0.2
 371      }
 372    }
 373  };
 374  function BackButton({
 375    initialPost
 376  }) {
 377    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BackButtonFill, {
 378      children: ({
 379        length
 380      }) => length <= 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, {
 381        variants: slideX,
 382        transition: {
 383          type: 'tween',
 384          delay: 0.8
 385        },
 386        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fullscreen_mode_close, {
 387          showTooltip: true,
 388          initialPost: initialPost
 389        })
 390      })
 391    });
 392  }
 393  /* harmony default export */ const back_button = (BackButton);
 394  
 395  ;// ./node_modules/@wordpress/edit-post/build-module/store/constants.js
 396  /**
 397   * The identifier for the data store.
 398   *
 399   * @type {string}
 400   */
 401  const STORE_NAME = 'core/edit-post';
 402  
 403  /**
 404   * CSS selector string for the admin bar view post link anchor tag.
 405   *
 406   * @type {string}
 407   */
 408  const VIEW_AS_LINK_SELECTOR = '#wp-admin-bar-view a';
 409  
 410  /**
 411   * CSS selector string for the admin bar preview post link anchor tag.
 412   *
 413   * @type {string}
 414   */
 415  const VIEW_AS_PREVIEW_LINK_SELECTOR = '#wp-admin-bar-preview a';
 416  
 417  ;// ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/listener-hooks.js
 418  /**
 419   * WordPress dependencies
 420   */
 421  
 422  
 423  
 424  
 425  /**
 426   * Internal dependencies
 427   */
 428  
 429  
 430  /**
 431   * This listener hook monitors any change in permalink and updates the view
 432   * post link in the admin bar.
 433   */
 434  const useUpdatePostLinkListener = () => {
 435    const {
 436      newPermalink
 437    } = (0,external_wp_data_namespaceObject.useSelect)(select => ({
 438      newPermalink: select(external_wp_editor_namespaceObject.store).getCurrentPost().link
 439    }), []);
 440    const nodeToUpdateRef = (0,external_wp_element_namespaceObject.useRef)();
 441    (0,external_wp_element_namespaceObject.useEffect)(() => {
 442      nodeToUpdateRef.current = document.querySelector(VIEW_AS_PREVIEW_LINK_SELECTOR) || document.querySelector(VIEW_AS_LINK_SELECTOR);
 443    }, []);
 444    (0,external_wp_element_namespaceObject.useEffect)(() => {
 445      if (!newPermalink || !nodeToUpdateRef.current) {
 446        return;
 447      }
 448      nodeToUpdateRef.current.setAttribute('href', newPermalink);
 449    }, [newPermalink]);
 450  };
 451  
 452  ;// ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/index.js
 453  /**
 454   * Internal dependencies
 455   */
 456  
 457  
 458  /**
 459   * Data component used for initializing the editor and re-initializes
 460   * when postId changes or on unmount.
 461   *
 462   * @return {null} This is a data component so does not render any ui.
 463   */
 464  function EditorInitialization() {
 465    useUpdatePostLinkListener();
 466    return null;
 467  }
 468  
 469  ;// external ["wp","keyboardShortcuts"]
 470  const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"];
 471  ;// ./node_modules/@wordpress/edit-post/build-module/store/reducer.js
 472  /**
 473   * WordPress dependencies
 474   */
 475  
 476  
 477  /**
 478   * Reducer keeping track of the meta boxes isSaving state.
 479   * A "true" value means the meta boxes saving request is in-flight.
 480   *
 481   *
 482   * @param {boolean} state  Previous state.
 483   * @param {Object}  action Action Object.
 484   *
 485   * @return {Object} Updated state.
 486   */
 487  function isSavingMetaBoxes(state = false, action) {
 488    switch (action.type) {
 489      case 'REQUEST_META_BOX_UPDATES':
 490        return true;
 491      case 'META_BOX_UPDATES_SUCCESS':
 492      case 'META_BOX_UPDATES_FAILURE':
 493        return false;
 494      default:
 495        return state;
 496    }
 497  }
 498  function mergeMetaboxes(metaboxes = [], newMetaboxes) {
 499    const mergedMetaboxes = [...metaboxes];
 500    for (const metabox of newMetaboxes) {
 501      const existing = mergedMetaboxes.findIndex(box => box.id === metabox.id);
 502      if (existing !== -1) {
 503        mergedMetaboxes[existing] = metabox;
 504      } else {
 505        mergedMetaboxes.push(metabox);
 506      }
 507    }
 508    return mergedMetaboxes;
 509  }
 510  
 511  /**
 512   * Reducer keeping track of the meta boxes per location.
 513   *
 514   * @param {boolean} state  Previous state.
 515   * @param {Object}  action Action Object.
 516   *
 517   * @return {Object} Updated state.
 518   */
 519  function metaBoxLocations(state = {}, action) {
 520    switch (action.type) {
 521      case 'SET_META_BOXES_PER_LOCATIONS':
 522        {
 523          const newState = {
 524            ...state
 525          };
 526          for (const [location, metaboxes] of Object.entries(action.metaBoxesPerLocation)) {
 527            newState[location] = mergeMetaboxes(newState[location], metaboxes);
 528          }
 529          return newState;
 530        }
 531    }
 532    return state;
 533  }
 534  
 535  /**
 536   * Reducer tracking whether meta boxes are initialized.
 537   *
 538   * @param {boolean} state
 539   * @param {Object}  action
 540   *
 541   * @return {boolean} Updated state.
 542   */
 543  function metaBoxesInitialized(state = false, action) {
 544    switch (action.type) {
 545      case 'META_BOXES_INITIALIZED':
 546        return true;
 547    }
 548    return state;
 549  }
 550  const metaBoxes = (0,external_wp_data_namespaceObject.combineReducers)({
 551    isSaving: isSavingMetaBoxes,
 552    locations: metaBoxLocations,
 553    initialized: metaBoxesInitialized
 554  });
 555  /* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
 556    metaBoxes
 557  }));
 558  
 559  ;// external ["wp","apiFetch"]
 560  const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"];
 561  var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject);
 562  ;// external ["wp","hooks"]
 563  const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
 564  ;// ./node_modules/@wordpress/edit-post/build-module/utils/meta-boxes.js
 565  /**
 566   * Function returning the current Meta Boxes DOM Node in the editor
 567   * whether the meta box area is opened or not.
 568   * If the MetaBox Area is visible returns it, and returns the original container instead.
 569   *
 570   * @param {string} location Meta Box location.
 571   *
 572   * @return {string} HTML content.
 573   */
 574  const getMetaBoxContainer = location => {
 575    const area = document.querySelector(`.edit-post-meta-boxes-area.is-$location} .metabox-location-$location}`);
 576    if (area) {
 577      return area;
 578    }
 579    return document.querySelector('#metaboxes .metabox-location-' + location);
 580  };
 581  
 582  ;// ./node_modules/@wordpress/edit-post/build-module/store/actions.js
 583  /**
 584   * WordPress dependencies
 585   */
 586  
 587  
 588  
 589  
 590  
 591  
 592  
 593  
 594  
 595  /**
 596   * Internal dependencies
 597   */
 598  
 599  
 600  const {
 601    interfaceStore
 602  } = unlock(external_wp_editor_namespaceObject.privateApis);
 603  
 604  /**
 605   * Returns an action object used in signalling that the user opened an editor sidebar.
 606   *
 607   * @param {?string} name Sidebar name to be opened.
 608   */
 609  const openGeneralSidebar = name => ({
 610    registry
 611  }) => {
 612    registry.dispatch(interfaceStore).enableComplementaryArea('core', name);
 613  };
 614  
 615  /**
 616   * Returns an action object signalling that the user closed the sidebar.
 617   */
 618  const closeGeneralSidebar = () => ({
 619    registry
 620  }) => registry.dispatch(interfaceStore).disableComplementaryArea('core');
 621  
 622  /**
 623   * Returns an action object used in signalling that the user opened a modal.
 624   *
 625   * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead.
 626   *
 627   *
 628   * @param {string} name A string that uniquely identifies the modal.
 629   *
 630   * @return {Object} Action object.
 631   */
 632  const openModal = name => ({
 633    registry
 634  }) => {
 635    external_wp_deprecated_default()("select( 'core/edit-post' ).openModal( name )", {
 636      since: '6.3',
 637      alternative: "select( 'core/interface').openModal( name )"
 638    });
 639    return registry.dispatch(interfaceStore).openModal(name);
 640  };
 641  
 642  /**
 643   * Returns an action object signalling that the user closed a modal.
 644   *
 645   * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead.
 646   *
 647   * @return {Object} Action object.
 648   */
 649  const closeModal = () => ({
 650    registry
 651  }) => {
 652    external_wp_deprecated_default()("select( 'core/edit-post' ).closeModal()", {
 653      since: '6.3',
 654      alternative: "select( 'core/interface').closeModal()"
 655    });
 656    return registry.dispatch(interfaceStore).closeModal();
 657  };
 658  
 659  /**
 660   * Returns an action object used in signalling that the user opened the publish
 661   * sidebar.
 662   * @deprecated
 663   *
 664   * @return {Object} Action object
 665   */
 666  const openPublishSidebar = () => ({
 667    registry
 668  }) => {
 669    external_wp_deprecated_default()("dispatch( 'core/edit-post' ).openPublishSidebar", {
 670      since: '6.6',
 671      alternative: "dispatch( 'core/editor').openPublishSidebar"
 672    });
 673    registry.dispatch(external_wp_editor_namespaceObject.store).openPublishSidebar();
 674  };
 675  
 676  /**
 677   * Returns an action object used in signalling that the user closed the
 678   * publish sidebar.
 679   * @deprecated
 680   *
 681   * @return {Object} Action object.
 682   */
 683  const closePublishSidebar = () => ({
 684    registry
 685  }) => {
 686    external_wp_deprecated_default()("dispatch( 'core/edit-post' ).closePublishSidebar", {
 687      since: '6.6',
 688      alternative: "dispatch( 'core/editor').closePublishSidebar"
 689    });
 690    registry.dispatch(external_wp_editor_namespaceObject.store).closePublishSidebar();
 691  };
 692  
 693  /**
 694   * Returns an action object used in signalling that the user toggles the publish sidebar.
 695   * @deprecated
 696   *
 697   * @return {Object} Action object
 698   */
 699  const togglePublishSidebar = () => ({
 700    registry
 701  }) => {
 702    external_wp_deprecated_default()("dispatch( 'core/edit-post' ).togglePublishSidebar", {
 703      since: '6.6',
 704      alternative: "dispatch( 'core/editor').togglePublishSidebar"
 705    });
 706    registry.dispatch(external_wp_editor_namespaceObject.store).togglePublishSidebar();
 707  };
 708  
 709  /**
 710   * Returns an action object used to enable or disable a panel in the editor.
 711   *
 712   * @deprecated
 713   *
 714   * @param {string} panelName A string that identifies the panel to enable or disable.
 715   *
 716   * @return {Object} Action object.
 717   */
 718  const toggleEditorPanelEnabled = panelName => ({
 719    registry
 720  }) => {
 721    external_wp_deprecated_default()("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled", {
 722      since: '6.5',
 723      alternative: "dispatch( 'core/editor').toggleEditorPanelEnabled"
 724    });
 725    registry.dispatch(external_wp_editor_namespaceObject.store).toggleEditorPanelEnabled(panelName);
 726  };
 727  
 728  /**
 729   * Opens a closed panel and closes an open panel.
 730   *
 731   * @deprecated
 732   *
 733   * @param {string} panelName A string that identifies the panel to open or close.
 734   */
 735  const toggleEditorPanelOpened = panelName => ({
 736    registry
 737  }) => {
 738    external_wp_deprecated_default()("dispatch( 'core/edit-post' ).toggleEditorPanelOpened", {
 739      since: '6.5',
 740      alternative: "dispatch( 'core/editor').toggleEditorPanelOpened"
 741    });
 742    registry.dispatch(external_wp_editor_namespaceObject.store).toggleEditorPanelOpened(panelName);
 743  };
 744  
 745  /**
 746   * Returns an action object used to remove a panel from the editor.
 747   *
 748   * @deprecated
 749   *
 750   * @param {string} panelName A string that identifies the panel to remove.
 751   *
 752   * @return {Object} Action object.
 753   */
 754  const removeEditorPanel = panelName => ({
 755    registry
 756  }) => {
 757    external_wp_deprecated_default()("dispatch( 'core/edit-post' ).removeEditorPanel", {
 758      since: '6.5',
 759      alternative: "dispatch( 'core/editor').removeEditorPanel"
 760    });
 761    registry.dispatch(external_wp_editor_namespaceObject.store).removeEditorPanel(panelName);
 762  };
 763  
 764  /**
 765   * Triggers an action used to toggle a feature flag.
 766   *
 767   * @param {string} feature Feature name.
 768   */
 769  const toggleFeature = feature => ({
 770    registry
 771  }) => registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core/edit-post', feature);
 772  
 773  /**
 774   * Triggers an action used to switch editor mode.
 775   *
 776   * @deprecated
 777   *
 778   * @param {string} mode The editor mode.
 779   */
 780  const switchEditorMode = mode => ({
 781    registry
 782  }) => {
 783    external_wp_deprecated_default()("dispatch( 'core/edit-post' ).switchEditorMode", {
 784      since: '6.6',
 785      alternative: "dispatch( 'core/editor').switchEditorMode"
 786    });
 787    registry.dispatch(external_wp_editor_namespaceObject.store).switchEditorMode(mode);
 788  };
 789  
 790  /**
 791   * Triggers an action object used to toggle a plugin name flag.
 792   *
 793   * @param {string} pluginName Plugin name.
 794   */
 795  const togglePinnedPluginItem = pluginName => ({
 796    registry
 797  }) => {
 798    const isPinned = registry.select(interfaceStore).isItemPinned('core', pluginName);
 799    registry.dispatch(interfaceStore)[isPinned ? 'unpinItem' : 'pinItem']('core', pluginName);
 800  };
 801  
 802  /**
 803   * Returns an action object used in signaling that a style should be auto-applied when a block is created.
 804   *
 805   * @deprecated
 806   */
 807  function updatePreferredStyleVariations() {
 808    external_wp_deprecated_default()("dispatch( 'core/edit-post' ).updatePreferredStyleVariations", {
 809      since: '6.6',
 810      hint: 'Preferred Style Variations are not supported anymore.'
 811    });
 812    return {
 813      type: 'NOTHING'
 814    };
 815  }
 816  
 817  /**
 818   * Update the provided block types to be visible.
 819   *
 820   * @param {string[]} blockNames Names of block types to show.
 821   */
 822  const showBlockTypes = blockNames => ({
 823    registry
 824  }) => {
 825    unlock(registry.dispatch(external_wp_editor_namespaceObject.store)).showBlockTypes(blockNames);
 826  };
 827  
 828  /**
 829   * Update the provided block types to be hidden.
 830   *
 831   * @param {string[]} blockNames Names of block types to hide.
 832   */
 833  const hideBlockTypes = blockNames => ({
 834    registry
 835  }) => {
 836    unlock(registry.dispatch(external_wp_editor_namespaceObject.store)).hideBlockTypes(blockNames);
 837  };
 838  
 839  /**
 840   * Stores info about which Meta boxes are available in which location.
 841   *
 842   * @param {Object} metaBoxesPerLocation Meta boxes per location.
 843   */
 844  function setAvailableMetaBoxesPerLocation(metaBoxesPerLocation) {
 845    return {
 846      type: 'SET_META_BOXES_PER_LOCATIONS',
 847      metaBoxesPerLocation
 848    };
 849  }
 850  
 851  /**
 852   * Update a metabox.
 853   */
 854  const requestMetaBoxUpdates = () => async ({
 855    registry,
 856    select,
 857    dispatch
 858  }) => {
 859    dispatch({
 860      type: 'REQUEST_META_BOX_UPDATES'
 861    });
 862  
 863    // Saves the wp_editor fields.
 864    if (window.tinyMCE) {
 865      window.tinyMCE.triggerSave();
 866    }
 867  
 868    // We gather the base form data.
 869    const baseFormData = new window.FormData(document.querySelector('.metabox-base-form'));
 870    const postId = baseFormData.get('post_ID');
 871    const postType = baseFormData.get('post_type');
 872  
 873    // Additional data needed for backward compatibility.
 874    // If we do not provide this data, the post will be overridden with the default values.
 875    // We cannot rely on getCurrentPost because right now on the editor we may be editing a pattern or a template.
 876    // We need to retrieve the post that the base form data is referring to.
 877    const post = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', postType, postId);
 878    const additionalData = [post.comment_status ? ['comment_status', post.comment_status] : false, post.ping_status ? ['ping_status', post.ping_status] : false, post.sticky ? ['sticky', post.sticky] : false, post.author ? ['post_author', post.author] : false].filter(Boolean);
 879  
 880    // We gather all the metaboxes locations.
 881    const activeMetaBoxLocations = select.getActiveMetaBoxLocations();
 882    const formDataToMerge = [baseFormData, ...activeMetaBoxLocations.map(location => new window.FormData(getMetaBoxContainer(location)))];
 883  
 884    // Merge all form data objects into a single one.
 885    const formData = formDataToMerge.reduce((memo, currentFormData) => {
 886      for (const [key, value] of currentFormData) {
 887        memo.append(key, value);
 888      }
 889      return memo;
 890    }, new window.FormData());
 891    additionalData.forEach(([key, value]) => formData.append(key, value));
 892    try {
 893      // Save the metaboxes.
 894      await external_wp_apiFetch_default()({
 895        url: window._wpMetaBoxUrl,
 896        method: 'POST',
 897        body: formData,
 898        parse: false
 899      });
 900      dispatch.metaBoxUpdatesSuccess();
 901    } catch {
 902      dispatch.metaBoxUpdatesFailure();
 903    }
 904  };
 905  
 906  /**
 907   * Returns an action object used to signal a successful meta box update.
 908   *
 909   * @return {Object} Action object.
 910   */
 911  function metaBoxUpdatesSuccess() {
 912    return {
 913      type: 'META_BOX_UPDATES_SUCCESS'
 914    };
 915  }
 916  
 917  /**
 918   * Returns an action object used to signal a failed meta box update.
 919   *
 920   * @return {Object} Action object.
 921   */
 922  function metaBoxUpdatesFailure() {
 923    return {
 924      type: 'META_BOX_UPDATES_FAILURE'
 925    };
 926  }
 927  
 928  /**
 929   * Action that changes the width of the editing canvas.
 930   *
 931   * @deprecated
 932   *
 933   * @param {string} deviceType
 934   */
 935  const __experimentalSetPreviewDeviceType = deviceType => ({
 936    registry
 937  }) => {
 938    external_wp_deprecated_default()("dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType", {
 939      since: '6.5',
 940      version: '6.7',
 941      hint: 'registry.dispatch( editorStore ).setDeviceType'
 942    });
 943    registry.dispatch(external_wp_editor_namespaceObject.store).setDeviceType(deviceType);
 944  };
 945  
 946  /**
 947   * Returns an action object used to open/close the inserter.
 948   *
 949   * @deprecated
 950   *
 951   * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false).
 952   */
 953  const setIsInserterOpened = value => ({
 954    registry
 955  }) => {
 956    external_wp_deprecated_default()("dispatch( 'core/edit-post' ).setIsInserterOpened", {
 957      since: '6.5',
 958      alternative: "dispatch( 'core/editor').setIsInserterOpened"
 959    });
 960    registry.dispatch(external_wp_editor_namespaceObject.store).setIsInserterOpened(value);
 961  };
 962  
 963  /**
 964   * Returns an action object used to open/close the list view.
 965   *
 966   * @deprecated
 967   *
 968   * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.
 969   */
 970  const setIsListViewOpened = isOpen => ({
 971    registry
 972  }) => {
 973    external_wp_deprecated_default()("dispatch( 'core/edit-post' ).setIsListViewOpened", {
 974      since: '6.5',
 975      alternative: "dispatch( 'core/editor').setIsListViewOpened"
 976    });
 977    registry.dispatch(external_wp_editor_namespaceObject.store).setIsListViewOpened(isOpen);
 978  };
 979  
 980  /**
 981   * Returns an action object used to switch to template editing.
 982   *
 983   * @deprecated
 984   */
 985  function setIsEditingTemplate() {
 986    external_wp_deprecated_default()("dispatch( 'core/edit-post' ).setIsEditingTemplate", {
 987      since: '6.5',
 988      alternative: "dispatch( 'core/editor').setRenderingMode"
 989    });
 990    return {
 991      type: 'NOTHING'
 992    };
 993  }
 994  
 995  /**
 996   * Create a block based template.
 997   *
 998   * @deprecated
 999   */
1000  function __unstableCreateTemplate() {
1001    external_wp_deprecated_default()("dispatch( 'core/edit-post' ).__unstableCreateTemplate", {
1002      since: '6.5'
1003    });
1004    return {
1005      type: 'NOTHING'
1006    };
1007  }
1008  let actions_metaBoxesInitialized = false;
1009  
1010  /**
1011   * Initializes WordPress `postboxes` script and the logic for saving meta boxes.
1012   */
1013  const initializeMetaBoxes = () => ({
1014    registry,
1015    select,
1016    dispatch
1017  }) => {
1018    const isEditorReady = registry.select(external_wp_editor_namespaceObject.store).__unstableIsEditorReady();
1019    if (!isEditorReady) {
1020      return;
1021    }
1022    // Only initialize once.
1023    if (actions_metaBoxesInitialized) {
1024      return;
1025    }
1026    const postType = registry.select(external_wp_editor_namespaceObject.store).getCurrentPostType();
1027    if (window.postboxes.page !== postType) {
1028      window.postboxes.add_postbox_toggles(postType);
1029    }
1030    actions_metaBoxesInitialized = true;
1031  
1032    // Save metaboxes on save completion, except for autosaves.
1033    (0,external_wp_hooks_namespaceObject.addAction)('editor.savePost', 'core/edit-post/save-metaboxes', async (post, options) => {
1034      if (!options.isAutosave && select.hasMetaBoxes()) {
1035        await dispatch.requestMetaBoxUpdates();
1036      }
1037    });
1038    dispatch({
1039      type: 'META_BOXES_INITIALIZED'
1040    });
1041  };
1042  
1043  /**
1044   * Action that toggles Distraction free mode.
1045   * Distraction free mode expects there are no sidebars, as due to the
1046   * z-index values set, you can't close sidebars.
1047   *
1048   * @deprecated
1049   */
1050  const toggleDistractionFree = () => ({
1051    registry
1052  }) => {
1053    external_wp_deprecated_default()("dispatch( 'core/edit-post' ).toggleDistractionFree", {
1054      since: '6.6',
1055      alternative: "dispatch( 'core/editor').toggleDistractionFree"
1056    });
1057    registry.dispatch(external_wp_editor_namespaceObject.store).toggleDistractionFree();
1058  };
1059  
1060  /**
1061   * Action that toggles the Fullscreen Mode view option.
1062   */
1063  const toggleFullscreenMode = () => ({
1064    registry
1065  }) => {
1066    const isFullscreen = registry.select(external_wp_preferences_namespaceObject.store).get('core/edit-post', 'fullscreenMode');
1067    registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core/edit-post', 'fullscreenMode');
1068    registry.dispatch(external_wp_notices_namespaceObject.store).createInfoNotice(isFullscreen ? (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode deactivated.') : (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode activated.'), {
1069      id: 'core/edit-post/toggle-fullscreen-mode/notice',
1070      type: 'snackbar',
1071      actions: [{
1072        label: (0,external_wp_i18n_namespaceObject.__)('Undo'),
1073        onClick: () => {
1074          registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core/edit-post', 'fullscreenMode');
1075        }
1076      }]
1077    });
1078  };
1079  
1080  ;// ./node_modules/@wordpress/edit-post/build-module/store/selectors.js
1081  /**
1082   * WordPress dependencies
1083   */
1084  
1085  
1086  
1087  
1088  
1089  
1090  /**
1091   * Internal dependencies
1092   */
1093  
1094  const {
1095    interfaceStore: selectors_interfaceStore
1096  } = unlock(external_wp_editor_namespaceObject.privateApis);
1097  const EMPTY_ARRAY = [];
1098  const EMPTY_OBJECT = {};
1099  
1100  /**
1101   * Returns the current editing mode.
1102   *
1103   * @param {Object} state Global application state.
1104   *
1105   * @return {string} Editing mode.
1106   */
1107  const getEditorMode = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
1108    var _select$get;
1109    return (_select$get = select(external_wp_preferences_namespaceObject.store).get('core', 'editorMode')) !== null && _select$get !== void 0 ? _select$get : 'visual';
1110  });
1111  
1112  /**
1113   * Returns true if the editor sidebar is opened.
1114   *
1115   * @param {Object} state Global application state
1116   *
1117   * @return {boolean} Whether the editor sidebar is opened.
1118   */
1119  const isEditorSidebarOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
1120    const activeGeneralSidebar = select(selectors_interfaceStore).getActiveComplementaryArea('core');
1121    return ['edit-post/document', 'edit-post/block'].includes(activeGeneralSidebar);
1122  });
1123  
1124  /**
1125   * Returns true if the plugin sidebar is opened.
1126   *
1127   * @param {Object} state Global application state.
1128   *
1129   * @return {boolean} Whether the plugin sidebar is opened.
1130   */
1131  const isPluginSidebarOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
1132    const activeGeneralSidebar = select(selectors_interfaceStore).getActiveComplementaryArea('core');
1133    return !!activeGeneralSidebar && !['edit-post/document', 'edit-post/block'].includes(activeGeneralSidebar);
1134  });
1135  
1136  /**
1137   * Returns the current active general sidebar name, or null if there is no
1138   * general sidebar active. The active general sidebar is a unique name to
1139   * identify either an editor or plugin sidebar.
1140   *
1141   * Examples:
1142   *
1143   *  - `edit-post/document`
1144   *  - `my-plugin/insert-image-sidebar`
1145   *
1146   * @param {Object} state Global application state.
1147   *
1148   * @return {?string} Active general sidebar name.
1149   */
1150  const getActiveGeneralSidebarName = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
1151    return select(selectors_interfaceStore).getActiveComplementaryArea('core');
1152  });
1153  
1154  /**
1155   * Converts panels from the new preferences store format to the old format
1156   * that the post editor previously used.
1157   *
1158   * The resultant converted data should look like this:
1159   * {
1160   *     panelName: {
1161   *         enabled: false,
1162   *         opened: true,
1163   *     },
1164   *     anotherPanelName: {
1165   *         opened: true
1166   *     },
1167   * }
1168   *
1169   * @param {string[] | undefined} inactivePanels An array of inactive panel names.
1170   * @param {string[] | undefined} openPanels     An array of open panel names.
1171   *
1172   * @return {Object} The converted panel data.
1173   */
1174  function convertPanelsToOldFormat(inactivePanels, openPanels) {
1175    var _ref;
1176    // First reduce the inactive panels.
1177    const panelsWithEnabledState = inactivePanels?.reduce((accumulatedPanels, panelName) => ({
1178      ...accumulatedPanels,
1179      [panelName]: {
1180        enabled: false
1181      }
1182    }), {});
1183  
1184    // Then reduce the open panels, passing in the result of the previous
1185    // reduction as the initial value so that both open and inactive
1186    // panel state is combined.
1187    const panels = openPanels?.reduce((accumulatedPanels, panelName) => {
1188      const currentPanelState = accumulatedPanels?.[panelName];
1189      return {
1190        ...accumulatedPanels,
1191        [panelName]: {
1192          ...currentPanelState,
1193          opened: true
1194        }
1195      };
1196    }, panelsWithEnabledState !== null && panelsWithEnabledState !== void 0 ? panelsWithEnabledState : {});
1197  
1198    // The panels variable will only be set if openPanels wasn't `undefined`.
1199    // If it isn't set just return `panelsWithEnabledState`, and if that isn't
1200    // set return an empty object.
1201    return (_ref = panels !== null && panels !== void 0 ? panels : panelsWithEnabledState) !== null && _ref !== void 0 ? _ref : EMPTY_OBJECT;
1202  }
1203  
1204  /**
1205   * Returns the preferences (these preferences are persisted locally).
1206   *
1207   * @param {Object} state Global application state.
1208   *
1209   * @return {Object} Preferences Object.
1210   */
1211  const getPreferences = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
1212    external_wp_deprecated_default()(`select( 'core/edit-post' ).getPreferences`, {
1213      since: '6.0',
1214      alternative: `select( 'core/preferences' ).get`
1215    });
1216    const corePreferences = ['editorMode', 'hiddenBlockTypes'].reduce((accumulatedPrefs, preferenceKey) => {
1217      const value = select(external_wp_preferences_namespaceObject.store).get('core', preferenceKey);
1218      return {
1219        ...accumulatedPrefs,
1220        [preferenceKey]: value
1221      };
1222    }, {});
1223  
1224    // Panels were a preference, but the data structure changed when the state
1225    // was migrated to the preferences store. They need to be converted from
1226    // the new preferences store format to old format to ensure no breaking
1227    // changes for plugins.
1228    const inactivePanels = select(external_wp_preferences_namespaceObject.store).get('core', 'inactivePanels');
1229    const openPanels = select(external_wp_preferences_namespaceObject.store).get('core', 'openPanels');
1230    const panels = convertPanelsToOldFormat(inactivePanels, openPanels);
1231    return {
1232      ...corePreferences,
1233      panels
1234    };
1235  });
1236  
1237  /**
1238   *
1239   * @param {Object} state         Global application state.
1240   * @param {string} preferenceKey Preference Key.
1241   * @param {*}      defaultValue  Default Value.
1242   *
1243   * @return {*} Preference Value.
1244   */
1245  function getPreference(state, preferenceKey, defaultValue) {
1246    external_wp_deprecated_default()(`select( 'core/edit-post' ).getPreference`, {
1247      since: '6.0',
1248      alternative: `select( 'core/preferences' ).get`
1249    });
1250  
1251    // Avoid using the `getPreferences` registry selector where possible.
1252    const preferences = getPreferences(state);
1253    const value = preferences[preferenceKey];
1254    return value === undefined ? defaultValue : value;
1255  }
1256  
1257  /**
1258   * Returns an array of blocks that are hidden.
1259   *
1260   * @return {Array} A list of the hidden block types
1261   */
1262  const getHiddenBlockTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
1263    var _select$get2;
1264    return (_select$get2 = select(external_wp_preferences_namespaceObject.store).get('core', 'hiddenBlockTypes')) !== null && _select$get2 !== void 0 ? _select$get2 : EMPTY_ARRAY;
1265  });
1266  
1267  /**
1268   * Returns true if the publish sidebar is opened.
1269   *
1270   * @deprecated
1271   *
1272   * @param {Object} state Global application state
1273   *
1274   * @return {boolean} Whether the publish sidebar is open.
1275   */
1276  const isPublishSidebarOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
1277    external_wp_deprecated_default()(`select( 'core/edit-post' ).isPublishSidebarOpened`, {
1278      since: '6.6',
1279      alternative: `select( 'core/editor' ).isPublishSidebarOpened`
1280    });
1281    return select(external_wp_editor_namespaceObject.store).isPublishSidebarOpened();
1282  });
1283  
1284  /**
1285   * Returns true if the given panel was programmatically removed, or false otherwise.
1286   * All panels are not removed by default.
1287   *
1288   * @deprecated
1289   *
1290   * @param {Object} state     Global application state.
1291   * @param {string} panelName A string that identifies the panel.
1292   *
1293   * @return {boolean} Whether or not the panel is removed.
1294   */
1295  const isEditorPanelRemoved = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, panelName) => {
1296    external_wp_deprecated_default()(`select( 'core/edit-post' ).isEditorPanelRemoved`, {
1297      since: '6.5',
1298      alternative: `select( 'core/editor' ).isEditorPanelRemoved`
1299    });
1300    return select(external_wp_editor_namespaceObject.store).isEditorPanelRemoved(panelName);
1301  });
1302  
1303  /**
1304   * Returns true if the given panel is enabled, or false otherwise. Panels are
1305   * enabled by default.
1306   *
1307   * @deprecated
1308   *
1309   * @param {Object} state     Global application state.
1310   * @param {string} panelName A string that identifies the panel.
1311   *
1312   * @return {boolean} Whether or not the panel is enabled.
1313   */
1314  const isEditorPanelEnabled = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, panelName) => {
1315    external_wp_deprecated_default()(`select( 'core/edit-post' ).isEditorPanelEnabled`, {
1316      since: '6.5',
1317      alternative: `select( 'core/editor' ).isEditorPanelEnabled`
1318    });
1319    return select(external_wp_editor_namespaceObject.store).isEditorPanelEnabled(panelName);
1320  });
1321  
1322  /**
1323   * Returns true if the given panel is open, or false otherwise. Panels are
1324   * closed by default.
1325   *
1326   * @deprecated
1327   *
1328   * @param {Object} state     Global application state.
1329   * @param {string} panelName A string that identifies the panel.
1330   *
1331   * @return {boolean} Whether or not the panel is open.
1332   */
1333  const isEditorPanelOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, panelName) => {
1334    external_wp_deprecated_default()(`select( 'core/edit-post' ).isEditorPanelOpened`, {
1335      since: '6.5',
1336      alternative: `select( 'core/editor' ).isEditorPanelOpened`
1337    });
1338    return select(external_wp_editor_namespaceObject.store).isEditorPanelOpened(panelName);
1339  });
1340  
1341  /**
1342   * Returns true if a modal is active, or false otherwise.
1343   *
1344   * @deprecated since WP 6.3 use `core/interface` store's selector with the same name instead.
1345   *
1346   * @param {Object} state     Global application state.
1347   * @param {string} modalName A string that uniquely identifies the modal.
1348   *
1349   * @return {boolean} Whether the modal is active.
1350   */
1351  const isModalActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, modalName) => {
1352    external_wp_deprecated_default()(`select( 'core/edit-post' ).isModalActive`, {
1353      since: '6.3',
1354      alternative: `select( 'core/interface' ).isModalActive`
1355    });
1356    return !!select(selectors_interfaceStore).isModalActive(modalName);
1357  });
1358  
1359  /**
1360   * Returns whether the given feature is enabled or not.
1361   *
1362   * @param {Object} state   Global application state.
1363   * @param {string} feature Feature slug.
1364   *
1365   * @return {boolean} Is active.
1366   */
1367  const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, feature) => {
1368    return !!select(external_wp_preferences_namespaceObject.store).get('core/edit-post', feature);
1369  });
1370  
1371  /**
1372   * Returns true if the plugin item is pinned to the header.
1373   * When the value is not set it defaults to true.
1374   *
1375   * @param {Object} state      Global application state.
1376   * @param {string} pluginName Plugin item name.
1377   *
1378   * @return {boolean} Whether the plugin item is pinned.
1379   */
1380  const isPluginItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, pluginName) => {
1381    return select(selectors_interfaceStore).isItemPinned('core', pluginName);
1382  });
1383  
1384  /**
1385   * Returns an array of active meta box locations.
1386   *
1387   * @param {Object} state Post editor state.
1388   *
1389   * @return {string[]} Active meta box locations.
1390   */
1391  const getActiveMetaBoxLocations = (0,external_wp_data_namespaceObject.createSelector)(state => {
1392    return Object.keys(state.metaBoxes.locations).filter(location => isMetaBoxLocationActive(state, location));
1393  }, state => [state.metaBoxes.locations]);
1394  
1395  /**
1396   * Returns true if a metabox location is active and visible
1397   *
1398   * @param {Object} state    Post editor state.
1399   * @param {string} location Meta box location to test.
1400   *
1401   * @return {boolean} Whether the meta box location is active and visible.
1402   */
1403  const isMetaBoxLocationVisible = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, location) => {
1404    return isMetaBoxLocationActive(state, location) && getMetaBoxesPerLocation(state, location)?.some(({
1405      id
1406    }) => {
1407      return select(external_wp_editor_namespaceObject.store).isEditorPanelEnabled(`meta-box-$id}`);
1408    });
1409  });
1410  
1411  /**
1412   * Returns true if there is an active meta box in the given location, or false
1413   * otherwise.
1414   *
1415   * @param {Object} state    Post editor state.
1416   * @param {string} location Meta box location to test.
1417   *
1418   * @return {boolean} Whether the meta box location is active.
1419   */
1420  function isMetaBoxLocationActive(state, location) {
1421    const metaBoxes = getMetaBoxesPerLocation(state, location);
1422    return !!metaBoxes && metaBoxes.length !== 0;
1423  }
1424  
1425  /**
1426   * Returns the list of all the available meta boxes for a given location.
1427   *
1428   * @param {Object} state    Global application state.
1429   * @param {string} location Meta box location to test.
1430   *
1431   * @return {?Array} List of meta boxes.
1432   */
1433  function getMetaBoxesPerLocation(state, location) {
1434    return state.metaBoxes.locations[location];
1435  }
1436  
1437  /**
1438   * Returns the list of all the available meta boxes.
1439   *
1440   * @param {Object} state Global application state.
1441   *
1442   * @return {Array} List of meta boxes.
1443   */
1444  const getAllMetaBoxes = (0,external_wp_data_namespaceObject.createSelector)(state => {
1445    return Object.values(state.metaBoxes.locations).flat();
1446  }, state => [state.metaBoxes.locations]);
1447  
1448  /**
1449   * Returns true if the post is using Meta Boxes
1450   *
1451   * @param {Object} state Global application state
1452   *
1453   * @return {boolean} Whether there are metaboxes or not.
1454   */
1455  function hasMetaBoxes(state) {
1456    return getActiveMetaBoxLocations(state).length > 0;
1457  }
1458  
1459  /**
1460   * Returns true if the Meta Boxes are being saved.
1461   *
1462   * @param {Object} state Global application state.
1463   *
1464   * @return {boolean} Whether the metaboxes are being saved.
1465   */
1466  function selectors_isSavingMetaBoxes(state) {
1467    return state.metaBoxes.isSaving;
1468  }
1469  
1470  /**
1471   * Returns the current editing canvas device type.
1472   *
1473   * @deprecated
1474   *
1475   * @param {Object} state Global application state.
1476   *
1477   * @return {string} Device type.
1478   */
1479  const __experimentalGetPreviewDeviceType = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
1480    external_wp_deprecated_default()(`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`, {
1481      since: '6.5',
1482      version: '6.7',
1483      alternative: `select( 'core/editor' ).getDeviceType`
1484    });
1485    return select(external_wp_editor_namespaceObject.store).getDeviceType();
1486  });
1487  
1488  /**
1489   * Returns true if the inserter is opened.
1490   *
1491   * @deprecated
1492   *
1493   * @param {Object} state Global application state.
1494   *
1495   * @return {boolean} Whether the inserter is opened.
1496   */
1497  const isInserterOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
1498    external_wp_deprecated_default()(`select( 'core/edit-post' ).isInserterOpened`, {
1499      since: '6.5',
1500      alternative: `select( 'core/editor' ).isInserterOpened`
1501    });
1502    return select(external_wp_editor_namespaceObject.store).isInserterOpened();
1503  });
1504  
1505  /**
1506   * Get the insertion point for the inserter.
1507   *
1508   * @deprecated
1509   *
1510   * @param {Object} state Global application state.
1511   *
1512   * @return {Object} The root client ID, index to insert at and starting filter value.
1513   */
1514  const __experimentalGetInsertionPoint = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
1515    external_wp_deprecated_default()(`select( 'core/edit-post' ).__experimentalGetInsertionPoint`, {
1516      since: '6.5',
1517      version: '6.7'
1518    });
1519    return unlock(select(external_wp_editor_namespaceObject.store)).getInserter();
1520  });
1521  
1522  /**
1523   * Returns true if the list view is opened.
1524   *
1525   * @param {Object} state Global application state.
1526   *
1527   * @return {boolean} Whether the list view is opened.
1528   */
1529  const isListViewOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
1530    external_wp_deprecated_default()(`select( 'core/edit-post' ).isListViewOpened`, {
1531      since: '6.5',
1532      alternative: `select( 'core/editor' ).isListViewOpened`
1533    });
1534    return select(external_wp_editor_namespaceObject.store).isListViewOpened();
1535  });
1536  
1537  /**
1538   * Returns true if the template editing mode is enabled.
1539   *
1540   * @deprecated
1541   */
1542  const isEditingTemplate = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
1543    external_wp_deprecated_default()(`select( 'core/edit-post' ).isEditingTemplate`, {
1544      since: '6.5',
1545      alternative: `select( 'core/editor' ).getRenderingMode`
1546    });
1547    return select(external_wp_editor_namespaceObject.store).getCurrentPostType() === 'wp_template';
1548  });
1549  
1550  /**
1551   * Returns true if meta boxes are initialized.
1552   *
1553   * @param {Object} state Global application state.
1554   *
1555   * @return {boolean} Whether meta boxes are initialized.
1556   */
1557  function areMetaBoxesInitialized(state) {
1558    return state.metaBoxes.initialized;
1559  }
1560  
1561  /**
1562   * Retrieves the template of the currently edited post.
1563   *
1564   * @return {?Object} Post Template.
1565   */
1566  const getEditedPostTemplate = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => {
1567    const {
1568      id: postId,
1569      type: postType
1570    } = select(external_wp_editor_namespaceObject.store).getCurrentPost();
1571    const templateId = unlock(select(external_wp_coreData_namespaceObject.store)).getTemplateId(postType, postId);
1572    if (!templateId) {
1573      return undefined;
1574    }
1575    return select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', 'wp_template', templateId);
1576  });
1577  
1578  ;// ./node_modules/@wordpress/edit-post/build-module/store/index.js
1579  /**
1580   * WordPress dependencies
1581   */
1582  
1583  
1584  /**
1585   * Internal dependencies
1586   */
1587  
1588  
1589  
1590  
1591  
1592  /**
1593   * Store definition for the edit post namespace.
1594   *
1595   * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
1596   *
1597   * @type {Object}
1598   */
1599  const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
1600    reducer: reducer,
1601    actions: actions_namespaceObject,
1602    selectors: selectors_namespaceObject
1603  });
1604  (0,external_wp_data_namespaceObject.register)(store);
1605  
1606  ;// ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcuts/index.js
1607  /**
1608   * WordPress dependencies
1609   */
1610  
1611  
1612  
1613  
1614  
1615  /**
1616   * Internal dependencies
1617   */
1618  
1619  function KeyboardShortcuts() {
1620    const {
1621      toggleFullscreenMode
1622    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
1623    const {
1624      registerShortcut
1625    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store);
1626    (0,external_wp_element_namespaceObject.useEffect)(() => {
1627      registerShortcut({
1628        name: 'core/edit-post/toggle-fullscreen',
1629        category: 'global',
1630        description: (0,external_wp_i18n_namespaceObject.__)('Enable or disable fullscreen mode.'),
1631        keyCombination: {
1632          modifier: 'secondary',
1633          character: 'f'
1634        }
1635      });
1636    }, []);
1637    (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-post/toggle-fullscreen', () => {
1638      toggleFullscreenMode();
1639    });
1640    return null;
1641  }
1642  /* harmony default export */ const keyboard_shortcuts = (KeyboardShortcuts);
1643  
1644  ;// ./node_modules/@wordpress/edit-post/build-module/components/init-pattern-modal/index.js
1645  /**
1646   * WordPress dependencies
1647   */
1648  
1649  
1650  
1651  
1652  
1653  
1654  function InitPatternModal() {
1655    const {
1656      editPost
1657    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store);
1658    const [syncType, setSyncType] = (0,external_wp_element_namespaceObject.useState)(undefined);
1659    const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)('');
1660    const {
1661      postType,
1662      isNewPost
1663    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
1664      const {
1665        getEditedPostAttribute,
1666        isCleanNewPost
1667      } = select(external_wp_editor_namespaceObject.store);
1668      return {
1669        postType: getEditedPostAttribute('type'),
1670        isNewPost: isCleanNewPost()
1671      };
1672    }, []);
1673    const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(() => isNewPost && postType === 'wp_block');
1674    if (postType !== 'wp_block' || !isNewPost) {
1675      return null;
1676    }
1677    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {
1678      children: isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, {
1679        title: (0,external_wp_i18n_namespaceObject.__)('Create pattern'),
1680        onRequestClose: () => {
1681          setIsModalOpen(false);
1682        },
1683        overlayClassName: "reusable-blocks-menu-items__convert-modal",
1684        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
1685          onSubmit: event => {
1686            event.preventDefault();
1687            setIsModalOpen(false);
1688            editPost({
1689              title,
1690              meta: {
1691                wp_pattern_sync_status: syncType
1692              }
1693            });
1694          },
1695          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
1696            spacing: "5",
1697            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
1698              label: (0,external_wp_i18n_namespaceObject.__)('Name'),
1699              value: title,
1700              onChange: setTitle,
1701              placeholder: (0,external_wp_i18n_namespaceObject.__)('My pattern'),
1702              className: "patterns-create-modal__name-input",
1703              __nextHasNoMarginBottom: true,
1704              __next40pxDefaultSize: true
1705            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, {
1706              __nextHasNoMarginBottom: true,
1707              label: (0,external_wp_i18n_namespaceObject._x)('Synced', 'pattern (singular)'),
1708              help: (0,external_wp_i18n_namespaceObject.__)('Sync this pattern across multiple locations.'),
1709              checked: !syncType,
1710              onChange: () => {
1711                setSyncType(!syncType ? 'unsynced' : undefined);
1712              }
1713            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, {
1714              justify: "right",
1715              children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
1716                __next40pxDefaultSize: true,
1717                variant: "primary",
1718                type: "submit",
1719                disabled: !title,
1720                accessibleWhenDisabled: true,
1721                children: (0,external_wp_i18n_namespaceObject.__)('Create')
1722              })
1723            })]
1724          })
1725        })
1726      })
1727    });
1728  }
1729  
1730  ;// ./node_modules/@wordpress/edit-post/build-module/components/browser-url/index.js
1731  /**
1732   * WordPress dependencies
1733   */
1734  
1735  
1736  
1737  
1738  
1739  /**
1740   * Returns the Post's Edit URL.
1741   *
1742   * @param {number} postId Post ID.
1743   *
1744   * @return {string} Post edit URL.
1745   */
1746  function getPostEditURL(postId) {
1747    return (0,external_wp_url_namespaceObject.addQueryArgs)('post.php', {
1748      post: postId,
1749      action: 'edit'
1750    });
1751  }
1752  class BrowserURL extends external_wp_element_namespaceObject.Component {
1753    constructor() {
1754      super(...arguments);
1755      this.state = {
1756        historyId: null
1757      };
1758    }
1759    componentDidUpdate(prevProps) {
1760      const {
1761        postId,
1762        postStatus
1763      } = this.props;
1764      const {
1765        historyId
1766      } = this.state;
1767      if ((postId !== prevProps.postId || postId !== historyId) && postStatus !== 'auto-draft' && postId) {
1768        this.setBrowserURL(postId);
1769      }
1770    }
1771  
1772    /**
1773     * Replaces the browser URL with a post editor link for the given post ID.
1774     *
1775     * Note it is important that, since this function may be called when the
1776     * editor first loads, the result generated `getPostEditURL` matches that
1777     * produced by the server. Otherwise, the URL will change unexpectedly.
1778     *
1779     * @param {number} postId Post ID for which to generate post editor URL.
1780     */
1781    setBrowserURL(postId) {
1782      window.history.replaceState({
1783        id: postId
1784      }, 'Post ' + postId, getPostEditURL(postId));
1785      this.setState(() => ({
1786        historyId: postId
1787      }));
1788    }
1789    render() {
1790      return null;
1791    }
1792  }
1793  /* harmony default export */ const browser_url = ((0,external_wp_data_namespaceObject.withSelect)(select => {
1794    const {
1795      getCurrentPost
1796    } = select(external_wp_editor_namespaceObject.store);
1797    const post = getCurrentPost();
1798    let {
1799      id,
1800      status,
1801      type
1802    } = post;
1803    const isTemplate = ['wp_template', 'wp_template_part'].includes(type);
1804    if (isTemplate) {
1805      id = post.wp_id;
1806    }
1807    return {
1808      postId: id,
1809      postStatus: status
1810    };
1811  })(BrowserURL));
1812  
1813  ;// ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-boxes-area/index.js
1814  /**
1815   * External dependencies
1816   */
1817  
1818  
1819  /**
1820   * WordPress dependencies
1821   */
1822  
1823  
1824  
1825  
1826  /**
1827   * Internal dependencies
1828   */
1829  
1830  
1831  /**
1832   * Render metabox area.
1833   *
1834   * @param {Object} props          Component props.
1835   * @param {string} props.location metabox location.
1836   * @return {Component} The component to be rendered.
1837   */
1838  
1839  function MetaBoxesArea({
1840    location
1841  }) {
1842    const container = (0,external_wp_element_namespaceObject.useRef)(null);
1843    const formRef = (0,external_wp_element_namespaceObject.useRef)(null);
1844    (0,external_wp_element_namespaceObject.useEffect)(() => {
1845      formRef.current = document.querySelector('.metabox-location-' + location);
1846      if (formRef.current) {
1847        container.current.appendChild(formRef.current);
1848      }
1849      return () => {
1850        if (formRef.current) {
1851          document.querySelector('#metaboxes').appendChild(formRef.current);
1852        }
1853      };
1854    }, [location]);
1855    const isSaving = (0,external_wp_data_namespaceObject.useSelect)(select => {
1856      return select(store).isSavingMetaBoxes();
1857    }, []);
1858    const classes = dist_clsx('edit-post-meta-boxes-area', `is-$location}`, {
1859      'is-loading': isSaving
1860    });
1861    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
1862      className: classes,
1863      children: [isSaving && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
1864        className: "edit-post-meta-boxes-area__container",
1865        ref: container
1866      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
1867        className: "edit-post-meta-boxes-area__clear"
1868      })]
1869    });
1870  }
1871  /* harmony default export */ const meta_boxes_area = (MetaBoxesArea);
1872  
1873  ;// ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-box-visibility.js
1874  /**
1875   * WordPress dependencies
1876   */
1877  
1878  
1879  
1880  function MetaBoxVisibility({
1881    id
1882  }) {
1883    const isVisible = (0,external_wp_data_namespaceObject.useSelect)(select => {
1884      return select(external_wp_editor_namespaceObject.store).isEditorPanelEnabled(`meta-box-$id}`);
1885    }, [id]);
1886    (0,external_wp_element_namespaceObject.useEffect)(() => {
1887      const element = document.getElementById(id);
1888      if (!element) {
1889        return;
1890      }
1891      if (isVisible) {
1892        element.classList.remove('is-hidden');
1893      } else {
1894        element.classList.add('is-hidden');
1895      }
1896    }, [id, isVisible]);
1897    return null;
1898  }
1899  
1900  ;// ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/index.js
1901  /**
1902   * WordPress dependencies
1903   */
1904  
1905  
1906  /**
1907   * Internal dependencies
1908   */
1909  
1910  
1911  
1912  
1913  function MetaBoxes({
1914    location
1915  }) {
1916    const metaBoxes = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getMetaBoxesPerLocation(location), [location]);
1917    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
1918      children: [(metaBoxes !== null && metaBoxes !== void 0 ? metaBoxes : []).map(({
1919        id
1920      }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxVisibility, {
1921        id: id
1922      }, id)), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(meta_boxes_area, {
1923        location: location
1924      })]
1925    });
1926  }
1927  
1928  ;// external ["wp","keycodes"]
1929  const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
1930  ;// ./node_modules/@wordpress/edit-post/build-module/components/more-menu/manage-patterns-menu-item.js
1931  /**
1932   * WordPress dependencies
1933   */
1934  
1935  
1936  
1937  
1938  
1939  
1940  function ManagePatternsMenuItem() {
1941    const url = (0,external_wp_data_namespaceObject.useSelect)(select => {
1942      const {
1943        canUser
1944      } = select(external_wp_coreData_namespaceObject.store);
1945      const defaultUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
1946        post_type: 'wp_block'
1947      });
1948      const patternsUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', {
1949        path: '/patterns'
1950      });
1951  
1952      // The site editor and templates both check whether the user has
1953      // edit_theme_options capabilities. We can leverage that here and not
1954      // display the manage patterns link if the user can't access it.
1955      return canUser('create', {
1956        kind: 'postType',
1957        name: 'wp_template'
1958      }) ? patternsUrl : defaultUrl;
1959    }, []);
1960    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, {
1961      role: "menuitem",
1962      href: url,
1963      children: (0,external_wp_i18n_namespaceObject.__)('Manage patterns')
1964    });
1965  }
1966  /* harmony default export */ const manage_patterns_menu_item = (ManagePatternsMenuItem);
1967  
1968  ;// ./node_modules/@wordpress/edit-post/build-module/components/more-menu/welcome-guide-menu-item.js
1969  /**
1970   * WordPress dependencies
1971   */
1972  
1973  
1974  
1975  
1976  
1977  function WelcomeGuideMenuItem() {
1978    const isEditingTemplate = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_editor_namespaceObject.store).getCurrentPostType() === 'wp_template', []);
1979    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
1980      scope: "core/edit-post",
1981      name: isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide',
1982      label: (0,external_wp_i18n_namespaceObject.__)('Welcome Guide')
1983    });
1984  }
1985  
1986  ;// ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/enable-custom-fields.js
1987  /**
1988   * WordPress dependencies
1989   */
1990  
1991  
1992  
1993  
1994  
1995  
1996  
1997  
1998  /**
1999   * Internal dependencies
2000   */
2001  
2002  
2003  const {
2004    PreferenceBaseOption
2005  } = unlock(external_wp_preferences_namespaceObject.privateApis);
2006  function submitCustomFieldsForm() {
2007    const customFieldsForm = document.getElementById('toggle-custom-fields-form');
2008  
2009    // Ensure the referrer values is up to update with any
2010    customFieldsForm.querySelector('[name="_wp_http_referer"]').setAttribute('value', (0,external_wp_url_namespaceObject.getPathAndQueryString)(window.location.href));
2011    customFieldsForm.submit();
2012  }
2013  function CustomFieldsConfirmation({
2014    willEnable
2015  }) {
2016    const [isReloading, setIsReloading] = (0,external_wp_element_namespaceObject.useState)(false);
2017    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
2018      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
2019        className: "edit-post-preferences-modal__custom-fields-confirmation-message",
2020        children: (0,external_wp_i18n_namespaceObject.__)('A page reload is required for this change. Make sure your content is saved before reloading.')
2021      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
2022        __next40pxDefaultSize: true,
2023        variant: "secondary",
2024        isBusy: isReloading,
2025        accessibleWhenDisabled: true,
2026        disabled: isReloading,
2027        onClick: () => {
2028          setIsReloading(true);
2029          submitCustomFieldsForm();
2030        },
2031        children: willEnable ? (0,external_wp_i18n_namespaceObject.__)('Show & Reload Page') : (0,external_wp_i18n_namespaceObject.__)('Hide & Reload Page')
2032      })]
2033    });
2034  }
2035  function EnableCustomFieldsOption({
2036    label
2037  }) {
2038    const areCustomFieldsEnabled = (0,external_wp_data_namespaceObject.useSelect)(select => {
2039      return !!select(external_wp_editor_namespaceObject.store).getEditorSettings().enableCustomFields;
2040    }, []);
2041    const [isChecked, setIsChecked] = (0,external_wp_element_namespaceObject.useState)(areCustomFieldsEnabled);
2042    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceBaseOption, {
2043      label: label,
2044      isChecked: isChecked,
2045      onChange: setIsChecked,
2046      children: isChecked !== areCustomFieldsEnabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomFieldsConfirmation, {
2047        willEnable: isChecked
2048      })
2049    });
2050  }
2051  
2052  ;// ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/enable-panel.js
2053  /**
2054   * WordPress dependencies
2055   */
2056  
2057  
2058  
2059  
2060  /**
2061   * Internal dependencies
2062   */
2063  
2064  
2065  const {
2066    PreferenceBaseOption: enable_panel_PreferenceBaseOption
2067  } = unlock(external_wp_preferences_namespaceObject.privateApis);
2068  function EnablePanelOption(props) {
2069    const {
2070      toggleEditorPanelEnabled
2071    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store);
2072    const {
2073      isChecked,
2074      isRemoved
2075    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
2076      const {
2077        isEditorPanelEnabled,
2078        isEditorPanelRemoved
2079      } = select(external_wp_editor_namespaceObject.store);
2080      return {
2081        isChecked: isEditorPanelEnabled(props.panelName),
2082        isRemoved: isEditorPanelRemoved(props.panelName)
2083      };
2084    }, [props.panelName]);
2085    if (isRemoved) {
2086      return null;
2087    }
2088    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel_PreferenceBaseOption, {
2089      isChecked: isChecked,
2090      onChange: () => toggleEditorPanelEnabled(props.panelName),
2091      ...props
2092    });
2093  }
2094  
2095  ;// ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/meta-boxes-section.js
2096  /**
2097   * WordPress dependencies
2098   */
2099  
2100  
2101  
2102  
2103  
2104  /**
2105   * Internal dependencies
2106   */
2107  
2108  
2109  
2110  
2111  
2112  const {
2113    PreferencesModalSection
2114  } = unlock(external_wp_preferences_namespaceObject.privateApis);
2115  function MetaBoxesSection({
2116    areCustomFieldsRegistered,
2117    metaBoxes,
2118    ...sectionProps
2119  }) {
2120    // The 'Custom Fields' meta box is a special case that we handle separately.
2121    const thirdPartyMetaBoxes = metaBoxes.filter(({
2122      id
2123    }) => id !== 'postcustom');
2124    if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) {
2125      return null;
2126    }
2127    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreferencesModalSection, {
2128      ...sectionProps,
2129      children: [areCustomFieldsRegistered && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnableCustomFieldsOption, {
2130        label: (0,external_wp_i18n_namespaceObject.__)('Custom fields')
2131      }), thirdPartyMetaBoxes.map(({
2132        id,
2133        title
2134      }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePanelOption, {
2135        label: title,
2136        panelName: `meta-box-$id}`
2137      }, id))]
2138    });
2139  }
2140  /* harmony default export */ const meta_boxes_section = ((0,external_wp_data_namespaceObject.withSelect)(select => {
2141    const {
2142      getEditorSettings
2143    } = select(external_wp_editor_namespaceObject.store);
2144    const {
2145      getAllMetaBoxes
2146    } = select(store);
2147    return {
2148      // This setting should not live in the block editor's store.
2149      areCustomFieldsRegistered: getEditorSettings().enableCustomFields !== undefined,
2150      metaBoxes: getAllMetaBoxes()
2151    };
2152  })(MetaBoxesSection));
2153  
2154  ;// ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/index.js
2155  /**
2156   * WordPress dependencies
2157   */
2158  
2159  
2160  
2161  
2162  
2163  /**
2164   * Internal dependencies
2165   */
2166  
2167  
2168  
2169  const {
2170    PreferenceToggleControl
2171  } = unlock(external_wp_preferences_namespaceObject.privateApis);
2172  const {
2173    PreferencesModal
2174  } = unlock(external_wp_editor_namespaceObject.privateApis);
2175  function EditPostPreferencesModal() {
2176    const extraSections = {
2177      general: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(meta_boxes_section, {
2178        title: (0,external_wp_i18n_namespaceObject.__)('Advanced')
2179      }),
2180      appearance: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, {
2181        scope: "core/edit-post",
2182        featureName: "themeStyles",
2183        help: (0,external_wp_i18n_namespaceObject.__)('Make the editor look like your theme.'),
2184        label: (0,external_wp_i18n_namespaceObject.__)('Use theme styles')
2185      })
2186    };
2187    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModal, {
2188      extraSections: extraSections
2189    });
2190  }
2191  
2192  ;// ./node_modules/@wordpress/edit-post/build-module/components/more-menu/index.js
2193  /**
2194   * WordPress dependencies
2195   */
2196  
2197  
2198  
2199  
2200  
2201  
2202  /**
2203   * Internal dependencies
2204   */
2205  
2206  
2207  
2208  
2209  
2210  const {
2211    ToolsMoreMenuGroup,
2212    ViewMoreMenuGroup
2213  } = unlock(external_wp_editor_namespaceObject.privateApis);
2214  const MoreMenu = () => {
2215    const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('large');
2216    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
2217      children: [isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ViewMoreMenuGroup, {
2218        children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, {
2219          scope: "core/edit-post",
2220          name: "fullscreenMode",
2221          label: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode'),
2222          info: (0,external_wp_i18n_namespaceObject.__)('Show and hide the admin user interface'),
2223          messageActivated: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode activated.'),
2224          messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode deactivated.'),
2225          shortcut: external_wp_keycodes_namespaceObject.displayShortcut.secondary('f')
2226        })
2227      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ToolsMoreMenuGroup, {
2228        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(manage_patterns_menu_item, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideMenuItem, {})]
2229      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditPostPreferencesModal, {})]
2230    });
2231  };
2232  /* harmony default export */ const more_menu = (MoreMenu);
2233  
2234  ;// ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/image.js
2235  
2236  function WelcomeGuideImage({
2237    nonAnimatedSrc,
2238    animatedSrc
2239  }) {
2240    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("picture", {
2241      className: "edit-post-welcome-guide__image",
2242      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("source", {
2243        srcSet: nonAnimatedSrc,
2244        media: "(prefers-reduced-motion: reduce)"
2245      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
2246        src: animatedSrc,
2247        width: "312",
2248        height: "240",
2249        alt: ""
2250      })]
2251    });
2252  }
2253  
2254  ;// ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/default.js
2255  /**
2256   * WordPress dependencies
2257   */
2258  
2259  
2260  
2261  
2262  
2263  /**
2264   * Internal dependencies
2265   */
2266  
2267  
2268  
2269  function WelcomeGuideDefault() {
2270    const {
2271      toggleFeature
2272    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
2273    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Guide, {
2274      className: "edit-post-welcome-guide",
2275      contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to the editor'),
2276      finishButtonText: (0,external_wp_i18n_namespaceObject.__)('Get started'),
2277      onFinish: () => toggleFeature('welcomeGuide'),
2278      pages: [{
2279        image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, {
2280          nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg",
2281          animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif"
2282        }),
2283        content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
2284          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", {
2285            className: "edit-post-welcome-guide__heading",
2286            children: (0,external_wp_i18n_namespaceObject.__)('Welcome to the editor')
2287          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
2288            className: "edit-post-welcome-guide__text",
2289            children: (0,external_wp_i18n_namespaceObject.__)('In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.')
2290          })]
2291        })
2292      }, {
2293        image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, {
2294          nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg",
2295          animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif"
2296        }),
2297        content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
2298          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", {
2299            className: "edit-post-welcome-guide__heading",
2300            children: (0,external_wp_i18n_namespaceObject.__)('Customize each block')
2301          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
2302            className: "edit-post-welcome-guide__text",
2303            children: (0,external_wp_i18n_namespaceObject.__)('Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.')
2304          })]
2305        })
2306      }, {
2307        image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, {
2308          nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg",
2309          animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif"
2310        }),
2311        content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
2312          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", {
2313            className: "edit-post-welcome-guide__heading",
2314            children: (0,external_wp_i18n_namespaceObject.__)('Explore all blocks')
2315          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
2316            className: "edit-post-welcome-guide__text",
2317            children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'), {
2318              InserterIconImage: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", {
2319                alt: (0,external_wp_i18n_namespaceObject.__)('inserter'),
2320                src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"
2321              })
2322            })
2323          })]
2324        })
2325      }, {
2326        image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, {
2327          nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg",
2328          animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif"
2329        }),
2330        content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
2331          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", {
2332            className: "edit-post-welcome-guide__heading",
2333            children: (0,external_wp_i18n_namespaceObject.__)('Learn more')
2334          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
2335            className: "edit-post-welcome-guide__text",
2336            children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)("New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>"), {
2337              a: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
2338                href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/wordpress-block-editor/')
2339              })
2340            })
2341          })]
2342        })
2343      }]
2344    });
2345  }
2346  
2347  ;// ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/template.js
2348  /**
2349   * WordPress dependencies
2350   */
2351  
2352  
2353  
2354  
2355  /**
2356   * Internal dependencies
2357   */
2358  
2359  
2360  
2361  function WelcomeGuideTemplate() {
2362    const {
2363      toggleFeature
2364    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
2365    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Guide, {
2366      className: "edit-template-welcome-guide",
2367      contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to the template editor'),
2368      finishButtonText: (0,external_wp_i18n_namespaceObject.__)('Get started'),
2369      onFinish: () => toggleFeature('welcomeGuideTemplate'),
2370      pages: [{
2371        image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, {
2372          nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.svg",
2373          animatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.gif"
2374        }),
2375        content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
2376          children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", {
2377            className: "edit-post-welcome-guide__heading",
2378            children: (0,external_wp_i18n_namespaceObject.__)('Welcome to the template editor')
2379          }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
2380            className: "edit-post-welcome-guide__text",
2381            children: (0,external_wp_i18n_namespaceObject.__)('Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.')
2382          })]
2383        })
2384      }]
2385    });
2386  }
2387  
2388  ;// ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/index.js
2389  /**
2390   * WordPress dependencies
2391   */
2392  
2393  
2394  /**
2395   * Internal dependencies
2396   */
2397  
2398  
2399  
2400  
2401  function WelcomeGuide({
2402    postType
2403  }) {
2404    const {
2405      isActive,
2406      isEditingTemplate
2407    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
2408      const {
2409        isFeatureActive
2410      } = select(store);
2411      const _isEditingTemplate = postType === 'wp_template';
2412      const feature = _isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide';
2413      return {
2414        isActive: isFeatureActive(feature),
2415        isEditingTemplate: _isEditingTemplate
2416      };
2417    }, [postType]);
2418    if (!isActive) {
2419      return null;
2420    }
2421    return isEditingTemplate ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideTemplate, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideDefault, {});
2422  }
2423  
2424  ;// ./node_modules/@wordpress/icons/build-module/library/fullscreen.js
2425  /**
2426   * WordPress dependencies
2427   */
2428  
2429  
2430  const fullscreen = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
2431    xmlns: "http://www.w3.org/2000/svg",
2432    viewBox: "0 0 24 24",
2433    children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, {
2434      d: "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"
2435    })
2436  });
2437  /* harmony default export */ const library_fullscreen = (fullscreen);
2438  
2439  ;// ./node_modules/@wordpress/edit-post/build-module/commands/use-commands.js
2440  /**
2441   * WordPress dependencies
2442   */
2443  
2444  
2445  
2446  
2447  
2448  
2449  function useCommands() {
2450    const {
2451      isFullscreen
2452    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
2453      const {
2454        get
2455      } = select(external_wp_preferences_namespaceObject.store);
2456      return {
2457        isFullscreen: get('core/edit-post', 'fullscreenMode')
2458      };
2459    }, []);
2460    const {
2461      toggle
2462    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
2463    const {
2464      createInfoNotice
2465    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
2466    (0,external_wp_commands_namespaceObject.useCommand)({
2467      name: 'core/toggle-fullscreen-mode',
2468      label: isFullscreen ? (0,external_wp_i18n_namespaceObject.__)('Exit fullscreen') : (0,external_wp_i18n_namespaceObject.__)('Enter fullscreen'),
2469      icon: library_fullscreen,
2470      callback: ({
2471        close
2472      }) => {
2473        toggle('core/edit-post', 'fullscreenMode');
2474        close();
2475        createInfoNotice(isFullscreen ? (0,external_wp_i18n_namespaceObject.__)('Fullscreen off.') : (0,external_wp_i18n_namespaceObject.__)('Fullscreen on.'), {
2476          id: 'core/edit-post/toggle-fullscreen-mode/notice',
2477          type: 'snackbar',
2478          actions: [{
2479            label: (0,external_wp_i18n_namespaceObject.__)('Undo'),
2480            onClick: () => {
2481              toggle('core/edit-post', 'fullscreenMode');
2482            }
2483          }]
2484        });
2485      }
2486    });
2487  }
2488  
2489  ;// ./node_modules/@wordpress/edit-post/build-module/components/layout/use-padding-appender.js
2490  /**
2491   * WordPress dependencies
2492   */
2493  
2494  
2495  
2496  
2497  
2498  // Ruleset to add space for the typewriter effect. When typing in the last
2499  // block, there needs to be room to scroll up.
2500  const CSS = ':root :where(.editor-styles-wrapper)::after {content: ""; display: block; height: 40vh;}';
2501  function usePaddingAppender(enabled) {
2502    const registry = (0,external_wp_data_namespaceObject.useRegistry)();
2503    const effect = (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
2504      function onMouseDown(event) {
2505        if (event.target !== node &&
2506        // Tests for the parent element because in the iframed editor if the click is
2507        // below the padding the target will be the parent element (html) and should
2508        // still be treated as intent to append.
2509        event.target !== node.parentElement) {
2510          return;
2511        }
2512  
2513        // Only handle clicks under the last child.
2514        const lastChild = node.lastElementChild;
2515        if (!lastChild) {
2516          return;
2517        }
2518        const lastChildRect = lastChild.getBoundingClientRect();
2519        if (event.clientY < lastChildRect.bottom) {
2520          return;
2521        }
2522        event.preventDefault();
2523        const blockOrder = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockOrder('');
2524        const lastBlockClientId = blockOrder[blockOrder.length - 1];
2525        const lastBlock = registry.select(external_wp_blockEditor_namespaceObject.store).getBlock(lastBlockClientId);
2526        const {
2527          selectBlock,
2528          insertDefaultBlock
2529        } = registry.dispatch(external_wp_blockEditor_namespaceObject.store);
2530        if (lastBlock && (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(lastBlock)) {
2531          selectBlock(lastBlockClientId);
2532        } else {
2533          insertDefaultBlock();
2534        }
2535      }
2536      const {
2537        ownerDocument
2538      } = node;
2539      // Adds the listener on the document so that in the iframed editor clicks below the
2540      // padding can be handled as they too should be treated as intent to append.
2541      ownerDocument.addEventListener('mousedown', onMouseDown);
2542      return () => {
2543        ownerDocument.removeEventListener('mousedown', onMouseDown);
2544      };
2545    }, [registry]);
2546    return enabled ? [effect, CSS] : [];
2547  }
2548  
2549  ;// ./node_modules/@wordpress/edit-post/build-module/components/layout/use-should-iframe.js
2550  /**
2551   * WordPress dependencies
2552   */
2553  
2554  
2555  
2556  
2557  
2558  /**
2559   * Internal dependencies
2560   */
2561  
2562  const isGutenbergPlugin =  false ? 0 : false;
2563  function useShouldIframe() {
2564    return (0,external_wp_data_namespaceObject.useSelect)(select => {
2565      const {
2566        getEditorSettings,
2567        getCurrentPostType,
2568        getDeviceType
2569      } = select(external_wp_editor_namespaceObject.store);
2570      return (
2571        // If the theme is block based and the Gutenberg plugin is active,
2572        // we ALWAYS use the iframe for consistency across the post and site
2573        // editor.
2574        isGutenbergPlugin && getEditorSettings().__unstableIsBlockBasedTheme ||
2575        // We also still want to iframe all the special
2576        // editor features and modes such as device previews, zoom out, and
2577        // template/pattern editing.
2578        getDeviceType() !== 'Desktop' || ['wp_template', 'wp_block'].includes(getCurrentPostType()) || unlock(select(external_wp_blockEditor_namespaceObject.store)).isZoomOut() ||
2579        // Finally, still iframe the editor if all blocks are v3 (which means
2580        // they are marked as iframe-compatible).
2581        select(external_wp_blocks_namespaceObject.store).getBlockTypes().every(type => type.apiVersion >= 3)
2582      );
2583    }, []);
2584  }
2585  
2586  ;// ./node_modules/@wordpress/edit-post/build-module/hooks/use-navigate-to-entity-record.js
2587  /**
2588   * WordPress dependencies
2589   */
2590  
2591  
2592  
2593  
2594  /**
2595   * A hook that records the 'entity' history in the post editor as a user
2596   * navigates between editing a post and editing the post template or patterns.
2597   *
2598   * Implemented as a stack, so a little similar to the browser history API.
2599   *
2600   * Used to control displaying UI elements like the back button.
2601   *
2602   * @param {number} initialPostId        The post id of the post when the editor loaded.
2603   * @param {string} initialPostType      The post type of the post when the editor loaded.
2604   * @param {string} defaultRenderingMode The rendering mode to switch to when navigating.
2605   *
2606   * @return {Object} An object containing the `currentPost` variable and
2607   *                 `onNavigateToEntityRecord` and `onNavigateToPreviousEntityRecord` functions.
2608   */
2609  function useNavigateToEntityRecord(initialPostId, initialPostType, defaultRenderingMode) {
2610    const [postHistory, dispatch] = (0,external_wp_element_namespaceObject.useReducer)((historyState, {
2611      type,
2612      post,
2613      previousRenderingMode
2614    }) => {
2615      if (type === 'push') {
2616        return [...historyState, {
2617          post,
2618          previousRenderingMode
2619        }];
2620      }
2621      if (type === 'pop') {
2622        // Try to leave one item in the history.
2623        if (historyState.length > 1) {
2624          return historyState.slice(0, -1);
2625        }
2626      }
2627      return historyState;
2628    }, [{
2629      post: {
2630        postId: initialPostId,
2631        postType: initialPostType
2632      }
2633    }]);
2634    const {
2635      post,
2636      previousRenderingMode
2637    } = postHistory[postHistory.length - 1];
2638    const {
2639      getRenderingMode
2640    } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_editor_namespaceObject.store);
2641    const {
2642      setRenderingMode
2643    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store);
2644    const onNavigateToEntityRecord = (0,external_wp_element_namespaceObject.useCallback)(params => {
2645      dispatch({
2646        type: 'push',
2647        post: {
2648          postId: params.postId,
2649          postType: params.postType
2650        },
2651        // Save the current rendering mode so we can restore it when navigating back.
2652        previousRenderingMode: getRenderingMode()
2653      });
2654      setRenderingMode(defaultRenderingMode);
2655    }, [getRenderingMode, setRenderingMode, defaultRenderingMode]);
2656    const onNavigateToPreviousEntityRecord = (0,external_wp_element_namespaceObject.useCallback)(() => {
2657      dispatch({
2658        type: 'pop'
2659      });
2660      if (previousRenderingMode) {
2661        setRenderingMode(previousRenderingMode);
2662      }
2663    }, [setRenderingMode, previousRenderingMode]);
2664    return {
2665      currentPost: post,
2666      onNavigateToEntityRecord,
2667      onNavigateToPreviousEntityRecord: postHistory.length > 1 ? onNavigateToPreviousEntityRecord : undefined
2668    };
2669  }
2670  
2671  ;// ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/use-meta-box-initialization.js
2672  /**
2673   * WordPress dependencies
2674   */
2675  
2676  
2677  
2678  
2679  /**
2680   * Internal dependencies
2681   */
2682  
2683  
2684  /**
2685   * Initializes WordPress `postboxes` script and the logic for saving meta boxes.
2686   *
2687   * @param { boolean } enabled
2688   */
2689  const useMetaBoxInitialization = enabled => {
2690    const isEnabledAndEditorReady = (0,external_wp_data_namespaceObject.useSelect)(select => enabled && select(external_wp_editor_namespaceObject.store).__unstableIsEditorReady(), [enabled]);
2691    const {
2692      initializeMetaBoxes
2693    } = (0,external_wp_data_namespaceObject.useDispatch)(store);
2694    // The effect has to rerun when the editor is ready because initializeMetaBoxes
2695    // will noop until then.
2696    (0,external_wp_element_namespaceObject.useEffect)(() => {
2697      if (isEnabledAndEditorReady) {
2698        initializeMetaBoxes();
2699      }
2700    }, [isEnabledAndEditorReady, initializeMetaBoxes]);
2701  };
2702  
2703  ;// ./node_modules/@wordpress/edit-post/build-module/components/layout/index.js
2704  /**
2705   * External dependencies
2706   */
2707  
2708  
2709  /**
2710   * WordPress dependencies
2711   */
2712  
2713  
2714  
2715  
2716  
2717  
2718  
2719  
2720  
2721  
2722  
2723  
2724  
2725  
2726  
2727  
2728  
2729  
2730  /**
2731   * Internal dependencies
2732   */
2733  
2734  
2735  
2736  
2737  
2738  
2739  
2740  
2741  
2742  
2743  
2744  
2745  
2746  
2747  
2748  
2749  const {
2750    getLayoutStyles
2751  } = unlock(external_wp_blockEditor_namespaceObject.privateApis);
2752  const {
2753    useCommands: layout_useCommands
2754  } = unlock(external_wp_coreCommands_namespaceObject.privateApis);
2755  const {
2756    useCommandContext
2757  } = unlock(external_wp_commands_namespaceObject.privateApis);
2758  const {
2759    Editor,
2760    FullscreenMode,
2761    NavigableRegion
2762  } = unlock(external_wp_editor_namespaceObject.privateApis);
2763  const {
2764    BlockKeyboardShortcuts
2765  } = unlock(external_wp_blockLibrary_namespaceObject.privateApis);
2766  const DESIGN_POST_TYPES = ['wp_template', 'wp_template_part', 'wp_block', 'wp_navigation'];
2767  function useEditorStyles(...additionalStyles) {
2768    const {
2769      hasThemeStyleSupport,
2770      editorSettings
2771    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
2772      return {
2773        hasThemeStyleSupport: select(store).isFeatureActive('themeStyles'),
2774        editorSettings: select(external_wp_editor_namespaceObject.store).getEditorSettings()
2775      };
2776    }, []);
2777    const addedStyles = additionalStyles.join('\n');
2778  
2779    // Compute the default styles.
2780    return (0,external_wp_element_namespaceObject.useMemo)(() => {
2781      var _editorSettings$style, _editorSettings$defau, _editorSettings$style2, _editorSettings$style3;
2782      const presetStyles = (_editorSettings$style = editorSettings.styles?.filter(style => style.__unstableType && style.__unstableType !== 'theme')) !== null && _editorSettings$style !== void 0 ? _editorSettings$style : [];
2783      const defaultEditorStyles = [...((_editorSettings$defau = editorSettings?.defaultEditorStyles) !== null && _editorSettings$defau !== void 0 ? _editorSettings$defau : []), ...presetStyles];
2784  
2785      // Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).
2786      const hasThemeStyles = hasThemeStyleSupport && presetStyles.length !== ((_editorSettings$style2 = editorSettings.styles?.length) !== null && _editorSettings$style2 !== void 0 ? _editorSettings$style2 : 0);
2787  
2788      // If theme styles are not present or displayed, ensure that
2789      // base layout styles are still present in the editor.
2790      if (!editorSettings.disableLayoutStyles && !hasThemeStyles) {
2791        defaultEditorStyles.push({
2792          css: getLayoutStyles({
2793            style: {},
2794            selector: 'body',
2795            hasBlockGapSupport: false,
2796            hasFallbackGapSupport: true,
2797            fallbackGapValue: '0.5em'
2798          })
2799        });
2800      }
2801      const baseStyles = hasThemeStyles ? (_editorSettings$style3 = editorSettings.styles) !== null && _editorSettings$style3 !== void 0 ? _editorSettings$style3 : [] : defaultEditorStyles;
2802      if (addedStyles) {
2803        return [...baseStyles, {
2804          css: addedStyles
2805        }];
2806      }
2807      return baseStyles;
2808    }, [editorSettings.defaultEditorStyles, editorSettings.disableLayoutStyles, editorSettings.styles, hasThemeStyleSupport, addedStyles]);
2809  }
2810  function MetaBoxesMain() {
2811    const [isOpen, openHeight, hasAnyVisible] = (0,external_wp_data_namespaceObject.useSelect)(select => {
2812      const {
2813        get
2814      } = select(external_wp_preferences_namespaceObject.store);
2815      const {
2816        isMetaBoxLocationVisible
2817      } = select(store);
2818      return [get('core/edit-post', 'metaBoxesMainIsOpen'), get('core/edit-post', 'metaBoxesMainOpenHeight'), isMetaBoxLocationVisible('normal') || isMetaBoxLocationVisible('advanced') || isMetaBoxLocationVisible('side')];
2819    }, []);
2820    const {
2821      set: setPreference
2822    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store);
2823    const metaBoxesMainRef = (0,external_wp_element_namespaceObject.useRef)();
2824    const isShort = (0,external_wp_compose_namespaceObject.useMediaQuery)('(max-height: 549px)');
2825    const [{
2826      min,
2827      max
2828    }, setHeightConstraints] = (0,external_wp_element_namespaceObject.useState)(() => ({}));
2829    // Keeps the resizable area’s size constraints updated taking into account
2830    // editor notices. The constraints are also used to derive the value for the
2831    // aria-valuenow attribute on the separator.
2832    const effectSizeConstraints = (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
2833      const container = node.closest('.interface-interface-skeleton__content');
2834      const noticeLists = container.querySelectorAll(':scope > .components-notice-list');
2835      const resizeHandle = container.querySelector('.edit-post-meta-boxes-main__presenter');
2836      const deriveConstraints = () => {
2837        const fullHeight = container.offsetHeight;
2838        let nextMax = fullHeight;
2839        for (const element of noticeLists) {
2840          nextMax -= element.offsetHeight;
2841        }
2842        const nextMin = resizeHandle.offsetHeight;
2843        setHeightConstraints({
2844          min: nextMin,
2845          max: nextMax
2846        });
2847      };
2848      const observer = new window.ResizeObserver(deriveConstraints);
2849      observer.observe(container);
2850      for (const element of noticeLists) {
2851        observer.observe(element);
2852      }
2853      return () => observer.disconnect();
2854    }, []);
2855    const separatorRef = (0,external_wp_element_namespaceObject.useRef)();
2856    const separatorHelpId = (0,external_wp_element_namespaceObject.useId)();
2857    const [isUntouched, setIsUntouched] = (0,external_wp_element_namespaceObject.useState)(true);
2858    const applyHeight = (candidateHeight, isPersistent, isInstant) => {
2859      const nextHeight = Math.min(max, Math.max(min, candidateHeight));
2860      if (isPersistent) {
2861        setPreference('core/edit-post', 'metaBoxesMainOpenHeight', nextHeight);
2862      } else {
2863        separatorRef.current.ariaValueNow = getAriaValueNow(nextHeight);
2864      }
2865      if (isInstant) {
2866        metaBoxesMainRef.current.updateSize({
2867          height: nextHeight,
2868          // Oddly, when the event that triggered this was not from the mouse (e.g. keydown),
2869          // if `width` is left unspecified a subsequent drag gesture applies a fixed
2870          // width and the pane fails to widen/narrow with parent width changes from
2871          // sidebars opening/closing or window resizes.
2872          width: 'auto'
2873        });
2874      }
2875    };
2876    if (!hasAnyVisible) {
2877      return;
2878    }
2879    const contents = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
2880      // The class name 'edit-post-layout__metaboxes' is retained because some plugins use it.
2881      className: "edit-post-layout__metaboxes edit-post-meta-boxes-main__liner",
2882      hidden: isShort && !isOpen,
2883      children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, {
2884        location: "normal"
2885      }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, {
2886        location: "advanced"
2887      })]
2888    });
2889    const isAutoHeight = openHeight === undefined;
2890    let usedMax = '50%'; // Approximation before max has a value.
2891    if (max !== undefined) {
2892      // Halves the available max height until a user height is set.
2893      usedMax = isAutoHeight && isUntouched ? max / 2 : max;
2894    }
2895    const getAriaValueNow = height => Math.round((height - min) / (max - min) * 100);
2896    const usedAriaValueNow = max === undefined || isAutoHeight ? 50 : getAriaValueNow(openHeight);
2897    const toggle = () => setPreference('core/edit-post', 'metaBoxesMainIsOpen', !isOpen);
2898  
2899    // TODO: Support more/all keyboard interactions from the window splitter pattern:
2900    // https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/
2901    const onSeparatorKeyDown = event => {
2902      const delta = {
2903        ArrowUp: 20,
2904        ArrowDown: -20
2905      }[event.key];
2906      if (delta) {
2907        const pane = metaBoxesMainRef.current.resizable;
2908        const fromHeight = isAutoHeight ? pane.offsetHeight : openHeight;
2909        const nextHeight = delta + fromHeight;
2910        applyHeight(nextHeight, true, true);
2911        event.preventDefault();
2912      }
2913    };
2914    const className = 'edit-post-meta-boxes-main';
2915    const paneLabel = (0,external_wp_i18n_namespaceObject.__)('Meta Boxes');
2916    let Pane, paneProps;
2917    if (isShort) {
2918      Pane = NavigableRegion;
2919      paneProps = {
2920        className: dist_clsx(className, 'is-toggle-only')
2921      };
2922    } else {
2923      Pane = external_wp_components_namespaceObject.ResizableBox;
2924      paneProps = /** @type {Parameters<typeof ResizableBox>[0]} */{
2925        as: NavigableRegion,
2926        ref: metaBoxesMainRef,
2927        className: dist_clsx(className, 'is-resizable'),
2928        defaultSize: {
2929          height: openHeight
2930        },
2931        minHeight: min,
2932        maxHeight: usedMax,
2933        enable: {
2934          top: true,
2935          right: false,
2936          bottom: false,
2937          left: false,
2938          topLeft: false,
2939          topRight: false,
2940          bottomRight: false,
2941          bottomLeft: false
2942        },
2943        handleClasses: {
2944          top: 'edit-post-meta-boxes-main__presenter'
2945        },
2946        handleComponent: {
2947          top: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
2948            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, {
2949              text: (0,external_wp_i18n_namespaceObject.__)('Drag to resize'),
2950              children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", {
2951                // eslint-disable-line jsx-a11y/role-supports-aria-props
2952                ref: separatorRef,
2953                role: "separator" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role
2954                ,
2955                "aria-valuenow": usedAriaValueNow,
2956                "aria-label": (0,external_wp_i18n_namespaceObject.__)('Drag to resize'),
2957                "aria-describedby": separatorHelpId,
2958                onKeyDown: onSeparatorKeyDown
2959              })
2960            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, {
2961              id: separatorHelpId,
2962              children: (0,external_wp_i18n_namespaceObject.__)('Use up and down arrow keys to resize the meta box panel.')
2963            })]
2964          })
2965        },
2966        // Avoids hiccups while dragging over objects like iframes and ensures that
2967        // the event to end the drag is captured by the target (resize handle)
2968        // whether or not it’s under the pointer.
2969        onPointerDown: ({
2970          pointerId,
2971          target
2972        }) => {
2973          if (separatorRef.current.parentElement.contains(target)) {
2974            target.setPointerCapture(pointerId);
2975          }
2976        },
2977        onResizeStart: (event, direction, elementRef) => {
2978          if (isAutoHeight) {
2979            // Sets the starting height to avoid visual jumps in height and
2980            // aria-valuenow being `NaN` for the first (few) resize events.
2981            applyHeight(elementRef.offsetHeight, false, true);
2982            setIsUntouched(false);
2983          }
2984        },
2985        onResize: () => applyHeight(metaBoxesMainRef.current.state.height),
2986        onResizeStop: () => applyHeight(metaBoxesMainRef.current.state.height, true)
2987      };
2988    }
2989    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Pane, {
2990      "aria-label": paneLabel,
2991      ...paneProps,
2992      children: [isShort ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("button", {
2993        "aria-expanded": isOpen,
2994        className: "edit-post-meta-boxes-main__presenter",
2995        onClick: toggle,
2996        children: [paneLabel, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, {
2997          icon: isOpen ? chevron_up : chevron_down
2998        })]
2999      }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("meta", {
3000        ref: effectSizeConstraints
3001      }), contents]
3002    });
3003  }
3004  function Layout({
3005    postId: initialPostId,
3006    postType: initialPostType,
3007    settings,
3008    initialEdits
3009  }) {
3010    layout_useCommands();
3011    useCommands();
3012    const shouldIframe = useShouldIframe();
3013    const {
3014      createErrorNotice
3015    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
3016    const {
3017      currentPost: {
3018        postId: currentPostId,
3019        postType: currentPostType
3020      },
3021      onNavigateToEntityRecord,
3022      onNavigateToPreviousEntityRecord
3023    } = useNavigateToEntityRecord(initialPostId, initialPostType, 'post-only');
3024    const isEditingTemplate = currentPostType === 'wp_template';
3025    const {
3026      mode,
3027      isFullscreenActive,
3028      hasResolvedMode,
3029      hasActiveMetaboxes,
3030      hasBlockSelected,
3031      showIconLabels,
3032      isDistractionFree,
3033      showMetaBoxes,
3034      isWelcomeGuideVisible,
3035      templateId,
3036      enablePaddingAppender
3037    } = (0,external_wp_data_namespaceObject.useSelect)(select => {
3038      var _getPostType$viewable;
3039      const {
3040        get
3041      } = select(external_wp_preferences_namespaceObject.store);
3042      const {
3043        isFeatureActive,
3044        hasMetaBoxes
3045      } = select(store);
3046      const {
3047        canUser,
3048        getPostType,
3049        getTemplateId
3050      } = unlock(select(external_wp_coreData_namespaceObject.store));
3051      const supportsTemplateMode = settings.supportsTemplateMode;
3052      const isViewable = (_getPostType$viewable = getPostType(currentPostType)?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false;
3053      const canViewTemplate = canUser('read', {
3054        kind: 'postType',
3055        name: 'wp_template'
3056      });
3057      const {
3058        getBlockSelectionStart,
3059        isZoomOut
3060      } = unlock(select(external_wp_blockEditor_namespaceObject.store));
3061      const {
3062        getEditorMode,
3063        getRenderingMode,
3064        getDefaultRenderingMode
3065      } = unlock(select(external_wp_editor_namespaceObject.store));
3066      const isRenderingPostOnly = getRenderingMode() === 'post-only';
3067      const isNotDesignPostType = !DESIGN_POST_TYPES.includes(currentPostType);
3068      const isDirectlyEditingPattern = currentPostType === 'wp_block' && !onNavigateToPreviousEntityRecord;
3069      const _templateId = getTemplateId(currentPostType, currentPostId);
3070      const defaultMode = getDefaultRenderingMode(currentPostType);
3071      return {
3072        mode: getEditorMode(),
3073        isFullscreenActive: isFeatureActive('fullscreenMode'),
3074        hasActiveMetaboxes: hasMetaBoxes(),
3075        hasResolvedMode: defaultMode === 'template-locked' ? !!_templateId : defaultMode !== undefined,
3076        hasBlockSelected: !!getBlockSelectionStart(),
3077        showIconLabels: get('core', 'showIconLabels'),
3078        isDistractionFree: get('core', 'distractionFree'),
3079        showMetaBoxes: isNotDesignPostType && !isZoomOut() || isDirectlyEditingPattern,
3080        isWelcomeGuideVisible: isFeatureActive('welcomeGuide'),
3081        templateId: supportsTemplateMode && isViewable && canViewTemplate && !isEditingTemplate ? _templateId : null,
3082        enablePaddingAppender: !isZoomOut() && isRenderingPostOnly && isNotDesignPostType
3083      };
3084    }, [currentPostType, currentPostId, isEditingTemplate, settings.supportsTemplateMode, onNavigateToPreviousEntityRecord]);
3085    useMetaBoxInitialization(hasActiveMetaboxes && hasResolvedMode);
3086    const [paddingAppenderRef, paddingStyle] = usePaddingAppender(enablePaddingAppender);
3087  
3088    // Set the right context for the command palette
3089    const commandContext = hasBlockSelected ? 'block-selection-edit' : 'entity-edit';
3090    useCommandContext(commandContext);
3091    const editorSettings = (0,external_wp_element_namespaceObject.useMemo)(() => ({
3092      ...settings,
3093      onNavigateToEntityRecord,
3094      onNavigateToPreviousEntityRecord,
3095      defaultRenderingMode: 'post-only'
3096    }), [settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord]);
3097    const styles = useEditorStyles(paddingStyle);
3098  
3099    // We need to add the show-icon-labels class to the body element so it is applied to modals.
3100    if (showIconLabels) {
3101      document.body.classList.add('show-icon-labels');
3102    } else {
3103      document.body.classList.remove('show-icon-labels');
3104    }
3105    const navigateRegionsProps = (0,external_wp_components_namespaceObject.__unstableUseNavigateRegions)();
3106    const className = dist_clsx('edit-post-layout', 'is-mode-' + mode, {
3107      'has-metaboxes': hasActiveMetaboxes
3108    });
3109    function onPluginAreaError(name) {
3110      createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: plugin name */
3111      (0,external_wp_i18n_namespaceObject.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name));
3112    }
3113    const {
3114      createSuccessNotice
3115    } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
3116    const onActionPerformed = (0,external_wp_element_namespaceObject.useCallback)((actionId, items) => {
3117      switch (actionId) {
3118        case 'move-to-trash':
3119          {
3120            document.location.href = (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', {
3121              trashed: 1,
3122              post_type: items[0].type,
3123              ids: items[0].id
3124            });
3125          }
3126          break;
3127        case 'duplicate-post':
3128          {
3129            const newItem = items[0];
3130            const title = typeof newItem.title === 'string' ? newItem.title : newItem.title?.rendered;
3131            createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
3132            // translators: %s: Title of the created post or template, e.g: "Hello world".
3133            (0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)), {
3134              type: 'snackbar',
3135              id: 'duplicate-post-action',
3136              actions: [{
3137                label: (0,external_wp_i18n_namespaceObject.__)('Edit'),
3138                onClick: () => {
3139                  const postId = newItem.id;
3140                  document.location.href = (0,external_wp_url_namespaceObject.addQueryArgs)('post.php', {
3141                    post: postId,
3142                    action: 'edit'
3143                  });
3144                }
3145              }]
3146            });
3147          }
3148          break;
3149      }
3150    }, [createSuccessNotice]);
3151    const initialPost = (0,external_wp_element_namespaceObject.useMemo)(() => {
3152      return {
3153        type: initialPostType,
3154        id: initialPostId
3155      };
3156    }, [initialPostType, initialPostId]);
3157    const backButton = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium') && isFullscreenActive ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(back_button, {
3158      initialPost: initialPost
3159    }) : null;
3160    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SlotFillProvider, {
3161      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_editor_namespaceObject.ErrorBoundary, {
3162        canCopyContent: true,
3163        children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_commands_namespaceObject.CommandMenu, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuide, {
3164          postType: currentPostType
3165        }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
3166          className: navigateRegionsProps.className,
3167          ...navigateRegionsProps,
3168          ref: navigateRegionsProps.ref,
3169          children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Editor, {
3170            settings: editorSettings,
3171            initialEdits: initialEdits,
3172            postType: currentPostType,
3173            postId: currentPostId,
3174            templateId: templateId,
3175            className: className,
3176            styles: styles,
3177            forceIsDirty: hasActiveMetaboxes,
3178            contentRef: paddingAppenderRef,
3179            disableIframe: !shouldIframe
3180            // We should auto-focus the canvas (title) on load.
3181            // eslint-disable-next-line jsx-a11y/no-autofocus
3182            ,
3183            autoFocus: !isWelcomeGuideVisible,
3184            onActionPerformed: onActionPerformed,
3185            extraSidebarPanels: showMetaBoxes && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, {
3186              location: "side"
3187            }),
3188            extraContent: !isDistractionFree && showMetaBoxes && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxesMain, {}),
3189            children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PostLockedModal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorInitialization, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FullscreenMode, {
3190              isActive: isFullscreenActive
3191            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(browser_url, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.UnsavedChangesWarning, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.AutosaveMonitor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.LocalAutosaveMonitor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorKeyboardShortcutsRegister, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InitPatternModal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_plugins_namespaceObject.PluginArea, {
3192              onError: onPluginAreaError
3193            }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(more_menu, {}), backButton, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorSnackbars, {})]
3194          })
3195        })]
3196      })
3197    });
3198  }
3199  /* harmony default export */ const layout = (Layout);
3200  
3201  ;// ./node_modules/@wordpress/edit-post/build-module/deprecated.js
3202  /**
3203   * WordPress dependencies
3204   */
3205  
3206  
3207  
3208  
3209  /**
3210   * Internal dependencies
3211   */
3212  
3213  
3214  const {
3215    PluginPostExcerpt
3216  } = unlock(external_wp_editor_namespaceObject.privateApis);
3217  const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes('site-editor.php');
3218  const deprecateSlot = name => {
3219    external_wp_deprecated_default()(`wp.editPost.$name}`, {
3220      since: '6.6',
3221      alternative: `wp.editor.$name}`
3222    });
3223  };
3224  
3225  /* eslint-disable jsdoc/require-param */
3226  /**
3227   * @see PluginBlockSettingsMenuItem in @wordpress/editor package.
3228   */
3229  function PluginBlockSettingsMenuItem(props) {
3230    if (isSiteEditor) {
3231      return null;
3232    }
3233    deprecateSlot('PluginBlockSettingsMenuItem');
3234    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginBlockSettingsMenuItem, {
3235      ...props
3236    });
3237  }
3238  
3239  /**
3240   * @see PluginDocumentSettingPanel in @wordpress/editor package.
3241   */
3242  function PluginDocumentSettingPanel(props) {
3243    if (isSiteEditor) {
3244      return null;
3245    }
3246    deprecateSlot('PluginDocumentSettingPanel');
3247    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginDocumentSettingPanel, {
3248      ...props
3249    });
3250  }
3251  
3252  /**
3253   * @see PluginMoreMenuItem in @wordpress/editor package.
3254   */
3255  function PluginMoreMenuItem(props) {
3256    if (isSiteEditor) {
3257      return null;
3258    }
3259    deprecateSlot('PluginMoreMenuItem');
3260    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginMoreMenuItem, {
3261      ...props
3262    });
3263  }
3264  
3265  /**
3266   * @see PluginPrePublishPanel in @wordpress/editor package.
3267   */
3268  function PluginPrePublishPanel(props) {
3269    if (isSiteEditor) {
3270      return null;
3271    }
3272    deprecateSlot('PluginPrePublishPanel');
3273    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginPrePublishPanel, {
3274      ...props
3275    });
3276  }
3277  
3278  /**
3279   * @see PluginPostPublishPanel in @wordpress/editor package.
3280   */
3281  function PluginPostPublishPanel(props) {
3282    if (isSiteEditor) {
3283      return null;
3284    }
3285    deprecateSlot('PluginPostPublishPanel');
3286    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginPostPublishPanel, {
3287      ...props
3288    });
3289  }
3290  
3291  /**
3292   * @see PluginPostStatusInfo in @wordpress/editor package.
3293   */
3294  function PluginPostStatusInfo(props) {
3295    if (isSiteEditor) {
3296      return null;
3297    }
3298    deprecateSlot('PluginPostStatusInfo');
3299    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginPostStatusInfo, {
3300      ...props
3301    });
3302  }
3303  
3304  /**
3305   * @see PluginSidebar in @wordpress/editor package.
3306   */
3307  function PluginSidebar(props) {
3308    if (isSiteEditor) {
3309      return null;
3310    }
3311    deprecateSlot('PluginSidebar');
3312    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginSidebar, {
3313      ...props
3314    });
3315  }
3316  
3317  /**
3318   * @see PluginSidebarMoreMenuItem in @wordpress/editor package.
3319   */
3320  function PluginSidebarMoreMenuItem(props) {
3321    if (isSiteEditor) {
3322      return null;
3323    }
3324    deprecateSlot('PluginSidebarMoreMenuItem');
3325    return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginSidebarMoreMenuItem, {
3326      ...props
3327    });
3328  }
3329  
3330  /**
3331   * @see PluginPostExcerpt in @wordpress/editor package.
3332   */
3333  function __experimentalPluginPostExcerpt() {
3334    if (isSiteEditor) {
3335      return null;
3336    }
3337    external_wp_deprecated_default()('wp.editPost.__experimentalPluginPostExcerpt', {
3338      since: '6.6',
3339      hint: 'Core and custom panels can be access programmatically using their panel name.',
3340      link: 'https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically'
3341    });
3342    return PluginPostExcerpt;
3343  }
3344  
3345  /* eslint-enable jsdoc/require-param */
3346  
3347  ;// ./node_modules/@wordpress/edit-post/build-module/index.js
3348  /**
3349   * WordPress dependencies
3350   */
3351  
3352  
3353  
3354  
3355  
3356  
3357  
3358  
3359  
3360  /**
3361   * Internal dependencies
3362   */
3363  
3364  
3365  
3366  const {
3367    BackButton: __experimentalMainDashboardButton,
3368    registerCoreBlockBindingsSources
3369  } = unlock(external_wp_editor_namespaceObject.privateApis);
3370  
3371  /**
3372   * Initializes and returns an instance of Editor.
3373   *
3374   * @param {string}  id           Unique identifier for editor instance.
3375   * @param {string}  postType     Post type of the post to edit.
3376   * @param {Object}  postId       ID of the post to edit.
3377   * @param {?Object} settings     Editor settings object.
3378   * @param {Object}  initialEdits Programmatic edits to apply initially, to be
3379   *                               considered as non-user-initiated (bypass for
3380   *                               unsaved changes prompt).
3381   */
3382  function initializeEditor(id, postType, postId, settings, initialEdits) {
3383    const isMediumOrBigger = window.matchMedia('(min-width: 782px)').matches;
3384    const target = document.getElementById(id);
3385    const root = (0,external_wp_element_namespaceObject.createRoot)(target);
3386    (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core/edit-post', {
3387      fullscreenMode: true,
3388      themeStyles: true,
3389      welcomeGuide: true,
3390      welcomeGuideTemplate: true
3391    });
3392    (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core', {
3393      allowRightClickOverrides: true,
3394      editorMode: 'visual',
3395      editorTool: 'edit',
3396      fixedToolbar: false,
3397      hiddenBlockTypes: [],
3398      inactivePanels: [],
3399      openPanels: ['post-status'],
3400      showBlockBreadcrumbs: true,
3401      showIconLabels: false,
3402      showListViewByDefault: false,
3403      enableChoosePatternModal: true,
3404      isPublishSidebarEnabled: true
3405    });
3406    if (window.__experimentalMediaProcessing) {
3407      (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core/media', {
3408        requireApproval: true,
3409        optimizeOnUpload: true
3410      });
3411    }
3412    (0,external_wp_data_namespaceObject.dispatch)(external_wp_blocks_namespaceObject.store).reapplyBlockTypeFilters();
3413  
3414    // Check if the block list view should be open by default.
3415    // If `distractionFree` mode is enabled, the block list view should not be open.
3416    // This behavior is disabled for small viewports.
3417    if (isMediumOrBigger && (0,external_wp_data_namespaceObject.select)(external_wp_preferences_namespaceObject.store).get('core', 'showListViewByDefault') && !(0,external_wp_data_namespaceObject.select)(external_wp_preferences_namespaceObject.store).get('core', 'distractionFree')) {
3418      (0,external_wp_data_namespaceObject.dispatch)(external_wp_editor_namespaceObject.store).setIsListViewOpened(true);
3419    }
3420    (0,external_wp_blockLibrary_namespaceObject.registerCoreBlocks)();
3421    registerCoreBlockBindingsSources();
3422    (0,external_wp_widgets_namespaceObject.registerLegacyWidgetBlock)({
3423      inserter: false
3424    });
3425    (0,external_wp_widgets_namespaceObject.registerWidgetGroupBlock)({
3426      inserter: false
3427    });
3428    if (false) {}
3429  
3430    // Show a console log warning if the browser is not in Standards rendering mode.
3431    const documentMode = document.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';
3432    if (documentMode !== 'Standards') {
3433      // eslint-disable-next-line no-console
3434      console.warn("Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.");
3435    }
3436  
3437    // This is a temporary fix for a couple of issues specific to Webkit on iOS.
3438    // Without this hack the browser scrolls the mobile toolbar off-screen.
3439    // Once supported in Safari we can replace this in favor of preventScroll.
3440    // For details see issue #18632 and PR #18686
3441    // Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.
3442    // But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.
3443  
3444    const isIphone = window.navigator.userAgent.indexOf('iPhone') !== -1;
3445    if (isIphone) {
3446      window.addEventListener('scroll', event => {
3447        const editorScrollContainer = document.getElementsByClassName('interface-interface-skeleton__body')[0];
3448        if (event.target === document) {
3449          // Scroll element into view by scrolling the editor container by the same amount
3450          // that Mobile Safari tried to scroll the html element upwards.
3451          if (window.scrollY > 100) {
3452            editorScrollContainer.scrollTop = editorScrollContainer.scrollTop + window.scrollY;
3453          }
3454          // Undo unwanted scroll on html element, but only in the visual editor.
3455          if (document.getElementsByClassName('is-mode-visual')[0]) {
3456            window.scrollTo(0, 0);
3457          }
3458        }
3459      });
3460    }
3461  
3462    // Prevent the default browser action for files dropped outside of dropzones.
3463    window.addEventListener('dragover', e => e.preventDefault(), false);
3464    window.addEventListener('drop', e => e.preventDefault(), false);
3465    root.render(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, {
3466      children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layout, {
3467        settings: settings,
3468        postId: postId,
3469        postType: postType,
3470        initialEdits: initialEdits
3471      })
3472    }));
3473    return root;
3474  }
3475  
3476  /**
3477   * Used to reinitialize the editor after an error. Now it's a deprecated noop function.
3478   */
3479  function reinitializeEditor() {
3480    external_wp_deprecated_default()('wp.editPost.reinitializeEditor', {
3481      since: '6.2',
3482      version: '6.3'
3483    });
3484  }
3485  
3486  
3487  
3488  
3489  
3490  (window.wp = window.wp || {}).editPost = __webpack_exports__;
3491  /******/ })()
3492  ;


Generated : Thu Apr 3 08:20:01 2025 Cross-referenced by PHPXref