/**
 * Generated by a build script. Do not modify.
 * Check orginal .jsx file.
 */
/* eslint-disable */

((DrupalGutenberg2) => {
  const { MediaBrowser } = DrupalGutenberg2.Components;
  const withGutenbergDialog = (Component) => {
    const onDialogCreate = () => {
    };
    const getDialog = ({ allowedTypes, onSelect }) => new Promise((resolve) => {
      resolve({
        component: (props) => /* @__PURE__ */ React.createElement(
          MediaBrowser,
          {
            ...props,
            allowedTypes,
            value: [],
            onSelect: (media) => {
              props.onSelect(props.multiple ? media : media[0]);
              onSelect();
            }
          }
        )
      });
    });
    return (props) => /* @__PURE__ */ React.createElement(
      Component,
      {
        ...props,
        onDialogCreate,
        getDialog
      }
    );
  };
  window.DrupalGutenberg = window.DrupalGutenberg || {};
  window.DrupalGutenberg.Components = window.DrupalGutenberg.Components || {};
  window.DrupalGutenberg.Components.withGutenbergDialog = withGutenbergDialog;
})(DrupalGutenberg);
