"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _index = _interopRequireDefault(require("../../../organism/review-stacked-slides/index.native"));
var _index2 = _interopRequireDefault(require("../../../organism/review-congrats/index.native"));
var _index3 = _interopRequireDefault(require("../../../organism/review-header/index.native"));
var _index4 = _interopRequireDefault(require("../../../molecule/cm-popin/index.native"));
var _templateContext = require("../template-context");
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 = theme => _reactNative.StyleSheet.create({
  container: {
    flex: 1,
    width: '100%',
    height: '100%',
    backgroundColor: theme.colors.white,
    flexDirection: 'column',
    justifyContent: 'space-between',
    alignItems: 'center'
  },
  backgroundImage: {
    position: 'absolute',
    top: 0,
    bottom: 0,
    left: 0,
    right: 0,
    width: '100%',
    height: '100%'
  }
});
const Slides = props => {
  const {
    congrats,
    header,
    stack,
    quitPopin,
    backgroundImage
  } = props;
  const {
    theme
  } = (0, _templateContext.useTemplateContext)();
  const [styleSheet, setStylesheet] = (0, _react.useState)(null);
  (0, _react.useEffect)(() => {
    const _stylesheet = createStyleSheet(theme);
    setStylesheet(_stylesheet);
  }, [theme]);
  if (!styleSheet) {
    return null;
  }
  const source = backgroundImage;
  return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
    style: styleSheet.container
  }, /*#__PURE__*/_react.default.createElement(_reactNative.ImageBackground, {
    style: styleSheet.backgroundImage,
    source: source,
    resizeMode: "cover"
  }), /*#__PURE__*/_react.default.createElement(_index3.default, header), stack ? /*#__PURE__*/_react.default.createElement(_index.default, stack) : null, congrats ? /*#__PURE__*/_react.default.createElement(_index2.default, congrats) : null, quitPopin ? /*#__PURE__*/_react.default.createElement(_index4.default, quitPopin) : null);
};
var _default = exports.default = Slides;
//# sourceMappingURL=index.native.js.map