(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9091],{63866:function(e,t,n){Promise.resolve().then(n.bind(n,92260))},95032:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]])},53879:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},99325:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]])},43345:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).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"}]])},14562:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]])},14796:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]])},49108:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},37805:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},10527:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).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"}]])},69475:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},37451:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},35005:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]])},5423:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]])},18994:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},81049:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]])},90684:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]])},79744:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]])},30438:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).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"}]])},29910:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},18727:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]])},85497:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).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"}]])},63854:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).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"}]])},58106:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).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"}]])},34059:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).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"}]])},52235:function(e,t,n){"use strict";n.d(t,{Z:function(){return 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,n(87461).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},47907:function(e,t,n){"use strict";var a=n(15313);n.o(a,"useParams")&&n.d(t,{useParams:function(){return a.useParams}}),n.o(a,"usePathname")&&n.d(t,{usePathname:function(){return a.usePathname}}),n.o(a,"useRouter")&&n.d(t,{useRouter:function(){return a.useRouter}}),n.o(a,"useSearchParams")&&n.d(t,{useSearchParams:function(){return a.useSearchParams}})},92260:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return I}});var a=n(3827),i=n(71126),s=n(47907),r=n(8792),l=n(20703),o=n(64090),c=n(71774),d=n(5423),u=n(14562),h=n(69475),x=n(85497),f=n(10527),m=n(95032),y=n(43345),p=n(35005);/**
 * @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 g=(0,n(87461).Z)("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);var k=n(34059),v=n(30438),b=n(29910),j=n(52235),Z=n(79744),w=n(18727),N=n(53879),M=n(81049),z=n(49108),C=n(37805),L=n(18994),P=n(89966),S=n(63854),H=n(90684),q=n(37451),A=n(99325),D=n(58106),_=n(14796);let U={notifications:{en:"Notifications",ar:"الإشعارات"},markAllRead:{en:"Mark all read",ar:"تحديد الكل كمقروء"},viewAll:{en:"View all",ar:"عرض الكل"},noNotifications:{en:"No notifications",ar:"لا توجد إشعارات"}},E={new_user:{icon:S.Z,color:"text-green-400"},new_lead:{icon:H.Z,color:"text-blue-400"},page_published:{icon:q.Z,color:"text-green-400"},user_suspended:{icon:A.Z,color:"text-orange-400"},user_deleted:{icon:D.Z,color:"text-red-400"}},O=e=>fetch(e).then(e=>e.json());function R(e){var t,n;let{collapsed:i}=e,{lang:s}=(0,c.Z)(),l="ar"===s,[d,u]=(0,o.useState)(!1),h=(0,o.useRef)(null),{data:x,mutate:f}=(0,P.ZP)("/api/admin/notifications?unreadOnly=false&limit=10",O,{refreshInterval:3e4}),m=null!==(t=null==x?void 0:x.notifications)&&void 0!==t?t:[],p=null!==(n=null==x?void 0:x.unreadCount)&&void 0!==n?n:0;(0,o.useEffect)(()=>{function e(e){h.current&&!h.current.contains(e.target)&&u(!1)}if(d)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[d]);let g=async()=>{await fetch("/api/admin/notifications",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({markAllRead:!0})}),f()},k=e=>{var t,n,a;return l?null===(t=U[e])||void 0===t?void 0:t.ar:null!==(a=null===(n=U[e])||void 0===n?void 0:n.en)&&void 0!==a?a:e};return(0,a.jsxs)("div",{ref:h,className:"relative",children:[(0,a.jsxs)("button",{onClick:()=>u(!d),className:"flex items-center gap-3 px-3 py-2 rounded-lg text-sm text-gray-400 hover:text-white hover:bg-white/[0.06] transition-colors w-full ".concat(i?"justify-center":""),children:[(0,a.jsxs)("span",{className:"relative shrink-0",children:[(0,a.jsx)(y.Z,{className:"h-4 w-4"}),p>0&&(0,a.jsx)("span",{className:"absolute -top-1.5 -right-1.5 bg-red-500 text-white text-[10px] font-bold min-w-[18px] h-[18px] rounded-full flex items-center justify-center px-1 leading-none",children:p>99?"99+":p})]}),!i&&(0,a.jsx)("span",{children:k("notifications")})]}),d&&(0,a.jsxs)("div",{className:"absolute bottom-full mb-2 ".concat(l?"right-0":"left-0"," w-80 bg-[#12121f] border border-white/[0.1] rounded-xl shadow-2xl z-[100] overflow-hidden"),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-white/[0.08]",children:[(0,a.jsx)("span",{className:"text-sm font-semibold text-white",children:k("notifications")}),p>0&&(0,a.jsxs)("button",{onClick:g,className:"flex items-center gap-1 text-xs text-indigo-400 hover:text-indigo-300 transition-colors",children:[(0,a.jsx)(_.Z,{className:"h-3.5 w-3.5"}),k("markAllRead")]})]}),(0,a.jsx)("div",{className:"max-h-80 overflow-y-auto",children:0===m.length?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-gray-500",children:[(0,a.jsx)(y.Z,{className:"h-8 w-8 mb-2 opacity-40"}),(0,a.jsx)("span",{className:"text-sm",children:k("noNotifications")})]}):m.map(e=>{let{icon:t,color:n}=E[e.type]||{icon:y.Z,color:"text-gray-400"};return(0,a.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 hover:bg-white/[0.04] transition-colors cursor-default",children:[(0,a.jsx)("div",{className:"mt-0.5 shrink-0 ".concat(n),children:(0,a.jsx)(t,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-gray-200 truncate",children:e.title}),!e.read&&(0,a.jsx)("span",{className:"h-2 w-2 rounded-full bg-indigo-500 shrink-0"})]}),(0,a.jsx)("p",{className:"text-xs text-gray-500 truncate mt-0.5",children:e.message}),(0,a.jsx)("p",{className:"text-[11px] text-gray-600 mt-1",children:function(e,t){let n=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(n<60)return t?"الآن":"just now";let a=Math.floor(n/60);if(a<60)return t?"منذ ".concat(a," د"):"".concat(a,"m ago");let i=Math.floor(a/60);if(i<24)return t?"منذ ".concat(i," س"):"".concat(i,"h ago");let s=Math.floor(i/24);return t?"منذ ".concat(s," ي"):"".concat(s,"d ago")}(e.createdAt,l)})]})]},e.id)})}),(0,a.jsx)("div",{className:"border-t border-white/[0.08] px-4 py-2.5",children:(0,a.jsx)(r.default,{href:"/admin/notifications",onClick:()=>u(!1),className:"block text-center text-xs text-indigo-400 hover:text-indigo-300 transition-colors",children:k("viewAll")})})]})]})}var B=n(44451);let T=[{key:"dashboard",href:"/admin",icon:d.Z},{key:"blog",href:"/admin/blog",icon:u.Z},{key:"cmsPages",href:"/admin/cms-pages",icon:h.Z},{key:"pages",href:"/admin/pages",icon:h.Z},{key:"leads",href:"/admin/leads",icon:x.Z},{key:"plans",href:"/admin/plans",icon:f.Z},{key:"activity",href:"/admin/activity",icon:m.Z},{key:"notifications",href:"/admin/notifications",icon:y.Z},{key:"homepage",href:"/admin/homepage",icon:p.Z},{key:"navbar",href:"/admin/navbar",icon:g},{key:"users",href:"/admin/users",icon:k.Z},{key:"messages",href:"/admin/messages",icon:v.Z},{key:"settings",href:"/admin/settings",icon:b.Z}],V={dashboard:{en:"Dashboard",ar:"لوحة القيادة"},users:{en:"Users",ar:"المستخدمون"},pages:{en:"Landing Pages",ar:"صفحات الهبوط"},leads:{en:"Leads",ar:"العملاء"},plans:{en:"Plans",ar:"الخطط"},activity:{en:"Activity Log",ar:"سجل النشاطات"},notifications:{en:"Notifications",ar:"الإشعارات"},homepage:{en:"Frontend",ar:"الواجهة الأمامية"},navbar:{en:"Navigation Bar",ar:"شريط التنقل"},blog:{en:"Blog",ar:"المدونة"},cmsPages:{en:"CMS Pages",ar:"صفحات الموقع"},messages:{en:"Messages",ar:"الرسائل"},settings:{en:"Settings",ar:"الإعدادات"}};function I(e){var t;let{children:n}=e,{data:d,status:u}=(0,i.useSession)(),h=(0,s.useRouter)(),x=(0,s.usePathname)(),{lang:f,setLang:m}=(0,c.Z)(),y="ar"===f,[p,g]=(0,o.useState)(!1),[k,v]=(0,o.useState)(!1),{siteName:b,logoUrl:P,logoSize:S}=(0,B.T)();if((0,o.useEffect)(()=>{var e;"unauthenticated"===u?h.push("/login"):"authenticated"===u&&(null==d?void 0:null===(e=d.user)||void 0===e?void 0:e.role)!=="ADMIN"&&h.push("/dashboard")},[u,d,h]),"loading"===u||"authenticated"===u&&(null==d?void 0:null===(t=d.user)||void 0===t?void 0:t.role)!=="ADMIN")return(0,a.jsx)("div",{className:"flex items-center justify-center min-h-screen bg-[#0a0a0f]",children:(0,a.jsx)(L.Z,{className:"h-8 w-8 animate-spin text-gray-500"})});let H=e=>"/admin"===e?"/admin"===x:x.startsWith(e);return(0,a.jsxs)("div",{dir:y?"rtl":"ltr",className:"flex min-h-screen bg-[#0a0a0f]",children:[k&&(0,a.jsx)("div",{className:"fixed inset-0 bg-black/60 z-40 md:hidden",onClick:()=>v(!1)}),(0,a.jsxs)("div",{className:"fixed top-0 left-0 right-0 h-14 bg-[#07070d] border-b border-white/[0.06] flex items-center justify-between px-4 z-30 md:hidden",children:[(0,a.jsx)("button",{onClick:()=>v(!k),className:"text-gray-400 hover:text-white p-1.5 rounded-lg hover:bg-white/[0.06] transition-colors",children:k?(0,a.jsx)(j.Z,{className:"h-5 w-5"}):(0,a.jsx)(Z.Z,{className:"h-5 w-5"})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[P?(0,a.jsx)(l.default,{src:P,alt:b,width:S,height:S,className:"object-contain",unoptimized:!0}):(0,a.jsx)(w.Z,{className:"h-5 w-5 text-indigo-400"}),(0,a.jsx)("span",{className:"font-bold text-white",children:b})]}),(0,a.jsx)("div",{className:"w-8"})]}),(0,a.jsxs)("aside",{className:"fixed top-0 ".concat(y?"right-0 border-l":"left-0 border-r"," h-full bg-[#07070d] border-white/[0.06] flex flex-col transition-all duration-300 z-50 md:translate-x-0\n          ").concat(p?"w-16":"w-64","\n          ").concat(k?"translate-x-0":y?"translate-x-full":"-translate-x-full","\n        "),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 p-4 border-b border-white/[0.06]",children:[P?(0,a.jsx)(l.default,{src:P,alt:b,width:S,height:S,className:"object-contain shrink-0",unoptimized:!0}):(0,a.jsx)(w.Z,{className:"h-6 w-6 text-indigo-400 shrink-0"}),!p&&(0,a.jsx)("span",{className:"font-bold text-lg whitespace-nowrap bg-gradient-to-r from-white to-gray-300 bg-clip-text text-transparent",children:b})]}),(0,a.jsx)("nav",{className:"flex-1 py-4 space-y-1 px-2",children:T.map(e=>{let t=e.icon,n=H(e.href);return(0,a.jsxs)(r.default,{href:e.href,onClick:()=>v(!1),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg text-sm font-medium transition-colors ".concat(n?"bg-indigo-500/10 text-indigo-400 ".concat(y?"border-r-2 border-l-2":"border-l-2 border-r-2"," border-l-indigo-400 border-r-indigo-400"):"text-gray-400 hover:text-white hover:bg-white/[0.06]"," ").concat(p?"justify-center":""),title:p?y?V[e.key].ar:V[e.key].en:void 0,children:[(0,a.jsx)(t,{className:"h-5 w-5 shrink-0"}),!p&&(0,a.jsx)("span",{children:y?V[e.key].ar:V[e.key].en})]},e.key)})}),(0,a.jsxs)("div",{className:"border-t border-white/[0.06] p-3 space-y-2",children:[(0,a.jsx)(R,{collapsed:p}),(0,a.jsxs)(r.default,{href:"/dashboard",onClick:()=>v(!1),className:"flex items-center gap-3 px-3 py-2 rounded-lg text-sm text-gray-400 hover:text-white hover:bg-white/[0.06] transition-colors ".concat(p?"justify-center":""),children:[y?(0,a.jsx)(N.Z,{className:"h-4 w-4 shrink-0 rotate-180"}):(0,a.jsx)(N.Z,{className:"h-4 w-4 shrink-0"}),!p&&(0,a.jsx)("span",{children:y?"العودة للداشبورد":"Back to Dashboard"})]}),(0,a.jsxs)("button",{onClick:()=>m("en"===f?"ar":"en"),className:"flex items-center gap-3 px-3 py-2 rounded-lg text-sm text-gray-400 hover:text-white hover:bg-white/[0.06] transition-colors w-full ".concat(p?"justify-center":""),children:[(0,a.jsx)("span",{className:"text-xs font-bold shrink-0",children:"en"===f?"ع":"EN"}),!p&&(0,a.jsx)("span",{children:"en"===f?"عربي":"English"})]}),(0,a.jsxs)("button",{onClick:()=>(0,i.signOut)({callbackUrl:"/"}),className:"flex items-center gap-3 px-3 py-2 rounded-lg text-sm text-red-400 hover:bg-red-500/[0.06] transition-colors w-full ".concat(p?"justify-center":""),children:[(0,a.jsx)(M.Z,{className:"h-4 w-4 shrink-0"}),!p&&(0,a.jsx)("span",{children:y?"تسجيل الخروج":"Sign Out"})]}),(0,a.jsx)("button",{onClick:()=>g(!p),className:"flex items-center justify-center w-full py-1 text-gray-600 hover:text-gray-400 transition-colors",children:p?y?(0,a.jsx)(z.Z,{className:"h-4 w-4"}):(0,a.jsx)(C.Z,{className:"h-4 w-4"}):y?(0,a.jsx)(C.Z,{className:"h-4 w-4"}):(0,a.jsx)(z.Z,{className:"h-4 w-4"})})]}),!p&&(null==d?void 0:d.user)&&(0,a.jsxs)("div",{className:"px-4 py-3 border-t border-white/[0.06]",children:[(0,a.jsx)("p",{className:"text-xs font-medium truncate text-gray-300",children:d.user.name||"Admin"}),(0,a.jsx)("p",{className:"text-xs text-gray-500 truncate",children:d.user.email})]})]}),(0,a.jsx)("main",{className:"flex-1 transition-all duration-300 pt-14 md:pt-0 bg-[#0a0a0f] min-h-screen overflow-x-hidden ".concat(p?y?"md:mr-16":"md:ml-16":y?"md:mr-64":"md:ml-64"),children:(0,a.jsx)("div",{className:"p-4 md:p-6",children:n})})]})}},44451:function(e,t,n){"use strict";n.d(t,{T:function(){return r}});var a=n(89966);let i={siteName:"PageCraft AI",siteDescription:"",logoUrl:"",logoSize:32,accentColor:"#6366f1",defaultLanguage:"ar"},s=e=>fetch(e).then(e=>e.json());function r(){var e,t,n,r,l,o;let{data:c,isLoading:d}=(0,a.ZP)("/api/settings/branding",s,{revalidateOnFocus:!1,dedupingInterval:6e4,fallbackData:i});return{siteName:null!==(e=null==c?void 0:c.siteName)&&void 0!==e?e:i.siteName,siteDescription:null!==(t=null==c?void 0:c.siteDescription)&&void 0!==t?t:i.siteDescription,logoUrl:null!==(n=null==c?void 0:c.logoUrl)&&void 0!==n?n:i.logoUrl,logoSize:null!==(r=null==c?void 0:c.logoSize)&&void 0!==r?r:i.logoSize,accentColor:null!==(l=null==c?void 0:c.accentColor)&&void 0!==l?l:i.accentColor,defaultLanguage:null!==(o=null==c?void 0:c.defaultLanguage)&&void 0!==o?o:i.defaultLanguage,isLoading:d}}}},function(e){e.O(0,[9966,2807,1126,703,1774,2971,8069,1744],function(){return e(e.s=63866)}),_N_E=e.O()}]);