'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
var vueRouter = require('vue-router');
var pinia = require('pinia');
require('../../../../stores/index.js');
var themeConfig = require('../../../../stores/themeConfig.js');

var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  __name: "columns",
  setup(__props) {
    const LayoutAside = vue.defineAsyncComponent(() => Promise.resolve().then(function () { return require('../component/aside.vue.js'); }));
    const LayoutHeader = vue.defineAsyncComponent(() => Promise.resolve().then(function () { return require('../component/header.vue.js'); }));
    const LayoutMain = vue.defineAsyncComponent(() => Promise.resolve().then(function () { return require('../component/main.vue.js'); }));
    const ColumnsAside = vue.defineAsyncComponent(() => Promise.resolve().then(function () { return require('../component/columnsAside.vue.js'); }));
    const layoutScrollbarRef = vue.ref("");
    const layoutMainRef = vue.ref();
    const route = vueRouter.useRoute();
    const storesThemeConfig = themeConfig.useThemeConfig();
    const { themeConfig: themeConfig$1 } = pinia.storeToRefs(storesThemeConfig);
    const updateScrollbar = () => {
      layoutScrollbarRef.value.update();
      layoutMainRef.value && layoutMainRef.value.layoutMainScrollbarRef.update();
    };
    const initScrollBarHeight = () => {
      vue.nextTick(() => {
        setTimeout(() => {
          updateScrollbar();
          layoutScrollbarRef.value.wrapRef.scrollTop = 0;
          if (layoutMainRef.value != void 0) layoutMainRef.value.layoutMainScrollbarRef.wrapRef.scrollTop = 0;
        }, 500);
      });
    };
    vue.onMounted(() => {
      initScrollBarHeight();
    });
    vue.watch(
      () => route.path,
      () => {
        initScrollBarHeight();
      }
    );
    vue.watch(
      () => [themeConfig$1.value.isTagsview, themeConfig$1.value.isFixedHeader],
      () => {
        vue.nextTick(() => {
          updateScrollbar();
        });
      },
      {
        deep: true
      }
    );
    return (_ctx, _cache) => {
      const _component_el_scrollbar = vue.resolveComponent("el-scrollbar");
      const _component_el_container = vue.resolveComponent("el-container");
      return vue.openBlock(), vue.createBlock(_component_el_container, { class: "layout-container" }, {
        default: vue.withCtx(() => [
          vue.createVNode(vue.unref(ColumnsAside)),
          vue.createVNode(_component_el_container, { class: "layout-columns-warp layout-container-view h100" }, {
            default: vue.withCtx(() => [
              vue.createVNode(vue.unref(LayoutAside)),
              vue.createVNode(
                _component_el_scrollbar,
                {
                  ref_key: "layoutScrollbarRef",
                  ref: layoutScrollbarRef,
                  class: "layout-backtop"
                },
                {
                  default: vue.withCtx(() => [
                    vue.createVNode(vue.unref(LayoutHeader)),
                    vue.createVNode(
                      vue.unref(LayoutMain),
                      {
                        ref_key: "layoutMainRef",
                        ref: layoutMainRef
                      },
                      null,
                      512
                      /* NEED_PATCH */
                    )
                  ]),
                  _: 1
                  /* STABLE */
                },
                512
                /* NEED_PATCH */
              )
            ]),
            _: 1
            /* STABLE */
          })
        ]),
        _: 1
        /* STABLE */
      });
    };
  }
});

exports.default = _sfc_main;
