@netlify/spark-ui 1.26.1-alpha.2 → 1.27.1

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.
Files changed (25) hide show
  1. package/README.md +3 -4
  2. package/dist/components/index.d.ts +2 -3
  3. package/dist/components/preact/DropZone/DropZone.d.ts +1 -0
  4. package/dist/components/preact/DropZone/drop-core/deploy.js +16 -16
  5. package/dist/components/preact/DropZone/drop-core/digest.d.ts +0 -1
  6. package/dist/components/preact/DropZone/drop-core/digest.js +5 -9
  7. package/dist/components/preact/DropZone/drop-core/index.js +9 -12
  8. package/dist/components/preact/DropZone/drop-core/readFiles.d.ts +0 -2
  9. package/dist/components/preact/DropZone/drop-core/readFiles.js +194 -195
  10. package/dist/components/preact/DropZone/drop-core/types.d.ts +0 -1
  11. package/dist/components/preact/DropZone/index.d.ts +3 -0
  12. package/dist/components/preact/DropZone/index.js +11 -0
  13. package/dist/components/preact/DropZone/useDropDeploy.js +31 -28
  14. package/dist/components/preact/index.d.ts +1 -0
  15. package/dist/components/preact/index.js +13 -10
  16. package/package.json +1 -1
  17. package/packages/components/index.ts +3 -3
  18. package/packages/components/preact/DropZone/DropZone.tsx +1 -0
  19. package/packages/components/preact/DropZone/drop-core/deploy.ts +4 -2
  20. package/packages/components/preact/DropZone/drop-core/digest.ts +0 -4
  21. package/packages/components/preact/DropZone/drop-core/readFiles.ts +18 -11
  22. package/packages/components/preact/DropZone/drop-core/types.ts +0 -1
  23. package/packages/components/preact/DropZone/index.tsx +16 -0
  24. package/packages/components/preact/DropZone/useDropDeploy.ts +13 -2
  25. package/packages/components/preact/index.ts +1 -0
package/README.md CHANGED
@@ -147,13 +147,13 @@ This repo includes a [Claude Code](https://claude.ai/code) skill for generating
147
147
 
148
148
  The skill is available automatically. Run:
149
149
 
150
- ```text
150
+ ```
151
151
  /project:landing-page <describe the page you want>
152
152
  ```
153
153
 
154
154
  For example:
155
155
 
156
- ```text
156
+ ```
157
157
  /project:landing-page A landing page for a new enterprise hosting product with a hero, feature cards, and a pricing comparison
158
158
  ```
159
159
 
@@ -185,7 +185,7 @@ When you’re ready to validate your component changes in a deploy preview, you
185
185
  >
186
186
  > Reach out to #internal-permissions in Slack
187
187
 
188
- ### Steps to Publish an Alpha Release
188
+ ### Steps to Publish an Alpha Release:
189
189
 
190
190
  1. **Make sure you're logged into npm locally**
191
191
 
@@ -206,7 +206,6 @@ When you’re ready to validate your component changes in a deploy preview, you
206
206
  ```
207
207
 
208
208
  1. **Install the updated package:**
209
-
210
209
  ```bash
211
210
  npm install
212
211
  ```
@@ -5,7 +5,6 @@ export { default as SearchLink } from './preact/SearchModal/components/SearchLin
5
5
  export { default as SearchHeading } from './preact/SearchModal/components/SearchHeading/SearchHeading';
6
6
  export { default as SearchToggle } from './preact/SearchModal/components/SearchToggle/SearchToggle';
7
7
  export { default as SearchModal } from './preact/SearchModal/components/SearchModal/SearchModal';
8
- export { default as DropZone } from './preact/DropZone/DropZone';
9
- export { AnonymousDropClient, deployFiles, readDataTransfer, readFileList, } from './preact/DropZone/drop-core';
10
- export type { DropClient, DropResponse, Digest, DeployResult, DeployProgress, DeployPhase, ProcessedFile, } from './preact/DropZone/drop-core';
8
+ export { DropZone, AnonymousDropClient, deployFiles, readDataTransfer, readFileList, } from './preact/DropZone';
9
+ export type { DropClient, DropResponse, Digest, DeployResult, DeployProgress, DeployPhase, ProcessedFile, } from './preact/DropZone';
11
10
  export { type IconName } from './preact/Icon';
@@ -27,6 +27,7 @@ interface Props {
27
27
  * - `dropzone_files_dropped` — files dropped via drag ({ method: 'drag', file_count })
28
28
  * - `dropzone_browse_opened` — file picker opened ({ method: 'keyboard' | 'click' })
29
29
  * - `dropzone_deploy_succeeded` — deploy went live ({ method, site_name, file_count })
30
+ * - `dropzone_deploy_failed` — deploy errored out ({ method, reason, file_count? })
30
31
  */
31
32
  onTrack?: TrackFn;
32
33
  /**
@@ -1,28 +1,28 @@
1
- import { getDigest as w, getShas as y } from "./digest.js";
2
- const r = 5;
3
- async function d(e, h, u, t, i, a) {
4
- const n = u.filter((p) => t.has(p.sha));
5
- let l = 0, c = 0;
1
+ import { getDigest as w } from "./digest.js";
2
+ const y = 5;
3
+ async function d(e, l, u, t, i, a) {
4
+ const n = u.filter((h) => t.has(h.sha));
5
+ let p = 0, c = 0;
6
6
  const o = async () => {
7
- for (; l < n.length; ) {
8
- const p = n[l++];
9
- await e.uploadFile(h, p.path, p.content, i), a == null || a(++c);
7
+ for (; p < n.length; ) {
8
+ const h = n[p++];
9
+ await e.uploadFile(l, h.path, h.content, i), a == null || a(++c);
10
10
  }
11
11
  };
12
- await Promise.all(Array.from({ length: Math.min(r, n.length) }, o));
12
+ await Promise.all(Array.from({ length: Math.min(y, n.length) }, o));
13
13
  }
14
- async function f(e, h, u = {}) {
15
- if (!h.length) throw new Error("No files to deploy");
14
+ async function f(e, l, u = {}) {
15
+ if (!l.length) throw new Error("No files to deploy");
16
16
  const { onProgress: t } = u;
17
17
  t == null || t({ phase: "creating" });
18
- const i = await e.getToken(), a = await e.createDeploy(w(h), i), n = a.required.length;
18
+ const i = await e.getToken(), a = await e.createDeploy(w(l), i), n = a.required.length;
19
19
  return t == null || t({ phase: "uploading", uploaded: 0, total: n }), await d(
20
20
  e,
21
- a.id,
22
- h,
23
- y(a.required),
21
+ a.deploy_id,
22
+ l,
23
+ new Set(a.required),
24
24
  i,
25
- (l) => t == null ? void 0 : t({ phase: "uploading", uploaded: l, total: n })
25
+ (p) => t == null ? void 0 : t({ phase: "uploading", uploaded: p, total: n })
26
26
  ), t == null || t({ phase: "processing" }), await e.waitUntilReady(a, i), t == null || t({ phase: "ready" }), { deploy: a, token: i, url: `https://${a.subdomain}.netlify.app` };
27
27
  }
28
28
  export {
@@ -1,3 +1,2 @@
1
1
  import { Digest, ProcessedFile } from './types';
2
2
  export declare function getDigest(files: ProcessedFile[]): Digest;
3
- export declare function getShas(required: string[]): Set<string>;
@@ -1,12 +1,8 @@
1
- function o(t) {
2
- const e = {};
3
- for (const n of t) e[n.path] = n.sha;
4
- return e;
5
- }
6
- function r(t) {
7
- return new Set(t);
1
+ function n(e) {
2
+ const t = {};
3
+ for (const o of e) t[o.path] = o.sha;
4
+ return t;
8
5
  }
9
6
  export {
10
- o as getDigest,
11
- r as getShas
7
+ n as getDigest
12
8
  };
@@ -1,16 +1,13 @@
1
- import { getDigest as o, getShas as r } from "./digest.js";
2
- import { getSingleNonIndexHtmlFileName as l, hasMultipleHtmlFilesWithoutIndex as a, normalizeFiles as m, readDataTransfer as n, readFileList as s, readZip as p } from "./readFiles.js";
3
- import { AnonymousDropClient as x } from "./client.js";
4
- import { deployFiles as g } from "./deploy.js";
1
+ import { getDigest as o } from "./digest.js";
2
+ import { getSingleNonIndexHtmlFileName as l, hasMultipleHtmlFilesWithoutIndex as i, readDataTransfer as m, readFileList as n } from "./readFiles.js";
3
+ import { AnonymousDropClient as p } from "./client.js";
4
+ import { deployFiles as x } from "./deploy.js";
5
5
  export {
6
- x as AnonymousDropClient,
7
- g as deployFiles,
6
+ p as AnonymousDropClient,
7
+ x as deployFiles,
8
8
  o as getDigest,
9
- r as getShas,
10
9
  l as getSingleNonIndexHtmlFileName,
11
- a as hasMultipleHtmlFilesWithoutIndex,
12
- m as normalizeFiles,
13
- n as readDataTransfer,
14
- s as readFileList,
15
- p as readZip
10
+ i as hasMultipleHtmlFilesWithoutIndex,
11
+ m as readDataTransfer,
12
+ n as readFileList
16
13
  };
@@ -9,7 +9,5 @@ import { ProcessedFile } from './types';
9
9
  */
10
10
  export declare function readDataTransfer(dt: DataTransfer): Promise<ProcessedFile[]>;
11
11
  export declare function readFileList(files: FileList): Promise<ProcessedFile[]>;
12
- export declare function readZip(zip: File): Promise<ProcessedFile[]>;
13
- export declare function normalizeFiles(files: ProcessedFile[]): ProcessedFile[];
14
12
  export declare function getSingleNonIndexHtmlFileName(files: ProcessedFile[]): string | null;
15
13
  export declare function hasMultipleHtmlFilesWithoutIndex(files: ProcessedFile[]): boolean;
@@ -1,13 +1,13 @@
1
- import { g as W } from "../../../../chunks/_commonjsHelpers.C6fGbg64.js";
2
- var L = { exports: {} }, j = L.exports, E;
3
- function F() {
4
- return E || (E = 1, function(x, m) {
1
+ import { g as F } from "../../../../chunks/_commonjsHelpers.C6fGbg64.js";
2
+ var L = { exports: {} }, I = L.exports, M;
3
+ function z() {
4
+ return M || (M = 1, function(g, _) {
5
5
  (function(b, p) {
6
- x.exports = p();
7
- })(typeof self < "u" ? self : j, function() {
6
+ g.exports = p();
7
+ })(typeof self < "u" ? self : I, function() {
8
8
  return (
9
9
  /******/
10
- function(y) {
10
+ function(x) {
11
11
  var b = {};
12
12
  function p(v) {
13
13
  if (b[v])
@@ -21,16 +21,16 @@ function F() {
21
21
  exports: {}
22
22
  /******/
23
23
  };
24
- return y[v].call(s.exports, s, s.exports, p), s.l = !0, s.exports;
24
+ return x[v].call(s.exports, s, s.exports, p), s.l = !0, s.exports;
25
25
  }
26
- return p.m = y, p.c = b, p.d = function(v, s, g) {
26
+ return p.m = x, p.c = b, p.d = function(v, s, y) {
27
27
  p.o(v, s) || Object.defineProperty(v, s, {
28
28
  /******/
29
29
  configurable: !1,
30
30
  /******/
31
31
  enumerable: !0,
32
32
  /******/
33
- get: g
33
+ get: y
34
34
  /******/
35
35
  });
36
36
  }, p.n = function(v) {
@@ -52,12 +52,12 @@ function F() {
52
52
  }([
53
53
  /* 0 */
54
54
  /***/
55
- function(y, b, p) {
55
+ function(x, b, p) {
56
56
  function v(e, o) {
57
57
  if (!(e instanceof o))
58
58
  throw new TypeError("Cannot call a class as a function");
59
59
  }
60
- var s = p(5), g = p(1), u = g.toHex, c = g.ceilHeapSize, l = p(6), d = function(e) {
60
+ var s = p(5), y = p(1), u = y.toHex, f = y.ceilHeapSize, l = p(6), d = function(e) {
61
61
  for (e += 9; e % 64 > 0; e += 1)
62
62
  ;
63
63
  return e;
@@ -80,11 +80,11 @@ function F() {
80
80
  }, t = function(e, o) {
81
81
  var n = new Int32Array(e, o + 320, 5), h = new Int32Array(5), a = new DataView(h.buffer);
82
82
  return a.setInt32(0, n[0], !1), a.setInt32(4, n[1], !1), a.setInt32(8, n[2], !1), a.setInt32(12, n[3], !1), a.setInt32(16, n[4], !1), h;
83
- }, f = function() {
83
+ }, c = function() {
84
84
  function e(o) {
85
85
  if (v(this, e), o = o || 64 * 1024, o % 64 > 0)
86
86
  throw new Error("Chunk size must be a multiple of 128 bit");
87
- this._offset = 0, this._maxChunkLen = o, this._padMaxChunkLen = d(o), this._heap = new ArrayBuffer(c(this._padMaxChunkLen + 320 + 20)), this._h32 = new Int32Array(this._heap), this._h8 = new Int8Array(this._heap), this._core = new s({ Int32Array }, {}, this._heap);
87
+ this._offset = 0, this._maxChunkLen = o, this._padMaxChunkLen = d(o), this._heap = new ArrayBuffer(f(this._padMaxChunkLen + 320 + 20)), this._h32 = new Int32Array(this._heap), this._h8 = new Int8Array(this._heap), this._core = new s({ Int32Array }, {}, this._heap);
88
88
  }
89
89
  return e.prototype._initState = function(n, h) {
90
90
  this._offset = 0;
@@ -95,9 +95,9 @@ function F() {
95
95
  return i(w, n), r(w, n, h), a;
96
96
  }, e.prototype._write = function(n, h, a, w) {
97
97
  l(n, this._h8, this._h32, h, a, w || 0);
98
- }, e.prototype._coreCall = function(n, h, a, w, _) {
98
+ }, e.prototype._coreCall = function(n, h, a, w, m) {
99
99
  var C = a;
100
- this._write(n, h, a), _ && (C = this._padChunk(a, w)), this._core.hash(C, this._padMaxChunkLen);
100
+ this._write(n, h, a), m && (C = this._padChunk(a, w)), this._core.hash(C, this._padMaxChunkLen);
101
101
  }, e.prototype.rawDigest = function(n) {
102
102
  var h = n.byteLength || n.length || n.size || 0;
103
103
  this._initState(this._heap, this._padMaxChunkLen);
@@ -116,9 +116,9 @@ function F() {
116
116
  }, e.prototype.resetState = function() {
117
117
  return this._initState(this._heap, this._padMaxChunkLen), this;
118
118
  }, e.prototype.append = function(n) {
119
- var h = 0, a = n.byteLength || n.length || n.size || 0, w = this._offset % this._maxChunkLen, _ = void 0;
119
+ var h = 0, a = n.byteLength || n.length || n.size || 0, w = this._offset % this._maxChunkLen, m = void 0;
120
120
  for (this._offset += a; h < a; )
121
- _ = Math.min(a - h, this._maxChunkLen - w), this._write(n, h, _, w), w += _, h += _, w === this._maxChunkLen && (this._core.hash(this._maxChunkLen, this._padMaxChunkLen), w = 0);
121
+ m = Math.min(a - h, this._maxChunkLen - w), this._write(n, h, m, w), w += m, h += m, w === this._maxChunkLen && (this._core.hash(this._maxChunkLen, this._padMaxChunkLen), w = 0);
122
122
  return this;
123
123
  }, e.prototype.getState = function() {
124
124
  var n = this._offset % this._maxChunkLen, h = void 0;
@@ -148,43 +148,43 @@ function F() {
148
148
  return u(this.rawEnd().buffer);
149
149
  }, e;
150
150
  }();
151
- y.exports = f, y.exports._core = s;
151
+ x.exports = c, x.exports._core = s;
152
152
  },
153
153
  /* 1 */
154
154
  /***/
155
- function(y, b) {
155
+ function(x, b) {
156
156
  for (var p = new Array(256), v = 0; v < 256; v++)
157
157
  p[v] = (v < 16 ? "0" : "") + v.toString(16);
158
- y.exports.toHex = function(s) {
159
- for (var g = new Uint8Array(s), u = new Array(s.byteLength), c = 0; c < u.length; c++)
160
- u[c] = p[g[c]];
158
+ x.exports.toHex = function(s) {
159
+ for (var y = new Uint8Array(s), u = new Array(s.byteLength), f = 0; f < u.length; f++)
160
+ u[f] = p[y[f]];
161
161
  return u.join("");
162
- }, y.exports.ceilHeapSize = function(s) {
163
- var g = 0;
162
+ }, x.exports.ceilHeapSize = function(s) {
163
+ var y = 0;
164
164
  if (s <= 65536) return 65536;
165
165
  if (s < 16777216)
166
- for (g = 1; g < s; g = g << 1)
166
+ for (y = 1; y < s; y = y << 1)
167
167
  ;
168
168
  else
169
- for (g = 16777216; g < s; g += 16777216)
169
+ for (y = 16777216; y < s; y += 16777216)
170
170
  ;
171
- return g;
172
- }, y.exports.isDedicatedWorkerScope = function(s) {
173
- var g = "WorkerGlobalScope" in s && s instanceof s.WorkerGlobalScope, u = "SharedWorkerGlobalScope" in s && s instanceof s.SharedWorkerGlobalScope, c = "ServiceWorkerGlobalScope" in s && s instanceof s.ServiceWorkerGlobalScope;
174
- return g && !u && !c;
171
+ return y;
172
+ }, x.exports.isDedicatedWorkerScope = function(s) {
173
+ var y = "WorkerGlobalScope" in s && s instanceof s.WorkerGlobalScope, u = "SharedWorkerGlobalScope" in s && s instanceof s.SharedWorkerGlobalScope, f = "ServiceWorkerGlobalScope" in s && s instanceof s.ServiceWorkerGlobalScope;
174
+ return y && !u && !f;
175
175
  };
176
176
  },
177
177
  /* 2 */
178
178
  /***/
179
- function(y, b, p) {
180
- y.exports = function() {
181
- var v = p(0), s = function(c, l, d) {
179
+ function(x, b, p) {
180
+ x.exports = function() {
181
+ var v = p(0), s = function(f, l, d) {
182
182
  try {
183
- return d(null, c.digest(l));
183
+ return d(null, f.digest(l));
184
184
  } catch (i) {
185
185
  return d(i);
186
186
  }
187
- }, g = function(c, l, d, i, r) {
187
+ }, y = function(f, l, d, i, r) {
188
188
  var t = new self.FileReader();
189
189
  t.onloadend = function() {
190
190
  if (t.error)
@@ -192,24 +192,24 @@ function F() {
192
192
  var e = t.result;
193
193
  l += t.result.byteLength;
194
194
  try {
195
- c.append(e);
195
+ f.append(e);
196
196
  } catch (o) {
197
197
  r(o);
198
198
  return;
199
199
  }
200
- l < i.size ? g(c, l, d, i, r) : r(null, c.end());
200
+ l < i.size ? y(f, l, d, i, r) : r(null, f.end());
201
201
  }, t.readAsArrayBuffer(i.slice(l, l + d));
202
202
  }, u = !0;
203
- return self.onmessage = function(c) {
203
+ return self.onmessage = function(f) {
204
204
  if (u) {
205
- var l = c.data.data, d = c.data.file, i = c.data.id;
205
+ var l = f.data.data, d = f.data.file, i = f.data.id;
206
206
  if (!(typeof i > "u") && !(!d && !l)) {
207
- var r = c.data.blockSize || 4 * 1024 * 1024, t = new v(r);
207
+ var r = f.data.blockSize || 4 * 1024 * 1024, t = new v(r);
208
208
  t.resetState();
209
- var f = function(e, o) {
209
+ var c = function(e, o) {
210
210
  e ? self.postMessage({ id: i, error: e.name }) : self.postMessage({ id: i, hash: o });
211
211
  };
212
- l && s(t, l, f), d && g(t, 0, r, d, f);
212
+ l && s(t, l, c), d && y(t, 0, r, d, c);
213
213
  }
214
214
  }
215
215
  }, function() {
@@ -219,8 +219,8 @@ function F() {
219
219
  },
220
220
  /* 3 */
221
221
  /***/
222
- function(y, b, p) {
223
- var v = p(4), s = p(0), g = p(7), u = p(2), c = p(1), l = c.isDedicatedWorkerScope, d = typeof self < "u" && l(self);
222
+ function(x, b, p) {
223
+ var v = p(4), s = p(0), y = p(7), u = p(2), f = p(1), l = f.isDedicatedWorkerScope, d = typeof self < "u" && l(self);
224
224
  s.disableWorkerBehaviour = d ? u() : function() {
225
225
  }, s.createWorker = function() {
226
226
  var i = v(
@@ -230,11 +230,11 @@ function F() {
230
230
  return i.terminate = function() {
231
231
  URL.revokeObjectURL(i.objectURL), r.call(i);
232
232
  }, i;
233
- }, s.createHash = g, y.exports = s;
233
+ }, s.createHash = y, x.exports = s;
234
234
  },
235
235
  /* 4 */
236
236
  /***/
237
- function(y, b, p) {
237
+ function(x, b, p) {
238
238
  function v(i) {
239
239
  var r = {};
240
240
  function t(e) {
@@ -283,34 +283,34 @@ function F() {
283
283
  }, t.p = "/", t.oe = function(e) {
284
284
  throw console.error(e), e;
285
285
  };
286
- var f = t(t.s = ENTRY_MODULE);
287
- return f.default || f;
286
+ var c = t(t.s = ENTRY_MODULE);
287
+ return c.default || c;
288
288
  }
289
- var s = "[\\.|\\-|\\+|\\w|/|@]+", g = "\\((/\\*.*?\\*/)?s?.*?(" + s + ").*?\\)";
289
+ var s = "[\\.|\\-|\\+|\\w|/|@]+", y = "\\((/\\*.*?\\*/)?s?.*?(" + s + ").*?\\)";
290
290
  function u(i) {
291
291
  return (i + "").replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
292
292
  }
293
- function c(i, r, t) {
294
- var f = {};
295
- f[t] = [];
293
+ function f(i, r, t) {
294
+ var c = {};
295
+ c[t] = [];
296
296
  var e = r.toString(), o = e.match(/^function\s?\(\w+,\s*\w+,\s*(\w+)\)/);
297
- if (!o) return f;
298
- for (var n = o[1], h = new RegExp("(\\\\n|\\W)" + u(n) + g, "g"), a; a = h.exec(e); )
299
- a[3] !== "dll-reference" && f[t].push(a[3]);
300
- for (h = new RegExp("\\(" + u(n) + '\\("(dll-reference\\s(' + s + '))"\\)\\)' + g, "g"); a = h.exec(e); )
301
- i[a[2]] || (f[t].push(a[1]), i[a[2]] = p(a[1]).m), f[a[2]] = f[a[2]] || [], f[a[2]].push(a[4]);
302
- return f;
297
+ if (!o) return c;
298
+ for (var n = o[1], h = new RegExp("(\\\\n|\\W)" + u(n) + y, "g"), a; a = h.exec(e); )
299
+ a[3] !== "dll-reference" && c[t].push(a[3]);
300
+ for (h = new RegExp("\\(" + u(n) + '\\("(dll-reference\\s(' + s + '))"\\)\\)' + y, "g"); a = h.exec(e); )
301
+ i[a[2]] || (c[t].push(a[1]), i[a[2]] = p(a[1]).m), c[a[2]] = c[a[2]] || [], c[a[2]].push(a[4]);
302
+ return c;
303
303
  }
304
304
  function l(i) {
305
305
  var r = Object.keys(i);
306
- return r.reduce(function(t, f) {
307
- return t || i[f].length > 0;
306
+ return r.reduce(function(t, c) {
307
+ return t || i[c].length > 0;
308
308
  }, !1);
309
309
  }
310
310
  function d(i, r) {
311
311
  for (var t = {
312
312
  main: [r]
313
- }, f = {
313
+ }, c = {
314
314
  main: []
315
315
  }, e = {
316
316
  main: {}
@@ -318,28 +318,28 @@ function F() {
318
318
  for (var o = Object.keys(t), n = 0; n < o.length; n++) {
319
319
  var h = o[n], a = t[h], w = a.pop();
320
320
  if (e[h] = e[h] || {}, !(e[h][w] || !i[h][w])) {
321
- e[h][w] = !0, f[h] = f[h] || [], f[h].push(w);
322
- for (var _ = c(i, i[h][w], h), C = Object.keys(_), S = 0; S < C.length; S++)
323
- t[C[S]] = t[C[S]] || [], t[C[S]] = t[C[S]].concat(_[C[S]]);
321
+ e[h][w] = !0, c[h] = c[h] || [], c[h].push(w);
322
+ for (var m = f(i, i[h][w], h), C = Object.keys(m), S = 0; S < C.length; S++)
323
+ t[C[S]] = t[C[S]] || [], t[C[S]] = t[C[S]].concat(m[C[S]]);
324
324
  }
325
325
  }
326
- return f;
326
+ return c;
327
327
  }
328
- y.exports = function(i, r) {
328
+ x.exports = function(i, r) {
329
329
  r = r || {};
330
330
  var t = {
331
331
  main: p.m
332
- }, f = r.all ? { main: Object.keys(t) } : d(t, i), e = "";
333
- Object.keys(f).filter(function(w) {
332
+ }, c = r.all ? { main: Object.keys(t) } : d(t, i), e = "";
333
+ Object.keys(c).filter(function(w) {
334
334
  return w !== "main";
335
335
  }).forEach(function(w) {
336
- for (var _ = 0; f[w][_]; )
337
- _++;
338
- f[w].push(_), t[w][_] = "(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })", e = e + "var " + w + " = (" + v.toString().replace("ENTRY_MODULE", JSON.stringify(_)) + ")({" + f[w].map(function(C) {
336
+ for (var m = 0; c[w][m]; )
337
+ m++;
338
+ c[w].push(m), t[w][m] = "(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })", e = e + "var " + w + " = (" + v.toString().replace("ENTRY_MODULE", JSON.stringify(m)) + ")({" + c[w].map(function(C) {
339
339
  return "" + JSON.stringify(C) + ": " + t[w][C].toString();
340
340
  }).join(",") + `});
341
341
  `;
342
- }), e = e + "(" + v.toString().replace("ENTRY_MODULE", JSON.stringify(i)) + ")({" + f.main.map(function(w) {
342
+ }), e = e + "(" + v.toString().replace("ENTRY_MODULE", JSON.stringify(i)) + ")({" + c.main.map(function(w) {
343
343
  return "" + JSON.stringify(w) + ": " + t.main[w].toString();
344
344
  }).join(",") + "})(self);";
345
345
  var o = new window.Blob([e], { type: "text/javascript" });
@@ -351,85 +351,85 @@ function F() {
351
351
  },
352
352
  /* 5 */
353
353
  /***/
354
- function(y, b) {
355
- y.exports = function(v, s, g) {
356
- var u = new v.Int32Array(g);
357
- function c(l, d) {
354
+ function(x, b) {
355
+ x.exports = function(v, s, y) {
356
+ var u = new v.Int32Array(y);
357
+ function f(l, d) {
358
358
  l = l | 0, d = d | 0;
359
- var i = 0, r = 0, t = 0, f = 0, e = 0, o = 0, n = 0, h = 0, a = 0, w = 0, _ = 0, C = 0, S = 0, A = 0;
360
- for (t = u[d + 320 >> 2] | 0, e = u[d + 324 >> 2] | 0, n = u[d + 328 >> 2] | 0, a = u[d + 332 >> 2] | 0, _ = u[d + 336 >> 2] | 0, i = 0; (i | 0) < (l | 0); i = i + 64 | 0) {
361
- for (f = t, o = e, h = n, w = a, C = _, r = 0; (r | 0) < 64; r = r + 4 | 0)
362
- A = u[i + r >> 2] | 0, S = ((t << 5 | t >>> 27) + (e & n | ~e & a) | 0) + ((A + _ | 0) + 1518500249 | 0) | 0, _ = a, a = n, n = e << 30 | e >>> 2, e = t, t = S, u[l + r >> 2] = A;
359
+ var i = 0, r = 0, t = 0, c = 0, e = 0, o = 0, n = 0, h = 0, a = 0, w = 0, m = 0, C = 0, S = 0, A = 0;
360
+ for (t = u[d + 320 >> 2] | 0, e = u[d + 324 >> 2] | 0, n = u[d + 328 >> 2] | 0, a = u[d + 332 >> 2] | 0, m = u[d + 336 >> 2] | 0, i = 0; (i | 0) < (l | 0); i = i + 64 | 0) {
361
+ for (c = t, o = e, h = n, w = a, C = m, r = 0; (r | 0) < 64; r = r + 4 | 0)
362
+ A = u[i + r >> 2] | 0, S = ((t << 5 | t >>> 27) + (e & n | ~e & a) | 0) + ((A + m | 0) + 1518500249 | 0) | 0, m = a, a = n, n = e << 30 | e >>> 2, e = t, t = S, u[l + r >> 2] = A;
363
363
  for (r = l + 64 | 0; (r | 0) < (l + 80 | 0); r = r + 4 | 0)
364
- A = (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) << 1 | (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) >>> 31, S = ((t << 5 | t >>> 27) + (e & n | ~e & a) | 0) + ((A + _ | 0) + 1518500249 | 0) | 0, _ = a, a = n, n = e << 30 | e >>> 2, e = t, t = S, u[r >> 2] = A;
364
+ A = (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) << 1 | (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) >>> 31, S = ((t << 5 | t >>> 27) + (e & n | ~e & a) | 0) + ((A + m | 0) + 1518500249 | 0) | 0, m = a, a = n, n = e << 30 | e >>> 2, e = t, t = S, u[r >> 2] = A;
365
365
  for (r = l + 80 | 0; (r | 0) < (l + 160 | 0); r = r + 4 | 0)
366
- A = (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) << 1 | (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) >>> 31, S = ((t << 5 | t >>> 27) + (e ^ n ^ a) | 0) + ((A + _ | 0) + 1859775393 | 0) | 0, _ = a, a = n, n = e << 30 | e >>> 2, e = t, t = S, u[r >> 2] = A;
366
+ A = (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) << 1 | (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) >>> 31, S = ((t << 5 | t >>> 27) + (e ^ n ^ a) | 0) + ((A + m | 0) + 1859775393 | 0) | 0, m = a, a = n, n = e << 30 | e >>> 2, e = t, t = S, u[r >> 2] = A;
367
367
  for (r = l + 160 | 0; (r | 0) < (l + 240 | 0); r = r + 4 | 0)
368
- A = (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) << 1 | (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) >>> 31, S = ((t << 5 | t >>> 27) + (e & n | e & a | n & a) | 0) + ((A + _ | 0) - 1894007588 | 0) | 0, _ = a, a = n, n = e << 30 | e >>> 2, e = t, t = S, u[r >> 2] = A;
368
+ A = (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) << 1 | (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) >>> 31, S = ((t << 5 | t >>> 27) + (e & n | e & a | n & a) | 0) + ((A + m | 0) - 1894007588 | 0) | 0, m = a, a = n, n = e << 30 | e >>> 2, e = t, t = S, u[r >> 2] = A;
369
369
  for (r = l + 240 | 0; (r | 0) < (l + 320 | 0); r = r + 4 | 0)
370
- A = (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) << 1 | (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) >>> 31, S = ((t << 5 | t >>> 27) + (e ^ n ^ a) | 0) + ((A + _ | 0) - 899497514 | 0) | 0, _ = a, a = n, n = e << 30 | e >>> 2, e = t, t = S, u[r >> 2] = A;
371
- t = t + f | 0, e = e + o | 0, n = n + h | 0, a = a + w | 0, _ = _ + C | 0;
370
+ A = (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) << 1 | (u[r - 12 >> 2] ^ u[r - 32 >> 2] ^ u[r - 56 >> 2] ^ u[r - 64 >> 2]) >>> 31, S = ((t << 5 | t >>> 27) + (e ^ n ^ a) | 0) + ((A + m | 0) - 899497514 | 0) | 0, m = a, a = n, n = e << 30 | e >>> 2, e = t, t = S, u[r >> 2] = A;
371
+ t = t + c | 0, e = e + o | 0, n = n + h | 0, a = a + w | 0, m = m + C | 0;
372
372
  }
373
- u[d + 320 >> 2] = t, u[d + 324 >> 2] = e, u[d + 328 >> 2] = n, u[d + 332 >> 2] = a, u[d + 336 >> 2] = _;
373
+ u[d + 320 >> 2] = t, u[d + 324 >> 2] = e, u[d + 328 >> 2] = n, u[d + 332 >> 2] = a, u[d + 336 >> 2] = m;
374
374
  }
375
- return { hash: c };
375
+ return { hash: f };
376
376
  };
377
377
  },
378
378
  /* 6 */
379
379
  /***/
380
- function(y, b) {
380
+ function(x, b) {
381
381
  var p = this, v = void 0;
382
382
  typeof self < "u" && typeof self.FileReaderSync < "u" && (v = new self.FileReaderSync());
383
- var s = function(c, l, d, i, r, t) {
384
- var f = void 0, e = t % 4, o = (r + e) % 4, n = r - o;
383
+ var s = function(f, l, d, i, r, t) {
384
+ var c = void 0, e = t % 4, o = (r + e) % 4, n = r - o;
385
385
  switch (e) {
386
386
  case 0:
387
- l[t] = c.charCodeAt(i + 3);
387
+ l[t] = f.charCodeAt(i + 3);
388
388
  case 1:
389
- l[t + 1 - (e << 1) | 0] = c.charCodeAt(i + 2);
389
+ l[t + 1 - (e << 1) | 0] = f.charCodeAt(i + 2);
390
390
  case 2:
391
- l[t + 2 - (e << 1) | 0] = c.charCodeAt(i + 1);
391
+ l[t + 2 - (e << 1) | 0] = f.charCodeAt(i + 1);
392
392
  case 3:
393
- l[t + 3 - (e << 1) | 0] = c.charCodeAt(i);
393
+ l[t + 3 - (e << 1) | 0] = f.charCodeAt(i);
394
394
  }
395
395
  if (!(r < o + (4 - e))) {
396
- for (f = 4 - e; f < n; f = f + 4 | 0)
397
- d[t + f >> 2] = c.charCodeAt(i + f) << 24 | c.charCodeAt(i + f + 1) << 16 | c.charCodeAt(i + f + 2) << 8 | c.charCodeAt(i + f + 3);
396
+ for (c = 4 - e; c < n; c = c + 4 | 0)
397
+ d[t + c >> 2] = f.charCodeAt(i + c) << 24 | f.charCodeAt(i + c + 1) << 16 | f.charCodeAt(i + c + 2) << 8 | f.charCodeAt(i + c + 3);
398
398
  switch (o) {
399
399
  case 3:
400
- l[t + n + 1 | 0] = c.charCodeAt(i + n + 2);
400
+ l[t + n + 1 | 0] = f.charCodeAt(i + n + 2);
401
401
  case 2:
402
- l[t + n + 2 | 0] = c.charCodeAt(i + n + 1);
402
+ l[t + n + 2 | 0] = f.charCodeAt(i + n + 1);
403
403
  case 1:
404
- l[t + n + 3 | 0] = c.charCodeAt(i + n);
404
+ l[t + n + 3 | 0] = f.charCodeAt(i + n);
405
405
  }
406
406
  }
407
- }, g = function(c, l, d, i, r, t) {
408
- var f = void 0, e = t % 4, o = (r + e) % 4, n = r - o;
407
+ }, y = function(f, l, d, i, r, t) {
408
+ var c = void 0, e = t % 4, o = (r + e) % 4, n = r - o;
409
409
  switch (e) {
410
410
  case 0:
411
- l[t] = c[i + 3];
411
+ l[t] = f[i + 3];
412
412
  case 1:
413
- l[t + 1 - (e << 1) | 0] = c[i + 2];
413
+ l[t + 1 - (e << 1) | 0] = f[i + 2];
414
414
  case 2:
415
- l[t + 2 - (e << 1) | 0] = c[i + 1];
415
+ l[t + 2 - (e << 1) | 0] = f[i + 1];
416
416
  case 3:
417
- l[t + 3 - (e << 1) | 0] = c[i];
417
+ l[t + 3 - (e << 1) | 0] = f[i];
418
418
  }
419
419
  if (!(r < o + (4 - e))) {
420
- for (f = 4 - e; f < n; f = f + 4 | 0)
421
- d[t + f >> 2 | 0] = c[i + f] << 24 | c[i + f + 1] << 16 | c[i + f + 2] << 8 | c[i + f + 3];
420
+ for (c = 4 - e; c < n; c = c + 4 | 0)
421
+ d[t + c >> 2 | 0] = f[i + c] << 24 | f[i + c + 1] << 16 | f[i + c + 2] << 8 | f[i + c + 3];
422
422
  switch (o) {
423
423
  case 3:
424
- l[t + n + 1 | 0] = c[i + n + 2];
424
+ l[t + n + 1 | 0] = f[i + n + 2];
425
425
  case 2:
426
- l[t + n + 2 | 0] = c[i + n + 1];
426
+ l[t + n + 2 | 0] = f[i + n + 1];
427
427
  case 1:
428
- l[t + n + 3 | 0] = c[i + n];
428
+ l[t + n + 3 | 0] = f[i + n];
429
429
  }
430
430
  }
431
- }, u = function(c, l, d, i, r, t) {
432
- var f = void 0, e = t % 4, o = (r + e) % 4, n = r - o, h = new Uint8Array(v.readAsArrayBuffer(c.slice(i, i + r)));
431
+ }, u = function(f, l, d, i, r, t) {
432
+ var c = void 0, e = t % 4, o = (r + e) % 4, n = r - o, h = new Uint8Array(v.readAsArrayBuffer(f.slice(i, i + r)));
433
433
  switch (e) {
434
434
  case 0:
435
435
  l[t] = h[3];
@@ -441,8 +441,8 @@ function F() {
441
441
  l[t + 3 - (e << 1) | 0] = h[0];
442
442
  }
443
443
  if (!(r < o + (4 - e))) {
444
- for (f = 4 - e; f < n; f = f + 4 | 0)
445
- d[t + f >> 2 | 0] = h[f] << 24 | h[f + 1] << 16 | h[f + 2] << 8 | h[f + 3];
444
+ for (c = 4 - e; c < n; c = c + 4 | 0)
445
+ d[t + c >> 2 | 0] = h[c] << 24 | h[c + 1] << 16 | h[c + 2] << 8 | h[c + 3];
446
446
  switch (o) {
447
447
  case 3:
448
448
  l[t + n + 1 | 0] = h[n + 2];
@@ -453,28 +453,28 @@ function F() {
453
453
  }
454
454
  }
455
455
  };
456
- y.exports = function(c, l, d, i, r, t) {
457
- if (typeof c == "string")
458
- return s(c, l, d, i, r, t);
459
- if (c instanceof Array || p && p.Buffer && p.Buffer.isBuffer(c))
460
- return g(c, l, d, i, r, t);
461
- if (c instanceof ArrayBuffer)
462
- return g(new Uint8Array(c), l, d, i, r, t);
463
- if (c.buffer instanceof ArrayBuffer)
464
- return g(new Uint8Array(c.buffer, c.byteOffset, c.byteLength), l, d, i, r, t);
465
- if (c instanceof Blob)
466
- return u(c, l, d, i, r, t);
456
+ x.exports = function(f, l, d, i, r, t) {
457
+ if (typeof f == "string")
458
+ return s(f, l, d, i, r, t);
459
+ if (f instanceof Array || p && p.Buffer && p.Buffer.isBuffer(f))
460
+ return y(f, l, d, i, r, t);
461
+ if (f instanceof ArrayBuffer)
462
+ return y(new Uint8Array(f), l, d, i, r, t);
463
+ if (f.buffer instanceof ArrayBuffer)
464
+ return y(new Uint8Array(f.buffer, f.byteOffset, f.byteLength), l, d, i, r, t);
465
+ if (f instanceof Blob)
466
+ return u(f, l, d, i, r, t);
467
467
  throw new Error("Unsupported data type.");
468
468
  };
469
469
  },
470
470
  /* 7 */
471
471
  /***/
472
- function(y, b, p) {
472
+ function(x, b, p) {
473
473
  var v = /* @__PURE__ */ function() {
474
474
  function d(i, r) {
475
475
  for (var t = 0; t < r.length; t++) {
476
- var f = r[t];
477
- f.enumerable = f.enumerable || !1, f.configurable = !0, "value" in f && (f.writable = !0), Object.defineProperty(i, f.key, f);
476
+ var c = r[t];
477
+ c.enumerable = c.enumerable || !1, c.configurable = !0, "value" in c && (c.writable = !0), Object.defineProperty(i, c.key, c);
478
478
  }
479
479
  }
480
480
  return function(i, r, t) {
@@ -485,9 +485,9 @@ function F() {
485
485
  if (!(d instanceof i))
486
486
  throw new TypeError("Cannot call a class as a function");
487
487
  }
488
- var g = p(0), u = p(1), c = u.toHex, l = function() {
488
+ var y = p(0), u = p(1), f = u.toHex, l = function() {
489
489
  function d() {
490
- s(this, d), this._rusha = new g(), this._rusha.resetState();
490
+ s(this, d), this._rusha = new y(), this._rusha.resetState();
491
491
  }
492
492
  return d.prototype.update = function(r) {
493
493
  return this._rusha.append(r), this;
@@ -496,7 +496,7 @@ function F() {
496
496
  if (!r)
497
497
  return t;
498
498
  if (r === "hex")
499
- return c(t);
499
+ return f(t);
500
500
  throw new Error("unsupported digest encoding");
501
501
  }, v(d, [{
502
502
  key: "state",
@@ -508,7 +508,7 @@ function F() {
508
508
  }
509
509
  }]), d;
510
510
  }();
511
- y.exports = function() {
511
+ x.exports = function() {
512
512
  return new l();
513
513
  };
514
514
  }
@@ -518,102 +518,101 @@ function F() {
518
518
  });
519
519
  }(L)), L.exports;
520
520
  }
521
- var I = F();
522
- const z = /* @__PURE__ */ W(I), P = new z(), M = (x) => x.startsWith(".") || x === "__MACOSX" || x === "node_modules", R = (x) => x.startsWith("/") ? x : `/${x}`;
523
- function k(x, m, y) {
521
+ var P = z();
522
+ const G = /* @__PURE__ */ F(P), J = new G(), R = (g) => g.startsWith(".") || g === "__MACOSX" || g === "node_modules", $ = (g) => g.split("/").some((_) => _ && R(_)), k = (g) => g.startsWith("/") ? g : `/${g}`;
523
+ function O(g, _, x) {
524
524
  return {
525
- path: R(x),
526
- size: m.byteLength,
527
- sha: P.digest(m),
528
- content: m,
529
- name: y
525
+ path: k(g),
526
+ size: _.byteLength,
527
+ sha: J.digest(_),
528
+ content: _,
529
+ name: x
530
530
  };
531
531
  }
532
- async function D(x) {
533
- const m = await new Promise((b, p) => x.file(b, p)), y = await m.arrayBuffer();
534
- return k(x.fullPath, y, m.name);
532
+ async function D(g) {
533
+ const _ = await new Promise((b, p) => g.file(b, p)), x = await _.arrayBuffer();
534
+ return O(g.fullPath, x, _.name);
535
535
  }
536
- async function B(x) {
537
- const m = x.createReader(), y = [];
536
+ async function B(g) {
537
+ const _ = g.createReader(), x = [];
538
538
  for (; ; ) {
539
- const b = await new Promise((p, v) => m.readEntries(p, v));
539
+ const b = await new Promise((p, v) => _.readEntries(p, v));
540
540
  if (!b.length) break;
541
541
  for (const p of b)
542
- M(p.name) || y.push(...p.isDirectory ? await B(p) : [await D(p)]);
542
+ R(p.name) || x.push(...p.isDirectory ? await B(p) : [await D(p)]);
543
543
  }
544
- return y;
544
+ return x;
545
545
  }
546
- async function J(x) {
546
+ async function V(g) {
547
547
  var p;
548
- const m = (p = x.files) == null ? void 0 : p[0];
549
- if (x.files.length === 1 && m && /\.zip$/i.test(m.name))
550
- return U(m);
551
- const b = Array.from(x.items ?? []).map((v) => {
548
+ const _ = (p = g.files) == null ? void 0 : p[0];
549
+ if (g.files.length === 1 && _ && /\.zip$/i.test(_.name))
550
+ return U(_);
551
+ const b = Array.from(g.items ?? []).map((v) => {
552
552
  var s;
553
553
  return (s = v.webkitGetAsEntry) == null ? void 0 : s.call(v);
554
554
  }).filter(Boolean);
555
555
  if (b.length) {
556
556
  const v = await Promise.all(
557
557
  b.map(
558
- (s) => M(s.name) ? [] : s.isDirectory ? B(s) : D(s).then((g) => [g])
558
+ (s) => R(s.name) ? [] : s.isDirectory ? B(s) : D(s).then((y) => [y])
559
559
  )
560
560
  );
561
- return O(v.flat());
561
+ return E(v.flat());
562
562
  }
563
- return G(x.files);
563
+ return Y(g.files);
564
564
  }
565
- async function G(x) {
566
- const m = Array.from(x);
567
- if (m.length === 1 && /\.zip$/i.test(m[0].name))
568
- return U(m[0]);
569
- const y = [];
570
- for (const b of m) {
565
+ async function Y(g) {
566
+ const _ = Array.from(g);
567
+ if (_.length === 1 && /\.zip$/i.test(_[0].name))
568
+ return U(_[0]);
569
+ const x = [];
570
+ for (const b of _) {
571
571
  const p = b.webkitRelativePath || b.name;
572
- y.push(k(p, await b.arrayBuffer(), b.name));
572
+ x.push(O(p, await b.arrayBuffer(), b.name));
573
573
  }
574
- return O(y);
574
+ return E(x);
575
575
  }
576
- async function U(x) {
577
- const { unzip: m } = await import("../../../../chunks/browser.D58rdxmc.js"), y = new Uint8Array(await x.arrayBuffer()), b = await new Promise(
578
- (v, s) => m(y, (g, u) => g ? s(g) : v(u))
576
+ async function U(g) {
577
+ const { unzip: _ } = await import("../../../../chunks/browser.D58rdxmc.js"), x = new Uint8Array(await g.arrayBuffer()), b = await new Promise(
578
+ (v, s) => _(x, (y, u) => y ? s(y) : v(u))
579
579
  ), p = [];
580
580
  for (const [v, s] of Object.entries(b)) {
581
- if (v.endsWith("/") || /(^|\/)(__MACOSX\/|\.)/.test(v)) continue;
582
- const g = s.buffer.slice(
581
+ if (v.endsWith("/") || $(v)) continue;
582
+ const y = s.buffer.slice(
583
583
  s.byteOffset,
584
584
  s.byteOffset + s.byteLength
585
585
  );
586
- p.push(k(v, g, v.split("/").pop()));
586
+ p.push(O(v, y, v.split("/").pop()));
587
587
  }
588
- return O(p);
588
+ return E(p);
589
589
  }
590
- function O(x) {
591
- if (!x.length) return x;
592
- const m = (p) => R(p).split("/").slice(1);
593
- let y = m(x[0].path).slice(0, -1);
594
- for (const p of x) {
595
- const v = m(p.path);
590
+ function E(g) {
591
+ if (!g.length) return g;
592
+ const _ = (p) => k(p).split("/").slice(1);
593
+ let x = _(g[0].path).slice(0, -1);
594
+ for (const p of g) {
595
+ const v = _(p.path);
596
596
  let s = 0;
597
- for (; s < y.length && s < v.length - 1 && y[s] === v[s]; ) s++;
598
- y = y.slice(0, s);
597
+ for (; s < x.length && s < v.length - 1 && x[s] === v[s]; ) s++;
598
+ x = x.slice(0, s);
599
599
  }
600
- if (!y.length) return x;
601
- const b = "/" + y.join("/");
602
- return x.map((p) => ({ ...p, path: R(p.path.slice(b.length)) }));
600
+ if (!x.length) return g;
601
+ const b = "/" + x.join("/");
602
+ return g.map((p) => ({ ...p, path: k(p.path.slice(b.length)) }));
603
603
  }
604
- function Y(x) {
605
- const m = x.filter((y) => /\.html?$/i.test(y.name));
606
- return m.some((y) => /^index\.html?$/i.test(y.name)) ? null : m.length === 1 ? m[0].name : null;
604
+ const W = (g) => g.filter((_) => /\.html?$/i.test(_.name)), j = (g) => g.some((_) => /^index\.html?$/i.test(_.name));
605
+ function Z(g) {
606
+ const _ = W(g);
607
+ return j(_) ? null : _.length === 1 ? _[0].name : null;
607
608
  }
608
- function Q(x) {
609
- const m = x.filter((y) => /\.html?$/i.test(y.name));
610
- return m.length > 1 && !m.some((y) => /^index\.html?$/i.test(y.name));
609
+ function X(g) {
610
+ const _ = W(g);
611
+ return _.length > 1 && !j(_);
611
612
  }
612
613
  export {
613
- Y as getSingleNonIndexHtmlFileName,
614
- Q as hasMultipleHtmlFilesWithoutIndex,
615
- O as normalizeFiles,
616
- J as readDataTransfer,
617
- G as readFileList,
618
- U as readZip
614
+ Z as getSingleNonIndexHtmlFileName,
615
+ X as hasMultipleHtmlFilesWithoutIndex,
616
+ V as readDataTransfer,
617
+ Y as readFileList
619
618
  };
@@ -23,7 +23,6 @@ export interface DropResponse {
23
23
  subdomain: string;
24
24
  /** SHAs the backend does NOT yet have — only these get uploaded */
25
25
  required: string[];
26
- state?: string;
27
26
  }
28
27
  export interface DeployResult {
29
28
  deploy: DropResponse;
@@ -0,0 +1,3 @@
1
+ export { default as DropZone } from './DropZone';
2
+ export { AnonymousDropClient, deployFiles, readDataTransfer, readFileList, } from './drop-core';
3
+ export type { DropClient, DropResponse, Digest, DeployResult, DeployProgress, DeployPhase, ProcessedFile, } from './drop-core';
@@ -0,0 +1,11 @@
1
+ import { default as e } from "./DropZone.js";
2
+ import { readDataTransfer as a, readFileList as p } from "./drop-core/readFiles.js";
3
+ import { AnonymousDropClient as l } from "./drop-core/client.js";
4
+ import { deployFiles as n } from "./drop-core/deploy.js";
5
+ export {
6
+ l as AnonymousDropClient,
7
+ e as DropZone,
8
+ n as deployFiles,
9
+ a as readDataTransfer,
10
+ p as readFileList
11
+ };
@@ -1,7 +1,7 @@
1
- import { d as c, A as _ } from "../../../chunks/hooks.module.DRcxknIz.js";
2
- import { getSingleNonIndexHtmlFileName as x, hasMultipleHtmlFilesWithoutIndex as S } from "./drop-core/readFiles.js";
3
- import { AnonymousDropClient as b } from "./drop-core/client.js";
4
- import { deployFiles as I } from "./drop-core/deploy.js";
1
+ import { d as m, A as x } from "../../../chunks/hooks.module.DRcxknIz.js";
2
+ import { getSingleNonIndexHtmlFileName as S, hasMultipleHtmlFilesWithoutIndex as b } from "./drop-core/readFiles.js";
3
+ import { AnonymousDropClient as I } from "./drop-core/client.js";
4
+ import { deployFiles as z } from "./drop-core/deploy.js";
5
5
  function F(n) {
6
6
  switch (n.phase) {
7
7
  case "creating":
@@ -14,51 +14,54 @@ function F(n) {
14
14
  }
15
15
  }
16
16
  function H(n) {
17
- const i = x(n);
18
- return i ? `No index.html found — "${i}" won’t be served at the site root.` : S(n) ? "No index.html found — your site may not have a landing page." : null;
17
+ const i = S(n);
18
+ return i ? `No index.html found — "${i}" won’t be served at the site root.` : b(n) ? "No index.html found — your site may not have a landing page." : null;
19
19
  }
20
- function A({
20
+ function C({
21
21
  apiBase: n,
22
22
  client: i,
23
- claimUrl: m,
24
- onDeploy: r,
25
- track: u
23
+ claimUrl: g,
24
+ onDeploy: d,
25
+ track: s
26
26
  }) {
27
- const [d, t] = c({ kind: "idle" }), [g, s] = c(null), p = _(i ?? new b(n)).current, f = d.kind !== "idle" && d.kind !== "error";
28
- async function h(y, a) {
29
- s(null), t({ kind: "reading" });
27
+ const [a, t] = m({ kind: "idle" }), [f, l] = m(null), h = x(i ?? new I(n)).current, k = a.kind !== "idle" && a.kind !== "error";
28
+ async function y(w, r) {
29
+ l(null), t({ kind: "reading" });
30
+ const p = (e, u) => {
31
+ t({ kind: "error", message: e }), s("dropzone_deploy_failed", { method: r, reason: e, ...u });
32
+ };
30
33
  try {
31
- const e = await y();
34
+ const e = await w();
32
35
  if (!e.length) {
33
- t({ kind: "error", message: "No files found to deploy." });
36
+ p("No files found to deploy.", { file_count: 0 });
34
37
  return;
35
38
  }
36
- a === "drag" && u("dropzone_files_dropped", { method: a, file_count: e.length }), s(H(e));
39
+ r === "drag" && s("dropzone_files_dropped", { method: r, file_count: e.length }), l(H(e));
37
40
  const {
38
- url: w,
39
- token: l,
41
+ url: u,
42
+ token: c,
40
43
  deploy: o
41
- } = await I(p, e, {
44
+ } = await z(h, e, {
42
45
  onProgress: (N) => t(F(N))
43
46
  });
44
47
  try {
45
- localStorage.setItem("drop-token", l), localStorage.setItem("dropSiteName", o.subdomain);
48
+ localStorage.setItem("drop-token", c), localStorage.setItem("dropSiteName", o.subdomain);
46
49
  } catch {
47
50
  }
48
- t({ kind: "redirecting" }), u("dropzone_deploy_succeeded", {
49
- method: a,
51
+ t({ kind: "redirecting" }), s("dropzone_deploy_succeeded", {
52
+ method: r,
50
53
  site_name: o.subdomain,
51
54
  file_count: e.length
52
- }), r == null || r({ url: w, token: l, siteName: o.subdomain, siteId: o.id }), window.location.assign(`${m(o.subdomain)}#drop_token=${l}`);
55
+ }), d == null || d({ url: u, token: c, siteName: o.subdomain, siteId: o.id }), window.location.assign(`${g(o.subdomain)}#drop_token=${c}`);
53
56
  } catch (e) {
54
- t({ kind: "error", message: e instanceof Error ? e.message : String(e) });
57
+ p(e instanceof Error ? e.message : String(e));
55
58
  }
56
59
  }
57
- function k() {
58
- s(null), t({ kind: "idle" });
60
+ function _() {
61
+ l(null), t({ kind: "idle" });
59
62
  }
60
- return { status: d, warning: g, busy: f, deploy: h, reset: k };
63
+ return { status: a, warning: f, busy: k, deploy: y, reset: _ };
61
64
  }
62
65
  export {
63
- A as useDropDeploy
66
+ C as useDropDeploy
64
67
  };
@@ -6,4 +6,5 @@ export { default as SearchHeading } from './SearchModal/components/SearchHeading
6
6
  export { default as SearchToggle } from './SearchModal/components/SearchToggle/SearchToggle';
7
7
  export { default as AskNetlify } from './AskNetlify/AskNetlify';
8
8
  export { SearchModal } from './SearchModal';
9
+ export { DropZone } from './DropZone';
9
10
  export { type IconName } from './Icon';
@@ -1,20 +1,23 @@
1
- import { default as t } from "./KeyboardKey/KeyboardKey.js";
1
+ import { default as f } from "./KeyboardKey/KeyboardKey.js";
2
2
  import { default as d } from "./Modal/Modal.js";
3
3
  import { default as m } from "./Icon/index.js";
4
- import { default as s } from "./SearchModal/components/SearchLink/SearchLink.js";
5
- import { default as u } from "./SearchModal/components/SearchHeading/SearchHeading.js";
6
- import { default as i } from "./SearchModal/components/SearchToggle/SearchToggle.js";
4
+ import { default as x } from "./SearchModal/components/SearchLink/SearchLink.js";
5
+ import { default as i } from "./SearchModal/components/SearchHeading/SearchHeading.js";
6
+ import { default as h } from "./SearchModal/components/SearchToggle/SearchToggle.js";
7
7
  import { A as S } from "../../chunks/AskNetlify.bx0blyGV.js";
8
8
  import "preact";
9
9
  import "../../chunks/hooks.module.DRcxknIz.js";
10
- import { default as n } from "./SearchModal/components/SearchModal/SearchModal.js";
10
+ import { default as y } from "./SearchModal/components/SearchModal/SearchModal.js";
11
+ import { default as A } from "./DropZone/DropZone.js";
12
+ import "./DropZone/drop-core/readFiles.js";
11
13
  export {
12
14
  S as AskNetlify,
15
+ A as DropZone,
13
16
  m as Icon,
14
- t as KeyboardKey,
17
+ f as KeyboardKey,
15
18
  d as Modal,
16
- u as SearchHeading,
17
- s as SearchLink,
18
- n as SearchModal,
19
- i as SearchToggle
19
+ i as SearchHeading,
20
+ x as SearchLink,
21
+ y as SearchModal,
22
+ h as SearchToggle
20
23
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@netlify/spark-ui",
3
3
  "description": "Assets, design tokens, components, and utilities",
4
- "version": "1.26.1-alpha.2",
4
+ "version": "1.27.1",
5
5
  "type": "module",
6
6
  "main": "dist/components/preact/index.js",
7
7
  "types": "dist/components/preact/index.d.ts",
@@ -6,13 +6,13 @@ export { default as SearchLink } from './preact/SearchModal/components/SearchLin
6
6
  export { default as SearchHeading } from './preact/SearchModal/components/SearchHeading/SearchHeading';
7
7
  export { default as SearchToggle } from './preact/SearchModal/components/SearchToggle/SearchToggle';
8
8
  export { default as SearchModal } from './preact/SearchModal/components/SearchModal/SearchModal';
9
- export { default as DropZone } from './preact/DropZone/DropZone';
10
9
  export {
10
+ DropZone,
11
11
  AnonymousDropClient,
12
12
  deployFiles,
13
13
  readDataTransfer,
14
14
  readFileList,
15
- } from './preact/DropZone/drop-core';
15
+ } from './preact/DropZone';
16
16
  export type {
17
17
  DropClient,
18
18
  DropResponse,
@@ -21,5 +21,5 @@ export type {
21
21
  DeployProgress,
22
22
  DeployPhase,
23
23
  ProcessedFile,
24
- } from './preact/DropZone/drop-core';
24
+ } from './preact/DropZone';
25
25
  export { type IconName } from './preact/Icon';
@@ -36,6 +36,7 @@ interface Props {
36
36
  * - `dropzone_files_dropped` — files dropped via drag ({ method: 'drag', file_count })
37
37
  * - `dropzone_browse_opened` — file picker opened ({ method: 'keyboard' | 'click' })
38
38
  * - `dropzone_deploy_succeeded` — deploy went live ({ method, site_name, file_count })
39
+ * - `dropzone_deploy_failed` — deploy errored out ({ method, reason, file_count? })
39
40
  */
40
41
  onTrack?: TrackFn;
41
42
  /**
@@ -1,4 +1,4 @@
1
- import { getDigest, getShas } from './digest';
1
+ import { getDigest } from './digest';
2
2
  import type { DropClient } from './client';
3
3
  import type { DeployProgress, DeployResult, ProcessedFile } from './types';
4
4
 
@@ -43,7 +43,9 @@ export async function deployFiles(
43
43
 
44
44
  const total = deploy.required.length;
45
45
  onProgress?.({ phase: 'uploading', uploaded: 0, total });
46
- await uploadRequired(client, deploy.id, files, getShas(deploy.required), token, uploaded =>
46
+ // File PUTs and readiness polling both key off `deploy_id` (BSON), NOT
47
+ // `deploy.id` (the site UUID) — see the note in client.waitUntilReady.
48
+ await uploadRequired(client, deploy.deploy_id, files, new Set(deploy.required), token, uploaded =>
47
49
  onProgress?.({ phase: 'uploading', uploaded, total })
48
50
  );
49
51
 
@@ -5,7 +5,3 @@ export function getDigest(files: ProcessedFile[]): Digest {
5
5
  for (const f of files) digest[f.path] = f.sha;
6
6
  return digest;
7
7
  }
8
-
9
- export function getShas(required: string[]): Set<string> {
10
- return new Set(required);
11
- }
@@ -5,9 +5,13 @@ import type { ProcessedFile } from './types';
5
5
 
6
6
  const rusha = new Rusha();
7
7
 
8
- const IGNORED = (name: string) =>
8
+ /** A single path segment we never deploy: dotfiles, macOS metadata, deps. */
9
+ const isJunkName = (name: string) =>
9
10
  name.startsWith('.') || name === '__MACOSX' || name === 'node_modules';
10
11
 
12
+ /** True if any segment of the path is junk (e.g. "foo/__MACOSX/bar", ".git/x"). */
13
+ const isJunkPath = (path: string) => path.split('/').some(seg => seg && isJunkName(seg));
14
+
11
15
  const slashPrefix = (p: string) => (p.startsWith('/') ? p : `/${p}`);
12
16
 
13
17
  function toProcessedFile(path: string, content: ArrayBuffer, name: string): ProcessedFile {
@@ -36,7 +40,7 @@ async function readDirEntry(entry: any): Promise<ProcessedFile[]> {
36
40
  const batch: any[] = await new Promise((res, rej) => reader.readEntries(res, rej));
37
41
  if (!batch.length) break;
38
42
  for (const child of batch) {
39
- if (IGNORED(child.name)) continue;
43
+ if (isJunkName(child.name)) continue;
40
44
  out.push(...(child.isDirectory ? await readDirEntry(child) : [await readFileEntry(child)]));
41
45
  }
42
46
  }
@@ -62,7 +66,7 @@ export async function readDataTransfer(dt: DataTransfer): Promise<ProcessedFile[
62
66
  if (entries.length) {
63
67
  const nested = await Promise.all(
64
68
  entries.map(e =>
65
- IGNORED(e.name) ? [] : e.isDirectory ? readDirEntry(e) : readFileEntry(e).then(f => [f])
69
+ isJunkName(e.name) ? [] : e.isDirectory ? readDirEntry(e) : readFileEntry(e).then(f => [f])
66
70
  )
67
71
  );
68
72
  return normalizeFiles(nested.flat());
@@ -88,7 +92,7 @@ export async function readFileList(files: FileList): Promise<ProcessedFile[]> {
88
92
 
89
93
  // --- zip --------------------------------------------------------------------
90
94
 
91
- export async function readZip(zip: File): Promise<ProcessedFile[]> {
95
+ async function readZip(zip: File): Promise<ProcessedFile[]> {
92
96
  const { unzip } = await import('fflate');
93
97
  const buf = new Uint8Array(await zip.arrayBuffer());
94
98
  const entries = await new Promise<Record<string, Uint8Array>>((resolve, reject) =>
@@ -97,8 +101,8 @@ export async function readZip(zip: File): Promise<ProcessedFile[]> {
97
101
  const out: ProcessedFile[] = [];
98
102
  for (const [path, bytes] of Object.entries(entries)) {
99
103
  // fflate uses a trailing slash to signal directory entries; also skip the
100
- // usual junk (macOS metadata, dotfiles at any depth).
101
- if (path.endsWith('/') || /(^|\/)(__MACOSX\/|\.)/.test(path)) continue;
104
+ // usual junk (macOS metadata, dotfiles/deps at any depth).
105
+ if (path.endsWith('/') || isJunkPath(path)) continue;
102
106
  // `bytes.buffer` is ArrayBufferLike; fflate always backs entries with a plain
103
107
  // ArrayBuffer, so narrow it for toProcessedFile's ArrayBuffer parameter.
104
108
  const content = bytes.buffer.slice(
@@ -112,7 +116,7 @@ export async function readZip(zip: File): Promise<ProcessedFile[]> {
112
116
 
113
117
  // --- path normalization (strip the common root folder) ----------------------
114
118
 
115
- export function normalizeFiles(files: ProcessedFile[]): ProcessedFile[] {
119
+ function normalizeFiles(files: ProcessedFile[]): ProcessedFile[] {
116
120
  if (!files.length) return files;
117
121
  const split = (p: string) => slashPrefix(p).split('/').slice(1); // drop leading ''
118
122
  let common = split(files[0].path).slice(0, -1);
@@ -129,13 +133,16 @@ export function normalizeFiles(files: ProcessedFile[]): ProcessedFile[] {
129
133
 
130
134
  // --- index.html validation (UI can surface these as warnings) ---------------
131
135
 
136
+ const htmlFiles = (files: ProcessedFile[]) => files.filter(f => /\.html?$/i.test(f.name));
137
+ const hasIndex = (html: ProcessedFile[]) => html.some(f => /^index\.html?$/i.test(f.name));
138
+
132
139
  export function getSingleNonIndexHtmlFileName(files: ProcessedFile[]): string | null {
133
- const html = files.filter(f => /\.html?$/i.test(f.name));
134
- if (html.some(f => /^index\.html?$/i.test(f.name))) return null;
140
+ const html = htmlFiles(files);
141
+ if (hasIndex(html)) return null;
135
142
  return html.length === 1 ? html[0].name : null;
136
143
  }
137
144
 
138
145
  export function hasMultipleHtmlFilesWithoutIndex(files: ProcessedFile[]): boolean {
139
- const html = files.filter(f => /\.html?$/i.test(f.name));
140
- return html.length > 1 && !html.some(f => /^index\.html?$/i.test(f.name));
146
+ const html = htmlFiles(files);
147
+ return html.length > 1 && !hasIndex(html);
141
148
  }
@@ -25,7 +25,6 @@ export interface DropResponse {
25
25
  subdomain: string;
26
26
  /** SHAs the backend does NOT yet have — only these get uploaded */
27
27
  required: string[];
28
- state?: string;
29
28
  }
30
29
 
31
30
  export interface DeployResult {
@@ -0,0 +1,16 @@
1
+ export { default as DropZone } from './DropZone';
2
+ export {
3
+ AnonymousDropClient,
4
+ deployFiles,
5
+ readDataTransfer,
6
+ readFileList,
7
+ } from './drop-core';
8
+ export type {
9
+ DropClient,
10
+ DropResponse,
11
+ Digest,
12
+ DeployResult,
13
+ DeployProgress,
14
+ DeployPhase,
15
+ ProcessedFile,
16
+ } from './drop-core';
@@ -86,10 +86,21 @@ export function useDropDeploy({
86
86
  async function deploy(read: () => Promise<ProcessedFile[]>, source: DeploySource) {
87
87
  setWarning(null);
88
88
  setStatus({ kind: 'reading' });
89
+
90
+ // Surface a failure: move to the error state and emit the matching
91
+ // analytics event. Centralised so every failure path (empty selection, a
92
+ // read/deploy throw) reports uniformly — the mirror of the
93
+ // `dropzone_deploy_succeeded` event on the happy path. `file_count` is only
94
+ // included where the file set is known (it isn't if `read()` itself threw).
95
+ const fail = (message: string, extra?: Record<string, unknown>) => {
96
+ setStatus({ kind: 'error', message });
97
+ track('dropzone_deploy_failed', { method: source, reason: message, ...extra });
98
+ };
99
+
89
100
  try {
90
101
  const files = await read();
91
102
  if (!files.length) {
92
- setStatus({ kind: 'error', message: 'No files found to deploy.' });
103
+ fail('No files found to deploy.', { file_count: 0 });
93
104
  return;
94
105
  }
95
106
 
@@ -136,7 +147,7 @@ export function useDropDeploy({
136
147
  // `#drop_token=` and persists it for the claim + post-signup steps.
137
148
  window.location.assign(`${claimUrl(result.subdomain)}#drop_token=${token}`);
138
149
  } catch (err) {
139
- setStatus({ kind: 'error', message: err instanceof Error ? err.message : String(err) });
150
+ fail(err instanceof Error ? err.message : String(err));
140
151
  }
141
152
  }
142
153
 
@@ -6,5 +6,6 @@ export { default as SearchHeading } from './SearchModal/components/SearchHeading
6
6
  export { default as SearchToggle } from './SearchModal/components/SearchToggle/SearchToggle';
7
7
  export { default as AskNetlify } from './AskNetlify/AskNetlify';
8
8
  export { SearchModal } from './SearchModal';
9
+ export { DropZone } from './DropZone';
9
10
 
10
11
  export { type IconName } from './Icon';