var gdjs;(function(a){let p;(function(l){l.loadFromIndexedDB=async function(u,e,d){return new Promise((s,t)=>{try{const r=indexedDB.open(u,1);r.onupgradeneeded=function(){const n=r.result;n.objectStoreNames.contains(e)||n.createObjectStore(e)},r.onsuccess=function(){const o=r.result.transaction(e,"readonly").objectStore(e).get(d);o.onsuccess=function(){o.result!==void 0?s(o.result):s(null)},o.onerror=function(){console.error("Error loading data from IndexedDB:",o.error),t(o.error)}},r.onerror=function(){console.error("Error opening IndexedDB:",r.error),t(r.error)}}catch(r){console.error("Exception thrown while opening IndexedDB:",r),t(r);return}})},l.saveToIndexedDB=async function(u,e,d,s){return new Promise((t,r)=>{try{const n=indexedDB.open(u,1);n.onupgradeneeded=function(f){const c=n.result;c.objectStoreNames.contains(e)||c.createObjectStore(e)},n.onsuccess=function(){const i=n.result.transaction(e,"readwrite").objectStore(e).put(s,d);i.onsuccess=function(){t()},i.onerror=function(){console.error("Error saving data to IndexedDB:",i.error),r(i.error)}},n.onerror=function(){console.error("Error opening IndexedDB:",n.error),r(n.error)}}catch(n){console.error("Exception thrown while opening IndexedDB:",n),r(n);return}})}})(p=a.indexedDb||(a.indexedDb={}))})(gdjs||(gdjs={}));
//# sourceMappingURL=indexeddb.js.map
