feat: support theme update and various improvements

- Add support for updating themes if a newer version is uploaded
- Hide config button for plugins without configuration items
- Auto refresh theme cache after panel update
- Fix issue where user used traffic cannot be set as a decimal
- Fix subscription issue for shadowrocket in v2board theme
This commit is contained in:
xboard committed 2025-07-15 01:26:14 +08:00
1 parent 342dc9df5a
commit 6ac0cc7ce5
7 files changed
+42 -30

No files matched your search

+3
View File
@@ -2,6 +2,7 @@
namespace App\Console\Commands;
use App\Services\ThemeService;
use App\Services\UpdateService;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;
@@ -46,6 +47,8 @@ class XboardUpdate extends Command
Artisan::call('horizon:terminate');
$updateService = new UpdateService();
$updateService->updateVersionCache();
$themeService = app(ThemeService::class);
$themeService->switch(admin_setting('current_theme'));
$this->info('更新完毕,队列服务已重启,你无需进行任何操作。');
}
}
@@ -206,9 +206,10 @@ class UserController extends Controller
if (!$user) {
return $this->fail([400202, '用户不存在']);
}
// 检查邮箱是否被使用
if (User::where('email', $params['email'])->first() && $user->email !== $params['email']) {
return $this->fail([400201, '邮箱已被使用']);
if (isset($params['email'])) {
if (User::where('email', $params['email'])->first() && $user->email !== $params['email']) {
return $this->fail([400201, '邮箱已被使用']);
}
}
// 处理密码
if (isset($params['password'])) {
@@ -223,7 +224,6 @@ class UserController extends Controller
if (!$plan) {
return $this->fail([400202, '订阅计划不存在']);
}
// return json_encode($plan);
$params['group_id'] = $plan->group_id;
}
// 处理邀请用户
+2 -1
View File
@@ -14,7 +14,8 @@ class UserUpdate extends FormRequest
public function rules()
{
return [
'email' => 'required|email:strict',
'id' => 'required|integer',
'email' => 'email:strict',
'password' => 'nullable|min:8',
'transfer_enable' => 'numeric',
'expired_at' => 'nullable|integer',
+21 -10
View File
@@ -156,7 +156,21 @@ class ThemeService
$targetPath = $userThemePath . $config['name'];
if (File::exists($targetPath)) {
throw new Exception('主题已存在');
$oldConfigFile = $targetPath . '/config.json';
if (!File::exists($oldConfigFile)) {
throw new Exception('已存在主题缺少配置文件');
}
$oldConfig = json_decode(File::get($oldConfigFile), true);
$oldVersion = $oldConfig['version'] ?? '0.0.0';
$newVersion = $config['version'] ?? '0.0.0';
if (version_compare($newVersion, $oldVersion, '>')) {
File::deleteDirectory($targetPath);
File::copyDirectory($sourcePath, $targetPath);
$this->initConfig($config['name']);
return true;
} else {
throw new Exception('主题已存在且不是新版本');
}
}
File::copyDirectory($sourcePath, $targetPath);
@@ -180,9 +194,6 @@ class ThemeService
public function switch(string $theme): bool
{
$currentTheme = admin_setting('current_theme');
if ($theme === $currentTheme) {
return true;
}
try {
// 验证主题是否存在
@@ -196,12 +207,6 @@ class ThemeService
throw new Exception('主题视图文件不存在');
}
// 复制主题文件到public目录
$targetPath = public_path('theme/' . $theme);
if (!File::copyDirectory($themePath, $targetPath)) {
throw new Exception('复制主题文件失败');
}
// 清理旧主题文件
if ($currentTheme) {
$oldPath = public_path('theme/' . $currentTheme);
@@ -210,6 +215,12 @@ class ThemeService
}
}
// 复制主题文件到public目录
$targetPath = public_path('theme/' . $theme);
if (!File::copyDirectory($themePath, $targetPath)) {
throw new Exception('复制主题文件失败');
}
admin_setting(['current_theme' => $theme]);
return true;
+11 -11
View File
@@ -1,21 +1,21 @@
import{r as m,j as e,t as eo,c as so,I as Xt,a as xt,S as Tn,u as Bs,b as to,d as Dn,R as kr,e as Tr,f as ao,F as no,C as ro,L as Dr,T as Fr,g as Pr,h as lo,i as io,k as oo,l as co,m as $,z as h,n as M,o as we,p as Te,q as ae,s as Is,v as Ee,w as mo,x as uo,O as Fn,y as xo,A as ho,B as go,D as po,E as fo,G as jo,Q as vo,H as bo,J as yo,K as _o,P as No,M as wo,N as Co,U as So,V as ko,W as Rr,X as Lr,Y as Va,Z as Ia,_ as Pn,$ as os,a0 as Ma,a1 as Oa,a2 as Er,a3 as Vr,a4 as Ir,a5 as Mr,a6 as Or,a7 as To,a8 as zr,a9 as $r,aa as Ar,ab as qr,ac as ht,ad as Ur,ae as Do,af as Hr,ag as Kr,ah as Fo,ai as Po,aj as Ro,ak as Lo,al as Eo,am as Vo,an as Io,ao as Mo,ap as Oo,aq as zo,ar as Br,as as $o,at as Ao,au as Zs,av as Gr,aw as qo,ax as Uo,ay as Wr,az as Rn,aA as Ho,aB as Ko,aC as sr,aD as Bo,aE as Yr,aF as Go,aG as Jr,aH as Wo,aI as Yo,aJ as Jo,aK as Qo,aL as Xo,aM as Zo,aN as ec,aO as Qr,aP as sc,aQ as tc,aR as ac,aS as xs,aT as nc,aU as Ln,aV as rc,aW as lc,aX as Xr,aY as Zr,aZ as el,a_ as ic,a$ as oc,b0 as cc,b1 as sl,b2 as dc,b3 as En,b4 as tl,b5 as mc,b6 as al,b7 as uc,b8 as nl,b9 as xc,ba as rl,bb as ll,bc as hc,bd as gc,be as il,bf as pc,bg as ol,bh as fc,bi as cl,bj as dl,bk as ml,bl as jc,bm as ul,bn as vc,bo as bc,bp as Es,bq as Re,br as ws,bs as yc,bt as _c,bu as Nc,bv as wc,bw as Cc,bx as Sc,by as tr,bz as ar,bA as kc,bB as Tc,bC as Vn,bD as Dc,bE as Fc,bF as wa,bG as Dt,bH as Zt,bI as Pc,bJ as xl,bK as Rc,bL as Lc,bM as hl,bN as Ec,bO as Vc,bP as nr,bQ as jn,bR as vn,bS as Ic,bT as Mc,bU as gl,bV as Oc,bW as zc,bX as $c,bY as Ac,bZ as Ca,b_ as bn,b$ as Be,c0 as Sa,c1 as qc,c2 as nn,c3 as Uc,c4 as yn,c5 as us,c6 as Kt,c7 as Bt,c8 as _n,c9 as pl,ca as Ge,cb as Ze,cc as fl,cd as jl,ce as Hc,cf as Kc,cg as Bc,ch as Gc,ci as Wc,cj as vl,ck as Yc,cl as Jc,cm as Ke,cn as rr,co as Qc,cp as bl,cq as yl,cr as _l,cs as Nl,ct as wl,cu as Cl,cv as Xc,cw as Zc,cx as ed,cy as za,cz as tt,cA as hs,cB as gs,cC as sd,cD as td,cE as ad,cF as nd,cG as rd,cH as ka,cI as ld,cJ as id,cK as Nn,cL as In,cM as Mn,cN as od,cO as Fs,cP as Ps,cQ as $a,cR as cd,cS as Ta,cT as dd,cU as lr,cV as Sl,cW as ir,cX as Da,cY as md,cZ as kl,c_ as ud,c$ as xd,d0 as hd,d1 as Tl,d2 as gd,d3 as pd,d4 as Dl,d5 as wn,d6 as Fl,d7 as fd,d8 as Cn,d9 as Pl,da as jd,db as vd,dc as bd,dd as Rl,de as yd,df as _d,dg as Ll,dh as Gt,di as On,dj as Nd,dk as or,dl as El,dm as wd,dn as cr,dp as Cd,dq as Sd}from"./vendor.js";import"./index.js";var np=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rp(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function kd(s){if(s.__esModule)return s;var n=s.default;if(typeof n=="function"){var t=function r(){return this instanceof r?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};t.prototype=n.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var a=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return s[r]}})}),t}const Td={theme:"system",setTheme:()=>null},Vl=m.createContext(Td);function Dd({children:s,defaultTheme:n="system",storageKey:t="vite-ui-theme",...r}){const[a,i]=m.useState(()=>localStorage.getItem(t)||n);m.useEffect(()=>{const d=window.document.documentElement;if(d.classList.remove("light","dark"),a==="system"){const u=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";d.classList.add(u);return}d.classList.add(a)},[a]);const l={theme:a,setTheme:d=>{localStorage.setItem(t,d),i(d)}};return e.jsx(Vl.Provider,{...r,value:l,children:s})}const Fd=()=>{const s=m.useContext(Vl);if(s===void 0)throw new Error("useTheme must be used within a ThemeProvider");return s},Pd=function(){const n=typeof document<"u"&&document.createElement("link").relList;return n&&n.supports&&n.supports("modulepreload")?"modulepreload":"preload"}(),Rd=function(s,n){return new URL(s,n).href},dr={},Ne=function(n,t,r){let a=Promise.resolve();if(t&&t.length>0){const l=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),u=d?.nonce||d?.getAttribute("nonce");a=Promise.allSettled(t.map(x=>{if(x=Rd(x,r),x in dr)return;dr[x]=!0;const o=x.endsWith(".css"),c=o?'[rel="stylesheet"]':"";if(!!r)for(let S=l.length-1;S>=0;S--){const w=l[S];if(w.href===x&&(!o||w.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${x}"]${c}`))return;const F=document.createElement("link");if(F.rel=o?"stylesheet":Pd,o||(F.as="script"),F.crossOrigin="",F.href=x,u&&F.setAttribute("nonce",u),document.head.appendChild(F),o)return new Promise((S,w)=>{F.addEventListener("load",S),F.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${x}`)))})}))}function i(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return a.then(l=>{for(const d of l||[])d.status==="rejected"&&i(d.reason);Line truncated
`)[0]})}),e.jsx(ue,{className:"max-w-[300px] whitespace-pre-wrap",children:e.jsx("span",{children:B.original.exception})})]})})}),qt.display({id:"actions",header:()=>s("dashboard:queue.details.action"),size:80,cell:({row:B})=>e.jsx(G,{variant:"ghost",size:"sm",onClick:()=>Wi(B.original),"aria-label":s("dashboard:queue.details.viewDetail"),children:e.jsx(bn,{className:"h-4 w-4"})})})],[s]),Zn=Be({data:Xn,columns:Hi,getCoreRowModel:Ge(),getPaginationRowModel:Ze(),pageCount:Math.ceil(Ui/d),manualPagination:!0,state:{pagination:{pageIndex:i-1,pageSize:d}},onPaginationChange:B=>{if(typeof B=="function"){const Ls=B({pageIndex:i-1,pageSize:d});er(Ls.pageIndex+1)}else er(B.pageIndex+1)}}),Ki=()=>{t(B=>B+1)},er=B=>{l(B)},oa=B=>{w(B)},ca=B=>{y(B),w(1)},Bi=B=>{se(B),w(1)},Gi=()=>{E(""),K(""),se("all"),w(1)},da=B=>{C(B),p(!0)},Wi=B=>{x(B),c(!0)},Yi=async()=>{try{const B=await ve.getLogClearStats({days:ee,level:fs==="all"?void 0:fs});Et(B.data),Vt(!0)}catch(B){console.error("Failed to get clear stats:",B),$.error(s("dashboard:systemLog.getStatsFailed"))}},Ji=async()=>{lt(!0);try{const{data:B}=await ve.clearSystemLog({days:ee,level:fs==="all"?void 0:fs,limit:re});B&&($.success(s("dashboard:systemLog.clearSuccess",{count:B.cleared_count}),{duration:3e3}),H(!1),Vt(!1),Et(null),ye())}catch(B){console.error("Failed to clear logs:",B),$.error(s("dashboard:systemLog.clearLogsFailed"))}finally{lt(!1)}};if(te||zi)return e.jsx("div",{className:"flex items-center justify-center p-6",children:e.jsx(Sa,{className:"h-6 w-6 animate-spin"})});const Qi=B=>B?e.jsx(fl,{className:"h-5 w-5 text-green-500"}):e.jsx(jl,{className:"h-5 w-5 text-red-500"});return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs(ke,{children:[e.jsxs(Fe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Le,{className:"flex items-center gap-2",children:[e.jsx(qc,{className:"h-5 w-5"}),s("dashboard:queue.title")]}),e.jsx(Hs,{children:s("dashboard:queue.status.description")})]}),e.jsx(G,{variant:"outline",size:"icon",onClick:Ki,disabled:Ye||Yn,children:e.jsx(nn,{className:N("h-4 w-4",(Ye||Yn)&&"animate-spin")})})]}),e.jsx(Pe,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[Qi(_e?.status||!1),e.jsx("span",{className:"font-medium",children:s("dashboard:queue.status.running")})]}),e.jsx(U,{variant:_e?.status?"secondary":"destructive",children:_e?.status?s("dashboard:queue.status.normal"):s("dashboard:queue.status.abnormal")})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.status.waitTime",{seconds:_e?.wait?.default||0})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(be,{children:e.jsxs(ge,{children:[e.jsx(pe,{asChild:!0,children:e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.recentJobs")}),e.jsx("p",{className:"text-2xl font-bold",children:_e?.recentJobs||0}),e.jsx(ba,{value:(_e?.recentJobs||0)/(_e?.periods?.recentJobs||1)*100,className:"h-1"})]})}),e.jsx(ue,{children:e.jsx("p",{children:s("dashboard:queue.details.statisticsPeriod",{hours:_e?.periods?.recentJobs||0})})})]})}),e.jsx(be,{children:e.jsxs(ge,{children:[e.jsx(pe,{asChild:!0,children:e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.jobsPerMinute")}),e.jsx("p",{className:"text-2xl font-bold",children:_e?.jobsPerMinute||0}),e.jsx(ba,{value:(_e?.jobsPerMinute||0)/(_e?.queueWithMaxThroughput?.throughput||1)*100,className:"h-1"})]})}),e.jsx(ue,{children:e.jsx("p",{children:s("dashboard:queue.details.maxThroughput",{value:_e?.queueWithMaxThroughput?.throughput||0})})})]})})]})]})})]}),e.jsxs(ke,{children:[e.jsxs(Fe,{children:[e.jsxs(Le,{className:"flex items-center gap-2",children:[e.jsx(Uc,{className:"h-5 w-5"}),s("dashboard:queue.jobDetails")]}),e.jsx(Hs,{children:s("dashboard:queue.details.description")})]}),e.jsx(Pe,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.failedJobs7Days")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"cursor-pointer text-2xl font-bold text-destructive hover:underline",title:s("dashboard:queue.details.viewFailedJobs"),onClick:()=>a(!0),style:{userSelect:"none"},children:_e?.failedJobs||0}),e.jsx(bn,{className:"h-4 w-4 cursor-pointer text-muted-foreground hover:text-destructive",onClick Line truncated
import{r as m,j as e,t as eo,c as so,I as Xt,a as xt,S as Tn,u as Bs,b as to,d as Dn,R as kr,e as Tr,f as ao,F as no,C as ro,L as Dr,T as Fr,g as Pr,h as lo,i as io,k as oo,l as co,m as $,z as h,n as M,o as we,p as Te,q as ae,s as Is,v as Ee,w as mo,x as uo,O as Fn,y as xo,A as ho,B as go,D as po,E as fo,G as jo,Q as vo,H as bo,J as yo,K as _o,P as No,M as wo,N as Co,U as So,V as ko,W as Rr,X as Lr,Y as Va,Z as Ia,_ as Pn,$ as os,a0 as Ma,a1 as Oa,a2 as Er,a3 as Vr,a4 as Ir,a5 as Mr,a6 as Or,a7 as To,a8 as zr,a9 as $r,aa as Ar,ab as qr,ac as ht,ad as Ur,ae as Do,af as Hr,ag as Kr,ah as Fo,ai as Po,aj as Ro,ak as Lo,al as Eo,am as Vo,an as Io,ao as Mo,ap as Oo,aq as zo,ar as Br,as as $o,at as Ao,au as Zs,av as Gr,aw as qo,ax as Uo,ay as Wr,az as Rn,aA as Ho,aB as Ko,aC as sr,aD as Bo,aE as Yr,aF as Go,aG as Jr,aH as Wo,aI as Yo,aJ as Jo,aK as Qo,aL as Xo,aM as Zo,aN as ec,aO as Qr,aP as sc,aQ as tc,aR as ac,aS as xs,aT as nc,aU as Ln,aV as rc,aW as lc,aX as Xr,aY as Zr,aZ as el,a_ as ic,a$ as oc,b0 as cc,b1 as sl,b2 as dc,b3 as En,b4 as tl,b5 as mc,b6 as al,b7 as uc,b8 as nl,b9 as xc,ba as rl,bb as ll,bc as hc,bd as gc,be as il,bf as pc,bg as ol,bh as fc,bi as cl,bj as dl,bk as ml,bl as jc,bm as ul,bn as vc,bo as bc,bp as Es,bq as Re,br as ws,bs as yc,bt as _c,bu as Nc,bv as wc,bw as Cc,bx as Sc,by as tr,bz as ar,bA as kc,bB as Tc,bC as Vn,bD as Dc,bE as Fc,bF as wa,bG as Dt,bH as Zt,bI as Pc,bJ as xl,bK as Rc,bL as Lc,bM as hl,bN as Ec,bO as Vc,bP as nr,bQ as jn,bR as vn,bS as Ic,bT as Mc,bU as gl,bV as Oc,bW as zc,bX as $c,bY as Ac,bZ as Ca,b_ as bn,b$ as Be,c0 as Sa,c1 as qc,c2 as nn,c3 as Uc,c4 as yn,c5 as us,c6 as Kt,c7 as Bt,c8 as _n,c9 as pl,ca as Ge,cb as Ze,cc as fl,cd as jl,ce as Hc,cf as Kc,cg as Bc,ch as Gc,ci as Wc,cj as vl,ck as Yc,cl as Jc,cm as Ke,cn as rr,co as Qc,cp as bl,cq as yl,cr as _l,cs as Nl,ct as wl,cu as Cl,cv as Xc,cw as Zc,cx as ed,cy as za,cz as tt,cA as hs,cB as gs,cC as sd,cD as td,cE as ad,cF as nd,cG as rd,cH as ka,cI as ld,cJ as id,cK as Nn,cL as In,cM as Mn,cN as od,cO as Fs,cP as Ps,cQ as $a,cR as cd,cS as Ta,cT as dd,cU as lr,cV as Sl,cW as ir,cX as Da,cY as md,cZ as kl,c_ as ud,c$ as xd,d0 as hd,d1 as Tl,d2 as gd,d3 as pd,d4 as Dl,d5 as wn,d6 as Fl,d7 as fd,d8 as Cn,d9 as Pl,da as jd,db as vd,dc as bd,dd as Rl,de as yd,df as _d,dg as Ll,dh as Gt,di as On,dj as Nd,dk as or,dl as El,dm as wd,dn as cr,dp as Cd,dq as Sd}from"./vendor.js";import"./index.js";var np=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rp(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function kd(s){if(s.__esModule)return s;var n=s.default;if(typeof n=="function"){var t=function r(){return this instanceof r?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};t.prototype=n.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var a=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return s[r]}})}),t}const Td={theme:"system",setTheme:()=>null},Vl=m.createContext(Td);function Dd({children:s,defaultTheme:n="system",storageKey:t="vite-ui-theme",...r}){const[a,i]=m.useState(()=>localStorage.getItem(t)||n);m.useEffect(()=>{const d=window.document.documentElement;if(d.classList.remove("light","dark"),a==="system"){const u=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";d.classList.add(u);return}d.classList.add(a)},[a]);const l={theme:a,setTheme:d=>{localStorage.setItem(t,d),i(d)}};return e.jsx(Vl.Provider,{...r,value:l,children:s})}const Fd=()=>{const s=m.useContext(Vl);if(s===void 0)throw new Error("useTheme must be used within a ThemeProvider");return s},Pd=function(){const n=typeof document<"u"&&document.createElement("link").relList;return n&&n.supports&&n.supports("modulepreload")?"modulepreload":"preload"}(),Rd=function(s,n){return new URL(s,n).href},dr={},Ne=function(n,t,r){let a=Promise.resolve();if(t&&t.length>0){const l=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),u=d?.nonce||d?.getAttribute("nonce");a=Promise.allSettled(t.map(x=>{if(x=Rd(x,r),x in dr)return;dr[x]=!0;const o=x.endsWith(".css"),c=o?'[rel="stylesheet"]':"";if(!!r)for(let S=l.length-1;S>=0;S--){const w=l[S];if(w.href===x&&(!o||w.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${x}"]${c}`))return;const F=document.createElement("link");if(F.rel=o?"stylesheet":Pd,o||(F.as="script"),F.crossOrigin="",F.href=x,u&&F.setAttribute("nonce",u),document.head.appendChild(F),o)return new Promise((S,w)=>{F.addEventListener("load",S),F.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${x}`)))})}))}function i(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return a.then(l=>{for(const d of l||[])d.status==="rejected"&&i(d.reason);Line truncated
`)[0]})}),e.jsx(ue,{className:"max-w-[300px] whitespace-pre-wrap",children:e.jsx("span",{children:B.original.exception})})]})})}),qt.display({id:"actions",header:()=>s("dashboard:queue.details.action"),size:80,cell:({row:B})=>e.jsx(G,{variant:"ghost",size:"sm",onClick:()=>Wi(B.original),"aria-label":s("dashboard:queue.details.viewDetail"),children:e.jsx(bn,{className:"h-4 w-4"})})})],[s]),Zn=Be({data:Xn,columns:Hi,getCoreRowModel:Ge(),getPaginationRowModel:Ze(),pageCount:Math.ceil(Ui/d),manualPagination:!0,state:{pagination:{pageIndex:i-1,pageSize:d}},onPaginationChange:B=>{if(typeof B=="function"){const Ls=B({pageIndex:i-1,pageSize:d});er(Ls.pageIndex+1)}else er(B.pageIndex+1)}}),Ki=()=>{t(B=>B+1)},er=B=>{l(B)},oa=B=>{w(B)},ca=B=>{y(B),w(1)},Bi=B=>{se(B),w(1)},Gi=()=>{E(""),K(""),se("all"),w(1)},da=B=>{C(B),p(!0)},Wi=B=>{x(B),c(!0)},Yi=async()=>{try{const B=await ve.getLogClearStats({days:ee,level:fs==="all"?void 0:fs});Et(B.data),Vt(!0)}catch(B){console.error("Failed to get clear stats:",B),$.error(s("dashboard:systemLog.getStatsFailed"))}},Ji=async()=>{lt(!0);try{const{data:B}=await ve.clearSystemLog({days:ee,level:fs==="all"?void 0:fs,limit:re});B&&($.success(s("dashboard:systemLog.clearSuccess",{count:B.cleared_count}),{duration:3e3}),H(!1),Vt(!1),Et(null),ye())}catch(B){console.error("Failed to clear logs:",B),$.error(s("dashboard:systemLog.clearLogsFailed"))}finally{lt(!1)}};if(te||zi)return e.jsx("div",{className:"flex items-center justify-center p-6",children:e.jsx(Sa,{className:"h-6 w-6 animate-spin"})});const Qi=B=>B?e.jsx(fl,{className:"h-5 w-5 text-green-500"}):e.jsx(jl,{className:"h-5 w-5 text-red-500"});return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs(ke,{children:[e.jsxs(Fe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Le,{className:"flex items-center gap-2",children:[e.jsx(qc,{className:"h-5 w-5"}),s("dashboard:queue.title")]}),e.jsx(Hs,{children:s("dashboard:queue.status.description")})]}),e.jsx(G,{variant:"outline",size:"icon",onClick:Ki,disabled:Ye||Yn,children:e.jsx(nn,{className:N("h-4 w-4",(Ye||Yn)&&"animate-spin")})})]}),e.jsx(Pe,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[Qi(_e?.status||!1),e.jsx("span",{className:"font-medium",children:s("dashboard:queue.status.running")})]}),e.jsx(U,{variant:_e?.status?"secondary":"destructive",children:_e?.status?s("dashboard:queue.status.normal"):s("dashboard:queue.status.abnormal")})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.status.waitTime",{seconds:_e?.wait?.default||0})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(be,{children:e.jsxs(ge,{children:[e.jsx(pe,{asChild:!0,children:e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.recentJobs")}),e.jsx("p",{className:"text-2xl font-bold",children:_e?.recentJobs||0}),e.jsx(ba,{value:(_e?.recentJobs||0)/(_e?.periods?.recentJobs||1)*100,className:"h-1"})]})}),e.jsx(ue,{children:e.jsx("p",{children:s("dashboard:queue.details.statisticsPeriod",{hours:_e?.periods?.recentJobs||0})})})]})}),e.jsx(be,{children:e.jsxs(ge,{children:[e.jsx(pe,{asChild:!0,children:e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.jobsPerMinute")}),e.jsx("p",{className:"text-2xl font-bold",children:_e?.jobsPerMinute||0}),e.jsx(ba,{value:(_e?.jobsPerMinute||0)/(_e?.queueWithMaxThroughput?.throughput||1)*100,className:"h-1"})]})}),e.jsx(ue,{children:e.jsx("p",{children:s("dashboard:queue.details.maxThroughput",{value:_e?.queueWithMaxThroughput?.throughput||0})})})]})})]})]})})]}),e.jsxs(ke,{children:[e.jsxs(Fe,{children:[e.jsxs(Le,{className:"flex items-center gap-2",children:[e.jsx(Uc,{className:"h-5 w-5"}),s("dashboard:queue.jobDetails")]}),e.jsx(Hs,{children:s("dashboard:queue.details.description")})]}),e.jsx(Pe,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:queue.details.failedJobs7Days")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"cursor-pointer text-2xl font-bold text-destructive hover:underline",title:s("dashboard:queue.details.viewFailedJobs"),onClick:()=>a(!0),style:{userSelect:"none"},children:_e?.failedJobs||0}),e.jsx(bn,{className:"h-4 w-4 cursor-pointer text-muted-foreground hover:text-destructive",onClick Line truncated
File: ${Xi}
Line: ${Zi}`}return JSON.stringify(B,null,2)}catch{return L.context}})()})})]})]}),e.jsx(Me,{children:e.jsx(Qs,{asChild:!0,children:e.jsx(G,{variant:"outline",children:s("common:close")})})})]})}),e.jsx(de,{open:ne,onOpenChange:H,children:e.jsxs(ce,{className:"max-w-2xl",children:[e.jsx(he,{children:e.jsxs(me,{className:"flex items-center gap-2",children:[e.jsx(us,{className:"h-5 w-5 text-destructive"}),s("dashboard:systemLog.clearLogs")]})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Je,{htmlFor:"clearDays",children:s("dashboard:systemLog.clearDays")}),e.jsx(k,{id:"clearDays",type:"number",min:"0",max:"365",value:ee,onChange:B=>{const Ls=B.target.value;if(Ls==="")fe(0);else{const vt=parseInt(Ls);!isNaN(vt)&&vt>=0&&vt<=365&&fe(vt)}},placeholder:"0"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("dashboard:systemLog.clearDaysDesc")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Je,{htmlFor:"clearLevel",children:s("dashboard:systemLog.clearLevel")}),e.jsxs(J,{value:fs,onValueChange:Ie,children:[e.jsx(W,{children:e.jsx(Q,{})}),e.jsxs(Y,{children:[e.jsx(A,{value:"all",children:s("dashboard:systemLog.tabs.all")}),e.jsx(A,{value:"info",children:s("dashboard:systemLog.tabs.info")}),e.jsx(A,{value:"warning",children:s("dashboard:systemLog.tabs.warning")}),e.jsx(A,{value:"error",children:s("dashboard:systemLog.tabs.error")})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Je,{htmlFor:"clearLimit",children:s("dashboard:systemLog.clearLimit")}),e.jsx(k,{id:"clearLimit",type:"number",min:"100",max:"10000",value:re,onChange:B=>q(parseInt(B.target.value)||1e3),placeholder:"1000"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("dashboard:systemLog.clearLimitDesc")})]})]}),e.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4 dark:border-amber-900 dark:bg-amber-950/30",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Vn,{className:"h-5 w-5 text-amber-600"}),e.jsx("span",{className:"font-medium text-amber-800 dark:text-amber-200",children:s("dashboard:systemLog.clearPreview")})]}),e.jsxs(G,{variant:"outline",size:"sm",onClick:Yi,disabled:ie,children:[e.jsx(ws,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.getStats")]})]}),na&&$s&&e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:systemLog.cutoffDate")}),e.jsx("p",{className:"font-mono text-sm",children:$s.cutoff_date})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:systemLog.totalLogs")}),e.jsx("p",{className:"font-mono text-sm font-medium",children:$s.total_logs.toLocaleString()})]})]}),e.jsxs("div",{className:"rounded-md bg-red-50 p-3 dark:bg-red-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Bt,{className:"h-4 w-4 text-red-600"}),e.jsxs("span",{className:"text-sm font-medium text-red-800 dark:text-red-200",children:[s("dashboard:systemLog.willClear"),":",e.jsx("span",{className:"ml-1 font-bold",children:$s.logs_to_clear.toLocaleString()}),s("dashboard:systemLog.logsUnit")]})]}),e.jsx("p",{className:"mt-1 text-xs text-red-600 dark:text-red-300",children:s("dashboard:systemLog.clearWarning")})]})]})]})]}),e.jsxs(Me,{children:[e.jsx(G,{variant:"outline",onClick:()=>{H(!1),Vt(!1),Et(null)},children:s("common:cancel")}),e.jsx(G,{variant:"destructive",onClick:Ji,disabled:ie||!na||!$s,children:ie?e.jsxs(e.Fragment,{children:[e.jsx(Sa,{className:"mr-2 h-4 w-4 animate-spin"}),s("dashboard:systemLog.clearing")]}):e.jsxs(e.Fragment,{children:[e.jsx(us,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.confirmClear")]})})]})]})})]})}function Um(){const{t:s}=M();return e.jsxs(qe,{children:[e.jsxs(Ue,{children:[e.jsx("div",{className:"flex items-center",children:e.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:s("dashboard:title")})}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(cs,{}),e.jsx(es,{}),e.jsx(ss,{})]})]}),e.jsx(We,{children:e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"grid gap-6",children:[e.jsx(Mm,{}),e.jsx(Rm,{}),e.jsx(Om,{}),e.jsx(qm,{})]})})})]})}const Hm=Object.freeze(Object.defineProperty({__proto__:null,default:Um},Symbol.toStringTag,{value:"Module"}));function Km({className:s,items:n,...t}){const{pathname:r}=Dn(),a=Bs(),[i,l]=m.useState(r??"/settings"),d=x=>{l(x),a(x)},{t:u}=M("settings");return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"p-1 md:hidden",children:e.jsxs(J,{value:i,onValueChange:d,children:[e.jsx(W,{className:"h-12 sm:w-48",children:e.jsx(Q,{placeholder:"The Line truncated
`),onChange:b=>{const F=b.target.value.split(`
`).filter(Boolean);c.onChange(F),o(l.getValues())}})}),e.jsx(z,{children:s("safe.form.emailWhitelist.suffixes.description")}),e.jsx(R,{})]})}),e.jsx(j,{control:l.control,name:"captcha_enable",render:({field:c})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(v,{className:"text-base",children:s("safe.form.captcha.enable.label")}),e.jsx(z,{children:s("safe.form.captcha.enable.description")})]}),e.jsx(_,{children:e.jsx(X,{checked:c.value||!1,onCheckedChange:b=>{c.onChange(b),o(l.getValues())}})})]})}),l.watch("captcha_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(j,{control:l.control,name:"captcha_type",render:({field:c})=>e.jsxs(f,{children:[e.jsx(v,{className:"text-base",children:s("safe.form.captcha.type.label")}),e.jsxs(J,{onValueChange:b=>{c.onChange(b),o(l.getValues())},value:c.value||"recaptcha",children:[e.jsx(_,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:s("safe.form.captcha.type.description")})})}),e.jsxs(Y,{children:[e.jsx(A,{value:"recaptcha",children:s("safe.form.captcha.type.options.recaptcha")}),e.jsx(A,{value:"recaptcha-v3",children:s("safe.form.captcha.type.options.recaptcha-v3")}),e.jsx(A,{value:"turnstile",children:s("safe.form.captcha.type.options.turnstile")})]})]}),e.jsx(z,{children:s("safe.form.captcha.type.description")}),e.jsx(R,{})]})}),l.watch("captcha_type")==="recaptcha"&&e.jsxs(e.Fragment,{children:[e.jsx(j,{control:l.control,name:"recaptcha_site_key",render:({field:c})=>e.jsxs(f,{children:[e.jsx(v,{className:"text-base",children:s("safe.form.captcha.recaptcha.siteKey.label")}),e.jsx(_,{children:e.jsx(k,{placeholder:s("safe.form.captcha.recaptcha.siteKey.placeholder"),...c,value:c.value||"",onChange:b=>{c.onChange(b),o(l.getValues())}})}),e.jsx(z,{children:s("safe.form.captcha.recaptcha.siteKey.description")}),e.jsx(R,{})]})}),e.jsx(j,{control:l.control,name:"recaptcha_key",render:({field:c})=>e.jsxs(f,{children:[e.jsx(v,{className:"text-base",children:s("safe.form.captcha.recaptcha.key.label")}),e.jsx(_,{children:e.jsx(k,{placeholder:s("safe.form.captcha.recaptcha.key.placeholder"),...c,value:c.value||"",onChange:b=>{c.onChange(b),o(l.getValues())}})}),e.jsx(z,{children:s("safe.form.captcha.recaptcha.key.description")}),e.jsx(R,{})]})})]}),l.watch("captcha_type")==="recaptcha-v3"&&e.jsxs(e.Fragment,{children:[e.jsx(j,{control:l.control,name:"recaptcha_v3_site_key",render:({field:c})=>e.jsxs(f,{children:[e.jsx(v,{className:"text-base",children:s("safe.form.captcha.recaptcha_v3.siteKey.label")}),e.jsx(_,{children:e.jsx(k,{placeholder:s("safe.form.captcha.recaptcha_v3.siteKey.placeholder"),...c,value:c.value||"",onChange:b=>{c.onChange(b),o(l.getValues())}})}),e.jsx(z,{children:s("safe.form.captcha.recaptcha_v3.siteKey.description")}),e.jsx(R,{})]})}),e.jsx(j,{control:l.control,name:"recaptcha_v3_secret_key",render:({field:c})=>e.jsxs(f,{children:[e.jsx(v,{className:"text-base",children:s("safe.form.captcha.recaptcha_v3.secretKey.label")}),e.jsx(_,{children:e.jsx(k,{placeholder:s("safe.form.captcha.recaptcha_v3.secretKey.placeholder"),...c,value:c.value||"",onChange:b=>{c.onChange(b),o(l.getValues())}})}),e.jsx(z,{children:s("safe.form.captcha.recaptcha_v3.secretKey.description")}),e.jsx(R,{})]})}),e.jsx(j,{control:l.control,name:"recaptcha_v3_score_threshold",render:({field:c})=>e.jsxs(f,{children:[e.jsx(v,{className:"text-base",children:s("safe.form.captcha.recaptcha_v3.scoreThreshold.label")}),e.jsx(_,{children:e.jsx(k,{type:"number",step:"0.1",min:"0",max:"1",placeholder:s("safe.form.captcha.recaptcha_v3.scoreThreshold.placeholder"),...c,value:c.value||"",onChange:b=>{c.onChange(b),o(l.getValues())}})}),e.jsx(z,{children:s("safe.form.captcha.recaptcha_v3.scoreThreshold.description")}),e.jsx(R,{})]})})]}),l.watch("captcha_type")==="turnstile"&&e.jsxs(e.Fragment,{children:[e.jsx(j,{control:l.control,name:"turnstile_site_key",render:({field:c})=>e.jsxs(f,{children:[e.jsx(v,{className:"text-base",children:s("safe.form.captcha.turnstile.siteKey.label")}),e.jsx(_,{children:e.jsx(k,{placeholder:s("safe.form.captcha.turnstile.siteKey.placeholder"),...c,value:c.value||"",onChange:b=>{c.onChange(b),o(l.getValues())}})}),e.jsx(z,{children:s("safe.form.captcha.turnstile.siteKey.description")}),e.jsx(R,{})]})}),e.jsx(j,{control:l.control,name:"turnstile_secret_key",render:({field:c})=>e.jsxs(f,{children:[e.jsx(v,{className:"text-base",children:s("safe.form.captcha.turnstile.secretKey.label")}),e.jsx(_,{children:e.jsx(k,{placeholder:s("safe.form.captcha.turnstile.secretKey.placeholder"),...c,value:c.value||"",onChange:b=>{c.onChange(b),o(l.getValues())}})}),e.jsx(z,{children:s("safe.form.captcha.turnstile.secretKey.description")}),e.jsx(R,{})]})})]})]}),e.jsx(j,{control:l.control,name:"register_limit_by_ip_enable",render:({field:c})=>e.jsxs(f,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(v,{className:"text-base",children:s("safe.form.registerLimit.enable.label")}),e.jsx(z,{children:s("safe.form.registerLimit.enable.description")})]}),e.jsx(_, Line truncated
Line: ${Zi}`}return JSON.stringify(B,null,2)}catch{return L.context}})()})})]})]}),e.jsx(Me,{children:e.jsx(Qs,{asChild:!0,children:e.jsx(G,{variant:"outline",children:s("common:close")})})})]})}),e.jsx(de,{open:ne,onOpenChange:H,children:e.jsxs(ce,{className:"max-w-2xl",children:[e.jsx(he,{children:e.jsxs(me,{className:"flex items-center gap-2",children:[e.jsx(us,{className:"h-5 w-5 text-destructive"}),s("dashboard:systemLog.clearLogs")]})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(Je,{htmlFor:"clearDays",children:s("dashboard:systemLog.clearDays")}),e.jsx(k,{id:"clearDays",type:"number",min:"0",max:"365",value:ee,onChange:B=>{const Ls=B.target.value;if(Ls==="")fe(0);else{const vt=parseInt(Ls);!isNaN(vt)&&vt>=0&&vt<=365&&fe(vt)}},placeholder:"0"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("dashboard:systemLog.clearDaysDesc")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Je,{htmlFor:"clearLevel",children:s("dashboard:systemLog.clearLevel")}),e.jsxs(J,{value:fs,onValueChange:Ie,children:[e.jsx(W,{children:e.jsx(Q,{})}),e.jsxs(Y,{children:[e.jsx(A,{value:"all",children:s("dashboard:systemLog.tabs.all")}),e.jsx(A,{value:"info",children:s("dashboard:systemLog.tabs.info")}),e.jsx(A,{value:"warning",children:s("dashboard:systemLog.tabs.warning")}),e.jsx(A,{value:"error",children:s("dashboard:systemLog.tabs.error")})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Je,{htmlFor:"clearLimit",children:s("dashboard:systemLog.clearLimit")}),e.jsx(k,{id:"clearLimit",type:"number",min:"100",max:"10000",value:re,onChange:B=>q(parseInt(B.target.value)||1e3),placeholder:"1000"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("dashboard:systemLog.clearLimitDesc")})]})]}),e.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4 dark:border-amber-900 dark:bg-amber-950/30",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Vn,{className:"h-5 w-5 text-amber-600"}),e.jsx("span",{className:"font-medium text-amber-800 dark:text-amber-200",children:s("dashboard:systemLog.clearPreview")})]}),e.jsxs(G,{variant:"outline",size:"sm",onClick:Yi,disabled:ie,children:[e.jsx(ws,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.getStats")]})]}),na&&$s&&e.jsxs("div",{className:"mt-4 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:systemLog.cutoffDate")}),e.jsx("p",{className:"font-mono text-sm",children:$s.cutoff_date})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s("dashboard:systemLog.totalLogs")}),e.jsx("p",{className:"font-mono text-sm font-medium",children:$s.total_logs.toLocaleString()})]})]}),e.jsxs("div",{className:"rounded-md bg-red-50 p-3 dark:bg-red-950/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Bt,{className:"h-4 w-4 text-red-600"}),e.jsxs("span",{className:"text-sm font-medium text-red-800 dark:text-red-200",children:[s("dashboard:systemLog.willClear"),":",e.jsx("span",{className:"ml-1 font-bold",children:$s.logs_to_clear.toLocaleString()}),s("dashboard:systemLog.logsUnit")]})]}),e.jsx("p",{className:"mt-1 text-xs text-red-600 dark:text-red-300",children:s("dashboard:systemLog.clearWarning")})]})]})]})]}),e.jsxs(Me,{children:[e.jsx(G,{variant:"outline",onClick:()=>{H(!1),Vt(!1),Et(null)},children:s("common:cancel")}),e.jsx(G,{variant:"destructive",onClick:Ji,disabled:ie||!na||!$s,children:ie?e.jsxs(e.Fragment,{children:[e.jsx(Sa,{className:"mr-2 h-4 w-4 animate-spin"}),s("dashboard:systemLog.clearing")]}):e.jsxs(e.Fragment,{children:[e.jsx(us,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.confirmClear")]})})]})]})})]})}function Um(){const{t:s}=M();return e.jsxs(qe,{children:[e.jsxs(Ue,{children:[e.jsx("div",{className:"flex items-center",children:e.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:s("dashboard:title")})}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(cs,{}),e.jsx(es,{}),e.jsx(ss,{})]})]}),e.jsx(We,{children:e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"grid gap-6",children:[e.jsx(Mm,{}),e.jsx(Rm,{}),e.jsx(Om,{}),e.jsx(qm,{})]})})})]})}const Hm=Object.freeze(Object.defineProperty({__proto__:null,default:Um},Symbol.toStringTag,{value:"Module"}));function Km({className:s,items:n,...t}){const{pathname:r}=Dn(),a=Bs(),[i,l]=m.useState(r??"/settings"),d=x=>{l(x),a(x)},{t:u}=M("settings");return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"p-1 md:hidden",children:e.jsxs(J,{value:i,onValueChange:d,children:[e.jsx(W,{className:"h-12 sm:w-48",children:e.jsx(Q,{placeholder:"The Line truncated
`),onChange:f=>{const F=f.target.value.split(`
`).filter(Boolean);c.onChange(F),o(l.getValues())}})}),e.jsx(z,{children:s("safe.form.emailWhitelist.suffixes.description")}),e.jsx(R,{})]})}),e.jsx(v,{control:l.control,name:"captcha_enable",render:({field:c})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{className:"text-base",children:s("safe.form.captcha.enable.label")}),e.jsx(z,{children:s("safe.form.captcha.enable.description")})]}),e.jsx(_,{children:e.jsx(X,{checked:c.value||!1,onCheckedChange:f=>{c.onChange(f),o(l.getValues())}})})]})}),l.watch("captcha_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:l.control,name:"captcha_type",render:({field:c})=>e.jsxs(j,{children:[e.jsx(b,{className:"text-base",children:s("safe.form.captcha.type.label")}),e.jsxs(J,{onValueChange:f=>{c.onChange(f),o(l.getValues())},value:c.value||"recaptcha",children:[e.jsx(_,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:s("safe.form.captcha.type.description")})})}),e.jsxs(Y,{children:[e.jsx(A,{value:"recaptcha",children:s("safe.form.captcha.type.options.recaptcha")}),e.jsx(A,{value:"recaptcha-v3",children:s("safe.form.captcha.type.options.recaptcha-v3")}),e.jsx(A,{value:"turnstile",children:s("safe.form.captcha.type.options.turnstile")})]})]}),e.jsx(z,{children:s("safe.form.captcha.type.description")}),e.jsx(R,{})]})}),l.watch("captcha_type")==="recaptcha"&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:l.control,name:"recaptcha_site_key",render:({field:c})=>e.jsxs(j,{children:[e.jsx(b,{className:"text-base",children:s("safe.form.captcha.recaptcha.siteKey.label")}),e.jsx(_,{children:e.jsx(k,{placeholder:s("safe.form.captcha.recaptcha.siteKey.placeholder"),...c,value:c.value||"",onChange:f=>{c.onChange(f),o(l.getValues())}})}),e.jsx(z,{children:s("safe.form.captcha.recaptcha.siteKey.description")}),e.jsx(R,{})]})}),e.jsx(v,{control:l.control,name:"recaptcha_key",render:({field:c})=>e.jsxs(j,{children:[e.jsx(b,{className:"text-base",children:s("safe.form.captcha.recaptcha.key.label")}),e.jsx(_,{children:e.jsx(k,{placeholder:s("safe.form.captcha.recaptcha.key.placeholder"),...c,value:c.value||"",onChange:f=>{c.onChange(f),o(l.getValues())}})}),e.jsx(z,{children:s("safe.form.captcha.recaptcha.key.description")}),e.jsx(R,{})]})})]}),l.watch("captcha_type")==="recaptcha-v3"&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:l.control,name:"recaptcha_v3_site_key",render:({field:c})=>e.jsxs(j,{children:[e.jsx(b,{className:"text-base",children:s("safe.form.captcha.recaptcha_v3.siteKey.label")}),e.jsx(_,{children:e.jsx(k,{placeholder:s("safe.form.captcha.recaptcha_v3.siteKey.placeholder"),...c,value:c.value||"",onChange:f=>{c.onChange(f),o(l.getValues())}})}),e.jsx(z,{children:s("safe.form.captcha.recaptcha_v3.siteKey.description")}),e.jsx(R,{})]})}),e.jsx(v,{control:l.control,name:"recaptcha_v3_secret_key",render:({field:c})=>e.jsxs(j,{children:[e.jsx(b,{className:"text-base",children:s("safe.form.captcha.recaptcha_v3.secretKey.label")}),e.jsx(_,{children:e.jsx(k,{placeholder:s("safe.form.captcha.recaptcha_v3.secretKey.placeholder"),...c,value:c.value||"",onChange:f=>{c.onChange(f),o(l.getValues())}})}),e.jsx(z,{children:s("safe.form.captcha.recaptcha_v3.secretKey.description")}),e.jsx(R,{})]})}),e.jsx(v,{control:l.control,name:"recaptcha_v3_score_threshold",render:({field:c})=>e.jsxs(j,{children:[e.jsx(b,{className:"text-base",children:s("safe.form.captcha.recaptcha_v3.scoreThreshold.label")}),e.jsx(_,{children:e.jsx(k,{type:"number",step:"0.1",min:"0",max:"1",placeholder:s("safe.form.captcha.recaptcha_v3.scoreThreshold.placeholder"),...c,value:c.value||"",onChange:f=>{c.onChange(f),o(l.getValues())}})}),e.jsx(z,{children:s("safe.form.captcha.recaptcha_v3.scoreThreshold.description")}),e.jsx(R,{})]})})]}),l.watch("captcha_type")==="turnstile"&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:l.control,name:"turnstile_site_key",render:({field:c})=>e.jsxs(j,{children:[e.jsx(b,{className:"text-base",children:s("safe.form.captcha.turnstile.siteKey.label")}),e.jsx(_,{children:e.jsx(k,{placeholder:s("safe.form.captcha.turnstile.siteKey.placeholder"),...c,value:c.value||"",onChange:f=>{c.onChange(f),o(l.getValues())}})}),e.jsx(z,{children:s("safe.form.captcha.turnstile.siteKey.description")}),e.jsx(R,{})]})}),e.jsx(v,{control:l.control,name:"turnstile_secret_key",render:({field:c})=>e.jsxs(j,{children:[e.jsx(b,{className:"text-base",children:s("safe.form.captcha.turnstile.secretKey.label")}),e.jsx(_,{children:e.jsx(k,{placeholder:s("safe.form.captcha.turnstile.secretKey.placeholder"),...c,value:c.value||"",onChange:f=>{c.onChange(f),o(l.getValues())}})}),e.jsx(z,{children:s("safe.form.captcha.turnstile.secretKey.description")}),e.jsx(R,{})]})})]})]}),e.jsx(v,{control:l.control,name:"register_limit_by_ip_enable",render:({field:c})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(b,{className:"text-base",children:s("safe.form.registerLimit.enable.label")}),e.jsx(z,{children:s("safe.form.registerLimit.enable.description")})]}),e.jsx(_, Line truncated
stop=8
0=30-30
1=100-400
2=400-500,c,500-1000`),...g,value:Array.isArray(g.value)?g.value.join(`
`):"",onChange:p=>{const E=p.target.value.split(`
`).filter(P=>P.trim()!=="");g.onChange(E)}})})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{control:d.control,name:"tls.server_name",render:({field:g})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(v,{children:r("dynamic_form.anytls.tls.server_name.label","SNI")}),e.jsx(_,{children:e.jsx(k,{placeholder:r("dynamic_form.anytls.tls.server_name.placeholder","服务器名称"),...g})})]})}),e.jsx(j,{control:d.control,name:"tls.allow_insecure",render:({field:g})=>e.jsxs(f,{children:[e.jsx(v,{children:r("dynamic_form.anytls.tls.allow_insecure","允许不安全连接")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(_,{children:e.jsx(X,{checked:g.value,onCheckedChange:g.onChange})})})]})})]})]})})};return e.jsx(be,{children:C[s]?.()})};function Mx(){const{t:s}=M("server"),n=h.object({start:h.string().min(1,s("form.dynamic_rate.start_time_error")),end:h.string().min(1,s("form.dynamic_rate.end_time_error")),rate:h.string().min(1,s("form.dynamic_rate.multiplier_error")).refine(E=>!isNaN(parseFloat(E))&&isFinite(Number(E)),{message:s("form.dynamic_rate.multiplier_error_numeric")}).refine(E=>parseFloat(E)>=0,{message:s("form.dynamic_rate.multiplier_error_gte_zero")})}),t=h.object({id:h.number().optional().nullable(),specific_key:h.string().optional().nullable(),code:h.string().optional(),show:h.boolean().optional().nullable(),name:h.string().min(1,s("form.name.error")),rate:h.string().min(1,s("form.rate.error")).refine(E=>!isNaN(parseFloat(E))&&isFinite(Number(E)),{message:s("form.rate.error_numeric")}).refine(E=>parseFloat(E)>=0,{message:s("form.rate.error_gte_zero")}),rate_time_enable:h.boolean().default(!1),rate_time_ranges:h.array(n).default([]),tags:h.array(h.string()).default([]),excludes:h.array(h.string()).default([]),ips:h.array(h.string()).default([]),group_ids:h.array(h.string()).default([]),host:h.string().min(1,s("form.host.error")),port:h.string().min(1,s("form.port.error")),server_port:h.string().min(1,s("form.server_port.error")),parent_id:h.string().default("0").nullable(),route_ids:h.array(h.string()).default([]),protocol_settings:h.record(h.any()).default({}).nullable()}),r={id:null,specific_key:null,code:"",show:!1,name:"",rate:"1",rate_time_enable:!1,rate_time_ranges:[],tags:[],excludes:[],ips:[],group_ids:[],host:"",port:"",server_port:"",parent_id:"0",route_ids:[],protocol_settings:null},{isOpen:a,setIsOpen:i,editingServer:l,setEditingServer:d,serverType:u,setServerType:x,refetch:o}=gi(),[c,b]=m.useState([]),[F,S]=m.useState([]),[w,T]=m.useState([]),y=we({resolver:Te(t),defaultValues:r,mode:"onChange"});m.useEffect(()=>{L()},[a]),m.useEffect(()=>{l?.type&&l.type!==u&&x(l.type)},[l,u,x]),m.useEffect(()=>{l?l.type===u&&y.reset({...r,...l}):y.reset({...r,protocol_settings:Oe[u].schema.parse({})})},[l,y,u]);const L=async()=>{if(!a)return;const[E,P,K]=await Promise.all([pt.getList(),qa.getList(),dt.getList()]);b(E.data?.map(Z=>({label:Z.name,value:Z.id.toString()}))||[]),S(P.data?.map(Z=>({label:Z.remarks,value:Z.id.toString()}))||[]),T(K.data||[])},C=m.useMemo(()=>w?.filter(E=>(E.parent_id===0||E.parent_id===null)&&E.type===u&&E.id!==y.watch("id")),[u,w,y]),g=()=>e.jsxs(zs,{children:[e.jsx(Ks,{asChild:!0,children:e.jsxs(D,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(Ke,{icon:"ion:add"}),e.jsx("div",{children:s("form.add_node")})]})}),e.jsx(Ms,{align:"start",children:e.jsx(cm,{children:Ts.map(({type:E,label:P})=>e.jsx(Se,{onClick:()=>{x(E),i(!0)},className:"cursor-pointer",children:e.jsx(U,{variant:"outline",className:"text-white",style:{background:bs[E]},children:P})},E))})})]}),p=()=>{i(!1),d(null),y.reset(r)},V=async()=>{const E=y.getValues();(await dt.save({...E,type:u})).data&&(p(),$.success(s("form.success")),o())};return e.jsxs(de,{open:a,onOpenChange:p,children:[g(),e.jsxs(ce,{className:"sm:max-w-[425px]",children:[e.jsxs(he,{children:[e.jsx(me,{children:s(l?"form.edit_node":"form.new_node")}),e.jsx(Ae,{})]}),e.jsxs(De,{...y,children:[e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{control:y.control,name:"name",render:({field:E})=>e.jsxs(f,{className:"flex-[2]",children:[e.jsx(v,{children:s("form.name.label")}),e.jsx(_,{children:e.jsx(k,{placeholder:s("form.name.placeholder"),...E})}),e.jsx(R,{})]})}),e.jsx(j,{control:y.control,name:"rate",render:({field:E})=>e.jsxs(f,{className:"flex-[1]",children:[e.jsx(v,{children:s("form.rate.label")}),e.jsx("div",{className:"relative flex",children:e.jsx(_,{children:e.jsx(k,{type:"number",min:"0",step:"0.1",...E})})}),e.jsx(R,{})]})})]}),e.jsx(j,{control:y.control,name:"rate_time_enable",render:({field:E})=>e.jsxs(f,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(v,{children:s("form.dynamic_rate.enable_label")}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s("form.dynamic_rate.enable_description")})]}),e.jsx(_,{children:e.jsx(X,{checked:E.value,onCheckedChange:E.onChange Line truncated
`).filter(P=>P.trim()!=="");g.onChange(E)}})})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"tls.server_name",render:({field:g})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(b,{children:r("dynamic_form.anytls.tls.server_name.label","SNI")}),e.jsx(_,{children:e.jsx(k,{placeholder:r("dynamic_form.anytls.tls.server_name.placeholder","服务器名称"),...g})})]})}),e.jsx(v,{control:d.control,name:"tls.allow_insecure",render:({field:g})=>e.jsxs(j,{children:[e.jsx(b,{children:r("dynamic_form.anytls.tls.allow_insecure","允许不安全连接")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(_,{children:e.jsx(X,{checked:g.value,onCheckedChange:g.onChange})})})]})})]})]})})};return e.jsx(be,{children:C[s]?.()})};function Mx(){const{t:s}=M("server"),n=h.object({start:h.string().min(1,s("form.dynamic_rate.start_time_error")),end:h.string().min(1,s("form.dynamic_rate.end_time_error")),rate:h.string().min(1,s("form.dynamic_rate.multiplier_error")).refine(E=>!isNaN(parseFloat(E))&&isFinite(Number(E)),{message:s("form.dynamic_rate.multiplier_error_numeric")}).refine(E=>parseFloat(E)>=0,{message:s("form.dynamic_rate.multiplier_error_gte_zero")})}),t=h.object({id:h.number().optional().nullable(),specific_key:h.string().optional().nullable(),code:h.string().optional(),show:h.boolean().optional().nullable(),name:h.string().min(1,s("form.name.error")),rate:h.string().min(1,s("form.rate.error")).refine(E=>!isNaN(parseFloat(E))&&isFinite(Number(E)),{message:s("form.rate.error_numeric")}).refine(E=>parseFloat(E)>=0,{message:s("form.rate.error_gte_zero")}),rate_time_enable:h.boolean().default(!1),rate_time_ranges:h.array(n).default([]),tags:h.array(h.string()).default([]),excludes:h.array(h.string()).default([]),ips:h.array(h.string()).default([]),group_ids:h.array(h.string()).default([]),host:h.string().min(1,s("form.host.error")),port:h.string().min(1,s("form.port.error")),server_port:h.string().min(1,s("form.server_port.error")),parent_id:h.string().default("0").nullable(),route_ids:h.array(h.string()).default([]),protocol_settings:h.record(h.any()).default({}).nullable()}),r={id:null,specific_key:null,code:"",show:!1,name:"",rate:"1",rate_time_enable:!1,rate_time_ranges:[],tags:[],excludes:[],ips:[],group_ids:[],host:"",port:"",server_port:"",parent_id:"0",route_ids:[],protocol_settings:null},{isOpen:a,setIsOpen:i,editingServer:l,setEditingServer:d,serverType:u,setServerType:x,refetch:o}=gi(),[c,f]=m.useState([]),[F,S]=m.useState([]),[w,T]=m.useState([]),y=we({resolver:Te(t),defaultValues:r,mode:"onChange"});m.useEffect(()=>{L()},[a]),m.useEffect(()=>{l?.type&&l.type!==u&&x(l.type)},[l,u,x]),m.useEffect(()=>{l?l.type===u&&y.reset({...r,...l}):y.reset({...r,protocol_settings:Oe[u].schema.parse({})})},[l,y,u]);const L=async()=>{if(!a)return;const[E,P,K]=await Promise.all([pt.getList(),qa.getList(),dt.getList()]);f(E.data?.map(Z=>({label:Z.name,value:Z.id.toString()}))||[]),S(P.data?.map(Z=>({label:Z.remarks,value:Z.id.toString()}))||[]),T(K.data||[])},C=m.useMemo(()=>w?.filter(E=>(E.parent_id===0||E.parent_id===null)&&E.type===u&&E.id!==y.watch("id")),[u,w,y]),g=()=>e.jsxs(zs,{children:[e.jsx(Ks,{asChild:!0,children:e.jsxs(D,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(Ke,{icon:"ion:add"}),e.jsx("div",{children:s("form.add_node")})]})}),e.jsx(Ms,{align:"start",children:e.jsx(cm,{children:Ts.map(({type:E,label:P})=>e.jsx(Se,{onClick:()=>{x(E),i(!0)},className:"cursor-pointer",children:e.jsx(U,{variant:"outline",className:"text-white",style:{background:bs[E]},children:P})},E))})})]}),p=()=>{i(!1),d(null),y.reset(r)},V=async()=>{const E=y.getValues();(await dt.save({...E,type:u})).data&&(p(),$.success(s("form.success")),o())};return e.jsxs(de,{open:a,onOpenChange:p,children:[g(),e.jsxs(ce,{className:"sm:max-w-[425px]",children:[e.jsxs(he,{children:[e.jsx(me,{children:s(l?"form.edit_node":"form.new_node")}),e.jsx(Ae,{})]}),e.jsxs(De,{...y,children:[e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:y.control,name:"name",render:({field:E})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(b,{children:s("form.name.label")}),e.jsx(_,{children:e.jsx(k,{placeholder:s("form.name.placeholder"),...E})}),e.jsx(R,{})]})}),e.jsx(v,{control:y.control,name:"rate",render:({field:E})=>e.jsxs(j,{className:"flex-[1]",children:[e.jsx(b,{children:s("form.rate.label")}),e.jsx("div",{className:"relative flex",children:e.jsx(_,{children:e.jsx(k,{type:"number",min:"0",step:"0.1",...E})})}),e.jsx(R,{})]})})]}),e.jsx(v,{control:y.control,name:"rate_time_enable",render:({field:E})=>e.jsxs(j,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(b,{children:s("form.dynamic_rate.enable_label")}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s("form.dynamic_rate.enable_description")})]}),e.jsx(_,{children:e.jsx(X,{checked:E.value,onCheckedChange:E.onChange Line truncated
`):"",onChange:x=>{const o=x.target.value.split(`
`);u.onChange(o)}})})}),e.jsx(R,{})]})}),e.jsx(j,{control:i.control,name:"action",render:({field:u})=>e.jsxs(f,{children:[e.jsx(v,{children:a("form.action")}),e.jsx("div",{className:"relative",children:e.jsx(_,{children:e.jsxs(J,{onValueChange:u.onChange,defaultValue:u.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:a("form.actionPlaceholder")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"block",children:a("actions.block")}),e.jsx(A,{value:"dns",children:a("actions.dns")})]})]})})}),e.jsx(R,{})]})}),i.watch("action")==="dns"&&e.jsx(j,{control:i.control,name:"action_value",render:({field:u})=>e.jsxs(f,{children:[e.jsx(v,{children:a("form.dns")}),e.jsx("div",{className:"relative",children:e.jsx(_,{children:e.jsx(k,{type:"text",placeholder:a("form.dnsPlaceholder"),...u})})})]})}),e.jsxs(Me,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(D,{variant:"outline",children:a("form.cancel")})}),e.jsx(D,{type:"submit",onClick:()=>{const u=i.getValues(),x={...u,match:Array.isArray(u.match)?u.match.filter(o=>o.trim()!==""):[]};qa.save(x).then(({data:o})=>{o&&(d(!1),s&&s(),$.success(a(r==="edit"?"messages.updateSuccess":"messages.createSuccess")),i.reset())})},children:a("form.submit")})]})]})]})]})}function Jx({table:s,refetch:n}){const t=s.getState().columnFilters.length>0,{t:r}=M("route");return e.jsx("div",{className:"flex items-center justify-between ",children:e.jsxs("div",{className:"flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-2",children:[e.jsx(pi,{refetch:n}),e.jsx(k,{placeholder:r("toolbar.searchPlaceholder"),value:s.getColumn("remarks")?.getFilterValue()??"",onChange:a=>s.getColumn("remarks")?.setFilterValue(a.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),t&&e.jsxs(D,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[r("toolbar.reset"),e.jsx(os,{className:"ml-2 h-4 w-4"})]})]})})}function Qx({columns:s,data:n,refetch:t}){const[r,a]=m.useState({}),[i,l]=m.useState({}),[d,u]=m.useState([]),[x,o]=m.useState([]),c=Be({data:n,columns:s,state:{sorting:x,columnVisibility:i,rowSelection:r,columnFilters:d},enableRowSelection:!0,onRowSelectionChange:a,onSortingChange:o,onColumnFiltersChange:u,onColumnVisibilityChange:l,getCoreRowModel:Ge(),getFilteredRowModel:hs(),getPaginationRowModel:Ze(),getSortedRowModel:gs(),getFacetedRowModel:Fs(),getFacetedUniqueValues:Ps(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(ts,{table:c,toolbar:b=>e.jsx(Jx,{table:b,refetch:t})})}const Xx=s=>{const{t:n}=M("route"),t={block:{icon:ud,variant:"destructive",className:"bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-800"},dns:{icon:xd,variant:"secondary",className:"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-400 hover:bg-blue-200 dark:hover:bg-blue-800"}};return[{accessorKey:"id",header:({column:r})=>e.jsx(O,{column:r,title:n("columns.id")}),cell:({row:r})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(U,{variant:"outline",children:r.getValue("id")})}),enableSorting:!0,enableHiding:!1},{accessorKey:"remarks",header:({column:r})=>e.jsx(O,{column:r,title:n("columns.remarks")}),cell:({row:r})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium sm:max-w-72 md:max-w-[31rem]",children:r.original.remarks})}),enableHiding:!1,enableSorting:!1},{accessorKey:"action_value",header:({column:r})=>e.jsx(O,{column:r,title:n("columns.action_value.title")}),cell:({row:r})=>{const a=r.original.action,i=r.original.action_value,l=r.original.match?.length||0;return e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx("span",{className:"text-sm font-medium",children:a==="dns"&&i?n("columns.action_value.dns",{value:i}):a==="block"?e.jsx("span",{className:"text-destructive",children:n("columns.action_value.block")}):n("columns.action_value.direct")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:n("columns.matchRules",{count:l})})]})},enableHiding:!1,enableSorting:!1,size:300},{accessorKey:"action",header:({column:r})=>e.jsx(O,{column:r,title:n("columns.action")}),cell:({row:r})=>{const a=r.getValue("action"),i=t[a]?.icon;return e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(U,{variant:t[a]?.variant||"default",className:N("flex items-center gap-1.5 px-3 py-1 capitalize",t[a]?.className),children:[i&&e.jsx(i,{className:"h-3.5 w-3.5"}),n(`actions.${a}`)]})})},enableSorting:!1,size:9e3},{id:"actions",header:()=>e.jsx("div",{className:"text-right",children:n("columns.actions")}),cell:({row:r})=>e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(pi,{defaultValues:r.original,refetch:s,type:"edit",dialogTrigger:e.jsxs(D,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(tt,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:n("form.edit")})]})}),e.jsx(_s,{title:n("messag Line truncated
`)||d("plan.form.submit.error.validation","表单校验失败"))},w=y=>{if(isNaN(y))return;const L=Object.entries(ja).reduce((C,[g,p])=>{const V=y*p.months*p.discount;return{...C,[g]:V.toFixed(2)}},{});u.setValue("prices",L,{shouldDirty:!0})},T=()=>{n(!1),r(null),u.reset(fa)};return e.jsx(de,{open:s,onOpenChange:T,children:e.jsxs(ce,{children:[e.jsxs(he,{children:[e.jsx(me,{children:d(t?"plan.form.edit_title":"plan.form.add_title")}),e.jsx(Ae,{})]}),e.jsx(De,{...u,children:e.jsxs("form",{onSubmit:u.handleSubmit(F,S),children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(j,{control:u.control,name:"name",render:({field:y})=>e.jsxs(f,{children:[e.jsx(v,{children:d("plan.form.name.label")}),e.jsx(_,{children:e.jsx(k,{placeholder:d("plan.form.name.placeholder"),...y})}),e.jsx(R,{})]})}),e.jsx(j,{control:u.control,name:"tags",render:({field:y})=>e.jsxs(f,{children:[e.jsx(v,{children:d("plan.form.tags.label","标签")}),e.jsx(_,{children:e.jsx(Xa,{value:y.value||[],onChange:y.onChange,placeholder:d("plan.form.tags.placeholder","输入标签后按回车确认"),className:"w-full"})}),e.jsx(R,{})]})}),e.jsx(j,{control:u.control,name:"group_id",render:({field:y})=>e.jsxs(f,{children:[e.jsxs(v,{className:"flex items-center justify-between",children:[d("plan.form.group.label"),e.jsx(Za,{dialogTrigger:e.jsx(D,{variant:"link",children:d("plan.form.group.add")}),refetch:b})]}),e.jsxs(J,{value:y.value?.toString()??"",onValueChange:L=>y.onChange(L?Number(L):null),children:[e.jsx(_,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:d("plan.form.group.placeholder")})})}),e.jsx(Y,{children:o?.map(L=>e.jsx(A,{value:L.id.toString(),children:L.name},L.id))})]}),e.jsx(R,{})]})}),e.jsx(j,{control:u.control,name:"transfer_enable",render:({field:y})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(v,{children:d("plan.form.transfer.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(_,{children:e.jsx(k,{type:"number",min:0,placeholder:d("plan.form.transfer.placeholder"),className:"rounded-r-none",...y})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:d("plan.form.transfer.unit")})]}),e.jsx(R,{})]})}),e.jsx(j,{control:u.control,name:"speed_limit",render:({field:y})=>e.jsxs(f,{className:"flex-1",children:[e.jsx(v,{children:d("plan.form.speed.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(_,{children:e.jsx(k,{type:"number",min:0,placeholder:d("plan.form.speed.placeholder"),className:"rounded-r-none",...y,value:y.value??""})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:d("plan.form.speed.unit")})]}),e.jsx(R,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex flex-1 items-center",children:[e.jsx("div",{className:"flex-grow border-t border-gray-200 dark:border-gray-700"}),e.jsx("h3",{className:"mx-4 text-sm font-medium text-gray-500 dark:text-gray-400",children:d("plan.form.price.title")}),e.jsx("div",{className:"flex-grow border-t border-gray-200 dark:border-gray-700"})]}),e.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2",children:e.jsx("span",{className:"text-sm font-medium text-gray-400",children:"¥"})}),e.jsx(k,{type:"number",step:"0.01",placeholder:d("plan.form.price.base_price"),className:"h-7 w-32 border-0 bg-gray-50 pl-6 pr-2 text-sm shadow-none ring-1 ring-gray-200 transition-shadow focus-visible:ring-2 focus-visible:ring-primary dark:bg-gray-800/50 dark:ring-gray-700 dark:placeholder:text-gray-500",onChange:y=>{const L=parseFloat(y.target.value);w(L)}})]}),e.jsx(be,{children:e.jsxs(ge,{children:[e.jsx(pe,{asChild:!0,children:e.jsx(D,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>{const y=Object.keys(ja).reduce((L,C)=>({...L,[C]:""}),{});u.setValue("prices",y,{shouldDirty:!0})},children:d("plan.form.price.clear.button")})}),e.jsx(ue,{side:"top",align:"end",children:e.jsx("p",{className:"text-xs",children:d("plan.form.price.clear.tooltip")})})]})})]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-3",children:Object.entries(ja).filter(([y])=>!["onetime","reset_traffic"].includes(y)).map(([y,L])=>e.jsx("div",{className:"group relative rounded-md bg-card p-2 ring-1 ring-gray-200 transition-all hover:ring-primary dark:ring-gray-800",children:e.jsx(j,{control:u.control,name:`prices.${y}`,render:({field:C})=>e.jsxs(f,{children:[e.jsxs(v,{className:"text-xs font-medium text-muted-foreground",children:[d(`plan.columns.price_period.${y}`),e.jsxs("span",{className:"ml-1 text-[10px] text-gray-400",children:["(",L.months===1?d("plan.form.price.period.monthly"):d("plan.form.price.period.months",{count:L.months}),")"]})]}),e.jsxs("div", Line truncated
`+a("columns.online_status.offline_duration.days",{count:b}):c>0?x+=`
`);u.onChange(o)}})})}),e.jsx(R,{})]})}),e.jsx(v,{control:i.control,name:"action",render:({field:u})=>e.jsxs(j,{children:[e.jsx(b,{children:a("form.action")}),e.jsx("div",{className:"relative",children:e.jsx(_,{children:e.jsxs(J,{onValueChange:u.onChange,defaultValue:u.value,children:[e.jsx(W,{children:e.jsx(Q,{placeholder:a("form.actionPlaceholder")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"block",children:a("actions.block")}),e.jsx(A,{value:"dns",children:a("actions.dns")})]})]})})}),e.jsx(R,{})]})}),i.watch("action")==="dns"&&e.jsx(v,{control:i.control,name:"action_value",render:({field:u})=>e.jsxs(j,{children:[e.jsx(b,{children:a("form.dns")}),e.jsx("div",{className:"relative",children:e.jsx(_,{children:e.jsx(k,{type:"text",placeholder:a("form.dnsPlaceholder"),...u})})})]})}),e.jsxs(Me,{children:[e.jsx(Qs,{asChild:!0,children:e.jsx(D,{variant:"outline",children:a("form.cancel")})}),e.jsx(D,{type:"submit",onClick:()=>{const u=i.getValues(),x={...u,match:Array.isArray(u.match)?u.match.filter(o=>o.trim()!==""):[]};qa.save(x).then(({data:o})=>{o&&(d(!1),s&&s(),$.success(a(r==="edit"?"messages.updateSuccess":"messages.createSuccess")),i.reset())})},children:a("form.submit")})]})]})]})]})}function Jx({table:s,refetch:n}){const t=s.getState().columnFilters.length>0,{t:r}=M("route");return e.jsx("div",{className:"flex items-center justify-between ",children:e.jsxs("div",{className:"flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-2",children:[e.jsx(pi,{refetch:n}),e.jsx(k,{placeholder:r("toolbar.searchPlaceholder"),value:s.getColumn("remarks")?.getFilterValue()??"",onChange:a=>s.getColumn("remarks")?.setFilterValue(a.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),t&&e.jsxs(D,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[r("toolbar.reset"),e.jsx(os,{className:"ml-2 h-4 w-4"})]})]})})}function Qx({columns:s,data:n,refetch:t}){const[r,a]=m.useState({}),[i,l]=m.useState({}),[d,u]=m.useState([]),[x,o]=m.useState([]),c=Be({data:n,columns:s,state:{sorting:x,columnVisibility:i,rowSelection:r,columnFilters:d},enableRowSelection:!0,onRowSelectionChange:a,onSortingChange:o,onColumnFiltersChange:u,onColumnVisibilityChange:l,getCoreRowModel:Ge(),getFilteredRowModel:hs(),getPaginationRowModel:Ze(),getSortedRowModel:gs(),getFacetedRowModel:Fs(),getFacetedUniqueValues:Ps(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(ts,{table:c,toolbar:f=>e.jsx(Jx,{table:f,refetch:t})})}const Xx=s=>{const{t:n}=M("route"),t={block:{icon:ud,variant:"destructive",className:"bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-800"},dns:{icon:xd,variant:"secondary",className:"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-400 hover:bg-blue-200 dark:hover:bg-blue-800"}};return[{accessorKey:"id",header:({column:r})=>e.jsx(O,{column:r,title:n("columns.id")}),cell:({row:r})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(U,{variant:"outline",children:r.getValue("id")})}),enableSorting:!0,enableHiding:!1},{accessorKey:"remarks",header:({column:r})=>e.jsx(O,{column:r,title:n("columns.remarks")}),cell:({row:r})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium sm:max-w-72 md:max-w-[31rem]",children:r.original.remarks})}),enableHiding:!1,enableSorting:!1},{accessorKey:"action_value",header:({column:r})=>e.jsx(O,{column:r,title:n("columns.action_value.title")}),cell:({row:r})=>{const a=r.original.action,i=r.original.action_value,l=r.original.match?.length||0;return e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx("span",{className:"text-sm font-medium",children:a==="dns"&&i?n("columns.action_value.dns",{value:i}):a==="block"?e.jsx("span",{className:"text-destructive",children:n("columns.action_value.block")}):n("columns.action_value.direct")}),e.jsx("span",{className:"text-xs text-muted-foreground",children:n("columns.matchRules",{count:l})})]})},enableHiding:!1,enableSorting:!1,size:300},{accessorKey:"action",header:({column:r})=>e.jsx(O,{column:r,title:n("columns.action")}),cell:({row:r})=>{const a=r.getValue("action"),i=t[a]?.icon;return e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(U,{variant:t[a]?.variant||"default",className:N("flex items-center gap-1.5 px-3 py-1 capitalize",t[a]?.className),children:[i&&e.jsx(i,{className:"h-3.5 w-3.5"}),n(`actions.${a}`)]})})},enableSorting:!1,size:9e3},{id:"actions",header:()=>e.jsx("div",{className:"text-right",children:n("columns.actions")}),cell:({row:r})=>e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(pi,{defaultValues:r.original,refetch:s,type:"edit",dialogTrigger:e.jsxs(D,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(tt,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:n("form.edit")})]})}),e.jsx(_s,{title:n("messag Line truncated
`)||d("plan.form.submit.error.validation","表单校验失败"))},w=y=>{if(isNaN(y))return;const L=Object.entries(ja).reduce((C,[g,p])=>{const V=y*p.months*p.discount;return{...C,[g]:V.toFixed(2)}},{});u.setValue("prices",L,{shouldDirty:!0})},T=()=>{n(!1),r(null),u.reset(fa)};return e.jsx(de,{open:s,onOpenChange:T,children:e.jsxs(ce,{children:[e.jsxs(he,{children:[e.jsx(me,{children:d(t?"plan.form.edit_title":"plan.form.add_title")}),e.jsx(Ae,{})]}),e.jsx(De,{...u,children:e.jsxs("form",{onSubmit:u.handleSubmit(F,S),children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{control:u.control,name:"name",render:({field:y})=>e.jsxs(j,{children:[e.jsx(b,{children:d("plan.form.name.label")}),e.jsx(_,{children:e.jsx(k,{placeholder:d("plan.form.name.placeholder"),...y})}),e.jsx(R,{})]})}),e.jsx(v,{control:u.control,name:"tags",render:({field:y})=>e.jsxs(j,{children:[e.jsx(b,{children:d("plan.form.tags.label","标签")}),e.jsx(_,{children:e.jsx(Xa,{value:y.value||[],onChange:y.onChange,placeholder:d("plan.form.tags.placeholder","输入标签后按回车确认"),className:"w-full"})}),e.jsx(R,{})]})}),e.jsx(v,{control:u.control,name:"group_id",render:({field:y})=>e.jsxs(j,{children:[e.jsxs(b,{className:"flex items-center justify-between",children:[d("plan.form.group.label"),e.jsx(Za,{dialogTrigger:e.jsx(D,{variant:"link",children:d("plan.form.group.add")}),refetch:f})]}),e.jsxs(J,{value:y.value?.toString()??"",onValueChange:L=>y.onChange(L?Number(L):null),children:[e.jsx(_,{children:e.jsx(W,{children:e.jsx(Q,{placeholder:d("plan.form.group.placeholder")})})}),e.jsx(Y,{children:o?.map(L=>e.jsx(A,{value:L.id.toString(),children:L.name},L.id))})]}),e.jsx(R,{})]})}),e.jsx(v,{control:u.control,name:"transfer_enable",render:({field:y})=>e.jsxs(j,{className:"flex-1",children:[e.jsx(b,{children:d("plan.form.transfer.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(_,{children:e.jsx(k,{type:"number",min:0,placeholder:d("plan.form.transfer.placeholder"),className:"rounded-r-none",...y})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:d("plan.form.transfer.unit")})]}),e.jsx(R,{})]})}),e.jsx(v,{control:u.control,name:"speed_limit",render:({field:y})=>e.jsxs(j,{className:"flex-1",children:[e.jsx(b,{children:d("plan.form.speed.label")}),e.jsxs("div",{className:"relative flex",children:[e.jsx(_,{children:e.jsx(k,{type:"number",min:0,placeholder:d("plan.form.speed.placeholder"),className:"rounded-r-none",...y,value:y.value??""})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:d("plan.form.speed.unit")})]}),e.jsx(R,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex flex-1 items-center",children:[e.jsx("div",{className:"flex-grow border-t border-gray-200 dark:border-gray-700"}),e.jsx("h3",{className:"mx-4 text-sm font-medium text-gray-500 dark:text-gray-400",children:d("plan.form.price.title")}),e.jsx("div",{className:"flex-grow border-t border-gray-200 dark:border-gray-700"})]}),e.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2",children:e.jsx("span",{className:"text-sm font-medium text-gray-400",children:"¥"})}),e.jsx(k,{type:"number",step:"0.01",placeholder:d("plan.form.price.base_price"),className:"h-7 w-32 border-0 bg-gray-50 pl-6 pr-2 text-sm shadow-none ring-1 ring-gray-200 transition-shadow focus-visible:ring-2 focus-visible:ring-primary dark:bg-gray-800/50 dark:ring-gray-700 dark:placeholder:text-gray-500",onChange:y=>{const L=parseFloat(y.target.value);w(L)}})]}),e.jsx(be,{children:e.jsxs(ge,{children:[e.jsx(pe,{asChild:!0,children:e.jsx(D,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>{const y=Object.keys(ja).reduce((L,C)=>({...L,[C]:""}),{});u.setValue("prices",y,{shouldDirty:!0})},children:d("plan.form.price.clear.button")})}),e.jsx(ue,{side:"top",align:"end",children:e.jsx("p",{className:"text-xs",children:d("plan.form.price.clear.tooltip")})})]})})]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-3",children:Object.entries(ja).filter(([y])=>!["onetime","reset_traffic"].includes(y)).map(([y,L])=>e.jsx("div",{className:"group relative rounded-md bg-card p-2 ring-1 ring-gray-200 transition-all hover:ring-primary dark:ring-gray-800",children:e.jsx(v,{control:u.control,name:`prices.${y}`,render:({field:C})=>e.jsxs(j,{children:[e.jsxs(b,{className:"text-xs font-medium text-muted-foreground",children:[d(`plan.columns.price_period.${y}`),e.jsxs("span",{className:"ml-1 text-[10px] text-gray-400",children:["(",L.months===1?d("plan.form.price.period.monthly"):d("plan.form.price.period.months",{count:L.months}),")"]})]}),e.jsxs("div", Line truncated
`+a("columns.online_status.offline_duration.days",{count:f}):c>0?x+=`
`+a("columns.online_status.offline_duration.hours",{count:c}):o>0?x+=`
`+a("columns.online_status.offline_duration.minutes",{count:o}):x+=`
`+a("columns.online_status.offline_duration.seconds",{count:u})}return e.jsx(be,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:N("size-2.5 rounded-full ring-2 ring-offset-2",d?"bg-green-500 ring-green-500/20":"bg-gray-300 ring-gray-300/20","transition-all duration-300")}),e.jsx("span",{className:"font-medium text-foreground/90",children:i.original.email})]})}),e.jsx(ue,{side:"bottom",className:"max-w-[280px]",children:e.jsx("p",{className:"whitespace-pre-line text-sm",children:x})})]})})},enableSorting:!1,enableHiding:!1},{accessorKey:"online_count",header:({column:i})=>e.jsx(O,{column:i,title:a("columns.online_count")}),cell:({row:i})=>{const l=i.original.device_limit,d=i.original.online_count||0;return e.jsx(be,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(pe,{children:e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsxs(U,{variant:"outline",className:N("min-w-[4rem] justify-center",l!==null&&d>=l?"border-destructive/50 bg-destructive/10 text-destructive":"border-primary/40 bg-primary/5 text-primary/90"),children:[d," / ",l===null?"∞":l]})})}),e.jsx(ue,{side:"bottom",children:e.jsx("p",{className:"text-sm",children:l===null?a("columns.device_limit.unlimited"):a("columns.device_limit.limited",{count:l})})})]})})},enableSorting:!0,enableHiding:!1},{accessorKey:"banned",header:({column:i})=>e.jsx(O,{column:i,title:a("columns.status")}),cell:({row:i})=>{const l=i.original.banned;return e.jsx("div",{className:"flex justify-center",children:e.jsx(U,{className:N("min-w-20 justify-center transition-colors",l?"bg-destructive/15 text-destructive hover:bg-destructive/25":"bg-success/15 text-success hover:bg-success/25"),children:a(l?"columns.status_text.banned":"columns.status_text.normal")})})},enableSorting:!0,filterFn:(i,l,d)=>d.includes(i.getValue(l))},{accessorKey:"plan_id",header:({column:i})=>e.jsx(O,{column:i,title:a("columns.subscription")}),cell:({row:i})=>e.jsx("div",{className:"min-w-[10em] break-all",children:i.original?.plan?.name||"-"}),enableSorting:!1,enableHiding:!1},{accessorKey:"group_id",header:({column:i})=>e.jsx(O,{column:i,title:a("columns.group")}),cell:({row:i})=>e.jsx("div",{className:"flex flex-wrap gap-1",children:e.jsx(U,{variant:"outline",className:N("px-2 py-0.5 font-medium","bg-secondary/50 hover:bg-secondary/70","border border-border/50","transition-all duration-200","cursor-default select-none","flex items-center gap-1.5 whitespace-nowrap"),children:i.original?.group?.name||"-"})}),enableSorting:!1},{accessorKey:"total_used",header:({column:i})=>e.jsx(O,{column:i,title:a("columns.used_traffic")}),cell:({row:i})=>{const l=ze(i.original?.total_used),d=ze(i.original?.transfer_enable),u=i.original?.total_used/i.original?.transfer_enable*100||0;return e.jsx(be,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(pe,{className:"w-full",children:e.jsxs("div",{className:"w-full space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:l}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[u.toFixed(1),"%"]})]}),e.jsx("div",{className:"h-1.5 w-full rounded-full bg-secondary",children:e.jsx("div",{className:N("h-full rounded-full transition-all",u>90?"bg-destructive":"bg-primary"),style:{width:`${Math.min(u,100)}%`}})})]})}),e.jsx(ue,{side:"bottom",children:e.jsxs("p",{className:"text-sm",children:[a("columns.total_traffic"),": ",d]})})]})})}},{accessorKey:"transfer_enable",header:({column:i})=>e.jsx(O,{column:i,title:a("columns.total_traffic")}),cell:({row:i})=>e.jsx("div",{className:"font-medium text-muted-foreground",children:ze(i.original?.transfer_enable)})},{accessorKey:"expired_at",header:({column:i})=>e.jsx(O,{column:i,title:a("columns.expire_time")}),cell:({row:i})=>{const l=i.original.expired_at,d=Date.now()/1e3,u=l!=null&&l<d,x=l!=null?new Date(l*1e3):null,o=x!=null?Math.ceil((x.getTime()-Date.now())/(1e3*60*60*24)):null;return e.jsx(be,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(pe,{className:"block w-full",children:e.jsx(U,{variant:"outline",className:N("w-full justify-center transition-colors",u?"border-destructive/50 bg-destructive/10 text-destructive":l?"border-success/50 bg-success/10 text-success":"border-primary/40 bg-primary/5 text-primary/90"),children:l==null?a("columns.expire_status.permanent"):oe(l,"YYYY-MM-DD")})}),e.jsx(ue,{side:"bottom",className:"space-y-1 p-3",children:l!=null?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[a("columns.expire_time"),": ",oe(l)]}),e.jsx("p",{className:N("text-sm font-medium",u?"text-destructive":"text-success"),children:u?a("columns.expire_status.expired",{days:Math.abs(o??0)}):a("columns.expire_status.remaining",{days:o??0})})]}):e.jsx("p",{className:"text-sm font-medium",children:a("columns.expire_status.permanent")})})]})})}},{accessorKey:"bal Line truncated
`),p=new Blob([g],{type:"text/csv;charset=utf-8;"}),V=document.createElement("a"),E=URL.createObjectURL(p);V.setAttribute("href",E),V.setAttribute("download",`traffic-reset-logs-${Re(new Date,"yyyy-MM-dd")}.csv`),V.style.visibility="hidden",document.body.appendChild(V),V.click(),document.body.removeChild(V),$.success(t("traffic_reset_logs.actions.export_success"))}catch(w){console.error("导出失败:",w),$.error(t("traffic_reset_logs.actions.export_failed"))}finally{x(!1)}},S=()=>e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.search_user")}),e.jsx(k,{placeholder:t("traffic_reset_logs.filters.search_user"),value:s.getColumn("user_email")?.getFilterValue()??"",onChange:w=>s.getColumn("user_email")?.setFilterValue(w.target.value),className:"h-9"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.reset_type")}),e.jsxs(J,{value:s.getColumn("reset_type")?.getFilterValue()??"",onValueChange:w=>s.getColumn("reset_type")?.setFilterValue(w==="all"?"":w),children:[e.jsx(W,{className:"h-9",children:e.jsx(Q,{placeholder:t("traffic_reset_logs.filters.reset_type")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"all",children:t("traffic_reset_logs.filters.all_types")}),o.map(w=>e.jsx(A,{value:w.value,children:w.label},w.value))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.trigger_source")}),e.jsxs(J,{value:s.getColumn("trigger_source")?.getFilterValue()??"",onValueChange:w=>s.getColumn("trigger_source")?.setFilterValue(w==="all"?"":w),children:[e.jsx(W,{className:"h-9",children:e.jsx(Q,{placeholder:t("traffic_reset_logs.filters.trigger_source")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"all",children:t("traffic_reset_logs.filters.all_sources")}),c.map(w=>e.jsx(A,{value:w.value,children:w.label},w.value))]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.start_date")}),e.jsxs(ls,{children:[e.jsx(is,{asChild:!0,children:e.jsxs(D,{variant:"outline",className:N("h-9 w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[e.jsx(ws,{className:"mr-2 h-4 w-4"}),a?Re(a,"MM-dd"):t("traffic_reset_logs.filters.start_date")]})}),e.jsx(Xe,{className:"w-auto p-0",align:"start",children:e.jsx(Cs,{mode:"single",selected:a,onSelect:i,initialFocus:!0})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.end_date")}),e.jsxs(ls,{children:[e.jsx(is,{asChild:!0,children:e.jsxs(D,{variant:"outline",className:N("h-9 w-full justify-start text-left font-normal",!l&&"text-muted-foreground"),children:[e.jsx(ws,{className:"mr-2 h-4 w-4"}),l?Re(l,"MM-dd"):t("traffic_reset_logs.filters.end_date")]})}),e.jsx(Xe,{className:"w-auto p-0",align:"start",children:e.jsx(Cs,{mode:"single",selected:l,onSelect:d,initialFocus:!0})})]})]})]}),(a||l)&&e.jsxs(D,{variant:"outline",className:"w-full",onClick:b,children:[e.jsx(cr,{className:"mr-2 h-4 w-4"}),t("traffic_reset_logs.filters.apply_date")]}),r&&e.jsxs(D,{variant:"ghost",onClick:()=>{s.resetColumnFilters(),i(void 0),d(void 0)},className:"w-full",children:[t("traffic_reset_logs.filters.reset"),e.jsx(os,{className:"ml-2 h-4 w-4"})]})]});return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between md:hidden",children:[e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(Gn,{children:[e.jsx(Ci,{asChild:!0,children:e.jsxs(D,{variant:"outline",size:"sm",className:"h-8",children:[e.jsx(wd,{className:"mr-2 h-4 w-4"}),t("traffic_reset_logs.filters.reset_type"),r&&e.jsx("div",{className:"ml-1 flex h-4 w-4 items-center justify-center rounded-full bg-primary text-xs text-primary-foreground",children:s.getState().columnFilters.length})]})}),e.jsxs(en,{side:"bottom",className:"h-[85vh]",children:[e.jsxs(sn,{className:"mb-4",children:[e.jsx(tn,{children:t("traffic_reset_logs.filters.filter_title")}),e.jsx(an,{children:t("traffic_reset_logs.filters.filter_description")})]}),e.jsx("div",{className:"max-h-[calc(85vh-120px)] overflow-y-auto",children:e.jsx(S,{})})]})]})}),e.jsxs(D,{variant:"outline",size:"sm",className:"h-8",onClick:F,disabled:u,children:[e.jsx(Zt,{className:"mr-2 h-4 w-4"}),t(u?"traffic_reset_logs.actions.exporting":"traffic_reset_logs.actions.export")]})]}),e.jsxs("div",{className:"hidden items-center justify-between md:flex",children:[e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[e.jsx(k,{placeholder:t("traffic_reset_logs.filters.search_user"),value:s.getColumn("user_email")?.getFilterValue()??"",onChange:w=>s.getColumn("user_email")?.setFilterValue(w.target.valu Line truncated
`+a("columns.online_status.offline_duration.seconds",{count:u})}return e.jsx(be,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:N("size-2.5 rounded-full ring-2 ring-offset-2",d?"bg-green-500 ring-green-500/20":"bg-gray-300 ring-gray-300/20","transition-all duration-300")}),e.jsx("span",{className:"font-medium text-foreground/90",children:i.original.email})]})}),e.jsx(ue,{side:"bottom",className:"max-w-[280px]",children:e.jsx("p",{className:"whitespace-pre-line text-sm",children:x})})]})})},enableSorting:!1,enableHiding:!1},{accessorKey:"online_count",header:({column:i})=>e.jsx(O,{column:i,title:a("columns.online_count")}),cell:({row:i})=>{const l=i.original.device_limit,d=i.original.online_count||0;return e.jsx(be,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(pe,{children:e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsxs(U,{variant:"outline",className:N("min-w-[4rem] justify-center",l!==null&&d>=l?"border-destructive/50 bg-destructive/10 text-destructive":"border-primary/40 bg-primary/5 text-primary/90"),children:[d," / ",l===null?"∞":l]})})}),e.jsx(ue,{side:"bottom",children:e.jsx("p",{className:"text-sm",children:l===null?a("columns.device_limit.unlimited"):a("columns.device_limit.limited",{count:l})})})]})})},enableSorting:!0,enableHiding:!1},{accessorKey:"banned",header:({column:i})=>e.jsx(O,{column:i,title:a("columns.status")}),cell:({row:i})=>{const l=i.original.banned;return e.jsx("div",{className:"flex justify-center",children:e.jsx(U,{className:N("min-w-20 justify-center transition-colors",l?"bg-destructive/15 text-destructive hover:bg-destructive/25":"bg-success/15 text-success hover:bg-success/25"),children:a(l?"columns.status_text.banned":"columns.status_text.normal")})})},enableSorting:!0,filterFn:(i,l,d)=>d.includes(i.getValue(l))},{accessorKey:"plan_id",header:({column:i})=>e.jsx(O,{column:i,title:a("columns.subscription")}),cell:({row:i})=>e.jsx("div",{className:"min-w-[10em] break-all",children:i.original?.plan?.name||"-"}),enableSorting:!1,enableHiding:!1},{accessorKey:"group_id",header:({column:i})=>e.jsx(O,{column:i,title:a("columns.group")}),cell:({row:i})=>e.jsx("div",{className:"flex flex-wrap gap-1",children:e.jsx(U,{variant:"outline",className:N("px-2 py-0.5 font-medium","bg-secondary/50 hover:bg-secondary/70","border border-border/50","transition-all duration-200","cursor-default select-none","flex items-center gap-1.5 whitespace-nowrap"),children:i.original?.group?.name||"-"})}),enableSorting:!1},{accessorKey:"total_used",header:({column:i})=>e.jsx(O,{column:i,title:a("columns.used_traffic")}),cell:({row:i})=>{const l=ze(i.original?.total_used),d=ze(i.original?.transfer_enable),u=i.original?.total_used/i.original?.transfer_enable*100||0;return e.jsx(be,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(pe,{className:"w-full",children:e.jsxs("div",{className:"w-full space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:l}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[u.toFixed(1),"%"]})]}),e.jsx("div",{className:"h-1.5 w-full rounded-full bg-secondary",children:e.jsx("div",{className:N("h-full rounded-full transition-all",u>90?"bg-destructive":"bg-primary"),style:{width:`${Math.min(u,100)}%`}})})]})}),e.jsx(ue,{side:"bottom",children:e.jsxs("p",{className:"text-sm",children:[a("columns.total_traffic"),": ",d]})})]})})}},{accessorKey:"transfer_enable",header:({column:i})=>e.jsx(O,{column:i,title:a("columns.total_traffic")}),cell:({row:i})=>e.jsx("div",{className:"font-medium text-muted-foreground",children:ze(i.original?.transfer_enable)})},{accessorKey:"expired_at",header:({column:i})=>e.jsx(O,{column:i,title:a("columns.expire_time")}),cell:({row:i})=>{const l=i.original.expired_at,d=Date.now()/1e3,u=l!=null&&l<d,x=l!=null?new Date(l*1e3):null,o=x!=null?Math.ceil((x.getTime()-Date.now())/(1e3*60*60*24)):null;return e.jsx(be,{delayDuration:100,children:e.jsxs(ge,{children:[e.jsx(pe,{className:"block w-full",children:e.jsx(U,{variant:"outline",className:N("w-full justify-center transition-colors",u?"border-destructive/50 bg-destructive/10 text-destructive":l?"border-success/50 bg-success/10 text-success":"border-primary/40 bg-primary/5 text-primary/90"),children:l==null?a("columns.expire_status.permanent"):oe(l,"YYYY-MM-DD")})}),e.jsx(ue,{side:"bottom",className:"space-y-1 p-3",children:l!=null?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[a("columns.expire_time"),": ",oe(l)]}),e.jsx("p",{className:N("text-sm font-medium",u?"text-destructive":"text-success"),children:u?a("columns.expire_status.expired",{days:Math.abs(o??0)}):a("columns.expire_status.remaining",{days:o??0})})]}):e.jsx("p",{className:"text-sm font-medium",children:a("columns.expire_status.permanent")})})]})})}},{accessorKey:"bal Line truncated
`),p=new Blob([g],{type:"text/csv;charset=utf-8;"}),V=document.createElement("a"),E=URL.createObjectURL(p);V.setAttribute("href",E),V.setAttribute("download",`traffic-reset-logs-${Re(new Date,"yyyy-MM-dd")}.csv`),V.style.visibility="hidden",document.body.appendChild(V),V.click(),document.body.removeChild(V),$.success(t("traffic_reset_logs.actions.export_success"))}catch(w){console.error("导出失败:",w),$.error(t("traffic_reset_logs.actions.export_failed"))}finally{x(!1)}},S=()=>e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.search_user")}),e.jsx(k,{placeholder:t("traffic_reset_logs.filters.search_user"),value:s.getColumn("user_email")?.getFilterValue()??"",onChange:w=>s.getColumn("user_email")?.setFilterValue(w.target.value),className:"h-9"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.reset_type")}),e.jsxs(J,{value:s.getColumn("reset_type")?.getFilterValue()??"",onValueChange:w=>s.getColumn("reset_type")?.setFilterValue(w==="all"?"":w),children:[e.jsx(W,{className:"h-9",children:e.jsx(Q,{placeholder:t("traffic_reset_logs.filters.reset_type")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"all",children:t("traffic_reset_logs.filters.all_types")}),o.map(w=>e.jsx(A,{value:w.value,children:w.label},w.value))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.trigger_source")}),e.jsxs(J,{value:s.getColumn("trigger_source")?.getFilterValue()??"",onValueChange:w=>s.getColumn("trigger_source")?.setFilterValue(w==="all"?"":w),children:[e.jsx(W,{className:"h-9",children:e.jsx(Q,{placeholder:t("traffic_reset_logs.filters.trigger_source")})}),e.jsxs(Y,{children:[e.jsx(A,{value:"all",children:t("traffic_reset_logs.filters.all_sources")}),c.map(w=>e.jsx(A,{value:w.value,children:w.label},w.value))]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.start_date")}),e.jsxs(ls,{children:[e.jsx(is,{asChild:!0,children:e.jsxs(D,{variant:"outline",className:N("h-9 w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[e.jsx(ws,{className:"mr-2 h-4 w-4"}),a?Re(a,"MM-dd"):t("traffic_reset_logs.filters.start_date")]})}),e.jsx(Xe,{className:"w-auto p-0",align:"start",children:e.jsx(Cs,{mode:"single",selected:a,onSelect:i,initialFocus:!0})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:t("traffic_reset_logs.filters.end_date")}),e.jsxs(ls,{children:[e.jsx(is,{asChild:!0,children:e.jsxs(D,{variant:"outline",className:N("h-9 w-full justify-start text-left font-normal",!l&&"text-muted-foreground"),children:[e.jsx(ws,{className:"mr-2 h-4 w-4"}),l?Re(l,"MM-dd"):t("traffic_reset_logs.filters.end_date")]})}),e.jsx(Xe,{className:"w-auto p-0",align:"start",children:e.jsx(Cs,{mode:"single",selected:l,onSelect:d,initialFocus:!0})})]})]})]}),(a||l)&&e.jsxs(D,{variant:"outline",className:"w-full",onClick:f,children:[e.jsx(cr,{className:"mr-2 h-4 w-4"}),t("traffic_reset_logs.filters.apply_date")]}),r&&e.jsxs(D,{variant:"ghost",onClick:()=>{s.resetColumnFilters(),i(void 0),d(void 0)},className:"w-full",children:[t("traffic_reset_logs.filters.reset"),e.jsx(os,{className:"ml-2 h-4 w-4"})]})]});return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between md:hidden",children:[e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(Gn,{children:[e.jsx(Ci,{asChild:!0,children:e.jsxs(D,{variant:"outline",size:"sm",className:"h-8",children:[e.jsx(wd,{className:"mr-2 h-4 w-4"}),t("traffic_reset_logs.filters.reset_type"),r&&e.jsx("div",{className:"ml-1 flex h-4 w-4 items-center justify-center rounded-full bg-primary text-xs text-primary-foreground",children:s.getState().columnFilters.length})]})}),e.jsxs(en,{side:"bottom",className:"h-[85vh]",children:[e.jsxs(sn,{className:"mb-4",children:[e.jsx(tn,{children:t("traffic_reset_logs.filters.filter_title")}),e.jsx(an,{children:t("traffic_reset_logs.filters.filter_description")})]}),e.jsx("div",{className:"max-h-[calc(85vh-120px)] overflow-y-auto",children:e.jsx(S,{})})]})]})}),e.jsxs(D,{variant:"outline",size:"sm",className:"h-8",onClick:F,disabled:u,children:[e.jsx(Zt,{className:"mr-2 h-4 w-4"}),t(u?"traffic_reset_logs.actions.exporting":"traffic_reset_logs.actions.export")]})]}),e.jsxs("div",{className:"hidden items-center justify-between md:flex",children:[e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[e.jsx(k,{placeholder:t("traffic_reset_logs.filters.search_user"),value:s.getColumn("user_email")?.getFilterValue()??"",onChange:w=>s.getColumn("user_email")?.setFilterValue(w.target.valu Line truncated
-3
View File
@@ -30,7 +30,6 @@ Route::get('/', function (Request $request) {
$themeService = new ThemeService();
try {
// 检查主题是否存在,不存在则尝试切换到默认主题
if (!$themeService->exists($theme)) {
if ($theme !== 'Xboard') {
Log::warning('Theme not found, switching to default theme', ['theme' => $theme]);
@@ -40,12 +39,10 @@ Route::get('/', function (Request $request) {
$themeService->switch($theme);
}
// 检查主题视图文件是否存在
if (!$themeService->getThemeViewPath($theme)) {
throw new Exception('主题视图文件不存在');
}
// 检查主题是否已复制到public目录
$publicThemePath = public_path('theme/' . $theme);
if (!File::exists($publicThemePath)) {
$themePath = $themeService->getThemePath($theme);
+1 -1
View File
@@ -1 +1 @@
(function(e){function t(t){for(var r,a,s=t[0],c=t[1],u=t[2],f=0,p=[];f<s.length;f++)a=s[f],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&p.push(o[a][0]),o[a]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(e[r]=c[r]);l&&l(t);while(p.length)p.shift()();return i.push.apply(i,u||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,s=1;s<n.length;s++){var c=n[s];0!==o[c]&&(r=!1)}r&&(i.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},o={1:0},i=[];function a(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="./";var s=window["webpackJsonp"]=window["webpackJsonp"]||[],c=s.push.bind(s);s.push=t,s=s.slice();for(var u=0;u<s.length;u++)t(s[u]);var l=c;i.push([1,2,0]),n()})({"+0iv":function(e,t,n){"use strict";var r=n("qDJ8");function o(e){return!0===r(e)&&"[object Object]"===Object.prototype.toString.call(e)}e.exports=function(e){var t,n;return!1!==o(e)&&(t=e.constructor,"function"===typeof t&&(n=t.prototype,!1!==o(n)&&!1!==n.hasOwnProperty("isPrototypeOf")))}},"+80P":function(e,t,n){"use strict";function r(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function o(e){return Object.prototype.toString.call(e)}function i(e){return"[object String]"===o(e)}function a(e){return"[object Object]"===o(e)}function s(e){return"[object RegExp]"===o(e)}function c(e){return"[object Function]"===o(e)}function u(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var l={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function f(e){return Object.keys(e||{}).reduce(function(e,t){return e||l.hasOwnProperty(t)},!1)}var p={"http:":{validate:function(e,t,n){var r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){var r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&":"===e[t-3]?0:t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},d="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",h="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function m(e){e.__index__=-1,e.__text_cache__=""}function v(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function y(){return function(e,t){t.normalize(e)}}function g(e){var t=e.re=n("sRdV")(e.__opts__),r=e.__tlds__.slice();function o(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||r.push(d),r.push(t.src_xn),t.src_tlds=r.join("|"),t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");var l=[];function f(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach(function(t){var n=e.__schemas__[t];if(null!==n){var r={validate:null,link:null};if(e.__compiled__[t]=r,a(n))return s(n.validate)?r.validate=v(n.validate):c(n.validate)?r.validate=n.validate:f(t,n),void(c(n.normalize)?r.normalize=n.normalize:n.normalize?f(t,n):r.normalize=y());i(n)?l.push(t):f(t,n)}}),l.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[""]={validate:null,normalize:y()};var p=Object.keys(e.__compiled__).fiLine truncated
(function(e){function t(t){for(var r,a,s=t[0],c=t[1],u=t[2],f=0,p=[];f<s.length;f++)a=s[f],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&p.push(o[a][0]),o[a]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(e[r]=c[r]);l&&l(t);while(p.length)p.shift()();return i.push.apply(i,u||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,s=1;s<n.length;s++){var c=n[s];0!==o[c]&&(r=!1)}r&&(i.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},o={1:0},i=[];function a(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="./";var s=window["webpackJsonp"]=window["webpackJsonp"]||[],c=s.push.bind(s);s.push=t,s=s.slice();for(var u=0;u<s.length;u++)t(s[u]);var l=c;i.push([1,2,0]),n()})({"+0iv":function(e,t,n){"use strict";var r=n("qDJ8");function o(e){return!0===r(e)&&"[object Object]"===Object.prototype.toString.call(e)}e.exports=function(e){var t,n;return!1!==o(e)&&(t=e.constructor,"function"===typeof t&&(n=t.prototype,!1!==o(n)&&!1!==n.hasOwnProperty("isPrototypeOf")))}},"+80P":function(e,t,n){"use strict";function r(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function o(e){return Object.prototype.toString.call(e)}function i(e){return"[object String]"===o(e)}function a(e){return"[object Object]"===o(e)}function s(e){return"[object RegExp]"===o(e)}function c(e){return"[object Function]"===o(e)}function u(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var l={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function f(e){return Object.keys(e||{}).reduce(function(e,t){return e||l.hasOwnProperty(t)},!1)}var p={"http:":{validate:function(e,t,n){var r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){var r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&":"===e[t-3]?0:t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},d="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",h="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function m(e){e.__index__=-1,e.__text_cache__=""}function v(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function y(){return function(e,t){t.normalize(e)}}function g(e){var t=e.re=n("sRdV")(e.__opts__),r=e.__tlds__.slice();function o(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||r.push(d),r.push(t.src_xn),t.src_tlds=r.join("|"),t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");var l=[];function f(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach(function(t){var n=e.__schemas__[t];if(null!==n){var r={validate:null,link:null};if(e.__compiled__[t]=r,a(n))return s(n.validate)?r.validate=v(n.validate):c(n.validate)?r.validate=n.validate:f(t,n),void(c(n.normalize)?r.normalize=n.normalize:n.normalize?f(t,n):r.normalize=y());i(n)?l.push(t):f(t,n)}}),l.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[""]={validate:null,normalize:y()};var p=Object.keys(e.__compiled__).fiLine truncated