import { defineComponent, ref, shallowRef, watch, resolveComponent, openBlock, createBlock, withCtx, createVNode, createTextVNode, resolveDynamicComponent, unref, createElementBlock, Fragment, renderList, createElementVNode, withDirectives, vShow, reactive, h, toRefs, computed, onMounted, onUnmounted, Transition, KeepAlive } from "vue";
import { T as ChartEnum, U as PageEnum, i as icon, g as getUUID, h as fetchPathByName, o as routerTurnByPath, _ as _export_sfc, y as useDesignStore, V as openDoc, W as openGiteeSourceCode, r as renderIcon, X as RouterLink, O as useSettingStore, e as useRoute, Y as asideWidth, Z as _sfc_main$6 } from "./index-e2623483.js";
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    show: Boolean
  },
  emits: ["close"],
  setup(__props, { emit }) {
    const props = __props;
    const { FishIcon, CloseIcon } = icon.ionicons5;
    const { StoreIcon: StoreIcon2, ObjectStorageIcon: ObjectStorageIcon2 } = icon.carbon;
    const showRef = ref(false);
    const typeList = shallowRef([
      {
        title: "新项目",
        key: ChartEnum.CHART_HOME_NAME,
        icon: FishIcon,
        disabled: false
      },
      {
        title: "我的模板",
        key: PageEnum.BASE_HOME_TEMPLATE_NAME,
        icon: ObjectStorageIcon2,
        disabled: true
      },
      {
        title: "模板市场",
        key: PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME,
        icon: StoreIcon2,
        disabled: true
      }
    ]);
    watch(props, (newValue) => {
      showRef.value = newValue.show;
    });
    const closeHandle = () => {
      emit("close", false);
    };
    const btnHandle = (key) => {
      closeHandle();
      const id = getUUID();
      const path = fetchPathByName(ChartEnum.CHART_HOME_NAME, "href");
      routerTurnByPath(path, [id], void 0, true);
    };
    return (_ctx, _cache) => {
      const _component_n_text = resolveComponent("n-text");
      const _component_n_icon = resolveComponent("n-icon");
      const _component_n_button = resolveComponent("n-button");
      const _component_n_space = resolveComponent("n-space");
      const _component_n_card = resolveComponent("n-card");
      const _component_n_modal = resolveComponent("n-modal");
      return openBlock(), createBlock(_component_n_modal, {
        show: showRef.value,
        "onUpdate:show": _cache[0] || (_cache[0] = ($event) => showRef.value = $event),
        class: "go-create-modal",
        onAfterLeave: closeHandle
      }, {
        default: withCtx(() => [
          createVNode(_component_n_space, { size: "large" }, {
            default: withCtx(() => [
              createVNode(_component_n_card, {
                class: "card-box",
                hoverable: ""
              }, {
                header: withCtx(() => [
                  createVNode(_component_n_text, { class: "card-box-tite" }, {
                    default: withCtx(() => [
                      createTextVNode(" project.create_tip")
                    ]),
                    _: 1
                  })
                ]),
                "header-extra": withCtx(() => [
                  createVNode(_component_n_text, { onClick: closeHandle }, {
                    default: withCtx(() => [
                      createVNode(_component_n_icon, { size: "20" }, {
                        default: withCtx(() => [
                          (openBlock(), createBlock(resolveDynamicComponent(unref(CloseIcon))))
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  })
                ]),
                action: withCtx(() => []),
                default: withCtx(() => [
                  createVNode(_component_n_space, {
                    class: "card-box-content",
                    justify: "center"
                  }, {
                    default: withCtx(() => [
                      (openBlock(true), createElementBlock(Fragment, null, renderList(typeList.value, (item) => {
                        return openBlock(), createBlock(_component_n_button, {
                          size: "large",
                          disabled: item.disabled,
                          key: item.key,
                          onClick: btnHandle
                        }, {
                          icon: withCtx(() => [
                            createVNode(_component_n_icon, { size: "18" }, {
                              default: withCtx(() => [
                                (openBlock(), createBlock(resolveDynamicComponent(item.icon)))
                              ]),
                              _: 2
                            }, 1024)
                          ]),
                          default: withCtx(() => [
                            (openBlock(), createBlock(resolveDynamicComponent(item.title)))
                          ]),
                          _: 2
                        }, 1032, ["disabled"]);
                      }), 128))
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              })
            ]),
            _: 1
          })
        ]),
        _: 1
      }, 8, ["show"]);
    };
  }
});
const index_vue_vue_type_style_index_0_scoped_cc74c483_lang = "";
const CreateModal = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-cc74c483"]]);
const _hoisted_1$3 = /* @__PURE__ */ createElementVNode("span", null, " project.create_btn ", -1);
const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("span", null, " create_btn ", -1);
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    collapsed: Boolean
  },
  setup(__props) {
    const { DuplicateIcon, DuplicateOutlineIcon } = icon.ionicons5;
    const designStore = useDesignStore();
    const modalShow = ref(false);
    const clickHandle = () => {
      modalShow.value = true;
    };
    const closeHandle = () => {
      modalShow.value = false;
    };
    return (_ctx, _cache) => {
      const _component_n_icon = resolveComponent("n-icon");
      const _component_n_button = resolveComponent("n-button");
      const _component_n_tooltip = resolveComponent("n-tooltip");
      return openBlock(), createElementBlock(Fragment, null, [
        createElementVNode("div", { onClick: clickHandle }, [
          __props.collapsed ? (openBlock(), createBlock(_component_n_tooltip, {
            key: 0,
            placement: "right",
            trigger: "hover"
          }, {
            trigger: withCtx(() => [
              createVNode(_component_n_button, {
                ghost: "",
                type: "primary",
                size: "small"
              }, {
                icon: withCtx(() => [
                  createVNode(_component_n_icon, null, {
                    default: withCtx(() => [
                      withDirectives(createVNode(unref(DuplicateOutlineIcon), null, null, 512), [
                        [vShow, unref(designStore).getDarkTheme]
                      ]),
                      withDirectives(createVNode(unref(DuplicateIcon), null, null, 512), [
                        [vShow, !unref(designStore).getDarkTheme]
                      ])
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              })
            ]),
            default: withCtx(() => [
              _hoisted_1$3
            ]),
            _: 1
          })) : (openBlock(), createBlock(_component_n_button, {
            key: 1,
            ghost: "",
            type: "primary"
          }, {
            icon: withCtx(() => [
              createVNode(_component_n_icon, null, {
                default: withCtx(() => [
                  withDirectives(createVNode(unref(DuplicateOutlineIcon), null, null, 512), [
                    [vShow, unref(designStore).getDarkTheme]
                  ]),
                  withDirectives(createVNode(unref(DuplicateIcon), null, null, 512), [
                    [vShow, !unref(designStore).getDarkTheme]
                  ])
                ]),
                _: 1
              })
            ]),
            default: withCtx(() => [
              _hoisted_2$1
            ]),
            _: 1
          }))
        ]),
        createVNode(unref(CreateModal), {
          show: modalShow.value,
          onClose: closeHandle
        }, null, 8, ["show"])
      ], 64);
    };
  }
});
const _hoisted_1$2 = { class: "go-aside-footer" };
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    collapsed: Boolean
  },
  setup(__props) {
    const { DocumentTextIcon, CodeSlashIcon } = icon.ionicons5;
    const handleDoc = () => {
      openDoc();
    };
    const handleCode = () => {
      openGiteeSourceCode();
    };
    return (_ctx, _cache) => {
      const _component_n_divider = resolveComponent("n-divider");
      const _component_n_icon = resolveComponent("n-icon");
      const _component_n_button = resolveComponent("n-button");
      const _component_n_text = resolveComponent("n-text");
      const _component_n_tooltip = resolveComponent("n-tooltip");
      const _component_n_space = resolveComponent("n-space");
      return openBlock(), createElementBlock("div", _hoisted_1$2, [
        createVNode(_component_n_divider, { class: "go-mt-0" }),
        createVNode(_component_n_space, { justify: "space-around" }, {
          default: withCtx(() => [
            __props.collapsed ? (openBlock(), createBlock(_component_n_tooltip, {
              key: 0,
              placement: "right",
              trigger: "hover"
            }, {
              trigger: withCtx(() => [
                createVNode(_component_n_button, {
                  secondary: "",
                  onClick: handleDoc
                }, {
                  icon: withCtx(() => [
                    createVNode(_component_n_icon, { size: "18" }, {
                      default: withCtx(() => [
                        createVNode(unref(DocumentTextIcon))
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                })
              ]),
              default: withCtx(() => [
                createVNode(_component_n_text, null, {
                  default: withCtx(() => [
                    createTextVNode(" global.doc ")
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })) : (openBlock(), createBlock(_component_n_button, {
              key: 1,
              secondary: "",
              onClick: handleDoc
            }, {
              icon: withCtx(() => [
                createVNode(_component_n_icon, { size: "18" }, {
                  default: withCtx(() => [
                    createVNode(unref(DocumentTextIcon))
                  ]),
                  _: 1
                })
              ]),
              default: withCtx(() => [
                createVNode(_component_n_text, null, {
                  default: withCtx(() => [
                    createTextVNode("global.doc")
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })),
            __props.collapsed ? (openBlock(), createBlock(_component_n_tooltip, {
              key: 2,
              placement: "right",
              trigger: "hover"
            }, {
              trigger: withCtx(() => [
                createVNode(_component_n_button, {
                  secondary: "",
                  onClick: handleDoc
                }, {
                  icon: withCtx(() => [
                    createVNode(_component_n_icon, { size: "18" }, {
                      default: withCtx(() => [
                        createVNode(unref(CodeSlashIcon))
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                })
              ]),
              default: withCtx(() => [
                createVNode(_component_n_text, null, {
                  default: withCtx(() => [
                    createTextVNode(" global.code_addr ")
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })) : (openBlock(), createBlock(_component_n_button, {
              key: 3,
              secondary: "",
              onClick: handleCode
            }, {
              icon: withCtx(() => [
                createVNode(_component_n_icon, { size: "18" }, {
                  default: withCtx(() => [
                    createVNode(unref(CodeSlashIcon))
                  ]),
                  _: 1
                })
              ]),
              default: withCtx(() => [
                withDirectives(createVNode(_component_n_text, null, {
                  default: withCtx(() => [
                    createTextVNode("global.code_addr")
                  ]),
                  _: 1
                }, 512), [
                  [vShow, !__props.collapsed]
                ])
              ]),
              _: 1
            }))
          ]),
          _: 1
        })
      ]);
    };
  }
});
const index_vue_vue_type_style_index_0_scoped_1a224f78_lang = "";
const ProjectLayoutAsideFooter = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-1a224f78"]]);
const { GridIcon, TvOutlineIcon } = icon.ionicons5;
const { StoreIcon, ObjectStorageIcon, DevicesIcon } = icon.carbon;
const expandedKeys = () => ["all-project"];
const menuOptionsInit = () => {
  return reactive([
    {
      key: "divider-1",
      type: "divider"
    },
    {
      label: () => h("span", null, { default: () => "project.project" }),
      key: "all-project",
      icon: renderIcon(DevicesIcon),
      children: [
        {
          type: "group",
          label: () => h("span", null, { default: () => "project.my" }),
          key: "my-project",
          children: [
            {
              label: () => h(
                RouterLink,
                {
                  to: {
                    name: PageEnum.BASE_HOME_ITEMS_NAME
                  }
                },
                { default: () => "project.all_project" }
              ),
              key: PageEnum.BASE_HOME_ITEMS_NAME,
              icon: renderIcon(TvOutlineIcon)
            },
            {
              label: () => h(
                RouterLink,
                {
                  to: {
                    name: PageEnum.BASE_HOME_TEMPLATE_NAME
                  }
                },
                { default: () => "project.my_templete" }
              ),
              key: PageEnum.BASE_HOME_TEMPLATE_NAME,
              icon: renderIcon(ObjectStorageIcon)
            }
          ]
        }
      ]
    },
    {
      key: "divider-2",
      type: "divider"
    },
    {
      label: () => h(
        RouterLink,
        {
          to: {
            name: PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME
          }
        },
        { default: () => "project.template_market" }
      ),
      key: PageEnum.BASE_HOME_TEMPLATE_MARKET_NAME,
      icon: renderIcon(StoreIcon)
    }
  ]);
};
const _hoisted_1$1 = { class: "go-project-sider-flex" };
const _hoisted_2 = { class: "sider-bottom" };
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
  __name: "index",
  setup(__props) {
    const collapsed = ref(false);
    const { getAsideCollapsedWidth } = toRefs(useSettingStore());
    const route = useRoute();
    const menuValue = computed(() => route.name);
    const menuOptions = menuOptionsInit();
    const defaultExpandedKeys = expandedKeys();
    const watchWidth = () => {
      const Width = document.body.clientWidth;
      if (Width <= 950) {
        collapsed.value = true;
      } else
        collapsed.value = false;
    };
    onMounted(() => {
      window.addEventListener("resize", watchWidth);
    });
    onUnmounted(() => {
      window.removeEventListener("resize", watchWidth);
    });
    return (_ctx, _cache) => {
      const _component_n_space = resolveComponent("n-space");
      const _component_n_menu = resolveComponent("n-menu");
      const _component_n_layout_sider = resolveComponent("n-layout-sider");
      return openBlock(), createBlock(_component_n_layout_sider, {
        class: "go-project-sider",
        bordered: "",
        "collapse-mode": "width",
        "show-trigger": "bar",
        collapsed: collapsed.value,
        "native-scrollbar": false,
        "collapsed-width": unref(getAsideCollapsedWidth),
        width: unref(asideWidth),
        onCollapse: _cache[0] || (_cache[0] = ($event) => collapsed.value = true),
        onExpand: _cache[1] || (_cache[1] = ($event) => collapsed.value = false)
      }, {
        default: withCtx(() => [
          createElementVNode("div", _hoisted_1$1, [
            createElementVNode("aside", null, [
              createVNode(_component_n_space, {
                vertical: "",
                class: "go-project-sider-top"
              }, {
                default: withCtx(() => [
                  createVNode(unref(_sfc_main$4), { collapsed: collapsed.value }, null, 8, ["collapsed"])
                ]),
                _: 1
              }),
              createVNode(_component_n_menu, {
                value: menuValue.value,
                options: unref(menuOptions),
                "collapsed-width": unref(getAsideCollapsedWidth),
                "collapsed-icon-size": 22,
                "default-expanded-keys": unref(defaultExpandedKeys)
              }, null, 8, ["value", "options", "collapsed-width", "default-expanded-keys"])
            ]),
            createElementVNode("div", _hoisted_2, [
              createVNode(unref(ProjectLayoutAsideFooter), { collapsed: collapsed.value }, null, 8, ["collapsed"])
            ])
          ])
        ]),
        _: 1
      }, 8, ["collapsed", "collapsed-width", "width"]);
    };
  }
});
const index_vue_vue_type_style_index_0_scoped_58606bc9_lang = "";
const ProjectLayoutSider = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-58606bc9"]]);
const _sfc_main$1 = {};
function _sfc_render(_ctx, _cache) {
  const _component_router_view = resolveComponent("router-view");
  return openBlock(), createBlock(_component_router_view, null, {
    default: withCtx(({ Component, route }) => [
      createVNode(Transition, {
        name: "fade",
        mode: "out-in",
        appear: ""
      }, {
        default: withCtx(() => [
          route.meta.noKeepAlive ? (openBlock(), createBlock(resolveDynamicComponent(Component), {
            key: route.fullPath
          })) : (openBlock(), createBlock(KeepAlive, { key: 1 }, [
            (openBlock(), createBlock(resolveDynamicComponent(Component), {
              key: route.fullPath
            }))
          ], 1024))
        ]),
        _: 2
      }, 1024)
    ]),
    _: 1
  });
}
const LayoutTransitionMain = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render]]);
const _hoisted_1 = { class: "go-project" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  setup(__props) {
    return (_ctx, _cache) => {
      const _component_n_space = resolveComponent("n-space");
      const _component_router_view = resolveComponent("router-view");
      const _component_n_layout_content = resolveComponent("n-layout-content");
      const _component_n_layout = resolveComponent("n-layout");
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createVNode(_component_n_layout, {
          "has-sider": "",
          position: "absolute"
        }, {
          default: withCtx(() => [
            createVNode(_component_n_space, { vertical: "" }, {
              default: withCtx(() => [
                createVNode(unref(ProjectLayoutSider))
              ]),
              _: 1
            }),
            createVNode(_component_n_layout, null, {
              default: withCtx(() => [
                createVNode(unref(_sfc_main$6)),
                createVNode(_component_n_layout, {
                  id: "go-project-content-top",
                  class: "content-top",
                  position: "absolute",
                  "native-scrollbar": false
                }, {
                  default: withCtx(() => [
                    createVNode(_component_n_layout_content, null, {
                      default: withCtx(() => [
                        createVNode(unref(LayoutTransitionMain), null, {
                          default: withCtx(() => [
                            createVNode(_component_router_view)
                          ]),
                          _: 1
                        })
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        })
      ]);
    };
  }
});
const index_vue_vue_type_style_index_0_scoped_56b2da50_lang = "";
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-56b2da50"]]);
export {
  index as default
};
