PageSourceSearch

https://valtis-restore-lane.pages.dev/assets/AdminAuditLog-DtGzX5Bp.js

js valtis-restore-lane.pages.dev collected 2026-10-03 05:46:55 UTC 25,079 bytes, 6 lines download raw bytes

1import{c as Ee,r as d,j as e,a0 as X,a4 as ke,ak as ae,al as De,n as N,l as Z,s as L,X as Ie,w as Le,E as F,P as Te,C as ne,T as Y,a as q,b as W,B as Re}from"./index-D8d0swLk.js";import{A as Oe,S as J}from"./AdminLayout-BdFBeeec.js";import{C as E,a as k}from"./card-DQor9FT-.js";import{B as O}from"./badge-zA5jZNoy.js";import{t as g,c as Pe,s as Q,g as ee,e as Fe,m as te,a as T,b as Be,d as Ue,f as He}from"./de-DpneaPr5.js";import{C as Ve}from"./check-CeE5OI2w.js";import{T as Xe}from"./trash-2-CWGXuNbX.js";import{P as $e}from"./pencil-DHqoNr5z.js";import{P as ze}from"./plus-Bo4lXND0.js";import{H as Ke}from"./history-BlnOytud.js";import{R as re}from"./radio-CtDTMXTy.js";import{A as Ge}from"./activity-DJziymb8.js";import{U as Ze}from"./user-BJHZR_b8.js";import{Z as oe}from"./zap-CA4QN30_.js";import{S as Ye}from"./search-CboX2UlF.js";import{P as qe}from"./play-DRXTiIu3.js";import{P as We}from"./pause-CsxkFx-Q.js";import{C as Je}from"./chevron-up-BNUQBjXs.js";import"./shield-DknB_7IR.js";import"./layout-dashboard-aL3EMy7Y.js";import"./square-check-big-BwxX8HxA.js";import"./folder-open-BzLko2ch.js";import"./user-cog-DS05Zg-z.js";import"./user-round-DdLoUA8g.js";import"./mail-BgdBQUzC.js";import"./wrench-BU59cqcy.js";import"./hard-hat-BzXGYYRr.js";import"./triangle-alert-DLRVO7OZ.js";import"./brain-BE-HjnoK.js";import"./file-text-BLT9exXs.js";import"./cpu-DZPFMC_P.js";import"./arrow-left-DwinG5x_.js";import"./log-out-Cq4Zj-XP.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Qe=Ee("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);function R(t,a){const r=g(t),o=g(a),n=r.getTime()-o.getTime();return n<0?-1:n>0?1:n}function ie(t){return Pe(t,Date.now())}function et(t,a){const r=Q(t),o=Q(a);return+r==+o}function tt(t,a){const r=g(t),o=g(a),n=r.getFullYear()-o.getFullYear(),l=r.getMonth()-o.getMonth();return n*12+l}function rt(t){return a=>{const o=(t?Math[t]:Math.trunc)(a);return o===0?0:o}}function st(t,a){return+g(t)-+g(a)}function at(t){const a=g(t);return a.setHours(23,59,59,999),a}function nt(t){const a=g(t),r=a.getMonth();return a.setFullYear(a.getFullYear(),r+1,0),a.setHours(23,59,59,999),a}function ot(t){const a=g(t);return+at(a)==+nt(a)}function it(t,a){const r=g(t),o=g(a),n=R(r,o),l=Math.abs(tt(r,o));let u;if(l<1)u=0;else{r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-n*l);let i=R(r,o)===-n;ot(g(t))&&l===1&&R(t,o)===1&&(i=!1),u=n*(l-Number(i))}return u===0?0:u}function lt(t,a,r){const o=st(t,a)/1e3;return rt(r==null?void 0:r.roundingMethod)(o)}function ct(t,a,r){const o=Be(),n=(r==null?void 0:r.locale)??o.locale??Fe,l=2520,u=R(t,a);if(isNaN(u))throw new RangeError("Invalid time value");const i=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:u});let m,x;u>0?(m=g(a),x=g(t)):(m=g(t),x=g(a));const p=lt(x,m),_=(ee(x)-ee(m))/1e3,f=Math.round((p-_)/60);let y;if(f<2)return r!=null&&r.includeSeconds?p<5?n.formatDistance("lessThanXSeconds",5,i):p<10?n.formatDistance("lessThanXSeconds",10,i):p<20?n.formatDistance("lessThanXSeconds",20,i):p<40?n.formatDistance("halfAMinute",0,i):p<60?n.formatDistance("lessThanXMinutes",1,i):n.formatDistance("xMinutes",1,i):f===0?n.formatDistance("lessThanXMinutes",1,i):n.formatDistance("xMinutes",f,i);if(f<45)return n.formatDistance("xMinutes",f,i);if(f<90)return n.formatDistance("aboutXHours",1,i);if(f<te){const h=Math.round(f/60);return n.formatDistance("aboutXHours",h,i)}else{if(f<l)return n.formatDistance("xDays",1,i);if(f<T){const h=Math.round(f/te);return n.formatDistance("xDays",h,i)}else if(f<T*2)return y=Math.round(f/T),n.formatDistance("aboutXMonths",y,i)}if(y=it(x,m),y<12){const h=Math.round(f/T);return n.formatDistance("xMonths",h,i)}else{const h=y%12,S=Math.trunc(y/12);return h<3?n.formatDistance("aboutXYears",S,i):h<9?n.formatDistance("overXYears",S,i):n.formatDistance("almostXYears",S+1,i)}}function dt(t,a){return ct(t,ie(t),a)}function ut(t){return et(t,ie(t))}var mt=Object.defineProperty,w=(t,a)=>mt(t,"name",{value:a,configurable:!0}),le="Avatar",[ft,ir]=ke(le),xt=[0,()=>{}],[pt,ce]=ft(le),de=d.forwardRef(w(function(a,r){const{__scopeAvatar:o,...n}=a,[l,u]=d.useState("idle"),[i,m]=xe();return e.jsx(pt,{scope:o,imageLoadingStatus:l,setImageLoadingStatus:u,imageCount:i,setImageCount:m,children:e.jsx(X.span,{...n,ref:r})})},"Avatar")),ht="AvatarImage",ue=d.forwardRef(w(function(a,r){const{__scopeAvatar:o,src:n,onLoadingStatusChange:l,...u}=a,i=ce(ht,o);i.setImageCount;const m=fe(n,{referrerPolicy:u.referrerPolicy,crossOrigin:u.crossOrigin,loadingStatus:i.imageLoadingStatus,set
6LoadingStatus:i.setImageLoadingStatus}),x=De(_=>{l==null||l(_)}),p=d.useRef(m);return ae(()=>{const _=p.current;p.current=m,m!==_&&x(m)},[m,x]),m==="loaded"?e.jsx(X.img,{...u,ref:r,src:n}):null},"AvatarImage")),gt="AvatarFallback",me=d.forwardRef(w(function(a,r){const{__scopeAvatar:o,delayMs:n,...l}=a,u=ce(gt,o),[i,m]=d.useState(n===void 0);return d.useEffect(()=>{if(n!==void 0){const x=window.setTimeout(()=>m(!0),n);return()=>window.clearTimeout(x)}},[n]),i&&u.imageLoadingStatus!=="loaded"?e.jsx(X.span,{...l,ref:r}):null},"AvatarFallback"));function fe(t,{loadingStatus:a,setLoadingStatus:r,referrerPolicy:o,crossOrigin:n}){return ae(()=>{if(!t){r("error");return}const l=new window.Image,u=w(m=>{const x=m.currentTarget;r(U(x))},"handleLoad"),i=w(()=>r("error"),"handleError");return l.addEventListener("load",u),l.addEventListener("error",i),o&&(l.referrerPolicy=o),l.crossOrigin=n??null,l.src=t,r(U(l)),()=>{l.removeEventListener("load",u),l.removeEventListener("error",i),r("idle")}},[t,n,o,r]),a}w(fe,"useImageLoadingStatus");function U(t){return t.complete?t.naturalWidth>0?"loaded":"error":"loading"}w(U,"getImageLoadingStatus");function xe(){return xt}w(xe,"useImageCount");function jt(t){}w(jt,"useUpdateImageCount");const pe=d.forwardRef(({className:t,...a},r)=>e.jsx(de,{ref:r,className:N("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...a}));pe.displayName=de.displayName;const bt=d.forwardRef(({className:t,...a},r)=>e.jsx(ue,{ref:r,className:N("aspect-square h-full w-full",t),...a}));bt.displayName=ue.displayName;const he=d.forwardRef(({className:t,...a},r)=>e.jsx(me,{ref:r,className:N("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...a}));he.displayName=me.displayName;const A={create:{icon:ze,color:"text-emerald-600 bg-emerald-100",border:"border-l-emerald-500",label:"Erstellt",dot:"bg-emerald-500"},update:{icon:$e,color:"text-blue-600 bg-blue-100",border:"border-l-blue-500",label:"Aktualisiert",dot:"bg-blue-500"},delete:{icon:Xe,color:"text-destructive bg-destructive/10",border:"border-l-destructive",label:"Gelöscht",dot:"bg-destructive"},approve:{icon:Ve,color:"text-emerald-600 bg-emerald-100",border:"border-l-emerald-500",label:"Genehmigt",dot:"bg-emerald-500"},reject:{icon:Ie,color:"text-orange-600 bg-orange-100",border:"border-l-orange-500",label:"Abgelehnt",dot:"bg-orange-500"},escalate:{icon:Qe,color:"text-violet-600 bg-violet-100",border:"border-l-violet-500",label:"Eskaliert",dot:"bg-violet-500"}},ge={icon:oe,color:"text-muted-foreground bg-muted",border:"border-l-border",dot:"bg-muted-foreground"},vt={property:"Liegenschaft",unit:"Einheit",lease:"Mietvertrag",contract:"Vertrag",contact:"Kontakt",invoice:"Rechnung",document:"Dokument",task:"Aufgabe",case:"Vorgang",payment:"Zahlung",budget_item:"Budgetposten",building_component:"Gebäudekomponente",compliance_item:"Compliance",maintenance_order:"Wartungsauftrag",owner_profile:"Eigentümerprofil",template:"Vorlage",vendor:"Lieferant",rent_charge:"Mietforderung"};function je(t,a){const r=A[t],o=a?vt[a]??a:null;if(r&&o)switch(t){case"create":return`${o} erstellt`;case"update":return`${o} aktualisiert`;case"delete":return`${o} gelöscht`;case"approve":return`${o} genehmigt`;case"reject":return`${o} abgelehnt`;case"escalate":return`${o} eskaliert`}return r?r.label:t}const se={old_status:"Alter Status",new_status:"Neuer Status",reason:"Grund",amount:"Betrag",tenant_name:"Mieter",unit_name:"Einheit",description:"Beschreibung",email:"E-Mail",phone:"Telefon",due_date:"Fällig am",start_date:"Startdatum",end_date:"Enddatum",name:"Name",title:"Titel",notes:"Notizen",status:"Status",priority:"Priorität",category:"Kategorie",type:"Typ",property_name:"Liegenschaft",address:"Adresse",city:"Stadt",postal_code:"PLZ",country:"Land",contact_name:"Kontakt",vendor_name:"Lieferant",contract_type:"Vertragstyp",file_name:"Dateiname",assigned_to:"Zugewiesen an",created_by:"Erstellt von",updated_by:"Geändert von",old_value:"Alter Wert",new_value:"Neuer Wert",field:"Feld",comment:"Kommentar",label:"Bezeichnung",summary:"Zusammenfassung",resolution:"Lösung",source:"Quelle",channel:"Kanal"};function B(t){return se[t]?se[t]:t.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,a=>a.toUpperCase())}const Nt=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2})/,yt=/^[0-9a-f]{8}-[0-9a-f]{4}-/i;function H(t){if(t==null)return"—";if(typeof t=="boolean")return t?"Ja":"Nein";
6if(typeof t=="number")return t.toLocaleString("de-CH");if(typeof t=="string"){if(Nt.test(t))try{return new Date(t).toLocaleString("de-CH",{dateStyle:"medium",timeStyle:"short"})}catch{}return yt.test(t)?t.slice(0,8)+"…":t}return Array.isArray(t)?t.map(H).join(", "):typeof t=="object"?JSON.stringify(t):String(t)}function wt(t){const a=[];for(const[r,o]of Object.entries(t))if(o!==null&&typeof o=="object"&&!Array.isArray(o))for(const[n,l]of Object.entries(o))a.push([`${B(r)} › ${B(n)}`,H(l)]);else a.push([B(r),H(o)]);return a}function be({details:t}){const a=wt(t),[r,o]=d.useState(!1);return e.jsxs("div",{className:"mt-1 space-y-1.5",children:[e.jsx("div",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-[11px]",children:a.map(([n,l],u)=>e.jsxs("div",{className:"contents",children:[e.jsxs("span",{className:"text-muted-foreground whitespace-nowrap",children:[n,":"]}),e.jsx("span",{className:"text-foreground break-words",children:l})]},u))}),e.jsx("button",{onClick:n=>{n.stopPropagation(),o(!r)},className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",children:r?"Rohdaten ausblenden":"Rohdaten"}),r&&e.jsx("pre",{className:"text-[10px] text-muted-foreground bg-muted/50 rounded-md p-2 overflow-x-auto max-h-32 font-mono",children:JSON.stringify(t,null,2)})]})}function _t(t){return t?t==="system"||t==="agent"?t[0].toUpperCase():t.split(/[\s.@]+/).filter(Boolean).slice(0,2).map(r=>r[0].toUpperCase()).join(""):"?"}function V(t){if(!t)return"—";try{return new Date(t).toLocaleString("de-CH",{dateStyle:"medium",timeStyle:"short"})}catch{return t}}function At(t){if(!t)return"--:--:--";try{return He(new Date(t),"HH:mm:ss")}catch{return"--:--:--"}}const M=30,St=200;function lr(){const[t,a]=d.useState(""),[r,o]=d.useState(""),[n,l]=d.useState(""),[u,i]=d.useState(null),[m,x]=d.useState(M),[p,_]=d.useState("timeline"),[f,y]=d.useState([]),[h,S]=d.useState(!1),[$,P]=d.useState(0),ve=d.useRef(null),z=d.useRef(!1);d.useEffect(()=>{z.current=h},[h]);const{data:v=[],isLoading:Ne}=Z({queryKey:["admin","audit-log"],queryFn:async()=>{const{data:s,error:c}=await L.from("audit_log").select("*").order("created_at",{ascending:!1}).limit(500);if(c)throw c;return s??[]}}),{data:K=[]}=Z({queryKey:["admin","properties","names"],queryFn:async()=>{const{data:s,error:c}=await L.from("properties").select("id, name").order("name");if(c)throw c;return s??[]}}),D=d.useMemo(()=>{const s=new Map;return K.forEach(c=>s.set(c.id,c.name)),s},[K]);d.useEffect(()=>{if(p!=="live")return;y(v.slice(0,50)),P(0);const s=L.channel("audit-log-live").on("postgres_changes",{event:"INSERT",schema:"public",table:"audit_log"},c=>{const j=c.new;if(z.current){P(b=>b+1);return}y(b=>[j,...b].slice(0,St))}).subscribe();return()=>{L.removeChannel(s)}},[p,v]);const ye=d.useCallback(()=>{S(!1),P(0)},[]),we=d.useMemo(()=>[...new Set(v.map(s=>s.action_type))].sort(),[v]),_e=d.useMemo(()=>[...new Set(v.map(s=>s.actor).filter(Boolean))].sort(),[v]),C=d.useMemo(()=>{const s=t.toLowerCase();return v.filter(c=>!(r&&c.action_type!==r||n&&c.actor!==n||s&&![c.action_type,c.actor,c.entity_type,c.entity_id,D.get(c.related_property_id??""),JSON.stringify(c.details)].filter(Boolean).join(" ").toLowerCase().includes(s)))},[v,t,r,n,D]),Ae=d.useMemo(()=>v.filter(s=>
6s.created_at&&ut(new Date(s.created_at))).length,[v]),Se=d.useMemo(()=>{var c;const s={};return v.forEach(j=>{j.actor&&(s[j.actor]=(s[j.actor]||0)+1)}),((c=Object.entries(s).sort((j,b)=>b[1]-j[1])[0])==null?void 0:c[0])??"—"},[v]),Ce=d.useMemo(()=>{var j;const s={};v.forEach(b=>s[b.action_type]=(s[b.action_type]||0)+1);const c=Object.entries(s).sort((b,I)=>I[1]-b[1])[0];return c?((j=A[c[0]])==null?void 0:j.label)??c[0]:"—"},[v]),G=C.slice(0,m);return e.jsx(Oe,{children:e.jsx(Le,{children:e.jsxs("div",{className:"max-w-[1440px] mx-auto w-full flex flex-col gap-4 md:gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx(J,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h1",{className:"text-xl font-bold text-foreground",children:"Audit-Log"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Alle Systemaktivitäten im Überblick"})]}),e.jsxs("div",{className:"flex items-center bg-muted rounded-lg p-1 gap-0.5",children:[e.jsxs(F,{variant:p==="timeline"?"default":"ghost",size:"sm",className:"h-8 gap-1.5 text-xs",onClick:()=>_("timeline"),children:[e.jsx(Ke,{className:"w-3.5 h-3.5"}),"Verlauf"]}),e.jsxs(F,{variant:p==="live"?"default":"ghost",size:"sm",className:"h-8 gap-1.5 text-xs",onClick:()=>_("live"),children:[e.jsx(re,{className:"w-3.5 h-3.5"}),"Live",p==="live"&&!h&&e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-emerald-500"})]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[e.jsx(E,{className:"border-border/50",children:e.jsxs(k,{className:"p-4 flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-emerald-100 flex items-center justify-center",children:e.jsx(Ge,{className:"w-4 h-4 text-emerald-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Heute"}),e.jsx("p",{className:"text-lg font-bold text-foreground",children:Ae})]})]})}),e.jsx(E,{className:"border-border/50",children:e.jsxs(k,{className:"p-4 flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-blue-100 flex items-center justify-center",children:e.jsx(Ze,{className:"w-4 h-4 text-blue-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Aktivster Akteur"}),e.jsx("p",{className:"text-sm font-semibold text-foreground truncate",children:Se})]})]})}),e.jsx(E,{className:"border-border/50",children:e.jsxs(k,{className:"p-4 flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-violet-100 flex items-center justify-center",children:e.jsx(oe,{className:"w-4 h-4 text-violet-600"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Häufigste Aktion"}),e.jsx("p",{className:"text-sm font-semibold text-foreground",children:Ce})]})]})})]}),p==="timeline"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("select",{className:"h-9 rounded-lg border border-border/60 bg-card px-3 text-xs text-foreground",value:r,onChange:s=>{o(s.target.value),x(M)},children:[e.jsx("option",{value:"",children:"Alle Aktionen"}),we.map(s=>{var c;return e.jsx("option",{value:s,children:((c=A[s])==null?void 0:c.label)??s},s)})]}),e.jsxs("select",{className:"h-9 rounded-lg border border-border/60 bg-card px-3 text-xs text-foreground",value:n,onChange:s=>{l(s.target.value),x(M)},children:[e.jsx("option",{value:"",children:"Alle Akteure"}),_e.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsxs("div",{className:"relative w-60 ml-auto",children:[e.jsx(Ye,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(Te,{className:"pl-9 h-9 text-xs",placeholder:"Suche…",value:t,onChange:s=>{a(s.target.value),x(M)}})]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[C.length," Einträge"]})]}),e.jsx(E,{children:e.jsxs(k,{className:"p-4 md:p-6",children:[Ne?e.jsx("div",{className:"space-y-4",children:[1,2,3].map(s=>e.jsx("div",{className:"h-16 rounded-lg bg-muted/40 animate-pulse"},s))}):C.length===0?e.jsxs("div",{className:"py-12 text-center",children:[e.jsx(J,{className:"h-10 w-10 text-muted-foreground mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Keine Einträge gefunden."})]}):e.jsx("div",{className:"space-y-0",children:G.map((s,c)=>e.jsx(Ct,{entry:s,isLast:c===G.length-1,isExpanded:u===s.id,onToggle:()=>i(u===s.id?null:s.id),propName:s.related_property_id?D.get(s.related_property_id)??null:null},s.id))}),m<C.length&&e.jsxs("button",{onClick:()=>x(s=>s+M),className:"w-full mt-4 py-2.5 text-xs font-medium text-primary hover:bg-primary/5 rounded-lg border border-border/40 transition-colors",children:["Weitere ",Math.min(M,C.length-m)," von ",C.length-m," laden"]})]})})]}),p==="live"&&e.jsx(E,{className:"border-border/50",children:e.jsxs(k,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 border-b border-border/40",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[h?e.jsx("span",{className:"inline-flex rounded-full h-2 w-2 bg-orange-400"}):e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-emerald-500"})]}),e.jsx("span",{className:"text-xs font-medium text-foreground",children:h?"Pausiert":"Verbunden"})]}),$>0&&h&&e.jsxs(O,{variant:"secondary",className:"text-[10px] px-1.5 py-0 bg-emerald-100 text-emerald-700 border-emerald-200",children:["+",$," neu"]}),e.jsxs("div",{className:"ml-auto flex items-center gap-1.5",children:[e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[f.length," Einträge"]}),e.jsx(F,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>{h?ye():S(!0)},children:h?e.jsx(qe,{className:"w-3.5 h-3.5"}):e.jsx(We,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{ref:ve,className:"max-h-[600px] overflow-y-auto",children:f.length===0?e.jsxs("div",{className:"py-16 text-center",children:[e.jsx(re,{className:"h-8 w-8 text-muted-foreground mx-auto mb-3 animate-pulse"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Warte auf neue Einträge…"})]}):e.jsx("div",{className:"divide-y divide-border/30",children:f.map(s=>{var I;const c=A[s.action_type]??ge,j=u===s.id,b=s.related_property_id?D.get(s.related_property_id):null;return e.jsxs("button",{onClick:()=>i(j?null:s.id),className:N("w-full text-left px-4 py-2 hover:bg-muted/30 transition-colors","animate-in fade-in slide-in-from-top-1 duration-300"),children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:"text-[11px] font-mono text-muted-foreground tabular-nums shrink-0",children:At(s.created_at)}),e.jsx("span",{className:N("w-2 h-2 rounded-full shrink-0",c.dot)}),e.jsx("span",{className:"text-xs font-medium text-foreground truncate flex-1",children:je(s.action_type,s.entity_type)}),b&&e.jsx("span",{className:"text-[10px] text-muted-foreground truncate max-w-[120px] hidden sm:inline",children:b}),e.jsx("span",{className:"text-[10px] text-muted-foreground truncate max-w-[100px]",children:s.actor??"—"}),e.jsx(ne,{className:N("w-3 h-3 text-muted-foreground shrink-0 transition-transform",j&&"rotate-180")}
6)]}),j&&e.jsxs("div",{className:"mt-2 pl-[72px] pb-1 space-y-1.5",onClick:Me=>Me.stopPropagation(),children:[e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-[11px]",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Akteur:"})," ",e.jsx("span",{className:"text-foreground font-medium",children:s.actor??"—"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Aktion:"})," ",e.jsx(O,{variant:"outline",className:N("text-[10px] ml-1",((I=A[s.action_type])==null?void 0:I.color)??""),children:s.action_type})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Entität:"})," ",e.jsx("span",{className:"text-foreground",children:s.entity_type??"—"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Entity-ID:"})," ",e.jsx("span",{className:"text-foreground font-mono text-[10px]",children:s.entity_id?s.entity_id.slice(0,12)+"…":"—"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Zeitpunkt:"})," ",e.jsx("span",{className:"text-foreground",children:V(s.created_at)})]}),b&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Objekt:"})," ",e.jsx("span",{className:"text-foreground",children:b})]})]}),s.details&&Object.keys(s.details).length>0&&e.jsx("div",{className:"mt-1",children:e.jsx(be,{details:s.details})})]})]},s.id)})})})]})})]})})})}function Ct({entry:t,isLast:a,isExpanded:r,onToggle:o,propName:n}){var m;const l=A[t.action_type]??ge,u=l.icon,i=(()=>{if(!t.created_at)return"—";try{return dt(new Date(t.created_at),{addSuffix:!0,locale:Ue})}catch{return"—"}})();return e.jsxs("div",{className:"flex gap-3 group",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:N("w-8 h-8 rounded-full flex items-center justify-center shrink-0",l.color),children:e.jsx(u,{className:"w-3.5 h-3.5"})}),!a&&e.jsx("div",{className:"w-px flex-1 bg-border/50 min-h-[16px]"})]}),e.jsxs("div",{className:N("flex-1 min-w-0 mb-3 rounded-lg border border-border/40 border-l-[3px] overflow-hidden transition-colors",l.border,r&&"bg-muted/30"),children:[e.jsxs("button",{onClick:o,className:"w-full flex items-center gap-3 px-3 py-2.5 hover:bg-muted/30 transition-colors text-left",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-semibold text-foreground leading-snug",children:je(t.action_type,t.entity_type)}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[e.jsxs(Y,{children:[e.jsx(q,{asChild:!0,children:e.jsx("span",{className:"text-[10px] text-muted-foreground cursor-default",children:i})}),e.jsx(W,{side:"top",className:"text-xs",children:V(t.created_at)})]}),n&&e.jsxs(O,{variant:"outline",className:"text-[10px] px-1.5 py-0 gap-1 font-normal",children:[e.jsx(Re,{className:"w-2.5 h-2.5"}),n]})]})]}),t.actor&&e.jsxs(Y,{children:[e.jsx(q,{asChild:!0,children:e.jsx("div",{children:e.jsx(pe,{className:"w-6 h-6",children:e.jsx(he,{className:"text-[10px] font-medium bg-primary/10 text-primary",children:_t(t.actor)})})})}),e.jsx(W,{side:"top",className:"text-xs",children:t.actor})]}),r?e.jsx(Je,{className:"w-3.5 h-3.5 text-muted-foreground shrink-0"}):e.jsx(ne,{className:"w-3.5 h-3.5 text-muted-foreground shrink-0"})]}),r&&e.jsxs("div",{className:"px-3 pb-3 pt-1 border-t border-border/30 space-y-1.5",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-[11px]",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Akteur:"})," ",e.jsx("span",{className:"text-foreground font-medium",children:t.actor??"—"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Aktion:"})," ",e.jsx(O,{variant:"outline",className:N("text-[10px] ml-1",((m=A[t.action_type])==null?void 0:m.color)??""),children:t.action_type})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Entität:"})," ",e.jsx("span",{className:"text-foreground",children:t.entity_type??"—"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Entity-ID:"})," ",e.jsx("span",{className:"text-foreground font-mono text-[10px]",children:t.entity_id?t.entity_id.slice(0,12)+"…":"—"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Zeitpunkt:"})," ",e.jsx("span",{className:"text-foreground",children:V(t.created_at)})]}),n&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Objekt:"})," ",e.jsx("span",{className:"text-foreground",children:n})]})]}),t.details&&Object.keys(t.details).length>0&&e.jsxs("div",{className:"mt-2",children:[e.jsx("p",{className:"text-[10px] text-muted-foreground mb-1",children:"Details"}),e.jsx(be,{details:t.details})]})]})]})]})}export{lr 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.