vue-layout-gitcode 1.12.15-beta.28 → 1.12.15-beta.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,10 +40,10 @@ import "vue-devui-lal/input/style.css";
40
40
  import "vue-devui-lal/form/style.css";
41
41
  import { NotificationService } from "vue-devui-lal/notification";
42
42
  import "vue-devui-lal/notification/style.css";
43
+ import "vue-devui-lal/layout/style.css";
43
44
  import { Menu } from "vue-devui-lal/menu";
44
45
  import "vue-devui-lal/menu/style.css";
45
46
  import { Aside } from "vue-devui-lal/layout";
46
- import "vue-devui-lal/layout/style.css";
47
47
  import { RadioGroup, Radio } from "vue-devui-lal/radio";
48
48
  import "@devui-design/icons/icomoon/devui-icon.css";
49
49
  import "vue-devui-lal/radio/style.css";
@@ -16563,12 +16563,12 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
16563
16563
  setup(__props) {
16564
16564
  const layoutConfig2 = useLayoutConfig();
16565
16565
  const { t: $t } = i18n.global;
16566
- const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-BoqHn9Wz.js"));
16567
- const UserSearch = defineAsyncComponent(() => import("./UserSearch-C8kV-5N3.js"));
16568
- const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-CpWvL8eY.js"));
16569
- const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-IGkwmPuz.js"));
16570
- const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-B9dD_SO8.js"));
16571
- const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-CpxEhodw.js"));
16566
+ const ProjectSearch = defineAsyncComponent(() => import("./ProjectSearch-Ber9ZHHW.js"));
16567
+ const UserSearch = defineAsyncComponent(() => import("./UserSearch-uv8WxV_S.js"));
16568
+ const GloabarSearch = defineAsyncComponent(() => import("./GloabarSearch-CJaiSi4m.js"));
16569
+ const SearchHistoryList = defineAsyncComponent(() => import("./SearchHistoryList-DX-RAh16.js"));
16570
+ const SearchScopeList = defineAsyncComponent(() => import("./SearchScopeList-DS9Z5dMM.js"));
16571
+ const SearchRecommed = defineAsyncComponent(() => import("./SearchRecommed-BS5IiPjT.js"));
16572
16572
  const props = __props;
16573
16573
  const repoInfo = inject("repoInfo");
16574
16574
  const orgInfo = inject("orgInfo");
@@ -17592,7 +17592,7 @@ const autoAvokeLogin = ({ isLogin, loginFunc, openHarmonyGuide, loginSuccess, lo
17592
17592
  loginFunc({ type: "login", triggerType: "", loginTriggerSource: "router_login_auth", ...loginFuncOpts }, loginSuccess, openHarmonyGuide);
17593
17593
  }
17594
17594
  };
17595
- const NoticeModal = defineAsyncComponent(() => import("./notice-D2YH729T.js"));
17595
+ const NoticeModal = defineAsyncComponent(() => import("./notice-C7D3RnAC.js"));
17596
17596
  function clearNotice() {
17597
17597
  if (localStorage$2.getItem("validator_email")) {
17598
17598
  localStorage$2.removeItem("validator_email");
@@ -18230,494 +18230,50 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
18230
18230
  }
18231
18231
  });
18232
18232
  const GitCodeHeader = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-vue-layout-gitcode"]]);
18233
- const layoutConfig$2 = useLayoutConfig();
18234
- const useConfigSide = (request, sceneValue) => {
18235
- const API = asideRequest(request);
18236
- const route = useRoute();
18237
- const sideLoading = ref(false);
18238
- const isEn = computed(() => {
18239
- return getLocaleLang() === LANG_EN;
18240
- });
18241
- const showBgColor = computed(() => {
18242
- return route.meta.showBgColor || false;
18243
- });
18244
- const area = ref([]);
18245
- const assetMenus = computed(() => {
18246
- return [
18247
- {
18248
- left_menu_name_cn: "首页",
18249
- left_menu_name_cn_shrink: "首页",
18250
- left_menu_name_en: "Home",
18251
- left_menu_name_en_shrink: "Home",
18252
- area: 1,
18253
- display_order: 1,
18254
- jump_type: 1,
18255
- is_open_new_tab: false,
18256
- isIcon: true,
18257
- left_menu_logo: "gt-line-home-2",
18258
- left_menu_logo_black: "gt-line-home-2",
18259
- left_menu_logo_hover: "gt-plane-home-2",
18260
- left_menu_logo_hover_black: "gt-plane-home-2",
18261
- search_type: 1,
18262
- left_menu_url: "/",
18263
- id: 0
18264
- }
18265
- ];
18266
- });
18267
- const judgeIsShowAssetMenus = (data) => {
18268
- return data.filter((item) => {
18269
- if (item.area === 1) {
18270
- if (item.select_scene && item.select_scene.length > 0) {
18271
- return item.select_scene.includes(sceneValue);
18272
- }
18273
- return true;
18274
- }
18275
- return false;
18276
- }).length === 0;
18277
- };
18278
- const groupByArea = (data) => {
18279
- const sortedData = [...data].sort((a, b) => a.area - b.area);
18280
- const grouped = {};
18281
- sortedData.forEach((item) => {
18282
- if (!grouped[item.area]) {
18283
- grouped[item.area] = [];
18284
- }
18285
- grouped[item.area].push(item);
18286
- });
18287
- return Object.values(grouped);
18288
- };
18289
- const fetchArea = async () => {
18290
- var _a, _b;
18291
- sideLoading.value = true;
18292
- const res = await API.getAsideConfig();
18293
- let asideList = (((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.data) || []).map((item) => {
18294
- let processedUrl = item.left_menu_url;
18295
- if (processedUrl == null ? void 0 : processedUrl.startsWith("https://competition.")) {
18296
- const competitionUrl = replaceHost({ url: processedUrl, customHost: transformUrl(layoutConfig$2.VITE_COMPETITION_HOST) });
18297
- processedUrl = competitionUrl.includes("atomgit") ? competitionUrl.replace("competition.", "competitions.") : competitionUrl;
18298
- } else if (processedUrl == null ? void 0 : processedUrl.startsWith("https://ai.")) {
18299
- processedUrl = replaceHost({ url: processedUrl, customHost: transformUrl(layoutConfig$2.VITE_AI_HOST) });
18300
- } else {
18301
- processedUrl = transformUrl(processedUrl);
18302
- }
18303
- return {
18304
- ...item,
18305
- left_menu_url: processedUrl,
18306
- left_menu_logo: transformUrl(item.left_menu_logo),
18307
- left_menu_logo_black: transformUrl(item.left_menu_logo_black),
18308
- left_menu_logo_hover: transformUrl(item.left_menu_logo_hover),
18309
- left_menu_logo_hover_black: transformUrl(item.left_menu_logo_hover_black)
18310
- };
18311
- });
18312
- if (typeof window !== "undefined" && GUI_YANG_GITCODE_HOST && ((_b = window.location) == null ? void 0 : _b.origin.includes(GUI_YANG_GITCODE_HOST))) {
18313
- asideList = asideList.filter((item) => !(item.left_menu_url && item.left_menu_url.includes("https://competition.gitcode")));
18314
- }
18315
- if (judgeIsShowAssetMenus(asideList)) {
18316
- area.value = groupByArea([...assetMenus.value, ...asideList]);
18317
- } else {
18318
- area.value = groupByArea([...asideList]);
18233
+ const createSetting = () => {
18234
+ const { t: t2 } = i18n.global;
18235
+ const isGitCodeHost2 = typeof window !== "undefined" && window.location.hostname.includes("gitcode");
18236
+ const settings = {
18237
+ slogan: t2("gitCodeLayout.home.slogon"),
18238
+ copyright: {
18239
+ digest: (/* @__PURE__ */ new Date()).getFullYear() + " " + t2("gitCodeLayout.home.digest"),
18240
+ digestAbbr: (/* @__PURE__ */ new Date()).getFullYear() + " " + t2("gitCodeLayout.home.companyInformation"),
18241
+ icp: t2("gitCodeLayout.home.recordInformation"),
18242
+ beian: "11010502055713",
18243
+ phone: "400-6868-951",
18244
+ serviceTime: "9:00-18:00",
18245
+ publicSecurity: t2("gitCodeLayout.common.publicSecurity"),
18246
+ publicSecurity_url: "https://beian.mps.gov.cn/#/query/webSearch?code=11010502055713",
18247
+ aboutUs: t2("gitCodeLayout.common.aboutUs"),
18248
+ recruitment: t2("gitCodeLayout.common.recruitment"),
18249
+ price: t2("gitCodeLayout.common.prices"),
18250
+ beian_url: "https://www.zhipin.com/gongsi/job/b1eccc6dba1cc0d41Hd60tW0GVc~.html?ka=company-jobs"
18319
18251
  }
18320
- sideLoading.value = false;
18321
- };
18322
- return {
18323
- isEn,
18324
- showBgColor,
18325
- area,
18326
- fetchArea,
18327
- sideLoading
18328
18252
  };
18329
- };
18330
- const layoutConfig$1 = useLayoutConfig();
18331
- const loadAsideData = async (requestFn, params = {}, dataType = "project") => {
18332
- var _a;
18333
- try {
18334
- const result2 = await requestFn(params);
18335
- const limit = dataType === "project" ? 4 : 2;
18336
- if (result2.data) {
18337
- const axiosRes = result2.data;
18338
- const httpBody = (axiosRes == null ? void 0 : axiosRes.data) ?? axiosRes;
18339
- const nested = httpBody && typeof httpBody === "object" && httpBody.data != null && typeof httpBody.data === "object" && ("content" in httpBody.data || "total" in httpBody.data);
18340
- const project = nested ? httpBody.data : httpBody;
18341
- let storeData = [];
18342
- const list = (((_a = project.content) == null ? void 0 : _a.map((item) => {
18343
- if (dataType === "enterprise") {
18344
- const code2 = item.code;
18345
- if (!code2) return null;
18346
- return {
18347
- key: code2,
18348
- web_url: `${layoutConfig$1.VITE_HOST}/enterprises/${code2}`,
18349
- avatar: item.avatar,
18350
- id: item.id,
18351
- label: item.name,
18352
- namespace: code2
18353
- };
18354
- }
18355
- const itemName = dataType === "project" ? item.name : item.full_name || item.name;
18356
- const namespace = dataType === "project" ? item.namespace_info.name : "";
18357
- return {
18358
- key: itemName,
18359
- web_url: item.web_url,
18360
- avatar: item.avatar,
18361
- id: item.id,
18362
- label: itemName,
18363
- namespace
18364
- };
18365
- })) ?? []).filter((row) => row != null);
18366
- if (params.page === 1 && list.length > limit) {
18367
- storeData = list.splice(limit);
18368
- }
18369
- return {
18370
- totalNum: project.total,
18371
- list,
18372
- storeData,
18373
- loading: false
18374
- };
18375
- }
18376
- return {
18377
- list: [],
18378
- loading: false
18379
- };
18380
- } catch (error) {
18381
- console.error("Load aside data failed:", error);
18382
- return {
18383
- list: [],
18384
- loading: false
18385
- };
18386
- }
18387
- };
18388
- const loadUserProjectsInvolved = async (requestFn, params = {}) => {
18389
- try {
18390
- const result2 = await requestFn(params);
18391
- if (result2.data) {
18392
- const { content = [], total = 0 } = result2.data.data;
18393
- const list = content.filter((item) => {
18394
- var _a;
18395
- return (_a = item.namespace_info) == null ? void 0 : _a.name;
18396
- }).map((item) => {
18397
- var _a;
18398
- return {
18399
- key: item.name,
18400
- web_url: transformUrl(item.web_url),
18401
- avatar: transformUrl(item.avatar),
18402
- id: item.id,
18403
- label: item.name,
18404
- namespace: (_a = item.namespace_info) == null ? void 0 : _a.name
18405
- };
18406
- });
18407
- return {
18408
- totalNum: total,
18409
- list,
18410
- loading: false
18411
- };
18412
- }
18413
- return {
18414
- totalNum: 0,
18415
- list: [],
18416
- loading: false
18417
- };
18418
- } catch (error) {
18419
- console.error("Load user projects involved failed:", error);
18420
- return {
18421
- totalNum: 0,
18422
- list: [],
18423
- loading: false
18253
+ if (!isGitCodeHost2) {
18254
+ settings.slogan = "";
18255
+ settings.copyright = {
18256
+ digest: (/* @__PURE__ */ new Date()).getFullYear() + " " + t2("gitCodeLayout.home.copyright_atomgit.digest"),
18257
+ digestAbbr: (/* @__PURE__ */ new Date()).getFullYear() + " " + t2("gitCodeLayout.home.copyright_atomgit.companyInformation"),
18258
+ icp: t2("gitCodeLayout.home.copyright_atomgit.recordInformation"),
18259
+ beian: "11010502058321",
18260
+ phone: "400-6868-951",
18261
+ serviceTime: "9:00-18:00",
18262
+ publicSecurity: t2("gitCodeLayout.home.copyright_atomgit.publicSecurity"),
18263
+ publicSecurity_url: "https://beian.mps.gov.cn/#/query/webSearch?code=11010502058321",
18264
+ aboutUs: t2("gitCodeLayout.common.aboutUs"),
18265
+ recruitment: t2("gitCodeLayout.common.recruitment"),
18266
+ price: t2("gitCodeLayout.common.prices"),
18267
+ beian_url: "https://www.zhipin.com/gongsi/job/b1eccc6dba1cc0d41Hd60tW0GVc~.html?ka=company-jobs"
18424
18268
  };
18425
18269
  }
18270
+ return settings;
18426
18271
  };
18427
- var JumpType = /* @__PURE__ */ ((JumpType2) => {
18428
- JumpType2[JumpType2["Link"] = 1] = "Link";
18429
- JumpType2[JumpType2["Search"] = 2] = "Search";
18430
- return JumpType2;
18431
- })(JumpType || {});
18432
- var SearchType = /* @__PURE__ */ ((SearchType2) => {
18433
- SearchType2[SearchType2["Project"] = 1] = "Project";
18434
- SearchType2[SearchType2["Organization"] = 2] = "Organization";
18435
- SearchType2[SearchType2["Enterprise"] = 3] = "Enterprise";
18436
- return SearchType2;
18437
- })(SearchType || {});
18438
- const _hoisted_1$m = { class: "area" };
18439
- const _hoisted_2$g = { class: "area__layout-slot" };
18272
+ const _hoisted_1$m = { class: "tools-item-wrapper" };
18273
+ const _hoisted_2$g = { class: "tools-item-wrapper-checkbox" };
18274
+ const _hoisted_3$f = ["onClick", "title"];
18440
18275
  const _sfc_main$q = /* @__PURE__ */ defineComponent({
18441
- __name: "Area",
18442
- props: {
18443
- list: {},
18444
- isLogin: { type: Boolean },
18445
- slotKeys: {},
18446
- sceneValue: {},
18447
- asideSetShowLittle: { type: Boolean }
18448
- },
18449
- setup(__props) {
18450
- const layoutConfig2 = useLayoutConfig();
18451
- const { t: t2 } = i18n.global;
18452
- const route = useRoute();
18453
- const MenuItem = defineAsyncComponent(() => import("./MenuItem-D1-td8QS.js"));
18454
- const ProjectMenuListV2 = defineAsyncComponent(() => import("./ProjectMenuListV2-BEjLzYNK.js"));
18455
- const ProjectMenuList = defineAsyncComponent(() => import("./ProjectMenuList-BIcw89Fz.js"));
18456
- const props = __props;
18457
- const useReport2 = inject("useReport");
18458
- const userInfo = inject("userInfo");
18459
- const request = inject("request");
18460
- const API = asideRequest(request);
18461
- const subShow = ref({
18462
- project: true,
18463
- team: true,
18464
- enterprise: true
18465
- });
18466
- const isProject = (item) => {
18467
- return item.jump_type === JumpType.Search && item.search_type === SearchType.Project;
18468
- };
18469
- const isOrganization = (item) => {
18470
- return item.jump_type === JumpType.Search && item.search_type === SearchType.Organization;
18471
- };
18472
- const isEnterprise = (item) => {
18473
- return item.jump_type === JumpType.Search && item.search_type === SearchType.Enterprise;
18474
- };
18475
- const username = computed(() => (userInfo == null ? void 0 : userInfo.username) || JSON.parse(localStorage$2.getItem("userInfo") || "{}").username);
18476
- const projectProps = computed(() => {
18477
- return {
18478
- subShow: subShow.value.project,
18479
- key: "project",
18480
- type: "project",
18481
- defaultData: defaultProject.value,
18482
- buttonText: t2("gitCodeLayout.dashboard.repo.createRepo"),
18483
- username: username.value
18484
- };
18485
- });
18486
- const orgProps = computed(() => {
18487
- return {
18488
- subShow: subShow.value.team,
18489
- type: "team",
18490
- defaultData: defaultOrg.value,
18491
- title: t2("gitCodeLayout.common.organize"),
18492
- buttonText: t2("gitCodeLayout.orgSetting.creOrg"),
18493
- query: {},
18494
- username: username.value
18495
- };
18496
- });
18497
- const enterpriseProps = computed(() => {
18498
- return {
18499
- subShow: subShow.value.enterprise,
18500
- type: "enterprise",
18501
- defaultData: defaultEnterprise.value,
18502
- title: t2("gitCodeLayout.common.enterprise"),
18503
- buttonText: "",
18504
- query: {},
18505
- username: username.value
18506
- };
18507
- });
18508
- const getMenuItemProps = (item) => {
18509
- const currentPath = route ? route.path : "";
18510
- const isActive = isHttps(item.left_menu_url) || item.is_open_new_tab ? item.left_menu_url === window.location.href : item.left_menu_url === currentPath;
18511
- return {
18512
- active: isActive
18513
- };
18514
- };
18515
- const getProps = (item) => {
18516
- if (isProject(item)) {
18517
- return projectProps.value;
18518
- }
18519
- if (isOrganization(item)) {
18520
- return orgProps.value;
18521
- }
18522
- if (isEnterprise(item)) {
18523
- return enterpriseProps.value;
18524
- }
18525
- return getMenuItemProps(item);
18526
- };
18527
- const renderComponent = (item) => {
18528
- if (isProject(item) && !props.asideSetShowLittle) {
18529
- return ProjectMenuListV2;
18530
- }
18531
- if (isOrganization(item) && !props.asideSetShowLittle) {
18532
- return ProjectMenuList;
18533
- }
18534
- if (isEnterprise(item) && !props.asideSetShowLittle) {
18535
- return ProjectMenuList;
18536
- }
18537
- return MenuItem;
18538
- };
18539
- const hasOrg = computed(() => {
18540
- return props.list.some((item) => isOrganization(item));
18541
- });
18542
- const hasProject = computed(() => {
18543
- return props.list.some((item) => isProject(item));
18544
- });
18545
- const hasEnterprise = computed(() => {
18546
- return props.list.some((item) => isEnterprise(item));
18547
- });
18548
- const filterList = computed(() => {
18549
- return props.list.filter((item) => {
18550
- if (!item.select_scene || item.select_scene.length === 0) {
18551
- return true;
18552
- }
18553
- return item.select_scene.includes(props.sceneValue);
18554
- });
18555
- });
18556
- const searchKeys = ["project", "team", "enterprise"];
18557
- const layoutSlotKeys = computed(() => {
18558
- return props.slotKeys.filter((key) => searchKeys.includes(key));
18559
- });
18560
- const mainSiteSlotKeys = computed(() => {
18561
- return props.slotKeys.filter((key) => !searchKeys.includes(key));
18562
- });
18563
- const LayoutSlotComponent = (item) => {
18564
- if (item === "project") {
18565
- return ProjectMenuListV2;
18566
- }
18567
- if (item === "team" || item === "enterprise") {
18568
- return ProjectMenuList;
18569
- }
18570
- return null;
18571
- };
18572
- const defaultProject = ref({ loading: true });
18573
- const defaultOrg = ref({});
18574
- const defaultEnterprise = ref({});
18575
- const getOrgProject = async () => {
18576
- if (props.isLogin) {
18577
- defaultOrg.value = {
18578
- loading: true
18579
- };
18580
- if (hasEnterprise.value) {
18581
- defaultEnterprise.value = {
18582
- loading: true
18583
- };
18584
- }
18585
- defaultProject.value = {
18586
- loading: true
18587
- };
18588
- if (hasProject.value) {
18589
- loadUserProjectsInvolved((params) => API.getMyProjectsInvolved(params), {
18590
- per_page: 50
18591
- }).then((res) => {
18592
- defaultProject.value = res;
18593
- });
18594
- }
18595
- if (hasOrg.value) {
18596
- loadAsideData(
18597
- (params) => API.getMyGroups(params),
18598
- {
18599
- page: 1,
18600
- per_page: 10
18601
- },
18602
- "team"
18603
- ).then((res) => {
18604
- defaultOrg.value = res;
18605
- });
18606
- }
18607
- if (hasEnterprise.value) {
18608
- loadAsideData(
18609
- (params) => API.getUserRelatedEnterprises(params),
18610
- {
18611
- page: 1,
18612
- per_page: 10
18613
- },
18614
- "enterprise"
18615
- ).then((res) => {
18616
- defaultEnterprise.value = res;
18617
- });
18618
- }
18619
- defaultOrg.value = {
18620
- loading: false
18621
- };
18622
- if (!hasEnterprise.value) {
18623
- defaultEnterprise.value = {
18624
- loading: false
18625
- };
18626
- }
18627
- defaultProject.value = {
18628
- loading: false
18629
- };
18630
- } else {
18631
- defaultOrg.value = {
18632
- loading: false
18633
- };
18634
- defaultEnterprise.value = {
18635
- loading: false
18636
- };
18637
- defaultProject.value = {
18638
- loading: false
18639
- };
18640
- }
18641
- };
18642
- getOrgProject();
18643
- const onMenuClick = (e) => {
18644
- const parentNode = e.el.parentNode;
18645
- const openMode = (parentNode == null ? void 0 : parentNode.getAttribute("data-openBlank")) ? "_blank" : "_self";
18646
- const url = (parentNode == null ? void 0 : parentNode.getAttribute("data-href")) || "";
18647
- const host = (parentNode == null ? void 0 : parentNode.getAttribute("data-host")) || "";
18648
- const key = (parentNode == null ? void 0 : parentNode.getAttribute("data-key")) || "";
18649
- const REPOKEY = (key || "").toUpperCase();
18650
- const reportName = ASIDE_MENU_REPO[REPOKEY] || "";
18651
- if (reportName) {
18652
- useReport2(REPO_EVENT.CLICK, { module_name: reportName });
18653
- }
18654
- if (host === layoutConfig2.VITE_AI_HOST) {
18655
- useReport2(AsideReportEvent.AI_CLICK, {});
18656
- }
18657
- window.open(url, openMode);
18658
- };
18659
- return (_ctx, _cache) => {
18660
- return openBlock(), createElementBlock("div", _hoisted_1$m, [
18661
- createVNode(unref(Menu), {
18662
- class: "menu",
18663
- onSelect: onMenuClick,
18664
- "open-keys": ["team", "project", "enterprise"]
18665
- }, {
18666
- default: withCtx(() => [
18667
- (openBlock(true), createElementBlock(Fragment, null, renderList(filterList.value, (item) => {
18668
- return openBlock(), createBlock(resolveDynamicComponent(renderComponent(item)), mergeProps({
18669
- key: item.id,
18670
- isLogin: _ctx.isLogin,
18671
- item,
18672
- slotKeys: _ctx.slotKeys,
18673
- ref_for: true
18674
- }, getProps(item)), createSlots({ _: 2 }, [
18675
- renderList(mainSiteSlotKeys.value, (key) => {
18676
- return {
18677
- name: key,
18678
- fn: withCtx(() => [
18679
- renderSlot(_ctx.$slots, key, {}, void 0, true)
18680
- ])
18681
- };
18682
- }),
18683
- renderList(layoutSlotKeys.value, (key) => {
18684
- return {
18685
- name: key,
18686
- fn: withCtx(() => [
18687
- createElementVNode("div", _hoisted_2$g, [
18688
- createVNode(unref(Menu), {
18689
- class: "menu",
18690
- onSelect: onMenuClick,
18691
- "open-keys": ["team", "project", "enterprise"]
18692
- }, {
18693
- default: withCtx(() => [
18694
- (openBlock(), createBlock(resolveDynamicComponent(LayoutSlotComponent(key)), mergeProps({ ref_for: true }, getProps(item), {
18695
- slotKeys: _ctx.slotKeys,
18696
- item,
18697
- isLogin: _ctx.isLogin
18698
- }), null, 16, ["slotKeys", "item", "isLogin"]))
18699
- ]),
18700
- _: 2
18701
- }, 1024)
18702
- ])
18703
- ])
18704
- };
18705
- })
18706
- ]), 1040, ["isLogin", "item", "slotKeys"]);
18707
- }), 128))
18708
- ]),
18709
- _: 3
18710
- })
18711
- ]);
18712
- };
18713
- }
18714
- });
18715
- const Area = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-vue-layout-gitcode"]]);
18716
- const _hoisted_1$l = { class: "tools-item-wrapper" };
18717
- const _hoisted_2$f = { class: "tools-item-wrapper-checkbox" };
18718
- const _hoisted_3$f = ["onClick", "title"];
18719
- const _sfc_main$p = /* @__PURE__ */ defineComponent({
18720
- __name: "Theme",
18276
+ __name: "Theme",
18721
18277
  setup(__props) {
18722
18278
  const { t: t2 } = i18n.global;
18723
18279
  const activeTheme = ref("System");
@@ -18741,9 +18297,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
18741
18297
  setTheme(activeTheme.value);
18742
18298
  };
18743
18299
  return (_ctx, _cache) => {
18744
- return openBlock(), createElementBlock("div", _hoisted_1$l, [
18300
+ return openBlock(), createElementBlock("div", _hoisted_1$m, [
18745
18301
  createElementVNode("div", null, toDisplayString$1(unref(t2)("gitCodeLayout.common.footerSetting.theme")), 1),
18746
- createElementVNode("div", _hoisted_2$f, [
18302
+ createElementVNode("div", _hoisted_2$g, [
18747
18303
  (openBlock(true), createElementBlock(Fragment, null, renderList(themeList.value, (item) => {
18748
18304
  return openBlock(), createElementBlock("div", mergeProps({
18749
18305
  key: item.value,
@@ -18766,27 +18322,28 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
18766
18322
  };
18767
18323
  }
18768
18324
  });
18769
- const _hoisted_1$k = { class: "settings__label" };
18770
- const _hoisted_2$e = { class: "aside-footer-tools-item-dropdown-item" };
18325
+ const _hoisted_1$l = { class: "aside-footer-tools-item" };
18326
+ const _hoisted_2$f = { class: "aside-footer-tools-item-dropdown-item" };
18771
18327
  const _hoisted_3$e = { class: "aside-footer-tools-item-dropdown-item" };
18772
- const _sfc_main$o = /* @__PURE__ */ defineComponent({
18773
- __name: "Settings",
18328
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
18329
+ ...{ name: "AsideFooterTools" },
18330
+ __name: "index",
18774
18331
  props: {
18775
- showThemeSetting: { type: Boolean },
18776
- showLangSetting: { type: Boolean },
18777
- asideSetShowLittle: { type: Boolean }
18332
+ showThemeSetting: { type: Boolean, default: true },
18333
+ showLangSetting: { type: Boolean, default: true },
18334
+ position: { default: () => ["bottom-end"] }
18778
18335
  },
18779
18336
  setup(__props) {
18780
18337
  const { t: t2 } = i18n.global;
18781
18338
  return (_ctx, _cache) => {
18782
18339
  return openBlock(), createBlock(unref(Dropdown), {
18783
- position: ["top", "top-start"],
18340
+ position: _ctx.position,
18784
18341
  align: "end",
18785
18342
  "overlay-class": "footer-tools-setting-dropdown"
18786
18343
  }, {
18787
18344
  menu: withCtx(() => [
18788
- withDirectives(createElementVNode("div", _hoisted_2$e, [
18789
- createVNode(_sfc_main$p)
18345
+ withDirectives(createElementVNode("div", _hoisted_2$f, [
18346
+ createVNode(_sfc_main$q)
18790
18347
  ], 512), [
18791
18348
  [vShow, _ctx.showThemeSetting]
18792
18349
  ]),
@@ -18797,731 +18354,1235 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
18797
18354
  ])
18798
18355
  ]),
18799
18356
  default: withCtx(() => [
18800
- createElementVNode("div", {
18801
- class: normalizeClass(["aside-footer-tools-item", { "aside-footer-tools-item-little": _ctx.asideSetShowLittle }])
18802
- }, [
18357
+ createElementVNode("div", _hoisted_1$l, [
18803
18358
  createVNode(GIcon, {
18804
18359
  name: "gt-line-setting",
18805
18360
  size: "16",
18806
- class: "default-icon settings__icon-min"
18361
+ class: "default-icon aside-footer-tools__icon-min"
18807
18362
  }),
18808
18363
  createVNode(GIcon, {
18809
18364
  name: "gt-line-setting",
18810
18365
  size: "16",
18811
- class: "active-icon settings__icon-min"
18366
+ class: "active-icon aside-footer-tools__icon-min"
18812
18367
  }),
18813
- createElementVNode("span", _hoisted_1$k, toDisplayString$1(unref(t2)("gitCodeLayout.common.footerSetting.preSettingLittle")), 1)
18814
- ], 2)
18368
+ createTextVNode(" " + toDisplayString$1(unref(t2)("gitCodeLayout.common.footerSetting.preSetting")), 1)
18369
+ ])
18815
18370
  ]),
18816
18371
  _: 1
18817
- });
18372
+ }, 8, ["position"]);
18818
18373
  };
18819
18374
  }
18820
18375
  });
18821
- const Settings = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-vue-layout-gitcode"]]);
18822
- const FEEDBACK_CENTER_URL = "https://gitcode.com/Gitcode-offical-team/GitCode-Docs/issues";
18823
- const _sfc_main$n = /* @__PURE__ */ defineComponent({
18824
- __name: "SubMenuList",
18825
- setup(__props) {
18826
- const layoutConfig2 = useLayoutConfig();
18827
- const { t: t2 } = i18n.global;
18828
- const isEn = computed(() => {
18829
- return getLocaleLang() === LANG_EN;
18830
- });
18831
- const linkList = computed(() => {
18832
- return [
18833
- {
18834
- name: t2("gitCodeLayout.home.informationCenter"),
18835
- icon: "gt-line-consulting",
18836
- url: `${transformNewsUrl(INFORMATION_CENTER_URL)}?lang=${getLocaleLang() || "zh"}`,
18837
- target: "_blank"
18838
- },
18839
- {
18840
- name: t2("gitCodeLayout.header.helpDocument"),
18841
- icon: "gt-line-file",
18842
- url: currentHelpDocsUrl(),
18843
- target: "_blank"
18844
- },
18845
- {
18846
- name: t2("gitCodeLayout.home.feedbackCenter"),
18847
- icon: "gt-line-Checks",
18848
- url: replaceHost({ url: FEEDBACK_CENTER_URL, customHost: layoutConfig2.VITE_HOST }),
18849
- target: "_self"
18376
+ const AsideFooterTools = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-vue-layout-gitcode"]]);
18377
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
18378
+ ...{
18379
+ name: "ScrollActiveContainer",
18380
+ inheritAttrs: false
18381
+ },
18382
+ __name: "ScrollActiveContainer",
18383
+ props: {
18384
+ tag: { default: "div" },
18385
+ timeout: { default: 300 },
18386
+ direction: { default: "vertical" },
18387
+ visibleOnHover: { type: Boolean, default: true },
18388
+ wrapperClass: { default: "" },
18389
+ contentClass: { default: "" }
18390
+ },
18391
+ emits: ["scroll", "mouseenter", "mouseleave"],
18392
+ setup(__props, { expose: __expose, emit: __emit }) {
18393
+ const props = __props;
18394
+ const emit = __emit;
18395
+ function checkIsIOSPhone() {
18396
+ if (typeof navigator === "undefined") return false;
18397
+ return /iPhone|iPad|iPod/i.test(navigator.userAgent);
18398
+ }
18399
+ const isIOSMobile = computed(() => checkIsIOSPhone());
18400
+ const isScrolling = ref(false);
18401
+ const isHovered = ref(false);
18402
+ const trackSize = ref(0);
18403
+ const spacerSize = ref(0);
18404
+ const containerRef = ref(null);
18405
+ const contentRef = ref(null);
18406
+ const trackRef = ref(null);
18407
+ let scrollTimeout = null;
18408
+ let isSyncing = false;
18409
+ const updateSizes = () => {
18410
+ if (isIOSMobile.value) return;
18411
+ const container = containerRef.value;
18412
+ if (!container) return;
18413
+ if (props.direction === "vertical") {
18414
+ trackSize.value = container.clientHeight;
18415
+ spacerSize.value = container.scrollHeight;
18416
+ } else {
18417
+ trackSize.value = container.clientWidth;
18418
+ spacerSize.value = container.scrollWidth;
18419
+ }
18420
+ };
18421
+ let resizeObserver = null;
18422
+ onMounted(() => {
18423
+ if (isIOSMobile.value) return;
18424
+ const container = containerRef.value;
18425
+ const content = contentRef.value;
18426
+ if (container) {
18427
+ updateSizes();
18428
+ if (typeof ResizeObserver !== "undefined") {
18429
+ resizeObserver = new ResizeObserver(() => {
18430
+ updateSizes();
18431
+ });
18432
+ resizeObserver.observe(container);
18433
+ if (content) {
18434
+ resizeObserver.observe(content);
18435
+ }
18850
18436
  }
18851
- ];
18437
+ }
18438
+ if (typeof window !== "undefined") {
18439
+ window.addEventListener("resize", updateSizes);
18440
+ }
18441
+ });
18442
+ onUnmounted(() => {
18443
+ if (resizeObserver) {
18444
+ resizeObserver.disconnect();
18445
+ resizeObserver = null;
18446
+ }
18447
+ if (typeof window !== "undefined") {
18448
+ window.removeEventListener("resize", updateSizes);
18449
+ }
18450
+ if (scrollTimeout) {
18451
+ clearTimeout(scrollTimeout);
18452
+ }
18453
+ });
18454
+ watch([trackSize, spacerSize, () => props.direction], () => {
18455
+ if (isIOSMobile.value) return;
18456
+ const container = containerRef.value;
18457
+ const track = trackRef.value;
18458
+ if (!container || !track) return;
18459
+ if (props.direction === "vertical") {
18460
+ track.scrollTop = container.scrollTop;
18461
+ } else {
18462
+ track.scrollLeft = container.scrollLeft;
18463
+ }
18464
+ });
18465
+ const handleContainerScroll = (event) => {
18466
+ isScrolling.value = true;
18467
+ if (scrollTimeout) {
18468
+ clearTimeout(scrollTimeout);
18469
+ }
18470
+ scrollTimeout = setTimeout(() => {
18471
+ isScrolling.value = false;
18472
+ }, props.timeout);
18473
+ emit("scroll", event);
18474
+ if (isIOSMobile.value || isSyncing) return;
18475
+ const container = containerRef.value;
18476
+ const track = trackRef.value;
18477
+ if (!container || !track) return;
18478
+ isSyncing = true;
18479
+ if (props.direction === "vertical") {
18480
+ track.scrollTop = container.scrollTop;
18481
+ } else {
18482
+ track.scrollLeft = container.scrollLeft;
18483
+ }
18484
+ if (typeof requestAnimationFrame !== "undefined") {
18485
+ requestAnimationFrame(() => {
18486
+ isSyncing = false;
18487
+ });
18488
+ } else {
18489
+ isSyncing = false;
18490
+ }
18491
+ };
18492
+ const handleTrackScroll = () => {
18493
+ if (isIOSMobile.value) return;
18494
+ const container = containerRef.value;
18495
+ const track = trackRef.value;
18496
+ if (!container || !track) return;
18497
+ if (isSyncing) return;
18498
+ isSyncing = true;
18499
+ if (props.direction === "vertical") {
18500
+ container.scrollTop = track.scrollTop;
18501
+ } else {
18502
+ container.scrollLeft = track.scrollLeft;
18503
+ }
18504
+ if (typeof requestAnimationFrame !== "undefined") {
18505
+ requestAnimationFrame(() => {
18506
+ isSyncing = false;
18507
+ });
18508
+ } else {
18509
+ isSyncing = false;
18510
+ }
18511
+ };
18512
+ const handleMouseEnter = (event) => {
18513
+ if (props.visibleOnHover) {
18514
+ isHovered.value = true;
18515
+ }
18516
+ emit("mouseenter", event);
18517
+ };
18518
+ const handleMouseLeave = (event) => {
18519
+ isHovered.value = false;
18520
+ isScrolling.value = false;
18521
+ if (scrollTimeout) {
18522
+ clearTimeout(scrollTimeout);
18523
+ }
18524
+ emit("mouseleave", event);
18525
+ };
18526
+ const showScrollbar = computed(() => {
18527
+ return !props.visibleOnHover || isHovered.value || isScrolling.value;
18528
+ });
18529
+ __expose({
18530
+ containerEl: containerRef,
18531
+ contentEl: contentRef,
18532
+ trackEl: trackRef
18852
18533
  });
18853
18534
  return (_ctx, _cache) => {
18854
18535
  return openBlock(), createElementBlock("div", {
18855
- class: normalizeClass(["sub-menu-list", { en: isEn.value }])
18536
+ class: normalizeClass(["scroll-active-container-wrapper", [_ctx.wrapperClass, { "scrollbar-none": !isIOSMobile.value }]]),
18537
+ onMouseenter: handleMouseEnter,
18538
+ onMouseleave: handleMouseLeave
18856
18539
  }, [
18857
- (openBlock(true), createElementBlock(Fragment, null, renderList(linkList.value, (item) => {
18858
- return openBlock(), createBlock(GLink, {
18859
- key: item.name,
18860
- class: "custom-link sub-menu-list__link",
18861
- href: item.url,
18862
- target: item.target
18863
- }, {
18864
- default: withCtx(() => [
18865
- createVNode(GIcon, {
18866
- name: item.icon,
18867
- color: "var(--theme-placeholder)"
18868
- }, null, 8, ["name"]),
18869
- createElementVNode("span", null, toDisplayString$1(item.name), 1)
18870
- ]),
18871
- _: 2
18872
- }, 1032, ["href", "target"]);
18873
- }), 128))
18874
- ], 2);
18875
- };
18876
- }
18877
- });
18878
- const SubMenuList = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-vue-layout-gitcode"]]);
18879
- const createSetting = () => {
18880
- const { t: t2 } = i18n.global;
18881
- const isGitCodeHost2 = typeof window !== "undefined" && window.location.hostname.includes("gitcode");
18882
- const settings = {
18883
- slogan: t2("gitCodeLayout.home.slogon"),
18884
- copyright: {
18885
- digest: (/* @__PURE__ */ new Date()).getFullYear() + " " + t2("gitCodeLayout.home.digest"),
18886
- digestAbbr: (/* @__PURE__ */ new Date()).getFullYear() + " " + t2("gitCodeLayout.home.companyInformation"),
18887
- icp: t2("gitCodeLayout.home.recordInformation"),
18888
- beian: "11010502055713",
18889
- phone: "400-6868-951",
18890
- serviceTime: "9:00-18:00",
18891
- publicSecurity: t2("gitCodeLayout.common.publicSecurity"),
18892
- publicSecurity_url: "https://beian.mps.gov.cn/#/query/webSearch?code=11010502055713",
18893
- aboutUs: t2("gitCodeLayout.common.aboutUs"),
18894
- recruitment: t2("gitCodeLayout.common.recruitment"),
18895
- price: t2("gitCodeLayout.common.prices"),
18896
- beian_url: "https://www.zhipin.com/gongsi/job/b1eccc6dba1cc0d41Hd60tW0GVc~.html?ka=company-jobs"
18897
- }
18898
- };
18899
- if (!isGitCodeHost2) {
18900
- settings.slogan = "";
18901
- settings.copyright = {
18902
- digest: (/* @__PURE__ */ new Date()).getFullYear() + " " + t2("gitCodeLayout.home.copyright_atomgit.digest"),
18903
- digestAbbr: (/* @__PURE__ */ new Date()).getFullYear() + " " + t2("gitCodeLayout.home.copyright_atomgit.companyInformation"),
18904
- icp: t2("gitCodeLayout.home.copyright_atomgit.recordInformation"),
18905
- beian: "11010502058321",
18906
- phone: "400-6868-951",
18907
- serviceTime: "9:00-18:00",
18908
- publicSecurity: t2("gitCodeLayout.home.copyright_atomgit.publicSecurity"),
18909
- publicSecurity_url: "https://beian.mps.gov.cn/#/query/webSearch?code=11010502058321",
18910
- aboutUs: t2("gitCodeLayout.common.aboutUs"),
18911
- recruitment: t2("gitCodeLayout.common.recruitment"),
18912
- price: t2("gitCodeLayout.common.prices"),
18913
- beian_url: "https://www.zhipin.com/gongsi/job/b1eccc6dba1cc0d41Hd60tW0GVc~.html?ka=company-jobs"
18914
- };
18915
- }
18916
- return settings;
18917
- };
18918
- const _hoisted_1$j = { class: "aside-footer" };
18919
- const _hoisted_2$d = { class: "remake-message" };
18920
- const _hoisted_3$d = ["title"];
18921
- const _hoisted_4$a = { class: "remake-message__line" };
18922
- const _hoisted_5$6 = {
18923
- href: "https://beian.miit.gov.cn/#/Integrated/index",
18924
- target: "_blank"
18925
- };
18926
- const _hoisted_6$5 = {
18927
- key: 0,
18928
- class: "remake-message__line public-security"
18929
- };
18930
- const _hoisted_7$4 = ["href"];
18931
- const _hoisted_8$4 = {
18932
- href: "https://www.huaweicloud.com/",
18933
- target: "_blank",
18934
- rel: "noopener noreferrer"
18935
- };
18936
- const _hoisted_9$4 = { class: "contact-info__about-row" };
18937
- const _hoisted_10$4 = { class: "footer-work-info" };
18938
- const _hoisted_11$4 = { class: "footer-work-info__item footer-work-info__item--mt" };
18939
- const _hoisted_12$3 = { class: "" };
18940
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
18941
- __name: "ContactInfo",
18942
- setup(__props) {
18943
- const { t: t2 } = i18n.global;
18944
- const setting = createSetting();
18945
- const { copyright } = setting;
18946
- const isEn = computed(() => {
18947
- return getLocaleLang() === LANG_EN;
18948
- });
18949
- return (_ctx, _cache) => {
18950
- return openBlock(), createElementBlock("div", _hoisted_1$j, [
18951
- createElementVNode("div", _hoisted_2$d, [
18952
- createElementVNode("p", {
18953
- class: "remake-message__line remake-message__line--break",
18954
- title: unref(copyright).digestAbbr
18955
- }, " © " + toDisplayString$1(unref(copyright).digestAbbr), 9, _hoisted_3$d),
18956
- createElementVNode("p", _hoisted_4$a, [
18957
- createElementVNode("a", _hoisted_5$6, toDisplayString$1(unref(copyright).icp), 1)
18540
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), mergeProps({
18541
+ ref_key: "containerRef",
18542
+ ref: containerRef,
18543
+ class: ["scroll-active-container-scroll", [
18544
+ !isIOSMobile.value ? "scrollbar-none" : "",
18545
+ _ctx.direction === "vertical" ? "is-vertical-scroll" : "is-horizontal-scroll"
18546
+ ]]
18547
+ }, _ctx.$attrs, { onScroll: handleContainerScroll }), {
18548
+ default: withCtx(() => [
18549
+ createElementVNode("div", {
18550
+ ref_key: "contentRef",
18551
+ ref: contentRef,
18552
+ class: normalizeClass(["scroll-active-container-content", _ctx.contentClass])
18553
+ }, [
18554
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
18555
+ ], 2)
18958
18556
  ]),
18959
- unref(copyright).publicSecurity_url ? (openBlock(), createElementBlock("p", _hoisted_6$5, [
18960
- _cache[0] || (_cache[0] = createElementVNode("img", { src: "//g.csdnimg.cn/common/csdn-footer/images/badge.png" }, null, -1)),
18961
- createElementVNode("a", {
18962
- href: unref(copyright).publicSecurity_url,
18963
- target: "_blank"
18964
- }, toDisplayString$1(unref(copyright).publicSecurity), 9, _hoisted_7$4)
18965
- ])) : createCommentVNode("", true)
18966
- ]),
18967
- createElementVNode("p", {
18968
- class: normalizeClass(["contact-info__support support", { en: isEn.value }])
18557
+ _: 3
18558
+ }, 16, ["class"])),
18559
+ !isIOSMobile.value ? (openBlock(), createElementBlock("div", {
18560
+ key: 0,
18561
+ ref_key: "trackRef",
18562
+ ref: trackRef,
18563
+ class: normalizeClass(["scroll-active-track", [
18564
+ _ctx.direction === "vertical" ? "scroll-active-track--vertical" : "scroll-active-track--horizontal",
18565
+ showScrollbar.value ? "is-visible" : "is-hidden"
18566
+ ]]),
18567
+ style: normalizeStyle({
18568
+ height: _ctx.direction === "vertical" && trackSize.value ? `${trackSize.value}px` : void 0,
18569
+ width: _ctx.direction === "horizontal" && trackSize.value ? `${trackSize.value}px` : void 0
18570
+ }),
18571
+ onScroll: handleTrackScroll
18969
18572
  }, [
18970
- createElementVNode("span", null, toDisplayString$1(unref(t2)("gitCodeLayout.home.technicalSupport")), 1),
18971
- _cache[1] || (_cache[1] = createElementVNode("a", {
18972
- href: "https://www.csdn.net/",
18973
- target: "_blank",
18974
- rel: "noopener noreferrer"
18975
- }, "CSDN", -1)),
18976
- _cache[2] || (_cache[2] = createTextVNode("  |  ")),
18977
- createElementVNode("a", _hoisted_8$4, toDisplayString$1(unref(t2)("gitCodeLayout.home.HWCloud")), 1)
18978
- ], 2),
18979
- createElementVNode("p", _hoisted_9$4, [
18980
- createVNode(GLink, {
18981
- target: "_blank",
18982
- href: unref(currentHelpDocsAboutUsUrl)()
18983
- }, {
18984
- default: withCtx(() => [
18985
- createTextVNode(toDisplayString$1(unref(copyright).aboutUs), 1)
18986
- ]),
18987
- _: 1
18988
- }, 8, ["href"]),
18989
- _cache[3] || (_cache[3] = createTextVNode("  |   ")),
18990
- createVNode(GLink, {
18991
- target: "_blank",
18992
- href: unref(copyright).beian_url
18993
- }, {
18994
- default: withCtx(() => [
18995
- createTextVNode(toDisplayString$1(unref(copyright).recruitment), 1)
18996
- ]),
18997
- _: 1
18998
- }, 8, ["href"])
18999
- ]),
19000
- createElementVNode("ul", _hoisted_10$4, [
19001
- _cache[4] || (_cache[4] = createElementVNode("li", { class: "footer-work-info__item" }, [
19002
- createElementVNode("span", { class: "" }, "400-6868-951")
19003
- ], -1)),
19004
- createElementVNode("li", _hoisted_11$4, [
19005
- createElementVNode("span", _hoisted_12$3, "9:00-18:00 (" + toDisplayString$1(unref(t2)("gitCodeLayout.home.onWeekdays")) + ")", 1)
19006
- ])
19007
- ])
19008
- ]);
18573
+ createElementVNode("div", {
18574
+ style: normalizeStyle({
18575
+ height: _ctx.direction === "vertical" ? `${spacerSize.value}px` : "1px",
18576
+ width: _ctx.direction === "horizontal" ? `${spacerSize.value}px` : "1px",
18577
+ pointerEvents: "none"
18578
+ })
18579
+ }, null, 4)
18580
+ ], 38)) : createCommentVNode("", true)
18581
+ ], 34);
19009
18582
  };
19010
18583
  }
19011
18584
  });
19012
- const ContactInfo = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-vue-layout-gitcode"]]);
19013
- const _hoisted_1$i = { class: "config-aside__main" };
19014
- const _hoisted_2$c = { key: 0 };
19015
- const _hoisted_3$c = {
19016
- key: 1,
19017
- class: "aside-menus"
18585
+ const ScrollActiveContainer = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-vue-layout-gitcode"]]);
18586
+ function asideV2Request(request) {
18587
+ return {
18588
+ /**
18589
+ * 首页一级频道列表
18590
+ */
18591
+ homeFirstChannel() {
18592
+ return reqCatch(
18593
+ () => request({
18594
+ url: "/api/v1/search/channel/list/one/preview",
18595
+ method: "get",
18596
+ params: {
18597
+ m_code: "channelOne",
18598
+ d_code: "channel_one_preview",
18599
+ c_id: "channel"
18600
+ }
18601
+ }),
18602
+ {}
18603
+ );
18604
+ },
18605
+ /**
18606
+ * 获取首页推荐块 (Promo Slot / RECOMMEND_BLOCKS) 配置
18607
+ */
18608
+ getPromoSlot() {
18609
+ return reqCatch(
18610
+ () => request({
18611
+ url: "/api/v1/search/nauth/home/operation-hot-recommend",
18612
+ method: "get"
18613
+ }),
18614
+ []
18615
+ );
18616
+ }
18617
+ };
18618
+ }
18619
+ function mapRecommendBlockItemToChannel(item, block, itemIndex) {
18620
+ const children = [];
18621
+ if (item.tabs && Array.isArray(item.tabs)) {
18622
+ for (const tab of item.tabs) {
18623
+ children.push({
18624
+ object_id: tab.code,
18625
+ name: tab.name,
18626
+ name_en: tab.name_en,
18627
+ icon: tab.icon,
18628
+ desc: tab.desc,
18629
+ desc_en: tab.desc_en,
18630
+ url: tab.url,
18631
+ parent_id: item.code
18632
+ });
18633
+ }
18634
+ }
18635
+ return {
18636
+ object_id: item.code,
18637
+ name: item.name,
18638
+ name_en: item.name_en,
18639
+ icon: item.icon,
18640
+ icon_dark: item.icon_dark,
18641
+ desc: item.desc,
18642
+ desc_en: item.desc_en,
18643
+ url: item.url,
18644
+ is_new: item.is_new,
18645
+ links: item.links,
18646
+ children,
18647
+ group: {
18648
+ name: block.name,
18649
+ name_en: block.name_en,
18650
+ len: block.items.length
18651
+ },
18652
+ groupIndex: itemIndex
18653
+ };
18654
+ }
18655
+ function mergeChannelsWithRecommendBlocks(originalChannels, blocks = []) {
18656
+ if (!originalChannels || originalChannels.length === 0) return [];
18657
+ if (!blocks || blocks.length === 0) return originalChannels;
18658
+ const beforeMap = /* @__PURE__ */ new Map();
18659
+ for (const block of blocks) {
18660
+ if (block.before) {
18661
+ const existing = beforeMap.get(block.before) || [];
18662
+ existing.push(block);
18663
+ beforeMap.set(block.before, existing);
18664
+ }
18665
+ }
18666
+ const result2 = [];
18667
+ const processedBeforeIds = /* @__PURE__ */ new Set();
18668
+ for (const ch of originalChannels) {
18669
+ const blocksToInsert = beforeMap.get(ch.object_id);
18670
+ if (blocksToInsert && blocksToInsert.length > 0) {
18671
+ processedBeforeIds.add(ch.object_id);
18672
+ for (const block of blocksToInsert) {
18673
+ block.items.forEach((item, index2) => {
18674
+ result2.push(mapRecommendBlockItemToChannel(item, block, index2));
18675
+ });
18676
+ }
18677
+ }
18678
+ result2.push(ch);
18679
+ }
18680
+ for (const block of blocks) {
18681
+ if (block.before && processedBeforeIds.has(block.before)) continue;
18682
+ block.items.forEach((item, index2) => {
18683
+ result2.push(mapRecommendBlockItemToChannel(item, block, index2));
18684
+ });
18685
+ }
18686
+ return result2;
18687
+ }
18688
+ const newTagImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAoCAYAAABpYH0BAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAClJJREFUeAHtWn1sHEcVn5nd+9rzNeePJjitseOE0iQtdWlJ0xKlMYW2VFRNqQRC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DahO8SC04+stfbyE3kRSfupvX4RnkuX+j95MOngcqorgcqryhq/6HXv/Rs4+Rm0iIPfOXrY95n1dURP6yRMQ/Ry93eKsnTA4TplYHevpmnmlwk3uXzG8lNwOIjlcWPbEi4OnbiGVK2caf957lTzuiZnD0SufJ2eMnUfjWWRXy+x/88M2/lPT39LaVPTA151zpy4z/HGl0HPzx87tDXv/TvIIx1ws97b/S2odE2pfKpq6FT5u1kMk48eu7zW4/5Cwpco8pKuxasHVTGxkBaIJA0X3mk2/7Ll2pDPr9j8aepLzgea5NV9rN/8VXw9ayijIWCW9WZfY4BBf+/XMkAxK6JlEWl2PQGNKWrOPW4illiswWwoPWAuAQ/wnJSUYAKKEdhLIO+DzZrMjyjs3eDq+Z7f8AUBTucqXJpZAAAAAASUVORK5CYII=";
18690
+ const _hoisted_1$k = { class: "home-channel-side-nav" };
18691
+ const _hoisted_2$e = {
18692
+ key: 0,
18693
+ class: "home-channel-side-nav__list",
18694
+ "aria-busy": "true",
18695
+ "aria-label": "加载中"
18696
+ };
18697
+ const _hoisted_3$d = {
18698
+ key: 0,
18699
+ class: "home-channel-side-nav__group-title home-channel-side-nav__group-title--skeleton"
19018
18700
  };
19019
- const _hoisted_4$9 = {
18701
+ const _hoisted_4$a = { class: "home-channel-side-nav__info" };
18702
+ const _hoisted_5$6 = { class: "home-channel-side-nav__label-row" };
18703
+ const _hoisted_6$5 = {
19020
18704
  key: 1,
19021
- class: "line line--mt"
18705
+ class: "home-channel-side-nav__list"
19022
18706
  };
19023
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
19024
- __name: "configAideContent",
19025
- props: {
19026
- sceneValue: { default: SceneValue.home },
19027
- isLogin: { type: Boolean, default: false },
19028
- asideDefaultWidth: { default: 240 },
19029
- asideSetShowLittle: { type: Boolean, default: false },
19030
- independence: { type: Boolean, default: false },
19031
- showPreferencesSetting: { type: Boolean },
19032
- showThemeSetting: { type: Boolean },
19033
- showLangSetting: { type: Boolean },
19034
- slotKeys: { default: () => [] },
19035
- collapseMode: { type: Boolean, default: false }
19036
- },
19037
- setup(__props) {
19038
- const layoutConfig2 = useLayoutConfig();
19039
- const userInfo = inject("userInfo");
19040
- const globalStore = inject("globalStore");
19041
- const route = useRoute();
19042
- const serverList = ref([]);
19043
- const request = inject("request");
19044
- const API = asideRequest(request);
18707
+ const _hoisted_7$4 = {
18708
+ key: 0,
18709
+ class: "home-channel-side-nav__group-title"
18710
+ };
18711
+ const _hoisted_8$4 = ["aria-current", "title", "onClick"];
18712
+ const _hoisted_9$4 = ["src", "alt", "onClick"];
18713
+ const _hoisted_10$4 = { class: "home-channel-side-nav__info" };
18714
+ const _hoisted_11$4 = { class: "home-channel-side-nav__label-row" };
18715
+ const _hoisted_12$3 = { class: "home-channel-side-nav__label" };
18716
+ const _hoisted_13$1 = ["src"];
18717
+ const _hoisted_14$1 = ["title"];
18718
+ const _hoisted_15$1 = {
18719
+ key: 3,
18720
+ xmlns: "http://www.w3.org/2000/svg",
18721
+ width: "14",
18722
+ height: "14",
18723
+ viewBox: "0 0 24 24",
18724
+ fill: "none",
18725
+ stroke: "currentColor",
18726
+ "stroke-width": "2",
18727
+ "stroke-linecap": "round",
18728
+ "stroke-linejoin": "round",
18729
+ class: "home-channel-side-nav__chevron"
18730
+ };
18731
+ const _hoisted_16$1 = { class: "home-channel-side-nav__footer-wrapper" };
18732
+ const _hoisted_17$1 = {
18733
+ class: "aside-footer nav-site-footer",
18734
+ "aria-label": "网站备案与站点链接"
18735
+ };
18736
+ const _hoisted_18$1 = {
18737
+ class: "nav-site-shortcuts",
18738
+ "aria-label": "站点服务"
18739
+ };
18740
+ const _hoisted_19$1 = ["href"];
18741
+ const _hoisted_20$1 = {
18742
+ key: 0,
18743
+ xmlns: "http://www.w3.org/2000/svg",
18744
+ width: "14",
18745
+ height: "14",
18746
+ viewBox: "0 0 24 24",
18747
+ fill: "none",
18748
+ stroke: "currentColor",
18749
+ "stroke-width": "2",
18750
+ "stroke-linecap": "round",
18751
+ "stroke-linejoin": "round"
18752
+ };
18753
+ const _hoisted_21$1 = {
18754
+ key: 1,
18755
+ xmlns: "http://www.w3.org/2000/svg",
18756
+ width: "14",
18757
+ height: "14",
18758
+ viewBox: "0 0 24 24",
18759
+ fill: "none",
18760
+ stroke: "currentColor",
18761
+ "stroke-width": "2",
18762
+ "stroke-linecap": "round",
18763
+ "stroke-linejoin": "round"
18764
+ };
18765
+ const _hoisted_22$1 = {
18766
+ key: 2,
18767
+ xmlns: "http://www.w3.org/2000/svg",
18768
+ width: "14",
18769
+ height: "14",
18770
+ viewBox: "0 0 24 24",
18771
+ fill: "none",
18772
+ stroke: "currentColor",
18773
+ "stroke-width": "2",
18774
+ "stroke-linecap": "round",
18775
+ "stroke-linejoin": "round"
18776
+ };
18777
+ const _hoisted_23$1 = {
18778
+ key: 3,
18779
+ xmlns: "http://www.w3.org/2000/svg",
18780
+ width: "14",
18781
+ height: "14",
18782
+ viewBox: "0 0 24 24",
18783
+ fill: "none",
18784
+ stroke: "currentColor",
18785
+ "stroke-width": "2",
18786
+ "stroke-linecap": "round",
18787
+ "stroke-linejoin": "round"
18788
+ };
18789
+ const _hoisted_24$1 = {
18790
+ key: 0,
18791
+ class: "home-channel-side-nav__footer-tools-container"
18792
+ };
18793
+ const _hoisted_25$1 = { class: "home-channel-side-nav__footer-tools-inner" };
18794
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
18795
+ ...{ name: "AsideV2Content", inheritAttrs: false },
18796
+ __name: "asideV2Content",
18797
+ props: {
18798
+ sceneValue: { default: SceneValue.home },
18799
+ disableFlatMode: { type: Boolean, default: false },
18800
+ singleCol: { type: Boolean, default: false },
18801
+ channels: { default: void 0 },
18802
+ modelValue: { default: "" },
18803
+ activeChannel: { default: "" },
18804
+ userInfo: { default: () => ({}) },
18805
+ isLogin: { type: Boolean, default: false },
18806
+ request: { type: Function, default: proxyService },
18807
+ globalStore: { default: () => ({ httpStatus: 200 }) },
18808
+ independence: { type: Boolean, default: false },
18809
+ showThemeSetting: { type: Boolean, default: void 0 },
18810
+ showLangSetting: { type: Boolean, default: void 0 },
18811
+ onChannelChange: { type: Function, default: void 0 }
18812
+ },
18813
+ emits: ["update:modelValue", "update:activeChannel", "channelChange", "select"],
18814
+ setup(__props, { emit: __emit }) {
19045
18815
  const props = __props;
19046
- const layoutSlotKeys = computed(() => {
19047
- return [...props.slotKeys, "project", "team"];
18816
+ const emit = __emit;
18817
+ const { t: t2 } = i18n.global;
18818
+ const route = useRoute();
18819
+ const layoutConfig2 = useLayoutConfig();
18820
+ const skeletonItems = [
18821
+ { width: "56px" },
18822
+ { width: "78px" },
18823
+ { width: "64px", descWidth: "116px" },
18824
+ { width: "88px", descWidth: "96px", isGroupLast: true },
18825
+ { isGroupTitle: true, width: "48px" },
18826
+ { width: "72px" },
18827
+ { width: "60px", descWidth: "124px" },
18828
+ { width: "80px" },
18829
+ { width: "68px" }
18830
+ ];
18831
+ const injectRequest = inject("request", props.request) || props.request || proxyService;
18832
+ const injectGlobalStore = inject("globalStore", props.globalStore);
18833
+ const { useReport: useReport2 } = useRequestReport(injectRequest, injectGlobalStore);
18834
+ const API = asideV2Request(injectRequest);
18835
+ const isEn = computed(() => getLocaleLang() === LANG_EN);
18836
+ const showThemeSetting = computed(() => {
18837
+ if (props.showThemeSetting !== void 0) return props.showThemeSetting;
18838
+ return ![SceneValue.aiHome, SceneValue.aiRepo, SceneValue.aiGuide].includes(props.sceneValue);
19048
18839
  });
19049
- const useReport2 = inject("useReport");
19050
- provide("independence", props.independence);
19051
- const { isEn, area, fetchArea, sideLoading } = useConfigSide(request, props.sceneValue);
19052
- fetchArea();
19053
- const isScroll = ref(false);
19054
- const timer = ref(null);
19055
- const isGroupHover = ref(false);
19056
- const visibleItems = computed(() => {
19057
- switch (props.sceneValue) {
19058
- case SceneValue.news:
19059
- return [];
19060
- case SceneValue.blog:
19061
- return [AsideDisplayItem.LINK, AsideDisplayItem.SITE_INFO];
19062
- case SceneValue.home:
19063
- return [
19064
- AsideDisplayItem.LINK,
19065
- AsideDisplayItem.PREFERENCE
19066
- ];
19067
- case SceneValue.repo:
19068
- case SceneValue.org:
19069
- case SceneValue.aiHome:
19070
- case SceneValue.aiRepo:
19071
- case SceneValue.active:
19072
- case SceneValue.aiGuide:
19073
- return [
19074
- AsideDisplayItem.LINK,
19075
- AsideDisplayItem.SITE_INFO,
19076
- AsideDisplayItem.PREFERENCE
19077
- ];
19078
- default:
19079
- return [
19080
- AsideDisplayItem.LINK,
19081
- AsideDisplayItem.SITE_INFO,
19082
- AsideDisplayItem.PREFERENCE
19083
- ];
18840
+ const showLangSetting = computed(() => {
18841
+ if (props.showLangSetting !== void 0) return props.showLangSetting;
18842
+ return true;
18843
+ });
18844
+ const isDarkTheme = computed(() => currentTheme.value === "black");
18845
+ const newTagSrc = computed(() => isDarkTheme.value ? newTagDarkImg : newTagImg);
18846
+ const copyright = computed(() => createSetting().copyright);
18847
+ computed(() => `© ${(/* @__PURE__ */ new Date()).getFullYear()} ${t2("gitCodeLayout.home.companyInformationAtomgit")}`);
18848
+ computed(() => `https://beian.mps.gov.cn/#/query/webSearch?code=${copyright.value.beian}`);
18849
+ computed(() => transformUrl("https://docs.gitcode.com/docs/help/home/aboutus/"));
18850
+ computed(
18851
+ () => copyright.value.beian_url || "https://www.zhipin.com/gongsi/job/b1eccc6dba1cc0d41Hd60tW0GVc~.html?ka=company-jobs"
18852
+ );
18853
+ const siteShortcutLinks = computed(() => [
18854
+ {
18855
+ name: t2("gitCodeLayout.home.informationCenter"),
18856
+ url: transformUrl("https://news.gitcode.com/news"),
18857
+ icon: "newspaper"
18858
+ },
18859
+ {
18860
+ name: t2("gitCodeLayout.header.helpDocument"),
18861
+ url: transformUrl("https://docs.gitcode.com/docs/help/home/"),
18862
+ icon: "book-open"
18863
+ },
18864
+ {
18865
+ name: t2("gitCodeLayout.home.feedbackCenter"),
18866
+ url: transformUrl("https://gitcode.com/GitCode-official-team/GitCode-Docs/issues"),
18867
+ icon: "message-square"
18868
+ },
18869
+ {
18870
+ name: "OpenAPI",
18871
+ url: transformUrl("https://docs.gitcode.com/docs/apis/"),
18872
+ icon: "braces"
19084
18873
  }
18874
+ ]);
18875
+ const loading = ref(false);
18876
+ const localChannels = ref([]);
18877
+ const channelsList = computed(() => {
18878
+ if (props.channels && props.channels.length > 0) {
18879
+ return props.channels;
18880
+ }
18881
+ return localChannels.value;
19085
18882
  });
19086
- const isModuleVisible = (auth) => {
19087
- return visibleItems.value.includes(auth);
19088
- };
19089
- computed(() => (userInfo == null ? void 0 : userInfo.username) || JSON.parse(localStorage$2.getItem("userInfo") || "{}").username);
19090
- const showPreferencesSetting = computed(() => {
19091
- if (props.showPreferencesSetting !== void 0) return props.showPreferencesSetting;
19092
- return (route == null ? void 0 : route.name) !== AICopilot_ROUTE_NAME && isModuleVisible(AsideDisplayItem.PREFERENCE);
18883
+ const currentChannelId = computed(() => {
18884
+ var _a;
18885
+ return props.modelValue || props.activeChannel || ((_a = route == null ? void 0 : route.query) == null ? void 0 : _a.tn) || "";
19093
18886
  });
19094
- const handleScroll = () => {
19095
- isScroll.value = true;
19096
- if (timer.value) clearTimeout(timer.value);
19097
- timer.value = setTimeout(() => {
19098
- isScroll.value = false;
19099
- }, 1e3);
19100
- };
19101
- const handleMouseLeave = () => {
19102
- isScroll.value = false;
19103
- };
19104
- const handleAsideMenuExpo = (type) => {
19105
- if (type === "expo") {
19106
- useReport2(REPO_EVENT.SHOW, { module_name: ASIDE_MENU_REPO.ASIDEEXPO });
18887
+ const recommendedChannelId = computed(() => {
18888
+ var _a;
18889
+ return ((_a = channelsList.value[0]) == null ? void 0 : _a.object_id) ?? "default";
18890
+ });
18891
+ function isRecommendedChannel(item) {
18892
+ return item.object_id === recommendedChannelId.value || item.object_id === "default" || item.name === "推荐" || item.name === "热门推荐";
18893
+ }
18894
+ function getItemName(item) {
18895
+ if (isEn.value) {
18896
+ return item.name_en || item.name || "";
19107
18897
  }
19108
- };
19109
- const getAreaItem = (item) => {
19110
- return item.filter((item2) => {
19111
- if (item2.left_menu_url === "/dashboard/downloads") {
19112
- if (!globalStore.value.downloadHistoryVisible) {
19113
- return false;
19114
- }
19115
- }
19116
- if (item2.left_menu_url === "/dashboard/downloads?tab=view") {
19117
- if (!globalStore.value.browseHistoryVisible) {
19118
- return false;
19119
- }
19120
- }
19121
- if (item2.select_scene && item2.select_scene.length && !item2.select_scene.includes(props.sceneValue)) {
19122
- return false;
19123
- }
19124
- return true;
19125
- }).map((item2) => {
19126
- if (props.asideSetShowLittle) {
19127
- return {
19128
- ...item2,
19129
- left_menu_name_cn: item2.left_menu_name_cn_shrink,
19130
- left_menu_name_en: item2.left_menu_name_en_shrink
19131
- };
19132
- }
19133
- return item2;
19134
- });
19135
- };
19136
- const getUserGroupChatServerList = async () => {
18898
+ return item.name || "";
18899
+ }
18900
+ function getItemDesc(item) {
18901
+ if (isEn.value) {
18902
+ return item.desc_en || item.desc || "";
18903
+ }
18904
+ return item.desc || item.desc_en || "";
18905
+ }
18906
+ function getPrefixLogo(item) {
18907
+ const raw = item;
18908
+ if (isDarkTheme.value) {
18909
+ const darkIcon = raw.dark_icon || raw.icon_dark;
18910
+ if (typeof darkIcon === "string" && darkIcon) return darkIcon;
18911
+ }
18912
+ const icon = raw.icon || raw.pre_logo;
18913
+ if (typeof icon === "string" && icon) return icon;
18914
+ const logo = raw.channelPrefixLogo;
18915
+ if (typeof (logo == null ? void 0 : logo.logoUrl) === "string" && logo.logoUrl) return logo.logoUrl;
18916
+ return "";
18917
+ }
18918
+ function getPrefixLogoLink(item) {
18919
+ const raw = item;
18920
+ if (typeof raw.pre_logo_jump_url === "string" && raw.pre_logo_jump_url) {
18921
+ return raw.pre_logo_jump_url;
18922
+ }
18923
+ const logo = raw.channelPrefixLogo;
18924
+ if (typeof (logo == null ? void 0 : logo.logoLink) === "string" && logo.logoLink) {
18925
+ return logo.logoLink;
18926
+ }
18927
+ return "";
18928
+ }
18929
+ function isUrl(str) {
18930
+ return /^(https?:)?\/\//.test(str) || str.startsWith("/");
18931
+ }
18932
+ function onPrefixLogoClick(event, item) {
18933
+ const link = getPrefixLogoLink(item);
18934
+ if (!link) return;
18935
+ event.stopPropagation();
18936
+ if (typeof window !== "undefined") {
18937
+ window.open(link, "_blank", "noopener,noreferrer");
18938
+ }
18939
+ }
18940
+ function selectChannel(item) {
19137
18941
  var _a;
19138
- const res = await API.getGroupChatServerList();
19139
- const data = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.data) || [];
19140
- serverList.value = data;
19141
- };
19142
- getUserGroupChatServerList();
19143
- const displayArea = computed(() => {
19144
- return area.value.filter((item) => {
19145
- return getAreaItem(item).length;
18942
+ void useReport2(REPO_EVENT.CLICK, {
18943
+ Channel_name: item.name,
18944
+ module_name: "频道切换",
18945
+ channel_id: item.object_id,
18946
+ channel_name: item.name
19146
18947
  });
19147
- });
19148
- const toGroupChat = () => {
19149
- var _a;
19150
- window.open(transformUrl(layoutConfig2.VITE_HOST) + "/im?server_id=" + ((_a = serverList.value[0]) == null ? void 0 : _a.server_id), "_blank");
19151
- };
19152
- watch(() => area.value, (newVal) => {
19153
- console.log("area", newVal);
19154
- });
19155
- return (_ctx, _cache) => {
19156
- return openBlock(), createBlock(unref(Aside), {
19157
- class: normalizeClass(["config-aside-content", { "side-bar-content-shot": _ctx.asideSetShowLittle }])
19158
- }, {
19159
- default: withCtx(() => [
19160
- createElementVNode("div", {
19161
- class: normalizeClass(["config-aside__content", { "side-bar-content-shot": _ctx.asideSetShowLittle, "shot-isCh": !unref(isEn) }])
19162
- }, [
19163
- withDirectives((openBlock(), createElementBlock("div", _hoisted_1$i, [
19164
- createElementVNode("div", {
19165
- class: normalizeClass(["scroll-content config-aside__scroll", { scroll: isScroll.value }]),
19166
- onScroll: handleScroll,
19167
- onMouseleave: handleMouseLeave
19168
- }, [
19169
- unref(sideLoading) ? (openBlock(), createElementBlock("div", _hoisted_2$c, [
19170
- createVNode(unref(Skeleton), {
19171
- loading: unref(sideLoading),
19172
- row: 4
19173
- }, null, 8, ["loading"])
19174
- ])) : (openBlock(), createElementBlock("div", _hoisted_3$c, [
19175
- (openBlock(true), createElementBlock(Fragment, null, renderList(displayArea.value, (item, index2) => {
19176
- return openBlock(), createElementBlock(Fragment, {
19177
- key: item.id
19178
- }, [
19179
- createVNode(Area, {
19180
- list: getAreaItem(item),
19181
- isLogin: _ctx.isLogin,
19182
- slotKeys: layoutSlotKeys.value,
19183
- sceneValue: _ctx.sceneValue,
19184
- asideSetShowLittle: _ctx.asideSetShowLittle
19185
- }, createSlots({ _: 2 }, [
19186
- renderList(layoutSlotKeys.value, (key) => {
19187
- return {
19188
- name: key,
19189
- fn: withCtx(() => [
19190
- renderSlot(_ctx.$slots, key, {}, void 0, true)
19191
- ])
19192
- };
19193
- })
19194
- ]), 1032, ["list", "isLogin", "slotKeys", "sceneValue", "asideSetShowLittle"]),
19195
- !index2 && !unref(isPhone)() && serverList.value.length ? (openBlock(), createElementBlock("div", {
19196
- key: 0,
19197
- class: "group-discussion",
19198
- onMouseenter: _cache[0] || (_cache[0] = ($event) => isGroupHover.value = true),
19199
- onMouseleave: _cache[1] || (_cache[1] = ($event) => isGroupHover.value = false),
19200
- onClick: toGroupChat
19201
- }, [
19202
- createVNode(GIcon, {
19203
- name: isGroupHover.value ? "gt-plane-users-black" : "gt-line-users",
19204
- size: "16"
19205
- }, null, 8, ["name"]),
19206
- _cache[2] || (_cache[2] = createElementVNode("span", null, "群组讨论", -1))
19207
- ], 32)) : createCommentVNode("", true),
19208
- !_ctx.asideSetShowLittle && index2 !== displayArea.value.length - 1 ? (openBlock(), createElementBlock("hr", _hoisted_4$9)) : createCommentVNode("", true)
19209
- ], 64);
19210
- }), 128)),
19211
- !_ctx.asideSetShowLittle && isModuleVisible(unref(AsideDisplayItem).LINK) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
19212
- _cache[3] || (_cache[3] = createElementVNode("hr", { class: "line line--my" }, null, -1)),
19213
- createVNode(SubMenuList)
19214
- ], 64)) : createCommentVNode("", true)
19215
- ])),
19216
- !_ctx.asideSetShowLittle && isModuleVisible(unref(AsideDisplayItem).SITE_INFO) ? (openBlock(), createBlock(ContactInfo, { key: 2 })) : createCommentVNode("", true)
19217
- ], 34),
19218
- showPreferencesSetting.value ? (openBlock(), createElementBlock("div", {
19219
- key: 0,
19220
- class: normalizeClass(["aside-footer-tools", { "aside-footer-tools-little": _ctx.asideSetShowLittle }])
19221
- }, [
19222
- createVNode(Settings, {
19223
- "show-lang-setting": _ctx.showLangSetting,
19224
- "show-theme-setting": _ctx.showThemeSetting,
19225
- asideSetShowLittle: _ctx.asideSetShowLittle
19226
- }, null, 8, ["show-lang-setting", "show-theme-setting", "asideSetShowLittle"])
19227
- ], 2)) : createCommentVNode("", true)
19228
- ])), [
19229
- [unref(vElementExposure), { trigger: (type) => handleAsideMenuExpo(type) }]
19230
- ])
19231
- ], 2)
19232
- ]),
19233
- _: 3
19234
- }, 8, ["class"]);
19235
- };
19236
- }
19237
- });
19238
- const ConfigAideContent = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-vue-layout-gitcode"]]);
19239
- const _hoisted_1$h = { class: "aside-drawer-header" };
19240
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
19241
- __name: "index",
19242
- props: {
19243
- sceneValue: { default: SceneValue.home },
19244
- disableFlatMode: { type: Boolean, default: false },
19245
- userInfo: { default: () => ({}) },
19246
- isLogin: { type: Boolean },
19247
- request: { type: Function, default: proxyService },
19248
- globalStore: { default: () => ({
19249
- httpStatus: 200
19250
- }) },
19251
- independence: { type: Boolean, default: false },
19252
- showPreferencesSetting: { type: Boolean, default: void 0 },
19253
- showThemeSetting: { type: Boolean, default: void 0 },
19254
- showLangSetting: { type: Boolean, default: void 0 },
19255
- collapseMode: { type: Boolean, default: false },
19256
- slotKeys: { default: () => [] }
19257
- },
19258
- setup(__props) {
19259
- const route = useRoute();
19260
- const router2 = useRouter();
19261
- const layoutConfig2 = useLayoutConfig();
19262
- async function handleDrawerLogoClick(e) {
19263
- if (props.independence) return;
19264
- if (e.metaKey || e.ctrlKey || e.shiftKey || e.button !== 0) return;
19265
- let href;
19266
- try {
19267
- href = router2.resolve({ name: "home" }).href;
19268
- } catch {
18948
+ emit("update:modelValue", item.object_id);
18949
+ emit("update:activeChannel", item.object_id);
18950
+ emit("channelChange", item);
18951
+ emit("select", item);
18952
+ (_a = props.onChannelChange) == null ? void 0 : _a.call(props, item);
18953
+ if (item.url) {
18954
+ if (typeof window !== "undefined") {
18955
+ const targetUrl = isUrl(item.url) ? transformUrl(item.url) : item.url;
18956
+ window.open(targetUrl, "_blank", "noopener,noreferrer");
18957
+ }
19269
18958
  return;
19270
18959
  }
19271
- e.preventDefault();
19272
- try {
19273
- const migrated = await isMigratedHref(href);
19274
- if (migrated) {
19275
- window.open(href, "_self");
19276
- } else {
19277
- router2.push({ name: "home" });
19278
- }
19279
- } catch {
19280
- router2.push({ name: "home" });
18960
+ if (typeof window !== "undefined") {
18961
+ const baseHost = (layoutConfig2.VITE_HOST || "").replace(/\/+$/, "");
18962
+ const jumpUrl = transformUrl(`${baseHost}/?tn=${item.object_id}`);
18963
+ window.location.href = jumpUrl;
19281
18964
  }
19282
18965
  }
19283
- const { headerHeight: headerHeight2 } = useHeaderHeight();
19284
- const props = __props;
19285
- const { useReport: useReport2 } = useRequestReport(props.request, props.globalStore);
19286
- provide(
19287
- "globalStore",
19288
- computed(() => props.globalStore)
19289
- );
19290
- provide("request", props.request);
19291
- provide(
19292
- "userInfo",
19293
- computed(() => props.userInfo)
19294
- );
19295
- provide("useReport", useReport2);
19296
- computed(() => {
19297
- if (route.meta.showBgColor) return true;
19298
- return false;
19299
- });
19300
- const logoConfig = getCurrentLogoMap();
19301
- const logoStyle = computed(() => {
19302
- const isBlackTheme = currentTheme.value === "black";
19303
- const logoUrl = isBlackTheme ? logoConfig.siteLogoWhite : logoConfig.siteLogoDark;
19304
- return {
19305
- backgroundImage: `url(${logoUrl})`,
19306
- backgroundRepeat: "no-repeat",
19307
- backgroundPosition: "0 center",
19308
- backgroundSize: "contain"
19309
- };
19310
- });
19311
- const sizeStore = usePageResize();
19312
- const asideSetShow = computed(() => {
19313
- return (props.sceneValue === SceneValue.home && !sizeStore.isMobile.value || props.collapseMode) && !props.disableFlatMode;
18966
+ const scrollContainerRef = ref(null);
18967
+ const isCollapsed = ref(true);
18968
+ const isMounted = ref(false);
18969
+ const maxVisibleCount = ref(999);
18970
+ const visibleChannels = computed(() => {
18971
+ if (!isMounted.value || !isCollapsed.value) return channelsList.value;
18972
+ const count = maxVisibleCount.value;
18973
+ if (count >= channelsList.value.length) return channelsList.value;
18974
+ const activeIndex = channelsList.value.findIndex((item) => item.object_id === currentChannelId.value);
18975
+ const displayCount = activeIndex >= count ? activeIndex + 1 : count;
18976
+ return channelsList.value.slice(0, displayCount);
19314
18977
  });
19315
- provide("asideSetShow", asideSetShow);
19316
- console.log("indexasideSetShow", asideSetShow.value);
19317
- const isHome = computed(() => {
19318
- return props.sceneValue === SceneValue.home && ["home", "issues", "kanban", "discussionCreated", "merge", "dashboard", "marketplace", "marketplaceDetail"].includes(route == null ? void 0 : route.name);
19319
- });
19320
- const asideSize = computed(() => {
19321
- if (props.collapseMode) {
19322
- return ASIDE_MENU_MODE.collapse;
19323
- } else {
19324
- return ASIDE_MENU_MODE.default;
18978
+ function expandChannels() {
18979
+ isCollapsed.value = false;
18980
+ }
18981
+ function collapseChannels() {
18982
+ isCollapsed.value = true;
18983
+ }
18984
+ function getItemHeight(item) {
18985
+ let height = 40;
18986
+ if (getItemDesc(item)) {
18987
+ height += 16;
19325
18988
  }
19326
- });
19327
- const asideSetShowLittle = useStorage("asideSetShowLittle", false);
19328
- const asideSetShowLittleMode = computed(() => {
19329
- if (props.collapseMode) {
19330
- return true;
19331
- } else if (isHome.value) {
19332
- return false;
19333
- } else {
19334
- return asideSetShowLittle.value;
18989
+ if (item.group && item.groupIndex === 0) {
18990
+ height += 32;
19335
18991
  }
19336
- });
19337
- const asideDefaultWidth = useStorage("asideDefaultWidth", sizeStore.isMobile.value ? 0 : asideSize.value.expand);
19338
- const mainMarginLeftWidth = computed(() => {
19339
- if (!asideSetShow.value || sizeStore.isMobile.value) {
19340
- return 0;
18992
+ if (item.group && typeof item.group.len === "number" && item.group.len - 1 === item.groupIndex) {
18993
+ height += 12;
19341
18994
  }
19342
- if (isHome.value) {
19343
- return 240;
18995
+ return height;
18996
+ }
18997
+ function getScrollElement() {
18998
+ if (!scrollContainerRef.value) return null;
18999
+ if ("containerEl" in scrollContainerRef.value && scrollContainerRef.value.containerEl) {
19000
+ return scrollContainerRef.value.containerEl;
19344
19001
  }
19345
- if (props.collapseMode) {
19346
- return asideDefaultWidth.value >= asideSize.value.expand ? asideSize.value.expand : asideDefaultWidth.value;
19347
- } else {
19348
- return asideDefaultWidth.value < asideSize.value.expand ? asideSize.value.collapse : asideDefaultWidth.value;
19002
+ return scrollContainerRef.value;
19003
+ }
19004
+ function calculateVisibleCount() {
19005
+ if (typeof window === "undefined") return;
19006
+ const containerEl = getScrollElement();
19007
+ if (!containerEl) return;
19008
+ const containerHeight = containerEl.getBoundingClientRect().height;
19009
+ const availableHeight = containerHeight - 16;
19010
+ const toggleHeight = 56;
19011
+ const footerHeight = 112;
19012
+ const totalHeight = channelsList.value.reduce((acc, item) => acc + getItemHeight(item), 0);
19013
+ if (totalHeight + footerHeight <= availableHeight) {
19014
+ maxVisibleCount.value = channelsList.value.length;
19015
+ return;
19349
19016
  }
19350
- });
19351
- const asideVisible = ref(false);
19352
- const handleAsideVisible = (val) => {
19353
- asideVisible.value = val;
19354
- emitEvent("handleAsideVisible", val);
19355
- };
19356
- const handleClickMenu = () => {
19357
- if (sizeStore.isMobile.value || !asideSetShow.value) {
19358
- asideVisible.value = !asideVisible.value;
19359
- emitEvent("handleAsideVisible", asideVisible.value);
19360
- } else {
19361
- const { collapse, expand } = asideSize.value;
19362
- asideDefaultWidth.value = asideDefaultWidth.value >= expand ? collapse : expand;
19363
- emitEvent("handleAsideVisible", asideDefaultWidth.value >= expand);
19364
- asideSetShowLittle.value = props.collapseMode || !(asideDefaultWidth.value >= expand);
19017
+ const limitHeight = availableHeight - toggleHeight - footerHeight;
19018
+ let accumulatedHeight = 0;
19019
+ let count = 0;
19020
+ for (const item of channelsList.value) {
19021
+ const h2 = getItemHeight(item);
19022
+ if (accumulatedHeight + h2 > limitHeight) {
19023
+ break;
19024
+ }
19025
+ accumulatedHeight += h2;
19026
+ count++;
19365
19027
  }
19366
- };
19367
- const initHomePageAside = () => {
19368
- if (isHome.value) {
19369
- asideVisible.value = false;
19370
- asideDefaultWidth.value = 240;
19371
- asideSetShowLittle.value = true;
19372
- emitEvent("handleAsideVisible", asideVisible.value);
19028
+ maxVisibleCount.value = Math.max(3, count);
19029
+ }
19030
+ async function fetchChannelsData() {
19031
+ var _a, _b;
19032
+ if (props.channels && props.channels.length > 0) return;
19033
+ loading.value = true;
19034
+ try {
19035
+ const [channelsRes, promoRes] = await Promise.all([
19036
+ API.homeFirstChannel(),
19037
+ API.getPromoSlot()
19038
+ ]);
19039
+ const rawChannels = ((_a = channelsRes == null ? void 0 : channelsRes.data) == null ? void 0 : _a.data) || [];
19040
+ const promoBlocks = ((_b = promoRes == null ? void 0 : promoRes.data) == null ? void 0 : _b.data) || [];
19041
+ const merged = mergeChannelsWithRecommendBlocks(rawChannels, promoBlocks);
19042
+ localChannels.value = merged;
19043
+ } catch (err) {
19044
+ console.error("[GitCodeAsideV2] fetchChannelsData error:", err);
19045
+ } finally {
19046
+ loading.value = false;
19047
+ void nextTick(() => calculateVisibleCount());
19373
19048
  }
19374
- };
19375
- initHomePageAside();
19049
+ }
19050
+ let resizeObserver = null;
19376
19051
  onMounted(() => {
19377
- addEventListener("toggleAsideMenuByHamburger", () => {
19378
- handleClickMenu();
19052
+ isMounted.value = true;
19053
+ void fetchChannelsData();
19054
+ void nextTick(() => {
19055
+ calculateVisibleCount();
19379
19056
  });
19057
+ if (typeof ResizeObserver !== "undefined") {
19058
+ resizeObserver = new ResizeObserver(() => {
19059
+ calculateVisibleCount();
19060
+ });
19061
+ const containerEl = getScrollElement();
19062
+ if (containerEl) {
19063
+ resizeObserver.observe(containerEl);
19064
+ } else if (typeof document !== "undefined") {
19065
+ resizeObserver.observe(document.body);
19066
+ }
19067
+ } else if (typeof window !== "undefined") {
19068
+ window.addEventListener("resize", calculateVisibleCount);
19069
+ }
19380
19070
  });
19381
19071
  onBeforeUnmount(() => {
19382
- offEvent("handleAsideVisible");
19383
- offEvent("toggleAsideMenuByHamburger");
19072
+ if (resizeObserver) {
19073
+ resizeObserver.disconnect();
19074
+ resizeObserver = null;
19075
+ } else if (typeof window !== "undefined") {
19076
+ window.removeEventListener("resize", calculateVisibleCount);
19077
+ }
19384
19078
  });
19079
+ watch(
19080
+ () => props.channels,
19081
+ () => {
19082
+ void nextTick(() => calculateVisibleCount());
19083
+ },
19084
+ { deep: true }
19085
+ );
19385
19086
  return (_ctx, _cache) => {
19386
- return asideSetShow.value ? (openBlock(), createBlock(ConfigAideContent, {
19387
- key: 0,
19388
- class: normalizeClass(["left-side-bar", { oldWhite: asideSetShowLittleMode.value, higherZIndex: unref(SITE_STATUS).DISABLE }]),
19389
- style: normalizeStyle({ width: mainMarginLeftWidth.value + "px", top: unref(headerHeight2) + "px" }),
19390
- sceneValue: _ctx.sceneValue,
19391
- asideDefaultWidth: mainMarginLeftWidth.value,
19392
- asideSetShowLittle: asideSetShowLittleMode.value,
19393
- isLogin: _ctx.isLogin,
19394
- showPreferencesSetting: _ctx.showPreferencesSetting,
19395
- showThemeSetting: _ctx.showThemeSetting,
19396
- showLangSetting: _ctx.showLangSetting,
19397
- independence: _ctx.independence,
19398
- slotKeys: _ctx.slotKeys,
19399
- collapseMode: _ctx.collapseMode
19400
- }, createSlots({ _: 2 }, [
19401
- renderList(_ctx.slotKeys, (key) => {
19402
- return {
19403
- name: key,
19404
- fn: withCtx(() => [
19405
- renderSlot(_ctx.$slots, key, {}, void 0, true)
19406
- ])
19407
- };
19408
- })
19409
- ]), 1032, ["class", "style", "sceneValue", "asideDefaultWidth", "asideSetShowLittle", "isLogin", "showPreferencesSetting", "showThemeSetting", "showLangSetting", "independence", "slotKeys", "collapseMode"])) : (openBlock(), createBlock(unref(Drawer), {
19410
- key: 1,
19411
- modelValue: asideVisible.value,
19412
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => asideVisible.value = $event),
19413
- position: "left",
19414
- "lock-scroll": "",
19415
- style: normalizeStyle([{ "top": "0", "max-height": "100%" }, { width: "240px", overflowY: "hidden" }]),
19416
- class: "draw-side-bar"
19417
- }, {
19418
- default: withCtx(() => [
19419
- createElementVNode("div", _hoisted_1$h, [
19420
- createVNode(GLink, {
19421
- class: "g-toolbar-left-logo",
19422
- style: normalizeStyle(logoStyle.value),
19423
- to: _ctx.independence ? "" : { name: "home" },
19424
- href: _ctx.independence ? unref(transformUrl)(unref(layoutConfig2).VITE_HOST) : "",
19425
- onClickCapture: handleDrawerLogoClick
19426
- }, null, 8, ["style", "to", "href"]),
19427
- createVNode(unref(Button), {
19428
- class: "draw-side-bar-close",
19429
- icon: "close",
19430
- onClick: _cache[0] || (_cache[0] = ($event) => handleAsideVisible(false)),
19431
- variant: "text"
19432
- })
19433
- ]),
19434
- createVNode(ConfigAideContent, mergeProps(props, {
19435
- sceneValue: _ctx.sceneValue,
19436
- asideDefaultWidth: 240,
19437
- isLogin: _ctx.isLogin,
19438
- showPreferencesSetting: _ctx.showPreferencesSetting,
19439
- showThemeSetting: _ctx.showThemeSetting,
19440
- showLangSetting: _ctx.showLangSetting,
19441
- independence: _ctx.independence,
19442
- slotKeys: _ctx.slotKeys
19443
- }), null, 16, ["sceneValue", "isLogin", "showPreferencesSetting", "showThemeSetting", "showLangSetting", "independence", "slotKeys"])
19444
- ]),
19445
- _: 1
19446
- }, 8, ["modelValue"]));
19447
- };
19448
- }
19449
- });
19450
- const GitCodeAside = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-vue-layout-gitcode"]]);
19451
- const _hoisted_1$g = { class: "g-toolbar allow-click-stop" };
19452
- const _hoisted_2$b = { class: "g-toolbar-left allow-click-stop" };
19453
- const _hoisted_3$b = { class: "g-toolbar-custom" };
19454
- const _hoisted_4$8 = { class: "enterprise-name" };
19455
- const _hoisted_5$5 = { class: "enterprise-flag" };
19456
- const _hoisted_6$4 = { class: "search-avatar" };
19457
- const _hoisted_7$3 = { class: "g-toolbar-right allow-click-stop" };
19458
- const _hoisted_8$3 = {
19459
- key: 0,
19460
- class: "g-header-body"
19461
- };
19462
- const _hoisted_9$3 = { class: "g-header-body-left" };
19463
- const _hoisted_10$3 = { class: "g-header-body-right" };
19464
- const _hoisted_11$3 = { key: 1 };
19465
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
19466
- ...{
19467
- name: "EnterpriseHeader"
19468
- },
19469
- __name: "EnterpriseHeader",
19470
- props: {
19471
- isLogin: { type: Boolean, default: false },
19472
- request: { type: Function, default: proxyService },
19473
- globalStore: { default: () => ({
19474
- httpStatus: 200
19475
- }) },
19476
- loginSuccess: {},
19477
- enterpriseInfo: { default: () => ({
19478
- avatar: "",
19479
- name: ""
19480
- }) },
19481
- loginOutFinish: {},
19482
- orgInfo: { default: () => ({
19483
- avatar: "",
19484
- name: ""
19485
- }) },
19486
- userInfo: { default: () => ({}) },
19487
- headerFunctions: {},
19488
- openHarmonyGuide: { type: Boolean },
19489
- headerBorder: { type: Boolean, default: false },
19490
- independence: { type: Boolean, default: false },
19491
- userMenus: {},
19492
- loginChildComponents: {}
19493
- },
19494
- emits: ["followDevCommunity", "followUser", "resetPwdDirectlySuccess"],
19495
- setup(__props, { emit: __emit }) {
19496
- var _a;
19497
- const route = useRoute();
19087
+ return openBlock(), createElementBlock("div", {
19088
+ class: normalizeClass(["gitcode-aside-v2-content home-channel-navigation", { "is-single-col": props.singleCol }])
19089
+ }, [
19090
+ createElementVNode("div", _hoisted_1$k, [
19091
+ createVNode(ScrollActiveContainer, {
19092
+ ref_key: "scrollContainerRef",
19093
+ ref: scrollContainerRef,
19094
+ tag: "nav",
19095
+ wrapperClass: "home-channel-side-nav__scroll-wrapper",
19096
+ contentClass: "home-channel-side-nav__scroll",
19097
+ "aria-label": "首页频道"
19098
+ }, {
19099
+ default: withCtx(() => [
19100
+ loading.value && (!channelsList.value || channelsList.value.length === 0) ? (openBlock(), createElementBlock("ul", _hoisted_2$e, [
19101
+ (openBlock(), createElementBlock(Fragment, null, renderList(skeletonItems, (sk, idx) => {
19102
+ return openBlock(), createElementBlock(Fragment, {
19103
+ key: `skeleton-${idx}`
19104
+ }, [
19105
+ sk.isGroupTitle ? (openBlock(), createElementBlock("div", _hoisted_3$d, [
19106
+ createElementVNode("span", {
19107
+ class: "home-channel-side-nav__skeleton-block home-channel-side-nav__group-skeleton",
19108
+ style: normalizeStyle({ width: sk.width })
19109
+ }, null, 4)
19110
+ ])) : (openBlock(), createElementBlock("li", {
19111
+ key: 1,
19112
+ class: normalizeClass(["home-channel-side-nav__row home-channel-side-nav__row--skeleton", { "is-group-last": sk.isGroupLast }])
19113
+ }, [
19114
+ createElementVNode("div", {
19115
+ class: normalizeClass(["home-channel-side-nav__item home-channel-side-nav__item--skeleton", { "has-desc": !!sk.descWidth }])
19116
+ }, [
19117
+ _cache[0] || (_cache[0] = createElementVNode("span", { class: "home-channel-side-nav__skeleton-block home-channel-side-nav__logo-skeleton" }, null, -1)),
19118
+ createElementVNode("div", _hoisted_4$a, [
19119
+ createElementVNode("span", _hoisted_5$6, [
19120
+ createElementVNode("span", {
19121
+ class: "home-channel-side-nav__skeleton-block home-channel-side-nav__label-skeleton",
19122
+ style: normalizeStyle({ width: sk.width })
19123
+ }, null, 4)
19124
+ ]),
19125
+ sk.descWidth ? (openBlock(), createElementBlock("span", {
19126
+ key: 0,
19127
+ class: "home-channel-side-nav__skeleton-block home-channel-side-nav__desc-skeleton",
19128
+ style: normalizeStyle({ width: sk.descWidth })
19129
+ }, null, 4)) : createCommentVNode("", true)
19130
+ ])
19131
+ ], 2)
19132
+ ], 2))
19133
+ ], 64);
19134
+ }), 64))
19135
+ ])) : (openBlock(), createElementBlock("ul", _hoisted_6$5, [
19136
+ (openBlock(true), createElementBlock(Fragment, null, renderList(visibleChannels.value, (item) => {
19137
+ return openBlock(), createElementBlock(Fragment, {
19138
+ key: item.object_id
19139
+ }, [
19140
+ item.group && item.groupIndex === 0 ? (openBlock(), createElementBlock("div", _hoisted_7$4, toDisplayString$1(isEn.value && item.group.name_en ? item.group.name_en : item.group.name), 1)) : createCommentVNode("", true),
19141
+ createElementVNode("li", {
19142
+ class: normalizeClass(["home-channel-side-nav__row", {
19143
+ "is-group-last": item.group && typeof item.group.len === "number" && item.group.len - 1 === item.groupIndex
19144
+ }])
19145
+ }, [
19146
+ createElementVNode("button", {
19147
+ type: "button",
19148
+ class: normalizeClass(["home-channel-side-nav__item", {
19149
+ "is-active": currentChannelId.value === item.object_id
19150
+ }]),
19151
+ "aria-current": currentChannelId.value === item.object_id ? "page" : void 0,
19152
+ title: getItemDesc(item) || void 0,
19153
+ onClick: ($event) => selectChannel(item)
19154
+ }, [
19155
+ isRecommendedChannel(item) ? (openBlock(), createBlock(GIcon, {
19156
+ key: 0,
19157
+ name: "gt-tuijian",
19158
+ size: "18px",
19159
+ class: "home-channel-side-nav__logo"
19160
+ })) : getPrefixLogo(item) && isUrl(getPrefixLogo(item)) ? (openBlock(), createElementBlock("img", {
19161
+ key: 1,
19162
+ src: getPrefixLogo(item),
19163
+ alt: item.name,
19164
+ class: "home-channel-side-nav__logo",
19165
+ onClick: ($event) => onPrefixLogoClick($event, item)
19166
+ }, null, 8, _hoisted_9$4)) : getPrefixLogo(item) ? (openBlock(), createBlock(GIcon, {
19167
+ key: 2,
19168
+ name: getPrefixLogo(item),
19169
+ size: "18px",
19170
+ class: "home-channel-side-nav__logo",
19171
+ onClick: ($event) => onPrefixLogoClick($event, item)
19172
+ }, null, 8, ["name", "onClick"])) : createCommentVNode("", true),
19173
+ createElementVNode("div", _hoisted_10$4, [
19174
+ createElementVNode("span", _hoisted_11$4, [
19175
+ createElementVNode("span", _hoisted_12$3, toDisplayString$1(getItemName(item)), 1),
19176
+ item.is_new ? (openBlock(), createElementBlock("img", {
19177
+ key: 0,
19178
+ src: newTagSrc.value,
19179
+ alt: "New",
19180
+ class: "home-channel-side-nav__new-tag"
19181
+ }, null, 8, _hoisted_13$1)) : createCommentVNode("", true)
19182
+ ]),
19183
+ getItemDesc(item) ? (openBlock(), createElementBlock("span", {
19184
+ key: 0,
19185
+ class: "home-channel-side-nav__desc",
19186
+ title: getItemDesc(item)
19187
+ }, toDisplayString$1(getItemDesc(item)), 9, _hoisted_14$1)) : createCommentVNode("", true)
19188
+ ]),
19189
+ !isRecommendedChannel(item) && item.children && item.children.length > 0 ? (openBlock(), createElementBlock("svg", _hoisted_15$1, _cache[1] || (_cache[1] = [
19190
+ createElementVNode("path", { d: "m9 18 6-6-6-6" }, null, -1)
19191
+ ]))) : createCommentVNode("", true)
19192
+ ], 10, _hoisted_8$4)
19193
+ ], 2)
19194
+ ], 64);
19195
+ }), 128))
19196
+ ])),
19197
+ isCollapsed.value && channelsList.value.length > maxVisibleCount.value ? (openBlock(), createElementBlock("button", {
19198
+ key: 2,
19199
+ type: "button",
19200
+ class: "home-channel-side-nav__more-toggle",
19201
+ onClick: expandChannels
19202
+ }, [
19203
+ _cache[2] || (_cache[2] = createElementVNode("svg", {
19204
+ xmlns: "http://www.w3.org/2000/svg",
19205
+ width: "14",
19206
+ height: "14",
19207
+ viewBox: "0 0 24 24",
19208
+ fill: "none",
19209
+ stroke: "currentColor",
19210
+ "stroke-width": "2",
19211
+ "stroke-linecap": "round",
19212
+ "stroke-linejoin": "round",
19213
+ class: "home-channel-side-nav__more-icon"
19214
+ }, [
19215
+ createElementVNode("path", { d: "m6 9 6 6 6-6" })
19216
+ ], -1)),
19217
+ createElementVNode("span", null, toDisplayString$1(unref(t2)("gitCodeLayout.home.channel.moreOpenSource")), 1)
19218
+ ])) : createCommentVNode("", true),
19219
+ !isCollapsed.value && channelsList.value.length > maxVisibleCount.value ? (openBlock(), createElementBlock("button", {
19220
+ key: 3,
19221
+ type: "button",
19222
+ class: "home-channel-side-nav__more-collapse",
19223
+ onClick: collapseChannels
19224
+ }, [
19225
+ _cache[3] || (_cache[3] = createElementVNode("svg", {
19226
+ xmlns: "http://www.w3.org/2000/svg",
19227
+ width: "14",
19228
+ height: "14",
19229
+ viewBox: "0 0 24 24",
19230
+ fill: "none",
19231
+ stroke: "currentColor",
19232
+ "stroke-width": "2",
19233
+ "stroke-linecap": "round",
19234
+ "stroke-linejoin": "round",
19235
+ class: "home-channel-side-nav__more-icon"
19236
+ }, [
19237
+ createElementVNode("path", { d: "m18 15-6-6-6 6" })
19238
+ ], -1)),
19239
+ createElementVNode("span", null, toDisplayString$1(unref(t2)("gitCodeLayout.home.channel.collapseChannels")), 1)
19240
+ ])) : createCommentVNode("", true),
19241
+ createElementVNode("div", _hoisted_16$1, [
19242
+ _cache[8] || (_cache[8] = createElementVNode("div", { class: "home-channel-side-nav__footer-divider" }, null, -1)),
19243
+ createElementVNode("footer", _hoisted_17$1, [
19244
+ createElementVNode("nav", _hoisted_18$1, [
19245
+ (openBlock(true), createElementBlock(Fragment, null, renderList(siteShortcutLinks.value, (shortcut) => {
19246
+ return openBlock(), createElementBlock("a", {
19247
+ key: shortcut.name,
19248
+ class: "nav-site-shortcut",
19249
+ href: shortcut.url,
19250
+ target: "_blank",
19251
+ rel: "noopener noreferrer"
19252
+ }, [
19253
+ shortcut.icon === "newspaper" ? (openBlock(), createElementBlock("svg", _hoisted_20$1, _cache[4] || (_cache[4] = [
19254
+ createElementVNode("path", { d: "M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2" }, null, -1),
19255
+ createElementVNode("path", { d: "M18 14h-8" }, null, -1),
19256
+ createElementVNode("path", { d: "M15 18h-5" }, null, -1),
19257
+ createElementVNode("path", { d: "M10 6h8v4h-8V6Z" }, null, -1)
19258
+ ]))) : shortcut.icon === "book-open" ? (openBlock(), createElementBlock("svg", _hoisted_21$1, _cache[5] || (_cache[5] = [
19259
+ createElementVNode("path", { d: "M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" }, null, -1),
19260
+ createElementVNode("path", { d: "M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" }, null, -1)
19261
+ ]))) : shortcut.icon === "message-square" ? (openBlock(), createElementBlock("svg", _hoisted_22$1, _cache[6] || (_cache[6] = [
19262
+ createElementVNode("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }, null, -1)
19263
+ ]))) : (openBlock(), createElementBlock("svg", _hoisted_23$1, _cache[7] || (_cache[7] = [
19264
+ createElementVNode("path", { d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1" }, null, -1),
19265
+ createElementVNode("path", { d: "M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1" }, null, -1)
19266
+ ]))),
19267
+ createElementVNode("span", null, toDisplayString$1(shortcut.name), 1)
19268
+ ], 8, _hoisted_19$1);
19269
+ }), 128))
19270
+ ])
19271
+ ])
19272
+ ])
19273
+ ]),
19274
+ _: 1
19275
+ }, 512),
19276
+ showThemeSetting.value || showLangSetting.value ? (openBlock(), createElementBlock("div", _hoisted_24$1, [
19277
+ createElementVNode("div", _hoisted_25$1, [
19278
+ createVNode(AsideFooterTools, {
19279
+ "show-theme-setting": showThemeSetting.value,
19280
+ "show-lang-setting": showLangSetting.value,
19281
+ position: ["top-start", "top-end"]
19282
+ }, null, 8, ["show-theme-setting", "show-lang-setting"])
19283
+ ])
19284
+ ])) : createCommentVNode("", true)
19285
+ ])
19286
+ ], 2);
19287
+ };
19288
+ }
19289
+ });
19290
+ const AsideV2Content = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-vue-layout-gitcode"]]);
19291
+ const _hoisted_1$j = { class: "aside-drawer-header" };
19292
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
19293
+ ...{ name: "GitCodeAsideV2", inheritAttrs: false },
19294
+ __name: "index",
19295
+ props: {
19296
+ showThemeSetting: { type: Boolean, default: void 0 },
19297
+ showLangSetting: { type: Boolean, default: void 0 },
19298
+ collapseMode: { type: Boolean, default: false },
19299
+ sceneValue: { default: SceneValue.home },
19300
+ disableFlatMode: { type: Boolean, default: false },
19301
+ singleCol: { type: Boolean, default: false },
19302
+ channels: { default: void 0 },
19303
+ modelValue: { default: "" },
19304
+ activeChannel: { default: "" },
19305
+ userInfo: { default: () => ({}) },
19306
+ isLogin: { type: Boolean },
19307
+ request: { type: Function, default: proxyService },
19308
+ globalStore: { default: () => ({
19309
+ httpStatus: 200
19310
+ }) },
19311
+ independence: { type: Boolean, default: false },
19312
+ onChannelChange: { type: Function, default: void 0 }
19313
+ },
19314
+ emits: ["update:modelValue", "update:activeChannel", "channelChange", "select"],
19315
+ setup(__props, { emit: __emit }) {
19498
19316
  const props = __props;
19499
19317
  const emit = __emit;
19318
+ const route = useRoute();
19319
+ const router2 = useRouter();
19320
+ const layoutConfig2 = useLayoutConfig();
19321
+ async function handleDrawerLogoClick(e) {
19322
+ if (props.independence) return;
19323
+ if (e.metaKey || e.ctrlKey || e.shiftKey || e.button !== 0) return;
19324
+ let href;
19325
+ try {
19326
+ href = router2.resolve({ name: "home" }).href;
19327
+ } catch {
19328
+ return;
19329
+ }
19330
+ e.preventDefault();
19331
+ try {
19332
+ const migrated = await isMigratedHref(href);
19333
+ if (migrated) {
19334
+ window.open(href, "_self");
19335
+ } else {
19336
+ router2.push({ name: "home" });
19337
+ }
19338
+ } catch {
19339
+ router2.push({ name: "home" });
19340
+ }
19341
+ }
19342
+ const { headerHeight: headerHeight2 } = useHeaderHeight();
19500
19343
  const { useReport: useReport2 } = useRequestReport(props.request, props.globalStore);
19501
- provide("request", props.request);
19502
19344
  provide(
19503
19345
  "globalStore",
19504
19346
  computed(() => props.globalStore)
19505
19347
  );
19506
- provide(
19507
- "orgInfo",
19508
- computed(() => props.orgInfo)
19509
- );
19510
- provide(
19511
- "enterpriseInfo",
19512
- computed(() => props.enterpriseInfo)
19513
- );
19348
+ provide("request", props.request);
19514
19349
  provide(
19515
19350
  "userInfo",
19516
19351
  computed(() => props.userInfo)
19517
19352
  );
19518
19353
  provide("useReport", useReport2);
19519
- provide(
19520
- "isLogin",
19521
- computed(() => props.isLogin)
19522
- );
19523
- const visibleItems = computed(() => {
19524
- if (props.headerFunctions && props.headerFunctions.length > 0) {
19354
+ computed(() => {
19355
+ if (route.meta.showBgColor) return true;
19356
+ return false;
19357
+ });
19358
+ const logoConfig = getCurrentLogoMap();
19359
+ const logoStyle = computed(() => {
19360
+ const isBlackTheme = currentTheme.value === "black";
19361
+ const logoUrl = isBlackTheme ? logoConfig.siteLogoWhite : logoConfig.siteLogoDark;
19362
+ return {
19363
+ backgroundImage: `url(${logoUrl})`,
19364
+ backgroundRepeat: "no-repeat",
19365
+ backgroundPosition: "0 center",
19366
+ backgroundSize: "contain"
19367
+ };
19368
+ });
19369
+ const sizeStore = usePageResize();
19370
+ const asideSetShow = computed(() => {
19371
+ if (props.singleCol) return false;
19372
+ return (props.sceneValue === SceneValue.home && !sizeStore.isMobile.value || props.collapseMode) && !props.disableFlatMode;
19373
+ });
19374
+ provide("asideSetShow", asideSetShow);
19375
+ console.log("indexasideSetShow", asideSetShow.value);
19376
+ const isHome = computed(() => {
19377
+ return props.sceneValue === SceneValue.home && ["home", "issues", "kanban", "discussionCreated", "merge", "dashboard", "marketplace", "marketplaceDetail"].includes(route == null ? void 0 : route.name);
19378
+ });
19379
+ const asideSize = computed(() => {
19380
+ if (props.collapseMode) {
19381
+ return ASIDE_MENU_MODE.collapse;
19382
+ } else {
19383
+ return ASIDE_MENU_MODE.default;
19384
+ }
19385
+ });
19386
+ const asideSetShowLittle = useStorage("asideSetShowLittle", false);
19387
+ const asideSetShowLittleMode = computed(() => {
19388
+ if (props.collapseMode) {
19389
+ return true;
19390
+ } else if (isHome.value) {
19391
+ return false;
19392
+ } else {
19393
+ return asideSetShowLittle.value;
19394
+ }
19395
+ });
19396
+ const asideDefaultWidth = useStorage("asideDefaultWidth", sizeStore.isMobile.value ? 0 : asideSize.value.expand);
19397
+ const mainMarginLeftWidth = computed(() => {
19398
+ if (!asideSetShow.value || sizeStore.isMobile.value) {
19399
+ return 0;
19400
+ }
19401
+ if (isHome.value) {
19402
+ return 240;
19403
+ }
19404
+ if (props.collapseMode) {
19405
+ return asideDefaultWidth.value >= asideSize.value.expand ? asideSize.value.expand : asideDefaultWidth.value;
19406
+ } else {
19407
+ return asideDefaultWidth.value < asideSize.value.expand ? asideSize.value.collapse : asideDefaultWidth.value;
19408
+ }
19409
+ });
19410
+ const asideVisible = ref(false);
19411
+ const handleAsideVisible = (val) => {
19412
+ asideVisible.value = val;
19413
+ emitEvent("handleAsideVisible", val);
19414
+ };
19415
+ const handleClickMenu = () => {
19416
+ if (sizeStore.isMobile.value || !asideSetShow.value) {
19417
+ asideVisible.value = !asideVisible.value;
19418
+ emitEvent("handleAsideVisible", asideVisible.value);
19419
+ } else {
19420
+ const { collapse, expand } = asideSize.value;
19421
+ asideDefaultWidth.value = asideDefaultWidth.value >= expand ? collapse : expand;
19422
+ emitEvent("handleAsideVisible", asideDefaultWidth.value >= expand);
19423
+ asideSetShowLittle.value = props.collapseMode || !(asideDefaultWidth.value >= expand);
19424
+ }
19425
+ };
19426
+ const initHomePageAside = () => {
19427
+ if (isHome.value) {
19428
+ asideVisible.value = false;
19429
+ asideDefaultWidth.value = 240;
19430
+ asideSetShowLittle.value = true;
19431
+ emitEvent("handleAsideVisible", asideVisible.value);
19432
+ }
19433
+ };
19434
+ initHomePageAside();
19435
+ const handleDrawerChannelChange = (item) => {
19436
+ var _a;
19437
+ handleAsideVisible(false);
19438
+ (_a = props.onChannelChange) == null ? void 0 : _a.call(props, item);
19439
+ };
19440
+ onMounted(() => {
19441
+ addEventListener("toggleAsideMenuByHamburger", () => {
19442
+ handleClickMenu();
19443
+ });
19444
+ });
19445
+ onBeforeUnmount(() => {
19446
+ offEvent("handleAsideVisible");
19447
+ offEvent("toggleAsideMenuByHamburger");
19448
+ });
19449
+ return (_ctx, _cache) => {
19450
+ return props.singleCol ? (openBlock(), createBlock(AsideV2Content, mergeProps({ key: 0 }, props, {
19451
+ showThemeSetting: _ctx.showThemeSetting,
19452
+ showLangSetting: _ctx.showLangSetting,
19453
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event)),
19454
+ "onUpdate:activeChannel": _cache[1] || (_cache[1] = ($event) => emit("update:activeChannel", $event)),
19455
+ onChannelChange: _cache[2] || (_cache[2] = ($event) => emit("channelChange", $event)),
19456
+ onSelect: _cache[3] || (_cache[3] = ($event) => emit("select", $event))
19457
+ }), null, 16, ["showThemeSetting", "showLangSetting"])) : asideSetShow.value ? (openBlock(), createElementBlock("div", {
19458
+ key: 1,
19459
+ class: normalizeClass(["left-side-bar gitcode-aside-v2-container", { oldWhite: asideSetShowLittleMode.value, higherZIndex: unref(SITE_STATUS).DISABLE }]),
19460
+ style: normalizeStyle({ width: mainMarginLeftWidth.value + "px", top: unref(headerHeight2) + "px" })
19461
+ }, [
19462
+ createVNode(AsideV2Content, mergeProps(props, {
19463
+ showThemeSetting: _ctx.showThemeSetting,
19464
+ showLangSetting: _ctx.showLangSetting,
19465
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => emit("update:modelValue", $event)),
19466
+ "onUpdate:activeChannel": _cache[5] || (_cache[5] = ($event) => emit("update:activeChannel", $event)),
19467
+ onChannelChange: _cache[6] || (_cache[6] = ($event) => emit("channelChange", $event)),
19468
+ onSelect: _cache[7] || (_cache[7] = ($event) => emit("select", $event))
19469
+ }), null, 16, ["showThemeSetting", "showLangSetting"])
19470
+ ], 6)) : (openBlock(), createBlock(unref(Drawer), {
19471
+ key: 2,
19472
+ modelValue: asideVisible.value,
19473
+ "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => asideVisible.value = $event),
19474
+ position: "left",
19475
+ "lock-scroll": "",
19476
+ style: normalizeStyle([{ "top": "0", "max-height": "100%" }, { width: "240px", overflowY: "hidden" }]),
19477
+ class: "draw-side-bar"
19478
+ }, {
19479
+ default: withCtx(() => [
19480
+ createElementVNode("div", _hoisted_1$j, [
19481
+ createVNode(GLink, {
19482
+ class: "g-toolbar-left-logo",
19483
+ style: normalizeStyle(logoStyle.value),
19484
+ to: _ctx.independence ? "" : { name: "home" },
19485
+ href: _ctx.independence ? unref(transformUrl)(unref(layoutConfig2).VITE_HOST) : "",
19486
+ onClickCapture: handleDrawerLogoClick
19487
+ }, null, 8, ["style", "to", "href"]),
19488
+ createVNode(unref(Button), {
19489
+ class: "draw-side-bar-close",
19490
+ icon: "close",
19491
+ onClick: _cache[8] || (_cache[8] = ($event) => handleAsideVisible(false)),
19492
+ variant: "text"
19493
+ })
19494
+ ]),
19495
+ createVNode(AsideV2Content, mergeProps(props, {
19496
+ "single-col": "",
19497
+ showThemeSetting: _ctx.showThemeSetting,
19498
+ showLangSetting: _ctx.showLangSetting,
19499
+ "on-channel-change": handleDrawerChannelChange,
19500
+ "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => emit("update:modelValue", $event)),
19501
+ "onUpdate:activeChannel": _cache[10] || (_cache[10] = ($event) => emit("update:activeChannel", $event)),
19502
+ onChannelChange: _cache[11] || (_cache[11] = ($event) => emit("channelChange", $event)),
19503
+ onSelect: _cache[12] || (_cache[12] = ($event) => emit("select", $event))
19504
+ }), null, 16, ["showThemeSetting", "showLangSetting"])
19505
+ ]),
19506
+ _: 1
19507
+ }, 8, ["modelValue"]));
19508
+ };
19509
+ }
19510
+ });
19511
+ const GitCodeAsideV2 = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-vue-layout-gitcode"]]);
19512
+ const _hoisted_1$i = { class: "g-toolbar allow-click-stop" };
19513
+ const _hoisted_2$d = { class: "g-toolbar-left allow-click-stop" };
19514
+ const _hoisted_3$c = { class: "g-toolbar-custom" };
19515
+ const _hoisted_4$9 = { class: "enterprise-name" };
19516
+ const _hoisted_5$5 = { class: "enterprise-flag" };
19517
+ const _hoisted_6$4 = { class: "search-avatar" };
19518
+ const _hoisted_7$3 = { class: "g-toolbar-right allow-click-stop" };
19519
+ const _hoisted_8$3 = {
19520
+ key: 0,
19521
+ class: "g-header-body"
19522
+ };
19523
+ const _hoisted_9$3 = { class: "g-header-body-left" };
19524
+ const _hoisted_10$3 = { class: "g-header-body-right" };
19525
+ const _hoisted_11$3 = { key: 1 };
19526
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
19527
+ ...{
19528
+ name: "EnterpriseHeader"
19529
+ },
19530
+ __name: "EnterpriseHeader",
19531
+ props: {
19532
+ isLogin: { type: Boolean, default: false },
19533
+ request: { type: Function, default: proxyService },
19534
+ globalStore: { default: () => ({
19535
+ httpStatus: 200
19536
+ }) },
19537
+ loginSuccess: {},
19538
+ enterpriseInfo: { default: () => ({
19539
+ avatar: "",
19540
+ name: ""
19541
+ }) },
19542
+ loginOutFinish: {},
19543
+ orgInfo: { default: () => ({
19544
+ avatar: "",
19545
+ name: ""
19546
+ }) },
19547
+ userInfo: { default: () => ({}) },
19548
+ headerFunctions: {},
19549
+ openHarmonyGuide: { type: Boolean },
19550
+ headerBorder: { type: Boolean, default: false },
19551
+ independence: { type: Boolean, default: false },
19552
+ userMenus: {},
19553
+ loginChildComponents: {}
19554
+ },
19555
+ emits: ["followDevCommunity", "followUser", "resetPwdDirectlySuccess"],
19556
+ setup(__props, { emit: __emit }) {
19557
+ var _a;
19558
+ const route = useRoute();
19559
+ const props = __props;
19560
+ const emit = __emit;
19561
+ const { useReport: useReport2 } = useRequestReport(props.request, props.globalStore);
19562
+ provide("request", props.request);
19563
+ provide(
19564
+ "globalStore",
19565
+ computed(() => props.globalStore)
19566
+ );
19567
+ provide(
19568
+ "orgInfo",
19569
+ computed(() => props.orgInfo)
19570
+ );
19571
+ provide(
19572
+ "enterpriseInfo",
19573
+ computed(() => props.enterpriseInfo)
19574
+ );
19575
+ provide(
19576
+ "userInfo",
19577
+ computed(() => props.userInfo)
19578
+ );
19579
+ provide("useReport", useReport2);
19580
+ provide(
19581
+ "isLogin",
19582
+ computed(() => props.isLogin)
19583
+ );
19584
+ const visibleItems = computed(() => {
19585
+ if (props.headerFunctions && props.headerFunctions.length > 0) {
19525
19586
  return props.headerFunctions;
19526
19587
  }
19527
19588
  const usualItems = [
@@ -19687,8 +19748,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
19687
19748
  class: normalizeClass(["g-header allow-click-stop", [showHeaderShadow.value ? "head-shadow" : "", _ctx.headerBorder ? "oldBorder" : "", headerClassName.value]])
19688
19749
  }, [
19689
19750
  createVNode(SiteAnnouncement),
19690
- withDirectives((openBlock(), createElementBlock("div", _hoisted_1$g, [
19691
- createElementVNode("div", _hoisted_2$b, [
19751
+ withDirectives((openBlock(), createElementBlock("div", _hoisted_1$i, [
19752
+ createElementVNode("div", _hoisted_2$d, [
19692
19753
  isModuleVisible(unref(HeaderDisplayItem).ASIDE_BUTTON) ? (openBlock(), createBlock(GIcon, {
19693
19754
  key: 0,
19694
19755
  onClick: handleHamburgerClick,
@@ -19697,7 +19758,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
19697
19758
  class: "g-toolbar-left-asideicon",
19698
19759
  color: "var(--theme-aide-text)"
19699
19760
  })) : createCommentVNode("", true),
19700
- createElementVNode("div", _hoisted_3$b, [
19761
+ createElementVNode("div", _hoisted_3$c, [
19701
19762
  createVNode(_sfc_main$L, {
19702
19763
  src: (_a2 = _ctx.enterpriseInfo) == null ? void 0 : _a2.avatar,
19703
19764
  name: (_b = _ctx.enterpriseInfo) == null ? void 0 : _b.name,
@@ -19706,7 +19767,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
19706
19767
  height: 32,
19707
19768
  class: "enterprise-avatar"
19708
19769
  }, null, 8, ["src", "name"]),
19709
- createElementVNode("span", _hoisted_4$8, toDisplayString$1((_c = _ctx.enterpriseInfo) == null ? void 0 : _c.name), 1),
19770
+ createElementVNode("span", _hoisted_4$9, toDisplayString$1((_c = _ctx.enterpriseInfo) == null ? void 0 : _c.name), 1),
19710
19771
  createElementVNode("span", _hoisted_5$5, toDisplayString$1(unref(t2)("gitCodeLayout.header.enterpriseFlag")), 1)
19711
19772
  ])
19712
19773
  ]),
@@ -19816,7 +19877,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
19816
19877
  renderSlot(_ctx.$slots, "headerBottom", {}, void 0, true)
19817
19878
  ])) : createCommentVNode("", true)
19818
19879
  ], 2),
19819
- createVNode(GitCodeAside, {
19880
+ createVNode(GitCodeAsideV2, {
19820
19881
  sceneValue: unref(SceneValue).home,
19821
19882
  "disable-flat-mode": "",
19822
19883
  userInfo: _ctx.userInfo,
@@ -19831,987 +19892,927 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
19831
19892
  };
19832
19893
  }
19833
19894
  });
19834
- const EnterpriseHeader = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-vue-layout-gitcode"]]);
19835
- const _hoisted_1$f = { class: "aside-footer-tools-item" };
19836
- const _hoisted_2$a = { class: "aside-footer-tools-item-dropdown-item" };
19837
- const _hoisted_3$a = { class: "aside-footer-tools-item-dropdown-item" };
19838
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
19839
- ...{ name: "AsideFooterTools" },
19840
- __name: "index",
19841
- props: {
19842
- showThemeSetting: { type: Boolean, default: true },
19843
- showLangSetting: { type: Boolean, default: true },
19844
- position: { default: () => ["bottom-end"] }
19845
- },
19846
- setup(__props) {
19847
- const { t: t2 } = i18n.global;
19848
- return (_ctx, _cache) => {
19849
- return openBlock(), createBlock(unref(Dropdown), {
19850
- position: _ctx.position,
19851
- align: "end",
19852
- "overlay-class": "footer-tools-setting-dropdown"
19853
- }, {
19854
- menu: withCtx(() => [
19855
- withDirectives(createElementVNode("div", _hoisted_2$a, [
19856
- createVNode(_sfc_main$p)
19857
- ], 512), [
19858
- [vShow, _ctx.showThemeSetting]
19859
- ]),
19860
- withDirectives(createElementVNode("div", _hoisted_3$a, [
19861
- createVNode(_sfc_main$z)
19862
- ], 512), [
19863
- [vShow, _ctx.showLangSetting]
19864
- ])
19865
- ]),
19866
- default: withCtx(() => [
19867
- createElementVNode("div", _hoisted_1$f, [
19868
- createVNode(GIcon, {
19869
- name: "gt-line-setting",
19870
- size: "16",
19871
- class: "default-icon aside-footer-tools__icon-min"
19872
- }),
19873
- createVNode(GIcon, {
19874
- name: "gt-line-setting",
19875
- size: "16",
19876
- class: "active-icon aside-footer-tools__icon-min"
19877
- }),
19878
- createTextVNode(" " + toDisplayString$1(unref(t2)("gitCodeLayout.common.footerSetting.preSetting")), 1)
19879
- ])
19880
- ]),
19881
- _: 1
19882
- }, 8, ["position"]);
19883
- };
19884
- }
19885
- });
19886
- const AsideFooterTools = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-vue-layout-gitcode"]]);
19887
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
19888
- ...{
19889
- name: "ScrollActiveContainer",
19890
- inheritAttrs: false
19891
- },
19892
- __name: "ScrollActiveContainer",
19893
- props: {
19894
- tag: { default: "div" },
19895
- timeout: { default: 300 },
19896
- direction: { default: "vertical" },
19897
- visibleOnHover: { type: Boolean, default: true },
19898
- wrapperClass: { default: "" },
19899
- contentClass: { default: "" }
19900
- },
19901
- emits: ["scroll", "mouseenter", "mouseleave"],
19902
- setup(__props, { expose: __expose, emit: __emit }) {
19903
- const props = __props;
19904
- const emit = __emit;
19905
- function checkIsIOSPhone() {
19906
- if (typeof navigator === "undefined") return false;
19907
- return /iPhone|iPad|iPod/i.test(navigator.userAgent);
19908
- }
19909
- const isIOSMobile = computed(() => checkIsIOSPhone());
19910
- const isScrolling = ref(false);
19911
- const isHovered = ref(false);
19912
- const trackSize = ref(0);
19913
- const spacerSize = ref(0);
19914
- const containerRef = ref(null);
19915
- const contentRef = ref(null);
19916
- const trackRef = ref(null);
19917
- let scrollTimeout = null;
19918
- let isSyncing = false;
19919
- const updateSizes = () => {
19920
- if (isIOSMobile.value) return;
19921
- const container = containerRef.value;
19922
- if (!container) return;
19923
- if (props.direction === "vertical") {
19924
- trackSize.value = container.clientHeight;
19925
- spacerSize.value = container.scrollHeight;
19926
- } else {
19927
- trackSize.value = container.clientWidth;
19928
- spacerSize.value = container.scrollWidth;
19895
+ const EnterpriseHeader = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-vue-layout-gitcode"]]);
19896
+ const layoutConfig$2 = useLayoutConfig();
19897
+ const useConfigSide = (request, sceneValue) => {
19898
+ const API = asideRequest(request);
19899
+ const route = useRoute();
19900
+ const sideLoading = ref(false);
19901
+ const isEn = computed(() => {
19902
+ return getLocaleLang() === LANG_EN;
19903
+ });
19904
+ const showBgColor = computed(() => {
19905
+ return route.meta.showBgColor || false;
19906
+ });
19907
+ const area = ref([]);
19908
+ const assetMenus = computed(() => {
19909
+ return [
19910
+ {
19911
+ left_menu_name_cn: "首页",
19912
+ left_menu_name_cn_shrink: "首页",
19913
+ left_menu_name_en: "Home",
19914
+ left_menu_name_en_shrink: "Home",
19915
+ area: 1,
19916
+ display_order: 1,
19917
+ jump_type: 1,
19918
+ is_open_new_tab: false,
19919
+ isIcon: true,
19920
+ left_menu_logo: "gt-line-home-2",
19921
+ left_menu_logo_black: "gt-line-home-2",
19922
+ left_menu_logo_hover: "gt-plane-home-2",
19923
+ left_menu_logo_hover_black: "gt-plane-home-2",
19924
+ search_type: 1,
19925
+ left_menu_url: "/",
19926
+ id: 0
19929
19927
  }
19930
- };
19931
- let resizeObserver = null;
19932
- onMounted(() => {
19933
- if (isIOSMobile.value) return;
19934
- const container = containerRef.value;
19935
- const content = contentRef.value;
19936
- if (container) {
19937
- updateSizes();
19938
- if (typeof ResizeObserver !== "undefined") {
19939
- resizeObserver = new ResizeObserver(() => {
19940
- updateSizes();
19941
- });
19942
- resizeObserver.observe(container);
19943
- if (content) {
19944
- resizeObserver.observe(content);
19945
- }
19928
+ ];
19929
+ });
19930
+ const judgeIsShowAssetMenus = (data) => {
19931
+ return data.filter((item) => {
19932
+ if (item.area === 1) {
19933
+ if (item.select_scene && item.select_scene.length > 0) {
19934
+ return item.select_scene.includes(sceneValue);
19946
19935
  }
19936
+ return true;
19947
19937
  }
19948
- if (typeof window !== "undefined") {
19949
- window.addEventListener("resize", updateSizes);
19950
- }
19951
- });
19952
- onUnmounted(() => {
19953
- if (resizeObserver) {
19954
- resizeObserver.disconnect();
19955
- resizeObserver = null;
19956
- }
19957
- if (typeof window !== "undefined") {
19958
- window.removeEventListener("resize", updateSizes);
19959
- }
19960
- if (scrollTimeout) {
19961
- clearTimeout(scrollTimeout);
19938
+ return false;
19939
+ }).length === 0;
19940
+ };
19941
+ const groupByArea = (data) => {
19942
+ const sortedData = [...data].sort((a, b) => a.area - b.area);
19943
+ const grouped = {};
19944
+ sortedData.forEach((item) => {
19945
+ if (!grouped[item.area]) {
19946
+ grouped[item.area] = [];
19962
19947
  }
19948
+ grouped[item.area].push(item);
19963
19949
  });
19964
- watch([trackSize, spacerSize, () => props.direction], () => {
19965
- if (isIOSMobile.value) return;
19966
- const container = containerRef.value;
19967
- const track = trackRef.value;
19968
- if (!container || !track) return;
19969
- if (props.direction === "vertical") {
19970
- track.scrollTop = container.scrollTop;
19950
+ return Object.values(grouped);
19951
+ };
19952
+ const fetchArea = async () => {
19953
+ var _a, _b;
19954
+ sideLoading.value = true;
19955
+ const res = await API.getAsideConfig();
19956
+ let asideList = (((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.data) || []).map((item) => {
19957
+ let processedUrl = item.left_menu_url;
19958
+ if (processedUrl == null ? void 0 : processedUrl.startsWith("https://competition.")) {
19959
+ const competitionUrl = replaceHost({ url: processedUrl, customHost: transformUrl(layoutConfig$2.VITE_COMPETITION_HOST) });
19960
+ processedUrl = competitionUrl.includes("atomgit") ? competitionUrl.replace("competition.", "competitions.") : competitionUrl;
19961
+ } else if (processedUrl == null ? void 0 : processedUrl.startsWith("https://ai.")) {
19962
+ processedUrl = replaceHost({ url: processedUrl, customHost: transformUrl(layoutConfig$2.VITE_AI_HOST) });
19971
19963
  } else {
19972
- track.scrollLeft = container.scrollLeft;
19964
+ processedUrl = transformUrl(processedUrl);
19973
19965
  }
19966
+ return {
19967
+ ...item,
19968
+ left_menu_url: processedUrl,
19969
+ left_menu_logo: transformUrl(item.left_menu_logo),
19970
+ left_menu_logo_black: transformUrl(item.left_menu_logo_black),
19971
+ left_menu_logo_hover: transformUrl(item.left_menu_logo_hover),
19972
+ left_menu_logo_hover_black: transformUrl(item.left_menu_logo_hover_black)
19973
+ };
19974
19974
  });
19975
- const handleContainerScroll = (event) => {
19976
- isScrolling.value = true;
19977
- if (scrollTimeout) {
19978
- clearTimeout(scrollTimeout);
19979
- }
19980
- scrollTimeout = setTimeout(() => {
19981
- isScrolling.value = false;
19982
- }, props.timeout);
19983
- emit("scroll", event);
19984
- if (isIOSMobile.value || isSyncing) return;
19985
- const container = containerRef.value;
19986
- const track = trackRef.value;
19987
- if (!container || !track) return;
19988
- isSyncing = true;
19989
- if (props.direction === "vertical") {
19990
- track.scrollTop = container.scrollTop;
19991
- } else {
19992
- track.scrollLeft = container.scrollLeft;
19993
- }
19994
- if (typeof requestAnimationFrame !== "undefined") {
19995
- requestAnimationFrame(() => {
19996
- isSyncing = false;
19997
- });
19998
- } else {
19999
- isSyncing = false;
19975
+ if (typeof window !== "undefined" && GUI_YANG_GITCODE_HOST && ((_b = window.location) == null ? void 0 : _b.origin.includes(GUI_YANG_GITCODE_HOST))) {
19976
+ asideList = asideList.filter((item) => !(item.left_menu_url && item.left_menu_url.includes("https://competition.gitcode")));
19977
+ }
19978
+ if (judgeIsShowAssetMenus(asideList)) {
19979
+ area.value = groupByArea([...assetMenus.value, ...asideList]);
19980
+ } else {
19981
+ area.value = groupByArea([...asideList]);
19982
+ }
19983
+ sideLoading.value = false;
19984
+ };
19985
+ return {
19986
+ isEn,
19987
+ showBgColor,
19988
+ area,
19989
+ fetchArea,
19990
+ sideLoading
19991
+ };
19992
+ };
19993
+ const layoutConfig$1 = useLayoutConfig();
19994
+ const loadAsideData = async (requestFn, params = {}, dataType = "project") => {
19995
+ var _a;
19996
+ try {
19997
+ const result2 = await requestFn(params);
19998
+ const limit = dataType === "project" ? 4 : 2;
19999
+ if (result2.data) {
20000
+ const axiosRes = result2.data;
20001
+ const httpBody = (axiosRes == null ? void 0 : axiosRes.data) ?? axiosRes;
20002
+ const nested = httpBody && typeof httpBody === "object" && httpBody.data != null && typeof httpBody.data === "object" && ("content" in httpBody.data || "total" in httpBody.data);
20003
+ const project = nested ? httpBody.data : httpBody;
20004
+ let storeData = [];
20005
+ const list = (((_a = project.content) == null ? void 0 : _a.map((item) => {
20006
+ if (dataType === "enterprise") {
20007
+ const code2 = item.code;
20008
+ if (!code2) return null;
20009
+ return {
20010
+ key: code2,
20011
+ web_url: `${layoutConfig$1.VITE_HOST}/enterprises/${code2}`,
20012
+ avatar: item.avatar,
20013
+ id: item.id,
20014
+ label: item.name,
20015
+ namespace: code2
20016
+ };
20017
+ }
20018
+ const itemName = dataType === "project" ? item.name : item.full_name || item.name;
20019
+ const namespace = dataType === "project" ? item.namespace_info.name : "";
20020
+ return {
20021
+ key: itemName,
20022
+ web_url: item.web_url,
20023
+ avatar: item.avatar,
20024
+ id: item.id,
20025
+ label: itemName,
20026
+ namespace
20027
+ };
20028
+ })) ?? []).filter((row) => row != null);
20029
+ if (params.page === 1 && list.length > limit) {
20030
+ storeData = list.splice(limit);
20000
20031
  }
20032
+ return {
20033
+ totalNum: project.total,
20034
+ list,
20035
+ storeData,
20036
+ loading: false
20037
+ };
20038
+ }
20039
+ return {
20040
+ list: [],
20041
+ loading: false
20001
20042
  };
20002
- const handleTrackScroll = () => {
20003
- if (isIOSMobile.value) return;
20004
- const container = containerRef.value;
20005
- const track = trackRef.value;
20006
- if (!container || !track) return;
20007
- if (isSyncing) return;
20008
- isSyncing = true;
20009
- if (props.direction === "vertical") {
20010
- container.scrollTop = track.scrollTop;
20011
- } else {
20012
- container.scrollLeft = track.scrollLeft;
20043
+ } catch (error) {
20044
+ console.error("Load aside data failed:", error);
20045
+ return {
20046
+ list: [],
20047
+ loading: false
20048
+ };
20049
+ }
20050
+ };
20051
+ const loadUserProjectsInvolved = async (requestFn, params = {}) => {
20052
+ try {
20053
+ const result2 = await requestFn(params);
20054
+ if (result2.data) {
20055
+ const { content = [], total = 0 } = result2.data.data;
20056
+ const list = content.filter((item) => {
20057
+ var _a;
20058
+ return (_a = item.namespace_info) == null ? void 0 : _a.name;
20059
+ }).map((item) => {
20060
+ var _a;
20061
+ return {
20062
+ key: item.name,
20063
+ web_url: transformUrl(item.web_url),
20064
+ avatar: transformUrl(item.avatar),
20065
+ id: item.id,
20066
+ label: item.name,
20067
+ namespace: (_a = item.namespace_info) == null ? void 0 : _a.name
20068
+ };
20069
+ });
20070
+ return {
20071
+ totalNum: total,
20072
+ list,
20073
+ loading: false
20074
+ };
20075
+ }
20076
+ return {
20077
+ totalNum: 0,
20078
+ list: [],
20079
+ loading: false
20080
+ };
20081
+ } catch (error) {
20082
+ console.error("Load user projects involved failed:", error);
20083
+ return {
20084
+ totalNum: 0,
20085
+ list: [],
20086
+ loading: false
20087
+ };
20088
+ }
20089
+ };
20090
+ var JumpType = /* @__PURE__ */ ((JumpType2) => {
20091
+ JumpType2[JumpType2["Link"] = 1] = "Link";
20092
+ JumpType2[JumpType2["Search"] = 2] = "Search";
20093
+ return JumpType2;
20094
+ })(JumpType || {});
20095
+ var SearchType = /* @__PURE__ */ ((SearchType2) => {
20096
+ SearchType2[SearchType2["Project"] = 1] = "Project";
20097
+ SearchType2[SearchType2["Organization"] = 2] = "Organization";
20098
+ SearchType2[SearchType2["Enterprise"] = 3] = "Enterprise";
20099
+ return SearchType2;
20100
+ })(SearchType || {});
20101
+ const _hoisted_1$h = { class: "area" };
20102
+ const _hoisted_2$c = { class: "area__layout-slot" };
20103
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
20104
+ __name: "Area",
20105
+ props: {
20106
+ list: {},
20107
+ isLogin: { type: Boolean },
20108
+ slotKeys: {},
20109
+ sceneValue: {},
20110
+ asideSetShowLittle: { type: Boolean }
20111
+ },
20112
+ setup(__props) {
20113
+ const layoutConfig2 = useLayoutConfig();
20114
+ const { t: t2 } = i18n.global;
20115
+ const route = useRoute();
20116
+ const MenuItem = defineAsyncComponent(() => import("./MenuItem-C5Q-MkeU.js"));
20117
+ const ProjectMenuListV2 = defineAsyncComponent(() => import("./ProjectMenuListV2-Dfow5AhS.js"));
20118
+ const ProjectMenuList = defineAsyncComponent(() => import("./ProjectMenuList-DrFkM_PV.js"));
20119
+ const props = __props;
20120
+ const useReport2 = inject("useReport");
20121
+ const userInfo = inject("userInfo");
20122
+ const request = inject("request");
20123
+ const API = asideRequest(request);
20124
+ const subShow = ref({
20125
+ project: true,
20126
+ team: true,
20127
+ enterprise: true
20128
+ });
20129
+ const isProject = (item) => {
20130
+ return item.jump_type === JumpType.Search && item.search_type === SearchType.Project;
20131
+ };
20132
+ const isOrganization = (item) => {
20133
+ return item.jump_type === JumpType.Search && item.search_type === SearchType.Organization;
20134
+ };
20135
+ const isEnterprise = (item) => {
20136
+ return item.jump_type === JumpType.Search && item.search_type === SearchType.Enterprise;
20137
+ };
20138
+ const username = computed(() => (userInfo == null ? void 0 : userInfo.username) || JSON.parse(localStorage$2.getItem("userInfo") || "{}").username);
20139
+ const projectProps = computed(() => {
20140
+ return {
20141
+ subShow: subShow.value.project,
20142
+ key: "project",
20143
+ type: "project",
20144
+ defaultData: defaultProject.value,
20145
+ buttonText: t2("gitCodeLayout.dashboard.repo.createRepo"),
20146
+ username: username.value
20147
+ };
20148
+ });
20149
+ const orgProps = computed(() => {
20150
+ return {
20151
+ subShow: subShow.value.team,
20152
+ type: "team",
20153
+ defaultData: defaultOrg.value,
20154
+ title: t2("gitCodeLayout.common.organize"),
20155
+ buttonText: t2("gitCodeLayout.orgSetting.creOrg"),
20156
+ query: {},
20157
+ username: username.value
20158
+ };
20159
+ });
20160
+ const enterpriseProps = computed(() => {
20161
+ return {
20162
+ subShow: subShow.value.enterprise,
20163
+ type: "enterprise",
20164
+ defaultData: defaultEnterprise.value,
20165
+ title: t2("gitCodeLayout.common.enterprise"),
20166
+ buttonText: "",
20167
+ query: {},
20168
+ username: username.value
20169
+ };
20170
+ });
20171
+ const getMenuItemProps = (item) => {
20172
+ const currentPath = route ? route.path : "";
20173
+ const isActive = isHttps(item.left_menu_url) || item.is_open_new_tab ? item.left_menu_url === window.location.href : item.left_menu_url === currentPath;
20174
+ return {
20175
+ active: isActive
20176
+ };
20177
+ };
20178
+ const getProps = (item) => {
20179
+ if (isProject(item)) {
20180
+ return projectProps.value;
20013
20181
  }
20014
- if (typeof requestAnimationFrame !== "undefined") {
20015
- requestAnimationFrame(() => {
20016
- isSyncing = false;
20017
- });
20018
- } else {
20019
- isSyncing = false;
20182
+ if (isOrganization(item)) {
20183
+ return orgProps.value;
20020
20184
  }
20021
- };
20022
- const handleMouseEnter = (event) => {
20023
- if (props.visibleOnHover) {
20024
- isHovered.value = true;
20185
+ if (isEnterprise(item)) {
20186
+ return enterpriseProps.value;
20025
20187
  }
20026
- emit("mouseenter", event);
20188
+ return getMenuItemProps(item);
20027
20189
  };
20028
- const handleMouseLeave = (event) => {
20029
- isHovered.value = false;
20030
- isScrolling.value = false;
20031
- if (scrollTimeout) {
20032
- clearTimeout(scrollTimeout);
20190
+ const renderComponent = (item) => {
20191
+ if (isProject(item) && !props.asideSetShowLittle) {
20192
+ return ProjectMenuListV2;
20033
20193
  }
20034
- emit("mouseleave", event);
20194
+ if (isOrganization(item) && !props.asideSetShowLittle) {
20195
+ return ProjectMenuList;
20196
+ }
20197
+ if (isEnterprise(item) && !props.asideSetShowLittle) {
20198
+ return ProjectMenuList;
20199
+ }
20200
+ return MenuItem;
20035
20201
  };
20036
- const showScrollbar = computed(() => {
20037
- return !props.visibleOnHover || isHovered.value || isScrolling.value;
20202
+ const hasOrg = computed(() => {
20203
+ return props.list.some((item) => isOrganization(item));
20038
20204
  });
20039
- __expose({
20040
- containerEl: containerRef,
20041
- contentEl: contentRef,
20042
- trackEl: trackRef
20205
+ const hasProject = computed(() => {
20206
+ return props.list.some((item) => isProject(item));
20043
20207
  });
20044
- return (_ctx, _cache) => {
20045
- return openBlock(), createElementBlock("div", {
20046
- class: normalizeClass(["scroll-active-container-wrapper", [_ctx.wrapperClass, { "scrollbar-none": !isIOSMobile.value }]]),
20047
- onMouseenter: handleMouseEnter,
20048
- onMouseleave: handleMouseLeave
20049
- }, [
20050
- (openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), mergeProps({
20051
- ref_key: "containerRef",
20052
- ref: containerRef,
20053
- class: ["scroll-active-container-scroll", [
20054
- !isIOSMobile.value ? "scrollbar-none" : "",
20055
- _ctx.direction === "vertical" ? "is-vertical-scroll" : "is-horizontal-scroll"
20056
- ]]
20057
- }, _ctx.$attrs, { onScroll: handleContainerScroll }), {
20058
- default: withCtx(() => [
20059
- createElementVNode("div", {
20060
- ref_key: "contentRef",
20061
- ref: contentRef,
20062
- class: normalizeClass(["scroll-active-container-content", _ctx.contentClass])
20063
- }, [
20064
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
20065
- ], 2)
20066
- ]),
20067
- _: 3
20068
- }, 16, ["class"])),
20069
- !isIOSMobile.value ? (openBlock(), createElementBlock("div", {
20070
- key: 0,
20071
- ref_key: "trackRef",
20072
- ref: trackRef,
20073
- class: normalizeClass(["scroll-active-track", [
20074
- _ctx.direction === "vertical" ? "scroll-active-track--vertical" : "scroll-active-track--horizontal",
20075
- showScrollbar.value ? "is-visible" : "is-hidden"
20076
- ]]),
20077
- style: normalizeStyle({
20078
- height: _ctx.direction === "vertical" && trackSize.value ? `${trackSize.value}px` : void 0,
20079
- width: _ctx.direction === "horizontal" && trackSize.value ? `${trackSize.value}px` : void 0
20080
- }),
20081
- onScroll: handleTrackScroll
20082
- }, [
20083
- createElementVNode("div", {
20084
- style: normalizeStyle({
20085
- height: _ctx.direction === "vertical" ? `${spacerSize.value}px` : "1px",
20086
- width: _ctx.direction === "horizontal" ? `${spacerSize.value}px` : "1px",
20087
- pointerEvents: "none"
20088
- })
20089
- }, null, 4)
20090
- ], 38)) : createCommentVNode("", true)
20091
- ], 34);
20092
- };
20093
- }
20094
- });
20095
- const ScrollActiveContainer = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-vue-layout-gitcode"]]);
20096
- function asideV2Request(request) {
20097
- return {
20098
- /**
20099
- * 首页一级频道列表
20100
- */
20101
- homeFirstChannel() {
20102
- return reqCatch(
20103
- () => request({
20104
- url: "/api/v1/search/channel/list/one/preview",
20105
- method: "get",
20106
- params: {
20107
- m_code: "channelOne",
20108
- d_code: "channel_one_preview",
20109
- c_id: "channel"
20110
- }
20111
- }),
20112
- {}
20113
- );
20114
- },
20115
- /**
20116
- * 获取首页推荐块 (Promo Slot / RECOMMEND_BLOCKS) 配置
20117
- */
20118
- getPromoSlot() {
20119
- return reqCatch(
20120
- () => request({
20121
- url: "/api/v1/search/nauth/home/operation-hot-recommend",
20122
- method: "get"
20123
- }),
20124
- []
20125
- );
20126
- }
20127
- };
20128
- }
20129
- function mapRecommendBlockItemToChannel(item, block, itemIndex) {
20130
- const children = [];
20131
- if (item.tabs && Array.isArray(item.tabs)) {
20132
- for (const tab of item.tabs) {
20133
- children.push({
20134
- object_id: tab.code,
20135
- name: tab.name,
20136
- name_en: tab.name_en,
20137
- icon: tab.icon,
20138
- desc: tab.desc,
20139
- desc_en: tab.desc_en,
20140
- url: tab.url,
20141
- parent_id: item.code
20208
+ const hasEnterprise = computed(() => {
20209
+ return props.list.some((item) => isEnterprise(item));
20210
+ });
20211
+ const filterList = computed(() => {
20212
+ return props.list.filter((item) => {
20213
+ if (!item.select_scene || item.select_scene.length === 0) {
20214
+ return true;
20215
+ }
20216
+ return item.select_scene.includes(props.sceneValue);
20142
20217
  });
20143
- }
20144
- }
20145
- return {
20146
- object_id: item.code,
20147
- name: item.name,
20148
- name_en: item.name_en,
20149
- icon: item.icon,
20150
- icon_dark: item.icon_dark,
20151
- desc: item.desc,
20152
- desc_en: item.desc_en,
20153
- url: item.url,
20154
- is_new: item.is_new,
20155
- links: item.links,
20156
- children,
20157
- group: {
20158
- name: block.name,
20159
- name_en: block.name_en,
20160
- len: block.items.length
20161
- },
20162
- groupIndex: itemIndex
20163
- };
20164
- }
20165
- function mergeChannelsWithRecommendBlocks(originalChannels, blocks = []) {
20166
- if (!originalChannels || originalChannels.length === 0) return [];
20167
- if (!blocks || blocks.length === 0) return originalChannels;
20168
- const beforeMap = /* @__PURE__ */ new Map();
20169
- for (const block of blocks) {
20170
- if (block.before) {
20171
- const existing = beforeMap.get(block.before) || [];
20172
- existing.push(block);
20173
- beforeMap.set(block.before, existing);
20174
- }
20175
- }
20176
- const result2 = [];
20177
- const processedBeforeIds = /* @__PURE__ */ new Set();
20178
- for (const ch of originalChannels) {
20179
- const blocksToInsert = beforeMap.get(ch.object_id);
20180
- if (blocksToInsert && blocksToInsert.length > 0) {
20181
- processedBeforeIds.add(ch.object_id);
20182
- for (const block of blocksToInsert) {
20183
- block.items.forEach((item, index2) => {
20184
- result2.push(mapRecommendBlockItemToChannel(item, block, index2));
20185
- });
20186
- }
20187
- }
20188
- result2.push(ch);
20189
- }
20190
- for (const block of blocks) {
20191
- if (block.before && processedBeforeIds.has(block.before)) continue;
20192
- block.items.forEach((item, index2) => {
20193
- result2.push(mapRecommendBlockItemToChannel(item, block, index2));
20194
20218
  });
20195
- }
20196
- return result2;
20197
- }
20198
- const newTagImg = "data:image/png;base64,i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Oitd24b1JLDHmgEeoOW2lwv5M+Z0abJM5ksjTKmE8YeJlmisW639mTkpTvvmfUPeOlXNfn+qTU/ePH5RniRGoEj+i1EVW/4d4//R/zx8TVzL7d/9nvwsCZBpbQZK/vOnZ8Gb2KuWQ2TB34V0Xvp8+gjIRUaBPjYwf/Hw/e5Z8GFf71XQG4iKVC+kUCA77eiTN8Wak41eeGDahO8SC04+stfbyE3kRSfupvX4RnkuX+j95MOngcqorgcqryhq/6HXv/Rs4+Rm0iIPfOXrY95n1dURP6yRMQ/Ry93eKsnTA4TplYHevpmnmlwk3uXzG8lNwOIjlcWPbEi4OnbiGVK2caf957lTzuiZnD0SufJ2eMnUfjWWRXy+x/88M2/lPT39LaVPTA151zpy4z/HGl0HPzx87tDXv/TvIIx1ws97b/S2odE2pfKpq6FT5u1kMk48eu7zW4/5Cwpco8pKuxasHVTGxkBaIJA0X3mk2/7Ll2pDPr9j8aepLzgea5NV9rN/8VXw9ayijIWCW9WZfY4BBf+/XMkAxK6JlEWl2PQGNKWrOPW4illiswWwoPWAuAQ/wnJSUYAKKEdhLIO+DzZrMjyjs3eDq+Z7f8AUBTucqXJpZAAAAAASUVORK5CYII=";
20200
- const _hoisted_1$e = { class: "home-channel-side-nav" };
20201
- const _hoisted_2$9 = {
20202
- key: 0,
20203
- class: "home-channel-side-nav__list",
20204
- "aria-busy": "true",
20205
- "aria-label": "加载中"
20206
- };
20207
- const _hoisted_3$9 = {
20208
- key: 0,
20209
- class: "home-channel-side-nav__group-title home-channel-side-nav__group-title--skeleton"
20210
- };
20211
- const _hoisted_4$7 = { class: "home-channel-side-nav__info" };
20212
- const _hoisted_5$4 = { class: "home-channel-side-nav__label-row" };
20213
- const _hoisted_6$3 = {
20214
- key: 1,
20215
- class: "home-channel-side-nav__list"
20216
- };
20217
- const _hoisted_7$2 = {
20218
- key: 0,
20219
- class: "home-channel-side-nav__group-title"
20220
- };
20221
- const _hoisted_8$2 = ["aria-current", "title", "onClick"];
20222
- const _hoisted_9$2 = ["src", "alt", "onClick"];
20223
- const _hoisted_10$2 = { class: "home-channel-side-nav__info" };
20224
- const _hoisted_11$2 = { class: "home-channel-side-nav__label-row" };
20225
- const _hoisted_12$2 = { class: "home-channel-side-nav__label" };
20226
- const _hoisted_13$1 = ["src"];
20227
- const _hoisted_14$1 = ["title"];
20228
- const _hoisted_15$1 = {
20229
- key: 3,
20230
- xmlns: "http://www.w3.org/2000/svg",
20231
- width: "14",
20232
- height: "14",
20233
- viewBox: "0 0 24 24",
20234
- fill: "none",
20235
- stroke: "currentColor",
20236
- "stroke-width": "2",
20237
- "stroke-linecap": "round",
20238
- "stroke-linejoin": "round",
20239
- class: "home-channel-side-nav__chevron"
20240
- };
20241
- const _hoisted_16$1 = { class: "home-channel-side-nav__footer-wrapper" };
20242
- const _hoisted_17$1 = {
20243
- class: "aside-footer nav-site-footer",
20244
- "aria-label": "网站备案与站点链接"
20245
- };
20246
- const _hoisted_18$1 = {
20247
- class: "nav-site-shortcuts",
20248
- "aria-label": "站点服务"
20249
- };
20250
- const _hoisted_19$1 = ["href"];
20251
- const _hoisted_20$1 = {
20252
- key: 0,
20253
- xmlns: "http://www.w3.org/2000/svg",
20254
- width: "14",
20255
- height: "14",
20256
- viewBox: "0 0 24 24",
20257
- fill: "none",
20258
- stroke: "currentColor",
20259
- "stroke-width": "2",
20260
- "stroke-linecap": "round",
20261
- "stroke-linejoin": "round"
20262
- };
20263
- const _hoisted_21$1 = {
20264
- key: 1,
20265
- xmlns: "http://www.w3.org/2000/svg",
20266
- width: "14",
20267
- height: "14",
20268
- viewBox: "0 0 24 24",
20269
- fill: "none",
20270
- stroke: "currentColor",
20271
- "stroke-width": "2",
20272
- "stroke-linecap": "round",
20273
- "stroke-linejoin": "round"
20274
- };
20275
- const _hoisted_22$1 = {
20276
- key: 2,
20277
- xmlns: "http://www.w3.org/2000/svg",
20278
- width: "14",
20279
- height: "14",
20280
- viewBox: "0 0 24 24",
20281
- fill: "none",
20282
- stroke: "currentColor",
20283
- "stroke-width": "2",
20284
- "stroke-linecap": "round",
20285
- "stroke-linejoin": "round"
20286
- };
20287
- const _hoisted_23$1 = {
20288
- key: 3,
20289
- xmlns: "http://www.w3.org/2000/svg",
20290
- width: "14",
20291
- height: "14",
20292
- viewBox: "0 0 24 24",
20293
- fill: "none",
20294
- stroke: "currentColor",
20295
- "stroke-width": "2",
20296
- "stroke-linecap": "round",
20297
- "stroke-linejoin": "round"
20298
- };
20299
- const _hoisted_24$1 = {
20300
- key: 0,
20301
- class: "home-channel-side-nav__footer-tools-container"
20302
- };
20303
- const _hoisted_25$1 = { class: "home-channel-side-nav__footer-tools-inner" };
20304
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
20305
- ...{ name: "AsideV2Content", inheritAttrs: false },
20306
- __name: "asideV2Content",
20307
- props: {
20308
- sceneValue: { default: SceneValue.home },
20309
- disableFlatMode: { type: Boolean, default: false },
20310
- singleCol: { type: Boolean, default: false },
20311
- channels: { default: void 0 },
20312
- modelValue: { default: "" },
20313
- activeChannel: { default: "" },
20314
- userInfo: { default: () => ({}) },
20315
- isLogin: { type: Boolean, default: false },
20316
- request: { type: Function, default: proxyService },
20317
- globalStore: { default: () => ({ httpStatus: 200 }) },
20318
- independence: { type: Boolean, default: false },
20319
- showThemeSetting: { type: Boolean, default: void 0 },
20320
- showLangSetting: { type: Boolean, default: void 0 },
20321
- onChannelChange: { type: Function, default: void 0 }
20322
- },
20323
- emits: ["update:modelValue", "update:activeChannel", "channelChange", "select"],
20324
- setup(__props, { emit: __emit }) {
20325
- const props = __props;
20326
- const emit = __emit;
20327
- const { t: t2 } = i18n.global;
20328
- const route = useRoute();
20329
- const layoutConfig2 = useLayoutConfig();
20330
- const skeletonItems = [
20331
- { width: "56px" },
20332
- { width: "78px" },
20333
- { width: "64px", descWidth: "116px" },
20334
- { width: "88px", descWidth: "96px", isGroupLast: true },
20335
- { isGroupTitle: true, width: "48px" },
20336
- { width: "72px" },
20337
- { width: "60px", descWidth: "124px" },
20338
- { width: "80px" },
20339
- { width: "68px" }
20340
- ];
20341
- const injectRequest = inject("request", props.request) || props.request || proxyService;
20342
- const injectGlobalStore = inject("globalStore", props.globalStore);
20343
- const { useReport: useReport2 } = useRequestReport(injectRequest, injectGlobalStore);
20344
- const API = asideV2Request(injectRequest);
20345
- const isEn = computed(() => getLocaleLang() === LANG_EN);
20346
- const showThemeSetting = computed(() => {
20347
- if (props.showThemeSetting !== void 0) return props.showThemeSetting;
20348
- return ![SceneValue.aiHome, SceneValue.aiRepo, SceneValue.aiGuide].includes(props.sceneValue);
20219
+ const searchKeys = ["project", "team", "enterprise"];
20220
+ const layoutSlotKeys = computed(() => {
20221
+ return props.slotKeys.filter((key) => searchKeys.includes(key));
20349
20222
  });
20350
- const showLangSetting = computed(() => {
20351
- if (props.showLangSetting !== void 0) return props.showLangSetting;
20352
- return true;
20223
+ const mainSiteSlotKeys = computed(() => {
20224
+ return props.slotKeys.filter((key) => !searchKeys.includes(key));
20353
20225
  });
20354
- const isDarkTheme = computed(() => currentTheme.value === "black");
20355
- const newTagSrc = computed(() => isDarkTheme.value ? newTagDarkImg : newTagImg);
20356
- const copyright = computed(() => createSetting().copyright);
20357
- computed(() => `© ${(/* @__PURE__ */ new Date()).getFullYear()} ${t2("gitCodeLayout.home.companyInformationAtomgit")}`);
20358
- computed(() => `https://beian.mps.gov.cn/#/query/webSearch?code=${copyright.value.beian}`);
20359
- computed(() => transformUrl("https://docs.gitcode.com/docs/help/home/aboutus/"));
20360
- computed(
20361
- () => copyright.value.beian_url || "https://www.zhipin.com/gongsi/job/b1eccc6dba1cc0d41Hd60tW0GVc~.html?ka=company-jobs"
20362
- );
20363
- const siteShortcutLinks = computed(() => [
20364
- {
20365
- name: t2("gitCodeLayout.home.informationCenter"),
20366
- url: transformUrl("https://news.gitcode.com/news"),
20367
- icon: "newspaper"
20368
- },
20369
- {
20370
- name: t2("gitCodeLayout.header.helpDocument"),
20371
- url: transformUrl("https://docs.gitcode.com/docs/help/home/"),
20372
- icon: "book-open"
20373
- },
20374
- {
20375
- name: t2("gitCodeLayout.home.feedbackCenter"),
20376
- url: transformUrl("https://gitcode.com/GitCode-official-team/GitCode-Docs/issues"),
20377
- icon: "message-square"
20378
- },
20379
- {
20380
- name: "OpenAPI",
20381
- url: transformUrl("https://docs.gitcode.com/docs/apis/"),
20382
- icon: "braces"
20383
- }
20384
- ]);
20385
- const loading = ref(false);
20386
- const localChannels = ref([]);
20387
- const channelsList = computed(() => {
20388
- if (props.channels && props.channels.length > 0) {
20389
- return props.channels;
20390
- }
20391
- return localChannels.value;
20392
- });
20393
- const currentChannelId = computed(() => {
20394
- var _a;
20395
- return props.modelValue || props.activeChannel || ((_a = route == null ? void 0 : route.query) == null ? void 0 : _a.tn) || "";
20396
- });
20397
- const recommendedChannelId = computed(() => {
20398
- var _a;
20399
- return ((_a = channelsList.value[0]) == null ? void 0 : _a.object_id) ?? "default";
20400
- });
20401
- function isRecommendedChannel(item) {
20402
- return item.object_id === recommendedChannelId.value || item.object_id === "default" || item.name === "推荐" || item.name === "热门推荐";
20403
- }
20404
- function getItemName(item) {
20405
- if (isEn.value) {
20406
- return item.name_en || item.name || "";
20407
- }
20408
- return item.name || "";
20409
- }
20410
- function getItemDesc(item) {
20411
- if (isEn.value) {
20412
- return item.desc_en || item.desc || "";
20413
- }
20414
- return item.desc || item.desc_en || "";
20415
- }
20416
- function getPrefixLogo(item) {
20417
- const raw = item;
20418
- if (isDarkTheme.value) {
20419
- const darkIcon = raw.dark_icon || raw.icon_dark;
20420
- if (typeof darkIcon === "string" && darkIcon) return darkIcon;
20421
- }
20422
- const icon = raw.icon || raw.pre_logo;
20423
- if (typeof icon === "string" && icon) return icon;
20424
- const logo = raw.channelPrefixLogo;
20425
- if (typeof (logo == null ? void 0 : logo.logoUrl) === "string" && logo.logoUrl) return logo.logoUrl;
20426
- return "";
20427
- }
20428
- function getPrefixLogoLink(item) {
20429
- const raw = item;
20430
- if (typeof raw.pre_logo_jump_url === "string" && raw.pre_logo_jump_url) {
20431
- return raw.pre_logo_jump_url;
20432
- }
20433
- const logo = raw.channelPrefixLogo;
20434
- if (typeof (logo == null ? void 0 : logo.logoLink) === "string" && logo.logoLink) {
20435
- return logo.logoLink;
20226
+ const LayoutSlotComponent = (item) => {
20227
+ if (item === "project") {
20228
+ return ProjectMenuListV2;
20436
20229
  }
20437
- return "";
20438
- }
20439
- function isUrl(str) {
20440
- return /^(https?:)?\/\//.test(str) || str.startsWith("/");
20441
- }
20442
- function onPrefixLogoClick(event, item) {
20443
- const link = getPrefixLogoLink(item);
20444
- if (!link) return;
20445
- event.stopPropagation();
20446
- if (typeof window !== "undefined") {
20447
- window.open(link, "_blank", "noopener,noreferrer");
20230
+ if (item === "team" || item === "enterprise") {
20231
+ return ProjectMenuList;
20448
20232
  }
20449
- }
20450
- function selectChannel(item) {
20451
- var _a;
20452
- void useReport2(REPO_EVENT.CLICK, {
20453
- Channel_name: item.name,
20454
- module_name: "频道切换",
20455
- channel_id: item.object_id,
20456
- channel_name: item.name
20457
- });
20458
- emit("update:modelValue", item.object_id);
20459
- emit("update:activeChannel", item.object_id);
20460
- emit("channelChange", item);
20461
- emit("select", item);
20462
- (_a = props.onChannelChange) == null ? void 0 : _a.call(props, item);
20463
- if (item.url) {
20464
- if (typeof window !== "undefined") {
20465
- const targetUrl = isUrl(item.url) ? transformUrl(item.url) : item.url;
20466
- window.open(targetUrl, "_blank", "noopener,noreferrer");
20233
+ return null;
20234
+ };
20235
+ const defaultProject = ref({ loading: true });
20236
+ const defaultOrg = ref({});
20237
+ const defaultEnterprise = ref({});
20238
+ const getOrgProject = async () => {
20239
+ if (props.isLogin) {
20240
+ defaultOrg.value = {
20241
+ loading: true
20242
+ };
20243
+ if (hasEnterprise.value) {
20244
+ defaultEnterprise.value = {
20245
+ loading: true
20246
+ };
20467
20247
  }
20468
- return;
20469
- }
20470
- if (typeof window !== "undefined") {
20471
- const baseHost = (layoutConfig2.VITE_HOST || "").replace(/\/+$/, "");
20472
- const jumpUrl = transformUrl(`${baseHost}/?tn=${item.object_id}`);
20473
- window.location.href = jumpUrl;
20474
- }
20475
- }
20476
- const scrollContainerRef = ref(null);
20477
- const isCollapsed = ref(true);
20478
- const isMounted = ref(false);
20479
- const maxVisibleCount = ref(999);
20480
- const visibleChannels = computed(() => {
20481
- if (!isMounted.value || !isCollapsed.value) return channelsList.value;
20482
- const count = maxVisibleCount.value;
20483
- if (count >= channelsList.value.length) return channelsList.value;
20484
- const activeIndex = channelsList.value.findIndex((item) => item.object_id === currentChannelId.value);
20485
- const displayCount = activeIndex >= count ? activeIndex + 1 : count;
20486
- return channelsList.value.slice(0, displayCount);
20487
- });
20488
- function expandChannels() {
20489
- isCollapsed.value = false;
20490
- }
20491
- function collapseChannels() {
20492
- isCollapsed.value = true;
20493
- }
20494
- function getItemHeight(item) {
20495
- let height = 40;
20496
- if (getItemDesc(item)) {
20497
- height += 16;
20498
- }
20499
- if (item.group && item.groupIndex === 0) {
20500
- height += 32;
20501
- }
20502
- if (item.group && typeof item.group.len === "number" && item.group.len - 1 === item.groupIndex) {
20503
- height += 12;
20504
- }
20505
- return height;
20506
- }
20507
- function getScrollElement() {
20508
- if (!scrollContainerRef.value) return null;
20509
- if ("containerEl" in scrollContainerRef.value && scrollContainerRef.value.containerEl) {
20510
- return scrollContainerRef.value.containerEl;
20248
+ defaultProject.value = {
20249
+ loading: true
20250
+ };
20251
+ if (hasProject.value) {
20252
+ loadUserProjectsInvolved((params) => API.getMyProjectsInvolved(params), {
20253
+ per_page: 50
20254
+ }).then((res) => {
20255
+ defaultProject.value = res;
20256
+ });
20257
+ }
20258
+ if (hasOrg.value) {
20259
+ loadAsideData(
20260
+ (params) => API.getMyGroups(params),
20261
+ {
20262
+ page: 1,
20263
+ per_page: 10
20264
+ },
20265
+ "team"
20266
+ ).then((res) => {
20267
+ defaultOrg.value = res;
20268
+ });
20269
+ }
20270
+ if (hasEnterprise.value) {
20271
+ loadAsideData(
20272
+ (params) => API.getUserRelatedEnterprises(params),
20273
+ {
20274
+ page: 1,
20275
+ per_page: 10
20276
+ },
20277
+ "enterprise"
20278
+ ).then((res) => {
20279
+ defaultEnterprise.value = res;
20280
+ });
20281
+ }
20282
+ defaultOrg.value = {
20283
+ loading: false
20284
+ };
20285
+ if (!hasEnterprise.value) {
20286
+ defaultEnterprise.value = {
20287
+ loading: false
20288
+ };
20289
+ }
20290
+ defaultProject.value = {
20291
+ loading: false
20292
+ };
20293
+ } else {
20294
+ defaultOrg.value = {
20295
+ loading: false
20296
+ };
20297
+ defaultEnterprise.value = {
20298
+ loading: false
20299
+ };
20300
+ defaultProject.value = {
20301
+ loading: false
20302
+ };
20511
20303
  }
20512
- return scrollContainerRef.value;
20513
- }
20514
- function calculateVisibleCount() {
20515
- if (typeof window === "undefined") return;
20516
- const containerEl = getScrollElement();
20517
- if (!containerEl) return;
20518
- const containerHeight = containerEl.getBoundingClientRect().height;
20519
- const availableHeight = containerHeight - 16;
20520
- const toggleHeight = 56;
20521
- const footerHeight = 112;
20522
- const totalHeight = channelsList.value.reduce((acc, item) => acc + getItemHeight(item), 0);
20523
- if (totalHeight + footerHeight <= availableHeight) {
20524
- maxVisibleCount.value = channelsList.value.length;
20525
- return;
20304
+ };
20305
+ getOrgProject();
20306
+ const onMenuClick = (e) => {
20307
+ const parentNode = e.el.parentNode;
20308
+ const openMode = (parentNode == null ? void 0 : parentNode.getAttribute("data-openBlank")) ? "_blank" : "_self";
20309
+ const url = (parentNode == null ? void 0 : parentNode.getAttribute("data-href")) || "";
20310
+ const host = (parentNode == null ? void 0 : parentNode.getAttribute("data-host")) || "";
20311
+ const key = (parentNode == null ? void 0 : parentNode.getAttribute("data-key")) || "";
20312
+ const REPOKEY = (key || "").toUpperCase();
20313
+ const reportName = ASIDE_MENU_REPO[REPOKEY] || "";
20314
+ if (reportName) {
20315
+ useReport2(REPO_EVENT.CLICK, { module_name: reportName });
20526
20316
  }
20527
- const limitHeight = availableHeight - toggleHeight - footerHeight;
20528
- let accumulatedHeight = 0;
20529
- let count = 0;
20530
- for (const item of channelsList.value) {
20531
- const h2 = getItemHeight(item);
20532
- if (accumulatedHeight + h2 > limitHeight) {
20533
- break;
20534
- }
20535
- accumulatedHeight += h2;
20536
- count++;
20317
+ if (host === layoutConfig2.VITE_AI_HOST) {
20318
+ useReport2(AsideReportEvent.AI_CLICK, {});
20537
20319
  }
20538
- maxVisibleCount.value = Math.max(3, count);
20539
- }
20540
- async function fetchChannelsData() {
20541
- var _a, _b;
20542
- if (props.channels && props.channels.length > 0) return;
20543
- loading.value = true;
20544
- try {
20545
- const [channelsRes, promoRes] = await Promise.all([
20546
- API.homeFirstChannel(),
20547
- API.getPromoSlot()
20548
- ]);
20549
- const rawChannels = ((_a = channelsRes == null ? void 0 : channelsRes.data) == null ? void 0 : _a.data) || [];
20550
- const promoBlocks = ((_b = promoRes == null ? void 0 : promoRes.data) == null ? void 0 : _b.data) || [];
20551
- const merged = mergeChannelsWithRecommendBlocks(rawChannels, promoBlocks);
20552
- localChannels.value = merged;
20553
- } catch (err) {
20554
- console.error("[GitCodeAsideV2] fetchChannelsData error:", err);
20555
- } finally {
20556
- loading.value = false;
20557
- void nextTick(() => calculateVisibleCount());
20558
- }
20559
- }
20560
- let resizeObserver = null;
20561
- onMounted(() => {
20562
- isMounted.value = true;
20563
- void fetchChannelsData();
20564
- void nextTick(() => {
20565
- calculateVisibleCount();
20320
+ window.open(url, openMode);
20321
+ };
20322
+ return (_ctx, _cache) => {
20323
+ return openBlock(), createElementBlock("div", _hoisted_1$h, [
20324
+ createVNode(unref(Menu), {
20325
+ class: "menu",
20326
+ onSelect: onMenuClick,
20327
+ "open-keys": ["team", "project", "enterprise"]
20328
+ }, {
20329
+ default: withCtx(() => [
20330
+ (openBlock(true), createElementBlock(Fragment, null, renderList(filterList.value, (item) => {
20331
+ return openBlock(), createBlock(resolveDynamicComponent(renderComponent(item)), mergeProps({
20332
+ key: item.id,
20333
+ isLogin: _ctx.isLogin,
20334
+ item,
20335
+ slotKeys: _ctx.slotKeys,
20336
+ ref_for: true
20337
+ }, getProps(item)), createSlots({ _: 2 }, [
20338
+ renderList(mainSiteSlotKeys.value, (key) => {
20339
+ return {
20340
+ name: key,
20341
+ fn: withCtx(() => [
20342
+ renderSlot(_ctx.$slots, key, {}, void 0, true)
20343
+ ])
20344
+ };
20345
+ }),
20346
+ renderList(layoutSlotKeys.value, (key) => {
20347
+ return {
20348
+ name: key,
20349
+ fn: withCtx(() => [
20350
+ createElementVNode("div", _hoisted_2$c, [
20351
+ createVNode(unref(Menu), {
20352
+ class: "menu",
20353
+ onSelect: onMenuClick,
20354
+ "open-keys": ["team", "project", "enterprise"]
20355
+ }, {
20356
+ default: withCtx(() => [
20357
+ (openBlock(), createBlock(resolveDynamicComponent(LayoutSlotComponent(key)), mergeProps({ ref_for: true }, getProps(item), {
20358
+ slotKeys: _ctx.slotKeys,
20359
+ item,
20360
+ isLogin: _ctx.isLogin
20361
+ }), null, 16, ["slotKeys", "item", "isLogin"]))
20362
+ ]),
20363
+ _: 2
20364
+ }, 1024)
20365
+ ])
20366
+ ])
20367
+ };
20368
+ })
20369
+ ]), 1040, ["isLogin", "item", "slotKeys"]);
20370
+ }), 128))
20371
+ ]),
20372
+ _: 3
20373
+ })
20374
+ ]);
20375
+ };
20376
+ }
20377
+ });
20378
+ const Area = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-vue-layout-gitcode"]]);
20379
+ const _hoisted_1$g = { class: "settings__label" };
20380
+ const _hoisted_2$b = { class: "aside-footer-tools-item-dropdown-item" };
20381
+ const _hoisted_3$b = { class: "aside-footer-tools-item-dropdown-item" };
20382
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
20383
+ __name: "Settings",
20384
+ props: {
20385
+ showThemeSetting: { type: Boolean },
20386
+ showLangSetting: { type: Boolean },
20387
+ asideSetShowLittle: { type: Boolean }
20388
+ },
20389
+ setup(__props) {
20390
+ const { t: t2 } = i18n.global;
20391
+ return (_ctx, _cache) => {
20392
+ return openBlock(), createBlock(unref(Dropdown), {
20393
+ position: ["top", "top-start"],
20394
+ align: "end",
20395
+ "overlay-class": "footer-tools-setting-dropdown"
20396
+ }, {
20397
+ menu: withCtx(() => [
20398
+ withDirectives(createElementVNode("div", _hoisted_2$b, [
20399
+ createVNode(_sfc_main$q)
20400
+ ], 512), [
20401
+ [vShow, _ctx.showThemeSetting]
20402
+ ]),
20403
+ withDirectives(createElementVNode("div", _hoisted_3$b, [
20404
+ createVNode(_sfc_main$z)
20405
+ ], 512), [
20406
+ [vShow, _ctx.showLangSetting]
20407
+ ])
20408
+ ]),
20409
+ default: withCtx(() => [
20410
+ createElementVNode("div", {
20411
+ class: normalizeClass(["aside-footer-tools-item", { "aside-footer-tools-item-little": _ctx.asideSetShowLittle }])
20412
+ }, [
20413
+ createVNode(GIcon, {
20414
+ name: "gt-line-setting",
20415
+ size: "16",
20416
+ class: "default-icon settings__icon-min"
20417
+ }),
20418
+ createVNode(GIcon, {
20419
+ name: "gt-line-setting",
20420
+ size: "16",
20421
+ class: "active-icon settings__icon-min"
20422
+ }),
20423
+ createElementVNode("span", _hoisted_1$g, toDisplayString$1(unref(t2)("gitCodeLayout.common.footerSetting.preSettingLittle")), 1)
20424
+ ], 2)
20425
+ ]),
20426
+ _: 1
20566
20427
  });
20567
- if (typeof ResizeObserver !== "undefined") {
20568
- resizeObserver = new ResizeObserver(() => {
20569
- calculateVisibleCount();
20570
- });
20571
- const containerEl = getScrollElement();
20572
- if (containerEl) {
20573
- resizeObserver.observe(containerEl);
20574
- } else if (typeof document !== "undefined") {
20575
- resizeObserver.observe(document.body);
20576
- }
20577
- } else if (typeof window !== "undefined") {
20578
- window.addEventListener("resize", calculateVisibleCount);
20579
- }
20428
+ };
20429
+ }
20430
+ });
20431
+ const Settings = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-vue-layout-gitcode"]]);
20432
+ const FEEDBACK_CENTER_URL = "https://gitcode.com/Gitcode-offical-team/GitCode-Docs/issues";
20433
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
20434
+ __name: "SubMenuList",
20435
+ setup(__props) {
20436
+ const layoutConfig2 = useLayoutConfig();
20437
+ const { t: t2 } = i18n.global;
20438
+ const isEn = computed(() => {
20439
+ return getLocaleLang() === LANG_EN;
20580
20440
  });
20581
- onBeforeUnmount(() => {
20582
- if (resizeObserver) {
20583
- resizeObserver.disconnect();
20584
- resizeObserver = null;
20585
- } else if (typeof window !== "undefined") {
20586
- window.removeEventListener("resize", calculateVisibleCount);
20587
- }
20441
+ const linkList = computed(() => {
20442
+ return [
20443
+ {
20444
+ name: t2("gitCodeLayout.home.informationCenter"),
20445
+ icon: "gt-line-consulting",
20446
+ url: `${transformNewsUrl(INFORMATION_CENTER_URL)}?lang=${getLocaleLang() || "zh"}`,
20447
+ target: "_blank"
20448
+ },
20449
+ {
20450
+ name: t2("gitCodeLayout.header.helpDocument"),
20451
+ icon: "gt-line-file",
20452
+ url: currentHelpDocsUrl(),
20453
+ target: "_blank"
20454
+ },
20455
+ {
20456
+ name: t2("gitCodeLayout.home.feedbackCenter"),
20457
+ icon: "gt-line-Checks",
20458
+ url: replaceHost({ url: FEEDBACK_CENTER_URL, customHost: layoutConfig2.VITE_HOST }),
20459
+ target: "_self"
20460
+ }
20461
+ ];
20588
20462
  });
20589
- watch(
20590
- () => props.channels,
20591
- () => {
20592
- void nextTick(() => calculateVisibleCount());
20593
- },
20594
- { deep: true }
20595
- );
20596
20463
  return (_ctx, _cache) => {
20597
20464
  return openBlock(), createElementBlock("div", {
20598
- class: normalizeClass(["gitcode-aside-v2-content home-channel-navigation", { "is-single-col": props.singleCol }])
20465
+ class: normalizeClass(["sub-menu-list", { en: isEn.value }])
20599
20466
  }, [
20600
- createElementVNode("div", _hoisted_1$e, [
20601
- createVNode(ScrollActiveContainer, {
20602
- ref_key: "scrollContainerRef",
20603
- ref: scrollContainerRef,
20604
- tag: "nav",
20605
- wrapperClass: "home-channel-side-nav__scroll-wrapper",
20606
- contentClass: "home-channel-side-nav__scroll",
20607
- "aria-label": "首页频道"
20467
+ (openBlock(true), createElementBlock(Fragment, null, renderList(linkList.value, (item) => {
20468
+ return openBlock(), createBlock(GLink, {
20469
+ key: item.name,
20470
+ class: "custom-link sub-menu-list__link",
20471
+ href: item.url,
20472
+ target: item.target
20608
20473
  }, {
20609
20474
  default: withCtx(() => [
20610
- loading.value && (!channelsList.value || channelsList.value.length === 0) ? (openBlock(), createElementBlock("ul", _hoisted_2$9, [
20611
- (openBlock(), createElementBlock(Fragment, null, renderList(skeletonItems, (sk, idx) => {
20612
- return openBlock(), createElementBlock(Fragment, {
20613
- key: `skeleton-${idx}`
20614
- }, [
20615
- sk.isGroupTitle ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
20616
- createElementVNode("span", {
20617
- class: "home-channel-side-nav__skeleton-block home-channel-side-nav__group-skeleton",
20618
- style: normalizeStyle({ width: sk.width })
20619
- }, null, 4)
20620
- ])) : (openBlock(), createElementBlock("li", {
20621
- key: 1,
20622
- class: normalizeClass(["home-channel-side-nav__row home-channel-side-nav__row--skeleton", { "is-group-last": sk.isGroupLast }])
20623
- }, [
20624
- createElementVNode("div", {
20625
- class: normalizeClass(["home-channel-side-nav__item home-channel-side-nav__item--skeleton", { "has-desc": !!sk.descWidth }])
20626
- }, [
20627
- _cache[0] || (_cache[0] = createElementVNode("span", { class: "home-channel-side-nav__skeleton-block home-channel-side-nav__logo-skeleton" }, null, -1)),
20628
- createElementVNode("div", _hoisted_4$7, [
20629
- createElementVNode("span", _hoisted_5$4, [
20630
- createElementVNode("span", {
20631
- class: "home-channel-side-nav__skeleton-block home-channel-side-nav__label-skeleton",
20632
- style: normalizeStyle({ width: sk.width })
20633
- }, null, 4)
20634
- ]),
20635
- sk.descWidth ? (openBlock(), createElementBlock("span", {
20636
- key: 0,
20637
- class: "home-channel-side-nav__skeleton-block home-channel-side-nav__desc-skeleton",
20638
- style: normalizeStyle({ width: sk.descWidth })
20639
- }, null, 4)) : createCommentVNode("", true)
20640
- ])
20641
- ], 2)
20642
- ], 2))
20643
- ], 64);
20644
- }), 64))
20645
- ])) : (openBlock(), createElementBlock("ul", _hoisted_6$3, [
20646
- (openBlock(true), createElementBlock(Fragment, null, renderList(visibleChannels.value, (item) => {
20647
- return openBlock(), createElementBlock(Fragment, {
20648
- key: item.object_id
20649
- }, [
20650
- item.group && item.groupIndex === 0 ? (openBlock(), createElementBlock("div", _hoisted_7$2, toDisplayString$1(isEn.value && item.group.name_en ? item.group.name_en : item.group.name), 1)) : createCommentVNode("", true),
20651
- createElementVNode("li", {
20652
- class: normalizeClass(["home-channel-side-nav__row", {
20653
- "is-group-last": item.group && typeof item.group.len === "number" && item.group.len - 1 === item.groupIndex
20654
- }])
20655
- }, [
20656
- createElementVNode("button", {
20657
- type: "button",
20658
- class: normalizeClass(["home-channel-side-nav__item", {
20659
- "is-active": currentChannelId.value === item.object_id
20660
- }]),
20661
- "aria-current": currentChannelId.value === item.object_id ? "page" : void 0,
20662
- title: getItemDesc(item) || void 0,
20663
- onClick: ($event) => selectChannel(item)
20664
- }, [
20665
- isRecommendedChannel(item) ? (openBlock(), createBlock(GIcon, {
20666
- key: 0,
20667
- name: "gt-tuijian",
20668
- size: "18px",
20669
- class: "home-channel-side-nav__logo"
20670
- })) : getPrefixLogo(item) && isUrl(getPrefixLogo(item)) ? (openBlock(), createElementBlock("img", {
20671
- key: 1,
20672
- src: getPrefixLogo(item),
20673
- alt: item.name,
20674
- class: "home-channel-side-nav__logo",
20675
- onClick: ($event) => onPrefixLogoClick($event, item)
20676
- }, null, 8, _hoisted_9$2)) : getPrefixLogo(item) ? (openBlock(), createBlock(GIcon, {
20677
- key: 2,
20678
- name: getPrefixLogo(item),
20679
- size: "18px",
20680
- class: "home-channel-side-nav__logo",
20681
- onClick: ($event) => onPrefixLogoClick($event, item)
20682
- }, null, 8, ["name", "onClick"])) : createCommentVNode("", true),
20683
- createElementVNode("div", _hoisted_10$2, [
20684
- createElementVNode("span", _hoisted_11$2, [
20685
- createElementVNode("span", _hoisted_12$2, toDisplayString$1(getItemName(item)), 1),
20686
- item.is_new ? (openBlock(), createElementBlock("img", {
20687
- key: 0,
20688
- src: newTagSrc.value,
20689
- alt: "New",
20690
- class: "home-channel-side-nav__new-tag"
20691
- }, null, 8, _hoisted_13$1)) : createCommentVNode("", true)
20692
- ]),
20693
- getItemDesc(item) ? (openBlock(), createElementBlock("span", {
20694
- key: 0,
20695
- class: "home-channel-side-nav__desc",
20696
- title: getItemDesc(item)
20697
- }, toDisplayString$1(getItemDesc(item)), 9, _hoisted_14$1)) : createCommentVNode("", true)
20698
- ]),
20699
- !isRecommendedChannel(item) && item.children && item.children.length > 0 ? (openBlock(), createElementBlock("svg", _hoisted_15$1, _cache[1] || (_cache[1] = [
20700
- createElementVNode("path", { d: "m9 18 6-6-6-6" }, null, -1)
20701
- ]))) : createCommentVNode("", true)
20702
- ], 10, _hoisted_8$2)
20703
- ], 2)
20704
- ], 64);
20705
- }), 128))
20706
- ])),
20707
- isCollapsed.value && channelsList.value.length > maxVisibleCount.value ? (openBlock(), createElementBlock("button", {
20708
- key: 2,
20709
- type: "button",
20710
- class: "home-channel-side-nav__more-toggle",
20711
- onClick: expandChannels
20712
- }, [
20713
- _cache[2] || (_cache[2] = createElementVNode("svg", {
20714
- xmlns: "http://www.w3.org/2000/svg",
20715
- width: "14",
20716
- height: "14",
20717
- viewBox: "0 0 24 24",
20718
- fill: "none",
20719
- stroke: "currentColor",
20720
- "stroke-width": "2",
20721
- "stroke-linecap": "round",
20722
- "stroke-linejoin": "round",
20723
- class: "home-channel-side-nav__more-icon"
20724
- }, [
20725
- createElementVNode("path", { d: "m6 9 6 6 6-6" })
20726
- ], -1)),
20727
- createElementVNode("span", null, toDisplayString$1(unref(t2)("gitCodeLayout.home.channel.moreOpenSource")), 1)
20728
- ])) : createCommentVNode("", true),
20729
- !isCollapsed.value && channelsList.value.length > maxVisibleCount.value ? (openBlock(), createElementBlock("button", {
20730
- key: 3,
20731
- type: "button",
20732
- class: "home-channel-side-nav__more-collapse",
20733
- onClick: collapseChannels
20475
+ createVNode(GIcon, {
20476
+ name: item.icon,
20477
+ color: "var(--theme-placeholder)"
20478
+ }, null, 8, ["name"]),
20479
+ createElementVNode("span", null, toDisplayString$1(item.name), 1)
20480
+ ]),
20481
+ _: 2
20482
+ }, 1032, ["href", "target"]);
20483
+ }), 128))
20484
+ ], 2);
20485
+ };
20486
+ }
20487
+ });
20488
+ const SubMenuList = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-vue-layout-gitcode"]]);
20489
+ const _hoisted_1$f = { class: "aside-footer" };
20490
+ const _hoisted_2$a = { class: "remake-message" };
20491
+ const _hoisted_3$a = ["title"];
20492
+ const _hoisted_4$8 = { class: "remake-message__line" };
20493
+ const _hoisted_5$4 = {
20494
+ href: "https://beian.miit.gov.cn/#/Integrated/index",
20495
+ target: "_blank"
20496
+ };
20497
+ const _hoisted_6$3 = {
20498
+ key: 0,
20499
+ class: "remake-message__line public-security"
20500
+ };
20501
+ const _hoisted_7$2 = ["href"];
20502
+ const _hoisted_8$2 = {
20503
+ href: "https://www.huaweicloud.com/",
20504
+ target: "_blank",
20505
+ rel: "noopener noreferrer"
20506
+ };
20507
+ const _hoisted_9$2 = { class: "contact-info__about-row" };
20508
+ const _hoisted_10$2 = { class: "footer-work-info" };
20509
+ const _hoisted_11$2 = { class: "footer-work-info__item footer-work-info__item--mt" };
20510
+ const _hoisted_12$2 = { class: "" };
20511
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
20512
+ __name: "ContactInfo",
20513
+ setup(__props) {
20514
+ const { t: t2 } = i18n.global;
20515
+ const setting = createSetting();
20516
+ const { copyright } = setting;
20517
+ const isEn = computed(() => {
20518
+ return getLocaleLang() === LANG_EN;
20519
+ });
20520
+ return (_ctx, _cache) => {
20521
+ return openBlock(), createElementBlock("div", _hoisted_1$f, [
20522
+ createElementVNode("div", _hoisted_2$a, [
20523
+ createElementVNode("p", {
20524
+ class: "remake-message__line remake-message__line--break",
20525
+ title: unref(copyright).digestAbbr
20526
+ }, " © " + toDisplayString$1(unref(copyright).digestAbbr), 9, _hoisted_3$a),
20527
+ createElementVNode("p", _hoisted_4$8, [
20528
+ createElementVNode("a", _hoisted_5$4, toDisplayString$1(unref(copyright).icp), 1)
20529
+ ]),
20530
+ unref(copyright).publicSecurity_url ? (openBlock(), createElementBlock("p", _hoisted_6$3, [
20531
+ _cache[0] || (_cache[0] = createElementVNode("img", { src: "//g.csdnimg.cn/common/csdn-footer/images/badge.png" }, null, -1)),
20532
+ createElementVNode("a", {
20533
+ href: unref(copyright).publicSecurity_url,
20534
+ target: "_blank"
20535
+ }, toDisplayString$1(unref(copyright).publicSecurity), 9, _hoisted_7$2)
20536
+ ])) : createCommentVNode("", true)
20537
+ ]),
20538
+ createElementVNode("p", {
20539
+ class: normalizeClass(["contact-info__support support", { en: isEn.value }])
20540
+ }, [
20541
+ createElementVNode("span", null, toDisplayString$1(unref(t2)("gitCodeLayout.home.technicalSupport")), 1),
20542
+ _cache[1] || (_cache[1] = createElementVNode("a", {
20543
+ href: "https://www.csdn.net/",
20544
+ target: "_blank",
20545
+ rel: "noopener noreferrer"
20546
+ }, "CSDN", -1)),
20547
+ _cache[2] || (_cache[2] = createTextVNode("  |  ")),
20548
+ createElementVNode("a", _hoisted_8$2, toDisplayString$1(unref(t2)("gitCodeLayout.home.HWCloud")), 1)
20549
+ ], 2),
20550
+ createElementVNode("p", _hoisted_9$2, [
20551
+ createVNode(GLink, {
20552
+ target: "_blank",
20553
+ href: unref(currentHelpDocsAboutUsUrl)()
20554
+ }, {
20555
+ default: withCtx(() => [
20556
+ createTextVNode(toDisplayString$1(unref(copyright).aboutUs), 1)
20557
+ ]),
20558
+ _: 1
20559
+ }, 8, ["href"]),
20560
+ _cache[3] || (_cache[3] = createTextVNode("  |   ")),
20561
+ createVNode(GLink, {
20562
+ target: "_blank",
20563
+ href: unref(copyright).beian_url
20564
+ }, {
20565
+ default: withCtx(() => [
20566
+ createTextVNode(toDisplayString$1(unref(copyright).recruitment), 1)
20567
+ ]),
20568
+ _: 1
20569
+ }, 8, ["href"])
20570
+ ]),
20571
+ createElementVNode("ul", _hoisted_10$2, [
20572
+ _cache[4] || (_cache[4] = createElementVNode("li", { class: "footer-work-info__item" }, [
20573
+ createElementVNode("span", { class: "" }, "400-6868-951")
20574
+ ], -1)),
20575
+ createElementVNode("li", _hoisted_11$2, [
20576
+ createElementVNode("span", _hoisted_12$2, "9:00-18:00 (" + toDisplayString$1(unref(t2)("gitCodeLayout.home.onWeekdays")) + ")", 1)
20577
+ ])
20578
+ ])
20579
+ ]);
20580
+ };
20581
+ }
20582
+ });
20583
+ const ContactInfo = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-vue-layout-gitcode"]]);
20584
+ const _hoisted_1$e = { class: "config-aside__main" };
20585
+ const _hoisted_2$9 = { key: 0 };
20586
+ const _hoisted_3$9 = {
20587
+ key: 1,
20588
+ class: "aside-menus"
20589
+ };
20590
+ const _hoisted_4$7 = {
20591
+ key: 1,
20592
+ class: "line line--mt"
20593
+ };
20594
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
20595
+ __name: "configAideContent",
20596
+ props: {
20597
+ sceneValue: { default: SceneValue.home },
20598
+ isLogin: { type: Boolean, default: false },
20599
+ asideDefaultWidth: { default: 240 },
20600
+ asideSetShowLittle: { type: Boolean, default: false },
20601
+ independence: { type: Boolean, default: false },
20602
+ showPreferencesSetting: { type: Boolean },
20603
+ showThemeSetting: { type: Boolean },
20604
+ showLangSetting: { type: Boolean },
20605
+ slotKeys: { default: () => [] },
20606
+ collapseMode: { type: Boolean, default: false }
20607
+ },
20608
+ setup(__props) {
20609
+ const layoutConfig2 = useLayoutConfig();
20610
+ const userInfo = inject("userInfo");
20611
+ const globalStore = inject("globalStore");
20612
+ const route = useRoute();
20613
+ const serverList = ref([]);
20614
+ const request = inject("request");
20615
+ const API = asideRequest(request);
20616
+ const props = __props;
20617
+ const layoutSlotKeys = computed(() => {
20618
+ return [...props.slotKeys, "project", "team"];
20619
+ });
20620
+ const useReport2 = inject("useReport");
20621
+ provide("independence", props.independence);
20622
+ const { isEn, area, fetchArea, sideLoading } = useConfigSide(request, props.sceneValue);
20623
+ fetchArea();
20624
+ const isScroll = ref(false);
20625
+ const timer = ref(null);
20626
+ const isGroupHover = ref(false);
20627
+ const visibleItems = computed(() => {
20628
+ switch (props.sceneValue) {
20629
+ case SceneValue.news:
20630
+ return [];
20631
+ case SceneValue.blog:
20632
+ return [AsideDisplayItem.LINK, AsideDisplayItem.SITE_INFO];
20633
+ case SceneValue.home:
20634
+ return [
20635
+ AsideDisplayItem.LINK,
20636
+ AsideDisplayItem.PREFERENCE
20637
+ ];
20638
+ case SceneValue.repo:
20639
+ case SceneValue.org:
20640
+ case SceneValue.aiHome:
20641
+ case SceneValue.aiRepo:
20642
+ case SceneValue.active:
20643
+ case SceneValue.aiGuide:
20644
+ return [
20645
+ AsideDisplayItem.LINK,
20646
+ AsideDisplayItem.SITE_INFO,
20647
+ AsideDisplayItem.PREFERENCE
20648
+ ];
20649
+ default:
20650
+ return [
20651
+ AsideDisplayItem.LINK,
20652
+ AsideDisplayItem.SITE_INFO,
20653
+ AsideDisplayItem.PREFERENCE
20654
+ ];
20655
+ }
20656
+ });
20657
+ const isModuleVisible = (auth) => {
20658
+ return visibleItems.value.includes(auth);
20659
+ };
20660
+ computed(() => (userInfo == null ? void 0 : userInfo.username) || JSON.parse(localStorage$2.getItem("userInfo") || "{}").username);
20661
+ const showPreferencesSetting = computed(() => {
20662
+ if (props.showPreferencesSetting !== void 0) return props.showPreferencesSetting;
20663
+ return (route == null ? void 0 : route.name) !== AICopilot_ROUTE_NAME && isModuleVisible(AsideDisplayItem.PREFERENCE);
20664
+ });
20665
+ const handleScroll = () => {
20666
+ isScroll.value = true;
20667
+ if (timer.value) clearTimeout(timer.value);
20668
+ timer.value = setTimeout(() => {
20669
+ isScroll.value = false;
20670
+ }, 1e3);
20671
+ };
20672
+ const handleMouseLeave = () => {
20673
+ isScroll.value = false;
20674
+ };
20675
+ const handleAsideMenuExpo = (type) => {
20676
+ if (type === "expo") {
20677
+ useReport2(REPO_EVENT.SHOW, { module_name: ASIDE_MENU_REPO.ASIDEEXPO });
20678
+ }
20679
+ };
20680
+ const getAreaItem = (item) => {
20681
+ return item.filter((item2) => {
20682
+ if (item2.left_menu_url === "/dashboard/downloads") {
20683
+ if (!globalStore.value.downloadHistoryVisible) {
20684
+ return false;
20685
+ }
20686
+ }
20687
+ if (item2.left_menu_url === "/dashboard/downloads?tab=view") {
20688
+ if (!globalStore.value.browseHistoryVisible) {
20689
+ return false;
20690
+ }
20691
+ }
20692
+ if (item2.select_scene && item2.select_scene.length && !item2.select_scene.includes(props.sceneValue)) {
20693
+ return false;
20694
+ }
20695
+ return true;
20696
+ }).map((item2) => {
20697
+ if (props.asideSetShowLittle) {
20698
+ return {
20699
+ ...item2,
20700
+ left_menu_name_cn: item2.left_menu_name_cn_shrink,
20701
+ left_menu_name_en: item2.left_menu_name_en_shrink
20702
+ };
20703
+ }
20704
+ return item2;
20705
+ });
20706
+ };
20707
+ const getUserGroupChatServerList = async () => {
20708
+ var _a;
20709
+ const res = await API.getGroupChatServerList();
20710
+ const data = ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.data) || [];
20711
+ serverList.value = data;
20712
+ };
20713
+ getUserGroupChatServerList();
20714
+ const displayArea = computed(() => {
20715
+ return area.value.filter((item) => {
20716
+ return getAreaItem(item).length;
20717
+ });
20718
+ });
20719
+ const toGroupChat = () => {
20720
+ var _a;
20721
+ window.open(transformUrl(layoutConfig2.VITE_HOST) + "/im?server_id=" + ((_a = serverList.value[0]) == null ? void 0 : _a.server_id), "_blank");
20722
+ };
20723
+ watch(() => area.value, (newVal) => {
20724
+ console.log("area", newVal);
20725
+ });
20726
+ return (_ctx, _cache) => {
20727
+ return openBlock(), createBlock(unref(Aside), {
20728
+ class: normalizeClass(["config-aside-content", { "side-bar-content-shot": _ctx.asideSetShowLittle }])
20729
+ }, {
20730
+ default: withCtx(() => [
20731
+ createElementVNode("div", {
20732
+ class: normalizeClass(["config-aside__content", { "side-bar-content-shot": _ctx.asideSetShowLittle, "shot-isCh": !unref(isEn) }])
20733
+ }, [
20734
+ withDirectives((openBlock(), createElementBlock("div", _hoisted_1$e, [
20735
+ createElementVNode("div", {
20736
+ class: normalizeClass(["scroll-content config-aside__scroll", { scroll: isScroll.value }]),
20737
+ onScroll: handleScroll,
20738
+ onMouseleave: handleMouseLeave
20734
20739
  }, [
20735
- _cache[3] || (_cache[3] = createElementVNode("svg", {
20736
- xmlns: "http://www.w3.org/2000/svg",
20737
- width: "14",
20738
- height: "14",
20739
- viewBox: "0 0 24 24",
20740
- fill: "none",
20741
- stroke: "currentColor",
20742
- "stroke-width": "2",
20743
- "stroke-linecap": "round",
20744
- "stroke-linejoin": "round",
20745
- class: "home-channel-side-nav__more-icon"
20746
- }, [
20747
- createElementVNode("path", { d: "m18 15-6-6-6 6" })
20748
- ], -1)),
20749
- createElementVNode("span", null, toDisplayString$1(unref(t2)("gitCodeLayout.home.channel.collapseChannels")), 1)
20750
- ])) : createCommentVNode("", true),
20751
- createElementVNode("div", _hoisted_16$1, [
20752
- _cache[8] || (_cache[8] = createElementVNode("div", { class: "home-channel-side-nav__footer-divider" }, null, -1)),
20753
- createElementVNode("footer", _hoisted_17$1, [
20754
- createElementVNode("nav", _hoisted_18$1, [
20755
- (openBlock(true), createElementBlock(Fragment, null, renderList(siteShortcutLinks.value, (shortcut) => {
20756
- return openBlock(), createElementBlock("a", {
20757
- key: shortcut.name,
20758
- class: "nav-site-shortcut",
20759
- href: shortcut.url,
20760
- target: "_blank",
20761
- rel: "noopener noreferrer"
20740
+ unref(sideLoading) ? (openBlock(), createElementBlock("div", _hoisted_2$9, [
20741
+ createVNode(unref(Skeleton), {
20742
+ loading: unref(sideLoading),
20743
+ row: 4
20744
+ }, null, 8, ["loading"])
20745
+ ])) : (openBlock(), createElementBlock("div", _hoisted_3$9, [
20746
+ (openBlock(true), createElementBlock(Fragment, null, renderList(displayArea.value, (item, index2) => {
20747
+ return openBlock(), createElementBlock(Fragment, {
20748
+ key: item.id
20749
+ }, [
20750
+ createVNode(Area, {
20751
+ list: getAreaItem(item),
20752
+ isLogin: _ctx.isLogin,
20753
+ slotKeys: layoutSlotKeys.value,
20754
+ sceneValue: _ctx.sceneValue,
20755
+ asideSetShowLittle: _ctx.asideSetShowLittle
20756
+ }, createSlots({ _: 2 }, [
20757
+ renderList(layoutSlotKeys.value, (key) => {
20758
+ return {
20759
+ name: key,
20760
+ fn: withCtx(() => [
20761
+ renderSlot(_ctx.$slots, key, {}, void 0, true)
20762
+ ])
20763
+ };
20764
+ })
20765
+ ]), 1032, ["list", "isLogin", "slotKeys", "sceneValue", "asideSetShowLittle"]),
20766
+ !index2 && !unref(isPhone)() && serverList.value.length ? (openBlock(), createElementBlock("div", {
20767
+ key: 0,
20768
+ class: "group-discussion",
20769
+ onMouseenter: _cache[0] || (_cache[0] = ($event) => isGroupHover.value = true),
20770
+ onMouseleave: _cache[1] || (_cache[1] = ($event) => isGroupHover.value = false),
20771
+ onClick: toGroupChat
20762
20772
  }, [
20763
- shortcut.icon === "newspaper" ? (openBlock(), createElementBlock("svg", _hoisted_20$1, _cache[4] || (_cache[4] = [
20764
- createElementVNode("path", { d: "M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2" }, null, -1),
20765
- createElementVNode("path", { d: "M18 14h-8" }, null, -1),
20766
- createElementVNode("path", { d: "M15 18h-5" }, null, -1),
20767
- createElementVNode("path", { d: "M10 6h8v4h-8V6Z" }, null, -1)
20768
- ]))) : shortcut.icon === "book-open" ? (openBlock(), createElementBlock("svg", _hoisted_21$1, _cache[5] || (_cache[5] = [
20769
- createElementVNode("path", { d: "M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" }, null, -1),
20770
- createElementVNode("path", { d: "M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" }, null, -1)
20771
- ]))) : shortcut.icon === "message-square" ? (openBlock(), createElementBlock("svg", _hoisted_22$1, _cache[6] || (_cache[6] = [
20772
- createElementVNode("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }, null, -1)
20773
- ]))) : (openBlock(), createElementBlock("svg", _hoisted_23$1, _cache[7] || (_cache[7] = [
20774
- createElementVNode("path", { d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1" }, null, -1),
20775
- createElementVNode("path", { d: "M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1" }, null, -1)
20776
- ]))),
20777
- createElementVNode("span", null, toDisplayString$1(shortcut.name), 1)
20778
- ], 8, _hoisted_19$1);
20779
- }), 128))
20780
- ])
20781
- ])
20782
- ])
20783
- ]),
20784
- _: 1
20785
- }, 512),
20786
- showThemeSetting.value || showLangSetting.value ? (openBlock(), createElementBlock("div", _hoisted_24$1, [
20787
- createElementVNode("div", _hoisted_25$1, [
20788
- createVNode(AsideFooterTools, {
20789
- "show-theme-setting": showThemeSetting.value,
20790
- "show-lang-setting": showLangSetting.value,
20791
- position: ["top-start", "top-end"]
20792
- }, null, 8, ["show-theme-setting", "show-lang-setting"])
20773
+ createVNode(GIcon, {
20774
+ name: isGroupHover.value ? "gt-plane-users-black" : "gt-line-users",
20775
+ size: "16"
20776
+ }, null, 8, ["name"]),
20777
+ _cache[2] || (_cache[2] = createElementVNode("span", null, "群组讨论", -1))
20778
+ ], 32)) : createCommentVNode("", true),
20779
+ !_ctx.asideSetShowLittle && index2 !== displayArea.value.length - 1 ? (openBlock(), createElementBlock("hr", _hoisted_4$7)) : createCommentVNode("", true)
20780
+ ], 64);
20781
+ }), 128)),
20782
+ !_ctx.asideSetShowLittle && isModuleVisible(unref(AsideDisplayItem).LINK) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
20783
+ _cache[3] || (_cache[3] = createElementVNode("hr", { class: "line line--my" }, null, -1)),
20784
+ createVNode(SubMenuList)
20785
+ ], 64)) : createCommentVNode("", true)
20786
+ ])),
20787
+ !_ctx.asideSetShowLittle && isModuleVisible(unref(AsideDisplayItem).SITE_INFO) ? (openBlock(), createBlock(ContactInfo, { key: 2 })) : createCommentVNode("", true)
20788
+ ], 34),
20789
+ showPreferencesSetting.value ? (openBlock(), createElementBlock("div", {
20790
+ key: 0,
20791
+ class: normalizeClass(["aside-footer-tools", { "aside-footer-tools-little": _ctx.asideSetShowLittle }])
20792
+ }, [
20793
+ createVNode(Settings, {
20794
+ "show-lang-setting": _ctx.showLangSetting,
20795
+ "show-theme-setting": _ctx.showThemeSetting,
20796
+ asideSetShowLittle: _ctx.asideSetShowLittle
20797
+ }, null, 8, ["show-lang-setting", "show-theme-setting", "asideSetShowLittle"])
20798
+ ], 2)) : createCommentVNode("", true)
20799
+ ])), [
20800
+ [unref(vElementExposure), { trigger: (type) => handleAsideMenuExpo(type) }]
20793
20801
  ])
20794
- ])) : createCommentVNode("", true)
20795
- ])
20796
- ], 2);
20802
+ ], 2)
20803
+ ]),
20804
+ _: 3
20805
+ }, 8, ["class"]);
20797
20806
  };
20798
20807
  }
20799
20808
  });
20800
- const AsideV2Content = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-vue-layout-gitcode"]]);
20809
+ const ConfigAideContent = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-vue-layout-gitcode"]]);
20801
20810
  const _hoisted_1$d = { class: "aside-drawer-header" };
20802
20811
  const _sfc_main$f = /* @__PURE__ */ defineComponent({
20803
- ...{ name: "GitCodeAsideV2", inheritAttrs: false },
20804
20812
  __name: "index",
20805
20813
  props: {
20806
- showThemeSetting: { type: Boolean, default: void 0 },
20807
- showLangSetting: { type: Boolean, default: void 0 },
20808
- collapseMode: { type: Boolean, default: false },
20809
20814
  sceneValue: { default: SceneValue.home },
20810
20815
  disableFlatMode: { type: Boolean, default: false },
20811
- singleCol: { type: Boolean, default: false },
20812
- channels: { default: void 0 },
20813
- modelValue: { default: "" },
20814
- activeChannel: { default: "" },
20815
20816
  userInfo: { default: () => ({}) },
20816
20817
  isLogin: { type: Boolean },
20817
20818
  request: { type: Function, default: proxyService },
@@ -20819,12 +20820,13 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
20819
20820
  httpStatus: 200
20820
20821
  }) },
20821
20822
  independence: { type: Boolean, default: false },
20822
- onChannelChange: { type: Function, default: void 0 }
20823
+ showPreferencesSetting: { type: Boolean, default: void 0 },
20824
+ showThemeSetting: { type: Boolean, default: void 0 },
20825
+ showLangSetting: { type: Boolean, default: void 0 },
20826
+ collapseMode: { type: Boolean, default: false },
20827
+ slotKeys: { default: () => [] }
20823
20828
  },
20824
- emits: ["update:modelValue", "update:activeChannel", "channelChange", "select"],
20825
- setup(__props, { emit: __emit }) {
20826
- const props = __props;
20827
- const emit = __emit;
20829
+ setup(__props) {
20828
20830
  const route = useRoute();
20829
20831
  const router2 = useRouter();
20830
20832
  const layoutConfig2 = useLayoutConfig();
@@ -20850,6 +20852,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
20850
20852
  }
20851
20853
  }
20852
20854
  const { headerHeight: headerHeight2 } = useHeaderHeight();
20855
+ const props = __props;
20853
20856
  const { useReport: useReport2 } = useRequestReport(props.request, props.globalStore);
20854
20857
  provide(
20855
20858
  "globalStore",
@@ -20878,7 +20881,6 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
20878
20881
  });
20879
20882
  const sizeStore = usePageResize();
20880
20883
  const asideSetShow = computed(() => {
20881
- if (props.singleCol) return false;
20882
20884
  return (props.sceneValue === SceneValue.home && !sizeStore.isMobile.value || props.collapseMode) && !props.disableFlatMode;
20883
20885
  });
20884
20886
  provide("asideSetShow", asideSetShow);
@@ -20942,11 +20944,6 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
20942
20944
  }
20943
20945
  };
20944
20946
  initHomePageAside();
20945
- const handleDrawerChannelChange = (item) => {
20946
- var _a;
20947
- handleAsideVisible(false);
20948
- (_a = props.onChannelChange) == null ? void 0 : _a.call(props, item);
20949
- };
20950
20947
  onMounted(() => {
20951
20948
  addEventListener("toggleAsideMenuByHamburger", () => {
20952
20949
  handleClickMenu();
@@ -20957,30 +20954,33 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
20957
20954
  offEvent("toggleAsideMenuByHamburger");
20958
20955
  });
20959
20956
  return (_ctx, _cache) => {
20960
- return props.singleCol ? (openBlock(), createBlock(AsideV2Content, mergeProps({ key: 0 }, props, {
20957
+ return asideSetShow.value ? (openBlock(), createBlock(ConfigAideContent, {
20958
+ key: 0,
20959
+ class: normalizeClass(["left-side-bar", { oldWhite: asideSetShowLittleMode.value, higherZIndex: unref(SITE_STATUS).DISABLE }]),
20960
+ style: normalizeStyle({ width: mainMarginLeftWidth.value + "px", top: unref(headerHeight2) + "px" }),
20961
+ sceneValue: _ctx.sceneValue,
20962
+ asideDefaultWidth: mainMarginLeftWidth.value,
20963
+ asideSetShowLittle: asideSetShowLittleMode.value,
20964
+ isLogin: _ctx.isLogin,
20965
+ showPreferencesSetting: _ctx.showPreferencesSetting,
20961
20966
  showThemeSetting: _ctx.showThemeSetting,
20962
20967
  showLangSetting: _ctx.showLangSetting,
20963
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event)),
20964
- "onUpdate:activeChannel": _cache[1] || (_cache[1] = ($event) => emit("update:activeChannel", $event)),
20965
- onChannelChange: _cache[2] || (_cache[2] = ($event) => emit("channelChange", $event)),
20966
- onSelect: _cache[3] || (_cache[3] = ($event) => emit("select", $event))
20967
- }), null, 16, ["showThemeSetting", "showLangSetting"])) : asideSetShow.value ? (openBlock(), createElementBlock("div", {
20968
+ independence: _ctx.independence,
20969
+ slotKeys: _ctx.slotKeys,
20970
+ collapseMode: _ctx.collapseMode
20971
+ }, createSlots({ _: 2 }, [
20972
+ renderList(_ctx.slotKeys, (key) => {
20973
+ return {
20974
+ name: key,
20975
+ fn: withCtx(() => [
20976
+ renderSlot(_ctx.$slots, key, {}, void 0, true)
20977
+ ])
20978
+ };
20979
+ })
20980
+ ]), 1032, ["class", "style", "sceneValue", "asideDefaultWidth", "asideSetShowLittle", "isLogin", "showPreferencesSetting", "showThemeSetting", "showLangSetting", "independence", "slotKeys", "collapseMode"])) : (openBlock(), createBlock(unref(Drawer), {
20968
20981
  key: 1,
20969
- class: normalizeClass(["left-side-bar gitcode-aside-v2-container", { oldWhite: asideSetShowLittleMode.value, higherZIndex: unref(SITE_STATUS).DISABLE }]),
20970
- style: normalizeStyle({ width: mainMarginLeftWidth.value + "px", top: unref(headerHeight2) + "px" })
20971
- }, [
20972
- createVNode(AsideV2Content, mergeProps(props, {
20973
- showThemeSetting: _ctx.showThemeSetting,
20974
- showLangSetting: _ctx.showLangSetting,
20975
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => emit("update:modelValue", $event)),
20976
- "onUpdate:activeChannel": _cache[5] || (_cache[5] = ($event) => emit("update:activeChannel", $event)),
20977
- onChannelChange: _cache[6] || (_cache[6] = ($event) => emit("channelChange", $event)),
20978
- onSelect: _cache[7] || (_cache[7] = ($event) => emit("select", $event))
20979
- }), null, 16, ["showThemeSetting", "showLangSetting"])
20980
- ], 6)) : (openBlock(), createBlock(unref(Drawer), {
20981
- key: 2,
20982
20982
  modelValue: asideVisible.value,
20983
- "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => asideVisible.value = $event),
20983
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => asideVisible.value = $event),
20984
20984
  position: "left",
20985
20985
  "lock-scroll": "",
20986
20986
  style: normalizeStyle([{ "top": "0", "max-height": "100%" }, { width: "240px", overflowY: "hidden" }]),
@@ -20998,27 +20998,27 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
20998
20998
  createVNode(unref(Button), {
20999
20999
  class: "draw-side-bar-close",
21000
21000
  icon: "close",
21001
- onClick: _cache[8] || (_cache[8] = ($event) => handleAsideVisible(false)),
21001
+ onClick: _cache[0] || (_cache[0] = ($event) => handleAsideVisible(false)),
21002
21002
  variant: "text"
21003
21003
  })
21004
21004
  ]),
21005
- createVNode(AsideV2Content, mergeProps(props, {
21006
- "single-col": "",
21005
+ createVNode(ConfigAideContent, mergeProps(props, {
21006
+ sceneValue: _ctx.sceneValue,
21007
+ asideDefaultWidth: 240,
21008
+ isLogin: _ctx.isLogin,
21009
+ showPreferencesSetting: _ctx.showPreferencesSetting,
21007
21010
  showThemeSetting: _ctx.showThemeSetting,
21008
21011
  showLangSetting: _ctx.showLangSetting,
21009
- "on-channel-change": handleDrawerChannelChange,
21010
- "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => emit("update:modelValue", $event)),
21011
- "onUpdate:activeChannel": _cache[10] || (_cache[10] = ($event) => emit("update:activeChannel", $event)),
21012
- onChannelChange: _cache[11] || (_cache[11] = ($event) => emit("channelChange", $event)),
21013
- onSelect: _cache[12] || (_cache[12] = ($event) => emit("select", $event))
21014
- }), null, 16, ["showThemeSetting", "showLangSetting"])
21012
+ independence: _ctx.independence,
21013
+ slotKeys: _ctx.slotKeys
21014
+ }), null, 16, ["sceneValue", "isLogin", "showPreferencesSetting", "showThemeSetting", "showLangSetting", "independence", "slotKeys"])
21015
21015
  ]),
21016
21016
  _: 1
21017
21017
  }, 8, ["modelValue"]));
21018
21018
  };
21019
21019
  }
21020
21020
  });
21021
- const GitCodeAsideV2 = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-vue-layout-gitcode"]]);
21021
+ const GitCodeAside = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-vue-layout-gitcode"]]);
21022
21022
  const repoInfoData = {
21023
21023
  "star_count": 0,
21024
21024
  "forks_count": 0,
@@ -26537,7 +26537,7 @@ const _SlidCaptchaManager = class _SlidCaptchaManager {
26537
26537
  __publicField(_SlidCaptchaManager, "instance");
26538
26538
  let SlidCaptchaManager = _SlidCaptchaManager;
26539
26539
  const slidCaptchaManager = SlidCaptchaManager.getInstance();
26540
- const SlidCaptcha = defineAsyncComponent(() => import("./index-G4pKhP1O.js"));
26540
+ const SlidCaptcha = defineAsyncComponent(() => import("./index-D1f9dtXu.js"));
26541
26541
  const useSlidCaptcha = () => {
26542
26542
  const { mount, unMount, isMounted } = usePopup("slid-captcha-popup");
26543
26543
  const open = (config) => {
@@ -26567,7 +26567,7 @@ const useSlidCaptcha = () => {
26567
26567
  close
26568
26568
  };
26569
26569
  };
26570
- const YunpianCaptcha = defineAsyncComponent(() => import("./index-CzVoqAG1.js"));
26570
+ const YunpianCaptcha = defineAsyncComponent(() => import("./index-lsN8c1aR.js"));
26571
26571
  const useYunpianCaptcha = () => {
26572
26572
  const { mount, unMount } = usePopup("yunpian-captcha-popup");
26573
26573
  const open = (config) => {