const t=window.localStorage;function n(n,r){return new Promise(((o,e)=>{try{t&&t.setItem(n,JSON.stringify(r)),o()}catch(t){e(`Couldnt store object ${t}`)}}))}function r(n){return new Promise(((r,o)=>{try{t&&t.removeItem(n),r()}catch(t){o(`Couldnt remove object ${t}`)}}))}function o(n){try{if(t){const r=t.getItem(n);return JSON.parse(r)}}catch(t){return null}}export{o as g,r,n as s}