import { j as jsxRuntimeExports } from "./doenetml-cB_aZGJ5.js";
import React__default from "react";
import { u as useDoenetRenderer } from "./useDoenetRenderer-DN3Z9CW3.js";
import { a as addCommasForCompositeRanges } from "./composites-DgtFnuE1.js";
import { c as calculateValidationState, a as createCheckWorkComponent } from "./checkWork-D9syAFsW.js";
const containerInline = React__default.memo(function ContainerInline(props) {
  let { id, SVs, children, actions, callAction } = useDoenetRenderer(props);
  if (SVs.hidden) {
    return null;
  }
  let checkWorkComponent = null;
  if (actions.submitAllAnswers) {
    const submitAllAnswers = () => callAction({
      action: actions.submitAllAnswers
    });
    const validationState = calculateValidationState(SVs);
    checkWorkComponent = createCheckWorkComponent(
      SVs,
      id,
      validationState,
      submitAllAnswers,
      true
    );
  }
  if (SVs._compositeReplacementActiveRange) {
    children = addCommasForCompositeRanges({
      children,
      compositeReplacementActiveRange: SVs._compositeReplacementActiveRange,
      startInd: 0,
      endInd: children.length - 1
    });
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { id, children: [
    children,
    checkWorkComponent
  ] });
});
export {
  containerInline as default
};
