import { useProp, useEffect, useEvent, h } from 'atomico';
import './aync-hook.js';
import 'funfix';
import { useDocumentTitleHook } from './use-document-title-hook.js';
import { g as getComponentOrDefine } from './chunks/65ef80fe.js';
import './horse-button-comp.js';
import './kun-icon.js';
import './chunks/a234fa33.js';
import './horse-download-box.js';
import '@caedman/kit/dist/use-stylesheet';
import 'lazyload-image';
import './kun-image.js';
import './chunks/19492529.js';
import './chunks/237ddcfd.js';
import { R as ROUTES } from './chunks/ee2fcfaa.js';
import './kun-upload-file.js';

const _jsxFileName = "/Users/rang/rang/frond_ng/packages/six/src/components/login-component/login-component.tsx";
const loginBoxstyle = `
.fixed-left-top {
  position: fixed;
  top: 10px;
  left: 15px;
}

.needle-item {
  margin-right: 10px;
}
.needle-items {
  display: flex;
  justify-content: center;
  flex-direction: row;
}
.wechat-img {
  width: 268px;
  height: 265px;
  padding: 26px
}

.login-box-flat {
  width: 400px;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  background:rgba(255,255,255,1);
}

.login-box {
  width: 400px;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  background:rgba(255,255,255,1);
  box-shadow:0px 3px 19px 0px rgba(223,223,223,0.5);
  border-radius:5px;
}

.page {
  width: 100%;
  height: 100vh;
  background:rgba(249,249,249,1);
  justify-content: center;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.login-title {
  font-size:40px;
  color:rgba(33,34,38,1);
  line-height:56px;
  margin-bottom: 50px;
}

`;

const LoginComponent = () => {
  const d = useProp("message");

  useEffect(() => {
    setTimeout(() => {
      const obj = new WxLogin({
        self_redirect: false,
        id: "login-box",
        appid: "wx4332e11f7d5c65e6",
        scope: "snsapi_login",
        redirect_uri: `https://www.xunlianying.vip/${ROUTES.RedirectWechat}`,
        href: "https://file.wintercoming.xyz/web/plume/index.css",
      });
    }, 100);
  }, []);

  useDocumentTitleHook("登录");
  const eventInit = {
    bubbles: true,
    composed: true,
  };
  const dispatchMyEvent = useEvent("LoginEvent", eventInit);
  const dispatchLoginWeibo = useEvent("LoginWeibo", eventInit);
  const handlerLogin1 = () => {
    dispatchMyEvent({
      // eslint-disable-next-line @typescript-eslint/camelcase
      user_name: "guofucheng",
      password: "wozhiaini",
    });
  };

  const handlerLoginWeibo = () => {
    dispatchLoginWeibo({
      // eslint-disable-next-line @typescript-eslint/camelcase
      user_name: "guofucheng",
      password: "wozhiaini",
    });
  };

  return (
    h('host', {__self: undefined, __source: {fileName: _jsxFileName, lineNumber: 122}}
      , h('style', {__self: undefined, __source: {fileName: _jsxFileName, lineNumber: 123}}, loginBoxstyle)
      , h('div', { className: "page", __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 124}}
        , h('div', { className: "fixed-left-top", __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 125}}
          , h('horse-download-box', {__self: undefined, __source: {fileName: _jsxFileName, lineNumber: 126}} )
        )
        , h('span', { className: "login-title", __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 128}}, "登录"

          , d
        )

        , h('div', { className: "login-box", __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 133}}
          , h('span', {__self: undefined, __source: {fileName: _jsxFileName, lineNumber: 134}}, "请打开手机微信扫描二维码"

            , h('span', { onclick: () => handlerLogin1(), __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 136}}, "确认登录")
          )
          , h('div', {__self: undefined, __source: {fileName: _jsxFileName, lineNumber: 138}}
            , h('div', { id: "login-box", className: "wechat-img", __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 139}} )
          )

          , h('div', { className: "needle-items", __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 142}}
            , h('div', { role: "presentation", __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 143}}
              , h('span', { className: "needle-item", onclick: handlerLoginWeibo, __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 144}}
                , h('kun-icon', { iconType: "weibo", width: 16, height: 16, __self: undefined, __source: {fileName: _jsxFileName, lineNumber: 145}} )
              )
            )
          )
        )
      )
    )
  );
};

LoginComponent.props = {
  message: {
    type: String,
    value: "login-component",
    reflect: true,
    event: {
      type: "changeMessage",
    },
  },
};

var loginComponent = getComponentOrDefine("login-component", LoginComponent);

export default loginComponent;
export { loginBoxstyle };
