PageSourceSearch

https://git-hub-new-api.hf.space/static/js/async/1004.dabaa38119.js

js git-hub-new-api.hf.space collected 2026-10-03 16:53:36 UTC 112,414 bytes, 2 lines download raw bytes

1/*! LICENSE: 1004.dabaa38119.js.LICENSE.txt */
2"use strict";(self.rspackChunknewapi_web=self.rspackChunknewapi_web||[]).push([[1004],{24510(e,a){var t=Symbol.for("react.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),x=Symbol.for("react.lazy");function h(e){if("object"==typeof e&&null!==e){var a=e.$$typeof;switch(a){case t:switch(e=e.type){case r:case s:case n:case u:case m:return e;default:switch(e=e&&e.$$typeof){case c:case o:case d:case x:case p:case i:return e;default:return a}}case l:return a}}}Symbol.for("react.offscreen"),Symbol.for("react.module.reference"),a.ForwardRef=d,a.isFragment=function(e){return h(e)===r},a.isMemo=function(e){return h(e)===p}},59650(e,a,t){e.exports=t(24510)},62301(e,a,t){var l=t
2(79015);t(65311);var r=t(27953),n=t(47801);function s(e){let{...a}=e;return(0,l.jsx)(r._s.Root,{"data-slot":"drawer",...a})}function i(e){let{...a}=e;return(0,l.jsx)(r._s.Trigger,{"data-slot":"drawer-trigger",...a})}function o(e){let{...a}=e;return(0,l.jsx)(r._s.Portal,{"data-slot":"drawer-portal",...a})}function c(e){let{className:a,...t}=e;return(0,l.jsx)(r._s.Overlay,{"data-slot":"drawer-overlay",className:(0,n.cn)("data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 z-50 bg-black/10 supports-backdrop-filter:backdrop-blur-xs",a),...t})}function d(e){let{className:a,children:t,...s}=e;return(0,l.jsxs)(o,{"data-slot":"drawer-portal",children:[(0,l.jsx)(c,{}),(0,l.jsxs)(r._s.Content,{"data-slot":"drawer-content",className:(0,n.cn)("group/drawer-content bg-background text-foreground fixed z-50 flex h-auto flex-col overflow-hidden text-sm shadow-none data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm",a),...s,children:[(0,l.jsx)("div",{className:"bg-muted mx-auto mt-4 hidden h-1 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),t]})]})}function u(e){let{className:a,...t}=e;return(0,l.jsx)("div",{"data-slot":"drawer-header",className:(0,n.cn)("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-0.5 md:text-left",a),...t})}function m(e){let{className:a,...t}=e;return(0,l.jsx)("div",{"data-slot":"drawer-footer",className:(0,n.cn)("mt-auto flex flex-col gap-2 p-4",a),...t})}function p(e){let{className:a,...t}=e;return(0,l.jsx)(r._s.Title,{"data-slot":"drawer-title",className:(0,n.cn)("text-foreground text-base font-medium",a),...t})}function x(e){let{className:a,...t}=e;return(0,l.jsx)(r._s.Description,{"data-slot":"drawer-description",className:(0,n.cn)("text-muted-foreground text-sm",a),...t})}t.d(a,{BE:()=>u,I6:()=>x,Uz:()=>i,_s:()=>s,gk:()=>p,tb:()=>m,zj:()=>d})},46978(e,a,t){var l=t(48041),r=t(65965);function n(){let{user:e}=(0,r.n)(e=>e.auth);return(e?.role??0)>=l.z7.ADMIN}t.d(a,{h:()=>n})},10625(e,a,t){var l=t(65311);let r="page-size";function n(e){let{search:a,navigate:t,pagination:n,globalFilter:s,columnFilters:i=[]}=e,o=n?.pageKey??"page",c=n?.pageSizeKey??"pageSize",d=n?.defaultPage??1,u=n?.defaultPageSize??20,m=s?.key??"filter",p=s?.enabled??!0,x=s?.trim??!0,h=(0,l.useMemo)(()=>{let e=[];for(let t of i){let l=a[t.searchKey],r=t.deserialize??(e=>e);if("string"===t.type){let a=r(l)??"";"string"==typeof a&&""!==a.trim()&&e.push({id:t.columnId,value:a})}else{let a=r(l)??[];Array.isArray(a)&&a.length>0&&e.push({id:t.columnId,value:a})}}return e},[i,a]),[g,f]=(0,l.useState)(h);(0,l.useEffect)(()=>{f(h)},[a]);let b=(0,l.useMemo)(()=>{let e=a[o],t=a[c];return{pageIndex:Math.max(0,("number"==typeof e?e:d)-1),pageSize:"number"==typeof t?t:function(){try{let e=parseInt(localStorage.getItem(r)??"",10);return e>0?e:void 0}catch{return}}()??u}},[a,o,c,d,u]),[y,j]=(0,l.useState)(()=>{if(!p)return;let e=a[m];return"string"==typeof e?e:""}),v=p?e=>{let a="function"==typeof e?e(y??""):e,l=x?a.trim():a;j(l),t({search:e=>({...e,[o]:void 0,[m]:l||void 0})})}:void 0;return{globalFilter:p?y??"":void 0,onGlobalFilterChange:v,columnFilters:g,onColumnFiltersChange:e=>{let a="function"==typeof e?e(g):e;f(a);let l={};for(let e of i){let t=a.find(a=>a.id===e.columnId),r=e.serialize??(e=>e);if("string"===e.type){let a="string"==typeof t?.value?t.value:"";l[e.searchKey]=""!==a.trim()?r(a):void 0}else{let a=Array.isArray(t?.value)?t.value:[];l[e.searchKey]=a.length>0?r(a):void 0}}t({search:e=>({...e,[o]:void 0,...l})})},pagination:b,onPaginationChange:e=>{let a="function"==typeof e?e(b):e,l=a.pageIndex+1,n=a.pageSize;n!==b.pageSize&&function(e){try{localStorage.setItem(r,String(e))}catch{}}(n),t({search:e=>({...e,[o]:l<=d?void 0:l,[c]:n})})},ensurePageInRange:function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{resetTo:"first"},r=a[o],n="number"==typeof r?r:d;e>0&&n>e&&t({replace:!0,search:a=>({...a,[o]:"last"===l.resetTo?e:void 0})})}}}t.d(a,{c:()=>n})},74116(e,a,t){t.r(a),t.d(a,{component:()=>tL});
2var l=t(79015),r=t(28585),n=t(72473),s=t(65311),i=t(89077),o=t(51571),c=t(60106),d=t(26028),u=t(31155),m=t(77577),p=t(97710);function x(e){let{t:a}=(0,i.Bd)(),[t,r]=(0,s.useState)(!1),[n,o]=(0,s.useState)(null),c=(0,s.useRef)(0);(0,s.useEffect)(()=>{if(!e.open||!e.target?.rule_name||!e.target?.key_fp)return void o(null);let t=++c.current;r(!0),o(null),(0,p.Mb)(e.target).then(e=>{t===c.current&&(e.success?o(e.data||{}):d.oR.error(e.message||a("Request failed")))}).catch(()=>{t===c.current&&d.oR.error(a("Request failed"))}).finally(()=>{t===c.current&&r(!1)})},[e.open,e.target,a]);let x=(0,s.useMemo)(()=>{if(!n)return[];let t=[],l=Number(n.hit||0),r=Number(n.total||0);(n.rule_name||e.target?.rule_name)&&t.push({key:a("Rule"),value:n.rule_name||e.target?.rule_name||""}),(n.using_group||e.target?.using_group)&&t.push({key:a("Group"),value:n.using_group||e.target?.using_group||""}),e.target?.key_hint&&t.push({key:a("Key Summary"),value:e.target.key_hint}),(n.key_fp||e.target?.key_fp)&&t.push({key:a("Key Fingerprint"),value:n.key_fp||e.target?.key_fp||""}),Number(n.window_seconds||0)>0&&t.push({key:a("TTL (seconds)"),value:n.window_seconds}),r>0&&t.push({key:a("Hit Rate"),value:`${l}/${r} (${function(e,a){if(!a||a<=0)return"-";let t=e/a*100;return Number.isFinite(t)?`${t.toFixed(2)}%`:"-"}(l,r)})`}),Number(n.last_seen_at||0)>0&&t.push({key:a("Last Seen"),value:(0,m.fk)(n.last_seen_at)});let s=Number(n.prompt_tokens||0),i=Number(n.cached_tokens||0),o=Number(n.completion_tokens||0),c=Number(n.total_tokens||0);return s>0&&t.push({key:"Prompt tokens",value:s}),i>0&&t.push({key:"Cached tokens",value:i}),o>0&&t.push({key:"Completion tokens",value:o}),c>0&&t.push({key:"Total tokens",value:c}),t},[n,e.target,a]);return(0,l.jsxs)(u.l,{open:e.open,onOpenChange:e.onOpenChange,title:a("Channel Affinity: Upstream Cache Hit"),contentClassName:"sm:max-w-lg",contentHeight:"auto",bodyClassName:"space-y-4",children:[(0,l.jsx)("p",{className:"text-muted-foreground text-xs",children:a("Hit criteria: If cached tokens exist in usage, it counts as a hit.")}),t?(0,l.jsx)("div",{className:"text-muted-foreground py-8 text-center text-sm",children:a("Loading...")}):x.length>0?(0,l.jsx)("div",{className:"space-y-2",children:x.map(e=>(0,l.jsxs)("div",{className:"flex justify-between gap-4 border-b pb-1 text-sm",children:[(0,l.jsx)("span",{className:"text-muted-foreground",children:e.key}),(0,l.jsx)("span",{className:"text-right font-medium break-all",children:e.value})]},e.key))}):(0,l.jsx)("div",{className:"text-muted-foreground py-8 text-center text-sm",children:a("No data available")})]})}var h=t(81516),g=t(70326),f=t(62978),b=t(63228);let y={quota:0,rpm:0,tpm:0},j={items:[],total:0},v=[{value:0,label:"Unknown",color:"default"},{value:1,label:"Top-up",color:"cyan"},{value:2,label:"Consume",color:"green"},{value:3,label:"Manage",color:"orange"},{value:4,label:"System",color:"purple"},{value:5,label:"Error",color:"red"},{value:6,label:"Refund",color:"blue"},{value:7,label:"Login",color:"teal"}],_=[{label:"All Types",value:"0"},...v.filter(e=>0!==e.value).map(e=>({label:e.label,value:String(e.value)}))],N="IMAGINE",k="UPSCALE",w="VIDEO",C="EDITS",S="VARIATION",A="HIGH_VARIATION",T="LOW_VARIATION",I="DESCRIBE",M="BLEND",z="UPLOAD",$="SHORTEN",q="REROLL",D="INPAINT",F="SWAP_FACE",R="ZOOM",K="CUSTOM_ZOOM",P="generate",L="textGenerate",O="firstTailGenerate",E="referenceGenerate",B="remixGenerate",U="SUCCESS",V={[String(1)]:{label:"Submitted",variant:"green"},[String(21)]:{label:"Waiting",variant:"lime"},[String(22)]:{label:"Duplicate",variant:"orange"},[String(0)]:{label:"Not Submitted",variant:"yellow"}},W=[0,2,5,6],H=[2,5];function G(e){return W.includes(e)}function Y(e){return H.includes(e)}function Q(e){return v.find(a=>a.value===e)||v["0"]}function Z(){let e=new Date,a=new Date(e);return a.setHours(0,0,0,0),{start:a,end:new Date(e.getTime()+36e5)}}function J(e){let a=new URLSearchParams;return Object.entries(e).forEach(e=>{let[t,l]=e;null!=l&&""!==l&&a.append(t,String(l))}),a}function X(e,a){let t=e.startTime??e.endTime?null:Z(),l=(e,t)=>{let l,r=e||t?.getTime();return r?(l=r,a?l:Math.floor(l/1e3)):void 0};return{start_timestamp:l(e.startTime,t?.start),end_timestamp:l(e.endTime,t?.end)}}function ee(e){let{page:a,pageSize:t,searchParams:l,columnFilters:r=[],isAdmin:n}=e,s=e=>{let a=e=>{let a=Number(e);return Number.isFinite(a)?a:void 0};return Array.isArray(e)&&1===e.length?a(e[0]):"string"==typeof e&&""!==e?a(e):void 0},i={p:a,page_size:t,...l.type?{type:s(l.type)}:{},...l.model?{model_name:String(l.model)}
2:{},...l.token?{token_name:String(l.token)}:{},...l.group?{group:String(l.group)}:{},...n&&l.channel?{channel:Number(l.channel)||0}:{},...n&&l.username?{username:String(l.username)}:{},...l.requestId?{request_id:String(l.requestId)}:{},...l.upstreamRequestId?{upstream_request_id:String(l.upstreamRequestId)}:{},...X(l,!1)};return r.length>0&&r.forEach(e=>{let{id:a,value:t}=e;if(null!=t&&""!==t)switch(a){case"type":i.type=s(t);break;case"model_name":i.model_name=String(t);break;case"token_name":i.token_name=String(t);break;case"group":i.group=String(t);break;case"channel":n&&(i.channel=Number(t)||0);break;case"username":n&&(i.username=String(t))}}),i}async function ea(e){let{logCategory:a,isAdmin:t,page:l,pageSize:r,searchParams:n,columnFilters:s}=e;if("common"===a){let e=ee({page:l,pageSize:r,searchParams:n,columnFilters:s,isAdmin:t});return t?await en(e):await es(e)}let i={...function(e){let{page:a,pageSize:t,searchParams:l,useMilliseconds:r=!1}=e;return{p:a,page_size:t,...l.channel?{channel_id:String(l.channel)}:{},...X(l,r)}}({page:l,pageSize:r,searchParams:n,useMilliseconds:"drawing"===a}),..."drawing"===a?{mj_id:n.filter}:{},..."task"===a?{task_id:n.filter}:{}};return"drawing"===a?t?await ed(i):await eu(i):t?await em(i):await ep(i)}function et(e,a){return a?e:`${e}/self`}async function el(e,a,t){let l=J({p:a.p||1,page_size:a.page_size||20,...a}),r=et(e,t);return(await b.FH.get(`${r}?${l}`)).data}async function er(e,a,t){let l=J(a),r=et(e,t);return(await b.FH.get(`${r}/stat?${l}`)).data}let en=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return el("/api/log",e,!0)},es=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return el("/api/log",e,!1)},ei=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return er("/api/log",e,!0)},eo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return er("/api/log",e,!1)};async function ec(e){return(await b.FH.get(`/api/user/${e}`)).data}let ed=e=>el("/api/mj",e,!0),eu=e=>el("/api/mj",e,!1),em=e=>el("/api/task",e,!0),ep=e=>el("/api/task",e,!1);function ex(e){let{userId:a,open:t,onOpenChange:r}=e,{t:n}=(0,i.Bd)(),[o,c]=(0,s.useState)(null),[p,x]=(0,s.useState)(!1),h=(0,s.useCallback)(async e=>{x(!0);try{let a=await ec(e);a.success?c(a.data||null):d.oR.error(a.message||n("Failed to fetch user information"))}catch(e){console.error("Failed to fetch user info:",e),d.oR.error(n("Failed to fetch user information"))}finally{x(!1)}},[n]);(0,s.useEffect)(()=>{t&&a&&h(a)},[t,a,h]);let b=e=>{let{label:a,value:t}=e;return(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(f.J,{className:"text-muted-foreground text-xs",children:a}),(0,l.jsx)("div",{className:"text-sm font-semibold",children:t})]})};return(0,l.jsx)(u.l,{open:t,onOpenChange:r,title:n("User Information"),description:n("View detailed information about this user including balance, usage statistics, and invitation details."),contentClassName:"sm:max-w-lg",contentHeight:"auto",bodyClassName:"space-y-4",children:p?(0,l.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,l.jsx)(g.A,{className:"text-muted-foreground size-6 animate-spin"})}):o?(0,l.jsxs)("div",{className:"space-y-4 py-4",children:[(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,l.jsx)(b,{label:n("Username"),value:o.username}),o.display_name&&(0,l.jsx)(b,{label:n("Display Name"),value:o.display_name})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,l.jsx)(b,{label:n("Balance"),value:(0,m.eN)(o.quota)}),(0,l.jsx)(b,{label:n("Used Quota"),value:(0,m.eN)(o.used_quota)})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,l.jsx)(b,{label:n("Request Count"),value:(0,m.wk)(o.request_count)}),o.group&&(0,l.jsx)(b,{label:n("User Group"),value:o.group})]}),(o.aff_code||void 0!==o.aff_count||void 0!==o.aff_quota&&o.aff_quota>0)&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[o.aff_code&&(0,l.jsx)(b,{label:n("Invitation Code"),value:o.aff_code}),void 0!==o.aff_count&&(0,l.jsx)(b,{label:n("Invited Users"),value:(0,m.wk)(o.aff_count)})]}),void 0!==o.aff_quota&&o.aff_quota>0&&(0,l.jsx)(b,{label:n("Invitation Quota"),value:(0,m.eN)(o.aff_quota)})]}),o.remark&&(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(f.J,{className:"text-muted-foreground text-xs",children:n("Remark")}),(0,l.jsx)("div",{className:"text-sm leading-relaxed font-semibold break-words",children:o.remark})]})]}):(0,l.jsx)("div",{className:"text-muted-foreground py-8 text-center text-sm",children:n("No user information available")})})}var eh=t(46978);let eg=(0,s.createContext)(void 0);function ef(e){let{children:a}
2=e,[t,r]=(0,s.useState)(null),[n,i]=(0,s.useState)(!1),[o,c]=(0,s.useState)(null),[d,u]=(0,s.useState)(!1),[m,p]=(0,s.useState)(!0),[x,h]=(0,s.useState)("all");return(0,l.jsx)(eg.Provider,{value:{selectedUserId:t,setSelectedUserId:r,userInfoDialogOpen:n,setUserInfoDialogOpen:i,affinityTarget:o,setAffinityTarget:c,affinityDialogOpen:d,setAffinityDialogOpen:u,sensitiveVisible:m,setSensitiveVisible:p,viewScope:x,setViewScope:h},children:a})}function eb(){let e=(0,s.useContext)(eg);if(!e)throw Error("useUsageLogsContext must be used within UsageLogsProvider");return e}function ey(){let e=(0,eh.h)(),{viewScope:a,setViewScope:t}=eb();return{canManageScope:e,viewScope:a,setViewScope:t,isAdminView:e&&"all"===a}}var ej=t(43866),ev=t(13595),e_=t(70085),eN=t(10625),ek=t(47801),ew=t(28213),eC=t(59325),eS=t(68758),eA=t(72744),eT=t(32483),eI=t(52613),eM=t(7803),ez=t(52909),e$=t(41327),eq=t(78373),eD=t(91078);let eF={set:"Set",delete:"Delete",copy:"Copy",move:"Move",append:"Append",prepend:"Prepend",trim_prefix:"Trim Prefix",trim_suffix:"Trim Suffix",ensure_prefix:"Ensure Prefix",ensure_suffix:"Ensure Suffix",trim_space:"Trim Space",to_lower:"To Lower",to_upper:"To Upper",replace:"Replace",regex_replace:"Regex Replace",set_header:"Set Header",delete_header:"Delete Header",copy_header:"Copy Header",move_header:"Move Header",pass_headers:"Pass Headers",sync_fields:"Sync Fields",return_error:"Return Error"};function eR(e){return!!e&&(!0===e.violation_fee||!!e.violation_fee_code||!!e.violation_fee_marker)}function eK(e){if(!e)return null;try{return JSON.parse(e)}catch(e){return console.error("Failed to parse log other field:",e),null}}function eP(e){return e<5?"success":e<10?"warning":"danger"}function eL(e,a){var t;return a<100||e<=0?e<10?"success":e<30?"warning":"danger":(t=a/e)>=30?"success":t>=15?"warning":"danger"}function eO(e){if(!e)return"";try{let a="u">typeof window?window.atob(e):Buffer.from(e,"base64").toString("binary"),t=new Uint8Array(a.length);for(let e=0;e<a.length;e++)t[e]=a.charCodeAt(e);if("u">typeof TextDecoder)return new TextDecoder().decode(t);return decodeURIComponent(Array.prototype.map.call(t,e=>"%"+e.toString(16).padStart(2,"0")).join(""))}catch{return""}}function eE(e){return!!e&&((e.cache_tokens||0)>0||(e.cache_creation_tokens||0)>0||(e.cache_creation_tokens_5m||0)>0||(e.cache_creation_tokens_1h||0)>0)}function eB(e){var a;if(!e||"tiered_expr"!==e.billing_mode)return null;let t=eO(e.expr_b64);if(!t)return null;let l=(0,eD.oK)(t),r=(a=e.matched_tier,0!==l.length&&a&&l.find(e=>{let t=(0,eD.wM)(e.label);return t===(0,eD.wM)(a)&&""!==t})||null);if(!r)return null;let n=eE(e),s=[];for(let e of eD.mq){if(!e.field||"cache"===e.group&&!n)continue;let a=Number(r[e.field]);Number.isFinite(a)&&a>0&&s.push({field:e.field,shortLabel:e.shortLabel,price:a})}return{tiers:l,tier:r,priceEntries:s}}let eU={login:"Logged in successfully via {{method}}","user.create":"Created user {{username}} (role {{role}})","user.update":"Updated user {{username}} (ID: {{id}})","user.delete":"Deleted user {{username}} (ID: {{id}})","user.manage":"Performed {{action}} on user {{username}} (ID: {{id}})","user.quota_add":"Increased user quota by {{quota}}","user.quota_subtract":"Decreased user quota by {{quota}}","user.quota_override":"Overrode user quota from {{from}} to {{to}}","user.binding_clear":"Cleared {{bindingType}} binding for user {{username}}","user.2fa_disable":"Force-disabled two-factor authentication for the user","user.passkey_register":"Registered a passkey","user.passkey_delete":"Deleted a passkey","user.topup_complete":"Completed top-up order for the user","user.reset_passkey":"Reset the user passkey","user.oauth_unbind":"Removed an OAuth binding for the user","option.update":"Updated system setting {{key}}","option.payment_compliance":"Confirmed payment compliance","option.reset_ratio":"Reset model ratios","option.clear_affinity_cache":"Cleared channel affinity cache","custom_oauth.create":"Created a custom OAuth provider","custom_oauth.update":"Updated a custom OAuth provider","custom_oauth.delete":"Deleted a custom OAuth provider","performance.clear_disk_cache":"Cleared disk cache","performance.gc":"Triggered garbage collection","performance.clear_logs":"Cleared log files","channel.create":"Created channel {{name}} (type {{type}}, count {{count}})","channel.update":"Updated channel {{name}} (ID: {{id}})","channel.delete":"Deleted channel {{name}} (ID: {{id}})","channel.delete_batch":"Batch deleted {{count}} channels","channel.delete_disabled":"Deleted all disabled channels ({{count}})","channel.key_view":"Viewed channel key {{name}} (ID: {{id}})","channel.tag_disable":"Disabled channels with tag {{tag}}","channel.tag_enable":"Enabled channels with tag {{tag}}","channel.tag_edit":"Edited channels with tag {{tag}}","channel.tag_batch_set":"Batch set tag for {{count}} channels","channel.copy":"Copied channel (source ID: {{sourceId}}) to {{name}} (new ID: {{id}})","channel.multi_key_manage":"Multi-key management {{action}} on channel (ID: {{id}})","channel.upstream_apply":"Applied upstream model changes to channel (ID: {{id}})","channel.upstream_apply_all":"Applied upstream model changes to {{count}} channels","redemption.create":"Created {{count}} redemption codes named {{name}} ({{quota}} each)","redemption.update":"Updated a redemption code","redemption.delete":"Deleted a redemption code","redemption.delete_invalid":"Deleted invali
2d redemption codes","prefill_group.create":"Created a prefill group","prefill_group.update":"Updated a prefill group","prefill_group.delete":"Deleted a prefill group","vendor.create":"Created a vendor","vendor.update":"Updated a vendor","vendor.delete":"Deleted a vendor","model.create":"Created a model","model.update":"Updated a model","model.delete":"Deleted a model","model.sync_upstream":"Synced upstream models","deployment.create":"Created a deployment","deployment.update":"Updated a deployment","deployment.delete":"Deleted a deployment","subscription.plan_create":"Created a subscription plan","subscription.plan_update":"Updated a subscription plan","subscription.bind":"Bound a subscription","log.clear":"Cleared historical logs",generic:"{{method}} {{route}}"};function eV(e,a){let t=e?.op;if(!t?.action)return null;let l=eU[t.action];return l?a(l,t.params??{}):null}var eW=t(41948),eH=t(70556),eG=t(70367),eY=t(49979),eQ=t(60033),eZ=t(26464),eJ=t(62348),eX=t(40946);let e0=(0,eX.A)("user-cog",[["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m14.305 16.53.923-.382",key:"1itpsq"}],["path",{d:"m15.228 13.852-.923-.383",key:"eplpkm"}],["path",{d:"m16.852 12.228-.383-.923",key:"13v3q0"}],["path",{d:"m16.852 17.772-.383.924",key:"1i8mnm"}],["path",{d:"m19.148 12.228.383-.923",key:"1q8j1v"}],["path",{d:"m19.53 18.696-.382-.924",key:"vk1qj3"}],["path",{d:"m20.772 13.852.924-.383",key:"n880s0"}],["path",{d:"m20.772 16.148.924.383",key:"1g6xey"}],["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);var e1=t(24014);let e2=(0,eX.A)("headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]),e5=(0,eX.A)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),e3=(0,eX.A)("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);var e4=t(53286),e6=t(73178),e8=t(98847),e7=t(70952),e9=t(95871);let ae="local",aa={status:"Status",models:"Models",group:"Group",type:"Type",base_url:"Base URL",key:"Key"};function at(e){return"success"===e?"text-emerald-600":"warning"===e?"text-amber-600":"text-rose-600"}function al(e){return(0,l.jsxs)("div",{className:"grid min-w-0 grid-cols-[5.25rem_minmax(0,1fr)] gap-2 text-sm sm:grid-cols-[7rem_minmax(0,1fr)] sm:gap-3",children:[(0,l.jsx)("span",{className:"text-muted-foreground min-w-0 text-xs",children:e.label}),(0,l.jsx)("span",{className:(0,ek.cn)("max-w-full min-w-0 text-xs break-all sm:wrap-break-word",e.mono&&"font-mono",e.muted&&"text-muted-foreground"),children:e.value})]})}function ar(e){let a="danger"===e.variant,t=a?"destructive":e.iconTone;return(0,l.jsxs)("div",{className:"min-w-0 space-y-1.5",children:[(0,l.jsxs)(f.J,{className:(0,ek.cn)("flex items-center gap-1.5 text-xs font-semibold",a&&"text-red-500"),children:[e.icon&&(0,l.jsx)(e8.f,{tone:t,size:"xs",children:e.icon}),e.label]}),(0,l.jsx)("div",{className:(0,ek.cn)("min-w-0 space-y-1 overflow-hidden rounded-md border p-2.5 max-sm:p-2",a?"border-red-200 bg-red-50 dark:border-red-900 dark:bg-red-950/20":"bg-muted/30"),children:e.children})]})}function an(e,a){switch(a?.usage_billing_path){case ae:return e("Local Billing");case"billing-usage-openai":return e("Upstream Response (billing-usage-openai)");case"billing-usage-openai-estimated":return e("Upstream Response (billing-usage-openai-estimated)");case"billing-usage-anthropic":return e("Upstream Response (billing-usage-anthropic)");case"billing-usage-anthropic-estimated":return e("Upstream Response (billing-usage-anthropic-estimated)");case"billing-usage-gemini":return e("Upstream Response (billing-usage-gemini)");case"billing-usage-gemini-estimated":return e("Upstream Response (billing-usage-gemini-estimated)");case"upstream":return e("Upstream Response");default:return e(a?.local_count_tokens?"Local Billing":"Upstream Response")}}function as(e){let{t:a}=(0,i.Bd)(),{log:t,other:r,isAdmin:n}=e,s=(r.model_price??0)>0,o=!0===r.claude,c="tiered_expr"===r.billing_mode,d=eB(r),u=[],p={digitsLarge:4,digitsSmall:6,abbreviate:!1},x=e=>(0,eq.AM)(e,p),h=null!=r.model_ratio?2*r.model_ratio:0;if(c)if(u.push({label:a("Billing Mode"),value:a("Dynamic Pricing")}),d)for(let e of(d.tier.label&&u.push({label:a("Matched Tier"),value:d.tier.label}
2),d.priceEntries))u.push({label:a(e.shortLabel),value:`${x(e.price)}/M`});else u.push({label:a("Matched Tier"),value:a("No matching results")});else s?(u.push({label:a("Billing Mode"),value:a("Per-call")}),null!=r.model_price&&u.push({label:a("Model Price"),value:x(r.model_price)})):(u.push({label:a("Billing Mode"),value:a("Per-token")}),null!=r.model_ratio&&u.push({label:a("Input"),value:`${x(h)}/M`}),null!=r.completion_ratio&&null!=r.model_ratio&&u.push({label:a("Output"),value:`${x(h*r.completion_ratio)}/M`}));let g=r.user_group_ratio,f=null!=g&&Number.isFinite(g)&&-1!==g,b=f?g:r.group_ratio;return(null!=b&&Number.isFinite(b)&&u.push({label:a(f?"User Exclusive Ratio":"Group Ratio"),value:`${null==b?"-":b.toFixed(4)}x`}),!c&&o&&eE(r)&&(null!=r.cache_ratio&&1!==r.cache_ratio&&u.push({label:a("Cache Read"),value:`${x(h*r.cache_ratio)}/M`}),null!=r.cache_creation_ratio&&1!==r.cache_creation_ratio&&u.push({label:a("Cache Creation"),value:`${x(h*r.cache_creation_ratio)}/M`}),null!=r.cache_creation_ratio_5m&&0!==r.cache_creation_ratio_5m&&u.push({label:a("Cache Creation (5m)"),value:`${x(h*r.cache_creation_ratio_5m)}/M`}),null!=r.cache_creation_ratio_1h&&0!==r.cache_creation_ratio_1h&&u.push({label:a("Cache Creation (1h)"),value:`${x(h*r.cache_creation_ratio_1h)}/M`})),c||(null!=r.audio_ratio&&1!==r.audio_ratio&&u.push({label:a("Audio input"),value:`${x(h*r.audio_ratio)}/M`}),null!=r.audio_completion_ratio&&1!==r.audio_completion_ratio&&u.push({label:a("Audio output"),value:`${x(h*r.audio_completion_ratio)}/M`}),null!=r.image_ratio&&1!==r.image_ratio&&u.push({label:a("Image input"),value:`${x(h*r.image_ratio)}/M`})),r.web_search&&r.web_search_call_count&&u.push({label:a("Web Search"),value:`${r.web_search_call_count}x${r.web_search_price?` (${x(r.web_search_price)})`:""}`}),r.file_search&&r.file_search_call_count&&u.push({label:a("File Search"),value:`${r.file_search_call_count}x${r.file_search_price?` (${x(r.file_search_price)})`:""}`}),r.image_generation_call&&r.image_generation_call_price&&u.push({label:a("Image Generation"),value:x(r.image_generation_call_price)}),r.audio_input_seperate_price&&r.audio_input_price&&u.push({label:a("Audio Input Price"),value:x(r.audio_input_price)}),n&&r.admin_info&&u.push({label:a("Billing Path"),value:an(a,r.admin_info)}),u.push({label:a("Total Cost"),value:(0,m.qW)(t.quota)}),0===u.length)?null:(0,l.jsx)(ar,{label:a("Billing Details"),children:u.map(e=>(0,l.jsx)(al,{label:e.label,value:e.value,mono:!0},e.label))})}function ai(e){let{t:a}=(0,i.Bd)(),{log:t,other:r}=e,n=t.prompt_tokens||0,s=t.completion_tokens||0,o=r.cache_tokens||0,c=r.cache_creation_tokens||0,d=r.cache_creation_tokens_5m||0,u=r.cache_creation_tokens_1h||0;if(!(n>0||s>0))return null;let m=[];return m.push({label:a("Input Tokens"),value:n.toLocaleString()}),m.push({label:a("Output Tokens"),value:s.toLocaleString()}),o>0&&m.push({label:a("Cache Read"),value:o.toLocaleString()}),c>0&&0===d&&0===u&&m.push({label:a("Cache Write"),value:c.toLocaleString()}),d>0&&m.push({label:a("Cache Write (5m)"),value:d.toLocaleString()}),u>0&&m.push({label:a("Cache Write (1h)"),value:u.toLocaleString()}),r.image&&r.image_output&&m.push({label:a("Image Tokens"),value:r.image_output.toLocaleString()}),(0,l.jsx)(ar,{label:a("Token Breakdown"),children:m.map(e=>(0,l.jsx)(al,{label:e.label,value:e.value,mono:!0},e.label))})}function ao(e){var a,t;let{t:r}=(0,i.Bd)(),{copiedText:n,copyToClipboard:s}=(0,e9.C)({notify:!1}),o=e.log.content??"",c=eK(e.log.other),d=Q(e.log.type),p=eR(c),x=6===e.log.type,h=2===e.log.type,g=1===e.log.type,b=3===e.log.type,y=c?.billing_source==="subscription",j=h&&!p&&c?.billing_mode==="tiered_expr"&&!!c?.expr_b64,v=c?.ws||c?.audio,_=Y(e.log.type),N=!!e.log.ip&&(_||e.isAdmin&&g),k=c?.admin_info,w=g&&e.isAdmin&&k?[k.payment_method&&{label:r("Order Payment Method"),value:k.payment_method},k.callback_payment_method&&{label:r("Callback Payment Method"),value:k.callback_payment_method},k.caller_ip&&{label:r("Callback Caller IP"),value:k.caller_ip},k.server_ip&&{label:r("Server IP"),value:k.server_ip},k.node_name&&{label:r("Node Name"),value:k.node_name},k.version&&{label:r("System Version"),value:k.version}
2].filter(Boolean):[],C=g&&e.isAdmin&&!k,S=g&&e.isAdmin&&(w.length>0||C),A=(()=>{if(!b||!e.isAdmin||!k)return null;let a=k.admin_username,t=k.admin_id,l=null!=a&&""!==String(a).trim(),r=null!=t&&""!==String(t).trim();return l||r?l&&r?`${a} (ID: ${t})`:l?String(a):`ID: ${t}`:null})(),T=b&&e.isAdmin&&k?.auth_method?"access_token"===k.auth_method?r("Access Token"):"session"===k.auth_method?r("Session"):String(k.auth_method):"",I=eV(c,r),M=b&&e.isAdmin?c?.audit_info:void 0,z=(b&&e.isAdmin&&Array.isArray(c?.op?.params?.changed_fields)?c.op.params.changed_fields:[]).map(e=>r(aa[e]??e)).join(", "),$=b&&e.isAdmin&&(null!=I||null!=M),q=7===e.log.type,D=q?[c?.login_method&&{label:r("Login Method"),value:String(c.login_method)},e.log.ip&&{label:r("IP Address"),value:e.log.ip},c?.user_agent&&{label:r("User Agent"),value:String(c.user_agent)}].filter(Boolean):[],F=c&&Array.isArray(c.request_conversion)?c.request_conversion.filter(Boolean):[],R=F.length<=1?r("Native format"):F.join(" -> "),K=e.isAdmin&&6!==e.log.type&&(c?.request_path||F.length>0),P=c?.admin_info?.use_channel,L=P&&P.length>0?P.join(" → "):void 0,O="green";return c?.reasoning_effort==="high"?O="orange":c?.reasoning_effort==="medium"&&(O="yellow"),(0,l.jsx)(u.l,{open:e.open,onOpenChange:e.onOpenChange,title:(0,l.jsxs)(l.Fragment,{children:[r("Log Details"),(0,l.jsx)(eT.Wh,{label:r(d.label),variant:d.color,size:"sm",copyable:!1})]}),description:r("View the complete details for this log entry"),contentClassName:(0,ek.cn)("min-w-0 overflow-hidden","max-sm:max-h-[calc(100dvh-1.5rem)] max-sm:w-[calc(100vw-1.5rem)] max-sm:max-w-[calc(100vw-1.5rem)] max-sm:p-4",j?"sm:max-w-4xl lg:max-w-5xl":"sm:max-w-lg"),headerClassName:"max-sm:gap-1",titleClassName:"flex items-center gap-2 text-base",descriptionClassName:"sr-only",contentHeight:"min(72dvh, 720px)",bodyClassName:"pr-2 sm:pr-4",children:(0,l.jsxs)("div",{className:"w-full max-w-full min-w-0 space-y-2.5 overflow-x-hidden py-1 sm:space-y-3",children:[(0,l.jsxs)("div",{className:"min-w-0 space-y-1",children:[e.log.request_id&&(0,l.jsx)(al,{label:r("Request ID"),value:e.log.request_id,mono:!0}),e.log.upstream_request_id&&(0,l.jsx)(al,{label:r("Upstream Request ID"),value:e.log.upstream_request_id,mono:!0}),e.isAdmin&&e.log.channel>0&&(0,l.jsx)(al,{label:r("Channel"),value:(0,l.jsxs)("span",{children:[e.log.channel,e.log.channel_name&&(0,l.jsxs)("span",{className:"text-muted-foreground",children:[" ","(",e.log.channel_name,")"]})]}),mono:!0}),L&&e.isAdmin&&(0,l.jsx)(al,{label:r("Retry Chain"),value:L,mono:!0}),e.log.token_name&&(0,l.jsx)(al,{label:r("Token"),value:e.log.token_name,mono:!0}),(e.log.group||c?.group)&&(0,l.jsx)(al,{label:r("Group"),value:e.log.group||c?.group||"",mono:!0}),N&&(0,l.jsx)(al,{label:r("IP Address"),value:(0,l.jsxs)("span",{className:"flex items-center gap-1",children:[(0,l.jsx)(eW.A,{className:"size-3 text-amber-500","aria-hidden":"true"}),e.log.ip]}),mono:!0}),_&&e.log.use_time>0&&(0,l.jsx)(al,{label:r("Response Time"),value:(0,l.jsxs)("span",{className:(0,ek.cn)("font-medium",at(eL(e.log.use_time,e.log.completion_tokens))),children:[(0,m.KK)(e.log.use_time),e.log.is_stream&&c?.frt!=null&&c.frt>0&&(0,l.jsxs)("span",{className:(0,ek.cn)("font-normal",at(eP(c.frt/1e3))),children:[" ","(FRT: ",(0,m.KK)(c.frt/1e3),")"]})]})})]}),K&&(0,l.jsx)(ar,{label:r("Request Conversion"),children:(0,l.jsxs)("div",{className:"relative min-w-0",children:[(0,l.jsx)(e6.$,{variant:"ghost",size:"sm",className:"absolute top-0 right-0 h-5 w-5 p-0",onClick:()=>s(R),title:r("Copy to clipboard"),"aria-label":r("Copy to clipboard"),children:n===R?(0,l.jsx)(eH.A,{className:"size-3 text-green-600"}):(0,l.jsx)(eG.A,{className:"size-3"})}),(0,l.jsxs)("div",{className:"min-w-0 space-y-1 pr-6",children:[c?.request_path&&(0,l.jsx)(al,{label:r("Path"),value:c.request_path,mono:!0}),(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-1.5 text-xs",children:[(0,l.jsx)(eY.A,{className:"text-muted-foreground size-3","aria-hidden":"true"}),(0,l.jsx)("span",{className:"min-w-0 break-all sm:wrap-break-word",children:R})]})]})]})}),e.isAdmin&&c?.admin_info?.quota_saturation&&(0,l.jsxs)(ar,{icon:(0,l.jsx)(eQ.A,{className:"size-3.5","aria-hidden":"true"}),label:r("Quota clamped"),variant:"danger",children:[(0,l.jsx)("p",{className:"mb-1 text-xs wrap-break-word",children:r("Quota saturation protection triggered")}),(0,l.jsx)(al,{label:r("Kind"),value:(a=c.admin_info.quota_saturation.kind,"overflow"===a?r("Overflow"):"underflow"===a?r("Underflow"):r("Invalid (NaN)"))}),(0,l.jsx)(al,{label:r("Original value"),value:String(c.admin_info.quota_saturation.original),mono:!0}),(0,l.jsx)(al,{label:r("Clamped to"),value:String(c.admin_info.quota_saturation.clamped),mono:!0}),(0,l.jsx)(al,{label:r("Operation"),value:c.admin_info.quota_saturation.op,mono:!0})]}),e.isAdmin&&c?.reject_reason&&(0,l.jsx)(ar,{icon:(0,l.jsx)(eQ.A,{className:"size-3.5","aria-hidden":"true"}),label:r("Reject Reason"),variant:"danger",children:(0,l.jsx)("p",{className:"text-xs wrap-break-word",children:c.reject_reason})}),p&&c&&(0,l.jsxs)(ar,{icon:(0,l.jsx)(eQ.A,{className:"size-3.5","aria-hidden":"true"}),label:r("Violation Fee"),variant:"danger",children:[c.violation_fee_code&&(0,l.jsx)(al,{label:r("Violation Code"),value:c.violation_fee_code,mono:!0}),c.violation_fee_marker&&(0,l.jsx)(al,{label:r("Violation Marker"),value:c.violation_fee_marker}),(0,l.jsx)(al,{label:r("Fee Amount"),value:(0,m.qW)(c.fee_quota??e.log.quota),mono:!0})]}),x&&c&&(c.task_id||c.reason)&&(0,l.jsxs)(ar,{label:r("Refund Details"),children:[c.task_id&&(0,l.jsx)(al,{label:r("Task ID"),value:c.task_id,mono:!0}),c.reason&&(0,l.jsx)(al,{label:r("Reason"),value:c.reason})]}),S&&(0,l.jsxs)(ar,{icon:(0,l.jsx)(eZ.A,{className:"size-3.5","aria-hidden":"true"}),iconTone:"success",label:r("Top-up Audit Info"),children:[w.map(e=>(0,l.jsx)(al,{label:e.label,value:e.value,mono:!0},e.label)),C&&(0,l.jsxs)("div",{className:"flex items-start gap-1.5 text-xs text-amber-600 dar
2k:text-amber-400",children:[(0,l.jsx)(eJ.A,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),(0,l.jsx)("span",{children:r("This historical record predates audit-info tracking and cannot be backfilled. The current instance already records server IP, callback IP, payment method, and system version for new top-ups going forward.")})]})]}),A&&(0,l.jsx)(al,{label:(0,l.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,l.jsx)(e0,{className:"text-muted-foreground size-3.5","aria-hidden":"true"}),r("Operator Admin")]}),value:A,mono:!0}),$&&(0,l.jsxs)(ar,{icon:(0,l.jsx)(eZ.A,{className:"size-3.5","aria-hidden":"true"}),iconTone:"info",label:r("Operation Audit Info"),children:[null!=I&&(0,l.jsx)(al,{label:r("Operation"),value:I}),""!==T&&(0,l.jsx)(al,{label:r("Authentication Method"),value:T}),""!==z&&(0,l.jsx)(al,{label:r("Changed Fields"),value:z}),M?.method&&M?.route&&(0,l.jsx)(al,{label:r("Request"),value:`${M.method} ${M.route}`,mono:!0}),M?.status!=null&&(0,l.jsx)(al,{label:r("Result"),value:
2M.success?`${r("Success")} (${M.status})`:`${r("Failed")} (${M.status})`,mono:!0})]}),q&&D.length>0&&(0,l.jsxs)(ar,{icon:(0,l.jsx)(e1.A,{className:"size-3.5","aria-hidden":"true"}),iconTone:"info",label:r("Login Info"),children:[null!=I&&(0,l.jsx)(al,{label:r("Operation"),value:I}),D.map(e=>(0,l.jsx)(al,{label:e.label,value:e.value,mono:!0},e.label))]}),v&&c&&(0,l.jsxs)(ar,{icon:(0,l.jsx)(e2,{className:"size-3.5","aria-hidden":"true"}),iconTone:"chart-4",label:r("Audio Tokens"),children:[null!=c.audio_input&&c.audio_input>0&&(0,l.jsx)(al,{label:r("Audio Input"),value:(0,m._y)(c.audio_input),mono:!0}),null!=c.audio_output&&c.audio_output>0&&(0,l.jsx)(al,{label:r("Audio Output"),value:(0,m._y)(c.audio_output),mono:!0}),null!=c.text_input&&c.text_input>0&&(0,l.jsx)(al,{label:r("Text Input"),value:(0,m._y)(c.text_input),mono:!0}),null!=c.text_output&&c.text_output>0&&(0,l.jsx)(al,{label:r("Text Output"),value:(0,m._y)(c.text_output),mono:!0})]}),c?.reasoning_effort&&(0,l.jsx)(al,{label:r("Reasoning Effort"),value:(0,l.jsx)(eT.Wh,{label:c.reasoning_effort,variant:O,size:"sm",copyable:!1})}),c?.is_system_prompt_overwritten&&(0,l.jsx)(al,{label:r("System Prompt"),value:(0,l.jsx)(eT.Wh,{label:r("Overwritten"),variant:"orange",size:"sm",copyable:!1})}),c?.is_model_mapped&&c?.upstream_model_name&&(0,l.jsxs)(ar,{label:r("Model Mapping"),children:[(0,l.jsx)(al,{label:r("Request Model"),value:e.log.model_name,mono:!0}),(0,l.jsx)(al,{label:r("Actual Model"),value:c.upstream_model_name,mono:!0})]}),[0,2,5,6].includes(e.log.type)&&c&&(0,l.jsx)(ai,{log:e.log,other:c}),h&&c&&!p&&(0,l.jsx)(as,{log:e.log,other:c,isAdmin:e.isAdmin}),j&&c?.expr_b64&&(0,l.jsx)(ar,{label:r("Dynamic Pricing"),children:(0,l.jsx)(e7.N,{compact:!0,billingExpr:eO(c.expr_b64),matchedTierLabel:c.matched_tier,hideCacheColumns:!eE(c)})}),e.isAdmin&&!h&&6!==e.log.type&&c?.admin_info&&(0,l.jsx)(al,{label:r("Billing Path"),value:(0,l.jsxs)("span",{className:"flex items-center gap-1",children:[(t=c.admin_info,t?.usage_billing_path?t.usage_billing_path===ae:t?.local_count_tokens===!0)?(0,l.jsx)(e5,{className:"size-3 text-blue-500"}):(0,l.jsx)(e3,{className:"size-3 text-emerald-500"}),(0,l.jsx)("span",{className:"text-xs",children:an(r,c.admin_info)})]})}),e.isAdmin&&c?.stream_status&&"ok"!==c.stream_status.status&&(0,l.jsxs)(ar,{label:r("Stream Status"),children:[(0,l.jsx)(al,{label:r("Status"),value:(0,l.jsx)(eT.Wh,{label:c.stream_status.status||r("Error"),variant:"red",size:"sm",copyable:!1})}),c.stream_status.end_reason&&(0,l.jsx)(al,{label:r("End Reason"),value:c.stream_status.end_reason}),(c.stream_status.error_count??0)>0&&(0,l.jsx)(al,{label:r("Soft Errors"),value:String(c.stream_status.error_count)}),c.stream_status.end_error&&(0,l.jsx)(al,{label:r("End Error"),value:c.stream_status.end_error}),Array.isArray(c.stream_status.errors)&&c.stream_status.errors.length>0&&(0,l.jsx)("pre",{className:"bg-background/60 mt-1 max-h-32 overflow-y-auto rounded border p-2 font-mono text-[11px] leading-relaxed wrap-break-word whitespace-pre-wrap",children:c.stream_status.errors.join("\n")})]}),y&&c&&(0,l.jsxs)(ar,{label:r("Subscription Billing"),children:[c.subscription_plan_id&&(0,l.jsx)(al,{label:r("Plan"),value:`#${c.subscription_plan_id} ${c.subscription_plan_title||""}`.trim()}),c.subscription_id&&(0,l.jsx)(al,{label:r("Instance"),value:`#${c.subscription_id}`,mono:!0}),null!=c.subscription_pre_consumed&&(0,l.jsx)(al,{label:r("Pre-consumed"),value:(0,m.qW)(c.subscription_pre_consumed),mono:!0}),null!=c.subscription_post_delta&&0!==c.subscription_post_delta&&(0,l.jsx)(al,{label:r("Post Delta"),value:(0,m.qW)(c.subscription_post_delta),mono:!0}),null!=c.subscription_consumed&&(0,l.jsx)(al,{label:r("Final Consumed"),value:(0,m.qW)(c.subscription_consumed),mono:!0}),null!=c.subscription_remain&&(0,l.jsx)(al,{label:r("Remaining"),value:`${(0,m.qW)(c.subscription_remain)}${null!=c.subscription_total?` / ${(0,m.qW)(c.subscription_total)}`:""}`,mono:!0})]}),c?.po&&Array.isArray(c.po)&&c.po.length>0&&(0,l.jsx)(ar,{icon:(0,l.jsx)(e4.A,{className:"size-3.5","aria-hidden":"true"}),iconTone:"chart-3",label:`${r("Param Override")} (${c.po.length}
2)`,children:c.po.filter(Boolean).map(e=>{var a;let t,n=function(e){if("string"!=typeof e)return null;let a=e.indexOf(" ");return a<=0?{action:e,content:e}:{action:e.slice(0,a),content:e.slice(a+1)}}(e);return n?(0,l.jsxs)("div",{className:"bg-background/60 flex min-w-0 flex-col gap-1.5 rounded border p-2 sm:flex-row sm:items-start sm:gap-2",children:[(0,l.jsx)(eT.Wh,{variant:"neutral",label:(a=n.action,(t=eF[a.toLowerCase()])?r(t):a),className:"shrink-0 font-medium",copyable:!1}),(0,l.jsx)("span",{className:"min-w-0 font-mono text-[11px] leading-relaxed break-all sm:wrap-break-word",children:n.content})]},`${n.action}-${n.content}`):null})}),o&&(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)(f.J,{className:"text-xs font-semibold",children:r("Content")}),(0,l.jsxs)("div",{className:"bg-muted/30 relative min-w-0 overflow-hidden rounded-md border p-2.5",children:[(0,l.jsx)(e6.$,{variant:"ghost",size:"sm",className:"absolute top-1.5 right-1.5 h-5 w-5 p-0",onClick:()=>s(o),title:r("Copy to clipboard"),"aria-label":r("Copy to clipboard"),children:n===o?(0,l.jsx)(eH.A,{className:"size-3 text-green-600"}):(0,l.jsx)(eG.A,{className:"size-3"})}),(0,l.jsx)("p",{className:"min-w-0 pr-6 text-xs leading-relaxed break-all whitespace-pre-wrap sm:wrap-break-word",children:o})]})]})]})})}var ac=t(98918);function ad(e){let a,t,r=(a=e.modelName.toLowerCase(),(t=e=>e.some(e=>a.includes(e)))(["gpt-","chatgpt-","text-embedding-","omni-moderation","dall-e","whisper","tts-"])||/\bo[134](?:-|$)/.test(a)?{icon:"OpenAI.Color",label:"OpenAI"}:t(["claude-","anthropic"])?{icon:"Claude.Color",label:"Claude"}:t(["gemini-","learnlm-"])?{icon:"Gemini.Color",label:"Gemini"}:t(["grok-","xai-"])?{icon:"Grok.Color",label:"Grok"}:t(["deepseek-"])?{icon:"DeepSeek.Color",label:"DeepSeek"}:t(["qwen","qwq-"])?{icon:"Qwen.Color",label:"Qwen"}:t(["doubao-","volcengine"])?{icon:"Doubao.Color",label:"Doubao"}:t(["moonshot-","kimi-"])?{icon:"Moonshot.Color",label:"Moonshot"}:t(["minimax","abab"])?{icon:"Minimax.Color",label:"MiniMax"}:t(["glm-","chatglm","cogview","cogvideo"])?{icon:"Zhipu.Color",label:"Zhipu"}:t(["mimo-"])?{icon:"XiaomiMiMo",label:"MiMo"}:t(["ernie"])?{icon:"Wenxin.Color",label:"Baidu"}:t(["spark"])?{icon:"Spark.Color",label:"iFlyTek"}:t(["hunyuan"])?{icon:"Hunyuan.Color",label:"Tencent"}:t(["baichuan"])?{icon:"Baichuan.Color",label:"Baichuan"}:t(["internlm"])?{icon:"InternLM.Color",label:"InternLM"}:t(["step-"])?{icon:"Stepfun.Color",label:"StepFun"}:t(["yi-"])?{icon:"Yi.Color",label:"Yi"}:t(["mistral-","mixtral-"])?{icon:"Mistral.Color",label:"Mistral"}:t(["llama-","meta-"])?{icon:"Meta.Color",label:"Meta"}:t(["command-","cohere-"])?{icon:"Cohere.Color",label:"Cohere"}:null);return(0,l.jsx)(eT.Wh,{copyText:e.modelName,size:"sm",showDot:!r,autoColor:r?void 0:e.modelName,className:(0,ek.cn)("border-border/60 bg-muted/30 h-6 max-w-none gap-1.5 rounded-md border px-2 [font-family:var(--font-body)]",r&&"text-foreground",e.className),children:(0,l.jsxs)("span",{className:"flex max-w-none items-center gap-1.5",children:[r&&(0,l.jsx)("span",{className:"flex h-[18px] w-[18px] shrink-0 items-center justify-center",title:r.label,"aria-label":r.label,children:(0,ac.Y)(r.icon,18)}),(0,l.jsx)("span",{className:"whitespace-nowrap",children:e.modelName})]})})}function au(e){let{t:a}=(0,i.Bd)();return e.actualModel?(0,l.jsxs)(eM.AM,{children:[(0,l.jsxs)(eM.Wv,{render:(0,l.jsx)("button",{type:"button",className:"inline-flex items-center gap-1"}),children:[(0,l.jsx)(ad,{...e}),(0,l.jsx)(eY.A,{className:"text-muted-foreground size-3 shrink-0"})]}),(0,l.jsx)(eM.hl,{className:"w-72",children:(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,l.jsx)("span",{className:"text-muted-foreground text-xs",children:a("Request Model:")}),(0,l.jsx)("span",{className:"truncate font-mono text-xs font-medium",children:e.modelName})]}),(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,l.jsx)("span",{className:"text-muted-foreground text-xs",children:a("Actual Model:")}),(0,l.jsx)("span",{className:"truncate font-mono text-xs font-medium",children:e.actualModel})]})]})})]}):(0,l.jsx)(ad,{...e})}var am=t(48537);let ap={...eT.jk,success:"bg-success/90",warning:"bg-warning/80",danger:"bg-destructive/80",neutral:"bg-neutral/80"};function ax(e){let{t:a}=(0,i.Bd)(),t=e.indicator??"bar",r=e.isStream,n=null!=e.frtMs&&e.frtMs>0?e.frtMs/1e3:null,s=null==n?"neutral":eP(n),o=eL(e.useTimeSec,e.completionTokens),c=null==n?a("N/A"):(0,m.KK)(n),d=(0,m.KK)(e.useTimeSec),u=(0,l.jsxs)("div",{className:"flex min-h-8 min-w-0 flex-col justify-center gap-0.5 text-xs leading-tight",children:[r&&(0,l.jsxs)("div",{className:"flex items-baseline gap-1.5",children:["dot"===t&&(0,l.jsx)("span",{"aria-hidden":!0,
2className:(0,ek.cn)("size-1.5 shrink-0 rounded-full",eT.jk[s])}),(0,l.jsx)("span",{className:"text-muted-foreground shrink-0",children:a("First token")}),(0,l.jsx)("span",{className:(0,ek.cn)("tabular-nums",eT.BQ[s]),children:c})]}),(0,l.jsxs)("div",{className:"flex items-baseline gap-1.5",children:["dot"===t&&(0,l.jsx)("span",{"aria-hidden":!0,className:(0,ek.cn)("size-1.5 shrink-0 rounded-full",eT.jk[o])}),(0,l.jsx)("span",{className:"text-muted-foreground shrink-0",children:a("Duration")}),(0,l.jsx)("span",{className:(0,ek.cn)("tabular-nums",eT.BQ[o]),children:d})]})]});return"dot"===t?(0,l.jsx)("div",{className:(0,ek.cn)("flex items-stretch",e.className),children:u}):(0,l.jsxs)("div",{className:(0,ek.cn)("flex items-stretch gap-2",e.className),children:[(0,l.jsx)("span",{"aria-hidden":!0,className:(0,ek.cn)("flex w-1 shrink-0 flex-col overflow-hidden rounded-full",!r&&ap[o]),children:r&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:(0,ek.cn)("flex-1",ap[s])}),(0,l.jsx)("span",{className:(0,ek.cn)("flex-1",ap[o])})]})}),u]})}function ah(e){let{t:a}=(0,i.Bd)(),t=e.isStream&&e.streamStatus&&"ok"!==e.streamStatus.status,r=null!=e.tokensPerSecond?`${Math.round(e.tokensPerSecond)} t/s`:"—",n=a(e.isStream?"Stream":"Non-stream");return(0,l.jsxs)("div",{className:(0,ek.cn)("flex shrink-0 flex-col items-start justify-center gap-0.5 text-xs leading-tight",e.className),children:[(0,l.jsxs)("span",{className:(0,ek.cn)("inline-flex items-center gap-1 font-medium",e.isStream?"text-info":"text-muted-foreground"),children:[n,t&&(0,l.jsx)(ez.Bc,{children:(0,l.jsxs)(ez.m_,{children:[(0,l.jsx)(ez.k$,{render:(0,l.jsx)(am.A,{className:"text-destructive size-3"})}),(0,l.jsx)(ez.ZI,{children:(0,l.jsxs)("div",{className:"space-y-0.5 text-xs",children:[(0,l.jsxs)("p",{children:[a("Stream Status"),": ",a("Error")]}),(0,l.jsx)("p",{children:e.streamStatus?.end_reason||"unknown"}),(e.streamStatus?.error_count??0)>0&&(0,l.jsxs)("p",{children:[a("Soft Errors"),": ",e.streamStatus?.error_count]})]})})]})})]}),(0,l.jsx)("span",{className:"text-muted-foreground/60 px-0.5 tabular-nums",children:r})]})}function ag(e){return null!=e&&Number.isFinite(e)?e%1==0?String(e):e.toFixed(4).replace(/\.?0+$/,""):"-"}var af=t(6863),ab=t(5487);let ay=(0,eX.A)("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]),aj=(0,eX.A)("paintbrush",[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]);var av=t(95099);let a_=(0,eX.A)("move",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]]);var aN=t(14398);let ak=(0,eX.A)("blend",[["circle",{cx:"9",cy:"9",r:"7",key:"p2h5vp"}],["circle",{cx:"15",cy:"15",r:"7",key:"19ennj"}]]),aw=(0,eX.A)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),aC=(0,eX.A)("scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);var aS=t(79736),aA=t(50926),aT=t(99554);let aI=(0,eX.A)("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);var aM=t(92265);function az(e){return{getLabel:function(a){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Unknown";return e[a]?.label??t},getVariant:function(a){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"neutral";return e[a]?.variant??t}}}let a$=az({[N]:{label:"Draw",variant:"blue"},[k]:{label:"Upscale",variant:"orange"},[w]:{label:"Video",variant:"orange"},[C]:{label:"Edit",variant:"orange"},[S]:{label:"Vary",variant:"violet"},[A]:{label:"Vary (Strong)",variant:"violet"},[T]:{label:"Vary (Subtle)",variant:"violet"},PAN:{label:"Pan",variant:"cyan"},[I]:{label:"Describe",variant:"yellow"},[M]:{label:"Blend",variant:"lime"},[z]:{label:"Upload",variant:"blue"},[$]:{label:"Shorten",variant:"pink"},[q]:{label:"Reroll",variant:"indigo"},[D]:{label:"Inpaint",variant:"teal"},[F]:{label:"Swap Face",variant:"purple"},[R]:{label:"Zoom",variant:"green"},[K]:{label:"Custom Zoom",variant:"green"}}),aq=az({SUCCESS:{label:"Success",variant:"green"},NOT_START:{label:"Not Started",variant:"neutral"},SUBMITTED:{label:"Queued",variant:"yellow"},IN_PROGRESS:{label:"In Progress",variant:"blue"},FAILURE:{label:"Failed",variant:"red"},MODAL:{label:"Waiting",variant:"amber"}}),aD=az(V),aF=az({MUSIC:{label:"Generate Music",variant:"neutral"},LYRICS:{label:"Generate Lyrics",variant:"pink"},[P]:{label:"Image to Video",variant:"blue"},[L]:{label:"Text to Video",variant:"blue"},[O]:{label:"First/Last Frame to Video",variant:"blue"},[E]:{label:"Reference Video",variant:"blue"},[B]:{label:"Video Remix",variant:"blue"}}),aR=az({[U]:{label:"Success",variant:"green"},NOT_START:{label:"Not Started",variant:"neutral"},SUBMITTED:{label:"Queued",variant:"yellow"},IN_PROGRESS:{label:"In Progress",variant:"blue"},FAILURE:{label:"Failed",variant:"red"},QUEUED:{label:"Queued",variant:"orange"},UNKNOWN:{label:"Unknown",variant:"neutral"}});var aK=t(68603),aP=t(93539);function aL(e){let{imageUrl:a,taskId:t,open:r,onOpenChange:n}=e,{t:o}
2=(0,i.Bd)(),[c,d]=(0,s.useState)(!0),[m,p]=(0,s.useState)(!1);return(0,l.jsx)(u.l,{open:r,onOpenChange:e=>{e&&(d(!0),p(!1)),n(e)},title:o("Image Preview"),description:t?`${o("Task ID:")} ${t}`:o("View the generated image"),contentClassName:"sm:max-w-3xl",contentHeight:"auto",bodyClassName:"space-y-4",children:(0,l.jsx)(aK.F,{className:"max-h-[600px]",children:(0,l.jsxs)("div",{className:"py-4",children:[(0,l.jsxs)("div",{className:"bg-muted/50 relative flex min-h-[300px] items-center justify-center rounded-lg border",children:[(c||m)&&(0,l.jsx)(aP.E,{className:"absolute inset-0 h-full w-full rounded-lg"}),(0,l.jsx)("img",{src:a,alt:o("Generated image"),className:`max-h-[550px] w-full rounded-lg object-contain ${c||m?"opacity-0":"opacity-100"}`,onLoad:()=>{d(!1),p(!1)},onError:()=>{d(!1),p(!0)},loading:"lazy"}),m&&(0,l.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,l.jsx)("p",{className:"text-muted-foreground text-sm",children:o("Failed to load image")})})]}),(0,l.jsx)("div",{className:"bg-muted mt-4 rounded-md p-3",children:(0,l.jsx)("p",{className:"text-muted-foreground font-mono text-xs break-all",children:a})})]})})})}function aO(e){let{prompt:a,promptEn:t,open:r,onOpenChange:n}=e,{t:s}=(0,i.Bd)(),{copiedText:o,copyToClipboard:c}=(0,e9.C)({notify:!1});return(0,l.jsx)(u.l,{open:r,onOpenChange:n,title:s("Prompt Details"),description:s("View the complete prompt and its English translation"),contentClassName:"sm:max-w-lg",contentHeight:"auto",bodyClassName:"space-y-4",children:(0,l.jsx)(aK.F,{className:"max-h-[500px] pr-4",children:(0,l.jsxs)("div",{className:"space-y-4 py-4",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(f.J,{className:"text-sm font-semibold",children:s("Prompt")}),(0,l.jsxs)("div",{className:"bg-muted/50 relative rounded-md border p-3",children:[(0,l.jsx)(e6.$,{variant:"ghost",size:"sm",className:"absolute top-2 right-2 h-8 w-8 p-0",onClick:()=>c(a),title:s("Copy to clipboard"),children:o===a?(0,l.jsx)(eH.A,{className:"size-4 text-green-600"}):(0,l.jsx)(eG.A,{className:"size-4"})}),(0,l.jsx)("p",{className:"pr-10 text-sm leading-relaxed break-words whitespace-pre-wrap",children:a||"-"})]})]}),t&&(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(f.J,{className:"text-sm font-semibold",children:s("Prompt (EN)")}),(0,l.jsxs)("div",{className:"bg-muted/50 relative rounded-md border p-3",children:[(0,l.jsx)(e6.$,{variant:"ghost",size:"sm",className:"absolute top-2 right-2 h-8 w-8 p-0",onClick:()=>c(t),title:s("Copy to clipboard"),children:o===t?(0,l.jsx)(eH.A,{className:"size-4 text-green-600"}):(0,l.jsx)(eG.A,{className:"size-4"})}),(0,l.jsx)("p",{className:"pr-10 text-sm leading-relaxed break-words whitespace-pre-wrap",children:t})]})]})]})})})}function aE(e){let{failReason:a,open:t,onOpenChange:r}=e,{t:n}=(0,i.Bd)(),{copiedText:s,copyToClipboard:o}=(0,e9.C)({notify:!1});return(0,l.jsx)(u.l,{open:t,onOpenChange:r,title:n("Fail Reason Details"),description:n("View the complete error message and details"),contentClassName:"sm:max-w-lg",contentHeight:"auto",bodyClassName:"space-y-4",children:(0,l.jsx)(aK.F,{className:"max-h-[500px] pr-4",children:(0,l.jsx)("div",{className:"space-y-4 py-4",children:(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(f.J,{className:"text-sm font-semibold",children:n("Error Message")}),(0,l.jsxs)("div",{className:"bg-muted/50 relative rounded-md border border-red-200 p-3",children:[(0,l.jsx)(e6.$,{variant:"ghost",size:"sm",className:"absolute top-2 right-2 h-8 w-8 p-0",onClick:()=>o(a),title:n("Copy to clipboard"),children:s===a?(0,l.jsx)(eH.A,{className:"size-4 text-green-600"}):(0,l.jsx)(eG.A,{className:"size-4"})}),(0,l.jsx)("p",{className:"overflow-wrap-anywhere pr-10 text-sm leading-relaxed break-all whitespace-pre-wrap text-red-600",children:a||"-"})]})]})})})})}function aB(e){let{submitTimeKey:a,finishTimeKey:t,unit:r="milliseconds",headerLabel:n,warningThresholdSec:s=60}=e;return{id:"duration",header:e=>{let{column:a}=e;return(0,l.jsx)(ev.wZ,{column:a,title:n})},cell:e=>{let{row:n}=e,i=n.original,o=function(e,a){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"milliseconds";if(!e||!a)return null;let l="milliseconds"===t?(a-e)/1e3:a-e;return{durationSec:l,variant:l>60?"red":"green"}}(i[a],i[t],r);
2if(!o)return(0,l.jsx)("span",{className:"text-muted-foreground/60 text-xs",children:"-"});let c=o.durationSec>s?"danger":"success";return(0,l.jsx)(eT.Wh,{label:`${o.durationSec.toFixed(1)}s`,variant:c,size:"sm",copyable:!1,className:(0,ek.cn)("rounded-md font-mono",{success:"border border-emerald-200/40 bg-emerald-50/35 !text-emerald-600 dark:border-emerald-900/40 dark:bg-emerald-950/15 dark:!text-emerald-400",warning:"border border-amber-200/45 bg-amber-50/35 !text-amber-600 dark:border-amber-900/40 dark:bg-amber-950/15 dark:!text-amber-400",danger:"border border-rose-200/50 bg-rose-50/35 !text-red-600 dark:border-rose-900/40 dark:bg-rose-950/15 dark:!text-red-400"}[c])})},meta:{label:n}}}function aU(e){let{accessorKey:a="channel_id",headerLabel:t}=e;return{accessorKey:a,header:e=>{let{column:a}=e;return(0,l.jsx)(ev.wZ,{column:a,title:t})},cell:e=>{let{row:t}=e,r=t.getValue(a);return r?(0,l.jsx)(eT.Wh,{label:`#${r}`,autoColor:String(r),copyText:String(r),size:"sm",showDot:!1,className:"font-mono"}):(0,l.jsx)("span",{className:"text-muted-foreground/60 text-xs",children:"-"})},meta:{label:t}}}function aV(e){let{accessorKey:a="progress",headerLabel:t}=e;return{accessorKey:a,header:e=>{let{column:a}=e;return(0,l.jsx)(ev.wZ,{column:a,title:t})},cell:e=>{let{row:t}=e,r=t.getValue(a);return r?(0,l.jsx)("span",{className:"border-border/60 bg-muted/30 inline-flex items-center rounded-md border px-1.5 py-0.5 font-mono text-xs",children:r}):(0,l.jsx)("span",{className:"text-muted-foreground/60 text-xs",children:"-"})},meta:{label:t}}}let aW={[N]:af.A,[k]:ab.A,[w]:ay,[C]:aj,[S]:av.A,[A]:av.A,[T]:av.A,PAN:a_,[I]:aN.A,[M]:ak,[z]:aw,[$]:aC,[q]:aS.A,[D]:aA.A,[F]:aT.A,[R]:aI,[K]:aI},aH=(0,eX.A)("music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);var aG=t(5238);function aY(e){let{clip:a}=e,{t}=(0,i.Bd)(),[r,n]=(0,s.useState)(!1),o=(0,s.useRef)(null);(0,s.useEffect)(()=>{n(!1)},[a.audio_url]);let c=a.title||t("Untitled"),u=a.tags||a.metadata?.tags||"",m=a.duration||a.metadata?.duration,p=a.image_url||a.image_large_url,x=a.audio_url;return x?(0,l.jsxs)("div",{className:"bg-card flex gap-4 rounded-lg border p-4",children:[p&&(0,l.jsx)("img",{src:p,alt:c,className:"h-20 w-20 shrink-0 rounded-lg object-cover",onError:e=>{e.target.style.display="none"}}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"mb-1 flex items-center gap-2",children:[(0,l.jsx)("span",{className:"truncate text-sm font-medium",children:c}),null!=m&&m>0&&(0,l.jsx)(eT.Wh,{label:function(e){if(!e||e<=0)return"--:--";let a=Math.floor(e/60),t=Math.floor(e%60);return`${a}:${t.toString().padStart(2,"0")}`}(m),variant:"neutral",className:"shrink-0",copyable:!1})]}),u&&(0,l.jsx)("p",{className:"text-muted-foreground mb-2 truncate text-xs",children:u}),r?(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("span",{className:"text-destructive text-xs",children:t("Audio playback failed")}),(0,l.jsxs)(e6.$,{variant:"outline",size:"sm",className:"h-7 gap-1 text-xs",onClick:()=>window.open(x,"_blank"),children:[(0,l.jsx)(aG.A,{className:"h-3 w-3"}),t("Open in new tab")]}),(0,l.jsxs)(e6.$,{variant:"outline",size:"sm",className:"h-7 gap-1 text-xs",onClick:()=>{navigator.clipboard.writeText(x),d.oR.success(t("Copied"))},children:[(0,l.jsx)(eG.A,{className:"h-3 w-3"}),t("Copy Link")]})]}):(0,l.jsx)("audio",{ref:o,src:x,controls:!0,preload:"none",onError:()=>n(!0),className:"h-9 w-full"})]})]}):null}function aQ(e){let{t:a}=(0,i.Bd)(),t=Array.isArray(e.clips)?e.clips:[];return(0,l.jsx)(u.l,{open:e.open,onOpenChange:e.onOpenChange,title:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(e8.f,{tone:"chart-4",size:"sm",children:(0,l.jsx)(aH,{})}),a("Audio Preview")]}),contentClassName:"sm:max-w-lg",titleClassName:"flex items-center gap-2",contentHeight:"auto",bodyClassName:"space-y-4",children:0===t.length?(0,l.jsx)("p",{className:"text-muted-foreground py-4 text-center text-sm",children:a("None")}):(0,l.jsx)(aK.F,{className:"max-h-[60vh]",children:(0,l.jsx)("div",{className:"space-y-3 pr-2",children:t.map((e,a)=>(0,l.jsx)(aY,{clip:e},e.clip_id||e.id||a))})})})}function aZ(e){if(Array.isArray(e))return e;if("string"==typeof e)try{let a=JSON.parse(e);return Array.isArray(a)?a:[]}catch{}return[]}function aJ(e){let{log:a}=e,{t}
2=(0,i.Bd)(),[r,n]=(0,s.useState)(!1),o=(0,s.useMemo)(()=>aZ(a.data).filter(e=>e&&"object"==typeof e&&e.audio_url),[a.data]);return 0===o.length?null:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("button",{type:"button",className:"group flex items-center gap-1 text-left text-xs",onClick:()=>n(!0),children:[(0,l.jsx)(aH,{className:"text-muted-foreground size-3"}),(0,l.jsx)("span",{className:"text-foreground leading-snug group-hover:underline",children:t("Click to preview audio")})]}),(0,l.jsx)(aQ,{open:r,onOpenChange:n,clips:o})]})}var aX=t(2276),a0=t(25385),a1=t(71451),a2=t(6487),a5=t(50010);function a3(e,a){let t={...e.startTime&&{startTime:e.startTime.getTime()},...e.endTime&&{endTime:e.endTime.getTime()},...e.channel&&{channel:e.channel}};switch(a){case"common":return{...t,...e.model&&{model:e.model},...e.token&&{token:e.token},...e.group&&{group:e.group},...e.username&&{username:e.username},...e.requestId&&{requestId:e.requestId},...e.upstreamRequestId&&{upstreamRequestId:e.upstreamRequestId}};case"drawing":return{...t,...e.mjId&&{filter:e.mjId}};case"task":return{...t,...e.taskId&&{filter:e.taskId}};default:return t}}let a4=(0,r.GY)("/_authenticated/usage-logs/$section");function a6(e){return(0,l.jsxs)("span",{className:"border-border/60 bg-muted/25 inline-flex h-7 items-center gap-2 rounded-md border px-2.5 text-xs shadow-xs",children:[(0,l.jsx)("span",{className:(0,ek.cn)("h-3.5 w-0.5 rounded-full",e.accent)}),(0,l.jsx)("span",{className:"text-muted-foreground",children:e.label}),(0,l.jsx)("span",{className:"text-foreground/85 font-mono font-semibold tabular-nums",children:e.value})]})}function a8(){let{t:e}=(0,i.Bd)(),{isAdminView:a}=ey(),t=a4.useSearch(),{sensitiveVisible:r}=eb(),{data:n,isLoading:s}=(0,ej.I)({queryKey:["usage-logs-stats",a,t],queryFn:async()=>{let e=ee({page:1,pageSize:1,searchParams:t,columnFilters:[],isAdmin:a}),l=a?await ei(e):await eo(e);return l.success&&l.data||y},placeholderData:e=>e});return s?(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(aP.E,{className:"h-7 w-[150px] rounded-md"}),(0,l.jsx)(aP.E,{className:"h-7 w-[100px] rounded-md"}),(0,l.jsx)(aP.E,{className:"h-7 w-[120px] rounded-md"})]}):(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)(a6,{label:e("Usage"),value:r?(0,m.qW)(n?.quota||0):"••••",accent:"bg-sky-500/70"}),(0,l.jsx)(a6,{label:e("RPM"),value:n?.rpm||0,accent:"bg-rose-500/65"}),(0,l.jsx)(a6,{label:e("TPM"),value:n?.tpm||0,accent:"bg-slate-400/70"})]})}var a7=t(99238),a9=t(62724),te=t(97569);function ta(e){return e?(0,te.A)(e).format("YYYY-MM-DDTHH:mm"):""}function tt(e){if(!e)return;let a=new Date(e);return Number.isNaN(a.getTime())?void 0:a}function tl(e){let{start:a,end:t,onChange:r,className:n}=e,{t:o}=(0,i.Bd)(),[c,d]=(0,s.useState)(!1),[u,m]=(0,s.useState)(ta(a)),[p,x]=(0,s.useState)(ta(t)),h=(0,s.useMemo)(()=>{if(!a&&!t)return o("Date Range");let e=a?(0,te.A)(a).format("YYYY-MM-DD HH:mm"):"-",l=t?(0,te.A)(t).format("YYYY-MM-DD HH:mm"):"-";return`${e} ~ ${l}`},[t,a,o]),g=e=>{let a=(0,te.A)(),t={today:{start:a.startOf("day").toDate(),end:a.endOf("day").toDate()},"7d":{start:a.subtract(6,"day").startOf("day").toDate(),end:a.endOf("day").toDate()},week:{start:a.startOf("week").toDate(),end:a.endOf("week").toDate()},"30d":{start:a.subtract(29,"day").startOf("day").toDate(),end:a.endOf("day").toDate()},month:{start:a.startOf("month").toDate(),end:a.endOf("month").toDate()}}[e];m(ta(t.start)),x(ta(t.end)),r(t),d(!1)};return(0,l.jsxs)(eM.AM,{open:c,onOpenChange:e=>{e&&(m(ta(a)),x(ta(t))),d(e)},children:[(0,l.jsxs)(eM.Wv,{render:(0,l.jsx)(e6.$,{type:"button",variant:"outline",className:(0,ek.cn)("w-full justify-start gap-2 px-2.5 text-sm leading-5 font-normal tabular-nums",!a&&!t&&"text-muted-foreground",n)}),children:[(0,l.jsx)(a7.A,{className:"text-muted-foreground size-4 shrink-0"}),(0,l.jsx)("span",{className:"truncate",children:h})]}),(0,l.jsx)(eM.hl,{align:"start",className:"w-[min(520px,calc(100vw-2rem))] p-3",children:(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsxs)("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto_1fr] sm:items-end",children:[(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)("div",{className:"text-muted-foreground text-xs",children:o("Start Time")}),(0,l.jsx)(a9.p,{type:"datetime-local",value:u,onChange:e=>m(e.target.value),className:"h-8 text-sm leading-5 tabular-nums"})]}),(0,l.jsx)("span",{className:"text-muted-foreground hidden pb-2 text-xs sm:block",children:"~"}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)("div",{className:"text-muted-foreground text-xs",children:o("End Time")}),(0,l.jsx)(a9.p,{type:"datetime-local",value:p,onChange:e=>x(e.target.value),className:"h-8 text-sm leading-5 tabular-nums"})]})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,l.jsx)(e6.$,{type:"button",variant:"secondary",size:"sm",className:"h-7 flex-1 px-2 text-xs",onClick:()=>
2g("today"),children:o("Today")}),(0,l.jsx)(e6.$,{type:"button",variant:"secondary",size:"sm",className:"h-7 flex-1 px-2 text-xs",onClick:()=>g("7d"),children:o("7 Days")}),(0,l.jsx)(e6.$,{type:"button",variant:"secondary",size:"sm",className:"h-7 flex-1 px-2 text-xs",onClick:()=>g("week"),children:o("This week")}),(0,l.jsx)(e6.$,{type:"button",variant:"secondary",size:"sm",className:"h-7 flex-1 px-2 text-xs",onClick:()=>g("30d"),children:o("30 Days")}),(0,l.jsx)(e6.$,{type:"button",variant:"secondary",size:"sm",className:"h-7 flex-1 px-2 text-xs",onClick:()=>g("month"),children:o("This month")})]}),(0,l.jsx)("div",{className:"flex justify-end",children:(0,l.jsx)(e6.$,{size:"sm",className:"h-8",onClick:()=>{r({start:tt(u),end:tt(p)}),d(!1)},children:o("Confirm")})})]})})]})}var tr=t(53926),tn=t(83357),ts=t(62301);function ti(e){return(0,l.jsx)("div",{className:(0,ek.cn)("min-w-0 [&_[data-slot=select-trigger]]:w-full [&_[data-slot=select-trigger]]:text-sm [&_[data-slot=select-value]]:leading-5",e.wide&&"sm:col-span-2",e.className),children:e.children})}function to(e){return(0,l.jsx)(a9.p,{...e,className:(0,ek.cn)("h-8 min-w-0 text-sm leading-5",e.className)})}function tc(e){let{t:a}=(0,i.Bd)(),[t,r]=(0,s.useState)(!1),[n,o]=(0,s.useState)(!1),[c,d]=(0,s.useState)(!1),u=(0,e_.Ub)("(max-width: 640px)"),m=null!=e.advancedFilters,p=e.advancedFilterCount??+!!e.hasAdvancedActiveFilters,x=e.mobileFilterCount??p,h=m?(0,l.jsxs)(e6.$,{type:"button",variant:"ghost",onClick:()=>r(e=>!e),"aria-expanded":t,className:(0,ek.cn)("text-muted-foreground hover:text-foreground gap-1 px-2",e.hasAdvancedActiveFilters&&!t&&"text-primary hover:text-primary"),children:[a(t?"Collapse":"Expand"),p>0&&(0,l.jsx)(tn.E,{className:"ml-0.5 size-5 justify-center p-0 text-[10px]",children:p}),(0,l.jsx)(tr.A,{className:(0,ek.cn)("size-3.5 transition-transform duration-200",t&&"rotate-180")})]}):null;return u&&null!=e.mobilePinnedFilters?(0,l.jsxs)(ts._s,{open:n,onOpenChange:o,children:[(0,l.jsxs)("div",{className:(0,ek.cn)("bg-card/50 rounded-lg border p-2.5",e.className),children:[!c&&(0,l.jsx)("div",{className:"grid gap-2",children:e.mobilePinnedFilters}),(0,l.jsxs)("div",{className:(0,ek.cn)("flex flex-col gap-2",!c&&"mt-2"),children:[!c&&e.stats,(0,l.jsxs)("div",{className:"flex items-center justify-end gap-1.5",children:[(0,l.jsx)(e6.$,{type:"button",variant:"ghost",size:"icon",onClick:()=>d(e=>!e),"aria-expanded":!c,"aria-label":a(c?"Expand":"Collapse"),className:"text-muted-foreground hover:text-foreground mr-auto size-7",children:(0,l.jsx)(tr.A,{className:(0,ek.cn)("size-3.5 transition-transform duration-200",!c&&"rotate-180")})}),e.actionStart,(0,l.jsx)(ts.Uz,{asChild:!0,children:(0,l.jsxs)(e6.$,{type:"button",variant:"ghost",className:(0,ek.cn)("text-muted-foreground hover:text-foreground gap-1 px-2",x>0&&"text-primary hover:text-primary"),children:[a("Filter"),x>0&&(0,l.jsx)(tn.E,{className:"ml-0.5 size-5 justify-center p-0 text-[10px]",children:x})]})}),(0,l.jsxs)(e6.$,{type:"button",onClick:e.onSearch,disabled:e.searchLoading,children:[e.searchLoading&&(0,l.jsx)(g.A,{className:"animate-spin"}),a("Search")]}),(0,l.jsx)(ev.io,{table:e.table})]})]})]}),(0,l.jsx)(ts.zj,{className:"max-h-[85dvh] p-0",children:(0,l.jsxs)("div",{className:"mx-auto flex w-full max-w-md flex-1 flex-col overflow-hidden",children:[(0,l.jsxs)(ts.BE,{className:"border-border/70 border-b px-4 py-3 text-left",children:[(0,l.jsx)(ts.gk,{children:a("Filter")}),(0,l.jsx)(ts.I6,{children:a("Adjust filters, then search to refresh the logs.")})]}),(0,l.jsx)("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto px-4 py-3",children:e.mobileFilters??(0,l.jsxs)(l.Fragment,{children:[e.primaryFilters,e.advancedFilters]})}),(0,l.jsxs)(ts.tb,{className:"border-border/70 grid grid-cols-2 gap-2 border-t px-4 py-3",children:[(0,l.jsx)(e6.$,{type:"button",variant:"outline",onClick:()=>{e.onReset(),o(!1)},disabled:!e.hasActiveFilters,children:a("Reset")}),(0,l.jsxs)(e6.$,{type:"button",onClick:()=>{e.onSearch(),o(!1)},disabled:e.searchLoading,children:[e.searchLoading&&(0,l.jsx)(g.A,{className:"animate-spin"}),a("Search")]})]})]})})]}):(0,l.jsxs)("div",{className:(0,ek.cn)("bg-card/50 rounded-lg border p-2.5 sm:p-3",e.className),children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-start gap-2",children:[(0,l.jsx)("div",{className:"grid min-w-0 flex-1 grid-cols-1 gap-2 sm:grid-cols-[repeat(auto-fit,minmax(10rem,1fr))]",children:e.primaryFilters}),h&&(0,l.jsx)("div",{className:"flex shrink-0 items-center justify-end",children:h})]}
2),t&&e.advancedFilters&&(0,l.jsx)("div",{className:"mt-2 grid grid-cols-1 gap-2 sm:grid-cols-[repeat(auto-fit,minmax(10rem,1fr))]",children:e.advancedFilters}),(0,l.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[e.stats,(0,l.jsxs)("div",{className:"ms-auto flex flex-wrap items-center justify-end gap-1.5 sm:gap-2",children:[e.actionStart,(0,l.jsx)(e6.$,{type:"button",variant:"outline",onClick:e.onReset,disabled:!e.hasActiveFilters,children:a("Reset")}),(0,l.jsxs)(e6.$,{type:"button",onClick:e.onSearch,disabled:e.searchLoading,children:[e.searchLoading&&(0,l.jsx)(g.A,{className:"animate-spin"}),a("Search")]}),(0,l.jsx)(ev.io,{table:e.table})]})]})]})}let td=(0,r.GY)("/_authenticated/usage-logs/$section"),tu=new Set(_.map(e=>e.value));function tm(e){return[e.startTime,e.endTime,e.channel,e.model,e.token,e.group,e.username,e.requestId,e.upstreamRequestId,Array.isArray(e.type)?e.type.join(","):e.type].map(e=>String(e??"")).join("\x1f")}function tp(e){let{t:a}=(0,i.Bd)(),t=(0,n.Z)(),r=(0,aX.jE)(),o=td.useSearch(),{isAdminView:c}=ey(),{sensitiveVisible:d,setSensitiveVisible:u}=eb(),m=(0,a0.C)({queryKey:["logs"]}),p=(0,s.useMemo)(()=>{var e,a;let{start:t,end:l}=Z(),r={startTime:o.startTime,endTime:o.endTime,channel:o.channel,model:o.model,token:o.token,group:o.group,username:o.username,requestId:o.requestId,upstreamRequestId:o.upstreamRequestId,type:o.type},n={startTime:o.startTime?new Date(o.startTime):t,endTime:o.endTime?new Date(o.endTime):l,channel:o.channel||void 0,model:o.model||void 0,token:o.token||void 0,group:o.group||void 0,username:o.username||void 0,requestId:o.requestId||void 0,upstreamRequestId:o.upstreamRequestId||void 0};return{sourceKey:tm(r),filters:n,logType:Array.isArray(e=o.type)&&1===e.length&&"string"==typeof e[0]&&(a=e[0],tu.has(a))?e[0]:"0"}},[o.startTime,o.endTime,o.channel,o.model,o.token,o.group,o.username,o.requestId,o.upstreamRequestId,o.type]),[x,h]=(0,s.use
2State)(()=>p),g=x.sourceKey===p.sourceKey?x:p,f=g.filters,b=g.logType,y=(0,s.useCallback)((e,a)=>{h(t=>{let l=t.sourceKey===p.sourceKey?t:p;return{sourceKey:p.sourceKey,filters:{...l.filters,[e]:a},logType:l.logType}})},[p]),j=(0,s.useCallback)(()=>{t({to:"/usage-logs/$section",params:{section:"common"},search:{...a3(f,"common"),type:[b],page:1}}),r.invalidateQueries({queryKey:["logs"]}),r.invalidateQueries({queryKey:["usage-logs-stats"]})},[f,b,t,r]),v=(0,s.useCallback)(()=>{let{start:e,end:a}=Z(),l={type:["0"],startTime:e.getTime(),endTime:a.getTime()};h({sourceKey:tm(l),filters:{startTime:e,endTime:a},logType:"0"}),t({to:"/usage-logs/$section",params:{section:"common"},search:{page:1,...l}}),r.invalidateQueries({queryKey:["logs"]}),r.invalidateQueries({queryKey:["usage-logs-stats"]})},[t,r]),N=(0,s.useCallback)(e=>{"Enter"===e.key&&j()},[j]),k=!!f.token||!!f.username||!!f.channel||!!f.requestId||!!f.upstreamRequestId,w="0"!==b,C=!!f.model||!!f.group||w||k,S=[f.token,c?f.username:void 0,c?f.channel:void 0,f.requestId,f.upstreamRequestId].filter(Boolean).length,A=d?"text":"password",T=(0,s.useMemo)(()=>_.map(e=>({value:e.value,label:a(e.label)})),[a]),I=T.find(e=>e.value===b)?.label??a("All Types"),M=(0,l.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,l.jsx)(a8,{})}),z=(0,l.jsxs)(ez.m_,{children:[(0,l.jsx)(ez.k$,{render:(0,l.jsx)(e6.$,{variant:"ghost",size:"icon",onClick:()=>u(!d),"aria-label":d?a("Hide"):a("Show"),className:"text-muted-foreground hover:text-foreground size-7"}),children:d?(0,l.jsx)(a1.A,{}):(0,l.jsx)(a2.A,{})}),(0,l.jsx)(ez.ZI,{children:d?a("Hide"):a("Show")})]}),$=(0,l.jsx)(ti,{wide:!0,children:(0,l.jsx)(tl,{start:f.startTime,end:f.endTime,onChange:e=>{let{start:a,end:t}=e;y("startTime",a),y("endTime",t)}})}),q=(0,l.jsx)(ti,{children:(0,l.jsx)(to,{placeholder:a("Model Name"),value:f.model||"",onChange:e=>y("model",e.target.value),onKeyDown:N})}),D=(0,l.jsx)(ti,{children:(0,l.jsx)(to,{placeholder:a("Group"),type:A,value:f.group||"",onChange:e=>y("group",e.target.value),onKeyDown:N})}),F=(0,l.jsx)(ti,{children:(0,l.jsxs)(a5.l6,{items:T,value:b,onValueChange:e=>{let a=null!==e&&tu.has(e)?e:"0";h(e=>{let t=e.sourceKey===p.sourceKey?e:p;return{sourceKey:p.sourceKey,filters:t.filters,logType:a}})},children:[(0,l.jsx)(a5.bq,{children:(0,l.jsx)(a5.yv,{children:I})}),(0,l.jsx)(a5.gC,{alignItemWithTrigger:!1,children:(0,l.jsx)(a5.s3,{children:_.map(e=>(0,l.jsx)(a5.eb,{value:e.value,children:a(e.label)},e.value))})})]})}),R=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ti,{children:(0,l.jsx)(to,{placeholder:a("Token Name"),type:A,value:f.token||"",onChange:e=>y("token",e.target.value),onKeyDown:N})}),c&&(0,l.jsx)(ti,{children:(0,l.jsx)(to,{placeholder:a("Username"),type:A,value:f.username||"",onChange:e=>y("username",e.target.value),onKeyDown:N})}),c&&(0,l.jsx)(ti,{children:(0,l.jsx)(to,{placeholder:a("Channel ID"),value:f.channel||"",onChange:e=>y("channel",e.target.value),onKeyDown:N})}),(0,l.jsx)(ti,{children:(0,l.jsx)(to,{placeholder:a("Request ID"),value:f.requestId||"",onChange:e=>y("requestId",e.target.value),onKeyDown:N})}),(0,l.jsx)(ti,{children:(0,l.jsx)(to,{placeholder:a("Upstream Request ID"),value:f.upstreamRequestId||"",onChange:e=>y("upstreamRequestId",e.target.value),onKeyDown:N})})]});return(0,l.jsx)(tc,{table:e.table,stats:M,actionStart:z,primaryFilters:(0,l.jsxs)(l.Fragment,{children:[$,q,D,F]}),advancedFilters:R,mobilePinnedFilters:$,mobileFilters:(0,l.jsxs)(l.Fragment,{children:[q,D,F,R]}),mobileFilterCount:[f.model,f.group,w].filter(Boolean).length+S,hasAdvancedActiveFilters:k,advancedFilterCount:S,hasActiveFilters:C,onSearch:j,searchLoading:m>0,onReset:v})}let tx=(0,r.GY)("/_authenticated/usage-logs/$section");function th(e){let{t:a}=(0,i.Bd)(),t=(0,n.Z)(),r=(0,aX.jE)(),o=tx.useSearch(),{isAdminView:c}=ey(),d=(0,a0.C)({queryKey:["logs"]}),[u,m]=(0,s.useState)(()=>{let{start:e,end:a}=Z();return{startTime:e,endTime:a}});(0,s.useEffect)(()=>{let{start:a,end:t}=Z(),l={startTime:o.startTime?new Date(o.startTime):a,endTime:o.endTime?new Date(o.endTime):t,...o.channel?{channel:String(o.channel)}:{}};m("drawing"===e.logCategory?{...l,...o.filter?{mjId:o.filter}:{}}:{...l,...o.filter?{taskId:o.filter}:{}})},[e.logCategory,o.startTime,o.endTime,o.channel,o.filter]);let p=(0,s.useCallback)((e,a)=>{m(t=>({...t,[e]:a}))},[]),x=(0,s.useCallback)(()=>{let a=a3(u,e.logCategory);t({to:"/usage-logs/$section",params:{section:e.logCategory},search:{...a,page:1}}),r.invalidateQueries({queryKey:["logs"]})},[u,t,e.logCategory,r]),h=(0,s.useCallback)(()=>{let{start:a,end:l}=Z();m({startTime:a,endTime:l}),t({to:"/usage-logs/$section",params:{section:e.logCategory},search:{page:1,startTime:a.getTime(),endTime:l.getTime()}}),r.invalidateQueries({queryKey:["logs"]})},[t,e.logCategory,r]),g=(0,s.useCallback)(e=>{"Enter"===e.key&&x()},[x]),f=(0,s.useCallback)(a=>{m(t=>{var l;return l=e.logCategory,"drawing"===l?{...t,mjId:a}:{...t,taskId:a}})},[e.logCategory]),b="drawing"===e.logCategory?u.mjId||"":u.taskId||"",y=a("drawing"===e.logCategory?"Filter by MjProxy task ID":"Filter by task ID"),j=!!b||!!u.channel,v=(0,l.jsx)(ti,{wide:!0,children:(0,l.jsx)(tl,{start:u.startTime,end:u.endTime,onChange:e=>{let{start:a,end:t}=e;p("startTime",a),p("endTime",t)}})}),_=(0,l.jsx)(ti,{children:(0,l.jsx)(to,{"aria-label":a("Task ID"),placeholder:y,value:b,onChange:e=>f(e.target.value),onKeyDown:g})}),N=c?(0,l.jsx)(ti,{children:(0,l.jsx)(to,{placeholder:a("Channel ID"),value:u.channel||"",onChange:e=>p("channel",e.target.value),onKeyDown:g})}):null;return(0,l.jsx)(tc,{table:e.table,primaryFilters:(0,l.jsxs)(l.Fragment,{children:[v,_,N]}),mobilePinnedFilters:v,mobileFilters:(0,l.jsxs)(l.Fragment,{children:[_,N]}
2),mobileFilterCount:[b,u.channel].filter(Boolean).length,hasActiveFilters:j,onSearch:x,searchLoading:d>0,onReset:h})}var tg=t(41391),tf=t(77871),tb=t(36543);let ty={5:"bg-rose-50/40 dark:bg-rose-950/20 border-rose-200/50 dark:border-rose-900/30",6:"bg-blue-50/30 dark:bg-blue-950/15 border-blue-200/50 dark:border-blue-900/30"};function tj(){return(0,l.jsx)("div",{className:"border-border/50 bg-card overflow-hidden rounded-lg border",children:[1,2,3].map(e=>(0,l.jsxs)("div",{className:"border-border/40 space-y-2.5 border-b p-3 last:border-b-0",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,l.jsx)(aP.E,{className:"h-5 w-40 rounded-md"}),(0,l.jsx)(aP.E,{className:"h-5 w-16 rounded-md"})]}),(0,l.jsx)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2",children:[1,2,3,4,5,6].map(e=>(0,l.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,l.jsx)(aP.E,{className:"h-3 w-10 rounded"}),(0,l.jsx)(aP.E,{className:"h-4 w-full rounded"})]},e))})]},e))})}function tv(e){let{cell:a,fallback:t="-",className:r,primaryOnly:n=!1}=e;return(0,l.jsx)("div",{className:(0,ek.cn)("min-w-0 overflow-hidden leading-tight [&_button]:max-w-full [&_span]:max-w-full",n&&"[&_.flex-col]:min-w-0 [&_.flex-col>*:not(:first-child)]:hidden",r),children:a?(0,tg.Kv)(a.column.columnDef.cell,a.getContext()):(0,l.jsx)("span",{className:"text-muted-foreground/50",children:t})})}function t_(e){let{label:a,cell:t,className:r,valueClassName:n,primaryOnly:s=!1}=e;return t?(0,l.jsxs)("div",{className:(0,ek.cn)("bg-muted/20 min-w-0 rounded-md px-2 py-1.5",r),children:[null!=a&&""!==a&&(0,l.jsx)("div",{className:"text-muted-foreground mb-1 text-[11px] leading-none font-medium select-none",children:a}),(0,l.jsx)(tv,{cell:t,primaryOnly:s,className:n})]}):null}function tN(e){let{createdAt:a,type:t}=e,{t:r}=(0,i.Bd)(),n=Q(("number"==typeof t?t:void 0)??0),s=n.color;return(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("div",{className:"font-mono text-xs leading-tight tabular-nums",children:(0,m.fk)("number"==typeof a?a:void 0)}),(0,l.jsxs)("div",{className:(0,ek.cn)("inline-flex items-center gap-1 text-xs leading-none font-medium",eT.BQ[s]),children:[(0,l.jsx)("span",{className:(0,ek.cn)("size-1.5 shrink-0 rounded-full",eT.jk[s]),"aria-hidden":"true"}),(0,l.jsx)("span",{children:r(n.label)})]})]})}function tk(e){let{log:a}=e,{t}=(0,i.Bd)();if(!G(a.type))return null;let r=a.prompt_tokens||0,n=a.completion_tokens||0;if(0===r&&0===n)return(0,l.jsx)("div",{className:"bg-muted/20 min-w-0 rounded-md px-2 py-1.5",children:(0,l.jsx)("span",{className:"text-muted-foreground text-xs",children:"-"})});let s=eK(a.other),o=s?.cache_tokens||0,c=s?.cache_creation_tokens_5m||0,d=s?.cache_creation_tokens_1h||0,u=c>0||d>0?c+d:s?.cache_creation_tokens||0,m=o>0||u>0;return(0,l.jsx)("div",{className:"bg-muted/20 min-w-0 rounded-md px-2 py-1.5",children:(0,l.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,l.jsxs)("span",{className:"font-mono text-xs font-medium tabular-nums",children:[r.toLocaleString()," / ",n.toLocaleString()]}),m?(0,l.jsxs)("div",{className:"text-muted-foreground flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-[11px] leading-none",children:[o>0&&(0,l.jsxs)("span",{children:[t("Cache"),"↓ ",o.toLocaleString()]}),u>0&&(0,l.jsxs)("span",{children:["↑ ",u.toLocaleString()]})]}):(0,l.jsx)("span",{className:"text-muted-foreground/50 text-[11px] leading-none",children:"—"})]})})}function tw(e){let{log:a}=e,{sensitiveVisible:t,setSelectedUserId:r,setUserInfoDialogOpen:n}=eb();return a.username?(0,l.jsxs)("button",{type:"button",className:"bg-muted/20 flex min-w-0 items-center gap-1.5 rounded-md px-2 py-1.5 text-left",onClick:e=>{e.stopPropagation(),r(a.user_id),n(!0)},children:[(0,l.jsx)(eI.eu,{className:"ring-border/60 size-6 shrink-0 ring-1",children:(0,l.jsx)(eI.q5,{className:(0,ek.cn)("text-[11px] font-semibold",!t&&"bg-muted text-muted-foreground"),style:t?(0,e$.u)(a.username):void 0,children:t?(0,e$.f)(a.username):"•"})}),(0,l.jsx)("span",{className:"text-foreground min-w-0 truncate text-sm",children:t?a.username:"••••"})]}):null}function tC(e){let{log:a}=e;if(!Y(a.type))return null;let t=eK(a.other),r=a.use_time||0,n=r>0&&a.completion_tokens>0?a.completion_tokens/r:null;return(0,l.jsxs)("div",{className:"bg-muted/20 flex min-w-0 items-center gap-2.5 rounded-md px-2 py-1.5",children:[(0,l.jsx)(ax,{useTimeSec:r,completionTokens:a.completion_tokens,frtMs:t?.frt,isStream:a.is_stream,indicator:"dot",className:"min-w-0 flex-1"}),(0,l.jsx)(ah,{isStream:a.is_stream,tokensPerSecond:n,streamStatus:t?.stream_status,className:"shrink-0"})]})}function tS(e){let{cells:a}=e,{t}=(0,i.Bd)(),r=a.get("model_name"),n=a.get("quota"),s=a.get("created_at")?.row.original;return(0,l.jsxs)("div",{className:"space-y-2.5",children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,l.jsx)(tv,{cell:r,className:"flex-1"}),(0,l.jsx)(tv,{cell:n,className:"shrink-0 text-right [&_.flex-col]:items-end"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-[minmax(0,1fr)_minmax(0,0.8fr)] ga
2p-1.5",children:[(0,l.jsx)("div",{className:"bg-muted/20 min-w-0 rounded-md px-2 py-1.5",children:(0,l.jsx)(tN,{createdAt:s?.created_at,type:s?.type})}),(0,l.jsx)(t_,{cell:a.get("channel"),valueClassName:"[&_.flex-col]:max-w-none"}),s&&a.has("user")?(0,l.jsx)(tw,{log:s}):(0,l.jsx)(t_,{cell:a.get("user")}),(0,l.jsx)(t_,{cell:a.get("token_name"),valueClassName:"[&_.flex-col]:max-w-none [&_.flex-col>*:not(:first-child)]:text-[11px] [&_.flex-col>*:not(:first-child)]:leading-none"}),s?(0,l.jsx)(tC,{log:s}):(0,l.jsx)(t_,{cell:a.get("use_time")}),s?(0,l.jsx)(tk,{log:s}):(0,l.jsx)(t_,{cell:a.get("prompt_tokens")}),(0,l.jsx)(t_,{label:t("Details"),cell:a.get("content"),className:"col-span-2 bg-transparent px-0 py-0"})]})]})}function tA(e){let{cells:a}=e,{t}=(0,i.Bd)(),r=a.get("task_id"),n=a.get("status"),s=a.get("submit_time");return(0,l.jsxs)("div",{className:"space-y-2.5",children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[(0,l.jsx)(tv,{cell:r,className:"flex-1"}),(0,l.jsx)(tv,{cell:n,className:"shrink-0 text-right"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-1.5",children:[(0,l.jsx)(t_,{label:t("Submit Time"),cell:s}),(0,l.jsx)(t_,{label:t("User"),cell:a.get("user"),primaryOnly:!0}),(0,l.jsx)(t_,{label:t("Result"),cell:a.get("fail_reason"),className:"col-span-2 bg-transparent px-0 py-0"})]})]})}function tT(e){let{cells:a}=e,{t}=(0,i.Bd)(),r=a.get("action"),n=a.get("code"),s=a.get("submit_time");return(0,l.jsxs)("div",{className:"space-y-2.5",children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[(0,l.jsx)(tv,{cell:r,className:"flex-1"}),(0,l.jsx)(tv,{cell:n,className:"shrink-0 text-right"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-1.5",children:[(0,l.jsx)(t_,{label:t("Submit Time"),cell:s}),(0,l.jsx)(t_,{label:t("Channel"),cell:a.get("channel"),primaryOnly:!0}),(0,l.jsx)(t_,{label:t("Task ID"),cell:a.get("mj_id")}),(0,l.jsx)(t_,{label:t("Duration"),cell:a.get("duration"),primaryOnly:!0}),(0,l.jsx)(t_,{label:t("Image"),cell:a.get("image_url")}),(0,l.jsx)(t_,{label:t("Prompt"),cell:a.get("prompt"),primaryOnly:!0}),(0,l.jsx)(t_,{label:t("Fail Reason"),cell:a.get("fail_reason"),className:"col-span-2 bg-transparent px-0 py-0"})]})]})}function tI(e){let{table:a,isLoading:t=!1,emptyTitle:r,emptyDescription:n,logCategory:s}=e,{t:o}=(0,i.Bd)(),c=r??o("No Logs Found"),d=n??o("No usage logs available. Logs will appear here once API calls are made.");if(t)return(0,l.jsx)(tj,{});let u=a.getRowModel().rows;return u&&0!==u.length?(0,l.jsx)("div",{className:"border-border/50 bg-card overflow-hidden rounded-lg border",children:u.map(e=>{let a=new Map(e.getVisibleCells().map(e=>[e.column.id,e])),t=e.original.type,r=null!=t?ty[t]??"":"";return(0,l.jsxs)("div",{className:(0,ek.cn)("border-border/40 border-b border-l-2 border-l-transparent p-3 transition-colors last:border-b-0",r),children:["common"===s&&(0,l.jsx)(tS,{cells:a}),"task"===s&&(0,l.jsx)(tA,{cells:a}),"drawing"===s&&(0,l.jsx)(tT,{cells:a})]},e.id)})}):(0,l.jsx)("div",{className:"rounded-lg border p-6",children:(0,l.jsx)(tb.Sv,{className:"border-none p-0",children:(0,l.jsxs)(tb.FT,{children:[(0,l.jsx)(tb.Kr,{variant:"icon",children:(0,l.jsx)(tf.A,{className:"size-6"})}),(0,l.jsx)(tb.cz,{children:c}),(0,l.jsx)(tb.Ou,{children:d})]})})})}let tM=(0,r.GY)("/_authenticated/usage-logs/$section"),tz={5:"bg-rose-50/40 dark:bg-rose-950/20",6:"bg-blue-50/30 dark:bg-blue-950/15"};function t$(e){return(Array.isArray(e)?e:e?[e]:[]).filter(e=>"0"!==String(e))}function tq(e){let{logCategory:a}=e,{t}=(0,i.Bd)(),{isAdminView:r}=ey(),n=(0,e_.Ub)("(max-width: 640px)"),o=tM.useSearch(),{columnFilters:c,onColumnFiltersChange:u,pagination:p,onPaginationChange:x,ensurePageInRange:h}=(0,eN.c)({search:tM.useSearch(),navigate:tM.useNavigate(),pagination:{defaultPage:1,defaultPageSize:n?20:100},globalFilter:{enabled:!1},columnFilters:[{columnId:"created_at",searchKey:"type",type:"array",deserialize:t$},{columnId:"model_name",searchKey:"model",type:"string"},{columnId:"token_name",searchKey:"token",type:"string"},{columnId:"group",searchKey:"group",type:"string"},...r?[{columnId:"channel",searchKey:"channel",type:"string"},{columnId:"username",searchKey:"username",type:"string"}]:[]]}),{data:g,isLoading:f,isFetching:b}=(0,ej.I)({queryKey:["logs",a,r,p.pageIndex+1,p.pageSize,c,o,t],queryFn:async()=>{let e=await ea({logCategory:a,isAdmin:r,page:p.pageIndex+1,pageSize:p.pageSize,searchParams:o,columnFilters:c});return e?.success?e.data||j:(d.oR.error(e?.message||t("Failed to load logs")),j)},placeholderData:(e,t)=>{if(t?.queryKey[1]===a)return e}}),y=g?.items||[],v=function(e,a){let t=function(e){let{t:a}=(0,i.Bd)(),t=[{accessorKey:"created_at",header:a("Time"),cell:e=>{let{row:t}=e,r=t.original,n=t.getValue("created_at"),s=Q(r.type);return(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,l.jsx)("span",{className:"truncate font-mono text-xs tabular-nums",children:(0,m.fk)(n)}),(0,l.jsx)(eT.Wh,{label:a(s.label),variant:s.color,size:"sm",copyable:!1,className:"-ml-1.5 !text-xs [&_span]:!text-xs"})]})},filterFn:(e,a,t)=>!!(!Array.isArray(t)||0===t.length||t.includes("0"))||t.includes(String(e.original.type)),enableHiding:!1,size:180}];return e&&t.push({id:"channel",header:a("Channel"),accessorFn:e=>e.channel,cell:function(e){let{row:t}=e,{sensitiveVisible:r,setAffinityTarget:n,setAffinityDialogOpen:s}=eb(),i=t.original;if(!G(i.type))return null;let o=eK(i.other),c=o?.admin_info?.channel_affinity,d=o?.admin_info?.use_channel??[],u=Array.isArray(d)?d.map(String).filter(
2Boolean):[],m=u.length>1,p=m?u.join(" → "):void 0,x=i.channel_name?`${i.channel_name} #${i.channel}`:`#${i.channel}`,h=`#${i.channel}`,g=r?i.channel_name:"••••",f=o?.admin_info?.multi_key_index,b=o?.admin_info?.is_multi_key===!0&&"number"==typeof f&&Number.isFinite(f);return(0,l.jsx)(ez.Bc,{children:(0,l.jsxs)(ez.m_,{children:[(0,l.jsxs)(ez.k$,{render:(0,l.jsx)("div",{className:"flex max-w-[160px] flex-col gap-0.5"}),children:[(0,l.jsxs)("div",{className:"relative inline-flex w-fit items-center gap-1",children:[(0,l.jsx)(eT.Wh,{label:h,autoColor:String(i.channel),copyText:String(i.channel),size:"sm",showDot:!1,className:"font-mono"}),b&&(0,l.jsx)(eT.Wh,{label:String(f),size:"sm",showDot:!1,copyable:!1,variant:"neutral",className:"h-5 min-w-5 justify-center rounded-full px-1 font-mono text-xs","aria-label":`${a("Key")} ${f}`}),m&&(0,l.jsxs)(eM.AM,{children:[(0,l.jsx)(eM.Wv,{render:(0,l.jsx)("button",{type:"button",className:"text-muted-foreground hover:text-foreground focus-visible:ring-ring inline-flex size-5 shrink-0 items-center justify-center rounded-full transition-colors focus-visible:ring-2 focus-visible:outline-none","aria-label":a("Retry Chain"),onClick:e=>e.stopPropagation()}),children:(0,l.jsx)(ew.A,{className:"size-3.5 text-amber-500","aria-hidden":"true"})}),(0,l.jsx)(eM.hl,{side:"top",align:"start",className:"w-64 text-xs",children:(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)("p",{className:"font-medium",children:a("Retry Chain")}),(0,l.jsx)("p",{className:"text-muted-foreground font-mono break-all",children:p})]})})]}),c&&(0,l.jsx)("button",{type:"button",className:"absolute -top-1 -right-1 leading-none text-amber-500",onClick:e=>{e.stopPropagation(),n({rule_name:c.rule_name||"",using_group:c.using_group||c.selected_group||"",key_hint:c.key_hint||"",key_fp:c.key_fp||""}),s(!0)},children:(0,l.jsx)(eC.A,{className:"size-3 fill-current"})})]}),i.channel_name&&(0,l.jsx)("span",{className:"text-muted-foreground/70 truncate [font-family:var(--font-body)] !text-xs",children:g})]}),(0,l.jsx)(ez.ZI,{children:(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("p",{children:r?x:h}),p&&(0,l.jsxs)("p",{className:"text-muted-foreground text-xs",children:[a("Chain"),": ",p]}),b&&(0,l.jsxs)("p",{className:"text-muted-foreground text-xs",children:[a("Key"),": ",f]}),c&&(0,l.jsxs)("div",{className:"border-t pt-1 text-xs",children:[(0,l.jsx)("p",{className:"font-medium",children:a("Channel Affinity")}),(0,l.jsxs)("p",{children:[a("Rule"),": ",c.rule_name||"-"]}),(0,l.jsxs)("p",{children:[a("Group"),":"," ",r?c.using_group||c.selected_group||"-":"••••"]})]})]})})]})})}},{id:"user",header:a("User"),accessorFn:e=>e.username,cell:function(e){let{row:a}=e,{sensitiveVisible:t,setSelectedUserId:r,setUserInfoDialogOpen:n}=eb(),s=a.original;return s.username?(0,l.jsxs)("button",{type:"button",className:"flex items-center gap-1.5 text-left",onClick:e=>{e.stopPropagation(),r(s.user_id),n(!0)},children:[(0,l.jsx)(eI.eu,{className:"ring-border/60 size-6 ring-1 max-sm:hidden",children:(0,l.jsx)(eI.q5,{className:(0,ek.cn)("text-[11px] font-semibold",!t&&"bg-muted text-muted-foreground"),style:t?(0,e$.u)(s.username):void 0,children:t?(0,e$.f)(s.username):"•"})}),(0,l.jsx)(ez.Bc,{delay:300,children:(0,l.jsxs)(ez.m_,{children:[(0,l.jsx)(ez.k$,{render:(0,l.jsx)("span",{className:"text-muted-foreground max-w-[100px] truncate text-sm hover:underline"}),children:t?s.username:"••••"}),t&&s.username.length>12&&(0,l.jsx)(ez.ZI,{side:"top",children:s.username})]})})]}):null}}),t.push({accessorKey:"token_name",header:a("Token"),cell:function(e){let{row:a}=e,{sensitiveVisible:t}=eb(),r=a.original;if(!G(r.type))return null;let n=r.token_name;if(!n)return null;let s=eK(r.other),i=t?n:"••••",o=r.group;o||(o=s?.group||"");let c=function(e){let a=e?.user_group_ratio;if(null!=a&&-1!==a&&Number.isFinite(a))return a;let t=e?.group_ratio;return null!=t&&1!==t&&Number.isFinite(t)?t:null}(s);return(0,l.jsxs)("div",{className:"flex max-w-[200px] flex-col gap-0.5",children:[(0,l.jsx)(ez.Bc,{delay:300,children:(0,l.jsxs)(ez.m_,{children:[(0,l.jsx)(ez.k$,{render:(0,l.jsx)("div",{className:"max-w-full"}),children:(0,l.jsx)(eT.Wh,{label:i,icon:eS.A,copyText:t?n:void 0,size:"sm",showDot:!1,className:"border-border/60 bg-muted/30 text-foreground h-6 max-w-full gap-1.5 overflow-hidden rounded-md border px-2 py-0.5 [font-family:var(--font-body)]"})}),t&&n.length>16&&(0,l.jsx)(ez.ZI,{side:"top",className:"max-w-xs break-all",children:n})]})}),(o||null!=c)&&(0,l.jsxs)("span",{className:"block max-w-full truncate text-xs leading-none",children:[o?(0,l.jsx)(eA.d,{group:o,label:t?void 0:"••••",type:"text",size:"sm",className:"inline align-baseline text-xs leading-none [&>span]:leading-none"}):null,o&&null!=c?" ":null,null!=c?(0,l.jsxs)("span",{className:"text-muted-foreground
2/60 relative top-px align-baseline tabular-nums",children:[ag(c),"x"]}):null]})]})},size:160}),t.push({accessorKey:"model_name",header:a("Model"),cell:function(e){let a,t,{row:r}=e,n=r.original;if(!G(n.type))return null;let s=(a=eK(n.other),t=!!(a?.is_model_mapped&&a?.upstream_model_name&&""!==a.upstream_model_name),{name:n.model_name,isMapped:t,actualModel:t?a.upstream_model_name:void 0});return(0,l.jsx)("div",{className:"flex w-fit flex-col gap-0.5",children:(0,l.jsx)(au,{modelName:s.name,actualModel:s.actualModel})})},meta:{mobileTitle:!0}},{accessorKey:"is_stream",header:a("Stream"),cell:e=>{let{row:a}=e,t=a.original;if(!Y(t.type))return null;let r=a.getValue("use_time"),n=eK(t.other),s=r>0&&t.completion_tokens>0?t.completion_tokens/r:null;return(0,l.jsx)(ah,{isStream:t.is_stream,tokensPerSecond:s,streamStatus:n?.stream_status})},meta:{label:a("Stream")}},{accessorKey:"prompt_tokens",header:"Tokens",cell:e=>{let{row:t}=e,r=t.original;if(!G(r.type))return null;let n=eK(r.other),s=r.prompt_tokens||0,i=r.completion_tokens||0;if(0===s&&0===i)return(0,l.jsx)("span",{className:"text-muted-foreground text-xs",children:"-"});let o=n?.cache_tokens||0,c=n?.cache_creation_tokens_5m||0,d=n?.cache_creation_tokens_1h||0,u=c>0||d>0?c+d:n?.cache_creation_tokens||0;return(0,l.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,l.jsxs)("span",{className:"font-mono text-xs font-medium tabular-nums",children:[s.toLocaleString()," /"," ",i.toLocaleString()]}),(o>0||u>0)&&(0,l.jsxs)("div",{className:"flex items-center gap-1 text-[11px]",children:[o>0&&(0,l.jsxs)("span",{className:"text-muted-foreground/60",children:[a("Cache"),"↓ ",o.toLocaleString()]}),u>0&&(0,l.jsxs)("span",{className:"text-muted-foreground/60",children:["↑ ",u.toLocaleString()]})]})]})}},{accessorKey:"quota",header:a("Cost"),cell:e=>{var t;let r,{row:n}=e,s=n.original;if(!G(s.type))return null;let i=n.getValue("quota"),o=eK(s.other);if(o?.billing_source==="subscription")return(0,l.jsx)(ez.Bc,{children:(0,l.jsxs)(ez.m_,{children:[(0,l.jsx)(ez.k$,{render:(0,l.jsx)(eT.Wh,{label:a("Subscription"),variant:"success",size:"sm",copyable:!1,className:"cursor-help"})}),(0,l.jsx)(ez.ZI,{children:(0,l.jsxs)("span",{children:[a("Deducted by subscription"),": ",(0,m.qW)(i)]})})]})});let c=(r=(t=(0,m.qW)(i)).match(/^([^0-9+\-.,\s]+)(.+)$/))?{prefix:r[1],amount:r[2]}:{prefix:"",amount:t};return(0,l.jsx)("div",{className:"flex flex-col gap-0.5",children:(0,l.jsxs)("span",{className:"border-border/80 bg-muted/60 inline-flex h-6 w-fit items-center rounded-md border px-2 [font-family:var(--font-body)] text-sm leading-none font-semibold tabular-nums",children:[c.prefix&&(0,l.jsx)("span",{className:"mr-1",children:c.prefix}),(0,l.jsx)("span",{children:c.amount})]})})}},{accessorKey:"use_time",header:a("Timing"),cell:e=>{let{row:a}=e,t=a.original;if(!Y(t.type))return null;let r=a.getValue("use_time"),n=eK(t.other);return(0,l.jsx)(ax,{useTimeSec:r,completionTokens:t.completion_tokens,frtMs:n?.frt,isStream:t.is_stream})}},{accessorKey:"content",header:a("Details"),cell:function(t){let r,{row:n}=t,[i,o]=(0,s.useState)(!1),c=n.original,d=eK(c.other),u=(r=function(e,a,t){if(3===e.type||7===e.type){let e=eV(a,t);return e?[{text:e}]:[]}if(6===e.type)return[{text:t("Async task refund")}];if(2!==e.type)return[];if(eR(a)){let l=[];return l.push({text:t("Violation Fee"),danger:!0}),a?.violation_fee_code&&l.push({text:a.violation_fee_code,muted:!0}),l.push({text:`${t("Fee")}: ${(0,m.qW)(a?.fee_quota??e.quota)}`,muted:!0}),l}if(!a)return[];let l=[],r={digitsLarge:4,digitsSmall:6,abbreviate:!1},n=e=>(0,eq.AM)(e,r),s=(e,a)=>{let t=e.join(" / ");return a?`${t}/M`:t},i="tiered_expr"===a.billing_mode,o=eB(a);if(i)if(o){let e=o.priceEntries.filter(e=>["inputPrice","outputPrice"].includes(e.field)).map(e=>n(e.price));if(e.length>0){let a=o.tier.label||t("Default");l.push({text:`${a} \xb7 ${s(e,!0)}`})}let a=o.priceEntries.filter(e=>["cacheReadPrice","cacheCreatePrice","cacheCreate1hPrice"].includes(e.field)).map(e=>n(e.price));a.length>0&&l.push({text:`${t("Cache")} ${s(a,!1)}`,muted:!0});let i=o.priceEntries.filter(e=>!["inputPrice","outputPrice","cacheReadPrice","cacheCreatePrice","cacheCreate1hPrice"].includes(e.field)).map(e=>{let a;return`${t(e.shortLabel)} ${a=e.price,`${(0,eq.AM)(a,r)}/M`}`});i.length>0&&l.push({text:i.join(" · "),muted:!0}
2)}else l.push({text:`${t("Dynamic Pricing")} \xb7 ${t("No matching results")}`,muted:!0});else{let e=a.model_price;if((e??0)>0&&null!=e)l.push({text:`${t("Per-call")} \xb7 ${(0,eq.AM)(e,r)}`});else if(null!=a.model_ratio){let e=2*a.model_ratio,r=[n(e)];if(null!=a.completion_ratio&&r.push(n(e*a.completion_ratio)),l.push({text:`${t("Standard")} \xb7 ${s(r,!0)}`}),eE(a)){let r=[null!=a.cache_ratio&&1!==a.cache_ratio?n(e*a.cache_ratio):null,null!=a.cache_creation_ratio&&1!==a.cache_creation_ratio?n(e*a.cache_creation_ratio):null,null!=a.cache_creation_ratio_1h&&0!==a.cache_creation_ratio_1h?n(e*a.cache_creation_ratio_1h):null].filter(Boolean);r.length>0&&l.push({text:`${t("Cache")} ${s(r,!1)}`,muted:!0})}}else{let e=a.user_group_ratio,r=a.group_ratio,n=null!=e&&Number.isFinite(e)&&-1!==e,s=n?e:r,i=n?t("User Exclusive Ratio"):t("Group Ratio");null!=s&&Number.isFinite(s)&&l.push({text:`${i} ${ag(s)}x`})}}return a.is_system_prompt_overwritten&&l.push({text:t("System Prompt Override"),danger:!0}),l}(c,d,a),e&&d?.admin_info?.quota_saturation?[{text:a("Quota clamped"),danger:!0},...r]:r),p=u[0],x=u.length>1,h="text-foreground";p?.muted?h="text-muted-foreground/60":p?.danger&&(h="text-red-600 dark:text-red-400");let g=(0,l.jsx)("span",{className:"text-muted-foreground/40",children:"—"});return p?g=(0,l.jsxs)("span",{className:(0,ek.cn)("truncate leading-snug group-hover:underline",h),children:[p.text,x&&(0,l.jsxs)("span",{className:"text-muted-foreground/40 ml-0.5",children:["+",u.length-1]})]}):c.content&&(g=(0,l.jsx)("span",{className:"text-muted-foreground truncate group-hover:underline",children:c.content})),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{type:"button",className:"group flex max-w-[200px] items-center gap-1 text-left text-xs",onClick:()=>o(!0),title:a("Click to view full details"),children:g}),(0,l.jsx)(ao,{log:c,isAdmin:e,open:i,onOpenChange:o})]})},size:180,maxSize:200}),t}(a),r=function(e){let{t:a}=(0,i.Bd)(),t=[{accessorKey:"submit_time",header:a("Submit Time"),cell:e=>{let{row:t}=e,r=t.original,n=t.getValue("submit_time");return(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,l.jsx)("span",{className:"truncate font-mono text-xs tabular-nums",children:(0,m.fk)(n,"milliseconds")}),(0,l.jsx)(eT.Wh,{label:a(aq.getLabel(r.status)),variant:aq.getVariant(r.status),size:"sm",copyable:!1})]})},size:180}];return e&&t.push(aU({headerLabel:a("Channel")})),t.push({accessorKey:"action",header:a("Type"),cell:e=>{let{row:t}=e,r=t.getValue("action");return(0,l.jsx)(eT.Wh,{label:a(a$.getLabel(r)),variant:a$.getVariant(r),icon:aW[r]??aM.A,size:"sm",copyable:!1,className:"-ml-1.5"})}}),t.push({accessorKey:"mj_id",header:a("Task ID"),cell:e=>{let{row:a}=e,t=a.getValue("mj_id");return t?(0,l.jsx)("div",{className:"flex max-w-[160px] flex-col gap-0.5",children:(0,l.jsx)(eT.Wh,{label:t,copyText:t,variant:"neutral",size:"sm",className:"border-border/60 bg-muted/30 !text-foreground max-w-full truncate rounded-md border px-1.5 py-0.5 font-mono"})}):(0,l.jsx)("span",{className:"text-muted-foreground/60 text-xs",children:"-"})},meta:{mobileTitle:!0}}),t.push(aB({submitTimeKey:"submit_time",finishTimeKey:"finish_time",headerLabel:a("Duration")})),e&&t.push({accessorKey:"code",header:a("Submit Result"),cell:e=>{let{row:t}=e,r=t.getValue("code");return(0,l.jsx)(eT.Wh,{label:a(aD.getLabel(String(r))),variant:aD.getVariant(String(r)),size:"sm",copyable:!1,className:"-ml-1.5"})}}),t.push(aV({headerLabel:a("Progress")}),{accessorKey:"image_url",header:a("Image"),cell:function(e){let{row:t}=e,r=t.original,n=t.getValue("image_url"),[i,o]=(0,s.useState)(!1);return n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{type:"button",className:"group text-left text-xs",onClick:()=>o(!0),title:a("Click to view image"),children:(0,l.jsx)("span",{className:"text-foreground truncate leading-snug group-hover:underline",children:a("View")})}),(0,l.jsx)(aL,{imageUrl:n,taskId:r.mj_id,open:i,onOpenChange:o})]}):(0,l.jsx)("span",{className:"text-muted-foreground/60 text-xs",children:"-"})}},{accessorKey:"prompt",header:a("Prompt"),cell:function(e){let{row:t}
2=e,r=t.original,n=t.getValue("prompt"),[i,o]=(0,s.useState)(!1);return n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{type:"button",className:"group flex max-w-[220px] items-center text-left text-xs",onClick:()=>o(!0),title:a("Click to view full prompt"),children:(0,l.jsx)("span",{className:"text-muted-foreground truncate leading-snug group-hover:underline",children:n})}),(0,l.jsx)(aO,{prompt:n,promptEn:r.prompt_en,open:i,onOpenChange:o})]}):(0,l.jsx)("span",{className:"text-muted-foreground/60 text-xs",children:"-"})},size:200,maxSize:220},function(e){let{accessorKey:a="fail_reason",headerLabel:t,cellTitle:r}=e;return{accessorKey:a,header:e=>{let{column:a}=e;return(0,l.jsx)(ev.wZ,{column:a,title:t})},cell:function(e){let{row:t}=e,n=t.getValue(a),[i,o]=(0,s.useState)(!1);return n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{type:"button",className:"group flex max-w-[200px] items-center gap-1 text-left text-xs",onClick:()=>o(!0),title:r,children:(0,l.jsx)("span",{className:"truncate leading-snug text-red-600 group-hover:underline dark:text-red-400",children:n})}),(0,l.jsx)(aE,{failReason:n,open:i,onOpenChange:o})]}):(0,l.jsx)("span",{className:"text-muted-foreground/60 text-xs",children:"-"})},meta:{label:t}}}({headerLabel:a("Fail Reason"),cellTitle:a("Click to view full error message")})),t}(a),n=function(e){let{t:a}=(0,i.Bd)(),t=[{accessorKey:"submit_time",header:a("Submit Time"),cell:e=>{let{row:a}=e,t=a.original,r=a.getValue("submit_time");return(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,l.jsx)("span",{className:"truncate font-mono text-xs tabular-nums",children:(0,m.fk)(r,"seconds")}),t.finish_time?(0,l.jsx)("span",{className:"text-muted-foreground/60 truncate font-mono text-[11px] tabular-nums",children:(0,m.fk)(t.finish_time,"seconds")}):(0,l.jsx)("span",{className:"text-muted-foreground/50 text-[11px]",children:"-"})]})},size:180}];return e&&t.push(aU({headerLabel:a("Channel")}),{id:"user",header:a("User"),accessorFn:e=>e.username||e.user_id,cell:function(e){let{row:a}=e,{sensitiveVisible:t,setSelectedUserId:r,setUserInfoDialogOpen:n}=eb(),s=a.original,i=s.username||String(s.user_id||"?");return(0,l.jsxs)("button",{type:"button",className:"flex items-center gap-1.5 text-left",onClick:e=>{e.stopPropagation(),r(s.user_id),n(!0)},children:[(0,l.jsx)(eI.eu,{className:"ring-border/60 size-6 ring-1 max-sm:hidden",children:(0,l.jsx)(eI.q5,{className:(0,ek.cn)("text-[11px] font-semibold",!t&&"bg-muted text-muted-foreground"),style:t?(0,e$.u)(i):void 0,children:t?(0,e$.f)(i):"•"})}),(0,l.jsx)("span",{className:"text-muted-foreground truncate text-sm hover:underline",children:t?i:"••••"})]})}}),t.push({accessorKey:"task_id",header:a("Task ID"),cell:e=>{let{row:t}=e,r=t.original,n=t.getValue("task_id");return n?(0,l.jsxs)("div",{className:"flex max-w-[170px] flex-col gap-0.5",children:[(0,l.jsx)(eT.Wh,{label:n,copyText:n,variant:"neutral",size:"sm",className:"border-border/60 bg-muted/30 !text-foreground max-w-full truncate rounded-md border px-1.5 py-0.5 font-mono"}),(0,l.jsxs)("span",{className:"text-muted-foreground/60 truncate text-[11px]",children:[a(r.platform)," · ",a(aF.getLabel(r.action))]})]}):(0,l.jsx)("span",{className:"text-muted-foreground/60 text-xs",children:"-"})},meta:{mobileTitle:!0}},aB({submitTimeKey:"submit_time",finishTimeKey:"finish_time",unit:"seconds",headerLabel:a("Duration"),warningThresholdSec:300}),{accessorKey:"status",header:a("Status"),cell:e=>{let{row:t}=e,r=t.getValue("status");return(0,l.jsx)(eT.Wh,{label:a(aR.getLabel(r,r||"Submitting")),variant:aR.getVariant(r),size:"sm",copyable:!1,className:"-ml-1.5"})}},aV({headerLabel:a("Progress")}),{accessorKey:"fail_reason",header:a("Details"),cell:function(e){let{row:t}=e,r=t.original,n=t.getValue("fail_reason"),i=r.status,[o,c]=(0,s.useState)(!1);if("suno"===r.platform&&i===U&&aZ(r.data).some(e=>e&&"object"==typeof e&&e.audio_url))return(0,l.jsx)(aJ,{log:r});let d=r.action===P||r.action===L||r.action===O||r.action===E||r.action===B,u=n?.startsWith("http");if(i===U&&d&&u){let e=`/v1/videos/${r.task_id}/content`;return(0,l.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-foreground text-xs hover:underline",children:a("Click to preview video")})}return n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{type:"button",className:"group flex max-w-[200px] items-center gap-1 text-left text-xs",onClick:()=>c(!0),title:a("Click to view full error message"),children:(0,l.jsx)("span",{className:"truncate leading-snug text-red-600 group-hover:underline dark:text-red-400",children:n})}),(0,l.jsx)(aE,{failReason:n,open:o,onOpenChange:c})]}
2):(0,l.jsx)("span",{className:"text-muted-foreground/60 text-xs",children:"-"})},size:200,maxSize:220}),t}(a);switch(e){case"common":default:return t;case"drawing":return r;case"task":return n}}(a,r),_=f||b&&!g,{table:N}=(0,ev.uI)({data:y,columns:v,columnFilters:c,columnVisibilityStorageKey:`usage-logs:${a}:${r?"admin":"user"}:column-visibility`,pagination:p,enableRowSelection:!1,onPaginationChange:x,onColumnFiltersChange:u,manualPagination:!0,manualFiltering:!0,totalCount:g?.total||0,ensurePageInRange:h}),k="common"===a;return(0,l.jsx)(ev.cx,{table:N,columns:v,isLoading:_,isFetching:b,emptyTitle:t("No Logs Found"),emptyDescription:t("No usage logs available. Logs will appear here once API calls are made."),skeletonKeyPrefix:"usage-log-skeleton",applyHeaderSize:!0,tableClassName:(0,ek.cn)("[&_[data-slot=table]]:text-[13px] [&_[data-slot=table]_td]:text-[13px] [&_[data-slot=table]_td_*]:text-[13px] [&_[data-slot=table]_th]:text-[13px] [&_[data-slot=table]_th_*]:text-[13px]"),mobile:(0,l.jsx)(tI,{table:N,isLoading:_,logCategory:a}),toolbar:k?(0,l.jsx)(tp,{table:N}):(0,l.jsx)(th,{table:N,logCategory:a}),renderRow:e=>{let a=e.original.type,t=k&&null!=a?tz[a]??"":"";if(k&&r){let a=eK(e.original.other??"");a?.admin_info?.quota_saturation&&(t="bg-amber-50/60 dark:bg-amber-950/25")}return(0,l.jsx)(ev.J2,{row:e,className:(0,ek.cn)("transition-colors",t),getColumnClassName:()=>k?"py-2":"py-3.5"},e.id)}})}var tD=t(87711);let tF=(0,r.GY)("/_authenticated/usage-logs/$section"),tR=["drawing","task"],tK={common:{titleKey:"Common Logs"},drawing:{titleKey:"Drawing Logs"},task:{titleKey:"Task Logs"}};function tP(){let{t:e}=(0,i.Bd)(),a=(0,n.Z)(),t=tF.useParams(),r=t.section&&(0,tD.Dk)(t.section)?t.section:tD.Ck,{selectedUserId:d,userInfoDialogOpen:u,setUserInfoDialogOpen:m,affinityTarget:p,affinityDialogOpen:g,setAffinityDialogOpen:f}=eb(),{canManageScope:b,viewScope:y,setViewScope:j}=ey(),v=(0,s.useMemo)(()=>[{title:"Task Logs",items:tR.map(e=>({title:tK[e].titleKey,url:`/usage-logs/${e}`}))}],[]),_=(0,h.K)(v),N=(0,s.useMemo)(()=>(_[0]?.items??[]).map(e=>"url"in e&&"string"==typeof e.url?e.url.split("/").pop()??null:null).filter(e=>!!(e&&(0,tD.Dk)(e))),[_]),k=(0,s.useCallback)(e=>{a({to:"/usage-logs/$section",params:{section:e}})},[a]),w=(0,s.useCallback)(e=>{("all"===e||"self"===e)&&j(e)},[j]),C="common"===r?tK.common:tK.task,S="common"!==r&&N.length>1;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(o.Ni,{fixedContent:!0,children:[(0,l.jsx)(o.Ni.Title,{children:e(C.titleKey)}),b&&(0,l.jsx)(o.Ni.Actions,{children:(0,l.jsx)(c.tU,{value:y,onValueChange:w,children:(0,l.jsxs)(c.j7,{children:[(0,l.jsx)(c.Xi,{value:"all",children:e("All")}),(0,l.jsx)(c.Xi,{value:"self",children:e("Only Mine")})]})})}),(0,l.jsx)(o.Ni.Content,{children:(0,l.jsxs)("div",{className:"flex h-full min-h-0 flex-col gap-4",children:[S&&(0,l.jsx)(c.tU,{value:r,onValueChange:k,children:(0,l.jsx)(c.j7,{className:"max-w-full flex-wrap justify-start group-data-horizontal/tabs:h-auto",children:N.map(a=>(0,l.jsx)(c.Xi,{value:a,children:e(tK[a].titleKey)},a))})}),(0,l.jsx)("div",{className:"min-h-0 flex-1",children:(0,l.jsx)(tq,{logCategory:r})})]})})]}),(0,l.jsx)(ex,{userId:d,open:u,onOpenChange:m}),(0,l.jsx)(x,{open:g,onOpenChange:f,target:p?{rule_name:p.rule_name||"",using_group:p.using_group||p.selected_group||"",key_hint:p.key_hint||"",key_fp:p.key_fp||""}:null})]})}let tL=function(){return(0,l.jsx)(ef,{children:(0,l.jsx)(tP,{})})}},99238(e,a,t){let l=(0,t(40946).A)("calendar-days",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);t.d(a,{},{A:l})},28213(e,a,t){let l=(0,t(40946).A)("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]);t.d(a,{},{A:l})},24014(e,a,t){let l=(0,t(40946).A)("log-in",[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}
2],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]);t.d(a,{},{A:l})},49979(e,a,t){let l=(0,t(40946).A)("route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);t.d(a,{},{A:l})},53286(e,a,t){let l=(0,t(40946).A)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);t.d(a,{},{A:l})},26464(e,a,t){let l=(0,t(40946).A)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);t.d(a,{},{A:l})},95099(e,a,t){let l=(0,t(40946).A)("shuffle",[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]]);t.d(a,{},{A:l})},99554(e,a,t){let l=(0,t(40946).A)("user-round",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);t.d(a,{},{A:l})},50926(e,a,t){let l=(0,t(40946).A)("wand-sparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);t.d(a,{},{A:l})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.