import{M as e,j as t}from"./i18n-BaLR3UdQ.js";import{t as n}from"./server-BXh06Wz_.js";var r=new class{initializedPromise;arr;constructor(){!e&&!t()?this.initializedPromise=n.get(`options`).then(e=>this.load(e)):this.initializedPromise=Promise.resolve()}load(e){this.arr=e}get(e){return this.arr?.[e]}getNames(){return Object.keys(this.arr||[])}getJson(e){let t=this.arr?.[e];if(typeof t!=`string`)return null;try{return JSON.parse(t)}catch{return null}}getInt(e){let t=this.arr?.[e];return typeof t==`number`?t:typeof t==`string`?parseInt(t):(console.warn(`Attempting to read int for unsupported value: `,t),null)}getFloat(e){let t=this.arr?.[e];return typeof t==`string`?parseFloat(t):null}is(e){return this.arr[e]===`true`}set(e,t){this.arr[e]=t}async save(e,t){this.set(e,t);let r={};r[e]=t,await n.put(`options`,r)}async saveMany(e){await n.put(`options`,e)}async toggle(e){await this.save(e,(!this.is(e)).toString())}};export{r as t};