PageSourceSearch

https://socialselling.ai/_next/static/chunks/28920.ce0b70ec1e516462.js

js socialselling.ai collected 2026-10-05 14:51:23 UTC 53,419 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[28920],{28920:function(e,t,a){a.r(t),a.d(t,{default:function(){return B}});var s=a(57437),r=a(2265),l=a(99376),n=a(79820),i=a(12381),d=a(40279),o=a(75060),c=a(69174),m=a(17168),x=a(33804),u=a(74291),g=a(15291),h=a(23675),p=a(89345),f=a(53417),b=a(58896),v=a(82431),w=a(99397),j=a(82023),N=a(15863),y=a(66901),k=a(42208),C=a(70525),_=a(73247),S=a(22252),R=a(89227),Z=a(33276),z=a(10407),T=a(18930),I=a(71837),D=a(14438),A=a(84881),L=a(9310),F=a(27049),M=a(52217),P=a(83426);let E=[{target:'[data-tour="campaigns-header"]',title:"Campaign Management",content:"Welcome to your campaign hub! Create, manage, and track all your marketing campaigns from here.",placement:"bottom"},{target:'[data-tour="campaigns-sync"]',title:"Sync Status",content:"Sync campaign delivery status with your email provider to get the latest metrics.",placement:"bottom"},{target:'[data-tour="campaigns-new"]',title:"Create New Campaign",content:"Click here to create a new email campaign. Choose a name, type, and set your budget.",placement:"bottom"},{target:'[data-tour="campaigns-stats"]',title:"Campaign Statistics",content:"Overview of your campaigns: total count, emails sent, delivery rate, open rate, and revenue generated.",placement:"bottom"},{target:'[data-tour="campaigns-tabs"]',title:"Filter by Status",content:"Filter campaigns by their status: All, Active, Scheduled, Drafts, or Completed.",placement:"bottom"},{target:'[data-tour="campaigns-search"]',title:"Search Campaigns",content:"Quickly find campaigns by searching by name or type.",placement:"bottom"},{target:'[data-tour="campaigns-table"]',title:"Campaign List",content:"View all your campaigns with key metrics. Click any row to see detailed analytics and manage the campaign.",placement:"top"}],V="campaigns-main-page",O=e=>({animationDelay:"".concat(100*e,"ms"),animationFillMode:"backwards"});function B(){let{user:e}=(0,A.a)(),t=(0,l.useRouter)(),{endNavigation:a}=(0,L.H)(),[B,U]=(0,r.useState)([]),[H,Y]=(0,r.useState)(!0),[W,G]=(0,r.useState)(null),[J,K]=(0,r.useState)("all"),[Q,X]=(0,r.useState)(""),[q,$]=(0,r.useState)(!1),[ee,et]=(0,r.useState)(!1),[ea,es]=(0,r.useState)(!1),[er,el]=(0,r.useState)(null),[en,ei]=(0,r.useState)(30),[ed,eo]=(0,r.useState)(!1),ec=(0,r.useRef)(null),[em,ex]=(0,r.useState)({name:"",type:"email",description:"",budget:0,channels:[]}),eu="all"===J?B:B.filter(e=>e.status===J),eg=B.filter(e=>e.email_stats&&e.email_stats.message_count>0),eh={total:B.length,active:B.filter(e=>"active"===e.status).length,scheduled:B.filter(e=>"scheduled"===e.status).length,draft:B.filter(e=>"draft"===e.status).length,completed:B.filter(e=>"completed"===e.status).length,totalSent:B.reduce((e,t)=>{var a;return e+((null===(a=t.email_stats)||void 0===a?void 0:a.total_recipients)||t.impressions||0)},0),totalDelivered:B.reduce((e,t)=>{var a;return e+((null===(a=t.email_stats)||void 0===a?void 0:a.messages_delivered)||0)},0),avgOpenRate:eg.length>0?eg.reduce((e,t)=>{var a;return e+((null===(a=t.email_stats)||void 0===a?void 0:a.open_rate)||0)},0)/eg.length:0,avgDeliveryRate:eg.length>0?eg.reduce((e,t)=>{var a;return e+((null===(a=t.email_stats)||void 0===a?void 0:a.delivery_rate)||0)},0)/eg.length:0,totalRevenue:B.reduce((e,t)=>e+(t.revenue_generated||0),0)},ep=(0,r.useCallback)(async()=>{try{Y(!0),G(null);let t=null==e?void 0:e.workspace_id,a={};t&&(a.workspace_id=t);let s=new URLSearchParams(a).toString(),r=(await I.api.get("/campaigns".concat(s?"?".concat(s):""))).data;if(r.success)U(r.data.campaigns||[]);else throw Error("Failed to fetch campaigns")}catch(e){G((0,I.getErrorMessage)(e,"Failed to load campaigns")),U([])}finally{Y(!1),a()}},[null==e?void 0:e.workspace_id,a]);(0,r.useEffect)(()=>{ep()},[ep]);let ef=async()=>{if(!em.name.trim()){D.A.error("Campaign name is required");return}try{et(!0);let t=null==e?void 0:e.workspace_id;if(!t){D.A.error("Workspace not configured. Please log out and log in again.");return}(await I.api.post("/campaigns?workspace_id=".concat(t,"&name=").concat(encodeURIComponent(em.name),"&campaign_type=").concat(em.type,"&description=").concat(encodeURIComponent(em.description||""),"&budget=").concat(em.budget))).data.success&&(D.A.success("Campaign created successfully!"),$(!1),ex({name:"",type:"email",description:"",budget:0,channels:[]}),ep())}catch(e){D.A.error((0,I.getErrorMessage)(e,"Failed to create campaign"))}finally{et(!1)}},eb=async(t,a)=>{try{let s=null==e?void 0:e.workspace_id;(await I.api.put("/campaigns/".concat(t,"/status?status=").concat(a,"&workspace_id=").concat(s))).data.success&&(D.A.success("Campaign ".concat(a," successfully")),ep())}catch(e){D.A.error((0,I.getErrorMessage)(e,"Failed to update campaign status"))}},ev=async()=>{try{es(!0),(await I.api.post("/mailjet/campaigns/sync")).data.success&&(D.A.success("Status sync triggered! Refreshing in 3 seconds..."),setTimeout(()=>{ep(),es(!1)},3e3))}catch(e){D.A.error((0,I.getErrorMessage)(e,"Failed to sync status")),es(!1)}},ew=async(t,a)=>{if(confirm('Are you sure you want to delete "'.concat(a,'"? This action cannot be undone.')))try{let a=null==e?void 0:e.workspace_id;(await I.api.delete("/campaigns/".concat(t).concat(a?"?workspace_id=".concat(a):""))).data.success&&(D.A.success("Campaign deleted successfully"),ep())}catch(e){D.A.error((0,I.getErrorMessage)(e,"Failed to delete campaign"))}},ej=eu.filter(e=>e.name.toLowerCase().includes(Q.toLowerCase())||e.type.toLowerCase().includes(Q.toLowerCase())),eN=ej.slice(0,en),ey=en<ej.length;(0,r.useEffect)(()=>{ei(30)},[J,Q]),(0,r.useEffect)(()=>{let e=ec.current;if(!e)return;let t=new IntersectionObserver(e=>{e[0].isIntersecting&&ey&&!ed&&!H&&(eo(!0),setTimeout(()=>{ei(e=>e+30),eo(!1)},300))},{root:null,rootMargin:"100px",threshold:.1});return t.observe(e),()=>t.disconnect()},[ey,ed,H]);let ek=e=>"email"===e?(0,s.jsx)(p.Z,{className:"h-4 w-4"}):(0,s.jsx)(f.Z,{className:"h-4 w-4"});return H?(0,s.jsx)("div",{className:"flex items-center justify-center min-h-[60vh]",children:(0,s.jsx)(F.LoadingScreen,{fullScreen:!1,size:"lg",message:"Loading Campaigns...",variant:"logo"})}):(0,s.jsxs)("div",{className:"min-h-full bg-gradient-to-br from-slate-50 via-green-50/30 to-emerald-50/20 dark:from-slate-950 dar
1k:via-green-950/10 dark:to-slate-950 relative",children:[(0,s.jsxs)("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[(0,s.jsx)("div",{className:"absolute -top-40 -right-40 w-80 h-80 bg-gradient-to-br from-green-400/20 to-emerald-500/20 rounded-full blur-3xl animate-pulse"}),(0,s.jsx)("div",{className:"absolute top-1/2 -left-20 w-60 h-60 bg-gradient-to-br from-blue-400/10 to-cyan-500/10 rounded-full blur-3xl animate-pulse",style:{animationDelay:"1s"}}),(0,s.jsx)("div",{className:"absolute bottom-20 right-1/4 w-40 h-40 bg-gradient-to-br from-purple-400/10 to-pink-500/10 rounded-full blur-3xl animate-pulse",style:{animationDelay:"2s"}})]}),(0,s.jsxs)("div",{className:"relative p-3 sm:p-4 md:p-6 space-y-3 sm:space-y-4 w-full max-w-[1920px] mx-auto",children:[(0,s.jsx)(M.Z,{}),(0,s.jsx)(P.X,{pageId:V,steps:E}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2 sm:gap-0 animate-[fadeInUp_0.6s_ease-out]","data-tour":"campaigns-header",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3",children:[(0,s.jsx)("div",{className:"w-8 h-8 sm:w-10 sm:h-10 rounded-lg bg-gradient-to-r from-green-500 to-emerald-600 flex items-center justify-center shadow-md flex-shrink-0",children:(0,s.jsx)(b.Z,{className:"w-4 h-4 sm:w-5 sm:h-5 text-white"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-base sm:text-lg md:text-2xl font-bold",children:"Campaigns"}),(0,s.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground hidden sm:block",children:"Create and manage marketing campaigns"})]})]}),(0,s.jsxs)("div",{className:"flex gap-1.5 sm:gap-3 w-full sm:w-auto justify-end",children:[(0,s.jsx)(P.h,{pageId:V}),(0,s.jsxs)(i.z,{variant:"outline",size:"sm",onClick:ev,disabled:ea,className:"h-8 px-2 sm:px-3 backdrop-blur-xl bg-white/70 dark:bg-slate-900/70 border-gray-200 dark:border-gray-700 text-gray-700 dark:text-gray-200 hover:bg-white dark:hover:bg-slate-800 hover:text-gray-900 dark:hover:text-white transition-all duration-300 rounded-lg sm:rounded-xl","data-tour":"campaigns-sync",children:[(0,s.jsx)(v.Z,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 ".concat(ea?"animate-spin":""," sm:mr-2")}),(0,s.jsx)("span",{className:"hidden sm:inline",children:ea?"Syncing...":"Sync"})]}),(0,s.jsxs)(i.z,{variant:"outline",size:"sm",onClick:ep,disabled:H,className:"h-8 px-2 sm:px-3 backdrop-blur-xl bg-white/70 dark:bg-slate-900/70 border-gray-200 dark:border-gray-700 text-gray-700 dark:text-gray-200 hover:bg-white dark:hover:bg-slate-800 hover:text-gray-900 dark:hover:text-white transition-all duration-300 rounded-lg sm:rounded-xl",children:[(0,s.jsx)(v.Z,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 ".concat(H?"animate-spin":""," sm:mr-2")}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Refresh"})]}),(0,s.jsxs)(u.Vq,{open:q,onOpenChange:$,children:[(0,s.jsx)(u.hg,{asChild:!0,children:(0,s.jsxs)(i.z,{size:"sm",className:"h-8 px-2 sm:px-3 bg-gradient-to-r from-green-500 to-emerald-600 hover:from-green-600 hover:to-emerald-700 shadow-lg shadow-green-500/25 hover:shadow-green-500/40 transition-all duration-300 rounded-lg sm:rounded-xl border-0","data-tour":"campaigns-new",children:[(0,s.jsx)(w.Z,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 sm:mr-2"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"New Campaign"})]})}),(0,s.jsxs)(u.cZ,{className:"max-w-[95vw] sm:max-w-md backdrop-blur-2xl bg-white/90 dark:bg-slate-900/90 border border-white/30 dark:border-white/10 shadow-2xl rounded-xl sm:rounded-2xl p-0 overflow-hidden max-h-[90vh] flex flex-col",children:[(0,s.jsxs)("div",{className:"relative bg-gradient-to-r from-green-500 via-emerald-500 to-teal-500 px-4 sm:px-6 py-4 sm:py-5 flex-shrink-0",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-[url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxjaXJjbGUgY3g9IjIwIiBjeT0iMjAiIHI9IjIiIGZpbGw9InJnYmEoMjU1LDI1NSwyNTUsMC4xKSIvPjwvZz48L3N2Zz4=')] opacity-50"}),(0,s.jsxs)("div",{className:"relative flex items-center gap-2 sm:gap-3",children:[(0,s.jsx)("div",{className:"p-2 sm:p-2.5 bg-white/20 backdrop-blur-sm rounded-lg sm:rounded-xl",children:(0,s.jsx)(j.Z,{className:"h-4 w-4 sm:h-5 sm:w-5 text-white"})}
1),(0,s.jsxs)("div",{children:[(0,s.jsx)(u.$N,{className:"text-base sm:text-lg font-bold text-white",children:"Create New Campaign"}),(0,s.jsx)(u.Be,{className:"text-white/80 text-xs sm:text-sm mt-0.5",children:"Set up a new marketing campaign"})]})]})]}),(0,s.jsxs)("div",{className:"px-4 sm:px-6 py-4 sm:py-5 space-y-3 sm:space-y-4 overflow-y-auto flex-1",children:[(0,s.jsxs)("div",{className:"space-y-1.5 sm:space-y-2",children:[(0,s.jsx)(o._,{htmlFor:"name",className:"text-xs sm:text-sm font-medium text-slate-700 dark:text-slate-300",children:"Campaign Name"}),(0,s.jsx)(d.I,{id:"name",placeholder:"e.g., Summer Sale 2025",value:em.name,onChange:e=>ex({...em,name:e.target.value}),className:"h-9 sm:h-10 rounded-lg bg-slate-50/50 dark:bg-slate-800/50 border-slate-200 dark:border-slate-700 focus:border-green-500 focus:ring-green-500/20 transition-all text-sm"})]}),(0,s.jsxs)("div",{className:"space-y-1.5 sm:space-y-2",children:[(0,s.jsx)(o._,{htmlFor:"type",className:"text-xs sm:text-sm font-medium text-slate-700 dark:text-slate-300",children:"Campaign Type"}),(0,s.jsxs)(g.Ph,{value:em.type,onValueChange:e=>ex({...em,type:e}),children:[(0,s.jsx)(g.i4,{className:"h-9 sm:h-10 rounded-lg bg-slate-50/50 dark:bg-slate-800/50 border-slate-200 dark:border-slate-700 focus:border-green-500 focus:ring-green-500/20 text-sm",children:(0,s.jsx)(g.ki,{placeholder:"Select type"})}),(0,s.jsx)(g.Bw,{className:"rounded-lg backdrop-blur-xl bg-white/95 dark:bg-slate-900/95 border-slate-200 dark:border-slate-700",children:(0,s.jsx)(g.Ql,{value:"email",className:"rounded-md cursor-pointer",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"p-1 bg-blue-100 dark:bg-blue-900/30 rounded",children:(0,s.jsx)(p.Z,{className:"h-3.5 w-3.5 text-blue-600 dark:text-blue-400"})}),(0,s.jsx)("span",{children:"Email"})]})})})]})]}),(0,s.jsxs)("div",{className:"space-y-1.5 sm:space-y-2",children:[(0,s.jsxs)(o._,{htmlFor:"description",className:"text-xs sm:text-sm font-medium text-slate-700 dark:text-slate-300",children:["Description ",(0,s.jsx)("span",{className:"text-slate-400 font-normal",children:"(Optional)"})]}),(0,s.jsx)(h.g,{id:"description",placeholder:"Describe your campaign goals...",value:em.description,onChange:e=>ex({...em,description:e.target.value}
1),className:"min-h-[60px] sm:min-h-[80px] rounded-lg bg-slate-50/50 dark:bg-slate-800/50 border-slate-200 dark:border-slate-700 focus:border-green-500 focus:ring-green-500/20 resize-none transition-all text-sm"})]}),(0,s.jsxs)("div",{className:"space-y-1.5 sm:space-y-2",children:[(0,s.jsx)(o._,{htmlFor:"budget",className:"text-xs sm:text-sm font-medium text-slate-700 dark:text-slate-300",children:"Budget"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400 font-medium text-sm",children:"₹"}),(0,s.jsx)(d.I,{id:"budget",type:"number",placeholder:"0.00",value:em.budget||"",onChange:e=>ex({...em,budget:parseFloat(e.target.value)||0}),className:"h-9 sm:h-10 pl-7 rounded-lg bg-slate-50/50 dark:bg-slate-800/50 border-slate-200 dark:border-slate-700 focus:border-green-500 focus:ring-green-500/20 transition-all text-sm"})]})]})]}),(0,s.jsxs)("div",{className:"px-4 sm:px-6 py-3 sm:py-4 bg-slate-50/50 dark:bg-slate-800/30 border-t border-slate-100 dark:border-slate-800 flex justify-end gap-2 sm:gap-3 flex-shrink-0",children:[(0,s.jsx)(i.z,{variant:"outline",onClick:()=>$(!1),className:"rounded-lg border-slate-200 dark:border-slate-700 hover:bg-slate-100 dark:hover:bg-slate-800 transition-all text-xs sm:text-sm h-8 sm:h-10 px-3 sm:px-4",children:"Cancel"}),(0,s.jsx)(i.z,{onClick:ef,disabled:ee,className:"rounded-lg bg-gradient-to-r from-green-500 to-emerald-500 hover:from-green-600 hover:to-emerald-600 border-0 shadow-lg shadow-green-500/20 hover:shadow-green-500/30 transition-all text-xs sm:text-sm h-8 sm:h-10 px-3 sm:px-4",children:ee?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(N.Z,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 mr-1.5 sm:mr-2 animate-spin"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Creating..."}),(0,s.jsx)("span",{className:"sm:hidden",children:"..."})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(w.Z,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 mr-1.5 sm:mr-2"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Create Campaign"}),(0,s.jsx)("span",{className:"sm:hidden",children:"Create"})]})})]})]})]})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-2 sm:gap-4 animate-[fadeInUp_0.6s_ease-out]","data-tour":"campaigns-stats",children:[(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-xl sm:rounded-2xl p-3 sm:p-5 group hover:scale-[1.02] hover:shadow-2xl transition-all duration-500",style:{background:"linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%)"},children:[(0,s.jsx)("div",{className:"absolute inset-0 opacity-10",style:{backgroundImage:"radial-gradient(circle, white 1px, transparent 1px)",backgroundSize:"16px 16px"}}),(0,s.jsx)("div",{className:"absolute top-2 sm:top-4 right-2 sm:right-4 w-6 sm:w-8 h-6 sm:h-8 rounded-full border border-white/20 animate-pulse"}),(0,s.jsx)("div",{className:"absolute bottom-2 sm:bottom-4 left-2 sm:left-4 w-4 sm:w-6 h-4 sm:h-6 rounded-full bg-white/10"}),(0,s.jsx)("div",{className:"absolute bottom-0 right-0 w-20 sm:w-32 h-20 sm:h-32 bg-emerald-300/30 blur-3xl"}),(0,s.jsxs)("div",{className:"relative flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-[10px] sm:text-xs font-semibold uppercase tracking-wider text-white/80 mb-0.5 sm:mb-1 truncate",children:"Campaigns"}),(0,s.jsx)("p",{className:"text-xl sm:text-3xl font-bold text-white",children:eh.total}),(0,s.jsxs)("p",{className:"text-[10px] sm:text-xs text-white/60 mt-0.5 sm:mt-1 truncate",children:[eh.active," active, ",eh.draft," drafts"]})]}),(0,s.jsx)("div",{className:"w-8 sm:w-12 h-8 sm:h-12 rounded-lg sm:rounded-xl bg-white/20 backdrop-blur flex items-center justify-center group-hover:scale-110 transition-transform duration-300 flex-shrink-0",children:(0,s.jsx)(b.Z,{className:"w-4 sm:w-6 h-4 sm:h-6 text-white"})})]})]}),(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-xl sm:rounded-2xl p-3 sm:p-5 group hover:scale-[1.02] hover:shadow-2xl transition-all duration-500",style:{background:"linear-gradient(135deg, #d1fae5 0%, #a7f3d0 50%, #6ee7b7 100%)"},children:[(0,s.jsx)("div",{className:"absolute inset-0 opacity-10",style:{backgroundImage:"radial-gradient(circle, white 1px, transparent 1px)",backgroundSize:"16px 16px"}}),(0,s.jsx)("div",{className:"absolute top-2 sm:top-4 right-2 sm:right-4 w-6 sm:w-8 h-6 sm:h-8 rounded-full border border-emerald-400/30 animate-pulse"}),(0,s.jsx)("div",{className:"absolute bottom-2 sm:bottom-4 left-2 sm:left-4 w-4 sm:w-6 h-4 sm:h-6 rounded-full bg-emerald-500/10"}),(0,s.jsx)("div",{className:"absolute bottom-0 right-0 w-20 sm:w-32 h-20 sm:h-32 bg-emerald-300/30 blur-3xl"}),(0,s.jsxs)("div",{className:"relative flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-[10px] sm:text-xs font-semibold uppercase tracking-wider text-emerald-700/80 mb-0.5 sm:mb-1 truncate",children:"Total Sent"}),(0,s.jsx)("p",{className:"text-xl sm:text-3xl font-bold text-emerald-900",children:eh.totalSent>=1e3?"".concat((eh.totalSent/1e3).toFixed(1),"K"):eh.totalSent}),(0,s.jsxs)("p",{className:"text-[10px] sm:text-xs text-emerald-700/60 mt-0.5 sm:mt-1 truncate",children:[eh.totalDelivered.toLocaleStr
1ing()," delivered"]})]}),(0,s.jsx)("div",{className:"w-8 sm:w-12 h-8 sm:h-12 rounded-lg sm:rounded-xl bg-emerald-500/20 backdrop-blur flex items-center justify-center group-hover:scale-110 transition-transform duration-300 flex-shrink-0",children:(0,s.jsx)(p.Z,{className:"w-4 sm:w-6 h-4 sm:h-6 text-emerald-600"})})]})]}),(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-xl sm:rounded-2xl p-3 sm:p-5 group hover:scale-[1.02] hover:shadow-2xl transition-all duration-500",style:{background:"linear-gradient(135deg, #16a34a 0%, #22c55e 50%, #4ade80 100%)"},children:[(0,s.jsx)("div",{className:"absolute inset-0 opacity-10",style:{backgroundImage:"radial-gradient(circle, white 1px, transparent 1px)",backgroundSize:"16px 16px"}}),(0,s.jsx)("div",{className:"absolute top-2 sm:top-4 right-2 sm:right-4 w-6 sm:w-8 h-6 sm:h-8 rounded-full border border-white/20 animate-pulse"}),(0,s.jsx)("div",{className:"absolute bottom-2 sm:bottom-4 left-2 sm:left-4 w-4 sm:w-6 h-4 sm:h-6 rounded-full bg-white/10"}),(0,s.jsx)("div",{className:"absolute bottom-0 right-0 w-20 sm:w-32 h-20 sm:h-32 bg-green-300/30 blur-3xl"}),(0,s.jsxs)("div",{className:"relative flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-[10px] sm:text-xs font-semibold uppercase tracking-wider text-white/80 mb-0.5 sm:mb-1 truncate",children:"Delivery Rate"}),(0,s.jsxs)("p",{className:"text-xl sm:text-3xl font-bold text-white",children:[eh.avgDeliveryRate.toFixed(1),"%"]}),(0,s.jsx)("p",{className:"text-[10px] sm:text-xs text-white/60 mt-0.5 sm:mt-1 truncate",children:eh.avgDeliveryRate>=95?"Excellent":eh.avgDeliveryRate>=90?"Good":"Needs attention"})]}),(0,s.jsx)("div",{className:"w-8 sm:w-12 h-8 sm:h-12 rounded-lg sm:rounded-xl bg-white/20 backdrop-blur flex items-center justify-center group-hover:scale-110 transition-transform duration-300 flex-shrink-0",children:(0,s.jsx)(y.Z,{className:"w-4 sm:w-6 h-4 sm:h-6 text-white"})})]})]}),(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-xl sm:rounded-2xl p-3 sm:p-5 group hover:scale-[1.02] hover:shadow-2xl transition-all duration-500",style:{background:"linear-gradient(135deg, #34d399 0%, #10b981 50%, #059669 100%)"},children:[(0,s.jsx)("div",{className:"absolute inset-0 opacity-10",style:{backgroundImage:"radial-gradient(circle, white 1px, transparent 1px)",backgroundSize:"16px 16px"}}),(0,s.jsx)("div",{className:"absolute top-2 sm:top-4 right-2 sm:right-4 w-6 sm:w-8 h-6 sm:h-8 rounded-full border border-white/20 animate-pulse"}),(0,s.jsx)("div",{className:"absolute bottom-2 sm:bottom-4 left-2 sm:left-4 w-4 sm:w-6 h-4 sm:h-6 rounded-full bg-white/10"}),(0,s.jsx)("div",{className:"absolute bottom-0 right-0 w-20 sm:w-32 h-20 sm:h-32 bg-green-300/30 blur-3xl"}),(0,s.jsxs)("div",{className:"relative flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-[10px] sm:text-xs font-semibold uppercase tracking-wider text-white/80 mb-0.5 sm:mb-1 truncate",children:"Open Rate"}),(0,s.jsxs)("p",{className:"text-xl sm:text-3xl font-bold text-white",children:[eh.avgOpenRate.toFixed(1),"%"]}),(0,s.jsx)("p",{className:"text-[10px] sm:text-xs text-white/60 mt-0.5 sm:mt-1 truncate",children:eh.avgOpenRate>=25?"Above average":eh.avgOpenRate>=15?"Average":"Below average"})]}),(0,s.jsx)("div",{className:"w-8 sm:w-12 h-8 sm:h-12 rounded-lg sm:rounded-xl bg-white/20 backdrop-blur flex items-center justify-center group-hover:scale-110 transition-transform duration-300 flex-shrink-0",children:(0,s.jsx)(k.Z,{className:"w-4 sm:w-6 h-4 sm:h-6 text-white"})})]})]}),(0,s.jsxs)("div",{className:"relative overflow-hidden rounded-xl sm:rounded-2xl p-3 sm:p-5 group hover:scale-[1.02] hover:shadow-2xl transition-all duration-500 col-span-2 sm:col-span-1",style:{background:"linear-gradient(135deg, #047857 0%, #065f46 50%, #064e3b 100%)"},children:[(0,s.jsx)("div",{className:"absolute inset-0 opacity-10",style:{backgroundImage:"radial-gradient(circle, white 1px, transparent 1px)",backgroundSize:"16px 16px"}}),(0,s.jsx)("div",{className:"absolute top-2 sm:top-4 right-2 sm:right-4 w-6 sm:w-8 h-6 sm:h-8 rounded-full border border-white/20 animate-pulse"}),(0,s.jsx)("div",{className:"absolute bottom-2 sm:bottom-4 left-2 sm:left-4 w-4 sm:w-6 h-4 sm:h-6 rounded-full bg-white/10"}),(0,s.jsx)("div",{className:"absolute bottom-0 right-0 w-20 sm:w-32 h-20 sm:h-32 bg-emerald-400/30 blur-3xl"}),(0,s.jsxs)("div",{className:"relative flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-[10px] sm:text-xs font-semibold uppercase tracking-wider text-white/80 mb-0.5 sm:mb-1 truncate",children:"Revenue"}),(0,s.jsxs)("p",{className:"text-xl sm:text-3xl font-bold text-white",children:["₹",eh.totalRevenue>=1e3?"".concat((eh.totalRevenue/1e3).toFixed(1),"K"):eh.totalRevenue.toFixed(0)]}),(0,s.jsx)("p",{className:"text-[10px] sm:text-xs text-white/60 mt-0.5 sm:mt-1 truncate",children:"Total attributed"})]}),(0,s.jsx)("div",{className:"w-8 sm:w-12 h-8 sm:h-12 rounded-lg sm:rounded-xl bg-white/20 backdrop-blur flex items-center justify-center group-hover:scale-110 transition-transform duration-300 flex-shrink-0",children:(0,s.jsx)(C.Z,{className:"w-4 sm:w-6 h-4 sm:h-6 text-white"})})]})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 backdrop-blur-xl bg-white/70 dark:bg-slate-900/70 p-2 rounded-xl shadow-sm border border-white/20 dark:border-white/10 animate-[fadeInUp_0.6s_ease-out]",style:O(5),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 sm:hidden",children:[(0,s.jsxs)("div",{className:"relative flex-1","data-tour":"campaigns-search",children:[(0,s.jsx)(_.Z,{className:"absolute left-2.5 top-1/2 transform -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,s.jsx)(d.I,{placeholder:"Search...",value:Q,onChange:e=>X(e.target.value),className:"pl-8 h-8 text-sm bg-white/50 dark:bg-slate-800/50 backdrop-blur-lg border-0 rounded-lg focus:ring-2 focus:ring-green-500/20"})]}),ej.length>0&&(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground whitespace-nowrap",children:[Math.min(en,ej.length),"/",ej.length]})]}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[(0,s.jsx)(m.Tabs,{value:J,onValueChange:K,className:"w-full sm:w-auto overflow-x-auto","data-tour":"campaigns-tabs",children:(0,s.jsxs)(m.TabsList,{className:"bg-slate-100/80 dark:bg-slate-800 p-0.5 sm:p-1 rounded-lg inline-flex min-w-max",children:[(0,s.jsxs)(m.TabsTrigger,{value:"all",className:"rounded-md px-2 sm:px-4 py-1 sm:py-1.5 text-xs sm:text-sm data-[state=active]:bg-white data-[state=active]:shadow-sm dark:data-[state=active]:bg-slate-700 transition-all duration-200",children:["All ",(0,s.jsx)("span",{className:"ml-1 text-[10px] sm:text-xs bg-slate-200 dark:bg-slate-600 px-1 sm:px-1.5 py-0.5 rounded-full",children:eh.total})]}),(0,s.jsxs)(m.TabsTrigger,{value:"active",className:"rounded-md px-2 sm:px-4 py-1 sm:py-1.5 text-xs sm:text-sm data-[state=active]:bg-gradient-to-r data-[state=active]:from-green-500 data-[state=active]:to-emerald-500 data-[state=active]:text-white transition-all duration-200",children:["Active ",(0,s.jsx)("span",{className:"ml-1 text-[10px] sm:text-xs bg-green-600/20 data-[state=active]:bg-white/20 px-1 sm:px-1.5 py-0.5 rounded-full",children:eh.active})]}),(0,s.jsxs)(m.TabsTrigger,{value:"scheduled",className:"rounded-md px-2 sm:px-4 py-1 sm:py-1.5 text-xs sm:text-sm data-[state=active]:bg-gradient-to-r data-[state=active]:from-blue-500 data-[state=active]:to-cyan-500 data-[state=active]:text-white transition-all duration-200",children:[(0,s.jsx)("span",{className:"sm:hidden",children:"Sched"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Scheduled"})," ",(0,s.jsx)("span",{className:"ml-1 text-[10px] sm:text-xs bg-blue-600/20 data-[state=active]:bg-white/20 px-1 sm:px-1.5 py-0.5 rounded-full",children:eh.scheduled})]}),(0,s.jsxs)(m.TabsTrigger,{value:"draft",className:"rounded-md px-2 sm:px-4 py-1 sm:py-1.5 text-xs sm:text-sm data-[state=active]:bg-gradient-to-r data-[state=active]:from-slate-500 data-[state=active]:to-slate-600 data-[state=active]:text-white transition-all duration-200",children:[(0,s.jsx)("span",{className:"sm:hidden",children:"Draft"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Drafts"})," ",(0,s.jsx)("span",{className:"ml-1 text-[10px] sm:text-xs bg-slate-400/20 data-[state=active]:bg-white/20 px-1 sm:px-1.5 py-0.5 rounded-full",children:eh.draft})]}),(0,s.jsxs)(m.TabsTrigger,{value:"completed",className:"rounded-md px-2 sm:px-4 py-1 sm:py-1.5 text-xs sm:text-sm data-[state=active]:bg-gradient-to-r data-[state=active]:from-purple-500 data-[state=active]:to-violet-500 data-[state=active]:text-white transition-all duration-200",children:[(0,s.jsx)("span",{className:"sm:hidden",children:"Done"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Completed"})," ",(0,s.jsx)("span",{className:"ml-1 text-[10px] sm:text-xs bg-purple-600/20 data-[state=active]:bg-white/20 px-1 sm:px-1.5 py-0.5 rounded-full",children:eh.completed})]})]})}),(0,s.jsxs)("div",{className:"hidden sm:flex items-center gap-3",children:[ej.length>0&&(0,s.jsxs)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:["Showing ",(0,s.jsx)("span",{className:"font-semibold text-slate-700 dark:text-slate-300",children:Math.min(en,ej.length)})," of ",(0,s.jsx)("span",{className:"font-semibold text-slate-700 dark:text-slate-300",children:ej.length})]}),(0,s.jsxs)("div",{className:"relative w-48 md:w-64 lg:w-72","data-tour":"campaigns-search",children:[(0,s.jsx)(_.Z,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,s.jsx)(d.I,{placeholder:"Search campaigns...",value:Q,onChange:e=>X(e.target.value),className:"pl-10 h-9 bg-white/50 dark:bg-slate-800/50 backdrop-blur-lg border-0 rounded-lg focus:ring-2 focus:ring-green-500/20"})]})]})]})]}),(0,s.jsx)(n.Zb,{className:"border border-white/20 dark:border-white/10 shadow-lg rounded-xl backdrop-blur-xl bg-white/70 dark:bg-slate-900/70 animate-[fadeInUp_0.6s_ease-out]",style:O(6),"data-tour":"campaigns-table",children:(0,s.jsx)(n.aY,{className:"p-0",children:H?(0,s.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,s.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,s.jsx)("div",{className:"relative",children:(0,s.jsx)("div",{className:"h-12 w-12 rounded-full border-4 border-green-200 dark:border-green-900 border-t-green-500 animate-spin"})}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading c
1ampaigns..."})]})}):W?(0,s.jsxs)("div",{className:"flex flex-col items-center py-20 bg-gradient-to-b from-red-50/50 to-transparent dark:from-red-950/20",children:[(0,s.jsx)("div",{className:"p-4 bg-gradient-to-br from-red-100 to-rose-100 dark:from-red-900/30 dark:to-rose-900/20 rounded-full mb-4",children:(0,s.jsx)(S.Z,{className:"h-8 w-8 text-red-600 dark:text-red-400"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Error Loading Campaigns"}),(0,s.jsx)("p",{className:"text-muted-foreground mb-6",children:W}),(0,s.jsxs)(i.z,{onClick:ep,size:"sm",variant:"outline",className:"rounded-lg",children:[(0,s.jsx)(v.Z,{className:"h-4 w-4 mr-2"}),"Try Again"]})]}):0===ej.length?(0,s.jsxs)("div",{className:"flex flex-col items-center py-20 bg-gradient-to-b from-green-50/30 to-transparent dark:from-green-950/10",children:[(0,s.jsx)("div",{className:"p-4 bg-gradient-to-br from-slate-100 to-green-50 dark:from-slate-800 dark:to-green-900/20 rounded-full mb-4",children:(0,s.jsx)(C.Z,{className:"h-8 w-8 text-green-500"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No Campaigns Found"}),(0,s.jsx)("p",{className:"text-muted-foreground mb-6",children:Q?"No campaigns match your search":"Create your first campaign to get started"}),(0,s.jsxs)(i.z,{onClick:()=>$(!0),size:"sm",className:"rounded-lg bg-gradient-to-r from-green-500 to-emerald-500 hover:from-green-600 hover:to-emerald-600 border-0",children:[(0,s.jsx)(w.Z,{className:"h-4 w-4 mr-2"}),"Create Campaign"]})]}):(0,s.jsxs)("div",{className:"overflow-x-auto",children:[(0,s.jsxs)(x.iA,{children:[(0,s.jsx)(x.xD,{children:(0,s.jsxs)(x.SC,{className:"bg-gradient-to-r from-slate-100/80 via-green-50/20 to-slate-100/80 dark:from-slate-900 dark:via-green-900/10 dark:to-slate-800 border-b-2 border-slate-200 dark:border-slate-700",children:[(0,s.jsx)(x.ss,{className:"min-w-[200px] sm:w-[300px] font-semibold text-slate-700 dark:text-slate-300 py-4",children:"Campaign"}),(0,s.jsx)(x.ss,{className:"font-semibold text-slate-700 dark:text-slate-300 hidden sm:table-cell",children:"Type"}),(0,s.jsx)(x.ss,{className:"font-semibold text-slate-700 dark:text-slate-300",children:"Status"}),(0,s.jsx)(x.ss,{className:"text-right font-semibold text-slate-700 dark:text-slate-300 hidden md:table-cell",children:"Recipients"}),(0,s.jsx)(x.ss,{className:"text-right font-semibold text-slate-700 dark:text-slate-300 hidden lg:table-cell",children:"Delivered"}),(0,s.jsx)(x.ss,{className:"text-right font-semibold text-slate-700 dark:text-slate-300 hidden lg:table-cell",children:"Opened"}),(0,s.jsx)(x.ss,{className:"text-right font-semibold text-slate-700 dark:text-slate-300 hidden xl:table-cell",children:"Clicked"}),(0,s.jsx)(x.ss,{className:"text-right font-semibold text-slate-700 dark:text-slate-300 hidden md:table-cell",children:"Open Rate"}),(0,s.jsx)(x.ss,{className:"text-right font-semibold text-slate-700 dark:text-slate-300 hidden xl:table-cell",children:"Click Rate"}),(0,s.jsx)(x.ss,{className:"text-center font-semibold text-slate-700 dark:text-slate-300 w-[80px] sm:w-[120px]",children:"Actions"})]})}),(0,s.jsx)(x.RM,{children:eN.map((e,a)=>{var r,l,n,d,o,m,u,g,h,p,f,b,v;return(0,s.jsxs)(x.SC,{onClick:()=>t.push("/dashboard/campaigns/".concat(e.id)),className:"\n                          cursor-pointer transition-all duration-200\n                          hover:bg-gradient-to-r hover:from-green-50/40 hover:via-white hover:to-green-50/40\n                          dark:hover:from-green-950/10 dark:hover:via-slate-900 dark:hover:to-green-950/10\n                          hover:shadow-md\n                          ".concat(a%2==0?"bg-white/60 dark:bg-slate-950/60":"bg-slate-50/60 dark:bg-slate-900/60","\n                          border-b border-slate-100 dark:border-slate-800\n                          group backdrop-blur-sm\n                        "),children:[(0,s.jsx)(x.pj,{className:"py-4",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"\n                              w-10 h-10 rounded-lg flex items-center justify-center shrink-0 shadow-md transition-all duration-300 group-hover:scale-105\n                              ".concat("active"===e.status?"bg-gradient-to-br from-green-400 to-emerald-500 shadow-green-500/20":"scheduled"===e.status?"bg-gradient-to-br from-blue-400 to-cyan-500 shadow-blue-500/20":"completed"===e.status?"bg-gradient-to-br from-purple-400 to-violet-500 shadow-purple-500/20":"bg-gradient-to-br from-slate-300 to-slate-400 dark:from-slate-700 dark:to-slate-600","\n                            "),children:ek(e.type)}),(0,s.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,s.jsx)("span",{className:"font-semibold text-slate-900 dark:text-white group-hover:text-green-600 dark:group-hover:text-green-400 transition-colors truncate",children:e.name}),e.description&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground truncate max-w-[220px]",children:e.description})]})]})}),(0,s.jsx)(x.pj,{className:"hidden sm:table-cell",children:(0,s.jsx)("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-slate-100/80 dark:bg-slate-800/80 backdrop-blur-sm rounded-md w-fit",children:(0,s.jsx)("span",{className:"capitalize text-sm font-medium",children:e.type})})}),(0,s.jsx)(x.pj,{children:(0,s.jsx)(c.C,{className:"\n                              text-xs font-semibold px-3 py-1 rounded-full border-0 shadow-sm transition-all duration-300 group-hover:scale-105\n                              ".concat("active"===e.status?"bg-gradient-to-r from-green-500 to-emerald-500 text-white shadow-green-500/20":"scheduled"===e.status?"bg-gradient-to-r from-blue-500 to-cyan-500 text-white shadow-blue-500/20":"completed"===e.status?"bg-gradient-to-r from-purple-500 to-violet-500 text-white shadow-purple-500/20":"paused"===e.status?"bg-gradient-to-r from-red-500 to-rose-500 text-white shadow-red-500/20":"bg-gradient-to-r from-slate-400 to-slate-500 text-white","\n                            "),children:e.status})}),(0,s.jsx)(x.pj,{className:"text-right hidden md:table-cell",children:(0,s.jsx)("span",{className:"font-bold text-slate-900 dark:text-white text-base",children:(null===(l=e.email_stats)||void 0===l?void 0:null===(r=l.total_recipients)||void 0===r?void 0:r.toLocaleStr
1ing())||(null===(n=e.impressions)||void 0===n?void 0:n.toLocaleString())||"-"})}),(0,s.jsx)(x.pj,{className:"text-right hidden lg:table-cell",children:(0,s.jsxs)("div",{className:"flex flex-col items-end",children:[(0,s.jsx)("span",{className:"font-bold text-green-600 dark:text-green-400 text-base",children:(null===(o=e.email_stats)||void 0===o?void 0:null===(d=o.messages_delivered)||void 0===d?void 0:d.toLocaleString())||"-"}),(null===(m=e.email_stats)||void 0===m?void 0:m.delivery_rate)!==void 0&&(0,s.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:[e.email_stats.delivery_rate,"%"]})]})}),(0,s.jsx)(x.pj,{className:"text-right hidden lg:table-cell",children:(0,s.jsx)("div",{className:"flex flex-col items-end",children:(0,s.jsx)("span",{className:"font-bold text-purple-600 dark:text-purple-400 text-base",children:(null===(g=e.email_stats)||void 0===g?void 0:null===(u=g.messages_read)||void 0===u?void 0:u.toLocaleString())||"-"})})}),(0,s.jsx)(x.pj,{className:"text-right hidden xl:table-cell",children:(0,s.jsx)("span",{className:"font-bold text-orange-600 dark:text-orange-400 text-base",children:(null===(p=e.email_stats)||void 0===p?void 0:null===(h=p.clicks)||void 0===h?void 0:h.toLocaleString())||(null===(f=e.clicks)||void 0===f?void 0:f.toLocaleString())||"-"})}),(0,s.jsx)(x.pj,{className:"text-right hidden md:table-cell",children:(null===(b=e.email_stats)||void 0===b?void 0:b.open_rate)!==void 0?(0,s.jsxs)("div",{className:"\n                              inline-flex items-center justify-center px-2.5 py-1 rounded-md text-sm font-bold\n                              ".concat(e.email_stats.open_rate>=25?"bg-gradient-to-r from-green-500/20 to-emerald-500/20 text-green-700 dark:text-green-400":e.email_stats.open_rate>=15?"bg-gradient-to-r from-yellow-500/20 to-amber-500/20 text-yellow-700 dark:text-yellow-400":"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400","\n                            "),children:[e.email_stats.open_rate,"%"]}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"})}),(0,s.jsx)(x.pj,{className:"text-right hidden xl:table-cell",children:(null===(v=e.email_stats)||void 0===v?void 0:v.click_rate)!==void 0?(0,s.jsxs)("div",{className:"\n                              inline-flex items-center justify-center px-2.5 py-1 rounded-md text-sm font-bold\n                              ".concat(e.email_stats.click_rate>=5?"bg-gradient-to-r from-green-500/20 to-emerald-500/20 text-green-700 dark:text-green-400":e.email_stats.click_rate>=2?"bg-gradient-to-r from-yellow-500/20 to-amber-500/20 text-yellow-700 dark:text-yellow-400":"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400","\n                            "),children:[e.email_stats.click_rate,"%"]}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"})}),(0,s.jsx)(x.pj,{onClick:e=>e.stopPropagation(),children:(0,s.jsxs)("div",{className:"flex items-center justify-center gap-1",children:["active"===e.status&&(0,s.jsx)(i.z,{size:"icon",variant:"ghost",className:"h-8 w-8 rounded-lg hover:bg-gradient-to-br hover:from-red-100 hover:to-rose-100 hover:text-red-600 dark:hover:from-red-900/30 dark:hover:to-rose-900/20 transition-all duration-200",onClick:t=>{t.stopPropagation(),eb(e.id,"paused")},title:"Pause Campaign",children:(0,s.jsx)(R.Z,{className:"h-4 w-4"})}),("draft"===e.status||"paused"===e.status)&&(0,s.jsx)(i.z,{size:"icon",variant:"ghost",className:"h-8 w-8 rounded-lg hover:bg-gradient-to-br hover:from-green-100 hover:to-emerald-100 hover:text-green-600 dark:hover:from-green-900/30 dark:hover:to-emerald-900/20 transition-all duration-200",onClick:t=>{t.stopPropagation(),eb(e.id,"active")},title:"Launch Campaign",children:(0,s.jsx)(Z.Z,{className:"h-4 w-4"})}),(0,s.jsx)(i.z,{size:"icon",variant:"ghost",className:"h-8 w-8 rounded-lg hover:bg-gradient-to-br hover:from-green-100 hover:to-emerald-100 hover:text-green-600 dark:hover:from-green-900/30 dark:hover:to-emerald-900/20 transition-all duration-200",onClick:a=>{a.stopPropagation(),t.push("/dashboard/campaigns/".concat(e.id))},title:"View Details",children:(0,s.jsx)(z.Z,{className:"h-4 w-4"})}),(0,s.jsx)(i.z,{size:"icon",variant:"ghost",className:"h-8 w-8 rounded-lg hover:bg-red-100 hover:text-red-600 dark:hover:bg-red-900/30",onClick:t=>{t.stopPropagation(),ew(e.id,e.name)},title:"Delete Campaign",children:(0,s.jsx)(T.Z,{className:"h-4 w-4"})})]})})]},e.id)})})]}),(0,s.jsxs)("div",{ref:ec,className:"py-4",children:[ed&&(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 py-3",children:[(0,s.jsx)("div",{className:"h-5 w-5 rounded-full border-2 border-green-200 border-t-green-500 animate-spin"}),(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:"Loading more campaigns..."})]}),!ey&&eN.length>0&&eN.length>=30&&(0,s.jsx)("div",{className:"flex items-center justify-center py-3",children:(0,s.jsxs)("span",{className:"text-sm text-muted-foreground",children:["All ",ej.length," campaigns loaded"]})})]})]})})})]})]})}},52217:function(e,t,a){a.d(t,{Z:function(){return u}});var s=a(57437),r=a(27648),l=a(99376),n=a(93448),i=a(46221),d=a(56439),o=a(95805),c=a(90740),m=a(89345);let x=[{name:"Analytics",href:"/dashboard/campaigns/analytics",icon:i.Z},{name:"Campaigns",href:"/dashboard/campaigns",icon:d.Z,exact:!0},{name:"Contacts",href:"/dashboard/campaigns/contacts",icon:o.Z},{name:"Segments",href:"/dashboard/campaigns/segments",icon:c.Z},{name:"Templates",href:"/dashboard/campaigns/templates",icon:m.Z}];function u(){let e=(0,l.usePathname)(),t=t=>t.exact?e===t.href:e.startsWith(t.href);return(0,s.jsx)("nav",{className:"border-b mb-6",children:(0,s.jsx)("div",{className:"flex space-x-1 overflow-x-auto",children:x.map(e=>{let a=e.icon,l=t(e);return(0,s.jsxs)(r.default,{href:e.href,className:(0,n.cn)("flex items-center gap-2 px-4 py-2.5 text-sm font-medium border-b-2 transition-colors whitespace-nowrap",l?"border-green-500 text-green-600":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground
1/30"),children:[(0,s.jsx)(a,{className:"h-4 w-4"}),e.name]},e.href)})})})}},79820:function(e,t,a){a.d(t,{Ol:function(){return i},SZ:function(){return o},Zb:function(){return n},aY:function(){return c},eW:function(){return m},ll:function(){return d}});var s=a(57437),r=a(2265),l=a(93448);let n=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:(0,l.cn)("rounded-[4px] border bg-card text-card-foreground shadow",a),...r})});n.displayName="Card";let i=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:(0,l.cn)("flex flex-col space-y-1.5 p-6",a),...r})});i.displayName="CardHeader";let d=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:(0,l.cn)("font-display font-semibold leading-none tracking-tight",a),...r})});d.displayName="CardTitle";let o=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",a),...r})});o.displayName="CardDescription";let c=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:(0,l.cn)("p-6 pt-0",a),...r})});c.displayName="CardContent";let m=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:(0,l.cn)("flex items-center p-6 pt-0",a),...r})});m.displayName="CardFooter"},74291:function(e,t,a){a.d(t,{$N:function(){return h},Be:function(){return p},Vq:function(){return d},cN:function(){return g},cZ:function(){return x},fK:function(){return u},hg:function(){return o}});var s=a(57437),r=a(2265),l=a(49027),n=a(93448),i=a(20653);let d=l.fC,o=l.xz,c=l.h_;l.x8;let m=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.aV,{ref:t,className:(0,n.cn)("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...r})});m.displayName=l.aV.displayName;let x=r.forwardRef((e,t)=>{let{className:a,children:r,overlayClassName:d,...o}=e;return(0,s.jsxs)(c,{children:[(0,s.jsx)(m,{className:d}),(0,s.jsxs)(l.VY,{ref:t,className:(0,n.cn)("fixed left-[50%] top-[50%] z-50 translate-x-[-50%] translate-y-[-50%] border bg-background shadow-lg duration-200","w-[calc(100%-1rem)] xs:w-[calc(100%-2rem)] sm:w-full max-w-lg","p-4 sm:p-6","max-h-[90vh] sm:max-h-[85vh]","rounded-lg sm:rounded-lg","flex flex-col","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",a),...o,children:[r,(0,s.jsxs)(l.x8,{className:"absolute right-3 top-3 sm:right-4 sm:top-4 z-50 rounded-full opacity-70 ring-offset-background transition-all hover:opacity-100 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground bg-white dark:bg-gray-900 shadow-md border border-gray-200 dark:border-gray-700 p-1.5",children:[(0,s.jsx)(i.Pxu,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});x.displayName=l.VY.displayName;let u=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,n.cn)("flex flex-col space-y-1.5 text-center sm:text-left flex-shrink-0",t),...a})};u.displayName="DialogHeader";let g=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 flex-shrink-0 mt-4",t),...a})};g.displayName="DialogFooter";let h=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.Dx,{ref:t,className:(0,n.cn)("font-display text-lg font-semibold leading-none tracking-tight",a),...r})});h.displayName=l.Dx.displayName;let p=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.dk,{ref:t,className:(0,n.cn)("text-sm text-muted-foreground",a),...r})});p.displayName=l.dk.displayName},75060:function(e,t,a){a.d(t,{_:function(){return o}});var s=a(57437),r=a(2265),l=a(6394),n=a(90535),i=a(93448);let d=(0,n.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),o=r.forwardRef((e,t)=>
1{let{className:a,...r}=e;return(0,s.jsx)(l.f,{ref:t,className:(0,i.cn)(d(),a),...r})});o.displayName=l.f.displayName},15291:function(e,t,a){a.d(t,{Bw:function(){return u},DI:function(){return c},Ph:function(){return o},Ql:function(){return h},i4:function(){return x},ki:function(){return m},n5:function(){return g}});var s=a(57437),r=a(2265),l=a(56873),n=a(40875),i=a(30401),d=a(93448);let o=l.fC,c=l.ZA,m=l.B4,x=r.forwardRef((e,t)=>{let{className:a,children:r,...i}=e;return(0,s.jsxs)(l.xz,{ref:t,className:(0,d.cn)("flex h-10 w-full items-center justify-between rounded-[4px] border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 dark:text-gray-100 px-3 py-2 text-sm ring-offset-white dark:ring-offset-gray-950 placeholder:text-gray-500 dark:placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-gray-950 dark:focus:ring-gray-300 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),...i,children:[r,(0,s.jsx)(l.JO,{asChild:!0,children:(0,s.jsx)(n.Z,{className:"h-4 w-4 opacity-50"})})]})});x.displayName=l.xz.displayName;let u=r.forwardRef((e,t)=>{let{className:a,children:r,position:n="popper",...i}=e;return(0,s.jsx)(l.h_,{children:(0,s.jsx)(l.VY,{ref:t,className:(0,d.cn)("relative z-50 min-w-[8rem] overflow-hidden rounded-[4px] border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-950 dark:text-gray-100 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:n,...i,children:(0,s.jsx)(l.l_,{className:(0,d.cn)("p-1 max-h-[300px] overflow-y-auto","popper"===n&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});u.displayName=l.VY.displayName;let g=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.__,{ref:t,className:(0,d.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...r})});g.displayName=l.__.displayName;let h=r.forwardRef((e,t)=>{let{className:a,children:r,...n}=e;return(0,s.jsxs)(l.ck,{ref:t,className:(0,d.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-gray-100 dark:focus:bg-gray-700 focus:text-gray-900 dark:focus:text-gray-100 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...n,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(l.wU,{children:(0,s.jsx)(i.Z,{className:"h-4 w-4"})})}),(0,s.jsx)(l.eT,{children:r})]})});h.displayName=l.ck.displayName,r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.Z0,{ref:t,className:(0,d.cn)("-mx-1 my-1 h-px bg-gray-100 dark:bg-gray-700",a),...r})}).displayName=l.Z0.displayName},33804:function(e,t,a){a.d(t,{RM:function(){return d},SC:function(){return o},iA:function(){return n},pj:function(){return m},ss:function(){return c},xD:function(){return i}});var s=a(57437),r=a(2265),l=a(93448);let n=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{className:"relative w-full overflow-auto",children:(0,s.jsx)("table",{ref:t,className:(0,l.cn)("w-full caption-bottom text-sm",a),...r})})});n.displayName="Table";let i=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("thead",{ref:t,className:(0,l.cn)("[&_tr]:border-b",a),...r})});i.displayName="TableHeader";let d=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("tbody",{ref:t,className:(0,l.cn)("[&_tr:last-child]:border-0",a),...r})});d.displayName="TableBody",r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("tfoot",{ref:t,className:(0,l.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",a),...r})}).displayName="TableFooter";let o=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("tr",{ref:t,className:(0,l.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",a),...r})});o.displayName="TableRow";
1let c=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("th",{ref:t,className:(0,l.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",a),...r})});c.displayName="TableHead";let m=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("td",{ref:t,className:(0,l.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",a),...r})});m.displayName="TableCell",r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("caption",{ref:t,className:(0,l.cn)("mt-4 text-sm text-muted-foreground",a),...r})}).displayName="TableCaption"},17168:function(e,t,a){a.d(t,{Tabs:function(){return i},TabsContent:function(){return c},TabsList:function(){return d},TabsTrigger:function(){return o}});var s=a(57437),r=a(2265),l=a(20271),n=a(93448);let i=l.fC,d=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.aV,{ref:t,className:(0,n.cn)("inline-flex h-10 items-center justify-center rounded-[4px] bg-gray-100 dark:bg-gray-800 p-1 text-gray-500 dark:text-gray-400",a),...r})});d.displayName=l.aV.displayName;let o=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.xz,{ref:t,className:(0,n.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-white dark:ring-offset-gray-950 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-950 dark:focus-visible:ring-gray-300 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-white dark:data-[state=active]:bg-gray-900 data-[state=active]:text-gray-950 dark:data-[state=active]:text-gray-100 data-[state=active]:shadow-sm",a),...r})});o.displayName=l.xz.displayName;let c=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(l.VY,{ref:t,className:(0,n.cn)("mt-2 ring-offset-white dark:ring-offset-gray-950 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-950 dark:focus-visible:ring-gray-300 focus-visible:ring-offset-2",a),...r})});c.displayName=l.VY.displayName},23675:function(e,t,a){a.d(t,{g:function(){return n}});var s=a(57437),r=a(2265),l=a(93448);let n=r.forwardRef((e,t)=>{let{className:a,error:r,...n}=e;return(0,s.jsx)("textarea",{"aria-invalid":r?"true":void 0,className:(0,l.cn)("flex min-h-[80px] w-full rounded-[4px] border border-input bg-background px-3 py-2 text-sm r
1ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r&&"border-red-500 focus-visible:ring-red-500",a),ref:t,...n})});n.displayName="Textarea"},9310:function(e,t,a){a.d(t,{H:function(){return d},K:function(){return i}});var s=a(57437),r=a(2265),l=a(99376);let n=(0,r.createContext)(void 0);function i(e){let{children:t}=e,[a,i]=(0,r.useState)(!1),d=(0,l.useRouter)(),o=(0,l.usePathname)(),c=(0,r.useRef)(o),m=(0,r.useRef)(null),x=(0,r.useCallback)(()=>{m.current&&(clearTimeout(m.current),m.current=null)},[]),u=(0,r.useCallback)(()=>{x(),i(!0),m.current=setTimeout(()=>{i(!1)},4e3)},[x]),g=(0,r.useCallback)(()=>{x(),i(!1)},[x]),h=(0,r.useCallback)(e=>{e!==o&&(u(),d.push(e))},[d,o,u]);return(0,r.useEffect)(()=>(o!==c.current&&(c.current=o),()=>x()),[o,x]),(0,s.jsx)(n.Provider,{value:{isNavigating:a,startNavigation:u,endNavigation:g,navigateTo:h},children:t})}function d(){let e=(0,r.useContext)(n);if(!e)throw Error("useNavigation must be used within a NavigationProvider");return e}}}]);

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.