import{S as Ue,i as Re,s as qe,e as w,t as $,k as U,c as D,a as T,h as L,d as u,m as R,b,$ as Ke,g as P,F as h,a0 as fe,J as Z,j as X,G as Q,R as Fe,E as se,H as ue,v as Ge,a1 as Je,a2 as te,a3 as he,U as ae,l as Y}from"../chunks/index-43525dfb.js";import{b as _e,s as z}from"../chunks/stores-31227ed5.js";import{c as Xe,l as de}from"../chunks/index-7f2b6b77.js";import{f as W}from"../chunks/index-921d3fdd.js";import"../chunks/index-4f3af860.js";function pe(s,l,t){const e=s.slice();return e[14]=l[t],e}function ve(s,l,t){const e=s.slice();return e[17]=l[t],e}function me(s,l,t){const e=s.slice();return e[20]=l[t],e}function ge(s,l,t){const e=s.slice();return e[23]=l[t][0],e[24]=l[t][1],e}function be(s,l,t){const e=s.slice();return e[20]=l[t],e}function ke(s,l,t){const e=s.slice();return e[29]=l[t],e}function Ee(s,l,t){const e=s.slice();return e[29]=l[t],e}function we(s,l,t){const e=s.slice();return e[34]=l[t],e[36]=t,e}function De(s){let l,t,e,a,i,n,d,o=s[1].spec["schedule-candidates"],_=[];for(let c=0;cs[6].call(i)),b(a,"class","flex flex-wrap gap-1")},m(c,f){P(c,l,f),h(l,t),P(c,e,f),P(c,a,f),h(a,i);for(let r=0;r<_.length;r+=1)_[r].m(i,null);fe(i,s[0]),n||(d=Z(i,"change",s[6]),n=!0)},p(c,f){if(f[0]&2){o=c[1].spec["schedule-candidates"];let r;for(r=0;rs.spec.speakers.find(e=>e.id===t).name).join(", ")}function $e(s,l){return l.type==="lightning-series"?s.spec.events.filter(t=>t.parent===l.id).map(t=>`${t.name} (${Me(s,t)})`).join(", "):Me(s,l)}function Le(s){return s.scheduleTimes.map(l=>{const[t,e]=l.split("/"),[a,i]=e.split("-"),n=s.dates[t-1];return{date:n,period:{start:new Date(`${n}T${a}`),end:new Date(`${n}T${i}`)}}})}function je(s,l,t){return t.includes(l.track||"")?"border border-blue-web/50":"opacity-20"}function Be(s,l){const t=s.spec.events.find(e=>e.id===l);if(!t)return null;switch(t.type){case"panel":t.color="bg-orange-400/20 hover:bg-orange-400/40";break;case"talk":t.color="bg-custom-green/20 hover:bg-custom-green/40";break;case"workshop":t.color="bg-custom-blue/20 hover:bg-custom-blue/40";break;case"campfire":t.color="bg-purple-400/20 hover:bg-purple-400/40";break;case"lightning-series":t.color="bg-yellow-400/20 hover:bg-yellow-400/40";break;default:t.color="bg-white hover:bg-gray-500/10"}return t}function xe(s,l,t){let e,a,i;ue(s,_e,k=>t(1,a=k)),ue(s,z,k=>t(3,i=k));let n=0;Ge(async()=>{_e.subscribe(k=>{const O={};O.stages=k.spec.stages.map(I=>I.id),O.tracks=k.spec.tracks.map(I=>I.id),z.set(O)})});function d(k,O,I,m=null){let C=O.start;const g=O.end,H=[],y={};for(;Xe(C,g)===-1;){const S={};for(const V of I.spec.stages){if(y[V.id]>0){S[V.id]=null,y[V.id]--;continue}if(m&&!m.stages.includes(V.id))continue;const j=k.schedule.find(A=>new Date(A.period.start).getTime()===new Date(C).getTime()&&A.stage===V.id);if(S[V.id]=j,j){const A=Math.floor((new Date(j.period.end).getTime()-new Date(j.period.start).getTime())/6e4/30);j.span=A,A>1&&(y[V.id]=A-1)}}H.push({title:W(C,"HH:mm"),stages:S}),C=new Date(C.getTime()+30*60*1e3)}return H}const o=[[],[]],_=(k,O)=>{const[I,m]=O.split(":");return`${I}:${Math.round(k.metrics[m||I]*1e3)/1e3}`};function c(){n=Je(this),t(0,n)}const f=()=>te(z,i.stages=a.spec.stages.map(k=>k.id),i);function r(){i.stages=he(o[1],this.__value,this.checked),z.set(i)}const p=k=>te(z,i.stages=[k.id],i),N=()=>te(z,i.tracks=a.spec.tracks.map(k=>k.id),i);function B(){i.tracks=he(o[0],this.__value,this.checked),z.set(i)}const M=k=>te(z,i.tracks=[k.id],i);return s.$$.update=()=>{s.$$.dirty[0]&3&&t(2,e=a?a.spec["schedule-candidates"][n]:null)},[n,a,e,i,d,_,c,f,r,o,p,N,B,M]}class nl extends Ue{constructor(l){super();Re(this,l,xe,Ze,qe,{},null,[-1,-1])}}export{nl as default,il as prerender};