1import{q as pe,r as g,a0 as be,j as e,F as $,p as ge,S as ve,I as H,B as v,X as fe,k as je,n as Ne,V as we,o as ye,M as Ce,J as ke,a1 as y,g as E,Q as Z,K as $e,w as Se,s as te,R as Q,c as K,z as Re,T as Be,E as G,e as Ae,a as Le,x as Ee,D as Oe}from"./index-Bcg6ZirZ.js";import{u as ae}from"./useMutation-DyAvRERQ.js";import{f as Te,Z as A,b as V,C as le,k as z,S as re,l as Pe,a as Fe}from"./booth-cNK3FT0c.js";import{K as Me}from"./KonvaBoothMap-Cok5esYM.js";import{C as He}from"./card--vI6b00c.js";import{C as D}from"./checkbox-B5NGTIpa.js";import{L as O}from"./label-BWfKpTOI.js";import{S as Ue}from"./separator-BmbEYafp.js";import{T as Ie}from"./timer-KccX93Zt.js";import{M as ze}from"./mail-DR1RA8lB.js";import{D as M}from"./dollar-sign-CvSW4jEm.js";import{P as De}from"./pencil-CK63Emkb.js";import{S as J}from"./shopping-cart-CK1WjIXx.js";import{U as ie}from"./user-plus-CadNd_UD.js";import{L as _}from"./lock-C-hFJwjn.js";import{L as oe}from"./lock-open-Djrcz52c.js";import{T as Ze}from"./trash-2-B-Y3Ozk0.js";import{D as _e,a as Ve,b as qe,c as Qe}from"./dialog-Cinj4yfW.js";import{C as Ke}from"./circle-alert-CyCT8v6e.js";import{R as Ge}from"./radio-Dj31-mBx.js";import{T as Je}from"./tent-CdhoZZqR.js";import{C as Ye}from"./chart-column-BMu39Hzn.js";import{T as Xe}from"./target-Fc2boUKC.js";import{Z as Y}from"./zap-DdaqJa3L.js";import{A as We}from"./activity-CLlBEbbL.js";import{A as es}from"./arrow-up-right-DZVKmwrJ.js";import{B as ss}from"./brain-DgO-zVFJ.js";import{L as ts}from"./lightbulb-N3aC6k_w.js";import"./maximize-2-D55WL6kp.js";import"./index-D8j0f6pS.js";function as(t){const l=pe({queryKey:["booths"],queryFn:async()=>{const i=await fetch("/api/public/booths");if(!i.ok)throw new Error("Failed to load booths");return i.json()},refetchInterval:3e4}),m=g.useMemo(()=>l.data?.booths?!t||Object.keys(t).length===0?l.data.booths:Te(l.data.booths,t):[],[l.data?.booths,t]);return{...l,booths:l.data?.booths??[],event:l.data?.event??null,filteredBooths:m}}function ls(){const t=be();return ae({mutationFn:async({boothId:l,action:m,data:i})=>{const h=await fetch(`/api/admin/booths/${l}/${m}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(i||{})});if(!h.ok){const n=await h.json();throw new Error(n.error||`Failed to ${m} booth`)}return h.json()},onSuccess:()=>{t.invalidateQueries({queryKey:["booths"]})}})}const X=["Main","Oak","Magnolia","Elm","Food Court"],W=["available","held","paid","sponsor_reserved","locked"],ee=["general","food","crafts","services","sponsor"],rs=({onFilterChange:t,totalBooths:l,filteredBooths:m,showCategories:i=!1,showSearch:h=!1})=>{const[n,x]=g.useState(!0),[a,b]=g.useState({}),o=r=>{const C={...a,...r};b(C),t(C)},f=(r,C,R)=>{const p=r??[],S=p.includes(C)?p.filter(U=>U!==C):[...p,C];return S.length===0||S.length===R.length?void 0:S},u=()=>{b({}),t({})},d=[a.zones,a.statuses,a.categories,a.premiumOnly,a.sponsorReservedOnly,a.availableOnly,a.searchQuery].filter(Boolean).length;return e.jsxs(He,{className:"p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-semibold text-sm font-display",children:"Filters"}),d>0&&e.jsx($,{variant:"secondary",className:"text-xs h-5 px-1.5",children:d})]}),e.jsx("button",{onClick:()=>x(!n),className:"p-1 hover:bg-muted rounded transition-colors","data-testid":"filter-toggle",children:e.jsx(ge,{className:`h-4 w-4 transition-transform ${n?"rotate-180":""}`})})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mb-3",children:[m," of ",l," booths"]}),n&&e.jsxs("div",{className:"space-y-4",children:[h&&e.jsxs("div",{className:"relative",children:[e.jsx(ve,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"}),e.jsx(H,{placeholder:"Search booth # or vendor...",className:"h-8 pl-8 text-sm",value:a.searchQuery||"",onChange:r=>o({searchQuery:r.target.value||void 0}),"data-testid":"filter-search"})]}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsx("button",{className:`text-xs px-2 py-1 rounded-full border transition-colors ${a.availableOnly?"bg-green-100 border-green-300 text-green-800":"border-border text-muted-foreground hover:bg-muted"}`,onClick:()=>o({availableOnly:!a.availableOnly||void 0}),"data-testid":"filter-available",children:"Available Only"}),e.jsx("button",{className:`text-xs px-2 py-1 rounded-full border transition-colors ${a.premiumOnly?"bg-yellow-100 border-yellow-300 text-yellow-800":"border-border text-muted-foreground hover:bg-muted"}`,onClick:()=>o({premiumOnly:!a.premiumOnly||void 0}),"data-testid":"filter-premium",children:"Premium Only"}),e.jsx("button",{className:`text-xs px-2 py-1 rounded-full border transition-colors ${a.sponsorReservedOnly?"bg-purple-100 border-purple-300 text-purple-800":"border-border text-muted-foreground hover:bg-muted"}`,onClick:()=>o({sponsorReservedOnly:!a.sponsorReservedOnly||void 0}),"data-testid":"filter-sponsor",children:"Sponsor Only"})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold mb-2 uppercase text-muted-foreground",children:"Zones"}),e.jsx("div",{className:"space-y-1.5",children:X.map(r=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{id:`zone-${r}`,checked:!a.zones||a.zones.includes(r),onCheckedChange:()=>o({zones:f(a.zones,r,X)}),"data-testid":`filter-zone-${r}`}),e.jsxs(O,{htmlFor:`zone-${r}`,className:"text-xs cursor-pointer flex items-center gap-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:A[r].color}}),A[r].label]})]},r))})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold mb-2 uppercase text-muted-foreground",children:"Status"}),e.jsx("div",{className:"space-y-1.5",children:W.map(r=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{id:`status-${r}`,checked:!a.statuses||a.statuses.includes(r),onCheckedChange:()=>o({statuses:f(a.statuses,r,W)}),"data-testid":`filter-status-${r}`}),e.jsx(O,{htmlFor:`status-${r}`,className:"text-xs cursor-pointer",children:V[r]})]},r))})]}),i&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold mb-2 uppercase text-muted-foreground",children:"Category"}),e.jsx("div",{className:"space-y-1.5",children:ee.map(r=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(D,{id:`cat-${r}`,checked:!a.categories||a.categories.includes(r),onCheckedChange:()=>o({categories:f(a.categories,r,ee)}),"data-testid":`filter-cat-${r}`}),e.jsx(O,{htmlFor:`cat-${r}`,className:"text-xs cursor-pointer",children:le[r]})]},r))})]}),d>0&&e.jsxs(v,{variant:"outline",size:"sm",onClick:u,className:"w-full h-7 text-xs","data-testid":"filter-reset",children:[e.jsx(fe,{className:"h-3 w-3 mr-1"}),"Reset Filters"]})]})]})};function is(t){const[l,m]=g.useState(()=>z(t));g.useEffect(()=>{if(m(z(t)),!t)return;const b=setInterval(()=>{const o=z(t);m(o),o<=0&&clearInterval(b)}
1,1e3);return()=>clearInterval(b)},[t]);const i=l<=0&&t!==null,h=l>0&&l<=120,n=Math.floor(l/60),x=l%60,a=l<=0?"Expired":`${n}:${x.toString().padStart(2,"0")}`;return{secondsRemaining:l,isExpired:i,isUrgent:h,display:a,minutes:n,seconds:x}}const os=({booth:t,open:l,onClose:m,onAction:i,onPriceChange:h,mode:n,loading:x=!1})=>{const a=is(t?.heldUntil??null),[b,o]=g.useState(!1),[f,u]=g.useState("");if(g.useEffect(()=>{t&&u(String((t.priceCents/100).toFixed(2))),o(!1)},[t?.id,t?.priceCents]),!t)return null;const d=A[t.zone];return e.jsx(je,{open:l,onOpenChange:r=>!r&&m(),children:e.jsxs(Ne,{className:"w-[380px] sm:w-[420px] p-0 flex flex-col","data-testid":"booth-detail-panel",children:[e.jsx(we,{className:"p-5 pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(ye,{className:"font-display text-lg",children:["Booth #",t.boothNumber]}),e.jsx($,{className:"text-xs text-white border-0",style:{backgroundColor:re[t.status]},"data-testid":"booth-status-badge",children:V[t.status]})]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-5 pb-5 space-y-4",children:[t.status==="held"&&t.heldUntil&&e.jsxs("div",{className:`rounded-lg p-3 border ${a.isUrgent?"bg-red-50 border-red-200":"bg-amber-50 border-amber-200"}`,"data-testid":"hold-countdown-display",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Ie,{className:`h-4 w-4 ${a.isUrgent?"text-red-600":"text-amber-600"}`}),e.jsx("span",{className:`text-xs font-semibold uppercase ${a.isUrgent?"text-red-800":"text-amber-800"}`,children:"Hold Expires In"})]}),e.jsx("p",{className:`text-2xl font-bold font-mono ${a.isUrgent?"text-red-600":"text-amber-600"}`,children:a.display}),t.heldByEmail&&e.jsxs("div",{className:"flex items-center gap-1.5 mt-2 text-xs text-muted-foreground",children:[e.jsx(ze,{className:"h-3 w-3"}),t.heldByEmail]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(F,{icon:Ce,label:"Zone",value:d?.label??t.zone,color:d?.color}),n==="admin"&&h?e.jsxs("div",{className:"bg-muted/50 rounded-lg p-2.5 col-span-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[e.jsx(M,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("span",{className:"text-[10px] font-semibold uppercase text-muted-foreground",children:"Price"})]}),b?e.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"$"}),e.jsx(H,{type:"number",min:"0",step:"0.01",value:f,onChange:r=>u(r.target.value),className:"h-6 text-xs px-1 py-0 w-16",autoFocus:!0,"data-testid":"input-booth-price"}),e.jsx(v,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>{const r=parseFloat(f);!isNaN(r)&&r>=0&&h(t.id,Math.round(r*100)),o(!1)},"data-testid":"button-save-price",children:e.jsx(ke,{className:"h-3 w-3 text-emerald-600"})})]}):e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("p",{className:"text-sm font-medium",children:y(t.priceCents)}),e.jsx(v,{size:"icon",variant:"ghost",className:"h-5 w-5 ml-auto",onClick:()=>o(!0),"data-testid":"button-edit-price",children:e.jsx(De,{className:"h-3 w-3 text-muted-foreground"})})]})]}):e.jsx(F,{icon:M,label:"Price",value:y(t.priceCents)}),e.jsx(F,{icon:E,label:"Type",value:t.isPremium?"Premium":"Standard"}),t.category&&e.jsx(F,{icon:J,label:"Category",value:le[t.category]??t.category})]}),t.vendorName&&e.jsxs(e.Fragment,{children:[e.jsx(Ue,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold uppercase text-muted-foreground mb-1",children:"Assigned Vendor"}),e.jsx("p",{className:"text-sm font-medium",children:t.vendorName}),t.heldByEmail&&e.jsx("p",{className:"text-xs text-muted-foreground",children:t.heldByEmail})]})]}),t.isSponsorReserved&&e.jsxs("div",{className:"bg-purple-50 border border-purple-200 rounded-lg p-3",children:[e.jsx("p",{className:"text-xs font-semibold text-purple-800",children:"Sponsor Reserved"}),e.jsx("p",{className:"text-xs text-purple-700 mt-1",children:"This booth is reserved for an event sponsor."})]}),n==="vendor"&&t.status==="available"&&e.jsx("div",{className:"bg-green-50 border border-green-200 rounded-lg p-3",children:e.jsx("p",{className:"text-xs text-green-800",children:"This booth is available. You can hold it for 10 minutes while you complete checkout."})}),n==="public"&&t.status==="available"&&e.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:e.jsx("p",{className:"text-xs text-blue-800",children:"Interested in this booth? Visit the vendor registration page to reserve it."})})]}),(n==="vendor"||n==="admin")&&e.jsxs("div",{className:"border-t p-4 space-y-2 bg-muted/30",children:[n==="vendor"&&t.status==="available"&&e.jsxs(v,{onClick:()=>i?.("hold",t.id),disabled:x,className:"w-full","data-testid":"booth-hold-btn",children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),x?"Processing...":"Hold This Booth"]}),n==="vendor"&&t.status==="held"&&t.heldByEmail&&e.jsxs(v,{onClick:()=>i?.("checkout",t.id),disabled:x,className:"w-full bg-green-600 hover:bg-green-700","data-testid":"booth-confirm-btn",children:[e.jsx(M,{className:"h-4 w-4 mr-2"}),x?"Processing...":"Confirm Selection"]}),n==="admin"&&e.jsxs("div",{className:"space-y-2",children:[t.status==="available"&&e.jsxs(e.Fragment,{children:[e.jsxs(v,{onClick:()=>i?.("assign",t.id),disabled:x,className:"w-full","data-testid":"booth-assign-btn",children:[e.jsx(ie,{className:"h-4 w-4 mr-2"}),"Assign to Vendor"]}),e.jsxs(v,{variant:"outline",onClick:()=>i?.("hold",t.id),disabled:x,className:"w-full","data-testid":"booth-hold-admin-btn",children:[e.jsx(Z,{className:"h-4 w-4 mr-2"}),"Place on Hold"]}),e.jsxs(v,{variant:"outline",onClick:()=>i?.("lock",t.id),disabled:x,className:"w-full","data-testid":"booth-lock-btn",children:[e.jsx(_,{className:"h-4 w-4 mr-2"}),"Lock Booth"]}),!t.isSponsorReserved&&e.jsxs(v,{variant:"outline",onClick:()=>i?.("sponsor",t.id),disabled:x,className:"w-full text-purple-700 border-purple-200 hover:bg-purple-50","data-testid":"booth-sponsor-btn",children:[e.jsx(E,{className:"h-4 w-4 mr-2"}),"Mark Sponsor Reserved"]})]}),t.status==="locked"&&e.jsxs(v,{variant:"outline",onClick:()=>i?.("unlock",t.id),disabled:x,className:"w-full","data-testid":"booth-unlock-btn",children:[e.jsx(oe,{className:"h-4 w-4 mr-2"}),"Unlock Booth"]}),t.status==="held"&&e.jsxs(v,{variant:"destructive",onClick:()=>i?.("release",t.id),disabled:x,className:"w-full","data-testid":"booth-release-btn",children:[e.jsx(Ze,{className:"h-4 w-4 mr-2"}),"Release Hold"]}),t.status==="sponsor_reserved"&&e.jsxs(v,{variant:"outline",onClick:()=>i?.("unsponsor",t.id),disabled:x,className:"w-full text-purple-700 border-purple-200 hover:bg-purple-50","data-testid":"booth-unsponsor-btn",children:[e.jsx(E,{className:"h-4 w-4 mr-2"}),"Remove Sponsor Reserve"]})]})]})]})})};function F({icon:t,label:l,value:m,color:i}){return e.jsxs("div",{className:"bg-muted/50 rounded-lg p-2.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[e.jsx(t,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("span",{className:"text-[10px] font-semibold uppercase text-muted-foreground",children:l})]}),e.jsx("p",{className:"text-sm font-medium",style:i?{color:i}:void 0,children:m})]})}const ns=({booth:t,open:l,onOpenChange:m,onAssign:i,loading:h=!1})=>{const[n,x]=g.useState(""),[a,b]=g.useState(""),[o,f]=g.useState("");
1if(!t)return null;const u=async()=>{if(!n.includes("@")){f("Enter a valid email");return}if(!a.trim()){f("Enter vendor name");return}f("");try{await i(t.id,{vendorEmail:n,vendorName:a}),m(!1),x(""),b("")}catch(d){f(d instanceof Error?d.message:"Assignment failed")}};return e.jsx(_e,{open:l,onOpenChange:m,children:e.jsxs(Ve,{className:"max-w-sm","data-testid":"admin-assign-dialog",children:[e.jsx(qe,{children:e.jsxs(Qe,{className:"font-display",children:["Assign Booth #",t.boothNumber]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"bg-muted/50 rounded-lg p-3 text-sm",children:e.jsxs("p",{children:[t.zone," Zone â ",y(t.priceCents)]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(O,{htmlFor:"assign-name",children:"Vendor Name"}),e.jsx(H,{id:"assign-name",value:a,onChange:d=>b(d.target.value),placeholder:"Jane Doe","data-testid":"assign-vendor-name"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(O,{htmlFor:"assign-email",children:"Vendor Email"}),e.jsx(H,{id:"assign-email",type:"email",value:n,onChange:d=>x(d.target.value),placeholder:"[email protected]","data-testid":"assign-vendor-email"})]}),o&&e.jsx("p",{className:"text-xs text-destructive",children:o}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(v,{variant:"outline",onClick:()=>m(!1),className:"flex-1",children:"Cancel"}),e.jsxs(v,{onClick:u,disabled:h,className:"flex-1","data-testid":"assign-confirm-btn",children:[e.jsx(ie,{className:"h-4 w-4 mr-1"}),h?"Assigning...":"Assign"]})]})]})]})})};function ds({open:t,title:l,message:m,confirmLabel:i,variant:h,onConfirm:n,onCancel:x,isPending:a}){return t?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 animate-in fade-in duration-150",onClick:a?void 0:x,children:e.jsxs("div",{className:"bg-slate-900 rounded-xl shadow-2xl border border-slate-700/60 p-6 max-w-sm w-full mx-4 animate-in zoom-in-95 duration-200",onClick:b=>b.stopPropagation(),role:"dialog","aria-modal":"true",children:[e.jsx("h3",{className:"text-lg font-semibold text-white mb-1",children:l}),e.jsx("p",{className:"text-sm text-slate-400 mb-5",children:m}),e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx(v,{variant:"outline",size:"sm",onClick:x,disabled:a,className:"border-slate-700 text-slate-300 hover:bg-slate-800","data-testid":"button-confirm-cancel",children:"Cancel"}),e.jsxs(v,{size:"sm",variant:h,onClick:n,disabled:a,className:h==="destructive"?"":"bg-violet-600 hover:bg-violet-500","data-testid":"button-confirm-action",children:[a&&e.jsx(te,{className:"w-3.5 h-3.5 animate-spin mr-1"}),i]})]})]})}):null}const cs=["Main","Oak","Magnolia","Elm","Food Court"];function ms(t){return cs.map(l=>{const m=t.filter(u=>u.zone===l),i=m.length,h=m.filter(u=>u.status==="available").length,n=m.filter(u=>u.status==="held").length,x=m.filter(u=>u.status==="paid").length,a=m.filter(u=>u.status==="locked").length,b=m.filter(u=>u.status==="sponsor_reserved").length,o=i>0?Math.round(x/i*100):0,f=m.filter(u=>u.status==="paid").reduce((u,d)=>u+d.priceCents,0);return{zone:l,total:i,available:h,held:n,booked:x,locked:a,sponsorReserved:b,fillRate:o,revenue:f,demand:Fe[l]}})}function xs(t,l,m){const i=[],h=l.total>0?Math.round(l.paid/l.total*100):0,n=m.filter(d=>d.fillRate<40&&d.total>0);n.length>0&&i.push({id:"underperforming-zones",severity:"critical",title:`${n.length} Zone${n.length>1?"s":""} Under 40% Fill Rate`,description:`${n.map(d=>`${A[d.zone].label} (${d.fillRate}%)`).join(", ")} ${n.length>1?"are":"is"} significantly underperforming. This impacts overall event revenue.`,recommendations:["Launch targeted vendor outreach for these zones","Consider zone-specific discount pricing","Reallocate sponsor reserved booths to increase availability"]});const a=t.filter(d=>d.status==="held").filter(d=>d.heldUntil?(typeof d.heldUntil=="string"?new Date(d.heldUntil):d.heldUntil).getTime()<Date.now():!1);a.length>0&&i.push({id:"expired-holds",severity:"high",title:`${a.length} Expired Booth Hold${a.length>1?"s":""} Detected`,description:"These booths have holds that passed their expiration time but haven't been released. They are blocking availability.",recommendations:["Release expired holds immediately to free inventory","Follow up with hold owners about payment conversion","Set up auto-release for future holds"]});const b=t.filter(d=>d.isPremium&&d.status==="available");b.length>0&&i.push({id:"unsold-premium",severity:"medium",title:`${b.length} Premium Booth${b.length>
11?"s":""} Still Available`,description:"Premium booths represent highest revenue per unit. Unsold premium inventory is a missed opportunity.",recommendations:["Send targeted outreach to high-value vendors","Offer premium booth upgrade bundles","Highlight premium benefits in marketing materials"]});const o=t.reduce((d,r)=>d+r.priceCents,0),f=o>0?Math.round(l.revenue/o*100):0;f<50&&l.total>0&&i.push({id:"revenue-gap",severity:"high",title:`Revenue Capture at ${f}% â ${y(o-l.revenue)} Remaining`,description:`Current booked revenue is ${y(l.revenue)} out of a potential ${y(o)}. Significant opportunity remains.`,recommendations:["Focus on converting held booths to paid","Prioritize high-value zones for outreach","Consider early-bird incentive campaigns"]}),h>=80&&i.push({id:"strong-fill",severity:"success",title:`Excellent Fill Rate: ${h}%`,description:"Booth occupancy is strong. Consider premium upsell strategies and waitlist management.",recommendations:["Implement waitlist for popular zones","Offer booth upgrade options to existing vendors"]});const u=[...m].sort((d,r)=>r.fillRate-d.fillRate)[0];return u&&u.fillRate>70&&i.push({id:"best-zone",severity:"low",title:`${A[u.zone].label} Leading at ${u.fillRate}% Fill`,description:"This zone is the highest-performing. Analyze what makes it attractive to replicate across other zones.",recommendations:["Study vendor category mix in this zone","Apply similar pricing strategy to underperforming zones"]}),i}const se={critical:{border:"border-red-500/60",bg:"bg-red-500/10",text:"text-red-400",badge:"bg-red-500/20 text-red-300 border-red-500/30",glow:"shadow-red-500/10"},high:{border:"border-orange-500/60",bg:"bg-orange-500/10",text:"text-orange-400",badge:"bg-orange-500/20 text-orange-300 border-orange-500/30",glow:"shadow-orange-500/10"},medium:{border:"border-amber-500/60",bg:"bg-amber-500/10",text:"text-amber-400",badge:"bg-amber-500/20 text-amber-300 border-amber-500/30",glow:"shadow-amber-500/10"},low:{border:"border-blue-500/60",bg:"bg-blue-500/10",text:"text-blue-400",badge:"bg-blue-500/20 text-blue-300 border-blue-500/30",glow:"shadow-blue-500/10"},success:{border:"border-emerald-500/60",bg:"bg-emerald-500/10",text:"text-emerald-400",badge:"bg-emerald-500/20 text-emerald-300 border-emerald-500/30",glow:"shadow-emerald-500/10"}};function Zs(){g.useEffect(()=>{$e("Booth Operations Command Center")},[]);const[t,l]=g.useState(null),[m,i]=g.useState(!1),[h,n]=g.useState({}),[x,a]=g.useState({open:!1,title:"",message:"",confirmLabel:"",variant:"default",onConfirm:()=>{}}),{toast:b}=Se(),{booths:o,filteredBooths:f,isLoading:u,error:d,refetch:r,isFetching:C}=as(h),R=ls(),p=Pe(o),S=ae({mutationFn:async({boothId:s,data:c})=>(await Oe("PATCH",`/api/admin/booths/${s}`,c)).json(),onSuccess:()=>{Ee.invalidateQueries({queryKey:["booths"]})},onError:()=>{b({title:"Update failed",variant:"destructive"})}}),U=g.useCallback((s,c)=>{S.mutate({boothId:s,data:{priceCents:c}}),b({title:"Price updated"})},[S]),ne=g.useCallback((s,c,w)=>{S.mutate({boothId:s,data:{x:c,y:w}})},[S]),T=g.useMemo(()=>ms(o),[o]),L=g.useMemo(()=>xs(o,p,T),[o,p,T]),I=g.useMemo(()=>L.filter(s=>s.severity==="critical"||s.severity==="high"),[L]),N=p.total>0?Math.round(p.paid/p.total*100):0,q=o.reduce((s,c)=>s+c.priceCents,0),de=q-p.revenue,ce=p.paid>0?Math.round(p.revenue/p.paid):0,P=[...T].sort((s,c)=>c.fillRate-s.fillRate)[0];g.useEffect(()=>{if(t&&o.length){const s=o.find(c=>c.id===t.id);s&&l(s)}},[o]);const me=async(s,c,w,j)=>{try{await R.mutateAsync({boothId:c,action:s,data:j}),b({title:w}),l(null),a(B=>({...B,open:!1}))}catch(B){b({title:"Action failed",description:B instanceof Error?B.message:"Something went wrong.",variant:"destructive"}),a(k=>({...k,open:!1}))}},xe=(s,c)=>{if(s==="assign"){i(!0);return}const w=o.find(ue=>ue.id===c),j=w?.boothNumber||"?",k={lock:{title:`Lock Booth #${j}?`,message:"This will prevent any assignment or hold until unlocked.",confirmLabel:"Lock",variant:"destructive",apiAction:"lock",successLabel:`Booth #${j} locked`},unlock:{title:`Unlock Booth #${j}?`,message:"This will restore the booth to available status.",confirmLabel:"Unlock",variant:"default",apiAction:"unlock",successLabel:`Booth #${j} unlocked`},release:{title:`Release Hold on Booth #${j}
1?`,message:`This will remove the hold${w?.heldByEmail?` by ${w.heldByEmail}`:""} and make it available.`,confirmLabel:"Release",variant:"destructive",apiAction:"release",successLabel:`Hold on Booth #${j} released`},hold:{title:`Hold Booth #${j}?`,message:"This will place a 30-minute admin hold on this booth.",confirmLabel:"Place Hold",variant:"default",apiAction:"hold",successLabel:`Booth #${j} placed on hold`},sponsor:{title:`Sponsor Reserve Booth #${j}?`,message:"This booth will be reserved for a sponsor and removed from general availability.",confirmLabel:"Reserve",variant:"default",apiAction:"sponsor",successLabel:`Booth #${j} sponsor-reserved`},unsponsor:{title:`Remove Sponsor Reserve from Booth #${j}?`,message:"This will make the booth available for general booking again.",confirmLabel:"Remove",variant:"default",apiAction:"sponsor",successLabel:`Booth #${j} sponsor reserve removed`,data:{reserve:!1}}}[s];k&&a({open:!0,title:k.title,message:k.message,confirmLabel:k.confirmLabel,variant:k.variant,onConfirm:()=>me(k.apiAction,c,k.successLabel,k.data)})},he=async(s,c)=>{await R.mutateAsync({boothId:s,action:"assign",data:c}),b({title:"Booth Assigned",description:`Assigned to ${c.vendorName}`}),l(null)};return u?e.jsxs("div",{className:"min-h-screen bg-slate-950 flex flex-col items-center justify-center gap-3",children:[e.jsx(te,{className:"h-8 w-8 animate-spin text-violet-400"}),e.jsx("p",{className:"text-sm text-slate-400",children:"Loading booth data..."})]}):d?e.jsxs("div",{className:"min-h-screen bg-slate-950 flex flex-col items-center justify-center gap-3",children:[e.jsx(Ke,{className:"h-10 w-10 text-red-400"}),e.jsx("p",{className:"text-sm font-medium text-red-300",children:"Failed to load booth data"}),e.jsxs(v,{variant:"outline",size:"sm",onClick:()=>r(),className:"gap-1.5 mt-2 border-slate-700 text-slate-300 hover:bg-slate-800","data-testid":"button-retry",children:[e.jsx(Q,{className:"w-3.5 h-3.5"})," Retry"]})]}):o.length?e.jsxs("div",{className:"min-h-screen bg-slate-950 text-white","data-testid":"admin-booths",children:[e.jsx("div",{className:"bg-gradient-to-br from-slate-900 via-slate-950 to-violet-950/30 border-b border-white/5",children:e.jsxs("div",{className:"max-w-[1600px] mx-auto px-6 py-8",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-gradient-to-br from-violet-500 to-purple-600 flex items-center justify-center shadow-xl shadow-violet-500/25",children:e.jsx(K,{className:"w-7 h-7 text-white"})}),e.jsx("div",{className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-emerald-500 border-2 border-slate-950 animate-pulse"})]}),e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-display font-extrabold tracking-tight flex items-center gap-2","data-testid":"text-booth-title",children:[e.jsx("span",{className:"bg-gradient-to-r from-white to-slate-400 bg-clip-text text-transparent",children:"Booth Operations"}),e.jsx($,{className:"bg-violet-500/20 text-violet-300 border-violet-500/30 text-[10px] uppercase tracking-wider font-medium",children:"Command Center"})]}),e.jsx("p",{className:"text-sm text-slate-400 mt-0.5",children:"Visual booth editor with lock, assignment, and release tools"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-lg ${N>=70?"bg-emerald-500/20":N>=40?"bg-amber-500/20":"bg-red-500/20"}`,"data-testid":"badge-fill-health",children:[e.jsx(Ge,{className:`w-3 h-3 ${N>=70?"text-emerald-400":N>=40?"text-amber-400":"text-red-400"}`}),e.jsx("span",{className:`text-xs font-medium ${N>=70?"text-emerald-400":N>=40?"text-amber-400":"text-red-400"}`,children:N>=70?"Healthy":N>=40?"Attention Needed":"Critical"})]}),e.jsxs(v,{variant:"outline",size:"sm",onClick:()=>r(),disabled:C,className:"border-white/10 bg-white/5 text-slate-300 hover:bg-white/10 hover:text-white gap-1.5","data-testid":"button-refresh-booths",children:[e.jsx(Q,{className:`w-3.5 h-3.5 ${C?"animate-spin":""}`}),C?"Refreshing...":"Refresh"]})]})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 xl:grid-cols-8 gap-3","data-testid":"booth-kpi-strip",children:[{label:"Total Booths",value:p.total,icon:Je,gradient:"from-slate-600/20 to-slate-500/10",border:"border-slate-500/30",color:"text-slate-300"},{label:"Available",value:p.available,icon:Re,gradient:"from-emerald-600/20 to-emerald-500/10",border:"border-emerald-500/30",color:"text-emerald-400",active:!!h.availableOnly,onClick:()=>n(s=>({...s,availableOnly:!s.availableOnly||void 0}))},{label:"Booked",value:p.paid,icon:M,gradient:"from-blue-600/20 to-blue-500/10",border:"border-blue-500/30",color:"text-blue-400",active:h.statuses?.length===1&&h.statuses[0]==="paid",onClick:()=>n(s=>s.statuses?.[0]==="paid"?{...s,statuses:void 0}:{...s,statuses:["paid"],availableOnly:void 0})}
1,{label:"Held",value:p.held,icon:Z,gradient:"from-amber-600/20 to-amber-500/10",border:"border-amber-500/30",color:"text-amber-400",active:h.statuses?.length===1&&h.statuses[0]==="held",onClick:()=>n(s=>s.statuses?.[0]==="held"?{...s,statuses:void 0}:{...s,statuses:["held"],availableOnly:void 0})},{label:"Sponsor",value:p.sponsorReserved,icon:E,gradient:"from-purple-600/20 to-purple-500/10",border:"border-purple-500/30",color:"text-purple-400",active:!!h.sponsorReservedOnly,onClick:()=>n(s=>({...s,sponsorReservedOnly:!s.sponsorReservedOnly||void 0}))},{label:"Locked",value:p.locked,icon:_,gradient:"from-red-600/20 to-red-500/10",border:"border-red-500/30",color:"text-red-400",active:h.statuses?.length===1&&h.statuses[0]==="locked",onClick:()=>n(s=>s.statuses?.[0]==="locked"?{...s,statuses:void 0}:{...s,statuses:["locked"],availableOnly:void 0})},{label:"Revenue",value:y(p.revenue),icon:Be,gradient:"from-emerald-600/20 to-teal-500/10",border:"border-emerald-500/30",color:"text-emerald-400"},{label:"Utilization",value:`${N}%`,icon:Ye,gradient:N>=70?"from-emerald-600/20 to-emerald-500/10":N>=40?"from-amber-600/20 to-amber-500/10":"from-red-600/20 to-red-500/10",border:N>=70?"border-emerald-500/30":N>=40?"border-amber-500/30":"border-red-500/30",color:N>=70?"text-emerald-400":N>=40?"text-amber-400":"text-red-400"}].map((s,c)=>e.jsxs("div",{className:`bg-gradient-to-br ${s.gradient} border ${s.border} rounded-xl p-4 backdrop-blur-sm transition-all ${s.onClick?"cursor-pointer hover:scale-[1.02]":""} ${"active"in s&&s.active?"ring-2 ring-violet-500/50":""}`,onClick:"onClick"in s?s.onClick:void 0,"data-testid":`kpi-${s.label.toLowerCase().replace(/\s+/g,"-")}`,children:[e.jsx("div",{className:"flex items-center justify-between mb-2",children:e.jsx(s.icon,{className:`w-4 h-4 ${s.color}`})}),e.jsx("div",{className:`text-2xl font-display font-extrabold ${s.color}`,children:s.value}),e.jsx("p",{className:"text-[10px] text-slate-500 font-medium mt-1 uppercase tracking-wider",children:s.label})]},c))})]})}),e.jsxs("div",{className:"max-w-[1600px] mx-auto px-6 py-8 space-y-8",children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4","data-testid":"computed-metrics",children:[{label:"Projected Revenue",value:y(q),sub:"100% fill",icon:Xe,color:"text-violet-400"},{label:"Remaining Opportunity",value:y(de),sub:`${p.available} booths`,icon:Y,color:"text-amber-400"},{label:"Avg Revenue/Booth",value:y(ce),sub:`${p.paid} booked`,icon:We,color:"text-blue-400"},{label:"Best Zone",value:P?A[P.zone].label:"N/A",sub:P?`${P.fillRate}% fill`:"",icon:E,color:"text-emerald-400"}].map((s,c)=>e.jsxs("div",{className:"bg-slate-900/80 border border-white/5 rounded-xl p-5 hover:border-white/10 transition-colors","data-testid":`metric-${s.label.toLowerCase().replace(/\s+/g,"-")}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx(s.icon,{className:`w-4 h-4 ${s.color}`}),e.jsx(es,{className:"w-3.5 h-3.5 text-slate-600"})]}),e.jsx("div",{className:`text-xl font-display font-extrabold ${s.color}`,children:s.value}),e.jsx("p",{className:"text-[10px] text-slate-500 font-medium mt-1 uppercase tracking-wider",children:s.label}),s.sub&&e.jsx("p",{className:"text-[10px] text-slate-600 mt-0.5",children:s.sub})]},c))}),I.length>0&&e.jsxs("div",{"data-testid":"exception-alerts",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-slate-500 uppercase tracking-wider font-medium mb-3",children:[e.jsx(G,{className:"w-3.5 h-3.5 text-red-400"})," Exception Alerts",e.jsx($,{className:"bg-red-500/20 text-red-300 border-red-500/30 text-[10px] ml-1",children:I.length})]}),e.jsx("div",{className:"space-y-3",children:I.map(s=>{const c=se[s.severity];return e.jsx("div",{className:`${c.bg} border ${c.border} rounded-xl p-4 shadow-lg ${c.glow}`,"data-testid":`alert-${s.id}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(G,{className:`w-5 h-5 ${c.text} mt-0.5 shrink-0`}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:`font-semibold text-sm ${c.text}`,children:s.title}),e.jsx($,{className:`${c.badge} text-[10px]`,children:s.severity})]}),e.jsx("p",{className:"text-xs text-slate-400 leading-relaxed",children:s.description})]})]})},s.id)})})]}),e.jsxs("div",{"data-testid":"zone-intelligence",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-slate-500 uppercase tracking-wider font-medium mb-4",children:[e.jsx(Ae,{className:"w-3.5 h-3.5"})," Zone Intelligence"]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-5 ga
1p-4",children:T.map(s=>{const c=A[s.zone],w=s.fillRate>=70?"bg-emerald-500":s.fillRate>=40?"bg-amber-500":"bg-red-500",j=s.fillRate>=70?"text-emerald-400":s.fillRate>=40?"text-amber-400":"text-red-400",B=s.demand==="Very High"?"text-emerald-300 bg-emerald-500/20":s.demand==="High"?"text-blue-300 bg-blue-500/20":s.demand==="Moderate"?"text-amber-300 bg-amber-500/20":"text-slate-300 bg-slate-500/20";return e.jsxs("div",{className:"bg-slate-900/80 border border-white/5 rounded-xl p-4 hover:border-white/10 transition-colors","data-testid":`zone-intel-${s.zone.toLowerCase().replace(/\s+/g,"-")}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("div",{className:"w-3 h-3 rounded-sm",style:{backgroundColor:c.color}}),e.jsx("span",{className:"text-sm font-semibold text-white",children:c.label}),e.jsx($,{className:`${B} text-[9px] ml-auto border-0`,children:s.demand})]}),e.jsxs("div",{className:"grid grid-cols-4 gap-2 text-center mb-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-bold text-white",children:s.total}),e.jsx("div",{className:"text-[9px] text-slate-500 uppercase",children:"Total"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-bold text-emerald-400",children:s.available}),e.jsx("div",{className:"text-[9px] text-slate-500 uppercase",children:"Free"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-bold text-amber-400",children:s.held}),e.jsx("div",{className:"text-[9px] text-slate-500 uppercase",children:"Held"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-bold text-blue-400",children:s.booked}),e.jsx("div",{className:"text-[9px] text-slate-500 uppercase",children:"Booked"})]})]}),e.jsxs("div",{className:"mb-2",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-[10px] text-slate-500",children:"Fill Rate"}),e.jsxs("span",{className:`text-xs font-bold ${j}`,children:[s.fillRate,"%"]})]}),e.jsx("div",{className:"w-full h-1.5 bg-slate-800 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full ${w} rounded-full transition-all`,style:{width:`${s.fillRate}%`}})})]}),e.jsxs("div",{className:"text-xs text-slate-400",children:["Revenue: ",e.jsx("span",{className:"text-emerald-400 font-semibold",children:y(s.revenue)})]})]},s.zone)})})]}),L.length>0&&e.jsxs("div",{"data-testid":"ai-intelligence-panel",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-slate-500 uppercase tracking-wider font-medium mb-4",children:[e.jsx(ss,{className:"w-3.5 h-3.5 text-violet-400"})," AI Intelligence",e.jsxs($,{className:"bg-violet-500/20 text-violet-300 border-violet-500/30 text-[10px] ml-1",children:[L.length," insights"]})]}),e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:L.map(s=>{const c=se[s.severity];return e.jsxs("div",{className:`bg-slate-900/80 border-l-2 ${c.border} border border-white/5 rounded-xl p-5 hover:border-white/10 transition-colors`,"data-testid":`insight-${s.id}`,children:[e.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[e.jsx(Le,{className:`w-4 h-4 ${c.text} mt-0.5 shrink-0`}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm font-semibold text-white",children:s.title}),e.jsx($,{className:`${c.badge} text-[9px]`,children:s.severity})]}),e.jsx("p",{className:"text-xs text-slate-400 leading-relaxed",children:s.description})]})]}),s.recommendations.length>0&&e.jsx("div",{className:"ml-7 space-y-1.5",children:s.recommendations.map((w,j)=>e.jsxs("div",{className:"flex items-start gap-2 text-xs text-slate-400",children:[e.jsx(ts,{className:"w-3 h-3 text-violet-400 mt-0.5 shrink-0"}),e.jsx("span",{children:w})]},j))})]},s.id)})})]}),e.jsxs("div",{className:"flex flex-wrap gap-3 items-center px-1","data-testid":"booth-legend",children:[["available","held","paid","sponsor_reserved","locked"].map(s=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-4 h-3 rounded-sm border border-white/10",style:{backgroundColor:re[s]}}),e.jsx("span",{className:"text-[11px] text-slate-400",children:V[s]})]},s)),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-sm text-yellow-500",children:"â
"}),e.jsx("span",{className:"text-[11px] text-slate-400",children:"Premium"})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.jsxs($,{className:"bg-slate-800 text-slate-400 border-slate-700 text-[10px]",children:[p.premiumCount," premium"]}),e.jsxs($,{className:"bg-slate-800 text-slate-400 border-slate-700 text-[10px]",children:[f.length,"/",o.length," shown"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[260px_1fr] gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"bg-slate-900/80 border border-white/5 rounded-xl p-4",children:e.jsx(rs,{onFilterChange:n,totalBooths:o.length,filteredBooths:f.length,showCategories:!0,showSearch:!0})}),e.jsxs("div",{className:"bg-slate-900/80 border border-white/5 rounded-xl p-4","data-testid":"bulk-actions-panel",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-slate-500 uppercase tracking-wider font-medium mb-3",children:[e.jsx(Y,{className:"w-3.5 h-3.5"})," Bulk Actions"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(v,{variant:"outline",size:"sm",className:"w-full border-slate-700 text-slate-300 hover:bg-slate-800 hover:text-white gap-1.5 justify-start text-xs","data-testid":"button-bulk-lock",disabled:p.available===0,children:[e.jsx(_,{className:"w-3.5 h-3.5"})," Lock Unsold Booths"]}),e.jsxs(v,{variant:"outline",size:"sm",className:"w-full border-slate-700 text-slate-300 hover:bg-slate-800 hover:text-white gap-1.5 justify-start text-xs","data-testid":"button-bulk-u
1nlock",disabled:p.locked===0,children:[e.jsx(oe,{className:"w-3.5 h-3.5"})," Unlock All Locked"]}),e.jsxs(v,{variant:"outline",size:"sm",className:"w-full border-slate-700 text-slate-300 hover:bg-slate-800 hover:text-white gap-1.5 justify-start text-xs","data-testid":"button-bulk-release",disabled:p.held===0,children:[e.jsx(Z,{className:"w-3.5 h-3.5"})," Release All Holds"]})]})]})]}),e.jsx("div",{className:"bg-slate-900/80 border border-white/5 rounded-xl p-4","data-testid":"booth-map-container",children:e.jsx(Me,{booths:f,allBooths:o,selectedBoothId:t?.id,onBoothSelect:l,onBoothMove:ne,height:650})})]})]}),e.jsx(os,{booth:t,open:!!t&&!m,onClose:()=>l(null),onAction:xe,onPriceChange:U,mode:"admin",loading:R.isPending}),e.jsx(ns,{booth:t,open:m,onOpenChange:s=>{i(s),s||l(null)},onAssign:he,loading:R.isPending}),e.jsx(ds,{open:x.open,title:x.title,message:x.message,confirmLabel:x.confirmLabel,variant:x.variant,onConfirm:x.onConfirm,onCancel:()=>a(s=>({...s,open:!1})),isPending:R.isPending})]}):e.jsxs("div",{className:"min-h-screen bg-slate-950 flex flex-col items-center justify-center gap-3",children:[e.jsx(K,{className:"h-10 w-10 text-slate-600"}),e.jsx("h3",{className:"font-semibold text-slate-400",children:"No Booths"}),e.jsx("p",{className:"text-xs text-slate-500",children:"No booths found for this event."})]})}export{Zs 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.