import{S as Re,i as Fe,s as Ge,e as D,t as L,k as A,c as T,a as I,h as j,d,m as C,b as g,$ as Je,g as B,F as c,a0 as fe,J as Z,j as J,G as Y,U as We,E as se,H as ue,v as Xe,a1 as Ye,a2 as te,a3 as de,W as ae,l as X}from"../chunks/index-acdcee87.js";import{b as he,s as z}from"../chunks/stores-77ce6fd0.js";import{c as ze,l as _e}from"../chunks/index-7f2b6b77.js";import{f as Q}from"../chunks/index-921d3fdd.js";import"../chunks/index-f786a58f.js";function pe(s,l,t){const e=s.slice();return e[16]=l[t],e}function ve(s,l,t){const e=s.slice();return e[19]=l[t],e}function me(s,l,t){const e=s.slice();return e[22]=l[t],e}function be(s,l,t){const e=s.slice();return e[25]=l[t][0],e[26]=l[t][1],e}function ge(s,l,t){const e=s.slice();return e[29]=l[t],e}function ke(s,l,t){const e=s.slice();return e[22]=l[t],e}function Ee(s,l,t){const e=s.slice();return e[34]=l[t],e}function we(s,l,t){const e=s.slice();return e[34]=l[t],e}function De(s,l,t){const e=s.slice();return e[39]=l[t],e[41]=t,e}function Te(s){let l,t,e,a,n,i,_,o=s[1].spec["schedule-candidates"],h=[];for(let f=0;fs[6].call(n)),g(a,"class","flex flex-wrap gap-1")},m(f,r){B(f,l,r),c(l,t),B(f,e,r),B(f,a,r),c(a,n);for(let u=0;u{const e=s.spec.speakers.find(a=>a.id===t);return e.name+(e.nickname?` (${e.nickname})`:"")}).join(", ")}function je(s,l){return l.type==="lightning-series"?s.spec.events.filter(t=>t.parent===l.id).map(t=>`${t.name} - ${Le(s,t)||"TBD"}`).join("
"):Le(s,l)}function tl(s,l){const[t,e]=l.split("/"),[a,n]=e.split("-"),i=s.dates[t-1];return{date:i,period:{start:new Date(`${i}T${a}`),end:new Date(`${i}T${n}`)}}}function Be(s){return s.scheduleTimes.map(l=>tl(s,l))}function Ue(s,l,t){return t.includes(l.track||"")?"border border-blue-web/50":"opacity-20"}function qe(s,l){const t=s.spec.events.find(e=>e.id===l);if(!t)return console.log(`Event not found: ${l}`),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-utxo-gradient text-white"}return t}const Ke=s=>`#${s}`;function sl(s,l,t){let e,a,n;ue(s,he,E=>t(1,a=E)),ue(s,z,E=>t(3,n=E));let i=0;Xe(async()=>{he.subscribe(E=>{const V={};V.stages=E.spec.stages.map(p=>p.id),V.tracks=E.spec.tracks.map(p=>p.id),z.set(V)})});function _(E,V,p,P=null){let k=V.start;const K=V.end,G=[],q={};for(;ze(k,K)===-1;){const O={};for(const N of p.spec.stages){if(q[N.id]>0){O[N.id]=null,q[N.id]--;continue}if(P&&!P.stages.includes(N.id))continue;let y=E.schedule.find($=>new Date($.period.start).getTime()===new Date(k).getTime()&&$.stage===N.id);if(O[N.id]=y,y){const $=Math.floor((new Date(y.period.end).getTime()-new Date(y.period.start).getTime())/6e4/30);y.span=$,$>1&&(q[N.id]=$-1)}}G.push({title:Q(k,"HH:mm"),stages:O}),k=new Date(k.getTime()+30*60*1e3)}return G}const o=[[],[]],h=(E,V)=>{const[p,P]=V.split(":");return`${p}:${Math.round(E.metrics[P||p]*1e3)/1e3}`};function f(){i=Ye(this),t(0,i)}const r=()=>te(z,n.stages=a.spec.stages.map(E=>E.id),n);function u(){n.stages=de(o[1],this.__value,this.checked),z.set(n)}const m=E=>te(z,n.stages=[E.id],n),b=()=>te(z,n.tracks=a.spec.tracks.map(E=>E.id),n);function M(){n.tracks=de(o[0],this.__value,this.checked),z.set(n)}const S=E=>te(z,n.tracks=[E.id],n),H=(E,V)=>V.id===E.track;return s.$$.update=()=>{s.$$.dirty[0]&3&&t(2,e=a?a.spec["schedule-candidates"][i]:null)},[i,a,e,n,_,h,f,r,u,o,m,b,M,S,H]}class fl extends Re{constructor(l){super();Fe(this,l,sl,ll,Ge,{},null,[-1,-1])}}export{fl as default,cl as prerender};