import{v as E}from"../chunks/tnLI9iJm.mjs";import"../chunks/E-vkuI0X.mjs";import{i as I}from"../chunks/D7QRsIUK.mjs";import{bg as q,b0 as ie,b1 as ce,aq as k,bo as s,W as n,bd as z,bu as de,ad as o,a3 as p,bE as f,bU as i,bP as M,au as m,b8 as ue,aw as le}from"../chunks/D_PZV9Md.mjs";import{p as R,i as v}from"../chunks/3irscRxQ.mjs";import{j as fe,s as _}from"../chunks/BZYxBvHH.mjs";import{fp as ve,fg as me,f7 as pe,fB as ge,fA as _e,fC as he,f6 as be,f8 as ye,fd as Ce,a7 as j,dT as P}from"../chunks/CPjd1xqp.mjs";import{a as B}from"../chunks/Bhi_Z-Vl.mjs";import{C as we}from"../chunks/B6OmlC5s.mjs";import{C as xe}from"../chunks/D4iMT9ba.mjs";import{n as Se,c as Le,u as ke}from"../chunks/D4_lcLhz.mjs";const Me=(async()=>({info:await E({})})),Ge=Object.freeze(Object.defineProperty({__proto__:null,load:Me},Symbol.toStringTag,{value:"Module"}));function Pe(c){const r=c.secsUntilNextLearn;if(r>=86400)return"";const e=Se(r),h=Math.round(ke(e,r)),b=Le(e),g=ve({amount:h,unit:b}),y=me({remaining:c.learnRemaining});return`${g} ${y}`}var F=m("<p> </p>"),O=m("<p></p>"),Re=m("<!> <!>",1),Te=m('<div class="description svelte-bnvdv9"></div>'),Ue=m('<div class="congrats svelte-bnvdv9"><h1> </h1> <p> </p> <!> <!> <!> <!></div>'),A=m('<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>',1);function De(c,r){q(r,!1);let e=R(r,"info",12),h=R(r,"refreshPeriodically",8,!0);const b=pe();let g=ue();const y=ge(),H=_e(),W=B("unbury",he()),G=be({unburyThem:W}),J=B("customStudy",ye()),K=Ce({customStudy:J});fe(()=>{h()&&setInterval(async()=>{try{e(await E({},{alertOnError:!1}))}catch{console.log("congrats fetch failed")}},6e4)}),ie(()=>o(e()),()=>{de(g,Pe(e()))}),ce(),I();var T=A(),C=k(T);j(C,()=>({"--gutter-block":"1rem","--gutter-inline":"2px"})),xe(C.lastChild,{breakpoint:"sm",children:(Q,Ne)=>{var U=A(),w=k(U);j(w,()=>({"--col-justify":"center"})),we(w.lastChild,{children:(V,$e)=>{var x=Ue(),S=p(x),X=p(S,!0);s(S);var L=f(S,2),Y=p(L,!0);s(L);var D=f(L,2);{var Z=t=>{var a=F(),l=p(a,!0);s(a),M(()=>_(l,y)),n(t,a)};v(D,t=>{o(e()),i(()=>e().reviewRemaining)&&t(Z)})}var N=f(D,2);{var ee=t=>{var a=F(),l=p(a,!0);s(a),M(()=>_(l,H)),n(t,a)};v(N,t=>{o(e()),i(()=>e().newRemaining)&&t(ee)})}var $=f(N,2);{var te=t=>{var a=Re(),l=k(a);{var se=d=>{var u=O();P(u,()=>G,!0),s(u),n(d,u)};v(l,d=>{o(e()),i(()=>e().haveSchedBuried||e().haveUserBuried)&&d(se)})}var ne=f(l,2);{var oe=d=>{var u=O();P(u,()=>K,!0),s(u),n(d,u)};v(ne,d=>{o(e()),i(()=>!e().isFilteredDeck)&&d(oe)})}n(t,a)};v($,t=>{o(e()),i(()=>e().bridgeCommandsSupported)&&t(te)})}var ae=f($,2);{var re=t=>{var a=Te();P(a,()=>(o(e()),i(()=>e().deckDescription)),!0),s(a),n(t,a)};v(ae,t=>{o(e()),i(()=>e().deckDescription)&&t(re)})}s(x),M(()=>{_(X,b),_(Y,le(g))}),n(V,x)},$$slots:{default:!0}}),s(w),n(Q,U)},$$slots:{default:!0}}),s(C),n(c,T),z()}function Je(c,r){q(r,!1);let e=R(r,"data",8);I(),De(c,{get info(){return o(e()),i(()=>e().info)}}),z()}export{Je as component,Ge as universal};
