PageSourceSearch

https://lexedit.ai/_next/static/chunks/9fcb96eabf333916.js?dpl=dpl_63bmbuPCooZeds82MKcd6R7JWAJY

js lexedit.ai collected 2026-09-24 12:40:04 UTC 27,191 bytes, 5 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="484460ef-0ed7-f8b7-09fd-3b9702a1b96f")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,690614,e=>{"use strict";let t=(0,e.i(4261).default)("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);e.s(["Mic",()=>t],690614)},505138,e=>{"use strict";function t(){if("undefined"!=typeof MediaRecorder){for(let e of[{mimeType:"audio/webm;codecs=opus",ext:"webm"},{mimeType:"audio/webm",ext:"webm"},{mimeType:"audio/mp4",ext:"m4a"}])if(MediaRecorder.isTypeSupported(e.mimeType))return e}return{mimeType:"",ext:"webm"}}function r(e,t){return e.includes("mp4")?"m4a":e.includes("webm")?"webm":e.includes("ogg")?"ogg":e.includes("mpeg")?"mp3":e.includes("wav")?"wav":t}e.s(["audioExtensionFromType",()=>r,"pickAudioRecordingFormat",()=>t])},473338,e=>{"use strict";let t=(0,e.i(4261).default)("CloudDownload",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]);e.s(["CloudDownload",()=>t],473338)},728771,294348,595003,e=>{"use strict";var t=e.i(4261);let r=(0,t.default)("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);e.s(["SquarePen",()=>r],728771);var a=e.i(350801),s=e.i(758001),n=e.i(718405),i=e.i(157638);let o=(0,t.default)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var l=e.i(587982),d=e.i(437909),c=e.i(901415);let u=(0,t.default)("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]),m=(0,t.default)("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);var x=e.i(279990);let p=(0,t.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var h=e.i(410266),f=e.i(424377),g=e.i(256222),b=e.i(161479),y=e.i(465486),j=e.i(839045),w=e.i(740046),v=e.i(930758),N=e.i(176167),k=e.i(262933),C=e.i(318398),S=e.i(364023);let z={active:"Aktywna",closed:"Zamknięta",on_hold:"Wstrzymana"};function D(e){return"active"===e?"#2E7D5B":"on_hold"===e?"#B8935A":"#B3A892"}function M({matter:e,active:t,onClick:r,onDelete:s}){let n="closed"===e.status,i="on_hold"===e.status;return(0,a.jsxs)("div",{className:"group/row relative",children:[(0,a.jsxs)("button",{onClick:r,className:`relative flex min-h-9 w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left transition-colors ${t?"bg-mist/70":"hover:bg-muted/70"} ${s?"pointer-coarse:pr-9":""}`,children:[(0,a.jsx)("span",{className:`min-w-0 flex-1 truncate text-[13px] ${t?"font-medium":""} ${n?"text-muted-foreground":"text-foreground"}`,children:e.client_name||e.name}),i&&(0,a.jsx)("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full ${s?"transition-opacity group-hover/row:opacity-0":""}`,style:{background:D(e.status)},"data-tip":z[e.status]})]}),s&&(0,a.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),s()},className:"absolute right-1.5 top-1/2 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-destructive/10 hover:text-destructive group-hover/row:opacity-100 pointer-coarse:opacity-100","data-tip":"Usuń sprawę","aria-label":"Usuń sprawę",children:(0,a.jsx)(g.Trash2,{className:"h-3.5 w-3.5"})})]})}function _({cases:e,loading:t,selectedCaseId:r,onSelectCase:n,onNewCase:o,onDeleteCase:l}
2){let[c,u]=(0,s.useState)(!0);return(0,a.jsxs)("div",{className:"flex shrink-0 flex-col border-b border-border/60 px-3 pb-3 pt-3",children:[(0,a.jsxs)("div",{className:"group flex items-center justify-between gap-1 pb-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>u(e=>!e),className:"flex items-center gap-1 rounded-md px-1 py-1 transition-colors hover:bg-muted/70","aria-expanded":c,children:[(0,a.jsxs)("span",{className:"flex items-center gap-1.5 text-[10.5px] font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:["Sprawy",(0,a.jsx)("span",{className:"font-medium tracking-normal text-muted-foreground/80",children:e.length})]}),(0,a.jsx)(i.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform ${c?"":"-rotate-90"}`})]}),(0,a.jsx)("button",{onClick:o,className:"flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-all duration-150 hover:bg-muted hover:text-foreground focus-visible:opacity-100 group-hover:opacity-100 pointer-coarse:opacity-100","data-tip":"Nowa sprawa","aria-label":"Nowa sprawa",children:(0,a.jsx)(S.Plus,{className:"h-3.5 w-3.5"})})]}),c&&(t?(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-3 text-xs text-muted-foreground",children:[(0,a.jsx)(d.Loader2,{className:"h-3.5 w-3.5 animate-spin"})," Ładowanie spraw…"]}):0===e.length?(0,a.jsx)("button",{onClick:o,className:"rounded-md border border-dashed border-border/80 px-3 py-3 text-left text-[12px] text-muted-foreground transition-colors hover:bg-muted/70",children:"Załóż pierwszą sprawę, aby kolejne badania widziały wspólne akta, pisma i ustalenia."}):(0,a.jsx)("div",{className:"pr-0.5",children:(0,a.jsx)("div",{className:"flex flex-col gap-1",children:e.map(e=>(0,a.jsx)(M,{matter:e,active:r===e.id,onClick:()=>n(e.id),onDelete:l?()=>l(e):void 0},e.id))})}))]})}function A({item:e,isSelected:t,isRunning:r,onSelect:n,onDeleted:i}){let[o,l]=(0,s.useState)(!1),[c,u]=(0,s.useState)(!1),m=(0,N.humanizeAnonMarkers)(e.query),x=r||"running"===e.status||"pending"===e.status||"queued"===e.status,p=async()=>{u(!0);try{await (0,j.deleteThread)(e.id),i(e.id)}catch{}finally{u(!1),l(!1)}};return(0,a.jsxs)("div",{className:"relative group",children:[(0,a.jsxs)("button",{onClick:n,className:`flex min-h-9 w-full items-center gap-2.5 rounded-md px-2.5 py-2 pointer-coarse:pr-8 text-left text-[13px] leading-snug transition-colors ${t?"bg-mist/70 font-medium text-foreground":x?"text-amber-700 hover:bg-amber-50/80":"failed"===e.status?"text-muted-foreground/60 hover:bg-muted/70 hover:text-foreground":"text-muted-foreground hover:bg-muted/70 hover:text-foreground"}`,children:[x&&(0,a.jsx)(d.Loader2,{className:"h-4 w-4 shrink-0 animate-spin text-amber-500","aria-label":"W toku"}),"failed"===e.status&&(0,a.jsx)(b.X,{className:"h-4 w-4 shrink-0 text-destructive/50","aria-label":"Błąd"}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate","data-tip":m,children:m})]}),(0,a.jsx)("div",{className:"absolute right-1.5 top-1/2 flex -translate-y-1/2 items-center gap-0.5 rounded-md border border-border/50 bg-background/95 opacity-0 shadow-sm transition-opacity group-hover:opacity-100 pointer-coarse:opacity-100",children:(0,a.jsx)("button",{onClick:e=>{e.stopPropagation(),l(!0)},className:"rounded p-1 text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive","data-tip":"Usuń","aria-label":"Usuń",children:(0,a.jsx)(g.Trash2,{className:"h-3 w-3"})})}),o&&(0,a.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/40",onClick:()=>l(!1)}),(0,a.jsxs)("div",{className:"relative bg-background rounded-lg border shadow-lg p-5 mx-4 max-w-sm w-full",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"Usunąć badanie?"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mb-4 line-clamp-2",children:m}),(0,a.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,a.jsx)("button",{onClick:()=>l(!1),className:"px-3 py-1.5 rounded-md text-xs font-medium hover:bg-muted transition-colors",children:"Anuluj"}
2),(0,a.jsx)("button",{onClick:p,disabled:c,className:"px-3 py-1.5 rounded-md text-xs font-medium bg-destructive text-destructive-foreground hover:bg-destructive/90 transition-colors disabled:opacity-50",children:c?"Usuwanie...":"Usuń"})]})]})]})]})}function L({label:e,onClick:t,active:r}){return(0,a.jsx)("button",{onClick:t,"aria-current":r?"page":void 0,className:`flex h-9 w-full items-center rounded-md px-2.5 text-[13px] font-medium transition-colors ${r?"bg-mist/70 text-foreground":"text-muted-foreground hover:bg-muted/70 hover:text-foreground"}`,children:(0,a.jsx)("span",{className:"truncate",children:e})})}function q({text:e,runningQueries:t,onSelectQuery:r}){return(0,a.jsx)("div",{className:"flex-1 px-4 py-6 text-sm text-muted-foreground",children:(0,a.jsxs)("div",{className:"rounded-2xl border border-border/40 bg-white/70 px-4 py-4 space-y-3",children:[(0,a.jsx)("p",{children:e}),(t??[]).map(e=>(0,a.jsxs)("button",{onClick:()=>r(e.id),className:"w-full rounded-xl border border-primary/20 bg-primary/5 px-3 py-2 text-left text-xs text-primary transition hover:bg-primary/10",children:["Trwa analiza: ",(0,N.humanizeAnonMarkers)(e.query)]},e.id))]})})}function T({history:e,caseHistory:t,historyError:r,onRetryHistory:m,selectedQueryId:g,onSelectQuery:j,onSelectCaseThread:v,onNewResearch:C,onCollapse:S,onDeleted:z,runningQueries:D,onCancelRunning:M,user:T,billing:$,isAdmin:P,activeView:U,onViewChange:H,onLoginClick:I,onOpenSettings:R,cases:B,casesLoading:E,selectedCaseId:O,onSelectCase:Q,onNewCase:W,onDeleteCase:F}
2){let[V,Z]=(0,s.useState)(""),[X,K]=(0,s.useState)(!1),G=(0,s.useRef)(null);(0,s.useEffect)(()=>{X&&G.current?.focus()},[X]);let J=(0,s.useMemo)(()=>{let t=new Date().toISOString();return(D??[]).map(r=>{let a=e.find(e=>e.id===r.id);return a?{...a,query:r.query||a.query}:{id:r.id,query:r.query,status:"running",model:"",cost_usd:null,num_turns:null,created_at:t,updated_at:t,parent_query_id:null,share_token:null}})},[e,D]),Y=(0,s.useMemo)(()=>{let t=V.trim().toLowerCase(),r=new Set(J.map(e=>e.id));return e.filter(e=>!r.has(e.id)&&(!t||e.query.toLowerCase().includes(t)))},[e,J,V]),ee=(0,s.useMemo)(()=>{let e=V.trim().toLowerCase();return e?J.filter(t=>t.query.toLowerCase().includes(e)):J},[J,V]),et=(0,s.useMemo)(()=>(function(e){let t=new Date,r=t.toDateString(),a=new Date(t);a.setDate(a.getDate()-1);let s=a.toDateString(),n=new Date(t);n.setDate(n.getDate()-7);let i=[],o=[],l=[],d=[];for(let t of e){let e=new Date(t.updated_at||t.created_at),a=e.toDateString();a===r?i.push(t):a===s?o.push(t):e>=n?l.push(t):d.push(t)}let c=[];return i.length&&c.push({label:"Dzisiaj",items:i}),o.length&&c.push({label:"Wczoraj",items:o}),l.length&&c.push({label:"Ostatni tydzień",items:l}),d.length&&c.push({label:"Starsze",items:d}),c})(Y),[Y]),[er,ea]=(0,s.useState)(!0),es=(0,s.useMemo)(()=>{let e=V.trim().toLowerCase();return e?t.filter(t=>t.query.toLowerCase().includes(e)||(t.case_name||"").toLowerCase().includes(e)||(t.case_client_name||"").toLowerCase().includes(e)):t},[t,V]);return(0,a.jsxs)("div",{className:"flex flex-col h-full",children:[(0,a.jsx)("div",{className:"px-4 py-3",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)(k.LexeditLockup,{size:.78}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("button",{onClick:()=>K(e=>!e),className:`flex h-8 w-8 items-center justify-center rounded-md transition-colors ${X?"bg-card text-foreground shadow-sm ring-1 ring-border/70":"text-muted-foreground hover:bg-muted/70 hover:text-foreground"}`,"data-tip":"Szukaj","aria-label":"Szukaj w historii",children:(0,a.jsx)(x.Search,{className:"h-4 w-4"})}),(0,a.jsx)("button",{onClick:S,className:"flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted/70 hover:text-foreground","data-tip":"Zwiń panel","aria-label":"Zwiń panel",children:(0,a.jsx)(u,{className:"h-4 w-4"})})]})]})}),(0,a.jsxs)("div",{className:"space-y-0.5 px-3 pb-3",children:[(0,a.jsx)("button",{onClick:()=>{H?.("research"),C()},className:"flex h-9 w-full items-center rounded-md border border-primary/10 bg-primary/[0.04] px-2.5 text-[13px] font-semibold text-foreground transition-colors hover:bg-primary/[0.07]",children:"Nowe badanie"}),(0,a.jsx)(L,{label:"Orzecznictwo",onClick:()=>H?.("case-law"),active:"case-law"===U}),(0,a.jsx)(L,{label:"Aktualności",onClick:()=>H?.("news"),active:"news"===U}),P&&(0,a.jsx)(L,{label:"Admin",onClick:()=>H?.("admin"),active:"admin"===U})]}),(0,a.jsx)("div",{className:"mx-4 border-t border-border/60"}),"research"===U&&(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",children:[(0,a.jsx)(_,{cases:B,loading:E,selectedCaseId:O,onSelectCase:Q,onNewCase:W,onDeleteCase:F}),es.length>0&&(0,a.jsxs)("div",{className:"flex shrink-0 flex-col border-b border-border/60 px-3 pb-2 pt-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>ea(e=>!e),className:"flex w-full items-center justify-between rounded-md px-1 py-1.5 transition-colors hover:bg-muted/70","aria-expanded":er,children:[(0,a.jsxs)("span",{className:"flex items-center gap-1.5 text-[10.5px] font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:["W sprawach",(0,a.jsx)("span",{className:"font-medium tracking-normal text-muted-foreground/80",children:es.length})]}),(0,a.jsx)(i.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform ${er?"":"-rotate-90"}`})]}),er&&(0,a.jsx)("div",{className:"pr-0.5",children:es.map(e=>{let t=e.case_client_name||e.case_name,r=(0,N.humanizeAnonMarkers)(e.query),s=g===e.id;return(0,a.jsxs)("button",{onClick:()=>v?.(e.id,e.case_id),className:`flex min-h-9 w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-left transition-colors ${s?"bg-mist/70":"hover:bg-muted/70"}`,children:["failed"===e.status&&(0,a.jsx)(b.X,{className:"h-4 w-4 shrink-0 text-destructive/50","aria-label":"Błąd"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:`block truncate text-[13px] leading-snug ${s?"text-foreground":"text-muted-foreground"}`,"data-tip":r,children:r}),(0,a.jsx)("span",{className:"block truncate text-[11px] text-muted-foreground
2/70","data-tip":t,children:t})]})]},e.id)})})]}),(0,a.jsx)("div",{className:"flex items-center justify-between px-4 pb-1.5 pt-3",children:(0,a.jsx)("p",{className:"text-[10.5px] font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:"Badania"})}),X&&(0,a.jsx)("div",{className:"px-4 pb-2 pt-1",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(x.Search,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70"}),(0,a.jsx)("input",{ref:G,type:"text",value:V,onChange:e=>Z(e.target.value),placeholder:"Szukaj badań...",className:"h-9 w-full rounded-md border border-border/70 bg-card pl-8 pr-8 text-base text-foreground shadow-sm outline-none transition-colors placeholder:text-muted-foreground/60 focus:border-primary/30 focus:ring-2 focus:ring-primary/10 sm:text-sm"}),V&&(0,a.jsx)("button",{type:"button",onClick:()=>Z(""),className:"absolute right-2 top-1/2 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground","aria-label":"Wyczyść wyszukiwanie","data-tip":"Wyczyść",children:(0,a.jsx)(b.X,{className:"h-3.5 w-3.5"})})]})}),r?(0,a.jsxs)("div",{className:"mx-3 my-3 rounded-md border border-red-200 bg-red-50 px-3 py-3 text-[12px] leading-snug text-red-800",children:[(0,a.jsx)("div",{className:"font-medium",children:"Nie udało się pobrać historii"}),(0,a.jsxs)("div",{className:"mt-1 text-red-700/85",children:[r,". Odśwież stronę lub spróbuj ponownie za chwilę."]}),m&&(0,a.jsx)("button",{type:"button",onClick:m,className:"mt-2 inline-flex h-7 items-center rounded border border-red-300 bg-white px-2 text-[11px] font-medium text-red-800 transition-colors hover:bg-red-50",children:"Spróbuj ponownie"})]}):0===et.length&&0===ee.length?(0,a.jsx)("p",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:V?"Brak wyników":"Brak historii"}):(0,a.jsxs)("nav",{className:"px-3 pb-2",children:[ee.length>0&&(0,a.jsx)("div",{className:"mb-1 pt-2",children:ee.map(e=>(0,a.jsxs)("div",{className:"relative group",children:[(0,a.jsxs)("button",{onClick:()=>j(e.id),className:`flex min-h-9 w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left text-[13px] leading-snug transition-colors ${g===e.id?"bg-mist/70 text-primary":"text-primary/80 hover:bg-primary/5 hover:text-primary"} ${M?"pointer-coarse:pr-8":""}`,children:[(0,a.jsx)(d.Loader2,{className:"h-3.5 w-3.5 shrink-0 animate-spin","aria-label":"W toku"}),(0,a.jsx)("span",{className:"min-w-0 flex-1 truncate","data-tip":(0,N.humanizeAnonMarkers)(e.query),children:(0,N.humanizeAnonMarkers)(e.query)})]}),M&&(0,a.jsx)("div",{className:"absolute right-2 top-1.5 opacity-0 transition-opacity group-hover:opacity-100 pointer-coarse:opacity-100",children:(0,a.jsx)("button",{onClick:t=>{t.stopPropagation(),M(e.id)},className:"rounded p-1 text-destructive/60 transition-colors hover:bg-destructive/10 hover:text-destructive","data-tip":"Anuluj badanie","aria-label":"Anuluj badanie",children:(0,a.jsx)("svg",{className:"h-3 w-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,a.jsx)("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})})})})]},e.id))}),et.map(e=>(0,a.jsxs)("div",{className:"mb-1",children:[(0,a.jsx)("p",{className:"px-1 pb-1 pt-3 text-[10.5px] font-semibold uppercase tracking-[0.16em] text-muted-foreground/70",children:e.label}),e.items.map(e=>(0,a.jsx)(A,{item:e,isSelected:g===e.id,isRunning:(D??[]).some(t=>t.id===e.id),onSelect:()=>j(e.id),onDeleted:z},e.id))]},e.label))]})]}),"news"===U&&(0,a.jsx)(q,{text:"Aktualności otwierają się w głównym panelu. Historia badań wróci po przełączeniu z powrotem na research.",runningQueries:D,onSelectQuery:j}),"case-law"===U&&(0,a.jsx)(q,{text:"Wyszukiwarka orzeczeń ładuje się w głównej części aplikacji. Możesz tu szukać spraw i filtrować wyniki bez opuszczania research.",runningQueries:D,onSelectQuery:j}),"admin"===U&&(0,a.jsx)(q,{text:"Panel admina ładuje się w głównej części aplikacji. Możesz tu zarządzać rolami, statystykami i konfiguracją.",runningQueries:D,onSelectQuery:j}),(0,a.jsxs)("div",{className:"mt-auto space-y-2 border-t border-border/60 bg-secondary/70 p-3",children:[T&&T.is_anonymous&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",onClick:()=>I?.("signup"),className:"flex h-9 w-full items-center justify-center gap-2 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:"Załóż darmowe konto"}),(0,a.jsxs)("button",{type:"button",onClick:()=>I?.("login"),className:"flex h-9 w-full items-center justify-center gap-2 rounded-md border border-border/80 bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-muted/70",children:[(0,a.jsx)(c.LogOut,{className:"h-3.5 w-3.5 rotate-180"}),(0,a.jsx)("span",{children:"Zaloguj się"})]}),(0,a.jsx)(n.default,{href:"/pomoc/research",target:"_blank",rel:"noreferrer",className:"block px-3 py-1 text-center text-[11.5px] text-muted-foreground transition-colors hover:text-foreground",children:"Pomoc"})]}),T&&!T.is_anonymous&&(0,a.jsxs)(y.DropdownMenu,{children:[(0,a.jsx)(y.DropdownMenuTrigger,{asChild:!0,children:(0,a.jsxs)("button",{type:"button","aria-label":"Menu konta",className:"flex min-h-10 w-full items-center gap-2 rounded-md px-1 text-left transition-colors hover:bg-muted/70 focus:outline-none focus-visible:outline-none",children:[(0,a.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-semibold uppercase text-primary",children:(T.email||"?").charAt(0)}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"truncate text-xs text-foreground",children:T.email}),$?.display_name&&(0,a.jsx)("p",{className:"truncate text-[11px] text-muted-foreground",children:$.display_name})]}),(0,a.jsx)(o,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})]})}),(0,a.jsxs)(y.DropdownMenuContent,{side:"top",align:"start",sideOffset:8,className:"w-[264px] rounded-xl p-1.5 shadow-lg",children:[(0,a.jsxs)(y.DropdownMenuLabel,{className:"flex items-center gap-2.5 px-1.5 py-2 font-normal",children:[(0,a.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-semibold uppercase text-primary",children:(T.email||"?").charAt(0)}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"truncate text-[13px] font-medium text-foreground",children:T.email}),$?.display_name&&(0,a.jsx)("p",{className:"truncate text-[11px] text-muted-foreground",children:$.display_name})]})]}),(0,a.jsx)(y.DropdownMenuSeparator,{}),$?.plan==="trial"&&(0,a.jsx)(y.DropdownMenuItem,{asChild:!0,className:"gap-2.5 rounded-md px-2.5 py-2 text-[13px] focus:bg-accent/10 focus:text-foreground",children:(0,a.jsxs)(n.default,{href:"/research/pricing",children:[(0,a.jsx)(f.Sparkles,{}),"Ulepsz plan"]})}),(0,a.jsxs)(y.DropdownMenuItem,{onClick:()=>R?.(),className:"gap-2.5 rounded-md px-2.5 py-2 text-[13px] focus:bg-accent/10 focus:text-foreground",children:[(0,a.jsx)(p,{}),"Ustawienia"]}),(0,a.jsx)(y.DropdownMenuItem,{asChild:!0,className:"gap-2.5 rounded-md px-2.5 py-2 text-[13px] focus:bg-accent/10 focus:text-foreground",children:(0,a.jsxs)(n.default,{href:"/mobile",target:"_blank",rel:"noreferrer",children:[(0,a.jsx)(h.Smartphone,{}),"Aplikacja mobilna"]})}),(0,a.jsx)(y.DropdownMenuItem,{asChild:!0,className:"gap-2.5 rounded-md px-2.5 py-2 text-[13px] focus:bg-accent/10 focus:text-foreground",children:(0,a.jsxs)(n.default,{href:"/pomoc/research",target:"_blank",rel:"noreferrer",children:[(0,a.jsx)(l.HelpCircle,{}),"Pomoc"]})}),(0,a.jsx)(y.DropdownMenuSeparator,{}),(0,a.jsxs)(y.DropdownMenuItem,{variant:"destructive",onClick:async()=>{await fetch((0,w.getLogoutUrl)(),{method:"POST",credentials:"include"}),window.location.href="/research"},className:"gap-2.5 rounded-md px-2.5 py-2 text-[13px]",children:[(0,a.jsx)(c.LogOut,{}),"Wyloguj się"]})]})]})]})]})}e.s(["CASE_STATUS_LABEL",0,z,"caseStatusDot",()=>D,"default",()=>_],294348);let $=(0,s.memo)(function({selectedQueryId:e,onSelectQuery:t,onSelectCaseThread:r,onNewResearch:n,refreshTrigger:i,runningQueries:o,onCancelRunning:l,user:d,isAdmin:c,activeView:u,onViewChange:x,onLoginClick:p,onOpenSettings:h,cases:f,casesLoading:g,selectedCaseId:b,onSelectCase:y,onNewCase:w,onDeleteCase:N}
2){let[k,S]=(0,s.useState)([]),[z,D]=(0,s.useState)([]),[M,_]=(0,s.useState)(null),[A,L]=(0,s.useState)(!1),[q,$]=(0,s.useState)(!1),[P,U]=(0,s.useState)([]),[H,I]=(0,s.useState)([]),[R,B]=(0,s.useState)(null);(0,s.useEffect)(()=>{if(!d||d.is_anonymous)return void B(null);let e=!1;return(0,v.getBillingStatus)().then(t=>{e||B(t)}).catch(()=>{}),()=>{e=!0}},[d?.email,d?.is_anonymous]);let E=(0,s.useCallback)(async()=>{try{let e=await (0,j.getActiveResearch)();U(e.map(e=>({id:e.root_id||e.id,query:e.query})))}catch{}},[]);(0,s.useEffect)(()=>{let e=setInterval(()=>{"hidden"!==document.visibilityState&&E()},3e4);return()=>clearInterval(e)},[E]);let O=(0,s.useCallback)(async()=>{E();try{let e=await (0,j.getHistory)(50,0);S(e),_(null),I(t=>t.filter(t=>!e.some(e=>e.id===t.id)))}catch(e){console.error("[HistorySidebar] Failed to load history:",e),_((0,C.getUserFacingServiceError)(e,"Nieznany błąd"))}try{D(await (0,j.getCaseHistory)(20,0))}catch(e){console.error("[HistorySidebar] Failed to load case history:",e),D([])}},[E]);(0,s.useEffect)(()=>{O()},[O,i]),(0,s.useEffect)(()=>{o&&0!==o.length&&I(e=>{let t=e;for(let e of o){if(e.id.startsWith("pending-"))continue;let r=t.find(t=>t.id===e.id);r&&r.query===e.query||(t=[...t.filter(t=>t.id!==e.id),e])}return t.filter(e=>!e.id.startsWith("pending-"))})},[o]),(0,s.useEffect)(()=>{if(0===H.length)return;let e=setTimeout(()=>I([]),6e3);return()=>clearTimeout(e)},[H]);let Q=e=>{S(t=>t.filter(t=>t.id!==e))},W=(0,s.useMemo)(()=>{let e=[],t=new Set;for(let r of[o??[],P,H])for(let a of r)t.has(a.id)||(t.add(a.id),e.push(a));return e},[o,P,H]),F=e=>{t(e),$(!1)},V=(e,t)=>{r?.(e,t),$(!1)},Z=()=>{n(),$(!1)},X=()=>{h?.(),$(!1)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:`absolute top-3 left-3 z-30 ${!A?"lg:hidden":""}`,children:(0,a.jsx)("button",{onClick:()=>{A?L(!1):$(!0)},className:"flex h-8 w-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground","data-tip":"Historia badań","aria-label":"Historia badań",children:(0,a.jsx)(m,{className:"h-4 w-4"})})}),(0,a.jsx)("aside",{"data-region":"history",className:`hidden lg:flex flex-col border-r border-border/60 bg-secondary overflow-hidden shrink-0 transition-all duration-200 ${A?"w-0 border-r-0":"w-[292px]"}`,children:!A&&(0,a.jsx)(T,{history:k,caseHistory:z,historyError:M,onRetryHistory:O,selectedQueryId:e,onSelectQuery:F,onSelectCaseThread:V,onNewResearch:Z,onCollapse:()=>L(!0),onDeleteCase:N,onDeleted:Q,runningQueries:W,onCancelRunning:l,user:d,billing:R,isAdmin:c,activeView:u,onViewChange:x,onLoginClick:p,onOpenSettings:X,cases:f,casesLoading:g,selectedCaseId:b,onSelectCase:y,onNewCase:w})}),q&&(0,a.jsxs)("div",{className:"fixed inset-0 z-40 lg:hidden",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/40",onClick:()=>$(!1)}),(0,a.jsx)("div",{"data-region":"history",className:"absolute inset-y-0 left-0 w-[min(85vw,300px)] bg-secondary border-r border-border/60 overflow-hidden flex flex-col animate-in slide-in-from-left duration-200",children:(0,a.jsx)(T,{history:k,caseHistory:z,historyError:M,onRetryHistory:O,selectedQueryId:e,onSelectQuery:F,onSelectCaseThread:V,onNewResearch:Z,onCollapse:()=>$(!1),onDeleteCase:N,onDeleted:Q,runningQueries:W,onCancelRunning:l,user:d,billing:R,isAdmin:c,activeView:u,onViewChange:x,onLoginClick:p,onOpenSettings:X,cases:f,casesLoading:g,selectedCaseId:b,onSelectCase:y,onNewCase:w})})]})]})});e.s(["HistoryItem",()=>A,"default",0,$],595003)}]);
3
4//# debugId=484460ef-0ed7-f8b7-09fd-3b9702a1b96f
5//# sourceMappingURL=00c1b84fbf7993c4.js.map

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.