1import{r as a,j as e,X as T,A as k,m as I,I as S,u as E,a as D,b as R,M as z,U as M,O as A,g as B,c as O,d as P,e as L}from"./index-U1SflU2i.js";import{c as m,C as U,a as q,B as g}from"./button-CK_AI-sw.js";const w=a.forwardRef(({className:o,variant:n,...t},r)=>e.jsx("div",{ref:r,className:m("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",n==="destructive"?"border-destructive bg-destructive text-destructive-foreground":"border-border bg-background",o),...t}));w.displayName="Toast";const N=a.forwardRef(({className:o,...n},t)=>e.jsx("button",{ref:t,className:m("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",o),"toast-close":"",...n,children:e.jsx(T,{className:"h-4 w-4"})}));N.displayName="ToastClose";const v=a.forwardRef(({className:o,...n},t)=>e.jsx("div",{ref:t,className:m("text-sm font-semibold",o),...n}));v.displayName="ToastTitle";const y=a.forwardRef(({className:o,...n},t)=>e.jsx("div",{ref:t,className:m("text-sm opacity-90",o),...n}));y.displayName="ToastDescription";const V=a.createContext({success:()=>{},error:()=>{},info:()=>{},removeToast:()=>{}});function W({children:o}){const[n,t]=a.useState([]),r=a.useCallback((s,l,i,p=5e3)=>{const b=Math.random().toString(36).substring(2,9);return t(j=>[...j,{id:b,type:s,title:l,description:i,duration:p}]),p!==Number.POSITIVE_INFINITY&&setTimeout(()=>{t(j=>j.filter(C=>C.id!==b))},p),b},[]),d=a.useCallback(s=>{t(l=>l.filter(i=>i.id!==s))},[]),x=a.useCallback((s,l,i)=>r("success",s,l,i),[r]),u=a.useCallback((s,l,i)=>r("error",s,l,i),[r]),f=a.useCallback((s,l,i)=>r("info",s,l,i),[r]),h=s=>{switch(s){case"success":return e.jsx(q,{className:"h-5 w-5 text-green-500"});case"error":return e.jsx(U,{className:"h-5 w-5 text-red-500"});case"info":return e.jsx(S,{className:"h-5 w-5 text-blue-500"});default:return null}},c=s=>{switch(s){case"success":return"border-green-200 bg-green-50";case"error":return"border-red-200 bg-red-50";case"info":return"border-blue-200 bg-blue-50";default:return""}};return e.jsxs(V.Provider,{value:{success:x,error:u,info:f,removeToast:d},children:[o,e.jsx("div",{className:"fixed bottom-4 right-4 z-[9999] flex flex-col gap-2 max-w-md",children:e.jsx(k,{children:n.map(s=>e.jsx(I.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},transition:{duration:.2},className:"w-full",children:e.jsxs(w,{className:c(s.type),children:[e.jsxs("div",{className:"flex items-start",children:[e.jsx("div",{className:"flex-shrink-0 mr-3",children:h(s.type)}),e.jsxs("div",{className:"flex-1",children:[e.jsx(v,{children:s.title}),s.description&&e.jsx(y,{children:s.description})]})]}),e.jsx(N,{onClick:()=>d(s.id)})]})},s.id))})})]})}function Y({children:o}){const[n,t]=a.useState(!1),[r,d]=a.useState(window.innerWidth<1024),[,x]=E(L),{impersonatedRole:u}=D(),f=u!==null,{user:h}=R();return a.useEffect(()=>{(async()=>{try{const l=(await B(O(P,"slp"))).docs.map(i=>({id:i.id,...i.data()}));x(l[1].properties)}catch(s){console.error("Error al obtener usuarios:",s)}})()},[]),a.useEffect(()=>{const c=()=>d(window.innerWidth<1024);return window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[]),e.jsx(W,{children:e.jsxs("div",{className:"min-h-screen bg-gray-100 w-full flex",children:[!r&&e.jsx("div",{className:"w-64 hidden lg:block flex-shrink-0",children:e.jsx(Sidebar,{})}),r&&n&&e.jsx("div",{className:"fixed inset-0 z-50 bg-black/50",onClick:()=>t(!1),children:e.jsx("div",{className:"w-64 h-full bg-white",onClick:c=>c.stopPropagation(),children:e.jsx(Sidebar,{onClose:()=>t(!1)})})}),e.jsxs("div",{className:"flex-1 flex flex-col w-full",children:[e.jsxs("header",{className:"bg-white border-b flex items-center justify-between p-4 w-full",children:[r&&e.jsx(g,{variant:"ghost",size:"icon",onClick:()=>t(!0),children:e.jsx(z,{className:"h-6 w-6"})}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"flex items-center space-x-4",children:e.jsxs(g,{variant:"ghost",className:"flex items-center gap-2 px-2","aria-label":"View profile",children:[e.jsx("div",{className:"h-8 w-8 rounded-full bg-gray-200 flex items-center justify-center overflow-hidden border border-gray-200",children:e.jsx(M,{className:"h-4 w-4 text-gray-500"})}),e.jsx("span",{className:"hidden md:inline-block text-sm font-medium",children:e.jsx("span",{className:"hidden md:inline-block text-sm font-medium",children:f?`ð¤ Impersonando como ${u}`:h?.email||"Usuario"})})]})})]}),e.jsxs("main",{className:"flex-1 w-full p-4 lg:p-6",children:[o,e.jsx(A,{})]})]})]})})}export{Y as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.