import{t as e}from"./react-CRXH2-jv.js";import{t}from"./middleware-Pd0e8Igk.js";import{r as n,s as r}from"./siteStore-BLhBstND.js";var i=r.find(e=>e.id===`ocean`)||r[0],a={presetId:i.id,customColors:{...i.colors},useCustomColors:!1,borderRadius:16,loaded:!1};function o(e){let t={loaded:!0};return e.presetId!==void 0&&(t.presetId=e.presetId),e.useCustomColors!==void 0&&(t.useCustomColors=e.useCustomColors),e.customColors!==void 0&&(t.customColors=e.customColors),e.borderRadius!==void 0&&(t.borderRadius=Math.min(32,Math.max(0,e.borderRadius))),t}var s=e()(t((e,t)=>({...a,loadConfig:async()=>{let t=n.getState().config.theme;if(t){e(o(t));return}e({loaded:!0})},saveConfig:async n=>(e({presetId:t().presetId,customColors:t().customColors,useCustomColors:t().useCustomColors,borderRadius:t().borderRadius,...n,loaded:!0}),!0)}),{name:`theme-config`,merge:(e,t)=>{let n={...t,...e};return n.borderRadius>32&&(n.borderRadius=32),n}}));function c(e){return e.useCustomColors?e.customColors:(r.find(t=>t.id===e.presetId)||i).colors}export{s as n,c as t};