zip-peek 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/zipServiceWorker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{"use strict";var t={257(t,e){function n(t){const n=t.trim();return n.startsWith(e.ZIP_PEEK_ERROR_PREFIX)?n:`${e.ZIP_PEEK_ERROR_PREFIX} ${n}`}Object.defineProperty(e,"__esModule",{value:!0}),e.ZIP_PEEK_ERROR_PREFIX=void 0,e.formatZipPeekError=n,e.createZipPeekError=function(t){return new Error(n(t))},e.toZipPeekError=function(t){const r=t instanceof Error?t:new Error(String(t));return r.message.startsWith(e.ZIP_PEEK_ERROR_PREFIX)||(r.message=n(r.message)),r},e.errorMessage=function(t){return t instanceof Error?t.message:String(t)},e.ZIP_PEEK_ERROR_PREFIX="[zip-peek-error]"},978(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.persistAllowedZipUrlsConfig=o,e.ensureAllowedZipUrlsLoaded=async function(){if(i.allowedZipUrlsLoaded)return i.allowedZipUrlsLoaded;const t=(async()=>{try{const t=await caches.open(i.CONFIG_CACHE_NAME),e=await t.match(i.CONFIG_CACHE_KEY);if(!e)return;const n=await e.json();Array.isArray(n.allowedZipUrls)?(0,i.setAllowedZipUrls)(new Set(n.allowedZipUrls.filter(t=>"string"==typeof t).map(t=>(0,r.normalizeZipUrl)(t)))):(0,i.setAllowedZipUrls)(null)}catch(t){(0,s.warn)("failed to load runtime config",t)}})();return(0,i.setAllowedZipUrlsLoaded)(t),t},e.applyRuntimeConfig=async function(t){if(!t)return;let e={...i.runtimeConfig},n=!1;if("string"==typeof t.zipAssetCacheName&&t.zipAssetCacheName.trim()&&(e.zipAssetCacheName=t.zipAssetCacheName,n=!0),"number"==typeof t.assetCacheTtlMs&&Number.isFinite(t.assetCacheTtlMs)&&(e.assetCacheTtlMs=t.assetCacheTtlMs,n=!0),"string"==typeof t.logPrefix&&t.logPrefix.trim()&&(e.logPrefix=t.logPrefix,n=!0),n&&(0,i.setRuntimeConfig)(e),"allowedZipUrls"in t){const e=Array.isArray(t.allowedZipUrls)?t.allowedZipUrls.map(t=>(0,r.normalizeZipUrl)(t)):null;(0,i.setAllowedZipUrls)(e?new Set(e):null),(0,i.setAllowedZipUrlsLoaded)(Promise.resolve()),await o(e)}},e.isZipUrlAllowed=function(t){return null===i.allowedZipUrls||i.allowedZipUrls.has(t)};const r=n(183),i=n(950),s=n(842);async function o(t){try{const e=await caches.open(i.CONFIG_CACHE_NAME);await e.put(new Request(i.CONFIG_CACHE_KEY),new Response(JSON.stringify({allowedZipUrls:t}),{headers:{"Content-Type":"application/json"}}))}catch(t){(0,s.warn)("failed to persist runtime config",t)}}},752(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.canonicalAssetRequest=function(t,e){return new Request((0,i.canonicalZipAssetRequestUrl)(t,e),{method:"GET"})},e.assetCacheEntryExpired=l,e.clearAllZipAssets=async function(){const t=await caches.open(s.runtimeConfig.zipAssetCacheName),e=await t.keys();await Promise.all(e.map(e=>t.delete(e))),await caches.delete(s.CONFIG_CACHE_NAME),s.zipManifests.clear(),s.pendingManifestLoads.clear(),(0,s.setAllowedZipUrlsLoaded)(Promise.resolve())},e.clearZipAssetsExceptAllowed=async function(t){try{const e=new Set(t),n=await caches.open(s.runtimeConfig.zipAssetCacheName),r=await n.keys();for(const t of r){const r=t.url;if(r.includes(s.MANIFEST_CACHE_KEY)){const i=(0,a.zipUrlFromManifestCacheKey)(r);i&&!e.has(i)&&await n.delete(t);continue}const o=(0,i.parseZipAssetRequest)(r);o&&!e.has(o.zipUrl)&&await n.delete(t)}for(const t of s.zipManifests.keys())e.has(t)||s.zipManifests.delete(t)}catch(t){throw(0,r.createZipPeekError)(`Failed to clear zip assets except allowed URLs: ${(0,r.errorMessage)(t)}`)}},e.putCachedFullAssetIfAbsent=async function(t,e){try{const n=await caches.open(s.runtimeConfig.zipAssetCacheName),r=await n.match(t);if(r&&!l(r))return;const i=e.type||"application/octet-stream";await n.put(t,new Response(e,{status:200,headers:{"Content-Type":i,"Content-Length":String(e.size),"Access-Control-Allow-Origin":"*",[s.ASSET_CACHED_AT_HEADER]:String(Date.now())}}))}catch(t){(0,o.warn)("asset cache put failed",t)}},e.readCachedZipAssetIfFresh=async function(t){let e=null,n="network";try{const r=await caches.open(s.runtimeConfig.zipAssetCacheName),i=await r.match(t);if(i)if(l(i))try{await r.delete(t)}catch(t){(0,o.warn)("asset cache delete expired failed",t)}else e=await i.blob(),n="cache-api"}catch(t){(0,o.warn)("asset cache read failed",t)}return{blob:e,assetSource:n}};const r=n(257),i=n(183),s=n(950),o=n(842),a=n(234);function l(t){const e=t.headers.get(s.ASSET_CACHED_AT_HEADER);if(!e)return!0;const n=parseInt(e,10);return!Number.isFinite(n)||Date.now()-n>s.runtimeConfig.assetCacheTtlMs}},886(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.installFetchHandler=function(){self.addEventListener("fetch",t=>{if("GET"!==t.request.method)return;const e=(0,i.parseZipAssetRequest)(t.request.url);if(!e)return;const n=(0,i.normalizeZipUrl)(e.zipUrl),f=e.internalPath,h=(0,i.normalizeZipEntryPath)(f);t.respondWith((async()=>{try{if(await(0,s.ensureAllowedZipUrlsLoaded)(),!(0,s.isZipUrlAllowed)(n))return(0,l.warn)("zip URL not allowed",{requestedZipUrl:n}),(0,c.corsErrorResponse)(`ZIP URL not allowed (not in allowedZipUrls): ${n}`,403);let e=a.zipManifests.get(n);if(e||(e=await(0,u.ensureManifestAvailable)(n,t.clientId||void 0)??void 0),!e){const t=Array.from(a.zipManifests.keys());return(0,l.warn)("manifest missing for zipUrl",{requestedZipUrl:n,knownZipUrls:t}),(0,c.corsErrorResponse)(`ZIP manifest not loaded for ${n}. Ensure the ZIP is reachable and supports byte-range requests.`,404)}const r=(0,u.resolveManifestEntry)(e,h);if(!r){const t=Array.from(e.keys()).slice(0,50);return(0,l.warn)("file not in manifest or ambiguous suffix match",{zipUrl:n,internalPathRaw:f,internalPathNormalized:h,manifestSize:e.size,sampleKeys:t}),(0,c.corsErrorResponse)(`File "${f}" not found in ZIP manifest for ${n}`,404)}const{key:i,info:p}=r;i!==h&&(0,l.log)("resolved via suffix match",{requested:h,manifestKey:i});const d=(0,o.canonicalAssetRequest)(n,i);let{blob:g,assetSource:v}=await(0,o.readCachedZipAssetIfFresh)(d);if(!g){const t=await(0,c.fetchUncompressedZipEntryFromNetwork)(n,i,p,d);if(!t.ok)return t.response;g=t.blob,v="network"}if(t.request.headers.has("range")){const e=t.request.headers.get("range").replace(/^bytes=/,"");if(e.includes(","))return new Response(null,{status:416,headers:{"Content-Range":`bytes */${g.size}`,"Access-Control-Allow-Origin":"*"}});const[n,r]=e.split("-"),i=""!==n?parseInt(n,10):NaN,s=""!==r?parseInt(r,10):g.size-1;if(isNaN(i)||isNaN(s)||i<0||s<i||i>=g.size)return new Response(null,{status:416,headers:{"Content-Range":`bytes */${g.size}`,"Access-Control-Allow-Origin":"*"}});const o=Math.min(s,g.size-1),l=g.slice(i,o+1);return new Response(l,{status:206,headers:{"Content-Type":g.type,"Content-Range":`bytes ${i}-${o}/${g.size}`,"Content-Length":l.size.toString(),"Accept-Ranges":"bytes","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":a.ASSET_SOURCE_HEADER,[a.ASSET_SOURCE_HEADER]:v}})}return new Response(g,{status:200,headers:{"Content-Type":g.type,"Content-Length":g.size.toString(),"Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":a.ASSET_SOURCE_HEADER,[a.ASSET_SOURCE_HEADER]:v}})}catch(t){return(0,l.error)("fetch handler failed",{zipUrl:n,internalPath:f,message:(0,r.errorMessage)(t)}),(0,c.corsErrorResponse)(`Failed to serve "${f}" from ${n}: ${(0,r.errorMessage)(t)}`,500)}})())})};const r=n(257),i=n(183),s=n(978),o=n(752),a=n(950),l=n(842),u=n(234),c=n(878)},950(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.CONFIG_CACHE_KEY=e.allowedZipUrlsLoaded=e.allowedZipUrls=e.runtimeConfig=e.pendingManifestLoads=e.zipManifests=e.MANIFEST_CACHE_KEY=e.LOCAL_FILE_HEADER_SIG=e.MIME_TYPES=e.ASSET_SOURCE_HEADER=e.ASSET_CACHED_AT_HEADER=e.ALLOWED_CACHE_NAMES=e.CONFIG_CACHE_NAME=e.DEFAULT_ASSET_CACHE_TTL_MS=e.DEFAULT_ZIP_ASSET_CACHE_NAME=void 0,e.setRuntimeConfig=function(t){e.runtimeConfig=t},e.setAllowedZipUrls=function(t){e.allowedZipUrls=t},e.setAllowedZipUrlsLoaded=function(t){e.allowedZipUrlsLoaded=t},e.DEFAULT_ZIP_ASSET_CACHE_NAME="zip-cache-v1",e.DEFAULT_ASSET_CACHE_TTL_MS=72e5,e.CONFIG_CACHE_NAME="zip-peek-config-v1",e.ALLOWED_CACHE_NAMES=[e.DEFAULT_ZIP_ASSET_CACHE_NAME,e.CONFIG_CACHE_NAME],e.ASSET_CACHED_AT_HEADER="X-ZipSW-Cached-At",e.ASSET_SOURCE_HEADER="X-ZipSW-Asset-Source",e.MIME_TYPES={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",json:"application/json",js:"application/javascript",css:"text/css; charset=utf-8",html:"text/html; charset=utf-8",txt:"text/plain; charset=utf-8",mp4:"video/mp4",webm:"video/webm",mp3:"audio/mpeg",wav:"audio/wav",oga:"audio/ogg",ogg:"audio/ogg",xml:"application/xml",wasm:"application/wasm"},e.LOCAL_FILE_HEADER_SIG=67324752,e.MANIFEST_CACHE_KEY="__zipsw_manifest__=1",e.zipManifests=new Map,e.pendingManifestLoads=new Map,e.runtimeConfig={zipAssetCacheName:e.DEFAULT_ZIP_ASSET_CACHE_NAME,assetCacheTtlMs:e.DEFAULT_ASSET_CACHE_TTL_MS,logPrefix:"[zipSW]"},e.allowedZipUrls=null,e.allowedZipUrlsLoaded=null,e.CONFIG_CACHE_KEY=new URL("__zip_peek_runtime_config__",self.registration.scope).href},842(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.log=function(...t){console.log(i.runtimeConfig.logPrefix,...t)},e.warn=function(...t){console.warn(i.runtimeConfig.logPrefix,...t)},e.error=function(...t){console.error(i.runtimeConfig.logPrefix,r.ZIP_PEEK_ERROR_PREFIX,...t)},e.reportClientError=s,e.installClientErrorReporting=function(){self.addEventListener("error",t=>{s(t.error??t.message,"Service worker uncaught error")}),self.addEventListener("unhandledrejection",t=>{s(t.reason,"Service worker unhandled promise rejection")})};const r=n(257),i=n(950);function s(t,e){const n=(0,r.toZipPeekError)(t);self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(t=>{const i={type:"ZIP_SW_ERROR",error:{message:n.message,stack:n.stack},info:e?(0,r.formatZipPeekError)(e):void 0};for(const e of t)e.postMessage(i)})}},234(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.manifestCacheKey=function(t){return t+(t.includes("?")?"&":"?")+i.MANIFEST_CACHE_KEY},e.parseCentralDirectoryToManifest=o,e.manifestFilesToMap=a,e.sendManifestToClientId=u,e.loadManifestFromClientId=c,e.fetchZipManifest=f,e.ensureManifestAvailable=function(t,e){const n=i.zipManifests.get(t);if(n)return Promise.resolve(n);let r=i.pendingManifestLoads.get(t);return r||(r=(async()=>{const n=await c(t,e);if(n)return i.zipManifests.set(t,n),(0,s.log)("restored manifest from client memory",{zipUrl:t,entryCount:n.size}),n;const r=await f(t);return r&&(i.zipManifests.set(t,r),await u(t,r,e),(0,s.log)("manifest fetched and stored in memory",{zipUrl:t,entryCount:r.size})),r})().finally(()=>{i.pendingManifestLoads.delete(t)}),i.pendingManifestLoads.set(t,r),r)},e.resolveManifestEntry=function(t,e){if(t.has(e))return{key:e,info:t.get(e)};const n=[];for(const r of t.keys())r.endsWith("/"+e)&&n.push(r);if(1===n.length){const e=n[0];return{key:e,info:t.get(e)}}return n.length>1?((0,s.error)("ambiguous suffix match for ZIP entry",{requested:e,candidates:n.slice(0,8)}),null):null},e.zipUrlFromManifestCacheKey=function(t){const e=i.MANIFEST_CACHE_KEY;if(!t.endsWith(e))return null;let n=t.slice(0,-e.length);return(n.endsWith("?")||n.endsWith("&"))&&(n=n.slice(0,-1)),n};const r=n(183),i=n(950),s=n(842);function o(t,e,n,i){const o=new DataView(t);let a=e;const l=[];for(;a+46<=t.byteLength&&33639248===o.getUint32(a,!0);){const e=o.getUint16(a+10,!0),n=o.getUint32(a+20,!0),i=o.getUint16(a+28,!0),s=o.getUint16(a+30,!0),u=o.getUint16(a+32,!0),c=o.getUint32(a+42,!0),f=new TextDecoder;if(a+46+i>t.byteLength)break;const h=new Uint8Array(t,a+46,i),p=f.decode(h),d=(0,r.normalizeZipEntryPath)(p);""!==d&&l.push({filename:d,offset:c,compressedSize:n,compression:e}),a+=46+i+s+u}if(0===l.length)return(0,s.error)("no files parsed from central directory",i),null;l.sort((t,e)=>t.offset-e.offset);const u=new Map;for(let t=0;t<l.length;t++){const e=l[t],i=(0,r.normalizeZipEntryPath)(e.filename);""!==i&&(u.has(i)&&(0,s.warn)("duplicate manifest key after normalize; overwriting",i),u.set(i,{filename:e.filename,offset:e.offset,compressedSize:e.compressedSize,compression:e.compression,nextOffset:t<l.length-1?l[t+1].offset:n}))}return u.size>0?u:null}function a(t){const e=new Map;for(const n of t){const t=(0,r.normalizeZipEntryPath)(n.filename);""!==t&&(e.has(t)&&(0,s.warn)("duplicate manifest key after normalize; overwriting",t),e.set(t,n))}return e.size>0?e:null}async function l(t){if(!t)return null;const e=await self.clients.get(t);return"window"===e?.type?e:null}async function u(t,e,n){const r=await l(n);if(!r)return;const i=Array.from(e.values());try{r.postMessage({type:"ZIP_SW_MANIFEST_CREATED",zipUrl:t,files:i})}catch(t){(0,s.warn)("failed to send manifest to client",t)}}async function c(t,e){const n=await l(e);return n?function(t,e){return new Promise(n=>{const r=new MessageChannel,i=setTimeout(()=>{r.port1.close(),n(null)},500);r.port1.onmessage=t=>{clearTimeout(i),r.port1.close();const e=t.data;e?.ok&&Array.isArray(e.files)?n(a(e.files)):n(null)},r.port1.onmessageerror=()=>{clearTimeout(i),r.port1.close(),n(null)};try{t.postMessage({type:"ZIP_SW_MANIFEST_REQUEST",zipUrl:e},[r.port2])}catch(t){clearTimeout(i),r.port1.close(),(0,s.warn)("failed to request manifest from client",t),n(null)}})}(n,t):null}async function f(t){const e=await fetch(t,{headers:{Range:"bytes=-65536"}});if(206!==e.status)return(0,s.error)("range requests not supported for ZIP manifest",{zipUrl:t,status:e.status}),null;const n=await e.arrayBuffer(),r=new DataView(n);let i=-1;for(let t=n.byteLength-22;t>=0;t--)if(101010256===r.getUint32(t,!0)){i=t;break}if(-1===i)return(0,s.error)("EOCD not found in last 64KB of ZIP file",t),null;const a=r.getUint32(i+16,!0),l=r.getUint32(i+12,!0);let u=n,c=-1;const f=e.headers.get("Content-Range");let h=0;if(f){const t=f.match(/\/(\d+)$/);t&&(h=parseInt(t[1],10))}if(h<=0)return(0,s.error)("could not determine ZIP file size from Content-Range header",{zipUrl:t,contentRange:f}),null;const p=h-n.byteLength;if(a>=p)c=a-p;else{const e=await fetch(t,{headers:{Range:`bytes=${a}-${a+l-1}`}});if(206!==e.status)return(0,s.error)("failed to fetch ZIP central directory",{zipUrl:t,status:e.status,cdOffset:a,cdSize:l}),null;u=await e.arrayBuffer(),c=0}return o(u,c,a,t)}},49(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.replyToMessage=f,e.installMessageHandler=function(){self.addEventListener("message",t=>{if(!t.data)return;const{type:e,zipUrl:n,files:h,config:p,allowedZipUrls:d}=t.data,g=function(t){if(!t||!("id"in t))return;const e=t.id;return"string"==typeof e?e:void 0}(t.source);if("ZIP_SW_CONFIG"===e){const e=(0,s.applyRuntimeConfig)(p).then(()=>f(t,{ok:!0})).catch(e=>f(t,c(e)));return void t.waitUntil(e)}if("ZIP_MANIFEST"===e){if(n&&h){const e=(0,i.normalizeZipUrl)(n),r=(0,u.manifestFilesToMap)(h),s=a.zipManifests.get(e);if(!r)return void(0,l.warn)("rejecting empty manifest; keeping existing",{zipUrl:e,existingSize:s?s.size:0});if(s&&s.size>r.size)return void(0,l.warn)("rejecting smaller manifest; keeping existing",{zipUrl:e,incomingSize:r.size,existingSize:s.size});a.zipManifests.set(e,r),t.waitUntil((0,u.sendManifestToClientId)(e,r,g));const o=Array.from(r.keys()).slice(0,40);(0,l.log)("ZIP_MANIFEST loaded",{zipUrl:e,entryCount:r.size,sampleKeys:o,replacedExistingSize:s?s.size:0})}}else if("CLEAR_ZIP_ASSETS_EXCEPT_ALLOWED"===e&&d){const e=(0,o.clearZipAssetsExceptAllowed)(d).then(()=>f(t,{ok:!0})).catch(e=>f(t,c(e)));t.waitUntil(e)}else if("CLEAR_ALL_ZIP_ASSETS"===e){const e=(0,o.clearAllZipAssets)().then(()=>f(t,{ok:!0})).catch(e=>f(t,c(e)));t.waitUntil(e)}else if("PRELOAD_ZIP_MANIFESTS"===e&&d){const e=async function(t,e){const n=await Promise.all(t.map(async t=>({zipUrl:t,manifest:await(0,u.ensureManifestAvailable)(t,e)}))),i=n.filter(t=>!t.manifest).map(t=>t.zipUrl);if(i.length>0)throw(0,r.createZipPeekError)(`Failed to preload ZIP manifest(s): ${i.join(", ")}`)}(d,g).then(()=>f(t,{ok:!0})).catch(e=>f(t,c(e)));t.waitUntil(e)}})};const r=n(257),i=n(183),s=n(978),o=n(752),a=n(950),l=n(842),u=n(234);function c(t){const e=(0,r.toZipPeekError)(t);return{ok:!1,error:e.message,errorStack:e.stack}}function f(t,e){t.ports[0]?.postMessage(e)}},878(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.corsErrorResponse=l,e.getMimeType=u,e.fetchUncompressedZipEntryFromNetwork=async function(t,e,n,i){const c=n.offset,f=n.nextOffset-1;(0,o.log)("fetching zip chunk from",{zipUrl:t,rangeStart:c,rangeEnd:f});const h=await fetch(t,{headers:{Range:`bytes=${c}-${f}`}});if(206!==h.status)return{ok:!1,response:l(`ZIP entry fetch for "${e}" expected HTTP 206 Partial Content from ${t}, got ${h.status}`,h.status>=400?h.status:502)};const p=await h.arrayBuffer(),d=new DataView(p);if(d.getUint32(0,!0)!==s.LOCAL_FILE_HEADER_SIG)return{ok:!1,response:l(`Invalid local file header for "${e}" in ${t} (expected ZIP signature 0x04034b50)`,500)};const g=30+d.getUint16(26,!0)+d.getUint16(28,!0);if(g>p.byteLength||g+n.compressedSize>p.byteLength)return{ok:!1,response:l(`Corrupt ZIP entry "${e}" in ${t}: dataStart=${g}, compressedSize=${n.compressedSize}, bufferLength=${p.byteLength}`,500)};const v=new Uint8Array(p,g,n.compressedSize);let m;if(8===n.compression)try{m=(0,r.inflateSync)(v)}catch(n){return(0,o.warn)("inflateSync failed",{zipUrl:t,manifestKey:e,error:n}),{ok:!1,response:l(`Failed to inflate DEFLATE-compressed entry "${e}" in ${t}`,500)}}else{if(0!==n.compression)return{ok:!1,response:l(`Unsupported compression method ${n.compression} for "${e}" in ${t} (only stored/0 and DEFLATE/8 are supported)`,500)};m=v}const y=u(e),w=new Blob([m],{type:y});return await(0,a.putCachedFullAssetIfAbsent)(i,w),{ok:!0,blob:w}};const r=n(845),i=n(257),s=n(950),o=n(842),a=n(752);function l(t,e){return new Response((0,i.formatZipPeekError)(t),{status:e,headers:{"Access-Control-Allow-Origin":"*"}})}function u(t){const e=t.split(".").pop()?.toLowerCase();return e?s.MIME_TYPES[e]??"application/octet-stream":"application/octet-stream"}},183(t,e){function n(t){try{return decodeURIComponent(t)}catch{return t}}Object.defineProperty(e,"__esModule",{value:!0}),e.isZipPackage=function(t){try{return new URL(t).pathname.endsWith(".zip")}catch{return t.split("?")[0].endsWith(".zip")}},e.normalizeZipUrl=function(t,e={}){const{stripCacheBuster:n=!0,stripHash:r=!0}=e,i=t=>r?t.split("#")[0]:t;if(!n)return i(t);const s=t.indexOf("?");if(-1===s)return i(t);const o=t.indexOf("#",s),a=t.substring(0,s),l=-1===o?t.substring(s+1):t.substring(s+1,o),u=r||-1===o?"":t.substring(o),c=l.split("&").filter(t=>{const e=t.indexOf("=");return"t"!==(-1===e?t:t.substring(0,e))});return 0===c.length?a+u:a+"?"+c.join("&")+u},e.normalizeZipEntryPath=function(t){let e=t.replace(/\\/g,"/");for(;e.startsWith("/");)e=e.slice(1);return e},e.parseZipAssetRequest=function(t){const e=/\.zip([/?])/.exec(t);if(!e)return null;const r=e.index+4,i=e[1],s=t.substring(0,r);if("/"===i){const e=t.substring(r+1),i=e.indexOf("?"),o=-1===i?e:e.substring(0,i);return""===o?null:{zipUrl:s,internalPath:n(o)}}const o=t.substring(r),a=o.indexOf("/");if(-1===a)return null;const l=o.substring(0,a),u=o.substring(a+1),c=u.indexOf("?"),f=-1===c?u:u.substring(0,c);return""===f?null:{zipUrl:s+l,internalPath:n(f)}},e.canonicalZipAssetRequestUrl=function(t,e){return t+"/"+encodeURIComponent(e)}},845(t,e){var n={},r=function(t,e,r,i,s){var o=new Worker(n[e]||(n[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(t){var e=t.data,n=e.$e$;if(n){var r=new Error(n[0]);r.code=n[1],r.stack=n[2],s(r,null)}else s(null,e)},o.postMessage(r,i),o},i=Uint8Array,s=Uint16Array,o=Int32Array,a=new i([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),l=new i([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),u=new i([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=function(t,e){for(var n=new s(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new o(n[30]);for(r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},f=c(a,2),h=f.b,p=f.r;h[28]=258,p[258]=28;for(var d=c(l,0),g=d.b,v=d.r,m=new s(32768),y=0;y<32768;++y){var w=(43690&y)>>1|(21845&y)<<1;w=(61680&(w=(52428&w)>>2|(13107&w)<<2))>>4|(3855&w)<<4,m[y]=((65280&w)>>8|(255&w)<<8)>>1}var E=function(t,e,n){for(var r=t.length,i=0,o=new s(e);i<r;++i)t[i]&&++o[t[i]-1];var a,l=new s(e);for(i=1;i<e;++i)l[i]=l[i-1]+o[i-1]<<1;if(n){a=new s(1<<e);var u=15-e;for(i=0;i<r;++i)if(t[i])for(var c=i<<4|t[i],f=e-t[i],h=l[t[i]-1]++<<f,p=h|(1<<f)-1;h<=p;++h)a[m[h]>>u]=c}else for(a=new s(r),i=0;i<r;++i)t[i]&&(a[i]=m[l[t[i]-1]++]>>15-t[i]);return a},A=new i(288);for(y=0;y<144;++y)A[y]=8;for(y=144;y<256;++y)A[y]=9;for(y=256;y<280;++y)A[y]=7;for(y=280;y<288;++y)A[y]=8;var C=new i(32);for(y=0;y<32;++y)C[y]=5;var b=E(A,9,0),_=E(A,9,1),z=E(C,5,0),S=E(C,5,1),M=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},U=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&n},Z=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},I=function(t){return(t+7)/8|0},T=function(t,e,n){return(null==e||e<0)&&(e=0),(null==n||n>t.length)&&(n=t.length),new i(t.subarray(e,n))};e.FlateErrorCode={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14};var P=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],R=function(t,e,n){var r=new Error(e||P[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,R),!n)throw r;return r},k=function(t,e,n,r){var s=t.length,o=r?r.length:0;if(!s||e.f&&!e.l)return n||new i(0);var c=!n,f=c||2!=e.i,p=e.i;c&&(n=new i(3*s));var d=function(t){var e=n.length;if(t>e){var r=new i(Math.max(2*e,t));r.set(n),n=r}},v=e.f||0,m=e.p||0,y=e.b||0,w=e.l,A=e.d,C=e.m,b=e.n,z=8*s;do{if(!w){v=U(t,m,1);var P=U(t,m+1,3);if(m+=3,!P){var k=t[(G=I(m)+4)-4]|t[G-3]<<8,L=G+k;if(L>s){p&&R(0);break}f&&d(y+k),n.set(t.subarray(G,L),y),e.b=y+=k,e.p=m=8*L,e.f=v;continue}if(1==P)w=_,A=S,C=9,b=5;else if(2==P){var x=U(t,m,31)+257,F=U(t,m+10,15)+4,O=x+U(t,m+5,31)+1;m+=14;for(var D=new i(O),N=new i(19),H=0;H<F;++H)N[u[H]]=U(t,m+3*H,7);m+=3*F;var $=M(N),j=(1<<$)-1,q=E(N,$,1);for(H=0;H<O;){var G,K=q[U(t,m,j)];if(m+=15&K,(G=K>>4)<16)D[H++]=G;else{var W=0,Y=0;for(16==G?(Y=3+U(t,m,3),m+=2,W=D[H-1]):17==G?(Y=3+U(t,m,7),m+=3):18==G&&(Y=11+U(t,m,127),m+=7);Y--;)D[H++]=W}}var X=D.subarray(0,x),B=D.subarray(x);C=M(X),b=M(B),w=E(X,C,1),A=E(B,b,1)}else R(1);if(m>z){p&&R(0);break}}f&&d(y+131072);for(var V=(1<<C)-1,J=(1<<b)-1,Q=m;;Q=m){var tt=(W=w[Z(t,m)&V])>>4;if((m+=15&W)>z){p&&R(0);break}if(W||R(2),tt<256)n[y++]=tt;else{if(256==tt){Q=m,w=null;break}var et=tt-254;if(tt>264){var nt=a[H=tt-257];et=U(t,m,(1<<nt)-1)+h[H],m+=nt}var rt=A[Z(t,m)&J],it=rt>>4;if(rt||R(3),m+=15&rt,B=g[it],it>3&&(nt=l[it],B+=Z(t,m)&(1<<nt)-1,m+=nt),m>z){p&&R(0);break}f&&d(y+131072);var st=y+et;if(y<B){var ot=o-B,at=Math.min(B,st);for(ot+y<0&&R(3);y<at;++y)n[y]=r[ot+y]}for(;y<st;++y)n[y]=n[y-B]}}e.l=w,e.p=Q,e.b=y,e.f=v,w&&(v=1,e.m=C,e.d=A,e.n=b)}while(!v);return y!=n.length&&c?T(n,0,y):n.subarray(0,y)},L=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},x=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},F=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var o=n.length,a=n.slice();if(!o)return{t:q,l:0};if(1==o){var l=new i(n[0].s+1);return l[n[0].s]=1,{t:l,l:1}}n.sort(function(t,e){return t.f-e.f}),n.push({s:-1,f:25001});var u=n[0],c=n[1],f=0,h=1,p=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};h!=o-1;)u=n[n[f].f<n[p].f?f++:p++],c=n[f!=h&&n[f].f<n[p].f?f++:p++],n[h++]={s:-1,f:u.f+c.f,l:u,r:c};var d=a[0].s;for(r=1;r<o;++r)a[r].s>d&&(d=a[r].s);var g=new s(d+1),v=O(n[h-1],g,0);if(v>e){r=0;var m=0,y=v-e,w=1<<y;for(a.sort(function(t,e){return g[e.s]-g[t.s]||t.f-e.f});r<o;++r){var E=a[r].s;if(!(g[E]>e))break;m+=w-(1<<v-g[E]),g[E]=e}for(m>>=y;m>0;){var A=a[r].s;g[A]<e?m-=1<<e-g[A]++-1:++r}for(;r>=0&&m;--r){var C=a[r].s;g[C]==e&&(--g[C],++m)}v=e}return{t:new i(g),l:v}},O=function(t,e,n){return-1==t.s?Math.max(O(t.l,e,n+1),O(t.r,e,n+1)):e[t.s]=n},D=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new s(++e),r=0,i=t[0],o=1,a=function(t){n[r++]=t},l=1;l<=e;++l)if(t[l]==i&&l!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=t[l]}return{c:n.subarray(0,r),n:e}},N=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},H=function(t,e,n){var r=n.length,i=I(e+2);t[i]=255&r,t[i+1]=r>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<r;++s)t[i+s+4]=n[s];return 8*(i+4+r)},$=function(t,e,n,r,i,o,c,f,h,p,d){L(e,d++,n),++i[256];for(var g=F(i,15),v=g.t,m=g.l,y=F(o,15),w=y.t,_=y.l,S=D(v),M=S.c,U=S.n,Z=D(w),I=Z.c,T=Z.n,P=new s(19),R=0;R<M.length;++R)++P[31&M[R]];for(R=0;R<I.length;++R)++P[31&I[R]];for(var k=F(P,7),O=k.t,$=k.l,j=19;j>4&&!O[u[j-1]];--j);var q,G,K,W,Y=p+5<<3,X=N(i,A)+N(o,C)+c,B=N(i,v)+N(o,w)+c+14+3*j+N(P,O)+2*P[16]+3*P[17]+7*P[18];if(h>=0&&Y<=X&&Y<=B)return H(e,d,t.subarray(h,h+p));if(L(e,d,1+(B<X)),d+=2,B<X){q=E(v,m,0),G=v,K=E(w,_,0),W=w;var V=E(O,$,0);for(L(e,d,U-257),L(e,d+5,T-1),L(e,d+10,j-4),d+=14,R=0;R<j;++R)L(e,d+3*R,O[u[R]]);d+=3*j;for(var J=[M,I],Q=0;Q<2;++Q){var tt=J[Q];for(R=0;R<tt.length;++R){var et=31&tt[R];L(e,d,V[et]),d+=O[et],et>15&&(L(e,d,tt[R]>>5&127),d+=tt[R]>>12)}}}else q=b,G=A,K=z,W=C;for(R=0;R<f;++R){var nt=r[R];if(nt>255){x(e,d,q[257+(et=nt>>18&31)]),d+=G[et+257],et>7&&(L(e,d,nt>>23&31),d+=a[et]);var rt=31&nt;x(e,d,K[rt]),d+=W[rt],rt>3&&(x(e,d,nt>>5&8191),d+=l[rt])}else x(e,d,q[nt]),d+=G[nt]}return x(e,d,q[256]),d+G[256]},j=new o([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),q=new i(0),G=function(t,e,n,r,u,c){var f=c.z||t.length,h=new i(r+f+5*(1+Math.ceil(f/7e3))+u),d=h.subarray(r,h.length-u),g=c.l,m=7&(c.r||0);if(e){m&&(d[0]=c.r>>3);for(var y=j[e-1],w=y>>13,E=8191&y,A=(1<<n)-1,C=c.p||new s(32768),b=c.h||new s(A+1),_=Math.ceil(n/3),z=2*_,S=function(e){return(t[e]^t[e+1]<<_^t[e+2]<<z)&A},M=new o(25e3),U=new s(288),Z=new s(32),P=0,R=0,k=c.i||0,L=0,x=c.w||0,F=0;k+2<f;++k){var O=S(k),D=32767&k,N=b[O];if(C[D]=N,b[O]=D,x<=k){var q=f-k;if((P>7e3||L>24576)&&(q>423||!g)){m=$(t,d,0,M,U,Z,R,L,F,k-F,m),L=P=R=0,F=k;for(var G=0;G<286;++G)U[G]=0;for(G=0;G<30;++G)Z[G]=0}var K=2,W=0,Y=E,X=D-N&32767;if(q>2&&O==S(k-X))for(var B=Math.min(w,q)-1,V=Math.min(32767,k),J=Math.min(258,q);X<=V&&--Y&&D!=N;){if(t[k+K]==t[k+K-X]){for(var Q=0;Q<J&&t[k+Q]==t[k+Q-X];++Q);if(Q>K){if(K=Q,W=X,Q>B)break;var tt=Math.min(X,Q-2),et=0;for(G=0;G<tt;++G){var nt=k-X+G&32767,rt=nt-C[nt]&32767;rt>et&&(et=rt,N=nt)}}}X+=(D=N)-(N=C[D])&32767}if(W){M[L++]=268435456|p[K]<<18|v[W];var it=31&p[K],st=31&v[W];R+=a[it]+l[st],++U[257+it],++Z[st],x=k+K,++P}else M[L++]=t[k],++U[t[k]]}}for(k=Math.max(k,x);k<f;++k)M[L++]=t[k],++U[t[k]];m=$(t,d,g,M,U,Z,R,L,F,k-F,m),g||(c.r=7&m|d[m/8|0]<<3,m-=7,c.h=b,c.p=C,c.i=k,c.w=x)}else{for(k=c.w||0;k<f+g;k+=65535){var ot=k+65535;ot>=f&&(d[m/8|0]=g,ot=f),m=H(d,m+1,t.subarray(k,ot))}c.i=f}return T(h,0,r+I(m)+u)},K=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&-306674912)^n>>>1;t[e]=n}return t}(),W=function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=K[255&n^e[r]]^n>>>8;t=n},d:function(){return~t}}},Y=function(){var t=1,e=0;return{p:function(n){for(var r=t,i=e,s=0|n.length,o=0;o!=s;){for(var a=Math.min(o+2655,s);o<a;++o)i+=r+=n[o];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}t=r,e=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(e%=65521))<<8|e>>8}}},X=function(t,e,n,r,s){if(!s&&(s={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),a=new i(o.length+t.length);a.set(o),a.set(t,o.length),t=a,s.w=o.length}return G(t,null==e.level?6:e.level,null==e.mem?s.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+e.mem,n,r,s)},B=function(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n},V=function(t,e,n){for(var r=t(),i=t.toString(),s=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<r.length;++o){var a=r[o],l=s[o];if("function"==typeof a){e+=";"+l+"=";var u=a.toString();if(a.prototype)if(-1!=u.indexOf("[native code]")){var c=u.indexOf(" ",8)+1;e+=u.slice(c,u.indexOf("(",c))}else for(var f in e+=u,a.prototype)e+=";"+l+".prototype."+f+"="+a.prototype[f].toString();else e+=u}else n[l]=a}return e},J=[],Q=function(t,e,n,i){if(!J[n]){for(var s="",o={},a=t.length-1,l=0;l<a;++l)s=V(t[l],s,o);J[n]={c:V(t[a],s,o),e:o}}var u=B({},J[n].e);return r(J[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e}(u),i)},tt=function(){return[i,s,o,a,l,u,h,g,_,S,m,P,E,M,U,Z,I,T,R,k,Zt,ot,at]},et=function(){return[i,s,o,a,l,u,p,v,b,A,z,C,m,j,q,E,L,x,F,O,D,N,H,$,I,T,G,X,zt,ot]},nt=function(){return[gt,yt,dt,W,K]},rt=function(){return[vt,mt]},it=function(){return[wt,dt,Y]},st=function(){return[Et]},ot=function(t){return postMessage(t,[t.buffer])},at=function(t){return t&&{out:t.size&&new i(t.size),dictionary:t.dictionary}},lt=function(t,e,n,r,i,s){var o=Q(n,r,i,function(t,e){o.terminate(),s(t,e)});return o.postMessage([t,e],e.consume?[t.buffer]:[]),function(){o.terminate()}},ut=function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){e.data.length?(t.push(e.data[0],e.data[1]),postMessage([e.data[0].length])):t.flush()}},ct=function(t,e,n,r,i,s,o){var a,l=Q(t,r,i,function(t,n){t?(l.terminate(),e.ondata.call(e,t)):Array.isArray(n)?1==n.length?(e.queuedSize-=n[0],e.ondrain&&e.ondrain(n[0])):(n[1]&&l.terminate(),e.ondata.call(e,t,n[0],n[1])):o(n)});l.postMessage(n),e.queuedSize=0,e.push=function(t,n){e.ondata||R(5),a&&e.ondata(R(4,0,1),null,!!n),e.queuedSize+=t.length,l.postMessage([t,a=n],[t.buffer])},e.terminate=function(){l.terminate()},s&&(e.flush=function(){l.postMessage([])})},ft=function(t,e){return t[e]|t[e+1]<<8},ht=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},pt=function(t,e){return ht(t,e)+4294967296*ht(t,e+4)},dt=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},gt=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&dt(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var r=0;r<=n.length;++r)t[r+10]=n.charCodeAt(r)}},vt=function(t){31==t[0]&&139==t[1]&&8==t[2]||R(6,"invalid gzip data");var e=t[3],n=10;4&e&&(n+=2+(t[10]|t[11]<<8));for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(2&e)},mt=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},yt=function(t){return 10+(t.filename?t.filename.length+1:0)},wt=function(t,e){var n=e.level,r=0==n?0:n<6?1:9==n?3:2;if(t[0]=120,t[1]=r<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=Y();i.p(e.dictionary),dt(t,2,i.d())}},Et=function(t,e){return(8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31)&&R(6,"invalid zlib data"),(t[1]>>5&1)==+!e&&R(6,"invalid zlib data: "+(32&t[1]?"need":"unexpected")+" dictionary"),2+(t[1]>>3&4)};function At(t,e){return"function"==typeof t&&(e=t,t={}),this.ondata=e,t}var Ct=function(){function t(t,e){if("function"==typeof t&&(e=t,t={}),this.ondata=e,this.o=t||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new i(98304),this.o.dictionary){var n=this.o.dictionary.subarray(-32768);this.b.set(n,32768-n.length),this.s.i=32768-n.length}}return t.prototype.p=function(t,e){this.ondata(X(t,this.o,0,0,this.s),e)},t.prototype.push=function(t,e){this.ondata||R(5),this.s.l&&R(4);var n=t.length+this.s.z;if(n>this.b.length){if(n>2*this.b.length-32768){var r=new i(-32768&n);r.set(this.b.subarray(0,this.s.z)),this.b=r}var s=this.b.length-this.s.z;this.b.set(t.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(t.subarray(s),32768),this.s.z=t.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(t,this.s.z),this.s.z+=t.length;this.s.l=1&e,(this.s.z>this.s.w+8191||e)&&(this.p(this.b,e||!1),this.s.w=this.s.i,this.s.i-=2)},t.prototype.flush=function(){this.ondata||R(5),this.s.l&&R(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},t}();e.Deflate=Ct;var bt=function(){return function(t,e){ct([et,function(){return[ut,Ct]}],this,At.call(this,t,e),function(t){var e=new Ct(t.data);onmessage=ut(e)},6,1)}}();function _t(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&R(7),lt(t,e,[et],function(t){return ot(zt(t.data[0],t.data[1]))},0,n)}function zt(t,e){return X(t,e||{},0,0)}e.AsyncDeflate=bt,e.deflate=_t,e.deflateSync=zt;var St=function(){function t(t,e){"function"==typeof t&&(e=t,t={}),this.ondata=e;var n=t&&t.dictionary&&t.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new i(32768),this.p=new i(0),n&&this.o.set(n)}return t.prototype.e=function(t){if(this.ondata||R(5),this.d&&R(4),this.p.length){if(t.length){var e=new i(this.p.length+t.length);e.set(this.p),e.set(t,this.p.length),this.p=e}}else this.p=t},t.prototype.c=function(t){this.s.i=+(this.d=t||!1);var e=this.s.b,n=k(this.p,this.s,this.o);this.ondata(T(n,e,this.s.b),this.d),this.o=T(n,this.s.b-32768),this.s.b=this.o.length,this.p=T(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}();e.Inflate=St;var Mt=function(){return function(t,e){ct([tt,function(){return[ut,St]}],this,At.call(this,t,e),function(t){var e=new St(t.data);onmessage=ut(e)},7,0)}}();function Ut(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&R(7),lt(t,e,[tt],function(t){return ot(Zt(t.data[0],at(t.data[1])))},1,n)}function Zt(t,e){return k(t,{i:2},e&&e.out,e&&e.dictionary)}e.AsyncInflate=Mt,e.inflate=Ut,e.inflateSync=Zt;var It=function(){function t(t,e){this.c=W(),this.l=0,this.v=1,Ct.call(this,t,e)}return t.prototype.push=function(t,e){this.c.p(t),this.l+=t.length,Ct.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){var n=X(t,this.o,this.v&&yt(this.o),e&&8,this.s);this.v&&(gt(n,this.o),this.v=0),e&&(dt(n,n.length-8,this.c.d()),dt(n,n.length-4,this.l)),this.ondata(n,e)},t.prototype.flush=function(){Ct.prototype.flush.call(this)},t}();e.Gzip=It,e.Compress=It;var Tt=function(){return function(t,e){ct([et,nt,function(){return[ut,Ct,It]}],this,At.call(this,t,e),function(t){var e=new It(t.data);onmessage=ut(e)},8,1)}}();function Pt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&R(7),lt(t,e,[et,nt,function(){return[Rt]}],function(t){return ot(Rt(t.data[0],t.data[1]))},2,n)}function Rt(t,e){e||(e={});var n=W(),r=t.length;n.p(t);var i=X(t,e,yt(e),8),s=i.length;return gt(i,e),dt(i,s-8,n.d()),dt(i,s-4,r),i}e.AsyncGzip=Tt,e.AsyncCompress=Tt,e.gzip=Pt,e.compress=Pt,e.gzipSync=Rt,e.compressSync=Rt;var kt=function(){function t(t,e){this.v=1,this.r=0,St.call(this,t,e)}return t.prototype.push=function(t,e){if(St.prototype.e.call(this,t),this.r+=t.length,this.v){var n=this.p.subarray(this.v-1),r=n.length>3?vt(n):4;if(r>n.length){if(!e)return}else this.v>1&&this.onmember&&this.onmember(this.r-n.length);this.p=n.subarray(r),this.v=0}St.prototype.c.call(this,e),!this.s.f||this.s.l||e||(this.v=I(this.s.p)+9,this.s={i:0},this.o=new i(0),this.push(new i(0),e))},t}();e.Gunzip=kt;var Lt=function(){return function(t,e){var n=this;ct([tt,rt,function(){return[ut,St,kt]}],this,At.call(this,t,e),function(t){var e=new kt(t.data);e.onmember=function(t){return postMessage(t)},onmessage=ut(e)},9,0,function(t){return n.onmember&&n.onmember(t)})}}();function xt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&R(7),lt(t,e,[tt,rt,function(){return[Ft]}],function(t){return ot(Ft(t.data[0],t.data[1]))},3,n)}function Ft(t,e){var n=vt(t);return n+8>t.length&&R(6,"invalid gzip data"),k(t.subarray(n,-8),{i:2},e&&e.out||new i(mt(t)),e&&e.dictionary)}e.AsyncGunzip=Lt,e.gunzip=xt,e.gunzipSync=Ft;var Ot=function(){function t(t,e){this.c=Y(),this.v=1,Ct.call(this,t,e)}return t.prototype.push=function(t,e){this.c.p(t),Ct.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){var n=X(t,this.o,this.v&&(this.o.dictionary?6:2),e&&4,this.s);this.v&&(wt(n,this.o),this.v=0),e&&dt(n,n.length-4,this.c.d()),this.ondata(n,e)},t.prototype.flush=function(){Ct.prototype.flush.call(this)},t}();e.Zlib=Ot;var Dt=function(){return function(t,e){ct([et,it,function(){return[ut,Ct,Ot]}],this,At.call(this,t,e),function(t){var e=new Ot(t.data);onmessage=ut(e)},10,1)}}();function Nt(t,e){e||(e={});var n=Y();n.p(t);var r=X(t,e,e.dictionary?6:2,4);return wt(r,e),dt(r,r.length-4,n.d()),r}e.AsyncZlib=Dt,e.zlib=function(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&R(7),lt(t,e,[et,it,function(){return[Nt]}],function(t){return ot(Nt(t.data[0],t.data[1]))},4,n)},e.zlibSync=Nt;var Ht=function(){function t(t,e){St.call(this,t,e),this.v=t&&t.dictionary?2:1}return t.prototype.push=function(t,e){if(St.prototype.e.call(this,t),this.v){if(this.p.length<6&&!e)return;this.p=this.p.subarray(Et(this.p,this.v-1)),this.v=0}e&&(this.p.length<4&&R(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),St.prototype.c.call(this,e)},t}();e.Unzlib=Ht;var $t=function(){return function(t,e){ct([tt,st,function(){return[ut,St,Ht]}],this,At.call(this,t,e),function(t){var e=new Ht(t.data);onmessage=ut(e)},11,0)}}();function jt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&R(7),lt(t,e,[tt,st,function(){return[qt]}],function(t){return ot(qt(t.data[0],at(t.data[1])))},5,n)}function qt(t,e){return k(t.subarray(Et(t,e&&e.dictionary),-4),{i:2},e&&e.out,e&&e.dictionary)}e.AsyncUnzlib=$t,e.unzlib=jt,e.unzlibSync=qt;var Gt=function(){function t(t,e){this.o=At.call(this,t,e)||{},this.G=kt,this.I=St,this.Z=Ht}return t.prototype.i=function(){var t=this;this.s.ondata=function(e,n){t.ondata(e,n)}},t.prototype.push=function(t,e){if(this.ondata||R(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new i(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length)}else this.p=t;this.p.length>2&&(this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(this.o):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,e),this.p=null)}},t}();e.Decompress=Gt;var Kt=function(){function t(t,e){Gt.call(this,t,e),this.queuedSize=0,this.G=Lt,this.I=Mt,this.Z=$t}return t.prototype.i=function(){var t=this;this.s.ondata=function(e,n,r){t.ondata(e,n,r)},this.s.ondrain=function(e){t.queuedSize-=e,t.ondrain&&t.ondrain(e)}},t.prototype.push=function(t,e){this.queuedSize+=t.length,Gt.prototype.push.call(this,t,e)},t}();e.AsyncDecompress=Kt,e.decompress=function(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&R(7),31==t[0]&&139==t[1]&&8==t[2]?xt(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Ut(t,e,n):jt(t,e,n)},e.decompressSync=function(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?Ft(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Zt(t,e):qt(t,e)};var Wt=function(t,e,n,r){for(var s in t){var o=t[s],a=e+s,l=r;Array.isArray(o)&&(l=B(r,o[1]),o=o[0]),o instanceof i?n[a]=[o,l]:(n[a+="/"]=[new i(0),l],Wt(o,a,n,r))}},Yt="undefined"!=typeof TextEncoder&&new TextEncoder,Xt="undefined"!=typeof TextDecoder&&new TextDecoder,Bt=0;try{Xt.decode(q,{stream:!0}),Bt=1}catch(t){}var Vt=function(t){for(var e="",n=0;;){var r=t[n++],i=(r>127)+(r>223)+(r>239);if(n+i>t.length)return{s:e,r:T(t,n-1)};i?3==i?(r=((15&r)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,e+=String.fromCharCode(55296|r>>10,56320|1023&r)):e+=1&i?String.fromCharCode((31&r)<<6|63&t[n++]):String.fromCharCode((15&r)<<12|(63&t[n++])<<6|63&t[n++]):e+=String.fromCharCode(r)}},Jt=function(){function t(t){this.ondata=t,Bt?this.t=new TextDecoder:this.p=q}return t.prototype.push=function(t,e){if(this.ondata||R(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&R(8),this.t=null));this.p||R(4);var n=new i(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var r=Vt(n),s=r.s,o=r.r;e?(o.length&&R(8),this.p=null):this.p=o,this.ondata(s,e)},t}();e.DecodeUTF8=Jt;var Qt=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){this.ondata||R(5),this.d&&R(4),this.ondata(te(t),this.d=e||!1)},t}();function te(t,e){if(e){for(var n=new i(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(Yt)return Yt.encode(t);var s=t.length,o=new i(t.length+(t.length>>1)),a=0,l=function(t){o[a++]=t};for(r=0;r<s;++r){if(a+5>o.length){var u=new i(a+8+(s-r<<1));u.set(o),o=u}var c=t.charCodeAt(r);c<128||e?l(c):c<2048?(l(192|c>>6),l(128|63&c)):c>55295&&c<57344?(l(240|(c=65536+(1047552&c)|1023&t.charCodeAt(++r))>>18),l(128|c>>12&63),l(128|c>>6&63),l(128|63&c)):(l(224|c>>12),l(128|c>>6&63),l(128|63&c))}return T(o,0,a)}function ee(t,e){if(e){for(var n="",r=0;r<t.length;r+=16384)n+=String.fromCharCode.apply(null,t.subarray(r,r+16384));return n}if(Xt)return Xt.decode(t);var i=Vt(t),s=i.s;return(n=i.r).length&&R(8),s}e.EncodeUTF8=Qt,e.strToU8=te,e.strFromU8=ee;var ne=function(t){return 1==t?3:t<6?2:9==t?1:0},re=function(t,e){return e+30+ft(t,e+26)+ft(t,e+28)},ie=function(t,e,n){var r=ft(t,e+28),i=ee(t.subarray(e+46,e+46+r),!(2048&ft(t,e+8))),s=e+46+r,o=ht(t,e+20),a=n&&4294967295==o?se(t,s):[o,ht(t,e+24),ht(t,e+42)],l=a[0],u=a[1],c=a[2];return[ft(t,e+10),l,u,i,s+ft(t,e+30)+ft(t,e+32),c]},se=function(t,e){for(;1!=ft(t,e);e+=4+ft(t,e+2));return[pt(t,e+12),pt(t,e+4),pt(t,e+20)]},oe=function(t){var e=0;if(t)for(var n in t){var r=t[n].length;r>65535&&R(9),e+=r+4}return e},ae=function(t,e,n,r,i,s,o,a){var l=r.length,u=n.extra,c=a&&a.length,f=oe(u);dt(t,e,null!=o?33639248:67324752),e+=4,null!=o&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(s<0&&8),t[e++]=i&&8,t[e++]=255&n.compression,t[e++]=n.compression>>8;var h=new Date(null==n.mtime?Date.now():n.mtime),p=h.getFullYear()-1980;if((p<0||p>119)&&R(10),dt(t,e,p<<25|h.getMonth()+1<<21|h.getDate()<<16|h.getHours()<<11|h.getMinutes()<<5|h.getSeconds()>>1),e+=4,-1!=s&&(dt(t,e,n.crc),dt(t,e+4,s<0?-s-2:s),dt(t,e+8,n.size)),dt(t,e+12,l),dt(t,e+14,f),e+=16,null!=o&&(dt(t,e,c),dt(t,e+6,n.attrs),dt(t,e+10,o),e+=14),t.set(r,e),e+=l,f)for(var d in u){var g=u[d],v=g.length;dt(t,e,+d),dt(t,e+2,v),t.set(g,e+4),e+=4+v}return c&&(t.set(a,e),e+=c),e},le=function(t,e,n,r,i){dt(t,e,101010256),dt(t,e+8,n),dt(t,e+10,n),dt(t,e+12,r),dt(t,e+16,i)},ue=function(){function t(t){this.filename=t,this.c=W(),this.size=0,this.compression=0}return t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){this.ondata||R(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}();e.ZipPassThrough=ue;var ce=function(){function t(t,e){var n=this;e||(e={}),ue.call(this,t),this.d=new Ct(e,function(t,e){n.ondata(null,t,e)}),this.compression=8,this.flag=ne(e.level)}return t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(t){this.ondata(t,null,e)}},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}();e.ZipDeflate=ce;var fe=function(){function t(t,e){var n=this;e||(e={}),ue.call(this,t),this.d=new bt(e,function(t,e,r){n.ondata(t,e,r)}),this.compression=8,this.flag=ne(e.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}();e.AsyncZipDeflate=fe;var he=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(this.ondata||R(5),2&this.d)this.ondata(R(4+8*(1&this.d),0,1),null,!1);else{var n=te(t.filename),r=n.length,s=t.comment,o=s&&te(s),a=r!=t.filename.length||o&&s.length!=o.length,l=r+oe(t.extra)+30;r>65535&&this.ondata(R(11,0,1),null,!1);var u=new i(l);ae(u,0,t,n,a,-1);var c=[u],f=function(){for(var t=0,n=c;t<n.length;t++){var r=n[t];e.ondata(null,r,!1)}c=[]},h=this.d;this.d=0;var p=this.u.length,d=B(t,{f:n,u:a,o,t:function(){t.terminate&&t.terminate()},r:function(){if(f(),h){var t=e.u[p+1];t?t.r():e.d=1}h=1}}),g=0;t.ondata=function(n,r,s){if(n)e.ondata(n,r,s),e.terminate();else if(g+=r.length,c.push(r),s){var o=new i(16);dt(o,0,134695760),dt(o,4,t.crc),dt(o,8,g),dt(o,12,t.size),c.push(o),d.c=g,d.b=l+g+16,d.crc=t.crc,d.size=t.size,h&&d.r(),h=1}else h&&f()},this.u.push(d)}},t.prototype.end=function(){var t=this;2&this.d?this.ondata(R(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&t.d&&(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3)},t.prototype.e=function(){for(var t=0,e=0,n=0,r=0,s=this.u;r<s.length;r++)n+=46+(u=s[r]).f.length+oe(u.extra)+(u.o?u.o.length:0);for(var o=new i(n+22),a=0,l=this.u;a<l.length;a++){var u=l[a];ae(o,t,u,u.f,u.u,-u.c-2,e,u.o),t+=46+u.f.length+oe(u.extra)+(u.o?u.o.length:0),e+=u.b}le(o,t,this.u.length,n,e),this.ondata(null,o,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++)e[t].t();this.d=2},t}();e.Zip=he,e.zip=function(t,e,n){n||(n=e,e={}),"function"!=typeof n&&R(7);var r={};Wt(t,"",r,e);var s=Object.keys(r),o=s.length,a=0,l=0,u=o,c=new Array(o),f=[],h=function(){for(var t=0;t<f.length;++t)f[t]()},p=function(t,e){me(function(){n(t,e)})};me(function(){p=n});var d=function(){var t=new i(l+22),e=a,n=l-a;l=0;for(var r=0;r<u;++r){var s=c[r];try{var o=s.c.length;ae(t,l,s,s.f,s.u,o);var f=30+s.f.length+oe(s.extra),h=l+f;t.set(s.c,h),ae(t,a,s,s.f,s.u,o,l,s.m),a+=16+f+(s.m?s.m.length:0),l=h+o}catch(t){return p(t,null)}}le(t,a,c.length,n,e),p(null,t)};o||d();for(var g=function(t){var e=s[t],n=r[e],i=n[0],u=n[1],g=W(),v=i.length;g.p(i);var m=te(e),y=m.length,w=u.comment,E=w&&te(w),A=E&&E.length,C=oe(u.extra),b=0==u.level?0:8,_=function(n,r){if(n)h(),p(n,null);else{var i=r.length;c[t]=B(u,{size:v,crc:g.d(),c:r,f:m,m:E,u:y!=e.length||E&&w.length!=A,compression:b}),a+=30+y+C+i,l+=76+2*(y+C)+(A||0)+i,--o||d()}};if(y>65535&&_(R(11,0,1),null),b)if(v<16e4)try{_(null,zt(i,u))}catch(t){_(t,null)}else f.push(_t(i,u,_));else _(null,i)},v=0;v<u;++v)g(v);return h},e.zipSync=function(t,e){e||(e={});var n={},r=[];Wt(t,"",n,e);var s=0,o=0;for(var a in n){var l=n[a],u=l[0],c=l[1],f=0==c.level?0:8,h=(_=te(a)).length,p=c.comment,d=p&&te(p),g=d&&d.length,v=oe(c.extra);h>65535&&R(11);var m=f?zt(u,c):u,y=m.length,w=W();w.p(u),r.push(B(c,{size:u.length,crc:w.d(),c:m,f:_,m:d,u:h!=a.length||d&&p.length!=g,o:s,compression:f})),s+=30+h+v+y,o+=76+2*(h+v)+(g||0)+y}for(var E=new i(o+22),A=s,C=o-s,b=0;b<r.length;++b){var _=r[b];ae(E,_.o,_,_.f,_.u,_.c.length);var z=30+_.f.length+oe(_.extra);E.set(_.c,_.o+z),ae(E,s,_,_.f,_.u,_.c.length,_.o,_.m),s+=16+z+(_.m?_.m.length:0)}return le(E,s,r.length,C,A),E};var pe=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}();e.UnzipPassThrough=pe;var de=function(){function t(){var t=this;this.i=new St(function(e,n){t.ondata(null,e,n)})}return t.prototype.push=function(t,e){try{this.i.push(t,e)}catch(t){this.ondata(t,null,e)}},t.compression=8,t}();e.UnzipInflate=de;var ge=function(){function t(t,e){var n=this;e<32e4?this.i=new St(function(t,e){n.ondata(null,t,e)}):(this.i=new Mt(function(t,e,r){n.ondata(t,e,r)}),this.terminate=this.i.terminate)}return t.prototype.push=function(t,e){this.i.terminate&&(t=T(t,0)),this.i.push(t,e)},t.compression=8,t}();e.AsyncUnzipInflate=ge;var ve=function(){function t(t){this.onfile=t,this.k=[],this.o={0:pe},this.p=q}return t.prototype.push=function(t,e){var n=this;if(this.onfile||R(5),this.p||R(4),this.c>0){var r=Math.min(this.c,t.length),s=t.subarray(0,r);if(this.c-=r,this.d?this.d.push(s,!this.c):this.k[0].push(s),(t=t.subarray(r)).length)return this.push(t,e)}else{var o=0,a=0,l=void 0,u=void 0;this.p.length?t.length?((u=new i(this.p.length+t.length)).set(this.p),u.set(t,this.p.length)):u=this.p:u=t;for(var c=u.length,f=this.c,h=f&&this.d,p=function(){var t,e=ht(u,a);if(67324752==e){o=1,l=a,d.d=null,d.c=0;var r=ft(u,a+6),i=ft(u,a+8),s=2048&r,h=8&r,p=ft(u,a+26),g=ft(u,a+28);if(c>a+30+p+g){var v=[];d.k.unshift(v),o=2;var m,y=ht(u,a+18),w=ht(u,a+22),E=ee(u.subarray(a+30,a+=30+p),!s);4294967295==y?(t=h?[-2]:se(u,a),y=t[0],w=t[1]):h&&(y=-1),a+=g,d.c=y;var A={name:E,compression:i,start:function(){if(A.ondata||R(5),y){var t=n.o[i];t||A.ondata(R(14,"unknown compression type "+i,1),null,!1),(m=y<0?new t(E):new t(E,y,w)).ondata=function(t,e,n){A.ondata(t,e,n)};for(var e=0,r=v;e<r.length;e++){var s=r[e];m.push(s,!1)}n.k[0]==v&&n.c?n.d=m:m.push(q,!0)}else A.ondata(null,q,!0)},terminate:function(){m&&m.terminate&&m.terminate()}};y>=0&&(A.size=y,A.originalSize=w),d.onfile(A)}return"break"}if(f){if(134695760==e)return l=a+=12+(-2==f&&8),o=3,d.c=0,"break";if(33639248==e)return l=a-=4,o=3,d.c=0,"break"}},d=this;a<c-4&&"break"!==p();++a);if(this.p=q,f<0){var g=o?u.subarray(0,l-12-(-2==f&&8)-(134695760==ht(u,l-16)&&4)):u.subarray(0,a);h?h.push(g,!!o):this.k[+(2==o)].push(g)}if(2&o)return this.push(u.subarray(a),e);this.p=u.subarray(a)}e&&(this.c&&R(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}();e.Unzip=ve;var me="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()};e.unzip=function(t,e,n){n||(n=e,e={}),"function"!=typeof n&&R(7);var r=[],s=function(){for(var t=0;t<r.length;++t)r[t]()},o={},a=function(t,e){me(function(){n(t,e)})};me(function(){a=n});for(var l=t.length-22;101010256!=ht(t,l);--l)if(!l||t.length-l>65558)return a(R(13,0,1),null),s;var u=ft(t,l+8);if(u){var c=u,f=ht(t,l+16),h=4294967295==f||65535==c;if(h){var p=ht(t,l-12);(h=101075792==ht(t,p))&&(c=u=ht(t,p+32),f=ht(t,p+48))}for(var d=e&&e.filter,g=function(e){var n=ie(t,f,h),l=n[0],c=n[1],p=n[2],g=n[3],v=n[4],m=n[5],y=re(t,m);f=v;var w=function(t,e){t?(s(),a(t,null)):(e&&(o[g]=e),--u||a(null,o))};if(!d||d({name:g,size:c,originalSize:p,compression:l}))if(l)if(8==l){var E=t.subarray(y,y+c);if(p<524288||c>.8*p)try{w(null,Zt(E,{out:new i(p)}))}catch(t){w(t,null)}else r.push(Ut(E,{size:p},w))}else w(R(14,"unknown compression type "+l,1),null);else w(null,T(t,y,y+c));else w(null,null)},v=0;v<c;++v)g()}else a(null,{});return s},e.unzipSync=function(t,e){for(var n={},r=t.length-22;101010256!=ht(t,r);--r)(!r||t.length-r>65558)&&R(13);var s=ft(t,r+8);if(!s)return{};var o=ht(t,r+16),a=4294967295==o||65535==s;if(a){var l=ht(t,r-12);(a=101075792==ht(t,l))&&(s=ht(t,l+32),o=ht(t,l+48))}for(var u=e&&e.filter,c=0;c<s;++c){var f=ie(t,o,a),h=f[0],p=f[1],d=f[2],g=f[3],v=f[4],m=f[5],y=re(t,m);o=v,u&&!u({name:g,size:p,originalSize:d,compression:h})||(h?8==h?n[g]=Zt(t.subarray(y,y+p),{out:new i(d)}):R(14,"unknown compression type "+h):n[g]=T(t,y,y+p))}return n}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,n),s.exports}(()=>{const t=n(842),e=n(886),r=n(49);self.addEventListener("install",()=>{self.skipWaiting()}),self.addEventListener("activate",t=>{t.waitUntil(self.clients.claim())}),(0,t.installClientErrorReporting)(),(0,r.installMessageHandler)(),(0,e.installFetchHandler)()})()})();
|
|
1
|
+
(()=>{"use strict";var e={180(e,t){function n(e){const n=e.trim();return n.startsWith(t.ZIP_PEEK_ERROR_PREFIX)?n:`${t.ZIP_PEEK_ERROR_PREFIX} ${n}`}t.ZIP_PEEK_ERROR_PREFIX=void 0,t.formatZipPeekError=n,t.createZipPeekError=function(e){return new Error(n(e))},t.toZipPeekError=function(e){const r=e instanceof Error?e:new Error(String(e));return r.message.startsWith(t.ZIP_PEEK_ERROR_PREFIX)||(r.message=n(r.message)),r},t.errorMessage=function(e){return e instanceof Error?e.message:String(e)},t.ZIP_PEEK_ERROR_PREFIX="[zip-peek-error]"},451(e,t,n){t.ensureAllowedZipUrlsLoaded=async function(){if(s.allowedZipUrlsLoaded)return s.allowedZipUrlsLoaded;const e=(async()=>{try{const e=await caches.open(s.CONFIG_CACHE_NAME),t=await e.match(s.CONFIG_CACHE_KEY);if(!t)return;const n=await t.json();Array.isArray(n.allowedZipUrls)?(0,s.setAllowedZipUrls)(new Set(n.allowedZipUrls.filter(e=>"string"==typeof e).map(e=>(0,r.normalizeZipUrl)(e)))):(0,s.setAllowedZipUrls)(null)}catch(e){(0,i.warn)("failed to load runtime config",e)}})();return(0,s.setAllowedZipUrlsLoaded)(e),e},t.applyRuntimeConfig=async function(e){if(!e)return;let t={...s.runtimeConfig},n=!1;if("string"==typeof e.zipAssetCacheName&&e.zipAssetCacheName.trim()&&(t.zipAssetCacheName=e.zipAssetCacheName,n=!0),"number"==typeof e.assetCacheTtlMs&&Number.isFinite(e.assetCacheTtlMs)&&(t.assetCacheTtlMs=e.assetCacheTtlMs,n=!0),"string"==typeof e.logPrefix&&e.logPrefix.trim()&&(t.logPrefix=e.logPrefix,n=!0),n&&(0,s.setRuntimeConfig)(t),"allowedZipUrls"in e){const t=Array.isArray(e.allowedZipUrls)?e.allowedZipUrls.map(e=>(0,r.normalizeZipUrl)(e)):null;(0,s.setAllowedZipUrls)(t?new Set(t):null),(0,s.setAllowedZipUrlsLoaded)(Promise.resolve()),await async function(e){try{const t=await caches.open(s.CONFIG_CACHE_NAME);await t.put(new Request(s.CONFIG_CACHE_KEY),new Response(JSON.stringify({allowedZipUrls:e}),{headers:{"Content-Type":"application/json"}}))}catch(e){(0,i.warn)("failed to persist runtime config",e)}}(t)}},t.isZipUrlAllowed=function(e){return null===s.allowedZipUrls||s.allowedZipUrls.has(e)};const r=n(134),s=n(167),i=n(777)},919(e,t,n){t.canonicalAssetRequest=function(e,t){return new Request((0,s.canonicalZipAssetRequestUrl)(e,t),{method:"GET"})},t.clearAllZipAssets=async function(){const e=await caches.open(i.runtimeConfig.zipAssetCacheName),t=await e.keys();await Promise.all(t.map(t=>e.delete(t))),await caches.delete(i.CONFIG_CACHE_NAME),i.zipManifests.clear(),i.pendingManifestLoads.clear(),(0,i.setAllowedZipUrlsLoaded)(Promise.resolve())},t.clearZipAssetsExceptAllowed=async function(e){try{const t=new Set(e),n=await caches.open(i.runtimeConfig.zipAssetCacheName),r=await n.keys();for(const e of r){const r=e.url;if(r.includes(i.MANIFEST_CACHE_KEY)){const s=(0,o.zipUrlFromManifestCacheKey)(r);s&&!t.has(s)&&await n.delete(e);continue}const a=(0,s.parseZipAssetRequest)(r);a&&!t.has(a.zipUrl)&&await n.delete(e)}for(const e of i.zipManifests.keys())t.has(e)||i.zipManifests.delete(e)}catch(e){throw(0,r.createZipPeekError)(`Failed to clear zip assets except allowed URLs: ${(0,r.errorMessage)(e)}`)}},t.putCachedFullAssetIfAbsent=async function(e,t){try{const n=await caches.open(i.runtimeConfig.zipAssetCacheName),r=await n.match(e);if(r&&!l(r))return;const s=t.type||"application/octet-stream";await n.put(e,new Response(t,{status:200,headers:{"Content-Type":s,"Content-Length":String(t.size),"Access-Control-Allow-Origin":"*",[i.ASSET_CACHED_AT_HEADER]:String(Date.now())}}))}catch(e){(0,a.warn)("asset cache put failed",e)}},t.readCachedZipAssetIfFresh=async function(e){let t=null,n="network";try{const r=await caches.open(i.runtimeConfig.zipAssetCacheName),s=await r.match(e);if(s)if(l(s))try{await r.delete(e)}catch(e){(0,a.warn)("asset cache delete expired failed",e)}else t=await s.blob(),n="cache-api"}catch(e){(0,a.warn)("asset cache read failed",e)}return{blob:t,assetSource:n}};const r=n(180),s=n(134),i=n(167),a=n(777),o=n(483);function l(e){const t=e.headers.get(i.ASSET_CACHED_AT_HEADER);if(!t)return!0;const n=parseInt(t,10);return!Number.isFinite(n)||Date.now()-n>i.runtimeConfig.assetCacheTtlMs}},705(e,t,n){t.installFetchHandler=function(){self.addEventListener("fetch",e=>{const t=e.request.method;if("GET"!==t&&"HEAD"!==t)return;const n="HEAD"===t,d=(0,s.parseZipAssetRequest)(e.request.url);if(!d)return;const g=(0,s.normalizeZipUrl)(d.zipUrl),m=d.internalPath,w=(0,s.normalizeZipEntryPath)(m);e.respondWith((async()=>{try{if(await(0,i.ensureAllowedZipUrlsLoaded)(),!(0,i.isZipUrlAllowed)(g))return(0,l.warn)("zip URL not allowed",{requestedZipUrl:g}),(0,f.corsErrorResponse)(`ZIP URL not allowed (not in allowedZipUrls): ${g}`,403);let t=o.zipManifests.get(g);if(t||(t=await(0,c.ensureManifestAvailable)(g,e.clientId||void 0)??void 0),!t){const e=Array.from(o.zipManifests.keys());return(0,l.warn)("manifest missing for zipUrl",{requestedZipUrl:g,knownZipUrls:e}),(0,f.corsErrorResponse)(`ZIP manifest not loaded for ${g}. Ensure the ZIP is reachable and supports byte-range requests.`,404)}const r=(0,c.resolveManifestEntry)(t,w);if(!r){const e=Array.from(t.keys()).slice(0,50);return(0,l.warn)("file not in manifest or ambiguous suffix match",{zipUrl:g,internalPathRaw:m,internalPathNormalized:w,manifestSize:t.size,sampleKeys:e}),(0,f.corsErrorResponse)(`File "${m}" not found in ZIP manifest for ${g}`,404)}const{key:s,info:d}=r;s!==w&&(0,l.log)("resolved via suffix match",{requested:w,manifestKey:s});const h=(0,a.canonicalAssetRequest)(g,s);if(n)return function(e,t,n){const r=(0,f.getMimeType)(t),s=(0,c.entryUncompressedSize)(n),i=e.headers.get("range");if(null!==s&&i)return p(null,r,s,"manifest",i);const a={"Content-Type":r,...u("manifest")};return null!==s&&(a["Content-Length"]=s.toString()),new Response(null,{status:200,headers:a})}(e.request,s,d);let{blob:E,assetSource:y}=await(0,a.readCachedZipAssetIfFresh)(h);if(!E){const e=await(0,f.fetchUncompressedZipEntryFromNetwork)(g,s,d,h);if(!e.ok)return e.response;E=e.blob,y="network"}return p(E,E.type,E.size,y,e.request.headers.get("range"))}catch(e){return(0,l.error)("fetch handler failed",{zipUrl:g,internalPath:m,message:(0,r.errorMessage)(e)}),(0,f.corsErrorResponse)(`Failed to serve "${m}" from ${g}: ${(0,r.errorMessage)(e)}`,500)}})())})};const r=n(180),s=n(134),i=n(451),a=n(919),o=n(167),l=n(777),c=n(483),f=n(237);function u(e){return{"Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":o.ASSET_SOURCE_HEADER,[o.ASSET_SOURCE_HEADER]:e}}function p(e,t,n,r,s){if(s){const i=s.replace(/^bytes=/,"");if(i.includes(","))return new Response(null,{status:416,headers:{"Content-Range":`bytes */${n}`,...u(r)}});const[a,o]=i.split("-"),l=""!==a?parseInt(a,10):NaN,c=""!==o?parseInt(o,10):n-1;if(isNaN(l)||isNaN(c)||l<0||c<l||l>=n)return new Response(null,{status:416,headers:{"Content-Range":`bytes */${n}`,...u(r)}});const f=Math.min(c,n-1),p=f-l+1,d=null===e?null:e.slice(l,f+1);return new Response(d,{status:206,headers:{"Content-Type":t,"Content-Range":`bytes ${l}-${f}/${n}`,"Content-Length":p.toString(),"Accept-Ranges":"bytes",...u(r)}})}return new Response(e,{status:200,headers:{"Content-Type":t,"Content-Length":n.toString(),...u(r)}})}},167(e,t){t.CONFIG_CACHE_KEY=t.allowedZipUrlsLoaded=t.allowedZipUrls=t.runtimeConfig=t.pendingManifestLoads=t.zipManifests=t.MANIFEST_CACHE_KEY=t.LOCAL_FILE_HEADER_SIG=t.MIME_TYPES=t.ASSET_SOURCE_HEADER=t.ASSET_CACHED_AT_HEADER=t.CONFIG_CACHE_NAME=t.kF=t.o2=void 0,t.setRuntimeConfig=function(e){t.runtimeConfig=e},t.setAllowedZipUrls=function(e){t.allowedZipUrls=e},t.setAllowedZipUrlsLoaded=function(e){t.allowedZipUrlsLoaded=e},t.o2="zip-cache-v1",t.kF=72e5,t.CONFIG_CACHE_NAME="zip-peek-config-v1",t.o2,t.CONFIG_CACHE_NAME,t.ASSET_CACHED_AT_HEADER="X-ZipSW-Cached-At",t.ASSET_SOURCE_HEADER="X-ZipSW-Asset-Source",t.MIME_TYPES={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",json:"application/json",js:"application/javascript",css:"text/css; charset=utf-8",html:"text/html; charset=utf-8",txt:"text/plain; charset=utf-8",mp4:"video/mp4",webm:"video/webm",mp3:"audio/mpeg",wav:"audio/wav",oga:"audio/ogg",ogg:"audio/ogg",xml:"application/xml",wasm:"application/wasm"},t.LOCAL_FILE_HEADER_SIG=67324752,t.MANIFEST_CACHE_KEY="__zipsw_manifest__=1",t.zipManifests=new Map,t.pendingManifestLoads=new Map,t.runtimeConfig={zipAssetCacheName:t.o2,assetCacheTtlMs:t.kF,logPrefix:"[zipSW]"},t.allowedZipUrls=null,t.allowedZipUrlsLoaded=null,t.CONFIG_CACHE_KEY=new URL("__zip_peek_runtime_config__",self.registration.scope).href},777(e,t,n){t.log=function(...e){console.log(s.runtimeConfig.logPrefix,...e)},t.warn=function(...e){console.warn(s.runtimeConfig.logPrefix,...e)},t.error=function(...e){console.error(s.runtimeConfig.logPrefix,r.ZIP_PEEK_ERROR_PREFIX,...e)},t.installClientErrorReporting=function(){self.addEventListener("error",e=>{i(e.error??e.message,"Service worker uncaught error")}),self.addEventListener("unhandledrejection",e=>{i(e.reason,"Service worker unhandled promise rejection")})};const r=n(180),s=n(167);function i(e,t){const n=(0,r.toZipPeekError)(e);self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(e=>{const s={type:"ZIP_SW_ERROR",error:{message:n.message,stack:n.stack},info:t?(0,r.formatZipPeekError)(t):void 0};for(const t of e)t.postMessage(s)})}},483(e,t,n){t.manifestFilesToMap=a,t.sendManifestToClientId=l,t.ensureManifestAvailable=function(e,t){const n=s.zipManifests.get(e);if(n)return Promise.resolve(n);let c=s.pendingManifestLoads.get(e);return c||(c=(async()=>{const n=await async function(e,t){const n=await o(t);return n?function(e,t){return new Promise(n=>{const r=new MessageChannel,s=setTimeout(()=>{r.port1.close(),n(null)},500);r.port1.onmessage=e=>{clearTimeout(s),r.port1.close();const t=e.data;t?.ok&&Array.isArray(t.files)?n(a(t.files)):n(null)},r.port1.onmessageerror=()=>{clearTimeout(s),r.port1.close(),n(null)};try{e.postMessage({type:"ZIP_SW_MANIFEST_REQUEST",zipUrl:t},[r.port2])}catch(e){clearTimeout(s),r.port1.close(),(0,i.warn)("failed to request manifest from client",e),n(null)}})}(n,e):null}(e,t);if(n)return s.zipManifests.set(e,n),(0,i.log)("restored manifest from client memory",{zipUrl:e,entryCount:n.size}),n;const c=await async function(e){const t=await fetch(e,{headers:{Range:"bytes=-65536"}});if(206!==t.status)return(0,i.error)("range requests not supported for ZIP manifest",{zipUrl:e,status:t.status}),null;const n=await t.arrayBuffer(),s=new DataView(n);let a=-1;for(let e=n.byteLength-22;e>=0;e--)if(101010256===s.getUint32(e,!0)){a=e;break}if(-1===a)return(0,i.error)("EOCD not found in last 64KB of ZIP file",e),null;const o=s.getUint32(a+16,!0),l=s.getUint32(a+12,!0);let c=n,f=-1;const u=t.headers.get("Content-Range");let p=0;if(u){const e=u.match(/\/(\d+)$/);e&&(p=parseInt(e[1],10))}if(p<=0)return(0,i.error)("could not determine ZIP file size from Content-Range header",{zipUrl:e,contentRange:u}),null;const d=p-n.byteLength;if(o>=d)f=o-d;else{const t=await fetch(e,{headers:{Range:`bytes=${o}-${o+l-1}`}});if(206!==t.status)return(0,i.error)("failed to fetch ZIP central directory",{zipUrl:e,status:t.status,cdOffset:o,cdSize:l}),null;c=await t.arrayBuffer(),f=0}return function(e,t,n,s){const a=new DataView(e);let o=t;const l=[];for(;o+46<=e.byteLength&&33639248===a.getUint32(o,!0);){const t=a.getUint16(o+10,!0),n=a.getUint32(o+20,!0),s=a.getUint32(o+24,!0),i=a.getUint16(o+28,!0),c=a.getUint16(o+30,!0),f=a.getUint16(o+32,!0),u=a.getUint32(o+42,!0),p=new TextDecoder;if(o+46+i>e.byteLength)break;const d=new Uint8Array(e,o+46,i),g=p.decode(d),m=(0,r.normalizeZipEntryPath)(g);""!==m&&l.push({filename:m,offset:u,compressedSize:n,uncompressedSize:s,compression:t}),o+=46+i+c+f}if(0===l.length)return(0,i.error)("no files parsed from central directory",s),null;l.sort((e,t)=>e.offset-t.offset);const c=new Map;for(let e=0;e<l.length;e++){const t=l[e],s=(0,r.normalizeZipEntryPath)(t.filename);""!==s&&(c.has(s)&&(0,i.warn)("duplicate manifest key after normalize; overwriting",s),c.set(s,{filename:t.filename,offset:t.offset,compressedSize:t.compressedSize,uncompressedSize:t.uncompressedSize,compression:t.compression,nextOffset:e<l.length-1?l[e+1].offset:n}))}return c.size>0?c:null}(c,f,o,e)}(e);return c&&(s.zipManifests.set(e,c),await l(e,c,t),(0,i.log)("manifest fetched and stored in memory",{zipUrl:e,entryCount:c.size})),c})().finally(()=>{s.pendingManifestLoads.delete(e)}),s.pendingManifestLoads.set(e,c),c)},t.entryUncompressedSize=function(e){return void 0!==e.uncompressedSize?e.uncompressedSize:0===e.compression?e.compressedSize:null},t.resolveManifestEntry=function(e,t){if(e.has(t))return{key:t,info:e.get(t)};const n=[];for(const r of e.keys())r.endsWith("/"+t)&&n.push(r);if(1===n.length){const t=n[0];return{key:t,info:e.get(t)}}return n.length>1?((0,i.error)("ambiguous suffix match for ZIP entry",{requested:t,candidates:n.slice(0,8)}),null):null},t.zipUrlFromManifestCacheKey=function(e){const t=s.MANIFEST_CACHE_KEY;if(!e.endsWith(t))return null;let n=e.slice(0,-t.length);return(n.endsWith("?")||n.endsWith("&"))&&(n=n.slice(0,-1)),n};const r=n(134),s=n(167),i=n(777);function a(e){const t=new Map;for(const n of e){const e=(0,r.normalizeZipEntryPath)(n.filename);""!==e&&(t.has(e)&&(0,i.warn)("duplicate manifest key after normalize; overwriting",e),t.set(e,n))}return t.size>0?t:null}async function o(e){if(!e)return null;const t=await self.clients.get(e);return"window"===t?.type?t:null}async function l(e,t,n){const r=await o(n);if(!r)return;const s=Array.from(t.values());try{r.postMessage({type:"ZIP_SW_MANIFEST_CREATED",zipUrl:e,files:s})}catch(e){(0,i.warn)("failed to send manifest to client",e)}}},814(e,t,n){t.installMessageHandler=function(){self.addEventListener("message",e=>{if(!e.data)return;const{type:t,zipUrl:n,files:p,config:d,allowedZipUrls:g}=e.data,m=function(e){if(!e||!("id"in e))return;const t=e.id;return"string"==typeof t?t:void 0}(e.source);if("ZIP_SW_CONFIG"===t){const t=(0,i.applyRuntimeConfig)(d).then(()=>u(e,{ok:!0})).catch(t=>u(e,f(t)));return void e.waitUntil(t)}if("ZIP_MANIFEST"===t){if(n&&p){const t=(0,s.normalizeZipUrl)(n),r=(0,c.manifestFilesToMap)(p),i=o.zipManifests.get(t);if(!r)return void(0,l.warn)("rejecting empty manifest; keeping existing",{zipUrl:t,existingSize:i?i.size:0});if(i&&i.size>r.size)return void(0,l.warn)("rejecting smaller manifest; keeping existing",{zipUrl:t,incomingSize:r.size,existingSize:i.size});o.zipManifests.set(t,r),e.waitUntil((0,c.sendManifestToClientId)(t,r,m));const a=Array.from(r.keys()).slice(0,40);(0,l.log)("ZIP_MANIFEST loaded",{zipUrl:t,entryCount:r.size,sampleKeys:a,replacedExistingSize:i?i.size:0})}}else if("CLEAR_ZIP_ASSETS_EXCEPT_ALLOWED"===t&&g){const t=(0,a.clearZipAssetsExceptAllowed)(g).then(()=>u(e,{ok:!0})).catch(t=>u(e,f(t)));e.waitUntil(t)}else if("CLEAR_ALL_ZIP_ASSETS"===t){const t=(0,a.clearAllZipAssets)().then(()=>u(e,{ok:!0})).catch(t=>u(e,f(t)));e.waitUntil(t)}else if("PRELOAD_ZIP_MANIFESTS"===t&&g){const t=async function(e,t){const n=await Promise.all(e.map(async e=>({zipUrl:e,manifest:await(0,c.ensureManifestAvailable)(e,t)}))),s=n.filter(e=>!e.manifest).map(e=>e.zipUrl);if(s.length>0)throw(0,r.createZipPeekError)(`Failed to preload ZIP manifest(s): ${s.join(", ")}`)}(g,m).then(()=>u(e,{ok:!0})).catch(t=>u(e,f(t)));e.waitUntil(t)}})};const r=n(180),s=n(134),i=n(451),a=n(919),o=n(167),l=n(777),c=n(483);function f(e){const t=(0,r.toZipPeekError)(e);return{ok:!1,error:t.message,errorStack:t.stack}}function u(e,t){e.ports[0]?.postMessage(t)}},237(e,t,n){t.corsErrorResponse=l,t.getMimeType=c,t.fetchUncompressedZipEntryFromNetwork=async function(e,t,n,s){const f=n.offset,u=n.nextOffset-1;(0,a.log)("fetching zip chunk from",{zipUrl:e,rangeStart:f,rangeEnd:u});const p=await fetch(e,{headers:{Range:`bytes=${f}-${u}`}});if(206!==p.status)return{ok:!1,response:l(`ZIP entry fetch for "${t}" expected HTTP 206 Partial Content from ${e}, got ${p.status}`,p.status>=400?p.status:502)};const d=await p.arrayBuffer(),g=new DataView(d);if(g.getUint32(0,!0)!==i.LOCAL_FILE_HEADER_SIG)return{ok:!1,response:l(`Invalid local file header for "${t}" in ${e} (expected ZIP signature 0x04034b50)`,500)};const m=30+g.getUint16(26,!0)+g.getUint16(28,!0);if(m>d.byteLength||m+n.compressedSize>d.byteLength)return{ok:!1,response:l(`Corrupt ZIP entry "${t}" in ${e}: dataStart=${m}, compressedSize=${n.compressedSize}, bufferLength=${d.byteLength}`,500)};const w=new Uint8Array(d,m,n.compressedSize);let h;if(8===n.compression)try{h=(0,r.inflateSync)(w)}catch(n){return(0,a.warn)("inflateSync failed",{zipUrl:e,manifestKey:t,error:n}),{ok:!1,response:l(`Failed to inflate DEFLATE-compressed entry "${t}" in ${e}`,500)}}else{if(0!==n.compression)return{ok:!1,response:l(`Unsupported compression method ${n.compression} for "${t}" in ${e} (only stored/0 and DEFLATE/8 are supported)`,500)};h=w}const E=c(t),y=new Blob([h],{type:E});return await(0,o.putCachedFullAssetIfAbsent)(s,y),{ok:!0,blob:y}};const r=n(612),s=n(180),i=n(167),a=n(777),o=n(919);function l(e,t){return new Response((0,s.formatZipPeekError)(e),{status:t,headers:{"Access-Control-Allow-Origin":"*"}})}function c(e){const t=e.split(".").pop()?.toLowerCase();return t?i.MIME_TYPES[t]??"application/octet-stream":"application/octet-stream"}},134(e,t){function n(e){try{return decodeURIComponent(e)}catch{return e}}t.normalizeZipUrl=function(e,t={}){const{stripCacheBuster:n=!0,stripHash:r=!0}=t,s=e=>r?e.split("#")[0]:e;if(!n)return s(e);const i=e.indexOf("?");if(-1===i)return s(e);const a=e.indexOf("#",i),o=e.substring(0,i),l=-1===a?e.substring(i+1):e.substring(i+1,a),c=r||-1===a?"":e.substring(a),f=l.split("&").filter(e=>{const t=e.indexOf("=");return"t"!==(-1===t?e:e.substring(0,t))});return 0===f.length?o+c:o+"?"+f.join("&")+c},t.normalizeZipEntryPath=function(e){let t=e.replace(/\\/g,"/");for(;t.startsWith("/");)t=t.slice(1);return t},t.parseZipAssetRequest=function(e){const t=/\.zip([/?])/.exec(e);if(!t)return null;const r=t.index+4,s=t[1],i=e.substring(0,r);if("/"===s){const t=e.substring(r+1),s=t.indexOf("?"),a=-1===s?t:t.substring(0,s);return""===a?null:{zipUrl:i,internalPath:n(a)}}const a=e.substring(r),o=a.indexOf("/");if(-1===o)return null;const l=a.substring(0,o),c=a.substring(o+1),f=c.indexOf("?"),u=-1===f?c:c.substring(0,f);return""===u?null:{zipUrl:i+l,internalPath:n(u)}},t.canonicalZipAssetRequestUrl=function(e,t){return e+"/"+encodeURIComponent(t)}},612(e,t){t.inflateSync=M;var n=Uint8Array,r=Uint16Array,s=Int32Array,i=new n([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new n([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new n([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),l=function(e,t){for(var n=new r(31),i=0;i<31;++i)n[i]=t+=1<<e[i-1];var a=new s(n[30]);for(i=1;i<30;++i)for(var o=n[i];o<n[i+1];++o)a[o]=o-n[i]<<5|i;return{b:n,r:a}},c=l(i,2),f=c.b,u=c.r;f[28]=258,u[258]=28;for(var p=l(a,0),d=p.b,g=(p.r,new r(32768)),m=0;m<32768;++m){var w=(43690&m)>>1|(21845&m)<<1;w=(61680&(w=(52428&w)>>2|(13107&w)<<2))>>4|(3855&w)<<4,g[m]=((65280&w)>>8|(255&w)<<8)>>1}var h=function(e,t,n){for(var s=e.length,i=0,a=new r(t);i<s;++i)e[i]&&++a[e[i]-1];var o,l=new r(t);for(i=1;i<t;++i)l[i]=l[i-1]+a[i-1]<<1;if(n){o=new r(1<<t);var c=15-t;for(i=0;i<s;++i)if(e[i])for(var f=i<<4|e[i],u=t-e[i],p=l[e[i]-1]++<<u,d=p|(1<<u)-1;p<=d;++p)o[g[p]>>c]=f}else for(o=new r(s),i=0;i<s;++i)e[i]&&(o[i]=g[l[e[i]-1]++]>>15-e[i]);return o},E=new n(288);for(m=0;m<144;++m)E[m]=8;for(m=144;m<256;++m)E[m]=9;for(m=256;m<280;++m)E[m]=7;for(m=280;m<288;++m)E[m]=8;var y=new n(32);for(m=0;m<32;++m)y[m]=5;var A=h(E,9,1),C=h(y,5,1),_=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},U=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},z=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},S=function(e){return(e+7)/8|0},Z=function(e,t,r){return(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length),new n(e.subarray(t,r))},R=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],v=function(e,t,n){var r=new Error(t||R[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,v),!n)throw r;return r},P=function(e,t,r,s){var l=e.length,c=s?s.length:0;if(!l||t.f&&!t.l)return r||new n(0);var u=!r,p=u||2!=t.i,g=t.i;u&&(r=new n(3*l));var m=function(e){var t=r.length;if(e>t){var s=new n(Math.max(2*t,e));s.set(r),r=s}},w=t.f||0,E=t.p||0,y=t.b||0,R=t.l,P=t.d,I=t.m,M=t.n,b=8*l;do{if(!R){w=U(e,E,1);var k=U(e,E+1,3);if(E+=3,!k){var T=e[(W=S(E)+4)-4]|e[W-3]<<8,L=W+T;if(L>l){g&&v(0);break}p&&m(y+T),r.set(e.subarray(W,L),y),t.b=y+=T,t.p=E=8*L,t.f=w;continue}if(1==k)R=A,P=C,I=9,M=5;else if(2==k){var F=U(e,E,31)+257,x=U(e,E+10,15)+4,N=F+U(e,E+5,31)+1;E+=14;for(var O=new n(N),H=new n(19),$=0;$<x;++$)H[o[$]]=U(e,E+3*$,7);E+=3*x;var D=_(H),q=(1<<D)-1,K=h(H,D,1);for($=0;$<N;){var W,j=K[U(e,E,q)];if(E+=15&j,(W=j>>4)<16)O[$++]=W;else{var G=0,Y=0;for(16==W?(Y=3+U(e,E,3),E+=2,G=O[$-1]):17==W?(Y=3+U(e,E,7),E+=3):18==W&&(Y=11+U(e,E,127),E+=7);Y--;)O[$++]=G}}var X=O.subarray(0,F),B=O.subarray(F);I=_(X),M=_(B),R=h(X,I,1),P=h(B,M,1)}else v(1);if(E>b){g&&v(0);break}}p&&m(y+131072);for(var V=(1<<I)-1,J=(1<<M)-1,Q=E;;Q=E){var ee=(G=R[z(e,E)&V])>>4;if((E+=15&G)>b){g&&v(0);break}if(G||v(2),ee<256)r[y++]=ee;else{if(256==ee){Q=E,R=null;break}var te=ee-254;if(ee>264){var ne=i[$=ee-257];te=U(e,E,(1<<ne)-1)+f[$],E+=ne}var re=P[z(e,E)&J],se=re>>4;if(re||v(3),E+=15&re,B=d[se],se>3&&(ne=a[se],B+=z(e,E)&(1<<ne)-1,E+=ne),E>b){g&&v(0);break}p&&m(y+131072);var ie=y+te;if(y<B){var ae=c-B,oe=Math.min(B,ie);for(ae+y<0&&v(3);y<oe;++y)r[y]=s[ae+y]}for(;y<ie;++y)r[y]=r[y-B]}}t.l=R,t.p=Q,t.b=y,t.f=w,R&&(w=1,t.m=I,t.d=P,t.n=M)}while(!w);return y!=r.length&&u?Z(r,0,y):r.subarray(0,y)},I=new n(0);function M(e,t){return P(e,{i:2},t&&t.out,t&&t.dictionary)}var b="undefined"!=typeof TextDecoder&&new TextDecoder;try{b.decode(I,{stream:!0})}catch(e){}"function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout&&setTimeout}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}(()=>{const e=n(777),t=n(705),r=n(814);self.addEventListener("install",()=>{self.skipWaiting()}),self.addEventListener("activate",e=>{e.waitUntil(self.clients.claim())}),(0,e.installClientErrorReporting)(),(0,r.installMessageHandler)(),(0,t.installFetchHandler)()})()})();
|
|
2
2
|
//# sourceMappingURL=zipServiceWorker.js.map
|