import '@das-fed/web/packages/layout/style.css';
import { reactive as Q, ref as $, defineComponent as z, computed as c, watch as te, createElementBlock as I, openBlock as g, Fragment as Y, createBlock as V, createCommentVNode as w, TransitionGroup as we, normalizeProps as ne, mergeProps as ae, withCtx as W, renderList as ue, withDirectives as D, resolveDynamicComponent as N, vShow as M, unref as _, nextTick as ce, resolveComponent as be, createElementVNode as x, normalizeStyle as Le, normalizeClass as _e, renderSlot as F, createVNode as Z, Transition as ve, guardReactiveProps as de, KeepAlive as me, h as ee, onBeforeMount as Ie, onMounted as Ce, onUnmounted as ke } from "vue";
import { useRouter as Te, useRoute as pe } from "vue-router";
import { setHtmlMinWH as Ae } from "@das-fed/utils/common-tools/setHtmlMinWH";
import { createCeNav as Ee, createCeTabs as Re, createCeMenu as Ve } from "@das-fed/web-components/das-web-app";
import { flatTree as Pe } from "@das-fed/utils/common-tools/nest-tree-format";
const p = Q({
  visible: !1,
  theme: "default",
  logo: "",
  items: [],
  projects: [],
  userInfo: {},
  config: {},
  searchConfig: {},
  // activeItem: '',
  // activeProject: {},
  eventListeners: {}
}), fe = {
  show: () => {
    p.visible = !0;
  },
  hide: () => {
    p.visible = !1;
  },
  setLogo: (e) => {
    p.logo = e;
  },
  setTheme: (e) => {
    p.theme = e;
  },
  setItems: (e) => {
    p.visible || (p.visible = !0), p.items = e;
  },
  getItems: () => p.items,
  removeItem: (e) => {
    const t = p.items.filter((s) => s.value !== e);
    p.items = t;
  },
  appendItem: (e) => {
    p.visible || (p.visible = !0), !p.items.find((s) => s.value == e.value) && p.items.push(e);
  },
  setActiveItem: (e) => {
    p.activeItem = e;
  },
  setConfig: (e) => {
    p.config = e;
  },
  setProjects: (e) => {
    p.projects = e;
  },
  setProjectConfig: (e) => {
    p.projectConfig = e;
  },
  setActiveProject: (e) => {
    p.activeProject = e;
  },
  setUserInfo: (e) => {
    p.userInfo = e;
  },
  setSearchConfig: (e) => {
    p.searchConfig = e;
  },
  triggerEventListener: (e, t, s) => {
    var m;
    const l = p.eventListeners, { autoRemove: d = !1 } = s || {}, r = [];
    for (const b in l) {
      const o = l[b];
      o.type === e && r.push(
        (m = o == null ? void 0 : o.handler) == null ? void 0 : m.call(o, t).then(() => {
          d && o.remove();
        })
      );
    }
    return Promise.all(r).then(() => !0).catch(() => !1);
  },
  addEventListener: (e, t) => {
    const s = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), l = () => {
      p.eventListeners[s] && delete p.eventListeners[s];
    };
    return p.eventListeners[s] = {
      type: e,
      handler: async (d) => {
        try {
          await t(d);
        } catch (r) {
          throw r;
        }
      },
      remove: l
    }, {
      remove: l
    };
  }
}, R = Q({
  theme: "default",
  items: [],
  collapse: !1,
  eventListeners: {}
}), he = {
  setItems: (e) => {
    R.items = e;
  },
  getItems: () => R.items,
  setTheme: (e) => {
    R.theme = e;
  },
  setActiveItem: (e) => {
    R.activeItem = e;
  },
  setCollapse: (e) => {
    R.collapse = e;
  },
  setPopupClassName: (e) => {
    R.popupClassName = e;
  },
  triggerEventListener: (e, t, s) => {
    var m;
    const l = R.eventListeners, { autoRemove: d = !1 } = s || {}, r = [];
    for (const b in l) {
      const o = l[b];
      o.type === e && r.push(
        (m = o == null ? void 0 : o.handler) == null ? void 0 : m.call(o, t).then(() => {
          d && o.remove();
        })
      );
    }
    return Promise.all(r).then(() => !0).catch(() => !1);
  },
  addEventListener: (e, t) => {
    const s = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), l = () => {
      R.eventListeners[s] && delete R.eventListeners[s];
    };
    return R.eventListeners[s] = {
      type: e,
      handler: async (d) => {
        try {
          await t(d);
        } catch (r) {
          throw r;
        }
      },
      remove: l
    }, {
      remove: l
    };
  }
}, k = Q({
  theme: "default",
  items: [],
  eventListeners: {}
}), ge = {
  setItems: (e) => {
    k.items = e;
  },
  getItems: () => k.items,
  setTheme: (e) => {
    k.theme = e;
  },
  removeItem: (e) => {
    const t = k.items.filter((s) => s.value !== e);
    k.items = t;
  },
  appendItem: (e) => {
    const t = k.items.findIndex((s) => s.value == e.value);
    t !== -1 ? k.items.splice(t, 1, e) : k.items.push(e);
  },
  setActiveItem: (e) => {
    k.activeItem = e;
  },
  triggerEventListener: (e, t, s) => {
    var m;
    const l = k.eventListeners, { autoRemove: d = !1 } = s || {}, r = [];
    for (const b in l) {
      const o = l[b];
      o.type === e && r.push(
        (m = o == null ? void 0 : o.handler) == null ? void 0 : m.call(o, t).then(() => {
          d && o.remove();
        })
      );
    }
    return Promise.all(r).then(() => !0).catch(() => !1);
  },
  addEventListener: (e, t) => {
    const s = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), l = () => {
      k.eventListeners[s] && delete k.eventListeners[s];
    };
    return k.eventListeners[s] = {
      type: e,
      handler: async (d) => {
        try {
          await t(d);
        } catch (r) {
          throw r;
        }
      },
      remove: l
    }, {
      remove: l
    };
  }
}, K = Q({
  eventListeners: {}
}), Se = {
  triggerEventListener: (e, t, s) => {
    var m;
    const l = K.eventListeners, { autoRemove: d = !1 } = s || {}, r = [];
    for (const b in l) {
      const o = l[b];
      o.type === e && r.push(
        (m = o == null ? void 0 : o.handler) == null ? void 0 : m.call(o, t).then(() => {
          d && o.remove();
        })
      );
    }
    return Promise.all(r).then(() => !0).catch(() => !1);
  },
  addEventListener: (e, t) => {
    const s = (/* @__PURE__ */ new Date()).getTime() + Math.random().toString(36).slice(-8), l = () => {
      K.eventListeners[s] && delete K.eventListeners[s];
    };
    return K.eventListeners[s] = {
      type: e,
      handler: async (d) => {
        try {
          await t(d);
        } catch (r) {
          throw r;
        }
      },
      remove: l
    }, {
      remove: l
    };
  }
}, se = Q({
  visible: !1,
  style: {}
}), De = {
  set: (e, t) => {
    se.visible = e, t || (t = {}), t.transition || (t.transition = "all 0.3s"), t && (se.style = t);
  }
}, B = {
  nav: p,
  menu: R,
  tab: k,
  overlay: se,
  iframeView: K,
  visible: $(!0)
}, v = {
  nav: fe,
  menu: he,
  tab: ge,
  overlay: De,
  iframeView: Se,
  setVisible: (e) => B.visible.value = e,
  setTheme: (e) => {
    fe.setTheme(e), he.setTheme(e), ge.setTheme(e);
  }
}, Me = ["name"], je = ["name"], xe = /* @__PURE__ */ z({
  __name: "das-iframe-router-view",
  props: {
    needTransition: { type: Boolean },
    transitionConfig: {},
    exclude: { default: () => [] }
  },
  setup(e) {
    const t = e, s = c(() => {
      const { mode: n = "", ...a } = {
        mode: "out-in",
        "enter-active-class": "animate__animated animate__fadeInLeft",
        ...t.transitionConfig || {}
      };
      return a;
    }), l = Te(), d = pe(), r = $([]), m = c(() => r.value.filter((n) => {
      var a;
      return (a = n.meta) == null ? void 0 : a.isOpen;
    })), b = (n) => {
      const a = n.lastIndexOf("-");
      let i = a !== -1 ? n.substring(a + 1) : "";
      i === "0" ? i = "1" : i = "0", m.value.forEach((f) => {
        f.meta.key === n && (f.meta.key = `${f.path}-${i}`);
      });
    };
    te(
      () => t.exclude,
      (n) => {
        if (!n || !n.length) return;
        const a = m.value.find((i) => n.includes(i.path));
        a && b(a.meta.key);
      },
      { deep: !0 }
    );
    const o = async (n) => {
      const a = n.component;
      let i = null;
      return typeof a == "function" ? i = (await a()).default : i = a, i;
    }, P = async () => {
      var a;
      const n = l.options.routes;
      for (const i of n)
        if ((a = i == null ? void 0 : i.meta) != null && a.isIframe && !r.value.find((f) => f.path === i.path)) {
          const f = await o(i);
          r.value.push({
            ...i,
            meta: { ...i.meta, key: `${i.path}-0`, componentInstance: f, isOpen: !1, isShow: !1 }
          });
        }
      T();
    }, T = async () => {
      var i, f;
      if (!r.value || !r.value.length) return;
      const n = r.value.find((C) => C.meta.isShow);
      n && (n.meta.isShow = !1, await ce(), v.iframeView.triggerEventListener("onDeactivated", { route: n }));
      const a = r.value.find((C) => C.path === d.path);
      a && ((i = a.meta) != null && i.isOpen || (a.meta.isOpen = !0), (f = a.meta) != null && f.isShow || (a.meta.isShow = !0), await ce(), v.iframeView.triggerEventListener("onActivated", { route: a }));
    };
    let A = 0;
    return te(
      () => l.currentRoute.value,
      () => {
        const n = l.options.routes.length;
        n !== A ? (P(), A = n) : T();
      },
      { immediate: !0 }
    ), v.iframeView.addEventListener("onRefreshCurrentPage", () => {
      m.value.forEach((n) => {
        var a;
        (a = n.meta) != null && a.isShow && (n.meta.key.includes("0") ? n.meta.key = n.meta.key.replaceAll("0", "1") : n.meta.key = n.meta.key.replaceAll("1", "0"));
      });
    }), v.iframeView.addEventListener("onUnloadPage", (n) => {
      r.value.forEach((a) => {
        a.path === n && (a.meta.isOpen = !1);
      });
    }), (n, a) => (g(), I(
      Y,
      null,
      [
        n.needTransition ? (g(), V(
          we,
          ne(ae({ key: 0 }, s.value)),
          {
            default: W(() => [
              (g(!0), I(
                Y,
                null,
                ue(m.value, ({ path: i, meta: f }) => D((g(), I("div", {
                  class: "das-iframe-router-view",
                  key: f.key,
                  name: i
                }, [
                  (g(), V(N(f.componentInstance), {
                    key: f.key
                  }))
                ], 8, Me)), [
                  [M, f.componentInstance && i === _(d).path]
                ])),
                128
                /* KEYED_FRAGMENT */
              ))
            ]),
            _: 1
            /* STABLE */
          },
          16
          /* FULL_PROPS */
        )) : w("v-if", !0),
        n.needTransition ? w("v-if", !0) : (g(!0), I(
          Y,
          { key: 1 },
          ue(m.value, ({ path: i, meta: f }) => D((g(), I("div", {
            class: "das-iframe-router-view",
            key: f.key,
            name: i
          }, [
            (g(), V(N(f.componentInstance), {
              key: f.key
            }))
          ], 8, je)), [
            [M, f.componentInstance && i === _(d).path]
          ])),
          128
          /* KEYED_FRAGMENT */
        ))
      ],
      64
      /* STABLE_FRAGMENT */
    ));
  }
}), ye = (e, t) => {
  const s = e.__vccOpts || e;
  for (const [l, d] of t)
    s[l] = d;
  return s;
}, $e = /* @__PURE__ */ ye(xe, [["__scopeId", "data-v-6dd310c9"]]), Be = { class: "das-web-app-container" }, He = {
  key: 0,
  class: "das-web-app-header"
}, Fe = { class: "das-web-app-main" }, Ne = {
  key: 0,
  class: "aside"
}, Oe = { class: "das-web-app-main-container" }, Ue = {
  key: 0,
  class: "tab"
}, We = { class: "das-web-app-main-content" }, Ke = { class: "banner" }, Qe = {
  key: 0,
  class: "das-web-app-main-router-view"
}, ze = {
  key: 0,
  style: { width: "100%", height: "100%" }
}, qe = {
  key: 1,
  style: { width: "100%", height: "100%" }
}, Ge = { style: { width: "100%", height: "100%" } }, Je = {
  class: "micro-app",
  style: { height: "100%", width: "100%" }
}, Xe = /* @__PURE__ */ z({
  __name: "das-web-layout",
  props: {
    loading: { type: Boolean, default: !0 },
    ignoreLoading: { type: Boolean, default: !0 },
    needTransition: { type: Boolean, default: !0 },
    transitionConfig: {},
    showLayout: { type: Boolean, default: !0 },
    showAside: { type: Boolean, default: !0 },
    showTabs: { type: Boolean, default: !0 },
    routerViewVisible: { type: Boolean, default: !0 },
    excludeRoutes: {},
    routeKeepAliveVisible: { type: Boolean, default: !0 },
    pageKey: { default: "0" }
  },
  setup(e) {
    const t = e;
    Ee(), Re(), Ve();
    const s = pe(), l = $(!0), d = $(!0), r = $(!0), m = c(() => l.value && t.showLayout), b = c(() => d.value && t.showLayout && t.showAside), o = c(() => l.value && t.showLayout && t.showTabs), P = c(() => t.routerViewVisible ?? !0), T = c(() => B.overlay.visible ?? !1), A = $(!0), n = c(() => A.value && B.visible.value), a = c(() => !m.value || t.ignoreLoading || !t.loading), i = c(() => ({
      "das-web-app-overlay-show": T.value === !0,
      "das-web-app-overlay-hide": T.value === !1,
      "das-web-app-overlay-destroy": T.value === "destroy"
    })), f = c(() => B.overlay.style ?? { backgroundColor: "rgba(0,0,0,0.5)" }), C = c(() => t.excludeRoutes), q = c(() => t.routeKeepAliveVisible);
    te(
      () => [s.meta, s.query],
      ([L, S]) => {
        const { layout: u = {}, showLayout: h = !0, showAside: y = !0, showTabs: j = !0 } = L, {
          showLayout: E = !0,
          showAside: H = !0,
          showTabs: re = !0,
          layoutVisible: oe = !0
        } = S;
        Ae(u);
        let ie = !0, J = !0, X = !0;
        (h === !1 || E === !1 || E === "false") && (ie = !1, J = !1, X = !1), (y === !1 || H === !1 || H === "false") && (J = !1), (j === !1 || re === !1 || re === "false") && (X = !1), l.value = ie, d.value = J, r.value = X;
        let le = !0;
        (oe === !1 || oe === "false") && (le = !1), A.value = le;
      }
    );
    const O = c(() => ({
      mode: "out-in",
      "enter-active-class": "animate__animated animate__fadeInLeft",
      ...t.transitionConfig || {}
    }));
    let U = /* @__PURE__ */ new Map();
    const G = (L, S) => {
      if (!L) return null;
      let u;
      return U.has(S) ? u = U.get(S) : (u = {
        name: S,
        render() {
          return ee("div", { style: { width: "100%", height: "100%" } }, [ee(L)]);
        }
      }, U.set(S, u)), ee(u);
    };
    return (L, S) => {
      const u = be("router-view");
      return g(), I("div", Be, [
        D(x(
          "div",
          {
            class: _e(["das-web-app-overlay", i.value]),
            style: Le(f.value)
          },
          null,
          6
          /* CLASS, STYLE */
        ), [
          [M, n.value]
        ]),
        m.value ? D((g(), I(
          "div",
          He,
          [
            F(L.$slots, "header", {}, void 0, !0)
          ],
          512
          /* NEED_PATCH */
        )), [
          [M, n.value]
        ]) : w("v-if", !0),
        x("div", Fe, [
          b.value ? D((g(), I(
            "div",
            Ne,
            [
              F(L.$slots, "aside", {}, void 0, !0)
            ],
            512
            /* NEED_PATCH */
          )), [
            [M, n.value]
          ]) : w("v-if", !0),
          x("div", Oe, [
            o.value ? D((g(), I(
              "div",
              Ue,
              [
                F(L.$slots, "tab", {}, void 0, !0)
              ],
              512
              /* NEED_PATCH */
            )), [
              [M, n.value]
            ]) : w("v-if", !0),
            x("div", We, [
              x("div", Ke, [
                F(L.$slots, "banner", {}, void 0, !0)
              ]),
              a.value ? (g(), I("div", Qe, [
                D((g(), I("div", {
                  key: L.pageKey,
                  style: { width: "100%", height: "100%" }
                }, [
                  F(L.$slots, "router-view", {}, () => [
                    w(" 有动画 "),
                    L.needTransition ? (g(), V(u, { key: 0 }, {
                      default: W(({ Component: h }) => [
                        Z(
                          ve,
                          ne(de(O.value)),
                          {
                            default: W(() => {
                              var y;
                              return [
                                _(s).meta.keepAlive ? (g(), V(me, {
                                  key: 0,
                                  exclude: C.value
                                }, [
                                  q.value && !((y = _(s).meta) != null && y.isIframe) ? (g(), V(N(G(h, _(s).path)), {
                                    key: _(s).fullPath
                                  })) : w("v-if", !0)
                                ], 1032, ["exclude"])) : w("v-if", !0)
                              ];
                            }),
                            _: 2
                            /* DYNAMIC */
                          },
                          1040
                          /* FULL_PROPS, DYNAMIC_SLOTS */
                        ),
                        Z(
                          ve,
                          ne(de(O.value)),
                          {
                            default: W(() => [
                              !_(s).meta.keepAlive && !_(s).meta.isIframe ? (g(), I("div", ze, [
                                (g(), V(N(h), {
                                  key: _(s).fullPath
                                }))
                              ])) : w("v-if", !0)
                            ]),
                            _: 2
                            /* DYNAMIC */
                          },
                          1040
                          /* FULL_PROPS, DYNAMIC_SLOTS */
                        )
                      ]),
                      _: 1
                      /* STABLE */
                    })) : w("v-if", !0),
                    w(" 无动画 "),
                    L.needTransition ? w("v-if", !0) : (g(), V(u, { key: 1 }, {
                      default: W(({ Component: h }) => [
                        _(s).meta.keepAlive ? (g(), V(me, {
                          key: 0,
                          exclude: C.value
                        }, [
                          q.value && !_(s).meta.isIframe ? (g(), V(N(G(h, _(s).path)), {
                            key: _(s).fullPath
                          })) : w("v-if", !0)
                        ], 1032, ["exclude"])) : w("v-if", !0),
                        !_(s).meta.keepAlive && !_(s).meta.isIframe ? (g(), I("div", qe, [
                          (g(), V(N(h), {
                            key: _(s).fullPath
                          }))
                        ])) : w("v-if", !0)
                      ]),
                      _: 1
                      /* STABLE */
                    })),
                    D(x(
                      "div",
                      Ge,
                      [
                        Z($e, {
                          exclude: C.value,
                          transitionConfig: O.value,
                          needTransition: L.needTransition
                        }, null, 8, ["exclude", "transitionConfig", "needTransition"])
                      ],
                      512
                      /* NEED_PATCH */
                    ), [
                      [M, _(s).meta.isIframe]
                    ])
                  ], !0)
                ])), [
                  [M, P.value]
                ]),
                D(x(
                  "div",
                  Je,
                  [
                    F(L.$slots, "default", {}, void 0, !0)
                  ],
                  512
                  /* NEED_PATCH */
                ), [
                  [M, !P.value]
                ])
              ])) : w("v-if", !0)
            ])
          ])
        ])
      ]);
    };
  }
}), ot = /* @__PURE__ */ ye(Xe, [["__scopeId", "data-v-687de0c1"]]), Ye = ["theme", "modelValue", "logoUrl", "config", "innerPagesConfig", "searchConfig", "projectTreeConfig", "userInfoConfig"], it = /* @__PURE__ */ z({
  __name: "das-web-nav",
  setup(e) {
    const { nav: t } = B, s = c(() => t.theme), l = c(() => t.logo || ""), d = c(() => t.activeItem || ""), r = c(() => (t.items || []).filter((h) => h.fixed)), m = c(() => (t.items || []).filter((h) => !h.fixed)), b = c(() => {
      var u, h, y, j, E;
      return {
        showAIHelper: ((u = t.config) == null ? void 0 : u.showAIHelper) ?? !1,
        showFullScreen: ((h = t.config) == null ? void 0 : h.showFullScreen) ?? !1,
        showChangeEnterprise: ((y = t.config) == null ? void 0 : y.showChangeEnterprise) ?? !1,
        showSearch: ((j = t.config) == null ? void 0 : j.showSearch) ?? !0,
        showProjectTree: ((E = t.config) == null ? void 0 : E.showProjectTree) ?? !0,
        subAppList: m.value.map((H) => ({ code: H.value, name: H.label, ...H }))
      };
    }), o = c(() => {
      const u = r.value.find((h) => h.value === t.activeItem);
      return {
        activeInnerPagePath: (u == null ? void 0 : u.path) || "",
        innerPages: r.value.map((h) => ({ title: h.label, ...h }))
      };
    }), P = c(() => ({
      projectStore: {
        projectTree: t.projects,
        currentProject: t.activeProject
      },
      ...t.projectConfig
    })), T = c(() => t.userInfo), A = c(() => t.searchConfig), n = async (u) => {
      const h = u.detail[0], y = r.value.find((E) => h.value === E.value);
      await v.nav.triggerEventListener("onItemClick", y) && v.nav.setActiveItem(y.value);
    }, a = async (u) => {
      const h = u.detail[0], y = m.value.find((E) => h === E.value);
      await v.nav.triggerEventListener("onItemClick", y) && v.nav.setActiveItem(y.value);
    }, i = async (u) => {
      const h = u.detail[0], y = m.value.find((E) => h === E.value);
      await v.nav.triggerEventListener("onItemRemove", y) && v.nav.removeItem(y.value);
    }, f = async (u) => {
      const [h, y] = u.detail;
      !h || !await v.nav.triggerEventListener("onProjectChange", y) || v.nav.setActiveProject(y);
    }, C = (u) => {
      v.nav.triggerEventListener("onUserCommandChange", u.detail[0]);
    }, q = (u) => {
      v.nav.triggerEventListener("searchToPage", { item: u.detail[0], keyword: u.detail[1], cb: u.detail[2] });
    }, O = (u) => {
      v.nav.triggerEventListener("clearSearchList", { cb: u.detail[0] });
    }, U = (u) => {
      v.nav.triggerEventListener("deleteSearchItem", { value: u.detail[0], cb: u.detail[1] });
    }, G = () => {
      v.nav.triggerEventListener("changeEnterpriseHandle");
    }, L = () => {
      v.nav.triggerEventListener("fullScreenHandle");
    }, S = () => {
      v.nav.triggerEventListener("openAI");
    };
    return Ie(() => {
      v.nav.triggerEventListener("onBeforeMount", null, { autoRemove: !0 });
    }), Ce(() => {
      v.nav.triggerEventListener("onMounted", null, { autoRemove: !0 });
    }), ke(() => {
      v.nav.triggerEventListener("onUnmounted", null, { autoRemove: !0 });
    }), (u, h) => (g(), I("das-ce-nav", {
      theme: s.value,
      modelValue: d.value,
      logoUrl: l.value,
      config: b.value,
      innerPagesConfig: o.value,
      searchConfig: A.value,
      projectTreeConfig: P.value,
      userInfoConfig: T.value,
      "on:userCommandHandle": C,
      "on:changeInnerPage": n,
      "on:handleTabClick": a,
      "on:handleTabDelete": i,
      "on:changeTreeHandle": f,
      "on:searchToPage": q,
      "on:clearSearchList": O,
      "on:deleteSearchItem": U,
      "on:changeEnterpriseHandle": G,
      "on:fullScreen": L,
      "on:openAI": S
    }, null, 40, Ye));
  }
}), Ze = ["theme", "modelValue", "data", "collapse", "fixedTopMenu", "subMenuAttrs"], lt = /* @__PURE__ */ z({
  __name: "das-web-menu",
  props: {
    menuAttr: {}
  },
  setup(e) {
    const { menu: t } = B, s = e, l = c(() => t.theme), d = c(() => s.menuAttr || {}), r = c(() => t.items), m = c(() => t.items.find((n) => n.fixed)), b = c(() => t.activeItem || ""), o = c(() => t.collapse || !1), P = c(() => ({ popupClassName: t.popupClassName ?? "" })), T = async (n) => {
      const a = n.detail[0], i = Pe(r.value).find((C) => a === C.id);
      await v.menu.triggerEventListener("onItemClick", i) && v.menu.setActiveItem(i.id);
    }, A = (n) => {
      v.menu.setCollapse(n.detail[0]), v.menu.triggerEventListener("toggleCollapse", n.detail[0]);
    };
    return (n, a) => r.value.length > 0 ? (g(), I("das-ce-menu", ae({
      key: 0,
      theme: l.value,
      modelValue: b.value,
      data: r.value,
      collapse: o.value,
      fixedTopMenu: m.value,
      subMenuAttrs: P.value
    }, d.value, {
      onChange: T,
      "on:toggleCollapse": A
    }), null, 16, Ze)) : w("v-if", !0);
  }
}), et = ["theme", "modelValue", "options"], ut = /* @__PURE__ */ z({
  __name: "das-web-tabs",
  props: {
    tabsAttr: {}
  },
  setup(e) {
    const { tab: t } = B, s = e, l = c(() => s.tabsAttr || {}), d = c(() => t.theme), r = c(() => t.items.map((n) => ({
      ...n,
      key: n.value,
      tab: n.label
    }))), m = c(() => t.activeItem || ""), b = async (n) => {
      const a = n.detail[0], i = r.value.find((C) => a === C.value);
      await v.tab.triggerEventListener("onItemClick", i) && v.tab.setActiveItem(i.value);
    }, o = async (n) => {
      const a = n.detail[0], i = r.value.find((C) => a === C.value);
      await v.tab.triggerEventListener("onItemRemove", i) && v.tab.removeItem(i.value);
    }, P = async (n) => {
      await v.tab.triggerEventListener("onMenuClick", { type: n.detail[0], data: n.detail[1] });
    }, T = async (n) => {
      await v.tab.triggerEventListener("onPageRefresh", n.detail[0]);
    }, A = () => {
      v.tab.triggerEventListener("onToggleFullScreen");
    };
    return (n, a) => r.value.length > 0 ? (g(), I("das-ce-tabs", ae({
      key: 0,
      theme: d.value,
      modelValue: m.value,
      options: r.value
    }, l.value, {
      "on:tabClick": b,
      "on:tabDelete": o,
      "on:menuClick": P,
      "on:pageRefresh": T,
      "on:toggleFullScreen": A
    }), null, 16, et)) : w("v-if", !0);
  }
});
$("@das-fed/web");
export {
  ot as DasWebLayout,
  lt as DasWebMenu,
  it as DasWebNav,
  ut as DasWebTabs,
  v as layout,
  B as layoutData
};
