PageSourceSearch

https://vidiapp-3798d.web.app/assets/ui--sqoI1Pb.js

js vidiapp-3798d.web.app collected 2026-10-03 12:39:28 UTC 8,793 bytes, 1 lines download raw bytes

1import{j as e,R as p,r as c,Q as w,M as y,B as f,A as k,C}from"./index-CjSuYpZB.js";const $=({title:t,message:a,isOpen:s,onClose:n,onConfirm:l})=>{const[i,r]=c.useState(!1),d=p.useRef(!1);if(!s)return null;const x=async()=>{if(!d.current){d.current=!0,r(!0);try{await l()}finally{d.current=!1,r(!1)}}};return e.jsxs(y,{title:t,isOpen:s,onClose:n,children:[e.jsx("div",{className:"text-gray-300 mb-6",children:a}),e.jsxs("div",{className:"flex justify-end gap-4",children:[e.jsx(f,{variant:"secondary",onClick:n,disabled:i,children:"Hủy"}),e.jsx(f,{onClick:x,disabled:i,className:"bg-red-600 hover:bg-red-700 text-white",children:i?"Đang xử lý...":"Xác nhận"})]})]})},E=({content:t,align:a="center"})=>{const[s,n]=c.useState(!1);c.useEffect(()=>{if(!s)return;const r=()=>{n(!1)},d=setTimeout(()=>{document.addEventListener("click",r)},0);return()=>{clearTimeout(d),document.removeEventListener("click",r)}},[s]);const l={center:"left-1/2 -translate-x-1/2",left:"left-0",right:"right-0"},i={center:"left-1/2 -translate-x-1/2",left:"left-4",right:"right-4"};return e.jsxs("div",{className:"group relative flex items-center",onClick:r=>{r.stopPropagation(),r.preventDefault(),n(!s)},children:[e.jsx(w,{className:"w-4 h-4 text-gray-500 hover:text-brand-accent transition-colors cursor-help"}),e.jsxs("div",{className:`absolute top-full mt-2 w-72 bg-slate-900 text-white text-sm rounded-lg p-4 shadow-xl transition-all duration-300 z-50 border border-slate-700 break-words whitespace-normal ${s?"opacity-100 visible pointer-events-auto":"opacity-0 invisible pointer-events-none group-hover:opacity-100 group-hover:visible"} ${l[a]}`,children:[t,e.jsx("div",{className:`absolute bottom-full w-0 h-0 border-x-8 border-x-transparent border-b-8 border-b-slate-900 ${i[a]}`})]})]})},T=p.forwardRef(({label:t,id:a,error:s,...n},l)=>e.jsxs("div",{children:[e.jsx("label",{htmlFor:a,className:"block text-sm font-medium text-slate-400 mb-1",children:t}),e.jsx("textarea",{id:a,ref:l,...n,className:`w-full bg-slate-700 border rounded-md p-2.5 text-gray-200 focus:ring-2 focus:ring-brand-accent focus:border-brand-accent transition ${s?"border-red-500 focus:border-red-500":"border-slate-600"}`,"aria-invalid":!!s,"aria-describedby":s?`${a}-error`:void 0}),s&&e.jsx("p",{id:`${a}-error`,className:"mt-1 text-sm text-red-500",children:s})]}));T.displayName="Textarea";const F=({checked:t,onChange:a,disabled:s=!1})=>{const n=()=>{s||a(!t)};return e.jsx("button",{role:"switch","aria-checked":t,onClick:n,disabled:s,className:`relative inline-flex items-center h-6 rounded-full w-11 transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-brand-dark focus:ring-brand-accent disabled:opacity-50 disabled:cursor-not-allowed ${t?"bg-brand-accent":"bg-slate-600"}`,children:e.jsx("span",{className:`inline-block w-4 h-4 transform bg-white rounded-full transition-transform ${t?"translate-x-6":"translate-x-1"}`})})},_=({stats:t,maxLevel:a=10,title:s="Thống kê hệ thống"})=>{const n=Object.values(t).reduce((l,i)=>l+(i||0),0);return e.jsxs("div",{className:"bg-slate-900/60 border border-slate-800/80 backdrop-blur-xl p-6 rounded-2xl mb-8 shadow-lg relative overflow-hidden",children:[e.jsx("div",{className:"absolute -right-16 -top-16 w-36 h-36 bg-brand-accent/5 rounded-full blur-2xl pointer-events-none"}),e.jsx("h2",{className:"text-lg font-bold text-white mb-5 tracking-tight relative z-10",children:s}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4 relative z-10",children:[Array.from({length:a},(l,i)=>i+1).map(l=>e.jsxs("div",{className:"bg-slate-950/40 border border-slate-800/50 rounded-xl p-4 text-center hover:border-brand-accent/30 hover:bg-slate-900/40 transition duration-300 group",children:[e.jsxs("p",{className:"text-xs font-semibold text-slate-400 uppercase tracking-wider group-hover:text-brand-accent transition-colors duration-200",children:["F",l]}),e.jsx("p",{className:"text-2xl font-extrabold text-white mt-1.5 bg-gradient-to-r from-white to-slate-200 bg-clip-text text-transparent",children:t[l]||0})]},l)),e.jsxs("div",{className:"bg-gradient-to-r from-brand-accent/10 to-cyan-500/10 border border-brand-accent/25 hover:border-brand-accent/40 p-5 rounded-xl text-center col-span-full transition duration-300 hover:shadow-[0_0_20px_rgba(163,230,53,0.08)]",children:[e.jsxs("p",{className:"text-xs font-extrabold text-brand-accent uppercase tracking-wider",children:["Tổng thành viên (F1-F",a,")"]}),e.jsx("p",{className:"text-3xl font-black text-brand-accent mt-1",children:n})]})]})]})},D=({rootUser:t,f1s:a,isSelfView:s})=>e.jsxs("div",{className:"bg-slate-900/60 border border-slate-800/80 backdrop-blur-xl p-6 rounded-2xl mt-8 shadow-lg relative overflow-hidden",children:[e.jsx("div",{className:"absolute -left-16 -bottom-16 w-36 h-36 bg-indigo-500/5 rounded-full blur-2xl pointer-events-none"}),e.jsx("h3",{className:"text-lg font-bold text-white mb-4 tracking-tight relative z-10",children:"Cây hệ thống"}),e.jsxs("div",{className:"mt-4 max-h-[60vh] overflow-y-auto pr-2 relative z-10",children:[e.jsxs("div",{className:"flex items-center gap-3 p-4 rounded-xl bg-slate-950/40 border border-slate-800/60 hover:border-slate-700/50 transition duration-300",children:[e.jsx("div",{className:"w-6 h-6 flex-shrink-0 flex items-center justify-center rounded-lg bg-indigo-500/20 text-indigo-400 font-bold text-xs",children:"R"}),e.jsxs("div",{className:"flex-grow",children:[e.jsxs("p",{className:"font-bold text-white text-base",children:[t.fullName," ",s&&e.jsx("span",{className:"text-[10px] font-bold text-brand-accent bg-brand-accent/15 border border-brand-accent/20 px-2 py-0.5 rounded-full ml-1.5",children:"Bạn"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 mt-1 text-xs",children:[e.jsxs("span",{className:"text-slate-400",children:["ID: ",e.jsx("span",{className:"text-white font-semibold",children:t.id})]}),e.jsx("span",{className:"text-slate-500",children:"•"}),e.jsxs("span",{className:"text-slate-400",children:["Thưởng GT: ",e.jsxs("span",{className:"text-amber-400 font-bold",children:[(t.referralBonus||0).toLocaleStr
1ing("vi-VN"),"đ"]})]})]})]})]}),e.jsxs("div",{className:"mt-2",children:[a===null&&e.jsx("div",{className:"pl-6 py-3 text-sm text-slate-400 italic",children:"Đang tải cây hệ thống..."}),a&&a.length===0&&e.jsx("div",{className:"pl-6 py-3 text-sm text-slate-400 italic",children:"Không có thành viên F1."}),a&&a.length>0&&a.map(n=>e.jsx(v,{user:n,level:1},n.id))]})]})]}),v=({user:t,level:a})=>{const{currentUser:s,deductCredit:n,getDownline:l,creditCosts:i}=c.useContext(k),[r,d]=c.useState(!1),[x,b]=c.useState(null),[m,g]=c.useState(!1);c.useEffect(()=>{let o=!0;return r&&(t!=null&&t.uid)?(g(!0),b(null),l(t.uid).then(h=>{o&&b(h)}).catch(h=>{console.error(`Failed to fetch downline for ${t.id}:`,h),o&&b([])}).finally(()=>{o&&g(!1)})):b(null),()=>{o=!1}},[r,t==null?void 0:t.uid,l]);const j=async()=>{const o=!r;if(o&&(s==null?void 0:s.role)!=="admin"){const h=i.view_downline_branch??30;if(((s==null?void 0:s.credit)??0)<h){alert("Bạn không đủ Credits để xem nhánh này. Vui lòng nạp thêm.");return}try{await n("view_downline_branch"),d(o)}catch{return}}else d(o)},u=["bg-blue-600","bg-emerald-600","bg-amber-600","bg-indigo-600","bg-pink-600","bg-teal-600","bg-purple-600","bg-rose-600","bg-cyan-600","bg-lime-600"],N=u[(a-1)%u.length];return e.jsxs("div",{className:"pl-6 relative",children:[e.jsx("div",{className:"absolute top-0 left-3 w-0.5 h-full bg-slate-700/70"}),e.jsx("div",{className:"absolute top-5 left-3 w-3 h-0.5 bg-slate-700/70"}),e.jsxs("div",{className:"flex items-center gap-2 py-2.5 pr-3 rounded-md",children:[e.jsx("button",{onClick:j,className:"p-1 rounded-full hover:bg-slate-600 z-10 flex-shrink-0 -ml-[5px]",children:e.jsx(C,{className:`w-4 h-4 transition-transform text-gray-400 ${r?"rotate-0":"-rotate-90"}`})}),e.jsxs("div",{className:"flex-grow",children:[e.jsxs("p",{className:"font-semibold text-white",children:[t.fullName," ",e.jsxs("span",{className:"text-xs font-normal text-gray-400",children:["(ID: ",t.id,")"]})]}),e.jsxs("p",{className:"text-xs text-amber-400",children:["Thưởng GT: ",(t.referralBonus||0).toLocaleString("vi-VN"),"đ"]})]}),e.jsxs("span",{className:`text-xs font-bold px-2 py-1 rounded-full text-white flex-shrink-0 ${N}`,children:["F",a]})]}),r&&e.jsxs("div",{className:"mt-1",children:[m&&e.jsx("div",{className:"pl-8 py-2 text-sm text-gray-500 italic",children:"Đang tải..."}),!m&&x&&x.length===0&&e.jsx("div",{className:"pl-8 py-2 text-sm text-gray-500 italic",children:"Không có thành viên con."}),!m&&x&&x.length>0&&x.map(o=>e.jsx(v,{user:o,level:a+1},o.id))]})]})};export{$ as C,D,E as I,_ as S,F as T,T as a};

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.