"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _reactNative = require("react-native");
var _vectorIcons = require("@expo/vector-icons");
var _GroupedPillButtons = _interopRequireDefault(require("../../components/internal/GroupedPillButtons"));
var _useI18n = require("../../hooks/useI18n");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const SignUpSummaryStep = ({
  colors,
  styles,
  nextStep,
  prevStep,
  allStepData,
  isLoading
}) => {
  const {
    t
  } = (0, _useI18n.useI18n)();
  // Extract data from previous steps
  const identityData = allStepData[1] || {}; // Step 2 (index 1)
  const securityData = allStepData[2] || {}; // Step 3 (index 2)

  const {
    username = '',
    email = ''
  } = identityData;
  const {
    password = ''
  } = securityData;

  // Check if all required data is available
  const hasValidData = username && email && password;
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
    children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
      style: styles.modernHeader,
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
        style: [styles.modernTitle, {
          color: colors.text
        }],
        children: t('signup.summary.title')
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
        style: [styles.modernSubtitle, {
          color: colors.secondaryText
        }],
        children: t('signup.summary.subtitle')
      })]
    }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
      style: [styles.modernInputContainer, {
        marginBottom: 32
      }],
      children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
        style: {
          backgroundColor: colors.inputBackground,
          borderRadius: 16,
          padding: 20,
          borderWidth: 1,
          borderColor: colors.border
        },
        children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
          style: {
            flexDirection: 'row',
            alignItems: 'center',
            marginBottom: 16
          },
          children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
            name: "person-outline",
            size: 20,
            color: colors.secondaryText,
            style: {
              marginRight: 12
            }
          }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
            style: {
              flex: 1
            },
            children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
              style: [styles.footerText, {
                color: colors.secondaryText,
                fontSize: 12,
                marginBottom: 4
              }],
              children: "Username"
            }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
              style: [styles.modernInput, {
                color: colors.text,
                fontSize: 16
              }],
              children: ["@", username || 'Not set']
            })]
          })]
        }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
          style: {
            flexDirection: 'row',
            alignItems: 'center'
          },
          children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
            name: "mail-outline",
            size: 20,
            color: colors.secondaryText,
            style: {
              marginRight: 12
            }
          }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
            style: {
              flex: 1
            },
            children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
              style: [styles.footerText, {
                color: colors.secondaryText,
                fontSize: 12,
                marginBottom: 4
              }],
              children: "Email"
            }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
              style: [styles.modernInput, {
                color: colors.text,
                fontSize: 16
              }],
              children: email || 'Not set'
            })]
          })]
        })]
      }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
        style: {
          flexDirection: 'row',
          alignItems: 'center',
          marginTop: 16,
          padding: 12,
          backgroundColor: colors.warning + '10',
          borderRadius: 8,
          borderWidth: 1,
          borderColor: colors.warning + '30'
        },
        children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
          name: "shield-checkmark",
          size: 20,
          color: colors.warning,
          style: {
            marginRight: 8
          }
        }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
          style: [styles.footerText, {
            color: colors.warning,
            fontSize: 14,
            flex: 1
          }],
          children: "For stronger security, we recommend enabling Two\u2011Factor Authentication (TOTP) from Account Settings after you create your account."
        })]
      }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
        style: {
          flexDirection: 'row',
          alignItems: 'center',
          marginTop: 16,
          padding: 12,
          backgroundColor: colors.success + '10',
          borderRadius: 8,
          borderWidth: 1,
          borderColor: colors.success + '30'
        },
        children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
          name: "checkmark-circle",
          size: 20,
          color: colors.success,
          style: {
            marginRight: 8
          }
        }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
          style: [styles.footerText, {
            color: colors.success,
            fontSize: 14,
            flex: 1
          }],
          children: "By creating an account, you agree to our Terms of Service and Privacy Policy"
        })]
      })]
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GroupedPillButtons.default, {
      buttons: [{
        text: t('common.actions.back'),
        onPress: prevStep,
        icon: 'arrow-back',
        variant: 'transparent'
      }, {
        text: t('common.actions.createAccount'),
        onPress: nextStep,
        icon: 'checkmark-circle',
        variant: 'primary',
        loading: isLoading,
        disabled: !hasValidData
      }],
      colors: colors
    })]
  });
};
var _default = exports.default = SignUpSummaryStep;
//# sourceMappingURL=SignUpSummaryStep.js.map