text: import { jsx as _jsx } from "react/jsx-runtime";
  import { createContext, useCallback, useContext, useLayoutEffect, useState } from 'react';
  import { useItem } from './ItemContext';
  const StepSetHasInputsContext = createContext(() => null);
  export const useSetStepHasInputs = () => useContext(StepSetHasInputsContext);
  export const StepHasInputsContext = createContext({});
  export const useStepHasInputs = () => useContext(StepHasInputsContext);
  export function StepHasInputsProvider(props) {
      const item = useItem();
      const [hasStepInputss, setHasStepInputsState] = useState({});
      const [setHasInputs, setHasInputsFunction] = useState(() => () => null);
      const validateSteps = useCallback(() => {
          setHasStepInputsState({});
          setHasInputsFunction(() => (id, has) => {
              setHasStepInputsState((state) => {
                  if (has && state[id] !== true) {
                      state = { ...state };
                      state[id] = true;
                  }
                  else if (!has && state[id] !== undefined) {
                      state = { ...state };
                      delete state[id];
                  }
                  return state;
              });
          });
      }, []);
      useLayoutEffect(() => validateSteps(), [item, validateSteps]);
      return (_jsx(StepSetHasInputsContext.Provider, { value: setHasInputs, children: _jsx(StepHasInputsContext.Provider, { value: hasStepInputss, children: props.children }, void 0) }, void 0));
  }
  //# sourceMappingURL=StepHasInputsProvider.js.map