@@ -1,20 +1,20 @@
import { r as m , j as e , t as Oi , c as zi , I as Yt , a as it , S as vn , u as As , b as $i , d as bn , R as Nr , e as _r , f as Ai , F as qi , C as Hi , L as wr , T as Cr , g as Sr , h as Ui , i as Ki , k as Bi , l as Gi , m as A , z as x , n as V , o as we , p as Ce , q as ne , s as Ts , v as ke , w as Wi , x as Yi , O as yn , y as Ji , A as Qi , B as Xi , D as Zi , E as eo , G as so , Q as to , H as ao , J as no , K as ro , P as lo , M as io , N as oo , U as co , V as mo , W as kr , X as Tr , Y as Da , Z as Pa , _ as Nn , $ as ms , a0 as La , a1 as Ea , a2 as Dr , a3 as Pr , a4 as Lr , a5 as _n , a6 as Er , a7 as uo , a8 as Rr , a9 as Fr , aa as Ir , ab as Vr , ac as ot , ad as Mr , ae as xo , af as Or , ag as zr , ah as ho , ai as go , aj as fo , ak as po , al as jo , am as vo , an as bo , ao as yo , ap as No , aq as _o , ar as wo , as as $r , at as Co , au as So , av as Ys , aw as Ar , ax as ko , ay as To , az as qr , aA as wn , aB as Do , aC as Po , aD as Jn , aE as Lo , aF as Hr , aG as Eo , aH as Ur , aI as Ro , aJ as Fo , aK as Io , aL as Vo , aM as Mo , aN as Oo , aO as Kr , aP as zo , aQ as $o , aR as Ao , aS as es , aT as qo , aU as Cn , aV as Ho , aW as Uo , aX as Br , aY as Gr , aZ as Wr , a _ as Ko , a$ as Bo , b0 as Go , b1 as Yr , b2 as Wo , b3 as Sn , b4 as Jr , b5 as Yo , b6 as Qr , b7 as Jo , b8 as Xr , b9 as Qo , ba as Zr , bb as el , bc as Xo , bd as Zo , be as sl , bf as ec , bg as sc , bh as tl , bi as tc , bj as al , bk as ac , bl as nc , bm as _s , bn as Pe , bo as Cs , bp as rc , bq as lc , br as ic , bs as oc , bt as cc , bu as dc , bv as Qn , bw as Xn , bx as mc , by as uc , bz as kn , bA as xc , bB as hc , bC as ja , bD as wt , bE as va , bF as gc , bG as nl , bH as fc , bI as pc , bJ as rl , bK as jc , bL as vc , bM as Zn , bN as dn , bO as mn , bP as bc , bQ as yc , bR as ll , bS as Nc , bT as _c , bU as wc , bV as ba , bW as un , bX as ss , bY as ya , bZ as Cc , b _ as Qa , b$ as Sc , c0 as er , c1 as ds , c2 as qt , c3 as Ht , c4 as xn , c5 as il , c6 as ts , c7 as us , c8 as ol , c9 as cl , ca as kc , cb as Tc , cc as Dc , cd as Pc , ce as Lc , cf as dl , cg as Ec , ch as Rc , ci as Be , cj as sr , ck as Fc , cl as ml , cm as ul , cn as xl , co as hl , cp as gl , cq as fl , cr as Ic , cs as Vc , ct as Mc , cu as Ra , cv as ct , cw as vs , cx as bs , cy as Oc , cz as zc , cA as $c , cB as Ac , cC as pl , cD as qc , cE as Hc , cF as Uc , cG as Kc , cH as hn , cI as Tn , cJ as Dn , cK as Bc , cL as Es , cM as Rs , cN as Fa , cO as Gc , cP as Na , cQ as Wc , cR as tr , cS as jl , cT as ar , cU as _a , cV as Yc , cW as Jc , cX as Qc , cY as Xc , cZ as Zc , c _ as vl , c$ as ed , d0 as sd , d1 as bl , d2 as gn , d3 as yl , d4 as td , d5 as fn , d6 as Nl , d7 as ad , d8 as Ut , d9 as Pn , da as nd , db as rd , dc as nr , dd as _l , de as ld , df as id , dg as od , dh as rr } from "./vendor.js" ; import "./index.js" ; var bg = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : { } ; function yg ( s ) { return s && s . _ _esModule && Object . prototype . hasOwnProperty . call ( s , "default" ) ? s . default : s } function cd ( 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 dd = { theme : "system" , setTheme : ( ) => null } , wl = m . createContext ( dd ) ; function md ( { 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 ( wl . Provider , { ... r , value : l , children : s } ) } const ud = ( ) => { const s = m . useContext ( wl ) ; if ( s === void 0 ) throw new Error ( "useTheme must be used within a ThemeProvider" ) ; return s } , xd = function ( ) { const n = typeof document < "u" && document . createElement ( "link" ) . relList ; return n && n . supports && n . supports ( "modulepreload" ) ? "modulepreload" : "preload" } ( ) , hd = function ( s , n ) { return new URL ( s , n ) . href } , lr = { } , ye = 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 ( o => { if ( o = hd ( o , r ) , o in lr ) return ; lr [ o ] = ! 0 ; const c = o . endsWith ( ".css" ) , h = c ? '[rel="stylesheet"]' : "" ; if ( ! ! r ) for ( let S = l . length - 1 ; S >= 0 ; S -- ) { const p = l [ S ] ; if ( p . href === o && ( ! c || p . rel === "stylesheet" ) ) return } else if ( document . querySelector ( ` link[href=" ${ o } "] ${ h } ` ) ) return ; const C = document . createElement ( "link" ) ; if ( C . rel = c ? "stylesheet" : xd , c || ( C . as = "script" ) , C . crossOrigin = "" , C . href = o , u && C . setAttribute ( "nonce" , u ) , document . head . appendChild ( C ) , c ) return new Promise ( ( S , p ) => { C . addEventListener ( "load" , S ) , C . addEventListener ( "error" , ( ) => p ( new Error ( ` Unable to preload CSS for ${ o } ` ) ) ) } ) } ) ) } 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 ) ; return n ( ) . catch ( i ) } ) } ; function y ( ... s ) { return Oi ( zi ( s ) ) } const Tt = it ( " in Line truncated
` )[0]})}),e.jsx(ce,{className:"max-w-[300px] whitespace-pre-wrap",children:e.jsx("span",{children:B.original.exception})})]})})}),zt.display({id:"actions",header:()=>s("dashboard:queue.details.action","操作"),size:80,cell:({row:B})=>e.jsx(G,{variant:"ghost",size:"sm",onClick:()=>Li(B.original),"aria-label":s("dashboard:queue.details.viewDetail","查看详情"),children:e.jsx(un,{className:"h-4 w-4"})})})],[s]),Wn=ss({data:Gn,columns:ki,getCoreRowModel:ts(),getPaginationRowModel:us(),pageCount:Math.ceil(Si/d),manualPagination:!0,state:{pagination:{pageIndex:i-1,pageSize:d}},onPaginationChange:B=>{if(typeof B=="function"){const Hs=B({pageIndex:i-1,pageSize:d});Yn(Hs.pageIndex+1)}else Yn(B.pageIndex+1)}}),Ti=()=>{t(B=>B+1)},Yn=B=>{l(B)},aa=B=>{p(B)},Di=B=>{ae(B),p(1)},Pi=()=>{R(""),I(""),ae("all"),p(1)},na=B=>{T(B),g(!0)},Li=B=>{o(B),h(!0)},Ei=async()=>{try{const B=await he.getLogClearStats({days:q,level:X==="all"?void 0:X});Lt(B.data),Et(!0)}catch(B){console.error("获取清理统计失败:",B),A.error("获取清理统计失败")}},Ri=async()=>{Fs(!0);try{const B=await he.clearSystemLog({days:q,level:X==="all"?void 0:X,limit:De});B.data.status==="success"?(A.success( ` 清理完成 ! 已清理 $ { B . data . cleared _count } 条日志 ` ),te(!1),Et(!1),Lt(null),se()):A.error(B.data.message||"清理失败")}catch(B){console.error("清理日志失败:",B),A.error("清理日志失败")}finally{Fs(!1)}};if(Ja||Zs)return e.jsx("div",{className:"flex items-center justify-center p-6",children:e.jsx(ya,{className:"h-6 w-6 animate-spin"})});const Fi=B=>B?e.jsx(ol,{className:"h-5 w-5 text-green-500"}):e.jsx(cl,{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(Ee,{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(Ge,{className:"flex items-center gap-2",children:[e.jsx(Cc,{className:"h-5 w-5"}),s("dashboard:queue.title")]}),e.jsx(Os,{children:s("dashboard:queue.status.description")})]}),e.jsx(G,{variant:"outline",size:"icon",onClick:Ti,disabled:pe||Un,children:e.jsx(Qa,{className:y("h-4 w-4",(pe||Un)&&"animate-spin")})})]}),e.jsx(Ie,{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:[Fi(re?.status||!1),e.jsx("span",{className:"font-medium",children:s("dashboard:queue.status.running")})]}),e.jsx(U,{variant:re?.status?"secondary":"destructive",children:re?.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:re?.wait?.default||0})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(be,{children:e.jsxs(ue,{children:[e.jsx(xe,{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:re?.recentJobs||0}),e.jsx(ha,{value:(re?.recentJobs||0)/(re?.periods?.recentJobs||1)*100,className:"h-1"})]})}),e.jsx(ce,{children:e.jsx("p",{children:s("dashboard:queue.details.statisticsPeriod",{hours:re?.periods?.recentJobs||0})})})]})}),e.jsx(be,{children:e.jsxs(ue,{children:[e.jsx(xe,{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:re?.jobsPerMinute||0}),e.jsx(ha,{value:(re?.jobsPerMinute||0)/(re?.queueWithMaxThroughput?.throughput||1)*100,className:"h-1"})]})}),e.jsx(ce,{children:e.jsx("p",{children:s("dashboard:queue.details.maxThroughput",{value:re?.queueWithMaxThroughput?.throughput||0})})})]})})]})]})})]}),e.jsxs(Ee,{children:[e.jsxs(Fe,{children:[e.jsxs(Ge,{className:"flex items-center gap-2",children:[e.jsx(Sc,{className:"h-5 w-5"}),s("dashboard:queue.jobDetails")]}),e.jsx(Os,{children:s("dashboard:queue.details.description")})]}),e.jsx(Ie,{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:re?.failedJobs||0}),e.jsx(un,{className:"h-4 w-4 cursor-pointer text-muted-foreground hover:text-destructive",o
Line truncated
import { r as m , j as e , t as Oi , c as zi , I as Yt , a as it , S as vn , u as As , b as $i , d as bn , R as Nr , e as _r , f as Ai , F as qi , C as Hi , L as wr , T as Cr , g as Sr , h as Ui , i as Ki , k as Bi , l as Gi , m as A , z as x , n as V , o as we , p as Ce , q as ne , s as Ts , v as ke , w as Wi , x as Yi , O as yn , y as Ji , A as Qi , B as Xi , D as Zi , E as eo , G as so , Q as to , H as ao , J as no , K as ro , P as lo , M as io , N as oo , U as co , V as mo , W as kr , X as Tr , Y as Da , Z as Pa , _ as Nn , $ as ms , a0 as La , a1 as Ra , a2 as Dr , a3 as Pr , a4 as Lr , a5 as _n , a6 as Rr , a7 as uo , a8 as Er , a9 as Fr , aa as Ir , ab as Vr , ac as ot , ad as Mr , ae as xo , af as Or , ag as zr , ah as ho , ai as go , aj as fo , ak as po , al as jo , am as vo , an as bo , ao as yo , ap as No , aq as _o , ar as wo , as as $r , at as Co , au as So , av as Ys , aw as Ar , ax as ko , ay as To , az as qr , aA as wn , aB as Do , aC as Po , aD as Jn , aE as Lo , aF as Hr , aG as Ro , aH as Ur , aI as Eo , aJ as Fo , aK as Io , aL as Vo , aM as Mo , aN as Oo , aO as Kr , aP as zo , aQ as $o , aR as Ao , aS as es , aT as qo , aU as Cn , aV as Ho , aW as Uo , aX as Br , aY as Gr , aZ as Wr , a _ as Ko , a$ as Bo , b0 as Go , b1 as Yr , b2 as Wo , b3 as Sn , b4 as Jr , b5 as Yo , b6 as Qr , b7 as Jo , b8 as Xr , b9 as Qo , ba as Zr , bb as el , bc as Xo , bd as Zo , be as sl , bf as ec , bg as sc , bh as tl , bi as tc , bj as al , bk as ac , bl as nc , bm as ws , bn as Pe , bo as Ss , bp as rc , bq as lc , br as ic , bs as oc , bt as cc , bu as dc , bv as Qn , bw as Xn , bx as mc , by as uc , bz as kn , bA as xc , bB as hc , bC as ja , bD as wt , bE as va , bF as gc , bG as nl , bH as fc , bI as pc , bJ as rl , bK as jc , bL as vc , bM as Zn , bN as dn , bO as mn , bP as bc , bQ as yc , bR as ll , bS as Nc , bT as _c , bU as wc , bV as ba , bW as un , bX as ss , bY as ya , bZ as Cc , b _ as Qa , b$ as Sc , c0 as er , c1 as ds , c2 as qt , c3 as Ht , c4 as xn , c5 as il , c6 as ts , c7 as us , c8 as ol , c9 as cl , ca as kc , cb as Tc , cc as Dc , cd as Pc , ce as Lc , cf as dl , cg as Rc , ch as Ec , ci as Be , cj as sr , ck as Fc , cl as ml , cm as ul , cn as xl , co as hl , cp as gl , cq as fl , cr as Ic , cs as Vc , ct as Mc , cu as Ea , cv as ct , cw as bs , cx as ys , cy as Oc , cz as zc , cA as $c , cB as Ac , cC as pl , cD as qc , cE as Hc , cF as Uc , cG as Kc , cH as hn , cI as Tn , cJ as Dn , cK as Bc , cL as Rs , cM as Es , cN as Fa , cO as Gc , cP as Na , cQ as Wc , cR as tr , cS as jl , cT as ar , cU as _a , cV as Yc , cW as Jc , cX as Qc , cY as Xc , cZ as Zc , c _ as vl , c$ as ed , d0 as sd , d1 as bl , d2 as gn , d3 as yl , d4 as td , d5 as fn , d6 as Nl , d7 as ad , d8 as Ut , d9 as Pn , da as nd , db as rd , dc as nr , dd as _l , de as ld , df as id , dg as od , dh as rr } from "./vendor.js" ; import "./index.js" ; var yg = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : { } ; function Ng ( s ) { return s && s . _ _esModule && Object . prototype . hasOwnProperty . call ( s , "default" ) ? s . default : s } function cd ( 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 dd = { theme : "system" , setTheme : ( ) => null } , wl = m . createContext ( dd ) ; function md ( { 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 ( wl . Provider , { ... r , value : l , children : s } ) } const ud = ( ) => { const s = m . useContext ( wl ) ; if ( s === void 0 ) throw new Error ( "useTheme must be used within a ThemeProvider" ) ; return s } , xd = function ( ) { const n = typeof document < "u" && document . createElement ( "link" ) . relList ; return n && n . supports && n . supports ( "modulepreload" ) ? "modulepreload" : "preload" } ( ) , hd = function ( s , n ) { return new URL ( s , n ) . href } , lr = { } , ye = 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 ( o => { if ( o = hd ( o , r ) , o in lr ) return ; lr [ o ] = ! 0 ; const c = o . endsWith ( ".css" ) , h = c ? '[rel="stylesheet"]' : "" ; if ( ! ! r ) for ( let S = l . length - 1 ; S >= 0 ; S -- ) { const f = l [ S ] ; if ( f . href === o && ( ! c || f . rel === "stylesheet" ) ) return } else if ( document . querySelector ( ` link[href=" ${ o } "] ${ h } ` ) ) return ; const C = document . createElement ( "link" ) ; if ( C . rel = c ? "stylesheet" : xd , c || ( C . as = "script" ) , C . crossOrigin = "" , C . href = o , u && C . setAttribute ( "nonce" , u ) , document . head . appendChild ( C ) , c ) return new Promise ( ( S , f ) => { C . addEventListener ( "load" , S ) , C . addEventListener ( "error" , ( ) => f ( new Error ( ` Unable to preload CSS for ${ o } ` ) ) ) } ) } ) ) } 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 ) ; return n ( ) . catch ( i ) } ) } ; function b ( ... s ) { return Oi ( zi ( s ) ) } const Tt = it ( " in Line truncated
` )[0]})}),e.jsx(ce,{className:"max-w-[300px] whitespace-pre-wrap",children:e.jsx("span",{children:B.original.exception})})]})})}),zt.display({id:"actions",header:()=>s("dashboard:queue.details.action","操作"),size:80,cell:({row:B})=>e.jsx(G,{variant:"ghost",size:"sm",onClick:()=>Li(B.original),"aria-label":s("dashboard:queue.details.viewDetail","查看详情"),children:e.jsx(un,{className:"h-4 w-4"})})})],[s]),Wn=ss({data:Gn,columns:ki,getCoreRowModel:ts(),getPaginationRowModel:us(),pageCount:Math.ceil(Si/d),manualPagination:!0,state:{pagination:{pageIndex:i-1,pageSize:d}},onPaginationChange:B=>{if(typeof B=="function"){const Hs=B({pageIndex:i-1,pageSize:d});Yn(Hs.pageIndex+1)}else Yn(B.pageIndex+1)}}),Ti=()=>{t(B=>B+1)},Yn=B=>{l(B)},aa=B=>{f(B)},Di=B=>{ae(B),f(1)},Pi=()=>{R(""),I(""),ae("all"),f(1)},na=B=>{T(B),g(!0)},Li=B=>{o(B),h(!0)},Ri=async()=>{try{const B=await he.getLogClearStats({days:q,level:X==="all"?void 0:X});Lt(B.data),Rt(!0)}catch(B){console.error("获取清理统计失败:",B),A.error("获取清理统计失败")}},Ei=async()=>{Fs(!0);try{const B=await he.clearSystemLog({days:q,level:X==="all"?void 0:X,limit:De});B.data.status==="success"?(A.success( ` 清理完成 ! 已清理 $ { B . data . cleared _count } 条日志 ` ),te(!1),Rt(!1),Lt(null),se()):A.error(B.data.message||"清理失败")}catch(B){console.error("清理日志失败:",B),A.error("清理日志失败")}finally{Fs(!1)}};if(Ja||Zs)return e.jsx("div",{className:"flex items-center justify-center p-6",children:e.jsx(ya,{className:"h-6 w-6 animate-spin"})});const Fi=B=>B?e.jsx(ol,{className:"h-5 w-5 text-green-500"}):e.jsx(cl,{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(Re,{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(Ge,{className:"flex items-center gap-2",children:[e.jsx(Cc,{className:"h-5 w-5"}),s("dashboard:queue.title")]}),e.jsx(Os,{children:s("dashboard:queue.status.description")})]}),e.jsx(G,{variant:"outline",size:"icon",onClick:Ti,disabled:pe||Un,children:e.jsx(Qa,{className:b("h-4 w-4",(pe||Un)&&"animate-spin")})})]}),e.jsx(Ie,{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:[Fi(re?.status||!1),e.jsx("span",{className:"font-medium",children:s("dashboard:queue.status.running")})]}),e.jsx(U,{variant:re?.status?"secondary":"destructive",children:re?.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:re?.wait?.default||0})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(be,{children:e.jsxs(ue,{children:[e.jsx(xe,{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:re?.recentJobs||0}),e.jsx(ha,{value:(re?.recentJobs||0)/(re?.periods?.recentJobs||1)*100,className:"h-1"})]})}),e.jsx(ce,{children:e.jsx("p",{children:s("dashboard:queue.details.statisticsPeriod",{hours:re?.periods?.recentJobs||0})})})]})}),e.jsx(be,{children:e.jsxs(ue,{children:[e.jsx(xe,{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:re?.jobsPerMinute||0}),e.jsx(ha,{value:(re?.jobsPerMinute||0)/(re?.queueWithMaxThroughput?.throughput||1)*100,className:"h-1"})]})}),e.jsx(ce,{children:e.jsx("p",{children:s("dashboard:queue.details.maxThroughput",{value:re?.queueWithMaxThroughput?.throughput||0})})})]})})]})]})})]}),e.jsxs(Re,{children:[e.jsxs(Fe,{children:[e.jsxs(Ge,{className:"flex items-center gap-2",children:[e.jsx(Sc,{className:"h-5 w-5"}),s("dashboard:queue.jobDetails")]}),e.jsx(Os,{children:s("dashboard:queue.details.description")})]}),e.jsx(Ie,{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:re?.failedJobs||0}),e.jsx(un,{className:"h-4 w-4 cursor-pointer text-muted-foreground hover:text-destructive",o
Line truncated
File : $ { Vi }
Line : $ { Mi } ` }return JSON.stringify(B,null,2)}catch{return f.context}})()})})]})]}),e.jsx(Le,{children:e.jsx(Gs,{asChild:!0,children:e.jsx(G,{variant:"outline",children:s("common.close","关闭")})})})]})}),e.jsx(ge,{open:ee,onOpenChange:te,children:e.jsxs(de,{className:"max-w-2xl",children:[e.jsx(ve,{children:e.jsxs(fe,{className:"flex items-center gap-2",children:[e.jsx(ds,{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(Ae,{htmlFor:"clearDays",children:s("dashboard:systemLog.clearDays","清理天数")}),e.jsx(D,{id:"clearDays",type:"number",min:"1",max:"365",value:q,onChange:B=>F(parseInt(B.target.value)||30),placeholder:"30"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("dashboard:systemLog.clearDaysDesc","清理多少天前的日志 (1-365天)")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ae,{htmlFor:"clearLevel",children:s("dashboard:systemLog.clearLevel","日志级别")}),e.jsxs(J,{value:X,onValueChange:ys,children:[e.jsx(W,{children:e.jsx(Q,{})}),e.jsxs(Y,{children:[e.jsx( $ ,{value:"all",children:s("dashboard:systemLog.tabs.all","全部")}),e.jsx( $ ,{value:"info",children:s("dashboard:systemLog.tabs.info","信息")}),e.jsx( $ ,{value:"warning",children:s("dashboard:systemLog.tabs.warning","警告")}),e.jsx( $ ,{value:"error",children:s("dashboard:systemLog.tabs.error","错误")})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ae,{htmlFor:"clearLimit",children:s("dashboard:systemLog.clearLimit","单次限制")}),e.jsx(D,{id:"clearLimit",type:"number",min:"100",max:"10000",value:De,onChange:B=>ie(parseInt(B.target.value)||1e3),placeholder:"1000"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("dashboard:systemLog.clearLimitDesc","单次清理数量限制 (100-10000条)")})]})]}),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(kn,{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:Ei,disabled:Ns,children:[e.jsx(Cs,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.getStats","获取统计")]})]}),Zt&&Xs&&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:Xs.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:Xs.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(Ht,{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:Xs.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(Le,{children:[e.jsx(G,{variant:"outline",onClick:()=>{te(!1),Et(!1),Lt(null)},children:s("common.cancel","取消")}),e.jsx(G,{variant:"destructive",onClick:Ri,disabled:Ns||!Zt||!Xs,children:Ns?e.jsxs(e.Fragment,{children:[e.jsx(ya,{className:"mr-2 h-4 w-4 animate-spin"}),s("dashboard:systemLog.clearing","清理中...")]}):e.jsxs(e.Fragment,{children:[e.jsx(ds,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.confirmClear","确认清理")]})})]})]})})]})}function Cm(){const{t:s}=V();return e.jsxs(ze,{children:[e.jsxs( $ e,{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(ns,{}),e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsx(He,{children:e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"grid gap-6",children:[e.jsx(vm,{}),e.jsx(hm,{}),e.jsx(bm,{}),e.jsx(wm,{})]})})})]})}const Sm=Object.freeze(Object.defineProperty({__proto__:null,default:Cm},Symbol.toStringTag,{value:"Module"}));function km({className:s,items:n,...t}){const{pa
Line truncated
Line : $ { Mi } ` }return JSON.stringify(B,null,2)}catch{return _.context}})()})})]})]}),e.jsx(Le,{children:e.jsx(Gs,{asChild:!0,children:e.jsx(G,{variant:"outline",children:s("common.close","关闭")})})})]})}),e.jsx(ge,{open:ee,onOpenChange:te,children:e.jsxs(de,{className:"max-w-2xl",children:[e.jsx(ve,{children:e.jsxs(fe,{className:"flex items-center gap-2",children:[e.jsx(ds,{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(Ae,{htmlFor:"clearDays",children:s("dashboard:systemLog.clearDays","清理天数")}),e.jsx(P,{id:"clearDays",type:"number",min:"1",max:"365",value:q,onChange:B=>F(parseInt(B.target.value)||30),placeholder:"30"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("dashboard:systemLog.clearDaysDesc","清理多少天前的日志 (1-365天)")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ae,{htmlFor:"clearLevel",children:s("dashboard:systemLog.clearLevel","日志级别")}),e.jsxs(J,{value:X,onValueChange:Ns,children:[e.jsx(W,{children:e.jsx(Q,{})}),e.jsxs(Y,{children:[e.jsx( $ ,{value:"all",children:s("dashboard:systemLog.tabs.all","全部")}),e.jsx( $ ,{value:"info",children:s("dashboard:systemLog.tabs.info","信息")}),e.jsx( $ ,{value:"warning",children:s("dashboard:systemLog.tabs.warning","警告")}),e.jsx( $ ,{value:"error",children:s("dashboard:systemLog.tabs.error","错误")})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Ae,{htmlFor:"clearLimit",children:s("dashboard:systemLog.clearLimit","单次限制")}),e.jsx(P,{id:"clearLimit",type:"number",min:"100",max:"10000",value:De,onChange:B=>ie(parseInt(B.target.value)||1e3),placeholder:"1000"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("dashboard:systemLog.clearLimitDesc","单次清理数量限制 (100-10000条)")})]})]}),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(kn,{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:Ri,disabled:_s,children:[e.jsx(Ss,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.getStats","获取统计")]})]}),Zt&&Xs&&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:Xs.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:Xs.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(Ht,{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:Xs.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(Le,{children:[e.jsx(G,{variant:"outline",onClick:()=>{te(!1),Rt(!1),Lt(null)},children:s("common.cancel","取消")}),e.jsx(G,{variant:"destructive",onClick:Ei,disabled:_s||!Zt||!Xs,children:_s?e.jsxs(e.Fragment,{children:[e.jsx(ya,{className:"mr-2 h-4 w-4 animate-spin"}),s("dashboard:systemLog.clearing","清理中...")]}):e.jsxs(e.Fragment,{children:[e.jsx(ds,{className:"mr-2 h-4 w-4"}),s("dashboard:systemLog.confirmClear","确认清理")]})})]})]})})]})}function Cm(){const{t:s}=V();return e.jsxs(ze,{children:[e.jsxs( $ e,{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(ns,{}),e.jsx(Ye,{}),e.jsx(Je,{})]})]}),e.jsx(He,{children:e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"grid gap-6",children:[e.jsx(vm,{}),e.jsx(hm,{}),e.jsx(bm,{}),e.jsx(wm,{})]})})})]})}const Sm=Object.freeze(Object.defineProperty({__proto__:null,default:Cm},Symbol.toStringTag,{value:"Module"}));function km({className:s,items:n,...t}){const{pa
Line truncated
` ),onChange:c=>{const h=c.target.value.split( `
` ).filter(Boolean);o.onChange(h),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.emailWhitelist.suffixes.description")}),e.jsx(L,{})]})}),e.jsx(b,{control:a.control,name:"recaptcha_enable",render:({field:o})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(v,{className:"text-base",children:s("safe.form.recaptcha.enable.label")}),e.jsx(O,{children:s("safe.form.recaptcha.enable.description")})]}),e.jsx(N,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),a.watch("recaptcha_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(b,{control:a.control,name:"recaptcha_site_key",render:({field:o})=>e.jsxs(j,{children:[e.jsx(v,{className:"text-base",children:s("safe.form.recaptcha.siteKey.label")}),e.jsx(N,{children:e.jsx(D,{placeholder:s("safe.form.recaptcha.siteKey.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.recaptcha.siteKey.description")}),e.jsx(L,{})]})}),e.jsx(b,{control:a.control,name:"recaptcha_key",render:({field:o})=>e.jsxs(j,{children:[e.jsx(v,{className:"text-base",children:s("safe.form.recaptcha.key.label")}),e.jsx(N,{children:e.jsx(D,{placeholder:s("safe.form.recaptcha.key.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.recaptcha.key.description")}),e.jsx(L,{})]})})]}),e.jsx(b,{control:a.control,name:"register_limit_by_ip_enable",render:({field:o})=>e.jsxs(j,{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(O,{children:s("safe.form.registerLimit.enable.description")})]}),e.jsx(N,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),a.watch("register_limit_by_ip_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(b,{control:a.control,name:"register_limit_count",render:({field:o})=>e.jsxs(j,{children:[e.jsx(v,{className:"text-base",children:s("safe.form.registerLimit.count.label")}),e.jsx(N,{children:e.jsx(D,{placeholder:s("safe.form.registerLimit.count.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.registerLimit.count.description")}),e.jsx(L,{})]})}),e.jsx(b,{control:a.control,name:"register_limit_expire",render:({field:o})=>e.jsxs(j,{children:[e.jsx(v,{className:"text-base",children:s("safe.form.registerLimit.expire.label")}),e.jsx(N,{children:e.jsx(D,{placeholder:s("safe.form.registerLimit.expire.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.registerLimit.expire.description")}),e.jsx(L,{})]})})]}),e.jsx(b,{control:a.control,name:"password_limit_enable",render:({field:o})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(v,{className:"text-base",children:s("safe.form.passwordLimit.enable.label")}),e.jsx(O,{children:s("safe.form.passwordLimit.enable.description")})]}),e.jsx(N,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),a.watch("password_limit_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(b,{control:a.control,name:"password_limit_count",render:({field:o})=>e.jsxs(j,{children:[e.jsx(v,{className:"text-base",children:s("safe.form.passwordLimit.count.label")}),e.jsx(N,{children:e.jsx(D,{placeholder:s("safe.form.passwordLimit.count.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.passwordLimit.count.description")}),e.jsx(L,{})]})}),e.jsx(b,{control:a.control,name:"password_limit_expire",render:({field:o})=>e.jsxs(j,{children:[e.jsx(v,{className:"text-base",children:s("safe.form.passwordLimit.expire.label")}),e.jsx(N,{children:e.jsx(D,{placeholder:s("safe.form.passwordLimit.expire.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.passwordLimit.expire.description")}),e.jsx(L,{})]})})]}),n&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("safe.form.saving")})]})})}function Om(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("safe.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("safe.description")})]}),e.jsx(Te,{}),e.jsx(Mm,{})]})}const zm=Object.freeze(Object.defineProperty({__proto__:null,default:Om},Symbol.toStringTag,{value:"Module"})), $ m=x.object({plan_change_enable:x.boolean().nullable().default(!1),reset_traffic_method:x.coerce.number().nullable().default(0),surplus_enable:x.boolean().nullable().default(!1),new_order_event_id:x.coerce.number().nullable().default(0),renew_order_event_id:x.coerce.number().nullable().default(0),change_order_event_id:x.coerce.number().nullable().default(0),show_info_to_server_enable:x.boolean().nullable().default(!1),show_protocol_
Line truncated
` ).filter(Boolean);o.onChange(h),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.emailWhitelist.suffixes.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"recaptcha_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.recaptcha.enable.label")}),e.jsx(O,{children:s("safe.form.recaptcha.enable.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),a.watch("recaptcha_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:a.control,name:"recaptcha_site_key",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.recaptcha.siteKey.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.recaptcha.siteKey.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.recaptcha.siteKey.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"recaptcha_key",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.recaptcha.key.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.recaptcha.key.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.recaptcha.key.description")}),e.jsx(E,{})]})})]}),e.jsx(v,{control:a.control,name:"register_limit_by_ip_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.registerLimit.enable.label")}),e.jsx(O,{children:s("safe.form.registerLimit.enable.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),a.watch("register_limit_by_ip_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:a.control,name:"register_limit_count",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.registerLimit.count.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.registerLimit.count.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.registerLimit.count.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"register_limit_expire",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.registerLimit.expire.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.registerLimit.expire.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.registerLimit.expire.description")}),e.jsx(E,{})]})})]}),e.jsx(v,{control:a.control,name:"password_limit_enable",render:({field:o})=>e.jsxs(p,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(j,{className:"text-base",children:s("safe.form.passwordLimit.enable.label")}),e.jsx(O,{children:s("safe.form.passwordLimit.enable.description")})]}),e.jsx(y,{children:e.jsx(Z,{checked:o.value||!1,onCheckedChange:c=>{o.onChange(c),u(a.getValues())}})})]})}),a.watch("password_limit_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(v,{control:a.control,name:"password_limit_count",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.passwordLimit.count.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.passwordLimit.count.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.passwordLimit.count.description")}),e.jsx(E,{})]})}),e.jsx(v,{control:a.control,name:"password_limit_expire",render:({field:o})=>e.jsxs(p,{children:[e.jsx(j,{className:"text-base",children:s("safe.form.passwordLimit.expire.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("safe.form.passwordLimit.expire.placeholder"),...o,value:o.value||"",onChange:c=>{o.onChange(c),u(a.getValues())}})}),e.jsx(O,{children:s("safe.form.passwordLimit.expire.description")}),e.jsx(E,{})]})})]}),n&&e.jsx("div",{className:"text-sm text-muted-foreground",children:s("safe.form.saving")})]})})}function Om(){const{t:s}=V("settings");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s("safe.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("safe.description")})]}),e.jsx(Te,{}),e.jsx(Mm,{})]})}const zm=Object.freeze(Object.defineProperty({__proto__:null,default:Om},Symbol.toStringTag,{value:"Module"})), $ m=x.object({plan_change_enable:x.boolean().nullable().default(!1),reset_traffic_method:x.coerce.number().nullable().default(0),surplus_enable:x.boolean().nullable().default(!1),new_order_event_id:x.coerce.number().nullable().default(0),renew_order_event_id:x.coerce.number().nullable().default(0),change_order_event_id:x.coerce.number().nullable().default(0),show_info_to_server_enable:x.boolean().nullable().default(!1),show_protocol_
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:w=>{const H=w.target.value.split( `
` ).filter(I=>I.trim()!=="");g.onChange(H)}})})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(b,{control:d.control,name:"tls.server_name",render:({field:g})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(v,{children:r("dynamic_form.anytls.tls.server_name.label","SNI")}),e.jsx(N,{children:e.jsx(D,{placeholder:r("dynamic_form.anytls.tls.server_name.placeholder","服务器名称"),...g})})]})}),e.jsx(b,{control:d.control,name:"tls.allow_insecure",render:({field:g})=>e.jsxs(j,{children:[e.jsx(v,{children:r("dynamic_form.anytls.tls.allow_insecure","允许不安全连接")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(N,{children:e.jsx(Z,{checked:g.value,onCheckedChange:g.onChange})})})]})})]})]})})};return e.jsx(be,{children:E[s]?.()})};function vx(){const{t:s}=V("server"),n=x.object({id:x.number().optional().nullable(),specific_key:x.string().optional().nullable(),code:x.string().optional(),show:x.boolean().optional().nullable(),name:x.string().min(1,s("form.name.error")),rate:x.string().min(1,s("form.rate.error")).refine(R=>!isNaN(parseFloat(R))&&isFinite(Number(R)),{message:s("form.rate.error_numeric")}).refine(R=>parseFloat(R)>=0,{message:s("form.rate.error_gte_zero")}),tags:x.array(x.string()).default([]),excludes:x.array(x.string()).default([]),ips:x.array(x.string()).default([]),group_ids:x.array(x.string()).default([]),host:x.string().min(1,s("form.host.error")),port:x.string().min(1,s("form.port.error")),server_port:x.string().min(1,s("form.server_port.error")),parent_id:x.string().default("0").nullable(),route_ids:x.array(x.string()).default([]),protocol_settings:x.record(x.any()).default({}).nullable()}),t={id:null,specific_key:null,code:"",show:!1,name:"",rate:"1",tags:[],excludes:[],ips:[],group_ids:[],host:"",port:"",server_port:"",parent_id:"0",route_ids:[],protocol_settings:null},{isOpen:r,setIsOpen:a,editingServer:i,setEditingServer:l,serverType:d,setServerType:u,refetch:o}=ti(),[c,h]=m.useState([]),[k,C]=m.useState([]),[S,p]=m.useState([]),_=we({resolver:Ce(n),defaultValues:t,mode:"onChange"});m.useEffect(()=>{f()},[r]),m.useEffect(()=>{i?.type&&i.type!==d&&u(i.type)},[i,d,u]),m.useEffect(()=>{i?i.type===d&&_.reset({...t,...i}):_.reset({...t,protocol_settings:Re[d].schema.parse({})})},[i,_,d]);const f=async()=>{if(!r)return;const[R,H,I]=await Promise.all([mt.getList(),Va.getList(),at.getList()]);h(R.data?.map(K=>({label:K.name,value:K.id.toString()}))||[]),C(H.data?.map(K=>({label:K.remarks,value:K.id.toString()}))||[]),p(I.data||[])},T=m.useMemo(()=>S?.filter(R=>(R.parent_id===0||R.parent_id===null)&&R.type===d&&R.id!==_.watch("id")),[d,S,_]),E=()=>e.jsxs(zs,{children:[e.jsx( $ s,{asChild:!0,children:e.jsxs(P,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(Be,{icon:"ion:add"}),e.jsx("div",{children:s("form.add_node")})]})}),e.jsx(Ls,{align:"start",children:e.jsx(Kd,{children:js.map(({type:R,label:H})=>e.jsx(_e,{onClick:()=>{u(R),a(!0)},className:"cursor-pointer",children:e.jsx(U,{variant:"outline",className:"text-white",style:{background:is[R]},children:H})},R))})})]}),g=()=>{a(!1),l(null),_.reset(t)},w=async()=>{const R=_.getValues();(await at.save({...R,type:d})).data&&(g(),A.success(s("form.success")),o())};return e.jsxs(ge,{open:r,onOpenChange:g,children:[E(),e.jsxs(de,{className:"sm:max-w-[425px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:s(i?"form.edit_node":"form.new_node")}),e.jsx(Ve,{})]}),e.jsxs(Se,{..._,children:[e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(b,{control:_.control,name:"name",render:({field:R})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(v,{children:s("form.name.label")}),e.jsx(N,{children:e.jsx(D,{placeholder:s("form.name.placeholder"),...R})}),e.jsx(L,{})]})}),e.jsx(b,{control:_.control,name:"rate",render:({field:R})=>e.jsxs(j,{className:"flex-[1]",children:[e.jsx(v,{children:s("form.rate.label")}),e.jsx("div",{className:"relative flex",children:e.jsx(N,{children:e.jsx(D,{type:"number",min:"0",step:"0.1",...R})})}),e.jsx(L,{})]})})]}),e.jsx(b,{control:_.control,name:"code",render:({field:R})=>e.jsxs(j,{children:[e.jsxs(v,{children:[s("form.code.label"),e.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:s("form.code.optional")})]}),e.jsx(N,{children:e.jsx(D,{placeholder:s("form.code.placeholder"),...R,value:R.value||""})}),e.jsx(L,{})]})}),e.jsx(b,{control:_.control,name:"tags",render:({field:R})=>e.jsxs(j,{children:[e.jsx(v,{children:s("form.tags.label")}),e.jsx(N,{children:e.jsx(zn,{value:R.value,onChange:R.onChange,placeholder:s("form.tags.placeholder"),className:"w-full"})}),e.jsx(L,{})]})}),e.jsx(b,{control:_.control,name:"group_ids",render:({field:R})=>e.jsxs(j,{children:[e.jsxs(v,{className:"flex items-center justify-between",children:[s("form.groups.label"),e.jsx(Ka,{dialogTrigger:e.jsx(P,{variant:"link",children:s("form.groups.add")}),refetch:f})]}),e.jsx(N,{children:e.jsx(kt,{options:c,onChange:H=>R.onChange(H.map(I=>I.value)),valu
Line truncated
` ).filter(I=>I.trim()!=="");g.onChange(H)}})})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:d.control,name:"tls.server_name",render:({field:g})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:r("dynamic_form.anytls.tls.server_name.label","SNI")}),e.jsx(y,{children:e.jsx(P,{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(p,{children:[e.jsx(j,{children:r("dynamic_form.anytls.tls.allow_insecure","允许不安全连接")}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(Z,{checked:g.value,onCheckedChange:g.onChange})})})]})})]})]})})};return e.jsx(be,{children:D[s]?.()})};function vx(){const{t:s}=V("server"),n=x.object({id:x.number().optional().nullable(),specific_key:x.string().optional().nullable(),code:x.string().optional(),show:x.boolean().optional().nullable(),name:x.string().min(1,s("form.name.error")),rate:x.string().min(1,s("form.rate.error")).refine(R=>!isNaN(parseFloat(R))&&isFinite(Number(R)),{message:s("form.rate.error_numeric")}).refine(R=>parseFloat(R)>=0,{message:s("form.rate.error_gte_zero")}),tags:x.array(x.string()).default([]),excludes:x.array(x.string()).default([]),ips:x.array(x.string()).default([]),group_ids:x.array(x.string()).default([]),host:x.string().min(1,s("form.host.error")),port:x.string().min(1,s("form.port.error")),server_port:x.string().min(1,s("form.server_port.error")),parent_id:x.string().default("0").nullable(),route_ids:x.array(x.string()).default([]),protocol_settings:x.record(x.any()).default({}).nullable()}),t={id:null,specific_key:null,code:"",show:!1,name:"",rate:"1",tags:[],excludes:[],ips:[],group_ids:[],host:"",port:"",server_port:"",parent_id:"0",route_ids:[],protocol_settings:null},{isOpen:r,setIsOpen:a,editingServer:i,setEditingServer:l,serverType:d,setServerType:u,refetch:o}=ti(),[c,h]=m.useState([]),[k,C]=m.useState([]),[S,f]=m.useState([]),N=we({resolver:Ce(n),defaultValues:t,mode:"onChange"});m.useEffect(()=>{_()},[r]),m.useEffect(()=>{i?.type&&i.type!==d&&u(i.type)},[i,d,u]),m.useEffect(()=>{i?i.type===d&&N.reset({...t,...i}):N.reset({...t,protocol_settings:Ee[d].schema.parse({})})},[i,N,d]);const _=async()=>{if(!r)return;const[R,H,I]=await Promise.all([mt.getList(),Va.getList(),at.getList()]);h(R.data?.map(K=>({label:K.name,value:K.id.toString()}))||[]),C(H.data?.map(K=>({label:K.remarks,value:K.id.toString()}))||[]),f(I.data||[])},T=m.useMemo(()=>S?.filter(R=>(R.parent_id===0||R.parent_id===null)&&R.type===d&&R.id!==N.watch("id")),[d,S,N]),D=()=>e.jsxs(zs,{children:[e.jsx( $ s,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(Be,{icon:"ion:add"}),e.jsx("div",{children:s("form.add_node")})]})}),e.jsx(Ls,{align:"start",children:e.jsx(Kd,{children:js.map(({type:R,label:H})=>e.jsx(_e,{onClick:()=>{u(R),a(!0)},className:"cursor-pointer",children:e.jsx(U,{variant:"outline",className:"text-white",style:{background:is[R]},children:H})},R))})})]}),g=()=>{a(!1),l(null),N.reset(t)},w=async()=>{const R=N.getValues();(await at.save({...R,type:d})).data&&(g(),A.success(s("form.success")),o())};return e.jsxs(ge,{open:r,onOpenChange:g,children:[D(),e.jsxs(de,{className:"sm:max-w-[425px]",children:[e.jsxs(ve,{children:[e.jsx(fe,{children:s(i?"form.edit_node":"form.new_node")}),e.jsx(Ve,{})]}),e.jsxs(Se,{...N,children:[e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{control:N.control,name:"name",render:({field:R})=>e.jsxs(p,{className:"flex-[2]",children:[e.jsx(j,{children:s("form.name.label")}),e.jsx(y,{children:e.jsx(P,{placeholder:s("form.name.placeholder"),...R})}),e.jsx(E,{})]})}),e.jsx(v,{control:N.control,name:"rate",render:({field:R})=>e.jsxs(p,{className:"flex-[1]",children:[e.jsx(j,{children:s("form.rate.label")}),e.jsx("div",{className:"relative flex",children:e.jsx(y,{children:e.jsx(P,{type:"number",min:"0",step:"0.1",...R})})}),e.jsx(E,{})]})})]}),e.jsx(v,{control:N.control,name:"code",render:({field:R})=>e.jsxs(p,{children:[e.jsxs(j,{children:[s("form.code.label"),e.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:s("form.code.optional")})]}),e.jsx(y,{children:e.jsx(P,{placeholder:s("form.code.placeholder"),...R,value:R.value||""})}),e.jsx(E,{})]})}),e.jsx(v,{control:N.control,name:"tags",render:({field:R})=>e.jsxs(p,{children:[e.jsx(j,{children:s("form.tags.label")}),e.jsx(y,{children:e.jsx(zn,{value:R.value,onChange:R.onChange,placeholder:s("form.tags.placeholder"),className:"w-full"})}),e.jsx(E,{})]})}),e.jsx(v,{control:N.control,name:"group_ids",render:({field:R})=>e.jsxs(p,{children:[e.jsxs(j,{className:"flex items-center justify-between",children:[s("form.groups.label"),e.jsx(Ka,{dialogTrigger:e.jsx(L,{variant:"link",children:s("form.groups.add")}),refetch:_})]}),e.jsx(y,{children:e.jsx(kt,{options:c,onChange:H=>R.onChange(H.map(I=>I.value)),valu
Line truncated
` ):"",onChange:o=>{const c=o.target.value.split( `
` );u.onChange(c)}})})}),e.jsx(L,{})]})}),e.jsx(b,{control:i.control,name:"action",render:({field:u})=>e.jsxs(j,{children:[e.jsx(v,{children:a("form.action")}),e.jsx("div",{className:"relative",children:e.jsx(N,{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( $ ,{value:"block",children:a("actions.block")}),e.jsx( $ ,{value:"dns",children:a("actions.dns")})]})]})})}),e.jsx(L,{})]})}),i.watch("action")==="dns"&&e.jsx(b,{control:i.control,name:"action_value",render:({field:u})=>e.jsxs(j,{children:[e.jsx(v,{children:a("form.dns")}),e.jsx("div",{className:"relative",children:e.jsx(N,{children:e.jsx(D,{type:"text",placeholder:a("form.dnsPlaceholder"),...u})})})]})}),e.jsxs(Le,{children:[e.jsx(Gs,{asChild:!0,children:e.jsx(P,{variant:"outline",children:a("form.cancel")})}),e.jsx(P,{type:"submit",onClick:()=>{const u=i.getValues(),o={...u,match:Array.isArray(u.match)?u.match.filter(c=>c.trim()!==""):[]};Va.save(o).then(({data:c})=>{c&&(d(!1),s&&s(),A.success(a(r==="edit"?"messages.updateSuccess":"messages.createSuccess")),i.reset())})},children:a("form.submit")})]})]})]})]})}function Ex({table:s,refetch:n}){const t=s.getState().columnFilters.length>0,{t:r}=V("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(ai,{refetch:n}),e.jsx(D,{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(P,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[r("toolbar.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]})})}function Rx({columns:s,data:n,refetch:t}){const[r,a]=m.useState({}),[i,l]=m.useState({}),[d,u]=m.useState([]),[o,c]=m.useState([]),h=ss({data:n,columns:s,state:{sorting:o,columnVisibility:i,rowSelection:r,columnFilters:d},enableRowSelection:!0,onRowSelectionChange:a,onSortingChange:c,onColumnFiltersChange:u,onColumnVisibilityChange:l,getCoreRowModel:ts(),getFilteredRowModel:vs(),getPaginationRowModel:us(),getSortedRowModel:bs(),getFacetedRowModel:Es(),getFacetedUniqueValues:Rs(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(xs,{table:h,toolbar:k=>e.jsx(Ex,{table:k,refetch:t})})}const Fx=s=>{const{t:n}=V("route"),t={block:{icon:Qc,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:Xc,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(z,{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(z,{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(z,{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(z,{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:y("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(ai,{defaultValues:r.original,refetch:s,type:"edit",dialogTrigger:e.jsxs(P,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(ct,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:n("form.edit")})]})}),e.jsx(ps,{title:n("messag
Line truncated
` );u.onChange(c)}})})}),e.jsx(E,{})]})}),e.jsx(v,{control:i.control,name:"action",render:({field:u})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.action")}),e.jsx("div",{className:"relative",children:e.jsx(y,{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( $ ,{value:"block",children:a("actions.block")}),e.jsx( $ ,{value:"dns",children:a("actions.dns")})]})]})})}),e.jsx(E,{})]})}),i.watch("action")==="dns"&&e.jsx(v,{control:i.control,name:"action_value",render:({field:u})=>e.jsxs(p,{children:[e.jsx(j,{children:a("form.dns")}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsx(P,{type:"text",placeholder:a("form.dnsPlaceholder"),...u})})})]})}),e.jsxs(Le,{children:[e.jsx(Gs,{asChild:!0,children:e.jsx(L,{variant:"outline",children:a("form.cancel")})}),e.jsx(L,{type:"submit",onClick:()=>{const u=i.getValues(),o={...u,match:Array.isArray(u.match)?u.match.filter(c=>c.trim()!==""):[]};Va.save(o).then(({data:c})=>{c&&(d(!1),s&&s(),A.success(a(r==="edit"?"messages.updateSuccess":"messages.createSuccess")),i.reset())})},children:a("form.submit")})]})]})]})]})}function Rx({table:s,refetch:n}){const t=s.getState().columnFilters.length>0,{t:r}=V("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(ai,{refetch:n}),e.jsx(P,{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(L,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:[r("toolbar.reset"),e.jsx(ms,{className:"ml-2 h-4 w-4"})]})]})})}function Ex({columns:s,data:n,refetch:t}){const[r,a]=m.useState({}),[i,l]=m.useState({}),[d,u]=m.useState([]),[o,c]=m.useState([]),h=ss({data:n,columns:s,state:{sorting:o,columnVisibility:i,rowSelection:r,columnFilters:d},enableRowSelection:!0,onRowSelectionChange:a,onSortingChange:c,onColumnFiltersChange:u,onColumnVisibilityChange:l,getCoreRowModel:ts(),getFilteredRowModel:bs(),getPaginationRowModel:us(),getSortedRowModel:ys(),getFacetedRowModel:Rs(),getFacetedUniqueValues:Es(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(xs,{table:h,toolbar:k=>e.jsx(Rx,{table:k,refetch:t})})}const Fx=s=>{const{t:n}=V("route"),t={block:{icon:Qc,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:Xc,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(z,{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(z,{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(z,{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(z,{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:b("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(ai,{defaultValues:r.original,refetch:s,type:"edit",dialogTrigger:e.jsxs(L,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(ct,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:n("form.edit")})]})}),e.jsx(ps,{title:n("messag
Line truncated
` +a("columns.online_status.offline_duration.days",{count:k}):h>0?o+= `
` +a("columns.online_status.offline_duration.hours",{count:h}):c>0?o+= `
` +a("columns.online_status.offline_duration.minutes",{count:c}):o+= `
` +a("columns.online_status.offline_duration.seconds",{count:u})}return e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:y("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(ce,{side:"bottom",className:"max-w-[280px]",children:e.jsx("p",{className:"whitespace-pre-line text-sm",children:o})})]})})},enableSorting:!1,enableHiding:!1},{accessorKey:"online_count",header:({column:i})=>e.jsx(z,{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(ue,{children:[e.jsx(xe,{children:e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsxs(U,{variant:"outline",className:y("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(ce,{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(z,{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:y("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(z,{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(z,{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:y("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(z,{column:i,title:a("columns.used_traffic")}),cell:({row:i})=>{const l=Oe(i.original?.total_used),d=Oe(i.original?.transfer_enable),u=i.original?.total_used/i.original?.transfer_enable*100||0;return e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{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:y("h-full rounded-full transition-all",u>90?"bg-destructive":"bg-primary"),style:{width: ` $ { Math . min ( u , 100 ) } % ` }})})]})}),e.jsx(ce,{side:"bottom",children:e.jsxs("p",{className:"text-sm",children:[a("columns.total_traffic"),": ",d]})})]})})}},{accessorKey:"transfer_enable",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.total_traffic")}),cell:({row:i})=>e.jsx("div",{className:"font-medium text-muted-foreground",children:Oe(i.original?.transfer_enable)})},{accessorKey:"expired_at",header:({column:i})=>e.jsx(z,{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,o=l!=null?new Date(l*1e3):null,c=o!=null?Math.ceil((o.getTime()-Date.now())/(1e3*60*60*24)):null;return e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{className:"block w-full",children:e.jsx(U,{variant:"outline",className:y("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"):me(l,"YYYY-MM-DD")})}),e.jsx(ce,{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"),": ",me(l)]}),e.jsx("p",{className:y("text-sm font-medium",u?"text-destructive":"text-success"),children:u?a("columns.expire_status.expired",{days:Math.abs(c??0)}):a("columns.expire_status.remaining",{days:c??0})})]}):e.jsx("p",{className:"text-sm font-medium",children:a("columns.expire_status.permanent")})})]})})}},{accessorKey:"bal
Line truncated
` ),w=new Blob([g],{type:"text/csv;charset=utf-8;"}),R=document.createElement("a"),H=URL.createObjectURL(w);R.setAttribute("href",H),R.setAttribute("download", ` traffic - reset - logs - $ { Pe ( new Date , "yyyy-MM-dd" ) } . csv ` ),R.style.visibility="hidden",document.body.appendChild(R),R.click(),document.body.removeChild(R),A.success(t("traffic_reset_logs.actions.export_success"))}catch(p){console.error("导出失败:",p),A.error(t("traffic_reset_logs.actions.export_failed"))}finally{o(!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(D,{placeholder:t("traffic_reset_logs.filters.search_user"),value:s.getColumn("user_email")?.getFilterValue()??"",onChange:p=>s.getColumn("user_email")?.setFilterValue(p.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:p=>s.getColumn("reset_type")?.setFilterValue(p==="all"?"":p),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( $ ,{value:"all",children:t("traffic_reset_logs.filters.all_types")}),c.map(p=>e.jsx( $ ,{value:p.value,children:p.label},p.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:p=>s.getColumn("trigger_source")?.setFilterValue(p==="all"?"":p),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( $ ,{value:"all",children:t("traffic_reset_logs.filters.all_sources")}),h.map(p=>e.jsx( $ ,{value:p.value,children:p.label},p.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(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(P,{variant:"outline",className:y("h-9 w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[e.jsx(Cs,{className:"mr-2 h-4 w-4"}),a?Pe(a,"MM-dd"):t("traffic_reset_logs.filters.start_date")]})}),e.jsx(Ze,{className:"w-auto p-0",align:"start",children:e.jsx(ks,{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(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(P,{variant:"outline",className:y("h-9 w-full justify-start text-left font-normal",!l&&"text-muted-foreground"),children:[e.jsx(Cs,{className:"mr-2 h-4 w-4"}),l?Pe(l,"MM-dd"):t("traffic_reset_logs.filters.end_date")]})}),e.jsx(Ze,{className:"w-auto p-0",align:"start",children:e.jsx(ks,{mode:"single",selected:l,onSelect:d,initialFocus:!0})})]})]})]}),(a||l)&&e.jsxs(P,{variant:"outline",className:"w-full",onClick:k,children:[e.jsx(rr,{className:"mr-2 h-4 w-4"}),t("traffic_reset_logs.filters.apply_date")]}),r&&e.jsxs(P,{variant:"ghost",onClick:()=>{s.resetColumnFilters(),i(void 0),d(void 0)},className:"w-full",children:[t("traffic_reset_logs.filters.reset"),e.jsx(ms,{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(qn,{children:[e.jsx(ci,{asChild:!0,children:e.jsxs(P,{variant:"outline",size:"sm",className:"h-8",children:[e.jsx(od,{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(Ba,{side:"bottom",className:"h-[85vh]",children:[e.jsxs(Ga,{className:"mb-4",children:[e.jsx(Wa,{children:t("traffic_reset_logs.filters.filter_title")}),e.jsx(Ya,{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(P,{variant:"outline",size:"sm",className:"h-8",onClick:C,disabled:u,children:[e.jsx(va,{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(D,{placeholder:t("traffic_reset_logs.filters.search_user"),value:s.getColumn("user_email")?.getFilterValue()??"",onChange:p=>s.getColumn("user_email")?.setFilterValue(p.target.valu
Line truncated
` +a("columns.online_status.offline_duration.seconds",{count:u})}return e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:b("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(ce,{side:"bottom",className:"max-w-[280px]",children:e.jsx("p",{className:"whitespace-pre-line text-sm",children:o})})]})})},enableSorting:!1,enableHiding:!1},{accessorKey:"online_count",header:({column:i})=>e.jsx(z,{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(ue,{children:[e.jsx(xe,{children:e.jsx("div",{className:"flex items-center gap-1.5",children:e.jsxs(U,{variant:"outline",className:b("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(ce,{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(z,{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:b("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(z,{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(z,{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:b("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(z,{column:i,title:a("columns.used_traffic")}),cell:({row:i})=>{const l=Oe(i.original?.total_used),d=Oe(i.original?.transfer_enable),u=i.original?.total_used/i.original?.transfer_enable*100||0;return e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{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:b("h-full rounded-full transition-all",u>90?"bg-destructive":"bg-primary"),style:{width: ` $ { Math . min ( u , 100 ) } % ` }})})]})}),e.jsx(ce,{side:"bottom",children:e.jsxs("p",{className:"text-sm",children:[a("columns.total_traffic"),": ",d]})})]})})}},{accessorKey:"transfer_enable",header:({column:i})=>e.jsx(z,{column:i,title:a("columns.total_traffic")}),cell:({row:i})=>e.jsx("div",{className:"font-medium text-muted-foreground",children:Oe(i.original?.transfer_enable)})},{accessorKey:"expired_at",header:({column:i})=>e.jsx(z,{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,o=l!=null?new Date(l*1e3):null,c=o!=null?Math.ceil((o.getTime()-Date.now())/(1e3*60*60*24)):null;return e.jsx(be,{delayDuration:100,children:e.jsxs(ue,{children:[e.jsx(xe,{className:"block w-full",children:e.jsx(U,{variant:"outline",className:b("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"):me(l,"YYYY-MM-DD")})}),e.jsx(ce,{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"),": ",me(l)]}),e.jsx("p",{className:b("text-sm font-medium",u?"text-destructive":"text-success"),children:u?a("columns.expire_status.expired",{days:Math.abs(c??0)}):a("columns.expire_status.remaining",{days:c??0})})]}):e.jsx("p",{className:"text-sm font-medium",children:a("columns.expire_status.permanent")})})]})})}},{accessorKey:"bal
Line truncated
` ),w=new Blob([g],{type:"text/csv;charset=utf-8;"}),R=document.createElement("a"),H=URL.createObjectURL(w);R.setAttribute("href",H),R.setAttribute("download", ` traffic - reset - logs - $ { Pe ( new Date , "yyyy-MM-dd" ) } . csv ` ),R.style.visibility="hidden",document.body.appendChild(R),R.click(),document.body.removeChild(R),A.success(t("traffic_reset_logs.actions.export_success"))}catch(f){console.error("导出失败:",f),A.error(t("traffic_reset_logs.actions.export_failed"))}finally{o(!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(P,{placeholder:t("traffic_reset_logs.filters.search_user"),value:s.getColumn("user_email")?.getFilterValue()??"",onChange:f=>s.getColumn("user_email")?.setFilterValue(f.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:f=>s.getColumn("reset_type")?.setFilterValue(f==="all"?"":f),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( $ ,{value:"all",children:t("traffic_reset_logs.filters.all_types")}),c.map(f=>e.jsx( $ ,{value:f.value,children:f.label},f.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:f=>s.getColumn("trigger_source")?.setFilterValue(f==="all"?"":f),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( $ ,{value:"all",children:t("traffic_reset_logs.filters.all_sources")}),h.map(f=>e.jsx( $ ,{value:f.value,children:f.label},f.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(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",className:b("h-9 w-full justify-start text-left font-normal",!a&&"text-muted-foreground"),children:[e.jsx(Ss,{className:"mr-2 h-4 w-4"}),a?Pe(a,"MM-dd"):t("traffic_reset_logs.filters.start_date")]})}),e.jsx(Ze,{className:"w-auto p-0",align:"start",children:e.jsx(vs,{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(os,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(L,{variant:"outline",className:b("h-9 w-full justify-start text-left font-normal",!l&&"text-muted-foreground"),children:[e.jsx(Ss,{className:"mr-2 h-4 w-4"}),l?Pe(l,"MM-dd"):t("traffic_reset_logs.filters.end_date")]})}),e.jsx(Ze,{className:"w-auto p-0",align:"start",children:e.jsx(vs,{mode:"single",selected:l,onSelect:d,initialFocus:!0})})]})]})]}),(a||l)&&e.jsxs(L,{variant:"outline",className:"w-full",onClick:k,children:[e.jsx(rr,{className:"mr-2 h-4 w-4"}),t("traffic_reset_logs.filters.apply_date")]}),r&&e.jsxs(L,{variant:"ghost",onClick:()=>{s.resetColumnFilters(),i(void 0),d(void 0)},className:"w-full",children:[t("traffic_reset_logs.filters.reset"),e.jsx(ms,{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(qn,{children:[e.jsx(ci,{asChild:!0,children:e.jsxs(L,{variant:"outline",size:"sm",className:"h-8",children:[e.jsx(od,{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(Ba,{side:"bottom",className:"h-[85vh]",children:[e.jsxs(Ga,{className:"mb-4",children:[e.jsx(Wa,{children:t("traffic_reset_logs.filters.filter_title")}),e.jsx(Ya,{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(L,{variant:"outline",size:"sm",className:"h-8",onClick:C,disabled:u,children:[e.jsx(va,{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(P,{placeholder:t("traffic_reset_logs.filters.search_user"),value:s.getColumn("user_email")?.getFilterValue()??"",onChange:f=>s.getColumn("user_email")?.setFilterValue(f.target.valu
Line truncated