import { reactive as s, ref as z, computed as k } from "vue";
const _ = {
  // 按钮
  详情: { "zh-CN": "详情", en: "Details", ar: "التفاصيل", _appCode: "framework" },
  下载: { "zh-CN": "下载", en: "Download", ar: "تحميل", _appCode: "framework" },
  审核: { "zh-CN": "审核", en: "Audit", ar: "تدقيق", _appCode: "framework" },
  通过: { "zh-CN": "通过", en: "Pass", ar: "موافقة", _appCode: "framework" },
  驳回: { "zh-CN": "驳回", en: "Reject", ar: "رفض", _appCode: "framework" },
  分派: { "zh-CN": "分派", en: "Assign", ar: "تعيين", _appCode: "framework" },
  处理: { "zh-CN": "处理", en: "Process", ar: "معالجة", _appCode: "framework" },
  删除: { "zh-CN": "删除", en: "Delete", ar: "حذف", _appCode: "framework" },
  回复: { "zh-CN": "回复", en: "Reply", ar: "رد", _appCode: "framework" },
  新增: { "zh-CN": "新增", en: "Add", ar: "إضافة", _appCode: "framework" },
  批量删除: { "zh-CN": "批量删除", en: "Bulk Delete", ar: "حذف جماعي", _appCode: "framework" },
  提交: { "zh-CN": "提交", en: "Submit", ar: "إرسال", _appCode: "framework" },
  查看记录: { "zh-CN": "查看记录", en: "Details", ar: "عرض السجلات", _appCode: "framework" },
  分享: { "zh-CN": "分享", en: "Share", ar: "مشاركة", _appCode: "framework" },
  取消: { "zh-CN": "取消", en: "Cancel", ar: "إلغاء", _appCode: "framework" },
  编辑: { "zh-CN": "编辑", en: "Edit", ar: "تحرير", _appCode: "framework" },
  保存: { "zh-CN": "保存", en: "Save", ar: "حفظ", _appCode: "framework" },
  确定: { "zh-CN": "确定", en: "OK", ar: "موافق", _appCode: "framework" },
  转单: { "zh-CN": "转单", en: "Transfer", ar: "تحويل", _appCode: "framework" },
  挂起: { "zh-CN": "挂起", en: "Suspend", ar: "تعليق", _appCode: "framework" },
  反馈: { "zh-CN": "反馈", en: "Feedback", ar: "ردود فعل", _appCode: "framework" },
  撤回: { "zh-CN": "撤回", en: "Withdraw", ar: "سحب", _appCode: "framework" },
  继续处理: { "zh-CN": "继续处理", en: "Continue", ar: "متابعة المعالجة", _appCode: "framework" },
  评价: { "zh-CN": "评价", en: "Evaluate", ar: "تقييم", _appCode: "framework" },
  重新处理: { "zh-CN": "重新处理", en: "Reprocess", ar: "إعادة المعالجة", _appCode: "framework" },
  处理确认: { "zh-CN": "处理确认", en: "Confirm", ar: "تأكيد المعالجة", _appCode: "framework" },
  作废: { "zh-CN": "作废", en: "Nullify", ar: "إبطال", _appCode: "framework" },
  回访: { "zh-CN": "回访", en: "Follow-up", ar: "زيارة متابعة", _appCode: "framework" },
  设备总数: { "zh-CN": "设备总数", en: "Total Devices", ar: "إجمالي الأجهزة", _appCode: "framework" },
  在线数: { "zh-CN": "在线数", en: "Online", ar: "متصل", _appCode: "framework" },
  离线数: { "zh-CN": "离线数", en: "Offline", ar: "غير متصل", _appCode: "framework" },
  已停用: { "zh-CN": "已停用", en: "Disabled", ar: "معطل", _appCode: "framework" },
  未激活: { "zh-CN": "未激活", en: "Inactive", ar: "غير نشط", _appCode: "framework" },
  最近更新人: { "zh-CN": "最近更新人", en: "Last Updater", ar: "آخر محدث", _appCode: "framework" },
  最近更新时间: { "zh-CN": "最近更新时间", en: "Last Updated Time", ar: "آخر وقت للتحديث", _appCode: "framework" },
  启用状态: { "zh-CN": "启用状态", en: "Status", ar: "الحالة", _appCode: "framework" },
  必填: { "zh-CN": "必填", en: "Required", ar: "مطلوب", _appCode: "framework" },
  用户账号: { "zh-CN": "用户账号", en: "Account", ar: "الحساب", _appCode: "framework" },
  用户密码: { "zh-CN": "用户密码", en: "Password", ar: "كلمة المرور", _appCode: "framework" },
  新增同级: { "zh-CN": "新增同级", en: "Add Sibling", ar: "إضافة同级", _appCode: "framework" },
  新增子级: { "zh-CN": "新增子级", en: "Add Child", ar: "إضافةابن", _appCode: "framework" },
  // 全局流程状态
  处理中: { "zh-CN": "处理中", en: "Processing", ar: "قيد المعالجة", _appCode: "framework" },
  出借中: { "zh-CN": "出借中", en: "Borrowing", ar: "قيد الاستعارة", _appCode: "framework" },
  审核中: { "zh-CN": "审核中", en: "Reviewing", ar: "قيد المراجعة", _appCode: "framework" },
  退约审核中: { "zh-CN": "退约审核中", en: "Reviewing", ar: "قيد مراجعة الإنهاء", _appCode: "framework" },
  通知我: { "zh-CN": "通知我", en: "Notice", ar: "إخطاري", _appCode: "framework" },
  我的待办: { "zh-CN": "我的待办", en: "To-do", ar: "مهامي", _appCode: "framework" },
  待分派: { "zh-CN": "待分派", en: "Pending Assign", ar: "في انتظار التعيين", _appCode: "framework" },
  待处理: { "zh-CN": "待处理", en: "Pending Process", ar: "في انتظار المعالجة", _appCode: "framework" },
  已挂起: { "zh-CN": "已挂起", en: "Suspended", ar: "معلّق", _appCode: "framework" },
  待确认: { "zh-CN": "待确认", en: "Pending Confirm", ar: "في انتظار التأكيد", _appCode: "framework" },
  待评价: { "zh-CN": "待评价", en: "Pending Evaluate", ar: "في انتظار التقييم", _appCode: "framework" },
  待提交: { "zh-CN": "待提交", en: "Pending Submit", ar: "في انتظار الإرسال", _appCode: "framework" },
  待放行: { "zh-CN": "待放行", en: "Pending Release", ar: "في انتظار الإفراج", _appCode: "framework" },
  超期: { "zh-CN": "超期", en: "Overdue", ar: "متأخر", _appCode: "framework" },
  待审核: { "zh-CN": "待审核", en: "Pending Review", ar: "في انتظار المراجعة", _appCode: "framework" },
  待借出: { "zh-CN": "待借出", en: "Pending borrow", ar: "في انتظار الاستعارة", _appCode: "framework" },
  待归还: { "zh-CN": "待归还", en: "Pending Return", ar: "في انتظار الإرجاع", _appCode: "framework" },
  待核实: { "zh-CN": "待核实", en: "Pending Verificate", ar: "في انتظار التحقق", _appCode: "framework" },
  待归档: { "zh-CN": "待归档", en: "Pending Archive", ar: "في انتظار الأرشفة", _appCode: "framework" },
  待复查: { "zh-CN": "待复查", en: "Pending Check", ar: "في انتظار إعادة الفحص", _appCode: "framework" },
  严重超期: { "zh-CN": "严重超期", en: "Severely Overdue", ar: "متأخر بشدة", _appCode: "framework" },
  待审批: { "zh-CN": "待审批", en: "Pending Review", ar: "في انتظار الموافقة", _appCode: "framework" },
  按时完成: { "zh-CN": "按时完成", en: "Completed On Time", ar: "مكتمل في الوقت", _appCode: "framework" },
  逾期完成: { "zh-CN": "逾期完成", en: "Overdue Completion", ar: "إكمال متأخر", _appCode: "framework" },
  审核通过: { "zh-CN": "审核通过", en: "Approved", ar: "موافق عليه", _appCode: "framework" },
  已完成: { "zh-CN": "已完成", en: "Completed", ar: "مكتمل", _appCode: "framework" },
  已驳回: { "zh-CN": "已驳回", en: "Rejected", ar: "مرفوض", _appCode: "framework" },
  已放行: { "zh-CN": "已放行", en: "Released", ar: "تم الإفراج", _appCode: "framework" },
  按时归还: { "zh-CN": "按时归还", en: "Returned On Time", ar: "تم الإرجاع في الوقت", _appCode: "framework" },
  "损坏/丢失": { "zh-CN": "损坏/丢失", en: "Damaged/Lost", ar: "تالف/فاقد", _appCode: "framework" },
  已发布: { "zh-CN": "已发布", en: "Published", ar: "منشور", _appCode: "framework" },
  已归档: { "zh-CN": "已归档", en: "Archived", ar: "مؤرشف", _appCode: "framework" },
  审核不通过: { "zh-CN": "审核不通过", en: "Rejected", ar: "مرفوض", _appCode: "framework" },
  已审核: { "zh-CN": "已审核", en: "Reviewed", ar: "تمت المراجعة", _appCode: "framework" },
  已处理: { "zh-CN": "已处理", en: "Processed", ar: "تمت المعالجة", _appCode: "framework" },
  逾期归还: { "zh-CN": "逾期归还", en: "Overdue Return", ar: "إرجاع متأخر", _appCode: "framework" },
  已失效: { "zh-CN": "已失效", en: "Expired", ar: "منتهي الصلاحية", _appCode: "framework" },
  待支付: { "zh-CN": "待支付", en: "Pending Payment", ar: "في انتظار الدفع", _appCode: "framework" },
  已预定: { "zh-CN": "已预定", en: "Scheduled", ar: "محجوز", _appCode: "framework" },
  已开始: { "zh-CN": "已开始", en: "In Progress", ar: "قيد التنفيذ", _appCode: "framework" },
  已结束: { "zh-CN": "已结束", en: "Ended", ar: "انتهى", _appCode: "framework" },
  已取消: { "zh-CN": "已取消", en: "Cancelled", ar: "ملغى", _appCode: "framework" },
  待退款: { "zh-CN": "待退款", en: "Pending Refund", ar: "في انتظار استرداد الأموال", _appCode: "framework" },
  告警中: { "zh-CN": "告警中", en: "Active", ar: "نشط", _appCode: "framework" },
  已恢复: { "zh-CN": "已恢复", en: "Restored", ar: "تمت الاستعادة", _appCode: "framework" },
  未处理: { "zh-CN": "未处理", en: "Unprocessed", ar: "غير معالج", _appCode: "framework" },
  未开始: { "zh-CN": "未开始", en: "Not Started", ar: "لم يبدا", _appCode: "framework" },
  进行中: { "zh-CN": "进行中", en: "In Progress", ar: "قيد التنفيذ", _appCode: "framework" },
  待发起: { "zh-CN": "待发起", en: "Pending Submit", ar: "في انتظار البدء", _appCode: "framework" },
  审核通过待生效: {
    "zh-CN": "审核通过待生效",
    en: "Pending take effect",
    ar: "في انتظار نفاذ الموافقة",
    _appCode: "framework"
  },
  生效中: { "zh-CN": "生效中", en: "In Effect", ar: "نافذ", _appCode: "framework" },
  即将到期: { "zh-CN": "即将到期", en: "Expiring", ar: "قارب على الانتهاء", _appCode: "framework" },
  已过期: { "zh-CN": "已过期", en: "Expired", ar: "منتهي الصلاحية", _appCode: "framework" },
  已作废: { "zh-CN": "已作废", en: "Voided", ar: "ملغى", _appCode: "framework" },
  已退约: { "zh-CN": "已退约", en: "Terminated", ar: "منتهي", _appCode: "framework" },
  已终止: { "zh-CN": "已终止", en: "Ended", ar: "انتهى", _appCode: "framework" },
  待接班: { "zh-CN": "待接班", en: "Pending take over", ar: "في انتظار التسلم", _appCode: "framework" },
  已撤回: { "zh-CN": "已撤回", en: "Withdrawn", ar: "تم السحب", _appCode: "framework" },
  待回访: { "zh-CN": "待回访", en: "Pending Follow-up", ar: "في انتظار الزيارة المتابعة", _appCode: "framework" },
  已回访: { "zh-CN": "已回访", en: "Followed-up", ar: "تمت الزيارة المتابعة", _appCode: "framework" },
  未成功回访: {
    "zh-CN": "未成功回访",
    en: "Unsuccessful Follow-up",
    ar: "زيارة متابعة غير ناجحة",
    _appCode: "framework"
  },
  免回访: { "zh-CN": "免回访", en: "Needless to Follow-up", ar: "无需回访", _appCode: "framework" },
  回访完成: { "zh-CN": "回访完成", en: "Follow-up Complete", ar: "اكتملت الزيارة المتابعة", _appCode: "framework" },
  报事报修: { "zh-CN": "报事报修", en: "Repair Process", ar: "عملية الإصلاح", _appCode: "framework" },
  "报事报修-用户确认": {
    "zh-CN": "报事报修-用户确认",
    en: "Repair Confirmation Process",
    ar: "عملية تأكيد الإصلاح",
    _appCode: "framework"
  },
  投诉建议流程: {
    "zh-CN": "投诉建议流程",
    en: "Suggestion Process",
    ar: "عملية الشكاوى والاقتراحات",
    _appCode: "framework"
  },
  有偿服务流程: {
    "zh-CN": "有偿服务流程",
    en: "Paid Service Process",
    ar: "عملية الخدمة المدفوعة",
    _appCode: "framework"
  },
  // 编辑、提交、保存、删除操作的toast
  保存成功: { "zh-CN": "保存成功", en: "Saved Successfully", ar: "تم الحفظ بنجاح", _appCode: "framework" },
  保存失败: { "zh-CN": "保存失败", en: "Saved Failed", ar: "فشل الحفظ", _appCode: "framework" },
  编辑成功: { "zh-CN": "编辑成功", en: "Edited Successfully", ar: "تم التحرير بنجاح", _appCode: "framework" },
  编辑失败: { "zh-CN": "编辑失败", en: "Edited Failed", ar: "فشل التحرير", _appCode: "framework" },
  删除成功: { "zh-CN": "删除成功", en: "Deleted Successfully", ar: "تم الحذف بنجاح", _appCode: "framework" },
  删除失败: { "zh-CN": "删除失败", en: "Deleted Failed", ar: "فشل الحذف", _appCode: "framework" },
  操作成功: { "zh-CN": "操作成功", en: "Operated Successfully", ar: "تمت العملية بنجاح", _appCode: "framework" },
  操作失败: { "zh-CN": "操作失败", en: "Operated Failed", ar: "فشلت العملية", _appCode: "framework" }
}, d = s({}), f = s({}), m = s({}), N = navigator.language.toLowerCase(), l = N.startsWith("ar"), c = N.startsWith("en"), u = sessionStorage.getItem("currentLang") ? sessionStorage.getItem("currentLang") : l ? "ar" : c ? "en" : "zh-CN", w = z(u), g = "dasI18n", R = (e = {}, o) => {
  const C = o === "global", n = !C, p = {};
  for (const r in e)
    for (const a in e[r])
      p[a] || (p[a] = {}), p[a][r] = e[r][a] ?? "", C && (f[a] || (f[a] = {}), f[a][r] = p[a][r]), n && (d[a] || (d[a] = {}), d[a][r] = p[a][r]);
}, h = (e = {}, o) => {
  var p;
  const C = o === "global", n = !C;
  for (const r in e)
    if (C && !f[r] && (f[r] = e[r]), n) {
      const a = (p = e[r]) != null && p._appCode ? e[r]._appCode.toLowerCase() : "";
      a && (m[a] || (m[a] = {}), m[a][r] = e[r]), d[r] || (d[r] = e[r]);
    }
}, D = async (e) => {
  var p, r;
  const o = document.documentElement;
  o && o.setAttribute("lang", w.value);
  const C = window[g];
  C && h(C, "global"), h(_);
  let n = Object.assign(((p = e == null ? void 0 : e.i18n) == null ? void 0 : p.glob) || {});
  (r = e == null ? void 0 : e.microApps) == null || r.map((a) => {
    var t;
    n = Object.assign(n, ((t = a.i18n) == null ? void 0 : t.glob) || {});
  }), Object.values(n).filter((a) => !!a).flat().map((a) => h(a));
}, P = (e) => {
  let o = "";
  const C = /\/([^\/]+)\/([^\/]+)\//, n = e.match(C);
  return n && n.length >= 3 && (o = n[1] + "/" + n[2]), o ? o.toLowerCase() : "";
}, v = (e, ...o) => k(() => {
  const C = P(location.pathname);
  let n = m.framework ?? {}, p = m[C] ?? {}, r = f[e] || n[e] || p[e] || d[e] || e;
  if (r === e) return e;
  typeof r == "string" && (r = { "zh-CN": r });
  let a = r[w.value];
  return w.value === "zh-CN" && r["zh-cn"] && !r["zh-CN"] && (a = r["zh-cn"]), o.map((t, i) => {
    a && (a = a.replace(`$${i}`, t)), a && (a = a.replace(`${i}$`, t));
  }), a;
}), b = v, L = (e, ...o) => b(e, ...o).value, A = (e) => {
  sessionStorage.setItem("currentLang", e), w.value = e;
}, I = () => w;
export {
  w as currentLang,
  d as customLangeData,
  v as getI18nRule,
  I as getLang,
  b as i18n,
  D as initI18n,
  h as setI18nRule,
  A as setLang,
  R as setLangRule,
  L as t
};
