import {
  Card
} from "/build/_shared/chunk-QMPAUNNA.js";
import {
  Button
} from "/build/_shared/chunk-OGUYUMUT.js";
import {
  require_jsx_dev_runtime
} from "/build/_shared/chunk-XGOTYLZ5.js";
import {
  useLoaderData
} from "/build/_shared/chunk-RG2SZ2V3.js";
import {
  createHotContext
} from "/build/_shared/chunk-73ZPIOGA.js";
import "/build/_shared/chunk-UWV35TSL.js";
import "/build/_shared/chunk-U4FRFQSK.js";
import "/build/_shared/chunk-7M6SC7J5.js";
import {
  __toESM
} from "/build/_shared/chunk-PNG5AS42.js";

// app/routes/_index.tsx
var import_jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
  console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
} else {
  prevRefreshReg = window.$RefreshReg$;
  prevRefreshSig = window.$RefreshSig$;
  window.$RefreshReg$ = (type, id) => {
    window.$RefreshRuntime$.register(type, '"app\\\\routes\\\\_index.tsx"' + id);
  };
  window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
}
var prevRefreshReg;
var prevRefreshSig;
var _s = $RefreshSig$();
if (import.meta) {
  import.meta.hot = createHotContext(
    //@ts-expect-error
    "app\\routes\\_index.tsx"
  );
}
var links = () => [{
  rel: "stylesheet",
  href: "/app/styles/index.css"
}];
var meta = () => {
  return [{
    title: "\u4E2D\u56FD\u70DF\u8349AI\u5408\u540C\u53CA\u5377\u5B97\u5BA1\u6838\u7CFB\u7EDF - \u9996\u9875"
  }, {
    name: "description",
    content: "AI\u5BA1\u6838\u7CFB\u7EDF\u9996\u9875"
  }];
};
function Index() {
  _s();
  const {
    stats,
    recentFiles
  } = useLoaderData();
  return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "dashboard-container", children: [
    /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "mb-4 p-3 bg-yellow-100 border border-yellow-300 rounded text-yellow-800", children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("h3", { className: "font-bold text-lg", children: "\u5F53\u524D\u9875\u9762: \u9996\u9875 (_index.tsx)" }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 117,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("p", { children: "\u5982\u679C\u4F60\u770B\u5230\u8FD9\u4E2A\u63D0\u793A\uFF0C\u8BF4\u660E\u4F60\u6B63\u5728\u6D4F\u89C8\u9996\u9875\uFF0C\u800C\u4E0D\u662F\u8BC4\u67E5\u70B9\u5217\u8868\u9875\u9762\u3002" }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 118,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "mt-2", children: [
        /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("a", { href: "/debug", className: "text-blue-600 hover:underline", children: "\u67E5\u770B\u8DEF\u7531\u8BCA\u65AD\u9875\u9762" }, void 0, false, {
          fileName: "app/routes/_index.tsx",
          lineNumber: 120,
          columnNumber: 11
        }, this),
        " |",
        /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("a", { href: "/rules", className: "ml-2 text-blue-600 hover:underline", children: "\u901A\u8FC7\u539F\u751F\u94FE\u63A5\u8BBF\u95EE\u8BC4\u67E5\u70B9\u5217\u8868" }, void 0, false, {
          fileName: "app/routes/_index.tsx",
          lineNumber: 121,
          columnNumber: 11
        }, this)
      ] }, void 0, true, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 119,
        columnNumber: 9
      }, this)
    ] }, void 0, true, {
      fileName: "app/routes/_index.tsx",
      lineNumber: 116,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Card, { title: "\u7EDF\u8BA1\u4FE1\u606F", icon: "ri-bar-chart-line", className: "mt-6 transition-all duration-200 hover:shadow-[0_4px_15px_rgba(0,0,0,0.1)]", children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "stat-grid ", children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(StatCard, { title: "\u603B\u6587\u4EF6\u6570", value: stats.totalFiles, icon: "ri-file-list-3-line" }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 128,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(StatCard, { title: "\u5DF2\u5BA1\u6838", value: stats.reviewedFiles, icon: "ri-check-double-line", trend: {
        value: 5.2,
        isUp: true
      } }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 130,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(StatCard, { title: "\u5F85\u5BA1\u6838", value: stats.pendingFiles, icon: "ri-time-line", trend: {
        value: 2.1,
        isUp: false
      } }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 135,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(StatCard, { title: "\u901A\u8FC7\u7387", value: `${stats.passRate}%`, icon: "ri-pie-chart-line", trend: {
        value: 1.5,
        isUp: true
      } }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 140,
        columnNumber: 9
      }, this)
    ] }, void 0, true, {
      fileName: "app/routes/_index.tsx",
      lineNumber: 127,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "app/routes/_index.tsx",
      lineNumber: 126,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Card, { title: "\u5FEB\u6377\u8BBF\u95EE", icon: "ri-speed-line", className: "mt-6 transition-all duration-200 hover:shadow-[0_4px_15px_rgba(0,0,0,0.1)]", children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "shortcut-grid", children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(ShortcutItem, { icon: "ri-upload-cloud-line", label: "\u4E0A\u4F20\u6587\u4EF6", to: "/files/new" }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 151,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(ShortcutItem, { icon: "ri-file-list-3-line", label: "\u6587\u4EF6\u5217\u8868", to: "/files" }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 152,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(ShortcutItem, { icon: "ri-list-check-2", label: "\u8BC4\u67E5\u70B9\u7BA1\u7406", to: "/rules" }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 153,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(ShortcutItem, { icon: "ri-folder-open-line", label: "\u8BC4\u67E5\u70B9\u5206\u7EC4", to: "/rule-groups" }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 154,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(ShortcutItem, { icon: "ri-file-chart-line", label: "\u8BC4\u67E5\u8BE6\u60C5", to: "/reviews" }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 155,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(ShortcutItem, { icon: "ri-file-list-line", label: "\u6587\u6863\u7C7B\u578B", to: "/doc-types" }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 156,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(ShortcutItem, { icon: "ri-settings-3-line", label: "\u7CFB\u7EDF\u8BBE\u7F6E", to: "/settings" }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 157,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(ShortcutItem, { icon: "ri-chat-1-line", label: "\u63D0\u793A\u8BCD\u7BA1\u7406", to: "/prompts" }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 158,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "app/routes/_index.tsx",
      lineNumber: 150,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "app/routes/_index.tsx",
      lineNumber: 149,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Card, { title: "\u6700\u8FD1\u6587\u6863", icon: "ri-file-list-3-line", extra: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Button, { to: "/files", size: "small", children: "\u67E5\u770B\u5168\u90E8" }, void 0, false, {
      fileName: "app/routes/_index.tsx",
      lineNumber: 163,
      columnNumber: 60
    }, this), className: "mt-6", children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "doc-list", children: recentFiles.map((file) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "doc-item", children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "doc-info", children: [
        /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("i", { className: `doc-icon ${file.name.endsWith(".pdf") ? "ri-file-pdf-line" : "ri-file-word-line"}` }, void 0, false, {
          fileName: "app/routes/_index.tsx",
          lineNumber: 168,
          columnNumber: 17
        }, this),
        /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { children: [
          /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "doc-name", children: file.name }, void 0, false, {
            fileName: "app/routes/_index.tsx",
            lineNumber: 170,
            columnNumber: 19
          }, this),
          /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "doc-meta", children: [
            file.type,
            " \xB7 ",
            file.updatedAt
          ] }, void 0, true, {
            fileName: "app/routes/_index.tsx",
            lineNumber: 171,
            columnNumber: 19
          }, this)
        ] }, void 0, true, {
          fileName: "app/routes/_index.tsx",
          lineNumber: 169,
          columnNumber: 17
        }, this)
      ] }, void 0, true, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 167,
        columnNumber: 15
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "doc-status", children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(StatusBadge, { status: file.reviewStatus }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 177,
        columnNumber: 17
      }, this) }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 176,
        columnNumber: 15
      }, this)
    ] }, file.id, true, {
      fileName: "app/routes/_index.tsx",
      lineNumber: 166,
      columnNumber: 36
    }, this)) }, void 0, false, {
      fileName: "app/routes/_index.tsx",
      lineNumber: 165,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "app/routes/_index.tsx",
      lineNumber: 163,
      columnNumber: 7
    }, this)
  ] }, void 0, true, {
    fileName: "app/routes/_index.tsx",
    lineNumber: 114,
    columnNumber: 10
  }, this);
}
_s(Index, "rsfQp5mh5EV/dK4JBBInSVSpclM=", false, function() {
  return [useLoaderData];
});
_c = Index;
function StatCard({
  title,
  value,
  icon,
  trend
}) {
  return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "stat-card", children: [
    /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "stat-title", children: title }, void 0, false, {
      fileName: "app/routes/_index.tsx",
      lineNumber: 197,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "stat-value", children: value }, void 0, false, {
      fileName: "app/routes/_index.tsx",
      lineNumber: 198,
      columnNumber: 7
    }, this),
    trend && /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: `stat-trend ${trend.isUp ? "trend-up" : "trend-down"}`, children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("i", { className: `mr-1 ${trend.isUp ? "ri-arrow-up-s-line" : "ri-arrow-down-s-line"}` }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 200,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", { children: [
        trend.value,
        "%"
      ] }, void 0, true, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 201,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", { className: "ml-1 text-gray-500", children: "\u8F83\u4E0A\u6708" }, void 0, false, {
        fileName: "app/routes/_index.tsx",
        lineNumber: 202,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "app/routes/_index.tsx",
      lineNumber: 199,
      columnNumber: 17
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("i", { className: `${icon} stat-icon` }, void 0, false, {
      fileName: "app/routes/_index.tsx",
      lineNumber: 204,
      columnNumber: 7
    }, this)
  ] }, void 0, true, {
    fileName: "app/routes/_index.tsx",
    lineNumber: 196,
    columnNumber: 10
  }, this);
}
_c2 = StatCard;
function ShortcutItem({
  icon,
  label,
  to
}) {
  return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Button, { to, type: "default", className: "shortcut-item", children: [
    /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("i", { className: `${icon} shortcut-icon text-2xl` }, void 0, false, {
      fileName: "app/routes/_index.tsx",
      lineNumber: 217,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", { className: "shortcut-label", children: label }, void 0, false, {
      fileName: "app/routes/_index.tsx",
      lineNumber: 218,
      columnNumber: 7
    }, this)
  ] }, void 0, true, {
    fileName: "app/routes/_index.tsx",
    lineNumber: 215,
    columnNumber: 10
  }, this);
}
_c3 = ShortcutItem;
function StatusBadge({
  status
}) {
  const statusMap = {
    pass: {
      label: "\u901A\u8FC7",
      className: "status-badge status-success",
      icon: "ri-checkbox-circle-line"
    },
    warning: {
      label: "\u8B66\u544A",
      className: "status-badge status-warning",
      icon: "ri-error-warning-line"
    },
    fail: {
      label: "\u4E0D\u901A\u8FC7",
      className: "status-badge status-error",
      icon: "ri-close-circle-line"
    },
    pending: {
      label: "\u5F85\u786E\u8BA4",
      className: "status-badge",
      icon: "ri-time-line"
    }
  };
  const {
    label,
    className,
    icon
  } = statusMap[status] || statusMap.pending;
  return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", { className, children: [
    /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("i", { className: `${icon} mr-1` }, void 0, false, {
      fileName: "app/routes/_index.tsx",
      lineNumber: 255,
      columnNumber: 7
    }, this),
    label
  ] }, void 0, true, {
    fileName: "app/routes/_index.tsx",
    lineNumber: 254,
    columnNumber: 10
  }, this);
}
_c4 = StatusBadge;
var _c;
var _c2;
var _c3;
var _c4;
$RefreshReg$(_c, "Index");
$RefreshReg$(_c2, "StatCard");
$RefreshReg$(_c3, "ShortcutItem");
$RefreshReg$(_c4, "StatusBadge");
window.$RefreshReg$ = prevRefreshReg;
window.$RefreshSig$ = prevRefreshSig;
export {
  Index as default,
  links,
  meta
};
//# sourceMappingURL=/build/routes/_index-IEYVWKLH.js.map
