Loading files
var e=`installed`;function t(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error)})}function n({indexedDB:e,databaseName:t,storeName:n}){return new Promise((r,i)=>{let a=e.open(t,1);a.onupgradeneeded=()=>{let e=a.result;e.objectStoreNames.contains(n)||e.createObjectStore(n)},a.onsuccess=()=>r(a.result),a.onerror=()=>i(a.error)})}function r(e){return e instanceof Uint8Array||e instanceof ArrayBuffer?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e??[])}function i(e){let t=r(e);if(t.length<8||t[4]!==88||t[5]!==83||t[6]!==95||t[7]!==65)throw TypeError(`XSアーカイブのヘッダーが不正です`);let n=new DataView(t.buffer,t.byteOffset,t.byteLength).getUint32(0,!1);if(n!==t.byteLength)throw TypeError(`XSアーカイブのサイズが不正です (${n} != ${t.byteLength})`);return t}function a(){let e=null;return{async saveInstalledMod({name:t,bytes:n}){let r=i(n);return e={name:t,bytes:r,size:r.byteLength,installedAt:Date.now()},{...e,bytes:new Uint8Array(e.bytes),storage:`memory`}},async loadInstalledMod(){return e?{...e,bytes:new Uint8Array(e.bytes),storage:`memory`}:null},async clearInstalledMod(){e=null}}}function o({indexedDB:r=globalThis.indexedDB,databaseName:o=`stackchan-wasm-mods`,storeName:s=`installed-mods`}={}){if(!r?.open)return a();async function c(e,t){return t((await n({indexedDB:r,databaseName:o,storeName:s})).transaction(s,e).objectStore(s))}return{async saveInstalledMod({name:n,bytes:r}){let a=i(r),o={name:n,bytes:a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength),size:a.byteLength,installedAt:Date.now()};return await c(`readwrite`,n=>t(n.put(o,e))),{...o,bytes:new Uint8Array(o.bytes),storage:`indexedDB`}},async loadInstalledMod(){let n=await c(`readonly`,n=>t(n.get(e)));if(!n)return null;let r=i(n.bytes);return{name:n.name,bytes:r,size:n.size??r.byteLength,installedAt:n.installedAt,storage:`indexedDB`}},async clearInstalledMod(){await c(`readwrite`,n=>t(n.delete(e)))}}}function s(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}export{o as n,s as r,a as t};2bbf844baThis file is pinned to the selected release. Download the original to open it in your design tool.