PageSourceSearch

https://rainbowinternationalschool.in/assets/AdminFriendshipSchools-CsVQXalY.js

js rainbowinternationalschool.in collected 2026-10-09 22:05:34 UTC 22,245 bytes, 1 lines download raw bytes

1import{r as n,j as e}from"./vendor-CekVgk2x.js";import{b as xe,a as he,n as ue}from"./friendship-url-utils-GHx-3Ej5.js";const i="#091a4f",v="#f59e0b",M="#059669",O="ris_admin_auth";function pe({onSuccess:o}){const[d,b]=n.useState(""),[x,a]=n.useState(!1),h=async u=>{if(u.preventDefault(),(await fetch("/api/admin/alliances/friendship/schools",{headers:{Authorization:`Bearer ${d}`}})).ok){try{sessionStorage.setItem(O,d)}catch{}o(d)}else a(!0),b(""),setTimeout(()=>a(!1),600)};return e.jsx("div",{className:"min-h-screen flex items-center justify-center px-4",style:{background:i},children:e.jsxs("form",{onSubmit:h,className:"bg-white rounded-2xl shadow-2xl p-8 w-full max-w-sm border-t-4 border-amber-400",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx("div",{className:"w-12 h-12 rounded-md flex items-center justify-center font-black text-sm",style:{background:v,color:i},children:"RIS"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-black text-lg",style:{color:i},children:"Admin Panel"}),e.jsx("div",{className:"text-xs text-slate-500",children:"Friendship Schools · Alliances"})]})]}),e.jsx("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Admin Token"}),e.jsx("input",{type:"password",value:d,onChange:u=>b(u.target.value),placeholder:"Enter admin token",className:`w-full px-4 py-3 rounded-lg border-2 text-sm focus:outline-none focus:ring-2 focus:ring-amber-400 ${x?"border-red-500 bg-red-50":"border-slate-300"}`,"data-testid":"input-admin-token"}),x&&e.jsx("div",{className:"mt-2 text-sm text-red-600",children:"Invalid token"}),e.jsx("button",{type:"submit",className:"mt-4 w-full py-3 rounded-lg font-bold text-white",style:{background:i},"data-testid":"button-admin-login",children:"Unlock"})]})})}const Y={Open:"#3b82f6","Walk-in Booked":"#8b5cf6","Walk-in Completed":"#f59e0b",Closed:"#ef4444","Future Prospect":"#6b7280","Admission Done":"#059669"};function be({lead:o,onUpdate:d}){const[b,x]=n.useState(!1);if(o.status!=="Admission Done")return e.jsx("span",{className:"text-xs text-slate-300",children:"—"});const a=async()=>{x(!0);try{const p=await fetch(`/api/admin/alliances/friendship/leads/${o.id}`,{method:"PATCH",headers:{"Content-Type":"application/json",...r()},body:JSON.stringify({commissionPaid:!o.commissionPaid})});p.ok&&d(await p.json())}catch{}x(!1)},h=o.commissionPaid===!0,u=h?M:o.commissionPaid===!1?"#dc2626":v;return e.jsx("button",{onClick:a,disabled:b,className:"text-xs font-semibold hover:opacity-70 transition disabled:opacity-50",style:{color:u},"data-testid":`button-commission-${o.id}`,children:b?"…":h?"Paid ✓":o.commissionPaid===!1?"Unpaid":"Pending"})}function fe(){try{return sessionStorage.getItem("ris_admin_auth")||""}catch{return""}}const r=()=>{const o=fe();return o?{Authorization:`Bearer ${o}`}:{}};function ve(){const[o,d]=n.useState(()=>{try{return sessionStorage.getItem(O)}catch{return null}});return o?e.jsx(ge,{}):e.jsx(pe,{onSuccess:d})}function ge(){const[o,d]=n.useState([]),[b,x]=n.useState(!0),[a,h]=n.useState(null),[u,p]=n.useState([]),[K,U]=n.useState(!1),[Z,N]=n.useState(!1),[f,_]=n.useState(null),[z,c]=n.useState(""),[w,X]=n.useState({}),[ee,Q]=n.useState(!1),[k,W]=n.useState(null),te=(t,s)=>{t.stopPropagation();const m=`${window.location.origin}/alliances/friendship/${s.token}`;navigator.clipboard.writeText(m).catch(()=>{}),W(s.id),setTimeout(()=>W(l=>l===s.id?null:l),2e3)},se=async()=>{if(a){c("Syncing status from Sheets…");try{const t=await fetch("/api/admin/alliances/friendship/sync-status-from-sheets",{method:"POST",headers:{"Content-Type":"application/json",...r()},body:JSON.stringify({schoolId:a.id})}),s=await t.json().catch(()=>({}));t.ok?(c(`Done — ${s.updated??0} lead${s.updated!==1?"s":""} updated`),J(a)):c(s.message||"Sync failed")}catch{c("Sync failed")}setTimeout(()=>c(""),5e3)}},[S,C]=n.useState(""),[A,P]=n.useState(""),[G,T]=n.useState(""),[H,$]=n.useState(""),[E,D]=n.useState(""),[V,g]=n.useState(""),[R,q]=n.useState(!1),[F,I]=n.useState(null),[y,L]=n.useState(null);n.useEffect(()=>{document.title="Friendship Schools | Admin | RIS";let t=document.querySelector('meta[name="robots"]');t||(t=document.createElement("meta"),t.name="robots",document.head.appendChild(t)),t.setAttribute("content","noindex, nofollow"),j()},[]);const j=async()=>{x(!0);try{const t=await fetch("/api/admin/alliances/friendship/schools",{headers:r()});if(t.status===401){try{sessionStorage.removeItem(O)}catch{}window.location.reload();return}const s=await t.json();d(s),s.length>0&&B()}catch{}x(!1)},B=async()=>{Q(!0);try{const t=await fetch("/api/admin/alliances/friendship/validation-status",{headers:r()});if(!t.ok)return;const s=await t.json(),m={};for(const l of s.schools)m[l.id]={hasDropdown:l.hasDropdown,reason:l.reason};X(m)}catch{}Q(!1)},J=async t=>{h(t),U(!0),p([]);try{const s=await fetch(`/api/admin/alliances/friendship/leads?schoolId=${t.id}`,{headers:r()});p(await s.json())}catch{}U(!1)},ae=()=>{_(null),C(""),P(""),T(""),$(""),D(""),g(""),N(!0)},ne=t=>{_(t),C(t.name),P(t.contactPerson),T(t.contactEmail||""),$(t.contactPhone||""),D(t.sheetsTabName),g(""),N(!0)},oe=async()=>
1{if(!S.trim()||!A.trim()||!E.trim()){g("School name, contact person, and Sheets tab name are required.");return}q(!0),g("");try{const t={name:S.trim(),contactPerson:A.trim(),contactEmail:G.trim()||void 0,contactPhone:H.trim()||void 0,sheetsTabName:E.trim()};f||(t.isActive=!0);const s=f?`/api/admin/alliances/friendship/schools/${f.id}`:"/api/admin/alliances/friendship/schools",l=await fetch(s,{method:f?"PUT":"POST",headers:{"Content-Type":"application/json",...r()},body:JSON.stringify(t)}),me=await l.json().catch(()=>({}));if(!l.ok)throw new Error(me.message||"Save failed");N(!1),j()}catch(t){g(t.message||"Something went wrong.")}q(!1)},ie=async t=>{try{await fetch(`/api/admin/alliances/friendship/schools/${t.id}`,{method:"PUT",headers:{"Content-Type":"application/json",...r()},body:JSON.stringify({isActive:!t.isActive})}),j(),a?.id===t.id&&h({...a,isActive:!t.isActive})}catch{}},le=async t=>{try{(await fetch(`/api/admin/alliances/friendship/schools/${t.id}/regenerate-token`,{method:"POST",headers:r()})).ok&&(I(null),j())}catch{}},de=async t=>{try{(await fetch(`/api/admin/alliances/friendship/schools/${t.id}`,{method:"DELETE",headers:r()})).ok&&(L(null),a?.id===t.id&&(h(null),p([])),j())}catch{}},re=async()=>{c("Applying dropdowns…");try{const s=await(await fetch("/api/admin/alliances/friendship/apply-validation",{method:"POST",headers:r()})).json().catch(()=>({})),m=(s.skipped??0)>0?`, ${s.skipped} already had dropdown`:"";c(`Dropdowns applied — ${s.applied??0}/${s.total??0} tabs updated${m}`),B()}catch{c("Apply validation failed")}setTimeout(()=>c(""),7e3)},ce=t=>new Date(t).toLocaleDateString("en-IN",{day:"2-digit",month:"short",year:"numeric",timeZone:"Asia/Kolkata"});return e.jsxs("div",{className:"min-h-screen",style:{background:"#f1f5f9"},children:[e.jsx("div",{className:"px-6 py-4 shadow-sm",style:{background:i},children:e.jsxs("div",{className:"max-w-6xl mx-auto flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center font-black text-xs flex-shrink-0",style:{background:v,color:i},children:"RIS"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-black text-white text-base",children:"Friendship Schools"}),e.jsx("div",{className:"text-blue-200 text-xs",children:"Admin Portal · Alliances"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:re,className:"px-4 py-2 rounded-lg text-xs font-bold border-2 border-white/30 text-white hover:bg-white/10 transition","data-testid":"button-apply-validation",children:"✅ Apply Dropdowns"}),e.jsx("button",{onClick:ae,className:"px-4 py-2 rounded-lg text-xs font-black transition",style:{background:v,color:i},"data-testid":"button-add-school",children:"+ Add School"})]})]})}),z&&e.jsx("div",{className:"text-center text-xs py-2 font-semibold",style:{background:v,color:i},children:z}),e.jsx("div",{className:"max-w-6xl mx-auto px-4 py-6",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsx("div",{className:"lg:col-span-1",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-sm overflow-hidden",children:[e.jsx("div",{className:"px-4 py-3 border-b border-slate-100 flex items-center justify-between",children:e.jsxs("div",{className:"font-bold text-slate-700 text-sm",children:[o.length," Friendship School",o.length!==1?"s":""]})}),b?e.jsx("div",{className:"p-8 text-center text-slate-400 text-sm",children:"Loading…"}):o.length===0?e.jsx("div",{className:"p-8 text-center text-slate-400 text-sm",children:"No schools yet. Add one to get started."}):e.jsx("div",{className:"divide-y divide-slate-100",children:o.map(t=>e.jsx("div",{className:`p-4 cursor-pointer transition-colors hover:bg-slate-50 ${a?.id===t.id?"bg-blue-50 border-l-4":"border-l-4 border-l-transparent"}`,style:a?.id===t.id?{borderLeftColor:i}:{},onClick:()=>J(t),"data-testid":`card-school-${t.id}`,children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-bold text-slate-800 text-sm truncate",children:t.name}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.contactPerson}),e.jsxs("div",{className:"flex items-center gap-2 mt-1.5 flex-wrap",children:[e.jsx("span",{className:"text-xs font-semibold px-2 py-0.5 rounded-full",style:{background:t.isActive?"#dcfce7":"#fee2e2",color:t.isActive?M:"#dc2626"},children:t.isActive?"Active":"Inactive"}),e.jsxs("span",{className:"text-xs text-slate-400",children:[t.leadCount," lead",t.leadCount!==1?"s":""]}),ee&&!(t.id in w)?e.jsx("span",{className:"text-xs text-slate-300 font-medium","data-testid":`badge-validation-${t.id}`,children:"…"}
1):t.id in w?w[t.id].hasDropdown?e.jsx("span",{className:"text-xs font-semibold px-1.5 py-0.5 rounded-full",style:{background:"#dcfce7",color:"#059669"},title:"Column H has status dropdown","data-testid":`badge-validation-${t.id}`,children:"✓ dropdown"}):e.jsx("span",{className:"text-xs font-semibold px-1.5 py-0.5 rounded-full",style:{background:"#fff7ed",color:"#c2410c"},title:w[t.id].reason==="tab not found"?"Sheet tab not found":"Column H is missing the status dropdown","data-testid":`badge-validation-${t.id}`,children:"⚠ missing"}):null]})]}),e.jsxs("div",{className:"flex flex-col gap-1 flex-shrink-0",children:[e.jsx("button",{onClick:s=>{s.stopPropagation(),window.open(`/admin/alliances/friendship/${t.id}/qr?name=${encodeURIComponent(t.name)}&token=${t.token}`,"_blank")},className:"text-xs px-2 py-1 rounded font-semibold transition hover:opacity-80",style:{background:"#f0f4ff",color:i},"data-testid":`button-qr-${t.id}`,children:"QR"}),e.jsx("button",{onClick:s=>te(s,t),className:"text-xs px-2 py-1 rounded font-semibold transition",style:{background:k===t.id?"#dcfce7":"#f0fdf4",color:k===t.id?"#059669":"#16a34a"},"data-testid":`button-link-${t.id}`,title:"Copy portal link",children:k===t.id?"✓":"Link"}),t.contactPhone&&e.jsx("a",{href:xe(t.contactPhone,t.token,t.name,window.location.origin),target:"_blank",rel:"noopener noreferrer",onClick:s=>s.stopPropagation(),className:"text-xs px-2 py-1 rounded font-semibold text-center transition",style:{background:"#dcfce7",color:"#16a34a"},"data-testid":`button-whatsapp-${t.id}`,title:"Send portal link via WhatsApp",children:"WA"}),t.contactEmail&&e.jsx("a",{href:he(t.contactEmail,t.token,t.name,window.location.origin),onClick:s=>s.stopPropagation(),className:"text-xs px-2 py-1 rounded font-semibold text-center transition",style:{background:"#eff6ff",color:"#2563eb"},"data-testid":`button-email-${t.id}`,title:"Send portal link via Email",children:"Mail"}),e.jsx("button",{onClick:s=>{s.stopPropagation(),ne(t)},className:"text-xs px-2 py-1 rounded font-semibold text-slate-600 bg-slate-100 hover:bg-slate-200 transition","data-testid":`button-edit-${t.id}`,children:"Edit"}),e.jsx("button",{onClick:s=>{s.stopPropagation(),L(t)},className:"text-xs px-2 py-1 rounded font-semibold text-red-500 bg-red-50 hover:bg-red-100 transition","data-testid":`button-delete-${t.id}`,children:"Del"})]})]})},t.id))})]})}),e.jsx("div",{className:"lg:col-span-2",children:a?e.jsxs("div",{className:"bg-white rounded-2xl shadow-sm overflow-hidden",children:[e.jsx("div",{className:"px-5 py-4 border-b border-slate-100",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-black text-slate-800",children:a.name}),e.jsxs("div",{className:"text-xs text-slate-500 mt-0.5",children:["Sheets tab: ",e.jsx("code",{className:"bg-slate-100 px-1 py-0.5 rounded",children:a.sheetsTabName})]}),e.jsxs("div",{className:"text-xs text-slate-500 mt-0.5 flex flex-wrap gap-x-3 gap-y-0.5 items-center",children:[e.jsx("span",{children:a.contactPerson}),a.contactPhone&&e.jsxs("a",{href:`https://wa.me/${ue(a.contactPhone)}`,target:"_blank",rel:"noopener noreferrer",className:"font-semibold text-green-600 hover:underline","data-testid":"link-header-whatsapp",children:["📞 ",a.contactPhone]}),a.contactEmail&&e.jsxs("a",{href:`mailto:${a.contactEmail}`,className:"font-semibold text-blue-600 hover:underline","data-testid":"link-header-email",children:["✉ ",a.
1contactEmail]})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:()=>ie(a),className:"text-xs px-3 py-1.5 rounded-lg font-semibold border transition",style:a.isActive?{borderColor:"#fee2e2",color:"#dc2626",background:"#fff"}:{borderColor:"#dcfce7",color:M,background:"#fff"},"data-testid":"button-toggle-active",children:a.isActive?"Deactivate":"Reactivate"}),e.jsx("button",{onClick:se,className:"text-xs px-3 py-1.5 rounded-lg font-semibold border border-blue-200 text-blue-600 hover:bg-blue-50 transition","data-testid":"button-sync-status-sheets",children:"↓ Sync Status"}),e.jsx("button",{onClick:()=>I(a),className:"text-xs px-3 py-1.5 rounded-lg font-semibold border border-amber-200 text-amber-600 hover:bg-amber-50 transition","data-testid":"button-regen-token",children:"🔄 Regen QR"})]})]})}),K?e.jsx("div",{className:"p-10 text-center text-slate-400 text-sm",children:"Loading leads…"}):u.length===0?e.jsx("div",{className:"p-10 text-center text-slate-400 text-sm",children:"No leads submitted yet."}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsx("tr",{className:"bg-slate-50 text-xs font-bold text-slate-500 uppercase tracking-wide",children:["Date","Student","Grade","Parent","Phone","Source","Status","Ref. Amt","Synced"].map(t=>e.jsx("th",{className:"px-4 py-3 text-left whitespace-nowrap",children:t},t))})}),e.jsx("tbody",{children:u.map(t=>e.jsxs("tr",{className:"border-t border-slate-100 hover:bg-slate-50","data-testid":`row-lead-${t.id}`,children:[e.jsx("td",{className:"px-4 py-2.5 text-slate-500 whitespace-nowrap text-xs",children:ce(t.submittedAt)}),e.jsx("td",{className:"px-4 py-2.5 font-semibold text-slate-800",children:t.studentName}),e.jsx("td",{className:"px-4 py-2.5 text-slate-600",children:t.grade}),e.jsx("td",{className:"px-4 py-2.5 text-slate-700",children:t.parentName}),e.jsx("td",{className:"px-4 py-2.5 text-slate-500",children:t.phone}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full font-semibold",style:{background:t.source==="bulk"?"#f0f4ff":"#f8fafc",color:t.source==="bulk"?i:"#64748b"},children:t.source})}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full font-semibold",style:{background:(Y[t.status]??"#64748b")+"20",color:Y[t.status]??"#64748b"},"data-testid":`badge-status-${t.id}`,children:t.status})}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsx(be,{lead:t,onUpdate:s=>p(m=>m.map(l=>l.id===s.id?s:l))})}),e.jsx("td",{className:"px-4 py-2.5",children:t.syncFailed?e.jsx("span",{className:"text-xs text-red-500 font-semibold",children:"Failed"}):t.syncedToSheets?e.jsx("span",{className:"text-xs text-green-600",children:"✓"}):e.jsx("span",{className:"text-xs text-amber-500",children:"Pending"})})]},t.id))})]})})]}):e.jsxs("div",{className:"bg-white rounded-2xl shadow-sm p-12 text-center",children:[e.jsx("div",{className:"text-3xl mb-3",children:"🏫"}),e.jsx("div",{className:"text-slate-500 text-sm",children:"Select a school on the left to view leads"})]})})]})}),Z&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center px-4",style:{background:"rgba(9,26,79,0.7)"},children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-md p-6",children:[e.jsx("div",{className:"font-black text-xl mb-5",style:{color:i},children:f?"Edit School":"Add Friendship School"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5",children:"School Name *"}),e.jsx("input",{value:S,onChange:t=>C(t.target.value),placeholder:"e.g. Sunshine Academy",className:"w-full px-4 py-3 rounded-xl border-2 border-slate-200 text-sm font-medium focus:outline-none focus:border-amber-400 transition","data-testid":"input-school-name"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5",children:"Contact Person *"}),e.jsx("input",{value:A,onChange:t=>P(t.target.value),placeholder:"e.g. Ms. Anita Sharma",className:"w-full px-4 py-3 rounded-xl border-2 border-slate-200 text-sm font-medium focus:outline-none focus:border-amber-400 transition","data-testid":"input-contact-person"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5",children:["Contact Phone ",e.jsx("span",{className:"font-normal text-slate-400",children:"(optional — for WhatsApp)"})]}),e.jsx("input",{type:"tel",value:H,onChange:t=>$(t.target.value),placeholder:"e.g. 9876543210",className:"w-full px-4 py-3 rounded-xl border-2 border-slate-200 text-sm font-medium focus:outline-none focus:border-amber-400 transition","data-testid":"input-contact-phone"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5",children:["Contact Email ",e.jsx("span",{className:"font-normal text-slate-400",children:"(optional)"})]}),e.jsx("input",{type:"email",value:G,onChange:t=>T(t.target.value),placeholder:"e.g. [email protected]",className:"w-full px-4 py-3 rounded-xl border-2 border-slate-200 text-sm font-medium focus:outline-none focus:border-amber-400 transition","data-testid":"input-contact-email"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-500 uppercase tracking-wide mb-1.5",children:"Google Sheets Tab Name *"}),e.jsx("input",{value:E,onChange:t=>D(t.target.value),placeholder:"e.g. Sunshine Academy",className:"w-full px-4 py-3 rounded-xl border-2 border-slate-200 text-sm font-medium focus:outline-none focus:border-amber-400 transition","data-testid":"input-tab-name"}),e.jsx("div",{className:"text-xs text-slate-400 mt-1",children:"Must match the exact tab name in your Google Sheets spreadsheet."})]}),V&&e.jsx("div",{className:"text-sm text-red-600 bg-red-50 border border-red-200 rounded-lg px-3 py-2",children:V})]}),e.jsxs("div",{className:"flex gap-3 mt-6",children:[e.jsx("button",{onClick:()=>N(!1),className:"flex-1 py-3 rounded-xl font-semibold border-2 border-slate-200 text-slate-600 hover:bg-slate-50 transition","data-testid":"button-cancel",children:"Cancel"}),e.jsx("button",{onClick:oe,disabled:R,className:"flex-1 py-3 rounded-xl font-black text-white transition disabled:opacity-60",style:{background:R?"#94a3b8":i},"data-testid":"button-save",children:R?"Saving…":f?"Save Changes":"Create School"})]})]})}),y&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center px-4",style:{background:"rgba(9,26,79,0.7)"},children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-sm p-6 text-center",children:[e.jsx("div",{className:"text-3xl mb-3",children:"🗑️"}),e.jsx("div",{className:"font-black text-lg mb-2",style:{color:i},children:"Delete School?"}),e.jsxs("div",{className:"text-sm text-slate-600 mb-6",children:["This will permanently delete ",e.jsx("strong",{children:y.name})," and all"," ",e.jsxs("strong",{children:[y.leadCount," lead",y.leadCount!==1?"s":""]})," associated with it. This cannot be undone."]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:()=>L(null),className:"flex-1 py-3 rounded-xl font-semibold border-2 border-slate-200 text-slate-600 hover:bg-slate-50 transition",children:"Cancel"}),e.jsx("button",{onClick:()=>de(y),className:"flex-1 py-3 rounded-xl font-black text-white transition",style:{background:"#dc2626"},"data-testid":"button-confirm-delete",children:"Delete Permanently"})]})]})}),F&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center px-4",style:{background:"rgba(9,26,79,0.7)"},children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-sm p-6 text-center",children:[e.jsx("div",{className:"text-3xl mb-3",children:"⚠️"}),e.jsx("div",{className:"font-black text-lg mb-2",style:{color:i},children:"Regenerate QR Code?"}),e.jsxs("div",{className:"text-sm text-slate-600 mb-6",children:["This will ",e.jsx("strong",{children:"invalidate the existing QR code"})," for ",e.jsx("strong",{children:F.name}),". All printed QR cards will stop working immediately. You'll need to print and distribute a new QR card."]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:()=>I(null),className:"flex-1 py-3 rounded-xl font-semibold border-2 border-slate-200 text-slate-600 hover:bg-slate-50 transition",children:"Cancel"}),e.jsx("button",{onClick:()=>le(F),className:"flex-1 py-3 rounded-xl font-black text-white transition",style:{background:"#dc2626"},"data-testid":"button-confirm-regen",children:"Yes, Regenerate"})]})]})})]})}export{ve 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.