opfs-worker 1.3.0 → 1.3.2

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.cjs CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("comlink"),e=require("./helpers-CF7A2WQG.cjs"),l=`/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("comlink"),e=require("./helpers-Dwc92hv9.cjs"),l=`/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- const bt = Symbol("Comlink.proxy"), Ht = Symbol("Comlink.endpoint"), Wt = Symbol("Comlink.releaseProxy"), J = Symbol("Comlink.finalizer"), U = Symbol("Comlink.thrown"), Ot = (s) => typeof s == "object" && s !== null || typeof s == "function", _t = {
6
+ const bt = Symbol("Comlink.proxy"), Ht = Symbol("Comlink.endpoint"), Wt = Symbol("Comlink.releaseProxy"), X = Symbol("Comlink.finalizer"), _ = Symbol("Comlink.thrown"), Ot = (s) => typeof s == "object" && s !== null || typeof s == "function", jt = {
7
7
  canHandle: (s) => Ot(s) && s[bt],
8
8
  serialize(s) {
9
9
  const { port1: t, port2: e } = new MessageChannel();
@@ -12,8 +12,8 @@ const bt = Symbol("Comlink.proxy"), Ht = Symbol("Comlink.endpoint"), Wt = Symbol
12
12
  deserialize(s) {
13
13
  return s.start(), Gt(s);
14
14
  }
15
- }, jt = {
16
- canHandle: (s) => Ot(s) && U in s,
15
+ }, _t = {
16
+ canHandle: (s) => Ot(s) && _ in s,
17
17
  serialize({ value: s }) {
18
18
  let t;
19
19
  return s instanceof Error ? t = {
@@ -29,8 +29,8 @@ const bt = Symbol("Comlink.proxy"), Ht = Symbol("Comlink.endpoint"), Wt = Symbol
29
29
  throw s.isError ? Object.assign(new Error(s.value.message), s.value) : s.value;
30
30
  }
31
31
  }, Dt = /* @__PURE__ */ new Map([
32
- ["proxy", _t],
33
- ["throw", jt]
32
+ ["proxy", jt],
33
+ ["throw", _t]
34
34
  ]);
35
35
  function Ut(s, t) {
36
36
  for (const e of s)
@@ -69,7 +69,7 @@ function ot(s, t = globalThis, e = ["*"]) {
69
69
  case "ENDPOINT":
70
70
  {
71
71
  const { port1: u, port2: d } = new MessageChannel();
72
- ot(s, d), h = B(u, [u]);
72
+ ot(s, d), h = U(u, [u]);
73
73
  }
74
74
  break;
75
75
  case "RELEASE":
@@ -79,15 +79,15 @@ function ot(s, t = globalThis, e = ["*"]) {
79
79
  return;
80
80
  }
81
81
  } catch (c) {
82
- h = { value: c, [U]: 0 };
82
+ h = { value: c, [_]: 0 };
83
83
  }
84
- Promise.resolve(h).catch((c) => ({ value: c, [U]: 0 })).then((c) => {
85
- const [f, u] = Y(c);
86
- t.postMessage(Object.assign(Object.assign({}, f), { id: i }), u), o === "RELEASE" && (t.removeEventListener("message", n), vt(t), J in s && typeof s[J] == "function" && s[J]());
84
+ Promise.resolve(h).catch((c) => ({ value: c, [_]: 0 })).then((c) => {
85
+ const [f, u] = V(c);
86
+ t.postMessage(Object.assign(Object.assign({}, f), { id: i }), u), o === "RELEASE" && (t.removeEventListener("message", n), vt(t), X in s && typeof s[X] == "function" && s[X]());
87
87
  }).catch((c) => {
88
- const [f, u] = Y({
88
+ const [f, u] = V({
89
89
  value: new TypeError("Unserializable return value"),
90
- [U]: 0
90
+ [_]: 0
91
91
  });
92
92
  t.postMessage(Object.assign(Object.assign({}, f), { id: i }), u);
93
93
  });
@@ -112,79 +112,79 @@ function Gt(s, t) {
112
112
  } finally {
113
113
  e.delete(i.id);
114
114
  }
115
- }), nt(s, e, [], t);
115
+ }), st(s, e, [], t);
116
116
  }
117
- function W(s) {
117
+ function H(s) {
118
118
  if (s)
119
119
  throw new Error("Proxy has been released and is not useable");
120
120
  }
121
121
  function At(s) {
122
- return $(s, /* @__PURE__ */ new Map(), {
122
+ return F(s, /* @__PURE__ */ new Map(), {
123
123
  type: "RELEASE"
124
124
  }).then(() => {
125
125
  vt(s);
126
126
  });
127
127
  }
128
- const q = /* @__PURE__ */ new WeakMap(), V = "FinalizationRegistry" in globalThis && new FinalizationRegistry((s) => {
129
- const t = (q.get(s) || 0) - 1;
130
- q.set(s, t), t === 0 && At(s);
128
+ const G = /* @__PURE__ */ new WeakMap(), q = "FinalizationRegistry" in globalThis && new FinalizationRegistry((s) => {
129
+ const t = (G.get(s) || 0) - 1;
130
+ G.set(s, t), t === 0 && At(s);
131
131
  });
132
132
  function qt(s, t) {
133
- const e = (q.get(t) || 0) + 1;
134
- q.set(t, e), V && V.register(s, t, s);
133
+ const e = (G.get(t) || 0) + 1;
134
+ G.set(t, e), q && q.register(s, t, s);
135
135
  }
136
136
  function Vt(s) {
137
- V && V.unregister(s);
137
+ q && q.unregister(s);
138
138
  }
139
- function nt(s, t, e = [], n = function() {
139
+ function st(s, t, e = [], n = function() {
140
140
  }) {
141
141
  let r = !1;
142
142
  const i = new Proxy(n, {
143
143
  get(o, a) {
144
- if (W(r), a === Wt)
144
+ if (H(r), a === Wt)
145
145
  return () => {
146
146
  Vt(i), At(s), t.clear(), r = !0;
147
147
  };
148
148
  if (a === "then") {
149
149
  if (e.length === 0)
150
150
  return { then: () => i };
151
- const l = $(s, t, {
151
+ const l = F(s, t, {
152
152
  type: "GET",
153
153
  path: e.map((h) => h.toString())
154
154
  }).then(C);
155
155
  return l.then.bind(l);
156
156
  }
157
- return nt(s, t, [...e, a]);
157
+ return st(s, t, [...e, a]);
158
158
  },
159
159
  set(o, a, l) {
160
- W(r);
161
- const [h, c] = Y(l);
162
- return $(s, t, {
160
+ H(r);
161
+ const [h, c] = V(l);
162
+ return F(s, t, {
163
163
  type: "SET",
164
164
  path: [...e, a].map((f) => f.toString()),
165
165
  value: h
166
166
  }, c).then(C);
167
167
  },
168
168
  apply(o, a, l) {
169
- W(r);
169
+ H(r);
170
170
  const h = e[e.length - 1];
171
171
  if (h === Ht)
172
- return $(s, t, {
172
+ return F(s, t, {
173
173
  type: "ENDPOINT"
174
174
  }).then(C);
175
175
  if (h === "bind")
176
- return nt(s, t, e.slice(0, -1));
176
+ return st(s, t, e.slice(0, -1));
177
177
  const [c, f] = ht(l);
178
- return $(s, t, {
178
+ return F(s, t, {
179
179
  type: "APPLY",
180
180
  path: e.map((u) => u.toString()),
181
181
  argumentList: c
182
182
  }, f).then(C);
183
183
  },
184
184
  construct(o, a) {
185
- W(r);
185
+ H(r);
186
186
  const [l, h] = ht(a);
187
- return $(s, t, {
187
+ return F(s, t, {
188
188
  type: "CONSTRUCT",
189
189
  path: e.map((c) => c.toString()),
190
190
  argumentList: l
@@ -197,17 +197,17 @@ function Yt(s) {
197
197
  return Array.prototype.concat.apply([], s);
198
198
  }
199
199
  function ht(s) {
200
- const t = s.map(Y);
200
+ const t = s.map(V);
201
201
  return [t.map((e) => e[0]), Yt(t.map((e) => e[1]))];
202
202
  }
203
203
  const Nt = /* @__PURE__ */ new WeakMap();
204
- function B(s, t) {
204
+ function U(s, t) {
205
205
  return Nt.set(s, t), s;
206
206
  }
207
207
  function Zt(s) {
208
208
  return Object.assign(s, { [bt]: !0 });
209
209
  }
210
- function Y(s) {
210
+ function V(s) {
211
211
  for (const [t, e] of Dt)
212
212
  if (e.canHandle(s)) {
213
213
  const [n, r] = e.serialize(s);
@@ -236,7 +236,7 @@ function C(s) {
236
236
  return s.value;
237
237
  }
238
238
  }
239
- function $(s, t, e, n) {
239
+ function F(s, t, e, n) {
240
240
  return new Promise((r) => {
241
241
  const i = Xt();
242
242
  t.set(i, r), s.start && s.start(), s.postMessage(Object.assign({ id: i }, e), n);
@@ -288,7 +288,7 @@ class w extends Error {
288
288
  }
289
289
  class Qt extends w {
290
290
  constructor(t) {
291
- super("OPFS is not supported in this browser", "OPFS_NOT_SUPPORTED", void 0, void 0, t);
291
+ super("OPFS is not supported in this browser", "ENOTSUP", void 0, void 0, t);
292
292
  }
293
293
  }
294
294
  class Kt extends w {
@@ -296,7 +296,7 @@ class Kt extends w {
296
296
  super(t, "INVALID_PATH", e, "access", n);
297
297
  }
298
298
  }
299
- class F extends w {
299
+ class R extends w {
300
300
  constructor(t, e, n) {
301
301
  const r = {
302
302
  file: \`File not found: \${e}\`,
@@ -308,7 +308,7 @@ class F extends w {
308
308
  }
309
309
  class te extends w {
310
310
  constructor(t, e, n) {
311
- super(\`Permission denied for \${e} on: \${t}\`, "PERMISSION_DENIED", t, e, n);
311
+ super(\`Permission denied for \${e} on: \${t}\`, "EACCES", t, e, n);
312
312
  }
313
313
  }
314
314
  class ee extends w {
@@ -321,10 +321,10 @@ class se extends w {
321
321
  super(\`File is busy: \${t}\`, "EBUSY", t, "open", e);
322
322
  }
323
323
  }
324
- class L extends w {
325
- constructor(t, e, n, r) {
326
- const i = e === "directory" ? \`Is a directory: \${n}\` : \`Not a directory: \${n}\`, o = e === "directory" ? "EISDIR" : "ENOTDIR";
327
- super(i, o, n, "access", r);
324
+ class nt extends w {
325
+ constructor(t, e, n) {
326
+ const r = t === "directory" ? \`Is a directory: \${e}\` : \`Not a directory: \${e}\`, i = t === "directory" ? "EISDIR" : "ENOTDIR";
327
+ super(r, i, e, "access", n);
328
328
  }
329
329
  }
330
330
  class N extends w {
@@ -356,15 +356,11 @@ class Ct extends w {
356
356
  class rt extends w {
357
357
  constructor(t, e, n) {
358
358
  const r = {
359
- remove: \`Failed to remove entry: \${e}\`,
360
- clear: \`Directory not empty: \${e}. Use recursive option to force removal.\`,
361
- root: "Cannot remove root directory"
362
- }, i = {
363
- remove: "RM_FAILED",
364
- clear: "ENOTEMPTY",
365
- root: "EROOT"
359
+ RM_FAILED: \`Failed to remove entry: \${e}\`,
360
+ ENOTEMPTY: \`Directory not empty: \${e}. Use recursive option to force removal.\`,
361
+ EROOT: "Cannot remove root directory"
366
362
  };
367
- super(r[t], i[t], e, "unlink", n);
363
+ super(r[t] || \`Directory operation failed: \${e}\`, t, e, "unlink", n);
368
364
  }
369
365
  }
370
366
  class re extends w {
@@ -372,36 +368,36 @@ class re extends w {
372
368
  super("Failed to initialize OPFS", "INIT_FAILED", t, "init", e);
373
369
  }
374
370
  }
375
- class Q extends w {
371
+ class J extends w {
376
372
  constructor(t, e, n) {
377
373
  super(\`Failed to \${t}: \${e}\`, \`\${t.toUpperCase()}_FAILED\`, e, t, n);
378
374
  }
379
375
  }
380
- class K extends w {
376
+ class Q extends w {
381
377
  constructor(t, e) {
382
378
  super(\`Destination already exists: \${t}\`, "EEXIST", t, "open", e);
383
379
  }
384
380
  }
385
- function _(s, t, e, n) {
381
+ function W(s, t, e, n) {
386
382
  const r = \`\${s.toUpperCase()}_FAILED\`;
387
383
  return new w(\`Failed to \${s} file descriptor: \${t}\`, r, e, s, n);
388
384
  }
389
- function A(s, t) {
390
- const e = t?.path, n = t?.isDirectory;
385
+ function v(s, t) {
386
+ const e = t?.path, n = t?.isDirectory, r = t?.existenceType ?? "file", i = t?.operation;
391
387
  switch (s.name) {
392
388
  case "InvalidStateError":
393
389
  return new se(e || "unknown", s);
394
390
  case "QuotaExceededError":
395
391
  return new ee(\`No space left on device: \${e || "unknown"}\`, e, s);
396
392
  case "NotFoundError":
397
- return new F("file", e, s);
393
+ return new R(r, e, s);
398
394
  case "TypeMismatchError":
399
- return n !== void 0 ? n ? new L("file", "directory", e || "unknown", s) : new L("directory", "file", e || "unknown", s) : new N("argument", \`Type mismatch: \${e || "unknown"}\`, e, s);
395
+ return n !== void 0 ? n ? new nt("directory", e || "unknown", s) : new nt("file", e || "unknown", s) : new N("argument", \`Type mismatch: \${e || "unknown"}\`, e, s);
400
396
  case "NotAllowedError":
401
397
  case "SecurityError":
402
398
  return new te(e, "unknown", s);
403
399
  case "InvalidModificationError":
404
- return new N("argument", \`Invalid modification: \${e || "unknown"}\`, e, s);
400
+ return i === "remove" ? new rt("ENOTEMPTY", e, s) : new N("argument", \`Invalid modification: \${e || "unknown"}\`, e, s);
405
401
  case "AbortError":
406
402
  return new ne(e || "unknown", s);
407
403
  case "OperationError":
@@ -409,7 +405,7 @@ function A(s, t) {
409
405
  case "TypeError":
410
406
  return new Ct(e || "unknown", s);
411
407
  default:
412
- return new ut(\`I/O error: \${e || "unknown"}\`, e, s);
408
+ return i === "remove" ? new rt("RM_FAILED", e, s) : new ut(\`I/O error: \${e || "unknown"}\`, e, s);
413
409
  }
414
410
  }
415
411
  const Ft = (s, t, e) => {
@@ -442,12 +438,12 @@ const Ft = (s, t, e) => {
442
438
  n.length && o !== void 0 && (a = [i, o]);
443
439
  }
444
440
  return a;
445
- }, $t = "\\0SLASH" + Math.random() + "\\0", Mt = "\\0OPEN" + Math.random() + "\\0", at = "\\0CLOSE" + Math.random() + "\\0", Pt = "\\0COMMA" + Math.random() + "\\0", Tt = "\\0PERIOD" + Math.random() + "\\0", oe = new RegExp($t, "g"), ae = new RegExp(Mt, "g"), ce = new RegExp(at, "g"), le = new RegExp(Pt, "g"), he = new RegExp(Tt, "g"), ue = /\\\\\\\\/g, fe = /\\\\{/g, de = /\\\\}/g, pe = /\\\\,/g, ge = /\\\\./g;
446
- function tt(s) {
441
+ }, $t = "\\0SLASH" + Math.random() + "\\0", Mt = "\\0OPEN" + Math.random() + "\\0", at = "\\0CLOSE" + Math.random() + "\\0", Tt = "\\0COMMA" + Math.random() + "\\0", Pt = "\\0PERIOD" + Math.random() + "\\0", oe = new RegExp($t, "g"), ae = new RegExp(Mt, "g"), ce = new RegExp(at, "g"), le = new RegExp(Tt, "g"), he = new RegExp(Pt, "g"), ue = /\\\\\\\\/g, fe = /\\\\{/g, de = /\\\\}/g, pe = /\\\\,/g, ge = /\\\\./g;
442
+ function K(s) {
447
443
  return isNaN(s) ? s.charCodeAt(0) : parseInt(s, 10);
448
444
  }
449
445
  function we(s) {
450
- return s.replace(ue, $t).replace(fe, Mt).replace(de, at).replace(pe, Pt).replace(ge, Tt);
446
+ return s.replace(ue, $t).replace(fe, Mt).replace(de, at).replace(pe, Tt).replace(ge, Pt);
451
447
  }
452
448
  function me(s) {
453
449
  return s.replace(oe, "\\\\").replace(ae, "{").replace(ce, "}").replace(le, ",").replace(he, ".");
@@ -464,7 +460,7 @@ function Rt(s) {
464
460
  return i.length && (o[o.length - 1] += a.shift(), o.push.apply(o, a)), t.push.apply(t, o), t;
465
461
  }
466
462
  function ye(s) {
467
- return s ? (s.slice(0, 2) === "{}" && (s = "\\\\{\\\\}" + s.slice(2)), I(we(s), !0).map(me)) : [];
463
+ return s ? (s.slice(0, 2) === "{}" && (s = "\\\\{\\\\}" + s.slice(2)), k(we(s), !0).map(me)) : [];
468
464
  }
469
465
  function Ee(s) {
470
466
  return "{" + s + "}";
@@ -478,11 +474,11 @@ function xe(s, t) {
478
474
  function be(s, t) {
479
475
  return s >= t;
480
476
  }
481
- function I(s, t) {
477
+ function k(s, t) {
482
478
  const e = [], n = Ft("{", "}", s);
483
479
  if (!n)
484
480
  return [s];
485
- const r = n.pre, i = n.post.length ? I(n.post, !1) : [""];
481
+ const r = n.pre, i = n.post.length ? k(n.post, !1) : [""];
486
482
  if (/\\$$/.test(n.pre))
487
483
  for (let o = 0; o < i.length; o++) {
488
484
  const a = r + "{" + n.body + "}" + i[o];
@@ -491,28 +487,28 @@ function I(s, t) {
491
487
  else {
492
488
  const o = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(n.body), a = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(n.body), l = o || a, h = n.body.indexOf(",") >= 0;
493
489
  if (!l && !h)
494
- return n.post.match(/,(?!,).*\\}/) ? (s = n.pre + "{" + n.body + at + n.post, I(s)) : [s];
490
+ return n.post.match(/,(?!,).*\\}/) ? (s = n.pre + "{" + n.body + at + n.post, k(s)) : [s];
495
491
  let c;
496
492
  if (l)
497
493
  c = n.body.split(/\\.\\./);
498
- else if (c = Rt(n.body), c.length === 1 && c[0] !== void 0 && (c = I(c[0], !1).map(Ee), c.length === 1))
494
+ else if (c = Rt(n.body), c.length === 1 && c[0] !== void 0 && (c = k(c[0], !1).map(Ee), c.length === 1))
499
495
  return i.map((u) => n.pre + c[0] + u);
500
496
  let f;
501
497
  if (l && c[0] !== void 0 && c[1] !== void 0) {
502
- const u = tt(c[0]), d = tt(c[1]), g = Math.max(c[0].length, c[1].length);
503
- let p = c.length === 3 && c[2] !== void 0 ? Math.abs(tt(c[2])) : 1, S = xe;
498
+ const u = K(c[0]), d = K(c[1]), g = Math.max(c[0].length, c[1].length);
499
+ let p = c.length === 3 && c[2] !== void 0 ? Math.abs(K(c[2])) : 1, S = xe;
504
500
  d < u && (p *= -1, S = be);
505
- const P = c.some(Se);
501
+ const M = c.some(Se);
506
502
  f = [];
507
503
  for (let x = u; S(x, d); x += p) {
508
504
  let m;
509
505
  if (a)
510
506
  m = String.fromCharCode(x), m === "\\\\" && (m = "");
511
- else if (m = String(x), P) {
507
+ else if (m = String(x), M) {
512
508
  const T = g - m.length;
513
509
  if (T > 0) {
514
- const H = new Array(T + 1).join("0");
515
- x < 0 ? m = "-" + H + m.slice(1) : m = H + m;
510
+ const z = new Array(T + 1).join("0");
511
+ x < 0 ? m = "-" + z + m.slice(1) : m = z + m;
516
512
  }
517
513
  }
518
514
  f.push(m);
@@ -520,7 +516,7 @@ function I(s, t) {
520
516
  } else {
521
517
  f = [];
522
518
  for (let u = 0; u < c.length; u++)
523
- f.push.apply(f, I(c[u], !1));
519
+ f.push.apply(f, k(c[u], !1));
524
520
  }
525
521
  for (let u = 0; u < f.length; u++)
526
522
  for (let d = 0; d < i.length; d++) {
@@ -530,7 +526,7 @@ function I(s, t) {
530
526
  }
531
527
  return e;
532
528
  }
533
- const Oe = 1024 * 64, Z = (s) => {
529
+ const Oe = 1024 * 64, Y = (s) => {
534
530
  if (typeof s != "string")
535
531
  throw new TypeError("invalid pattern");
536
532
  if (s.length > Oe)
@@ -550,7 +546,7 @@ const Oe = 1024 * 64, Z = (s) => {
550
546
  "[:upper:]": ["\\\\p{Lu}", !0],
551
547
  "[:word:]": ["\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}", !0],
552
548
  "[:xdigit:]": ["A-Fa-f0-9", !1]
553
- }, R = (s) => s.replace(/[[\\]\\\\-]/g, "\\\\$&"), ve = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, "\\\\$&"), dt = (s) => s.join(""), Ae = (s, t) => {
549
+ }, P = (s) => s.replace(/[[\\]\\\\-]/g, "\\\\$&"), ve = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, "\\\\$&"), dt = (s) => s.join(""), Ae = (s, t) => {
554
550
  const e = t;
555
551
  if (s.charAt(e) !== "[")
556
552
  throw new Error("not in a brace expression");
@@ -571,27 +567,27 @@ const Oe = 1024 * 64, Z = (s) => {
571
567
  continue;
572
568
  }
573
569
  if (p === "[" && !l) {
574
- for (const [S, [v, P, x]] of Object.entries(De))
570
+ for (const [S, [A, M, x]] of Object.entries(De))
575
571
  if (s.startsWith(S, i)) {
576
572
  if (f)
577
573
  return ["$.", !1, s.length - e, !0];
578
- i += S.length, x ? r.push(v) : n.push(v), a = a || P;
574
+ i += S.length, x ? r.push(A) : n.push(A), a = a || M;
579
575
  continue t;
580
576
  }
581
577
  }
582
578
  if (l = !1, f) {
583
- p > f ? n.push(R(f) + "-" + R(p)) : p === f && n.push(R(p)), f = "", i++;
579
+ p > f ? n.push(P(f) + "-" + P(p)) : p === f && n.push(P(p)), f = "", i++;
584
580
  continue;
585
581
  }
586
582
  if (s.startsWith("-]", i + 1)) {
587
- n.push(R(p + "-")), i += 2;
583
+ n.push(P(p + "-")), i += 2;
588
584
  continue;
589
585
  }
590
586
  if (s.startsWith("-", i + 1)) {
591
587
  f = p, i += 2;
592
588
  continue;
593
589
  }
594
- n.push(R(p)), i++;
590
+ n.push(P(p)), i++;
595
591
  }
596
592
  if (c < i)
597
593
  return ["", !1, 0, !1];
@@ -603,7 +599,7 @@ const Oe = 1024 * 64, Z = (s) => {
603
599
  }
604
600
  const u = "[" + (h ? "^" : "") + dt(n) + "]", d = "[" + (h ? "" : "^") + dt(r) + "]";
605
601
  return [n.length && r.length ? "(" + u + "|" + d + ")" : n.length ? u : d, a, c - e, !0];
606
- }, k = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/\\[([^\\/\\\\])\\]/g, "$1") : s.replace(/((?!\\\\).|^)\\[([^\\/\\\\])\\]/g, "$1$2").replace(/\\\\([^\\/])/g, "$1"), Ne = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), pt = (s) => Ne.has(s), Ce = "(?!(?:^|/)\\\\.\\\\.?(?:$|/))", j = "(?!\\\\.)", Fe = /* @__PURE__ */ new Set(["[", "."]), $e = /* @__PURE__ */ new Set(["..", "."]), Me = new Set("().*{}+?[]^$\\\\!"), Pe = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, "\\\\$&"), ct = "[^/]", gt = ct + "*?", wt = ct + "+?";
602
+ }, I = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/\\[([^\\/\\\\])\\]/g, "$1") : s.replace(/((?!\\\\).|^)\\[([^\\/\\\\])\\]/g, "$1$2").replace(/\\\\([^\\/])/g, "$1"), Ne = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), pt = (s) => Ne.has(s), Ce = "(?!(?:^|/)\\\\.\\\\.?(?:$|/))", j = "(?!\\\\.)", Fe = /* @__PURE__ */ new Set(["[", "."]), $e = /* @__PURE__ */ new Set(["..", "."]), Me = new Set("().*{}+?[]^$\\\\!"), Te = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, "\\\\$&"), ct = "[^/]", gt = ct + "*?", wt = ct + "+?";
607
603
  class E {
608
604
  type;
609
605
  #s;
@@ -856,8 +852,8 @@ class E {
856
852
  const e = t ?? !!this.#r.dot;
857
853
  if (this.#s === this && this.#d(), !this.type) {
858
854
  const l = this.isStart() && this.isEnd(), h = this.#t.map((d) => {
859
- const [g, p, S, v] = typeof d == "string" ? E.#p(d, this.#n, l) : d.toRegExpSource(t);
860
- return this.#n = this.#n || S, this.#i = this.#i || v, g;
855
+ const [g, p, S, A] = typeof d == "string" ? E.#p(d, this.#n, l) : d.toRegExpSource(t);
856
+ return this.#n = this.#n || S, this.#i = this.#i || A, g;
861
857
  }).join("");
862
858
  let c = "";
863
859
  if (this.isStart() && typeof this.#t[0] == "string" && !(this.#t.length === 1 && $e.has(this.#t[0]))) {
@@ -872,7 +868,7 @@ class E {
872
868
  let f = "";
873
869
  return this.isEnd() && this.#s.#a && this.#e?.type === "!" && (f = "(?:$|\\\\/)"), [
874
870
  c + h + f,
875
- k(h),
871
+ I(h),
876
872
  this.#n = !!this.#n,
877
873
  this.#i
878
874
  ];
@@ -881,7 +877,7 @@ class E {
881
877
  let i = this.#f(e);
882
878
  if (this.isStart() && this.isEnd() && !i && this.type !== "!") {
883
879
  const l = this.toString();
884
- return this.#t = [l], this.type = null, this.#n = void 0, [l, k(this.toString()), !1, !1];
880
+ return this.#t = [l], this.type = null, this.#n = void 0, [l, I(this.toString()), !1, !1];
885
881
  }
886
882
  let o = !n || t || e || !j ? "" : this.#f(!0);
887
883
  o === i && (o = ""), o && (i = \`(?:\${i})(?:\${o})*?\`);
@@ -897,7 +893,7 @@ class E {
897
893
  }
898
894
  return [
899
895
  a,
900
- k(i),
896
+ I(i),
901
897
  this.#n = !!this.#n,
902
898
  this.#i
903
899
  ];
@@ -937,33 +933,33 @@ class E {
937
933
  i += ct, e = !0;
938
934
  continue;
939
935
  }
940
- i += Pe(l);
936
+ i += Te(l);
941
937
  }
942
- return [i, k(t), !!e, o];
938
+ return [i, I(t), !!e, o];
943
939
  }
944
940
  }
945
- const Te = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/[?*()[\\]]/g, "[$&]") : s.replace(/[?*()[\\]\\\\]/g, "\\\\$&"), y = (s, t, e = {}) => (Z(t), !e.nocomment && t.charAt(0) === "#" ? !1 : new X(t, e).match(s)), Re = /^\\*+([^+@!?\\*\\[\\(]*)$/, Ie = (s) => (t) => !t.startsWith(".") && t.endsWith(s), ke = (s) => (t) => t.endsWith(s), ze = (s) => (s = s.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(s)), Le = (s) => (s = s.toLowerCase(), (t) => t.toLowerCase().endsWith(s)), He = /^\\*+\\.\\*+$/, We = (s) => !s.startsWith(".") && s.includes("."), _e = (s) => s !== "." && s !== ".." && s.includes("."), je = /^\\.\\*+$/, Ue = (s) => s !== "." && s !== ".." && s.startsWith("."), Be = /^\\*+$/, Ge = (s) => s.length !== 0 && !s.startsWith("."), qe = (s) => s.length !== 0 && s !== "." && s !== "..", Ve = /^\\?+([^+@!?\\*\\[\\(]*)?$/, Ye = ([s, t = ""]) => {
946
- const e = It([s]);
941
+ const Pe = (s, { windowsPathsNoEscape: t = !1 } = {}) => t ? s.replace(/[?*()[\\]]/g, "[$&]") : s.replace(/[?*()[\\]\\\\]/g, "\\\\$&"), y = (s, t, e = {}) => (Y(t), !e.nocomment && t.charAt(0) === "#" ? !1 : new Z(t, e).match(s)), Re = /^\\*+([^+@!?\\*\\[\\(]*)$/, ke = (s) => (t) => !t.startsWith(".") && t.endsWith(s), Ie = (s) => (t) => t.endsWith(s), Le = (s) => (s = s.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(s)), ze = (s) => (s = s.toLowerCase(), (t) => t.toLowerCase().endsWith(s)), He = /^\\*+\\.\\*+$/, We = (s) => !s.startsWith(".") && s.includes("."), je = (s) => s !== "." && s !== ".." && s.includes("."), _e = /^\\.\\*+$/, Ue = (s) => s !== "." && s !== ".." && s.startsWith("."), Be = /^\\*+$/, Ge = (s) => s.length !== 0 && !s.startsWith("."), qe = (s) => s.length !== 0 && s !== "." && s !== "..", Ve = /^\\?+([^+@!?\\*\\[\\(]*)?$/, Ye = ([s, t = ""]) => {
942
+ const e = kt([s]);
947
943
  return t ? (t = t.toLowerCase(), (n) => e(n) && n.toLowerCase().endsWith(t)) : e;
948
944
  }, Ze = ([s, t = ""]) => {
949
- const e = kt([s]);
945
+ const e = It([s]);
950
946
  return t ? (t = t.toLowerCase(), (n) => e(n) && n.toLowerCase().endsWith(t)) : e;
951
947
  }, Xe = ([s, t = ""]) => {
952
- const e = kt([s]);
948
+ const e = It([s]);
953
949
  return t ? (n) => e(n) && n.endsWith(t) : e;
954
950
  }, Je = ([s, t = ""]) => {
955
- const e = It([s]);
951
+ const e = kt([s]);
956
952
  return t ? (n) => e(n) && n.endsWith(t) : e;
957
- }, It = ([s]) => {
953
+ }, kt = ([s]) => {
958
954
  const t = s.length;
959
955
  return (e) => e.length === t && !e.startsWith(".");
960
- }, kt = ([s]) => {
956
+ }, It = ([s]) => {
961
957
  const t = s.length;
962
958
  return (e) => e.length === t && e !== "." && e !== "..";
963
- }, zt = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", mt = {
959
+ }, Lt = typeof process == "object" && process ? typeof process.env == "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix", mt = {
964
960
  win32: { sep: "\\\\" },
965
961
  posix: { sep: "/" }
966
- }, Qe = zt === "win32" ? mt.win32.sep : mt.posix.sep;
962
+ }, Qe = Lt === "win32" ? mt.win32.sep : mt.posix.sep;
967
963
  y.sep = Qe;
968
964
  const O = Symbol("globstar **");
969
965
  y.GLOBSTAR = O;
@@ -1004,17 +1000,17 @@ const b = (s, t = {}) => Object.assign({}, s, t), rs = (s) => {
1004
1000
  });
1005
1001
  };
1006
1002
  y.defaults = rs;
1007
- const Lt = (s, t = {}) => (Z(s), t.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(s) ? [s] : ye(s));
1008
- y.braceExpand = Lt;
1009
- const is = (s, t = {}) => new X(s, t).makeRe();
1003
+ const zt = (s, t = {}) => (Y(s), t.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(s) ? [s] : ye(s));
1004
+ y.braceExpand = zt;
1005
+ const is = (s, t = {}) => new Z(s, t).makeRe();
1010
1006
  y.makeRe = is;
1011
1007
  const os = (s, t, e = {}) => {
1012
- const n = new X(t, e);
1008
+ const n = new Z(t, e);
1013
1009
  return s = s.filter((r) => n.match(r)), n.options.nonull && !s.length && s.push(t), s;
1014
1010
  };
1015
1011
  y.match = os;
1016
1012
  const yt = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/, as = (s) => s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, "\\\\$&");
1017
- class X {
1013
+ class Z {
1018
1014
  options;
1019
1015
  set;
1020
1016
  pattern;
@@ -1033,7 +1029,7 @@ class X {
1033
1029
  windowsNoMagicRoot;
1034
1030
  regexp;
1035
1031
  constructor(t, e = {}) {
1036
- Z(t), e = e || {}, this.options = e, this.pattern = t, this.platform = e.platform || zt, this.isWindows = this.platform === "win32", this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e.allowWindowsEscape === !1, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\\\/g, "/")), this.preserveMultipleSlashes = !!e.preserveMultipleSlashes, this.regexp = null, this.negate = !1, this.nonegate = !!e.nonegate, this.comment = !1, this.empty = !1, this.partial = !!e.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = e.windowsNoMagicRoot !== void 0 ? e.windowsNoMagicRoot : !!(this.isWindows && this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make();
1032
+ Y(t), e = e || {}, this.options = e, this.pattern = t, this.platform = e.platform || Lt, this.isWindows = this.platform === "win32", this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e.allowWindowsEscape === !1, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\\\/g, "/")), this.preserveMultipleSlashes = !!e.preserveMultipleSlashes, this.regexp = null, this.negate = !1, this.nonegate = !!e.nonegate, this.comment = !1, this.empty = !1, this.partial = !!e.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = e.windowsNoMagicRoot !== void 0 ? e.windowsNoMagicRoot : !!(this.isWindows && this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make();
1037
1033
  }
1038
1034
  hasMagic() {
1039
1035
  if (this.options.magicalBraces && this.set.length > 1)
@@ -1241,10 +1237,10 @@ class X {
1241
1237
  matchOne(t, e, n = !1) {
1242
1238
  const r = this.options;
1243
1239
  if (this.isWindows) {
1244
- const p = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), S = !p && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), v = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), P = !v && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]), x = S ? 3 : p ? 0 : void 0, m = P ? 3 : v ? 0 : void 0;
1240
+ const p = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), S = !p && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), A = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), M = !A && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]), x = S ? 3 : p ? 0 : void 0, m = M ? 3 : A ? 0 : void 0;
1245
1241
  if (typeof x == "number" && typeof m == "number") {
1246
- const [T, H] = [t[x], e[m]];
1247
- T.toLowerCase() === H.toLowerCase() && (e[m] = T, m > x ? e = e.slice(m) : x > m && (t = t.slice(x)));
1242
+ const [T, z] = [t[x], e[m]];
1243
+ T.toLowerCase() === z.toLowerCase() && (e[m] = T, m > x ? e = e.slice(m) : x > m && (t = t.slice(x)));
1248
1244
  }
1249
1245
  }
1250
1246
  const { optimizationLevel: i = 1 } = this.options;
@@ -1290,17 +1286,17 @@ globstar while\`, t, u, e, d, g), this.matchOne(t.slice(u), e.slice(d), n))
1290
1286
  throw new Error("wtf?");
1291
1287
  }
1292
1288
  braceExpand() {
1293
- return Lt(this.pattern, this.options);
1289
+ return zt(this.pattern, this.options);
1294
1290
  }
1295
1291
  parse(t) {
1296
- Z(t);
1292
+ Y(t);
1297
1293
  const e = this.options;
1298
1294
  if (t === "**")
1299
1295
  return O;
1300
1296
  if (t === "")
1301
1297
  return "";
1302
1298
  let n, r = null;
1303
- (n = t.match(Be)) ? r = e.dot ? qe : Ge : (n = t.match(Re)) ? r = (e.nocase ? e.dot ? Le : ze : e.dot ? ke : Ie)(n[1]) : (n = t.match(Ve)) ? r = (e.nocase ? e.dot ? Ze : Ye : e.dot ? Xe : Je)(n) : (n = t.match(He)) ? r = e.dot ? _e : We : (n = t.match(je)) && (r = Ue);
1299
+ (n = t.match(Be)) ? r = e.dot ? qe : Ge : (n = t.match(Re)) ? r = (e.nocase ? e.dot ? ze : Le : e.dot ? Ie : ke)(n[1]) : (n = t.match(Ve)) ? r = (e.nocase ? e.dot ? Ze : Ye : e.dot ? Xe : Je)(n) : (n = t.match(He)) ? r = e.dot ? je : We : (n = t.match(_e)) && (r = Ue);
1304
1300
  const i = E.fromGlob(t, this.options).toMMPattern();
1305
1301
  return r && typeof i == "object" && Reflect.defineProperty(i, "test", { value: r }), i;
1306
1302
  }
@@ -1365,44 +1361,44 @@ globstar while\`, t, u, e, d, g), this.matchOne(t.slice(u), e.slice(d), n))
1365
1361
  }
1366
1362
  }
1367
1363
  y.AST = E;
1368
- y.Minimatch = X;
1369
- y.escape = Te;
1370
- y.unescape = k;
1364
+ y.Minimatch = Z;
1365
+ y.escape = Pe;
1366
+ y.unescape = I;
1371
1367
  function cs() {
1372
1368
  if (!("storage" in navigator) || !("getDirectory" in navigator.storage))
1373
1369
  throw new Qt();
1374
1370
  }
1375
- async function z(s, t, e) {
1371
+ async function L(s, t, e) {
1376
1372
  return typeof navigator < "u" && navigator.locks?.request ? navigator.locks.request(\`opfs:\${s.replace(/\\/+/g, "/")}\`, { mode: t }, e) : e();
1377
1373
  }
1378
- function M(s) {
1374
+ function $(s) {
1379
1375
  return Array.isArray(s) ? s : (s.startsWith("~/") ? s.slice(2) : s).split("/").filter(Boolean);
1380
1376
  }
1381
1377
  function lt(s) {
1382
1378
  return typeof s == "string" ? s ?? "/" : \`/\${s.join("/")}\`;
1383
1379
  }
1384
1380
  function it(s) {
1385
- const t = M(s);
1381
+ const t = $(s);
1386
1382
  return t[t.length - 1] || "";
1387
1383
  }
1388
- function et(s) {
1389
- const t = M(s);
1384
+ function tt(s) {
1385
+ const t = $(s);
1390
1386
  return t.pop(), lt(t);
1391
1387
  }
1392
- function G(s) {
1388
+ function B(s) {
1393
1389
  return !s || s === "/" ? "/" : s.startsWith("~/") ? \`/\${s.slice(2)}\` : s.startsWith("/") ? s : \`/\${s}\`;
1394
1390
  }
1395
1391
  function ls(s, t = !1) {
1396
1392
  return s = s.replace(/\\/$/, ""), t && !s.includes("*") ? \`\${s}/**\` : s;
1397
1393
  }
1398
- function st(s, t) {
1394
+ function et(s, t) {
1399
1395
  return y(s, t, {
1400
1396
  dot: !0,
1401
1397
  matchBase: !0
1402
1398
  });
1403
1399
  }
1404
1400
  function Et(s) {
1405
- const t = G(s), e = M(t), n = [];
1401
+ const t = B(s), e = $(t), n = [];
1406
1402
  for (const r of e)
1407
1403
  if (!(r === "." || r === ""))
1408
1404
  if (r === "..") {
@@ -1425,15 +1421,19 @@ async function us(s) {
1425
1421
  }
1426
1422
  async function fs(s, t, e = {}) {
1427
1423
  const n = it(t);
1428
- return z(t, "exclusive", async () => {
1424
+ return L(t, "exclusive", async () => {
1429
1425
  const r = e.recursive ?? !1, i = e.force ?? !1;
1430
1426
  try {
1431
1427
  await s.removeEntry(n, { recursive: r });
1432
1428
  } catch (o) {
1433
- if (o.name === "NotFoundError") {
1434
- if (!i)
1435
- throw new F("file", t, o);
1436
- } else throw o.name === "InvalidModificationError" ? new rt("clear", t, o) : o.name === "TypeMismatchError" && !r ? new L("file", "directory", t, o) : new rt("remove", t, o);
1429
+ if (o.name === "NotFoundError" && i)
1430
+ return;
1431
+ const a = o.name === "TypeMismatchError" && !r;
1432
+ throw v(o, {
1433
+ path: t,
1434
+ operation: "remove",
1435
+ isDirectory: a
1436
+ });
1437
1437
  }
1438
1438
  });
1439
1439
  }
@@ -1464,7 +1464,7 @@ async function ps(s, t) {
1464
1464
  try {
1465
1465
  return await s.createSyncAccessHandle();
1466
1466
  } catch (e) {
1467
- throw A(e, { path: t, isDirectory: !1 });
1467
+ throw v(e, { path: t, isDirectory: !1 });
1468
1468
  }
1469
1469
  }
1470
1470
  class gs {
@@ -1504,14 +1504,13 @@ class gs {
1504
1504
  * This method is called by internal operations to notify clients about
1505
1505
  * changes, even when no specific paths are being watched.
1506
1506
  *
1507
- * @param path - The path that was changed
1508
- * @param type - The type of change (create, change, delete)
1507
+ * @param event - The event describing the change
1509
1508
  */
1510
1509
  async notifyChange(t) {
1511
1510
  if (!this.options.broadcastChannel)
1512
1511
  return;
1513
1512
  const e = t.path;
1514
- if (![...this.watchers.values()].some((i) => st(e, i.pattern) && i.include.some((o) => o && st(e, o)) && !i.exclude.some((o) => o && st(e, o))))
1513
+ if (![...this.watchers.values()].some((i) => et(e, i.pattern) && i.include.some((o) => o && et(e, o)) && !i.exclude.some((o) => o && et(e, o))))
1515
1514
  return;
1516
1515
  let r;
1517
1516
  if (this.options.hashAlgorithm)
@@ -1551,7 +1550,6 @@ class gs {
1551
1550
  * This method sets up the root directory for all subsequent operations.
1552
1551
  * If no root is specified, it will use the OPFS root directory.
1553
1552
  *
1554
- * @param root - The root path for the file system (default: '/')
1555
1553
  * @returns Promise that resolves to true if initialization was successful
1556
1554
  * @throws {OPFSError} If initialization fails
1557
1555
  *
@@ -1590,7 +1588,7 @@ class gs {
1590
1588
  * @param options.broadcastChannel - Custom name for the broadcast channel
1591
1589
  */
1592
1590
  async setOptions(t) {
1593
- t.hashAlgorithm !== void 0 && (this.options.hashAlgorithm = t.hashAlgorithm), t.maxFileSize !== void 0 && (this.options.maxFileSize = t.maxFileSize), t.broadcastChannel !== void 0 && (this.broadcastChannel && this.options.broadcastChannel !== t.broadcastChannel && (this.broadcastChannel.close(), this.broadcastChannel = null), this.options.broadcastChannel = t.broadcastChannel), t.namespace && (this.options.namespace = t.namespace), t.root !== void 0 && (this.options.root = G(t.root), this.options.namespace || (this.options.namespace = \`opfs-worker:\${this.options.root}\`), await this.mount());
1591
+ t.hashAlgorithm !== void 0 && (this.options.hashAlgorithm = t.hashAlgorithm), t.maxFileSize !== void 0 && (this.options.maxFileSize = t.maxFileSize), t.broadcastChannel !== void 0 && (this.broadcastChannel && this.options.broadcastChannel !== t.broadcastChannel && (this.broadcastChannel.close(), this.broadcastChannel = null), this.options.broadcastChannel = t.broadcastChannel), t.namespace && (this.options.namespace = t.namespace), t.root !== void 0 && (this.options.root = B(t.root), this.options.namespace || (this.options.namespace = \`opfs-worker:\${this.options.root}\`), await this.mount());
1594
1592
  }
1595
1593
  /**
1596
1594
  * Get a directory handle from a path
@@ -1611,7 +1609,7 @@ class gs {
1611
1609
  * \`\`\`
1612
1610
  */
1613
1611
  async getDirectoryHandle(t, e = !1, n = this.root) {
1614
- const r = Array.isArray(t) ? t : M(t);
1612
+ const r = Array.isArray(t) ? t : $(t);
1615
1613
  let i = n;
1616
1614
  for (const o of r)
1617
1615
  i = await i.getDirectoryHandle(o, { create: e });
@@ -1637,7 +1635,7 @@ class gs {
1637
1635
  * \`\`\`
1638
1636
  */
1639
1637
  async getFileHandle(t, e = !1, n = this.root) {
1640
- const r = M(t);
1638
+ const r = $(t);
1641
1639
  if (r.length === 0)
1642
1640
  throw new Kt("Path must not be empty", Array.isArray(t) ? t.join("/") : t);
1643
1641
  const i = r.pop();
@@ -1706,17 +1704,17 @@ class gs {
1706
1704
  async readFile(t) {
1707
1705
  await this.mount();
1708
1706
  try {
1709
- return await z(t, "shared", async () => {
1707
+ return await L(t, "shared", async () => {
1710
1708
  const e = await this.open(t);
1711
1709
  try {
1712
1710
  const { size: n } = await this.fstat(e), r = new Uint8Array(n);
1713
- return n > 0 && await this.read(e, r, 0, n, 0), B(r, [r.buffer]);
1711
+ return n > 0 && await this.read(e, r, 0, n, 0), U(r, [r.buffer]);
1714
1712
  } finally {
1715
1713
  await this.close(e);
1716
1714
  }
1717
1715
  });
1718
1716
  } catch (e) {
1719
- throw new F("file", t, e);
1717
+ throw new R("file", t, e);
1720
1718
  }
1721
1719
  }
1722
1720
  /**
@@ -1744,7 +1742,7 @@ class gs {
1744
1742
  async writeFile(t, e) {
1745
1743
  await this.mount();
1746
1744
  const n = e instanceof Uint8Array ? e : new Uint8Array(e);
1747
- await z(t, "exclusive", async () => {
1745
+ await L(t, "exclusive", async () => {
1748
1746
  const r = await this.exists(t), i = await this.open(t, { create: !0, truncate: !0 });
1749
1747
  try {
1750
1748
  await this.write(i, n, 0, n.length, null, !1), await this.fsync(i);
@@ -1779,7 +1777,7 @@ class gs {
1779
1777
  async appendFile(t, e) {
1780
1778
  await this.mount();
1781
1779
  const n = e instanceof Uint8Array ? e : new Uint8Array(e);
1782
- await z(t, "exclusive", async () => {
1780
+ await L(t, "exclusive", async () => {
1783
1781
  const r = await this.open(t, { create: !0 });
1784
1782
  try {
1785
1783
  const { size: i } = await this.fstat(r);
@@ -1813,14 +1811,17 @@ class gs {
1813
1811
  */
1814
1812
  async mkdir(t, e) {
1815
1813
  await this.mount();
1816
- const n = e?.recursive ?? !1, r = M(t);
1814
+ const n = e?.recursive ?? !1, r = $(t);
1817
1815
  let i = this.root;
1818
1816
  for (let o = 0; o < r.length; o++) {
1819
1817
  const a = r[o];
1820
1818
  try {
1821
1819
  i = await i.getDirectoryHandle(a, { create: n || o === r.length - 1 });
1822
1820
  } catch (l) {
1823
- throw l.name === "NotFoundError" ? new F("directory", lt(r.slice(0, o + 1)), l) : l.name === "TypeMismatchError" ? new L("directory", "file", a, l) : new Q("create directory", a, l);
1821
+ throw l.name === "NotFoundError" ? v(l, {
1822
+ path: lt(r.slice(0, o + 1)),
1823
+ existenceType: "directory"
1824
+ }) : l.name === "TypeMismatchError" ? v(l, { path: a, isDirectory: !1 }) : new J("create directory", a, l);
1824
1825
  }
1825
1826
  }
1826
1827
  await this.notifyChange({ path: t, type: D.Added, isDirectory: !0 });
@@ -1860,7 +1861,7 @@ class gs {
1860
1861
  const e = it(t);
1861
1862
  let n;
1862
1863
  try {
1863
- n = await this.getDirectoryHandle(et(t), !1);
1864
+ n = await this.getDirectoryHandle(tt(t), !1);
1864
1865
  const r = this.options.hashAlgorithm, o = await (await n.getFileHandle(e, { create: !1 })).getFile(), a = {
1865
1866
  kind: "file",
1866
1867
  size: o.size,
@@ -1881,9 +1882,9 @@ class gs {
1881
1882
  return a;
1882
1883
  } catch (r) {
1883
1884
  if (r.name === "NotFoundError")
1884
- throw new F("file", t, r);
1885
+ throw new R("file", t, r);
1885
1886
  if (r.name !== "TypeMismatchError")
1886
- throw new Q("stat", t, r);
1887
+ throw new J("stat", t, r);
1887
1888
  }
1888
1889
  try {
1889
1890
  return await n.getDirectoryHandle(e, { create: !1 }), {
@@ -1895,7 +1896,7 @@ class gs {
1895
1896
  isDirectory: !0
1896
1897
  };
1897
1898
  } catch (r) {
1898
- throw new Q("stat", t, r);
1899
+ throw new J("stat", t, r);
1899
1900
  }
1900
1901
  }
1901
1902
  /**
@@ -1950,7 +1951,7 @@ class gs {
1950
1951
  const e = it(t);
1951
1952
  let n = null;
1952
1953
  try {
1953
- n = await this.getDirectoryHandle(et(t), !1);
1954
+ n = await this.getDirectoryHandle(tt(t), !1);
1954
1955
  } catch (r) {
1955
1956
  if (n = null, r.name !== "NotFoundError" && r.name !== "TypeMismatchError")
1956
1957
  throw r;
@@ -2000,7 +2001,7 @@ class gs {
2000
2001
  }
2001
2002
  await this.notifyChange({ path: t, type: D.Changed, isDirectory: !0 });
2002
2003
  } catch (e) {
2003
- throw e instanceof w ? e : A(e, { path: t, isDirectory: !0 });
2004
+ throw e instanceof w ? e : v(e, { path: t, isDirectory: !0 });
2004
2005
  }
2005
2006
  }
2006
2007
  /**
@@ -2029,8 +2030,8 @@ class gs {
2029
2030
  */
2030
2031
  async remove(t, e) {
2031
2032
  if (await this.mount(), t === "/")
2032
- throw new rt("root", t);
2033
- const { recursive: n = !1, force: r = !1 } = e || {}, i = await this.getDirectoryHandle(et(t), !1), o = await this.stat(t);
2033
+ throw new rt("EROOT", t);
2034
+ const { recursive: n = !1, force: r = !1 } = e || {}, i = await this.getDirectoryHandle(tt(t), !1), o = await this.stat(t);
2034
2035
  await fs(i, t, { recursive: n, force: r }), await this.notifyChange({ path: t, type: D.Removed, isDirectory: o.isDirectory });
2035
2036
  }
2036
2037
  /**
@@ -2056,10 +2057,10 @@ class gs {
2056
2057
  try {
2057
2058
  const e = Et(t);
2058
2059
  if (!await this.exists(e))
2059
- throw new F("file", e);
2060
+ throw new R("file", e);
2060
2061
  return e;
2061
2062
  } catch (e) {
2062
- throw e instanceof w ? e : A(e, { path: t });
2063
+ throw e instanceof w ? e : v(e, { path: t });
2063
2064
  }
2064
2065
  }
2065
2066
  /**
@@ -2089,10 +2090,10 @@ class gs {
2089
2090
  try {
2090
2091
  const r = n?.overwrite ?? !1, i = await this.stat(t);
2091
2092
  if (await this.exists(e) && !r)
2092
- throw new K(e);
2093
+ throw new Q(e);
2093
2094
  await this.copy(t, e, { recursive: !0, overwrite: r }), await this.remove(t, { recursive: !0 }), await this.notifyChange({ path: t, type: D.Removed, isDirectory: i.isDirectory }), await this.notifyChange({ path: e, type: D.Added, isDirectory: i.isDirectory });
2094
2095
  } catch (r) {
2095
- throw r instanceof w ? r : A(r, { path: t });
2096
+ throw r instanceof w ? r : v(r, { path: t });
2096
2097
  }
2097
2098
  }
2098
2099
  /**
@@ -2125,15 +2126,15 @@ class gs {
2125
2126
  try {
2126
2127
  const r = n?.recursive ?? !1, i = n?.overwrite ?? !0;
2127
2128
  if (!await this.exists(t))
2128
- throw new F("source", t);
2129
+ throw new R("source", t);
2129
2130
  if (await this.exists(e) && !i)
2130
- throw new K(e);
2131
+ throw new Q(e);
2131
2132
  if ((await this.stat(t)).isFile) {
2132
2133
  const h = await this.readFile(t);
2133
2134
  await this.writeFile(e, h);
2134
2135
  } else {
2135
2136
  if (!r)
2136
- throw new L("file", "directory", t);
2137
+ throw new nt("directory", t);
2137
2138
  await this.mkdir(e, { recursive: !0 });
2138
2139
  const h = await this.readDir(t);
2139
2140
  for (const c of h) {
@@ -2142,7 +2143,7 @@ class gs {
2142
2143
  }
2143
2144
  }
2144
2145
  } catch (r) {
2145
- throw r instanceof w ? r : A(r, { path: t });
2146
+ throw r instanceof w ? r : v(r, { path: t });
2146
2147
  }
2147
2148
  }
2148
2149
  /**
@@ -2215,15 +2216,21 @@ class gs {
2215
2216
  */
2216
2217
  async open(t, e) {
2217
2218
  await this.mount();
2218
- const { create: n = !1, exclusive: r = !1, truncate: i = !1 } = e || {}, o = G(Et(t));
2219
+ const { create: n = !1, exclusive: r = !1, truncate: i = !1 } = e || {}, o = B(Et(t));
2219
2220
  try {
2220
- return n && r ? await z(o, "exclusive", async () => {
2221
+ return n && r ? await L(o, "exclusive", async () => {
2221
2222
  if (await this.exists(o))
2222
- throw new K(o);
2223
+ throw new Q(o);
2223
2224
  return this._openFile(o, n, i);
2224
2225
  }) : await this._openFile(o, n, i);
2225
2226
  } catch (a) {
2226
- throw a instanceof w ? a : A(a, { path: o, isDirectory: !1 });
2227
+ if (a instanceof w)
2228
+ throw a;
2229
+ const l = a && a.name === "TypeMismatchError";
2230
+ throw v(a, {
2231
+ path: o,
2232
+ isDirectory: !!l
2233
+ });
2227
2234
  }
2228
2235
  }
2229
2236
  /**
@@ -2235,7 +2242,7 @@ class gs {
2235
2242
  try {
2236
2243
  await r.getFile();
2237
2244
  } catch (a) {
2238
- throw A(a, { path: t, isDirectory: !0 });
2245
+ throw v(a, { path: t, isDirectory: !0 });
2239
2246
  }
2240
2247
  const i = await ps(r, t);
2241
2248
  n && (i.truncate(0), i.flush());
@@ -2295,11 +2302,11 @@ class gs {
2295
2302
  try {
2296
2303
  const a = i ?? o.position, l = o.syncHandle.getSize(), { isEOF: h, actualLength: c } = ds(a, r, l);
2297
2304
  if (h)
2298
- return B({ bytesRead: 0, buffer: e }, [e.buffer]);
2305
+ return U({ bytesRead: 0, buffer: e }, [e.buffer]);
2299
2306
  const f = e.subarray(n, n + c), u = o.syncHandle.read(f, { at: a });
2300
- return i == null && (o.position = a + u), B({ bytesRead: u, buffer: e }, [e.buffer]);
2307
+ return i == null && (o.position = a + u), U({ bytesRead: u, buffer: e }, [e.buffer]);
2301
2308
  } catch (a) {
2302
- throw _("read", t, o.path, a);
2309
+ throw W("read", t, o.path, a);
2303
2310
  }
2304
2311
  }
2305
2312
  /**
@@ -2330,7 +2337,7 @@ class gs {
2330
2337
  const h = i ?? a.position, c = e.subarray(n, n + l), f = a.syncHandle.write(c, { at: h });
2331
2338
  return (i == null || i === a.position) && (a.position = h + f), o && await this.notifyChange({ path: a.path, type: D.Changed, isDirectory: !1 }), f;
2332
2339
  } catch (h) {
2333
- throw _("write", t, a.path, h);
2340
+ throw W("write", t, a.path, h);
2334
2341
  }
2335
2342
  }
2336
2343
  /**
@@ -2378,7 +2385,7 @@ class gs {
2378
2385
  try {
2379
2386
  n.syncHandle.truncate(e), n.syncHandle.flush(), n.position > e && (n.position = e), await this.notifyChange({ path: n.path, type: D.Changed, isDirectory: !1 });
2380
2387
  } catch (r) {
2381
- throw _("truncate", t, n.path, r);
2388
+ throw W("truncate", t, n.path, r);
2382
2389
  }
2383
2390
  }
2384
2391
  /**
@@ -2400,7 +2407,7 @@ class gs {
2400
2407
  try {
2401
2408
  e.syncHandle.flush();
2402
2409
  } catch (n) {
2403
- throw _("sync", t, e.path, n);
2410
+ throw W("sync", t, e.path, n);
2404
2411
  }
2405
2412
  }
2406
2413
  /**
@@ -2422,8 +2429,6 @@ class gs {
2422
2429
  * This is useful for importing data from external sources or syncing with remote data.
2423
2430
  *
2424
2431
  * @param entries - Array of [path, data] tuples to sync
2425
- * @param options - Options for synchronization
2426
- * @param options.cleanBefore - Whether to clear the file system before syncing (default: false)
2427
2432
  * @returns Promise that resolves when synchronization is complete
2428
2433
  * @throws {OPFSError} If the synchronization fails
2429
2434
  *
@@ -2447,16 +2452,16 @@ class gs {
2447
2452
  await this.mount();
2448
2453
  try {
2449
2454
  for (const [e, n] of t) {
2450
- const r = G(e);
2455
+ const r = B(e);
2451
2456
  let i;
2452
2457
  n instanceof Blob ? i = await us(n) : typeof n == "string" ? i = new TextEncoder().encode(n) : i = n, await this.writeFile(r, i);
2453
2458
  }
2454
2459
  } catch (e) {
2455
- throw e instanceof w ? e : A(e);
2460
+ throw e instanceof w ? e : v(e);
2456
2461
  }
2457
2462
  }
2458
2463
  }
2459
2464
  typeof globalThis < "u" && globalThis.constructor.name === "DedicatedWorkerGlobalScope" && ot(new gs());
2460
- //# sourceMappingURL=worker-1Wh1cr7P.js.map
2461
- `,h=typeof self<"u"&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",l],{type:"text/javascript;charset=utf-8"});function u(o){let n;try{if(n=h&&(self.URL||self.webkitURL).createObjectURL(h),!n)throw"";const t=new Worker(n,{type:"module",name:o?.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(n)}),t}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(l),{type:"module",name:o?.name})}}function a(o){return o instanceof URL?o.pathname:o}class p{#n;promises=this;constructor(n){this.#n=d.wrap(new u),n&&(n.broadcastChannel&&n.broadcastChannel instanceof BroadcastChannel&&(n.broadcastChannel=n.broadcastChannel.name),this.setOptions(n))}watch(n,t){const r=a(n);return this.#n.watch(r,t),()=>this.unwatch(r)}unwatch(n){const t=a(n);this.#n.unwatch(t)}async setOptions(n){return this.#n.setOptions(n)}async index(){return this.#n.index()}async readFile(n,t){const r=a(n);let s;typeof t=="string"?s=t:t&&typeof t=="object"&&(s=t.encoding);const i=await this.#n.readFile(r);return s||(s=e.isBinaryFileExtension(r)?"binary":"utf-8"),s==="binary"?i:e.decodeBuffer(i,s)}async writeFile(n,t,r){const s=a(n);let i;typeof r=="string"?i=r:r&&typeof r=="object"&&(i=r.encoding),i||(i=typeof t!="string"||e.isBinaryFileExtension(s)?"binary":"utf-8");const c=typeof t=="string"?e.encodeString(t,i):t instanceof Uint8Array?t:new Uint8Array(t);return this.#n.writeFile(s,c)}async appendFile(n,t,r){const s=a(n);r||(r=typeof t!="string"||e.isBinaryFileExtension(s)?"binary":"utf-8");const i=typeof t=="string"?e.encodeString(t,r):t instanceof Uint8Array?t:new Uint8Array(t);return this.#n.appendFile(s,i)}async mkdir(n,t){const r=a(n);let s;return typeof t=="number"?s={recursive:!1}:s=t,this.#n.mkdir(r,s)}async stat(n){const t=a(n);return this.#n.stat(t)}async readDir(n){const t=a(n);return this.#n.readDir(t)}async exists(n){const t=a(n);return this.#n.exists(t)}async clear(n){const t=n?a(n):void 0;return this.#n.clear(t)}async remove(n,t){const r=a(n);return this.#n.remove(r,t)}async unlink(n){return this.remove(n)}async rm(n,t){return this.remove(n,t)}async rmdir(n){return this.remove(n)}async readdir(n,t){return this.readDir(n)}async lstat(n){return this.stat(n)}async chmod(n,t){return Promise.resolve()}async realpath(n){const t=a(n);return this.#n.realpath(t)}async rename(n,t,r){const s=a(n),i=a(t);return this.#n.rename(s,i,r)}async copy(n,t,r){const s=a(n),i=a(t);return this.#n.copy(s,i,r)}async open(n,t){const r=a(n);return this.#n.open(r,t)}async close(n){return this.#n.close(n)}async read(n,t,r,s,i){const{bytesRead:c,buffer:f}=await this.#n.read(n,new Uint8Array(s),0,s,i);return c>0&&t.set(f.subarray(0,c),r),{bytesRead:c,buffer:t}}async write(n,t,r,s,i,c){return this.#n.write(n,t,r,s,i,c)}async fstat(n){return this.#n.fstat(n)}async ftruncate(n,t){return this.#n.ftruncate(n,t)}async fsync(n){return this.#n.fsync(n)}dispose(){this.#n.dispose()}async createIndex(n){const t=n.map(([r,s])=>[a(r),s]);return this.#n.createIndex(t)}async readText(n,t="utf-8"){const r=a(n),s=await this.#n.readFile(r);return e.decodeBuffer(s,t)}async writeText(n,t,r="utf-8"){const s=a(n),i=e.encodeString(t,r);return this.#n.writeFile(s,i)}async appendText(n,t,r="utf-8"){const s=a(n),i=e.encodeString(t,r);return this.#n.appendFile(s,i)}}function m(o){return new p(o)}exports.AlreadyExistsError=e.AlreadyExistsError;exports.BINARY_FILE_EXTENSIONS=e.BINARY_FILE_EXTENSIONS;exports.DirectoryOperationError=e.DirectoryOperationError;exports.ExistenceError=e.ExistenceError;exports.FileBusyError=e.FileBusyError;exports.FileSystemOperationError=e.FileSystemOperationError;exports.FileTypeError=e.FileTypeError;exports.IOError=e.IOError;exports.InitializationFailedError=e.InitializationFailedError;exports.OPFSError=e.OPFSError;exports.OPFSNotSupportedError=e.OPFSNotSupportedError;exports.OperationAbortedError=e.OperationAbortedError;exports.OperationNotSupportedError=e.OperationNotSupportedError;exports.PathError=e.PathError;exports.PathResolutionFailedError=e.PathResolutionFailedError;exports.PermissionError=e.PermissionError;exports.StorageError=e.StorageError;exports.TimeoutError=e.TimeoutError;exports.ValidationError=e.ValidationError;exports.WatchEventType=e.WatchEventType;exports.basename=e.basename;exports.buffersEqual=e.buffersEqual;exports.calculateFileHash=e.calculateFileHash;exports.calculateReadLength=e.calculateReadLength;exports.checkOPFSSupport=e.checkOPFSSupport;exports.convertBlobToUint8Array=e.convertBlobToUint8Array;exports.createBuffer=e.createBuffer;exports.createFDError=e.createFDError;exports.createSyncHandleSafe=e.createSyncHandleSafe;exports.decodeBuffer=e.decodeBuffer;exports.dirname=e.dirname;exports.encodeString=e.encodeString;exports.extname=e.extname;exports.isBinaryFileExtension=e.isBinaryFileExtension;exports.isPathExcluded=e.isPathExcluded;exports.joinPath=e.joinPath;exports.mapDomError=e.mapDomError;exports.matchMinimatch=e.matchMinimatch;exports.normalizeMinimatch=e.normalizeMinimatch;exports.normalizePath=e.normalizePath;exports.removeEntry=e.removeEntry;exports.resolvePath=e.resolvePath;exports.safeCloseSyncHandle=e.safeCloseSyncHandle;exports.splitPath=e.splitPath;exports.validateReadWriteArgs=e.validateReadWriteArgs;exports.withLock=e.withLock;exports.OPFSFileSystem=p;exports.createWorker=m;
2465
+ //# sourceMappingURL=worker-DYYLzR1Y.js.map
2466
+ `,h=typeof self<"u"&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",l],{type:"text/javascript;charset=utf-8"});function u(o){let n;try{if(n=h&&(self.URL||self.webkitURL).createObjectURL(h),!n)throw"";const t=new Worker(n,{type:"module",name:o?.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(n)}),t}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(l),{type:"module",name:o?.name})}}function a(o){return o instanceof URL?o.pathname:o}class p{#n;#t;promises=this;constructor(n){this.#t=new u,this.#n=d.wrap(this.#t),n&&(n.broadcastChannel&&n.broadcastChannel instanceof BroadcastChannel&&(n.broadcastChannel=n.broadcastChannel.name),this.setOptions(n))}watch(n,t){const r=a(n);return this.#n.watch(r,t),()=>this.unwatch(r)}unwatch(n){const t=a(n);this.#n.unwatch(t)}async setOptions(n){return this.#n.setOptions(n)}async index(){return this.#n.index()}async readFile(n,t){const r=a(n);let s;typeof t=="string"?s=t:t&&typeof t=="object"&&(s=t.encoding);const i=await this.#n.readFile(r);return s||(s=e.isBinaryFileExtension(r)?"binary":"utf-8"),s==="binary"?i:e.decodeBuffer(i,s)}async writeFile(n,t,r){const s=a(n);let i;typeof r=="string"?i=r:r&&typeof r=="object"&&(i=r.encoding),i||(i=typeof t!="string"||e.isBinaryFileExtension(s)?"binary":"utf-8");const c=typeof t=="string"?e.encodeString(t,i):t instanceof Uint8Array?t:new Uint8Array(t);return this.#n.writeFile(s,c)}async appendFile(n,t,r){const s=a(n);r||(r=typeof t!="string"||e.isBinaryFileExtension(s)?"binary":"utf-8");const i=typeof t=="string"?e.encodeString(t,r):t instanceof Uint8Array?t:new Uint8Array(t);return this.#n.appendFile(s,i)}async mkdir(n,t){const r=a(n);let s;return typeof t=="number"?s={recursive:!1}:s=t,this.#n.mkdir(r,s)}async stat(n){const t=a(n);return this.#n.stat(t)}async readDir(n){const t=a(n);return this.#n.readDir(t)}async exists(n){const t=a(n);return this.#n.exists(t)}async clear(n){const t=n?a(n):void 0;return this.#n.clear(t)}async remove(n,t){const r=a(n);return this.#n.remove(r,t)}async unlink(n){return this.remove(n)}async rm(n,t){return this.remove(n,t)}async rmdir(n){return this.remove(n)}async readdir(n,t){return this.readDir(n)}async lstat(n){return this.stat(n)}async chmod(n,t){return Promise.resolve()}async realpath(n){const t=a(n);return this.#n.realpath(t)}async rename(n,t,r){const s=a(n),i=a(t);return this.#n.rename(s,i,r)}async copy(n,t,r){const s=a(n),i=a(t);return this.#n.copy(s,i,r)}async open(n,t){const r=a(n);return this.#n.open(r,t)}async close(n){return this.#n.close(n)}async read(n,t,r,s,i){const{bytesRead:c,buffer:f}=await this.#n.read(n,new Uint8Array(s),0,s,i);return c>0&&t.set(f.subarray(0,c),r),{bytesRead:c,buffer:t}}async write(n,t,r,s,i,c){return this.#n.write(n,t,r,s,i,c)}async fstat(n){return this.#n.fstat(n)}async ftruncate(n,t){return this.#n.ftruncate(n,t)}async fsync(n){return this.#n.fsync(n)}async createIndex(n){const t=n.map(([r,s])=>[a(r),s]);return this.#n.createIndex(t)}async readText(n,t="utf-8"){const r=a(n),s=await this.#n.readFile(r);return e.decodeBuffer(s,t)}async writeText(n,t,r="utf-8"){const s=a(n),i=e.encodeString(t,r);return this.#n.writeFile(s,i)}async appendText(n,t,r="utf-8"){const s=a(n),i=e.encodeString(t,r);return this.#n.appendFile(s,i)}dispose(){const n=this.#n,t=this.#t;(async()=>{try{await n.dispose()}finally{t.terminate()}})()}}function m(o){return new p(o)}exports.AlreadyExistsError=e.AlreadyExistsError;exports.BINARY_FILE_EXTENSIONS=e.BINARY_FILE_EXTENSIONS;exports.DirectoryOperationError=e.DirectoryOperationError;exports.ExistenceError=e.ExistenceError;exports.FileBusyError=e.FileBusyError;exports.FileSystemOperationError=e.FileSystemOperationError;exports.FileTypeError=e.FileTypeError;exports.IOError=e.IOError;exports.InitializationFailedError=e.InitializationFailedError;exports.OPFSError=e.OPFSError;exports.OPFSNotSupportedError=e.OPFSNotSupportedError;exports.OperationAbortedError=e.OperationAbortedError;exports.OperationNotSupportedError=e.OperationNotSupportedError;exports.PathError=e.PathError;exports.PermissionError=e.PermissionError;exports.StorageError=e.StorageError;exports.ValidationError=e.ValidationError;exports.WatchEventType=e.WatchEventType;exports.basename=e.basename;exports.buffersEqual=e.buffersEqual;exports.calculateFileHash=e.calculateFileHash;exports.calculateReadLength=e.calculateReadLength;exports.checkOPFSSupport=e.checkOPFSSupport;exports.convertBlobToUint8Array=e.convertBlobToUint8Array;exports.createBuffer=e.createBuffer;exports.createFDError=e.createFDError;exports.createSyncHandleSafe=e.createSyncHandleSafe;exports.decodeBuffer=e.decodeBuffer;exports.dirname=e.dirname;exports.encodeString=e.encodeString;exports.extname=e.extname;exports.isBinaryFileExtension=e.isBinaryFileExtension;exports.isPathExcluded=e.isPathExcluded;exports.joinPath=e.joinPath;exports.mapDomError=e.mapDomError;exports.matchMinimatch=e.matchMinimatch;exports.normalizeMinimatch=e.normalizeMinimatch;exports.normalizePath=e.normalizePath;exports.removeEntry=e.removeEntry;exports.resolvePath=e.resolvePath;exports.safeCloseSyncHandle=e.safeCloseSyncHandle;exports.splitPath=e.splitPath;exports.validateReadWriteArgs=e.validateReadWriteArgs;exports.withLock=e.withLock;exports.OPFSFileSystem=p;exports.createWorker=m;
2462
2467
  //# sourceMappingURL=index.cjs.map