import { getItem as c } from "./local.mjs";
const g = (e) => e.split("/")[1], i = (e, l = []) => (e.forEach((t) => {
  l.push({
    path: t.path,
    title: t.title
  }), t.children && i(t.children, l);
}), [...l]), S = () => {
  var r, a, s, u;
  let e = "/login";
  const l = c("menuData") || null, t = localStorage.getItem("layoutStorage") || null, n = t ? ((a = (r = JSON.parse(t)) == null ? void 0 : r.state) == null ? void 0 : a.menuData.length) == 0 ? l : (u = (s = JSON.parse(t)) == null ? void 0 : s.state) == null ? void 0 : u.menuData : null;
  if (n && (n == null ? void 0 : n.length) > 0) {
    const o = n[0].url;
    e = g(o) || null ? o : `/${o}`;
  }
  return e;
};
export {
  S as getDefaultUrl,
  i as getFlatRoutes,
  g as getSplit
};
