(()=>{var e={};e.id=7350,e.ids=[7350],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")},14720:(e,t,s)=>{"use strict";s.r(t),s.d(t,{GlobalError:()=>i.ZP,__next_app__:()=>u,originalPathname:()=>o,pages:()=>d,routeModule:()=>x,tree:()=>c});var r=s(50482),a=s(69108),i=s(83543),n=s(68300),l={};for(let e in n)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>n[e]);s.d(t,l);let c=["",{children:["admin",{children:["cms-pages",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,14623)),"C:\\test2\\pagecraft-ai\\src\\app\\admin\\cms-pages\\page.tsx"]}]},{loading:[()=>Promise.resolve().then(s.bind(s,74003)),"C:\\test2\\pagecraft-ai\\src\\app\\admin\\cms-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"]}],d=["C:\\test2\\pagecraft-ai\\src\\app\\admin\\cms-pages\\page.tsx"],o="/admin/cms-pages/page",u={require:s,loadChunk:()=>Promise.resolve()},x=new r.AppPageRouteModule({definition:{kind:a.x.APP_PAGE,page:"/admin/cms-pages/page",pathname:"/admin/cms-pages",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:c}})},17457:(e,t,s)=>{Promise.resolve().then(s.bind(s,71007))},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"}]])},53148:(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)("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:()=>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"}]])},31741:(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)("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},51838:(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)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},38271:(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)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},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"}]])},71007:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>y});var r=s(95344),a=s(66543),i=s(37775),n=s(56506),l=s(51838),c=s(37121),d=s(53148),o=s(31741),u=s(38271),x=s(3729),p=s(9885);let h=e=>fetch(e).then(e=>e.json());function m(){let{lang:e,isRTL:t}=(0,p.Z)(),s="ar"===e,{data:m,isLoading:y}=(0,a.ZP)("/api/admin/cms-pages",h),[g,f]=(0,x.useState)(null),[v,j]=(0,x.useState)(null);async function b(e){f(e),(await fetch(`/api/admin/cms-pages/${e}`,{method:"DELETE"})).ok&&(await (0,i.j)("/api/admin/cms-pages"),j(null)),f(null)}if(y)return r.jsx("div",{className:"space-y-3",children:[1,2,3].map(e=>r.jsx("div",{className:"h-16 rounded-xl bg-white/[0.04] animate-pulse"},e))});let k=m??[];return(0,r.jsxs)("div",{dir:t?"rtl":"ltr",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,r.jsxs)("div",{children:[r.jsx("h1",{className:"text-xl font-bold text-white",children:s?"صفحات الموقع":"CMS Pages"}),r.jsx("p",{className:"text-gray-400 text-sm mt-1",children:s?`${k.length} صفحة`:`${k.length} pages`})]}),r.jsx(n.default,{href:"/admin/cms-pages/new",children:(0,r.jsxs)("button",{className:"flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-500 transition-colors",children:[r.jsx(l.Z,{className:"h-4 w-4"}),s?"صفحة جديدة":"New Page"]})})]}),0===k.length&&(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[r.jsx(c.Z,{className:"h-12 w-12 text-gray-600 mb-4"}),r.jsx("p",{className:"text-gray-400 text-sm",children:s?"لا توجد صفحات بعد":"No pages yet"}),r.jsx(n.default,{href:"/admin/cms-pages/new",className:"mt-4 text-indigo-400 text-sm hover:text-indigo-300 transition-colors",children:s?"أنشئ أول صفحة":"Create your first page"})]}),k.length>0&&r.jsx("div",{className:"rounded-xl border border-white/[0.06] overflow-hidden",children:(0,r.jsxs)("table",{className:"w-full text-sm",children:[r.jsx("thead",{children:(0,r.jsxs)("tr",{className:"border-b border-white/[0.06] bg-white/[0.02]",children:[r.jsx("th",{className:`px-4 py-3 text-gray-400 font-medium ${t?"text-right":"text-left"}`,children:s?"العنوان":"Title"}),r.jsx("th",{className:`px-4 py-3 text-gray-400 font-medium ${t?"text-right":"text-left"}`,children:s?"الرابط":"Slug"}),r.jsx("th",{className:"px-4 py-3 text-gray-400 font-medium text-center",children:s?"الحالة":"Status"}),r.jsx("th",{className:"px-4 py-3 text-gray-400 font-medium text-center",children:s?"ظهور":"Visible"}),r.jsx("th",{className:`px-4 py-3 text-gray-400 font-medium ${t?"text-left":"text-right"}`,children:s?"إجراءات":"Actions"})]})}),r.jsx("tbody",{children:k.map(e=>(0,r.jsxs)("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.02] transition-colors",children:[r.jsx("td",{className:"px-4 py-3 text-white font-medium",children:s?e.titleAr:e.titleEn}),r.jsx("td",{className:"px-4 py-3",children:(0,r.jsxs)("span",{className:"text-indigo-400 font-mono text-xs",children:["/",e.slug]})}),r.jsx("td",{className:"px-4 py-3 text-center",children:r.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${"PUBLISHED"===e.status?"bg-green-500/10 text-green-400":"bg-yellow-500/10 text-yellow-400"}`,children:"PUBLISHED"===e.status?s?"منشور":"Published":s?"مسودة":"Draft"})}),r.jsx("td",{className:"px-4 py-3 text-center",children:(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[e.showInFooter&&r.jsx("span",{className:"text-xs text-gray-500 bg-white/[0.04] px-1.5 py-0.5 rounded",children:s?"فوتر":"Footer"}),e.showInNavbar&&r.jsx("span",{className:"text-xs text-gray-500 bg-white/[0.04] px-1.5 py-0.5 rounded",children:s?"نافبار":"Navbar"}),!e.showInFooter&&!e.showInNavbar&&r.jsx("span",{className:"text-gray-700 text-xs",children:"—"})]})}),r.jsx("td",{className:"px-4 py-3",children:(0,r.jsxs)("div",{className:`flex items-center gap-2 ${t?"justify-start":"justify-end"}`,children:["PUBLISHED"===e.status&&r.jsx("a",{href:`/${e.slug}`,target:"_blank",rel:"noopener noreferrer",className:"p-1.5 text-gray-500 hover:text-white hover:bg-white/[0.06] rounded-lg transition-colors",title:s?"عرض":"View",children:r.jsx(d.Z,{className:"h-4 w-4"})}),r.jsx(n.default,{href:`/admin/cms-pages/${e.id}/edit`,className:"p-1.5 text-gray-500 hover:text-white hover:bg-white/[0.06] rounded-lg transition-colors",title:s?"تعديل":"Edit",children:r.jsx(o.Z,{className:"h-4 w-4"})}),v===e.id?(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[r.jsx("button",{onClick:()=>b(e.id),disabled:g===e.id,className:"px-2 py-1 text-xs text-white bg-red-600 hover:bg-red-500 rounded transition-colors disabled:opacity-50",children:s?"تأكيد":"Confirm"}),r.jsx("button",{onClick:()=>j(null),className:"px-2 py-1 text-xs text-gray-400 hover:text-white hover:bg-white/[0.06] rounded transition-colors",children:s?"إلغاء":"Cancel"})]}):r.jsx("button",{onClick:()=>j(e.id),className:"p-1.5 text-gray-500 hover:text-red-400 hover:bg-red-500/[0.06] rounded-lg transition-colors",title:s?"حذف":"Delete",children:r.jsx(u.Z,{className:"h-4 w-4"})})]})})]},e.id))})]})})]})}function y(){return r.jsx(m,{})}},48096:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var s in t)Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}(t,{DynamicServerError:function(){return r},isDynamicServerError:function(){return a}});let s="DYNAMIC_SERVER_USAGE";class r extends Error{constructor(e){super("Dynamic server usage: "+e),this.description=e,this.digest=s}}function a(e){return"object"==typeof e&&null!==e&&"digest"in e&&"string"==typeof e.digest&&e.digest===s}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},72973:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var s in t)Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}(t,{isStaticGenBailoutError:function(){return l},staticGenerationBailout:function(){return d}});let r=s(48096),a=s(45869),i="NEXT_STATIC_GEN_BAILOUT";class n extends Error{constructor(...e){super(...e),this.code=i}}function l(e){return"object"==typeof e&&null!==e&&"code"in e&&e.code===i}function c(e,t){let{dynamic:s,link:r}=t||{};return"Page"+(s?' with `dynamic = "'+s+'"`':"")+" couldn't be rendered statically because it used `"+e+"`."+(r?" See more info here: "+r:"")}let d=(e,t)=>{let{dynamic:s,link:i}=void 0===t?{}:t,l=a.staticGenerationAsyncStorage.getStore();if(!l)return!1;if(l.forceStatic)return!0;if(l.dynamicShouldError)throw new n(c(e,{link:i,dynamic:null!=s?s:"error"}));let d=c(e,{dynamic:s,link:"https://nextjs.org/docs/messages/dynamic-server-error"});if(null==l.postpone||l.postpone.call(l,e),l.revalidate=0,l.isStaticGeneration){let t=new r.DynamicServerError(d);throw l.dynamicUsageDescription=e,l.dynamicUsageStack=t.stack,t}return!1};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},74003:(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:"space-y-3",children:[r.jsx("div",{className:"h-8 w-48 rounded-lg bg-white/[0.04] animate-pulse mb-6"}),[1,2,3,4].map(e=>r.jsx("div",{className:"h-14 rounded-xl bg-white/[0.04] animate-pulse"},e))]})}},14623:(e,t,s)=>{"use strict";s.r(t),s.d(t,{$$typeof:()=>i,__esModule:()=>a,default:()=>n});let r=(0,s(86843).createProxy)(String.raw`C:\test2\pagecraft-ai\src\app\admin\cms-pages\page.tsx`),{__esModule:a,$$typeof:i}=r,n=r.default}};var t=require("../../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),r=t.X(0,[1638,5312,6632,3910,9043],()=>s(14720));module.exports=r})();