1import{d as ue,A as Ve,C as Oe,o as r,c as i,e as we,a as e,t as c,j as A,F as B,i as j,k as y,_ as qe,l as oe,w as _e,a8 as Ne,h as V,X as L,Y as z,n as O,a9 as Ue,f as xe,p as Pe,aa as ze,g as ie,L as Fe}from"./app-YcnN7_bz.js";import{u as ot}from"./useSeo-Bsuyj7Ul.js";class R extends Error{status;code;constructor(m,o=0,v=""){super(m),this.name="AdminRequestError",this.status=o,this.code=v}}async function de(n,m={}){if(!n.startsWith("/api/admin/"))throw new Error("Invalid admin API path");const o=await fetch(n,{...m,credentials:"same-origin",redirect:"manual",cache:"no-store"});if(o.type==="opaqueredirect"||o.status>=300&&o.status<400)throw new R("é®ç®±éªè¯å·²è¿æï¼è¯·éæ°éªè¯é®ç®±ã",403,"ADMIN_ACCESS_REQUIRED");if(o.status===429)throw new R("å°è¯æ¬¡æ°è¿å¤ï¼åå°è®¿é®å·²ææ¶å°éï¼è¯·ç¨ååè¯ã",429);if(!o.headers.get("content-type")?.includes("application/json"))throw o.status===403||o.ok?new R("è¯·éæ°éªè¯é®ç®±ååæä½ã",403,"ADMIN_ACCESS_REQUIRED"):new R("å尿塿æ¶ä¸å¯ç¨ï¼è¯·ç¨ååè¯ã",o.status);const a=await o.clone().json().catch(()=>null);if(!a)throw new R("åå°ååºå¼å¸¸ï¼è¯·ç¨ååè¯ã",o.status);if(a.code==="ADMIN_ACCESS_REQUIRED")throw new R("é®ç®±éªè¯å·²è¿ææå½åè´¦å·æ æè®¿é®ï¼è¯·éæ°éªè¯é®ç®±ã",o.status,a.code);if(a.code==="ADMIN_ACCESS_NOT_CONFIGURED")throw new R("åå°é®ç®±éªè¯å°æªé
ç½®å®æï¼è¯·ç¨ååè¯ã",o.status,a.code);if(!o.ok){const d=o.status===401?"åå°å¯ç é误ã":o.status===403?"åå°å¯ç éªè¯å¤±è´¥ï¼è¯·éæ°ç»å½ã":typeof a.error=="string"?a.error:"æä½å¤±è´¥ï¼è¯·ç¨ååè¯ã";throw new R(d,o.status)}return o}const nt={class:"flex items-center justify-between gap-4 border-b px-6 py-4 sticky top-0 bg-white z-10"},at=["title"],rt={class:"flex gap-2 shrink-0"},it=["disabled"],dt={class:"p-6 space-y-6"},ut={key:0,role:"alert",class:"text-red-600"},ct={key:1,role:"status",class:"text-gray-500"},mt={class:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-5 gap-y-2 text-sm"},pt={class:"font-mono break-all"},ft={class:"font-mono break-all"},vt={class:"font-semibold mb-2"},gt={key:0,class:"text-amber-700 text-sm"},bt={key:1,class:"text-sm text-gray-500"},xt={key:2,class:"divide-y text-sm"},ht={class:"font-mono break-all"},yt={key:0,class:"ml-2 text-blue-600"},wt={class:"text-xs text-gray-500 mt-1"},_t={class:"font-semibold mb-3"},kt={key:0,class:"text-sm text-gray-500"},Ct={key:1,class:"divide-y text-sm"},$t={class:"text-xs text-gray-500"},At={class:"whitespace-pre-wrap break-words my-1"},St={class:"text-xs font-mono break-all text-gray-500"},Tt=ue({__name:"RoomDetails",props:{slug:{},boxId:{},secret:{}},emits:["close","authError"],setup(n,{emit:m}){const o=n,v=m,a=y(),d=y(null),b=y(!1),x=y("");let u=null;const w=h=>h?new Date(h).toLocaleString():"æªç¥",C=h=>({text:"ææ¬",image:"å¾ç",file:"æä»¶"})[h]||h,I=typeof Intl.DisplayNames=="function"?new Intl.DisplayNames(["zh-CN"],{type:"region"}):null,$=h=>h==="T1"?"Tor ç½ç»":!/^[A-Z]{2}$/.test(h)||h==="XX"?"æªç¥":I?.of(h)||h;async function S(){if(!b.value){u=new AbortController,b.value=!0,x.value="";try{const h=new URLSearchParams({boxId:o.boxId}),f=await de(`/api/admin/boxes/${encodeURIComponent(o.slug)}/details?${h}`,{headers:{"x-admin-secret":o.secret},signal:u.signal});if(!f.ok){const F=await f.json().catch(()=>({}));throw new Error(f.status===403?"ç»å½å·²å¤±æï¼è¯·éæ°ç»å½":F.error||"å 载失败ï¼è¯·éè¯")}const p=await f.json();d.value=p}catch(h){h instanceof R&&[401,403,429].includes(h.status)&&v("authError",h),u?.signal.aborted||(x.value=h instanceof Error?h.message:"å 载失败")}finally{b.value=!1}}}return Ve(()=>{a.value?.showModal(),S()}),Oe(()=>{u?.abort(),a.value?.close()}),(h,f)=>(r(),i("dialog",{ref_key:"dialog",ref:a,"aria-labelledby":"room-details-title",class:"room-details rounded-2xl p-0 text-gray-800 shadow-xl",onCancel:f[2]||(f[2]=we(p=>v("close"),["prevent"])),onClick:f[3]||(f[3]=p=>p.target===a.value&&v("close"))},[e("div",nt,[e("h2",{id:"room-details-title",class:"font-bold text-lg truncate",title:n.slug}
1,"æ¿é´è¯¦æ
· "+c(n.slug),9,at),e("div",rt,[e("button",{class:"px-3 py-2 text-sm rounded-lg bg-gray-100 disabled:opacity-50",disabled:b.value,onClick:f[0]||(f[0]=p=>S())},"å·æ°",8,it),e("button",{autofocus:"",class:"px-3 py-2 text-sm rounded-lg bg-gray-100",onClick:f[1]||(f[1]=p=>v("close"))},"å
³é")])]),e("div",dt,[x.value?(r(),i("p",ut,c(x.value),1)):A("",!0),b.value&&!d.value?(r(),i("p",ct,"æ£å¨å è½½â¦")):A("",!0),d.value?(r(),i(B,{key:2},[e("section",null,[f[9]||(f[9]=e("h3",{class:"font-semibold mb-3"},"åºæ¬ä¿¡æ¯",-1)),e("dl",mt,[f[4]||(f[4]=e("dt",{class:"text-gray-500"},"å建æ¶é´",-1)),e("dd",null,c(w(d.value.room.createdAt)),1),f[5]||(f[5]=e("dt",{class:"text-gray-500"},"å建è
",-1)),e("dd",pt,c(d.value.room.creatorActorId||"æªç¥"),1),f[6]||(f[6]=e("dt",{class:"text-gray-500"},"æ¿é´ ID",-1)),e("dd",ft,c(d.value.room.id),1),f[7]||(f[7]=e("dt",{class:"text-gray-500"},"å¯ç ä¿æ¤",-1)),e("dd",null,c(d.value.room.hasPassword?"å·²å¼å¯":"æªå¼å¯"),1),f[8]||(f[8]=e("dt",{class:"text-gray-500"},"ç¦»çº¿éæ¯è§å",-1)),e("dd",null,c(d.value.room.ttlSeconds===-1?"æ°¸ä¹
ä¿ç":`æåä¸äººç¦»å¼ ${d.value.room.ttlSeconds} ç§å鿝`),1)])]),e("section",null,[e("h3",vt,"å½åå¨çº¿äººå"+c(d.value.members?`ï¼${d.value.members.length}ï¼`:""),1),f[10]||(f[10]=e("p",{class:"text-xs text-gray-500 mb-3"},"å¿åè®¾å¤æ è¯ï¼ä¸ä»£è¡¨çå®å§åï¼åä¸è®¾å¤çå¤ä¸ªæ ç¾é¡µåå¹¶æ¾ç¤ºã人åä¿¡æ¯ä»¥æ¬æ¬¡å·æ°ä¸ºåã",-1)),d.value.members===null?(r(),i("p",gt,"ææ¶æ æ³è·åå¨çº¿äººåï¼è¯·å·æ°éè¯ã")):d.value.members.length?(r(),i("ul",xt,[(r(!0),i(B,null,j(d.value.members,p=>(r(),i("li",{key:p.actorId,class:"py-2"},[e("span",ht,c(p.actorId),1),p.actorId===d.value.room.creatorActorId?(r(),i("span",yt,"å建è
")):A("",!0),e("p",wt,c(p.connections)+" ä¸ªè¿æ¥ · æè¿æ´»å¨ "+c(w(p.lastSeenAt)),1),(r(!0),i(B,null,j(p.networks,F=>(r(),i("p",{key:`${F.ip}:${F.country}`,class:"text-xs text-gray-600 mt-1 break-all"},"IPï¼"+c(F.ip||"æªç¥")+" · å½å®¶/å°åºï¼"+c($(F.country)),1))),128))]))),128))])):(r(),i("p",bt,"å½åæ 人å¨çº¿")),f[11]||(f[11]=e("p",{class:"text-xs text-gray-500 mt-2"},"å½å®¶/å°åºä¸ºè¿æ¥æ¶ç IP å½å±å°ï¼ä½¿ç¨ä»£çå¯è½æ¾ç¤ºä»£çæå¨å°ãæ§è¿æ¥ç¼ºå¤±çä¿¡æ¯ééè¿åè·åã",-1))]),e("section",null,[e("h3",_t,"å½åå享ï¼"+c(d.value.content.length)+"ï¼",1),d.value.content.length?(r(),i("ul",Ct,[(r(!0),i(B,null,j(d.value.content,p=>(r(),i("li",{key:p.id,class:"py-3"},[e("p",$t,c(C(p.type))+" · "+c(w(p.createdAt)),1),e("p",At,c(p.summary),1),e("p",St,c(p.actorId||"æªç¥"),1)]))),128))])):(r(),i("p",kt,"ææ å
容"))])],64)):A("",!0)])],544))}}),It=qe(Tt,[["__scopeId","data-v-0e4b06b6"]]),Et={class:"hidden sm:inline"},Rt={class:"sm:hidden whitespace-nowrap"},Lt={class:"block"},Bt={class:"block"},he=ue({__name:"AdminTimestamp",props:{value:{}},setup(n){const m=n,o=oe(()=>new Date(m.value));return(v,a)=>(r(),i(B,null,[e("span",Et,c(o.value.toLocaleString()),1),e("span",Rt,[e("span",Lt,c(o.value.toLocaleDateString()),1),e("span",Bt,c(o.value.toLocaleTimeString()),1)])],64))}}),Dt={class:"bg-gray-50 text-gray-500 border-b"},Mt={class:"block truncate"},Nt=["aria-label","aria-valuenow","onPointerdown","onKeydown"],Ut=ue({__name:"ResizableTableHeader",props:{columns:{}},emits:["resize"],setup(n,{emit:m}){const o=n,v=m;let a=null;function d(u,w){if(u.button!==0)return;const C=u.currentTarget;a={pointerId:u.pointerId,index:w,x:u.clientX,width:o.columns[w].width},C.setPointerCapture(u.pointerId),u.preventDefault()}function b(u,w){v("resize",u,Math.max(72,Math.min(800,Math.round(w))))}function x(u){a?.pointerId===u.pointerId&&b(a.index,a.width+u.clientX-a.x)}return(u,w)=>(r(),i("thead",Dt,[e("tr",null,[(r(!0),i(B,null,j(n.columns,(C,I)=>(r(),i("th",{key:C.label,scope:"col",class:"p-4 font-medium relative select-none"},[e("span",Mt,c(C.label),1),e("span",{role:"separator",tabindex:"0","aria-orientation":"vertical","aria-label":`è°æ´${C.label}å宽`,"aria-valuenow":C.width,"aria-valuemin":72,"aria-valuemax":800,title:"æå¨è°æ´å宽",class:"absolute right-0 top-0 h-full w-2 cursor-col-resize touch-none hover:bg-blue-200 focus:bg-blue-200 focus:outline-none border-r border-gray-200",onPointerdown:$=>d($,I),onPointermove:x,onPointerup:w[0]||(w[0]=$=>Ne(a)?a.value=null:a=null),onLostpointercapture:w[1]||(w[1]=$=>Ne(a)?a.value=null:a=null),onKeydown:[_e(we($=>b(I,C.width-10),["prevent"]),["left"]),_e(we($=>b(I,C.width+10),["prevent"]),["right"])]},null,40,Nt)]))),128))])]))}}),We="admin_box_column_widths_v2",Pt=()=>[{label:"åç§°",width:220,mobileWidth:136},{label:"å½å®¶/å°åº",width:130,mobileWidth:96},{label:"å
容(ææ¬/å¾ç/æä»¶)",width:220,mobileWidth:156},{label:"å¨çº¿",width:80,mobileWidth:64},{label:"å建æ¶é´",width:190,mobileWidth:112}
1,{label:"æä½æ¶é´",width:190,mobileWidth:112},{label:"IP",width:220,mobileWidth:152},{label:"ç¶æ",width:160,mobileWidth:112},{label:"æä½",width:160,mobileWidth:144}];function je(n){return[n.textCount,n.imageCount,n.fileCount].some(m=>m==null)?String(n.snippetCount):`${n.snippetCount}(${n.textCount}/${n.imageCount}/${n.fileCount})`}function ke(n){try{const m=typeof n.details=="string"?JSON.parse(n.details):n.details;return m&&typeof m=="object"&&!Array.isArray(m)?m:{}}catch{return{}}}function zt(n){if(n.action==="CREATE_BOX")return"å建空é´";if(n.action==="DELETE_BOX")return"éæ¯ç©ºé´";if(n.action==="CLEAR_SNIPPETS")return"æ¸
空æçå
容";if(n.action==="DELETE_SNIPPET")switch(ke(n).type){case"text":return"å 餿æ¬";case"image":return"å é¤å¾ç";case"file":return"å 餿件";default:return"å é¤å
容"}if(n.action==="UPLOAD_FILE")switch(ke(n).type){case"text":return"åäº«ææ¬";case"image":return"å享å¾ç";case"file":return"å享æä»¶";default:return"å享å
容"}return n.action||"æªç¥äºä»¶"}function Ft(n){const m=n.roomCountry===void 0&&n.action==="CREATE_BOX"?ke(n).country:n.roomCountry;return typeof m=="string"&&/^(?:[A-Z]{2}|T1)$/.test(m)?m:""}const Ce=()=>({segments:[],loaded:!1,pending:[],errors:{}}),q=n=>`${n.createdAt}:${n.id}`;async function Wt(n,m=15e3){const o=new AbortController;let v;const a=new Promise((d,b)=>{v=setTimeout(()=>{b(new Error("æ¥å¿å è½½è¶
æ¶ï¼è¯·éè¯ã")),o.abort()},m)});try{return await Promise.race([n(o.signal),a])}finally{clearTimeout(v)}}function Q(n,m){const[o,v]=n.split(":").map(Number),[a,d]=m.split(":").map(Number);return a-o||v-d}function jt(n){if(!n||!Array.isArray(n.items)||n.items.length>50||!(n.nextCursor===null||typeof n.nextCursor=="string"))throw new Error("æ¥å¿åé¡µæ°æ®å¼å¸¸ï¼è¯·å·æ°éè¯ã");const m=n.items;if(m.some((o,v)=>!o||!Number.isSafeInteger(o.id)||o.id<=0||!Number.isSafeInteger(o.createdAt)||o.createdAt<0||v>0&&Q(q(m[v-1]),q(o))>=0)||new Set(m.map(o=>o.id)).size!==m.length||n.nextCursor!==null&&(m.length!==50||n.nextCursor!==q(m[m.length-1])))throw new Error("æ¥å¿åé¡µæ°æ®å¼å¸¸ï¼è¯·å·æ°éè¯ã");return{items:m,nextCursor:n.nextCursor}}function Vt(n,m,o){if(!o&&!m.items.length)return n;const v={...m,top:o||q(m.items[0])},a=[];for(const d of[...n,v].sort((b,x)=>Q(b.top,x.top))){const b=a[a.length-1];if(!b||b.nextCursor!==null&&Q(d.top,b.nextCursor)>0){a.push({...d});continue}const x=new Map(b.items.map(u=>[u.id,u]));for(const u of d.items)x.set(u.id,u);b.items=[...x.values()].sort((u,w)=>Q(q(u),q(w))),b.nextCursor=b.nextCursor===null||d.nextCursor===null?null:Q(b.nextCursor,d.nextCursor)>=0?b.nextCursor:d.nextCursor}return a}function Ot(n,m){let o=Ce(),v=0;const a=new Map,d=(x,u)=>{o=x,m(o,u)},b=x=>{const u=x||"latest",w=a.get(u);if(w)return w;const C=v,I={...o.errors};delete I[u],d({...o,pending:[...o.pending,u],errors:I});const $=(async()=>{try{const S=await n(x);if(C!==v)return!1;const h=jt(S);if(x&&h.items.some(f=>Q(q(f),x)<=0))throw new Error("æ¥å¿å页ä½ç½®å¼å¸¸ï¼è¯·éè¯ã");return d({...o,segments:Vt(o.segments,h,x),loaded:!0},x?"more":"refresh"),!0}catch(S){if(C!==v)return!1;throw d({...o,errors:{...o.errors,[u]:S instanceof Error?S.message:"å 载失败ï¼è¯·éè¯ã"}}),S}finally{C===v&&(a.delete(u),d({...o,pending:o.pending.filter(S=>S!==u)}))}})();return a.set(u,$),$};return{refresh:()=>b(),loadMore:x=>b(x),reset:()=>{v++,a.clear(),d(Ce())}}}const qt={dir:"ltr",class:"h-screen bg-gray-100 font-sans text-gray-800 flex flex-col overflow-hidden"},Xt={key:0,role:"alert",class:"flex-none border-b border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800"},Kt={key:1,class:"flex-1 flex items-center justify-center overflow-y-auto"},Gt={class:"bg-white p-8 rounded-2xl shadow-xl w-full max-w-sm"},Jt={key:2,class:"flex flex-col flex-1 min-h-0 overflow-hidden"},Qt={class:"max-w-6xl mx-auto px-4 py-8"},Ht={class:"flex gap-3 sm:gap-4 mb-6 sm:mb-8 border-b border-gray-200 overflow-x-auto whitespace-nowrap [&>button]:shrink-0"},Zt=["disabled"],Yt={key:0,class:"grid grid-cols-2 md:grid-cols-4 gap-6 animate-fade"},es={class:"bg-white p-6 rounded-xl shadow-sm border border-gray-100"},ts={class:"text-3xl font-bold mt-2"},ss={class:"bg-white p-6 rounded-xl shadow-sm border border-gray-100"},ls={class:"text-3xl font-bold mt-2 text-green-600"},os={class:"bg-white p-6 rounded-xl shadow-sm border border-gray-100"},ns={class:"text-3xl font-bold mt-2"},as={class:"bg-white p-6 rounded-xl shadow-sm border border-gray-100"},rs={class:"text-3xl font-bold mt-2 text-blue-600"},is={key:1,class:"animate-fade"},ds={class:"flex items-center justify-between mb-4"},us={class:"text-sm text-gray-500"},cs={class:"font-bold text-gray-800"},ms={class:"flex gap-2"}
1,ps={key:0,class:"bg-white rounded-xl shadow-sm border border-gray-100 p-12 text-center text-gray-400"},fs={key:1,class:"bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden"},vs={class:"overflow-x-auto",tabindex:"0",role:"region","aria-label":"临æ¶ç©ºé´å表ï¼å¯å·¦å³æ»å¨æ¥çææå"},gs={class:"divide-y"},bs={class:"admin-readable-cell p-4 max-w-0 align-middle"},xs={class:"flex items-center gap-2 min-w-0"},hs=["title"],ys={key:0,class:"text-xs bg-yellow-100 text-yellow-700 px-1.5 py-0.5 rounded shrink-0"},ws=["title"],_s=["title"],ks={class:"bg-blue-50 text-blue-700 text-xs px-2 py-0.5 rounded-full font-medium whitespace-nowrap"},Cs={class:"p-4 text-center"},$s={key:0,class:"bg-green-50 text-green-700 text-xs px-2 py-0.5 rounded-full font-medium"},As={key:1,class:"text-gray-300 text-xs"},Ss=["title"],Ts=["title"],Is={key:1},Es=["title"],Rs={class:"admin-readable-cell p-4"},Ls=["title"],Bs={class:"p-4 text-center"},Ds={class:"flex flex-wrap justify-center gap-2"},Ms=["onClick","disabled"],Ns=["onClick","disabled"],Us={key:2,class:"sm:hidden mt-2 text-xs text-gray-500"},Ps={key:2,class:"bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden animate-fade"},zs={class:"overflow-x-auto",tabindex:"0",role:"region","aria-label":"审计æ¥å¿ï¼å¯å·¦å³æ»å¨æ¥çææå"},Fs={class:"admin-table admin-audit-table w-full min-w-[720px] text-left text-sm"},Ws={class:"divide-y"},js=["data-audit-id"],Vs={class:"p-4 text-gray-500 whitespace-nowrap"},Os={class:"p-4 whitespace-nowrap"},qs={class:"p-4 whitespace-nowrap"},Xs={class:"p-4 font-mono text-xs whitespace-nowrap"},Ks=["data-audit-cursor"],Gs={colspan:"5",class:"p-4 text-center text-gray-500","aria-live":"polite"},Js={class:"audit-page-status"},Qs={key:0},Hs={key:1},Zs=["onClick"],Ys={key:2},el={key:0,class:"p-4 text-center text-gray-500"},tl={key:1,class:"p-4 text-center text-gray-500"},sl={key:3,class:"max-w-2xl animate-fade"},ll={class:"bg-white p-6 rounded-xl shadow-sm border border-gray-100 space-y-8"},ol={class:"space-y-4"},nl={class:"flex items-center justify-between"},al={class:"relative inline-flex items-center cursor-pointer"},rl={key:0,class:"bg-red-50 p-4 rounded-lg border border-red-200"},il={class:"grid grid-cols-2 gap-4"},dl={class:"bg-blue-50 p-4 rounded-lg border border-blue-200"},ul={class:"space-y-4"},cl={class:"grid grid-cols-2 gap-4"},ml=["placeholder"],pl={class:"text-xs text-gray-400 mt-1"},fl={class:"bg-yellow-50 p-4 rounded-lg border border-yellow-200"},vl={class:"space-y-4"},gl={class:"flex items-center justify-between"},bl={class:"relative inline-flex items-center cursor-pointer"},xl={key:0,class:"bg-red-50 p-4 rounded-lg border border-red-200"},hl={class:"grid grid-cols-2 gap-4"},yl={class:"bg-blue-50 p-4 rounded-lg border border-blue-200"},wl=["disabled"],J="",ye=600,_l=ue({__name:"AdminView",setup(n){const{setNoIndex:m}=ot(),o=y(""),v=y(!1),a=y("dashboard"),d=y([]),b=oe(()=>d.value.includes(a.value)),x=y(!1);let u=0;const w=new Map,C=y(""),I=y(!1),$=l=>{C.value=l instanceof Error?l.message:"åå°è¯·æ±å¤±è´¥ï¼è¯·ç¨ååè¯ã",I.value=l instanceof R&&l.code==="ADMIN_ACCESS_REQUIRED",l instanceof R&&[401,403,429].includes(l.status)&&(v.value=!1,o.value="",W.value=null,ae())},S=async(l,t)=>{try{return await de(l,t)}catch(s){throw $(s),s}},h=()=>{window.location.assign("/")},f=y({activeBoxes:0,totalFiles:0,totalSnippets:0,uptime:0,onlineUsers:0}),p=y(Ce()),F=oe(()=>p.value.segments.flatMap(l=>l.items)),X=y(null);let ne=0,H=0,D=null;const ce=Ot(l=>Wt(async t=>(await de(`${J}/api/admin/logs?page=1${l?`&before=${encodeURIComponent(l)}`:""}`,{headers:{"x-admin-secret":o.value},signal:t})).json()),(l,t)=>{const s=t==="more"&&!l.pending.includes("latest")&&a.value==="logs"?X.value:null,_=s?.getBoundingClientRect(),k=s&&_?Array.from(s.querySelectorAll("[data-audit-id]")).find(P=>{const G=P.getBoundingClientRect();return G.bottom>_.top&&G.top<_.bottom}):null,U=k?.dataset.auditId,E=k?.getBoundingClientRect().top,K=u,le=H,lt=p.value.pending.length>0;p.value=l,s&&U&&E!==void 0&&Fe(()=>{if(K!==u||le!==H||a.value!=="logs"||s!==X.value)return;const P=s.querySelector(`[data-audit-id="${U}"]`);P&&(s.scrollTop+=P.getBoundingClientRect().top-E),ne=s.scrollTop}),lt&&!l.pending.length&&D&&Fe(()=>
1{if(K!==u||le!==H)return;const P=D;D=null;const G=X.value;if(!P||!G||a.value!=="logs"||p.value.pending.length||p.value.errors[P])return;const Be=G.querySelector(`[data-audit-cursor="${P}"]`);if(!Be)return;const De=Be.getBoundingClientRect(),Me=G.getBoundingClientRect();De.top<=Me.bottom&&De.bottom>=Me.top&&me(P)})}),me=async l=>{if(!(!v.value||a.value!=="logs"||p.value.pending.includes("latest")))try{await ce.loadMore(l)}catch(t){t instanceof R&&[401,403,429].includes(t.status)&&$(t)}},Xe=()=>{const l=X.value;if(!l)return;const t=ne;if(ne=l.scrollTop,l.scrollTop<t&&(D=null),a.value!=="logs"||l.scrollTop<=t||p.value.pending.includes("latest"))return;const s=l.getBoundingClientRect(),_=s.bottom-(l.scrollTop-t);for(const k of l.querySelectorAll("[data-audit-cursor]")){const U=k.getBoundingClientRect(),E=k.dataset.auditCursor;if(U.top<=s.bottom&&U.bottom>=Math.min(s.top,_)&&!p.value.errors[E]&&!p.value.pending.includes(E)){if(p.value.pending.length){if(U.bottom<s.top)continue;D=E}else D=null,me(E);break}}},T=y([]),M=y(null),W=y(null),N=y(Pt()),Ke=oe(()=>N.value.reduce((l,t)=>l+t.width,0)),Ge=oe(()=>N.value.reduce((l,t)=>l+t.mobileWidth,0)),Je=typeof Intl.DisplayNames=="function"?new Intl.DisplayNames(["zh-CN"],{type:"region"}):null,pe=(l="")=>l==="T1"?"Tor ç½ç»":!/^[A-Z]{2}$/.test(l)||l==="XX"?"æªç¥":Je?.of(l)||l,$e=y(Date.now());let Ae=Date.now(),fe;const Qe=(l,t)=>{if(N.value[l]){N.value[l].width=t;try{localStorage.setItem(We,JSON.stringify(N.value.map(s=>s.width)))}catch{}}},Se=l=>l.ttlStatus==="destroying"?"鿝ä¸":l.onlineUsers>0||l.ttlStatus==="online"?"å¨çº¿":et(l.ttlRemaining<0?l.ttlRemaining:Math.max(0,l.ttlRemaining-Math.floor(($e.value-Ae)/1e3))),ve={allowUpload:!0,allowImageUpload:!0,maxFileSizeMB:100,maxImageSizeMB:10,fileWhitelist:[],imageWhitelist:[],fileLimitRules:[],imageLimitRules:[],globalBoxTTLSeconds:ye,boxTTLRules:[]},g=y({...ve}),Z=y(""),Y=y(""),ee=y(""),te=y(""),se=y(""),Te=l=>{if(l===-1)return"â¾ï¸ æ°¸ä¸è¿æ";const t=Math.floor(l/3600),s=Math.floor(l%3600/60);return`${t}h ${s}m`},Ie=l=>new Date(l).toLocaleString(),Ee=l=>l.split(` 2`).map(t=>{const[s,_]=t.split(":");return s&&_?{slug:s.trim(),limit:Number(_.trim())}:null}).filter(t=>t!==null),Re=l=>!l||!Array.isArray(l)?"":l.map(t=>`${t.slug}:${t.limit}`).join(` 3`),Le=async()=>{C.value="",I.value=!1;try{(await S(`${J}/api/admin/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({secret:o.value})})).ok&&(ae(),a.value="dashboard",v.value=!0,await be())}catch(l){$(l)}},ae=()=>{D=null,u++,w.clear(),d.value=[],x.value=!1,T.value=[],ce.reset(),f.value={activeBoxes:0,totalFiles:0,totalSnippets:0,uptime:0,onlineUsers:0},g.value={...ve},Z.value=Y.value="",ee.value=te.value=se.value=""},ge=l=>{if(!v.value)return Promise.resolve(!1);const t=w.get(l);if(t)return t;const s={dashboard:"stats",boxes:"boxes",logs:"logs",settings:"settings"}[l];if(!s)return Promise.resolve(!1);const _=u,k={"x-admin-secret":o.value};C.value="",d.value=[...d.value,l];const U=(async()=>{try{if(l==="logs")return await ce.refresh();const K=await(await de(`${J}/api/admin/${s}`,{headers:k})).json();return _!==u||!v.value?!1:(l==="dashboard"&&(f.value=K),l==="boxes"&&(T.value=K,Ae=Date.now()),l==="settings"&&(g.value={...ve,...K},Z.value=(g.value.fileWhitelist||[]).join(` 4`),Y.value=(g.value.imageWhitelist||[]).join(` 5`),ee.value=Re(g.value.fileLimitRules),te.value=Re(g.value.imageLimitRules),se.value=(g.value.boxTTLRules||[]).map(le=>`${le.slug}:${le.ttl}`).join(` 6`),x.value=!0),!0)}catch(E){return _===u&&$(E),!1}finally{_===u&&(w.delete(l),d.value=d.value.filter(E=>E!==l))}})();return w.set(l,U),U},be=()=>(a.value==="logs"&&(H++,D=null,X.value?.scrollTo({top:0,behavior:"instant"}),ne=0),ge(a.value)),He=()=>ge("boxes"),re=l=>{a.value!==l&&(H++,D=null,a.value=l,!(l==="logs"&&p.value.loaded)&&(l!=="settings"||!x.value)&&ge(l))},Ze=async l=>{if(confirm(`ç¡®å®è¦å é¤ä¸´æ¶ç©ºé´ã${l}ãåï¼ 7 8è¿å°æ°¸ä¹ å é¤å ¶ä¸æææä»¶åæ°æ®ï¼`)){M.value=l;try{(await S(`${J}/api/admin/boxes/${encodeURIComponent(l)}`,{method:"DELETE",headers:{"x-admin-secret":o.value}})).ok?T.value=T.value.filter(s=>s.slug!==l):alert("å é¤å¤±è´¥")}catch(t){$(t)}finally{M.value=null}}},Ye=async()=>
8{if(confirm(`â ï¸ ç¡®å®è¦å é¤å ¨é¨ ${T.value.length} 个临æ¶ç©ºé´åï¼ 9 10æ¤æä½ä¸å¯æ¤éï¼`)){for(const l of[...T.value]){M.value=l.slug;try{await S(`${J}/api/admin/boxes/${encodeURIComponent(l.slug)}`,{method:"DELETE",headers:{"x-admin-secret":o.value}}),T.value=T.value.filter(t=>t.slug!==l.slug)}catch(t){$(t),M.value=null;return}}M.value=null,await be()}},et=l=>{if(l===-2)return"å¾ åå§å";if(l===-1)return"æ°¸ä¹ ";if(l<=0)return"å³å°éæ¯";const t=Math.floor(l/86400);if(t>0)return`${t}天${Math.floor(l%86400/3600)}å°æ¶å鿝`;const s=Math.floor(l/3600);if(s>0)return`${s}å°æ¶${Math.floor(l%3600/60)}åå鿝`;const _=Math.floor(l/60),k=l%60;return _>0?`${_}å${k}ç§å鿝`:`${k}ç§å鿝`},tt=async()=>{if(!(!x.value||b.value))try{g.value.fileWhitelist=Z.value.split(` 11`).map(t=>t.trim()).filter(t=>t),g.value.imageWhitelist=Y.value.split(` 12`).map(t=>t.trim()).filter(t=>t),g.value.fileLimitRules=Ee(ee.value),g.value.imageLimitRules=Ee(te.value),g.value.globalBoxTTLSeconds=Number(g.value.globalBoxTTLSeconds),g.value.boxTTLRules=se.value.split(` 13`).map(t=>{const[s,_]=t.split(":");return s&&_?{slug:s.trim(),ttl:Number(_.trim())}:null}).filter(t=>t!==null),g.value.maxFileSizeMB=Number(g.value.maxFileSizeMB),g.value.maxImageSizeMB=Number(g.value.maxImageSizeMB);const l=await S(`${J}/api/admin/settings`,{method:"POST",headers:{"Content-Type":"application/json","x-admin-secret":o.value},body:JSON.stringify(g.value)});if(!l.ok)throw new Error(`Settings update failed (${l.status})`);alert("设置已ä¿åï¼")}catch(l){$(l)}},st=()=>{W.value=null,v.value=!1,o.value="",ae()};return Ve(()=>{fe=setInterval(()=>{$e.value=Date.now()},1e3);try{const l=JSON.parse(localStorage.getItem(We)||"null");Array.isArray(l)&&l.length===N.value.length&&l.forEach((t,s)=>{Number.isFinite(t)&&t>=72&&t<=800&&(N.value[s].width=t)})}catch{}m();try{localStorage.removeItem("admin_secret")}catch{}try{sessionStorage.removeItem("admin_secret")}catch{}}),Oe(()=>{fe&&clearInterval(fe),v.value=!1,o.value="",ae()}),(l,t)=>(r(),i("div",qt,[C.value?(r(),i("div",Xt,[V(c(C.value)+" ",1),I.value?(r(),i("button",{key:0,class:"ml-3 underline font-semibold",onClick:h},"éæ°éªè¯é®ç®±")):A("",!0)])):A("",!0),v.value?(r(),i("div",Jt,[e("header",{class:"bg-white border-b flex-none z-20"},[e("div",{class:"max-w-6xl mx-auto px-4 h-16 flex items-center justify-between"},[t[17]||(t[17]=e("div",{class:"font-bold text-xl flex items-center gap-2"},[V(" ð tmps.fyi "),e("span",{class:"bg-yellow-100 text-yellow-800 text-xs px-2 py-1 rounded"},"ADMIN")],-1)),e("button",{onClick:st,class:"text-sm text-red-500 hover:text-red-700"},"Logout")])]),e("main",{ref_key:"adminScroll",ref:X,onScrollPassive:Xe,class:"flex-1 overflow-y-auto"},[e("div",Qt,[e("div",Ht,[e("button",{onClick:t[1]||(t[1]=s=>re("dashboard")),class:O([a.value==="dashboard"?"border-blue-500 text-blue-600":"border-transparent","pb-2 border-b-2 font-medium px-2"])},"Dashboard",2),e("button",{onClick:t[2]||(t[2]=s=>re("boxes")),class:O([a.value==="boxes"?"border-blue-500 text-blue-600":"border-transparent","pb-2 border-b-2 font-medium px-2"])},"ð¦ Boxes",2),e("button",{onClick:t[3]||(t[3]=s=>re("logs")),class:O([a.value==="logs"?"border-blue-500 text-blue-600":"border-transparent","pb-2 border-b-2 font-medium px-2"])},"Audit Logs",2),e("button",{onClick:t[4]||(t[4]=s=>re("settings")),class:O([a.value==="settings"?"border-blue-500 text-blue-600":"border-transparent","pb-2 border-b-2 font-medium px-2"])},"Settings",2),e("button",{onClick:be,disabled:b.value,class:"ml-auto text-sm text-gray-500 hover:text-blue-500 disabled:opacity-50"},"ð Refresh",8,Zt)]),a.value==="dashboard"?(r(),i("div",Yt,[e("div",es,[t[18]||(t[18]=e("div",{class:"text-gray-400 text-xs font-bold uppercase tracking-wider"},"Active Boxes",-1)),e("div",ts,c(f.value.activeBoxes),1)]),e("div",ss,[t[19]||(t[19]=e("div",{class:"text-gray-400 text-xs font-bold uppercase tracking-wider"},"Online Users",-1)),e("div",ls,c(f.value.onlineUsers),1)]),e("div",os,[t[20]||(t[20]=e("div",{class:"text-gray-400 text-xs font-bold uppercase tracking-wider"},"Total Files",-1)),e("div",ns,c(f.value.totalFiles),1)]),e("div",as,[t[21]||(t[21]=e("div",{class:"text-gray-400 text-xs font-bold uppercase tracking-wider"},"System Uptime",-1)),e("div",rs,c(Te(f.value.uptime)),1)])])):A("",!0),a.value==="boxes"?(r(),i("div",is,[e("div",ds,[e("div",us,[t[22]||(t[22]=V(" å ± ",-1)),e("span",cs,c(T.value.length),1),t[23]||(t[23]=V(" 个临æ¶ç©ºé´ ",-1))]),e("div",ms,[e("button",{onClick:He,class:"text-sm px-3 py-1.5 bg-gray-100 rounded-lg hover:bg-gray-200 transition"},"ð å·æ°"),T.value.length>0?(r(),i("button",{key:0,onClick:Ye,class:"text-sm px-3 py-1.5 bg-red-50 text-red-600 rounded-lg hover:bg-red-100 transition"},"ðï¸ å ¨é¨å é¤")):A("",!0)])]),T.value.length===0?(r(),i("div",ps," å½åæ²¡ææ´»è·ç临æ¶ç©ºé´ ")):(r(),i("div",fs,[e("div",vs,[e("table",{class:"admin-table admin-box-table table-fixed text-left text-sm",style:Ue({"--desktop-width":`${Ke.value}px`,"--mobile-width":`${Ge.value}px`})},[e("colgroup",null,[(r(!0),i(B,null,j(N.value,s=>(r(),i("col",{key:s.label,style:Ue({"--desktop-width":`${s.width}px`,"--mobile-width":`${s.mobileWidth}px`})},null,4))),128))]),xe(Ut,{columns:N.value,onResize:Qe},null,8,["columns"]),e("tbody",gs,[(r(!0),i(B,null,j(T.value,s=>(r(),i("tr",{key:s.id,class:O(["hover:bg-gray-50",{"opacity-50":M.value===s.slug}])},[e("td",bs,[e("div",xs,[e("span",{class:"font-bold text-gray-800 truncate",title:s.slug},c(s.slug),9,hs),s.hasPassword?(r(),i("span",ys,"ð")):A("",!0)])]),e("td",{class:"admin-readable-cell p-4 text-xs text-gray-500 truncate",title:pe(s.creatorCountry)},c(pe(s.creatorCountry)),9,ws),e("td",{class:"p-4 text-center truncate",title:ie(je)(s)},[e("span",ks,c(ie(je)(s)),1)],8,_s),e("td",Cs,[s.onlineUsers>0?(r(),i("span",$s,c(s.onlineUsers)+" ð¤",1)):(r(),i("span",As,"0"))]),e("td",{class:"p-4 text-gray-500 text-xs truncate",title:Ie(s.createdAt)},[xe(he,{value:s.createdAt},null,8,["value"])],8,Ss),e("td",{class:"p-4 text-gray-500 text-xs truncate",title:s.lastActivityAt??s.lastSharedAt?Ie(s.lastActivityAt??s.lastSharedAt):"ææ æä½æ¶
13é´"},[s.lastActivityAt??s.lastSharedAt?(r(),Pe(he,{key:0,value:s.lastActivityAt??s.lastSharedAt},null,8,["value"])):(r(),i("span",Is,"â"))],8,Ts),e("td",{class:"admin-readable-cell p-4 font-mono text-xs text-gray-500 truncate",title:s.creatorIp||"æªç¥"},c(s.creatorIp||"æªç¥"),9,Es),e("td",Rs,[e("span",{class:O(["block truncate text-xs",s.onlineUsers>0||s.ttlStatus==="online"?"text-green-700":"text-gray-600"]),title:Se(s)},c(Se(s)),11,Ls)]),e("td",Bs,[e("div",Ds,[e("button",{onClick:_=>W.value={slug:s.slug,id:s.id},disabled:M.value===s.slug,class:"text-xs px-3 py-1.5 bg-blue-50 text-blue-700 rounded-lg hover:bg-blue-100 disabled:opacity-50"},"详æ ",8,Ms),e("button",{onClick:_=>Ze(s.slug),disabled:M.value===s.slug,class:"text-xs px-3 py-1.5 bg-red-500 text-white rounded-lg hover:bg-red-600 disabled:opacity-50 transition"},c(M.value===s.slug?"å é¤ä¸...":"å é¤"),9,Ns)])])],2))),128))])],4)])])),T.value.length?(r(),i("p",Us,"左峿»å¨æ¥çææå")):A("",!0),W.value&&v.value?(r(),Pe(It,{key:W.value.id,slug:W.value.slug,"box-id":W.value.id,secret:o.value,onClose:t[5]||(t[5]=s=>W.value=null),onAuthError:$},null,8,["slug","box-id","secret"])):A("",!0)])):A("",!0),a.value==="logs"?(r(),i("div",Ps,[e("div",zs,[e("table",Fs,[t[24]||(t[24]=e("colgroup",null,[e("col"),e("col"),e("col"),e("col"),e("col")],-1)),t[25]||(t[25]=e("thead",{class:"bg-gray-50 text-gray-500 border-b"},[e("tr",null,[e("th",{class:"w-px p-4 font-medium whitespace-nowrap"},"æ¶é´"),e("th",{class:"p-4 font-medium whitespace-nowrap"},"空é´"),e("th",{class:"p-4 font-medium whitespace-nowrap",title:"空é´å建æ¶çå½å®¶/å°åº"},"å½å®¶/å°åº"),e("th",{class:"p-4 font-medium whitespace-nowrap"},"äºä»¶"),e("th",{class:"p-4 font-medium whitespace-nowrap"},"IP")])],-1)),e("tbody",Ws,[(r(!0),i(B,null,j(p.value.segments,(s,_)=>(r(),i(B,{key:s.top},[(r(!0),i(B,null,j(s.items,k=>(r(),i("tr",{key:k.id,"data-audit-id":k.id,class:"hover:bg-gray-50"},[e("td",Vs,[xe(he,{value:k.createdAt},null,8,["value"])]),e("td",Os,c(k.boxSlug),1),e("td",qs,c(pe(ie(Ft)(k))),1),e("td",{class:O(["p-4 font-bold whitespace-nowrap",{"text-green-600":k.action==="CREATE_BOX","text-blue-600":k.action==="UPLOAD_FILE","text-red-500":["DELETE_BOX","DELETE_SNIPPET","CLEAR_SNIPPETS"].includes(k.action)}])},c(ie(zt)(k)),3),e("td",Xs,c(k.ip),1)],8,js))),128)),s.nextCursor?(r(),i("tr",{key:s.nextCursor,"data-audit-cursor":s.nextCursor},[e("td",Gs,[e("div",Js,[p.value.pending.includes(s.nextCursor)?(r(),i("span",Qs,"æ£å¨å è½½â¦")):p.value.errors[s.nextCursor]?(r(),i("span",Hs,[V(c(p.value.errors[s.nextCursor])+" ",1),e("button",{class:"ml-2 text-blue-600 underline",onClick:k=>me(s.nextCursor)},"éè¯",8,Zs)])):(r(),i("span",Ys,c(_<p.value.segments.length-1?"å¾ å è½½åº Â· å䏿»å¨è¡¥é½ä¸é´è®°å½":"å䏿»å¨å è½½æ´æ©çè®°å½"),1))])])],8,Ks)):A("",!0)],64))),128))])])]),p.value.loaded&&!F.value.length?(r(),i("p",el,"ææ æ¥å¿")):p.value.loaded&&p.value.segments[p.value.segments.length-1]?.nextCursor===null?(r(),i("p",tl,"æ²¡ææ´å¤äº")):A("",!0),t[26]||(t[26]=e("p",{class:"sm:hidden px-3 py-2 text-xs text-gray-500 border-t border-gray-100"},"左峿»å¨æ¥çææå",-1))])):A("",!0),a.value==="settings"?(r(),i("div",sl,[e("div",ll,[e("div",ol,[e("div",nl,[t[28]||(t[28]=e("div",null,[e("h3",{class:"font-bold text-lg"},"ð File Transfer"),e("p",{class:"text-sm text-gray-500"},"General file uploads.")],-1)),e("label",al,[L(e("input",{type:"checkbox","onUpdate:modelValue":t[6]||(t[6]=s=>g.value.allowUpload=s),class:"sr-only peer"},null,512),[[ze,g.value.allowUpload]]),t[27]||(t[27]=e("div",{class:"w-11 h-6 bg-gray-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-green-600"},null,-1))])]),g.value.allowUpload?A("",!0):(r(),i("div",rl,[t[29]||(t[29]=e("label",{class:"block text-sm font-semibold text-red-700 mb-2"},"Access Whitelist (Allowed Rooms)",-1)),L(e("textarea",{"onUpdate:modelValue":t[7]||(t[7]=s=>Z.value=s),rows:"2",class:"w-full p-2 border rounded text-sm font-mono",placeholder:"vip-room"},null,512),[[z,Z.value]])])),e("div",il,[e("div",null,[t[30]||(t[30]=e("label",{class:"block text-sm font-semibold text-gray-700 mb-1"},"Global Size Limit (MB)",-1)),L(e("input",{type:"number","onUpdate:modelValue":t[8]||(t[8]=s=>g.value.maxFileSizeMB=s),class:"w-full border p-2 rounded"},null,512),[[z,g.value.maxFileSizeMB,void 0,{number:!0}]])])]),e("div",dl,[t[31]||(t[31]=e("label",{class:"block text-sm font-semibold text-blue-700 mb-2"},"Custom Size Limits (Format: room:MB)",-1)),L(e("textarea",{"onUpdate:modelValue":t[9]||(t[9]=s=>ee.value=s),rows:"3",class:"w-full p-2 border rounded text-sm font-mono",placeholder:`vip-room:1024 14test-box:500`},null,512),[[z,ee.value]])])]),t[41]||(t[41]=e("hr",{class:"border-gray-100"},null,-1)),e("div",ul,[t[35]||(t[35]=e("div",{class:"flex items-center justify-between"},[e("div",null,[e("h3",{class:"font-bold text-lg"},"â³ Destruction Rules (TTL)"),e("p",{class:"text-sm text-gray-500"}
14,"Auto destruction timer settings.")])],-1)),e("div",cl,[e("div",null,[t[32]||(t[32]=e("label",{class:"block text-sm font-semibold text-gray-700 mb-1"},"Global TTL (Seconds, -1 = Permanent)",-1)),L(e("input",{type:"number","onUpdate:modelValue":t[10]||(t[10]=s=>g.value.globalBoxTTLSeconds=s),class:"w-full border p-2 rounded",placeholder:`Default: ${ye}`},null,8,ml),[[z,g.value.globalBoxTTLSeconds,void 0,{number:!0}]]),e("p",pl,c(Te(g.value.globalBoxTTLSeconds||ye)),1)])]),e("div",fl,[t[33]||(t[33]=e("label",{class:"block text-sm font-semibold text-yellow-800 mb-2"},"Special Room Rules (Format: room:seconds, -1 = Permanent)",-1)),L(e("textarea",{"onUpdate:modelValue":t[11]||(t[11]=s=>se.value=s),rows:"3",class:"w-full p-2 border rounded text-sm font-mono",placeholder:`persistent-room:-1 15quick-share:60`},null,512),[[z,se.value]]),t[34]||(t[34]=e("p",{class:"text-xs text-yellow-700 mt-2"},[V("Historical huge TTL values are shown and saved as "),e("code",null,"-1"),V(" so permanent rooms never create an unsafe far-future Alarm.")],-1))])]),t[42]||(t[42]=e("hr",{class:"border-gray-100"},null,-1)),e("div",vl,[e("div",gl,[t[37]||(t[37]=e("div",null,[e("h3",{class:"font-bold text-lg"},"ð¼ï¸ Image Clipboard"),e("p",{class:"text-sm text-gray-500"},"Image uploads.")],-1)),e("label",bl,[L(e("input",{type:"checkbox","onUpdate:modelValue":t[12]||(t[12]=s=>g.value.allowImageUpload=s),class:"sr-only peer"},null,512),[[ze,g.value.allowImageUpload]]),t[36]||(t[36]=e("div",{class:"w-11 h-6 bg-gray-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-green-600"},null,-1))])]),g.value.allowImageUpload?A("",!0):(r(),i("div",xl,[t[38]||(t[38]=e("label",{class:"block text-sm font-semibold text-red-700 mb-2"},"Access Whitelist (Allowed Rooms)",-1)),L(e("textarea",{"onUpdate:modelValue":t[13]||(t[13]=s=>Y.value=s),rows:"2",class:"w-full p-2 border rounded text-sm font-mono",placeholder:"vip-room"},null,512),[[z,Y.value]])])),e("div",hl,[e("div",null,[t[39]||(t[39]=e("label",{class:"block text-sm font-semibold text-gray-700 mb-1"},"Global Size Limit (MB)",-1)),L(e("input",{type:"number","onUpdate:modelValue":t[14]||(t[14]=s=>g.value.maxImageSizeMB=s),class:"w-full border p-2 rounded"},null,512),[[z,g.value.maxImageSizeMB,void 0,{number:!0}]])])]),e("div",yl,[t[40]||(t[40]=e("label",{class:"block text-sm font-semibold text-blue-700 mb-2"},"Custom Size Limits (Format: room:MB)",-1)),L(e("textarea",{"onUpdate:modelValue":t[15]||(t[15]=s=>te.value=s),rows:"3",class:"w-full p-2 border rounded text-sm font-mono",placeholder:`vip-room:50 16hd-photos:20`},null,512),[[z,te.value]])])]),e("button",{onClick:tt,disabled:!x.value||b.value,class:"w-full bg-black text-white py-3 rounded-lg font-bold hover:bg-gray-800 shadow-lg transition disabled:opacity-50"}," Save All Settings ",8,wl)])])):A("",!0)])],544)])):(r(),i("div",Kt,[e("div",Gt,[t[16]||(t[16]=e("h1",{class:"text-2xl font-bold mb-6 text-center"},"ð¡ï¸ Admin Login",-1)),L(e("input",{"onUpdate:modelValue":t[0]||(t[0]=s=>o.value=s),type:"password",placeholder:"Enter Admin Secret",class:"w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-blue-500 outline-none mb-4",onKeyup:_e(Le,["enter"])},null,544),[[z,o.value]]),e("button",{onClick:Le,class:"w-full bg-black text-white py-3 rounded-lg font-bold hover:bg-gray-800 transition"}," Unlock ")])]))]))}}),$l=qe(_l,[["__scopeId","data-v-ec876b32"]]);export{$l as default};
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.