1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/QuickQrModal-D6e9IYaK.js","assets/vendor-tiptap-CRdka2py.js","assets/vendor-i18n-Do9jGewF.js","assets/browser-DHQErJaB.js","assets/constants-CeJOtMm9.js","assets/discipline-CdVyycxc.js","assets/vendor-qr-CqIydqGu.js"])))=>i.map(i=>d[i]); 2import{r as R,H as W,aE as _,aH as O,aF as Q,aT as $}from"./index-Dm1QE6j5.js";import{j as e}from"./vendor-tiptap-CRdka2py.js";import{b as a,u as A,R as D}from"./vendor-i18n-Do9jGewF.js";import{L as U}from"./Logo-B03P7U9X.js";import"./vendor-firebase-B7FTlnjY.js";import{L as V}from"./LanguageSwitcher-GPbGxAv_.js";import{u as F,a as P,b as q}from"./useMemberMessages-CDSZKJOk.js";import"./memberMessages-BHXdkRPx.js";import"./youtube-CPSuZNLQ.js";const G=()=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M12 12a5 5 0 100-10 5 5 0 000 10z"})}),J=()=>e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})}),C=()=>
2{const[o,h]=a.useState(null);a.useEffect(()=>{const n=document.documentElement.classList.contains("dark");h(n?"dark":"light")},[]),a.useEffect(()=>{if(o===null)return;const n=window.document.documentElement;o==="dark"?(n.classList.add("dark"),localStorage.setItem("flowroll_theme","dark")):(n.classList.remove("dark"),localStorage.setItem("flowroll_theme","light"))},[o]),a.useEffect(()=>{const n=p=>{if(p.key!=="flowroll_theme")return;const c=p.newValue;(c==="dark"||c==="light")&&h(c)};return window.addEventListener("storage",n),()=>window.removeEventListener("storage",n)},[]);const m=()=>{h(n=>n==="dark"?"light":"dark")};if(o===null)return e.jsx("div",{className:"p-2.5 rounded-full w-[42px] h-[42px]","aria-hidden":"true"});const u=o==="dark";return e.jsx("button",{onClick:m,className:"group p-2.5 rounded-full bg-white dark:bg-zinc-800 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-700 border border-zinc-200 dark:border-zinc-700 shadow-sm hover:shadow-md transition-all duration-300 focus:outline-none focus:ring-2 focus:ring-zinc-200 dark:focus:ring-zinc-700","aria-label":u?"Växla till ljust läge":"Växla till mörkt läge",title:u?"Växla till ljust läge":"Växla till mörkt läge",children:e.jsxs("div",{className:"relative w-5 h-5 overflow-hidden",children:[e.jsx("style",{children:".ease-spring { transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }"}),e.jsx("div",{className:`absolute inset-0 transform transition-transform duration-500 ease-spring ${u?"rotate-0 opacity-100":"-rotate-90 opacity-0"}`,children:e.jsx(G,{})}),e.jsx("div",{className:`absolute inset-0 transform transition-transform duration-500 ease-spring ${u?"rotate-90 opacity-0":"rotate-0 opacity-100"}`,children:e.jsx(J,{})})]})})},K=()=>
2{const[o,h]=a.useState(null),[m,u]=a.useState(null),[n,p]=a.useState(!1),c=async()=>{const d=await R();d&&(p(!!d.alertBarEnabled),h(d.clubName||null),u(d.logoUrl||null))};return a.useEffect(()=>{c();const d=()=>{W(),c()};return window.addEventListener("clubSettingsUpdated",d),()=>{window.removeEventListener("clubSettingsUpdated",d)}},[]),!n||!o?null:e.jsx("div",{className:"w-full bg-zinc-950 dark:bg-zinc-950 border-b border-zinc-800 z-50 relative overflow-hidden",children:e.jsx("div",{className:"container mx-auto px-4 md:px-8",children:e.jsxs("div",{className:"flex items-center justify-center gap-3 h-10 md:h-14 py-1",children:[m&&e.jsx("img",{src:m,alt:o,className:"max-h-full w-auto object-contain"}),e.jsx("span",{className:"text-[10px] md:text-xs font-black text-white uppercase tracking-[0.25em] whitespace-nowrap",children:o}),e.jsxs("div",{className:"flex items-center gap-1.5 ml-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 bg-green-500 rounded-full animate-pulse"}),e.jsx("span",{className:"text-[8px] font-bold text-green-400 uppercase tracking-widest hidden sm:inline",children:"Verifierad"})]})]})})})},X=D.lazy(()=>$(()=>import("./QuickQrModal-D6e9IYaK.js"),__vite__mapDeps([0,1,2,3,4,5,6])).then(o=>({default:o.QuickQrModal}))),Y=()=>e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",children:e.jsx("div",{className:"w-10 h-10 border-4 border-zinc-200 dark:border-zinc-700 border-t-primary rounded-full animate-spin"})}),de=({activeTab:o,setActiveTab:h,onLogout:m,onLogin:u,onRegister:n,onNavigateToDashboard:p,onViewProfile:c,onToggleSidebar:d,sidebarCollapsed:M})=>{const{currentUser:s,activeProfile:r,setActiveProfile:L}=_(),{users:k,invoices:v,familyMembers:f}=O(),{t:l}=A(),[j,x]=a.useState(!1),[Z,ee]=a.useState(!1),[E,z]=a.useState(!1),b=a.useRef(null);a.useEffect(()=>{const t=i=>{b.current&&!b.current.contains(i.target)&&x(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[b]);const w=a.useMemo(()=>{if(!s||!v)return 0;let t=[s.id];return s.familyRole==="guardian"&&f.length>0&&(t=f.map(i=>i.id)),v.filter(i=>i.recipient.userId&&t.includes(i.recipient.userId)&&(i.status==="sent"||i.status==="overdue")).length},[v,s,f]),N=t=>{const i=k.find(B=>B.id===t);i&&(L(i),x(!1))},y=a.useMemo(()=>s?f.filter(t=>
2t.familyRole==="child"&&t.id!==s.id).concat(k.filter(t=>t.familyRole==="child"&&t.extraGuardianIds?.includes(s.id)&&!f.some(i=>i.id===t.id))):[],[s,f,k]),S=r?`${r.firstName?.[0]||""}${r.lastName?.[0]||""}`.toUpperCase():"",{unseenSharedTechniqueCount:I}=F({ownerId:r?.id,enabled:!!r}),{pendingConnectionRequests:T}=P({user:r,enabled:!!r}),{unreadMessageCount:H}=q({userId:r?.id,enabled:!!r}),g=I+T.length+H;return e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"safe-area-top sticky top-0 z-40 w-full border-b border-zinc-200 dark:border-dark-border bg-white/95 dark:bg-dark-bg/95 backdrop-blur-xl transition-all duration-300 shadow-elevation-1 dark:shadow-none",children:[e.jsx(K,{}),e.jsx("div",{className:"container mx-auto px-4 md:px-8",children:e.jsxs("div",{className:"flex justify-between items-center h-14 md:h-20",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[s&&e.jsx("button",{onClick:d,className:"p-2.5 rounded-xl hover:bg-zinc-100 dark:hover:bg-zinc-900 transition-colors text-zinc-600 dark:text-zinc-300",children:e.jsx("svg",{className:`w-6 h-6 transition-transform duration-500 ${M?"":"rotate-180"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M13 5l7 7-7 7M5 5l7 7-7 7"})})}),e.jsx("div",{className:"cursor-pointer group",onClick:p,children:e.jsx(U,{className:"h-8 md:h-10"})})]}),e.jsx("div",{className:"flex items-center gap-3",children:s&&r?e.jsxs(e.Fragment,{children:[s?.role==="admin"&&e.jsx("button",{onClick:()=>Q("/"),className:"group p-2.5 rounded-full bg-zinc-50 dark:bg-dark-surface-1 text-primary dark:text-primary-light hover:bg-primary/10 dark:hover:bg-primary/10 border border-zinc-200 dark:border-zinc-700 shadow-elevation-0 hover:shadow-elevation-1 transition-all duration-300 focus:outline-none focus:ring-2 focus:ring-primary/20","aria-label":l("header.viewWebsite"),title:l("header.viewWebsite"),children:e.jsxs("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})}),e.jsx("button",{onClick:()=>z(!0),className:"group p-2.5 rounded-full bg-zinc-50 dark:bg-dark-surface-1 text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-dark-surface-2 border border-zinc-200 dark:border-zinc-700 shadow-elevation-0 hover:shadow-elevation-1 transition-all duration-300 focus:outline-none focus:ring-2 focus:ring-primary/20","aria-label":l("header.memberCard"),title:l("header.memberCard"),children:e.jsx("svg",{className:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M3 3h4v4H3zM9 3h2v2H9zM15 3h2v2h-2zM21 3v2h-2zM3 9h2v2H3zM21 9v2h-2zM3 15h2v2H3zM21 15v2h-2zM15 15h2v2h-2zM9 9h6v6H9zM9 15h2v2H9zM15 21h2v-2h-2z"})})}),e.jsx(C,{}),e.jsxs("div",{className:"relative",ref:b,children:[e.jsxs("button",{onClick:()=>x(!j),className:"flex items-center gap-3 pl-1.5 pr-2 py-1.5 rounded-2xl hover:bg-zinc-50 dark:hover:bg-dark-surface-1 transition-all duration-200 border border-transparent hover:border-zinc-200 dark:hover:border-zinc-700",children:[e.jsxs("div",{className:"relative shrink-0",children:[e.jsx("div",{className:"h-9 w-9 rounded-xl bg-zinc-900 dark:bg-zinc-800 flex items-center justify-center text-white font-black text-xs ring-2 ring-zinc-100 dark:ring-zinc-800 shadow-sm overflow-hidden",children:r.profilePicture?e.jsx("img",{src:r.profilePicture,className:"w-full h-full object-cover"}):e.jsx("span",{children:S})}),g>0&&e.jsx("span",{className:"absolute -top-1.5 -right-1.5 min-w-[18px] h-[18px] px-1 flex items-center justify-center bg-red-500 border-2 border-white dark:border-black rounded-full text-white text-[9px] font-black",children:g})]}),w>0&&e.jsx("span",{className:"absolute top-1 left-8 w-3 h-3 bg-primary border-2 border-white dark:border-black rounded-full animate-pulse"}),e.jsxs("div",{className:"hidden sm:flex flex-col items-start text-left",children:[e.jsx("span",{className:"font-black text-xs text-zinc-900 dark:text-white uppercase tracking-tight",children:r.firstName}),e.jsx("span",{className:"text-[9px] text-primary font-black tracking-widest uppercase",children:r.role})]})]}),j&&e.jsxs("div",{className:"absolute top-full right-0 mt-3 w-80 bg-white dark:bg-dark-surface-1 rounded-2xl shadow-elevation-3 py-3 z-50 border border-zinc-200 dark:border-zinc-700 animate-in fade-in zoom-in-95 duration-200",children:[e.jsxs("button",{onClick:()=>{s&&N(s.id),c(),x(!1)},className:`w-full text-left px-5 py-4 text-sm font-black text-zinc-700 dark:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-dark-surface-2 flex items-center justify-between uppercase tracking-widest transition-all duration-200 ${r?.id===s?.id?"bg-primary/5":""}`,children:[e.jsxs("span",{className:"flex items-center gap-2",children:[r?.id===s?.id&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-primary inline-block"}),s?.firstName," ",s?.lastName]}),w>0&&e.jsxs("span",{className:"text-[9px] bg-red-600 text-white px-2 py-1 rounded-lg",children:[w," ",l("header.unpaid")]})]}),y.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-5 pt-2 pb-1",children:e.jsx("span",{className:"text-[9px] font-black text-zinc-400 dark:text-zinc-500 uppercase tracking-[0.2em]",children:l("header.children")})}),y.map(t=>e.jsxs("button",{onClick:()=>{N(t.id),c(t.id),x(!1)},className:`w-full text-left px-5 py-3 text-sm font-bold text-zinc-700 dark:text-zinc-200 hover:bg-zinc-50 dark:hover:bg-dark-surface-2 flex items-center gap-3 transition-all duration-200 ${r?.id===t.id?"bg-primary/5":""}`,children:[e.jsxs("div",{className:"w-7 h-7 rounded-lg bg-zinc-200 dark:bg-zinc-700 flex items-center justify-center text-[10px] font-black text-zinc-600 dark:text-zinc-300 flex-shrink-0",children:[t.firstName?.[0],t.lastName?.[0]]}),e.jsxs("span",{className:"flex-1 uppercase tracking-wide text-xs",children:[t.firstName," ",t.lastName]}),r?.id===t.id&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-primary flex-shrink-0"})]},t.id))]}),e.jsx("div",{className:"h-px bg-zinc-100 dark:bg-zinc-800 my-2 mx-5"}),g>0&&e.jsxs("button",{onClick:()=>{c(r?.id,"training"),x(!1)},className:"w-full text-left px-5 py-3 text-xs font-black uppercase tracking-[0.2em] transition-colors flex items-center justify-between gap-4 hover:bg-zinc-50 dark:hover:bg-dark-surface-2 text-zinc-700 dark:text-zinc-200",children:[e.jsxs("span",{className:"flex items-center gap-4",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),l("header.training")]}),e.jsx("span",{className:"text-[9px] bg-red-500 text-white px-2 py-1 rounded-lg",children:l("header.newCount",{count:g})})]}),e.jsxs("button",{onClick:()=>{c(),x(!1)},className:"w-full text-left px-5 py-3 text-xs text-zinc-500 dark:text-zinc-400 font-black uppercase tracking-[0.2em] transition-colors flex items-center gap-4 hover:bg-zinc-50 dark:hover:bg-dark-surface-2",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),l("header.myProfile")]}),e.jsxs("button",{onClick:()=>{m(),x(!1)},className:"w-full text-left px-5 py-3 text-xs text-red-600 font-black uppercase tracking-[0.2em] transition-colors flex items-center gap-4 hover:bg-red-50 dark:hover:bg-red-900/10",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M17 16l4-4m0 0l-4-4m4 4H7"})}),l("auth.logout")]})]})]})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(V,{compact:!0}),e.jsx(C,{}),e.jsx("button",{onClick:u,className:"text-xs font-black text-zinc-600 dark:text-zinc-400 uppercase tracking-widest px-4 py-2",children:l("auth.login")}),e.jsx("button",{onClick:n,className:"bg-primary hover:bg-primary-hover text-white text-[10px] font-black py-3 px-6 rounded-xl transition-all duration-200 shadow-glow hover:shadow-elevation-2 uppercase tracking-widest active:scale-[0.97]",children:l("header.becomeMember")})]})})]})})]}),E&&r&&e.jsx(a.Suspense,{fallback:e.jsx(Y,{}),children:e.jsx(X,{user:r,onClose:()=>z(!1)})})]})};export{de as Header};
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.