import o, { useEffect as S, useState as d } from "react";
import { useOAuthStore as A } from "./state/oAuthStore.es.js";
import { Uploader as E } from "./components/Uploader/Uploader.es.js";
import "./model/Brand/LibraryIconMap.es.js";
import "./state/uploaderStore.es.js";
import "./components/MenuEntries/MenuEntries.es2.js";
import "./components/Image/Image.es2.js";
import "./components/ImageGallery/ImageGallery.es2.js";
import w from "./node_modules/zustand/esm/shallow.es.js";
import "./components/BrandDropdown/BrandDropdown.es2.js";
import "./components/DestinationDashboard/DestinationDashboard.es2.js";
import { useAssetUploadStore as U } from "./state/assetUploadStore.es.js";
import "./node_modules/@frontify/frontify-authenticator/dist/index.es.es.js";
import "./components/Authentication/Authentication.es2.js";
import "./node_modules/@frontify/fondue/dist/styles.es.js";
const D = ({
  onCancel: s,
  onError: i = (t) => console.log(t),
  onSuccess: r = (t) => console.log(t),
  autoClose: m = !0,
  images: p,
  clientId: c,
  domain: l,
  enableImageGallery: u
}) => {
  const { setAuth: t } = A((e) => ({ setAuth: e.setAuth })), { setOnError: a, setOnSuccess: f } = U(
    (e) => ({
      setOnError: e.setOnError,
      setOnSuccess: e.setOnSuccess
    }),
    w
  );
  S(() => {
    t(c, l), a(i), f(r);
  }, []);
  const [g, n] = d(!0), h = () => {
    m && n(!1), s && s();
  }, O = (e) => {
    m && n(!1), r && r(e);
  };
  return g ? /* @__PURE__ */ o.createElement(E, {
    imageAssets: p,
    onCancel: h,
    onSuccess: O,
    showImageGallery: u
  }) : /* @__PURE__ */ o.createElement(o.Fragment, null);
};
export {
  D as FrontifyUploader
};
//# sourceMappingURL=FrontifyUploader.es.js.map
