const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Protokollfenster-DeA4EXoc.js","assets/dist-aE7UmubC.js","assets/sheet-DG7u1mB-.js","assets/dist-CakcBaML.js","assets/button-BHVKhtQ6.js","assets/index-DRAkqVZT.js","assets/abfragen-pD_qBEtc.js","assets/useSelector-DBNxxw17.js","assets/useMatch-DDVpPKJI.js","assets/useRouterState-DJr4hrdj.js","assets/index-D9NqFm_c.css"])))=>i.map(i=>d[i]); import{a as e,c as t,i as n,r,t as i}from"./dist-aE7UmubC.js";import{Et as a,Mt as o,bt as s,h as c,ht as l,yt as u,zt as d}from"./abfragen-pD_qBEtc.js";import{t as f}from"./button-BHVKhtQ6.js";import{L as p,U as m}from"./index-DRAkqVZT.js";var h=r(),g=t(e(),1),_=n(),v=(0,g.lazy)(()=>m(()=>import(`./Protokollfenster-DeA4EXoc.js`).then(e=>({default:e.Protokollfenster})),__vite__mapDeps([0,1,2,3,4]))),y=(0,g.lazy)(()=>m(()=>import(`./index-DRAkqVZT.js`).then(e=>e.h).then(e=>({default:e.Bestaetigen})),__vite__mapDeps([5,1,3,4,6,7,8,9,10])));function b({h:e,basis:t}){let n=c(t),[r,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(null),b=e.stufe===`rot`,x=m?o(e,m):null;async function S(){try{let n=await d(`${t}/${encodeURIComponent(e.id)}/aktion/protokoll`);p({titel:e.titel,text:n.text||n.out||n.err||`Kein Protokoll vorhanden.`})}catch(e){a(`fehler`,e.message)}}function C(t){n.mutate({hinweis:e.id,aktion:t.id,label:t.label})}function w(t){t.id===`protokoll`?S():o(e,t)?h(t):C(t)}let T=e.zustand===`stumm`;return(0,_.jsxs)(`article`,{className:i(`flex flex-col gap-2.5 rounded-2xl px-4 py-3.5 ring-1 ring-inset`,T?`bg-white/[0.03] opacity-70 ring-white/10`:b?`bg-rot/[0.07] ring-rot/35`:`bg-bernstein/[0.06] ring-bernstein/30`),children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,_.jsx)(`h3`,{className:`min-w-0 flex-1 font-sans text-[16.5px] leading-snug font-semibold`,children:e.titel}),(0,_.jsx)(`span`,{className:i(`etikett shrink-0 rounded-full px-2.5 py-0.5 text-[10.5px] tracking-[0.12em] ring-1 ring-inset`,b?`bg-rot/12 text-rot-text ring-rot/40`:`bg-bernstein/10 text-bernstein ring-bernstein/35`),children:b?`Jetzt`:`Prüfen`})]}),(0,_.jsxs)(`p`,{className:`ziffern text-[13px] text-text-3`,children:[u(e.seit),` · zuletzt `,s(e.zuletzt),e.zustand===`neu`&&(0,_.jsx)(`span`,{className:`font-sans text-cyan-text`,children:` · neu`}),T&&e.stumm_bis&&(0,_.jsxs)(`span`,{className:`font-sans`,children:[` · stumm bis `,l(new Date(e.stumm_bis*1e3).toISOString()).toLowerCase()]})]}),e.text&&(0,_.jsx)(`p`,{className:`text-[15px] leading-relaxed break-words text-text-2`,children:e.text}),(0,_.jsxs)(`div`,{className:`flex flex-wrap gap-2.5 pt-1`,children:[e.aktionen.map((e,t)=>(0,_.jsx)(f,{variant:t===0&&e.id!==`protokoll`?`default`:`outline`,size:`sm`,disabled:n.isPending,onClick:()=>w(e),children:e.label},e.id)),e.zustand===`neu`&&(0,_.jsx)(f,{variant:`ghost`,size:`sm`,disabled:n.isPending,onClick:()=>C({id:`gesehen`,label:`Gesehen`}),children:`Gesehen`}),e.zustand&&!T&&(0,_.jsx)(f,{variant:`ghost`,size:`sm`,disabled:n.isPending,onClick:()=>C({id:`stumm`,label:`24 h stumm`}),children:`24 h stumm`}),T&&(0,_.jsx)(f,{variant:`ghost`,size:`sm`,disabled:n.isPending,onClick:()=>C({id:`laut`,label:`Wieder melden`}),children:`Wieder melden`})]}),r&&(0,_.jsx)(g.Suspense,{fallback:null,children:(0,_.jsx)(v,{offen:!0,titel:r.titel,text:r.text,onSchliessen:()=>p(null)})}),m&&x&&(0,_.jsx)(g.Suspense,{fallback:null,children:(0,_.jsx)(y,{offen:!0,titel:x.titel,text:x.text,knopf:x.knopf,gesperrt:n.isPending,onNein:()=>h(null),onJa:()=>{C(m),h(null)}})})]})}function x(e){let t=(0,h.c)(15),{hinweise:n,verlauf:r,basis:i}=e,a=i===void 0?`/api/hinweise`:i,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Date().toDateString(),t[0]=o):o=t[0];let s=o,c;if(t[1]!==n.length||t[2]!==r){c=Symbol.for(`react.early_return_sentinel`);bb0:{let e;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>(e.art===`erledigt`||e.art===`auto`)&&new Date(e.ts*1e3).toDateString()===s,t[4]=e):e=t[4];let i=r.filter(e);if(n.length===0){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,_.jsx)(`p`,{className:`text-[15px] text-text-2`,children:`Keine offenen Punkte. Der Wächter prüft jede Minute.`}),t[5]=e):e=t[5];let n=i.length>0&&(0,_.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-text-3`,children:i.slice(0,4).map(S)}),r;t[6]===n?r=t[7]:(r=(0,_.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e,n]}),t[6]=n,t[7]=r),c=r;break bb0}}t[1]=n.length,t[2]=r,t[3]=c}else c=t[3];if(c!==Symbol.for(`react.early_return_sentinel`))return c;let l;if(t[8]!==a||t[9]!==n){let e;t[11]===a?e=t[12]:(e=e=>(0,_.jsx)(b,{h:e,basis:a},e.id),t[11]=a,t[12]=e),l=n.map(e),t[8]=a,t[9]=n,t[10]=l}else l=t[10];let u;return t[13]===l?u=t[14]:(u=(0,_.jsx)(`div`,{className:`flex flex-col gap-3`,children:l}),t[13]=l,t[14]=u),u}function S(e){return(0,_.jsxs)(`li`,{children:[(0,_.jsx)(`span`,{className:`ziffern`,children:s(e.ts)}),` · `,e.text]},`${e.id}-${e.ts}`)}var C={ok:{block:`bg-gruen/[0.07] ring-gruen/30`,glut:`var(--gruen)`,text:`text-gruen`},info:{block:`bg-cyan/[0.07] ring-cyan/30`,glut:`var(--cyan)`,text:`text-cyan-text`},gelb:{block:`bg-bernstein/[0.08] ring-bernstein/35`,glut:`var(--bernstein)`,text:`text-bernstein`},rot:{block:`bg-rot/10 ring-rot/40`,glut:`var(--rot)`,text:`text-rot-text`},stumm:{block:`bg-white/[0.04] ring-white/15`,glut:`var(--text-3)`,text:`text-text-2`}};function w(e){let t=(0,h.c)(32),{art:n,oben:r,mitte:a,unten:o,aktiv:s,onAnsehen:c,label:l,children:u}=e,d=C[n],f=`radial-gradient(closest-side, color-mix(in srgb, ${d.glut} 20%, transparent), transparent)`,p;t[0]===f?p=t[1]:(p=(0,_.jsx)(`div`,{"aria-hidden":!0,className:`glut-atmet pointer-events-none absolute -top-40 -left-32 size-[460px] rounded-full`,style:{background:f}}),t[0]=f,t[1]=p);let m=!s,g=`${r}: ${a}`,v=s?`cursor-pointer hover:brightness-125`:`cursor-default`,y=n===`gelb`&&`lampe-atmet`,b;t[2]!==d.block||t[3]!==v||t[4]!==y?(b=i(`flex min-h-[132px] flex-col items-start justify-center gap-1.5 rounded-2xl px-5 py-4 text-left ring-1 ring-inset transition-[filter]`,d.block,v,y),t[2]=d.block,t[3]=v,t[4]=y,t[5]=b):b=t[5];let x;t[6]===r?x=t[7]:(x=(0,_.jsx)(`span`,{className:`etikett text-[11px] tracking-[0.18em] text-text-3`,children:r}),t[6]=r,t[7]=x);let S;t[8]===d.text?S=t[9]:(S=i(`text-[30px] leading-tight font-semibold tracking-[-0.01em] sm:text-[34px]`,d.text),t[8]=d.text,t[9]=S);let w;t[10]!==a||t[11]!==S?(w=(0,_.jsx)(`span`,{className:S,children:a}),t[10]=a,t[11]=S,t[12]=w):w=t[12];let T;t[13]===o?T=t[14]:(T=(0,_.jsx)(`span`,{className:`text-[13.5px] text-text-2`,children:o}),t[13]=o,t[14]=T);let E;t[15]!==c||t[16]!==w||t[17]!==T||t[18]!==m||t[19]!==g||t[20]!==b||t[21]!==x?(E=(0,_.jsxs)(`button`,{type:`button`,onClick:c,disabled:m,"aria-label":g,className:b,children:[x,w,T]}),t[15]=c,t[16]=w,t[17]=T,t[18]=m,t[19]=g,t[20]=b,t[21]=x,t[22]=E):E=t[22];let D;t[23]===u?D=t[24]:(D=(0,_.jsx)(`ul`,{className:`m-0 grid list-none grid-cols-1 gap-2 p-0 min-[480px]:grid-cols-2 xl:grid-cols-4`,children:u}),t[23]=u,t[24]=D);let O;t[25]!==E||t[26]!==D?(O=(0,_.jsxs)(`div`,{className:`relative grid gap-4 p-4 sm:p-5 lg:grid-cols-[280px_minmax(0,1fr)] lg:gap-5`,children:[E,D]}),t[25]=E,t[26]=D,t[27]=O):O=t[27];let k;return t[28]!==l||t[29]!==O||t[30]!==p?(k=(0,_.jsxs)(`section`,{"aria-label":l,className:`auftauchen flaeche relative overflow-hidden rounded-3xl`,children:[p,O]}),t[28]=l,t[29]=O,t[30]=p,t[31]=k):k=t[31],k}var T={ok:`ok`,aus:`aus`,warn:`warn`,info:`info`,fehler:`rot`},E={ok:`text-text-3`,aus:`text-text-3`,warn:`text-bernstein`,info:`text-cyan-text`,fehler:`text-rot-text`},D={ok:`in Ordnung`,aus:`aus`,warn:`braucht Aufmerksamkeit`,info:`Info`,fehler:`Störung`};function O(e){let t=(0,h.c)(25),{bild:n,name:r,wert:a,zustand:o,zahl:s,onClick:c}=e,l=T[o],u;t[0]!==n||t[1]!==l?(u=(0,_.jsx)(p,{bild:n,punkt:l}),t[0]=n,t[1]=l,t[2]=u):u=t[2];let d;t[3]===r?d=t[4]:(d=(0,_.jsx)(`span`,{className:`truncate text-[14.5px] leading-snug font-medium`,children:r}),t[3]=r,t[4]=d);let f=E[o],m;t[5]===f?m=t[6]:(m=i(`truncate text-[12.5px] leading-snug`,f),t[5]=f,t[6]=m);let g;t[7]!==m||t[8]!==a?(g=(0,_.jsx)(`span`,{className:m,children:a}),t[7]=m,t[8]=a,t[9]=g):g=t[9];let v;t[10]===s?v=t[11]:(v=s&&(0,_.jsx)(`span`,{className:i(`truncate text-[12px] leading-snug`,s.stufe===`rot`?`text-rot-text`:s.stufe===`gelb`?`text-bernstein`:`text-text-3`),children:s.text}),t[10]=s,t[11]=v);let y=D[o],b;t[12]===y?b=t[13]:(b=(0,_.jsx)(`span`,{className:`sr-only`,children:y}),t[12]=y,t[13]=b);let x;t[14]!==d||t[15]!==g||t[16]!==v||t[17]!==b?(x=(0,_.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[d,g,v,b]}),t[14]=d,t[15]=g,t[16]=v,t[17]=b,t[18]=x):x=t[18];let S;t[19]!==x||t[20]!==u?(S=(0,_.jsxs)(_.Fragment,{children:[u,x]}),t[19]=x,t[20]=u,t[21]=S):S=t[21];let C=S,w;return t[22]!==C||t[23]!==c?(w=(0,_.jsx)(`li`,{children:c?(0,_.jsx)(`button`,{type:`button`,onClick:c,className:i(`flaeche-innen flex h-full w-full min-w-0 items-center gap-3 rounded-xl px-3 py-2.5 text-left`,`transition-colors hover:border-white/20 hover:bg-white/[0.05]`),children:C}):(0,_.jsx)(`div`,{className:`flaeche-innen flex h-full w-full min-w-0 items-center gap-3 rounded-xl px-3 py-2.5 text-left`,children:C})}),t[22]=C,t[23]=c,t[24]=w):w=t[24],w}export{w as n,x as r,O as t};