/**
 * 与 Laravel 平台角色模板对齐；经营主账号只用「平台角色管理 → 代理」(slug=agent)。
 * 线路内「角色」页用于子账号自定义角色，不再使用 agent_owner_* 默认包。
 */
export const AGENT_OWNER_BASE_SLUGS = [
  "prd.dashboard.view",
  "prd.agent.view",
  "prd.agent.role.view",
  "prd.agent.user.view",
  "prd.tickets.view",
  "prd.settlement.agent.view",
] as const;

export const AGENT_OWNER_LINE_ROOT_EXTRA_SLUGS = [
  "prd.agent.manage",
  "prd.agent.profile.manage",
  "prd.agent.role.manage",
  "prd.agent.user.manage",
  "prd.users.manage",
  "prd.users.view_cs",
  "prd.settlement.agent.manage",
] as const;

/** 代理模块内可下放/勾选的产品权限分组（不含平台专属：对账、赔率、接入站点等）。 */
export const AGENT_PERMISSION_PACKAGES: Record<
  string,
  { key: string; label: string; slugs: string[] }[]
> = {
  dashboard: [{ key: "view", label: "查看", slugs: ["prd.dashboard.view"] }],
  agents: [
    { key: "node_view", label: "线路·查看", slugs: ["prd.agent.view"] },
    { key: "node_manage", label: "线路·管理", slugs: ["prd.agent.manage", "prd.agent.profile.manage"] },
    { key: "role_view", label: "角色·查看", slugs: ["prd.agent.role.view"] },
    { key: "role_manage", label: "角色·管理", slugs: ["prd.agent.role.manage"] },
    { key: "user_view", label: "账号·查看", slugs: ["prd.agent.user.view"] },
    { key: "user_manage", label: "账号·管理", slugs: ["prd.agent.user.manage"] },
  ],
  players: [
    {
      key: "view",
      label: "查看",
      slugs: ["prd.users.view_finance", "prd.users.view_cs"],
    },
    { key: "manage", label: "管理", slugs: ["prd.users.manage"] },
  ],
  tickets: [{ key: "view", label: "查看", slugs: ["prd.tickets.view"] }],
  settlement_agent: [
    { key: "view", label: "账单·查看", slugs: ["prd.settlement.agent.view"] },
    { key: "manage", label: "账单·管理", slugs: ["prd.settlement.agent.manage"] },
  ],
};
