import{S as je,i as Ce,s as qe,e as E,t as $,k as C,c as D,a as w,h as A,m as q,d,b as m,g as S,J as c,j as G,E as le,q as V,w as te,x as ie,y as re,o as B,B as ae,n as P,p as Q,K as ne,N as Me,L as he,l as _e}from"./index-9987666b.js";import{A as Ne}from"./Avatar-eb89e521.js";import{S as Oe,L as Ze}from"./Link-57e97f60.js";import{E as Fe}from"./EventTypeLabel-f121afea.js";import{f as se}from"./index-14ac584d.js";import{l as Je}from"./index-c9b2ee0d.js";import{b as Ke,c as fe}from"./stores-af76d038.js";function Re(n){let e,a=se(n[1],"iiiii",{locale:Je.cs}).toUpperCase()+"",t,l,r=se(n[1],"HH:mm")+"",i,s,f=se(n[2],"HH:mm")+"",o,g,h=(n[0]?n[0].name:"n/a")+"",u,_;return{c(){e=E("div"),t=$(a),l=C(),i=$(r),s=$("-"),o=$(f),g=$(" ("),u=$(h),_=$(")"),this.h()},l(v){e=D(v,"DIV",{class:!0});var k=w(e);t=A(k,a),l=q(k),i=A(k,r),s=A(k,"-"),o=A(k,f),g=A(k," ("),u=A(k,h),_=A(k,")"),k.forEach(d),this.h()},h(){m(e,"class","font-semibold")},m(v,k){S(v,e,k),c(e,t),c(e,l),c(e,i),c(e,s),c(e,o),c(e,g),c(e,u),c(e,_)},p(v,[k]){k&1&&h!==(h=(v[0]?v[0].name:"n/a")+"")&&G(u,h)},i:le,o:le,d(v){v&&d(e)}}}function Ue(n,e,a){let t,{item:l}=e,{e:r}=e,{bundle:i}=e;const s=new Date(l.period.start),f=new Date(l.period.end);return n.$$set=o=>{"item"in o&&a(3,l=o.item),"e"in o&&a(4,r=o.e),"bundle"in o&&a(5,i=o.bundle)},n.$$.update=()=>{n.$$.dirty&40&&a(0,t=i?i.spec.stages.find(o=>o.id===l.stage):null)},[t,s,f,l,r,i]}class Ge extends je{constructor(e){super();Ce(this,e,Ue,Re,qe,{item:3,e:4,bundle:5})}}function Pe(n,e){if(!e)return 0;if(n.duration)return n.duration;const a=e.spec.events.filter(t=>t.parent===n.id);if(a.length>0){let t=a.reduce((l,r)=>l+(r.duration?r.duration:0),0);return t+=5*(a.length-1),t}}function ve(n,e){e.update(a=>{const t=a.favoriteEvents;let l=null;return t.includes(n)?l=Object.assign({},a,{favoriteEvents:t.filter(r=>r!==n)}):(t.push(n),l=Object.assign(a,{favoriteEvents:t})),l})}function me(n,e,a){const t=n.slice();return t[13]=e[a],t}function pe(n,e,a){const t=n.slice();return t[16]=e[a],t}function ge(n,e,a){const t=n.slice();return t[19]=e[a],t}function ke(n,e,a){const t=n.slice();return t[16]=e[a],t}function be(n){let e,a,t=n[7](n[0].speakers),l=[];for(let i=0;iB(l[i],1,1,()=>{l[i]=null});return{c(){e=E("div");for(let i=0;iB(r[s],1,1,()=>{r[s]=null});return{c(){e=E("div"),a=E("div");for(let s=0;sB(l[i],1,1,()=>{l[i]=null});return{c(){for(let i=0;i{K[M]=null}),Q(),_=K[u],_?_.p(n,z):(_=K[u]=W[u](n),_.c()),V(_,1),_.m(h,null)),(!b||z&33&&k!==(k="border rounded py-1.5 px-2.5 text-sm transition-all "+(n[5].favoriteEvents.includes(n[13].id)?"bg-yellow-100":"bg-gray-100")))&&m(e,"class",k)},i(F){b||(V(_),b=!0)},o(F){B(_),b=!1},d(F){F&&d(e),K[u].d(),J=!1,R()}}}function Xe(n){let e,a,t,l,r,i,s,f=n[0].name+"",o,g,h,u,_,v,k,b,J,R,Y,W,K,X,F=n[9](n[0]).length>0,z,M,y,x,H=n[0].speakers&&n[0].speakers.length>0&&be(n);b=new Fe({props:{event:n[0]}});let L=n[2]&&we(n),N=n[4]&&Ie(n),O=n[0].track&&Ve(n),Z=n[0].tags&&$e(n),T=n[0].description&&Be(n),j=F&&ze(n);return{c(){e=E("div"),a=E("div"),t=E("i"),r=C(),i=E("div"),s=E("a"),o=$(f),h=C(),H&&H.c(),u=C(),_=E("div"),v=E("div"),k=E("div"),te(b.$$.fragment),J=C(),L&&L.c(),R=C(),N&&N.c(),Y=C(),O&&O.c(),W=C(),Z&&Z.c(),K=C(),T&&T.c(),X=C(),j&&j.c(),this.h()},l(p){e=D(p,"DIV",{class:!0});var I=w(e);a=D(I,"DIV",{class:!0});var ee=w(a);t=D(ee,"I",{class:!0}),w(t).forEach(d),ee.forEach(d),r=q(I),i=D(I,"DIV",{class:!0});var oe=w(i);s=D(oe,"A",{href:!0});var ue=w(s);o=A(ue,f),ue.forEach(d),oe.forEach(d),h=q(I),H&&H.l(I),u=q(I),_=D(I,"DIV",{class:!0});var ce=w(_);v=D(ce,"DIV",{class:!0});var U=w(v);k=D(U,"DIV",{class:!0});var de=w(k);ie(b.$$.fragment,de),de.forEach(d),J=q(U),L&&L.l(U),R=q(U),N&&N.l(U),Y=q(U),O&&O.l(U),W=q(U),Z&&Z.l(U),U.forEach(d),ce.forEach(d),K=q(I),T&&T.l(I),X=q(I),j&&j.l(I),I.forEach(d),this.h()},h(){m(t,"class",l="fa-star "+(n[5].favoriteEvents.includes(n[0].id)?"fa-solid":"fa-regular")+" cursor-pointer"),m(a,"class","float-right"),m(s,"href",g="/udalosti?id="+n[0].id),m(i,"class","text-lg font-semibold"),m(k,"class","opacity-80"),m(v,"class","text-sm flex flex-wrap gap-3 flex-1"),m(_,"class",""),m(e,"class",z="transition-all mb-4 border px-3 py-2 rounded-md shadow "+(n[5].favoriteEvents.includes(n[0].id)?"bg-yellow-100":""))},m(p,I){S(p,e,I),c(e,a),c(a,t),c(e,r),c(e,i),c(i,s),c(s,o),c(e,h),H&&H.m(e,null),c(e,u),c(e,_),c(_,v),c(v,k),re(b,k,null),c(v,J),L&&L.m(v,null),c(v,R),N&&N.m(v,null),c(v,Y),O&&O.m(v,null),c(v,W),Z&&Z.m(v,null),c(e,K),T&&T.m(e,null),c(e,X),j&&j.m(e,null),M=!0,y||(x=Me(t,"click",n[11]),y=!0)},p(p,[I]){(!M||I&33&&l!==(l="fa-star "+(p[5].favoriteEvents.includes(p[0].id)?"fa-solid":"fa-regular")+" cursor-pointer"))&&m(t,"class",l),(!M||I&1)&&f!==(f=p[0].name+"")&&G(o,f),(!M||I&1&&g!==(g="/udalosti?id="+p[0].id))&&m(s,"href",g),p[0].speakers&&p[0].speakers.length>0?H?(H.p(p,I),I&1&&V(H,1)):(H=be(p),H.c(),V(H,1),H.m(e,u)):H&&(P(),B(H,1,1,()=>{H=null}),Q());const ee={};I&1&&(ee.event=p[0]),b.$set(ee),p[2]?L?(L.p(p,I),I&4&&V(L,1)):(L=we(p),L.c(),V(L,1),L.m(v,R)):L&&(P(),B(L,1,1,()=>{L=null}),Q()),p[4]?N?N.p(p,I):(N=Ie(p),N.c(),N.m(v,Y)):N&&(N.d(1),N=null),p[0].track?O?O.p(p,I):(O=Ve(p),O.c(),O.m(v,W)):O&&(O.d(1),O=null),p[0].tags?Z?Z.p(p,I):(Z=$e(p),Z.c(),Z.m(v,null)):Z&&(Z.d(1),Z=null),p[0].description?T?(T.p(p,I),I&1&&V(T,1)):(T=Be(p),T.c(),V(T,1),T.m(e,X)):T&&(P(),B(T,1,1,()=>{T=null}),Q()),I&1&&(F=p[9](p[0]).length>0),F?j?(j.p(p,I),I&1&&V(j,1)):(j=ze(p),j.c(),V(j,1),j.m(e,null)):j&&(P(),B(j,1,1,()=>{j=null}),Q()),(!M||I&33&&z!==(z="transition-all mb-4 border px-3 py-2 rounded-md shadow "+(p[5].favoriteEvents.includes(p[0].id)?"bg-yellow-100":"")))&&m(e,"class",z)},i(p){M||(V(H),V(b.$$.fragment,p),V(L),V(T),V(j),M=!0)},o(p){B(H),B(b.$$.fragment,p),B(L),B(T),B(j),M=!1},d(p){p&&d(e),H&&H.d(),ae(b),L&&L.d(),N&&N.d(),O&&O.d(),Z&&Z.d(),T&&T.d(),j&&j.d(),y=!1,x()}}}function Ye(n){if(!n.description)return{};const e=n.description.split(` `),a=e.length>1;return{md:e[0],stripped:a}}function ye(n,e,a){let t,l,r,i,s,f;he(n,Ke,b=>a(1,s=b)),he(n,fe,b=>a(5,f=b));let{event:o}=e;const g={link:Ze};function h(b){if(!!b)return b.map(J=>s.spec.speakers.find(R=>R.id===J))}function u(b){const J=s.spec.tracks.find(R=>R.id===b);return J.shortname||J.name}function _(b){return s.spec.events.filter(J=>J.parent===b.id)}const v=()=>ve(t.id,fe),k=b=>ve(b.id,fe);return n.$$set=b=>{"event"in b&&a(10,o=b.event)},n.$$.update=()=>{n.$$.dirty&1024&&a(0,t=o),n.$$.dirty&3&&a(4,l=Pe(t,s)),n.$$.dirty&1&&a(3,r=Ye(t)),n.$$.dirty&3&&a(2,i=s?s.spec.schedule.find(b=>b.event===t.id):null)},[t,s,i,r,l,f,g,h,u,_,o,v,k]}class nl extends je{constructor(e){super();Ce(this,e,ye,Xe,qe,{event:10})}}export{nl as E,Ge as a,ve as b,Pe as c};