(()=>{var e={};e.id=9327,e.ids=[9327],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")},66936:(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 a=s(50482),r=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:["pages",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,84863)),"C:\\test2\\pagecraft-ai\\src\\app\\admin\\pages\\page.tsx"]}]},{loading:[()=>Promise.resolve().then(s.bind(s,10314)),"C:\\test2\\pagecraft-ai\\src\\app\\admin\\pages\\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\\pages\\page.tsx"],o="/admin/pages/page",x={require:s,loadChunk:()=>Promise.resolve()},p=new a.AppPageRouteModule({definition:{kind:r.x.APP_PAGE,page:"/admin/pages/page",pathname:"/admin/pages",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},84025:(e,t,s)=>{Promise.resolve().then(s.bind(s,79464))},88534:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(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:()=>a});/**
 * @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 a=(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:()=>a});/**
 * @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 a=(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:()=>a});/**
 * @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 a=(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:()=>a});/**
 * @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 a=(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"}]])},7060:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(0,s(69224).Z)("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},71532:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(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:()=>a});/**
 * @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 a=(0,s(69224).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},25545:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(0,s(69224).Z)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},85674:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(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"}]])},2768:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(0,s(69224).Z)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},53148:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(0,s(69224).Z)("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},42739:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(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:()=>a});/**
 * @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 a=(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:()=>a});/**
 * @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 a=(0,s(69224).Z)("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]])},15366:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(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:()=>a});/**
 * @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 a=(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:()=>a});/**
 * @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 a=(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:()=>a});/**
 * @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 a=(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"}]])},73229:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(0,s(69224).Z)("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},79464:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>w});var a=s(95344),r=s(3729),i=s(9885),l=s(7060),n=s(28765),d=s(42739),c=s(38852),o=s(53148),x=s(2768),p=s(73229),m=s(25545),h=s(14513),u=s(11453),g=s(66543);let y=[{key:"all",label:{en:"All",ar:"الكل"}},{key:"PENDING",label:{en:"Pending",ar:"قيد الانتظار"}},{key:"IN_REVIEW",label:{en:"In Review",ar:"قيد المراجعة"}},{key:"APPROVED",label:{en:"Approved",ar:"معتمدة"}},{key:"REJECTED",label:{en:"Rejected",ar:"مرفوضة"}}],b={pageTitle:{en:"Content Management",ar:"إدارة المحتوى"},subtitle:{en:"Review and manage all pages",ar:"مراجعة وإدارة جميع الصفحات"},approveTitle:{en:"Approve Page",ar:"اعتماد الصفحة"},rejectTitle:{en:"Reject Page",ar:"رفض الصفحة"},noteLabel:{en:"Review Note (optional)",ar:"ملاحظة المراجعة (اختياري)"},notePlaceholder:{en:"Add a note for the page owner...",ar:"أضف ملاحظة لمالك الصفحة..."},confirm:{en:"Confirm",ar:"تأكيد"},cancel:{en:"Cancel",ar:"إلغاء"},noPages:{en:"No pages found",ar:"لا يوجد صفحات"},search:{en:"Search",ar:"بحث"},searchPlaceholder:{en:"Search by title or slug...",ar:"بحث بالعنوان أو الـ slug..."},title:{en:"Title",ar:"العنوان"},owner:{en:"Owner",ar:"المالك"},pageStatus:{en:"Page Status",ar:"حالة الصفحة"},reviewStatus:{en:"Review Status",ar:"حالة المراجعة"},views:{en:"Views",ar:"المشاهدات"},leads:{en:"Leads",ar:"العملاء"},created:{en:"Created",ar:"تاريخ الإنشاء"},actions:{en:"Actions",ar:"الإجراءات"}};function v(e,t){return t?e.ar:e.en}function w(){let{lang:e}=(0,i.Z)(),t="ar"===e,[s,w]=(0,r.useState)(""),[f,j]=(0,r.useState)(""),[N,k]=(0,r.useState)("all"),[P,Z]=(0,r.useState)(!1),[E,C]=(0,r.useState)("APPROVED"),[R,q]=(0,r.useState)(""),[S,A]=(0,r.useState)(""),[M,_]=(0,r.useState)(""),[D,T]=(0,r.useState)(!1),[V,I]=(0,r.useState)(""),O=new URLSearchParams;f&&O.set("search",f),"all"!==N&&O.set("reviewStatus",N);let $=O.toString(),z=`/api/admin/pages${$?`?${$}`:""}`,{data:L=[],isLoading:H,mutate:F}=(0,g.ZP)(z),J=()=>j(s),U=e=>({PUBLISHED:"bg-green-500/10 text-green-400",DRAFT:"bg-yellow-500/10 text-yellow-400",ARCHIVED:"bg-white/[0.05] text-gray-400"})[e]||"bg-white/[0.05] text-gray-400",G=e=>({PENDING:"bg-yellow-500/10 text-yellow-400",IN_REVIEW:"bg-blue-500/10 text-blue-400",APPROVED:"bg-green-500/10 text-green-400",REJECTED:"bg-red-500/10 text-red-400"})[e]||"bg-white/[0.05] text-gray-400",W=(e,t,s)=>{q(e),A(t),C(s),_(""),Z(!0)},B=()=>{Z(!1),q(""),A(""),_("")},X=async(e,s,a)=>{T(!0);try{let r=await fetch("/api/admin/pages/review",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({pageId:e,reviewStatus:s,reviewNote:a||null})});if(!r.ok){let e=await r.json().catch(()=>null);alert(e?.error||"Failed to update review status");return}await F(),I("APPROVED"===s?t?"تم اعتماد الصفحة":"Page approved":"REJECTED"===s?t?"تم رفض الصفحة":"Page rejected":t?"تم تحديث حالة المراجعة":"Review status updated"),setTimeout(()=>I(""),3e3)}finally{T(!1)}},K=async()=>{await X(R,E,M),B()},Q=async e=>{await X(e,"IN_REVIEW")};return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-6",children:[a.jsx("h1",{className:"text-2xl font-bold text-white",children:v(b.pageTitle,t)}),a.jsx("p",{className:"text-sm text-gray-400",children:v(b.subtitle,t)})]}),V&&(0,a.jsxs)("div",{className:"mb-4 px-4 py-2.5 rounded-lg bg-green-500/10 border border-green-500/20 text-green-400 text-sm flex items-center gap-2",children:[a.jsx(l.Z,{className:"h-4 w-4 shrink-0"}),V]}),a.jsx("div",{className:"flex flex-wrap gap-2 mb-4",children:y.map(e=>a.jsx("button",{onClick:()=>k(e.key),className:`px-3 py-1.5 rounded-lg text-sm font-medium border transition-colors ${N===e.key?"bg-indigo-500/10 text-indigo-400 border-indigo-500/30":"text-gray-400 border-transparent hover:text-white hover:bg-white/[0.06]"}`,children:v(e.label,t)},e.key))}),(0,a.jsxs)("div",{className:"flex gap-2 mb-6",children:[(0,a.jsxs)("div",{className:"relative flex-1 max-w-md",children:[a.jsx(n.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-500"}),a.jsx("input",{type:"text",value:s,onChange:e=>w(e.target.value),onKeyDown:e=>"Enter"===e.key&&J(),placeholder:v(b.searchPlaceholder,t),className:"w-full pl-10 pr-4 py-2 border rounded-lg text-sm bg-white/[0.03] border-white/[0.08] text-white placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/30"})]}),a.jsx("button",{onClick:J,className:"px-4 py-2 bg-indigo-500 text-white rounded-lg text-sm font-medium hover:bg-indigo-400 transition-colors",children:v(b.search,t)})]}),H?a.jsx("div",{className:"flex justify-center py-12",children:a.jsx(d.Z,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):0===L.length?a.jsx("div",{className:"rounded-2xl border border-white/[0.06] bg-white/[0.03] overflow-hidden",children:a.jsx("div",{className:"text-center py-12 text-gray-500",children:v(b.noPages,t)})}):(0,a.jsxs)(a.Fragment,{children:[a.jsx("div",{className:"hidden md:block rounded-2xl border border-white/[0.06] bg-white/[0.03] overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm min-w-[900px]",children:[a.jsx("thead",{children:(0,a.jsxs)("tr",{className:`bg-white/[0.03] text-gray-400 ${t?"text-right":"text-left"}`,children:[a.jsx("th",{className:"py-3 px-4 font-medium",children:v(b.title,t)}),a.jsx("th",{className:"py-3 px-4 font-medium",children:v(b.owner,t)}),a.jsx("th",{className:"py-3 px-4 font-medium",children:v(b.pageStatus,t)}),a.jsx("th",{className:"py-3 px-4 font-medium",children:v(b.reviewStatus,t)}),a.jsx("th",{className:"py-3 px-4 font-medium",children:v(b.views,t)}),a.jsx("th",{className:"py-3 px-4 font-medium",children:v(b.leads,t)}),a.jsx("th",{className:"py-3 px-4 font-medium",children:v(b.created,t)}),a.jsx("th",{className:"py-3 px-4 font-medium",children:v(b.actions,t)})]})}),a.jsx("tbody",{children:L.map(e=>(0,a.jsxs)("tr",{className:"border-t border-white/[0.04] hover:bg-white/[0.02] transition-colors",children:[(0,a.jsxs)("td",{className:"py-3 px-4",children:[a.jsx("div",{className:"font-medium text-white",children:e.title}),(0,a.jsxs)("div",{className:"text-xs text-gray-500",children:["/p/",e.slug]})]}),(0,a.jsxs)("td",{className:"py-3 px-4",children:[a.jsx("div",{className:"text-xs text-gray-300",children:e.user.name||"—"}),a.jsx("div",{className:"text-xs text-gray-500",children:e.user.email})]}),a.jsx("td",{className:"py-3 px-4",children:a.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${U(e.status)}`,children:e.status})}),(0,a.jsxs)("td",{className:"py-3 px-4",children:[a.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium inline-flex items-center gap-1 ${G(e.reviewStatus)}`,children:e.reviewStatus}),e.reviewNote&&a.jsx("span",{className:"ml-1 inline-flex",title:e.reviewNote,children:a.jsx(c.Z,{className:"h-3 w-3 text-gray-500"})})]}),a.jsx("td",{className:"py-3 px-4",children:(0,a.jsxs)("span",{className:"flex items-center gap-1 text-gray-400",children:[a.jsx(o.Z,{className:"h-3.5 w-3.5"})," ",e.viewsCount]})}),a.jsx("td",{className:"py-3 px-4",children:a.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${e.leadsEnabled?"bg-green-500/10 text-green-400":"bg-white/[0.05] text-gray-500"}`,children:e.leadsEnabled?t?"مفعّل":"ON":t?"معطّل":"OFF"})}),a.jsx("td",{className:"py-3 px-4 text-xs text-gray-500",children:(0,u.p)(e.createdAt)}),a.jsx("td",{className:"py-3 px-4",children:(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[a.jsx("a",{href:`/p/${e.slug}`,target:"_blank",rel:"noopener noreferrer",className:"p-1.5 rounded-md text-indigo-400 hover:bg-indigo-500/[0.08] inline-flex",title:t?"معاينة":"Preview",children:a.jsx(x.Z,{className:"h-4 w-4"})}),"APPROVED"!==e.reviewStatus&&a.jsx("button",{onClick:()=>W(e.id,e.title,"APPROVED"),disabled:D,className:"p-1.5 rounded-md text-green-400 hover:bg-green-500/10 inline-flex disabled:opacity-50",title:t?"اعتماد":"Approve",children:a.jsx(l.Z,{className:"h-4 w-4"})}),"REJECTED"!==e.reviewStatus&&a.jsx("button",{onClick:()=>W(e.id,e.title,"REJECTED"),disabled:D,className:"p-1.5 rounded-md text-red-400 hover:bg-red-500/10 inline-flex disabled:opacity-50",title:t?"رفض":"Reject",children:a.jsx(p.Z,{className:"h-4 w-4"})}),"IN_REVIEW"!==e.reviewStatus&&a.jsx("button",{onClick:()=>Q(e.id),disabled:D,className:"p-1.5 rounded-md text-blue-400 hover:bg-blue-500/10 inline-flex disabled:opacity-50",title:t?"قيد المراجعة":"Mark as In Review",children:a.jsx(m.Z,{className:"h-4 w-4"})})]})})]},e.id))})]})})}),a.jsx("div",{className:"md:hidden flex flex-col gap-3",children:L.map(e=>(0,a.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.03] p-4",children:[(0,a.jsxs)("div",{className:"mb-2",children:[a.jsx("div",{className:"font-medium text-white",children:e.title}),(0,a.jsxs)("div",{className:"text-xs text-gray-500",children:["/p/",e.slug]})]}),(0,a.jsxs)("div",{className:"mb-2 text-xs",children:[(0,a.jsxs)("span",{className:"text-gray-400",children:[v(b.owner,t),": "]}),a.jsx("span",{className:"text-gray-300",children:e.user.name||"—"}),e.user.email&&(0,a.jsxs)("span",{className:"text-gray-500",children:[" (",e.user.email,")"]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[a.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${U(e.status)}`,children:e.status}),a.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium inline-flex items-center gap-1 ${G(e.reviewStatus)}`,children:e.reviewStatus}),e.reviewNote&&a.jsx("span",{className:"inline-flex",title:e.reviewNote,children:a.jsx(c.Z,{className:"h-3 w-3 text-gray-500"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-4 mb-2 text-xs",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1 text-gray-400",children:[a.jsx(o.Z,{className:"h-3.5 w-3.5"})," ",e.viewsCount," ",v(b.views,t)]}),(0,a.jsxs)("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${e.leadsEnabled?"bg-green-500/10 text-green-400":"bg-white/[0.05] text-gray-500"}`,children:[v(b.leads,t),": ",e.leadsEnabled?t?"مفعّل":"ON":t?"معطّل":"OFF"]})]}),(0,a.jsxs)("div",{className:"mb-3 text-xs text-gray-500",children:[v(b.created,t),": ",(0,u.p)(e.createdAt)]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 border-t border-white/[0.04] pt-3",children:[a.jsx("a",{href:`/p/${e.slug}`,target:"_blank",rel:"noopener noreferrer",className:"p-1.5 rounded-md text-indigo-400 hover:bg-indigo-500/[0.08] inline-flex",title:t?"معاينة":"Preview",children:a.jsx(x.Z,{className:"h-4 w-4"})}),"APPROVED"!==e.reviewStatus&&a.jsx("button",{onClick:()=>W(e.id,e.title,"APPROVED"),disabled:D,className:"p-1.5 rounded-md text-green-400 hover:bg-green-500/10 inline-flex disabled:opacity-50",title:t?"اعتماد":"Approve",children:a.jsx(l.Z,{className:"h-4 w-4"})}),"REJECTED"!==e.reviewStatus&&a.jsx("button",{onClick:()=>W(e.id,e.title,"REJECTED"),disabled:D,className:"p-1.5 rounded-md text-red-400 hover:bg-red-500/10 inline-flex disabled:opacity-50",title:t?"رفض":"Reject",children:a.jsx(p.Z,{className:"h-4 w-4"})}),"IN_REVIEW"!==e.reviewStatus&&a.jsx("button",{onClick:()=>Q(e.id),disabled:D,className:"p-1.5 rounded-md text-blue-400 hover:bg-blue-500/10 inline-flex disabled:opacity-50",title:t?"قيد المراجعة":"Mark as In Review",children:a.jsx(m.Z,{className:"h-4 w-4"})})]})]},e.id))})]}),P&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:B,children:(0,a.jsxs)("div",{className:"bg-[#12121f] border border-white/[0.1] rounded-2xl w-full max-w-md mx-4 p-6 shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h2",{className:"text-lg font-semibold text-white",children:"APPROVED"===E?v(b.approveTitle,t):v(b.rejectTitle,t)}),a.jsx("button",{onClick:B,className:"p-1 rounded-md text-gray-400 hover:text-white hover:bg-white/[0.06]",children:a.jsx(h.Z,{className:"h-5 w-5"})})]}),a.jsx("p",{className:"text-sm text-gray-400 mb-4",children:S}),(0,a.jsxs)("div",{className:"mb-5",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:v(b.noteLabel,t)}),a.jsx("textarea",{value:M,onChange:e=>_(e.target.value),placeholder:v(b.notePlaceholder,t),rows:3,className:"w-full px-3 py-2 border rounded-lg text-sm bg-white/[0.03] border-white/[0.08] text-white placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/30 resize-none"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-3",children:[a.jsx("button",{onClick:B,className:"px-4 py-2 rounded-lg text-sm font-medium text-gray-400 hover:text-white hover:bg-white/[0.06] transition-colors",children:v(b.cancel,t)}),a.jsx("button",{onClick:K,disabled:D,className:`px-4 py-2 rounded-lg text-sm font-medium transition-colors disabled:opacity-50 ${"APPROVED"===E?"bg-green-500/10 text-green-400 hover:bg-green-500/20 border border-green-500/30":"bg-red-500/10 text-red-400 hover:bg-red-500/20 border border-red-500/30"}`,children:D?a.jsx(d.Z,{className:"h-4 w-4 animate-spin"}):v(b.confirm,t)})]})]})})]})}},11453:(e,t,s)=>{"use strict";s.d(t,{cn:()=>i,p:()=>l});var a=s(56815),r=s(79377);function i(...e){return(0,r.m6)((0,a.W)(e))}function l(e){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(new Date(e))}},10314:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>r});var a=s(25036);function r(){return(0,a.jsxs)("div",{className:"animate-pulse",children:[(0,a.jsxs)("div",{className:"mb-6",children:[a.jsx("div",{className:"h-7 w-48 bg-white/[0.06] rounded mb-2"}),a.jsx("div",{className:"h-4 w-24 bg-white/[0.06] rounded"})]}),a.jsx("div",{className:"h-10 w-80 bg-white/[0.06] rounded mb-6"}),a.jsx("div",{className:"h-96 rounded-2xl border border-white/[0.06] bg-white/[0.03]"})]})}},84863:(e,t,s)=>{"use strict";s.r(t),s.d(t,{$$typeof:()=>i,__esModule:()=>r,default:()=>l});let a=(0,s(86843).createProxy)(String.raw`C:\test2\pagecraft-ai\src\app\admin\pages\page.tsx`),{__esModule:r,$$typeof:i}=a,l=a.default}};var t=require("../../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),a=t.X(0,[1638,5312,3207,6632,3910,9043],()=>s(66936));module.exports=a})();