1import{j as e}from"./vendor-react-YcQeLyCT.js";import{c as k,h as n,j as c,k as x,U as L,i,Y as C,v as f,f as O,F as N,B as S,aa as j,l as p,bx as W,ak as u,bn as v,a5 as A,aN as T,al as F,bt as K}from"./index-DJ8tWrMn.js";import{P}from"./progress-BvCQrqEJ.js";import{u as m}from"./vendor-query-YhiXJ5UB.js";import{R as q}from"./receipt-DJjJabpF.js";import{L as w}from"./link-2-srNqDh4V.js";import{U as I}from"./user-check-Xswts_97.js";import{S as M}from"./shield-alert-Ba7an1td.js";import{P as U}from"./percent-BEnYJtwZ.js";import{S as B}from"./server-C-7QJSxt.js";import{T as R}from"./timer-D6qkESUx.js";import"./vendor-radix-C79pJRp9.js";import"./vendor-charts-vgdclHSZ.js";const E=k("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]);const V=k("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);function o(){return e.jsx(n,{className:"h-full flex flex-col bg-white border border-slate-200 shadow-sm rounded-xl overflow-hidden",children:e.jsx(i,{className:"flex-1 p-4",children:e.jsxs("div",{className:"animate-pulse space-y-3",children:[e.jsx("div",{className:"h-3 bg-gray-200 rounded w-2/3"}),e.jsx("div",{className:"h-8 bg-gray-200 rounded w-1/2"}),e.jsx("div",{className:"h-2 bg-gray-200 rounded w-full"}),e.jsx("div",{className:"h-2 bg-gray-200 rounded w-3/4"})]})})})}const d="h-full flex flex-col bg-white border border-slate-200 shadow-sm hover:shadow-md transition-all rounded-xl overflow-hidden";function te(){const{data:s,isLoading:r}=m({queryKey:["/api/metrics/okonomi/billable-ready"],staleTime:12e4,refetchOnWindowFocus:!1});return r?e.jsx(o,{}):e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Fakturerings-klart"}),e.jsx(q,{className:"w-4 h-4 text-[#006699]"})]})}),e.jsxs(i,{className:"flex-1 p-4",children:[e.jsxs("div",{className:"text-3xl font-bold text-[#005580] mb-1",children:[(s?.billableAmou
1nt||0).toLocaleString("no-NO")," kr"]}),e.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"Godkjente timer, ikke fakturert"}),e.jsxs("div",{className:"space-y-1 text-xs text-gray-600",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Timer"}),e.jsxs("span",{className:"font-medium",children:[(s?.billableHours||0).toFixed(1),"t"]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Oppdrag"}),e.jsx("span",{className:"font-medium",children:s?.jobCount||0})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Kunder"}),e.jsx("span",{className:"font-medium",children:s?.customerCount||0})]})]})]})]})}function ae(){const{data:s,isLoading:r}=m({queryKey:["/api/metrics/okonomi/payroll-deviations"],staleTime:12e4,refetchOnWindowFocus:!1});if(r)return e.jsx(o,{});const t=s?.deviations||[],l=s?.count||0;return e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Lønns-avvik"}),e.jsx(u,{className:"w-4 h-4 text-red-600"})]})}),e.jsxs(i,{className:"flex-1 p-4 overflow-y-auto",children:[e.jsxs("div",{className:"flex items-end gap-2 mb-2",children:[e.jsx("span",{className:`text-3xl font-bold ${l>0?"text-red-600":"text-green-600"}`,children:l}),e.jsx("span",{className:"text-xs text-gray-400 mb-1",children:"mangler data"})]}),t.length>0?e.jsx("div",{className:"space-y-1.5",children:t.slice(0,5).map(a=>e.jsxs("div",{className:"flex items-center justify-between text-xs border-l-2 border-red-300 pl-2",children:[e.jsx("span",{className:"text-gray-700 truncate max-w-[100px]",children:a.name}),e.jsxs("div",{className:"flex gap-1",children:[a.missingBankAccount&&e.jsx(p,{variant:"destructive",className:"text-[9px] px-1 py-0",children:"Konto"}),a.missingTaxCard&&e.jsx(p,{variant:"outline",className:"text-[9px] px-1 py-0 border-orange-400 text-orange-600",children:"Skattekort"})]})]},a.id))}):e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(j,{className:"w-3 h-3 text-[#006699]"}),e.jsx("span",{className:"text-xs text-green-600",children:"Alle ansatte har komplett data"})]})]})]})}function le(){const{data:s,isLoading:r}=m({queryKey:["/api/metrics/okonomi/aging-invoices"],staleTime:12e4,refetchOnWindowFocus:!1});if(r)return e.jsx(o,{});const t=s?.buckets||{};return e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Eldreliste (Fordringer)"}),e.jsx(V,{className:"w-4 h-4 text-[#006699]"})]})}),e.jsxs(i,{className:"flex-1 p-4",children:[e.jsxs("div",{className:"text-2xl font-bold text-gray-900 mb-2",children:[(s?.totalOutstanding||0).toLocaleString("no-NO")," kr"]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-green-400"}),e.jsx("span",{className:"text-gray-600",children:"0-30 dager"})]}),e.jsxs("span",{className:"font-semibold",children:[(t["0-30"]||0).toLocaleString("no-NO")," kr"]})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-yellow-400"}),e.jsx("span",{className:"text-gray-600",children:"30-60 dager"})]}),e.jsxs("span",{className:"font-semibold",children:[(t["30-60"]||0).toLocaleString("no-NO")," kr"]})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-orange-400"}),e.jsx("span",{className:"text-gray-600",children:"60-90 dager"})]}),e.jsxs("span",{className:"font-semibold",children:[(t["60-90"]||0).toLocaleStr
1ing("no-NO")," kr"]})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-400"}),e.jsx("span",{className:"text-gray-600",children:"90+ dager"})]}),e.jsxs("span",{className:"font-semibold text-red-600",children:[(t["90+"]||0).toLocaleString("no-NO")," kr"]})]})]})]})]})}function re(){const{data:s,isLoading:r}=m({queryKey:["/api/metrics/okonomi/summary"],staleTime:12e4,refetchOnWindowFocus:!1});if(r)return e.jsx(o,{});const t=s?.profitability,l=s?.costs,a=(t?.netMarginPercent||0)>=25;return e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Margin-vakt (Global)"}),e.jsx(U,{className:"w-4 h-4 text-[#4d82a3]"})]})}),e.jsxs(i,{className:"flex-1 p-4",children:[e.jsxs("div",{className:"flex items-end gap-2 mb-1",children:[e.jsxs("span",{className:`text-3xl font-bold ${a?"text-[#005580]":"text-red-600"}`,children:[t?.netMarginPercent||0,"%"]}),e.jsx("span",{className:"text-xs text-gray-400 mb-1",children:"etter lønn, AGA, OTP"})]}),e.jsxs("div",{className:"text-sm font-semibold text-gray-700 mb-1",children:["DB: ",(t?.netMargin||0).toLocaleString("no-NO")," kr"]}),e.jsxs("div",{className:"space-y-0.5 text-[10px] text-gray-500",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"AGA (14,1%)"}),e.jsxs("span",{children:[(l?.agaCost||0).toLocaleString("no-NO")," kr"]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"OTP (2%)"}),e.jsxs("span",{children:[(l?.otpCost||0).toLocaleString("no-NO")," kr"]})]})]}),!a&&e.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[e.jsx(u,{className:"w-3 h-3 text-[#006699]"}),e.jsx("span",{className:"text-xs text-amber-600",children:"Under 25% mÃ¥l"})]})]})]})}function ne(){const{data:s,isLoading:r}=m({queryKey:["/api/hris/integrations"],staleTime:3e5,refetchOnWindowFocus:!1});if(r)return e.jsx(o,{});const t=Array.isArray(s)?s:[];return e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Integrasjons-status"}),e.jsx(w,{className:"w-4 h-4 text-[#006699]"})]})}),e.jsx(i,{className:"flex-1 p-4 overflow-y-auto",children:t.length===0?e.jsxs("div",{className:"flex flex-col items-center py-3",children:[e.jsx(w,{className:"w-6 h-6 text-gray-300 mb-2"}),e.jsx("p",{className:"text-xs text-gray-400",children:"Ingen integrasjoner konfigurert"}),e.jsx("p",{className:"text-[10px] text-gray-400 mt-1",children:"Tripletex, Fiken, Visma m.fl."})]}):e.jsx("div",{className:"space-y-1.5",children:t.slice(0,5).map(l=>e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-700 truncate max-w-[110px]",children:l.provider||l.name}),e.jsx(p,{variant:l.status==="active"?"default":"destructive",className:"text-[9px] px-1.5",children:l.status==="active"?"Aktiv":"Inaktiv"})]},l.id))})})]})}function ie(){const{data:s,isLoading:r}=m({queryKey:["/api/metrics/okonomi/approved-hours-weekly"],staleTime:12e4,refetchOnWindowFocus:!1});return r?e.jsx(o,{}):e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Godkjente timer"}),e.jsx(j,{className:"w-4 h-4 text-[#006699]"})]})}),e.jsxs(i,{className:"flex-1 p-4",children:[e.jsxs("div",{className:"text-3xl font-bold text-gray-900 mb-1",children:[(s?.totalHours||0).toFixed(1),"t"]}),e.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"Siste 7 dager â klar for lønnskjøring"}),e.jsxs("div",{className:"space-y-1 text-xs text-gray-600",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Registreringer"}),e.jsx("span",{className:"font-medium",children:s?.entryCount||0})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Oppdrag"}),e.jsx("span",{className:"font-medium",children:s?.jobCount||0})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Est. lønnskostnad"}),e.jsxs("span",{className:"font-medium text-[#006699]",children:[(s?.estimatedPayroll||0).toLocaleStr
1ing("no-NO")," kr"]})]})]})]})]})}function ce(){const{data:s,isLoading:r}=m({queryKey:["/api/metrics/okonomi/summary"],staleTime:12e4,refetchOnWindowFocus:!1});if(r)return e.jsx(o,{});const t=s?.costs;return e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Sosialkostnader"}),e.jsx(T,{className:"w-4 h-4 text-[#006699]"})]})}),e.jsxs(i,{className:"flex-1 p-4",children:[e.jsxs("div",{className:"text-2xl font-bold text-[#006699] mb-2",children:[(t?.socialCosts||0).toLocaleString("no-NO")," kr"]}),e.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"Estimert for perioden"}),e.jsxs("div",{className:"space-y-1.5 text-xs text-gray-600",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Arbeidsgiveravgift (14,1%)"}),e.jsxs("span",{className:"font-medium",children:[(t?.agaCost||0).toLocaleString("no-NO")," kr"]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"OTP (2%)"}),e.jsxs("span",{className:"font-medium",children:[(t?.otpCost||0).toLocaleString("no-NO")," kr"]})]}),e.jsxs("div",{className:"border-t pt-1 flex justify-between font-semibold",children:[e.jsx("span",{children:"Lønnskostnad"}),e.jsxs("span",{children:[(t?.total||0).toLocaleString("no-NO")," kr"]})]})]})]})]})}function xe(){return e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Kredittsjekk-varsel"}),e.jsx(M,{className:"w-4 h-4 text-red-600"})]})}),e.jsx(i,{className:"flex-1 p-4",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-3",children:[e.jsx(j,{className:"w-8 h-8 text-[#006699] mb-2"}),e.jsx("p",{className:"text-xs text-gray-500",children:"Ingen varsler"}),e.jsx("p",{className:"text-[10px] text-gray-400 mt-1",children:"Kunder med lav kredittscore eller betalingsstans vises her"})]})})]})}function de(){const{data:s,isLoading:r}=m({queryKey:["/api/metrics/okonomi/pending-timesheets"],staleTime:12e4,refetchOnWindowFocus:!1});if(r)return e.jsx(o,{});const t=s?.timesheets||[],l=s?.count||0;return e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Ventende godkjenninger"}),e.jsx(K,{className:"w-4 h-4 text-[#006699]"})]})}),e.jsxs(i,{className:"flex-1 p-4 overflow-y-auto",children:[e.jsxs("div",{className:"flex items-end gap-2 mb-2",children:[e.jsx("span",{className:`text-3xl font-bold ${l>0?"text-amber-600":"text-green-600"}`,children:l}),e.jsx("span",{className:"text-xs text-gray-400 mb-1",children:"venter på leder"})]}),t.length>0?e.jsx("div",{className:"space-y-1.5",children:t.slice(0,5).map(a=>e.jsxs("div",{className:"flex items-center justify-between text-xs border-l-2 border-amber-300 pl-2",children:[e.jsx("span",{className:"text-gray-700 truncate max-w-[120px]",children:a.candidate_name||"Ukjent"}),e.jsxs("span",{className:"font-semibold",children:[Number(a.total_hours||0).toFixed(1),"t"]})]},a.id))}):e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(j,{className:"w-3 h-3 text-[#006699]"}),e.jsx("span",{className:"text-xs text-green-600",children:"Alle timer godkjent"})]})]})]})}function me(){return e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Utlegg og Reise"}),e.jsx(F,{className:"w-4 h-4 text-[#4d82a3]"})]})}),e.jsx(i,{className:"flex-1 p-4",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-3",children:[e.jsx(j,{className:"w-8 h-8 text-[#006699] mb-2"}),e.jsx("p",{className:"text-xs text-gray-500",children:"Ingen ventende utlegg"}),e.jsx("p",{className:"text-[10px] text-gray-400 mt-1",children:"Utleggsforespørsler fra ansatte og vikarer vises her"})]})})]})}function oe(){return e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Sykefravær & Refusjoner"}),e.jsx(E,{className:"w-4 h-4 text-[#006699]"})]})}),e.jsx(i,{className:"flex-1 p-4",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-3",children:[e.jsx(j,{className:"w-8 h-8 text-[#006699] mb-2"}),e.jsx("p",{className:"text-xs text-gray-500",children:"Ingen aktive saker"}),e.jsx("p",{className:"text-[10px] text-gray-400 mt-1",children:"Sykdom og NAV-refusjonskrav vises her"})]})})]})}function he(){const{data:s,isLoading:r}=m({queryKey:["/api/metrics/okonomi/financial-audit-log"],staleTime:12e4,refetchOnWindowFocus:!1});if(r)return e.jsx(o,{});const t=s?.logs||[];return e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Finansiell Audit Log"}),e.jsx(N,{className:"w-4 h-4 text-gray-600"})]})}),e.jsx(i,{className:"flex-1 p-4 overflow-y-auto",children:t.length===0?e.jsxs("div",{className:"flex flex-col items-center py-3",children:[e.jsx(N,{className:"w-6 h-6 text-gray-300 mb-2"}),e.jsx("p",{className:"text-xs text-gray-400",children:"Ingen finansielle endringer logget"})]}):e.jsx("div",{className:"space-y-1.5",children:t.slice(0,6).map(l=>e.jsxs("div",{className:"text-xs border-l-2 border-gray-200 pl-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-gray-700 truncate max-w-[130px] font-medium",children:l.action}),e.jsx("span",{className:"text-[10px] text-gray-400",children:l.created_at?new Date(l.created_at).toLocaleDateString("no-NO"):""})]}),e.jsxs("span",{className:"text-[10px] text-gray-400",children:[l.entity_type," #",l.entity_id]})]},l.id))})})]})}function je(){const{data:s,isLoading:r}=m({queryKey:["/api/metrics/okonomi/summary"],staleTime:12e4,refetchOnWindowFocus:!1});if(r)return e.jsx(o,{});const t=s?.revenue?.amount||0,l=s?.costs?.total||0,a=s?.costs?.socialCosts||0,h=l+a,g=t-h,b=g>=0,y=Math.max(t,h,1);return e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Omsetning vs. Kostnad"}),e.jsx(A,{className:"w-4 h-4 text-[#006699]"})]})}),e.jsx(i,{className:"flex-1 p-4",children:e.jsxs("div",{className:"space-y-2 mt-1",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between text-xs mb-0.5",children:[e.jsx("span",{className:"text-gray-600",children:"Omsetning"}),e.jsxs("span",{className:"font-medium text-[#006699]",children:[t.toLocaleStr
1ing("no-NO")," kr"]})]}),e.jsx("div",{className:"w-full bg-gray-100 rounded-full h-3",children:e.jsx("div",{className:"bg-[#006699] h-3 rounded-full",style:{width:`${t/y*100}%`}})})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between text-xs mb-0.5",children:[e.jsx("span",{className:"text-gray-600",children:"Totalkostnad"}),e.jsxs("span",{className:"font-medium text-red-600",children:[h.toLocaleString("no-NO")," kr"]})]}),e.jsx("div",{className:"w-full bg-gray-100 rounded-full h-3",children:e.jsx("div",{className:"bg-red-400 h-3 rounded-full",style:{width:`${h/y*100}%`}})})]}),e.jsxs("div",{className:"border-t pt-1 flex justify-between text-xs",children:[e.jsx("span",{className:"font-semibold",children:"Balanse"}),e.jsxs("span",{className:`font-bold ${b?"text-[#006699]":"text-red-600"}`,children:[b?"+":"",g.toLocaleString("no-NO")," kr"]})]})]})})]})}function pe(){const{data:s,isLoading:r}=m({queryKey:["/api/metrics/okonomi/deadlines"],staleTime:6e5,refetchOnWindowFocus:!1});if(r)return e.jsx(o,{});const t=s?.deadlines||[],l=a=>a<=7?"text-red-600 bg-red-50":a<=14?"text-orange-600 bg-orange-50":a<=30?"text-amber-600 bg-amber-50":"text-green-600 bg-green-50";return e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Termin-nedtelling"}),e.jsx(R,{className:"w-4 h-4 text-[#006699]"})]})}),e.jsx(i,{className:"flex-1 p-4 overflow-y-auto",children:t.length===0?e.jsxs("div",{className:"flex flex-col items-center py-3",children:[e.jsx(j,{className:"w-6 h-6 text-[#006699] mb-1"}),e.jsx("p",{className:"text-xs text-gray-400",children:"Ingen nære frister"})]}):e.jsx("div",{className:"space-y-1.5",children:t.map((a,h)=>e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:a.type}),e.jsx("span",{className:"text-[10px] text-gray-400 ml-1",children:a.period})]}),e.jsxs(p,{className:`text-[10px] px-1.5 ${l(a.daysLeft)}`,children:[a.daysLeft,"d"]})]},h))})})]})}function fe(){const s=(r,t)=>{window.open(`/api/export/${r}?format=${t}`,"_blank","noopener,noreferrer")};return e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Eksport-senter"}),e.jsx(C,{className:"w-4 h-4 text-gray-600"})]})}),e.jsxs(i,{className:"flex-1 p-4",children:[e.jsxs("div",{className:"space-y-1.5 mt-1",children:[e.jsxs(f,{variant:"outline",size:"sm",className:"w-full justify-start text-xs h-7",onClick:()=>s("time-entries","csv"),children:[e.jsx(O,{className:"w-3 h-3 mr-2"})," Lønnsfil (CSV)"]}),e.jsxs(f,{variant:"outline",size:"sm",className:"w-full justify-start text-xs h-7",onClick:()=>s("time-entries","xlsx"),children:[e.jsx(N,{className:"w-3 h-3 mr-2"})," Lønnsfil (Excel)"]}),e.jsxs(f,{variant:"outline",size:"sm",className:"w-full justify-start text-xs h-7",onClick:()=>s("jobs","csv"),children:[e.jsx(S,{className:"w-3 h-3 mr-2"})," Oppdragsrapport"]}),e.jsxs(f,{variant:"outline",size:"sm",className:"w-full justify-start text-xs h-7",onClick:()=>s("candidates","csv"),children:[e.jsx(L,{className:"w-3 h-3 mr-2"})," Ansattliste"]})]}),e.jsx("p",{className:"text-[10px] text-gray-400 mt-2",children:"Huldt & Lillevik / Visma-kompatibel"})]})]})}function Ne(){const{data:s,isLoading:r}=m({queryKey:["/api/metrics/okonomi/contract-overview"],staleTime:12e4,refetchOnWindowFocus:!1});if(r)return e.jsx(o,{});const t=s?.signed||0,l=s?.unsigned||0,a=t+l;return e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Kontrakts-oversikt"}),e.jsx(W,{className:"w-4 h-4 text-[#006699]"})]})}),e.jsx(i,{className:"flex-1 p-4",children:e.jsxs("div",{className:"space-y-2 mt-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-green-400"}),e.jsx("span",{className:"text-gray-600",children:"Signerte kontrakter"})]}),e.jsx("span",{className:"font-semibold text-green-600",children:t})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-400"}),e.jsx("span",{className:"text-gray-600",children:"Uten gyldig kontrakt"})]}),e.jsx("span",{className:"font-semibold text-red-600",children:l})]}),a>0&&e.jsx(P,{value:a>0?Math.round(t/a*100):0,className:"h-2 mt-1"}),l>0&&e.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[e.jsx(u,{className:"w-3 h-3 text-[#006699]"}),e.jsxs("span",{className:"text-[10px] text-amber-600",children:[l," oppdrag mangler kontrakt"]})]})]})})]})}function ue(){const{data:s,isLoading:r}=m({queryKey:["/api/metrics/recent-activity"],staleTime:12e4,refetchOnWindowFocus:!1});if(r)return e.jsx(o,{});const t=s?.activities||[],l=a=>{switch(a){case"contract":return e.jsx(W,{className:"w-3 h-3 text-[#4d82a3]"});case"time_entry":return e.jsx(O,{className:"w-3 h-3 text-[#4d82a3]"});case"job":return e.jsx(S,{className:"w-3 h-3 text-[#4d82a3]"});default:return e.jsx(v,{className:"w-3 h-3 text-gray-400"})}};return e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Nylig aktivitet"}),e.jsx(v,{className:"w-4 h-4 text-[#006699]"})]})}),e.jsx(i,{className:"flex-1 p-4 overflow-y-auto",children:t.length===0?e.jsx("p",{className:"text-xs text-gray-400 mt-2",children:"Ingen nylige hendelser"}):e.jsx("div",{className:"space-y-1.5",children:t.slice(0,7).map((a,h)=>e.jsxs("div",{className:"flex items-start gap-2 text-xs border-l-2 border-gray-100 pl-2",children:[l(a.type||""),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-gray-700 truncate",children:a.title||a.description||"Hendelse"}),e.jsx("p",{className:"text-[10px] text-gray-400",children:a.time||""})]})]},a.id||h))})})]})}function ge(){const{data:s,isLoading:r}=m({queryKey:["/api/presence/online-users"],staleTime:3e4,refetchOnWindowFocus:!1});if(r)return e.jsx(o,{});const l=(Array.isArray(s)?s:s?.users||[]).filter(a=>a.role==="admin");return e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Kolleger pålogget"}),e.jsx(I,{className:"w-4 h-4 text-[#006699]"})]})}),e.jsxs(i,{className:"flex-1 p-4 overflow-y-auto",children:[e.jsxs("div",{className:"flex items-end gap-2 mb-2",children:[e.jsx("span",{className:"text-3xl font-bold text-green-600",children:l.length}),e.jsx("span",{className:"text-xs text-gray-400 mb-1",children:"aktive ledere"})]}),l.length>0?e.jsx("div",{className:"space-y-1",children:l.slice(0,6).map((a,h)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-400"}),e.jsxs("span",{className:"text-gray-700 truncate",children:[a.firstName||a.email||"Bruker"," ",a.lastName||""]})]},a.id||h))}):e.jsx("p",{className:"text-xs text-gray-400",children:"Ingen andre pålogget nå"})]})]})}function be(){const{data:s,isLoading:r}=m({queryKey:["/api/metrics/active-candidates"],staleTime:12e4,refetchOnWindowFocus:!1});return r?e.jsx(o,{}):e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Aktive kandidater"}),e.jsx(L,{className:"w-4 h-4 text-[#006699]"})]})}),e.jsxs(i,{className:"flex-1 p-4",children:[e.jsx("div",{className:"text-3xl font-bold text-gray-900 mb-1",children:s?.total||0}),e.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"Registrerte i systemet"}),e.jsxs("div",{className:"space-y-1 text-xs text-gray-600",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Nye i dag"}),e.jsx("span",{className:"font-medium",children:s?.newToday||0})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Denne uken"}),e.jsx("span",{className:"font-medium",children:s?.newThisWeek||0})]})]}),e.jsx("p",{className:"text-[10px] text-gray-400 mt-2",children:"Søkbar tilgang til personalmapper"})]})]})}function ye(){const{data:s,isLoading:r}=m({queryKey:["/api/auth/check"],staleTime:6e4,refetchOnWindowFocus:!1});if(r)return e.jsx(o,{});const t=[{name:"Database",status:"ok"},{name:"API",status:s?.authenticated?"ok":"error"}
1,{name:"Fillagring (R2)",status:"ok"},{name:"SMS (Keysms)",status:"ok"},{name:"AI (OpenAI)",status:"ok"}],l=t.every(a=>a.status==="ok");return e.jsxs(n,{className:d,children:[e.jsx(c,{className:"px-4 pt-4 pb-3 border-b border-slate-100 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(x,{className:"text-xs font-semibold uppercase tracking-wider text-slate-500",children:"Systemstatus"}),e.jsx(B,{className:"w-4 h-4 text-[#006699]"})]})}),e.jsxs(i,{className:"flex-1 p-4",children:[e.jsx("div",{className:"flex items-center gap-2 mb-2",children:l?e.jsx(p,{className:"bg-green-100 text-green-700 text-xs",children:"Alt operativt"}):e.jsx(p,{className:"bg-red-100 text-red-700 text-xs",children:"Problemer oppdaget"})}),e.jsx("div",{className:"space-y-1",children:t.map((a,h)=>e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-700",children:a.name}),a.status==="ok"?e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-400"}),e.jsx("span",{className:"text-green-600 text-[10px]",children:"OK"})]}):e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-red-400"}),e.jsx("span",{className:"text-red-600 text-[10px]",children:"Feil"})]})]},h))})]})]})}export{be as AktiveKandidaterWidget,fe as EksportSenterWidget,le as EldrelisteWidget,te as FaktureringKlartWidget,he as FinansiellAuditLogWidget,ie as GodkjenteTimerWidget,ne as IntegrasjonStatusWidget,ge as KollegerPaloggetWidget,Ne as KontraktsOversiktWidget,xe as KredittSjekkWidget,ae as LonnsAvvikWidget,re as MarginVaktWidget,ue as NyligAktivitetFinansWidget,je as OmsetningVsKostnadWidget,ce as SosialkostnaderWidget,oe as SykefravaerWidget,ye as SystemstatusWidget,pe as TerminNedtellingWidget,me as UtleggReiseWidget,de as VentendeGodkjenningerWidget};
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.