1import{r as j,j as e}from"./vendor-react-BoyrKzsG.js";import{A as J}from"./AdminLayout-UtVj2u1H.js";import{n as _,t as b,R as I,D as te,u as re,y as v,b as K}from"./index-CKCEYSTE.js";import{Q as g,R as le,_ as ce,m as de,s as U,F as me,aM as ue,au as he,r as Q}from"./vendor-ui-Cy9YOY35.js";import{c as T,g as A,h as N,q as H,n as pe,w as z,p as W}from"./vendor-firebase-DbFCdLkQ.js";import{I as ge,S as fe}from"./constants-DUDh8Qwa.js";import{M as ye}from"./MigrationService-xzB8CPZ6.js";const V=["YOUR_PROD_ADMIN_UID_HERE"],xe=["matches","mood_entries","notifications","accountability_logs","communityPosts","communityComments","reports","liked_users","actions","activity_logs"],$={wipeCollection:async t=>{try{console.log(`[MAINTENANCE] Wiping collection: ${t}...`);const i=T(b,t),l=await A(i);if(l.empty){console.log(`[MAINTENANCE] ${t} is already empty.`);return}let m=0;const a=[];for(let c=0;c<l.docs.length;c+=500)a.push(l.docs.slice(c,c+500));for(const c of a){const n=N(b);c.forEach(r=>n.delete(r.ref)),await n.commit(),m+=c.length,console.log(`[MAINTENANCE] Deleted ${m}/${l.docs.length} from ${t}`)}console.log(`[MAINTENANCE] Successfully wiped ${t}.`)}catch(i){throw console.error(`[MAINTENANCE] Error wiping ${t}:`,i),i}},wipeSubCollection:async t=>{try{console.log(`[MAINTENANCE] Wiping sub-collection: ${t}...`);const i=H(pe(b,t)),l=await A(i);if(l.empty)return;const m=[];for(let a=0;a<l.docs.length;a+=500)m.push(l.docs.slice(a,a+500));for(const a of m){const c=N(b);a.forEach(n=>c.delete(n.ref)),await c.commit()}console.log(`[MAINTENANCE] Successfully wiped all ${t} sub-collections.`)}catch(i){console.error(`[MAINTENANCE] Error wiping sub-collection ${t}:`,i)}},prepareForProduction:async t=>{if(!window.confirm("CRITICAL WARNING: This will delete ALL test data inclusive of users, chats, and posts. ONLY admin accounts will be preserved. This action is irreversible. Proceed?"))return;const l=t?[...V,t]:V;try{_.info("Beginning production cleanup...");for(const h of xe)await $.wipeCollection(h);await $.wipeSubCollection("messages"),await $.wipeCollection("chats"),console.log("[MAINTENANCE] Cleaning up communities...");const m=T(b,"communities"),a=await A(m),c=N(b);a.docs.forEach(h=>{c.update(h.ref,{"statistics.memberCount":0,"statistics.postCount":0,"statistics.activeMembersCount":0,updatedAt:Date.now()})}),await c.commit(),console.log("[MAINTENANCE] Cleaning up memberships...");const n=T(b,"communityMembers"),r=await A(n),s=N(b);let w=0;r.docs.forEach(h=>{const y=h.data().userId;l.includes(y)||(s.delete(h.ref),w++)}),await s.commit(),console.log("[MAINTENANCE] Cleaning up users...");const u=T(b,"users"),x=await A(u),f=N(b);let d=0;x.docs.forEach(h=>{l.includes(h.id)||(f.delete(h.ref),d++)}),await f.commit(),_.success(`Cleanup complete. Deleted ${d} users and ${w} memberships.`),console.log("[MAINTENANCE] PRODUCTION PREPARATION COMPLETE.")}catch(m){console.error("[MAINTENANCE] Cleanup failed:",m),_.error("Cleanup failed - see logs")}}},be=["Just looking for someone to talk to.","Life has been tough lately, hoping to find support here.","Trying to navigate through these changes.","Believer in kindness and second chances.","Artist, dreamer, and currently struggling.","Finding peace in the little things.","Here to listen and share.","Healing is a journey, not a destination.","Working on myself, one day at a time.","Love nature, books, and deep conversations.","Sometimes it's okay not to be okay.","Looking for a judgment-free zone.","Trying to find my spark again."],we=["I'm surrounded by nature and silence.","I have a good cup of coffee in my hand.","I can talk to someone who genuinely listens.","I finish a creative project I'm proud of.","I get a good night's sleep.","I listen to my favorite old songs.","I'm walking my dog in the park.","I can laugh about my problems with a friend.","I feel understood without having to explain everything."],Ce=["feeling like I'm the only one going through this.","not knowing what the future holds for me.","pretending to be okay when I'm clearly not.","finding the motivation to get out of bed some days.","trusting people again after what happened.","managing the overwhelming anxiety at work.","silencing the negative thoughts in my head.","admitting that I actually need help.","dealing with the loneliness on weekends."],ve=["The Office","Friends","Gilmore Girls","Brooklyn Nine-Nine","Stranger Things","Modern Family","Parks and Recreation","Grey's Anatomy","New Girl","Ted Lasso","Schitt's Creek","The Good Place","Community","Supernatural","Doctor Who"],Ie=["I've always been the 'strong one' in my family, the one everyone leans on. But lately, the weight has become too heavy. I realized I don't have anyone to lean on myself. I'm here to find a space where I can just be human and not have to hold it all together.","Moving to a new city for my dream job was supposed to be exciting, but the reality has been incredibly lonely. I miss my old friends and the familiarity of home. I'm hoping to connect with people who understand what it's like to start over.","After my relationship ended, I felt like I lost a part of myself. It's been a few months, but the silence in my apartment still feels loud. I want to talk to people who have navigated this kind of grief and found their way back to themselves.","I've struggled with social anxiety for as long as I can remember. It makes meeting new people in real life terrifying. I'm trying this app because writing feels safer than speaking sometimes. I just want to make a genuine connection without the pressure.","Work has been consuming my life to the point of burnout. I used to love my career, but now I just feel drained and empty. I'm looking for perspective and maybe some advice from others who have managed to find a better balance.","I recently lost a close family member, and the world just feels different now. Most people don't know
1what to say, so they say nothing. I just need a place where I can talk about them and my feelings without making things awkward.","Parenting is the hardest job I've ever had. I love my kids, but I feel like I'm losing my own identity in the process. I'm here to connect with other parents who are honest about the struggles, not just the highlight reels.","I'm at a crossroads in my life and I'm not sure which path to take. The uncertainty is paralyzing. I'm hoping to hear stories from people who have made big life pivots and survived to tell the tale.","Living with a chronic illness can be so isolating. It's hard for my healthy friends to truly understand the daily fatigue and frustration. I'm looking for a community that 'gets it' without me having to apologize for my limitations.","I've always felt a bit different, like I don't quite fit in. It's been a lonely journey trying to find my tribe. I'm hoping that by being open here, I might find others who appreciate the quirks and unique perspectives I bring."],R=t=>t[Math.floor(Math.random()*t.length)],X=(t,i)=>[...t].sort(()=>.5-Math.random()).slice(0,i),ke=t=>({IN:"India",US:"United States",GB:"United Kingdom",CA:"Canada",AU:"Australia",FR:"France",DE:"Germany"})[t]||t,L=t=>t.charAt(0).toUpperCase()+t.slice(1),oe=()=>[{prompt:"I feel better when...",answer:R(we)},{prompt:"The hardest part is...",answer:R(Ce)},{prompt:"My go-to comfort show...",answer:R(ve)},{prompt:"My Story",answer:R(Ie)}];async function Z(t,i){try{return(await(await fetch(`https://randomuser.me/api/?results=${t}&nat=${i}&inc=name,location,dob,picture,gender&noinfo`)).json()).results.map(a=>({displayName:`${L(a.name.first)} ${L(a.name.last)}`,bio:R(be),age:a.dob.age,gender:L(a.gender),city:L(a.location.city),country:ke(a.location.country||i.toUpperCase()),latitude:parseFloat(a.location.coordinates.latitude),longitude:parseFloat(a.location.coordinates.longitude),photoUrl:a.picture.large,struggles:X(fe,Math.floor(Math.random()*2)+1),interests:X(ge,Math.floor(Math.random()*3)+2),expressivePrompts:oe()}))}catch(l){return console.error("Failed to fetch from randomuser.me",l),[]}}const je=async()=>{console.log("ð Starting Production Launch Prep v3.0 (Smart Fill)...");const t=await I.getUserRepository(),i=T(b,"users"),l=H(i,z(W(),">=","seed_"),z(W(),"<=","seed_")),m=await A(l),a=m.size;if(console.log(`� Found ${a} existing seed users.`),a>0){console.log(`ð updating Q&A for ${a} existing users...`);const r=N(b);let s=0;m.docs.forEach(w=>{var x;const u=w.data();(!((x=u.profile)!=null&&x.expressivePrompts)||u.profile.expressivePrompts.length===0)&&(r.update(w.ref,{"profile.expressivePrompts":oe(),"subscription.tier":"premium"}),s++)}),s>0&&(await r.commit(),console.log(`â
Updated ${s} profiles.`))}const n=100-a;if(n>0){console.log(`ð± Generating ${n} NEW authentically diverse profiles...`);const r=Math.floor(n*.3),s=n-r,[w,u]=await Promise.all([Z(r,"in"),Z(s,"us,gb,ca,au,fr,de")]),x=[...w,...u].sort(()=>.5-Math.random());let f=0;for(const d of x){const y=`seed_${d.displayName.toLowerCase().replace(/[^a-z0-9]/g,"_")}_${Math.floor(Math.random()*1e5)}`;await t.create(y,{email:`${y}@bondedpath.com`,displayName:d.displayName,photoURL:d.photoUrl}),await t.update(y,{profile:{age:d.age,gender:d.gender,bio:d.bio,location:{city:d.city,state:"",country:d.country,latitude:d.latitude,longitude:d.longitude},struggles:d.struggles,interests:d.interests,expressivePrompts:d.expressivePrompts},hasCompletedOnboarding:!0,accountStatus:"active",subscription:{tier:"premium",status:"active",startDate:Date.now(),endDate:Date.now()+31536e6,autoRenew:!1}}),f++}console.log(`â
Successfully created ${f} new profiles.`)}else console.log("â
Sufficient seed users already exist. No new creations needed.");
1console.log("ð Launch Prep Complete!")},ee={"breakup-support":{posts:["How do you deal with the urge to text them?","It's been a month and I still cry every morning. Does it get easier?","Found an old shirt of theirs today. Set me back weeks.","My friends are tired of hearing about it. I feel so alone.","Navigating single life after 5 years feels impossible.","Any advice for co-parenting with a toxic ex?","I keep checking their social media. I know I shouldn't.","Has anyone successfully stayed friends with an ex?","The silence in the apartment is the hardest part.","Starting to feel a little bit of hope today."],comments:["I'm in the exact same boat. Stay strong.","Block them on everything. It's the only way.","Time heals all wounds, I promise.","Focus on yourself. Take up a new hobby.","You are not alone in this.","It gets better, day by day.","Sending you so much love.","Don't text them! You'll regret it.","I needed to hear this today. Thank you.","We are here for you."]},anxiety:{posts:["Woke up with a racing heart again.","Work presentations are my nightmare. Any tips?","Does anyone else feel like everyone is judging them?","My anxiety is affecting my relationship.","Tried meditation but my mind won't shut up.","Social events drain me completely.","Health anxiety is taking over my life.","Feeling overwhelmed by simple tasks today.","The physical symptoms are so scary.","Just need to vent about my stressful week."],comments:["Deep breathing really helps me.","Have you tried therapy? It changed my life.","I totally get that feeling.","You are stronger than you think.","Take it one step at a time.","Be kind to yourself.","It's okay to not be okay.","I use a weighted blanket, it helps.","Same here. It's exhausting.","Sending positive vibes."]},loneliness:{posts:["Moved to a new city and knowing no one is hard.","Weekends are the loneliest times for me.","I have friends but I still feel lonely.","Does anyone want to chat? Just need connection.","It feels like everyone else has a perfect life.","Age 30 and making friends feels impossible.","Missing the community I used to have.","Eating dinner alone every night gets old.","How do you put yourself out there?","Just looking for my tribe."],comments:["I'm looking for friends too!","Try joining a local club or class.","I feel the same way often.","Let's chat anytime.","It takes time to build connections.","You seem like a great person.","Don't give up hope.","The internet can be a great place to connect.","Sending a virtual hug.","Me too, especially on Sundays."]},depression:{posts:["Getting out of bed was my victory today.","Everything feels gray and pointless.","How do you explain depression to family?","Medication side effects are tough.","Feeling like a burden to everyone.","Some days are better than others.","Just want to feel like myself again.","The exhaustion is real.","Small wins matter.","Grateful for this safe space."],comments:["Proud of you for getting up.","One day at a time.","You are not a burden.","Keep fighting.","Here if you need to talk.","I understand that gray feeling.","Small steps lead to big changes.","You are worthy.","Don't lose hope.","We are in this together."]},generic:{posts:["Just checking in with everyone.","How is your day going?","Looking for some positivity today.","Grateful for this community.","Anyone else having a tough week?","Sharing a small win: I went for a walk.","This app has been a lifesaver.","Does anyone like to read?","Need a movie recommendation.","Sending love to you all."],comments:["Hope you have a great day!","Thanks for sharing.","That's awesome!","Good for you.","Hugs.","I agree completely.","Interesting perspective.","Thanks for being here.","Love this.","Keep it up!"]}},F=t=>t[Math.floor(Math.random()*t.length)],Se=(t,i)=>[...t].sort(()=>.5-Math.random()).slice(0,i),Ae=async()=>{console.log("ð Starting Community Conversation Seeding...");const t=await I.getCommunityRepository();await I.getUserRepository(),console.log("ð Fetching seed users...");const i=T(b,"users"),l=H(i,z(W(),">=","seed_"),z(W(),"<=","seed_")),m=await A(l);if(m.empty)throw new Error("No seed users found. Please run 'Seed Member Profiles' first.");const a=m.docs.map(n=>({id:n.id,...n.data()}));console.log(`â
Found ${a.length} seed users.`),console.log("ð Fetching specific communities to seed...");const c=await t.getAll();if(c.length===0){console.warn("No active communities found.");return}console.log(`â
Found ${c.length} communities.`);for(const n of c){console.log(`Working on community: ${n.name} (${n.id})...`);let r="generic";const s=(n.name+" "+n.id).toLowerCase();s.includes("breakup")||s.includes("divorce")||s.includes("heartbreak")?r="breakup-support":s.includes("anxiety")||s.includes("stress")||s.includes("panic")?r="anxiety":s.includes("lonely")||s.includes("isolation")||s.includes("friend")?r="loneliness":(s.includes("depression")||s.includes("sad")||s.includes("mood"))&&(r="depression");const w=ee[r]||ee.generic,u=Se(a,Math.floor(Math.random()*4)+5);await Promise.all(u.map(f=>t.addMember(n.id,f.id,"member")));const x=5;for(let f=0;f<x;f++){const d=F(u),h=F(w.posts),y=await t.createPost(d.id,{communityId:n.id,text:h,postType:"discussion"}),P=4;for(let D=0;D<P;D++){const B=F(u),O=F(w.comments);await t.createComment(B.id,{communityId:n.id,postId:y.id,text:O})}}console.log(` ⨠Seeded ${x} posts & ~${x*4} comments in ${n.name}`)}
1console.log("ð Community Seeding Complete!")},Ne="system";async function Te(){try{const t=await I.getCommunityRepository();for(const i of te)await t.getById(i.id)?console.log(`Community already exists in DAL: ${i.name}`):(await t.create(Ne,{id:i.id,name:i.name,description:i.description,struggleCategory:i.category,tags:[i.category],settings:{isPrivate:!1,requireApproval:!1,maxMembers:1e4,allowMemberPosts:!0,moderationLevel:"medium"}}),console.log(`Created default community via DAL: ${i.name}`));console.log("Default communities seeding complete")}catch(t){console.error("Error seeding default communities via DAL:",t)}}async function Ee(){try{const t=await I.getCommunityRepository(),i=te[0];return await t.getById(i.id)?!1:(console.log("Default communities not found in DAL, seeding..."),await Te(),!0)}catch(t){return console.error("Error checking default communities via DAL:",t),!1}}const ze=()=>{var q,Y;const[t,i]=j.useState(null),[l,m]=j.useState(!0),[a,c]=j.useState(!1),[n,r]=j.useState(!1),[s,w]=j.useState(null),[u,x]=j.useState(null),[f,d]=j.useState(""),{user:h}=re();j.useEffect(()=>{y()},[]);const y=async()=>{m(!0);try{const o=await I.getConfigRepository(),p=await I.getAdminRepository(),[k,C]=await Promise.all([o.getConfig(),p.getCleanupStats()]);i(k),w(C)}catch(o){console.error("Failed to fetch data:",o),g.error("Failed to load system data")}finally{m(!1)}},P=async(o=!0)=>{const p=o?s==null?void 0:s.expiredGuests:s==null?void 0:s.totalGuests;if(!p||p===0)return;const k=o?`Are you sure you want to delete ${p} expired guest accounts?`:`WARNING: Are you sure you want to delete ALL ${p} guest accounts, including active ones?`;if(window.confirm(`${k} This cannot be undone.`)){r(!0);try{const M=await(await I.getAdminRepository()).cleanupGuestAccounts(o);g.success(`Deleted ${M.deletedCount} guest accounts`),y()}catch(C){console.error("Cleanup failed:",C),g.error("Account cleanup failed")}finally{r(!1)}}},D=async()=>{if(h){r(!0);try{await $.prepareForProduction(h.uid),g.success("Production wipe completed successfully"),y()}catch(o){console.error("Production cleanup failed:",o),g.error("Production cleanup failed")}finally{r(!1)}}},B=async()=>{r(!0);try{await je(),g.success("Seeded 100 authentic member profiles"),y()}catch(o){console.error("Seeding failed:",o),g.error("Failed to seed profiles")}finally{r(!1)}},O=async()=>{r(!0);try{const o=K.environment,p=await ye.seedSubscriptionPlans(o);g.success(`Successfully seeded ${p} subscription plans for ${o}`),y()}catch(o){console.error("Seeding plans failed:",o),g.error(`Failed to seed plans: ${o.message}`)}finally{r(!1)}},se=async()=>{r(!0);try{await Ee()?g.success("Successfully seeded default communities"):g.success("Default communities already exist"),y()}catch(o){console.error("Seeding communities failed:",o),g.error(`Failed to seed communities: ${o.message}`)}finally{r(!1)}},ne=async()=>{r(!0);try{await Ae(),g.success("Seeded community conversations")}catch(o){console.error("Community seeding failed:",o),g.error("Failed to seed communities")}finally{r(!1)}},E=(o,p,k)=>{x({action:o,title:p,prompt:k}),d("")},ie=async()=>{const o="prod";if(f.toLowerCase()!==o){g.error(`Invalid confirmation. Type '${o}' to proceed.`);return}const p=u==null?void 0:u.action;x(null),p&&await p()},S=(o,p)=>{if(!t)return;const k={...t},C=o.split(".");let M=k;for(let G=0;G<C.length-1;G++)M=M[C[G]];M[C[C.length-1]]=p,i(k)},ae=async()=>{if(!(!t||!h)){c(!0);try{await(await I.getConfigRepository()).updateConfig(t,h.uid),g.success("Configuration updated successfully")}catch(o){console.error("Failed to update config:",o),g.error("Failed to update configuration")}finally{c(!1)}}};return l?e.jsx(J,{title:"System Configuration",children:e.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"50px"},children:e.jsx(v,{})})}):e.jsxs(J,{title:"System Configuration",children:[e.jsxs("div",{className:"admin-controls",children:[e.jsx("p",{style:{color:"#6b7280"},children:"Manage global application settings and feature flags."}),e.jsxs("div",{className:"filter-group",children:[e.jsxs("button",{className:"filter-btn",onClick:y,children:[e.jsx(le,{size:18}),"Reload"]}),e.jsxs("button",{className:"filter-btn",style:{background:"var(--color-primary-500)",color:"white",borderColor:"var(--color-primary-600)"},onClick:ae,disabled:a,children:[a?e.jsx(v,{size:"small"}):e.jsx(ce,{size:18}),"Save Changes"]})]})]}),e.jsxs("div",{className:"config-grid",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(400px, 1fr))",gap:"24px"},children:[e.jsxs("div",{className:"admin-section",children:[e.jsx("h3",{children:"General Settings"}),e.jsxs("div",{className:"config-field",style:{marginBottom:"16
1px"},children:[e.jsx("label",{style:{display:"block",marginBottom:"8px",fontWeight:"500"},children:"App Name"}),e.jsx("input",{type:"text",style:{width:"100%",padding:"8px",borderRadius:"4px",border:"1px solid #ddd"},value:t==null?void 0:t.general.appName,onChange:o=>S("general.appName",o.target.value)})]}),e.jsxs("div",{className:"config-field",style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx("input",{type:"checkbox",id:"maintenanceMode",checked:t==null?void 0:t.general.maintenanceMode,onChange:o=>S("general.maintenanceMode",o.target.checked)}),e.jsxs("label",{htmlFor:"maintenanceMode",style:{fontWeight:"500",display:"flex",alignItems:"center",gap:"8px"},children:["Maintenance Mode",(t==null?void 0:t.general.maintenanceMode)&&e.jsx(de,{size:16,color:"#eab308"})]})]})]}),e.jsxs("div",{className:"admin-section",children:[e.jsx("h3",{children:"Matching & Community"}),e.jsxs("div",{className:"config-field",style:{marginBottom:"16px"},children:[e.jsx("label",{style:{display:"block",marginBottom:"8px",fontWeight:"500"},children:"Daily Match Limit (Free)"}),e.jsx("input",{type:"number",style:{width:"100%",padding:"8px",borderRadius:"4px",border:"1px solid #ddd"},value:t==null?void 0:t.matching.dailyMatchLimit.free,onChange:o=>S("matching.dailyMatchLimit.free",parseInt(o.target.value))})]}),e.jsxs("div",{className:"config-field",style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx("input",{type:"checkbox",id:"requireApproval",checked:t==null?void 0:t.community.requireApprovalForNew,onChange:o=>S("community.requireApprovalForNew",o.target.checked)}),e.jsx("label",{htmlFor:"requireApproval",style:{fontWeight:"500"},children:"Require Approval for New Communities"})]})]}),e.jsxs("div",{className:"admin-section",children:[e.jsx("h3",{children:"Feature Flags"}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[e.jsxs("div",{className:"config-field",style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx("input",{type:"checkbox",id:"enableGuest",checked:t==null?void 0:t.features.enableGuestAccess,onChange:o=>S("features.enableGuestAccess",o.target.checked)}),e.jsx("label",{htmlFor:"enableGuest",style:{fontWeight:"500"},children:"Enable Guest Access"})]}),e.jsxs("div",{className:"config-field",style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsx("input",{type:"checkbox",id:"enableCoach",checked:t==null?void 0:t.features.enableCoachChats,onChange:o=>S("features.enableCoachChats",o.target.checked)}),e.jsx("label",{htmlFor:"enableCoach",style:{fontWeight:"500"},children:"Enable Coach Chats"})]})]})]}),e.jsxs("div",{className:"admin-section",children:[e.jsx("h3",{children:"App Content"}),e.jsxs("div",{className:"config-field",style:{marginBottom:"16px"},children:[e.jsx("label",{style:{display:"block",marginBottom:"8px",fontWeight:"500"},children:"Struggles / Topics (Comma Separated)"}),e.jsx("p",{style:{fontSize:"0.8rem",color:"#666",marginBottom:"8px"},children:"These options appear in Onboarding and Search filters."}),e.jsx("textarea",{rows:5,style:{width:"100%",padding:"12px",borderRadius:"4px",border:"1px solid #ddd",fontFamily:"inherit"},value:((Y=(q=t==null?void 0:t.content)==null?void 0:q.struggles)==null?void 0:Y.join(", "))||"",onChange:o=>S("content.struggles",o.target.value.split(",").map(p=>p.trim()).filter(Boolean))})]})]}),e.jsxs("div",{className:"admin-section",children:[e.jsx("h3",{children:"Database Maintenance"}),e.jsx("p",{style:{fontSize:"0.85rem",color:"#666",marginBottom:"16px"},children:"Manage data retention and cleanup policies. Default TTL: 3 days."}),e.jsxs("div",{style:{padding:"16px",background:"#fef2f2",borderRadius:"8px",border:"1px solid #fee2e2"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[e.jsxs("div",{children:[e.jsx("h4",{style:{margin:0,fontSize:"0.9rem",color:"#991b1b"},children:"Cleanup Guest Accounts"}),e.jsxs("p",{style:{margin:0,fontSize:"0.8rem",color:"#b91c1c"},children:["Current: ",(s==null?void 0:s.totalGuests)||0," total (",(s==null?void 0:s.expiredGuests)||0," expired)"]})]}),e.jsxs("div",{style:{display:"flex",gap:"8px"},children:[e.jsxs("button",{className:"filter-btn",style:{background:"#ef4444",color:"white",borderColor:"#dc2626"},onClick:()=>P(!0),disabled:n||!(s!=null&&s.expiredGuests),title:"Delete guest accounts older than 3 days",children:[n?e.jsx(v,{size:"small"}):e.jsx(U,{size:16}),"Clean Expired"]}),e.jsxs("button",{className:"filter-btn",style:{background:"#991b1b",color:"white",borderColor:"#7f1d1d"},onClick:()=>P(!1),disabled:n||!(s!=null&&s.totalGuests),title:"CAUTION: Delete ALL guest accounts immediately",children:[n?e.jsx(v,{size:"small"}):e.jsx(U,{size:16}),"Wipe All"]})]})]}),e.jsxs("p",{style:{margin:0,fontSize:"0.75rem",color:"#7f1d1d",fontStyle:"italic"},children:["Tip: Firestore TTL (expireAt) deletes are ",e.jsx("b",{children:"free"})," and don't count towards your quota!"]})]}),e.jsx("div",{style:{marginTop:"20px",padding:"16px",background:"#fffbeb",borderRadius:"8px",border:"1px solid #fef3c7"},children:e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",ga
1p:"12px"},children:[e.jsx("div",{style:{padding:"8px",background:"#fef3c7",borderRadius:"50%",color:"#d97706"},children:e.jsx(me,{size:20})}),e.jsxs("div",{style:{flex:1},children:[e.jsx("h4",{style:{margin:"0 0 4px 0",fontSize:"0.950rem",color:"#92400e"},children:"Ready for Launch?"}),e.jsxs("p",{style:{margin:"0 0 16px 0",fontSize:"0.875rem",color:"#b45309",lineHeight:"1.4"},children:["Perform a surgical ",e.jsx("b",{children:"Production Wipe"})," to remove all test conversations, matches, and non-admin users. Your personal account and existing communities will be preserved."]}),e.jsxs("button",{className:"filter-btn",style:{width:"100%",justifyContent:"center",background:"#d97706",color:"white",borderColor:"#b45309",fontWeight:"600",marginBottom:"8px"},onClick:()=>E(D,"Production Wipe","This will remove all test data (matches, posts, test users). Your personal account and official communities will be saved."),disabled:n,children:[n?e.jsx(v,{size:"small"}):e.jsx(U,{size:18}),"WIPE DATA FOR PRODUCTION"]}),e.jsxs("button",{className:"filter-btn",style:{width:"100%",justifyContent:"center",background:"#10b981",color:"white",borderColor:"#059669",fontWeight:"600",marginBottom:"8px"},onClick:()=>E(B,"Seed Members","Clicking confirm will add 10 high-quality member profiles to the database."),disabled:n,children:[n?e.jsx(v,{size:"small"}):e.jsx(ue,{size:18}),"SEED MEMBER PROFILES"]}),e.jsxs("button",{className:"filter-btn",style:{width:"100%",justifyContent:"center",background:"#6366f1",color:"white",borderColor:"#4f46e5",fontWeight:"600",marginBottom:"8px"},onClick:()=>E(O,"Seed Plans",`This will overwrite subscription plans in the ${K.environment} environment.`),disabled:n,children:[n?e.jsx(v,{size:"small"}):e.jsx(he,{size:18}),"SEED SUBSCRIPTION PLANS"]}),e.jsxs("button",{className:"filter-btn",style:{width:"100%",justifyContent:"center",background:"#8b5cf6",color:"white",borderColor:"#7c3aed",fontWeight:"600",marginBottom:"8px"},onClick:()=>E(se,"Seed Communities","This will seed the default official communities into the database."),disabled:n,children:[n?e.jsx(v,{size:"small"}):e.jsx(Q,{size:18}),"SEED DEFAULT COMMUNITIES"]}),e.jsxs("button",{className:"filter-btn",style:{width:"100%",justifyContent:"center",background:"#0d9488",color:"white",borderColor:"#0f766e",fontWeight:"600"},onClick:()=>E(ne,"Seed Conversations","This will seed posts and comments into existing communities using authentic user profiles."),disabled:n,children:[n?e.jsx(v,{size:"small"}):e.jsx(Q,{size:18}),"SEED COMMUNITY CONVERSATIONS"]})]})]})})]})]}),u&&e.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,backdropFilter:"blur(4px)"},children:e.jsxs("div",{style:{backgroundColor:"white",padding:"32px",borderRadius:"24px",maxWidth:"400px",width:"90%",boxShadow:"0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04)"},children:[e.jsx("h3",{style:{marginTop:0,marginBottom:"12px",fontSize:"1.25rem"},children:u.title}),e.jsx("p",{style:{color:"#666",fontSize:"0.9rem",marginBottom:"24px",lineHeight:"1.5"},children:u.prompt}),e.jsxs("div",{style:{marginBottom:"24px"},children:[e.jsxs("label",{style:{display:"block",fontSize:"0.75rem",fontWeight:"bold",color:"#999",textTransform:"uppercase",marginBottom:"8px"},children:['Type "',e.jsx("b",{children:"prod"}),'" to confirm']}),e.jsx("input",{type:"text",value:f,onChange:o=>d(o.target.value),placeholder:"prod",style:{width:"100%",padding:"12px 16px",borderRadius:"12px",border:"2px solid #eee",fontSize:"1rem",outline:"none"}})]}),e.jsxs("div",{style:{display:"flex",gap:"12px"},children:[e.jsx("button",{onClick:()=>x(null),style:{flex:1,padding:"12px",borderRadius:"12px",border:"none",backgroundColor:"#f3f4f6",color:"#4b5563",fontWeight:"600",cursor:"pointer"},children:"Cancel"}),e.jsx("button",{onClick:ie,disabled:f.toLowerCase()!=="prod",style:{flex:1,padding:"12px",borderRadius:"12px",border:"none",backgroundColor:f.toLowerCase()==="prod"?"#ef4444":"#fee2e2",color:"white",fontWeight:"600",cursor:f.toLowerCase()==="prod"?"pointer":"not-allowed"},children:"Confirm"})]})]})})]})};export{ze 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.