zip-peek 0.1.0 → 0.2.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/README.md +34 -29
- package/dist/index.d.ts +19 -5
- package/dist/index.js +91 -11
- package/dist/zipServiceWorker.js +1 -1
- package/dist/zipServiceWorker.js.map +1 -1
- package/package.json +1 -1
- package/dist/ZipStreamManager.d.ts +0 -19
- package/dist/ZipStreamManager.js +0 -181
package/README.md
CHANGED
|
@@ -39,16 +39,14 @@ The package provides two pieces:
|
|
|
39
39
|
|
|
40
40
|
At runtime, the package:
|
|
41
41
|
|
|
42
|
-
1.
|
|
43
|
-
2.
|
|
44
|
-
3.
|
|
45
|
-
4.
|
|
46
|
-
5.
|
|
47
|
-
6.
|
|
48
|
-
7.
|
|
49
|
-
8.
|
|
50
|
-
9. Returns the extracted file bytes to the browser request as a normal `Response`.
|
|
51
|
-
10. Caches extracted assets in the browser Cache API.
|
|
42
|
+
1. Registers the ZIP service worker with the configured `workerUrl` and `scopeUrl`.
|
|
43
|
+
2. Reloads once after first service worker install when needed, so the page becomes controlled.
|
|
44
|
+
3. Intercepts matching `.zip/...` asset requests within the service worker scope.
|
|
45
|
+
4. Loads and caches the ZIP central directory on first use, or during init when `allowedZipUrls` is provided.
|
|
46
|
+
5. Fetches only the byte range needed for the requested file.
|
|
47
|
+
6. Inflates deflated files using `fflate`.
|
|
48
|
+
7. Returns the extracted file bytes to the browser request as a normal `Response`.
|
|
49
|
+
8. Caches extracted assets in the browser Cache API.
|
|
52
50
|
|
|
53
51
|
## Installation
|
|
54
52
|
|
|
@@ -68,7 +66,6 @@ npm install zip-peek
|
|
|
68
66
|
import { initZipPeek } from 'zip-peek';
|
|
69
67
|
|
|
70
68
|
const zipPeekInit = await initZipPeek({
|
|
71
|
-
zipUrl: 'https://cdn.example.com/packages/zipfile.zip',
|
|
72
69
|
workerUrl: new URL('/zipServiceWorker.js', window.location.origin).href,
|
|
73
70
|
scopeUrl: new URL('/', window.location.origin).href,
|
|
74
71
|
});
|
|
@@ -96,15 +93,17 @@ The browser requests that URL normally. The service worker intercepts it and ser
|
|
|
96
93
|
|
|
97
94
|
```ts
|
|
98
95
|
type InitZipPeekOptions = {
|
|
99
|
-
zipUrl: string;
|
|
100
96
|
workerUrl: string;
|
|
101
97
|
scopeUrl: string;
|
|
102
98
|
reloadOnFirstInstall?: boolean;
|
|
103
|
-
|
|
99
|
+
cacheClearingStrategy?: ZipCacheClearingStrategy;
|
|
100
|
+
allowedZipUrls?: string[];
|
|
104
101
|
zipAssetCacheName?: string;
|
|
105
102
|
assetCacheTtlMs?: number;
|
|
106
103
|
logPrefix?: string;
|
|
107
104
|
};
|
|
105
|
+
|
|
106
|
+
type ZipCacheClearingStrategy = 'keep-all' | 'keep-allowed-urls' | 'clear-all';
|
|
108
107
|
```
|
|
109
108
|
|
|
110
109
|
Returns:
|
|
@@ -118,17 +117,6 @@ type InitZipPeekResult = {
|
|
|
118
117
|
|
|
119
118
|
### Options
|
|
120
119
|
|
|
121
|
-
`zipUrl`
|
|
122
|
-
|
|
123
|
-
The URL of the ZIP package. This can be absolute or relative, but it must point to a path ending in `.zip`. It can also be a presigned url.
|
|
124
|
-
|
|
125
|
-
Example:
|
|
126
|
-
|
|
127
|
-
```ts
|
|
128
|
-
zipUrl: 'https://cdn.example.com/packages/zipfile.zip'
|
|
129
|
-
zipUrl: 'https://d3jfe.cloudfront.net/somedir/zipfile.zip?Expires=1798761599&Signature=K2CJW4Z7B3DCM4&Key-Pair-Id=K2CJW4Z7B3DCM4'
|
|
130
|
-
```
|
|
131
|
-
|
|
132
120
|
`workerUrl`
|
|
133
121
|
|
|
134
122
|
The URL where the browser can download the service worker JavaScript file. The service worker file must be served from the same origin as the page.
|
|
@@ -162,9 +150,28 @@ Choose the smallest scope that includes the pages and asset requests you want th
|
|
|
162
150
|
|
|
163
151
|
Defaults to `true`. When a service worker is installed for the first time, the current page may not yet be controlled by it. With this option enabled, the package reloads once and returns `{ reloaded: true, initialized: false }`.
|
|
164
152
|
|
|
165
|
-
`
|
|
153
|
+
`cacheClearingStrategy`
|
|
154
|
+
|
|
155
|
+
Defaults to `'keep-all'`. Controls which zip-peek cache entries are cleared during initialization.
|
|
166
156
|
|
|
167
|
-
|
|
157
|
+
- `'keep-all'`: do not clear cached ZIP manifests or extracted assets.
|
|
158
|
+
- `'keep-allowed-urls'`: requires non-empty `allowedZipUrls`; clears cached ZIP data for URLs outside the allow-list.
|
|
159
|
+
- `'clear-all'`: clears all zip-peek cached manifests and extracted assets for a fresh start.
|
|
160
|
+
|
|
161
|
+
`allowedZipUrls`
|
|
162
|
+
|
|
163
|
+
Restricts zip-peek to a known set of ZIP package URLs. When omitted, zip-peek lazily serves any matching `.zip/...` request inside the service worker scope. When provided, the array must contain at least one ZIP URL, and zip-peek rejects matching requests for ZIP URLs outside the list.
|
|
164
|
+
|
|
165
|
+
The allow-list also acts as a warmup list: zip-peek loads and caches each allowed ZIP manifest during initialization.
|
|
166
|
+
|
|
167
|
+
Examples:
|
|
168
|
+
|
|
169
|
+
```ts
|
|
170
|
+
allowedZipUrls: ['https://cdn.example.com/packages/zipfile.zip']
|
|
171
|
+
allowedZipUrls: [
|
|
172
|
+
'https://d3jfe.cloudfront.net/somedir/zipfile.zip?Expires=1798761599&Signature=K2CJW4Z7B3DCM4&Key-Pair-Id=K2CJW4Z7B3DCM4',
|
|
173
|
+
]
|
|
174
|
+
```
|
|
168
175
|
|
|
169
176
|
`zipAssetCacheName`
|
|
170
177
|
|
|
@@ -319,7 +326,6 @@ For example, after resolving the emitted filename:
|
|
|
319
326
|
|
|
320
327
|
```ts
|
|
321
328
|
await initZipPeek({
|
|
322
|
-
zipUrl,
|
|
323
329
|
workerUrl: new URL(`/assets/${zipServiceWorkerFilename}`, window.location.origin).href,
|
|
324
330
|
scopeUrl: new URL('/', window.location.origin).href,
|
|
325
331
|
});
|
|
@@ -356,7 +362,6 @@ Then use:
|
|
|
356
362
|
|
|
357
363
|
```ts
|
|
358
364
|
await initZipPeek({
|
|
359
|
-
zipUrl,
|
|
360
365
|
workerUrl: new URL('/zipServiceWorker.js', window.location.origin).href,
|
|
361
366
|
scopeUrl: new URL('/', window.location.origin).href,
|
|
362
367
|
});
|
|
@@ -379,7 +384,7 @@ zip-cache-v1
|
|
|
379
384
|
|
|
380
385
|
Extracted assets expire after two hours by default. Set `assetCacheTtlMs` to customize this.
|
|
381
386
|
|
|
382
|
-
|
|
387
|
+
Use `cacheClearingStrategy` to control initialization-time cleanup. `keep-all` leaves existing entries untouched, `keep-allowed-urls` removes cached ZIP data outside `allowedZipUrls`, and `clear-all` removes all zip-peek cached ZIP data before warming any allowed manifests.
|
|
383
388
|
|
|
384
389
|
## Limitations
|
|
385
390
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { ZipWorkerConfig } from './ZipStreamManager';
|
|
2
1
|
import { isZipPackage } from './zip-utils';
|
|
2
|
+
export type ZipWorkerConfig = {
|
|
3
|
+
zipAssetCacheName?: string;
|
|
4
|
+
assetCacheTtlMs?: number;
|
|
5
|
+
logPrefix?: string;
|
|
6
|
+
};
|
|
7
|
+
export type ZipCacheClearingStrategy = 'keep-all' | 'keep-allowed-urls' | 'clear-all';
|
|
3
8
|
export type InitZipPeekOptions = {
|
|
4
|
-
zipUrl: string;
|
|
5
9
|
workerUrl: string;
|
|
6
10
|
scopeUrl: string;
|
|
7
11
|
reloadOnFirstInstall?: boolean;
|
|
8
|
-
|
|
12
|
+
cacheClearingStrategy?: ZipCacheClearingStrategy;
|
|
13
|
+
allowedZipUrls?: string[];
|
|
9
14
|
zipAssetCacheName?: string;
|
|
10
15
|
assetCacheTtlMs?: number;
|
|
11
16
|
logPrefix?: string;
|
|
@@ -14,6 +19,15 @@ export type InitZipPeekResult = {
|
|
|
14
19
|
reloaded: boolean;
|
|
15
20
|
initialized: boolean;
|
|
16
21
|
};
|
|
17
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Registers the zip-peek service worker and configures lazy ZIP asset loading.
|
|
24
|
+
*
|
|
25
|
+
* By default, zip-peek serves any matching `.zip/...` request within the
|
|
26
|
+
* service worker scope by loading the ZIP manifest on first use. Pass
|
|
27
|
+
* `allowedZipUrls` to restrict serving to a known, non-empty set of ZIP
|
|
28
|
+
* package URLs and warm their manifests during initialization. Use
|
|
29
|
+
* `cacheClearingStrategy` to keep existing cache entries, keep only allowed
|
|
30
|
+
* ZIP URLs, or clear all zip-peek cache entries before use.
|
|
31
|
+
*/
|
|
32
|
+
export declare function initZipPeek({ workerUrl, scopeUrl, reloadOnFirstInstall, cacheClearingStrategy, allowedZipUrls, zipAssetCacheName, assetCacheTtlMs, logPrefix, }: InitZipPeekOptions): Promise<InitZipPeekResult>;
|
|
18
33
|
export { isZipPackage };
|
|
19
|
-
export type { ZipWorkerConfig };
|
package/dist/index.js
CHANGED
|
@@ -3,11 +3,65 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isZipPackage = void 0;
|
|
4
4
|
exports.initZipPeek = initZipPeek;
|
|
5
5
|
const registerZipServiceWorker_1 = require("./registerZipServiceWorker");
|
|
6
|
-
const ZipStreamManager_1 = require("./ZipStreamManager");
|
|
7
6
|
const zip_utils_1 = require("./zip-utils");
|
|
8
7
|
Object.defineProperty(exports, "isZipPackage", { enumerable: true, get: function () { return zip_utils_1.isZipPackage; } });
|
|
9
|
-
|
|
10
|
-
if (
|
|
8
|
+
function normalizeAllowedZipUrls(allowedZipUrls) {
|
|
9
|
+
if (allowedZipUrls === undefined) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
if (allowedZipUrls.length === 0) {
|
|
13
|
+
throw new Error('zip-peek: allowedZipUrls must contain at least one ZIP URL when provided.');
|
|
14
|
+
}
|
|
15
|
+
const normalized = new Set();
|
|
16
|
+
for (const zipUrl of allowedZipUrls) {
|
|
17
|
+
const resolvedZipUrl = new URL(zipUrl, window.location.href).href;
|
|
18
|
+
if (!(0, zip_utils_1.isZipPackage)(resolvedZipUrl)) {
|
|
19
|
+
throw new Error(`zip-peek: allowedZipUrls contains a non-ZIP URL: ${zipUrl}`);
|
|
20
|
+
}
|
|
21
|
+
normalized.add((0, zip_utils_1.normalizeZipUrlForSw)(resolvedZipUrl));
|
|
22
|
+
}
|
|
23
|
+
return Array.from(normalized);
|
|
24
|
+
}
|
|
25
|
+
function postWorkerMessage(message) {
|
|
26
|
+
const controller = navigator.serviceWorker.controller;
|
|
27
|
+
if (!controller) {
|
|
28
|
+
return Promise.resolve();
|
|
29
|
+
}
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
const channel = new MessageChannel();
|
|
32
|
+
channel.port1.onmessage = event => {
|
|
33
|
+
const response = event.data;
|
|
34
|
+
channel.port1.close();
|
|
35
|
+
if (!response || response.ok) {
|
|
36
|
+
resolve();
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
reject(new Error(response.error ?? 'zip-peek: service worker message failed.'));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
channel.port1.onmessageerror = () => {
|
|
43
|
+
channel.port1.close();
|
|
44
|
+
reject(new Error('zip-peek: failed to receive service worker response.'));
|
|
45
|
+
};
|
|
46
|
+
controller.postMessage(message, [channel.port2]);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Registers the zip-peek service worker and configures lazy ZIP asset loading.
|
|
51
|
+
*
|
|
52
|
+
* By default, zip-peek serves any matching `.zip/...` request within the
|
|
53
|
+
* service worker scope by loading the ZIP manifest on first use. Pass
|
|
54
|
+
* `allowedZipUrls` to restrict serving to a known, non-empty set of ZIP
|
|
55
|
+
* package URLs and warm their manifests during initialization. Use
|
|
56
|
+
* `cacheClearingStrategy` to keep existing cache entries, keep only allowed
|
|
57
|
+
* ZIP URLs, or clear all zip-peek cache entries before use.
|
|
58
|
+
*/
|
|
59
|
+
async function initZipPeek({ workerUrl, scopeUrl, reloadOnFirstInstall = true, cacheClearingStrategy = 'keep-all', allowedZipUrls, zipAssetCacheName, assetCacheTtlMs, logPrefix, }) {
|
|
60
|
+
const normalizedAllowedZipUrls = normalizeAllowedZipUrls(allowedZipUrls);
|
|
61
|
+
if (cacheClearingStrategy === 'keep-allowed-urls' && !normalizedAllowedZipUrls) {
|
|
62
|
+
throw new Error('zip-peek: cacheClearingStrategy "keep-allowed-urls" requires a non-empty allowedZipUrls allow-list.');
|
|
63
|
+
}
|
|
64
|
+
if (!('serviceWorker' in navigator)) {
|
|
11
65
|
return { reloaded: false, initialized: false };
|
|
12
66
|
}
|
|
13
67
|
const reloaded = await (0, registerZipServiceWorker_1.ensureZipServiceWorkerRegistered)({
|
|
@@ -18,14 +72,40 @@ async function initZipPeek({ zipUrl, workerUrl, scopeUrl, reloadOnFirstInstall =
|
|
|
18
72
|
if (reloaded) {
|
|
19
73
|
return { reloaded: true, initialized: false };
|
|
20
74
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
75
|
+
await postWorkerMessage({
|
|
76
|
+
type: 'ZIP_SW_CONFIG',
|
|
77
|
+
config: {
|
|
78
|
+
zipAssetCacheName,
|
|
79
|
+
assetCacheTtlMs,
|
|
80
|
+
logPrefix,
|
|
81
|
+
allowedZipUrls: normalizedAllowedZipUrls ?? null,
|
|
82
|
+
},
|
|
29
83
|
});
|
|
84
|
+
if (cacheClearingStrategy === 'clear-all') {
|
|
85
|
+
await postWorkerMessage({
|
|
86
|
+
type: 'CLEAR_ALL_ZIP_ASSETS',
|
|
87
|
+
});
|
|
88
|
+
await postWorkerMessage({
|
|
89
|
+
type: 'ZIP_SW_CONFIG',
|
|
90
|
+
config: {
|
|
91
|
+
zipAssetCacheName,
|
|
92
|
+
assetCacheTtlMs,
|
|
93
|
+
logPrefix,
|
|
94
|
+
allowedZipUrls: normalizedAllowedZipUrls ?? null,
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
else if (cacheClearingStrategy === 'keep-allowed-urls' && normalizedAllowedZipUrls) {
|
|
99
|
+
await postWorkerMessage({
|
|
100
|
+
type: 'CLEAR_ZIP_ASSETS_EXCEPT_ALLOWED',
|
|
101
|
+
allowedZipUrls: normalizedAllowedZipUrls,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
if (normalizedAllowedZipUrls) {
|
|
105
|
+
await postWorkerMessage({
|
|
106
|
+
type: 'PRELOAD_ZIP_MANIFESTS',
|
|
107
|
+
allowedZipUrls: normalizedAllowedZipUrls,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
30
110
|
return { reloaded: false, initialized: true };
|
|
31
111
|
}
|
package/dist/zipServiceWorker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{"use strict";var t={183(t,n){function e(t){const n=t.indexOf("?");if(-1===n)return t.split("#")[0];const e=t.indexOf("#",n),i=t.substring(0,n),r=-1===e?t.substring(n+1):t.substring(n+1,e),s=-1===e?"":t.substring(e),a=r.split("&").filter(t=>{const n=t.indexOf("=");return"t"!==(-1===n?t:t.substring(0,n))});return 0===a.length?i+s:i+"?"+a.join("&")+s}function i(t){try{return decodeURIComponent(t)}catch{return t}}Object.defineProperty(n,"__esModule",{value:!0}),n.normalizeZipUrlForSw=void 0,n.isZipPackage=function(t){try{return new URL(t).pathname.endsWith(".zip")}catch{return t.split("?")[0].endsWith(".zip")}},n.stripTParam=e,n.normalizeZipEntryPath=function(t){let n=t.replace(/\\/g,"/");for(;n.startsWith("/");)n=n.slice(1);return n},n.parseZipAssetRequest=function(t){const n=/\.zip([/?])/.exec(t);if(!n)return null;const e=n.index+4,r=n[1],s=t.substring(0,e);if("/"===r){const n=t.substring(e+1),r=n.indexOf("?"),a=-1===r?n:n.substring(0,r);return""===a?null:{zipUrl:s,internalPath:i(a)}}const a=t.substring(e),o=a.indexOf("/");if(-1===o)return null;const u=a.substring(0,o),f=a.substring(o+1),c=f.indexOf("?"),h=-1===c?f:f.substring(0,c);return""===h?null:{zipUrl:s+u,internalPath:i(h)}},n.canonicalZipAssetRequestUrl=function(t,n){return t+"/"+encodeURI(n)},n.normalizeZipUrlForSw=e},845(t,n){var e={},i=function(t,n,i,r,s){var a=new Worker(e[n]||(e[n]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(t){var n=t.data,e=n.$e$;if(e){var i=new Error(e[0]);i.code=e[1],i.stack=e[2],s(i,null)}else s(null,n)},a.postMessage(i,r),a},r=Uint8Array,s=Uint16Array,a=Int32Array,o=new r([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]),u=new r([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]),f=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=function(t,n){for(var e=new s(31),i=0;i<31;++i)e[i]=n+=1<<t[i-1];var r=new a(e[30]);for(i=1;i<30;++i)for(var o=e[i];o<e[i+1];++o)r[o]=o-e[i]<<5|i;return{b:e,r}},h=c(o,2),l=h.b,p=h.r;l[28]=258,p[258]=28;for(var d=c(u,0),v=d.b,g=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 b=function(t,n,e){for(var i=t.length,r=0,a=new s(n);r<i;++r)t[r]&&++a[t[r]-1];var o,u=new s(n);for(r=1;r<n;++r)u[r]=u[r-1]+a[r-1]<<1;if(e){o=new s(1<<n);var f=15-n;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],h=n-t[r],l=u[t[r]-1]++<<h,p=l|(1<<h)-1;l<=p;++l)o[m[l]>>f]=c}else for(o=new s(i),r=0;r<i;++r)t[r]&&(o[r]=m[u[t[r]-1]++]>>15-t[r]);return o},z=new r(288);for(y=0;y<144;++y)z[y]=8;for(y=144;y<256;++y)z[y]=9;for(y=256;y<280;++y)z[y]=7;for(y=280;y<288;++y)z[y]=8;var x=new r(32);for(y=0;y<32;++y)x[y]=5;var A=b(z,9,0),S=b(z,9,1),k=b(x,5,0),C=b(x,5,1),U=function(t){for(var n=t[0],e=1;e<t.length;++e)t[e]>n&&(n=t[e]);return n},M=function(t,n,e){var i=n/8|0;return(t[i]|t[i+1]<<8)>>(7&n)&e},T=function(t,n){var e=n/8|0;return(t[e]|t[e+1]<<8|t[e+2]<<16)>>(7&n)},I=function(t){return(t+7)/8|0},P=function(t,n,e){return(null==n||n<0)&&(n=0),(null==e||e>t.length)&&(e=t.length),new r(t.subarray(n,e))};n.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 Z=["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"],E=function(t,n,e){var i=new Error(n||Z[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,E),!e)throw i;return i},_=function(t,n,e,i){var s=t.length,a=i?i.length:0;if(!s||n.f&&!n.l)return e||new r(0);var c=!e,h=c||2!=n.i,p=n.i;c&&(e=new r(3*s));var d=function(t){var n=e.length;if(t>n){var i=new r(Math.max(2*n,t));i.set(e),e=i}},g=n.f||0,m=n.p||0,y=n.b||0,w=n.l,z=n.d,x=n.m,A=n.n,k=8*s;do{if(!w){g=M(t,m,1);var Z=M(t,m+1,3);if(m+=3,!Z){var _=t[($=I(m)+4)-4]|t[$-3]<<8,O=$+_;if(O>s){p&&E(0);break}h&&d(y+_),e.set(t.subarray($,O),y),n.b=y+=_,n.p=m=8*O,n.f=g;continue}if(1==Z)w=S,z=C,x=9,A=5;else if(2==Z){var F=M(t,m,31)+257,R=M(t,m+10,15)+4,q=F+M(t,m+5,31)+1;m+=14;for(var D=new r(q),N=new r(19),j=0;j<R;++j)N[f[j]]=M(t,m+3*j,7);m+=3*R;var L=U(N),W=(1<<L)-1,G=b(N,L,1);for(j=0;j<q;){var $,H=G[M(t,m,W)];if(m+=15&H,($=H>>4)<16)D[j++]=$;else{var B=0,K=0;for(16==$?(K=3+M(t,m,3),m+=2,B=D[j-1]):17==$?(K=3+M(t,m,7),m+=3):18==$&&(K=11+M(t,m,127),m+=7);K--;)D[j++]=B}}var X=D.subarray(0,F),J=D.subarray(F);x=U(X),A=U(J),w=b(X,x,1),z=b(J,A,1)}else E(1);if(m>k){p&&E(0);break}}h&&d(y+131072);for(var V=(1<<x)-1,Y=(1<<A)-1,Q=m;;Q=m){var tt=(B=w[T(t,m)&V])>>4;if((m+=15&B)>k){p&&E(0);break}if(B||E(2),tt<256)e[y++]=tt;else{if(256==tt){Q=m,w=null;break}var nt=tt-254;if(tt>264){var et=o[j=tt-257];nt=M(t,m,(1<<et)-1)+l[j],m+=et}var it=z[T(t,m)&Y],rt=it>>4;if(it||E(3),m+=15&it,J=v[rt],rt>3&&(et=u[rt],J+=T(t,m)&(1<<et)-1,m+=et),m>k){p&&E(0);break}h&&d(y+131072);var st=y+nt;if(y<J){var at=a-J,ot=Math.min(J,st);for(at+y<0&&E(3);y<ot;++y)e[y]=i[at+y]}for(;y<st;++y)e[y]=e[y-J]}}n.l=w,n.p=Q,n.b=y,n.f=g,w&&(g=1,n.m=x,n.d=z,n.n=A)}while(!g);return y!=e.length&&c?P(e,0,y):e.subarray(0,y)},O=function(t,n,e){e<<=7&n;var i=n/8|0;t[i]|=e,t[i+1]|=e>>8},F=function(t,n,e){e<<=7&n;var i=n/8|0;t[i]|=e,t[i+1]|=e>>8,t[i+2]|=e>>16},R=function(t,n){for(var e=[],i=0;i<t.length;++i)t[i]&&e.push({s:i,f:t[i]});var a=e.length,o=e.slice();if(!a)return{t:G,l:0};if(1==a){var u=new r(e[0].s+1);return u[e[0].s]=1,{t:u,l:1}}e.sort(function(t,n){return t.f-n.f}),e.push({s:-1,f:25001});var f=e[0],c=e[1],h=0,l=1,p=2;for(e[0]={s:-1,f:f.f+c.f,l:f,r:c};l!=a-1;)f=e[e[h].f<e[p].f?h++:p++],c=e[h!=l&&e[h].f<e[p].f?h++:p++],e[l++]={s:-1,f:f.f+c.f,l:f,r:c};var d=o[0].s;for(i=1;i<a;++i)o[i].s>d&&(d=o[i].s);var v=new s(d+1),g=q(e[l-1],v,0);if(g>n){i=0;var m=0,y=g-n,w=1<<y;for(o.sort(function(t,n){return v[n.s]-v[t.s]||t.f-n.f});i<a;++i){var b=o[i].s;if(!(v[b]>n))break;m+=w-(1<<g-v[b]),v[b]=n}for(m>>=y;m>0;){var z=o[i].s;v[z]<n?m-=1<<n-v[z]++-1:++i}for(;i>=0&&m;--i){var x=o[i].s;v[x]==n&&(--v[x],++m)}g=n}return{t:new r(v),l:g}},q=function(t,n,e){return-1==t.s?Math.max(q(t.l,n,e+1),q(t.r,n,e+1)):n[t.s]=e},D=function(t){for(var n=t.length;n&&!t[--n];);for(var e=new s(++n),i=0,r=t[0],a=1,o=function(t){e[i++]=t},u=1;u<=n;++u)if(t[u]==r&&u!=n)++a;else{if(!r&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(r),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(r);a=1,r=t[u]}return{c:e.subarray(0,i),n}},N=function(t,n){for(var e=0,i=0;i<n.length;++i)e+=t[i]*n[i];return e},j=function(t,n,e){var i=e.length,r=I(n+2);t[r]=255&i,t[r+1]=i>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;s<i;++s)t[r+s+4]=e[s];return 8*(r+4+i)},L=function(t,n,e,i,r,a,c,h,l,p,d){O(n,d++,e),++r[256];for(var v=R(r,15),g=v.t,m=v.l,y=R(a,15),w=y.t,S=y.l,C=D(g),U=C.c,M=C.n,T=D(w),I=T.c,P=T.n,Z=new s(19),E=0;E<U.length;++E)++Z[31&U[E]];for(E=0;E<I.length;++E)++Z[31&I[E]];for(var _=R(Z,7),q=_.t,L=_.l,W=19;W>4&&!q[f[W-1]];--W);var G,$,H,B,K=p+5<<3,X=N(r,z)+N(a,x)+c,J=N(r,g)+N(a,w)+c+14+3*W+N(Z,q)+2*Z[16]+3*Z[17]+7*Z[18];if(l>=0&&K<=X&&K<=J)return j(n,d,t.subarray(l,l+p));if(O(n,d,1+(J<X)),d+=2,J<X){G=b(g,m,0),$=g,H=b(w,S,0),B=w;var V=b(q,L,0);for(O(n,d,M-257),O(n,d+5,P-1),O(n,d+10,W-4),d+=14,E=0;E<W;++E)O(n,d+3*E,q[f[E]]);d+=3*W;for(var Y=[U,I],Q=0;Q<2;++Q){var tt=Y[Q];for(E=0;E<tt.length;++E){var nt=31&tt[E];O(n,d,V[nt]),d+=q[nt],nt>15&&(O(n,d,tt[E]>>5&127),d+=tt[E]>>12)}}}else G=A,$=z,H=k,B=x;for(E=0;E<h;++E){var et=i[E];if(et>255){F(n,d,G[257+(nt=et>>18&31)]),d+=$[nt+257],nt>7&&(O(n,d,et>>23&31),d+=o[nt]);var it=31&et;F(n,d,H[it]),d+=B[it],it>3&&(F(n,d,et>>5&8191),d+=u[it])}else F(n,d,G[et]),d+=$[et]}return F(n,d,G[256]),d+$[256]},W=new a([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),G=new r(0),$=function(t,n,e,i,f,c){var h=c.z||t.length,l=new r(i+h+5*(1+Math.ceil(h/7e3))+f),d=l.subarray(i,l.length-f),v=c.l,m=7&(c.r||0);if(n){m&&(d[0]=c.r>>3);for(var y=W[n-1],w=y>>13,b=8191&y,z=(1<<e)-1,x=c.p||new s(32768),A=c.h||new s(z+1),S=Math.ceil(e/3),k=2*S,C=function(n){return(t[n]^t[n+1]<<S^t[n+2]<<k)&z},U=new a(25e3),M=new s(288),T=new s(32),Z=0,E=0,_=c.i||0,O=0,F=c.w||0,R=0;_+2<h;++_){var q=C(_),D=32767&_,N=A[q];if(x[D]=N,A[q]=D,F<=_){var G=h-_;if((Z>7e3||O>24576)&&(G>423||!v)){m=L(t,d,0,U,M,T,E,O,R,_-R,m),O=Z=E=0,R=_;for(var $=0;$<286;++$)M[$]=0;for($=0;$<30;++$)T[$]=0}var H=2,B=0,K=b,X=D-N&32767;if(G>2&&q==C(_-X))for(var J=Math.min(w,G)-1,V=Math.min(32767,_),Y=Math.min(258,G);X<=V&&--K&&D!=N;){if(t[_+H]==t[_+H-X]){for(var Q=0;Q<Y&&t[_+Q]==t[_+Q-X];++Q);if(Q>H){if(H=Q,B=X,Q>J)break;var tt=Math.min(X,Q-2),nt=0;for($=0;$<tt;++$){var et=_-X+$&32767,it=et-x[et]&32767;it>nt&&(nt=it,N=et)}}}X+=(D=N)-(N=x[D])&32767}if(B){U[O++]=268435456|p[H]<<18|g[B];var rt=31&p[H],st=31&g[B];E+=o[rt]+u[st],++M[257+rt],++T[st],F=_+H,++Z}else U[O++]=t[_],++M[t[_]]}}for(_=Math.max(_,F);_<h;++_)U[O++]=t[_],++M[t[_]];m=L(t,d,v,U,M,T,E,O,R,_-R,m),v||(c.r=7&m|d[m/8|0]<<3,m-=7,c.h=A,c.p=x,c.i=_,c.w=F)}else{for(_=c.w||0;_<h+v;_+=65535){var at=_+65535;at>=h&&(d[m/8|0]=v,at=h),m=j(d,m+1,t.subarray(_,at))}c.i=h}return P(l,0,i+I(m)+f)},H=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var e=n,i=9;--i;)e=(1&e&&-306674912)^e>>>1;t[n]=e}return t}(),B=function(){var t=-1;return{p:function(n){for(var e=t,i=0;i<n.length;++i)e=H[255&e^n[i]]^e>>>8;t=e},d:function(){return~t}}},K=function(){var t=1,n=0;return{p:function(e){for(var i=t,r=n,s=0|e.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)r+=i+=e[a];i=(65535&i)+15*(i>>16),r=(65535&r)+15*(r>>16)}t=i,n=r},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},X=function(t,n,e,i,s){if(!s&&(s={l:1},n.dictionary)){var a=n.dictionary.subarray(-32768),o=new r(a.length+t.length);o.set(a),o.set(t,a.length),t=o,s.w=a.length}return $(t,null==n.level?6:n.level,null==n.mem?s.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+n.mem,e,i,s)},J=function(t,n){var e={};for(var i in t)e[i]=t[i];for(var i in n)e[i]=n[i];return e},V=function(t,n,e){for(var i=t(),r=t.toString(),s=r.slice(r.indexOf("[")+1,r.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<i.length;++a){var o=i[a],u=s[a];if("function"==typeof o){n+=";"+u+"=";var f=o.toString();if(o.prototype)if(-1!=f.indexOf("[native code]")){var c=f.indexOf(" ",8)+1;n+=f.slice(c,f.indexOf("(",c))}else for(var h in n+=f,o.prototype)n+=";"+u+".prototype."+h+"="+o.prototype[h].toString();else n+=f}else e[u]=o}return n},Y=[],Q=function(t,n,e,r){if(!Y[e]){for(var s="",a={},o=t.length-1,u=0;u<o;++u)s=V(t[u],s,a);Y[e]={c:V(t[o],s,a),e:a}}var f=J({},Y[e].e);return i(Y[e].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+n.toString()+"}",e,f,function(t){var n=[];for(var e in t)t[e].buffer&&n.push((t[e]=new t[e].constructor(t[e])).buffer);return n}(f),r)},tt=function(){return[r,s,a,o,u,f,l,v,S,C,m,Z,b,U,M,T,I,P,E,_,Tt,at,ot]},nt=function(){return[r,s,a,o,u,f,p,g,A,z,k,x,m,W,G,b,O,F,R,q,D,N,j,L,I,P,$,X,kt,at]},et=function(){return[vt,yt,dt,B,H]},it=function(){return[gt,mt]},rt=function(){return[wt,dt,K]},st=function(){return[bt]},at=function(t){return postMessage(t,[t.buffer])},ot=function(t){return t&&{out:t.size&&new r(t.size),dictionary:t.dictionary}},ut=function(t,n,e,i,r,s){var a=Q(e,i,r,function(t,n){a.terminate(),s(t,n)});return a.postMessage([t,n],n.consume?[t.buffer]:[]),function(){a.terminate()}},ft=function(t){return t.ondata=function(t,n){return postMessage([t,n],[t.buffer])},function(n){n.data.length?(t.push(n.data[0],n.data[1]),postMessage([n.data[0].length])):t.flush()}},ct=function(t,n,e,i,r,s,a){var o,u=Q(t,i,r,function(t,e){t?(u.terminate(),n.ondata.call(n,t)):Array.isArray(e)?1==e.length?(n.queuedSize-=e[0],n.ondrain&&n.ondrain(e[0])):(e[1]&&u.terminate(),n.ondata.call(n,t,e[0],e[1])):a(e)});u.postMessage(e),n.queuedSize=0,n.push=function(t,e){n.ondata||E(5),o&&n.ondata(E(4,0,1),null,!!e),n.queuedSize+=t.length,u.postMessage([t,o=e],[t.buffer])},n.terminate=function(){u.terminate()},s&&(n.flush=function(){u.postMessage([])})},ht=function(t,n){return t[n]|t[n+1]<<8},lt=function(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16|t[n+3]<<24)>>>0},pt=function(t,n){return lt(t,n)+4294967296*lt(t,n+4)},dt=function(t,n,e){for(;e;++n)t[n]=e,e>>>=8},vt=function(t,n){var e=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&dt(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),e){t[3]=8;for(var i=0;i<=e.length;++i)t[i+10]=e.charCodeAt(i)}},gt=function(t){31==t[0]&&139==t[1]&&8==t[2]||E(6,"invalid gzip data");var n=t[3],e=10;4&n&&(e+=2+(t[10]|t[11]<<8));for(var i=(n>>3&1)+(n>>4&1);i>0;i-=!t[e++]);return e+(2&n)},mt=function(t){var n=t.length;return(t[n-4]|t[n-3]<<8|t[n-2]<<16|t[n-1]<<24)>>>0},yt=function(t){return 10+(t.filename?t.filename.length+1:0)},wt=function(t,n){var e=n.level,i=0==e?0:e<6?1:9==e?3:2;if(t[0]=120,t[1]=i<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var r=K();r.p(n.dictionary),dt(t,2,r.d())}},bt=function(t,n){return(8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31)&&E(6,"invalid zlib data"),(t[1]>>5&1)==+!n&&E(6,"invalid zlib data: "+(32&t[1]?"need":"unexpected")+" dictionary"),2+(t[1]>>3&4)};function zt(t,n){return"function"==typeof t&&(n=t,t={}),this.ondata=n,t}var xt=function(){function t(t,n){if("function"==typeof t&&(n=t,t={}),this.ondata=n,this.o=t||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new r(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return t.prototype.p=function(t,n){this.ondata(X(t,this.o,0,0,this.s),n)},t.prototype.push=function(t,n){this.ondata||E(5),this.s.l&&E(4);var e=t.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new r(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}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&n,(this.s.z>this.s.w+8191||n)&&(this.p(this.b,n||!1),this.s.w=this.s.i,this.s.i-=2)},t.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},t}();n.Deflate=xt;var At=function(){return function(t,n){ct([nt,function(){return[ft,xt]}],this,zt.call(this,t,n),function(t){var n=new xt(t.data);onmessage=ft(n)},6,1)}}();function St(t,n,e){return e||(e=n,n={}),"function"!=typeof e&&E(7),ut(t,n,[nt],function(t){return at(kt(t.data[0],t.data[1]))},0,e)}function kt(t,n){return X(t,n||{},0,0)}n.AsyncDeflate=At,n.deflate=St,n.deflateSync=kt;var Ct=function(){function t(t,n){"function"==typeof t&&(n=t,t={}),this.ondata=n;var e=t&&t.dictionary&&t.dictionary.subarray(-32768);this.s={i:0,b:e?e.length:0},this.o=new r(32768),this.p=new r(0),e&&this.o.set(e)}return t.prototype.e=function(t){if(this.ondata||E(5),this.d&&E(4),this.p.length){if(t.length){var n=new r(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length),this.p=n}}else this.p=t},t.prototype.c=function(t){this.s.i=+(this.d=t||!1);var n=this.s.b,e=_(this.p,this.s,this.o);this.ondata(P(e,n,this.s.b),this.d),this.o=P(e,this.s.b-32768),this.s.b=this.o.length,this.p=P(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,n){this.e(t),this.c(n)},t}();n.Inflate=Ct;var Ut=function(){return function(t,n){ct([tt,function(){return[ft,Ct]}],this,zt.call(this,t,n),function(t){var n=new Ct(t.data);onmessage=ft(n)},7,0)}}();function Mt(t,n,e){return e||(e=n,n={}),"function"!=typeof e&&E(7),ut(t,n,[tt],function(t){return at(Tt(t.data[0],ot(t.data[1])))},1,e)}function Tt(t,n){return _(t,{i:2},n&&n.out,n&&n.dictionary)}n.AsyncInflate=Ut,n.inflate=Mt,n.inflateSync=Tt;var It=function(){function t(t,n){this.c=B(),this.l=0,this.v=1,xt.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),this.l+=t.length,xt.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var e=X(t,this.o,this.v&&yt(this.o),n&&8,this.s);this.v&&(vt(e,this.o),this.v=0),n&&(dt(e,e.length-8,this.c.d()),dt(e,e.length-4,this.l)),this.ondata(e,n)},t.prototype.flush=function(){xt.prototype.flush.call(this)},t}();n.Gzip=It,n.Compress=It;var Pt=function(){return function(t,n){ct([nt,et,function(){return[ft,xt,It]}],this,zt.call(this,t,n),function(t){var n=new It(t.data);onmessage=ft(n)},8,1)}}();function Zt(t,n,e){return e||(e=n,n={}),"function"!=typeof e&&E(7),ut(t,n,[nt,et,function(){return[Et]}],function(t){return at(Et(t.data[0],t.data[1]))},2,e)}function Et(t,n){n||(n={});var e=B(),i=t.length;e.p(t);var r=X(t,n,yt(n),8),s=r.length;return vt(r,n),dt(r,s-8,e.d()),dt(r,s-4,i),r}n.AsyncGzip=Pt,n.AsyncCompress=Pt,n.gzip=Zt,n.compress=Zt,n.gzipSync=Et,n.compressSync=Et;var _t=function(){function t(t,n){this.v=1,this.r=0,Ct.call(this,t,n)}return t.prototype.push=function(t,n){if(Ct.prototype.e.call(this,t),this.r+=t.length,this.v){var e=this.p.subarray(this.v-1),i=e.length>3?gt(e):4;if(i>e.length){if(!n)return}else this.v>1&&this.onmember&&this.onmember(this.r-e.length);this.p=e.subarray(i),this.v=0}Ct.prototype.c.call(this,n),!this.s.f||this.s.l||n||(this.v=I(this.s.p)+9,this.s={i:0},this.o=new r(0),this.push(new r(0),n))},t}();n.Gunzip=_t;var Ot=function(){return function(t,n){var e=this;ct([tt,it,function(){return[ft,Ct,_t]}],this,zt.call(this,t,n),function(t){var n=new _t(t.data);n.onmember=function(t){return postMessage(t)},onmessage=ft(n)},9,0,function(t){return e.onmember&&e.onmember(t)})}}();function Ft(t,n,e){return e||(e=n,n={}),"function"!=typeof e&&E(7),ut(t,n,[tt,it,function(){return[Rt]}],function(t){return at(Rt(t.data[0],t.data[1]))},3,e)}function Rt(t,n){var e=gt(t);return e+8>t.length&&E(6,"invalid gzip data"),_(t.subarray(e,-8),{i:2},n&&n.out||new r(mt(t)),n&&n.dictionary)}n.AsyncGunzip=Ot,n.gunzip=Ft,n.gunzipSync=Rt;var qt=function(){function t(t,n){this.c=K(),this.v=1,xt.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),xt.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var e=X(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(wt(e,this.o),this.v=0),n&&dt(e,e.length-4,this.c.d()),this.ondata(e,n)},t.prototype.flush=function(){xt.prototype.flush.call(this)},t}();n.Zlib=qt;var Dt=function(){return function(t,n){ct([nt,rt,function(){return[ft,xt,qt]}],this,zt.call(this,t,n),function(t){var n=new qt(t.data);onmessage=ft(n)},10,1)}}();function Nt(t,n){n||(n={});var e=K();e.p(t);var i=X(t,n,n.dictionary?6:2,4);return wt(i,n),dt(i,i.length-4,e.d()),i}n.AsyncZlib=Dt,n.zlib=function(t,n,e){return e||(e=n,n={}),"function"!=typeof e&&E(7),ut(t,n,[nt,rt,function(){return[Nt]}],function(t){return at(Nt(t.data[0],t.data[1]))},4,e)},n.zlibSync=Nt;var jt=function(){function t(t,n){Ct.call(this,t,n),this.v=t&&t.dictionary?2:1}return t.prototype.push=function(t,n){if(Ct.prototype.e.call(this,t),this.v){if(this.p.length<6&&!n)return;this.p=this.p.subarray(bt(this.p,this.v-1)),this.v=0}n&&(this.p.length<4&&E(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),Ct.prototype.c.call(this,n)},t}();n.Unzlib=jt;var Lt=function(){return function(t,n){ct([tt,st,function(){return[ft,Ct,jt]}],this,zt.call(this,t,n),function(t){var n=new jt(t.data);onmessage=ft(n)},11,0)}}();function Wt(t,n,e){return e||(e=n,n={}),"function"!=typeof e&&E(7),ut(t,n,[tt,st,function(){return[Gt]}],function(t){return at(Gt(t.data[0],ot(t.data[1])))},5,e)}function Gt(t,n){return _(t.subarray(bt(t,n&&n.dictionary),-4),{i:2},n&&n.out,n&&n.dictionary)}n.AsyncUnzlib=Lt,n.unzlib=Wt,n.unzlibSync=Gt;var $t=function(){function t(t,n){this.o=zt.call(this,t,n)||{},this.G=_t,this.I=Ct,this.Z=jt}return t.prototype.i=function(){var t=this;this.s.ondata=function(n,e){t.ondata(n,e)}},t.prototype.push=function(t,n){if(this.ondata||E(5),this.s)this.s.push(t,n);else{if(this.p&&this.p.length){var e=new r(this.p.length+t.length);e.set(this.p),e.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,n),this.p=null)}},t}();n.Decompress=$t;var Ht=function(){function t(t,n){$t.call(this,t,n),this.queuedSize=0,this.G=Ot,this.I=Ut,this.Z=Lt}return t.prototype.i=function(){var t=this;this.s.ondata=function(n,e,i){t.ondata(n,e,i)},this.s.ondrain=function(n){t.queuedSize-=n,t.ondrain&&t.ondrain(n)}},t.prototype.push=function(t,n){this.queuedSize+=t.length,$t.prototype.push.call(this,t,n)},t}();n.AsyncDecompress=Ht,n.decompress=function(t,n,e){return e||(e=n,n={}),"function"!=typeof e&&E(7),31==t[0]&&139==t[1]&&8==t[2]?Ft(t,n,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Mt(t,n,e):Wt(t,n,e)},n.decompressSync=function(t,n){return 31==t[0]&&139==t[1]&&8==t[2]?Rt(t,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Tt(t,n):Gt(t,n)};var Bt=function(t,n,e,i){for(var s in t){var a=t[s],o=n+s,u=i;Array.isArray(a)&&(u=J(i,a[1]),a=a[0]),a instanceof r?e[o]=[a,u]:(e[o+="/"]=[new r(0),u],Bt(a,o,e,i))}},Kt="undefined"!=typeof TextEncoder&&new TextEncoder,Xt="undefined"!=typeof TextDecoder&&new TextDecoder,Jt=0;try{Xt.decode(G,{stream:!0}),Jt=1}catch(t){}var Vt=function(t){for(var n="",e=0;;){var i=t[e++],r=(i>127)+(i>223)+(i>239);if(e+r>t.length)return{s:n,r:P(t,e-1)};r?3==r?(i=((15&i)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i)):n+=1&r?String.fromCharCode((31&i)<<6|63&t[e++]):String.fromCharCode((15&i)<<12|(63&t[e++])<<6|63&t[e++]):n+=String.fromCharCode(i)}},Yt=function(){function t(t){this.ondata=t,Jt?this.t=new TextDecoder:this.p=G}return t.prototype.push=function(t,n){if(this.ondata||E(5),n=!!n,this.t)return this.ondata(this.t.decode(t,{stream:!0}),n),void(n&&(this.t.decode().length&&E(8),this.t=null));this.p||E(4);var e=new r(this.p.length+t.length);e.set(this.p),e.set(t,this.p.length);var i=Vt(e),s=i.s,a=i.r;n?(a.length&&E(8),this.p=null):this.p=a,this.ondata(s,n)},t}();n.DecodeUTF8=Yt;var Qt=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(tn(t),this.d=n||!1)},t}();function tn(t,n){if(n){for(var e=new r(t.length),i=0;i<t.length;++i)e[i]=t.charCodeAt(i);return e}if(Kt)return Kt.encode(t);var s=t.length,a=new r(t.length+(t.length>>1)),o=0,u=function(t){a[o++]=t};for(i=0;i<s;++i){if(o+5>a.length){var f=new r(o+8+(s-i<<1));f.set(a),a=f}var c=t.charCodeAt(i);c<128||n?u(c):c<2048?(u(192|c>>6),u(128|63&c)):c>55295&&c<57344?(u(240|(c=65536+(1047552&c)|1023&t.charCodeAt(++i))>>18),u(128|c>>12&63),u(128|c>>6&63),u(128|63&c)):(u(224|c>>12),u(128|c>>6&63),u(128|63&c))}return P(a,0,o)}function nn(t,n){if(n){for(var e="",i=0;i<t.length;i+=16384)e+=String.fromCharCode.apply(null,t.subarray(i,i+16384));return e}if(Xt)return Xt.decode(t);var r=Vt(t),s=r.s;return(e=r.r).length&&E(8),s}n.EncodeUTF8=Qt,n.strToU8=tn,n.strFromU8=nn;var en=function(t){return 1==t?3:t<6?2:9==t?1:0},rn=function(t,n){return n+30+ht(t,n+26)+ht(t,n+28)},sn=function(t,n,e){var i=ht(t,n+28),r=nn(t.subarray(n+46,n+46+i),!(2048&ht(t,n+8))),s=n+46+i,a=lt(t,n+20),o=e&&4294967295==a?an(t,s):[a,lt(t,n+24),lt(t,n+42)],u=o[0],f=o[1],c=o[2];return[ht(t,n+10),u,f,r,s+ht(t,n+30)+ht(t,n+32),c]},an=function(t,n){for(;1!=ht(t,n);n+=4+ht(t,n+2));return[pt(t,n+12),pt(t,n+4),pt(t,n+20)]},on=function(t){var n=0;if(t)for(var e in t){var i=t[e].length;i>65535&&E(9),n+=i+4}return n},un=function(t,n,e,i,r,s,a,o){var u=i.length,f=e.extra,c=o&&o.length,h=on(f);dt(t,n,null!=a?33639248:67324752),n+=4,null!=a&&(t[n++]=20,t[n++]=e.os),t[n]=20,n+=2,t[n++]=e.flag<<1|(s<0&&8),t[n++]=r&&8,t[n++]=255&e.compression,t[n++]=e.compression>>8;var l=new Date(null==e.mtime?Date.now():e.mtime),p=l.getFullYear()-1980;if((p<0||p>119)&&E(10),dt(t,n,p<<25|l.getMonth()+1<<21|l.getDate()<<16|l.getHours()<<11|l.getMinutes()<<5|l.getSeconds()>>1),n+=4,-1!=s&&(dt(t,n,e.crc),dt(t,n+4,s<0?-s-2:s),dt(t,n+8,e.size)),dt(t,n+12,u),dt(t,n+14,h),n+=16,null!=a&&(dt(t,n,c),dt(t,n+6,e.attrs),dt(t,n+10,a),n+=14),t.set(i,n),n+=u,h)for(var d in f){var v=f[d],g=v.length;dt(t,n,+d),dt(t,n+2,g),t.set(v,n+4),n+=4+g}return c&&(t.set(o,n),n+=c),n},fn=function(t,n,e,i,r){dt(t,n,101010256),dt(t,n+8,e),dt(t,n+10,e),dt(t,n+12,i),dt(t,n+16,r)},cn=function(){function t(t){this.filename=t,this.c=B(),this.size=0,this.compression=0}return t.prototype.process=function(t,n){this.ondata(null,t,n)},t.prototype.push=function(t,n){this.ondata||E(5),this.c.p(t),this.size+=t.length,n&&(this.crc=this.c.d()),this.process(t,n||!1)},t}();n.ZipPassThrough=cn;var hn=function(){function t(t,n){var e=this;n||(n={}),cn.call(this,t),this.d=new xt(n,function(t,n){e.ondata(null,t,n)}),this.compression=8,this.flag=en(n.level)}return t.prototype.process=function(t,n){try{this.d.push(t,n)}catch(t){this.ondata(t,null,n)}},t.prototype.push=function(t,n){cn.prototype.push.call(this,t,n)},t}();n.ZipDeflate=hn;var ln=function(){function t(t,n){var e=this;n||(n={}),cn.call(this,t),this.d=new At(n,function(t,n,i){e.ondata(t,n,i)}),this.compression=8,this.flag=en(n.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,n){this.d.push(t,n)},t.prototype.push=function(t,n){cn.prototype.push.call(this,t,n)},t}();n.AsyncZipDeflate=ln;var pn=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var n=this;if(this.ondata||E(5),2&this.d)this.ondata(E(4+8*(1&this.d),0,1),null,!1);else{var e=tn(t.filename),i=e.length,s=t.comment,a=s&&tn(s),o=i!=t.filename.length||a&&s.length!=a.length,u=i+on(t.extra)+30;i>65535&&this.ondata(E(11,0,1),null,!1);var f=new r(u);un(f,0,t,e,o,-1);var c=[f],h=function(){for(var t=0,e=c;t<e.length;t++){var i=e[t];n.ondata(null,i,!1)}c=[]},l=this.d;this.d=0;var p=this.u.length,d=J(t,{f:e,u:o,o:a,t:function(){t.terminate&&t.terminate()},r:function(){if(h(),l){var t=n.u[p+1];t?t.r():n.d=1}l=1}}),v=0;t.ondata=function(e,i,s){if(e)n.ondata(e,i,s),n.terminate();else if(v+=i.length,c.push(i),s){var a=new r(16);dt(a,0,134695760),dt(a,4,t.crc),dt(a,8,v),dt(a,12,t.size),c.push(a),d.c=v,d.b=u+v+16,d.crc=t.crc,d.size=t.size,l&&d.r(),l=1}else l&&h()},this.u.push(d)}},t.prototype.end=function(){var t=this;2&this.d?this.ondata(E(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,n=0,e=0,i=0,s=this.u;i<s.length;i++)e+=46+(f=s[i]).f.length+on(f.extra)+(f.o?f.o.length:0);for(var a=new r(e+22),o=0,u=this.u;o<u.length;o++){var f=u[o];un(a,t,f,f.f,f.u,-f.c-2,n,f.o),t+=46+f.f.length+on(f.extra)+(f.o?f.o.length:0),n+=f.b}fn(a,t,this.u.length,e,n),this.ondata(null,a,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,n=this.u;t<n.length;t++)n[t].t();this.d=2},t}();n.Zip=pn,n.zip=function(t,n,e){e||(e=n,n={}),"function"!=typeof e&&E(7);var i={};Bt(t,"",i,n);var s=Object.keys(i),a=s.length,o=0,u=0,f=a,c=new Array(a),h=[],l=function(){for(var t=0;t<h.length;++t)h[t]()},p=function(t,n){yn(function(){e(t,n)})};yn(function(){p=e});var d=function(){var t=new r(u+22),n=o,e=u-o;u=0;for(var i=0;i<f;++i){var s=c[i];try{var a=s.c.length;un(t,u,s,s.f,s.u,a);var h=30+s.f.length+on(s.extra),l=u+h;t.set(s.c,l),un(t,o,s,s.f,s.u,a,u,s.m),o+=16+h+(s.m?s.m.length:0),u=l+a}catch(t){return p(t,null)}}fn(t,o,c.length,e,n),p(null,t)};a||d();for(var v=function(t){var n=s[t],e=i[n],r=e[0],f=e[1],v=B(),g=r.length;v.p(r);var m=tn(n),y=m.length,w=f.comment,b=w&&tn(w),z=b&&b.length,x=on(f.extra),A=0==f.level?0:8,S=function(e,i){if(e)l(),p(e,null);else{var r=i.length;c[t]=J(f,{size:g,crc:v.d(),c:i,f:m,m:b,u:y!=n.length||b&&w.length!=z,compression:A}),o+=30+y+x+r,u+=76+2*(y+x)+(z||0)+r,--a||d()}};if(y>65535&&S(E(11,0,1),null),A)if(g<16e4)try{S(null,kt(r,f))}catch(t){S(t,null)}else h.push(St(r,f,S));else S(null,r)},g=0;g<f;++g)v(g);return l},n.zipSync=function(t,n){n||(n={});var e={},i=[];Bt(t,"",e,n);var s=0,a=0;for(var o in e){var u=e[o],f=u[0],c=u[1],h=0==c.level?0:8,l=(S=tn(o)).length,p=c.comment,d=p&&tn(p),v=d&&d.length,g=on(c.extra);l>65535&&E(11);var m=h?kt(f,c):f,y=m.length,w=B();w.p(f),i.push(J(c,{size:f.length,crc:w.d(),c:m,f:S,m:d,u:l!=o.length||d&&p.length!=v,o:s,compression:h})),s+=30+l+g+y,a+=76+2*(l+g)+(v||0)+y}for(var b=new r(a+22),z=s,x=a-s,A=0;A<i.length;++A){var S=i[A];un(b,S.o,S,S.f,S.u,S.c.length);var k=30+S.f.length+on(S.extra);b.set(S.c,S.o+k),un(b,s,S,S.f,S.u,S.c.length,S.o,S.m),s+=16+k+(S.m?S.m.length:0)}return fn(b,s,i.length,x,z),b};var dn=function(){function t(){}return t.prototype.push=function(t,n){this.ondata(null,t,n)},t.compression=0,t}();n.UnzipPassThrough=dn;var vn=function(){function t(){var t=this;this.i=new Ct(function(n,e){t.ondata(null,n,e)})}return t.prototype.push=function(t,n){try{this.i.push(t,n)}catch(t){this.ondata(t,null,n)}},t.compression=8,t}();n.UnzipInflate=vn;var gn=function(){function t(t,n){var e=this;n<32e4?this.i=new Ct(function(t,n){e.ondata(null,t,n)}):(this.i=new Ut(function(t,n,i){e.ondata(t,n,i)}),this.terminate=this.i.terminate)}return t.prototype.push=function(t,n){this.i.terminate&&(t=P(t,0)),this.i.push(t,n)},t.compression=8,t}();n.AsyncUnzipInflate=gn;var mn=function(){function t(t){this.onfile=t,this.k=[],this.o={0:dn},this.p=G}return t.prototype.push=function(t,n){var e=this;if(this.onfile||E(5),this.p||E(4),this.c>0){var i=Math.min(this.c,t.length),s=t.subarray(0,i);if(this.c-=i,this.d?this.d.push(s,!this.c):this.k[0].push(s),(t=t.subarray(i)).length)return this.push(t,n)}else{var a=0,o=0,u=void 0,f=void 0;this.p.length?t.length?((f=new r(this.p.length+t.length)).set(this.p),f.set(t,this.p.length)):f=this.p:f=t;for(var c=f.length,h=this.c,l=h&&this.d,p=function(){var t,n=lt(f,o);if(67324752==n){a=1,u=o,d.d=null,d.c=0;var i=ht(f,o+6),r=ht(f,o+8),s=2048&i,l=8&i,p=ht(f,o+26),v=ht(f,o+28);if(c>o+30+p+v){var g=[];d.k.unshift(g),a=2;var m,y=lt(f,o+18),w=lt(f,o+22),b=nn(f.subarray(o+30,o+=30+p),!s);4294967295==y?(t=l?[-2]:an(f,o),y=t[0],w=t[1]):l&&(y=-1),o+=v,d.c=y;var z={name:b,compression:r,start:function(){if(z.ondata||E(5),y){var t=e.o[r];t||z.ondata(E(14,"unknown compression type "+r,1),null,!1),(m=y<0?new t(b):new t(b,y,w)).ondata=function(t,n,e){z.ondata(t,n,e)};for(var n=0,i=g;n<i.length;n++){var s=i[n];m.push(s,!1)}e.k[0]==g&&e.c?e.d=m:m.push(G,!0)}else z.ondata(null,G,!0)},terminate:function(){m&&m.terminate&&m.terminate()}};y>=0&&(z.size=y,z.originalSize=w),d.onfile(z)}return"break"}if(h){if(134695760==n)return u=o+=12+(-2==h&&8),a=3,d.c=0,"break";if(33639248==n)return u=o-=4,a=3,d.c=0,"break"}},d=this;o<c-4&&"break"!==p();++o);if(this.p=G,h<0){var v=a?f.subarray(0,u-12-(-2==h&&8)-(134695760==lt(f,u-16)&&4)):f.subarray(0,o);l?l.push(v,!!a):this.k[+(2==a)].push(v)}if(2&a)return this.push(f.subarray(o),n);this.p=f.subarray(o)}n&&(this.c&&E(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}();n.Unzip=mn;var yn="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()};n.unzip=function(t,n,e){e||(e=n,n={}),"function"!=typeof e&&E(7);var i=[],s=function(){for(var t=0;t<i.length;++t)i[t]()},a={},o=function(t,n){yn(function(){e(t,n)})};yn(function(){o=e});for(var u=t.length-22;101010256!=lt(t,u);--u)if(!u||t.length-u>65558)return o(E(13,0,1),null),s;var f=ht(t,u+8);if(f){var c=f,h=lt(t,u+16),l=4294967295==h||65535==c;if(l){var p=lt(t,u-12);(l=101075792==lt(t,p))&&(c=f=lt(t,p+32),h=lt(t,p+48))}for(var d=n&&n.filter,v=function(n){var e=sn(t,h,l),u=e[0],c=e[1],p=e[2],v=e[3],g=e[4],m=e[5],y=rn(t,m);h=g;var w=function(t,n){t?(s(),o(t,null)):(n&&(a[v]=n),--f||o(null,a))};if(!d||d({name:v,size:c,originalSize:p,compression:u}))if(u)if(8==u){var b=t.subarray(y,y+c);if(p<524288||c>.8*p)try{w(null,Tt(b,{out:new r(p)}))}catch(t){w(t,null)}else i.push(Mt(b,{size:p},w))}else w(E(14,"unknown compression type "+u,1),null);else w(null,P(t,y,y+c));else w(null,null)},g=0;g<c;++g)v()}else o(null,{});return s},n.unzipSync=function(t,n){for(var e={},i=t.length-22;101010256!=lt(t,i);--i)(!i||t.length-i>65558)&&E(13);var s=ht(t,i+8);if(!s)return{};var a=lt(t,i+16),o=4294967295==a||65535==s;if(o){var u=lt(t,i-12);(o=101075792==lt(t,u))&&(s=lt(t,u+32),a=lt(t,u+48))}for(var f=n&&n.filter,c=0;c<s;++c){var h=sn(t,a,o),l=h[0],p=h[1],d=h[2],v=h[3],g=h[4],m=h[5],y=rn(t,m);a=g,f&&!f({name:v,size:p,originalSize:d,compression:l})||(l?8==l?e[v]=Tt(t.subarray(y,y+p),{out:new r(d)}):E(14,"unknown compression type "+l):e[v]=P(t,y,y+p))}return e}}},n={};function e(i){var r=n[i];if(void 0!==r)return r.exports;var s=n[i]={exports:{}};return t[i](s,s.exports,e),s.exports}(()=>{const t=e(845),n=e(183),i=n.normalizeZipEntryPath;self.addEventListener("install",()=>{self.skipWaiting()}),self.addEventListener("activate",t=>{t.waitUntil(self.clients.claim())});const r=new Map,s="X-ZipSW-Cached-At",a="X-ZipSW-Asset-Source";let o={zipAssetCacheName:"zip-cache-v1",assetCacheTtlMs:72e5,logPrefix:"[zipSW]"};function u(...t){console.log(o.logPrefix,...t)}function f(...t){console.warn(o.logPrefix,...t)}function c(t){return t+(t.includes("?")?"&":"?")+"__zipsw_manifest__=1"}const h=new Map;function l(t,n){return new Response(t,{status:n,headers:{"Access-Control-Allow-Origin":"*"}})}self.addEventListener("message",t=>{if(!t.data)return;const{type:e,zipUrl:s,files:a,config:h}=t.data;if("ZIP_SW_CONFIG"!==e)if("ZIP_MANIFEST"===e){if(s&&a){const e=(0,n.stripTParam)(s),h=new Map;let l=!1;for(const t of a){const n=i(t.filename);""!==n?(h.has(n)&&f("duplicate manifest key after normalize; overwriting",n),h.set(n,t)):l=!0}const p=r.get(e);if(0===h.size)return void f("rejecting empty manifest; keeping existing",{zipUrl:e,existingSize:p?p.size:0,hadEmptyKey:l});if(p&&p.size>h.size)return void f("rejecting smaller manifest; keeping existing",{zipUrl:e,incomingSize:h.size,existingSize:p.size});r.set(e,h),t.waitUntil(async function(t,n){try{const e=await caches.open(o.zipAssetCacheName),i=Array.from(n.values());await e.put(new Request(c(t)),new Response(JSON.stringify(i),{headers:{"Content-Type":"application/json"}}))}catch(t){f("failed to persist manifest",t)}}(e,h));const d=Array.from(h.keys());u("manifest all paths",d);const v=d.slice(0,40);u("ZIP_MANIFEST loaded",{zipUrl:e,entryCount:h.size,sampleKeys:v,replacedExistingSize:p?p.size:0})}}else"PURGE_OTHER_ZIP_ASSETS"===e&&s&&t.waitUntil(async function(t){try{const e=(0,n.stripTParam)(t),i=await caches.open(o.zipAssetCacheName),s=await i.keys();for(const t of s){const r=t.url;if(r.includes("__zipsw_manifest__=1")){const s=m(r);s&&(0,n.stripTParam)(s)!==e&&await i.delete(t);continue}const s=(0,n.parseZipAssetRequest)(r);s&&(0,n.stripTParam)(s.zipUrl)!==e&&await i.delete(t)}for(const t of r.keys())t!==e&&r.delete(t)}catch(t){f("purgeOtherZipAssets failed",t)}}(s));else!function(t){t&&("string"==typeof t.zipAssetCacheName&&t.zipAssetCacheName.trim()&&(o={...o,zipAssetCacheName:t.zipAssetCacheName}),"number"==typeof t.assetCacheTtlMs&&Number.isFinite(t.assetCacheTtlMs)&&(o={...o,assetCacheTtlMs:t.assetCacheTtlMs}),"string"==typeof t.logPrefix&&t.logPrefix.trim()&&(o={...o,logPrefix:t.logPrefix}))}(h)});const p={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"};function d(t){const n=t.headers.get(s);if(!n)return!0;const e=parseInt(n,10);return!Number.isFinite(e)||Date.now()-e>o.assetCacheTtlMs}const v="&__zipsw_manifest__=1",g="?__zipsw_manifest__=1";function m(t){return t.endsWith(v)?t.slice(0,-v.length):t.endsWith(g)?t.slice(0,-g.length):null}self.addEventListener("fetch",e=>{if("GET"!==e.request.method)return;const v=(0,n.parseZipAssetRequest)(e.request.url);if(!v)return;const g=(0,n.stripTParam)(v.zipUrl),m=v.internalPath,y=i(m);e.respondWith((async()=>{let v=r.get(g);if(v||(v=await function(t){const n=r.get(t);if(n)return Promise.resolve(n);let e=h.get(t);return e||(e=(async()=>{const n=await async function(t){try{const n=await caches.open(o.zipAssetCacheName),e=await n.match(c(t));if(!e)return null;const r=await e.json();if(!Array.isArray(r)||0===r.length)return null;const s=new Map;for(const t of r){const n=i(t.filename);""!==n&&s.set(n,t)}return s.size>0?s:null}catch(t){return f("failed to load persisted manifest",t),null}}(t);return n&&(r.set(t,n),u("rehydrated manifest from cache",{zipUrl:t,entryCount:n.size})),n})().finally(()=>{h.delete(t)}),h.set(t,e),e)}(g)??void 0),!v){const t=Array.from(r.keys());return f("manifest missing for zipUrl",{requestedZipUrl:g,knownZipUrls:t}),l("Zip manifest not loaded",404)}const w=function(t,n){if(t.has(n))return{key:n,info:t.get(n)};const e=[];for(const i of t.keys())i.endsWith("/"+n)&&e.push(i);if(1===e.length){const n=e[0];return{key:n,info:t.get(n)}}if(e.length>1){e.sort((t,n)=>t.length-n.length),f("ambiguous suffix match; using shortest path",{requested:n,picked:e[0],candidates:e.slice(0,8)});const i=e[0];return{key:i,info:t.get(i)}}return null}(v,y);if(!w){const t=Array.from(v.keys()).slice(0,50);return f("file not in manifest",{zipUrl:g,internalPathRaw:m,internalPathNormalized:y,manifestSize:v.size,sampleKeys:t}),l("File not found in zip manifest",404)}const{key:b,info:z}=w;b!==y&&u("resolved via suffix match",{requested:y,manifestKey:b});const x=function(t,e){return new Request((0,n.canonicalZipAssetRequestUrl)(t,e),{method:"GET"})}(g,b);let A=null,S="network";try{const t=await caches.open(o.zipAssetCacheName),n=await t.match(x);if(n)if(d(n))try{await t.delete(x)}catch(t){f("asset cache delete expired failed",t)}else A=await n.blob(),S="cache-api"}catch(t){f("asset cache read failed",t)}if(!A){const n=z.offset,e=z.nextOffset-1;f("fetching zip chunk from",g);const i=await fetch(g,{headers:{Range:`bytes=${n}-${e}`}});if(!i.ok&&206!==i.status)return l("Failed to fetch zip chunk",i.status);const r=await i.arrayBuffer(),a=new DataView(r);if(67324752!==a.getUint32(0,!0))return l("Invalid Local File Header",500);const u=a.getUint16(26,!0),c=a.getUint16(28,!0),h=new Uint8Array(r,30+u+c,z.compressedSize);let v;if(8===z.compression)v=(0,t.inflateSync)(h);else{if(0!==z.compression)return l(`Unsupported compression method: ${z.compression}`,500);v=h}const m=function(t){const n=t.split(".").pop()?.toLowerCase();return n?p[n]??"application/octet-stream":"application/octet-stream"}(b);A=new Blob([v],{type:m}),S="network",await async function(t,n){try{const e=await caches.open(o.zipAssetCacheName),i=await e.match(t);if(i&&!d(i))return;const r=n.type||"application/octet-stream";await e.put(t,new Response(n,{status:200,headers:{"Content-Type":r,"Content-Length":String(n.size),"Access-Control-Allow-Origin":"*",[s]:String(Date.now())}}))}catch(t){f("asset cache put failed",t)}}(x,A)}if(e.request.headers.has("range")){const t=e.request.headers.get("range").replace(/bytes=/,"").split("-"),n=parseInt(t[0],10),i=t[1]?parseInt(t[1],10):A.size-1,r=A.slice(n,i+1);return new Response(r,{status:206,headers:{"Content-Type":A.type,"Content-Range":`bytes ${n}-${i}/${A.size}`,"Content-Length":r.size.toString(),"Accept-Ranges":"bytes","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":a,[a]:S}})}return new Response(A,{status:200,headers:{"Content-Type":A.type,"Content-Length":A.size.toString(),"Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":a,[a]:S}})})())})})()})();
|
|
1
|
+
(()=>{"use strict";var t={183(t,n){function e(t){const n=t.indexOf("?");if(-1===n)return t.split("#")[0];const e=t.indexOf("#",n),i=t.substring(0,n),r=-1===e?t.substring(n+1):t.substring(n+1,e),s=-1===e?"":t.substring(e),a=r.split("&").filter(t=>{const n=t.indexOf("=");return"t"!==(-1===n?t:t.substring(0,n))});return 0===a.length?i+s:i+"?"+a.join("&")+s}function i(t){try{return decodeURIComponent(t)}catch{return t}}Object.defineProperty(n,"__esModule",{value:!0}),n.normalizeZipUrlForSw=void 0,n.isZipPackage=function(t){try{return new URL(t).pathname.endsWith(".zip")}catch{return t.split("?")[0].endsWith(".zip")}},n.stripTParam=e,n.normalizeZipEntryPath=function(t){let n=t.replace(/\\/g,"/");for(;n.startsWith("/");)n=n.slice(1);return n},n.parseZipAssetRequest=function(t){const n=/\.zip([/?])/.exec(t);if(!n)return null;const e=n.index+4,r=n[1],s=t.substring(0,e);if("/"===r){const n=t.substring(e+1),r=n.indexOf("?"),a=-1===r?n:n.substring(0,r);return""===a?null:{zipUrl:s,internalPath:i(a)}}const a=t.substring(e),o=a.indexOf("/");if(-1===o)return null;const u=a.substring(0,o),c=a.substring(o+1),f=c.indexOf("?"),l=-1===f?c:c.substring(0,f);return""===l?null:{zipUrl:s+u,internalPath:i(l)}},n.canonicalZipAssetRequestUrl=function(t,n){return t+"/"+encodeURI(n)},n.normalizeZipUrlForSw=e},845(t,n){var e={},i=function(t,n,i,r,s){var a=new Worker(e[n]||(e[n]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(t){var n=t.data,e=n.$e$;if(e){var i=new Error(e[0]);i.code=e[1],i.stack=e[2],s(i,null)}else s(null,n)},a.postMessage(i,r),a},r=Uint8Array,s=Uint16Array,a=Int32Array,o=new r([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]),u=new r([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]),c=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f=function(t,n){for(var e=new s(31),i=0;i<31;++i)e[i]=n+=1<<t[i-1];var r=new a(e[30]);for(i=1;i<30;++i)for(var o=e[i];o<e[i+1];++o)r[o]=o-e[i]<<5|i;return{b:e,r}},l=f(o,2),h=l.b,p=l.r;h[28]=258,p[258]=28;for(var d=f(u,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 b=function(t,n,e){for(var i=t.length,r=0,a=new s(n);r<i;++r)t[r]&&++a[t[r]-1];var o,u=new s(n);for(r=1;r<n;++r)u[r]=u[r-1]+a[r-1]<<1;if(e){o=new s(1<<n);var c=15-n;for(r=0;r<i;++r)if(t[r])for(var f=r<<4|t[r],l=n-t[r],h=u[t[r]-1]++<<l,p=h|(1<<l)-1;h<=p;++h)o[m[h]>>c]=f}else for(o=new s(i),r=0;r<i;++r)t[r]&&(o[r]=m[u[t[r]-1]++]>>15-t[r]);return o},z=new r(288);for(y=0;y<144;++y)z[y]=8;for(y=144;y<256;++y)z[y]=9;for(y=256;y<280;++y)z[y]=7;for(y=280;y<288;++y)z[y]=8;var A=new r(32);for(y=0;y<32;++y)A[y]=5;var U=b(z,9,0),S=b(z,9,1),k=b(A,5,0),x=b(A,5,1),C=function(t){for(var n=t[0],e=1;e<t.length;++e)t[e]>n&&(n=t[e]);return n},T=function(t,n,e){var i=n/8|0;return(t[i]|t[i+1]<<8)>>(7&n)&e},M=function(t,n){var e=n/8|0;return(t[e]|t[e+1]<<8|t[e+2]<<16)>>(7&n)},Z=function(t){return(t+7)/8|0},P=function(t,n,e){return(null==n||n<0)&&(n=0),(null==e||e>t.length)&&(e=t.length),new r(t.subarray(n,e))};n.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 _=["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"],E=function(t,n,e){var i=new Error(n||_[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,E),!e)throw i;return i},I=function(t,n,e,i){var s=t.length,a=i?i.length:0;if(!s||n.f&&!n.l)return e||new r(0);var f=!e,l=f||2!=n.i,p=n.i;f&&(e=new r(3*s));var d=function(t){var n=e.length;if(t>n){var i=new r(Math.max(2*n,t));i.set(e),e=i}},v=n.f||0,m=n.p||0,y=n.b||0,w=n.l,z=n.d,A=n.m,U=n.n,k=8*s;do{if(!w){v=T(t,m,1);var _=T(t,m+1,3);if(m+=3,!_){var I=t[(G=Z(m)+4)-4]|t[G-3]<<8,R=G+I;if(R>s){p&&E(0);break}l&&d(y+I),e.set(t.subarray(G,R),y),n.b=y+=I,n.p=m=8*R,n.f=v;continue}if(1==_)w=S,z=x,A=9,U=5;else if(2==_){var L=T(t,m,31)+257,O=T(t,m+10,15)+4,D=L+T(t,m+5,31)+1;m+=14;for(var q=new r(D),F=new r(19),N=0;N<O;++N)F[c[N]]=T(t,m+3*N,7);m+=3*O;var j=C(F),W=(1<<j)-1,$=b(F,j,1);for(N=0;N<D;){var G,B=$[T(t,m,W)];if(m+=15&B,(G=B>>4)<16)q[N++]=G;else{var H=0,K=0;for(16==G?(K=3+T(t,m,3),m+=2,H=q[N-1]):17==G?(K=3+T(t,m,7),m+=3):18==G&&(K=11+T(t,m,127),m+=7);K--;)q[N++]=H}}var V=q.subarray(0,L),X=q.subarray(L);A=C(V),U=C(X),w=b(V,A,1),z=b(X,U,1)}else E(1);if(m>k){p&&E(0);break}}l&&d(y+131072);for(var J=(1<<A)-1,Y=(1<<U)-1,Q=m;;Q=m){var tt=(H=w[M(t,m)&J])>>4;if((m+=15&H)>k){p&&E(0);break}if(H||E(2),tt<256)e[y++]=tt;else{if(256==tt){Q=m,w=null;break}var nt=tt-254;if(tt>264){var et=o[N=tt-257];nt=T(t,m,(1<<et)-1)+h[N],m+=et}var it=z[M(t,m)&Y],rt=it>>4;if(it||E(3),m+=15&it,X=g[rt],rt>3&&(et=u[rt],X+=M(t,m)&(1<<et)-1,m+=et),m>k){p&&E(0);break}l&&d(y+131072);var st=y+nt;if(y<X){var at=a-X,ot=Math.min(X,st);for(at+y<0&&E(3);y<ot;++y)e[y]=i[at+y]}for(;y<st;++y)e[y]=e[y-X]}}n.l=w,n.p=Q,n.b=y,n.f=v,w&&(v=1,n.m=A,n.d=z,n.n=U)}while(!v);return y!=e.length&&f?P(e,0,y):e.subarray(0,y)},R=function(t,n,e){e<<=7&n;var i=n/8|0;t[i]|=e,t[i+1]|=e>>8},L=function(t,n,e){e<<=7&n;var i=n/8|0;t[i]|=e,t[i+1]|=e>>8,t[i+2]|=e>>16},O=function(t,n){for(var e=[],i=0;i<t.length;++i)t[i]&&e.push({s:i,f:t[i]});var a=e.length,o=e.slice();if(!a)return{t:$,l:0};if(1==a){var u=new r(e[0].s+1);return u[e[0].s]=1,{t:u,l:1}}e.sort(function(t,n){return t.f-n.f}),e.push({s:-1,f:25001});var c=e[0],f=e[1],l=0,h=1,p=2;for(e[0]={s:-1,f:c.f+f.f,l:c,r:f};h!=a-1;)c=e[e[l].f<e[p].f?l++:p++],f=e[l!=h&&e[l].f<e[p].f?l++:p++],e[h++]={s:-1,f:c.f+f.f,l:c,r:f};var d=o[0].s;for(i=1;i<a;++i)o[i].s>d&&(d=o[i].s);var g=new s(d+1),v=D(e[h-1],g,0);if(v>n){i=0;var m=0,y=v-n,w=1<<y;for(o.sort(function(t,n){return g[n.s]-g[t.s]||t.f-n.f});i<a;++i){var b=o[i].s;if(!(g[b]>n))break;m+=w-(1<<v-g[b]),g[b]=n}for(m>>=y;m>0;){var z=o[i].s;g[z]<n?m-=1<<n-g[z]++-1:++i}for(;i>=0&&m;--i){var A=o[i].s;g[A]==n&&(--g[A],++m)}v=n}return{t:new r(g),l:v}},D=function(t,n,e){return-1==t.s?Math.max(D(t.l,n,e+1),D(t.r,n,e+1)):n[t.s]=e},q=function(t){for(var n=t.length;n&&!t[--n];);for(var e=new s(++n),i=0,r=t[0],a=1,o=function(t){e[i++]=t},u=1;u<=n;++u)if(t[u]==r&&u!=n)++a;else{if(!r&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(r),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(r);a=1,r=t[u]}return{c:e.subarray(0,i),n}},F=function(t,n){for(var e=0,i=0;i<n.length;++i)e+=t[i]*n[i];return e},N=function(t,n,e){var i=e.length,r=Z(n+2);t[r]=255&i,t[r+1]=i>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;s<i;++s)t[r+s+4]=e[s];return 8*(r+4+i)},j=function(t,n,e,i,r,a,f,l,h,p,d){R(n,d++,e),++r[256];for(var g=O(r,15),v=g.t,m=g.l,y=O(a,15),w=y.t,S=y.l,x=q(v),C=x.c,T=x.n,M=q(w),Z=M.c,P=M.n,_=new s(19),E=0;E<C.length;++E)++_[31&C[E]];for(E=0;E<Z.length;++E)++_[31&Z[E]];for(var I=O(_,7),D=I.t,j=I.l,W=19;W>4&&!D[c[W-1]];--W);var $,G,B,H,K=p+5<<3,V=F(r,z)+F(a,A)+f,X=F(r,v)+F(a,w)+f+14+3*W+F(_,D)+2*_[16]+3*_[17]+7*_[18];if(h>=0&&K<=V&&K<=X)return N(n,d,t.subarray(h,h+p));if(R(n,d,1+(X<V)),d+=2,X<V){$=b(v,m,0),G=v,B=b(w,S,0),H=w;var J=b(D,j,0);for(R(n,d,T-257),R(n,d+5,P-1),R(n,d+10,W-4),d+=14,E=0;E<W;++E)R(n,d+3*E,D[c[E]]);d+=3*W;for(var Y=[C,Z],Q=0;Q<2;++Q){var tt=Y[Q];for(E=0;E<tt.length;++E){var nt=31&tt[E];R(n,d,J[nt]),d+=D[nt],nt>15&&(R(n,d,tt[E]>>5&127),d+=tt[E]>>12)}}}else $=U,G=z,B=k,H=A;for(E=0;E<l;++E){var et=i[E];if(et>255){L(n,d,$[257+(nt=et>>18&31)]),d+=G[nt+257],nt>7&&(R(n,d,et>>23&31),d+=o[nt]);var it=31&et;L(n,d,B[it]),d+=H[it],it>3&&(L(n,d,et>>5&8191),d+=u[it])}else L(n,d,$[et]),d+=G[et]}return L(n,d,$[256]),d+G[256]},W=new a([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),$=new r(0),G=function(t,n,e,i,c,f){var l=f.z||t.length,h=new r(i+l+5*(1+Math.ceil(l/7e3))+c),d=h.subarray(i,h.length-c),g=f.l,m=7&(f.r||0);if(n){m&&(d[0]=f.r>>3);for(var y=W[n-1],w=y>>13,b=8191&y,z=(1<<e)-1,A=f.p||new s(32768),U=f.h||new s(z+1),S=Math.ceil(e/3),k=2*S,x=function(n){return(t[n]^t[n+1]<<S^t[n+2]<<k)&z},C=new a(25e3),T=new s(288),M=new s(32),_=0,E=0,I=f.i||0,R=0,L=f.w||0,O=0;I+2<l;++I){var D=x(I),q=32767&I,F=U[D];if(A[q]=F,U[D]=q,L<=I){var $=l-I;if((_>7e3||R>24576)&&($>423||!g)){m=j(t,d,0,C,T,M,E,R,O,I-O,m),R=_=E=0,O=I;for(var G=0;G<286;++G)T[G]=0;for(G=0;G<30;++G)M[G]=0}var B=2,H=0,K=b,V=q-F&32767;if($>2&&D==x(I-V))for(var X=Math.min(w,$)-1,J=Math.min(32767,I),Y=Math.min(258,$);V<=J&&--K&&q!=F;){if(t[I+B]==t[I+B-V]){for(var Q=0;Q<Y&&t[I+Q]==t[I+Q-V];++Q);if(Q>B){if(B=Q,H=V,Q>X)break;var tt=Math.min(V,Q-2),nt=0;for(G=0;G<tt;++G){var et=I-V+G&32767,it=et-A[et]&32767;it>nt&&(nt=it,F=et)}}}V+=(q=F)-(F=A[q])&32767}if(H){C[R++]=268435456|p[B]<<18|v[H];var rt=31&p[B],st=31&v[H];E+=o[rt]+u[st],++T[257+rt],++M[st],L=I+B,++_}else C[R++]=t[I],++T[t[I]]}}for(I=Math.max(I,L);I<l;++I)C[R++]=t[I],++T[t[I]];m=j(t,d,g,C,T,M,E,R,O,I-O,m),g||(f.r=7&m|d[m/8|0]<<3,m-=7,f.h=U,f.p=A,f.i=I,f.w=L)}else{for(I=f.w||0;I<l+g;I+=65535){var at=I+65535;at>=l&&(d[m/8|0]=g,at=l),m=N(d,m+1,t.subarray(I,at))}f.i=l}return P(h,0,i+Z(m)+c)},B=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var e=n,i=9;--i;)e=(1&e&&-306674912)^e>>>1;t[n]=e}return t}(),H=function(){var t=-1;return{p:function(n){for(var e=t,i=0;i<n.length;++i)e=B[255&e^n[i]]^e>>>8;t=e},d:function(){return~t}}},K=function(){var t=1,n=0;return{p:function(e){for(var i=t,r=n,s=0|e.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)r+=i+=e[a];i=(65535&i)+15*(i>>16),r=(65535&r)+15*(r>>16)}t=i,n=r},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},V=function(t,n,e,i,s){if(!s&&(s={l:1},n.dictionary)){var a=n.dictionary.subarray(-32768),o=new r(a.length+t.length);o.set(a),o.set(t,a.length),t=o,s.w=a.length}return G(t,null==n.level?6:n.level,null==n.mem?s.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+n.mem,e,i,s)},X=function(t,n){var e={};for(var i in t)e[i]=t[i];for(var i in n)e[i]=n[i];return e},J=function(t,n,e){for(var i=t(),r=t.toString(),s=r.slice(r.indexOf("[")+1,r.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<i.length;++a){var o=i[a],u=s[a];if("function"==typeof o){n+=";"+u+"=";var c=o.toString();if(o.prototype)if(-1!=c.indexOf("[native code]")){var f=c.indexOf(" ",8)+1;n+=c.slice(f,c.indexOf("(",f))}else for(var l in n+=c,o.prototype)n+=";"+u+".prototype."+l+"="+o.prototype[l].toString();else n+=c}else e[u]=o}return n},Y=[],Q=function(t,n,e,r){if(!Y[e]){for(var s="",a={},o=t.length-1,u=0;u<o;++u)s=J(t[u],s,a);Y[e]={c:J(t[o],s,a),e:a}}var c=X({},Y[e].e);return i(Y[e].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+n.toString()+"}",e,c,function(t){var n=[];for(var e in t)t[e].buffer&&n.push((t[e]=new t[e].constructor(t[e])).buffer);return n}(c),r)},tt=function(){return[r,s,a,o,u,c,h,g,S,x,m,_,b,C,T,M,Z,P,E,I,Mt,at,ot]},nt=function(){return[r,s,a,o,u,c,p,v,U,z,k,A,m,W,$,b,R,L,O,D,q,F,N,j,Z,P,G,V,kt,at]},et=function(){return[gt,yt,dt,H,B]},it=function(){return[vt,mt]},rt=function(){return[wt,dt,K]},st=function(){return[bt]},at=function(t){return postMessage(t,[t.buffer])},ot=function(t){return t&&{out:t.size&&new r(t.size),dictionary:t.dictionary}},ut=function(t,n,e,i,r,s){var a=Q(e,i,r,function(t,n){a.terminate(),s(t,n)});return a.postMessage([t,n],n.consume?[t.buffer]:[]),function(){a.terminate()}},ct=function(t){return t.ondata=function(t,n){return postMessage([t,n],[t.buffer])},function(n){n.data.length?(t.push(n.data[0],n.data[1]),postMessage([n.data[0].length])):t.flush()}},ft=function(t,n,e,i,r,s,a){var o,u=Q(t,i,r,function(t,e){t?(u.terminate(),n.ondata.call(n,t)):Array.isArray(e)?1==e.length?(n.queuedSize-=e[0],n.ondrain&&n.ondrain(e[0])):(e[1]&&u.terminate(),n.ondata.call(n,t,e[0],e[1])):a(e)});u.postMessage(e),n.queuedSize=0,n.push=function(t,e){n.ondata||E(5),o&&n.ondata(E(4,0,1),null,!!e),n.queuedSize+=t.length,u.postMessage([t,o=e],[t.buffer])},n.terminate=function(){u.terminate()},s&&(n.flush=function(){u.postMessage([])})},lt=function(t,n){return t[n]|t[n+1]<<8},ht=function(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16|t[n+3]<<24)>>>0},pt=function(t,n){return ht(t,n)+4294967296*ht(t,n+4)},dt=function(t,n,e){for(;e;++n)t[n]=e,e>>>=8},gt=function(t,n){var e=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&dt(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),e){t[3]=8;for(var i=0;i<=e.length;++i)t[i+10]=e.charCodeAt(i)}},vt=function(t){31==t[0]&&139==t[1]&&8==t[2]||E(6,"invalid gzip data");var n=t[3],e=10;4&n&&(e+=2+(t[10]|t[11]<<8));for(var i=(n>>3&1)+(n>>4&1);i>0;i-=!t[e++]);return e+(2&n)},mt=function(t){var n=t.length;return(t[n-4]|t[n-3]<<8|t[n-2]<<16|t[n-1]<<24)>>>0},yt=function(t){return 10+(t.filename?t.filename.length+1:0)},wt=function(t,n){var e=n.level,i=0==e?0:e<6?1:9==e?3:2;if(t[0]=120,t[1]=i<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var r=K();r.p(n.dictionary),dt(t,2,r.d())}},bt=function(t,n){return(8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31)&&E(6,"invalid zlib data"),(t[1]>>5&1)==+!n&&E(6,"invalid zlib data: "+(32&t[1]?"need":"unexpected")+" dictionary"),2+(t[1]>>3&4)};function zt(t,n){return"function"==typeof t&&(n=t,t={}),this.ondata=n,t}var At=function(){function t(t,n){if("function"==typeof t&&(n=t,t={}),this.ondata=n,this.o=t||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new r(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return t.prototype.p=function(t,n){this.ondata(V(t,this.o,0,0,this.s),n)},t.prototype.push=function(t,n){this.ondata||E(5),this.s.l&&E(4);var e=t.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new r(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}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&n,(this.s.z>this.s.w+8191||n)&&(this.p(this.b,n||!1),this.s.w=this.s.i,this.s.i-=2)},t.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},t}();n.Deflate=At;var Ut=function(){return function(t,n){ft([nt,function(){return[ct,At]}],this,zt.call(this,t,n),function(t){var n=new At(t.data);onmessage=ct(n)},6,1)}}();function St(t,n,e){return e||(e=n,n={}),"function"!=typeof e&&E(7),ut(t,n,[nt],function(t){return at(kt(t.data[0],t.data[1]))},0,e)}function kt(t,n){return V(t,n||{},0,0)}n.AsyncDeflate=Ut,n.deflate=St,n.deflateSync=kt;var xt=function(){function t(t,n){"function"==typeof t&&(n=t,t={}),this.ondata=n;var e=t&&t.dictionary&&t.dictionary.subarray(-32768);this.s={i:0,b:e?e.length:0},this.o=new r(32768),this.p=new r(0),e&&this.o.set(e)}return t.prototype.e=function(t){if(this.ondata||E(5),this.d&&E(4),this.p.length){if(t.length){var n=new r(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length),this.p=n}}else this.p=t},t.prototype.c=function(t){this.s.i=+(this.d=t||!1);var n=this.s.b,e=I(this.p,this.s,this.o);this.ondata(P(e,n,this.s.b),this.d),this.o=P(e,this.s.b-32768),this.s.b=this.o.length,this.p=P(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,n){this.e(t),this.c(n)},t}();n.Inflate=xt;var Ct=function(){return function(t,n){ft([tt,function(){return[ct,xt]}],this,zt.call(this,t,n),function(t){var n=new xt(t.data);onmessage=ct(n)},7,0)}}();function Tt(t,n,e){return e||(e=n,n={}),"function"!=typeof e&&E(7),ut(t,n,[tt],function(t){return at(Mt(t.data[0],ot(t.data[1])))},1,e)}function Mt(t,n){return I(t,{i:2},n&&n.out,n&&n.dictionary)}n.AsyncInflate=Ct,n.inflate=Tt,n.inflateSync=Mt;var Zt=function(){function t(t,n){this.c=H(),this.l=0,this.v=1,At.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),this.l+=t.length,At.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var e=V(t,this.o,this.v&&yt(this.o),n&&8,this.s);this.v&&(gt(e,this.o),this.v=0),n&&(dt(e,e.length-8,this.c.d()),dt(e,e.length-4,this.l)),this.ondata(e,n)},t.prototype.flush=function(){At.prototype.flush.call(this)},t}();n.Gzip=Zt,n.Compress=Zt;var Pt=function(){return function(t,n){ft([nt,et,function(){return[ct,At,Zt]}],this,zt.call(this,t,n),function(t){var n=new Zt(t.data);onmessage=ct(n)},8,1)}}();function _t(t,n,e){return e||(e=n,n={}),"function"!=typeof e&&E(7),ut(t,n,[nt,et,function(){return[Et]}],function(t){return at(Et(t.data[0],t.data[1]))},2,e)}function Et(t,n){n||(n={});var e=H(),i=t.length;e.p(t);var r=V(t,n,yt(n),8),s=r.length;return gt(r,n),dt(r,s-8,e.d()),dt(r,s-4,i),r}n.AsyncGzip=Pt,n.AsyncCompress=Pt,n.gzip=_t,n.compress=_t,n.gzipSync=Et,n.compressSync=Et;var It=function(){function t(t,n){this.v=1,this.r=0,xt.call(this,t,n)}return t.prototype.push=function(t,n){if(xt.prototype.e.call(this,t),this.r+=t.length,this.v){var e=this.p.subarray(this.v-1),i=e.length>3?vt(e):4;if(i>e.length){if(!n)return}else this.v>1&&this.onmember&&this.onmember(this.r-e.length);this.p=e.subarray(i),this.v=0}xt.prototype.c.call(this,n),!this.s.f||this.s.l||n||(this.v=Z(this.s.p)+9,this.s={i:0},this.o=new r(0),this.push(new r(0),n))},t}();n.Gunzip=It;var Rt=function(){return function(t,n){var e=this;ft([tt,it,function(){return[ct,xt,It]}],this,zt.call(this,t,n),function(t){var n=new It(t.data);n.onmember=function(t){return postMessage(t)},onmessage=ct(n)},9,0,function(t){return e.onmember&&e.onmember(t)})}}();function Lt(t,n,e){return e||(e=n,n={}),"function"!=typeof e&&E(7),ut(t,n,[tt,it,function(){return[Ot]}],function(t){return at(Ot(t.data[0],t.data[1]))},3,e)}function Ot(t,n){var e=vt(t);return e+8>t.length&&E(6,"invalid gzip data"),I(t.subarray(e,-8),{i:2},n&&n.out||new r(mt(t)),n&&n.dictionary)}n.AsyncGunzip=Rt,n.gunzip=Lt,n.gunzipSync=Ot;var Dt=function(){function t(t,n){this.c=K(),this.v=1,At.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),At.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var e=V(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(wt(e,this.o),this.v=0),n&&dt(e,e.length-4,this.c.d()),this.ondata(e,n)},t.prototype.flush=function(){At.prototype.flush.call(this)},t}();n.Zlib=Dt;var qt=function(){return function(t,n){ft([nt,rt,function(){return[ct,At,Dt]}],this,zt.call(this,t,n),function(t){var n=new Dt(t.data);onmessage=ct(n)},10,1)}}();function Ft(t,n){n||(n={});var e=K();e.p(t);var i=V(t,n,n.dictionary?6:2,4);return wt(i,n),dt(i,i.length-4,e.d()),i}n.AsyncZlib=qt,n.zlib=function(t,n,e){return e||(e=n,n={}),"function"!=typeof e&&E(7),ut(t,n,[nt,rt,function(){return[Ft]}],function(t){return at(Ft(t.data[0],t.data[1]))},4,e)},n.zlibSync=Ft;var Nt=function(){function t(t,n){xt.call(this,t,n),this.v=t&&t.dictionary?2:1}return t.prototype.push=function(t,n){if(xt.prototype.e.call(this,t),this.v){if(this.p.length<6&&!n)return;this.p=this.p.subarray(bt(this.p,this.v-1)),this.v=0}n&&(this.p.length<4&&E(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),xt.prototype.c.call(this,n)},t}();n.Unzlib=Nt;var jt=function(){return function(t,n){ft([tt,st,function(){return[ct,xt,Nt]}],this,zt.call(this,t,n),function(t){var n=new Nt(t.data);onmessage=ct(n)},11,0)}}();function Wt(t,n,e){return e||(e=n,n={}),"function"!=typeof e&&E(7),ut(t,n,[tt,st,function(){return[$t]}],function(t){return at($t(t.data[0],ot(t.data[1])))},5,e)}function $t(t,n){return I(t.subarray(bt(t,n&&n.dictionary),-4),{i:2},n&&n.out,n&&n.dictionary)}n.AsyncUnzlib=jt,n.unzlib=Wt,n.unzlibSync=$t;var Gt=function(){function t(t,n){this.o=zt.call(this,t,n)||{},this.G=It,this.I=xt,this.Z=Nt}return t.prototype.i=function(){var t=this;this.s.ondata=function(n,e){t.ondata(n,e)}},t.prototype.push=function(t,n){if(this.ondata||E(5),this.s)this.s.push(t,n);else{if(this.p&&this.p.length){var e=new r(this.p.length+t.length);e.set(this.p),e.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,n),this.p=null)}},t}();n.Decompress=Gt;var Bt=function(){function t(t,n){Gt.call(this,t,n),this.queuedSize=0,this.G=Rt,this.I=Ct,this.Z=jt}return t.prototype.i=function(){var t=this;this.s.ondata=function(n,e,i){t.ondata(n,e,i)},this.s.ondrain=function(n){t.queuedSize-=n,t.ondrain&&t.ondrain(n)}},t.prototype.push=function(t,n){this.queuedSize+=t.length,Gt.prototype.push.call(this,t,n)},t}();n.AsyncDecompress=Bt,n.decompress=function(t,n,e){return e||(e=n,n={}),"function"!=typeof e&&E(7),31==t[0]&&139==t[1]&&8==t[2]?Lt(t,n,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Tt(t,n,e):Wt(t,n,e)},n.decompressSync=function(t,n){return 31==t[0]&&139==t[1]&&8==t[2]?Ot(t,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Mt(t,n):$t(t,n)};var Ht=function(t,n,e,i){for(var s in t){var a=t[s],o=n+s,u=i;Array.isArray(a)&&(u=X(i,a[1]),a=a[0]),a instanceof r?e[o]=[a,u]:(e[o+="/"]=[new r(0),u],Ht(a,o,e,i))}},Kt="undefined"!=typeof TextEncoder&&new TextEncoder,Vt="undefined"!=typeof TextDecoder&&new TextDecoder,Xt=0;try{Vt.decode($,{stream:!0}),Xt=1}catch(t){}var Jt=function(t){for(var n="",e=0;;){var i=t[e++],r=(i>127)+(i>223)+(i>239);if(e+r>t.length)return{s:n,r:P(t,e-1)};r?3==r?(i=((15&i)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,n+=String.fromCharCode(55296|i>>10,56320|1023&i)):n+=1&r?String.fromCharCode((31&i)<<6|63&t[e++]):String.fromCharCode((15&i)<<12|(63&t[e++])<<6|63&t[e++]):n+=String.fromCharCode(i)}},Yt=function(){function t(t){this.ondata=t,Xt?this.t=new TextDecoder:this.p=$}return t.prototype.push=function(t,n){if(this.ondata||E(5),n=!!n,this.t)return this.ondata(this.t.decode(t,{stream:!0}),n),void(n&&(this.t.decode().length&&E(8),this.t=null));this.p||E(4);var e=new r(this.p.length+t.length);e.set(this.p),e.set(t,this.p.length);var i=Jt(e),s=i.s,a=i.r;n?(a.length&&E(8),this.p=null):this.p=a,this.ondata(s,n)},t}();n.DecodeUTF8=Yt;var Qt=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(tn(t),this.d=n||!1)},t}();function tn(t,n){if(n){for(var e=new r(t.length),i=0;i<t.length;++i)e[i]=t.charCodeAt(i);return e}if(Kt)return Kt.encode(t);var s=t.length,a=new r(t.length+(t.length>>1)),o=0,u=function(t){a[o++]=t};for(i=0;i<s;++i){if(o+5>a.length){var c=new r(o+8+(s-i<<1));c.set(a),a=c}var f=t.charCodeAt(i);f<128||n?u(f):f<2048?(u(192|f>>6),u(128|63&f)):f>55295&&f<57344?(u(240|(f=65536+(1047552&f)|1023&t.charCodeAt(++i))>>18),u(128|f>>12&63),u(128|f>>6&63),u(128|63&f)):(u(224|f>>12),u(128|f>>6&63),u(128|63&f))}return P(a,0,o)}function nn(t,n){if(n){for(var e="",i=0;i<t.length;i+=16384)e+=String.fromCharCode.apply(null,t.subarray(i,i+16384));return e}if(Vt)return Vt.decode(t);var r=Jt(t),s=r.s;return(e=r.r).length&&E(8),s}n.EncodeUTF8=Qt,n.strToU8=tn,n.strFromU8=nn;var en=function(t){return 1==t?3:t<6?2:9==t?1:0},rn=function(t,n){return n+30+lt(t,n+26)+lt(t,n+28)},sn=function(t,n,e){var i=lt(t,n+28),r=nn(t.subarray(n+46,n+46+i),!(2048<(t,n+8))),s=n+46+i,a=ht(t,n+20),o=e&&4294967295==a?an(t,s):[a,ht(t,n+24),ht(t,n+42)],u=o[0],c=o[1],f=o[2];return[lt(t,n+10),u,c,r,s+lt(t,n+30)+lt(t,n+32),f]},an=function(t,n){for(;1!=lt(t,n);n+=4+lt(t,n+2));return[pt(t,n+12),pt(t,n+4),pt(t,n+20)]},on=function(t){var n=0;if(t)for(var e in t){var i=t[e].length;i>65535&&E(9),n+=i+4}return n},un=function(t,n,e,i,r,s,a,o){var u=i.length,c=e.extra,f=o&&o.length,l=on(c);dt(t,n,null!=a?33639248:67324752),n+=4,null!=a&&(t[n++]=20,t[n++]=e.os),t[n]=20,n+=2,t[n++]=e.flag<<1|(s<0&&8),t[n++]=r&&8,t[n++]=255&e.compression,t[n++]=e.compression>>8;var h=new Date(null==e.mtime?Date.now():e.mtime),p=h.getFullYear()-1980;if((p<0||p>119)&&E(10),dt(t,n,p<<25|h.getMonth()+1<<21|h.getDate()<<16|h.getHours()<<11|h.getMinutes()<<5|h.getSeconds()>>1),n+=4,-1!=s&&(dt(t,n,e.crc),dt(t,n+4,s<0?-s-2:s),dt(t,n+8,e.size)),dt(t,n+12,u),dt(t,n+14,l),n+=16,null!=a&&(dt(t,n,f),dt(t,n+6,e.attrs),dt(t,n+10,a),n+=14),t.set(i,n),n+=u,l)for(var d in c){var g=c[d],v=g.length;dt(t,n,+d),dt(t,n+2,v),t.set(g,n+4),n+=4+v}return f&&(t.set(o,n),n+=f),n},cn=function(t,n,e,i,r){dt(t,n,101010256),dt(t,n+8,e),dt(t,n+10,e),dt(t,n+12,i),dt(t,n+16,r)},fn=function(){function t(t){this.filename=t,this.c=H(),this.size=0,this.compression=0}return t.prototype.process=function(t,n){this.ondata(null,t,n)},t.prototype.push=function(t,n){this.ondata||E(5),this.c.p(t),this.size+=t.length,n&&(this.crc=this.c.d()),this.process(t,n||!1)},t}();n.ZipPassThrough=fn;var ln=function(){function t(t,n){var e=this;n||(n={}),fn.call(this,t),this.d=new At(n,function(t,n){e.ondata(null,t,n)}),this.compression=8,this.flag=en(n.level)}return t.prototype.process=function(t,n){try{this.d.push(t,n)}catch(t){this.ondata(t,null,n)}},t.prototype.push=function(t,n){fn.prototype.push.call(this,t,n)},t}();n.ZipDeflate=ln;var hn=function(){function t(t,n){var e=this;n||(n={}),fn.call(this,t),this.d=new Ut(n,function(t,n,i){e.ondata(t,n,i)}),this.compression=8,this.flag=en(n.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,n){this.d.push(t,n)},t.prototype.push=function(t,n){fn.prototype.push.call(this,t,n)},t}();n.AsyncZipDeflate=hn;var pn=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var n=this;if(this.ondata||E(5),2&this.d)this.ondata(E(4+8*(1&this.d),0,1),null,!1);else{var e=tn(t.filename),i=e.length,s=t.comment,a=s&&tn(s),o=i!=t.filename.length||a&&s.length!=a.length,u=i+on(t.extra)+30;i>65535&&this.ondata(E(11,0,1),null,!1);var c=new r(u);un(c,0,t,e,o,-1);var f=[c],l=function(){for(var t=0,e=f;t<e.length;t++){var i=e[t];n.ondata(null,i,!1)}f=[]},h=this.d;this.d=0;var p=this.u.length,d=X(t,{f:e,u:o,o:a,t:function(){t.terminate&&t.terminate()},r:function(){if(l(),h){var t=n.u[p+1];t?t.r():n.d=1}h=1}}),g=0;t.ondata=function(e,i,s){if(e)n.ondata(e,i,s),n.terminate();else if(g+=i.length,f.push(i),s){var a=new r(16);dt(a,0,134695760),dt(a,4,t.crc),dt(a,8,g),dt(a,12,t.size),f.push(a),d.c=g,d.b=u+g+16,d.crc=t.crc,d.size=t.size,h&&d.r(),h=1}else h&&l()},this.u.push(d)}},t.prototype.end=function(){var t=this;2&this.d?this.ondata(E(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,n=0,e=0,i=0,s=this.u;i<s.length;i++)e+=46+(c=s[i]).f.length+on(c.extra)+(c.o?c.o.length:0);for(var a=new r(e+22),o=0,u=this.u;o<u.length;o++){var c=u[o];un(a,t,c,c.f,c.u,-c.c-2,n,c.o),t+=46+c.f.length+on(c.extra)+(c.o?c.o.length:0),n+=c.b}cn(a,t,this.u.length,e,n),this.ondata(null,a,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,n=this.u;t<n.length;t++)n[t].t();this.d=2},t}();n.Zip=pn,n.zip=function(t,n,e){e||(e=n,n={}),"function"!=typeof e&&E(7);var i={};Ht(t,"",i,n);var s=Object.keys(i),a=s.length,o=0,u=0,c=a,f=new Array(a),l=[],h=function(){for(var t=0;t<l.length;++t)l[t]()},p=function(t,n){yn(function(){e(t,n)})};yn(function(){p=e});var d=function(){var t=new r(u+22),n=o,e=u-o;u=0;for(var i=0;i<c;++i){var s=f[i];try{var a=s.c.length;un(t,u,s,s.f,s.u,a);var l=30+s.f.length+on(s.extra),h=u+l;t.set(s.c,h),un(t,o,s,s.f,s.u,a,u,s.m),o+=16+l+(s.m?s.m.length:0),u=h+a}catch(t){return p(t,null)}}cn(t,o,f.length,e,n),p(null,t)};a||d();for(var g=function(t){var n=s[t],e=i[n],r=e[0],c=e[1],g=H(),v=r.length;g.p(r);var m=tn(n),y=m.length,w=c.comment,b=w&&tn(w),z=b&&b.length,A=on(c.extra),U=0==c.level?0:8,S=function(e,i){if(e)h(),p(e,null);else{var r=i.length;f[t]=X(c,{size:v,crc:g.d(),c:i,f:m,m:b,u:y!=n.length||b&&w.length!=z,compression:U}),o+=30+y+A+r,u+=76+2*(y+A)+(z||0)+r,--a||d()}};if(y>65535&&S(E(11,0,1),null),U)if(v<16e4)try{S(null,kt(r,c))}catch(t){S(t,null)}else l.push(St(r,c,S));else S(null,r)},v=0;v<c;++v)g(v);return h},n.zipSync=function(t,n){n||(n={});var e={},i=[];Ht(t,"",e,n);var s=0,a=0;for(var o in e){var u=e[o],c=u[0],f=u[1],l=0==f.level?0:8,h=(S=tn(o)).length,p=f.comment,d=p&&tn(p),g=d&&d.length,v=on(f.extra);h>65535&&E(11);var m=l?kt(c,f):c,y=m.length,w=H();w.p(c),i.push(X(f,{size:c.length,crc:w.d(),c:m,f:S,m:d,u:h!=o.length||d&&p.length!=g,o:s,compression:l})),s+=30+h+v+y,a+=76+2*(h+v)+(g||0)+y}for(var b=new r(a+22),z=s,A=a-s,U=0;U<i.length;++U){var S=i[U];un(b,S.o,S,S.f,S.u,S.c.length);var k=30+S.f.length+on(S.extra);b.set(S.c,S.o+k),un(b,s,S,S.f,S.u,S.c.length,S.o,S.m),s+=16+k+(S.m?S.m.length:0)}return cn(b,s,i.length,A,z),b};var dn=function(){function t(){}return t.prototype.push=function(t,n){this.ondata(null,t,n)},t.compression=0,t}();n.UnzipPassThrough=dn;var gn=function(){function t(){var t=this;this.i=new xt(function(n,e){t.ondata(null,n,e)})}return t.prototype.push=function(t,n){try{this.i.push(t,n)}catch(t){this.ondata(t,null,n)}},t.compression=8,t}();n.UnzipInflate=gn;var vn=function(){function t(t,n){var e=this;n<32e4?this.i=new xt(function(t,n){e.ondata(null,t,n)}):(this.i=new Ct(function(t,n,i){e.ondata(t,n,i)}),this.terminate=this.i.terminate)}return t.prototype.push=function(t,n){this.i.terminate&&(t=P(t,0)),this.i.push(t,n)},t.compression=8,t}();n.AsyncUnzipInflate=vn;var mn=function(){function t(t){this.onfile=t,this.k=[],this.o={0:dn},this.p=$}return t.prototype.push=function(t,n){var e=this;if(this.onfile||E(5),this.p||E(4),this.c>0){var i=Math.min(this.c,t.length),s=t.subarray(0,i);if(this.c-=i,this.d?this.d.push(s,!this.c):this.k[0].push(s),(t=t.subarray(i)).length)return this.push(t,n)}else{var a=0,o=0,u=void 0,c=void 0;this.p.length?t.length?((c=new r(this.p.length+t.length)).set(this.p),c.set(t,this.p.length)):c=this.p:c=t;for(var f=c.length,l=this.c,h=l&&this.d,p=function(){var t,n=ht(c,o);if(67324752==n){a=1,u=o,d.d=null,d.c=0;var i=lt(c,o+6),r=lt(c,o+8),s=2048&i,h=8&i,p=lt(c,o+26),g=lt(c,o+28);if(f>o+30+p+g){var v=[];d.k.unshift(v),a=2;var m,y=ht(c,o+18),w=ht(c,o+22),b=nn(c.subarray(o+30,o+=30+p),!s);4294967295==y?(t=h?[-2]:an(c,o),y=t[0],w=t[1]):h&&(y=-1),o+=g,d.c=y;var z={name:b,compression:r,start:function(){if(z.ondata||E(5),y){var t=e.o[r];t||z.ondata(E(14,"unknown compression type "+r,1),null,!1),(m=y<0?new t(b):new t(b,y,w)).ondata=function(t,n,e){z.ondata(t,n,e)};for(var n=0,i=v;n<i.length;n++){var s=i[n];m.push(s,!1)}e.k[0]==v&&e.c?e.d=m:m.push($,!0)}else z.ondata(null,$,!0)},terminate:function(){m&&m.terminate&&m.terminate()}};y>=0&&(z.size=y,z.originalSize=w),d.onfile(z)}return"break"}if(l){if(134695760==n)return u=o+=12+(-2==l&&8),a=3,d.c=0,"break";if(33639248==n)return u=o-=4,a=3,d.c=0,"break"}},d=this;o<f-4&&"break"!==p();++o);if(this.p=$,l<0){var g=a?c.subarray(0,u-12-(-2==l&&8)-(134695760==ht(c,u-16)&&4)):c.subarray(0,o);h?h.push(g,!!a):this.k[+(2==a)].push(g)}if(2&a)return this.push(c.subarray(o),n);this.p=c.subarray(o)}n&&(this.c&&E(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}();n.Unzip=mn;var yn="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()};n.unzip=function(t,n,e){e||(e=n,n={}),"function"!=typeof e&&E(7);var i=[],s=function(){for(var t=0;t<i.length;++t)i[t]()},a={},o=function(t,n){yn(function(){e(t,n)})};yn(function(){o=e});for(var u=t.length-22;101010256!=ht(t,u);--u)if(!u||t.length-u>65558)return o(E(13,0,1),null),s;var c=lt(t,u+8);if(c){var f=c,l=ht(t,u+16),h=4294967295==l||65535==f;if(h){var p=ht(t,u-12);(h=101075792==ht(t,p))&&(f=c=ht(t,p+32),l=ht(t,p+48))}for(var d=n&&n.filter,g=function(n){var e=sn(t,l,h),u=e[0],f=e[1],p=e[2],g=e[3],v=e[4],m=e[5],y=rn(t,m);l=v;var w=function(t,n){t?(s(),o(t,null)):(n&&(a[g]=n),--c||o(null,a))};if(!d||d({name:g,size:f,originalSize:p,compression:u}))if(u)if(8==u){var b=t.subarray(y,y+f);if(p<524288||f>.8*p)try{w(null,Mt(b,{out:new r(p)}))}catch(t){w(t,null)}else i.push(Tt(b,{size:p},w))}else w(E(14,"unknown compression type "+u,1),null);else w(null,P(t,y,y+f));else w(null,null)},v=0;v<f;++v)g()}else o(null,{});return s},n.unzipSync=function(t,n){for(var e={},i=t.length-22;101010256!=ht(t,i);--i)(!i||t.length-i>65558)&&E(13);var s=lt(t,i+8);if(!s)return{};var a=ht(t,i+16),o=4294967295==a||65535==s;if(o){var u=ht(t,i-12);(o=101075792==ht(t,u))&&(s=ht(t,u+32),a=ht(t,u+48))}for(var c=n&&n.filter,f=0;f<s;++f){var l=sn(t,a,o),h=l[0],p=l[1],d=l[2],g=l[3],v=l[4],m=l[5],y=rn(t,m);a=v,c&&!c({name:g,size:p,originalSize:d,compression:h})||(h?8==h?e[g]=Mt(t.subarray(y,y+p),{out:new r(d)}):E(14,"unknown compression type "+h):e[g]=P(t,y,y+p))}return e}}},n={};function e(i){var r=n[i];if(void 0!==r)return r.exports;var s=n[i]={exports:{}};return t[i](s,s.exports,e),s.exports}(()=>{const t=e(845),n=e(183),i=n.normalizeZipEntryPath;self.addEventListener("install",()=>{self.skipWaiting()}),self.addEventListener("activate",t=>{t.waitUntil(self.clients.claim())});const r=new Map,s="zip-peek-config-v1",a=new URL("__zip_peek_runtime_config__",self.registration.scope).href,o="X-ZipSW-Cached-At",u="X-ZipSW-Asset-Source";let c={zipAssetCacheName:"zip-cache-v1",assetCacheTtlMs:72e5,logPrefix:"[zipSW]"},f=null,l=null;function h(...t){console.log(c.logPrefix,...t)}function p(...t){console.warn(c.logPrefix,...t)}function d(t,n){t.ports[0]?.postMessage(n)}function g(t){return t+(t.includes("?")?"&":"?")+"__zipsw_manifest__=1"}async function v(t,n){try{const e=await caches.open(c.zipAssetCacheName),i=Array.from(n.values());await e.put(new Request(g(t)),new Response(JSON.stringify(i),{headers:{"Content-Type":"application/json"}}))}catch(t){p("failed to persist manifest",t)}}const m=new Map;function y(t){const n=r.get(t);if(n)return Promise.resolve(n);let e=m.get(t);return e||(e=(async()=>{const n=await async function(t){try{const n=await caches.open(c.zipAssetCacheName),e=await n.match(g(t));if(!e)return null;const r=await e.json();if(!Array.isArray(r)||0===r.length)return null;const s=new Map;for(const t of r){const n=i(t.filename);""!==n&&s.set(n,t)}return s.size>0?s:null}catch(t){return p("failed to load persisted manifest",t),null}}(t);if(n)return r.set(t,n),h("rehydrated manifest from cache",{zipUrl:t,entryCount:n.size}),n;const e=await async function(t){const n=await fetch(t,{headers:{Range:"bytes=-65536"}});if(206!==n.status)return p("range requests not supported",{zipUrl:t,status:n.status}),null;const e=await n.arrayBuffer(),r=new DataView(e);let s=-1;for(let t=e.byteLength-22;t>=0;t--)if(101010256===r.getUint32(t,!0)){s=t;break}if(-1===s)return p("EOCD not found in last 64KB",t),null;const a=r.getUint32(s+16,!0),o=r.getUint32(s+12,!0);let u=e,c=-1;const f=n.headers.get("Content-Range");let l=0;if(f){const t=f.match(/\/(\d+)$/);t&&(l=parseInt(t[1],10))}if(l<=0)return null;const h=l-e.byteLength;if(a>=h)c=a-h;else{const n=await fetch(t,{headers:{Range:`bytes=${a}-${a+o-1}`}});if(206!==n.status)return p("failed to fetch central directory",{zipUrl:t,status:n.status}),null;u=await n.arrayBuffer(),c=0}const d=new DataView(u);let g=c;const v=[];for(;g+46<=u.byteLength&&33639248===d.getUint32(g,!0);){const t=d.getUint16(g+10,!0),n=d.getUint32(g+20,!0),e=d.getUint16(g+28,!0),r=d.getUint16(g+30,!0),s=d.getUint16(g+32,!0),a=d.getUint32(g+42,!0);if(g+46+e>u.byteLength)break;const o=new Uint8Array(u,g+46,e),c=(new TextDecoder).decode(o),f=i(c);""!==f&&v.push({filename:f,offset:a,compressedSize:n,compression:t}),g+=46+e+r+s}if(0===v.length)return p("no files parsed from central directory",t),null;v.sort((t,n)=>t.offset-n.offset);const m=new Map;for(let t=0;t<v.length;t++){const n=v[t],e=i(n.filename);""!==e&&(m.has(e)&&p("duplicate manifest key after normalize; overwriting",e),m.set(e,{filename:n.filename,offset:n.offset,compressedSize:n.compressedSize,compression:n.compression,nextOffset:t<v.length-1?v[t+1].offset:a}))}return m.size>0?m:null}(t);return e&&(r.set(t,e),await v(t,e),h("manifest fetched and cached",{zipUrl:t,entryCount:e.size})),e})().finally(()=>{m.delete(t)}),m.set(t,e),e)}function w(t,n){return new Response(t,{status:n,headers:{"Access-Control-Allow-Origin":"*"}})}self.addEventListener("message",t=>{if(!t.data)return;const{type:e,zipUrl:o,files:u,config:g,allowedZipUrls:w}=t.data;if("ZIP_SW_CONFIG"===e){const e=async function(t){if(t&&("string"==typeof t.zipAssetCacheName&&t.zipAssetCacheName.trim()&&(c={...c,zipAssetCacheName:t.zipAssetCacheName}),"number"==typeof t.assetCacheTtlMs&&Number.isFinite(t.assetCacheTtlMs)&&(c={...c,assetCacheTtlMs:t.assetCacheTtlMs}),"string"==typeof t.logPrefix&&t.logPrefix.trim()&&(c={...c,logPrefix:t.logPrefix}),"allowedZipUrls"in t)){const e=Array.isArray(t.allowedZipUrls)?t.allowedZipUrls.map(n.stripTParam):null;f=e?new Set(e):null,l=Promise.resolve(),await async function(t){try{const n=await caches.open(s);await n.put(new Request(a),new Response(JSON.stringify({allowedZipUrls:t}),{headers:{"Content-Type":"application/json"}}))}catch(t){p("failed to persist runtime config",t)}}(e)}}(g).then(()=>d(t,{ok:!0})).catch(n=>d(t,{ok:!1,error:n instanceof Error?n.message:String(n)}));return void t.waitUntil(e)}if("ZIP_MANIFEST"===e){if(o&&u){const e=(0,n.stripTParam)(o),s=new Map;let a=!1;for(const t of u){const n=i(t.filename);""!==n?(s.has(n)&&p("duplicate manifest key after normalize; overwriting",n),s.set(n,t)):a=!0}const c=r.get(e);if(0===s.size)return void p("rejecting empty manifest; keeping existing",{zipUrl:e,existingSize:c?c.size:0,hadEmptyKey:a});if(c&&c.size>s.size)return void p("rejecting smaller manifest; keeping existing",{zipUrl:e,incomingSize:s.size,existingSize:c.size});r.set(e,s),t.waitUntil(v(e,s));const f=Array.from(s.keys());h("manifest all paths",f);const l=f.slice(0,40);h("ZIP_MANIFEST loaded",{zipUrl:e,entryCount:s.size,sampleKeys:l,replacedExistingSize:c?c.size:0})}}else if("CLEAR_ZIP_ASSETS_EXCEPT_ALLOWED"===e&&w){const e=async function(t){try{const e=new Set(t.map(n.stripTParam)),i=await caches.open(c.zipAssetCacheName),s=await i.keys();for(const t of s){const r=t.url;if(r.includes("__zipsw_manifest__=1")){const s=S(r);s&&!e.has((0,n.stripTParam)(s))&&await i.delete(t);continue}const s=(0,n.parseZipAssetRequest)(r);s&&!e.has((0,n.stripTParam)(s.zipUrl))&&await i.delete(t)}for(const t of r.keys())e.has((0,n.stripTParam)(t))||r.delete(t)}catch(t){p("clearZipAssetsExceptAllowed failed",t)}}(w).then(()=>d(t,{ok:!0})).catch(n=>d(t,{ok:!1,error:n instanceof Error?n.message:String(n)}));t.waitUntil(e)}else if("CLEAR_ALL_ZIP_ASSETS"===e){const n=async function(){try{const t=await caches.open(c.zipAssetCacheName),n=await t.keys();await Promise.all(n.map(n=>t.delete(n))),await caches.delete(s),r.clear(),m.clear(),l=Promise.resolve()}catch(t){p("clearAllZipAssets failed",t)}}().then(()=>d(t,{ok:!0})).catch(n=>d(t,{ok:!1,error:n instanceof Error?n.message:String(n)}));t.waitUntil(n)}else if("PRELOAD_ZIP_MANIFESTS"===e&&w){const e=Promise.all(w.map(t=>y((0,n.stripTParam)(t)))).then(()=>d(t,{ok:!0})).catch(n=>d(t,{ok:!1,error:n instanceof Error?n.message:String(n)}));t.waitUntil(e)}});const b={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"};function z(t){const n=t.headers.get(o);if(!n)return!0;const e=parseInt(n,10);return!Number.isFinite(e)||Date.now()-e>c.assetCacheTtlMs}const A="&__zipsw_manifest__=1",U="?__zipsw_manifest__=1";function S(t){return t.endsWith(A)?t.slice(0,-A.length):t.endsWith(U)?t.slice(0,-U.length):null}self.addEventListener("fetch",e=>{if("GET"!==e.request.method)return;const d=(0,n.parseZipAssetRequest)(e.request.url);if(!d)return;const g=(0,n.stripTParam)(d.zipUrl),v=d.internalPath,m=i(v);e.respondWith((async()=>{if(await async function(){return l||(l=(async()=>{try{const t=await caches.open(s),e=await t.match(a);if(!e)return;const i=await e.json();f=Array.isArray(i.allowedZipUrls)?new Set(i.allowedZipUrls.filter(t=>"string"==typeof t).map(n.stripTParam)):null}catch(t){p("failed to load runtime config",t)}})(),l)}(),!function(t){return null===f||f.has((0,n.stripTParam)(t))}(g))return p("zip URL not allowed",{requestedZipUrl:g,allowedZipUrls:f?Array.from(f):null}),w("Zip URL not allowed",403);let i=r.get(g);if(i||(i=await y(g)??void 0),!i){const t=Array.from(r.keys());return p("manifest missing for zipUrl",{requestedZipUrl:g,knownZipUrls:t}),w("Zip manifest not loaded",404)}const d=function(t,n){if(t.has(n))return{key:n,info:t.get(n)};const e=[];for(const i of t.keys())i.endsWith("/"+n)&&e.push(i);if(1===e.length){const n=e[0];return{key:n,info:t.get(n)}}if(e.length>1){e.sort((t,n)=>t.length-n.length),p("ambiguous suffix match; using shortest path",{requested:n,picked:e[0],candidates:e.slice(0,8)});const i=e[0];return{key:i,info:t.get(i)}}return null}(i,m);if(!d){const t=Array.from(i.keys()).slice(0,50);return p("file not in manifest",{zipUrl:g,internalPathRaw:v,internalPathNormalized:m,manifestSize:i.size,sampleKeys:t}),w("File not found in zip manifest",404)}const{key:A,info:U}=d;A!==m&&h("resolved via suffix match",{requested:m,manifestKey:A});const S=function(t,e){return new Request((0,n.canonicalZipAssetRequestUrl)(t,e),{method:"GET"})}(g,A);let k=null,x="network";try{const t=await caches.open(c.zipAssetCacheName),n=await t.match(S);if(n)if(z(n))try{await t.delete(S)}catch(t){p("asset cache delete expired failed",t)}else k=await n.blob(),x="cache-api"}catch(t){p("asset cache read failed",t)}if(!k){const n=U.offset,e=U.nextOffset-1;p("fetching zip chunk from",g);const i=await fetch(g,{headers:{Range:`bytes=${n}-${e}`}});if(!i.ok&&206!==i.status)return w("Failed to fetch zip chunk",i.status);const r=await i.arrayBuffer(),s=new DataView(r);if(67324752!==s.getUint32(0,!0))return w("Invalid Local File Header",500);const a=s.getUint16(26,!0),u=s.getUint16(28,!0),f=new Uint8Array(r,30+a+u,U.compressedSize);let l;if(8===U.compression)l=(0,t.inflateSync)(f);else{if(0!==U.compression)return w(`Unsupported compression method: ${U.compression}`,500);l=f}const h=function(t){const n=t.split(".").pop()?.toLowerCase();return n?b[n]??"application/octet-stream":"application/octet-stream"}(A);k=new Blob([l],{type:h}),x="network",await async function(t,n){try{const e=await caches.open(c.zipAssetCacheName),i=await e.match(t);if(i&&!z(i))return;const r=n.type||"application/octet-stream";await e.put(t,new Response(n,{status:200,headers:{"Content-Type":r,"Content-Length":String(n.size),"Access-Control-Allow-Origin":"*",[o]:String(Date.now())}}))}catch(t){p("asset cache put failed",t)}}(S,k)}if(e.request.headers.has("range")){const t=e.request.headers.get("range").replace(/bytes=/,"").split("-"),n=parseInt(t[0],10),i=t[1]?parseInt(t[1],10):k.size-1,r=k.slice(n,i+1);return new Response(r,{status:206,headers:{"Content-Type":k.type,"Content-Range":`bytes ${n}-${i}/${k.size}`,"Content-Length":r.size.toString(),"Accept-Ranges":"bytes","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":u,[u]:x}})}return new Response(k,{status:200,headers:{"Content-Type":k.type,"Content-Length":k.size.toString(),"Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":u,[u]:x}})})())})})()})();
|
|
2
2
|
//# sourceMappingURL=zipServiceWorker.js.map
|