PageSourceSearch

https://sendunlimitedemail.com/sue/mod-B93lGi2C.js

js sendunlimitedemail.com collected 2026-10-05 06:25:02 UTC 23,596 bytes, 2 lines download raw bytes

1import{k as O,r as n,j as e,B as i,i as ve,Z as be,e as x,t as d}from"./edge-BOITG1XR.js";import{C as w,a as R,b as T,c as $}from"./mod-DgQ0OFXm.js";import{I as h}from"./mod-BUsEZZHX.js";import{L as m}from"./mod-kvo2LsX8.js";import{B as se}from"./mod-D625c86a.js";import{R as Ne}from"./mod-RPxq32x0.js";import{B as M}from"./mod-D5xxkeD6.js";import{P as ae}from"./mod-BHbsKpbp.js";import{C as we}from"./mod-E2spV6fa.js";import{C as ye}from"./mod-D7ZJrZxI.js";import{L as y}from"./mod-DxqX0N6D.js";import{P as _e}from"./mod-BC0FuShf.js";import{S as z}from"./mod-CIn4OWcr.js";import{T as oe}from"./mod-CFOXB00Z.js";import{E as ne}from"./mod-DlaYEcom.js";import{X as U}from"./mod-C3kaoPgB.js";import{L as ce,P as te,a as Ce}from"./mod-CSynIO_k.js";import{I as D}from"./mod-ClnwnFZu.js";import{U as ke}from"./mod-T3ncT9Ga.js";import{S as Se}from"./mod-C9xhOiHj.js";import{E as Ae}from"./mod-B_npTkgx.js";import{P as Ie}from"./mod-4f-rbCW3.js";import{E as Be}from"./mod-OWtIy5n2.js";import{T as Le}from"./mod-BuHkwEt_.js";const Ee=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Fe=O("columns-2",Ee);const Pe=[["path",{d:"M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z",key:"1dudjm"}],["path",{d:"M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z",key:"l2t8xc"}],["path",{d:"M16 17h4",key:"1dejxt"}],["path",{d:"M4 13h4",key:"1bwh8b"}]],Re=O("footprints",Pe);const Te=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]],$e=O("rectangle-horizontal",Te),S=[{value:"hero_full",label:"Full Width",icon:$e,desc:"100% — spans the entire row",css:"col-span-12"},{value:"hero_half",label:"Half Width",icon:Fe,desc:"50% — pair two together",css:"col-span-6"},{value:"hero_primary",label:"3/4 Primary",icon:te,desc:"75% — pair with 1/4 banner",css:"col-span-9"},{value:"hero_secondary",label:"1/4 Secondary",icon:Ce,desc:"25% — pair with 3/4 banner",css:"col-span-3"},{value:"hero_third",label:"1/3 Column",icon:ce,desc:"33% — use three together",css:"col-span-4"},{value:"sidebar",label:"Sidebar",icon:te,desc:"Aside / sidebar placement",css:""},{value:"footer",label:"Footer Strip",icon:Re,desc:"Below-fold footer area",css:""}],le={title:"",subtitle:"",link_url:"",position:"hero_full",sort_order:1,is_active:!0,image_url:"",bg_color:"#7c3aed",text_color:"#ffffff",cta_text:"Shop Now"},re={main:{label:"AI Main",color:"bg-violet-100 text-violet-700 border-violet-200"},offer:{label:"AI Offer",color:"bg-amber-100 text-amber-700 border-amber-200"},seasonal:{label:"Seasonal",color:"bg-rose-100 text-rose-700 border-rose-200"},fixed:{label:"Fixed",color:"bg-slate-100 text-slate-600 border-slate-200"}},ze=({banner:a,onEdit:g,onToggle:A,onDelete:_})=>{const t=S.find(j=>j.value===a.position)||S[0],f=re[a.banner_role]||re.fixed;return e.jsxs("div",{className:"group relative overflow-hidden rounded-xl border bg-card transition hover:shadow-md",children:[e.jsxs("div",{className:"relative h-36 overflow-hidden bg-muted",children:[a.image_url?e.jsx("img",{src:a.image_url,alt:a.title,className:"h-full w-full object-cover transition group-hover:scale-105"}):e.jsx("div",{className:"flex h-full items-center justify-center",style:{background:`linear-gradient(135deg, ${a.bg_color||"#7c3aed"}, ${a.text_color==="#ffffff"?"#4c1d95":"#1a1a1a"})`},children:e.jsx(D,{className:"h-10 w-10 text-white/40"})}),e.jsxs("div",{className:"absolute inset-x-0 top-0 flex items-center justify-between p-2",children:[e.jsx(se,{variant:a.is_active?"default":"secondary",className:"text-[10px]",children:a.is_active?"Live":"Draft"}),e.jsxs("div",{className:"flex gap-1",children:[a.ai_generated&&e.jsxs("span",{className:"flex items-center gap-0.5 rounded-full bg-violet-600 px-1.5 py-0.5 text-[9px] font-bold text-white",children:[e.jsx(M,{className:"h-2.5 w-2.5"})," AI"]}),e.jsx(se,{variant:"outline",className:"bg-black/40 text-[10px] text-white border-white/20",children:t.label})]})]})]}),e.jsxs("div",{className:"p-3",children:[e.jsxs("div",{className:"flex items-start gap-2 mb-1",children:[e.jsx("p",{className:"font-semibold leading-snug line-clamp-1 flex-1",children:a.title}),e.jsx("span",{className:`shrink-0 rounded-full border px-1.5 py-0.5 text-[9px] font-semibold ${f.color}`,children:f.label})]}),a.subtitle&&e.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground line-clamp-1",children:a.subtitle}),a.banner_role==="offer"&&a.promo_percent>0&&e.jsxs("p",{className:"mt-1 flex items-center gap-1 text-[10px] font-medium text-amber-600",children:[e.jsx(oe,{className:"h-3 w-3"}),a.promo_percent,"% off · cap AED ",a.promo_cap_aed||20]}),a.link_url&&e.jsxs("p",{className:"mt-1 flex items-center gap-1 text-[10px] text-muted-foreground",children:[e.jsx(Ae,{className:"h-3 w-3"}),e.jsx("span",{className:"truncate",children:a.link_url})]})]}),e.jsxs("div",{className:"flex gap-1 border-t px-3 py-2",children:[e.jsxs(i,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>g(a),children:[e.jsx(Ie,{className:"h-3.5 w-3.5 mr-1"})," Edit"]}),e.jsxs(i,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>A(a.id),children:[a.is_active?e.jsx(Be,{className:"h-3.5 w-3.5 mr-1"}):e.jsx(ne,{className:"h-3.5 w-3.5 mr-1"}),a.is_active?"Hide":"Show"]}),e.jsx(i,{size:"sm",variant:"ghost",className:"ml-auto h-7 px-2 text-xs text-destructive hover:bg-destructive/10",onClick:()=>_(a.id),children:e.jsx(Le,{className:"h-3.5 w-3.5"})})]})]})},ie=({value:a})=>{const g={hero_full:e.jsx("div",{className:"h-full w-full rounded bg-primary/60"}),hero_half:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-full w-1/2 roun
1ded bg-primary/60 mr-0.5"}),e.jsx("div",{className:"h-full w-1/2 rounded bg-muted"})]}),hero_primary:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-full rounded bg-primary/60",style:{width:"75%",marginRight:2}}),e.jsx("div",{className:"h-full rounded bg-muted",style:{width:"25%"}})]}),hero_secondary:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-full rounded bg-muted",style:{width:"75%",marginRight:2}}),e.jsx("div",{className:"h-full rounded bg-primary/60",style:{width:"25%"}})]}),hero_third:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-full w-1/3 rounded bg-primary/60 mr-0.5"}),e.jsx("div",{className:"h-full w-1/3 rounded bg-muted mx-0.5"}),e.jsx("div",{className:"h-full w-1/3 rounded bg-muted ml-0.5"})]}),sidebar:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-full w-3/4 rounded bg-muted mr-0.5"}),e.jsx("div",{className:"h-full w-1/4 rounded bg-primary/60"})]}),footer:e.jsx("div",{className:"h-2/5 w-full self-end rounded bg-primary/60 mt-auto"})};return e.jsx("div",{className:"flex h-8 w-16 items-stretch overflow-hidden rounded border bg-muted/30 p-0.5",children:g[a]||e.jsx("div",{className:"h-full w-full rounded bg-primary/60"})})},cs=()=>{const[a,g]=n.useState([]),[A,_]=n.useState(!0),[t,f]=n.useState(le),[j,I]=n.useState(null),[H,G]=n.useState(!1),[W,Z]=n.useState(!1),[v,u]=n.useState(""),[de,B]=n.useState(!1),X=n.useRef(null),[p,me]=n.useState(null),[C,V]=n.useState(!1),[Y,q]=n.useState(!1),[J,k]=n.useState(null),[L,K]=n.useState(!1),b={total:a.length,active:a.filter(s=>s.is_active).length,hero:a.filter(s=>s.position?.startsWith("hero")).length,aiCount:a.filter(s=>s.ai_generated).length},N=async()=>{try{_(!0);const s=await x.get("/admin/banners"),l=Array.isArray(s.data)?s.data:s.data?.data||[];g(l),window.dispatchEvent(new CustomEvent("bannersUpdated"))}catch{}finally{_(!1)}},E=async()=>{try{const s=await x.get("/admin/ai/banners/status");me(s.data)}catch{}};n.useEffect(()=>{N(),E()},[]);const o=(s,l)=>f(r=>({...r,[s]:l})),Q=()=>{f(le),I(null),u(""),B(!0)},xe=s=>{f({title:s.title||"",subtitle:s.subtitle||"",link_url:s.link_url||"",position:s.position||"hero_full",sort_order:s.sort_order||1,is_active:s.is_active??!0,image_url:s.image_url||"",bg_color:s.bg_color||"#7c3aed",text_color:s.text_color||"#ffffff",cta_text:s.cta_text||"Shop Now"}),u(s.image_url||""),I(s.id),B(!0)},F=()=>{B(!1),I(null)},he=async()=>{const s=t.title||"ecommerce shopping";Z(!0);try{const c=await x.post("/ai/generate-banner-image",{prompt:s,title:s});if(c.data?.url||c.data?.image_url){const ee=c.data.url||c.data.image_url;u(ee),o("image_url",ee),d.success("AI image generated!");return}}catch{}const r=`https://picsum.photos/seed/${encodeURIComponent(s.toLowerCase().replace(/\s+/g,"-").substring(0,20))}/1200/400`;u(r),o("image_url",r),d.success("Image generated from keyword"),Z(!1)},ue=s=>{const l=s.target.files?.[0];if(!l)return;const r=new FileReader;r.onload=c=>{u(c.target.result),o("image_url",c.target.result)},r.readAsDataURL(l)},P=async(s="all",l=!0)=>{V(!0),k(null);try{const c=(await x.post("/admin/ai/banners/generate",{type:s,force:l})).data;d.success(`AI rotation complete — ${c.created} created, ${c.rotated} active`),c.errors?.length&&d.warning(`Errors: ${c.errors.join(", ")}`),N(),E()}catch(r){d.error(r?.response?.data?.message||"AI rotation failed")}finally{V(!1)}},pe=async(s="main")=>{q(!0),k(null);try{const l=await x.post("/admin/ai/banners/preview",{type:s});k(l.data.concept)}catch(l){d.error(l?.response?.data?.message||"Preview failed")}finally{q(!1)}},ge=async()=>{if(!t.title.trim()){d.error("Title is required");return}G(!0);try{const s=new FormData;Object.entries(t).forEach(([l,r])=>{l==="image_url"&&r?.startsWith("data:")||s.append(l,r===!0?"1":r===!1?"0":String(r??""))}),j?(await x.post(`/admin/banners/${j}`,s,{headers:{"Content-Type":"multipart/form-data"}}),d.success("Banner updated")):(await x.post("/admin/banners",s,{headers:{"Content-Type":"multipart/form-data"}}),d.success("Banner created")),F(),N()}catch{d.error("Failed to save banner")}finally{G(!1)}},fe=async s=>{try{await x.patch(`/admin/banners/${s}/toggle`),N()}catch{g(l=>l.map(r=>r.id===s?{...r,is_active:!r.is_active}:r))}},je=async s=>{if(window.confirm("Delete this banner?"))try{await x.delete(`/admin/banners/${s}`),N(),d.success("Banner deleted")}catch{d.error("Failed to delete banner")}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Banner Manager"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[b.total," banners · ",b.aiCount," AI-generated"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(i,{variant:"outline",size:"sm",onClick:()=>{N(),E()},children:e.jsx(Ne,{className:"h-4 w-4"})}),e.jsxs(i,{variant:"outline",size:"sm",onClick:()=>K(s=>!s),className:"border-violet-300 text-violet-700 hover:bg-violet-50",children:[e.jsx(M,{className:"mr-2 h-4 w-4"})," AI Control"]}),e.jsxs(i,{onClick:Q,children:[e.jsx(ae,{className:"mr-2 h-4 w-4"})," New Banner"]})]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[{label:"Total",value:b.total,color:"text-primary"},{label:"Live",value:b.active,color:"text-emerald-600"},{label:"Hero",value:b.hero,color:"text-violet-600"},{label:"AI Generated",value:b.aiCount,color:"text-purple-600"}].map(s=>e.jsxs(w,{className:"text-center py-3 px-4",children:[e.jsx("p",{className:`text-2xl font-bold ${s.color}`,children:s.value}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.label})]},s.label))}),e.jsxs(w,{className:"border-violet-200 bg-gradient-to-br from-violet-50/60 to-purple-50/40",children:[e.jsx(R,{className:"pb-2 pt-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(T,{className:"text-sm font-semibold flex items-center gap-2 text-violet-800",children:[e.jsx(M,{className:"h-4 w-4"}),"AI Banner Rotation",e.jsx("span",{className:"text-[10px] font-normal text-violet-500 bg-violet-100 px-2 py-0.5 rounded-full",children:"Every 5 days · FLUX Pro"})]}),e.jsxs("button",{onClick:()=>K(s=>!s),className:"flex items-center gap-1 text-xs text-violet-600 hover:text-violet-800 transition",children:[L?"Collapse":"Expand",e.jsx(ve,{className:`h-3.5 w-3.5 transition-transform ${L?"rotate-180":""}`})]})]})}),e.jsxs($,{className:"pb-3 pt-0 space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(we,{className:"h-3.5 w-3.5 text-violet-400"}),"Last run: ",e.jsx("strong",{className:"text-foreground ml-1",children:p?.last_rotation?new Date(p.last_rotation).toLocaleDateString():"Never"})]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(be,{className:"h-3.5 w-3.5 text-amber-400"}),"Next: ",e.jsx("strong",{className:"text-foreground ml-1",children:p?.next_rotation??"—"})]}),p?.counts&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ye,{className:"h-3.5 w-3.5 text-violet-400"}),"AI Main: ",e.jsx("strong",{className:"text-violet-700 ml-1",children:p.counts.ai_main})]}),e.jsxs("span",{children:["AI Offer: ",e.jsx("strong",{className:"text-amber-700",children:p.counts.ai_offer})]}),e.jsxs("span",{children:["Fixed: ",e.jsx("strong",{children:p.counts.fixed})]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(i,{size:"sm",className:"bg-violet-600 hover:bg-violet-700 text-white h-8 text-xs",onClick:()=>P("all",!0),disabled:C,children:[C?e.jsx(y,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):e.jsx(_e,{className:"mr-1.5 h-3.5 w-3.5"}),"Generate All (Force)"]}),e.jsxs(i,{size:"sm",variant:"outline",className:"border-violet-300 text-violet-700 hover:bg-violet-50 h-8 text-xs",onClick:()=>P("main",!0),disabled:C,children:[e.jsx(z,{className:"mr-1.5 h-3.5 w-3.5"})," Main Banners"]}),e.jsxs(i,{size:"sm",variant:"outline",className:"border-amber-300 text-amber-700 hover:bg-amber-50 h-8 text-xs",onClick:()=>P("offer",!0),disabled:C,children:[e.jsx(oe,{className:"mr-1.5 h-3.5 w-3.5"})," Offer Banner"]}),e.jsxs(i,{size:"sm",variant:"ghost",className:"text-violet-600 h-8 text-xs ml-auto",onClick:()=>pe("main"),disabled:Y,children:[Y?e.jsx(y,{className:"mr-1 h-3 w-3 animate-spin"}):e.jsx(ne,{className:"mr-1 h-3 w-3"}),"Preview Concept"]})]}),L&&e.jsxs("div",{className:"mt-2 space-y-3 border-t pt-3",children:[e.jsx("div",{className:"grid grid-cols-2 gap-3 text-xs sm:grid-cols-4",children:[{label:"Cycle",value:"5 days",icon:"🔄"},{label:"Main banners/cycle",value:"2 new",icon:"🖼️"},{label:"Offer banners/cycle",value:"1 new",icon:"🏷️"},{label:"Discount range",value:"5–20%",icon:"💰"},{label:"Normal cap",value:"AED 20",icon:"🔒"},{label:"Event cap",value:"AED 50",icon:"🎉"},{label:"Img engine",value:"FLUX Pro 1.1",icon:"⚡"},{label:"Text engine",value:"AI text provider",icon:"🤖"}].map(s=>e.jsxs("div",{className:"rounded-lg bg-white/70 border border-violet-100 p-2",children:[e.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[s.icon," ",s.label]}),e.jsx("p",{className:"font-semibold text-foreground",children:s.value})]},s.label))}),J&&e.jsxs("div",{className:"rounded-xl bg-white border border-violet-200 p-4 space-y-2",children:[e.jsxs("p",{className:"text-xs font-semibold text-violet-700 flex items-center gap-1",children:[e.jsx(z,{className:"h-3.5 w-3.5"})," AI Concept Preview"]}),e.jsx("div",{className:"space-y-1 text-xs",children:Object.entries(J).map(([s,l])=>e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("span",{className:"w-24 shrink-0 font-medium text-muted-foreground capitalize",children:[s.replace(/_/g," "),":"]}),e.jsx("span",{className:"text-foreground",children:typeof l=="object"?JSON.stringify(l):String(l)}
1)]},s))}),e.jsxs(i,{size:"sm",variant:"ghost",className:"text-xs h-6 text-destructive",onClick:()=>k(null),children:[e.jsx(U,{className:"h-3 w-3 mr-1"})," Close"]})]}),e.jsxs("p",{className:"text-[10px] text-muted-foreground leading-relaxed",children:["The scheduler runs ",e.jsx("code",{className:"bg-muted px-1 rounded",children:"banners:generate-ai"}),' daily at 04:00 UAE time. It checks if 5 days have passed before acting. "Force" buttons bypass this check. 2 main lifestyle banners + 1 offer banner are replaced per cycle; fixed banners remain unchanged.']})]})]})]}),e.jsxs(w,{className:"border-dashed",children:[e.jsx(R,{className:"pb-2 pt-4",children:e.jsxs(T,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(ce,{className:"h-4 w-4 text-primary"}),"Banner Row Layout Guide"]})}),e.jsx($,{className:"grid grid-cols-2 gap-2 pb-4 sm:grid-cols-3 lg:grid-cols-7",children:S.map(s=>e.jsxs("div",{className:"flex flex-col items-center gap-1 rounded-lg bg-muted/40 p-2 text-center",children:[e.jsx(ie,{value:s.value}),e.jsx("p",{className:"text-[11px] font-semibold",children:s.label}),e.jsx("p",{className:"text-[10px] text-muted-foreground leading-tight",children:s.desc})]},s.value))})]}),de&&e.jsxs(w,{className:"border-primary/30 shadow-md",children:[e.jsxs(R,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(T,{className:"text-base",children:j?"Edit Banner":"Create Banner"}),e.jsx(i,{variant:"ghost",size:"icon",onClick:F,children:e.jsx(U,{className:"h-4 w-4"})})]}),e.jsxs($,{className:"space-y-5",children:[e.jsxs("div",{className:"grid gap-5 lg:grid-cols-2",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(m,{children:"Headline *"}),e.jsx(h,{value:t.title,onChange:s=>o("title",s.target.value),placeholder:"Summer Sale — Up to 50% Off"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(m,{children:"Subtitle"}),e.jsx(h,{value:t.subtitle,onChange:s=>o("subtitle",s.target.value),placeholder:"Short description or offer detail"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(m,{children:"CTA Button Text"}),e.jsx(h,{value:t.cta_text,onChange:s=>o("cta_text",s.target.value),placeholder:"Shop Now"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(m,{children:"Link URL"}),e.jsx(h,{value:t.link_url,onChange:s=>o("link_url",s.target.value),placeholder:"/flash-sales or https://..."})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(m,{children:"Layout / Position"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:S.map(s=>e.jsxs("button",{type:"button",onClick:()=>o("position",s.value),className:`flex items-center gap-2 rounded-lg border p-2 text-left text-xs transition
2                                                    ${t.position===s.value?"border-primary bg-primary/5 text-primary":"hover:bg-muted/50"}`,children:[e.jsx(ie,{value:s.value}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold",children:s.label}),e.jsx("p",{className:"text-muted-foreground",children:s.desc})]})]},s.value))})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsxs(m,{children:["Row Order ",e.jsx("span",{className:"text-muted-foreground text-[10px]",children:"(pair same-row banners with consecutive numbers)"})]}),e.jsx(h,{type:"number",min:1,value:t.sort_order,onChange:s=>o("sort_order",+s.target.value)})]}),e.jsxs("div",{className:"flex items-end gap-2 pb-0.5",children:[e.jsx("input",{type:"checkbox",id:"ba",checked:t.is_active,onChange:s=>o("is_active",s.target.checked),className:"h-4 w-4 rounded"}),e.jsx(m,{htmlFor:"ba",children:"Active"})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(m,{children:"Banner Image"}),e.jsx("div",{className:"relative flex h-44 items-center justify-center overflow-hidden rounded-xl border-2 border-dashed",style:v?{}:{background:`linear-gradient(135deg, ${t.bg_color}, #4c1d95)`},children:v?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:v,alt:"preview",className:"h-full w-full object-cover"}),e.jsx("button",{onClick:()=>{u(""),o("image_url","")}
2,className:"absolute top-2 right-2 rounded-full bg-black/50 p-1 text-white hover:bg-black/70",children:e.jsx(U,{className:"h-3 w-3"})})]}):e.jsxs("div",{className:"text-center text-white/70",children:[e.jsx(D,{className:"mx-auto mb-2 h-8 w-8"}),e.jsx("p",{className:"text-xs",children:"No image — using gradient"})]})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(m,{children:"Image URL"}),e.jsx("div",{className:"flex gap-2",children:e.jsx(h,{value:t.image_url?.startsWith("data:")?"":t.image_url||"",onChange:s=>{o("image_url",s.target.value),u(s.target.value)},placeholder:"https://... or paste a URL"})})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(i,{type:"button",variant:"outline",className:"flex-1",onClick:()=>X.current?.click(),children:[e.jsx(ke,{className:"mr-2 h-4 w-4"})," Upload Image"]}),e.jsxs(i,{type:"button",variant:"outline",className:"flex-1",onClick:he,disabled:W,children:[W?e.jsx(y,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(z,{className:"mr-2 h-4 w-4"}),"AI Generate"]}),e.jsx("input",{ref:X,type:"file",accept:"image/*",className:"hidden",onChange:ue})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(m,{children:["Background Color ",e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"(no image)"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"color",value:t.bg_color,onChange:s=>o("bg_color",s.target.value),className:"h-9 w-9 cursor-pointer rounded border p-0.5"}),e.jsx(h,{value:t.bg_color,onChange:s=>o("bg_color",s.target.value),className:"flex-1 font-mono text-sm"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(m,{children:"Text Color"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"color",value:t.text_color,onChange:s=>o("text_color",s.target.value),className:"h-9 w-9 cursor-pointer rounded border p-0.5"}),e.jsx(h,{value:t.text_color,onChange:s=>o("text_color",s.target.value),className:"flex-1 font-mono text-sm"})]})]})]}),e.jsxs("div",{className:"relative flex h-24 items-end overflow-hidden rounded-xl p-4",style:v?{backgroundImage:`url(${v})`,backgroundSize:"cover",backgroundPosition:"center"}:{background:`linear-gradient(135deg, ${t.bg_color}, #2e1065)`},children:[v&&e.jsx("div",{className:"absolute inset-0 bg-black/40"}),e.jsxs("div",{className:"relative z-10",style:{color:t.text_color},children:[e.jsx("p",{className:"text-sm font-bold leading-tight",children:t.title||"Banner Headline"}),t.subtitle&&e.jsx("p",{className:"text-xs opacity-80",children:t.subtitle}),t.cta_text&&e.jsxs("span",{className:"mt-1 inline-block rounded-full bg-white/20 px-3 py-0.5 text-[10px] font-semibold",children:[t.cta_text," →"]})]})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-3 border-t pt-4",children:[e.jsx(i,{variant:"outline",onClick:F,children:"Cancel"}),e.jsxs(i,{onClick:ge,disabled:H,children:[H?e.jsx(y,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(Se,{className:"mr-2 h-4 w-4"}),j?"Update Banner":"Create Banner"]})]})]})]}),A?e.jsx("div",{className:"flex items-center justify-center py-16",children:e.jsx(y,{className:"h-8 w-8 animate-spin text-primary"})}):a.length===0?e.jsxs(w,{className:"py-16 text-center",children:[e.jsx(D,{className:"mx-auto h-12 w-12 text-muted-foreground/40"}),e.jsx("p",{className:"mt-3 text-muted-foreground",children:"No banners yet."}),e.jsxs(i,{className:"mt-4",onClick:Q,children:[e.jsx(ae,{className:"mr-2 h-4 w-4"})," Create First Banner"]})]}):e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:[...a].sort((s,l)=>(s.sort_order||0)-(l.sort_order||0)).map(s=>e.jsx(ze,{banner:s,onEdit:xe,onToggle:fe,onDelete:je},s.id))})]})};export{cs 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.