(()=>{var e={};e.id=3965,e.ids=[3965],e.modules={53524:e=>{"use strict";e.exports=require("@prisma/client")},47849:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external")},72934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},55403:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external")},54580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},94749:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external")},45869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},50852:e=>{"use strict";e.exports=require("async_hooks")},32081:e=>{"use strict";e.exports=require("child_process")},82361:e=>{"use strict";e.exports=require("events")},57147:e=>{"use strict";e.exports=require("fs")},73292:e=>{"use strict";e.exports=require("fs/promises")},22037:e=>{"use strict";e.exports=require("os")},71017:e=>{"use strict";e.exports=require("path")},76224:e=>{"use strict";e.exports=require("tty")},73837:e=>{"use strict";e.exports=require("util")},97114:(e,t,s)=>{"use strict";s.r(t),s.d(t,{GlobalError:()=>i.ZP,__next_app__:()=>x,originalPathname:()=>o,pages:()=>c,routeModule:()=>p,tree:()=>d});var r=s(50482),a=s(69108),i=s(83543),l=s(68300),n={};for(let e in l)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(n[e]=()=>l[e]);s.d(t,n);let d=["",{children:["admin",{children:["leads",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,8951)),"C:\\test2\\pagecraft-ai\\src\\app\\admin\\leads\\page.tsx"]}]},{loading:[()=>Promise.resolve().then(s.bind(s,51832)),"C:\\test2\\pagecraft-ai\\src\\app\\admin\\leads\\loading.tsx"]}]},{layout:[()=>Promise.resolve().then(s.bind(s,82050)),"C:\\test2\\pagecraft-ai\\src\\app\\admin\\layout.tsx"],loading:[()=>Promise.resolve().then(s.bind(s,98338)),"C:\\test2\\pagecraft-ai\\src\\app\\admin\\loading.tsx"]}]},{layout:[()=>Promise.resolve().then(s.bind(s,43625)),"C:\\test2\\pagecraft-ai\\src\\app\\layout.tsx"],error:[()=>Promise.resolve().then(s.bind(s,24117)),"C:\\test2\\pagecraft-ai\\src\\app\\error.tsx"],"not-found":[()=>Promise.resolve().then(s.bind(s,48206)),"C:\\test2\\pagecraft-ai\\src\\app\\not-found.tsx"]}],c=["C:\\test2\\pagecraft-ai\\src\\app\\admin\\leads\\page.tsx"],o="/admin/leads/page",x={require:s,loadChunk:()=>Promise.resolve()},p=new r.AppPageRouteModule({definition:{kind:a.x.APP_PAGE,page:"/admin/leads/page",pathname:"/admin/leads",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},28794:(e,t,s)=>{Promise.resolve().then(s.bind(s,84670))},88534:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]])},63024:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},80895:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]])},33037:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]])},67711:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]])},71532:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},97751:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},85674:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]])},96885:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},42739:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},38852:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},27860:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]])},40626:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]])},15366:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]])},28240:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]])},32817:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]])},89895:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},84670:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>h});var r=s(95344),a=s(3729),i=s(66543),l=s(9885),n=s(96885),d=s(42739),c=s(71206),o=s(40626),x=s(38852),p=s(11453);function h(){let{lang:e}=(0,l.Z)(),t="ar"===e,[s,h]=(0,a.useState)(""),[m,u]=(0,a.useState)(""),y=(()=>{let e=new URLSearchParams;s&&e.set("from",s),m&&e.set("to",m);let t=e.toString();return`/api/admin/leads${t?`?${t}`:""}`})(),{data:g=[],isLoading:v,mutate:f}=(0,i.ZP)(y);return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-6",children:[(0,r.jsxs)("div",{children:[r.jsx("h1",{className:"text-2xl font-bold text-white",children:t?"العملاء المحتملون":"Leads"}),r.jsx("p",{className:"text-sm text-gray-400",children:t?`${g.length} عميل محتمل`:`${g.length} leads`})]}),(0,r.jsxs)("a",{href:"/api/admin/export?type=leads",className:"flex items-center gap-2 px-4 py-2 text-sm border rounded-lg border-white/[0.1] text-gray-400 hover:text-white hover:bg-white/[0.06] transition-colors",children:[r.jsx(n.Z,{className:"h-4 w-4"}),t?"تصدير CSV":"Export CSV"]})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-3 mb-6 items-end",children:[(0,r.jsxs)("div",{children:[r.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:t?"من":"From"}),r.jsx("input",{type:"date",value:s,onChange:e=>h(e.target.value),className:"border rounded-lg px-3 py-2 text-sm bg-white/[0.03] border-white/[0.08] text-white"})]}),(0,r.jsxs)("div",{children:[r.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:t?"إلى":"To"}),r.jsx("input",{type:"date",value:m,onChange:e=>u(e.target.value),className:"border rounded-lg px-3 py-2 text-sm bg-white/[0.03] border-white/[0.08] text-white"})]}),r.jsx("button",{onClick:()=>f(),className:"px-4 py-2 bg-indigo-500 text-white rounded-lg text-sm font-medium hover:bg-indigo-400 transition-colors",children:t?"تطبيق":"Apply"}),(s||m)&&r.jsx("button",{onClick:()=>{h(""),u("")},className:"px-3 py-2 text-sm text-gray-500 hover:text-gray-300",children:t?"إعادة تعيين":"Reset"})]}),v?r.jsx("div",{className:"flex justify-center py-12",children:r.jsx(d.Z,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):0===g.length?r.jsx("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.03] p-4",children:r.jsx("div",{className:"text-center py-12 text-gray-500",children:t?"لا يوجد عملاء محتملون":"No leads found"})}):r.jsx("div",{className:"grid gap-3",children:g.map(e=>r.jsx("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.03] p-4",children:(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx(c.Z,{className:"h-4 w-4 text-indigo-400"}),r.jsx("span",{className:"font-medium text-white",children:e.email})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-sm text-gray-400",children:[e.name&&r.jsx("span",{children:e.name}),e.phone&&(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[r.jsx(o.Z,{className:"h-3 w-3"}),e.phone]})]}),e.message&&(0,r.jsxs)("p",{className:"text-sm text-gray-500 mt-2 flex items-start gap-1",children:[r.jsx(x.Z,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),r.jsx("span",{className:"line-clamp-2",children:e.message})]})]}),(0,r.jsxs)("div",{className:"text-right text-xs text-gray-500 space-y-1 shrink-0",children:[r.jsx("div",{className:"font-medium text-gray-300",children:e.page.title}),(0,r.jsxs)("div",{children:["/p/",e.page.slug]}),(0,r.jsxs)("div",{children:[t?"المالك:":"Owner:"," ",e.page.user.email]}),r.jsx("div",{children:(0,p.p)(e.createdAt)})]})]})},e.id))})]})}},11453:(e,t,s)=>{"use strict";s.d(t,{cn:()=>i,p:()=>l});var r=s(56815),a=s(79377);function i(...e){return(0,a.m6)((0,r.W)(e))}function l(e){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(new Date(e))}},51832:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});var r=s(25036);function a(){return(0,r.jsxs)("div",{className:"animate-pulse",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,r.jsxs)("div",{children:[r.jsx("div",{className:"h-7 w-48 bg-white/[0.06] rounded mb-2"}),r.jsx("div",{className:"h-4 w-24 bg-white/[0.06] rounded"})]}),r.jsx("div",{className:"h-10 w-32 bg-white/[0.06] rounded"})]}),(0,r.jsxs)("div",{className:"flex gap-3 mb-6",children:[r.jsx("div",{className:"h-10 w-36 bg-white/[0.06] rounded"}),r.jsx("div",{className:"h-10 w-36 bg-white/[0.06] rounded"}),r.jsx("div",{className:"h-10 w-20 bg-white/[0.06] rounded"})]}),r.jsx("div",{className:"space-y-3",children:[1,2,3,4].map(e=>r.jsx("div",{className:"h-28 rounded-2xl border border-white/[0.06] bg-white/[0.03]"},e))})]})}},8951:(e,t,s)=>{"use strict";s.r(t),s.d(t,{$$typeof:()=>i,__esModule:()=>a,default:()=>l});let r=(0,s(86843).createProxy)(String.raw`C:\test2\pagecraft-ai\src\app\admin\leads\page.tsx`),{__esModule:a,$$typeof:i}=r,l=r.default}};var t=require("../../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),r=t.X(0,[1638,5312,3207,6632,3910,9043],()=>s(97114));module.exports=r})();