import{Kt as e,X as t,bt as n,vt as r}from"./xY0c-UfG.js";import{C as i,z as a}from"./BW-sf0N4.js";var o=e({insightsStore:()=>c});function s(){let e=n(!1),o=n(!1),s=n(null),c=n(!1),l=n(!1),u=n(!1);async function d(){if(!t(e)){r(e,!0);try{let e=await i();r(s,e.accent_color??null,!0),r(c,e.onboarded??!1,!0),r(l,e.onboarding_deferred??!1,!0),r(o,!0),r(u,!0)}catch(e){console.error(`Failed to load preferences:`,e),r(o,!0),r(u,!0)}finally{r(e,!1)}}}async function f(e){r(s,e,!0),await a({accent_color:e})}async function p(){r(c,!0),await a({onboarded:!0})}async function m(){r(l,!0);try{await a({onboarding_deferred:!0})}catch(e){console.error(`Failed to persist onboarding defer:`,e)}}async function h(){r(l,!1);try{await a({onboarding_deferred:!1})}catch(e){console.error(`Failed to persist onboarding resume:`,e)}}return{get loading(){return t(e)},get loaded(){return t(o)},get accentColor(){return t(s)},get onboarded(){return t(c)},get deferred(){return t(l)},get prefsLoaded(){return t(u)},load:d,saveAccentColor:f,markOnboarded:p,deferOnboarding:m,resumeOnboarding:h}}var c=s();export{o as n,c as t};