import{b as z}from"../chunks/CG0ncoKB.mjs";import"../chunks/E-vkuI0X.mjs";import{i as A}from"../chunks/DE12Pz0s.mjs";import{p as E,l as ie,a as ce,f as k,r as s,c as n,d as H,s as ue,i as o,h as p,a0 as v,u as i,b as M,j as f,m as de,g as le}from"../chunks/DXA5xaTu.mjs";import{p as P,i as m}from"../chunks/DZ_x5TWR.mjs";import{o as ve,s as _}from"../chunks/iXLj1DaW.mjs";import{L as me,M as fe,N as pe,O as ge,P as _e,Q as he,R as ye,S as be,T as xe,U as j,V as R}from"../chunks/CrCfjO1_.mjs";import{b as O}from"../chunks/N-j6n1jq.mjs";import{C as Ce}from"../chunks/BJDS8D8i.mjs";import{C as we}from"../chunks/DSI_ySdY.mjs";import{n as Se,u as Le,a as ke}from"../chunks/BPALNMrX.mjs";const Me=(async()=>({info:await z({})})),qe=Object.freeze(Object.defineProperty({__proto__:null,load:Me},Symbol.toStringTag,{value:"Module"}));function Re(c){const r=c.secsUntilNextLearn;if(r>=86400)return"";const e=Se(r),h=Math.round(ke(e,r)),y=Le(e),g=me({amount:h,unit:y}),b=fe({remaining:c.learnRemaining});return`${g} ${b}`}var B=f("<p> </p>"),F=f("<p></p>"),Pe=f("<!> <!>",1),Te=f('<div class="description svelte-bnvdv9"></div>'),Ne=f('<div class="congrats svelte-bnvdv9"><h1> </h1> <p> </p> <!> <!> <!> <!></div>'),I=f('<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>',1);function Ue(c,r){E(r,!1);let e=P(r,"info",12),h=P(r,"refreshPeriodically",8,!0);const y=pe();let g=de();const b=ge(),Q=_e(),V=O("unbury",he()),q=ye({unburyThem:V}),G=O("customStudy",be()),J=xe({customStudy:G});ve(()=>{h()&&setInterval(async()=>{try{e(await z({},{alertOnError:!1}))}catch{console.log("congrats fetch failed")}},6e4)}),ie(()=>o(e()),()=>{ue(g,Re(e()))}),ce(),A();var T=I(),x=k(T);j(x,()=>({"--gutter-block":"1rem","--gutter-inline":"2px"})),we(x.lastChild,{breakpoint:"sm",children:(K,De)=>{var N=I(),C=k(N);j(C,()=>({"--col-justify":"center"})),Ce(C.lastChild,{children:(W,$e)=>{var w=Ne(),S=p(w),X=p(S,!0);s(S);var L=v(S,2),Y=p(L,!0);s(L);var U=v(L,2);{var Z=t=>{var a=B(),l=p(a,!0);s(a),M(()=>_(l,b)),n(t,a)};m(U,t=>{o(e()),i(()=>e().reviewRemaining)&&t(Z)})}var D=v(U,2);{var ee=t=>{var a=B(),l=p(a,!0);s(a),M(()=>_(l,Q)),n(t,a)};m(D,t=>{o(e()),i(()=>e().newRemaining)&&t(ee)})}var $=v(D,2);{var te=t=>{var a=Pe(),l=k(a);{var se=u=>{var d=F();R(d,()=>q,!0),s(d),n(u,d)};m(l,u=>{o(e()),i(()=>e().haveSchedBuried||e().haveUserBuried)&&u(se)})}var ne=v(l,2);{var oe=u=>{var d=F();R(d,()=>J,!0),s(d),n(u,d)};m(ne,u=>{o(e()),i(()=>!e().isFilteredDeck)&&u(oe)})}n(t,a)};m($,t=>{o(e()),i(()=>e().bridgeCommandsSupported)&&t(te)})}var ae=v($,2);{var re=t=>{var a=Te();R(a,()=>(o(e()),i(()=>e().deckDescription)),!0),s(a),n(t,a)};m(ae,t=>{o(e()),i(()=>e().deckDescription)&&t(re)})}s(w),M(()=>{_(X,y),_(Y,le(g))}),n(W,w)},$$slots:{default:!0}}),s(C),n(K,N)},$$slots:{default:!0}}),s(x),n(c,T),H()}function Ge(c,r){E(r,!1);let e=P(r,"data",8);A(),Ue(c,{get info(){return o(e()),i(()=>e().info)}}),H()}export{Ge as component,qe as universal};
