import { createContext, useContext } from 'react';
import Button from './components/buttons/Button';
import { TOKENS } from './container-api';
import { DispatchAction } from './contexts/reducers/store';
import OnboardingStack from './navigators/OnboardingStack';
import Developer from './screens/Developer';
import Onboarding from './screens/Onboarding';
import Preface from './screens/Preface';
import ScreenTerms from './screens/Terms';
import { Screens } from './types/navigators';
export class MainContainer {
  static TOKENS = TOKENS;
  constructor(container) {
    this.container = container;
  }
  init() {
    // eslint-disable-next-line no-console
    console.log(`Initializing Bifold container`);
    this.container.registerInstance(TOKENS.SCREEN_PREFACE, Preface);
    this.container.registerInstance(TOKENS.SCREEN_DEVELOPER, Developer);
    this.container.registerInstance(TOKENS.SCREEN_TERMS, ScreenTerms);
    this.container.registerInstance(TOKENS.SCREEN_ONBOARDING, Onboarding);
    this.container.registerInstance(TOKENS.STACK_ONBOARDING, OnboardingStack);
    this.container.registerInstance(TOKENS.COMP_BUTTON, Button);
    this.container.registerInstance(TOKENS.FN_ONBOARDING_DONE, (dispatch, navigation) => {
      return () => {
        dispatch({
          type: DispatchAction.DID_COMPLETE_TUTORIAL
        });
        navigation.navigate(Screens.Terms);
      };
    });
    return this;
  }
  resolve(token) {
    // eslint-disable-next-line no-console
    console.log(`resolving ${token}`);
    return this.container.resolve(token);
  }
  getContainer() {
    return this.container;
  }
}
export const SystemContext = /*#__PURE__*/createContext(undefined);
export const SystemProvider = SystemContext.Provider;

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
export const useSystem = () => useContext(SystemContext);
//# sourceMappingURL=container-impl.js.map