"use strict";

exports.__esModule = true;
exports.useCreatePickerModal = useCreatePickerModal;
exports.usePickerModal = usePickerModal;
var _hooks = require("../hooks");
var _bexCore = require("@wix/bex-core");
var _react = require("@wix/fe-essentials/react");
var _react2 = require("react");
function useCreatePickerModal() {
  const {
    errorMonitor,
    environment,
    biLoggerFactory
  } = (0, _react.useEssentials)();
  const createPickerModalBase = (0, _hooks.useCreatePickerModal)();
  return (0, _react2.useCallback)(params => createPickerModalBase({
    errorMonitor,
    biLoggerFactory,
    ...params,
    environment: (0, _bexCore.wixPatternsEnvironment)({
      ...environment,
      ...(params == null ? void 0 : params.environment)
    })
  }), []);
}
function usePickerModal(params) {
  const createPickerModal = useCreatePickerModal();
  const [state] = (0, _react2.useState)(() => createPickerModal(params));
  (0, _hooks.useSyncPickerModalProps)(state, params);
  return state;
}
//# sourceMappingURL=usePickerModal.js.map