zip-peek 0.2.3-alpha.0 → 0.3.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2,47 +2,138 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isZipPackage = void 0;
4
4
  exports.initZipPeek = initZipPeek;
5
- const registerZipServiceWorker_1 = require("./registerZipServiceWorker");
5
+ const types_1 = require("./types");
6
6
  const zip_utils_1 = require("./zip-utils");
7
7
  Object.defineProperty(exports, "isZipPackage", { enumerable: true, get: function () { return zip_utils_1.isZipPackage; } });
8
8
  let currentOnError;
9
- let clientErrorListenerInstalled = false;
10
- function toError(error) {
11
- return error instanceof Error ? error : new Error(String(error));
9
+ let clientMessageListenerInstalled = false;
10
+ const sessionManifests = new Map();
11
+ function normalizeScopePath(href) {
12
+ let p = new URL(href).pathname;
13
+ if (p.length > 1 && p.endsWith("/")) {
14
+ p = p.slice(0, -1);
15
+ }
16
+ return p;
17
+ }
18
+ function zipServiceWorkerScriptMatches(scriptURL, expectedWorkerUrl) {
19
+ if (!scriptURL) {
20
+ return false;
21
+ }
22
+ try {
23
+ const expected = new URL(expectedWorkerUrl, window.location.href).href;
24
+ const resolved = new URL(scriptURL, window.location.href).href;
25
+ return resolved === expected;
26
+ }
27
+ catch {
28
+ try {
29
+ return /\/zipServiceWorker(\.[0-9a-f]{8})?\.js(\?|$)/.test(new URL(scriptURL).pathname);
30
+ }
31
+ catch {
32
+ return false;
33
+ }
34
+ }
35
+ }
36
+ async function unregisterMismatchedScopeZipServiceWorkerIfNeeded(expectedWorkerUrl, expectedScopeUrl) {
37
+ const expectedWorkerHref = new URL(expectedWorkerUrl, window.location.href).href;
38
+ const wantScopePath = normalizeScopePath(expectedScopeUrl);
39
+ const registrations = await navigator.serviceWorker.getRegistrations();
40
+ for (const reg of registrations) {
41
+ const scriptURL = reg.installing?.scriptURL ?? reg.waiting?.scriptURL ?? reg.active?.scriptURL;
42
+ if (!scriptURL) {
43
+ continue;
44
+ }
45
+ let scriptHref;
46
+ try {
47
+ scriptHref = new URL(scriptURL, window.location.href).href;
48
+ }
49
+ catch {
50
+ continue;
51
+ }
52
+ if (scriptHref !== expectedWorkerHref) {
53
+ continue;
54
+ }
55
+ const regScopePath = normalizeScopePath(reg.scope);
56
+ if (regScopePath !== wantScopePath) {
57
+ await reg.unregister();
58
+ console.log(`Unregistered zip service worker (scope ${reg.scope}); re-registering with ${expectedScopeUrl}`);
59
+ }
60
+ }
61
+ }
62
+ async function ensureZipServiceWorkerRegistered({ workerUrl, scopeUrl, reloadOnFirstInstall = true, }) {
63
+ if (!("serviceWorker" in navigator)) {
64
+ return false;
65
+ }
66
+ await unregisterMismatchedScopeZipServiceWorkerIfNeeded(workerUrl, scopeUrl);
67
+ const existing = await navigator.serviceWorker.getRegistration(scopeUrl);
68
+ const alreadyRegistered = existing &&
69
+ (zipServiceWorkerScriptMatches(existing.active?.scriptURL, workerUrl) ||
70
+ zipServiceWorkerScriptMatches(existing.waiting?.scriptURL, workerUrl) ||
71
+ zipServiceWorkerScriptMatches(existing.installing?.scriptURL, workerUrl));
72
+ if (!alreadyRegistered) {
73
+ await navigator.serviceWorker.register(workerUrl, { scope: scopeUrl });
74
+ console.log("Zip service worker registered successfully");
75
+ }
76
+ else {
77
+ console.log("Zip service worker already registered; skipping register().");
78
+ }
79
+ await navigator.serviceWorker.ready;
80
+ if (reloadOnFirstInstall && !navigator.serviceWorker.controller) {
81
+ window.location.reload();
82
+ return true;
83
+ }
84
+ return false;
12
85
  }
13
- function toZipPeekError(error, info) {
14
- const err = toError(error);
86
+ function attachZipPeekInfo(error, info) {
87
+ const err = (0, types_1.toZipPeekError)(error);
15
88
  if (info) {
16
- err.zipPeekInfo = info;
89
+ err.zipPeekInfo = (0, types_1.formatZipPeekError)(info);
17
90
  }
18
91
  return err;
19
92
  }
20
93
  function reportZipPeekError(onError, error, info) {
21
- const err = toError(error);
94
+ const err = (0, types_1.toZipPeekError)(error);
22
95
  onError?.(err, info ?? err.zipPeekInfo);
23
96
  }
24
97
  function errorFromWorkerResponse(response) {
25
- const error = new Error(response.error ?? "zip-peek: service worker message failed.");
98
+ const error = new Error(response.error ?? (0, types_1.formatZipPeekError)("Service worker did not acknowledge the message."));
26
99
  if (response.errorStack) {
27
100
  error.stack = response.errorStack;
28
101
  }
29
102
  return error;
30
103
  }
31
- function ensureClientErrorListener() {
32
- if (clientErrorListenerInstalled || !("serviceWorker" in navigator)) {
104
+ function ensureClientMessageListener() {
105
+ if (clientMessageListenerInstalled || !("serviceWorker" in navigator)) {
33
106
  return;
34
107
  }
35
- clientErrorListenerInstalled = true;
108
+ clientMessageListenerInstalled = true;
36
109
  navigator.serviceWorker.addEventListener("message", (event) => {
37
110
  const data = event.data;
38
- if (!data || data.type !== "ZIP_SW_ERROR" || !currentOnError) {
111
+ if (!data) {
112
+ return;
113
+ }
114
+ if (data.type === "ZIP_SW_MANIFEST_CREATED" &&
115
+ data.zipUrl &&
116
+ Array.isArray(data.files) &&
117
+ data.files.length > 0) {
118
+ sessionManifests.set((0, zip_utils_1.normalizeZipUrl)(data.zipUrl), data.files);
119
+ return;
120
+ }
121
+ if (data.type === "ZIP_SW_MANIFEST_REQUEST" && data.zipUrl) {
122
+ const port = event.ports[0];
123
+ if (!port)
124
+ return;
125
+ const files = sessionManifests.get((0, zip_utils_1.normalizeZipUrl)(data.zipUrl));
126
+ port.postMessage(files ? { ok: true, files } : { ok: false });
127
+ return;
128
+ }
129
+ if (data.type !== "ZIP_SW_ERROR" || !currentOnError) {
39
130
  return;
40
131
  }
41
- const error = new Error(data.error?.message ?? "zip-peek: service worker error");
132
+ const error = new Error(data.error?.message ?? (0, types_1.formatZipPeekError)("Service worker reported an error."));
42
133
  if (data.error?.stack) {
43
134
  error.stack = data.error.stack;
44
135
  }
45
- currentOnError(error, data.info);
136
+ currentOnError(error, data.info ? (0, types_1.formatZipPeekError)(data.info) : undefined);
46
137
  });
47
138
  }
48
139
  function normalizeAllowedZipUrls(allowedZipUrls) {
@@ -50,13 +141,13 @@ function normalizeAllowedZipUrls(allowedZipUrls) {
50
141
  return undefined;
51
142
  }
52
143
  if (allowedZipUrls.length === 0) {
53
- throw new Error("zip-peek: allowedZipUrls must contain at least one ZIP URL when provided.");
144
+ throw (0, types_1.createZipPeekError)("allowedZipUrls must contain at least one ZIP URL when provided.");
54
145
  }
55
146
  const normalized = new Set();
56
147
  for (const zipUrl of allowedZipUrls) {
57
148
  const resolvedZipUrl = new URL(zipUrl, window.location.href).href;
58
149
  if (!(0, zip_utils_1.isZipPackage)(resolvedZipUrl)) {
59
- throw new Error(`zip-peek: allowedZipUrls contains a non-ZIP URL: ${zipUrl}`);
150
+ throw (0, types_1.createZipPeekError)(`allowedZipUrls contains a non-ZIP URL: ${zipUrl}`);
60
151
  }
61
152
  normalized.add((0, zip_utils_1.normalizeZipUrl)(resolvedZipUrl));
62
153
  }
@@ -65,7 +156,7 @@ function normalizeAllowedZipUrls(allowedZipUrls) {
65
156
  function postWorkerMessage(message) {
66
157
  const controller = navigator.serviceWorker.controller;
67
158
  if (!controller) {
68
- return Promise.resolve();
159
+ return Promise.reject((0, types_1.createZipPeekError)("No active service worker controller. Reload the page after first install, or pass reloadOnFirstInstall: true."));
69
160
  }
70
161
  return new Promise((resolve, reject) => {
71
162
  const channel = new MessageChannel();
@@ -81,7 +172,7 @@ function postWorkerMessage(message) {
81
172
  };
82
173
  channel.port1.onmessageerror = () => {
83
174
  channel.port1.close();
84
- reject(new Error("zip-peek: failed to receive service worker response."));
175
+ reject((0, types_1.createZipPeekError)("Failed to deserialize the service worker response on MessageChannel."));
85
176
  };
86
177
  controller.postMessage(message, [channel.port2]);
87
178
  });
@@ -91,7 +182,7 @@ async function postWorkerMessageOrThrow(message, info) {
91
182
  await postWorkerMessage(message);
92
183
  }
93
184
  catch (error) {
94
- throw toZipPeekError(error, info);
185
+ throw attachZipPeekInfo(error, info);
95
186
  }
96
187
  }
97
188
  /**
@@ -107,28 +198,27 @@ async function postWorkerMessageOrThrow(message, info) {
107
198
  async function initZipPeek({ workerUrl, scopeUrl, reloadOnFirstInstall = true, cacheClearingStrategy = "keep-all", allowedZipUrls, zipAssetCacheName, assetCacheTtlMs, logPrefix, onError, }) {
108
199
  if (onError) {
109
200
  currentOnError = onError;
110
- ensureClientErrorListener();
111
201
  }
112
202
  try {
113
203
  const normalizedAllowedZipUrls = normalizeAllowedZipUrls(allowedZipUrls);
114
- if (cacheClearingStrategy === "keep-allowed-urls" &&
115
- !normalizedAllowedZipUrls) {
116
- throw new Error('zip-peek: cacheClearingStrategy "keep-allowed-urls" requires a non-empty allowedZipUrls allow-list.');
204
+ if (cacheClearingStrategy === "keep-allowed-urls" && !normalizedAllowedZipUrls) {
205
+ throw (0, types_1.createZipPeekError)('cacheClearingStrategy "keep-allowed-urls" requires a non-empty allowedZipUrls allow-list.');
117
206
  }
118
207
  if (!("serviceWorker" in navigator)) {
119
- console.warn("zip-peek: Service Worker API not supported.");
208
+ console.warn("zip-peek: Service Worker API not supported in this browser.");
120
209
  return { reloaded: false, initialized: false };
121
210
  }
211
+ ensureClientMessageListener();
122
212
  let reloaded;
123
213
  try {
124
- reloaded = await (0, registerZipServiceWorker_1.ensureZipServiceWorkerRegistered)({
214
+ reloaded = await ensureZipServiceWorkerRegistered({
125
215
  workerUrl,
126
216
  scopeUrl,
127
217
  reloadOnFirstInstall,
128
218
  });
129
219
  }
130
220
  catch (error) {
131
- throw toZipPeekError(error, "zip-peek: service worker registration failed");
221
+ throw attachZipPeekInfo(error, "Service worker registration failed");
132
222
  }
133
223
  if (reloaded) {
134
224
  return { reloaded: true, initialized: false };
@@ -141,11 +231,11 @@ async function initZipPeek({ workerUrl, scopeUrl, reloadOnFirstInstall = true, c
141
231
  logPrefix,
142
232
  allowedZipUrls: normalizedAllowedZipUrls ?? null,
143
233
  },
144
- }, "zip-peek: failed to configure service worker");
234
+ }, "Failed to configure service worker");
145
235
  if (cacheClearingStrategy === "clear-all") {
146
236
  await postWorkerMessageOrThrow({
147
237
  type: "CLEAR_ALL_ZIP_ASSETS",
148
- }, "zip-peek: failed to clear zip assets");
238
+ }, "Failed to clear all zip assets");
149
239
  await postWorkerMessageOrThrow({
150
240
  type: "ZIP_SW_CONFIG",
151
241
  config: {
@@ -154,20 +244,19 @@ async function initZipPeek({ workerUrl, scopeUrl, reloadOnFirstInstall = true, c
154
244
  logPrefix,
155
245
  allowedZipUrls: normalizedAllowedZipUrls ?? null,
156
246
  },
157
- }, "zip-peek: failed to reconfigure service worker after cache clear");
247
+ }, "Failed to reconfigure service worker after cache clear");
158
248
  }
159
- else if (cacheClearingStrategy === "keep-allowed-urls" &&
160
- normalizedAllowedZipUrls) {
249
+ else if (cacheClearingStrategy === "keep-allowed-urls" && normalizedAllowedZipUrls) {
161
250
  await postWorkerMessageOrThrow({
162
251
  type: "CLEAR_ZIP_ASSETS_EXCEPT_ALLOWED",
163
252
  allowedZipUrls: normalizedAllowedZipUrls,
164
- }, "zip-peek: failed to clear disallowed zip assets");
253
+ }, "Failed to clear disallowed zip assets");
165
254
  }
166
255
  if (normalizedAllowedZipUrls) {
167
256
  await postWorkerMessageOrThrow({
168
257
  type: "PRELOAD_ZIP_MANIFESTS",
169
258
  allowedZipUrls: normalizedAllowedZipUrls,
170
- }, "zip-peek: failed to preload zip manifests");
259
+ }, "Failed to preload ZIP manifests");
171
260
  }
172
261
  return { reloaded: false, initialized: true };
173
262
  }
package/dist/types.d.ts CHANGED
@@ -25,3 +25,8 @@ export type WorkerMessageResponse = {
25
25
  error?: string;
26
26
  errorStack?: string;
27
27
  };
28
+ export declare const ZIP_PEEK_ERROR_PREFIX = "[zip-peek-error]";
29
+ export declare function formatZipPeekError(message: string): string;
30
+ export declare function createZipPeekError(message: string): Error;
31
+ export declare function toZipPeekError(error: unknown): Error;
32
+ export declare function errorMessage(error: unknown): string;
package/dist/types.js CHANGED
@@ -1,2 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZIP_PEEK_ERROR_PREFIX = void 0;
4
+ exports.formatZipPeekError = formatZipPeekError;
5
+ exports.createZipPeekError = createZipPeekError;
6
+ exports.toZipPeekError = toZipPeekError;
7
+ exports.errorMessage = errorMessage;
8
+ exports.ZIP_PEEK_ERROR_PREFIX = "[zip-peek-error]";
9
+ function formatZipPeekError(message) {
10
+ const trimmed = message.trim();
11
+ if (trimmed.startsWith(exports.ZIP_PEEK_ERROR_PREFIX)) {
12
+ return trimmed;
13
+ }
14
+ return `${exports.ZIP_PEEK_ERROR_PREFIX} ${trimmed}`;
15
+ }
16
+ function createZipPeekError(message) {
17
+ return new Error(formatZipPeekError(message));
18
+ }
19
+ function toZipPeekError(error) {
20
+ const err = error instanceof Error ? error : new Error(String(error));
21
+ if (!err.message.startsWith(exports.ZIP_PEEK_ERROR_PREFIX)) {
22
+ err.message = formatZipPeekError(err.message);
23
+ }
24
+ return err;
25
+ }
26
+ function errorMessage(error) {
27
+ return error instanceof Error ? error.message : String(error);
28
+ }
@@ -1,2 +1,2 @@
1
- (()=>{"use strict";var t={978(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.persistAllowedZipUrlsConfig=o,e.ensureAllowedZipUrlsLoaded=async function(){if(s.allowedZipUrlsLoaded)return s.allowedZipUrlsLoaded;const t=(async()=>{try{const t=await caches.open(r.CONFIG_CACHE_NAME),e=await t.match(s.CONFIG_CACHE_KEY);if(!e)return;const n=await e.json();Array.isArray(n.allowedZipUrls)?(0,s.setAllowedZipUrls)(new Set(n.allowedZipUrls.filter(t=>"string"==typeof t).map(t=>(0,i.normalizeZipUrl)(t)))):(0,s.setAllowedZipUrls)(null)}catch(t){(0,a.warn)("failed to load runtime config",t)}})();return(0,s.setAllowedZipUrlsLoaded)(t),t},e.applyRuntimeConfig=async function(t){if(!t)return;let e={...s.runtimeConfig},n=!1;if("string"==typeof t.zipAssetCacheName&&t.zipAssetCacheName.trim()&&(e.zipAssetCacheName=t.zipAssetCacheName,n=!0),"number"==typeof t.assetCacheTtlMs&&Number.isFinite(t.assetCacheTtlMs)&&(e.assetCacheTtlMs=t.assetCacheTtlMs,n=!0),"string"==typeof t.logPrefix&&t.logPrefix.trim()&&(e.logPrefix=t.logPrefix,n=!0),n&&(0,s.setRuntimeConfig)(e),"allowedZipUrls"in t){const e=Array.isArray(t.allowedZipUrls)?t.allowedZipUrls.map(t=>(0,i.normalizeZipUrl)(t)):null;(0,s.setAllowedZipUrls)(e?new Set(e):null),(0,s.setAllowedZipUrlsLoaded)(Promise.resolve()),await o(e)}},e.isZipUrlAllowed=function(t){return null===s.allowedZipUrls||s.allowedZipUrls.has(t)};const i=n(183),r=n(778),s=n(6),a=n(271);async function o(t){try{const e=await caches.open(r.CONFIG_CACHE_NAME);await e.put(new Request(s.CONFIG_CACHE_KEY),new Response(JSON.stringify({allowedZipUrls:t}),{headers:{"Content-Type":"application/json"}}))}catch(t){(0,a.warn)("failed to persist runtime config",t)}}},752(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.canonicalAssetRequest=function(t,e){return new Request((0,i.canonicalZipAssetRequestUrl)(t,e),{method:"GET"})},e.assetCacheEntryExpired=l,e.clearAllZipAssets=async function(){const t=await caches.open(o.runtimeConfig.zipAssetCacheName),e=await t.keys();await Promise.all(e.map(e=>t.delete(e))),await caches.delete(r.CONFIG_CACHE_NAME),o.zipManifests.clear(),o.pendingManifestLoads.clear(),(0,o.setAllowedZipUrlsLoaded)(Promise.resolve())},e.clearZipAssetsExceptAllowed=async function(t){try{const e=new Set(t),n=await caches.open(o.runtimeConfig.zipAssetCacheName),s=await n.keys();for(const t of s){const s=t.url;if(s.includes(r.MANIFEST_CACHE_KEY)){const i=(0,a.zipUrlFromManifestCacheKey)(s);i&&!e.has(i)&&await n.delete(t);continue}const o=(0,i.parseZipAssetRequest)(s);o&&!e.has(o.zipUrl)&&await n.delete(t)}for(const t of o.zipManifests.keys())e.has(t)||o.zipManifests.delete(t)}catch(t){(0,s.warn)("clearZipAssetsExceptAllowed failed",t)}},e.putCachedFullAssetIfAbsent=async function(t,e){try{const n=await caches.open(o.runtimeConfig.zipAssetCacheName),i=await n.match(t);if(i&&!l(i))return;const s=e.type||"application/octet-stream";await n.put(t,new Response(e,{status:200,headers:{"Content-Type":s,"Content-Length":String(e.size),"Access-Control-Allow-Origin":"*",[r.ASSET_CACHED_AT_HEADER]:String(Date.now())}}))}catch(t){(0,s.warn)("asset cache put failed",t)}},e.readCachedZipAssetIfFresh=async function(t){let e=null,n="network";try{const i=await caches.open(o.runtimeConfig.zipAssetCacheName),r=await i.match(t);if(r)if(l(r))try{await i.delete(t)}catch(t){(0,s.warn)("asset cache delete expired failed",t)}else e=await r.blob(),n="cache-api"}catch(t){(0,s.warn)("asset cache read failed",t)}return{blob:e,assetSource:n}};const i=n(183),r=n(778),s=n(271),a=n(234),o=n(6);function l(t){const e=t.headers.get(r.ASSET_CACHED_AT_HEADER);if(!e)return!0;const n=parseInt(e,10);return!Number.isFinite(n)||Date.now()-n>o.runtimeConfig.assetCacheTtlMs}},546(t,e){function n(t,e){const n=t instanceof Error?t:new Error(String(t));self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(t=>{const i={type:"ZIP_SW_ERROR",error:{message:n.message,stack:n.stack},info:e};for(const e of t)e.postMessage(i)})}Object.defineProperty(e,"__esModule",{value:!0}),e.reportClientError=n,e.installClientErrorReporting=function(){self.addEventListener("error",t=>{n(t.error??t.message,"zip-peek: service worker error")}),self.addEventListener("unhandledrejection",t=>{n(t.reason,"zip-peek: service worker unhandled rejection")})}},778(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MANIFEST_CACHE_KEY=e.LOCAL_FILE_HEADER_SIG=e.MIME_TYPES=e.ASSET_SOURCE_HEADER=e.ASSET_CACHED_AT_HEADER=e.ALLOWED_CACHE_NAMES=e.CONFIG_CACHE_NAME=e.DEFAULT_ASSET_CACHE_TTL_MS=e.DEFAULT_ZIP_ASSET_CACHE_NAME=void 0,e.DEFAULT_ZIP_ASSET_CACHE_NAME="zip-cache-v1",e.DEFAULT_ASSET_CACHE_TTL_MS=72e5,e.CONFIG_CACHE_NAME="zip-peek-config-v1",e.ALLOWED_CACHE_NAMES=[e.DEFAULT_ZIP_ASSET_CACHE_NAME,e.CONFIG_CACHE_NAME],e.ASSET_CACHED_AT_HEADER="X-ZipSW-Cached-At",e.ASSET_SOURCE_HEADER="X-ZipSW-Asset-Source",e.MIME_TYPES={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",json:"application/json",js:"application/javascript",css:"text/css; charset=utf-8",html:"text/html; charset=utf-8",txt:"text/plain; charset=utf-8",mp4:"video/mp4",webm:"video/webm",mp3:"audio/mpeg",wav:"audio/wav",oga:"audio/ogg",ogg:"audio/ogg",xml:"application/xml",wasm:"application/wasm"},e.LOCAL_FILE_HEADER_SIG=67324752,e.MANIFEST_CACHE_KEY="__zipsw_manifest__=1"},886(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.installFetchHandler=function(){self.addEventListener("fetch",t=>{if("GET"!==t.request.method)return;const e=(0,i.parseZipAssetRequest)(t.request.url);if(!e)return;const n=(0,i.normalizeZipUrl)(e.zipUrl),f=e.internalPath,h=(0,i.normalizeZipEntryPath)(f);t.respondWith((async()=>{if(await(0,r.ensureAllowedZipUrlsLoaded)(),!(0,r.isZipUrlAllowed)(n))return(0,o.warn)("zip URL not allowed",{requestedZipUrl:n}),(0,c.corsErrorResponse)("Zip URL not allowed",403);let e=u.zipManifests.get(n);if(e||(e=await(0,l.ensureManifestAvailable)(n)??void 0),!e){const t=Array.from(u.zipManifests.keys());return(0,o.warn)("manifest missing for zipUrl",{requestedZipUrl:n,knownZipUrls:t}),(0,c.corsErrorResponse)("Zip manifest not loaded",404)}const i=(0,l.resolveManifestEntry)(e,h);if(!i){const t=Array.from(e.keys()).slice(0,50);return(0,o.warn)("file not in manifest or ambiguous suffix match",{zipUrl:n,internalPathRaw:f,internalPathNormalized:h,manifestSize:e.size,sampleKeys:t}),(0,c.corsErrorResponse)("File not found in zip manifest",404)}const{key:p,info:d}=i;p!==h&&(0,o.log)("resolved via suffix match",{requested:h,manifestKey:p});const g=(0,s.canonicalAssetRequest)(n,p);let{blob:v,assetSource:m}=await(0,s.readCachedZipAssetIfFresh)(g);if(!v){const t=await(0,c.fetchUncompressedZipEntryFromNetwork)(n,p,d,g);if(!t.ok)return t.response;v=t.blob,m="network"}if(t.request.headers.has("range")){const e=t.request.headers.get("range").replace(/^bytes=/,"");if(e.includes(","))return new Response(null,{status:416,headers:{"Content-Range":`bytes */${v.size}`,"Access-Control-Allow-Origin":"*"}});const[n,i]=e.split("-"),r=""!==n?parseInt(n,10):NaN,s=""!==i?parseInt(i,10):v.size-1;if(isNaN(r)||isNaN(s)||r<0||s<r||r>=v.size)return new Response(null,{status:416,headers:{"Content-Range":`bytes */${v.size}`,"Access-Control-Allow-Origin":"*"}});const o=Math.min(s,v.size-1),l=v.slice(r,o+1);return new Response(l,{status:206,headers:{"Content-Type":v.type,"Content-Range":`bytes ${r}-${o}/${v.size}`,"Content-Length":l.size.toString(),"Accept-Ranges":"bytes","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":a.ASSET_SOURCE_HEADER,[a.ASSET_SOURCE_HEADER]:m}})}return new Response(v,{status:200,headers:{"Content-Type":v.type,"Content-Length":v.size.toString(),"Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":a.ASSET_SOURCE_HEADER,[a.ASSET_SOURCE_HEADER]:m}})})())})};const i=n(183),r=n(978),s=n(752),a=n(778),o=n(271),l=n(234),u=n(6),c=n(878)},271(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.log=function(...t){console.log(i.runtimeConfig.logPrefix,...t)},e.warn=function(...t){console.warn(i.runtimeConfig.logPrefix,...t)};const i=n(6)},234(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.manifestCacheKey=o,e.persistManifest=l,e.loadPersistedManifest=u,e.parseCentralDirectoryToManifest=c,e.fetchZipManifest=f,e.ensureManifestAvailable=function(t){const e=a.zipManifests.get(t);if(e)return Promise.resolve(e);let n=a.pendingManifestLoads.get(t);return n||(n=(async()=>{const e=await u(t);if(e)return a.zipManifests.set(t,e),(0,s.log)("rehydrated manifest from cache",{zipUrl:t,entryCount:e.size}),e;const n=await f(t);return n&&(a.zipManifests.set(t,n),await l(t,n),(0,s.log)("manifest fetched and cached",{zipUrl:t,entryCount:n.size})),n})().finally(()=>{a.pendingManifestLoads.delete(t)}),a.pendingManifestLoads.set(t,n),n)},e.resolveManifestEntry=function(t,e){if(t.has(e))return{key:e,info:t.get(e)};const n=[];for(const i of t.keys())i.endsWith("/"+e)&&n.push(i);if(1===n.length){const e=n[0];return{key:e,info:t.get(e)}}return n.length>1?((0,s.warn)("ambiguous suffix match",{requested:e,picked:n[0],candidates:n.slice(0,8)}),null):null},e.zipUrlFromManifestCacheKey=function(t){const e=r.MANIFEST_CACHE_KEY;if(!t.endsWith(e))return null;let n=t.slice(0,-e.length);return(n.endsWith("?")||n.endsWith("&"))&&(n=n.slice(0,-1)),n};const i=n(183),r=n(778),s=n(271),a=n(6);function o(t){return t+(t.includes("?")?"&":"?")+r.MANIFEST_CACHE_KEY}async function l(t,e){try{const n=await caches.open(a.runtimeConfig.zipAssetCacheName),i=Array.from(e.values());await n.put(new Request(o(t)),new Response(JSON.stringify(i),{headers:{"Content-Type":"application/json"}}))}catch(t){(0,s.warn)("failed to persist manifest",t)}}async function u(t){try{const e=await caches.open(a.runtimeConfig.zipAssetCacheName),n=await e.match(o(t));if(!n)return null;const r=await n.json();if(!Array.isArray(r)||0===r.length)return null;const s=new Map;for(const t of r){const e=(0,i.normalizeZipEntryPath)(t.filename);""!==e&&s.set(e,t)}return s.size>0?s:null}catch(t){return(0,s.warn)("failed to load persisted manifest",t),null}}function c(t,e,n,r){const a=new DataView(t);let o=e;const l=[];for(;o+46<=t.byteLength&&33639248===a.getUint32(o,!0);){const e=a.getUint16(o+10,!0),n=a.getUint32(o+20,!0),r=a.getUint16(o+28,!0),s=a.getUint16(o+30,!0),u=a.getUint16(o+32,!0),c=a.getUint32(o+42,!0),f=new TextDecoder;if(o+46+r>t.byteLength)break;const h=new Uint8Array(t,o+46,r),p=f.decode(h),d=(0,i.normalizeZipEntryPath)(p);""!==d&&l.push({filename:d,offset:c,compressedSize:n,compression:e}),o+=46+r+s+u}if(0===l.length)return(0,s.warn)("no files parsed from central directory",r),null;l.sort((t,e)=>t.offset-e.offset);const u=new Map;for(let t=0;t<l.length;t++){const e=l[t],r=(0,i.normalizeZipEntryPath)(e.filename);""!==r&&(u.has(r)&&(0,s.warn)("duplicate manifest key after normalize; overwriting",r),u.set(r,{filename:e.filename,offset:e.offset,compressedSize:e.compressedSize,compression:e.compression,nextOffset:t<l.length-1?l[t+1].offset:n}))}return u.size>0?u:null}async function f(t){const e=await fetch(t,{headers:{Range:"bytes=-65536"}});if(206!==e.status)return(0,s.warn)("range requests not supported",{zipUrl:t,status:e.status}),null;const n=await e.arrayBuffer(),i=new DataView(n);let r=-1;for(let t=n.byteLength-22;t>=0;t--)if(101010256===i.getUint32(t,!0)){r=t;break}if(-1===r)return(0,s.warn)("EOCD not found in last 64KB",t),null;const a=i.getUint32(r+16,!0),o=i.getUint32(r+12,!0);let l=n,u=-1;const f=e.headers.get("Content-Range");let h=0;if(f){const t=f.match(/\/(\d+)$/);t&&(h=parseInt(t[1],10))}if(h<=0)return null;const p=h-n.byteLength;if(a>=p)u=a-p;else{const e=await fetch(t,{headers:{Range:`bytes=${a}-${a+o-1}`}});if(206!==e.status)return(0,s.warn)("failed to fetch central directory",{zipUrl:t,status:e.status}),null;l=await e.arrayBuffer(),u=0}return c(l,u,a,t)}},49(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.replyToMessage=c,e.installMessageHandler=function(){self.addEventListener("message",t=>{if(!t.data)return;const{type:e,zipUrl:n,files:f,config:h,allowedZipUrls:p}=t.data;if("ZIP_SW_CONFIG"===e){const e=(0,r.applyRuntimeConfig)(h).then(()=>c(t,{ok:!0})).catch(e=>c(t,u(e)));return void t.waitUntil(e)}if("ZIP_MANIFEST"===e){if(n&&f){const e=(0,i.normalizeZipUrl)(n),r=new Map;let s=!1;for(const t of f){const e=(0,i.normalizeZipEntryPath)(t.filename);""!==e?(r.has(e)&&(0,a.warn)("duplicate manifest key after normalize; overwriting",e),r.set(e,t)):s=!0}const u=l.zipManifests.get(e);if(0===r.size)return void(0,a.warn)("rejecting empty manifest; keeping existing",{zipUrl:e,existingSize:u?u.size:0,hadEmptyKey:s});if(u&&u.size>r.size)return void(0,a.warn)("rejecting smaller manifest; keeping existing",{zipUrl:e,incomingSize:r.size,existingSize:u.size});l.zipManifests.set(e,r),t.waitUntil((0,o.persistManifest)(e,r));const c=Array.from(r.keys()).slice(0,40);(0,a.log)("ZIP_MANIFEST loaded",{zipUrl:e,entryCount:r.size,sampleKeys:c,replacedExistingSize:u?u.size:0})}}else if("CLEAR_ZIP_ASSETS_EXCEPT_ALLOWED"===e&&p){const e=(0,s.clearZipAssetsExceptAllowed)(p).then(()=>c(t,{ok:!0})).catch(e=>c(t,u(e)));t.waitUntil(e)}else if("CLEAR_ALL_ZIP_ASSETS"===e){const e=(0,s.clearAllZipAssets)().then(()=>c(t,{ok:!0})).catch(e=>c(t,u(e)));t.waitUntil(e)}else if("PRELOAD_ZIP_MANIFESTS"===e&&p){const e=Promise.all(p.map(t=>(0,o.ensureManifestAvailable)(t))).then(()=>c(t,{ok:!0})).catch(e=>c(t,u(e)));t.waitUntil(e)}})};const i=n(183),r=n(978),s=n(752),a=n(271),o=n(234),l=n(6);function u(t){const e=t instanceof Error?t:new Error(String(t));return{ok:!1,error:e.message,errorStack:e.stack}}function c(t,e){t.ports[0]?.postMessage(e)}},6(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.CONFIG_CACHE_KEY=e.allowedZipUrlsLoaded=e.allowedZipUrls=e.runtimeConfig=e.pendingManifestLoads=e.zipManifests=void 0,e.setRuntimeConfig=function(t){e.runtimeConfig=t},e.setAllowedZipUrls=function(t){e.allowedZipUrls=t},e.setAllowedZipUrlsLoaded=function(t){e.allowedZipUrlsLoaded=t};const i=n(778);e.zipManifests=new Map,e.pendingManifestLoads=new Map,e.runtimeConfig={zipAssetCacheName:i.DEFAULT_ZIP_ASSET_CACHE_NAME,assetCacheTtlMs:i.DEFAULT_ASSET_CACHE_TTL_MS,logPrefix:"[zipSW]"},e.allowedZipUrls=null,e.allowedZipUrlsLoaded=null,e.CONFIG_CACHE_KEY=new URL("__zip_peek_runtime_config__",self.registration.scope).href},878(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.corsErrorResponse=o,e.getMimeType=l,e.fetchUncompressedZipEntryFromNetwork=async function(t,e,n,u){const c=n.offset,f=n.nextOffset-1;(0,s.log)("fetching zip chunk from",{zipUrl:t,rangeStart:c,rangeEnd:f});const h=await fetch(t,{headers:{Range:`bytes=${c}-${f}`}});if(206!==h.status)return{ok:!1,response:o("The server did not return a 206 Partial Content response",h.status)};const p=await h.arrayBuffer(),d=new DataView(p);if(d.getUint32(0,!0)!==r.LOCAL_FILE_HEADER_SIG)return{ok:!1,response:o("Invalid Local File Header",500)};const g=30+d.getUint16(26,!0)+d.getUint16(28,!0);if(g>p.byteLength||g+n.compressedSize>p.byteLength)return{ok:!1,response:o(`Invalid data start or compressed size for file ${e}: dataStart=${g}, compressedSize=${n.compressedSize}, bufferLength=${p.byteLength}`,500)};const v=new Uint8Array(p,g,n.compressedSize);let m;if(8===n.compression)try{m=(0,i.inflateSync)(v)}catch(t){return(0,s.warn)("inflateSync failed",t),{ok:!1,response:o("Failed to inflate the compressed data",500)}}else{if(0!==n.compression)return{ok:!1,response:o(`Unsupported compression method: ${n.compression}`,500)};m=v}const y=l(e),w=new Blob([m],{type:y});return await(0,a.putCachedFullAssetIfAbsent)(u,w),{ok:!0,blob:w}};const i=n(845),r=n(778),s=n(271),a=n(752);function o(t,e){return new Response(t,{status:e,headers:{"Access-Control-Allow-Origin":"*"}})}function l(t){const e=t.split(".").pop()?.toLowerCase();return e?r.MIME_TYPES[e]??"application/octet-stream":"application/octet-stream"}},183(t,e){function n(t){try{return decodeURIComponent(t)}catch{return t}}Object.defineProperty(e,"__esModule",{value:!0}),e.isZipPackage=function(t){try{return new URL(t).pathname.endsWith(".zip")}catch{return t.split("?")[0].endsWith(".zip")}},e.normalizeZipUrl=function(t,e={}){const{stripCacheBuster:n=!0,stripHash:i=!0}=e,r=t=>i?t.split("#")[0]:t;if(!n)return r(t);const s=t.indexOf("?");if(-1===s)return r(t);const a=t.indexOf("#",s),o=t.substring(0,s),l=-1===a?t.substring(s+1):t.substring(s+1,a),u=i||-1===a?"":t.substring(a),c=l.split("&").filter(t=>{const e=t.indexOf("=");return"t"!==(-1===e?t:t.substring(0,e))});return 0===c.length?o+u:o+"?"+c.join("&")+u},e.normalizeZipEntryPath=function(t){let e=t.replace(/\\/g,"/");for(;e.startsWith("/");)e=e.slice(1);return e},e.parseZipAssetRequest=function(t){const e=/\.zip([/?])/.exec(t);if(!e)return null;const i=e.index+4,r=e[1],s=t.substring(0,i);if("/"===r){const e=t.substring(i+1),r=e.indexOf("?"),a=-1===r?e:e.substring(0,r);return""===a?null:{zipUrl:s,internalPath:n(a)}}const a=t.substring(i),o=a.indexOf("/");if(-1===o)return null;const l=a.substring(0,o),u=a.substring(o+1),c=u.indexOf("?"),f=-1===c?u:u.substring(0,c);return""===f?null:{zipUrl:s+l,internalPath:n(f)}},e.canonicalZipAssetRequestUrl=function(t,e){return t+"/"+encodeURIComponent(e)}},845(t,e){var n={},i=function(t,e,i,r,s){var a=new Worker(n[e]||(n[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(t){var e=t.data,n=e.$e$;if(n){var i=new Error(n[0]);i.code=n[1],i.stack=n[2],s(i,null)}else s(null,e)},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]),l=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]),u=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=function(t,e){for(var n=new s(31),i=0;i<31;++i)n[i]=e+=1<<t[i-1];var r=new a(n[30]);for(i=1;i<30;++i)for(var o=n[i];o<n[i+1];++o)r[o]=o-n[i]<<5|i;return{b:n,r}},f=c(o,2),h=f.b,p=f.r;h[28]=258,p[258]=28;for(var d=c(l,0),g=d.b,v=d.r,m=new s(32768),y=0;y<32768;++y){var w=(43690&y)>>1|(21845&y)<<1;w=(61680&(w=(52428&w)>>2|(13107&w)<<2))>>4|(3855&w)<<4,m[y]=((65280&w)>>8|(255&w)<<8)>>1}var A=function(t,e,n){for(var i=t.length,r=0,a=new s(e);r<i;++r)t[r]&&++a[t[r]-1];var o,l=new s(e);for(r=1;r<e;++r)l[r]=l[r-1]+a[r-1]<<1;if(n){o=new s(1<<e);var u=15-e;for(r=0;r<i;++r)if(t[r])for(var c=r<<4|t[r],f=e-t[r],h=l[t[r]-1]++<<f,p=h|(1<<f)-1;h<=p;++h)o[m[h]>>u]=c}else for(o=new s(i),r=0;r<i;++r)t[r]&&(o[r]=m[l[t[r]-1]++]>>15-t[r]);return o},E=new r(288);for(y=0;y<144;++y)E[y]=8;for(y=144;y<256;++y)E[y]=9;for(y=256;y<280;++y)E[y]=7;for(y=280;y<288;++y)E[y]=8;var C=new r(32);for(y=0;y<32;++y)C[y]=5;var b=A(E,9,0),z=A(E,9,1),_=A(C,5,0),S=A(C,5,1),M=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},U=function(t,e,n){var i=e/8|0;return(t[i]|t[i+1]<<8)>>(7&e)&n},T=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},Z=function(t){return(t+7)/8|0},k=function(t,e,n){return(null==e||e<0)&&(e=0),(null==n||n>t.length)&&(n=t.length),new r(t.subarray(e,n))};e.FlateErrorCode={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14};var L=["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"],x=function(t,e,n){var i=new Error(e||L[t]);if(i.code=t,Error.captureStackTrace&&Error.captureStackTrace(i,x),!n)throw i;return i},R=function(t,e,n,i){var s=t.length,a=i?i.length:0;if(!s||e.f&&!e.l)return n||new r(0);var c=!n,f=c||2!=e.i,p=e.i;c&&(n=new r(3*s));var d=function(t){var e=n.length;if(t>e){var i=new r(Math.max(2*e,t));i.set(n),n=i}},v=e.f||0,m=e.p||0,y=e.b||0,w=e.l,E=e.d,C=e.m,b=e.n,_=8*s;do{if(!w){v=U(t,m,1);var L=U(t,m+1,3);if(m+=3,!L){var R=t[($=Z(m)+4)-4]|t[$-3]<<8,I=$+R;if(I>s){p&&x(0);break}f&&d(y+R),n.set(t.subarray($,I),y),e.b=y+=R,e.p=m=8*I,e.f=v;continue}if(1==L)w=z,E=S,C=9,b=5;else if(2==L){var O=U(t,m,31)+257,F=U(t,m+10,15)+4,N=O+U(t,m+5,31)+1;m+=14;for(var P=new r(N),D=new r(19),H=0;H<F;++H)D[u[H]]=U(t,m+3*H,7);m+=3*F;var j=M(D),q=(1<<j)-1,G=A(D,j,1);for(H=0;H<N;){var $,W=G[U(t,m,q)];if(m+=15&W,($=W>>4)<16)P[H++]=$;else{var K=0,Y=0;for(16==$?(Y=3+U(t,m,3),m+=2,K=P[H-1]):17==$?(Y=3+U(t,m,7),m+=3):18==$&&(Y=11+U(t,m,127),m+=7);Y--;)P[H++]=K}}var B=P.subarray(0,O),V=P.subarray(O);C=M(B),b=M(V),w=A(B,C,1),E=A(V,b,1)}else x(1);if(m>_){p&&x(0);break}}f&&d(y+131072);for(var X=(1<<C)-1,J=(1<<b)-1,Q=m;;Q=m){var tt=(K=w[T(t,m)&X])>>4;if((m+=15&K)>_){p&&x(0);break}if(K||x(2),tt<256)n[y++]=tt;else{if(256==tt){Q=m,w=null;break}var et=tt-254;if(tt>264){var nt=o[H=tt-257];et=U(t,m,(1<<nt)-1)+h[H],m+=nt}var it=E[T(t,m)&J],rt=it>>4;if(it||x(3),m+=15&it,V=g[rt],rt>3&&(nt=l[rt],V+=T(t,m)&(1<<nt)-1,m+=nt),m>_){p&&x(0);break}f&&d(y+131072);var st=y+et;if(y<V){var at=a-V,ot=Math.min(V,st);for(at+y<0&&x(3);y<ot;++y)n[y]=i[at+y]}for(;y<st;++y)n[y]=n[y-V]}}e.l=w,e.p=Q,e.b=y,e.f=v,w&&(v=1,e.m=C,e.d=E,e.n=b)}while(!v);return y!=n.length&&c?k(n,0,y):n.subarray(0,y)},I=function(t,e,n){n<<=7&e;var i=e/8|0;t[i]|=n,t[i+1]|=n>>8},O=function(t,e,n){n<<=7&e;var i=e/8|0;t[i]|=n,t[i+1]|=n>>8,t[i+2]|=n>>16},F=function(t,e){for(var n=[],i=0;i<t.length;++i)t[i]&&n.push({s:i,f:t[i]});var a=n.length,o=n.slice();if(!a)return{t:G,l:0};if(1==a){var l=new r(n[0].s+1);return l[n[0].s]=1,{t:l,l:1}}n.sort(function(t,e){return t.f-e.f}),n.push({s:-1,f:25001});var u=n[0],c=n[1],f=0,h=1,p=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};h!=a-1;)u=n[n[f].f<n[p].f?f++:p++],c=n[f!=h&&n[f].f<n[p].f?f++:p++],n[h++]={s:-1,f:u.f+c.f,l:u,r:c};var d=o[0].s;for(i=1;i<a;++i)o[i].s>d&&(d=o[i].s);var g=new s(d+1),v=N(n[h-1],g,0);if(v>e){i=0;var m=0,y=v-e,w=1<<y;for(o.sort(function(t,e){return g[e.s]-g[t.s]||t.f-e.f});i<a;++i){var A=o[i].s;if(!(g[A]>e))break;m+=w-(1<<v-g[A]),g[A]=e}for(m>>=y;m>0;){var E=o[i].s;g[E]<e?m-=1<<e-g[E]++-1:++i}for(;i>=0&&m;--i){var C=o[i].s;g[C]==e&&(--g[C],++m)}v=e}return{t:new r(g),l:v}},N=function(t,e,n){return-1==t.s?Math.max(N(t.l,e,n+1),N(t.r,e,n+1)):e[t.s]=n},P=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new s(++e),i=0,r=t[0],a=1,o=function(t){n[i++]=t},l=1;l<=e;++l)if(t[l]==r&&l!=e)++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[l]}return{c:n.subarray(0,i),n:e}},D=function(t,e){for(var n=0,i=0;i<e.length;++i)n+=t[i]*e[i];return n},H=function(t,e,n){var i=n.length,r=Z(e+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]=n[s];return 8*(r+4+i)},j=function(t,e,n,i,r,a,c,f,h,p,d){I(e,d++,n),++r[256];for(var g=F(r,15),v=g.t,m=g.l,y=F(a,15),w=y.t,z=y.l,S=P(v),M=S.c,U=S.n,T=P(w),Z=T.c,k=T.n,L=new s(19),x=0;x<M.length;++x)++L[31&M[x]];for(x=0;x<Z.length;++x)++L[31&Z[x]];for(var R=F(L,7),N=R.t,j=R.l,q=19;q>4&&!N[u[q-1]];--q);var G,$,W,K,Y=p+5<<3,B=D(r,E)+D(a,C)+c,V=D(r,v)+D(a,w)+c+14+3*q+D(L,N)+2*L[16]+3*L[17]+7*L[18];if(h>=0&&Y<=B&&Y<=V)return H(e,d,t.subarray(h,h+p));if(I(e,d,1+(V<B)),d+=2,V<B){G=A(v,m,0),$=v,W=A(w,z,0),K=w;var X=A(N,j,0);for(I(e,d,U-257),I(e,d+5,k-1),I(e,d+10,q-4),d+=14,x=0;x<q;++x)I(e,d+3*x,N[u[x]]);d+=3*q;for(var J=[M,Z],Q=0;Q<2;++Q){var tt=J[Q];for(x=0;x<tt.length;++x){var et=31&tt[x];I(e,d,X[et]),d+=N[et],et>15&&(I(e,d,tt[x]>>5&127),d+=tt[x]>>12)}}}else G=b,$=E,W=_,K=C;for(x=0;x<f;++x){var nt=i[x];if(nt>255){O(e,d,G[257+(et=nt>>18&31)]),d+=$[et+257],et>7&&(I(e,d,nt>>23&31),d+=o[et]);var it=31&nt;O(e,d,W[it]),d+=K[it],it>3&&(O(e,d,nt>>5&8191),d+=l[it])}else O(e,d,G[nt]),d+=$[nt]}return O(e,d,G[256]),d+$[256]},q=new a([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),G=new r(0),$=function(t,e,n,i,u,c){var f=c.z||t.length,h=new r(i+f+5*(1+Math.ceil(f/7e3))+u),d=h.subarray(i,h.length-u),g=c.l,m=7&(c.r||0);if(e){m&&(d[0]=c.r>>3);for(var y=q[e-1],w=y>>13,A=8191&y,E=(1<<n)-1,C=c.p||new s(32768),b=c.h||new s(E+1),z=Math.ceil(n/3),_=2*z,S=function(e){return(t[e]^t[e+1]<<z^t[e+2]<<_)&E},M=new a(25e3),U=new s(288),T=new s(32),L=0,x=0,R=c.i||0,I=0,O=c.w||0,F=0;R+2<f;++R){var N=S(R),P=32767&R,D=b[N];if(C[P]=D,b[N]=P,O<=R){var G=f-R;if((L>7e3||I>24576)&&(G>423||!g)){m=j(t,d,0,M,U,T,x,I,F,R-F,m),I=L=x=0,F=R;for(var $=0;$<286;++$)U[$]=0;for($=0;$<30;++$)T[$]=0}var W=2,K=0,Y=A,B=P-D&32767;if(G>2&&N==S(R-B))for(var V=Math.min(w,G)-1,X=Math.min(32767,R),J=Math.min(258,G);B<=X&&--Y&&P!=D;){if(t[R+W]==t[R+W-B]){for(var Q=0;Q<J&&t[R+Q]==t[R+Q-B];++Q);if(Q>W){if(W=Q,K=B,Q>V)break;var tt=Math.min(B,Q-2),et=0;for($=0;$<tt;++$){var nt=R-B+$&32767,it=nt-C[nt]&32767;it>et&&(et=it,D=nt)}}}B+=(P=D)-(D=C[P])&32767}if(K){M[I++]=268435456|p[W]<<18|v[K];var rt=31&p[W],st=31&v[K];x+=o[rt]+l[st],++U[257+rt],++T[st],O=R+W,++L}else M[I++]=t[R],++U[t[R]]}}for(R=Math.max(R,O);R<f;++R)M[I++]=t[R],++U[t[R]];m=j(t,d,g,M,U,T,x,I,F,R-F,m),g||(c.r=7&m|d[m/8|0]<<3,m-=7,c.h=b,c.p=C,c.i=R,c.w=O)}else{for(R=c.w||0;R<f+g;R+=65535){var at=R+65535;at>=f&&(d[m/8|0]=g,at=f),m=H(d,m+1,t.subarray(R,at))}c.i=f}return k(h,0,i+Z(m)+u)},W=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,i=9;--i;)n=(1&n&&-306674912)^n>>>1;t[e]=n}return t}(),K=function(){var t=-1;return{p:function(e){for(var n=t,i=0;i<e.length;++i)n=W[255&n^e[i]]^n>>>8;t=n},d:function(){return~t}}},Y=function(){var t=1,e=0;return{p:function(n){for(var i=t,r=e,s=0|n.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)r+=i+=n[a];i=(65535&i)+15*(i>>16),r=(65535&r)+15*(r>>16)}t=i,e=r},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(e%=65521))<<8|e>>8}}},B=function(t,e,n,i,s){if(!s&&(s={l:1},e.dictionary)){var a=e.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==e.level?6:e.level,null==e.mem?s.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+e.mem,n,i,s)},V=function(t,e){var n={};for(var i in t)n[i]=t[i];for(var i in e)n[i]=e[i];return n},X=function(t,e,n){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],l=s[a];if("function"==typeof o){e+=";"+l+"=";var u=o.toString();if(o.prototype)if(-1!=u.indexOf("[native code]")){var c=u.indexOf(" ",8)+1;e+=u.slice(c,u.indexOf("(",c))}else for(var f in e+=u,o.prototype)e+=";"+l+".prototype."+f+"="+o.prototype[f].toString();else e+=u}else n[l]=o}return e},J=[],Q=function(t,e,n,r){if(!J[n]){for(var s="",a={},o=t.length-1,l=0;l<o;++l)s=X(t[l],s,a);J[n]={c:X(t[o],s,a),e:a}}var u=V({},J[n].e);return i(J[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e}(u),r)},tt=function(){return[r,s,a,o,l,u,h,g,z,S,m,L,A,M,U,T,Z,k,x,R,Tt,at,ot]},et=function(){return[r,s,a,o,l,u,p,v,b,E,_,C,m,q,G,A,I,O,F,N,P,D,H,j,Z,k,$,B,_t,at]},nt=function(){return[gt,yt,dt,K,W]},it=function(){return[vt,mt]},rt=function(){return[wt,dt,Y]},st=function(){return[At]},at=function(t){return postMessage(t,[t.buffer])},ot=function(t){return t&&{out:t.size&&new r(t.size),dictionary:t.dictionary}},lt=function(t,e,n,i,r,s){var a=Q(n,i,r,function(t,e){a.terminate(),s(t,e)});return a.postMessage([t,e],e.consume?[t.buffer]:[]),function(){a.terminate()}},ut=function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){e.data.length?(t.push(e.data[0],e.data[1]),postMessage([e.data[0].length])):t.flush()}},ct=function(t,e,n,i,r,s,a){var o,l=Q(t,i,r,function(t,n){t?(l.terminate(),e.ondata.call(e,t)):Array.isArray(n)?1==n.length?(e.queuedSize-=n[0],e.ondrain&&e.ondrain(n[0])):(n[1]&&l.terminate(),e.ondata.call(e,t,n[0],n[1])):a(n)});l.postMessage(n),e.queuedSize=0,e.push=function(t,n){e.ondata||x(5),o&&e.ondata(x(4,0,1),null,!!n),e.queuedSize+=t.length,l.postMessage([t,o=n],[t.buffer])},e.terminate=function(){l.terminate()},s&&(e.flush=function(){l.postMessage([])})},ft=function(t,e){return t[e]|t[e+1]<<8},ht=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},pt=function(t,e){return ht(t,e)+4294967296*ht(t,e+4)},dt=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},gt=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&dt(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var i=0;i<=n.length;++i)t[i+10]=n.charCodeAt(i)}},vt=function(t){31==t[0]&&139==t[1]&&8==t[2]||x(6,"invalid gzip data");var e=t[3],n=10;4&e&&(n+=2+(t[10]|t[11]<<8));for(var i=(e>>3&1)+(e>>4&1);i>0;i-=!t[n++]);return n+(2&e)},mt=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},yt=function(t){return 10+(t.filename?t.filename.length+1:0)},wt=function(t,e){var n=e.level,i=0==n?0:n<6?1:9==n?3:2;if(t[0]=120,t[1]=i<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var r=Y();r.p(e.dictionary),dt(t,2,r.d())}},At=function(t,e){return(8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31)&&x(6,"invalid zlib data"),(t[1]>>5&1)==+!e&&x(6,"invalid zlib data: "+(32&t[1]?"need":"unexpected")+" dictionary"),2+(t[1]>>3&4)};function Et(t,e){return"function"==typeof t&&(e=t,t={}),this.ondata=e,t}var Ct=function(){function t(t,e){if("function"==typeof t&&(e=t,t={}),this.ondata=e,this.o=t||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new r(98304),this.o.dictionary){var n=this.o.dictionary.subarray(-32768);this.b.set(n,32768-n.length),this.s.i=32768-n.length}}return t.prototype.p=function(t,e){this.ondata(B(t,this.o,0,0,this.s),e)},t.prototype.push=function(t,e){this.ondata||x(5),this.s.l&&x(4);var n=t.length+this.s.z;if(n>this.b.length){if(n>2*this.b.length-32768){var i=new r(-32768&n);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&e,(this.s.z>this.s.w+8191||e)&&(this.p(this.b,e||!1),this.s.w=this.s.i,this.s.i-=2)},t.prototype.flush=function(){this.ondata||x(5),this.s.l&&x(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},t}();e.Deflate=Ct;var bt=function(){return function(t,e){ct([et,function(){return[ut,Ct]}],this,Et.call(this,t,e),function(t){var e=new Ct(t.data);onmessage=ut(e)},6,1)}}();function zt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[et],function(t){return at(_t(t.data[0],t.data[1]))},0,n)}function _t(t,e){return B(t,e||{},0,0)}e.AsyncDeflate=bt,e.deflate=zt,e.deflateSync=_t;var St=function(){function t(t,e){"function"==typeof t&&(e=t,t={}),this.ondata=e;var n=t&&t.dictionary&&t.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new r(32768),this.p=new r(0),n&&this.o.set(n)}return t.prototype.e=function(t){if(this.ondata||x(5),this.d&&x(4),this.p.length){if(t.length){var e=new r(this.p.length+t.length);e.set(this.p),e.set(t,this.p.length),this.p=e}}else this.p=t},t.prototype.c=function(t){this.s.i=+(this.d=t||!1);var e=this.s.b,n=R(this.p,this.s,this.o);this.ondata(k(n,e,this.s.b),this.d),this.o=k(n,this.s.b-32768),this.s.b=this.o.length,this.p=k(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}();e.Inflate=St;var Mt=function(){return function(t,e){ct([tt,function(){return[ut,St]}],this,Et.call(this,t,e),function(t){var e=new St(t.data);onmessage=ut(e)},7,0)}}();function Ut(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[tt],function(t){return at(Tt(t.data[0],ot(t.data[1])))},1,n)}function Tt(t,e){return R(t,{i:2},e&&e.out,e&&e.dictionary)}e.AsyncInflate=Mt,e.inflate=Ut,e.inflateSync=Tt;var Zt=function(){function t(t,e){this.c=K(),this.l=0,this.v=1,Ct.call(this,t,e)}return t.prototype.push=function(t,e){this.c.p(t),this.l+=t.length,Ct.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){var n=B(t,this.o,this.v&&yt(this.o),e&&8,this.s);this.v&&(gt(n,this.o),this.v=0),e&&(dt(n,n.length-8,this.c.d()),dt(n,n.length-4,this.l)),this.ondata(n,e)},t.prototype.flush=function(){Ct.prototype.flush.call(this)},t}();e.Gzip=Zt,e.Compress=Zt;var kt=function(){return function(t,e){ct([et,nt,function(){return[ut,Ct,Zt]}],this,Et.call(this,t,e),function(t){var e=new Zt(t.data);onmessage=ut(e)},8,1)}}();function Lt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[et,nt,function(){return[xt]}],function(t){return at(xt(t.data[0],t.data[1]))},2,n)}function xt(t,e){e||(e={});var n=K(),i=t.length;n.p(t);var r=B(t,e,yt(e),8),s=r.length;return gt(r,e),dt(r,s-8,n.d()),dt(r,s-4,i),r}e.AsyncGzip=kt,e.AsyncCompress=kt,e.gzip=Lt,e.compress=Lt,e.gzipSync=xt,e.compressSync=xt;var Rt=function(){function t(t,e){this.v=1,this.r=0,St.call(this,t,e)}return t.prototype.push=function(t,e){if(St.prototype.e.call(this,t),this.r+=t.length,this.v){var n=this.p.subarray(this.v-1),i=n.length>3?vt(n):4;if(i>n.length){if(!e)return}else this.v>1&&this.onmember&&this.onmember(this.r-n.length);this.p=n.subarray(i),this.v=0}St.prototype.c.call(this,e),!this.s.f||this.s.l||e||(this.v=Z(this.s.p)+9,this.s={i:0},this.o=new r(0),this.push(new r(0),e))},t}();e.Gunzip=Rt;var It=function(){return function(t,e){var n=this;ct([tt,it,function(){return[ut,St,Rt]}],this,Et.call(this,t,e),function(t){var e=new Rt(t.data);e.onmember=function(t){return postMessage(t)},onmessage=ut(e)},9,0,function(t){return n.onmember&&n.onmember(t)})}}();function Ot(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[tt,it,function(){return[Ft]}],function(t){return at(Ft(t.data[0],t.data[1]))},3,n)}function Ft(t,e){var n=vt(t);return n+8>t.length&&x(6,"invalid gzip data"),R(t.subarray(n,-8),{i:2},e&&e.out||new r(mt(t)),e&&e.dictionary)}e.AsyncGunzip=It,e.gunzip=Ot,e.gunzipSync=Ft;var Nt=function(){function t(t,e){this.c=Y(),this.v=1,Ct.call(this,t,e)}return t.prototype.push=function(t,e){this.c.p(t),Ct.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){var n=B(t,this.o,this.v&&(this.o.dictionary?6:2),e&&4,this.s);this.v&&(wt(n,this.o),this.v=0),e&&dt(n,n.length-4,this.c.d()),this.ondata(n,e)},t.prototype.flush=function(){Ct.prototype.flush.call(this)},t}();e.Zlib=Nt;var Pt=function(){return function(t,e){ct([et,rt,function(){return[ut,Ct,Nt]}],this,Et.call(this,t,e),function(t){var e=new Nt(t.data);onmessage=ut(e)},10,1)}}();function Dt(t,e){e||(e={});var n=Y();n.p(t);var i=B(t,e,e.dictionary?6:2,4);return wt(i,e),dt(i,i.length-4,n.d()),i}e.AsyncZlib=Pt,e.zlib=function(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[et,rt,function(){return[Dt]}],function(t){return at(Dt(t.data[0],t.data[1]))},4,n)},e.zlibSync=Dt;var Ht=function(){function t(t,e){St.call(this,t,e),this.v=t&&t.dictionary?2:1}return t.prototype.push=function(t,e){if(St.prototype.e.call(this,t),this.v){if(this.p.length<6&&!e)return;this.p=this.p.subarray(At(this.p,this.v-1)),this.v=0}e&&(this.p.length<4&&x(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),St.prototype.c.call(this,e)},t}();e.Unzlib=Ht;var jt=function(){return function(t,e){ct([tt,st,function(){return[ut,St,Ht]}],this,Et.call(this,t,e),function(t){var e=new Ht(t.data);onmessage=ut(e)},11,0)}}();function qt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),lt(t,e,[tt,st,function(){return[Gt]}],function(t){return at(Gt(t.data[0],ot(t.data[1])))},5,n)}function Gt(t,e){return R(t.subarray(At(t,e&&e.dictionary),-4),{i:2},e&&e.out,e&&e.dictionary)}e.AsyncUnzlib=jt,e.unzlib=qt,e.unzlibSync=Gt;var $t=function(){function t(t,e){this.o=Et.call(this,t,e)||{},this.G=Rt,this.I=St,this.Z=Ht}return t.prototype.i=function(){var t=this;this.s.ondata=function(e,n){t.ondata(e,n)}},t.prototype.push=function(t,e){if(this.ondata||x(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new r(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length)}else this.p=t;this.p.length>2&&(this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(this.o):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,e),this.p=null)}},t}();e.Decompress=$t;var Wt=function(){function t(t,e){$t.call(this,t,e),this.queuedSize=0,this.G=It,this.I=Mt,this.Z=jt}return t.prototype.i=function(){var t=this;this.s.ondata=function(e,n,i){t.ondata(e,n,i)},this.s.ondrain=function(e){t.queuedSize-=e,t.ondrain&&t.ondrain(e)}},t.prototype.push=function(t,e){this.queuedSize+=t.length,$t.prototype.push.call(this,t,e)},t}();e.AsyncDecompress=Wt,e.decompress=function(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&x(7),31==t[0]&&139==t[1]&&8==t[2]?Ot(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Ut(t,e,n):qt(t,e,n)},e.decompressSync=function(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?Ft(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Tt(t,e):Gt(t,e)};var Kt=function(t,e,n,i){for(var s in t){var a=t[s],o=e+s,l=i;Array.isArray(a)&&(l=V(i,a[1]),a=a[0]),a instanceof r?n[o]=[a,l]:(n[o+="/"]=[new r(0),l],Kt(a,o,n,i))}},Yt="undefined"!=typeof TextEncoder&&new TextEncoder,Bt="undefined"!=typeof TextDecoder&&new TextDecoder,Vt=0;try{Bt.decode(G,{stream:!0}),Vt=1}catch(t){}var Xt=function(t){for(var e="",n=0;;){var i=t[n++],r=(i>127)+(i>223)+(i>239);if(n+r>t.length)return{s:e,r:k(t,n-1)};r?3==r?(i=((15&i)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,e+=String.fromCharCode(55296|i>>10,56320|1023&i)):e+=1&r?String.fromCharCode((31&i)<<6|63&t[n++]):String.fromCharCode((15&i)<<12|(63&t[n++])<<6|63&t[n++]):e+=String.fromCharCode(i)}},Jt=function(){function t(t){this.ondata=t,Vt?this.t=new TextDecoder:this.p=G}return t.prototype.push=function(t,e){if(this.ondata||x(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&x(8),this.t=null));this.p||x(4);var n=new r(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var i=Xt(n),s=i.s,a=i.r;e?(a.length&&x(8),this.p=null):this.p=a,this.ondata(s,e)},t}();e.DecodeUTF8=Jt;var Qt=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){this.ondata||x(5),this.d&&x(4),this.ondata(te(t),this.d=e||!1)},t}();function te(t,e){if(e){for(var n=new r(t.length),i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}if(Yt)return Yt.encode(t);var s=t.length,a=new r(t.length+(t.length>>1)),o=0,l=function(t){a[o++]=t};for(i=0;i<s;++i){if(o+5>a.length){var u=new r(o+8+(s-i<<1));u.set(a),a=u}var c=t.charCodeAt(i);c<128||e?l(c):c<2048?(l(192|c>>6),l(128|63&c)):c>55295&&c<57344?(l(240|(c=65536+(1047552&c)|1023&t.charCodeAt(++i))>>18),l(128|c>>12&63),l(128|c>>6&63),l(128|63&c)):(l(224|c>>12),l(128|c>>6&63),l(128|63&c))}return k(a,0,o)}function ee(t,e){if(e){for(var n="",i=0;i<t.length;i+=16384)n+=String.fromCharCode.apply(null,t.subarray(i,i+16384));return n}if(Bt)return Bt.decode(t);var r=Xt(t),s=r.s;return(n=r.r).length&&x(8),s}e.EncodeUTF8=Qt,e.strToU8=te,e.strFromU8=ee;var ne=function(t){return 1==t?3:t<6?2:9==t?1:0},ie=function(t,e){return e+30+ft(t,e+26)+ft(t,e+28)},re=function(t,e,n){var i=ft(t,e+28),r=ee(t.subarray(e+46,e+46+i),!(2048&ft(t,e+8))),s=e+46+i,a=ht(t,e+20),o=n&&4294967295==a?se(t,s):[a,ht(t,e+24),ht(t,e+42)],l=o[0],u=o[1],c=o[2];return[ft(t,e+10),l,u,r,s+ft(t,e+30)+ft(t,e+32),c]},se=function(t,e){for(;1!=ft(t,e);e+=4+ft(t,e+2));return[pt(t,e+12),pt(t,e+4),pt(t,e+20)]},ae=function(t){var e=0;if(t)for(var n in t){var i=t[n].length;i>65535&&x(9),e+=i+4}return e},oe=function(t,e,n,i,r,s,a,o){var l=i.length,u=n.extra,c=o&&o.length,f=ae(u);dt(t,e,null!=a?33639248:67324752),e+=4,null!=a&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(s<0&&8),t[e++]=r&&8,t[e++]=255&n.compression,t[e++]=n.compression>>8;var h=new Date(null==n.mtime?Date.now():n.mtime),p=h.getFullYear()-1980;if((p<0||p>119)&&x(10),dt(t,e,p<<25|h.getMonth()+1<<21|h.getDate()<<16|h.getHours()<<11|h.getMinutes()<<5|h.getSeconds()>>1),e+=4,-1!=s&&(dt(t,e,n.crc),dt(t,e+4,s<0?-s-2:s),dt(t,e+8,n.size)),dt(t,e+12,l),dt(t,e+14,f),e+=16,null!=a&&(dt(t,e,c),dt(t,e+6,n.attrs),dt(t,e+10,a),e+=14),t.set(i,e),e+=l,f)for(var d in u){var g=u[d],v=g.length;dt(t,e,+d),dt(t,e+2,v),t.set(g,e+4),e+=4+v}return c&&(t.set(o,e),e+=c),e},le=function(t,e,n,i,r){dt(t,e,101010256),dt(t,e+8,n),dt(t,e+10,n),dt(t,e+12,i),dt(t,e+16,r)},ue=function(){function t(t){this.filename=t,this.c=K(),this.size=0,this.compression=0}return t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){this.ondata||x(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}();e.ZipPassThrough=ue;var ce=function(){function t(t,e){var n=this;e||(e={}),ue.call(this,t),this.d=new Ct(e,function(t,e){n.ondata(null,t,e)}),this.compression=8,this.flag=ne(e.level)}return t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(t){this.ondata(t,null,e)}},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}();e.ZipDeflate=ce;var fe=function(){function t(t,e){var n=this;e||(e={}),ue.call(this,t),this.d=new bt(e,function(t,e,i){n.ondata(t,e,i)}),this.compression=8,this.flag=ne(e.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}();e.AsyncZipDeflate=fe;var he=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(this.ondata||x(5),2&this.d)this.ondata(x(4+8*(1&this.d),0,1),null,!1);else{var n=te(t.filename),i=n.length,s=t.comment,a=s&&te(s),o=i!=t.filename.length||a&&s.length!=a.length,l=i+ae(t.extra)+30;i>65535&&this.ondata(x(11,0,1),null,!1);var u=new r(l);oe(u,0,t,n,o,-1);var c=[u],f=function(){for(var t=0,n=c;t<n.length;t++){var i=n[t];e.ondata(null,i,!1)}c=[]},h=this.d;this.d=0;var p=this.u.length,d=V(t,{f:n,u:o,o:a,t:function(){t.terminate&&t.terminate()},r:function(){if(f(),h){var t=e.u[p+1];t?t.r():e.d=1}h=1}}),g=0;t.ondata=function(n,i,s){if(n)e.ondata(n,i,s),e.terminate();else if(g+=i.length,c.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),c.push(a),d.c=g,d.b=l+g+16,d.crc=t.crc,d.size=t.size,h&&d.r(),h=1}else h&&f()},this.u.push(d)}},t.prototype.end=function(){var t=this;2&this.d?this.ondata(x(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&t.d&&(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3)},t.prototype.e=function(){for(var t=0,e=0,n=0,i=0,s=this.u;i<s.length;i++)n+=46+(u=s[i]).f.length+ae(u.extra)+(u.o?u.o.length:0);for(var a=new r(n+22),o=0,l=this.u;o<l.length;o++){var u=l[o];oe(a,t,u,u.f,u.u,-u.c-2,e,u.o),t+=46+u.f.length+ae(u.extra)+(u.o?u.o.length:0),e+=u.b}le(a,t,this.u.length,n,e),this.ondata(null,a,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++)e[t].t();this.d=2},t}();e.Zip=he,e.zip=function(t,e,n){n||(n=e,e={}),"function"!=typeof n&&x(7);var i={};Kt(t,"",i,e);var s=Object.keys(i),a=s.length,o=0,l=0,u=a,c=new Array(a),f=[],h=function(){for(var t=0;t<f.length;++t)f[t]()},p=function(t,e){me(function(){n(t,e)})};me(function(){p=n});var d=function(){var t=new r(l+22),e=o,n=l-o;l=0;for(var i=0;i<u;++i){var s=c[i];try{var a=s.c.length;oe(t,l,s,s.f,s.u,a);var f=30+s.f.length+ae(s.extra),h=l+f;t.set(s.c,h),oe(t,o,s,s.f,s.u,a,l,s.m),o+=16+f+(s.m?s.m.length:0),l=h+a}catch(t){return p(t,null)}}le(t,o,c.length,n,e),p(null,t)};a||d();for(var g=function(t){var e=s[t],n=i[e],r=n[0],u=n[1],g=K(),v=r.length;g.p(r);var m=te(e),y=m.length,w=u.comment,A=w&&te(w),E=A&&A.length,C=ae(u.extra),b=0==u.level?0:8,z=function(n,i){if(n)h(),p(n,null);else{var r=i.length;c[t]=V(u,{size:v,crc:g.d(),c:i,f:m,m:A,u:y!=e.length||A&&w.length!=E,compression:b}),o+=30+y+C+r,l+=76+2*(y+C)+(E||0)+r,--a||d()}};if(y>65535&&z(x(11,0,1),null),b)if(v<16e4)try{z(null,_t(r,u))}catch(t){z(t,null)}else f.push(zt(r,u,z));else z(null,r)},v=0;v<u;++v)g(v);return h},e.zipSync=function(t,e){e||(e={});var n={},i=[];Kt(t,"",n,e);var s=0,a=0;for(var o in n){var l=n[o],u=l[0],c=l[1],f=0==c.level?0:8,h=(z=te(o)).length,p=c.comment,d=p&&te(p),g=d&&d.length,v=ae(c.extra);h>65535&&x(11);var m=f?_t(u,c):u,y=m.length,w=K();w.p(u),i.push(V(c,{size:u.length,crc:w.d(),c:m,f:z,m:d,u:h!=o.length||d&&p.length!=g,o:s,compression:f})),s+=30+h+v+y,a+=76+2*(h+v)+(g||0)+y}for(var A=new r(a+22),E=s,C=a-s,b=0;b<i.length;++b){var z=i[b];oe(A,z.o,z,z.f,z.u,z.c.length);var _=30+z.f.length+ae(z.extra);A.set(z.c,z.o+_),oe(A,s,z,z.f,z.u,z.c.length,z.o,z.m),s+=16+_+(z.m?z.m.length:0)}return le(A,s,i.length,C,E),A};var pe=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}();e.UnzipPassThrough=pe;var de=function(){function t(){var t=this;this.i=new St(function(e,n){t.ondata(null,e,n)})}return t.prototype.push=function(t,e){try{this.i.push(t,e)}catch(t){this.ondata(t,null,e)}},t.compression=8,t}();e.UnzipInflate=de;var ge=function(){function t(t,e){var n=this;e<32e4?this.i=new St(function(t,e){n.ondata(null,t,e)}):(this.i=new Mt(function(t,e,i){n.ondata(t,e,i)}),this.terminate=this.i.terminate)}return t.prototype.push=function(t,e){this.i.terminate&&(t=k(t,0)),this.i.push(t,e)},t.compression=8,t}();e.AsyncUnzipInflate=ge;var ve=function(){function t(t){this.onfile=t,this.k=[],this.o={0:pe},this.p=G}return t.prototype.push=function(t,e){var n=this;if(this.onfile||x(5),this.p||x(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,e)}else{var a=0,o=0,l=void 0,u=void 0;this.p.length?t.length?((u=new r(this.p.length+t.length)).set(this.p),u.set(t,this.p.length)):u=this.p:u=t;for(var c=u.length,f=this.c,h=f&&this.d,p=function(){var t,e=ht(u,o);if(67324752==e){a=1,l=o,d.d=null,d.c=0;var i=ft(u,o+6),r=ft(u,o+8),s=2048&i,h=8&i,p=ft(u,o+26),g=ft(u,o+28);if(c>o+30+p+g){var v=[];d.k.unshift(v),a=2;var m,y=ht(u,o+18),w=ht(u,o+22),A=ee(u.subarray(o+30,o+=30+p),!s);4294967295==y?(t=h?[-2]:se(u,o),y=t[0],w=t[1]):h&&(y=-1),o+=g,d.c=y;var E={name:A,compression:r,start:function(){if(E.ondata||x(5),y){var t=n.o[r];t||E.ondata(x(14,"unknown compression type "+r,1),null,!1),(m=y<0?new t(A):new t(A,y,w)).ondata=function(t,e,n){E.ondata(t,e,n)};for(var e=0,i=v;e<i.length;e++){var s=i[e];m.push(s,!1)}n.k[0]==v&&n.c?n.d=m:m.push(G,!0)}else E.ondata(null,G,!0)},terminate:function(){m&&m.terminate&&m.terminate()}};y>=0&&(E.size=y,E.originalSize=w),d.onfile(E)}return"break"}if(f){if(134695760==e)return l=o+=12+(-2==f&&8),a=3,d.c=0,"break";if(33639248==e)return l=o-=4,a=3,d.c=0,"break"}},d=this;o<c-4&&"break"!==p();++o);if(this.p=G,f<0){var g=a?u.subarray(0,l-12-(-2==f&&8)-(134695760==ht(u,l-16)&&4)):u.subarray(0,o);h?h.push(g,!!a):this.k[+(2==a)].push(g)}if(2&a)return this.push(u.subarray(o),e);this.p=u.subarray(o)}e&&(this.c&&x(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}();e.Unzip=ve;var me="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()};e.unzip=function(t,e,n){n||(n=e,e={}),"function"!=typeof n&&x(7);var i=[],s=function(){for(var t=0;t<i.length;++t)i[t]()},a={},o=function(t,e){me(function(){n(t,e)})};me(function(){o=n});for(var l=t.length-22;101010256!=ht(t,l);--l)if(!l||t.length-l>65558)return o(x(13,0,1),null),s;var u=ft(t,l+8);if(u){var c=u,f=ht(t,l+16),h=4294967295==f||65535==c;if(h){var p=ht(t,l-12);(h=101075792==ht(t,p))&&(c=u=ht(t,p+32),f=ht(t,p+48))}for(var d=e&&e.filter,g=function(e){var n=re(t,f,h),l=n[0],c=n[1],p=n[2],g=n[3],v=n[4],m=n[5],y=ie(t,m);f=v;var w=function(t,e){t?(s(),o(t,null)):(e&&(a[g]=e),--u||o(null,a))};if(!d||d({name:g,size:c,originalSize:p,compression:l}))if(l)if(8==l){var A=t.subarray(y,y+c);if(p<524288||c>.8*p)try{w(null,Tt(A,{out:new r(p)}))}catch(t){w(t,null)}else i.push(Ut(A,{size:p},w))}else w(x(14,"unknown compression type "+l,1),null);else w(null,k(t,y,y+c));else w(null,null)},v=0;v<c;++v)g()}else o(null,{});return s},e.unzipSync=function(t,e){for(var n={},i=t.length-22;101010256!=ht(t,i);--i)(!i||t.length-i>65558)&&x(13);var s=ft(t,i+8);if(!s)return{};var a=ht(t,i+16),o=4294967295==a||65535==s;if(o){var l=ht(t,i-12);(o=101075792==ht(t,l))&&(s=ht(t,l+32),a=ht(t,l+48))}for(var u=e&&e.filter,c=0;c<s;++c){var f=re(t,a,o),h=f[0],p=f[1],d=f[2],g=f[3],v=f[4],m=f[5],y=ie(t,m);a=v,u&&!u({name:g,size:p,originalSize:d,compression:h})||(h?8==h?n[g]=Tt(t.subarray(y,y+p),{out:new r(d)}):x(14,"unknown compression type "+h):n[g]=k(t,y,y+p))}return n}}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,n),s.exports}(()=>{const t=n(546),e=n(886),i=n(49);self.addEventListener("install",()=>{self.skipWaiting()}),self.addEventListener("activate",t=>{t.waitUntil(self.clients.claim())}),(0,t.installClientErrorReporting)(),(0,i.installMessageHandler)(),(0,e.installFetchHandler)()})()})();
1
+ (()=>{"use strict";var t={257(t,e){function n(t){const n=t.trim();return n.startsWith(e.ZIP_PEEK_ERROR_PREFIX)?n:`${e.ZIP_PEEK_ERROR_PREFIX} ${n}`}Object.defineProperty(e,"__esModule",{value:!0}),e.ZIP_PEEK_ERROR_PREFIX=void 0,e.formatZipPeekError=n,e.createZipPeekError=function(t){return new Error(n(t))},e.toZipPeekError=function(t){const r=t instanceof Error?t:new Error(String(t));return r.message.startsWith(e.ZIP_PEEK_ERROR_PREFIX)||(r.message=n(r.message)),r},e.errorMessage=function(t){return t instanceof Error?t.message:String(t)},e.ZIP_PEEK_ERROR_PREFIX="[zip-peek-error]"},978(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.persistAllowedZipUrlsConfig=o,e.ensureAllowedZipUrlsLoaded=async function(){if(i.allowedZipUrlsLoaded)return i.allowedZipUrlsLoaded;const t=(async()=>{try{const t=await caches.open(i.CONFIG_CACHE_NAME),e=await t.match(i.CONFIG_CACHE_KEY);if(!e)return;const n=await e.json();Array.isArray(n.allowedZipUrls)?(0,i.setAllowedZipUrls)(new Set(n.allowedZipUrls.filter(t=>"string"==typeof t).map(t=>(0,r.normalizeZipUrl)(t)))):(0,i.setAllowedZipUrls)(null)}catch(t){(0,s.warn)("failed to load runtime config",t)}})();return(0,i.setAllowedZipUrlsLoaded)(t),t},e.applyRuntimeConfig=async function(t){if(!t)return;let e={...i.runtimeConfig},n=!1;if("string"==typeof t.zipAssetCacheName&&t.zipAssetCacheName.trim()&&(e.zipAssetCacheName=t.zipAssetCacheName,n=!0),"number"==typeof t.assetCacheTtlMs&&Number.isFinite(t.assetCacheTtlMs)&&(e.assetCacheTtlMs=t.assetCacheTtlMs,n=!0),"string"==typeof t.logPrefix&&t.logPrefix.trim()&&(e.logPrefix=t.logPrefix,n=!0),n&&(0,i.setRuntimeConfig)(e),"allowedZipUrls"in t){const e=Array.isArray(t.allowedZipUrls)?t.allowedZipUrls.map(t=>(0,r.normalizeZipUrl)(t)):null;(0,i.setAllowedZipUrls)(e?new Set(e):null),(0,i.setAllowedZipUrlsLoaded)(Promise.resolve()),await o(e)}},e.isZipUrlAllowed=function(t){return null===i.allowedZipUrls||i.allowedZipUrls.has(t)};const r=n(183),i=n(950),s=n(842);async function o(t){try{const e=await caches.open(i.CONFIG_CACHE_NAME);await e.put(new Request(i.CONFIG_CACHE_KEY),new Response(JSON.stringify({allowedZipUrls:t}),{headers:{"Content-Type":"application/json"}}))}catch(t){(0,s.warn)("failed to persist runtime config",t)}}},752(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.canonicalAssetRequest=function(t,e){return new Request((0,i.canonicalZipAssetRequestUrl)(t,e),{method:"GET"})},e.assetCacheEntryExpired=l,e.clearAllZipAssets=async function(){const t=await caches.open(s.runtimeConfig.zipAssetCacheName),e=await t.keys();await Promise.all(e.map(e=>t.delete(e))),await caches.delete(s.CONFIG_CACHE_NAME),s.zipManifests.clear(),s.pendingManifestLoads.clear(),(0,s.setAllowedZipUrlsLoaded)(Promise.resolve())},e.clearZipAssetsExceptAllowed=async function(t){try{const e=new Set(t),n=await caches.open(s.runtimeConfig.zipAssetCacheName),r=await n.keys();for(const t of r){const r=t.url;if(r.includes(s.MANIFEST_CACHE_KEY)){const i=(0,a.zipUrlFromManifestCacheKey)(r);i&&!e.has(i)&&await n.delete(t);continue}const o=(0,i.parseZipAssetRequest)(r);o&&!e.has(o.zipUrl)&&await n.delete(t)}for(const t of s.zipManifests.keys())e.has(t)||s.zipManifests.delete(t)}catch(t){throw(0,r.createZipPeekError)(`Failed to clear zip assets except allowed URLs: ${(0,r.errorMessage)(t)}`)}},e.putCachedFullAssetIfAbsent=async function(t,e){try{const n=await caches.open(s.runtimeConfig.zipAssetCacheName),r=await n.match(t);if(r&&!l(r))return;const i=e.type||"application/octet-stream";await n.put(t,new Response(e,{status:200,headers:{"Content-Type":i,"Content-Length":String(e.size),"Access-Control-Allow-Origin":"*",[s.ASSET_CACHED_AT_HEADER]:String(Date.now())}}))}catch(t){(0,o.warn)("asset cache put failed",t)}},e.readCachedZipAssetIfFresh=async function(t){let e=null,n="network";try{const r=await caches.open(s.runtimeConfig.zipAssetCacheName),i=await r.match(t);if(i)if(l(i))try{await r.delete(t)}catch(t){(0,o.warn)("asset cache delete expired failed",t)}else e=await i.blob(),n="cache-api"}catch(t){(0,o.warn)("asset cache read failed",t)}return{blob:e,assetSource:n}};const r=n(257),i=n(183),s=n(950),o=n(842),a=n(234);function l(t){const e=t.headers.get(s.ASSET_CACHED_AT_HEADER);if(!e)return!0;const n=parseInt(e,10);return!Number.isFinite(n)||Date.now()-n>s.runtimeConfig.assetCacheTtlMs}},886(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.installFetchHandler=function(){self.addEventListener("fetch",t=>{if("GET"!==t.request.method)return;const e=(0,i.parseZipAssetRequest)(t.request.url);if(!e)return;const n=(0,i.normalizeZipUrl)(e.zipUrl),f=e.internalPath,h=(0,i.normalizeZipEntryPath)(f);t.respondWith((async()=>{try{if(await(0,s.ensureAllowedZipUrlsLoaded)(),!(0,s.isZipUrlAllowed)(n))return(0,l.warn)("zip URL not allowed",{requestedZipUrl:n}),(0,c.corsErrorResponse)(`ZIP URL not allowed (not in allowedZipUrls): ${n}`,403);let e=a.zipManifests.get(n);if(e||(e=await(0,u.ensureManifestAvailable)(n,t.clientId||void 0)??void 0),!e){const t=Array.from(a.zipManifests.keys());return(0,l.warn)("manifest missing for zipUrl",{requestedZipUrl:n,knownZipUrls:t}),(0,c.corsErrorResponse)(`ZIP manifest not loaded for ${n}. Ensure the ZIP is reachable and supports byte-range requests.`,404)}const r=(0,u.resolveManifestEntry)(e,h);if(!r){const t=Array.from(e.keys()).slice(0,50);return(0,l.warn)("file not in manifest or ambiguous suffix match",{zipUrl:n,internalPathRaw:f,internalPathNormalized:h,manifestSize:e.size,sampleKeys:t}),(0,c.corsErrorResponse)(`File "${f}" not found in ZIP manifest for ${n}`,404)}const{key:i,info:p}=r;i!==h&&(0,l.log)("resolved via suffix match",{requested:h,manifestKey:i});const d=(0,o.canonicalAssetRequest)(n,i);let{blob:g,assetSource:v}=await(0,o.readCachedZipAssetIfFresh)(d);if(!g){const t=await(0,c.fetchUncompressedZipEntryFromNetwork)(n,i,p,d);if(!t.ok)return t.response;g=t.blob,v="network"}if(t.request.headers.has("range")){const e=t.request.headers.get("range").replace(/^bytes=/,"");if(e.includes(","))return new Response(null,{status:416,headers:{"Content-Range":`bytes */${g.size}`,"Access-Control-Allow-Origin":"*"}});const[n,r]=e.split("-"),i=""!==n?parseInt(n,10):NaN,s=""!==r?parseInt(r,10):g.size-1;if(isNaN(i)||isNaN(s)||i<0||s<i||i>=g.size)return new Response(null,{status:416,headers:{"Content-Range":`bytes */${g.size}`,"Access-Control-Allow-Origin":"*"}});const o=Math.min(s,g.size-1),l=g.slice(i,o+1);return new Response(l,{status:206,headers:{"Content-Type":g.type,"Content-Range":`bytes ${i}-${o}/${g.size}`,"Content-Length":l.size.toString(),"Accept-Ranges":"bytes","Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":a.ASSET_SOURCE_HEADER,[a.ASSET_SOURCE_HEADER]:v}})}return new Response(g,{status:200,headers:{"Content-Type":g.type,"Content-Length":g.size.toString(),"Access-Control-Allow-Origin":"*","Access-Control-Expose-Headers":a.ASSET_SOURCE_HEADER,[a.ASSET_SOURCE_HEADER]:v}})}catch(t){return(0,l.error)("fetch handler failed",{zipUrl:n,internalPath:f,message:(0,r.errorMessage)(t)}),(0,c.corsErrorResponse)(`Failed to serve "${f}" from ${n}: ${(0,r.errorMessage)(t)}`,500)}})())})};const r=n(257),i=n(183),s=n(978),o=n(752),a=n(950),l=n(842),u=n(234),c=n(878)},950(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.CONFIG_CACHE_KEY=e.allowedZipUrlsLoaded=e.allowedZipUrls=e.runtimeConfig=e.pendingManifestLoads=e.zipManifests=e.MANIFEST_CACHE_KEY=e.LOCAL_FILE_HEADER_SIG=e.MIME_TYPES=e.ASSET_SOURCE_HEADER=e.ASSET_CACHED_AT_HEADER=e.ALLOWED_CACHE_NAMES=e.CONFIG_CACHE_NAME=e.DEFAULT_ASSET_CACHE_TTL_MS=e.DEFAULT_ZIP_ASSET_CACHE_NAME=void 0,e.setRuntimeConfig=function(t){e.runtimeConfig=t},e.setAllowedZipUrls=function(t){e.allowedZipUrls=t},e.setAllowedZipUrlsLoaded=function(t){e.allowedZipUrlsLoaded=t},e.DEFAULT_ZIP_ASSET_CACHE_NAME="zip-cache-v1",e.DEFAULT_ASSET_CACHE_TTL_MS=72e5,e.CONFIG_CACHE_NAME="zip-peek-config-v1",e.ALLOWED_CACHE_NAMES=[e.DEFAULT_ZIP_ASSET_CACHE_NAME,e.CONFIG_CACHE_NAME],e.ASSET_CACHED_AT_HEADER="X-ZipSW-Cached-At",e.ASSET_SOURCE_HEADER="X-ZipSW-Asset-Source",e.MIME_TYPES={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",json:"application/json",js:"application/javascript",css:"text/css; charset=utf-8",html:"text/html; charset=utf-8",txt:"text/plain; charset=utf-8",mp4:"video/mp4",webm:"video/webm",mp3:"audio/mpeg",wav:"audio/wav",oga:"audio/ogg",ogg:"audio/ogg",xml:"application/xml",wasm:"application/wasm"},e.LOCAL_FILE_HEADER_SIG=67324752,e.MANIFEST_CACHE_KEY="__zipsw_manifest__=1",e.zipManifests=new Map,e.pendingManifestLoads=new Map,e.runtimeConfig={zipAssetCacheName:e.DEFAULT_ZIP_ASSET_CACHE_NAME,assetCacheTtlMs:e.DEFAULT_ASSET_CACHE_TTL_MS,logPrefix:"[zipSW]"},e.allowedZipUrls=null,e.allowedZipUrlsLoaded=null,e.CONFIG_CACHE_KEY=new URL("__zip_peek_runtime_config__",self.registration.scope).href},842(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.log=function(...t){console.log(i.runtimeConfig.logPrefix,...t)},e.warn=function(...t){console.warn(i.runtimeConfig.logPrefix,...t)},e.error=function(...t){console.error(i.runtimeConfig.logPrefix,r.ZIP_PEEK_ERROR_PREFIX,...t)},e.reportClientError=s,e.installClientErrorReporting=function(){self.addEventListener("error",t=>{s(t.error??t.message,"Service worker uncaught error")}),self.addEventListener("unhandledrejection",t=>{s(t.reason,"Service worker unhandled promise rejection")})};const r=n(257),i=n(950);function s(t,e){const n=(0,r.toZipPeekError)(t);self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(t=>{const i={type:"ZIP_SW_ERROR",error:{message:n.message,stack:n.stack},info:e?(0,r.formatZipPeekError)(e):void 0};for(const e of t)e.postMessage(i)})}},234(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.manifestCacheKey=function(t){return t+(t.includes("?")?"&":"?")+i.MANIFEST_CACHE_KEY},e.parseCentralDirectoryToManifest=o,e.manifestFilesToMap=a,e.sendManifestToClientId=u,e.loadManifestFromClientId=c,e.fetchZipManifest=f,e.ensureManifestAvailable=function(t,e){const n=i.zipManifests.get(t);if(n)return Promise.resolve(n);let r=i.pendingManifestLoads.get(t);return r||(r=(async()=>{const n=await c(t,e);if(n)return i.zipManifests.set(t,n),(0,s.log)("restored manifest from client memory",{zipUrl:t,entryCount:n.size}),n;const r=await f(t);return r&&(i.zipManifests.set(t,r),await u(t,r,e),(0,s.log)("manifest fetched and stored in memory",{zipUrl:t,entryCount:r.size})),r})().finally(()=>{i.pendingManifestLoads.delete(t)}),i.pendingManifestLoads.set(t,r),r)},e.resolveManifestEntry=function(t,e){if(t.has(e))return{key:e,info:t.get(e)};const n=[];for(const r of t.keys())r.endsWith("/"+e)&&n.push(r);if(1===n.length){const e=n[0];return{key:e,info:t.get(e)}}return n.length>1?((0,s.error)("ambiguous suffix match for ZIP entry",{requested:e,candidates:n.slice(0,8)}),null):null},e.zipUrlFromManifestCacheKey=function(t){const e=i.MANIFEST_CACHE_KEY;if(!t.endsWith(e))return null;let n=t.slice(0,-e.length);return(n.endsWith("?")||n.endsWith("&"))&&(n=n.slice(0,-1)),n};const r=n(183),i=n(950),s=n(842);function o(t,e,n,i){const o=new DataView(t);let a=e;const l=[];for(;a+46<=t.byteLength&&33639248===o.getUint32(a,!0);){const e=o.getUint16(a+10,!0),n=o.getUint32(a+20,!0),i=o.getUint16(a+28,!0),s=o.getUint16(a+30,!0),u=o.getUint16(a+32,!0),c=o.getUint32(a+42,!0),f=new TextDecoder;if(a+46+i>t.byteLength)break;const h=new Uint8Array(t,a+46,i),p=f.decode(h),d=(0,r.normalizeZipEntryPath)(p);""!==d&&l.push({filename:d,offset:c,compressedSize:n,compression:e}),a+=46+i+s+u}if(0===l.length)return(0,s.error)("no files parsed from central directory",i),null;l.sort((t,e)=>t.offset-e.offset);const u=new Map;for(let t=0;t<l.length;t++){const e=l[t],i=(0,r.normalizeZipEntryPath)(e.filename);""!==i&&(u.has(i)&&(0,s.warn)("duplicate manifest key after normalize; overwriting",i),u.set(i,{filename:e.filename,offset:e.offset,compressedSize:e.compressedSize,compression:e.compression,nextOffset:t<l.length-1?l[t+1].offset:n}))}return u.size>0?u:null}function a(t){const e=new Map;for(const n of t){const t=(0,r.normalizeZipEntryPath)(n.filename);""!==t&&(e.has(t)&&(0,s.warn)("duplicate manifest key after normalize; overwriting",t),e.set(t,n))}return e.size>0?e:null}async function l(t){if(!t)return null;const e=await self.clients.get(t);return"window"===e?.type?e:null}async function u(t,e,n){const r=await l(n);if(!r)return;const i=Array.from(e.values());try{r.postMessage({type:"ZIP_SW_MANIFEST_CREATED",zipUrl:t,files:i})}catch(t){(0,s.warn)("failed to send manifest to client",t)}}async function c(t,e){const n=await l(e);return n?function(t,e){return new Promise(n=>{const r=new MessageChannel,i=setTimeout(()=>{r.port1.close(),n(null)},500);r.port1.onmessage=t=>{clearTimeout(i),r.port1.close();const e=t.data;e?.ok&&Array.isArray(e.files)?n(a(e.files)):n(null)},r.port1.onmessageerror=()=>{clearTimeout(i),r.port1.close(),n(null)};try{t.postMessage({type:"ZIP_SW_MANIFEST_REQUEST",zipUrl:e},[r.port2])}catch(t){clearTimeout(i),r.port1.close(),(0,s.warn)("failed to request manifest from client",t),n(null)}})}(n,t):null}async function f(t){const e=await fetch(t,{headers:{Range:"bytes=-65536"}});if(206!==e.status)return(0,s.error)("range requests not supported for ZIP manifest",{zipUrl:t,status:e.status}),null;const n=await e.arrayBuffer(),r=new DataView(n);let i=-1;for(let t=n.byteLength-22;t>=0;t--)if(101010256===r.getUint32(t,!0)){i=t;break}if(-1===i)return(0,s.error)("EOCD not found in last 64KB of ZIP file",t),null;const a=r.getUint32(i+16,!0),l=r.getUint32(i+12,!0);let u=n,c=-1;const f=e.headers.get("Content-Range");let h=0;if(f){const t=f.match(/\/(\d+)$/);t&&(h=parseInt(t[1],10))}if(h<=0)return(0,s.error)("could not determine ZIP file size from Content-Range header",{zipUrl:t,contentRange:f}),null;const p=h-n.byteLength;if(a>=p)c=a-p;else{const e=await fetch(t,{headers:{Range:`bytes=${a}-${a+l-1}`}});if(206!==e.status)return(0,s.error)("failed to fetch ZIP central directory",{zipUrl:t,status:e.status,cdOffset:a,cdSize:l}),null;u=await e.arrayBuffer(),c=0}return o(u,c,a,t)}},49(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.replyToMessage=f,e.installMessageHandler=function(){self.addEventListener("message",t=>{if(!t.data)return;const{type:e,zipUrl:n,files:h,config:p,allowedZipUrls:d}=t.data,g=function(t){if(!t||!("id"in t))return;const e=t.id;return"string"==typeof e?e:void 0}(t.source);if("ZIP_SW_CONFIG"===e){const e=(0,s.applyRuntimeConfig)(p).then(()=>f(t,{ok:!0})).catch(e=>f(t,c(e)));return void t.waitUntil(e)}if("ZIP_MANIFEST"===e){if(n&&h){const e=(0,i.normalizeZipUrl)(n),r=(0,u.manifestFilesToMap)(h),s=a.zipManifests.get(e);if(!r)return void(0,l.warn)("rejecting empty manifest; keeping existing",{zipUrl:e,existingSize:s?s.size:0});if(s&&s.size>r.size)return void(0,l.warn)("rejecting smaller manifest; keeping existing",{zipUrl:e,incomingSize:r.size,existingSize:s.size});a.zipManifests.set(e,r),t.waitUntil((0,u.sendManifestToClientId)(e,r,g));const o=Array.from(r.keys()).slice(0,40);(0,l.log)("ZIP_MANIFEST loaded",{zipUrl:e,entryCount:r.size,sampleKeys:o,replacedExistingSize:s?s.size:0})}}else if("CLEAR_ZIP_ASSETS_EXCEPT_ALLOWED"===e&&d){const e=(0,o.clearZipAssetsExceptAllowed)(d).then(()=>f(t,{ok:!0})).catch(e=>f(t,c(e)));t.waitUntil(e)}else if("CLEAR_ALL_ZIP_ASSETS"===e){const e=(0,o.clearAllZipAssets)().then(()=>f(t,{ok:!0})).catch(e=>f(t,c(e)));t.waitUntil(e)}else if("PRELOAD_ZIP_MANIFESTS"===e&&d){const e=async function(t,e){const n=await Promise.all(t.map(async t=>({zipUrl:t,manifest:await(0,u.ensureManifestAvailable)(t,e)}))),i=n.filter(t=>!t.manifest).map(t=>t.zipUrl);if(i.length>0)throw(0,r.createZipPeekError)(`Failed to preload ZIP manifest(s): ${i.join(", ")}`)}(d,g).then(()=>f(t,{ok:!0})).catch(e=>f(t,c(e)));t.waitUntil(e)}})};const r=n(257),i=n(183),s=n(978),o=n(752),a=n(950),l=n(842),u=n(234);function c(t){const e=(0,r.toZipPeekError)(t);return{ok:!1,error:e.message,errorStack:e.stack}}function f(t,e){t.ports[0]?.postMessage(e)}},878(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.corsErrorResponse=l,e.getMimeType=u,e.fetchUncompressedZipEntryFromNetwork=async function(t,e,n,i){const c=n.offset,f=n.nextOffset-1;(0,o.log)("fetching zip chunk from",{zipUrl:t,rangeStart:c,rangeEnd:f});const h=await fetch(t,{headers:{Range:`bytes=${c}-${f}`}});if(206!==h.status)return{ok:!1,response:l(`ZIP entry fetch for "${e}" expected HTTP 206 Partial Content from ${t}, got ${h.status}`,h.status>=400?h.status:502)};const p=await h.arrayBuffer(),d=new DataView(p);if(d.getUint32(0,!0)!==s.LOCAL_FILE_HEADER_SIG)return{ok:!1,response:l(`Invalid local file header for "${e}" in ${t} (expected ZIP signature 0x04034b50)`,500)};const g=30+d.getUint16(26,!0)+d.getUint16(28,!0);if(g>p.byteLength||g+n.compressedSize>p.byteLength)return{ok:!1,response:l(`Corrupt ZIP entry "${e}" in ${t}: dataStart=${g}, compressedSize=${n.compressedSize}, bufferLength=${p.byteLength}`,500)};const v=new Uint8Array(p,g,n.compressedSize);let m;if(8===n.compression)try{m=(0,r.inflateSync)(v)}catch(n){return(0,o.warn)("inflateSync failed",{zipUrl:t,manifestKey:e,error:n}),{ok:!1,response:l(`Failed to inflate DEFLATE-compressed entry "${e}" in ${t}`,500)}}else{if(0!==n.compression)return{ok:!1,response:l(`Unsupported compression method ${n.compression} for "${e}" in ${t} (only stored/0 and DEFLATE/8 are supported)`,500)};m=v}const y=u(e),w=new Blob([m],{type:y});return await(0,a.putCachedFullAssetIfAbsent)(i,w),{ok:!0,blob:w}};const r=n(845),i=n(257),s=n(950),o=n(842),a=n(752);function l(t,e){return new Response((0,i.formatZipPeekError)(t),{status:e,headers:{"Access-Control-Allow-Origin":"*"}})}function u(t){const e=t.split(".").pop()?.toLowerCase();return e?s.MIME_TYPES[e]??"application/octet-stream":"application/octet-stream"}},183(t,e){function n(t){try{return decodeURIComponent(t)}catch{return t}}Object.defineProperty(e,"__esModule",{value:!0}),e.isZipPackage=function(t){try{return new URL(t).pathname.endsWith(".zip")}catch{return t.split("?")[0].endsWith(".zip")}},e.normalizeZipUrl=function(t,e={}){const{stripCacheBuster:n=!0,stripHash:r=!0}=e,i=t=>r?t.split("#")[0]:t;if(!n)return i(t);const s=t.indexOf("?");if(-1===s)return i(t);const o=t.indexOf("#",s),a=t.substring(0,s),l=-1===o?t.substring(s+1):t.substring(s+1,o),u=r||-1===o?"":t.substring(o),c=l.split("&").filter(t=>{const e=t.indexOf("=");return"t"!==(-1===e?t:t.substring(0,e))});return 0===c.length?a+u:a+"?"+c.join("&")+u},e.normalizeZipEntryPath=function(t){let e=t.replace(/\\/g,"/");for(;e.startsWith("/");)e=e.slice(1);return e},e.parseZipAssetRequest=function(t){const e=/\.zip([/?])/.exec(t);if(!e)return null;const r=e.index+4,i=e[1],s=t.substring(0,r);if("/"===i){const e=t.substring(r+1),i=e.indexOf("?"),o=-1===i?e:e.substring(0,i);return""===o?null:{zipUrl:s,internalPath:n(o)}}const o=t.substring(r),a=o.indexOf("/");if(-1===a)return null;const l=o.substring(0,a),u=o.substring(a+1),c=u.indexOf("?"),f=-1===c?u:u.substring(0,c);return""===f?null:{zipUrl:s+l,internalPath:n(f)}},e.canonicalZipAssetRequestUrl=function(t,e){return t+"/"+encodeURIComponent(e)}},845(t,e){var n={},r=function(t,e,r,i,s){var o=new Worker(n[e]||(n[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return o.onmessage=function(t){var e=t.data,n=e.$e$;if(n){var r=new Error(n[0]);r.code=n[1],r.stack=n[2],s(r,null)}else s(null,e)},o.postMessage(r,i),o},i=Uint8Array,s=Uint16Array,o=Int32Array,a=new i([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),l=new i([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),u=new i([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c=function(t,e){for(var n=new s(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new o(n[30]);for(r=1;r<30;++r)for(var a=n[r];a<n[r+1];++a)i[a]=a-n[r]<<5|r;return{b:n,r:i}},f=c(a,2),h=f.b,p=f.r;h[28]=258,p[258]=28;for(var d=c(l,0),g=d.b,v=d.r,m=new s(32768),y=0;y<32768;++y){var w=(43690&y)>>1|(21845&y)<<1;w=(61680&(w=(52428&w)>>2|(13107&w)<<2))>>4|(3855&w)<<4,m[y]=((65280&w)>>8|(255&w)<<8)>>1}var E=function(t,e,n){for(var r=t.length,i=0,o=new s(e);i<r;++i)t[i]&&++o[t[i]-1];var a,l=new s(e);for(i=1;i<e;++i)l[i]=l[i-1]+o[i-1]<<1;if(n){a=new s(1<<e);var u=15-e;for(i=0;i<r;++i)if(t[i])for(var c=i<<4|t[i],f=e-t[i],h=l[t[i]-1]++<<f,p=h|(1<<f)-1;h<=p;++h)a[m[h]>>u]=c}else for(a=new s(r),i=0;i<r;++i)t[i]&&(a[i]=m[l[t[i]-1]++]>>15-t[i]);return a},A=new i(288);for(y=0;y<144;++y)A[y]=8;for(y=144;y<256;++y)A[y]=9;for(y=256;y<280;++y)A[y]=7;for(y=280;y<288;++y)A[y]=8;var C=new i(32);for(y=0;y<32;++y)C[y]=5;var b=E(A,9,0),_=E(A,9,1),z=E(C,5,0),S=E(C,5,1),M=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},U=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&n},Z=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},I=function(t){return(t+7)/8|0},T=function(t,e,n){return(null==e||e<0)&&(e=0),(null==n||n>t.length)&&(n=t.length),new i(t.subarray(e,n))};e.FlateErrorCode={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14};var P=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],R=function(t,e,n){var r=new Error(e||P[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,R),!n)throw r;return r},k=function(t,e,n,r){var s=t.length,o=r?r.length:0;if(!s||e.f&&!e.l)return n||new i(0);var c=!n,f=c||2!=e.i,p=e.i;c&&(n=new i(3*s));var d=function(t){var e=n.length;if(t>e){var r=new i(Math.max(2*e,t));r.set(n),n=r}},v=e.f||0,m=e.p||0,y=e.b||0,w=e.l,A=e.d,C=e.m,b=e.n,z=8*s;do{if(!w){v=U(t,m,1);var P=U(t,m+1,3);if(m+=3,!P){var k=t[(G=I(m)+4)-4]|t[G-3]<<8,L=G+k;if(L>s){p&&R(0);break}f&&d(y+k),n.set(t.subarray(G,L),y),e.b=y+=k,e.p=m=8*L,e.f=v;continue}if(1==P)w=_,A=S,C=9,b=5;else if(2==P){var x=U(t,m,31)+257,F=U(t,m+10,15)+4,O=x+U(t,m+5,31)+1;m+=14;for(var D=new i(O),N=new i(19),H=0;H<F;++H)N[u[H]]=U(t,m+3*H,7);m+=3*F;var $=M(N),j=(1<<$)-1,q=E(N,$,1);for(H=0;H<O;){var G,K=q[U(t,m,j)];if(m+=15&K,(G=K>>4)<16)D[H++]=G;else{var W=0,Y=0;for(16==G?(Y=3+U(t,m,3),m+=2,W=D[H-1]):17==G?(Y=3+U(t,m,7),m+=3):18==G&&(Y=11+U(t,m,127),m+=7);Y--;)D[H++]=W}}var X=D.subarray(0,x),B=D.subarray(x);C=M(X),b=M(B),w=E(X,C,1),A=E(B,b,1)}else R(1);if(m>z){p&&R(0);break}}f&&d(y+131072);for(var V=(1<<C)-1,J=(1<<b)-1,Q=m;;Q=m){var tt=(W=w[Z(t,m)&V])>>4;if((m+=15&W)>z){p&&R(0);break}if(W||R(2),tt<256)n[y++]=tt;else{if(256==tt){Q=m,w=null;break}var et=tt-254;if(tt>264){var nt=a[H=tt-257];et=U(t,m,(1<<nt)-1)+h[H],m+=nt}var rt=A[Z(t,m)&J],it=rt>>4;if(rt||R(3),m+=15&rt,B=g[it],it>3&&(nt=l[it],B+=Z(t,m)&(1<<nt)-1,m+=nt),m>z){p&&R(0);break}f&&d(y+131072);var st=y+et;if(y<B){var ot=o-B,at=Math.min(B,st);for(ot+y<0&&R(3);y<at;++y)n[y]=r[ot+y]}for(;y<st;++y)n[y]=n[y-B]}}e.l=w,e.p=Q,e.b=y,e.f=v,w&&(v=1,e.m=C,e.d=A,e.n=b)}while(!v);return y!=n.length&&c?T(n,0,y):n.subarray(0,y)},L=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},x=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},F=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var o=n.length,a=n.slice();if(!o)return{t:q,l:0};if(1==o){var l=new i(n[0].s+1);return l[n[0].s]=1,{t:l,l:1}}n.sort(function(t,e){return t.f-e.f}),n.push({s:-1,f:25001});var u=n[0],c=n[1],f=0,h=1,p=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};h!=o-1;)u=n[n[f].f<n[p].f?f++:p++],c=n[f!=h&&n[f].f<n[p].f?f++:p++],n[h++]={s:-1,f:u.f+c.f,l:u,r:c};var d=a[0].s;for(r=1;r<o;++r)a[r].s>d&&(d=a[r].s);var g=new s(d+1),v=O(n[h-1],g,0);if(v>e){r=0;var m=0,y=v-e,w=1<<y;for(a.sort(function(t,e){return g[e.s]-g[t.s]||t.f-e.f});r<o;++r){var E=a[r].s;if(!(g[E]>e))break;m+=w-(1<<v-g[E]),g[E]=e}for(m>>=y;m>0;){var A=a[r].s;g[A]<e?m-=1<<e-g[A]++-1:++r}for(;r>=0&&m;--r){var C=a[r].s;g[C]==e&&(--g[C],++m)}v=e}return{t:new i(g),l:v}},O=function(t,e,n){return-1==t.s?Math.max(O(t.l,e,n+1),O(t.r,e,n+1)):e[t.s]=n},D=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new s(++e),r=0,i=t[0],o=1,a=function(t){n[r++]=t},l=1;l<=e;++l)if(t[l]==i&&l!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=t[l]}return{c:n.subarray(0,r),n:e}},N=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},H=function(t,e,n){var r=n.length,i=I(e+2);t[i]=255&r,t[i+1]=r>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<r;++s)t[i+s+4]=n[s];return 8*(i+4+r)},$=function(t,e,n,r,i,o,c,f,h,p,d){L(e,d++,n),++i[256];for(var g=F(i,15),v=g.t,m=g.l,y=F(o,15),w=y.t,_=y.l,S=D(v),M=S.c,U=S.n,Z=D(w),I=Z.c,T=Z.n,P=new s(19),R=0;R<M.length;++R)++P[31&M[R]];for(R=0;R<I.length;++R)++P[31&I[R]];for(var k=F(P,7),O=k.t,$=k.l,j=19;j>4&&!O[u[j-1]];--j);var q,G,K,W,Y=p+5<<3,X=N(i,A)+N(o,C)+c,B=N(i,v)+N(o,w)+c+14+3*j+N(P,O)+2*P[16]+3*P[17]+7*P[18];if(h>=0&&Y<=X&&Y<=B)return H(e,d,t.subarray(h,h+p));if(L(e,d,1+(B<X)),d+=2,B<X){q=E(v,m,0),G=v,K=E(w,_,0),W=w;var V=E(O,$,0);for(L(e,d,U-257),L(e,d+5,T-1),L(e,d+10,j-4),d+=14,R=0;R<j;++R)L(e,d+3*R,O[u[R]]);d+=3*j;for(var J=[M,I],Q=0;Q<2;++Q){var tt=J[Q];for(R=0;R<tt.length;++R){var et=31&tt[R];L(e,d,V[et]),d+=O[et],et>15&&(L(e,d,tt[R]>>5&127),d+=tt[R]>>12)}}}else q=b,G=A,K=z,W=C;for(R=0;R<f;++R){var nt=r[R];if(nt>255){x(e,d,q[257+(et=nt>>18&31)]),d+=G[et+257],et>7&&(L(e,d,nt>>23&31),d+=a[et]);var rt=31&nt;x(e,d,K[rt]),d+=W[rt],rt>3&&(x(e,d,nt>>5&8191),d+=l[rt])}else x(e,d,q[nt]),d+=G[nt]}return x(e,d,q[256]),d+G[256]},j=new o([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),q=new i(0),G=function(t,e,n,r,u,c){var f=c.z||t.length,h=new i(r+f+5*(1+Math.ceil(f/7e3))+u),d=h.subarray(r,h.length-u),g=c.l,m=7&(c.r||0);if(e){m&&(d[0]=c.r>>3);for(var y=j[e-1],w=y>>13,E=8191&y,A=(1<<n)-1,C=c.p||new s(32768),b=c.h||new s(A+1),_=Math.ceil(n/3),z=2*_,S=function(e){return(t[e]^t[e+1]<<_^t[e+2]<<z)&A},M=new o(25e3),U=new s(288),Z=new s(32),P=0,R=0,k=c.i||0,L=0,x=c.w||0,F=0;k+2<f;++k){var O=S(k),D=32767&k,N=b[O];if(C[D]=N,b[O]=D,x<=k){var q=f-k;if((P>7e3||L>24576)&&(q>423||!g)){m=$(t,d,0,M,U,Z,R,L,F,k-F,m),L=P=R=0,F=k;for(var G=0;G<286;++G)U[G]=0;for(G=0;G<30;++G)Z[G]=0}var K=2,W=0,Y=E,X=D-N&32767;if(q>2&&O==S(k-X))for(var B=Math.min(w,q)-1,V=Math.min(32767,k),J=Math.min(258,q);X<=V&&--Y&&D!=N;){if(t[k+K]==t[k+K-X]){for(var Q=0;Q<J&&t[k+Q]==t[k+Q-X];++Q);if(Q>K){if(K=Q,W=X,Q>B)break;var tt=Math.min(X,Q-2),et=0;for(G=0;G<tt;++G){var nt=k-X+G&32767,rt=nt-C[nt]&32767;rt>et&&(et=rt,N=nt)}}}X+=(D=N)-(N=C[D])&32767}if(W){M[L++]=268435456|p[K]<<18|v[W];var it=31&p[K],st=31&v[W];R+=a[it]+l[st],++U[257+it],++Z[st],x=k+K,++P}else M[L++]=t[k],++U[t[k]]}}for(k=Math.max(k,x);k<f;++k)M[L++]=t[k],++U[t[k]];m=$(t,d,g,M,U,Z,R,L,F,k-F,m),g||(c.r=7&m|d[m/8|0]<<3,m-=7,c.h=b,c.p=C,c.i=k,c.w=x)}else{for(k=c.w||0;k<f+g;k+=65535){var ot=k+65535;ot>=f&&(d[m/8|0]=g,ot=f),m=H(d,m+1,t.subarray(k,ot))}c.i=f}return T(h,0,r+I(m)+u)},K=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&-306674912)^n>>>1;t[e]=n}return t}(),W=function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=K[255&n^e[r]]^n>>>8;t=n},d:function(){return~t}}},Y=function(){var t=1,e=0;return{p:function(n){for(var r=t,i=e,s=0|n.length,o=0;o!=s;){for(var a=Math.min(o+2655,s);o<a;++o)i+=r+=n[o];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}t=r,e=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(e%=65521))<<8|e>>8}}},X=function(t,e,n,r,s){if(!s&&(s={l:1},e.dictionary)){var o=e.dictionary.subarray(-32768),a=new i(o.length+t.length);a.set(o),a.set(t,o.length),t=a,s.w=o.length}return G(t,null==e.level?6:e.level,null==e.mem?s.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+e.mem,n,r,s)},B=function(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n},V=function(t,e,n){for(var r=t(),i=t.toString(),s=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<r.length;++o){var a=r[o],l=s[o];if("function"==typeof a){e+=";"+l+"=";var u=a.toString();if(a.prototype)if(-1!=u.indexOf("[native code]")){var c=u.indexOf(" ",8)+1;e+=u.slice(c,u.indexOf("(",c))}else for(var f in e+=u,a.prototype)e+=";"+l+".prototype."+f+"="+a.prototype[f].toString();else e+=u}else n[l]=a}return e},J=[],Q=function(t,e,n,i){if(!J[n]){for(var s="",o={},a=t.length-1,l=0;l<a;++l)s=V(t[l],s,o);J[n]={c:V(t[a],s,o),e:o}}var u=B({},J[n].e);return r(J[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,u,function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e}(u),i)},tt=function(){return[i,s,o,a,l,u,h,g,_,S,m,P,E,M,U,Z,I,T,R,k,Zt,ot,at]},et=function(){return[i,s,o,a,l,u,p,v,b,A,z,C,m,j,q,E,L,x,F,O,D,N,H,$,I,T,G,X,zt,ot]},nt=function(){return[gt,yt,dt,W,K]},rt=function(){return[vt,mt]},it=function(){return[wt,dt,Y]},st=function(){return[Et]},ot=function(t){return postMessage(t,[t.buffer])},at=function(t){return t&&{out:t.size&&new i(t.size),dictionary:t.dictionary}},lt=function(t,e,n,r,i,s){var o=Q(n,r,i,function(t,e){o.terminate(),s(t,e)});return o.postMessage([t,e],e.consume?[t.buffer]:[]),function(){o.terminate()}},ut=function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){e.data.length?(t.push(e.data[0],e.data[1]),postMessage([e.data[0].length])):t.flush()}},ct=function(t,e,n,r,i,s,o){var a,l=Q(t,r,i,function(t,n){t?(l.terminate(),e.ondata.call(e,t)):Array.isArray(n)?1==n.length?(e.queuedSize-=n[0],e.ondrain&&e.ondrain(n[0])):(n[1]&&l.terminate(),e.ondata.call(e,t,n[0],n[1])):o(n)});l.postMessage(n),e.queuedSize=0,e.push=function(t,n){e.ondata||R(5),a&&e.ondata(R(4,0,1),null,!!n),e.queuedSize+=t.length,l.postMessage([t,a=n],[t.buffer])},e.terminate=function(){l.terminate()},s&&(e.flush=function(){l.postMessage([])})},ft=function(t,e){return t[e]|t[e+1]<<8},ht=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},pt=function(t,e){return ht(t,e)+4294967296*ht(t,e+4)},dt=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},gt=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&dt(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var r=0;r<=n.length;++r)t[r+10]=n.charCodeAt(r)}},vt=function(t){31==t[0]&&139==t[1]&&8==t[2]||R(6,"invalid gzip data");var e=t[3],n=10;4&e&&(n+=2+(t[10]|t[11]<<8));for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(2&e)},mt=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},yt=function(t){return 10+(t.filename?t.filename.length+1:0)},wt=function(t,e){var n=e.level,r=0==n?0:n<6?1:9==n?3:2;if(t[0]=120,t[1]=r<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var i=Y();i.p(e.dictionary),dt(t,2,i.d())}},Et=function(t,e){return(8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31)&&R(6,"invalid zlib data"),(t[1]>>5&1)==+!e&&R(6,"invalid zlib data: "+(32&t[1]?"need":"unexpected")+" dictionary"),2+(t[1]>>3&4)};function At(t,e){return"function"==typeof t&&(e=t,t={}),this.ondata=e,t}var Ct=function(){function t(t,e){if("function"==typeof t&&(e=t,t={}),this.ondata=e,this.o=t||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new i(98304),this.o.dictionary){var n=this.o.dictionary.subarray(-32768);this.b.set(n,32768-n.length),this.s.i=32768-n.length}}return t.prototype.p=function(t,e){this.ondata(X(t,this.o,0,0,this.s),e)},t.prototype.push=function(t,e){this.ondata||R(5),this.s.l&&R(4);var n=t.length+this.s.z;if(n>this.b.length){if(n>2*this.b.length-32768){var r=new i(-32768&n);r.set(this.b.subarray(0,this.s.z)),this.b=r}var s=this.b.length-this.s.z;this.b.set(t.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(t.subarray(s),32768),this.s.z=t.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(t,this.s.z),this.s.z+=t.length;this.s.l=1&e,(this.s.z>this.s.w+8191||e)&&(this.p(this.b,e||!1),this.s.w=this.s.i,this.s.i-=2)},t.prototype.flush=function(){this.ondata||R(5),this.s.l&&R(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},t}();e.Deflate=Ct;var bt=function(){return function(t,e){ct([et,function(){return[ut,Ct]}],this,At.call(this,t,e),function(t){var e=new Ct(t.data);onmessage=ut(e)},6,1)}}();function _t(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&R(7),lt(t,e,[et],function(t){return ot(zt(t.data[0],t.data[1]))},0,n)}function zt(t,e){return X(t,e||{},0,0)}e.AsyncDeflate=bt,e.deflate=_t,e.deflateSync=zt;var St=function(){function t(t,e){"function"==typeof t&&(e=t,t={}),this.ondata=e;var n=t&&t.dictionary&&t.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new i(32768),this.p=new i(0),n&&this.o.set(n)}return t.prototype.e=function(t){if(this.ondata||R(5),this.d&&R(4),this.p.length){if(t.length){var e=new i(this.p.length+t.length);e.set(this.p),e.set(t,this.p.length),this.p=e}}else this.p=t},t.prototype.c=function(t){this.s.i=+(this.d=t||!1);var e=this.s.b,n=k(this.p,this.s,this.o);this.ondata(T(n,e,this.s.b),this.d),this.o=T(n,this.s.b-32768),this.s.b=this.o.length,this.p=T(this.p,this.s.p/8|0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}();e.Inflate=St;var Mt=function(){return function(t,e){ct([tt,function(){return[ut,St]}],this,At.call(this,t,e),function(t){var e=new St(t.data);onmessage=ut(e)},7,0)}}();function Ut(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&R(7),lt(t,e,[tt],function(t){return ot(Zt(t.data[0],at(t.data[1])))},1,n)}function Zt(t,e){return k(t,{i:2},e&&e.out,e&&e.dictionary)}e.AsyncInflate=Mt,e.inflate=Ut,e.inflateSync=Zt;var It=function(){function t(t,e){this.c=W(),this.l=0,this.v=1,Ct.call(this,t,e)}return t.prototype.push=function(t,e){this.c.p(t),this.l+=t.length,Ct.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){var n=X(t,this.o,this.v&&yt(this.o),e&&8,this.s);this.v&&(gt(n,this.o),this.v=0),e&&(dt(n,n.length-8,this.c.d()),dt(n,n.length-4,this.l)),this.ondata(n,e)},t.prototype.flush=function(){Ct.prototype.flush.call(this)},t}();e.Gzip=It,e.Compress=It;var Tt=function(){return function(t,e){ct([et,nt,function(){return[ut,Ct,It]}],this,At.call(this,t,e),function(t){var e=new It(t.data);onmessage=ut(e)},8,1)}}();function Pt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&R(7),lt(t,e,[et,nt,function(){return[Rt]}],function(t){return ot(Rt(t.data[0],t.data[1]))},2,n)}function Rt(t,e){e||(e={});var n=W(),r=t.length;n.p(t);var i=X(t,e,yt(e),8),s=i.length;return gt(i,e),dt(i,s-8,n.d()),dt(i,s-4,r),i}e.AsyncGzip=Tt,e.AsyncCompress=Tt,e.gzip=Pt,e.compress=Pt,e.gzipSync=Rt,e.compressSync=Rt;var kt=function(){function t(t,e){this.v=1,this.r=0,St.call(this,t,e)}return t.prototype.push=function(t,e){if(St.prototype.e.call(this,t),this.r+=t.length,this.v){var n=this.p.subarray(this.v-1),r=n.length>3?vt(n):4;if(r>n.length){if(!e)return}else this.v>1&&this.onmember&&this.onmember(this.r-n.length);this.p=n.subarray(r),this.v=0}St.prototype.c.call(this,e),!this.s.f||this.s.l||e||(this.v=I(this.s.p)+9,this.s={i:0},this.o=new i(0),this.push(new i(0),e))},t}();e.Gunzip=kt;var Lt=function(){return function(t,e){var n=this;ct([tt,rt,function(){return[ut,St,kt]}],this,At.call(this,t,e),function(t){var e=new kt(t.data);e.onmember=function(t){return postMessage(t)},onmessage=ut(e)},9,0,function(t){return n.onmember&&n.onmember(t)})}}();function xt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&R(7),lt(t,e,[tt,rt,function(){return[Ft]}],function(t){return ot(Ft(t.data[0],t.data[1]))},3,n)}function Ft(t,e){var n=vt(t);return n+8>t.length&&R(6,"invalid gzip data"),k(t.subarray(n,-8),{i:2},e&&e.out||new i(mt(t)),e&&e.dictionary)}e.AsyncGunzip=Lt,e.gunzip=xt,e.gunzipSync=Ft;var Ot=function(){function t(t,e){this.c=Y(),this.v=1,Ct.call(this,t,e)}return t.prototype.push=function(t,e){this.c.p(t),Ct.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){var n=X(t,this.o,this.v&&(this.o.dictionary?6:2),e&&4,this.s);this.v&&(wt(n,this.o),this.v=0),e&&dt(n,n.length-4,this.c.d()),this.ondata(n,e)},t.prototype.flush=function(){Ct.prototype.flush.call(this)},t}();e.Zlib=Ot;var Dt=function(){return function(t,e){ct([et,it,function(){return[ut,Ct,Ot]}],this,At.call(this,t,e),function(t){var e=new Ot(t.data);onmessage=ut(e)},10,1)}}();function Nt(t,e){e||(e={});var n=Y();n.p(t);var r=X(t,e,e.dictionary?6:2,4);return wt(r,e),dt(r,r.length-4,n.d()),r}e.AsyncZlib=Dt,e.zlib=function(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&R(7),lt(t,e,[et,it,function(){return[Nt]}],function(t){return ot(Nt(t.data[0],t.data[1]))},4,n)},e.zlibSync=Nt;var Ht=function(){function t(t,e){St.call(this,t,e),this.v=t&&t.dictionary?2:1}return t.prototype.push=function(t,e){if(St.prototype.e.call(this,t),this.v){if(this.p.length<6&&!e)return;this.p=this.p.subarray(Et(this.p,this.v-1)),this.v=0}e&&(this.p.length<4&&R(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),St.prototype.c.call(this,e)},t}();e.Unzlib=Ht;var $t=function(){return function(t,e){ct([tt,st,function(){return[ut,St,Ht]}],this,At.call(this,t,e),function(t){var e=new Ht(t.data);onmessage=ut(e)},11,0)}}();function jt(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&R(7),lt(t,e,[tt,st,function(){return[qt]}],function(t){return ot(qt(t.data[0],at(t.data[1])))},5,n)}function qt(t,e){return k(t.subarray(Et(t,e&&e.dictionary),-4),{i:2},e&&e.out,e&&e.dictionary)}e.AsyncUnzlib=$t,e.unzlib=jt,e.unzlibSync=qt;var Gt=function(){function t(t,e){this.o=At.call(this,t,e)||{},this.G=kt,this.I=St,this.Z=Ht}return t.prototype.i=function(){var t=this;this.s.ondata=function(e,n){t.ondata(e,n)}},t.prototype.push=function(t,e){if(this.ondata||R(5),this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var n=new i(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length)}else this.p=t;this.p.length>2&&(this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(this.o):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(this.o):new this.Z(this.o),this.i(),this.s.push(this.p,e),this.p=null)}},t}();e.Decompress=Gt;var Kt=function(){function t(t,e){Gt.call(this,t,e),this.queuedSize=0,this.G=Lt,this.I=Mt,this.Z=$t}return t.prototype.i=function(){var t=this;this.s.ondata=function(e,n,r){t.ondata(e,n,r)},this.s.ondrain=function(e){t.queuedSize-=e,t.ondrain&&t.ondrain(e)}},t.prototype.push=function(t,e){this.queuedSize+=t.length,Gt.prototype.push.call(this,t,e)},t}();e.AsyncDecompress=Kt,e.decompress=function(t,e,n){return n||(n=e,e={}),"function"!=typeof n&&R(7),31==t[0]&&139==t[1]&&8==t[2]?xt(t,e,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Ut(t,e,n):jt(t,e,n)},e.decompressSync=function(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?Ft(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Zt(t,e):qt(t,e)};var Wt=function(t,e,n,r){for(var s in t){var o=t[s],a=e+s,l=r;Array.isArray(o)&&(l=B(r,o[1]),o=o[0]),o instanceof i?n[a]=[o,l]:(n[a+="/"]=[new i(0),l],Wt(o,a,n,r))}},Yt="undefined"!=typeof TextEncoder&&new TextEncoder,Xt="undefined"!=typeof TextDecoder&&new TextDecoder,Bt=0;try{Xt.decode(q,{stream:!0}),Bt=1}catch(t){}var Vt=function(t){for(var e="",n=0;;){var r=t[n++],i=(r>127)+(r>223)+(r>239);if(n+i>t.length)return{s:e,r:T(t,n-1)};i?3==i?(r=((15&r)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536,e+=String.fromCharCode(55296|r>>10,56320|1023&r)):e+=1&i?String.fromCharCode((31&r)<<6|63&t[n++]):String.fromCharCode((15&r)<<12|(63&t[n++])<<6|63&t[n++]):e+=String.fromCharCode(r)}},Jt=function(){function t(t){this.ondata=t,Bt?this.t=new TextDecoder:this.p=q}return t.prototype.push=function(t,e){if(this.ondata||R(5),e=!!e,this.t)return this.ondata(this.t.decode(t,{stream:!0}),e),void(e&&(this.t.decode().length&&R(8),this.t=null));this.p||R(4);var n=new i(this.p.length+t.length);n.set(this.p),n.set(t,this.p.length);var r=Vt(n),s=r.s,o=r.r;e?(o.length&&R(8),this.p=null):this.p=o,this.ondata(s,e)},t}();e.DecodeUTF8=Jt;var Qt=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){this.ondata||R(5),this.d&&R(4),this.ondata(te(t),this.d=e||!1)},t}();function te(t,e){if(e){for(var n=new i(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(Yt)return Yt.encode(t);var s=t.length,o=new i(t.length+(t.length>>1)),a=0,l=function(t){o[a++]=t};for(r=0;r<s;++r){if(a+5>o.length){var u=new i(a+8+(s-r<<1));u.set(o),o=u}var c=t.charCodeAt(r);c<128||e?l(c):c<2048?(l(192|c>>6),l(128|63&c)):c>55295&&c<57344?(l(240|(c=65536+(1047552&c)|1023&t.charCodeAt(++r))>>18),l(128|c>>12&63),l(128|c>>6&63),l(128|63&c)):(l(224|c>>12),l(128|c>>6&63),l(128|63&c))}return T(o,0,a)}function ee(t,e){if(e){for(var n="",r=0;r<t.length;r+=16384)n+=String.fromCharCode.apply(null,t.subarray(r,r+16384));return n}if(Xt)return Xt.decode(t);var i=Vt(t),s=i.s;return(n=i.r).length&&R(8),s}e.EncodeUTF8=Qt,e.strToU8=te,e.strFromU8=ee;var ne=function(t){return 1==t?3:t<6?2:9==t?1:0},re=function(t,e){return e+30+ft(t,e+26)+ft(t,e+28)},ie=function(t,e,n){var r=ft(t,e+28),i=ee(t.subarray(e+46,e+46+r),!(2048&ft(t,e+8))),s=e+46+r,o=ht(t,e+20),a=n&&4294967295==o?se(t,s):[o,ht(t,e+24),ht(t,e+42)],l=a[0],u=a[1],c=a[2];return[ft(t,e+10),l,u,i,s+ft(t,e+30)+ft(t,e+32),c]},se=function(t,e){for(;1!=ft(t,e);e+=4+ft(t,e+2));return[pt(t,e+12),pt(t,e+4),pt(t,e+20)]},oe=function(t){var e=0;if(t)for(var n in t){var r=t[n].length;r>65535&&R(9),e+=r+4}return e},ae=function(t,e,n,r,i,s,o,a){var l=r.length,u=n.extra,c=a&&a.length,f=oe(u);dt(t,e,null!=o?33639248:67324752),e+=4,null!=o&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(s<0&&8),t[e++]=i&&8,t[e++]=255&n.compression,t[e++]=n.compression>>8;var h=new Date(null==n.mtime?Date.now():n.mtime),p=h.getFullYear()-1980;if((p<0||p>119)&&R(10),dt(t,e,p<<25|h.getMonth()+1<<21|h.getDate()<<16|h.getHours()<<11|h.getMinutes()<<5|h.getSeconds()>>1),e+=4,-1!=s&&(dt(t,e,n.crc),dt(t,e+4,s<0?-s-2:s),dt(t,e+8,n.size)),dt(t,e+12,l),dt(t,e+14,f),e+=16,null!=o&&(dt(t,e,c),dt(t,e+6,n.attrs),dt(t,e+10,o),e+=14),t.set(r,e),e+=l,f)for(var d in u){var g=u[d],v=g.length;dt(t,e,+d),dt(t,e+2,v),t.set(g,e+4),e+=4+v}return c&&(t.set(a,e),e+=c),e},le=function(t,e,n,r,i){dt(t,e,101010256),dt(t,e+8,n),dt(t,e+10,n),dt(t,e+12,r),dt(t,e+16,i)},ue=function(){function t(t){this.filename=t,this.c=W(),this.size=0,this.compression=0}return t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){this.ondata||R(5),this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}();e.ZipPassThrough=ue;var ce=function(){function t(t,e){var n=this;e||(e={}),ue.call(this,t),this.d=new Ct(e,function(t,e){n.ondata(null,t,e)}),this.compression=8,this.flag=ne(e.level)}return t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(t){this.ondata(t,null,e)}},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}();e.ZipDeflate=ce;var fe=function(){function t(t,e){var n=this;e||(e={}),ue.call(this,t),this.d=new bt(e,function(t,e,r){n.ondata(t,e,r)}),this.compression=8,this.flag=ne(e.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}();e.AsyncZipDeflate=fe;var he=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(this.ondata||R(5),2&this.d)this.ondata(R(4+8*(1&this.d),0,1),null,!1);else{var n=te(t.filename),r=n.length,s=t.comment,o=s&&te(s),a=r!=t.filename.length||o&&s.length!=o.length,l=r+oe(t.extra)+30;r>65535&&this.ondata(R(11,0,1),null,!1);var u=new i(l);ae(u,0,t,n,a,-1);var c=[u],f=function(){for(var t=0,n=c;t<n.length;t++){var r=n[t];e.ondata(null,r,!1)}c=[]},h=this.d;this.d=0;var p=this.u.length,d=B(t,{f:n,u:a,o,t:function(){t.terminate&&t.terminate()},r:function(){if(f(),h){var t=e.u[p+1];t?t.r():e.d=1}h=1}}),g=0;t.ondata=function(n,r,s){if(n)e.ondata(n,r,s),e.terminate();else if(g+=r.length,c.push(r),s){var o=new i(16);dt(o,0,134695760),dt(o,4,t.crc),dt(o,8,g),dt(o,12,t.size),c.push(o),d.c=g,d.b=l+g+16,d.crc=t.crc,d.size=t.size,h&&d.r(),h=1}else h&&f()},this.u.push(d)}},t.prototype.end=function(){var t=this;2&this.d?this.ondata(R(4+8*(1&this.d),0,1),null,!0):(this.d?this.e():this.u.push({r:function(){1&t.d&&(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3)},t.prototype.e=function(){for(var t=0,e=0,n=0,r=0,s=this.u;r<s.length;r++)n+=46+(u=s[r]).f.length+oe(u.extra)+(u.o?u.o.length:0);for(var o=new i(n+22),a=0,l=this.u;a<l.length;a++){var u=l[a];ae(o,t,u,u.f,u.u,-u.c-2,e,u.o),t+=46+u.f.length+oe(u.extra)+(u.o?u.o.length:0),e+=u.b}le(o,t,this.u.length,n,e),this.ondata(null,o,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++)e[t].t();this.d=2},t}();e.Zip=he,e.zip=function(t,e,n){n||(n=e,e={}),"function"!=typeof n&&R(7);var r={};Wt(t,"",r,e);var s=Object.keys(r),o=s.length,a=0,l=0,u=o,c=new Array(o),f=[],h=function(){for(var t=0;t<f.length;++t)f[t]()},p=function(t,e){me(function(){n(t,e)})};me(function(){p=n});var d=function(){var t=new i(l+22),e=a,n=l-a;l=0;for(var r=0;r<u;++r){var s=c[r];try{var o=s.c.length;ae(t,l,s,s.f,s.u,o);var f=30+s.f.length+oe(s.extra),h=l+f;t.set(s.c,h),ae(t,a,s,s.f,s.u,o,l,s.m),a+=16+f+(s.m?s.m.length:0),l=h+o}catch(t){return p(t,null)}}le(t,a,c.length,n,e),p(null,t)};o||d();for(var g=function(t){var e=s[t],n=r[e],i=n[0],u=n[1],g=W(),v=i.length;g.p(i);var m=te(e),y=m.length,w=u.comment,E=w&&te(w),A=E&&E.length,C=oe(u.extra),b=0==u.level?0:8,_=function(n,r){if(n)h(),p(n,null);else{var i=r.length;c[t]=B(u,{size:v,crc:g.d(),c:r,f:m,m:E,u:y!=e.length||E&&w.length!=A,compression:b}),a+=30+y+C+i,l+=76+2*(y+C)+(A||0)+i,--o||d()}};if(y>65535&&_(R(11,0,1),null),b)if(v<16e4)try{_(null,zt(i,u))}catch(t){_(t,null)}else f.push(_t(i,u,_));else _(null,i)},v=0;v<u;++v)g(v);return h},e.zipSync=function(t,e){e||(e={});var n={},r=[];Wt(t,"",n,e);var s=0,o=0;for(var a in n){var l=n[a],u=l[0],c=l[1],f=0==c.level?0:8,h=(_=te(a)).length,p=c.comment,d=p&&te(p),g=d&&d.length,v=oe(c.extra);h>65535&&R(11);var m=f?zt(u,c):u,y=m.length,w=W();w.p(u),r.push(B(c,{size:u.length,crc:w.d(),c:m,f:_,m:d,u:h!=a.length||d&&p.length!=g,o:s,compression:f})),s+=30+h+v+y,o+=76+2*(h+v)+(g||0)+y}for(var E=new i(o+22),A=s,C=o-s,b=0;b<r.length;++b){var _=r[b];ae(E,_.o,_,_.f,_.u,_.c.length);var z=30+_.f.length+oe(_.extra);E.set(_.c,_.o+z),ae(E,s,_,_.f,_.u,_.c.length,_.o,_.m),s+=16+z+(_.m?_.m.length:0)}return le(E,s,r.length,C,A),E};var pe=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}();e.UnzipPassThrough=pe;var de=function(){function t(){var t=this;this.i=new St(function(e,n){t.ondata(null,e,n)})}return t.prototype.push=function(t,e){try{this.i.push(t,e)}catch(t){this.ondata(t,null,e)}},t.compression=8,t}();e.UnzipInflate=de;var ge=function(){function t(t,e){var n=this;e<32e4?this.i=new St(function(t,e){n.ondata(null,t,e)}):(this.i=new Mt(function(t,e,r){n.ondata(t,e,r)}),this.terminate=this.i.terminate)}return t.prototype.push=function(t,e){this.i.terminate&&(t=T(t,0)),this.i.push(t,e)},t.compression=8,t}();e.AsyncUnzipInflate=ge;var ve=function(){function t(t){this.onfile=t,this.k=[],this.o={0:pe},this.p=q}return t.prototype.push=function(t,e){var n=this;if(this.onfile||R(5),this.p||R(4),this.c>0){var r=Math.min(this.c,t.length),s=t.subarray(0,r);if(this.c-=r,this.d?this.d.push(s,!this.c):this.k[0].push(s),(t=t.subarray(r)).length)return this.push(t,e)}else{var o=0,a=0,l=void 0,u=void 0;this.p.length?t.length?((u=new i(this.p.length+t.length)).set(this.p),u.set(t,this.p.length)):u=this.p:u=t;for(var c=u.length,f=this.c,h=f&&this.d,p=function(){var t,e=ht(u,a);if(67324752==e){o=1,l=a,d.d=null,d.c=0;var r=ft(u,a+6),i=ft(u,a+8),s=2048&r,h=8&r,p=ft(u,a+26),g=ft(u,a+28);if(c>a+30+p+g){var v=[];d.k.unshift(v),o=2;var m,y=ht(u,a+18),w=ht(u,a+22),E=ee(u.subarray(a+30,a+=30+p),!s);4294967295==y?(t=h?[-2]:se(u,a),y=t[0],w=t[1]):h&&(y=-1),a+=g,d.c=y;var A={name:E,compression:i,start:function(){if(A.ondata||R(5),y){var t=n.o[i];t||A.ondata(R(14,"unknown compression type "+i,1),null,!1),(m=y<0?new t(E):new t(E,y,w)).ondata=function(t,e,n){A.ondata(t,e,n)};for(var e=0,r=v;e<r.length;e++){var s=r[e];m.push(s,!1)}n.k[0]==v&&n.c?n.d=m:m.push(q,!0)}else A.ondata(null,q,!0)},terminate:function(){m&&m.terminate&&m.terminate()}};y>=0&&(A.size=y,A.originalSize=w),d.onfile(A)}return"break"}if(f){if(134695760==e)return l=a+=12+(-2==f&&8),o=3,d.c=0,"break";if(33639248==e)return l=a-=4,o=3,d.c=0,"break"}},d=this;a<c-4&&"break"!==p();++a);if(this.p=q,f<0){var g=o?u.subarray(0,l-12-(-2==f&&8)-(134695760==ht(u,l-16)&&4)):u.subarray(0,a);h?h.push(g,!!o):this.k[+(2==o)].push(g)}if(2&o)return this.push(u.subarray(a),e);this.p=u.subarray(a)}e&&(this.c&&R(13),this.p=null)},t.prototype.register=function(t){this.o[t.compression]=t},t}();e.Unzip=ve;var me="function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout?setTimeout:function(t){t()};e.unzip=function(t,e,n){n||(n=e,e={}),"function"!=typeof n&&R(7);var r=[],s=function(){for(var t=0;t<r.length;++t)r[t]()},o={},a=function(t,e){me(function(){n(t,e)})};me(function(){a=n});for(var l=t.length-22;101010256!=ht(t,l);--l)if(!l||t.length-l>65558)return a(R(13,0,1),null),s;var u=ft(t,l+8);if(u){var c=u,f=ht(t,l+16),h=4294967295==f||65535==c;if(h){var p=ht(t,l-12);(h=101075792==ht(t,p))&&(c=u=ht(t,p+32),f=ht(t,p+48))}for(var d=e&&e.filter,g=function(e){var n=ie(t,f,h),l=n[0],c=n[1],p=n[2],g=n[3],v=n[4],m=n[5],y=re(t,m);f=v;var w=function(t,e){t?(s(),a(t,null)):(e&&(o[g]=e),--u||a(null,o))};if(!d||d({name:g,size:c,originalSize:p,compression:l}))if(l)if(8==l){var E=t.subarray(y,y+c);if(p<524288||c>.8*p)try{w(null,Zt(E,{out:new i(p)}))}catch(t){w(t,null)}else r.push(Ut(E,{size:p},w))}else w(R(14,"unknown compression type "+l,1),null);else w(null,T(t,y,y+c));else w(null,null)},v=0;v<c;++v)g()}else a(null,{});return s},e.unzipSync=function(t,e){for(var n={},r=t.length-22;101010256!=ht(t,r);--r)(!r||t.length-r>65558)&&R(13);var s=ft(t,r+8);if(!s)return{};var o=ht(t,r+16),a=4294967295==o||65535==s;if(a){var l=ht(t,r-12);(a=101075792==ht(t,l))&&(s=ht(t,l+32),o=ht(t,l+48))}for(var u=e&&e.filter,c=0;c<s;++c){var f=ie(t,o,a),h=f[0],p=f[1],d=f[2],g=f[3],v=f[4],m=f[5],y=re(t,m);o=v,u&&!u({name:g,size:p,originalSize:d,compression:h})||(h?8==h?n[g]=Zt(t.subarray(y,y+p),{out:new i(d)}):R(14,"unknown compression type "+h):n[g]=T(t,y,y+p))}return n}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,n),s.exports}(()=>{const t=n(842),e=n(886),r=n(49);self.addEventListener("install",()=>{self.skipWaiting()}),self.addEventListener("activate",t=>{t.waitUntil(self.clients.claim())}),(0,t.installClientErrorReporting)(),(0,r.installMessageHandler)(),(0,e.installFetchHandler)()})()})();
2
2
  //# sourceMappingURL=zipServiceWorker.js.map