NeahNew/.next/static/chunks/app/layout-09a32a3ea75fe56a.js
2025-05-06 23:01:34 +02:00

1 line
44 KiB
JavaScript

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{9513:(e,t,a)=>{"use strict";a.d(t,{LayoutWrapper:()=>eT});var s=a(95155),r=a(12115),n=a(16785),i=a(92749),o=a(28883),l=a(74783),c=a(69074),d=a(14186),u=a(44940),h=a(25657),m=a(9803),f=a(93840),p=a(14259),x=a(12548),g=a(13062),b=a(9428),v=a(34835),j=a(66766),w=a(6874),N=a.n(w),y=a(53999),k=a(57434),A=a(95880),C=a(87949),S=a(81497),I=a(19491),_=a(5040),E=a(66516),T=a(33127),O=a(60171),R=a(6740),z=a(23227),F=a(99245),D=a(42355),M=a(97168),L=a(16891),B=a(35695),P=a(12108),U=a(49509);function G(e){var t;let{isOpen:a,onClose:r}=e,{data:n,status:i}=(0,P.useSession)(),l=(0,B.useRouter)(),c=(0,B.usePathname)();if(console.log("SIDEBAR DEBUG - Session:",n),console.log("SIDEBAR DEBUG - User roles:",null==n||null==(t=n.user)?void 0:t.role),"loading"===i||"unauthenticated"===i)return null;let d=e=>{var t;if(!e)return!0;if(!(null==n||null==(t=n.user)?void 0:t.role))return!1;let a=Array.isArray(n.user.role)?n.user.role:[n.user.role],s=["offline_access","uma_authorization","default-roles-cercle"],r=a.filter(Boolean).filter(e=>!s.includes(String(e))).map(e=>"string"!=typeof e?"":e.replace(/^\//,"").replace(/^ROLE_/i,"").replace(/^default-roles-[^/]*\//i,"").toLowerCase()).filter(e=>""!==e);if(Array.isArray(e))return e.filter(Boolean).map(e=>"string"==typeof e?e.toLowerCase():"").filter(e=>""!==e).some(e=>r.includes(e));if("string"==typeof e){let t=e.toLowerCase();return r.includes(t)}return!1},u=[{title:"Pages",icon:k.A,href:"/pages",iframe:"https://journal.governance-labs.com/"},{title:"Courrier",icon:o.A,href:"/courrier"},{title:"Dossiers",icon:A.A,href:"/dossiers",iframe:"https://espace.slm-lab.net/apps/files/?embedMode=true&hideNavigation=true"},{title:"Apprendre",icon:C.A,href:"/apprendre",iframe:"https://apprendre.slm-lab.net"},{title:"Parole",icon:S.A,href:"/parole",iframe:"https://parole.slm-lab.net/channel/City"},{title:"Missions",icon:I.A,href:"/mission-tab",iframe:U.env.NEXT_PUBLIC_IFRAME_MISSIONSBOARD_URL},{title:"Chapitre",icon:_.A,href:"/chapitre",iframe:"https://chapitre.slm-lab.net"},{title:"Agilit\xe9",icon:E.A,href:"/agilite",iframe:"https://agilite.slm-lab.net/oidc/login"},...[{title:"Artlab",icon:T.A,href:"/design",iframe:"https://artlab.slm-lab.net",requiredRole:["expression","admin","user","coding","dataintelligence","mediation"]},{title:"Gite",icon:O.A,href:"/gite",iframe:"https://gite.slm-lab.net/user/oauth2/cube",requiredRole:["coding","dataintelligence"]},{title:"Calcul",icon:R.A,href:"/calcul",iframe:"https://calcul.slm-lab.net",requiredRole:"dataintelligence"},{title:"M\xe9diation",icon:z.A,href:"/mediation",iframe:"https://connect.slm-lab.net/realms/cercle/protocol/openid-connect/auth?client_id=mediations.slm-lab.net&redirect_uri=https%3A%2F%2Fmediations.slm-lab.net%2F%3Fopenid_mode%3Dtrue&scope=openid%20profile%20email&response_type=code",requiredRole:"mediation"},{title:"Livres",icon:F.A,href:"/livres",iframe:"https://memoire.slm-lab.net/"}].filter(e=>d(e.requiredRole))],h=(e,t)=>{t&&e?window.open(e,"_blank"):l.push(e),r()};return(0,s.jsxs)(s.Fragment,{children:[a&&(0,s.jsx)("div",{className:"fixed inset-0 z-40 bg-background/80 backdrop-blur-sm",onClick:r}),(0,s.jsx)("div",{className:(0,y.cn)("fixed top-0 left-0 z-50 h-full w-64 transform bg-panel transition-all duration-200 ease-in-out",a?"translate-x-0":"-translate-x-full"),children:(0,s.jsxs)(L.F,{className:"h-full w-full relative",children:[(0,s.jsx)("button",{onClick:r,className:"absolute -right-3 top-1/2 transform -translate-y-1/2 w-6 h-12 bg-black text-white rounded-r-md flex items-center justify-center hover:bg-gray-800 transition-colors z-[60]",children:(0,s.jsx)(D.A,{className:"h-4 w-4"})}),(0,s.jsx)("div",{className:"flex justify-center p-6 border-b",children:(0,s.jsx)(j.default,{src:"/Neahv3 logo.png",alt:"Neah Logo",width:50,height:16.5,className:"text-black"})}),(0,s.jsx)("div",{className:"space-y-1 p-4",children:u.map(e=>(0,s.jsxs)(M.$,{variant:"ghost",className:(0,y.cn)("w-full justify-start gap-2 text-black hover:bg-gray-100",c===e.href&&!e.external&&"bg-gray-100"),onClick:()=>h(e.href,e.external),children:[(0,s.jsx)(e.icon,{className:"h-5 w-5"}),(0,s.jsx)("span",{children:e.title})]},e.title))})]})})]})}var V=a(67133),q=a(81189),Y=a(16946),W=a(23861),$=a(5196),J=a(70306),Q=a(85339),K=a(33786),H=a(88145);let X={total:0,unread:0,sources:{}};var Z=a(90498),ee=a(10822);function et(e){let{html:t,className:a}=e,r=ee.A.sanitize(t,{USE_PROFILES:{html:!0},ALLOWED_TAGS:["a","p","br","b","i","em","strong","span","div","img","ul","ol","li","h1","h2","h3","h4","h5","h6","code","pre","blockquote"],ALLOWED_ATTR:["href","target","class","id","style","src","alt","data-tagged-user-id","data-mention"]});return(0,s.jsx)("div",{className:a,dangerouslySetInnerHTML:{__html:r}})}let ea=(0,r.memo)(function(e){let{className:t}=e,{data:a,status:n}=(0,P.useSession)(),{notifications:i,notificationCount:o,markAsRead:l,markAllAsRead:c,fetchNotifications:d,loading:u,error:h}=function(){let e,{data:t,status:a}=(0,P.useSession)(),[s,n]=(0,r.useState)([]),[i,o]=(0,r.useState)(X),[l,c]=(0,r.useState)(!1),[d,u]=(0,r.useState)(null),h=(0,r.useRef)(null),m=(0,r.useRef)(0),f=(0,r.useRef)(!1),p=(0,r.useRef)(!1),x=(0,r.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!(null==t?void 0:t.user)||!f.current)return;let a=Date.now();if(!e&&a-m.current<5e3)return void console.log("Skipping notification count fetch - too soon");try{u(null),m.current=a,console.log("[useNotifications] Fetching notification count");let e=await fetch("/api/notifications/count",{credentials:"include"});if(!e.ok){let t=await e.text();console.error("Failed to fetch notification count:",{status:e.status,body:t}),u(t||"Failed to fetch notification count");return}let t=await e.json();f.current&&o(t)}catch(e){console.error("Error fetching notification count:",e),u("Failed to fetch notification count")}},[null==t?void 0:t.user]),g=(0,r.useCallback)((e=null,function(){for(var t=arguments.length,a=Array(t),s=0;s<t;s++)a[s]=arguments[s];e&&clearTimeout(e),e=setTimeout(()=>x(...a),300)}),[x]),b=(0,r.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20;if(!(null==t?void 0:t.user)||!f.current)return;let s=Date.now();if(s-m.current<5e3)return void console.log("Skipping notifications fetch - too soon");c(!0),u(null),m.current=s;try{console.log("[useNotifications] Fetching notifications",{page:e,limit:a});let t=await fetch("/api/notifications?page=".concat(e,"&limit=").concat(a),{credentials:"include"});if(!t.ok){let e=await t.text();console.error("Failed to fetch notifications:",{status:t.status,body:e}),u(e||"Failed to fetch notifications");return}let s=await t.json();f.current&&n(s.notifications)}catch(e){console.error("Error fetching notifications:",e),u("Failed to fetch notifications")}finally{f.current&&c(!1)}},[null==t?void 0:t.user]),v=(0,r.useCallback)(async e=>{if(!(null==t?void 0:t.user))return!1;try{console.log("[useNotifications] Marking notification as read:",e);let t=await fetch("/api/notifications/".concat(e,"/read"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"});if(!t.ok){let e=await t.text();return console.error("Failed to mark notification as read:",{status:t.status,body:e}),!1}return n(t=>t.map(t=>t.id===e?{...t,isRead:!0}:t)),g(!0),!0}catch(e){return console.error("Error marking notification as read:",e),!1}},[null==t?void 0:t.user,g]),j=(0,r.useCallback)(async()=>{if(!(null==t?void 0:t.user))return!1;try{console.log("[useNotifications] Marking all notifications as read");let e=await fetch("/api/notifications/read-all",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"});if(!e.ok){let t=await e.text();return console.error("Failed to mark all notifications as read:",{status:e.status,body:t}),!1}return n(e=>e.map(e=>({...e,isRead:!0}))),g(!0),!0}catch(e){return console.error("Error marking all notifications as read:",e),!1}},[null==t?void 0:t.user,g]),w=(0,r.useCallback)(()=>{if(!p.current)return p.current=!0,h.current&&clearInterval(h.current),h.current=setInterval(()=>{f.current&&g()},6e4),()=>N()},[g]),N=(0,r.useCallback)(()=>{h.current&&(clearInterval(h.current),h.current=null),p.current=!1},[]);return(0,r.useEffect)(()=>(f.current=!0,"authenticated"===a&&(null==t?void 0:t.user)&&(x(!0),b(),w()),()=>{f.current=!1,N()}),[a,null==t?void 0:t.user,x,b,w,N]),{notifications:s,notificationCount:i,loading:l,error:d,fetchNotifications:b,fetchNotificationCount:()=>g(!0),markAsRead:v,markAllAsRead:j}}(),m=o.unread>0,[f,p]=(0,r.useState)(!1),[x,g]=(0,r.useState)(!1);console.log("[NOTIFICATION_BADGE] Auth status:",n),console.log("[NOTIFICATION_BADGE] Session:",a?"exists":"null"),console.log("[NOTIFICATION_BADGE] Current notification count:",o),console.log("[NOTIFICATION_BADGE] Current notifications:",i.length>0?"".concat(i.length," loaded"):"none loaded"),console.log("[NOTIFICATION_BADGE] Loading state:",u),console.log("[NOTIFICATION_BADGE] Error state:",h);let b=async()=>{console.log("[NOTIFICATION_BADGE] Manual fetch initiated"),g(!0);try{let e=await fetch("/api/notifications",{credentials:"include"});if(console.log("[NOTIFICATION_BADGE] Manual fetch response:",e.status),e.ok){let t=await e.json();console.log("[NOTIFICATION_BADGE] Manual fetch success:",t)}else console.error("[NOTIFICATION_BADGE] Manual fetch failed:",e.status,await e.text())}catch(e){console.error("[NOTIFICATION_BADGE] Manual fetch error:",e)}d(1,10)};(0,r.useEffect)(()=>{f&&"authenticated"===n&&(console.log("[NOTIFICATION_BADGE] Dropdown opened, fetching notifications"),b())},[f,n]);let v=async e=>{await l(e)},j=async()=>{await c(),p(!1)};(0,r.useEffect)(()=>{"authenticated"===n&&(console.log("[NOTIFICATION_BADGE] Component mounted and authenticated, fetching initial notifications"),b())},[n]);let w=i.slice(0,10),y=(null==h?void 0:h.includes("Not authenticated"))||(null==h?void 0:h.includes("401"));return(0,s.jsx)("div",{className:"relative ".concat(t||""),children:(0,s.jsxs)(V.rI,{open:f,onOpenChange:e=>{p(e),e&&"authenticated"===n&&(console.log("[NOTIFICATION_BADGE] Dropdown opened via handleOpenChange, fetching notifications"),b())},children:[(0,s.jsx)(V.ty,{asChild:!0,children:(0,s.jsxs)(M.$,{variant:"ghost",size:"icon",className:"text-white/80 hover:text-white relative p-0",children:[(0,s.jsx)(W.A,{className:"w-5 h-5"}),m&&(0,s.jsx)(H.E,{variant:"notification",size:"notification",className:"absolute -top-2 -right-2 z-50",children:o.unread>99?"99+":o.unread}),(0,s.jsx)("span",{className:"sr-only",children:"Notifications"})]})}),(0,s.jsxs)(V.SQ,{align:"end",className:"w-80 max-h-[80vh] overflow-y-auto",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,s.jsx)("h3",{className:"font-medium",children:"Notifications"}),o.unread>0&&(0,s.jsxs)(M.$,{variant:"ghost",size:"sm",onClick:j,children:[(0,s.jsx)($.A,{className:"h-4 w-4 mr-2"}),"Mark all read"]})]}),(0,s.jsx)(V.mB,{}),u?(0,s.jsxs)("div",{className:"py-8 px-4 text-center",children:[(0,s.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900 mx-auto mb-2"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading notifications..."})]}):y?(0,s.jsxs)("div",{className:"py-8 px-4 text-center",children:[(0,s.jsx)(J.A,{className:"h-8 w-8 text-orange-500 mx-auto mb-2"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Authentication required"}),(0,s.jsx)(M.$,{variant:"outline",size:"sm",onClick:()=>(0,P.signIn)(),children:"Sign in"})]}):h?(0,s.jsxs)("div",{className:"py-8 px-4 text-center",children:[(0,s.jsx)(Q.A,{className:"h-8 w-8 text-red-500 mx-auto mb-2"}),(0,s.jsx)("p",{className:"text-sm text-red-500 mb-2",children:h}),(0,s.jsx)(M.$,{variant:"outline",size:"sm",onClick:b,children:"Retry"})]}):0===i.length&&x?(0,s.jsxs)("div",{className:"py-8 px-4 text-center",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No notifications found"}),(0,s.jsx)(M.$,{variant:"outline",size:"sm",className:"mt-2",onClick:b,children:"Refresh"})]}):0===i.length?(0,s.jsx)("div",{className:"py-8 px-4 text-center",children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No notifications"})}):(0,s.jsx)(s.Fragment,{children:w.map(e=>(0,s.jsx)(V._2,{className:"px-4 py-3 cursor-default",children:(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between",children:[(0,s.jsxs)("div",{className:"max-w-[90%]",children:[(0,s.jsxs)("div",{className:"text-sm font-medium",children:[e.title,!e.isRead&&(0,s.jsx)(H.E,{variant:"secondary",className:"ml-2 bg-blue-500 text-white",children:"New"}),"leantime"===e.source&&(0,s.jsxs)(H.E,{variant:"outline",className:"ml-2 text-[10px] py-0 px-1.5 bg-amber-50 text-amber-700 border-amber-200 flex items-center",children:[(0,s.jsx)(I.A,{className:"mr-1 h-2.5 w-2.5"}),"Agilit\xe9"]})]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(0,Z.m)(new Date(e.timestamp),{addSuffix:!0}),e.source&&(0,s.jsxs)("span",{className:"ml-1 opacity-75",children:["• ","leantime"===e.source?"Leantime":e.source]})]})]}),(0,s.jsxs)("div",{className:"flex space-x-1 ml-2",children:[!e.isRead&&(0,s.jsxs)(M.$,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>v(e.id),children:[(0,s.jsx)($.A,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{className:"sr-only",children:"Mark as read"})]}),e.link&&(0,s.jsx)(N(),{href:e.link,target:"_blank",children:(0,s.jsxs)(M.$,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",children:[(0,s.jsx)(K.A,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{className:"sr-only",children:"Open"})]})})]})]}),(0,s.jsx)(et,{html:e.message,className:"text-xs mt-1 notification-message"})]})},e.id))})]})]})})});var es=a(99840),er=a(45821),en=a(99474),ei=a(89852),eo=a(51154),el=a(54416);let ec=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(er.hJ,{ref:t,className:(0,y.cn)("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...r})});function ed(e){let{open:t,onOpenChange:a}=e,{data:n}=(0,P.useSession)(),[i,o]=(0,r.useState)(""),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(!1),[h,m]=(0,r.useState)(""),f=async()=>{if(!i.trim())return void m("Please enter a title for your note");if(!l.trim())return void m("Please enter content for your note");try{var e;u(!0),m("");let t={id:"user-".concat(null==n||null==(e=n.user)?void 0:e.id,"/notes/").concat(i).concat(i.endsWith(".md")?"":".md"),title:i,content:l,folder:"notes",mime:"text/markdown"};if(!(await fetch("/api/storage/files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok)throw Error("Failed to save note");o(""),c(""),a(!1)}catch(e){console.error("Error saving note:",e),m("Failed to save your note. Please try again.")}finally{u(!1)}};return(0,s.jsx)(es.lG,{open:t,onOpenChange:a,children:(0,s.jsxs)(es.ZJ,{children:[(0,s.jsx)(ec,{}),(0,s.jsxs)(es.Cf,{className:"sm:max-w-[500px] bg-white border-gray-200",children:[(0,s.jsx)(es.c7,{children:(0,s.jsx)(es.L3,{className:"text-gray-900",children:"Quick Note"})}),(0,s.jsxs)("div",{className:"grid gap-4 py-4",children:[h&&(0,s.jsx)("div",{className:"bg-red-50 text-red-500 p-2 rounded-md text-sm",children:h}),(0,s.jsx)("div",{className:"grid grid-cols-4 items-center gap-4",children:(0,s.jsx)(ei.p,{id:"title",placeholder:"Note title",className:"col-span-4 text-gray-800 bg-white border-gray-300 placeholder-gray-500",value:i,onChange:e=>o(e.target.value),disabled:d})}),(0,s.jsx)("div",{className:"grid grid-cols-4 items-center gap-4",children:(0,s.jsx)(en.T,{id:"content",placeholder:"What's on your mind?",className:"col-span-4 text-gray-800 bg-white border-gray-300 placeholder-gray-500",rows:10,value:l,onChange:e=>c(e.target.value),disabled:d})})]}),(0,s.jsxs)(es.Es,{children:[(0,s.jsx)(M.$,{variant:"destructive",onClick:()=>a(!1),disabled:d,className:"bg-red-600 hover:bg-red-700 text-white",children:"Cancel"}),(0,s.jsx)(M.$,{onClick:f,disabled:d,className:"bg-blue-600 hover:bg-blue-700 text-white",children:d?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eo.A,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Note"})]}),(0,s.jsxs)(er.bm,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 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",children:[(0,s.jsx)(el.A,{className:"h-4 w-4 text-gray-500"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})})}ec.displayName=er.hJ.displayName;var eu=a(87712),eh=a(18979);function em(){let[e,t]=(0,r.useState)(!1),[a,n]=(0,r.useState)(!1);return((0,r.useEffect)(()=>{if(window.electron){var e,a;return t(!0),null==(e=window.electron.windowState)||e.onMaximized(()=>n(!0)),null==(a=window.electron.windowState)||a.onUnmaximized(()=>n(!1)),()=>{window.electron&&window.electron.windowState&&(window.electron.windowState.removeMaximizedListener(),window.electron.windowState.removeUnmaximizedListener())}}},[]),e)?(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(M.$,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 text-white/70 hover:text-white hover:bg-transparent",onClick:()=>{var e;return null==(e=window.electron)?void 0:e.windowControl.minimize()},"aria-label":"Minimize",children:(0,s.jsx)(eu.A,{className:"h-3 w-3"})}),(0,s.jsx)(M.$,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 text-white/70 hover:text-white hover:bg-transparent",onClick:()=>{var e;return null==(e=window.electron)?void 0:e.windowControl.maximize()},"aria-label":"Maximize",children:(0,s.jsx)(eh.A,{className:"h-3 w-3"})}),(0,s.jsx)(M.$,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 text-white/70 hover:text-white hover:bg-red-500",onClick:()=>{var e;return null==(e=window.electron)?void 0:e.windowControl.close()},"aria-label":"Close",children:(0,s.jsx)(el.A,{className:"h-3 w-3"})})]}):null}var ef=a(49509);let ep=async()=>{try{let e=await Notification.requestPermission();return"granted"===e}catch(e){return console.error("Error requesting notification permission:",e),!1}};function ex(){var e;let[t,a]=(0,r.useState)(!1),{data:w,status:y}=(0,P.useSession)(),[k,A]=(0,r.useState)("online"),[C,S]=(0,r.useState)(!1);console.log("Session:",w),console.log("Status:",y);let I=e=>{var t;if(!(null==w||null==(t=w.user)?void 0:t.role))return console.log("No user roles found"),!1;let a=Array.isArray(w.user.role)?w.user.role:[w.user.role];console.log("Raw user roles:",a);let s=a.map(e=>e.replace(/^[\/]/,"").replace(/^ROLE_/,"").toLowerCase());console.log("Clean user roles:",s);let r=e.map(e=>e.toLowerCase());console.log("Clean required roles:",r);let n=r.some(e=>s.includes(e));return console.log("Has any role:",n),n},_={online:{color:"text-green-500",label:"Online",notifications:!0},busy:{color:"text-orange-500",label:"Busy",notifications:!1},away:{color:"text-gray-500",label:"Away",notifications:!1}},E=async e=>{if(A(e),"online"!==e){if(await ep()&&"serviceWorker"in navigator){var t;let e=await navigator.serviceWorker.ready;await (null==(t=e.pushManager.getSubscription())?void 0:t.then(e=>{e&&e.unsubscribe()}))}}else ep()},T=[{title:"WP-Admin",icon:n.A,href:"/wp-admin"},...[{title:"Centrale",icon:n.A,href:"/missions",requiredRoles:["entrepreneurship","admin"]},{title:"Equipes",icon:i.A,href:"/equipes",requiredRoles:["admin","entrepreneurship"]},{title:"TheMessage",icon:o.A,href:"/the-message",requiredRoles:["mediation","expression"]}].filter(e=>I(e.requiredRoles))],O=new Date,R=(0,q.GP)(O,"d MMMM yyyy",{locale:Y.fr}),z=(0,q.GP)(O,"HH:mm");return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed top-0 left-0 right-0 z-50 bg-black",children:(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-1",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,s.jsx)("button",{onClick:()=>a(!0),className:"text-white/80 hover:text-white",children:(0,s.jsx)(l.A,{className:"w-5 h-5"})}),(0,s.jsx)(N(),{href:"/",children:(0,s.jsx)(j.default,{src:"/Neahv2 logo W.png",alt:"Neah Logo",width:40,height:13,className:"text-white"})}),(0,s.jsx)(N(),{href:"/agenda",className:"text-white/80 hover:text-white",children:(0,s.jsx)(c.A,{className:"w-5 h-5"})}),(0,s.jsxs)(N(),{href:"/timetracker",className:"text-white/80 hover:text-white",children:[(0,s.jsx)(d.A,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"sr-only",children:"TimeTracker"})]}),(0,s.jsxs)("button",{onClick:()=>S(!0),className:"text-white/80 hover:text-white",children:[(0,s.jsx)(u.A,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"sr-only",children:"Notes"})]}),(0,s.jsxs)(N(),{href:"/alma",className:"text-white/80 hover:text-white",children:[(0,s.jsx)(h.A,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"sr-only",children:"ALMA"})]}),(0,s.jsxs)(N(),{href:"/vision",className:"text-white/80 hover:text-white",children:[(0,s.jsx)(m.A,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"sr-only",children:"Vision"})]}),(0,s.jsxs)(N(),{href:"/observatory",className:"text-white/80 hover:text-white",children:[(0,s.jsx)(f.A,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"sr-only",children:"Observatory"})]}),(0,s.jsxs)(N(),{href:"/radio",className:"text-white/80 hover:text-white",children:[(0,s.jsx)(p.A,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"sr-only",children:"Radio"})]}),(0,s.jsxs)(N(),{href:"/press",className:"text-white/80 hover:text-white",children:[(0,s.jsx)(x.A,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"sr-only",children:"Press"})]}),(0,s.jsxs)(N(),{href:"/announcement",className:"text-white/80 hover:text-white",children:[(0,s.jsx)(g.A,{className:"w-5 h-5"}),(0,s.jsx)("span",{className:"sr-only",children:"Announcement"})]})]}),(0,s.jsxs)("div",{className:"hidden md:flex flex-col items-center",children:[(0,s.jsx)("div",{className:"text-white/80 text-xs",children:R}),(0,s.jsx)("div",{className:"text-white text-sm font-medium",children:z})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(em,{}),(0,s.jsx)(ea,{}),"authenticated"===y&&(null==w?void 0:w.user)?(0,s.jsxs)(V.rI,{children:[(0,s.jsx)(V.ty,{className:"outline-none",children:(0,s.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-600 flex items-center justify-center text-white cursor-pointer hover:bg-blue-700 transition-colors",children:(()=>{var e;if(null==w||null==(e=w.user)?void 0:e.name){let e=w.user.name.split(" ");return e.length>=2?"".concat(e[0][0]).concat(e[e.length-1][0]).toUpperCase():e[0].slice(0,2).toUpperCase()}return"?"})()})}),(0,s.jsxs)(V.SQ,{align:"end",className:"w-56 bg-black/90 border-gray-700",children:[(0,s.jsx)(V.lp,{className:"text-white/80",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{children:(null==w||null==(e=w.user)?void 0:e.name)||"User"}),(0,s.jsxs)(V.rI,{children:[(0,s.jsx)(V.ty,{className:"outline-none",children:(0,s.jsxs)("div",{className:"flex items-center space-x-1 text-sm",children:[(0,s.jsx)(b.A,{className:"h-3 w-3 ".concat(_[k].color)}),(0,s.jsx)("span",{className:"text-gray-400",children:_[k].label})]})}),(0,s.jsxs)(V.SQ,{className:"bg-black/90 border-gray-700",children:[(0,s.jsxs)(V._2,{className:"text-white/80 hover:text-white hover:bg-black/50 cursor-pointer",onClick:()=>E("online"),children:[(0,s.jsx)(b.A,{className:"h-3 w-3 text-green-500 mr-2"}),(0,s.jsx)("span",{children:"Online"})]}),(0,s.jsxs)(V._2,{className:"text-white/80 hover:text-white hover:bg-black/50 cursor-pointer",onClick:()=>E("busy"),children:[(0,s.jsx)(b.A,{className:"h-3 w-3 text-orange-500 mr-2"}),(0,s.jsx)("span",{children:"Busy"})]}),(0,s.jsxs)(V._2,{className:"text-white/80 hover:text-white hover:bg-black/50 cursor-pointer",onClick:()=>E("away"),children:[(0,s.jsx)(b.A,{className:"h-3 w-3 text-gray-500 mr-2"}),(0,s.jsx)("span",{children:"Away"})]})]})]})]})}),(0,s.jsx)(V.mB,{className:"bg-gray-700"}),T.map(e=>(0,s.jsxs)(V._2,{className:"text-white/80 hover:text-white hover:bg-black/50 cursor-pointer",onClick:()=>window.location.href=e.href,children:[(0,s.jsx)(e.icon,{className:"mr-2 h-4 w-4"}),(0,s.jsx)("span",{children:e.title})]},e.title)),(0,s.jsxs)(V._2,{className:"text-white/80 hover:text-white hover:bg-black/50 cursor-pointer",onClick:async()=>{try{await (0,P.signOut)({callbackUrl:"/signin",redirect:!1});let e=new URL("".concat(ef.env.NEXT_PUBLIC_KEYCLOAK_ISSUER,"/protocol/openid-connect/logout"));e.searchParams.append("post_logout_redirect_uri",window.location.origin),e.searchParams.append("id_token_hint",(null==w?void 0:w.accessToken)||""),window.location.href=e.toString()}catch(e){console.error("Error during logout:",e),window.location.href="/signin"}},children:[(0,s.jsx)(v.A,{className:"mr-2 h-4 w-4"}),(0,s.jsx)("span",{children:"D\xe9connexion"})]})]})]}):(0,s.jsx)("div",{className:"cursor-pointer text-white/80 hover:text-white",children:(0,s.jsx)("span",{onClick:()=>(0,P.signIn)("keycloak",{callbackUrl:"/"}),children:"Login"})})]})]})}),(0,s.jsx)(G,{isOpen:t,onClose:()=>a(!1)}),(0,s.jsx)(ed,{open:C,onOpenChange:S})]})}function eg(){return(0,s.jsx)("footer",{className:"w-full p-4 bg-black text-white/80",children:(0,s.jsxs)("div",{className:"flex space-x-4 text-sm",children:[(0,s.jsx)(N(),{href:"/support",className:"hover:text-white",children:"Support"}),(0,s.jsx)(N(),{href:"/help",className:"hover:text-white",children:"Centre d'aide"}),(0,s.jsx)(N(),{href:"/privacy",className:"hover:text-white",children:"Confidentialit\xe9"}),(0,s.jsx)(N(),{href:"/tos",className:"hover:text-white",children:"Conditions d'utilisation"})]})})}function eb(e){let{children:t}=e,{data:a,status:n}=(0,P.useSession)(),i=(0,B.usePathname)(),o=(0,B.useRouter)();return((0,r.useEffect)(()=>{"unauthenticated"===n&&"/signin"!==i&&o.push("/signin")},[n,o,i]),"loading"===n)?(0,s.jsx)("div",{children:"Chargement..."}):"unauthenticated"===n&&"/signin"!==i?null:(0,s.jsx)(s.Fragment,{children:t})}var ev=a(53580),ej=a(26621),ew=a(74466);let eN=ej.Kq,ey=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(ej.LM,{ref:t,className:(0,y.cn)("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",a),...r})});ey.displayName=ej.LM.displayName;let ek=(0,ew.F)("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground","new-email":"border-blue-500 bg-blue-600 text-white"}},defaultVariants:{variant:"default"}}),eA=r.forwardRef((e,t)=>{let{className:a,variant:r,...n}=e;return(0,s.jsx)(ej.bL,{ref:t,className:(0,y.cn)(ek({variant:r}),a),...n})});eA.displayName=ej.bL.displayName,r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(ej.rc,{ref:t,className:(0,y.cn)("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",a),...r})}).displayName=ej.rc.displayName;let eC=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(ej.bm,{ref:t,className:(0,y.cn)("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",a),"toast-close":"",...r,children:(0,s.jsx)(el.A,{className:"h-4 w-4"})})});eC.displayName=ej.bm.displayName;let eS=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(ej.hE,{ref:t,className:(0,y.cn)("text-sm font-semibold",a),...r})});eS.displayName=ej.hE.displayName;let eI=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(ej.VY,{ref:t,className:(0,y.cn)("text-sm opacity-90",a),...r})});function e_(){let{toasts:e}=(0,ev.dj)();return(0,s.jsxs)(eN,{children:[e.map(function(e){let{id:t,title:a,description:r,action:n,...i}=e;return(0,s.jsxs)(eA,{...i,children:[(0,s.jsxs)("div",{className:"grid gap-1",children:[a&&(0,s.jsx)(eS,{children:a}),r&&(0,s.jsx)(eI,{children:r})]}),n,(0,s.jsx)(eC,{})]},t)}),(0,s.jsx)(ey,{})]})}eI.displayName=ej.VY.displayName;let eE=["/background/Autumn birger-strahl-6YZgnYaPD5s-unsplash.jpeg","/background/Moneral tobias-reich-VltYe88rkt8-unsplash.jpeg","/background/aaron-burden-cGW1w-qLix8-unsplash.jpg","/background/aaron-burden-xtIYGB0KEqc-unsplash.jpg","/background/art credit library-of-congress-ULl31hxiehE-unsplash.jpeg","/background/art-institute-of-chicago-fayEVJ03T7M-unsplash.jpg","/background/art-institute-of-chicago-j-3IgXK3iJg-unsplash.jpg","/background/art-institute-of-chicago-ueWnHtoaplI-unsplash.jpg","/background/art-institute-of-chicago-yIgLfU6EEBw-unsplash.jpg","/background/birmingham-museums-trust-M9ryRhN4YSI-unsplash.jpg","/background/david-ramirez-LC7lLC9jDzw-unsplash.jpg","/background/europeana-HDIOpM_XXbI-unsplash.jpg","/background/gabor-juhasz-B1Zyw7sdm5w-unsplash.jpg","/background/gonzalo-mendiola-XXCrAQgQnVw-unsplash.jpg","/background/ian-keefe-OgcJIKRnRC8-unsplash.jpg","/background/japan credit dale-scogings-_SBsVi4kmkY-unsplash.jpeg","/background/japan credit david-edelstein-N4DbvTUDikw-unsplash.jpeg","/background/japan credit falco-negenman-K8MMfFifWcE-unsplash.jpeg","/background/japan credit galen-crout-0_xMuEbpFAQ-unsplash.jpeg","/background/japan credit gilly-cLnFkSji734-unsplash.jpeg","/background/japan credit matthew-buchanan-VVi59Xtsd8Y-unsplash.jpeg","/background/japan credit redd-f-Bxzrd0p6yOM-unsplash.jpeg","/background/japan credit redd-f-wPMvPMD9KBI-unsplash.jpeg","/background/japan credit sorasak-_UIN-pFfJ7c-unsplash.jpeg","/background/japan credittianshu-liu-SBK40fdKbAg-unsplash.jpeg","/background/japan.jpeg","/background/joel-holland-TRhGEGdw-YY-unsplash.jpg","/background/marko-blazevic-S7mAngnWV1A-unsplash.jpg","/background/museum-of-new-zealand-te-papa-tongarewa-h2qlQSm7N-0-unsplash.jpg","/background/redd-f-Lm5rkxzgiFQ-unsplash.jpg","/background/spencer-davis-ONVA6s03hg8-unsplash.jpg","/background/summer credit spencer-everett-DdVOCPTofFc-unsplash.jpeg","/background/summer.jpeg","/background/sylvain-mauroux-jYCUBAIUsk8-unsplash.jpg","/background/the-cleveland-museum-of-art-6uIO1CNv3Vc-unsplash.jpg","/background/the-cleveland-museum-of-art-Tl9uudd4DOE-unsplash.jpg","/background/the-cleveland-museum-of-art-WQOzF8TSnRQ-unsplash.jpg","/background/tingfeng-xia-WwKrhith4l4-unsplash.jpg","/background/vegetal credit yuya-murakami-VkcD1QxtY4A-unsplash.jpeg","/background/vegetal ryunosuke-kikuno-U8_eaHSUwdw-unsplash.jpeg"];function eT(e){let{children:t,isSignInPage:a,isAuthenticated:n}=e,{currentBackground:i,changeBackground:o}=function(){let[e,t]=(0,r.useState)(eE[0]);return(0,r.useEffect)(()=>{let e=Math.floor(Math.random()*eE.length);t(eE[e])},[]),{currentBackground:e,changeBackground:()=>{let a=(eE.indexOf(e)+1)%eE.length;t(eE[a])}}}();return(0,s.jsxs)(eb,{children:[!a&&n&&(0,s.jsx)(ex,{}),(0,s.jsx)("div",{className:"min-h-screen",style:a?{}:{backgroundImage:"url('".concat(i,"')"),backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundAttachment:"fixed",cursor:"pointer",transition:"background-image 0.5s ease-in-out"},onClick:a?void 0:o,children:(0,s.jsx)("main",{children:t})}),!a&&n&&(0,s.jsx)(eg,{}),(0,s.jsx)(e_,{})]})}},16891:(e,t,a)=>{"use strict";a.d(t,{F:()=>o});var s=a(95155),r=a(12115),n=a(64792),i=a(53999);let o=r.forwardRef((e,t)=>{let{className:a,children:r,...o}=e;return(0,s.jsxs)(n.bL,{ref:t,className:(0,i.cn)("relative overflow-hidden",a),...o,children:[(0,s.jsx)(n.LM,{className:"h-full w-full rounded-[inherit]",children:r}),(0,s.jsx)(l,{}),(0,s.jsx)(n.OK,{})]})});o.displayName=n.bL.displayName;let l=r.forwardRef((e,t)=>{let{className:a,orientation:r="vertical",...o}=e;return(0,s.jsx)(n.VM,{ref:t,orientation:r,className:(0,i.cn)("flex touch-none select-none transition-colors","vertical"===r&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===r&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",a),...o,children:(0,s.jsx)(n.lr,{className:"relative flex-1 rounded-full bg-border"})})});l.displayName=n.VM.displayName},19324:()=>{},53580:(e,t,a)=>{"use strict";a.d(t,{dj:()=>h});var s=a(12115);let r=0,n=new Map,i=e=>{if(n.has(e))return;let t=setTimeout(()=>{n.delete(e),d({type:"REMOVE_TOAST",toastId:e})},1e6);n.set(e,t)},o=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:a}=t;return a?i(a):e.toasts.forEach(e=>{i(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===a||void 0===a?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},l=[],c={toasts:[]};function d(e){c=o(c,e),l.forEach(e=>{e(c)})}function u(e){let{...t}=e,a=(r=(r+1)%Number.MAX_SAFE_INTEGER).toString(),s=()=>d({type:"DISMISS_TOAST",toastId:a});return d({type:"ADD_TOAST",toast:{...t,id:a,open:!0,onOpenChange:e=>{e||s()}}}),{id:a,dismiss:s,update:e=>d({type:"UPDATE_TOAST",toast:{...e,id:a}})}}function h(){let[e,t]=s.useState(c);return s.useEffect(()=>(l.push(t),()=>{let e=l.indexOf(t);e>-1&&l.splice(e,1)}),[e]),{...e,toast:u,dismiss:e=>d({type:"DISMISS_TOAST",toastId:e})}}},53709:(e,t,a)=>{Promise.resolve().then(a.t.bind(a,19324,23)),Promise.resolve().then(a.bind(a,9513)),Promise.resolve().then(a.bind(a,78743)),Promise.resolve().then(a.t.bind(a,65299,23))},53999:(e,t,a)=>{"use strict";a.d(t,{cn:()=>n});var s=a(52596),r=a(39688);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,r.QP)((0,s.$)(t))}},67133:(e,t,a)=>{"use strict";a.d(t,{SQ:()=>h,_2:()=>m,lp:()=>f,mB:()=>p,rI:()=>d,ty:()=>u});var s=a(95155),r=a(12115),n=a(73447),i=a(13052),o=a(5196),l=a(9428),c=a(53999);let d=n.bL,u=n.l9;n.YJ,n.ZL,n.Pb,n.z6,r.forwardRef((e,t)=>{let{className:a,inset:r,children:o,...l}=e;return(0,s.jsxs)(n.ZP,{ref:t,className:(0,c.cn)("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",a),...l,children:[o,(0,s.jsx)(i.A,{className:"ml-auto"})]})}).displayName=n.ZP.displayName,r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(n.G5,{ref:t,className:(0,c.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",a),...r})}).displayName=n.G5.displayName;let h=r.forwardRef((e,t)=>{let{className:a,sideOffset:r=4,...i}=e;return(0,s.jsx)(n.ZL,{children:(0,s.jsx)(n.UC,{ref:t,sideOffset:r,className:(0,c.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground 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",a),...i})})});h.displayName=n.UC.displayName;let m=r.forwardRef((e,t)=>{let{className:a,inset:r,...i}=e;return(0,s.jsx)(n.q7,{ref:t,className:(0,c.cn)("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",a),...i})});m.displayName=n.q7.displayName,r.forwardRef((e,t)=>{let{className:a,children:r,checked:i,...l}=e;return(0,s.jsxs)(n.H_,{ref:t,className:(0,c.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),checked:i,...l,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(n.VF,{children:(0,s.jsx)(o.A,{className:"h-4 w-4"})})}),r]})}).displayName=n.H_.displayName,r.forwardRef((e,t)=>{let{className:a,children:r,...i}=e;return(0,s.jsxs)(n.hN,{ref:t,className:(0,c.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...i,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(n.VF,{children:(0,s.jsx)(l.A,{className:"h-2 w-2 fill-current"})})}),r]})}).displayName=n.hN.displayName;let f=r.forwardRef((e,t)=>{let{className:a,inset:r,...i}=e;return(0,s.jsx)(n.JU,{ref:t,className:(0,c.cn)("px-2 py-1.5 text-sm font-semibold",r&&"pl-8",a),...i})});f.displayName=n.JU.displayName;let p=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(n.wv,{ref:t,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",a),...r})});p.displayName=n.wv.displayName},78743:(e,t,a)=>{"use strict";a.d(t,{Providers:()=>n});var s=a(95155),r=a(12108);function n(e){let{children:t}=e;return(0,s.jsx)(r.SessionProvider,{children:t})}},88145:(e,t,a)=>{"use strict";a.d(t,{E:()=>o});var s=a(95155);a(12115);var r=a(74466),n=a(53999);let i=(0,r.F)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",notification:"border-transparent bg-red-500 text-white hover:bg-red-600 absolute -top-1 -right-1 px-1.5 py-0.5 min-w-[1.25rem] h-5 flex items-center justify-center"},shape:{default:"rounded-full",pill:"rounded-full",square:"rounded-md"},size:{default:"text-xs px-2.5 py-0.5",sm:"text-xs px-2 py-0.25 h-3.5 min-w-[1rem]",lg:"text-sm px-3 py-1",notification:"text-xs px-1.5 py-0.5 h-5 min-w-[1.25rem]"}},defaultVariants:{variant:"default",shape:"default",size:"default"}});function o(e){let{className:t,variant:a,shape:r,size:o,...l}=e;return(0,s.jsx)("div",{className:(0,n.cn)(i({variant:a,shape:r,size:o}),t),...l})}},89852:(e,t,a)=>{"use strict";a.d(t,{p:()=>i});var s=a(95155),r=a(12115),n=a(53999);let i=r.forwardRef((e,t)=>{let{className:a,type:r,...i}=e;return(0,s.jsx)("input",{type:r,className:(0,n.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground 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 md:text-sm",a),ref:t,...i})});i.displayName="Input"},97168:(e,t,a)=>{"use strict";a.d(t,{$:()=>c,r:()=>l});var s=a(95155),r=a(12115),n=a(99708),i=a(74466),o=a(53999);let l=(0,i.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),c=r.forwardRef((e,t)=>{let{className:a,variant:r,size:i,asChild:c=!1,...d}=e,u=c?n.DX:"button";return(0,s.jsx)(u,{className:(0,o.cn)(l({variant:r,size:i,className:a})),ref:t,...d})});c.displayName="Button"},99474:(e,t,a)=>{"use strict";a.d(t,{T:()=>i});var s=a(95155),r=a(12115),n=a(53999);let i=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("textarea",{className:(0,n.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-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 md:text-sm",a),ref:t,...r})});i.displayName="Textarea"},99840:(e,t,a)=>{"use strict";a.d(t,{Cf:()=>h,Es:()=>f,L3:()=>p,ZJ:()=>d,c7:()=>m,lG:()=>l,rr:()=>x,zM:()=>c});var s=a(95155),r=a(12115),n=a(45821),i=a(54416),o=a(53999);let l=n.bL,c=n.l9,d=n.ZL;n.bm;let u=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(n.hJ,{ref:t,className:(0,o.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})});u.displayName=n.hJ.displayName;let h=r.forwardRef((e,t)=>{let{className:a,children:r,...l}=e;return(0,s.jsxs)(d,{children:[(0,s.jsx)(u,{}),(0,s.jsxs)(n.UC,{ref:t,className:(0,o.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-white p-6 shadow-lg duration-200 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%] sm:rounded-lg",a),...l,children:[r,(0,s.jsxs)(n.bm,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 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",children:[(0,s.jsx)(i.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});h.displayName=n.UC.displayName;let m=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...a})};m.displayName="DialogHeader";let f=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,o.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};f.displayName="DialogFooter";let p=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(n.hE,{ref:t,className:(0,o.cn)("text-lg font-semibold leading-none tracking-tight",a),...r})});p.displayName=n.hE.displayName;let x=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(n.VY,{ref:t,className:(0,o.cn)("text-sm text-muted-foreground",a),...r})});x.displayName=n.VY.displayName}},e=>{var t=t=>e(e.s=t);e.O(0,[2533,9854,4277,2108,5685,8067,6874,1334,5004,4361,8441,1684,7358],()=>t(53709)),_N_E=e.O()}]);