import{S as _e,i as pe,s as me,e as m,k as A,t as C,c as g,a as b,d as v,m as z,h as F,b as p,g as q,F as u,j as ge,E as S,q as V,w as J,x as Q,y as U,o as j,B as X,n as Y,p as Z,G as x,K as be,H as re,l as ie}from"./index-e45cd9d1.js";import{A as ke}from"./Avatar-f71fd69a.js";import{b as Ee,a as W}from"./stores-adaa4006.js";function ye(s,e){if(!e)return 0;if(console.log(s.duration),s.duration)return s.duration;const a=e.spec.events.filter(r=>r.parent===s.id);if(a.length>0){let r=a.reduce((t,o)=>t+(o.duration?o.duration:0),0);return r+=5*(a.length-1),r}}function ne(s,e){e.update(a=>{const r=a.favoriteEvents;let t=null;return r.includes(s)?t=Object.assign({},a,{favoriteEvents:r.filter(o=>o!==s)}):(r.push(s),t=Object.assign(a,{favoriteEvents:r})),t})}function Ce(){}function De(s){let e,a,r,t,o,n=s[1].title+"",l,i,c;return{c(){e=m("div"),a=m("div"),t=A(),o=m("div"),l=C(n),this.h()},l(h){e=g(h,"DIV",{class:!0});var f=b(e);a=g(f,"DIV",{class:!0}),b(a).forEach(v),t=z(f),o=g(f,"DIV",{class:!0});var d=b(o);l=F(d,n),d.forEach(v),f.forEach(v),this.h()},h(){p(a,"class",r="w-1 rounded-l-sm "+s[1].style),p(o,"class",i=(s[0]==="big"?"px-2 py-0.5":"px-1.5 py-0.5")+" rounded-r-sm bg-gray-100 uppercase"),p(e,"class",c="flex "+(s[0]==="big"?"h-6 text-sm":"h-5 text-xs"))},m(h,f){q(h,e,f),u(e,a),u(e,t),u(e,o),u(o,l)},p(h,[f]){f&2&&r!==(r="w-1 rounded-l-sm "+h[1].style)&&p(a,"class",r),f&2&&n!==(n=h[1].title+"")&&ge(l,n),f&1&&i!==(i=(h[0]==="big"?"px-2 py-0.5":"px-1.5 py-0.5")+" rounded-r-sm bg-gray-100 uppercase")&&p(o,"class",i),f&1&&c!==(c="flex "+(h[0]==="big"?"h-6 text-sm":"h-5 text-xs"))&&p(e,"class",c)},i:S,o:S,d(h){h&&v(e)}}}function we(s,e,a){let r,{event:t={}}=e,{size:o=null}=e;const n={panel:{title:"Panelov\xE1 debata",style:"bg-custom-red text-white"},talk:{title:"P\u0159edn\xE1\u0161ka",style:"bg-custom-green text-white"},workshop:{title:"Workshop",style:"bg-custom-blue text-white"},other:{title:"Ostatn\xED",style:"bg-custom-yellow"},lightning:{title:"Lightning talk",style:"bg-pink-400"}};return s.$$set=l=>{"event"in l&&a(2,t=l.event),"size"in l&&a(0,o=l.size)},s.$$.update=()=>{s.$$.dirty&4&&a(1,r=n[t.type])},[o,r,t]}class Ie extends _e{constructor(e){super();pe(this,e,we,De,me,{event:2,size:0})}}function oe(s,e,a){const r=s.slice();return r[10]=e[a],r}function ce(s,e,a){const r=s.slice();return r[13]=e[a],r}function fe(s,e,a){const r=s.slice();return r[13]=e[a],r}function Ve(s){let e,a,r=s[3](s[2].speakers),t=[];for(let n=0;nj(t[n],1,1,()=>{t[n]=null});return{c(){e=m("div");for(let n=0;nj(o[l],1,1,()=>{o[l]=null});return{c(){e=m("div"),a=m("div");for(let l=0;lj(t[n],1,1,()=>{t[n]=null});return{c(){for(let n=0;n0,y,D,L,N,$=s[2].speakers&&s[2].speakers.length>0&&Ve(s);k=new Ie({props:{event:s[2]}});let I=s[0]&&de(s),O=R&&$e(s);return{c(){e=m("div"),a=m("div"),r=m("i"),o=A(),n=m("div"),l=m("a"),c=C(i),h=A(),$&&$.c(),f=A(),d=m("div"),_=m("div"),J(k.$$.fragment),T=A(),B=m("div"),H=C(G),M=A(),I&&I.c(),P=A(),O&&O.c(),this.h()},l(E){e=g(E,"DIV",{class:!0});var w=b(e);a=g(w,"DIV",{class:!0});var ee=b(a);r=g(ee,"I",{class:!0}),b(r).forEach(v),ee.forEach(v),o=z(w),n=g(w,"DIV",{class:!0});var te=b(n);l=g(te,"A",{href:!0});var le=b(l);c=F(le,i),le.forEach(v),te.forEach(v),h=z(w),$&&$.l(w),f=z(w),d=g(w,"DIV",{class:!0});var K=b(d);_=g(K,"DIV",{});var ae=b(_);Q(k.$$.fragment,ae),ae.forEach(v),T=z(K),B=g(K,"DIV",{class:!0});var se=b(B);H=F(se,G),se.forEach(v),M=z(K),I&&I.l(K),K.forEach(v),P=z(w),O&&O.l(w),w.forEach(v),this.h()},h(){p(r,"class",t="fa-star "+(s[1].favoriteEvents.includes(s[2].id)?"fa-solid":"fa-regular")+" cursor-pointer"),p(a,"class","float-right"),p(l,"href","/udalosti?id="+s[2].id),p(n,"class","text-lg font-semibold"),p(B,"class","text-sm my-auto"),p(d,"class","mt-2 text-sm flex flex-wrap gap-2"),p(e,"class",y="transition-all mb-4 border px-3 py-2 rounded-md shadow "+(s[1].favoriteEvents.includes(s[2].id)?"bg-yellow-100":""))},m(E,w){q(E,e,w),u(e,a),u(a,r),u(e,o),u(e,n),u(n,l),u(l,c),u(e,h),$&&$.m(e,null),u(e,f),u(e,d),u(d,_),U(k,_,null),u(d,T),u(d,B),u(B,H),u(d,M),I&&I.m(d,null),u(e,P),O&&O.m(e,null),D=!0,L||(N=be(r,"click",s[8]),L=!0)},p(E,[w]){(!D||w&2&&t!==(t="fa-star "+(E[1].favoriteEvents.includes(E[2].id)?"fa-solid":"fa-regular")+" cursor-pointer"))&&p(r,"class",t),E[2].speakers&&E[2].speakers.length>0&&$.p(E,w),E[0]?I?I.p(E,w):(I=de(E),I.c(),I.m(d,null)):I&&(I.d(1),I=null),R&&O.p(E,w),(!D||w&2&&y!==(y="transition-all mb-4 border px-3 py-2 rounded-md shadow "+(E[1].favoriteEvents.includes(E[2].id)?"bg-yellow-100":"")))&&p(e,"class",y)},i(E){D||(V($),V(k.$$.fragment,E),V(O),D=!0)},o(E){j($),j(k.$$.fragment,E),j(O),D=!1},d(E){E&&v(e),$&&$.d(),X(k),I&&I.d(),O&&O.d(),L=!1,N()}}}function Te(s,e,a){let r,t,o;re(s,Ee,_=>a(7,t=_)),re(s,W,_=>a(1,o=_));let{event:n}=e;const l=n;function i(_){if(!!_)return _.map(k=>t.spec.speakers.find(T=>T.id===k))}function c(_){const k=t.spec.tracks.find(T=>T.id===_);return k.shortname||k.name}function h(_){return t.spec.events.filter(k=>k.parent===_.id)}const f=()=>ne(l.id,W),d=()=>ne(l.id,W);return s.$$set=_=>{"event"in _&&a(6,n=_.event)},s.$$.update=()=>{s.$$.dirty&128&&a(0,r=ye(l,t))},[r,o,l,i,c,h,n,t,f,d]}class Fe extends _e{constructor(e){super();pe(this,e,Te,Be,me,{event:6})}}export{Ie as E,Fe as a,ne as b,Ce as c,ye as d};