import{_ as t,a as n,b as e,c as i,i as o,s as r,d as c,ah as a,S as s,e as u,f,t as l,g as d,h as $,k as h,l as p,j as m,m as g,n as v,o as w,A as x,O as y,p as R,a2 as b,u as N,v as S,w as E,ae as A,z as B,B as D,ad as I,E as _,Q as z,F as k,G as P,I as C,R as O,H as q,J as T,q as V,r as H,ai as M,T as j,a5 as F,P as L,X as G,y as J,Y as Z,ag as Q,D as U,x as X,$ as Y,a0 as K,a1 as W}from"./client.920ae3a6.js";import{G as tt}from"./GroupBlock.f4a3911d.js";function nt(t){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var o,r=n(t);if(i){var c=n(this).constructor;o=Reflect.construct(r,arguments,c)}else o=r.apply(this,arguments);return e(this,o)}}function et(t){var n,e,i,o,r,c,a,s,b,N,S,E,A,B=(t[3]||"~")+"";return{c:function(){n=u("div"),e=u("span"),i=f(),o=u("span"),r=f(),c=u("span"),a=f(),s=u("span"),b=f(),N=u("span"),S=l(B),this.h()},l:function(t){n=d(t,"DIV",{class:!0,style:!0});var u=$(n);e=d(u,"SPAN",{class:!0,style:!0}),$(e).forEach(h),i=p(u),o=d(u,"SPAN",{class:!0,style:!0}),$(o).forEach(h),r=p(u),c=d(u,"SPAN",{class:!0,style:!0}),$(c).forEach(h),a=p(u),s=d(u,"SPAN",{class:!0,style:!0}),$(s).forEach(h),b=p(u),N=d(u,"SPAN",{class:!0});var f=$(N);S=m(f,B),f.forEach(h),u.forEach(h),this.h()},h:function(){g(e,"class","ring a svelte-1bdiq0m"),g(e,"style",t[5]),g(o,"class","ring b svelte-1bdiq0m"),g(o,"style",t[5]),g(c,"class","ring c svelte-1bdiq0m"),g(c,"style",t[5]),g(s,"class","bg svelte-1bdiq0m"),g(s,"style",t[5]),g(N,"class","txt svelte-1bdiq0m"),g(n,"class",E="timer "+t[1]+" "+(t[2]?"paused":"")+" svelte-1bdiq0m"),g(n,"style",A=""+(t[4]+t[0]))},m:function(t,u){v(t,n,u),w(n,e),w(n,i),w(n,o),w(n,r),w(n,c),w(n,a),w(n,s),w(n,b),w(n,N),w(N,S)},p:function(t,i){var r=x(i,1)[0];32&r&&g(e,"style",t[5]),32&r&&g(o,"style",t[5]),32&r&&g(c,"style",t[5]),32&r&&g(s,"style",t[5]),8&r&&B!==(B=(t[3]||"~")+"")&&y(S,B),6&r&&E!==(E="timer "+t[1]+" "+(t[2]?"paused":"")+" svelte-1bdiq0m")&&g(n,"class",E),17&r&&A!==(A=""+(t[4]+t[0]))&&g(n,"style",A)},i:R,o:R,d:function(t){t&&h(n)}}}function it(){for(var t=1;t<99999;t++)window.clearInterval(t),window.cancelAnimationFrame(t)}function ot(t,n,e){var i,o,r,c,a,s,u=b(),f=n.time,l=n.size,d=void 0===l?150:l,$=n.style,h=n.className,p=void 0===h?"spin":h,m=n.paused,g=void 0!==m&&m,v=n.id,w=void 0===v?"":v,x=!1;function y(t){"undefined"==typeof window||"undefined"==typeof document||x||(it(),e(6,f=t),e(3,i=f),o=f,c=0,r=new Date,console.log("[Timer] ⏰  onRestart:",w),window.requestAnimationFrame(R),u("start",o))}function R(){if("undefined"!=typeof window&&"undefined"!=typeof document){var t=!0;if(!g&&i>0){c=(new Date-r)/1e3;var n=i;o=f-c,e(3,i=parseInt(o,10)),i!=n&&(u("second",o),0==i&&(u("end",o),it(),t=!1))}else r=new Date-1e3*c;t&&!x&&(console.log("[Timer] ⏰  onFrame:",w),window.requestAnimationFrame(R))}else console.error("there is no window to request animation frame from")}return N(S(E.mark((function t(){return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:x=!1,console.log("[Timer] ⏰✅  onMount (restart) :",w),y(f);case 3:case"end":return t.stop()}}),t)})))),A((function(){console.log("[Timer] ⏰❌  onDestroy:",w),x=!0})),t.$$set=function(t){"time"in t&&e(6,f=t.time),"size"in t&&e(7,d=t.size),"style"in t&&e(0,$=t.style),"className"in t&&e(1,p=t.className),"paused"in t&&e(2,g=t.paused),"id"in t&&e(8,w=t.id)},t.$$.update=function(){128&t.$$.dirty&&e(4,a="font-size:".concat(.4*d,"px;line-height:").concat(d,"px;border-radius:").concat(d,"px;width:").concat(d,"px;height:").concat(d,"px;flex-basis:").concat(d,"px;max-height:").concat(d,"px;")),128&t.$$.dirty&&e(5,s="border-radius:".concat(d,"px;animation-delay:-").concat(Math.floor(100*Math.random()),"s;"))},[$,p,g,i,a,s,f,d,w,y]}var rt=function(n){t(u,s);var e=nt(u);function u(t){var n;return i(this,u),n=e.call(this),o(c(n),t,ot,et,r,{time:6,size:7,style:0,className:1,paused:2,id:8,restart:9}),n}return a(u,[{key:"restart",get:function(){return this.$$.ctx[9]}}]),u}();function ct(t){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var o,r=n(t);if(i){var c=n(this).constructor;o=Reflect.construct(r,arguments,c)}else o=r.apply(this,arguments);return e(this,o)}}function at(t){var n,e;return{c:function(){n=B("svg"),e=B("path"),this.h()},l:function(t){n=d(t,"svg",{width:!0,height:!0,viewBox:!0},1);var i=$(n);e=d(i,"path",{d:!0,fill:!0},1),$(e).forEach(h),i.forEach(h),this.h()},h:function(){g(e,"d","M14,19H18V5H14M6,19H10V5H6V19Z"),g(e,"fill",t[2]),g(n,"width",t[0]),g(n,"height",t[1]),g(n,"viewBox",t[3])},m:function(t,i){v(t,n,i),w(n,e)},p:function(t,i){var o=x(i,1)[0];4&o&&g(e,"fill",t[2]),1&o&&g(n,"width",t[0]),2&o&&g(n,"height",t[1]),8&o&&g(n,"viewBox",t[3])},i:R,o:R,d:function(t){t&&h(n)}}}function st(t,n,e){var i=n.size,o=void 0===i?"1em":i,r=n.width,c=void 0===r?o:r,a=n.height,s=void 0===a?o:a,u=n.color,f=void 0===u?"currentColor":u,l=n.viewBox,d=void 0===l?"0 0 24 24":l;return t.$$set=function(t){"size"in t&&e(4,o=t.size),"width"in t&&e(0,c=t.width),"height"in t&&e(1,s=t.height),"color"in t&&e(2,f=t.color),"viewBox"in t&&e(3,d=t.viewBox)},[c,s,f,d,o]}var ut=function(n){t(a,s);var e=ct(a);function a(t){var n;return i(this,a),n=e.call(this),o(c(n),t,st,at,r,{size:4,width:0,height:1,color:2,viewBox:3}),n}return a}();function ft(t){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var o,r=n(t);if(i){var c=n(this).constructor;o=Reflect.construct(r,arguments,c)}else o=r.apply(this,arguments);return e(this,o)}}function lt(t){var n,e;return{c:function(){n=B("svg"),e=B("path"),this.h()},l:function(t){n=d(t,"svg",{width:!0,height:!0,viewBox:!0},1);var i=$(n);e=d(i,"path",{d:!0,fill:!0},1),$(e).forEach(h),i.forEach(h),this.h()},h:function(){g(e,"d","M8,5.14V19.14L19,12.14L8,5.14Z"),g(e,"fill",t[2]),g(n,"width",t[0]),g(n,"height",t[1]),g(n,"viewBox",t[3])},m:function(t,i){v(t,n,i),w(n,e)},p:function(t,i){var o=x(i,1)[0];4&o&&g(e,"fill",t[2]),1&o&&g(n,"width",t[0]),2&o&&g(n,"height",t[1]),8&o&&g(n,"viewBox",t[3])},i:R,o:R,d:function(t){t&&h(n)}}}function dt(t,n,e){var i=n.size,o=void 0===i?"1em":i,r=n.width,c=void 0===r?o:r,a=n.height,s=void 0===a?o:a,u=n.color,f=void 0===u?"currentColor":u,l=n.viewBox,d=void 0===l?"0 0 24 24":l;return t.$$set=function(t){"size"in t&&e(4,o=t.size),"width"in t&&e(0,c=t.width),"height"in t&&e(1,s=t.height),"color"in t&&e(2,f=t.color),"viewBox"in t&&e(3,d=t.viewBox)},[c,s,f,d,o]}var $t=function(n){t(a,s);var e=ft(a);function a(t){var n;return i(this,a),n=e.call(this),o(c(n),t,dt,lt,r,{size:4,width:0,height:1,color:2,viewBox:3}),n}return a}();function ht(t){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var o,r=n(t);if(i){var c=n(this).constructor;o=Reflect.construct(r,arguments,c)}else o=r.apply(this,arguments);return e(this,o)}}function pt(t){var n,e;return{c:function(){n=B("svg"),e=B("path"),this.h()},l:function(t){n=d(t,"svg",{width:!0,height:!0,viewBox:!0},1);var i=$(n);e=d(i,"path",{d:!0,fill:!0},1),$(e).forEach(h),i.forEach(h),this.h()},h:function(){g(e,"d","M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z"),g(e,"fill",t[2]),g(n,"width",t[0]),g(n,"height",t[1]),g(n,"viewBox",t[3])},m:function(t,i){v(t,n,i),w(n,e)},p:function(t,i){var o=x(i,1)[0];4&o&&g(e,"fill",t[2]),1&o&&g(n,"width",t[0]),2&o&&g(n,"height",t[1]),8&o&&g(n,"viewBox",t[3])},i:R,o:R,d:function(t){t&&h(n)}}}function mt(t,n,e){var i=n.size,o=void 0===i?"1em":i,r=n.width,c=void 0===r?o:r,a=n.height,s=void 0===a?o:a,u=n.color,f=void 0===u?"currentColor":u,l=n.viewBox,d=void 0===l?"0 0 24 24":l;return t.$$set=function(t){"size"in t&&e(4,o=t.size),"width"in t&&e(0,c=t.width),"height"in t&&e(1,s=t.height),"color"in t&&e(2,f=t.color),"viewBox"in t&&e(3,d=t.viewBox)},[c,s,f,d,o]}var gt=function(n){t(a,s);var e=ht(a);function a(t){var n;return i(this,a),n=e.call(this),o(c(n),t,mt,pt,r,{size:4,width:0,height:1,color:2,viewBox:3}),n}return a}();function vt(t){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var o,r=n(t);if(i){var c=n(this).constructor;o=Reflect.construct(r,arguments,c)}else o=r.apply(this,arguments);return e(this,o)}}function wt(t,n,e){var i=t.slice();return i[25]=n[e],i}function xt(t){var n,e,i;function o(n){t[12].call(null,n)}var r={className:"spin",id:"INTRO: "+t[5].description,time:t[4].break_time,paused:t[0]};return void 0!==t[2]&&(r.restart=t[2]),n=new rt({props:r}),Y.push((function(){return K(n,"restart",o)})),n.$on("start",Ht),n.$on("second",t[7]),n.$on("end",t[8]),{c:function(){_(n.$$.fragment)},l:function(t){k(n.$$.fragment,t)},m:function(t,e){P(n,t,e),i=!0},p:function(t,i){var o={};32&i&&(o.id="INTRO: "+t[5].description),16&i&&(o.time=t[4].break_time),1&i&&(o.paused=t[0]),!e&&4&i&&(e=!0,o.restart=t[2],W((function(){return e=!1}))),n.$set(o)},i:function(t){i||(q(n.$$.fragment,t),i=!0)},o:function(t){C(n.$$.fragment,t),i=!1},d:function(t){T(n,t)}}}function yt(t){var n,e;return(n=new rt({props:{className:"pulse",id:"RECORD: "+t[5].description,time:t[5].time}})).$on("start",Mt),n.$on("second",jt),n.$on("end",t[9]),{c:function(){_(n.$$.fragment)},l:function(t){k(n.$$.fragment,t)},m:function(t,i){P(n,t,i),e=!0},p:function(t,e){var i={};32&e&&(i.id="RECORD: "+t[5].description),32&e&&(i.time=t[5].time),n.$set(i)},i:function(t){e||(q(n.$$.fragment,t),e=!0)},o:function(t){C(n.$$.fragment,t),e=!1},d:function(t){T(n,t)}}}function Rt(t){var n,e,i,o,r=[yt,xt],c=[];function a(t,n){return t[1]?0:1}return n=a(t),e=c[n]=r[n](t),{c:function(){e.c(),i=z()},l:function(t){e.l(t),i=z()},m:function(t,e){c[n].m(t,e),v(t,i,e),o=!0},p:function(t,o){var s=n;(n=a(t))===s?c[n].p(t,o):(j(),C(c[s],1,1,(function(){c[s]=null})),O(),(e=c[n])||(e=c[n]=r[n](t)).c(),q(e,1),e.m(i.parentNode,i))},i:function(t){o||(q(e),o=!0)},o:function(t){C(e),o=!1},d:function(t){c[n].d(t),t&&h(i)}}}function bt(t){var n,e=t[5].example.data&&Nt(t);return{c:function(){e&&e.c(),n=z()},l:function(t){e&&e.l(t),n=z()},m:function(t,i){e&&e.m(t,i),v(t,n,i)},p:function(t,i){t[5].example.data?e?e.p(t,i):((e=Nt(t)).c(),e.m(n.parentNode,n)):e&&(e.d(1),e=null)},d:function(t){e&&e.d(t),t&&h(n)}}}function Nt(t){var n,e;return{c:function(){n=u("audio"),this.h()},l:function(t){n=d(t,"AUDIO",{style:!0,class:!0,src:!0,autoplay:!0,controls:!0}),$(n).forEach(h),this.h()},h:function(){F(n,"max-width","120px"),g(n,"class","mtb06 grow"),n.src!==(e=t[5].example.data.full_url)&&g(n,"src",e),n.autoplay=!0,n.controls=!0},m:function(t,e){v(t,n,e)},p:function(t,i){32&i&&n.src!==(e=t[5].example.data.full_url)&&g(n,"src",e)},d:function(t){t&&h(n)}}}function St(t){var n,e,i,o=t[25].tag_id.title+"";return{c:function(){n=u("span"),e=l(o),i=l(" ")},l:function(t){n=d(t,"SPAN",{});var r=$(n);e=m(r,o),i=m(r," "),r.forEach(h)},m:function(t,o){v(t,n,o),w(n,e),w(n,i)},p:function(t,n){32&n&&o!==(o=t[25].tag_id.title+"")&&y(e,o)},d:function(t){t&&h(n)}}}function Et(t){for(var n,e,i,o,r,c,a,s,x,R,b,N=t[4].exercises.length+"",S=t[5].description+"",E="sound"==t[4].point_of_interest&&t[5].example&&bt(t),A=t[5].tags,B=[],D=0;D<A.length;D+=1)B[D]=St(wt(t,A,D));return{c:function(){E&&E.c(),n=f(),e=u("div"),i=u("div"),o=l(t[3]),r=l("/"),c=l(N),a=l(": "),s=l(S),x=f(),R=u("div"),b=l("Tags:\n      ");for(var d=0;d<B.length;d+=1)B[d].c();this.h()},l:function(u){E&&E.l(u),n=p(u),e=d(u,"DIV",{class:!0});var f=$(e);i=d(f,"DIV",{});var l=$(i);o=m(l,t[3]),r=m(l,"/"),c=m(l,N),a=m(l,": "),s=m(l,S),l.forEach(h),x=p(f),R=d(f,"DIV",{});var g=$(R);b=m(g,"Tags:\n      ");for(var v=0;v<B.length;v+=1)B[v].l(g);g.forEach(h),f.forEach(h),this.h()},h:function(){g(e,"class","grow")},m:function(t,u){E&&E.m(t,u),v(t,n,u),v(t,e,u),w(e,i),w(i,o),w(i,r),w(i,c),w(i,a),w(i,s),w(e,x),w(e,R),w(R,b);for(var f=0;f<B.length;f+=1)B[f].m(R,null)},p:function(t,e){if("sound"==t[4].point_of_interest&&t[5].example?E?E.p(t,e):((E=bt(t)).c(),E.m(n.parentNode,n)):E&&(E.d(1),E=null),8&e&&y(o,t[3]),16&e&&N!==(N=t[4].exercises.length+"")&&y(c,N),32&e&&S!==(S=t[5].description+"")&&y(s,S),32&e){var i;for(A=t[5].tags,i=0;i<A.length;i+=1){var r=wt(t,A,i);B[i]?B[i].p(r,e):(B[i]=St(r),B[i].c(),B[i].m(R,null))}for(;i<B.length;i+=1)B[i].d(1);B.length=A.length}},d:function(t){E&&E.d(t),t&&h(n),t&&h(e),L(B,t)}}}function At(t){var n,e,i,o,r,c,a;return e=new Q({}),c=new I({props:{a:{grow:!0},className:"mlr06 pb06",$$slots:{default:[Pt]},$$scope:{ctx:t}}}),{c:function(){n=u("a"),_(e.$$.fragment),i=l(" Back"),r=f(),_(c.$$.fragment),this.h()},l:function(t){n=d(t,"A",{style:!0,href:!0});var o=$(n);k(e.$$.fragment,o),i=m(o," Back"),o.forEach(h),r=p(t),k(c.$$.fragment,t),this.h()},h:function(){F(n,"position","absolute"),F(n,"top","50px"),F(n,"left","10px"),F(n,"flex-direction","row"),F(n,"align-items","center"),g(n,"href",o="/session/"+t[4].url)},m:function(t,o){v(t,n,o),P(e,n,null),w(n,i),v(t,r,o),P(c,t,o),a=!0},p:function(t,e){(!a||16&e&&o!==(o="/session/"+t[4].url))&&g(n,"href",o);var i={};268435477&e&&(i.$$scope={dirty:e,ctx:t}),c.$set(i)},i:function(t){a||(q(e.$$.fragment,t),q(c.$$.fragment,t),a=!0)},o:function(t){C(e.$$.fragment,t),C(c.$$.fragment,t),a=!1},d:function(t){t&&h(n),T(e),t&&h(r),T(c,t)}}}function Bt(t){var n,e;return n=new I({props:{a:{grow:!0},className:"mlr06",$$slots:{default:[Ot]},$$scope:{ctx:t}}}),{c:function(){_(n.$$.fragment)},l:function(t){k(n.$$.fragment,t)},m:function(t,i){P(n,t,i),e=!0},p:function(t,e){var i={};268435456&e&&(i.$$scope={dirty:e,ctx:t}),n.$set(i)},i:function(t){e||(q(n.$$.fragment,t),e=!0)},o:function(t){C(n.$$.fragment,t),e=!1},d:function(t){T(n,t)}}}function Dt(t){var n,e,i;return e=new gt({}),{c:function(){n=u("span"),_(e.$$.fragment)},l:function(t){n=d(t,"SPAN",{});var i=$(n);k(e.$$.fragment,i),i.forEach(h)},m:function(t,o){v(t,n,o),P(e,n,null),i=!0},i:function(t){i||(q(e.$$.fragment,t),i=!0)},o:function(t){C(e.$$.fragment,t),i=!1},d:function(t){t&&h(n),T(e)}}}function It(t){var n,e,i;return e=new ut({}),{c:function(){n=u("span"),_(e.$$.fragment)},l:function(t){n=d(t,"SPAN",{});var i=$(n);k(e.$$.fragment,i),i.forEach(h)},m:function(t,o){v(t,n,o),P(e,n,null),i=!0},i:function(t){i||(q(e.$$.fragment,t),i=!0)},o:function(t){C(e.$$.fragment,t),i=!1},d:function(t){t&&h(n),T(e)}}}function _t(t){var n,e,i;return e=new $t({}),{c:function(){n=u("span"),_(e.$$.fragment)},l:function(t){n=d(t,"SPAN",{});var i=$(n);k(e.$$.fragment,i),i.forEach(h)},m:function(t,o){v(t,n,o),P(e,n,null),i=!0},i:function(t){i||(q(e.$$.fragment,t),i=!0)},o:function(t){C(e.$$.fragment,t),i=!1},d:function(t){t&&h(n),T(e)}}}function zt(t){var n,e,i,o,r=[_t,It],c=[];function a(t,n){return t[0]?0:1}return n=a(t),e=c[n]=r[n](t),{c:function(){e.c(),i=z()},l:function(t){e.l(t),i=z()},m:function(t,e){c[n].m(t,e),v(t,i,e),o=!0},p:function(t,o){var s=n;(n=a(t))!==s&&(j(),C(c[s],1,1,(function(){c[s]=null})),O(),(e=c[n])||(e=c[n]=r[n](t)).c(),q(e,1),e.m(i.parentNode,i))},i:function(t){o||(q(e),o=!0)},o:function(t){C(e),o=!1},d:function(t){c[n].d(t),t&&h(i)}}}function kt(t){var n;return{c:function(){n=l("10s")},l:function(t){n=m(t,"10s")},m:function(t,e){v(t,n,e)},d:function(t){t&&h(n)}}}function Pt(t){var n,e,i,o,r,c;return(n=new U({props:{a:{grow:!0},$$slots:{default:[Dt]},$$scope:{ctx:t}}})).$on("click",t[13]),(i=new U({props:{a:{grow:!0},$$slots:{default:[zt]},$$scope:{ctx:t}}})).$on("click",t[14]),(r=new U({props:{a:{grow:!0},$$slots:{default:[kt]},$$scope:{ctx:t}}})).$on("click",t[15]),{c:function(){_(n.$$.fragment),e=f(),_(i.$$.fragment),o=f(),_(r.$$.fragment)},l:function(t){k(n.$$.fragment,t),e=p(t),k(i.$$.fragment,t),o=p(t),k(r.$$.fragment,t)},m:function(t,a){P(n,t,a),v(t,e,a),P(i,t,a),v(t,o,a),P(r,t,a),c=!0},p:function(t,e){var o={};268435456&e&&(o.$$scope={dirty:e,ctx:t}),n.$set(o);var c={};268435457&e&&(c.$$scope={dirty:e,ctx:t}),i.$set(c);var a={};268435456&e&&(a.$$scope={dirty:e,ctx:t}),r.$set(a)},i:function(t){c||(q(n.$$.fragment,t),q(i.$$.fragment,t),q(r.$$.fragment,t),c=!0)},o:function(t){C(n.$$.fragment,t),C(i.$$.fragment,t),C(r.$$.fragment,t),c=!1},d:function(t){T(n,t),t&&h(e),T(i,t),t&&h(o),T(r,t)}}}function Ct(t){var n;return{c:function(){n=l("Panic!")},l:function(t){n=m(t,"Panic!")},m:function(t,e){v(t,n,e)},d:function(t){t&&h(n)}}}function Ot(t){var n,e;return(n=new U({props:{a:{grow:!0,height:"60px"},className:"pb1",$$slots:{default:[Ct]},$$scope:{ctx:t}}})).$on("click",t[10]),{c:function(){_(n.$$.fragment)},l:function(t){k(n.$$.fragment,t)},m:function(t,i){P(n,t,i),e=!0},p:function(t,e){var i={};268435456&e&&(i.$$scope={dirty:e,ctx:t}),n.$set(i)},i:function(t){e||(q(n.$$.fragment,t),e=!0)},o:function(t){C(n.$$.fragment,t),e=!1},d:function(t){T(n,t)}}}function qt(t){var n,e,i,o,r,c,a,s;n=new tt({props:{className:"justify-center align-center",$$slots:{default:[Rt]},$$scope:{ctx:t}}}),i=new I({props:{a:{grow:!0},className:"align-center mlr06",$$slots:{default:[Et]},$$scope:{ctx:t}}});var u=[Bt,At],l=[];function d(t,n){return t[1]?0:1}return r=d(t),c=l[r]=u[r](t),{c:function(){_(n.$$.fragment),e=f(),_(i.$$.fragment),o=f(),c.c(),a=z()},l:function(t){k(n.$$.fragment,t),e=p(t),k(i.$$.fragment,t),o=p(t),c.l(t),a=z()},m:function(t,c){P(n,t,c),v(t,e,c),P(i,t,c),v(t,o,c),l[r].m(t,c),v(t,a,c),s=!0},p:function(t,e){var o=x(e,1)[0],s={};268435511&o&&(s.$$scope={dirty:o,ctx:t}),n.$set(s);var f={};268435512&o&&(f.$$scope={dirty:o,ctx:t}),i.$set(f);var $=r;(r=d(t))===$?l[r].p(t,o):(j(),C(l[$],1,1,(function(){l[$]=null})),O(),(c=l[r])||(c=l[r]=u[r](t)).c(),q(c,1),c.m(a.parentNode,a))},i:function(t){s||(q(n.$$.fragment,t),q(i.$$.fragment,t),q(c),s=!0)},o:function(t){C(n.$$.fragment,t),C(i.$$.fragment,t),C(c),s=!1},d:function(t){T(n,t),t&&h(e),T(i,t),t&&h(o),l[r].d(t),t&&h(a)}}}function Tt(t,n){return Vt.apply(this,arguments)}function Vt(){return(Vt=S(E.mark((function t(n,e){return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",D(n,e,this));case 1:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}function Ht(t){console.log("[session:slug:idx] 🖖🏁 intro start:",t.detail)}function Mt(t){console.log("[session:slug:idx] 🔴🏁 record start:",t.detail)}function jt(t){console.log("[session:slug:idx] 🔴 recording:",t.detail)}function Ft(t,n,e){var i,o;V(t,X,(function(t){return e(21,o=t)}));var r=H().page;V(t,r,(function(t){return e(17,i=t)}));var c,a=n.data,s=!1,u=!1;function f(t){J.set({type:"wait",message:"Sending to AI..."});var n={action:"stop",type:"🤖",timestamp:(new Date).toISOString().substr(11,8),message:"stopping exercise"};if(console.log("[idx.svelte] 🤖 ⚡️ 💅  sending config STOP to AI...",n),window.websocketsClient){window.websocketsClient.send(JSON.stringify(n)),e(1,u=!1),J.set(null);var i=l>=$.exercises.length-1?"/session/"+$.url+"/complete":"/session/"+$.url+"/"+(d+1);console.log("[session:slug:idx] 🛫  goto: ",i,l,$.exercises.length),Z(i)}else J.set({type:"error",message:"No connection to AI..."})}N(S(E.mark((function t(){return E.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:console.log("[session:slug:idx] 🤳 idx:",d);case 1:case"end":return t.stop()}}),t)}))));var l,d,$,h,p,m,g,v;return t.$$set=function(t){"data"in t&&e(11,a=t.data)},t.$$.update=function(){131072&t.$$.dirty&&e(16,l=parseInt(i.params.idx,10)-1),131072&t.$$.dirty&&e(3,d=parseInt(i.params.idx,10)),2048&t.$$.dirty&&e(4,$=a[0]||{}),65552&t.$$.dirty&&e(5,h=$.exercises[l]?$.exercises[l].exercise_id:{example:{data:{}}}),32&t.$$.dirty&&e(18,p=h.tags||[]),262144&t.$$.dirty&&(m=p.map((function(t){return t.tag_id.url}))),2359320&t.$$.dirty&&e(20,g=function(){var t=o.hostname+"_";return t+=$.point_of_interest+"_",t+=$.url+"_",t+=d+"_",p.forEach((function(n,e){n.tag_id&&(t+=n.tag_id.url,e<p.length-1&&(t+="-"))})),console.log("[SESSION] 🗯 🦆  returning ID:",t),t}),1048576&t.$$.dirty&&e(22,v=g()),6291456&t.$$.dirty&&{"session-id":"".concat(v,"_").concat(M()),sources:{audio:{active:!0},video:{active:!0},heartrate:{active:!!o.backend.miband.connected}},sinks:{rstp:{active:!1},file:{active:!0},window:{active:!1}}}},[s,u,c,d,$,h,r,function(t){var n=parseInt(t.detail,10);if(n<=10&&0!=n){var e=1==n?"50 50 11 0.001":"100 100 1 0.001";console.log("Count",e,n),console.log("[session:slug:idx] 🖖 intro buzz:",t.detail),G.post("/buzz?as=json",{sequence:e})}},function(t){console.log("[session:slug:idx] 🖖 intro ended:",t.detail),function(t){J.set({type:"wait",status:"🤖",message:"Sending to AI..."});var n=["liebe","trauer","wut","freude","uberraschung","verachtung","angst"],i="none";m.forEach((function(t){-1!=n.indexOf(t)&&(i=t)}));var o={action:"start",title:i,tags:m,type:"🤖",length:h.time,timestamp:(new Date).toISOString().substr(11,8),message:'starting exercise: "'.concat(i,'" ').concat(h.time,"s")};console.log("[idx.svelte] 🤖 ⚡️ 💅  sending config START to AI...",o),window.websocketsClient?(window.websocketsClient.send(JSON.stringify(o)),e(1,u=!0),J.set(null)):J.set({type:"error",status:"🤖",message:"No connection to AI..."})}()},function(t){console.log("[session:slug:idx] 🔴✅  recording ended:",t.detail),f()},f,a,function(t){e(2,c=t)},function(){return c($.break_time+1)},function(){return e(0,s=!s)},function(){return c(11)}]}var Lt=function(n){t(a,s);var e=vt(a);function a(t){var n;return i(this,a),n=e.call(this),o(c(n),t,Ft,qt,r,{data:11}),n}return a}();export default Lt;export{Tt as preload};
