"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _novaIcons = require("@coorpacademy/nova-icons");
var _templateContext = require("../../template/app-review/template-context");
var _index = _interopRequireDefault(require("../../hoc/touchable/index.native"));
var _index2 = _interopRequireDefault(require("../html/index.native"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
const createStyleSheet = (brandTheme, theme) => _reactNative.StyleSheet.create({
  container: {
    backgroundColor: theme.colors.white,
    justifyContent: 'space-between',
    flex: 1,
    padding: 20,
    paddingTop: 20,
    paddingBottom: 100
  },
  title: {
    height: 72,
    width: 268,
    fontSize: theme.fontSize.xxlarge,
    fontWeight: theme.fontWeight.bold,
    lineHeight: 36,
    color: theme.colors.text.primary,
    marginBottom: 32
  },
  textContainer: {
    marginTop: 8
  },
  text: {
    fontSize: theme.fontSize.large,
    color: theme.colors.text.primary,
    opacity: 0.7
  },
  tips: {
    marginTop: 32,
    height: 230,
    justifyContent: 'center'
  },
  tip: {
    flexDirection: 'row',
    overflow: 'hidden',
    alignItems: 'center',
    height: 54,
    borderRadius: 8,
    backgroundColor: theme.colors.gray.extra,
    marginTop: theme.spacing.micro,
    marginBottom: theme.spacing.micro
  },
  tipText: {
    fontSize: 16,
    lineHeight: 22,
    color: theme.colors.text.primary
  },
  icon: {
    margin: 10
  },
  button: {
    height: 52,
    borderRadius: 7,
    marginBottom: 32,
    marginTop: 16,
    backgroundColor: brandTheme?.colors?.primary || theme.colors.cta,
    justifyContent: 'center'
  },
  buttonText: {
    alignSelf: 'center',
    fontWeight: theme.fontWeight.bold,
    fontSize: theme.fontSize.large,
    color: '#fff'
  }
});
const Tip = props => {
  const templateContext = (0, _templateContext.useTemplateContext)();
  const [styleSheet, setStylesheet] = (0, _react.useState)(null);
  const {
    brandTheme,
    theme
  } = templateContext;
  const {
    Icon,
    text
  } = props;
  (0, _react.useEffect)(() => {
    const _stylesheet = createStyleSheet(brandTheme, theme);
    setStylesheet(_stylesheet);
  }, [brandTheme, theme]);
  if (!styleSheet) {
    return null;
  }
  return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
    style: styleSheet.tip
  }, /*#__PURE__*/_react.default.createElement(Icon, {
    height: 16,
    width: 16,
    style: styleSheet.icon,
    color: theme.colors.text.primary
  }), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
    style: styleSheet.tipText
  }, text));
};
const Onboarding = props => {
  const templateContext = (0, _templateContext.useTemplateContext)();
  const [styleSheet, setStylesheet] = (0, _react.useState)(null);
  const {
    brandTheme,
    theme,
    translations
  } = templateContext;
  const {
    onPress
  } = props;
  (0, _react.useEffect)(() => {
    const _stylesheet = createStyleSheet(brandTheme, theme);
    setStylesheet(_stylesheet);
  }, [brandTheme, theme]);

  // ------------------------------------

  if (!styleSheet) {
    return null;
  }
  return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
    style: styleSheet.container
  }, /*#__PURE__*/_react.default.createElement(_index2.default, {
    style: styleSheet.title
  }, translations.appReview.presentation.title), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
    style: styleSheet.textContainer
  }, /*#__PURE__*/_react.default.createElement(_index2.default, {
    style: styleSheet.text
  }, translations.appReview.presentation.text)), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
    style: styleSheet.tips
  }, /*#__PURE__*/_react.default.createElement(Tip, {
    Icon: _novaIcons.NovaLineSelectionCursorsCursorArrowTarget,
    text: translations.appReview.presentation.labelList.skills.text
  }), /*#__PURE__*/_react.default.createElement(Tip, {
    Icon: _novaIcons.NovaSolidInterfaceFeedbackInterfaceQuestionMark,
    text: translations.appReview.presentation.labelList.questions.text
  }), /*#__PURE__*/_react.default.createElement(Tip, {
    Icon: _novaIcons.NovaCompositionCoorpacademyVoteHeartOutline,
    text: translations.appReview.presentation.labelList.lifes.text
  }), /*#__PURE__*/_react.default.createElement(Tip, {
    Icon: _novaIcons.NovaSolidStatusCheckCircle2,
    text: translations.appReview.presentation.labelList.allright.text
  })), /*#__PURE__*/_react.default.createElement(_index.default, {
    testID: "button-quit-revision-onboarding",
    onPress: onPress,
    analyticsID: "button-start",
    style: styleSheet.button
  }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
    style: styleSheet.buttonText
  }, translations.ok)));
};
var _default = exports.default = Onboarding;
//# sourceMappingURL=index.native.js.map