Files
Simon James b54a3139c7 Initial commit: Qortal Web Builder monorepo.
Includes QWB, Qortal Web, and Q-Shops Q-Apps with shared packages and build scripts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-09 12:17:29 +00:00

2 lines
2.6 KiB
JavaScript

"use strict";(()=>{var R=(function(){let c=new Uint32Array(256);for(let s=0;s<256;s++){let o=s;for(let U=0;U<8;U++)o=o&1?3988292384^o>>>1:o>>>1;c[s]=o>>>0}return c})();function k(r){let c=4294967295;for(let s=0;s<r.length;s++)c=R[(c^r[s])&255]^c>>>8;return(c^4294967295)>>>0}function x(r){return r instanceof Uint8Array?r:typeof r=="string"?new TextEncoder().encode(String(r)):new Uint8Array(r)}var D=["index.html","index.htm","default.html","default.htm","home.html","home.htm","manifest.json"];function E(r){let c=new Set(r),s=[];for(let o of D)c.has(o)&&(s.push(o),c.delete(o));return s.push(...Array.from(c).sort((o,U)=>o.localeCompare(U))),s}function S(r){let s=E(Object.keys(r)).map(i=>{let u=x(r[i]);return{name:i,data:u}}),o=0,U=[],p=[];for(let i of s){let u=x(i.name),l=u.length;if(l>65535)throw new Error("zip path too long: "+i.name);let m=i.data,n=m.length,t=k(m),b=67324752,h=20,O=0,T=0,Z=0,j=0,A=n,L=30+l,f=new DataView(new ArrayBuffer(L+n)),e=0;f.setUint32(e,b,!0),e+=4,f.setUint16(e,h,!0),e+=2,f.setUint16(e,O,!0),e+=2,f.setUint16(e,T,!0),e+=2,f.setUint16(e,Z,!0),e+=2,f.setUint16(e,j,!0),e+=2,f.setUint32(e,t,!0),e+=4,f.setUint32(e,A,!0),e+=4,f.setUint32(e,n,!0),e+=4,f.setUint16(e,l,!0),e+=2,f.setUint16(e,0,!0),e+=2,new Uint8Array(f.buffer).set(u,e),e+=l,new Uint8Array(f.buffer).set(m,e),U.push(new Uint8Array(f.buffer)),p.push({nameBytes:u,crc:t,size:n,csize:A,localOffset:o}),o+=f.buffer.byteLength}let g=[],y=0,z=o;for(let i=0;i<p.length;i++){let u=p[i],l=u.nameBytes.length,m=46+l,n=new DataView(new ArrayBuffer(46)),t=0;n.setUint32(t,33639248,!0),t+=4,n.setUint16(t,20,!0),t+=2,n.setUint16(t,20,!0),t+=2,n.setUint16(t,0,!0),t+=2,n.setUint16(t,0,!0),t+=2,n.setUint16(t,0,!0),t+=2,n.setUint16(t,0,!0),t+=2,n.setUint32(t,u.crc,!0),t+=4,n.setUint32(t,u.csize,!0),t+=4,n.setUint32(t,u.size,!0),t+=4,n.setUint16(t,l,!0),t+=2,n.setUint16(t,0,!0),t+=2,n.setUint16(t,0,!0),t+=2,n.setUint16(t,0,!0),t+=2,n.setUint16(t,0,!0),t+=2,n.setUint32(t,0,!0),t+=4,n.setUint32(t,u.localOffset,!0),t+=4;let b=new Uint8Array(n.buffer),h=new Uint8Array(m);h.set(b,0),h.set(u.nameBytes,46),g.push(h),y+=h.length}let a=new DataView(new ArrayBuffer(22));a.setUint32(0,101010256,!0),a.setUint16(4,0,!0),a.setUint16(6,0,!0),a.setUint16(8,s.length,!0),a.setUint16(10,s.length,!0),a.setUint32(12,y,!0),a.setUint32(16,z,!0),a.setUint16(20,0,!0);let B=o+y+22,d=new Uint8Array(B),w=0;for(let i of U)d.set(i,w),w+=i.length;for(let i of g)d.set(i,w),w+=i.length;return d.set(new Uint8Array(a.buffer),w),d}window.buildZipStore=function(r){if(!r||typeof r!="object")throw new Error("buildZipStore: expected files object");return S(r)};})();