import React from 'react';
import useEngineContext from "../../../hooks/useEngineContext";
import Button from "../../button";
import "./index.less";
var Guest = function Guest(props) {
  var _utils$translation, _utils$translation2, _utils$translation3, _utils$translation4, _utils$translation5, _setting$titleConfig, _utils$translation6, _setting$subtitleConf, _utils$translation7, _setting$buttonConfig, _utils$translation8, _setting$buttonConfig2;
  var setting = props.setting;
  var context = useEngineContext();
  var _ref = context.appHelper || {},
    utils = _ref.utils;
  /**
   * @title: 拉起登录
   * @description:
   * @return {*}
   * @Author: WangHan
   * @Date: 2025-03-13 15:34
   */
  var goLogin = function goLogin() {
    console.log(utils, 'wh978796');
    utils === null || utils === void 0 || utils.action({
      type: 'pisell1.login',
      data: {},
      callback: function callback(status) {
        console.log(status, 'wh978796');
        if (status === 'success') {}
      }
    });
  };

  /**
   * @title: 样式处理
   * @description:
   * @param {any} config
   * @return {*}
   * @Author: WangHan
   * @Date: 2025-03-13 15:39
   */
  var getTextStyle = function getTextStyle(config, otherConfig) {
    return {
      color: (config === null || config === void 0 ? void 0 : config.color) || (otherConfig === null || otherConfig === void 0 ? void 0 : otherConfig.color) || '#fff',
      fontSize: (config === null || config === void 0 ? void 0 : config.size) || (otherConfig === null || otherConfig === void 0 ? void 0 : otherConfig.size) || 14,
      fontWeight: (config === null || config === void 0 ? void 0 : config.weight) || (otherConfig === null || otherConfig === void 0 ? void 0 : otherConfig.weight) || 400,
      fontStyle: (config === null || config === void 0 ? void 0 : config.style) || 'normal'
    };
  };
  return /*#__PURE__*/React.createElement("div", {
    className: "pisell-wallet-guest-wrap",
    style: {
      backgroundColor: setting === null || setting === void 0 ? void 0 : setting.backgroundColor
    }
  }, utils !== null && utils !== void 0 && (_utils$translation = utils.translation) !== null && _utils$translation !== void 0 && _utils$translation.call(utils, setting === null || setting === void 0 ? void 0 : setting.backgroundImage) ? /*#__PURE__*/React.createElement("img", {
    className: "pisell-wallet-guest-bg",
    src: (utils === null || utils === void 0 || (_utils$translation2 = utils.translation) === null || _utils$translation2 === void 0 ? void 0 : _utils$translation2.call(utils, setting.backgroundImage)) || '',
    alt: (utils === null || utils === void 0 || (_utils$translation3 = utils.translation) === null || _utils$translation3 === void 0 ? void 0 : _utils$translation3.call(utils, setting === null || setting === void 0 ? void 0 : setting.backgroundImageAlt)) || '',
    title: (utils === null || utils === void 0 || (_utils$translation4 = utils.translation) === null || _utils$translation4 === void 0 ? void 0 : _utils$translation4.call(utils, setting === null || setting === void 0 ? void 0 : setting.backgroundImageAlt)) || ''
  }) : null, /*#__PURE__*/React.createElement("div", {
    className: "pisell-wallet-guest-content ".concat(setting.align === 'center' ? 'pisell-wallet-guest-center' : '')
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
    className: "pisell-wallet-guest-title",
    style: getTextStyle(setting === null || setting === void 0 ? void 0 : setting.titleConfig, {
      size: 18,
      weight: 600
    })
  }, (utils === null || utils === void 0 || (_utils$translation5 = utils.translation) === null || _utils$translation5 === void 0 ? void 0 : _utils$translation5.call(utils, (setting === null || setting === void 0 ? void 0 : setting.title) || (setting === null || setting === void 0 || (_setting$titleConfig = setting.titleConfig) === null || _setting$titleConfig === void 0 ? void 0 : _setting$titleConfig.text))) || ''), /*#__PURE__*/React.createElement("div", {
    className: "pisell-wallet-guest-subtitle",
    style: getTextStyle(setting === null || setting === void 0 ? void 0 : setting.subtitleConfig, {
      color: '#D0D5DD'
    })
  }, (utils === null || utils === void 0 || (_utils$translation6 = utils.translation) === null || _utils$translation6 === void 0 ? void 0 : _utils$translation6.call(utils, (setting === null || setting === void 0 ? void 0 : setting.subtitle) || (setting === null || setting === void 0 || (_setting$subtitleConf = setting.subtitleConfig) === null || _setting$subtitleConf === void 0 ? void 0 : _setting$subtitleConf.text))) || '')), utils !== null && utils !== void 0 && (_utils$translation7 = utils.translation) !== null && _utils$translation7 !== void 0 && _utils$translation7.call(utils, (setting === null || setting === void 0 ? void 0 : setting.buttonText) || (setting === null || setting === void 0 || (_setting$buttonConfig = setting.buttonConfig) === null || _setting$buttonConfig === void 0 ? void 0 : _setting$buttonConfig.text)) ? /*#__PURE__*/React.createElement("div", {
    className: "pisell-wallet-guest-button-wrap"
  }, /*#__PURE__*/React.createElement(Button, {
    style: {
      backgroundColor: (setting === null || setting === void 0 ? void 0 : setting.buttonColor) || '#7F56D9',
      borderColor: (setting === null || setting === void 0 ? void 0 : setting.buttonBorderColor) || '#7F56D9'
    },
    onClick: goLogin
  }, /*#__PURE__*/React.createElement("div", {
    style: getTextStyle(setting === null || setting === void 0 ? void 0 : setting.buttonConfig, {
      weight: 600
    })
  }, (utils === null || utils === void 0 || (_utils$translation8 = utils.translation) === null || _utils$translation8 === void 0 ? void 0 : _utils$translation8.call(utils, (setting === null || setting === void 0 ? void 0 : setting.buttonText) || (setting === null || setting === void 0 || (_setting$buttonConfig2 = setting.buttonConfig) === null || _setting$buttonConfig2 === void 0 ? void 0 : _setting$buttonConfig2.text))) || ''))) : null));
};
export default Guest;