utxo22-web/_app/chunks/Event-082db885.js

4 řádky
14 KiB
JavaScript
Surový Normální zobrazení Historie

import{S as Ae,i as ze,s as Be,e as m,k as S,t as C,c as g,a as k,d,m as T,h as F,b as _,g as q,F as u,j as J,E as x,q as $,w as ee,x as le,y as te,o as B,B as ie,n as R,p as W,G as se,J as Se,H as ce,l as ue}from"./index-b6ec56f3.js";import{A as Te,S as je,L as Le}from"./Avatar-16a27348.js";import{b as Oe,c as re}from"./stores-9ca2ce08.js";function Pe(a,e){if(!e)return 0;if(a.duration)return a.duration;const i=e.spec.events.filter(r=>r.parent===a.id);if(i.length>0){let r=i.reduce((l,n)=>l+(n.duration?n.duration:0),0);return r+=5*(i.length-1),r}}function de(a,e){e.update(i=>{const r=i.favoriteEvents;let l=null;return r.includes(a)?l=Object.assign({},i,{favoriteEvents:r.filter(n=>n!==a)}):(r.push(a),l=Object.assign(i,{favoriteEvents:r})),l})}function qe(a){let e,i,r,l,n,t=a[1].title+"",s,o,f;return{c(){e=m("div"),i=m("div"),l=S(),n=m("div"),s=C(t),this.h()},l(v){e=g(v,"DIV",{class:!0});var c=k(e);i=g(c,"DIV",{class:!0}),k(i).forEach(d),l=T(c),n=g(c,"DIV",{class:!0});var h=k(n);s=F(h,t),h.forEach(d),c.forEach(d),this.h()},h(){_(i,"class",r="w-1 rounded-l-sm "+a[1].style),_(n,"class",o=(a[0]==="big"?"px-2 py-0.5":"px-1.5 py-0.5")+" rounded-r-sm bg-gray-100 uppercase"),_(e,"class",f="flex "+(a[0]==="big"?"h-6 text-sm":"h-5 text-xs"))},m(v,c){q(v,e,c),u(e,i),u(e,l),u(e,n),u(n,s)},p(v,[c]){c&2&&r!==(r="w-1 rounded-l-sm "+v[1].style)&&_(i,"class",r),c&2&&t!==(t=v[1].title+"")&&J(s,t),c&1&&o!==(o=(v[0]==="big"?"px-2 py-0.5":"px-1.5 py-0.5")+" rounded-r-sm bg-gray-100 uppercase")&&_(n,"class",o),c&1&&f!==(f="flex "+(v[0]==="big"?"h-6 text-sm":"h-5 text-xs"))&&_(e,"class",f)},i:x,o:x,d(v){v&&d(e)}}}function Ce(a,e,i){let r,{event:l={}}=e,{size:n=null}=e;const t={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:"Bleskov\xE1 p\u0159edn\xE1\u0161ka",style:"bg-pink-400"},"lightning-series":{title:"P\xE1smo bleskov\xFDch p\u0159edn\xE1\u0161ek",style:"bg-pink-400"}};return a.$$set=s=>{"event"in s&&i(2,l=s.event),"size"in s&&i(0,n=s.size)},a.$$.update=()=>{a.$$.dirty&4&&i(1,r=t[l.type])},[n,r,l]}class Fe extends Ae{constructor(e){super();ze(this,e,Ce,qe,Be,{event:2,size:0})}}function he(a,e,i){const r=a.slice();return r[12]=e[i],r}function _e(a,e,i){const r=a.slice();return r[15]=e[i],r}function ve(a,e,i){const r=a.slice();return r[18]=e[i],r}function pe(a,e,i){const r=a.slice();return r[15]=e[i],r}function me(a){let e,i,r=a[5](a[0].speakers),l=[];for(let t=0;t<r.length;t+=1)l[t]=ge(pe(a,r,t));const n=t=>B(l[t],1,1,()=>{l[t]=null});return{c(){e=m("div");for(let t=0;t<l.length;t+=1)l[t].c();this.h()},l(t){e=g(t,"DIV",{class:!0});var s=k(e);for(let o=0;o<l.length;o+=1)l[o].l(s);s.forEach(d),this.h()},h(){_(e,"class","mt-1 mb-2 flex flex-wrap gap-2")},m(t,s){q(t,e,s);for(let o=0;o<l.length;o+=1)l[o].m(e,null);i=!0},p(t,s){if(s&33){r=t[5](t[0].speakers);let o;for(o=0;o<r.length;o+=1){const f=pe(t,r,o);l[o]?(l[o].p(f,s),$(l[o],1)):(l[o]=ge(f),l[o].c(),$(l[o],1),l[o].m(e,null))}for(R(),o=r.length;o<l.length;o+=1)n(o);W()}},i(t){if(!i){for(let s=0;s<r.length;s+=1)$(l[s]);i=!0}},o(t){l=l.filter(Boolean);for(let s=0;s<l.length;s+=1)B(l[s]);i=!1},d(t){t&&d(e),se(l,t)}}}function ge(a){let e,i,r,l,n,t=a[15].name+"",s,o,f,v;return i=new Te({props:{speaker:a[15],size:"extra-small"}}),{c(){e=m("div"),ee(i.$$.fragment),r=S(),l=m("div"),n=m("a"),s=C(t),f=S(),this.h()},l(c){e=g(c,"DIV",{class:!0});var h=k(e);le(i.$$.fragment,h),r=T(h),l=g(h,"DIV",{class:!0});var b=k(l);n=g(b,"A",{href:!0});var D=k(n);s=F(D,t),D.forEach(d),b.forEach(d),f=T(h),h.forEach(d),this.h()},h(){_(n,"href",o="/lide?id="+a[15].id),_(l,"class","m-auto"),_(e,"class","flex gap-1.5")},m(c,h){q(c,e,h),te(i,e,null),u(e,r),u(e,l),u(l,n),u(n,s),u(e,f),v=!0},p(c,h){const b={};h&1&&(b.speaker=c[15]),i.$set(b),(!v||h&1)&&t!==(t=c[15].name+"")&&J(s,t),(!v||h&1&&o!==(o="/lide?id="+c[15].id))&&_(n,"href",o)},i(c){v||($(i.$$.fragment,c),v=!0)},o(c){B(i.$$.fragment,c),v=!1},d(c)
`),i=e.length>1;return{md:e[0],stripped:i}}function Je(a,e,i){let r,l,n,t,s;ce(a,Oe,w=>i(9,t=w)),ce(a,re,w=>i(3,s=w));let{event:o}=e;const f={link:Le};function v(w){if(!!w)return w.map(I=>t.spec.speakers.find(G=>G.id===I))}function c(w){const I=t.spec.tracks.find(G=>G.id===w);return I.shortname||I.name}function h(w){return t.spec.events.filter(I=>I.parent===w.id)}const b=()=>de(r.id,re),D=w=>de(w.id,re);return a.$$set=w=>{"event"in w&&i(8,o=w.event)},a.$$.update=()=>{a.$$.dirty&256&&i(0,r=o),a.$$.dirty&513&&i(2,l=Pe(r,t)),a.$$.dirty&1&&i(1,n=He(r))},[r,n,l,s,f,v,c,h,o,t,b,D]}class Ke extends Ae{constructor(e){super();ze(this,e,Je,Ge,Be,{event:8})}}export{Fe as E,Ke as a,de as b,Pe as c};