utxo22-web/_app/chunks/Event-b09d0962.js

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

import{S as Be,i as Se,s as Te,e as g,k as C,t as S,c as k,a as b,d,m as L,h as T,b as v,g as A,F as h,j as H,E as x,q as $,w as ee,x as le,y as te,o as j,B as ie,n as R,p as W,G as se,J as je,H as ce,l as ue}from"./index-acdcee87.js";import{A as Ce}from"./Avatar-1e11dff9.js";import{S as Le,L as Oe}from"./Link-3573ed9f.js";import{b as Pe,c as ae}from"./stores-ea7e4be0.js";function qe(r,e){if(!e)return 0;if(r.duration)return r.duration;const s=e.spec.events.filter(a=>a.parent===r.id);if(s.length>0){let a=s.reduce((l,i)=>l+(i.duration?i.duration:0),0);return a+=5*(s.length-1),a}}function de(r,e){e.update(s=>{const a=s.favoriteEvents;let l=null;return a.includes(r)?l=Object.assign({},s,{favoriteEvents:a.filter(i=>i!==r)}):(a.push(r),l=Object.assign(s,{favoriteEvents:a})),l})}function Fe(r){let e,s,a,l,i,t=r[1].title+"",n,f,o;return{c(){e=g("div"),s=g("div"),l=C(),i=g("div"),n=S(t),this.h()},l(p){e=k(p,"DIV",{class:!0});var c=b(e);s=k(c,"DIV",{class:!0}),b(s).forEach(d),l=L(c),i=k(c,"DIV",{class:!0});var u=b(i);n=T(u,t),u.forEach(d),c.forEach(d),this.h()},h(){v(s,"class",a="w-1 rounded-l-sm "+r[1].style),v(i,"class",f=(r[0]==="big"?"px-2 py-0.5":"px-1.5 py-0.5")+" rounded-r-sm bg-gray-100 uppercase"),v(e,"class",o="flex "+(r[0]==="big"?"h-6 text-sm":"h-5 text-xs"))},m(p,c){A(p,e,c),h(e,s),h(e,l),h(e,i),h(i,n)},p(p,[c]){c&2&&a!==(a="w-1 rounded-l-sm "+p[1].style)&&v(s,"class",a),c&2&&t!==(t=p[1].title+"")&&H(n,t),c&1&&f!==(f=(p[0]==="big"?"px-2 py-0.5":"px-1.5 py-0.5")+" rounded-r-sm bg-gray-100 uppercase")&&v(i,"class",f),c&1&&o!==(o="flex "+(p[0]==="big"?"h-6 text-sm":"h-5 text-xs"))&&v(e,"class",o)},i:x,o:x,d(p){p&&d(e)}}}function Me(r,e,s){let a,{event:l={}}=e,{size:i=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"},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"},campfire:{title:"Campfire",style:"bg-purple-500"},other:{title:"Ostatn\xED",style:"bg-custom-yellow"}};return r.$$set=n=>{"event"in n&&s(2,l=n.event),"size"in n&&s(0,i=n.size)},r.$$.update=()=>{r.$$.dirty&4&&s(1,a=t[l.type])},[i,a,l]}class Ze extends Be{constructor(e){super();Se(this,e,Me,Fe,Te,{event:2,size:0})}}function he(r,e,s){const a=r.slice();return a[12]=e[s],a}function _e(r,e,s){const a=r.slice();return a[15]=e[s],a}function ve(r,e,s){const a=r.slice();return a[18]=e[s],a}function pe(r,e,s){const a=r.slice();return a[15]=e[s],a}function me(r){let e,s,a=r[5](r[0].speakers),l=[];for(let t=0;t<a.length;t+=1)l[t]=ke(pe(r,a,t));const i=t=>j(l[t],1,1,()=>{l[t]=null});return{c(){e=g("div");for(let t=0;t<l.length;t+=1)l[t].c();this.h()},l(t){e=k(t,"DIV",{class:!0});var n=b(e);for(let f=0;f<l.length;f+=1)l[f].l(n);n.forEach(d),this.h()},h(){v(e,"class","mt-1 mb-2 flex flex-wrap gap-2")},m(t,n){A(t,e,n);for(let f=0;f<l.length;f+=1)l[f].m(e,null);s=!0},p(t,n){if(n&33){a=t[5](t[0].speakers);let f;for(f=0;f<a.length;f+=1){const o=pe(t,a,f);l[f]?(l[f].p(o,n),$(l[f],1)):(l[f]=ke(o),l[f].c(),$(l[f],1),l[f].m(e,null))}for(R(),f=a.length;f<l.length;f+=1)i(f);W()}},i(t){if(!s){for(let n=0;n<a.length;n+=1)$(l[n]);s=!0}},o(t){l=l.filter(Boolean);for(let n=0;n<l.length;n+=1)j(l[n]);s=!1},d(t){t&&d(e),se(l,t)}}}function ge(r){let e,s=r[15].nickname+"",a,l;return{c(){e=S("\xA0("),a=S(s),l=S(")")},l(i){e=T(i,"\xA0("),a=T(i,s),l=T(i,")")},m(i,t){A(i,e,t),A(i,a,t),A(i,l,t)},p(i,t){t&1&&s!==(s=i[15].nickname+"")&&H(a,s)},d(i){i&&d(e),i&&d(a),i&&d(l)}}}function ke(r){let e,s,a,l,i,t=r[15].name+"",n,f,o,p;s=new Ce({props:{speaker:r[15],size:"extra-small"}});let c=r[15].nickname&&ge(r);return{c(){e=g("div"),ee(s.$$.fragment),a=C(),l=g("div"),i=g("a"),n=S(t),c&&c.c(),o=C(),this.h()},l(u){e=k(u,"DIV",{class:!0});var _=b(e);le(s.$$.fragment,_),a=L(_),l=k(_,"DIV",{class:!0});var w=b(l);i=k(w,"A",{href:!0});var E=b(i);n=T(E,t),c&&c.l(E),E.forEach(d),w.forEach(d),o=L(_),_.forEach(d),this.h()},h(){v(i,"
`),s=e.length>1;return{md:e[0],stripped:s}}function Re(r,e,s){let a,l,i,t,n;ce(r,Pe,E=>s(9,t=E)),ce(r,ae,E=>s(3,n=E));let{event:f}=e;const o={link:Oe};function p(E){if(!!E)return E.map(I=>t.spec.speakers.find(G=>G.id===I))}function c(E){const I=t.spec.tracks.find(G=>G.id===E);return I.shortname||I.name}function u(E){return t.spec.events.filter(I=>I.parent===E.id)}const _=()=>de(a.id,ae),w=E=>de(E.id,ae);return r.$$set=E=>{"event"in E&&s(8,f=E.event)},r.$$.update=()=>{r.$$.dirty&256&&s(0,a=f),r.$$.dirty&513&&s(2,l=qe(a,t)),r.$$.dirty&1&&s(1,i=Ne(a))},[a,i,l,n,o,p,c,u,f,t,_,w]}class Xe extends Be{constructor(e){super();Se(this,e,Re,Je,Te,{event:8})}}export{Ze as E,Xe as a,de as b,qe as c};