import { b as buildAssetsURL } from '../../handlers/renderer.mjs';
import { m as getListHttp, o as operateLikeHttp, H as Head, T as Title, M as Meta } from './cross-icon-0d3f98ec.mjs';
import { h as handleDate, E as ElMessage, _ as __nuxt_component_3, a as __nuxt_component_4 } from './top-head-a8210f9c.mjs';
import { useSSRContext, mergeProps, unref, inject, ref, watchEffect, nextTick, onUnmounted, withAsyncContext, withCtx, createTextVNode, createVNode } from 'vue';
import { ssrRenderAttrs, ssrRenderAttr, ssrInterpolate, ssrRenderComponent, ssrRenderList, ssrRenderStyle } from 'vue/server-renderer';
import { _ as _export_sfc } from './_plugin-vue_export-helper-cc2b3d55.mjs';
import { u as useHead } from './index-0ac4f71f.mjs';
import { e as useRoute, u as useRouter } from '../server.mjs';
import 'vue-bundle-renderer/runtime';
import '../../nitro/node-server.mjs';
import 'node:http';
import 'node:https';
import 'fs';
import 'path';
import 'node:fs';
import 'node:url';
import 'devalue';
import '@unhead/ssr';
import 'unhead';
import '@unhead/shared';
import 'lodash-unified';
import '@vue/shared';
import '@vueuse/core';
import 'axios';
import 'qs';
import '@vue/reactivity';
import 'vue-router';

const _imports_0$1 = "" + buildAssetsURL("time-icon.fef65a83.svg");
const _imports_1$1 = "" + buildAssetsURL("time-white-icon.805d0e12.svg");
const _imports_2 = "" + buildAssetsURL("eye-icon.efcf8c6f.svg");
const _imports_3 = "" + buildAssetsURL("expression-icon.a3be8be6.svg");
const _imports_4 = "" + buildAssetsURL("comment-icon.f7b16ad3.svg");
const _sfc_main$1 = {
  __name: "Item",
  __ssrInlineRender: true,
  props: {
    item: Object
  },
  emits: ["childEvent"],
  setup(__props, { emit: __emit }) {
    const formatNumberWithCommas = (number) => {
      return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
    };
    return (_ctx, _push, _parent, _attrs) => {
      _push(`<a${ssrRenderAttrs(mergeProps({
        class: "box flexflex",
        target: "_blank",
        href: `./details/${__props.item["uniqid"]}`
      }, _attrs))} data-v-fca24522><img class="img"${ssrRenderAttr("src", __props.item["schoolimage"])} data-v-fca24522><div class="content flexflex" data-v-fca24522><div class="name" data-v-fca24522>${ssrInterpolate(__props.item["school"])}</div><div class="list flexflex" data-v-fca24522>`);
      if (__props.item["profession"]) {
        _push(`<div class="item flexacenter" data-v-fca24522><div class="item-name" data-v-fca24522>\u4E13\u4E1A</div><div class="item-value ellipsis" data-v-fca24522>${ssrInterpolate(__props.item["profession"])}</div></div>`);
      } else {
        _push(`<!---->`);
      }
      if (__props.item["project"]) {
        _push(`<div class="item flexacenter" data-v-fca24522><div class="item-name" data-v-fca24522>\u9879\u76EE</div><div class="item-value ellipsis" data-v-fca24522>${ssrInterpolate(__props.item["project"])}</div></div>`);
      } else {
        _push(`<!---->`);
      }
      if (__props.item["interviewtime"]) {
        _push(`<div class="item flexacenter" data-v-fca24522><div class="item-name" data-v-fca24522>\u65F6\u95F4</div><div class="item-value ellipsis" data-v-fca24522>${ssrInterpolate(__props.item["interviewtime"])}</div></div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</div><div class="text-box" data-v-fca24522><div class="text" data-v-fca24522>${ssrInterpolate(__props.item["message"])}</div><div class="time flexacenter" data-v-fca24522><img class="time-icon time-black-icon"${ssrRenderAttr("src", _imports_0$1)} data-v-fca24522><img class="time-icon time-white-icon"${ssrRenderAttr("src", _imports_1$1)} data-v-fca24522> ${ssrInterpolate(("handleDate" in _ctx ? _ctx.handleDate : unref(handleDate))(__props.item["releasetime"]))}\u53D1\u5E03 </div></div><div class="data-list flexacenter" data-v-fca24522><div class="data-item flexacenter" data-v-fca24522><img class="data-item-icon"${ssrRenderAttr("src", _imports_2)} data-v-fca24522> ${ssrInterpolate(formatNumberWithCommas(__props.item["views"] || 0))}</div><div class="data-item flexacenter" data-v-fca24522><img class="data-item-icon"${ssrRenderAttr("src", _imports_3)} data-v-fca24522> ${ssrInterpolate(__props.item["ripostes"] || 0)}</div><div class="data-item flexacenter" data-v-fca24522><img class="data-item-icon"${ssrRenderAttr("src", _imports_4)} data-v-fca24522> ${ssrInterpolate(__props.item["commentnum"] || 0)}</div></div></div></a>`);
    };
  }
};
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/Item.vue");
  return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const __nuxt_component_5 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-fca24522"]]);
const _imports_0 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAIKADAAQAAAABAAAAIAAAAACshmLzAAAED0lEQVRYCe2Wu09UQRTGdwlYWWMAIzEhWhCJhRgVAbHzAWil1sT/gKcKLAqG159AYimVgIFSeVOglSYmRhPFEEiIlTQ2sP6+y5zr3OUuLFDqJLPnzHce883MmdmbSPzrLXmQDRgaGjqNfyO9Op1OFyFPuvjVZDK5Dja3tbU10dHR8d3h+4qcCDDxdZL3ku3yvhlxgMwS4nFLS8vMfv57Eujr6zuRn5//goQ3vESf0Sch9BW55vBifMrA6pFnPN9Jxk0Q2fCwiJqVwODg4Hk8J+inXMQYyVIk+xDJkDFgtyogkgK+60wrxDVki4sloMkJmifRcZJsoN/LZTvdhIEYGBioI26UQSF9E/1qHIldBLTtBQUFywRp5Z/y8vJuNjc3r6AfuA0PD5dub29PEVhOX4HERUhEjiMvM6vOHEyTbxxlcuUVcXLcUi56KTs6ItxvEQKqdlgGBYfz/cOu3J9AOcj5wGH1HG+tb48QYNI+Zxxra2ub9h2lc64XSFCVidtYNvnY2CTb/hZ9XGPIPDdcMiTgHplLAnFKSfqN86wEV20s4Nvp26Q7bEE+cSTAu+XHIq+oNqSrhQQw3NmBEl/iqpViOoY9KFp8n7LaLuefk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K5CYII=";
const _sfc_main = {
  __name: "index",
  __ssrInlineRender: true,
  async setup(__props) {
    let __temp, __restore;
    let isNeedLogin = inject("isNeedLogin");
    const goLogin = inject("goLogin");
    useHead({ script: [{ src: "https://app.gter.net/bottom?tpl=header&menukey=mj" }, { src: "https://app.gter.net/bottom?tpl=footer,popupnotification", body: true }] });
    ref(null);
    const route = useRoute();
    let keyword = ref("");
    keyword.value = route.query["keyword"];
    watchEffect(() => {
      if (keyword.value != route.query["keyword"]) {
        list.value = [];
        page.value = 1;
        keyword.value = route.query["keyword"];
        getList(route.query["keyword"]);
      }
    });
    const handleScroll = () => {
      const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
      if (scrollTop > 200)
        returnTopState.value = true;
      else
        returnTopState.value = false;
      const scrollHeight = document.documentElement.scrollHeight;
      const clientHeight = document.documentElement.clientHeight;
      if (scrollTop + clientHeight >= scrollHeight - 40)
        getList();
    };
    let page = ref(1);
    let count = ref(0);
    let list = ref([]);
    let loading = false;
    const getList = () => {
      if (page.value == 0 || loading)
        return;
      loading = true;
      getListHttp({ page: page.value, keyword: keyword.value }).then((res) => {
        if (res.code != 200) {
          page.value = 0;
          ElMessage({
            message: res.message,
            type: "error"
          });
          return;
        }
        let data = res.data;
        list.value = list.value.concat(data.data || []);
        if (data.count > list.value.length)
          page.value++;
        else
          page.value = 0;
        count.value = data["count"];
        nextTick(() => {
        });
      }).finally(() => loading = false);
    };
    const handleLike = (token) => {
      if (isNeedLogin.value) {
        goLogin();
        return;
      }
      operateLikeHttp({ token }).then((res) => {
        if (res.code != 200)
          return;
        let data = res.data;
        list.value.forEach((element) => {
          if (element["token"] == token) {
            element["islike"] = data["status"];
            element["likenum"] = data["count"];
          }
        });
        ElMessage.success(res.message);
      });
    };
    onUnmounted(() => {
      window.removeEventListener("scroll", handleScroll);
    });
    useRouter();
    try {
      if (true) {
        [__temp, __restore] = withAsyncContext(() => getListHttp({ page: 1, keyword: keyword.value }).then((res) => {
          if (res.code != 200) {
            page.value = 0;
            ElMessage({
              message: res.message,
              type: "error"
            });
            return;
          }
          let data = res.data;
          list.value = list.value.concat(data.data || []);
        })), await __temp, __restore();
      }
    } catch (error) {
    }
    let returnTopState = ref(false);
    return (_ctx, _push, _parent, _attrs) => {
      const _component_Head = Head;
      const _component_Title = Title;
      const _component_Meta = Meta;
      const _component_TopHead = __nuxt_component_3;
      const _component_empty = __nuxt_component_4;
      const _component_Item = __nuxt_component_5;
      _push(`<!--[-->`);
      _push(ssrRenderComponent(_component_Head, null, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(ssrRenderComponent(_component_Title, null, {
              default: withCtx((_2, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(`\u5BC4\u6258\u5929\u4E0B - \u9762\u7ECF\u5206\u4EAB`);
                } else {
                  return [
                    createTextVNode("\u5BC4\u6258\u5929\u4E0B - \u9762\u7ECF\u5206\u4EAB")
                  ];
                }
              }),
              _: 1
            }, _parent2, _scopeId));
            _push2(ssrRenderComponent(_component_Meta, {
              name: "keyword",
              content: "\u7559\u5B66\u8D44\u8BAF\uFF0C\u7559\u5B66\u4EA4\u6D41\u8BBA\u575B\uFF0C\u7559\u5B66\u9762\u7ECF\uFF0C\u9762\u8BD5\u7ECF\u9A8C\uFF0C\u5BC4\u6258\u5929\u4E0B"
            }, null, _parent2, _scopeId));
          } else {
            return [
              createVNode(_component_Title, null, {
                default: withCtx(() => [
                  createTextVNode("\u5BC4\u6258\u5929\u4E0B - \u9762\u7ECF\u5206\u4EAB")
                ]),
                _: 1
              }),
              createVNode(_component_Meta, {
                name: "keyword",
                content: "\u7559\u5B66\u8D44\u8BAF\uFF0C\u7559\u5B66\u4EA4\u6D41\u8BBA\u575B\uFF0C\u7559\u5B66\u9762\u7ECF\uFF0C\u9762\u8BD5\u7ECF\u9A8C\uFF0C\u5BC4\u6258\u5929\u4E0B"
              })
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(ssrRenderComponent(_component_TopHead, null, null, _parent));
      if (unref(keyword)) {
        _push(`<div class="search-result flexacenter" data-v-3292866c><div class="keyword flexacenter" data-v-3292866c>${ssrInterpolate(unref(keyword))} <img class="keyword-icon"${ssrRenderAttr("src", _imports_0)} data-v-3292866c></div><div class="halving-line" data-v-3292866c></div><div class="total" data-v-3292866c>\u5171 ${ssrInterpolate(unref(count))} \u6761\u641C\u7D22\u6570\u636E</div></div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`<div class="content" data-v-3292866c>`);
      if (unref(list).length == 0 && unref(page) == 0) {
        _push(`<div class="empty-box flexcenter" data-v-3292866c>`);
        _push(ssrRenderComponent(_component_empty, { hint: "\u6CA1\u6709\u627E\u5230\u76F8\u5173\u7ED3\u679C\uFF0C\u8BF7\u66F4\u6362\u641C\u7D22\u5173\u952E\u8BCD" }, null, _parent));
        _push(`</div>`);
      } else {
        _push(`<!--[-->`);
        ssrRenderList(unref(list), (item, index2) => {
          _push(ssrRenderComponent(_component_Item, {
            key: index2,
            item,
            onHandleLike: handleLike
          }, null, _parent));
        });
        _push(`<!--]-->`);
      }
      _push(`</div>`);
      if (unref(page) == 0 && unref(list).length > 0) {
        _push(`<div class="in-end" data-v-3292866c>- \u5230\u5E95\u4E86 -</div>`);
      } else {
        _push(`<!---->`);
      }
      if (unref(returnTopState)) {
        _push(`<div class="right-returnTop" data-v-3292866c><img${ssrRenderAttr("src", _imports_1)} style="${ssrRenderStyle({ "width": "24px", "height": "24px" })}" data-v-3292866c></div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`<!--]-->`);
    };
  }
};
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/index.html/index.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3292866c"]]);

export { index as default };
//# sourceMappingURL=index-bbc3c9b2.mjs.map
