"use strict";(globalThis.webpackChunkfloccus=globalThis.webpackChunkfloccus||[]).push([[541],{79541:(e,t,s)=>{s.r(t),s.d(t,{PreferencesWeb:()=>r});var i=s(29895);class r extends i.WebPlugin{constructor(){super(...arguments),this.group="CapacitorStorage"}async configure({group:e}){"string"==typeof e&&(this.group=e)}async get(e){return{value:this.impl.getItem(this.applyPrefix(e.key))}}async set(e){this.impl.setItem(this.applyPrefix(e.key),e.value)}async remove(e){this.impl.removeItem(this.applyPrefix(e.key))}async keys(){return{keys:this.rawKeys().map((e=>e.substring(this.prefix.length)))}}async clear(){for(const e of this.rawKeys())this.impl.removeItem(e)}async migrate(){var e;const t=[],s=[],i=Object.keys(this.impl).filter((e=>0===e.indexOf("_cap_")));for(const r of i){const i=r.substring(5),a=null!==(e=this.impl.getItem(r))&&void 0!==e?e:"",{value:n}=await this.get({key:i});"string"==typeof n?s.push(i):(await this.set({key:i,value:a}),t.push(i))}return{migrated:t,existing:s}}async removeOld(){const e=Object.keys(this.impl).filter((e=>0===e.indexOf("_cap_")));for(const t of e)this.impl.removeItem(t)}get impl(){return window.localStorage}get prefix(){return"NativeStorage"===this.group?"":`${this.group}.`}rawKeys(){return Object.keys(this.impl).filter((e=>0===e.indexOf(this.prefix)))}applyPrefix(e){return this.prefix+e}}}}]);