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