PageSourceSearch

https://i-vysocina.cz/assets/index-88kuGTUb.js

js i-vysocina.cz collected 2026-09-25 08:06:50 UTC 14,308 bytes, 1 lines download raw bytes

1import{V as I,r as p,j as e,i as P,M as L,e as O,f as v,m as D,as as V,u as C,ar as W,L as h,y as Z,Z as B,N as q,P as A,t as T}from"./index-BTKcJhd6.js";import{N as R,b as z,S as K,c as Q,s as $,r as H,u as U,a as E}from"./newsroom-categories-Cpyoefzc.js";import{F as G}from"./folder-heart-BFg--ht_.js";import{D as J}from"./database-gG5a8Y30.js";import{A as X}from"./arrow-left-BY_ct31A.js";import{A as M}from"./arrow-right-CpkX8oGz.js";import{C as F}from"./check-B038eIli.js";import{S as Y}from"./settings-j9W2aPBy.js";import{R as ee}from"./refresh-cw-DnFPDfYO.js";const se=[{name:"Jihlava",lat:49.3961,lon:15.591},{name:"Třebíč",lat:49.2148,lon:15.8814},{name:"Žďár nad Sázavou",lat:49.5644,lon:15.9398},{name:"Havlíčkův Brod",lat:49.6079,lon:15.5797},{name:"Pelhřimov",lat:49.4307,lon:15.2229},{name:"Telč",lat:49.1841,lon:15.4528},{name:"Velké Meziříčí",lat:49.3554,lon:16.0124}],te={ai_brief:!0,data:!0,articles:!0,videos:!0};function re({initial:l,saving:N,onComplete:w}){const{categories:g}=I({activeOnly:!0}),a=g.filter(s=>R.has(s.slug)),y=g.filter(s=>!R.has(s.slug)),[n,o]=p.useState(0),[x,_]=p.useState(l.categories??[]),[f,i]=p.useState(l.sections??te),[c,j]=p.useState(l.city),[u,d]=p.useState({lat:l.lat,lon:l.lon}),b=s=>_(r=>r.includes(s)?r.filter(S=>S!==s):[...r,s]),k=s=>i(r=>({...r,[s]:!r[s]})),t=()=>w({categories:x,city:c,lat:u.lat,lon:u.lon,sections:f}),m=s=>{const r=x.includes(s.slug);return e.jsxs("button",{type:"button",onClick:()=>b(s.slug),className:`flex items-center justify-between rounded-xl border p-3 text-left text-sm transition-colors ${r?"border-primary bg-primary/10 text-foreground":"border-border bg-surface/40 hover:border-primary/50"}`,children:[e.jsx("span",{className:"font-medium",children:s.name}),r&&e.jsx(F,{className:"h-4 w-4 text-primary"})]},s.slug)};return e.jsxs("div",{className:"mx-auto max-w-3xl rounded-2xl border border-border bg-card p-6 sm:p-10",children:[e.jsxs("div",{className:"mb-6 flex items-center gap-2",children:[e.jsx("div",{className:"rounded-xl bg-primary/15 p-2 text-primary",children:e.jsx(P,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-display text-2xl font-bold",children:"Vítej v Mém AI Newsroomu"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Tři krátké kroky a tvůj dashboard bude přesně podle tebe."})]})]}),e.jsx("div",{className:"mb-8 flex items-center gap-2",children:[0,1,2].map(s=>e.jsx("div",{className:`h-1.5 flex-1 rounded-full transition-colors ${s<=n?"bg-primary":"bg-muted"}`},s))}),n===0&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"mb-1 flex items-center gap-2 font-display text-lg font-semibold",children:[e.jsx(G,{className:"h-5 w-5 text-primary"}),"Co tě zajímá?"]}),e.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:"Vyber rubriky, ze kterých budeme tahat články. Můžeš zaškrtnout víc."}),a.length>0&&e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Regiony"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:a.map(m)})]}),y.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Témata"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:y.map(m)})]}),e.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:"Tip: bez výběru ti ukážeme všechny rubriky."})]}),e.jsxs("div",{children:[e.jsxs("h3",{className:"mb-1 flex items-center gap-2 font-display text-lg font-semibold",children:[e.jsx(J,{className:"h-5 w-5 text-primary"}),"Datové karty"]}),e.jsx("p",{className:"mb-3 text-sm text-muted-foreground",children:"Co chceš mít na dashboardu kromě článků?"}),e.jsx("div",{className:"space-y-2",children:z.map(s=>e.jsxs("label",{className:"flex cursor-pointer items-center justify-between rounded-xl border border-border bg-surface/40 p-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:s.label}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s.description})]}),e.jsx(K,{checked:f[s.key],onCheckedChange:()=>k(s.key)})]},s.key))})]})]}),n===1&&e.jsxs("div",{children:[e.jsxs("h3",{className:"mb-1 flex items-center gap-2 font-display text-lg font-semibold",children:[e.jsx(L,{className:"h-5 w-5 text-primary"}),"Tvoje město"]}),e.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:"Použijeme ho pro počasí a místní data."}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:se.map(s=>{const r=c===s.name;return e.jsx("button",{type:"button",onClick:()=>{j(s.name),d({lat:s.lat,lon:s.lon})},className:`rounded-xl border p-3 text-left transition-colors ${r?"border-primary bg-primary/10":"border-border bg-surface/40 hover:border-primary/50"}`,children:e.jsx("div",{className:"text-sm font-semibold",children:s.name})},s.name)})}),e.jsxs("div",{className:"mt-4",children:[e.jsx("label",{className:"text-xs text-muted-foreground",children:"…nebo jiné město (ručně)"}),e.jsx(O,{value:c,onChange:s=>j(s.target.value),placeholder:"Název města",className:"mt-1"})]})]}),n===2&&e.jsxs("div",{children:[e.jsxs("h3",{className:"mb-1 flex items-center gap-2 font-display text-lg font-semibold",children:[e.jsx(P,{className:"h-5 w-5 text-primary"}),"Shrnutí"]}),e.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:"Pak ti AI vygeneruje první personalizovaný briefing."}),e.jsxs("div",{className:"space-y-3 rounded-xl border border-border bg-surface/40 p-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Rubriky"}),e.jsx("div",{className:"mt-1 flex flex-wrap gap-1.5",children:x.length===0?e.jsx("span",{className:"text-muted-foreground",children:"Všechny"}):x.map(s=>{const r=g.find(S=>S.slug===s);return e.jsx("span",{className:"rounded-full bg-primary/15 px-2.5 py-0.5 text-xs font-medium text-primary",children:r?.name??s},s)})})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Datové karty"}),e.jsxs("div",{className:"mt-1 flex flex-wrap gap-1.5",children:[z.filter(s=>f[s.key]).map(s=>e.jsx("span",{className:"rounded-full bg-primary/15 px-2.5 py-0.5 text-xs font-medium text-primary",children:s.label},s.key)),z.every(s=>!f[s.key])&&e.jsx("span",{className:"text-muted-foreground",children:"Žádné"})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"Město"}),e.jsx("div",{className:"mt-1 font-medium",children:c||"—"})]})]})]}),e.jsxs("div",{className:"mt-8 flex items-center justify-between",children:[e.jsxs(v,{variant:"ghost",onClick:()=>o(s=>Math.max(0,s-1)),disabled:n===0,children:[e.jsx(X,{className:"mr-1.5 h-4 w-4"})," Zpět"]}),n<2?e.jsxs(v,{onClick:()=>o(s=>s+1),children:["Pokračovat ",e.jsx(M,{className:"ml-1.5 h-4 w-4"})]}):e.jsxs(v,{onClick:t,disabled:N,children:[N?e.jsx(D,{className:"mr-1.5 h-4 w-4 animate-spin"}):e.jsx(F,{className:"mr-1.5 h-4 w-4"}),"Hotovo, ukaž dashboard"]})]})]})}function ue(){const l=V(),N=C(Q),w=C($),g=C(H),{data:a,isLoading:y}=U({queryKey:["newsroom-data"],queryFn:()=>N()}),n=E({mutationFn:t=>w({data:t}),onSuccess:async()=>
1{await l.invalidateQueries({queryKey:["newsroom-data"]})}}),o=E({mutationFn:()=>g(),onSuccess:()=>{T.success("Briefing aktualizován"),l.invalidateQueries({queryKey:["newsroom-data"]})},onError:t=>T.error(t.message)}),[x,_]=p.useState(!1);if(y||!a)return e.jsxs("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:[e.jsx(D,{className:"mr-2 h-5 w-5 animate-spin"})," Připravuji tvůj newsroom…"]});if(!a.prefs.onboarding_completed&&!x)return e.jsx(re,{initial:{categories:a.prefs.categories,city:a.prefs.city,lat:a.prefs.lat,lon:a.prefs.lon},saving:n.isPending,onComplete:async t=>{await n.mutateAsync({...t,onboarding_completed:!0}),await o.mutateAsync()}});const{prefs:i,articles:c,videos:j,weather:u,spot:d,brief:b}=a,k=i.categories.map(t=>W.find(m=>m.slug===t)?.name).filter(Boolean).join(" · ");return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"font-display text-3xl font-bold sm:text-4xl",children:"Dnes v tvém newsroomu"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[k||"Všechny rubriky"," · ",i.city]})]}),e.jsx(v,{asChild:!0,variant:"outline",size:"sm",children:e.jsxs(h,{to:"/muj-newsroom/nastaveni",children:[e.jsx(Y,{className:"mr-1.5 h-4 w-4"})," Upravit preference"]})})]}),i.sections.ai_brief&&e.jsxs("section",{className:"overflow-hidden rounded-2xl border border-primary/30 bg-gradient-to-br from-primary/10 via-card to-card p-6",children:[e.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(P,{className:"h-5 w-5 text-primary"}),e.jsx("h2",{className:"font-display text-xl font-bold",children:"AI briefing"})]}),b&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["· aktualizováno ",new Date(b.generated_at).toLocaleString("cs-CZ")]}),e.jsxs(v,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>o.mutate(),disabled:o.isPending,children:[o.isPending?e.jsx(D,{className:"mr-1.5 h-4 w-4 animate-spin"}):e.jsx(ee,{className:"mr-1.5 h-4 w-4"}),"Regenerovat"]})]}),e.jsx("p",{className:"text-base leading-relaxed text-foreground",children:b?.text??e.jsx("span",{className:"text-muted-foreground",children:'Zatím žádný briefing. Klikni na „Regenerovat" a AI ti shrne dnešek.'})})]}),i.sections.data&&e.jsxs("section",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-2xl border border-border bg-card p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(Z,{className:"h-4 w-4"})," Počasí · ",i.city]}),u?e.jsxs("div",{className:"mt-2",children:[e.jsxs("div",{className:"font-display text-4xl font-bold",children:[u.temp,"°C"]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["vítr ",u.wind," km/h"]})]}):e.jsx("div",{className:"mt-2 text-sm text-muted-foreground",children:"Data nejsou dostupná."})]}),e.jsxs("div",{className:"rounded-2xl border border-border bg-card p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(B,{className:"h-4 w-4"})," Spot elektřina (CZ)"]}),d&&d.now!==null?e.jsxs("div",{className:"mt-2",children:[e.jsxs("div",{className:"font-display text-4xl font-bold",children:[d.now.toFixed(1)," ",e.jsx("span",{className:"text-base font-semibold text-muted-foreground",children:d.currency})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["24h min ",d.min?.toFixed(1)," · max ",d.max?.toFixed(1)]})]}):e.jsx("div",{className:"mt-2 text-sm text-muted-foreground",children:"Data nejsou dostupná."})]})]}),i.sections.articles&&e.jsxs("section",{children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsxs("h2",{className:"flex items-center gap-2 font-display text-xl font-bold",children:[e.jsx(q,{className:"h-5 w-5 text-primary"})," Pro tebe"]}),e.jsxs(h,{to:"/zpravy",search:{tags:void 0},className:"text-sm text-muted-foreground hover:text-foreground",children:["Všechny zprávy ",e.jsx(M,{className:"ml-1 inline h-3 w-3"})]})]}),c.length===0?e.jsxs("div",{className:"rounded-xl border border-dashed border-border p-8 text-center text-sm text-muted-foreground",children:["Pro tvůj výběr zatím nejsou žádné nové články. Zkus rozšířit"," ",e.jsx(h,{to:"/muj-newsroom/nastaveni",className:"text-primary underline",children:"preference"}),"."]}):e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:c.map(t=>{const m=t.image_url??t.cover_image_url;return e.jsxs(h,{to:"/zpravy/$slug",params:{slug:t.slug},className:"group flex flex-col overflow-hidden rounded-xl border border-border bg-card transition-colors hover:border-primary/50",children:[m?e.jsx("img",{src:m,alt:"",loading:"lazy",className:"aspect-video w-full object-cover transition-transform group-hover:scale-105"}):e.jsx("div",{className:"aspect-video w-full bg-muted"}),e.jsxs("div",{className:"flex flex-1 flex-col gap-1.5 p-3",children:[e.jsx("div",{className:"text-xs uppercase tracking-wider text-primary",children:t.category}),e.jsx("h3",{className:"line-clamp-3 font-semibold leading-snug",children:t.title}),t.excerpt&&e.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:t.excerpt})]})]},t.id)})})]}),i.sections.videos&&j.length>0&&e.jsxs("section",{children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsxs("h2",{className:"flex items-center gap-2 font-display text-xl font-bold",children:[e.jsx(A,{className:"h-5 w-5 text-primary"})," Doporučená videa"]}),e.jsxs(h,{to:"/tv",className:"text-sm text-muted-foreground hover:text-foreground",children:["TV archiv ",e.jsx(M,{className:"ml-1 inline h-3 w-3"})]})]}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:j.map(t=>e.jsxs(h,{to:"/tv",className:"group flex flex-col overflow-hidden rounded-xl border border-border bg-card transition-colors hover:border-primary/50",children:[t.thumbnail_url?e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:t.thumbnail_url,alt:"",loading:"lazy",className:"aspect-video w-full object-cover transition-transform group-hover:scale-105"}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"rounded-full bg-black/60 p-2",children:e.jsx(A,{className:"h-5 w-5 fill-white text-white"})})}),t.duration&&e.jsx("span",{className:"absolute bottom-2 right-2 roun
1ded bg-black/70 px-1.5 py-0.5 text-xs text-white",children:t.duration})]}):e.jsx("div",{className:"aspect-video w-full bg-muted"}),e.jsx("div",{className:"p-3",children:e.jsx("h3",{className:"line-clamp-2 font-semibold leading-snug",children:t.title})})]},t.id))})]})]})}export{ue as component};

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.