"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const reactBinding = require("@contember/react-binding");
const useOnPersistSuccess = require("../useOnPersistSuccess.cjs");
const NotFoundBoundary = require("./NotFoundBoundary.cjs");
const scopeComponent = require("./scopeComponent.cjs");
const FeedbackRenderer = require("../../bindingFacade/renderers/FeedbackRenderer.cjs");
const EditScope = scopeComponent.scopeComponent(
  ({
    children,
    onPersistSuccess,
    redirectOnSuccess,
    refreshDataBindingOnPersist,
    skipBindingStateUpdateAfterPersist,
    stateComponent,
    stateProps,
    ...entityProps
  }) => /* @__PURE__ */ jsxRuntime.jsx(
    reactBinding.DataBindingProvider,
    {
      refreshOnPersist: refreshDataBindingOnPersist ?? true,
      stateComponent: stateComponent ?? FeedbackRenderer.FeedbackRenderer,
      stateProps,
      skipStateUpdateAfterPersist: skipBindingStateUpdateAfterPersist,
      children: /* @__PURE__ */ jsxRuntime.jsx(reactBinding.EntitySubTree, { ...entityProps, onPersistSuccess: useOnPersistSuccess.useOnPersistSuccess({ redirectOnSuccess, onPersistSuccess }), children: /* @__PURE__ */ jsxRuntime.jsx(NotFoundBoundary.NotFoundBoundary, { children }) })
    }
  ),
  "EditScope"
);
exports.EditScope = EditScope;
//# sourceMappingURL=EditScope.cjs.map
