@unocss/language-server 66.6.7 → 66.6.8
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.d.mts +2 -2
- package/dist/index.mjs +44 -31
- package/dist/server.cjs +460 -412
- package/package.json +28 -28
package/dist/server.cjs
CHANGED
|
@@ -37,6 +37,7 @@ let node_process = require("node:process");
|
|
|
37
37
|
node_process = __toESM(node_process);
|
|
38
38
|
let node_url = require("node:url");
|
|
39
39
|
let node_util = require("node:util");
|
|
40
|
+
let node_diagnostics_channel = require("node:diagnostics_channel");
|
|
40
41
|
let node_fs = require("node:fs");
|
|
41
42
|
node_fs = __toESM(node_fs);
|
|
42
43
|
let node_fs_promises = require("node:fs/promises");
|
|
@@ -280,7 +281,7 @@ function normalizeCSSEntries(obj) {
|
|
|
280
281
|
return (!Array.isArray(obj) ? Object.entries(obj) : obj).filter((i) => i[1] != null);
|
|
281
282
|
}
|
|
282
283
|
function normalizeCSSValues(obj) {
|
|
283
|
-
if (Array.isArray(obj)) if (obj.
|
|
284
|
+
if (Array.isArray(obj)) if (obj.some((i) => !Array.isArray(i) || Array.isArray(i[0]))) return obj.map((i) => normalizeCSSEntries(i));
|
|
284
285
|
else return [obj];
|
|
285
286
|
else return [normalizeCSSEntries(obj)];
|
|
286
287
|
}
|
|
@@ -580,7 +581,7 @@ function flatternFilterPattern(pattern) {
|
|
|
580
581
|
function definePreset(preset) {
|
|
581
582
|
return preset;
|
|
582
583
|
}
|
|
583
|
-
var version = "66.6.
|
|
584
|
+
var version = "66.6.8";
|
|
584
585
|
const symbols = {
|
|
585
586
|
shortcutsNoMerge: "$$symbol-shortcut-no-merge",
|
|
586
587
|
noMerge: "$$symbol-no-merge",
|
|
@@ -35170,69 +35171,42 @@ var Fzf = class {
|
|
|
35170
35171
|
}
|
|
35171
35172
|
};
|
|
35172
35173
|
//#endregion
|
|
35173
|
-
//#region ../../node_modules/.pnpm/lru-cache@11.2
|
|
35174
|
-
var
|
|
35175
|
-
typeof
|
|
35176
|
-
},
|
|
35177
|
-
|
|
35178
|
-
|
|
35179
|
-
|
|
35180
|
-
|
|
35181
|
-
reason;
|
|
35182
|
-
aborted = !1;
|
|
35183
|
-
addEventListener(i, s) {
|
|
35184
|
-
this._onabort.push(s);
|
|
35185
|
-
}
|
|
35186
|
-
}, C$1 = class {
|
|
35187
|
-
constructor() {
|
|
35188
|
-
t();
|
|
35189
|
-
}
|
|
35190
|
-
signal = new D$1();
|
|
35191
|
-
abort(i) {
|
|
35192
|
-
if (!this.signal.aborted) {
|
|
35193
|
-
this.signal.reason = i, this.signal.aborted = !0;
|
|
35194
|
-
for (let s of this.signal._onabort) s(i);
|
|
35195
|
-
this.signal.onabort?.(i);
|
|
35196
|
-
}
|
|
35197
|
-
}
|
|
35198
|
-
};
|
|
35199
|
-
let a = R$1.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1", t = () => {
|
|
35200
|
-
a && (a = !1, x("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", t));
|
|
35201
|
-
};
|
|
35202
|
-
}
|
|
35203
|
-
var G$1 = (a) => !I$1.has(a), y$1 = (a) => a && a === Math.floor(a) && a > 0 && isFinite(a), U = (a) => y$1(a) ? a <= Math.pow(2, 8) ? Uint8Array : a <= Math.pow(2, 16) ? Uint16Array : a <= Math.pow(2, 32) ? Uint32Array : a <= Number.MAX_SAFE_INTEGER ? z : null : null, z = class extends Array {
|
|
35204
|
-
constructor(t) {
|
|
35205
|
-
super(t), this.fill(0);
|
|
35206
|
-
}
|
|
35207
|
-
}, W = class a {
|
|
35174
|
+
//#region ../../node_modules/.pnpm/lru-cache@11.3.2/node_modules/lru-cache/dist/esm/node/index.min.js
|
|
35175
|
+
var S$1 = (0, node_diagnostics_channel.channel)("lru-cache:metrics"), W = (0, node_diagnostics_channel.tracingChannel)("lru-cache"), x = () => S$1.hasSubscribers || W.hasSubscribers, G$1 = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date, M = /* @__PURE__ */ new Set(), C$1 = typeof process == "object" && process ? process : {}, P = (u, e, t, i) => {
|
|
35176
|
+
typeof C$1.emitWarning == "function" ? C$1.emitWarning(u, e, t, i) : console.error(`[${t}] ${e}: ${u}`);
|
|
35177
|
+
}, H = (u) => !M.has(u), F$1 = (u) => !!u && u === Math.floor(u) && u > 0 && isFinite(u), U = (u) => F$1(u) ? u <= Math.pow(2, 8) ? Uint8Array : u <= Math.pow(2, 16) ? Uint16Array : u <= Math.pow(2, 32) ? Uint32Array : u <= Number.MAX_SAFE_INTEGER ? O$1 : null : null, O$1 = class extends Array {
|
|
35178
|
+
constructor(e) {
|
|
35179
|
+
super(e), this.fill(0);
|
|
35180
|
+
}
|
|
35181
|
+
}, R$1 = class u {
|
|
35208
35182
|
heap;
|
|
35209
35183
|
length;
|
|
35210
35184
|
static #o = !1;
|
|
35211
|
-
static create(
|
|
35212
|
-
let
|
|
35213
|
-
if (!
|
|
35214
|
-
|
|
35215
|
-
let i = new
|
|
35216
|
-
return
|
|
35185
|
+
static create(e) {
|
|
35186
|
+
let t = U(e);
|
|
35187
|
+
if (!t) return [];
|
|
35188
|
+
u.#o = !0;
|
|
35189
|
+
let i = new u(e, t);
|
|
35190
|
+
return u.#o = !1, i;
|
|
35217
35191
|
}
|
|
35218
|
-
constructor(
|
|
35219
|
-
if (!
|
|
35220
|
-
this.heap = new e
|
|
35192
|
+
constructor(e, t) {
|
|
35193
|
+
if (!u.#o) throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
35194
|
+
this.heap = new t(e), this.length = 0;
|
|
35221
35195
|
}
|
|
35222
|
-
push(
|
|
35223
|
-
this.heap[this.length++] =
|
|
35196
|
+
push(e) {
|
|
35197
|
+
this.heap[this.length++] = e;
|
|
35224
35198
|
}
|
|
35225
35199
|
pop() {
|
|
35226
35200
|
return this.heap[--this.length];
|
|
35227
35201
|
}
|
|
35228
|
-
}, L$1 = class
|
|
35202
|
+
}, L$1 = class u {
|
|
35229
35203
|
#o;
|
|
35230
|
-
#
|
|
35204
|
+
#u;
|
|
35231
35205
|
#w;
|
|
35232
|
-
#
|
|
35206
|
+
#x;
|
|
35233
35207
|
#S;
|
|
35234
|
-
#
|
|
35235
|
-
#
|
|
35208
|
+
#M;
|
|
35209
|
+
#U;
|
|
35236
35210
|
#m;
|
|
35237
35211
|
get perf() {
|
|
35238
35212
|
return this.#m;
|
|
@@ -35253,515 +35227,576 @@ var G$1 = (a) => !I$1.has(a), y$1 = (a) => a && a === Math.floor(a) && a > 0 &&
|
|
|
35253
35227
|
allowStaleOnFetchRejection;
|
|
35254
35228
|
ignoreFetchAbort;
|
|
35255
35229
|
#n;
|
|
35256
|
-
#
|
|
35230
|
+
#b;
|
|
35257
35231
|
#s;
|
|
35258
35232
|
#i;
|
|
35259
35233
|
#t;
|
|
35260
35234
|
#a;
|
|
35261
|
-
#
|
|
35235
|
+
#c;
|
|
35262
35236
|
#l;
|
|
35263
35237
|
#h;
|
|
35264
|
-
#b;
|
|
35265
|
-
#r;
|
|
35266
35238
|
#y;
|
|
35267
|
-
#
|
|
35239
|
+
#r;
|
|
35240
|
+
#_;
|
|
35241
|
+
#F;
|
|
35268
35242
|
#d;
|
|
35269
35243
|
#g;
|
|
35270
35244
|
#T;
|
|
35271
|
-
#
|
|
35245
|
+
#W;
|
|
35272
35246
|
#f;
|
|
35273
|
-
#
|
|
35274
|
-
static unsafeExposeInternals(
|
|
35247
|
+
#j;
|
|
35248
|
+
static unsafeExposeInternals(e) {
|
|
35275
35249
|
return {
|
|
35276
|
-
starts:
|
|
35277
|
-
ttls:
|
|
35278
|
-
autopurgeTimers:
|
|
35279
|
-
sizes:
|
|
35280
|
-
keyMap:
|
|
35281
|
-
keyList:
|
|
35282
|
-
valList:
|
|
35283
|
-
next:
|
|
35284
|
-
prev:
|
|
35250
|
+
starts: e.#F,
|
|
35251
|
+
ttls: e.#d,
|
|
35252
|
+
autopurgeTimers: e.#g,
|
|
35253
|
+
sizes: e.#_,
|
|
35254
|
+
keyMap: e.#s,
|
|
35255
|
+
keyList: e.#i,
|
|
35256
|
+
valList: e.#t,
|
|
35257
|
+
next: e.#a,
|
|
35258
|
+
prev: e.#c,
|
|
35285
35259
|
get head() {
|
|
35286
|
-
return
|
|
35260
|
+
return e.#l;
|
|
35287
35261
|
},
|
|
35288
35262
|
get tail() {
|
|
35289
|
-
return
|
|
35263
|
+
return e.#h;
|
|
35290
35264
|
},
|
|
35291
|
-
free:
|
|
35292
|
-
isBackgroundFetch: (
|
|
35293
|
-
backgroundFetch: (
|
|
35294
|
-
moveToTail: (
|
|
35295
|
-
indexes: (
|
|
35296
|
-
rindexes: (
|
|
35297
|
-
isStale: (
|
|
35265
|
+
free: e.#y,
|
|
35266
|
+
isBackgroundFetch: (t) => e.#e(t),
|
|
35267
|
+
backgroundFetch: (t, i, s, n) => e.#P(t, i, s, n),
|
|
35268
|
+
moveToTail: (t) => e.#L(t),
|
|
35269
|
+
indexes: (t) => e.#A(t),
|
|
35270
|
+
rindexes: (t) => e.#z(t),
|
|
35271
|
+
isStale: (t) => e.#p(t)
|
|
35298
35272
|
};
|
|
35299
35273
|
}
|
|
35300
35274
|
get max() {
|
|
35301
35275
|
return this.#o;
|
|
35302
35276
|
}
|
|
35303
35277
|
get maxSize() {
|
|
35304
|
-
return this.#
|
|
35278
|
+
return this.#u;
|
|
35305
35279
|
}
|
|
35306
35280
|
get calculatedSize() {
|
|
35307
|
-
return this.#
|
|
35281
|
+
return this.#b;
|
|
35308
35282
|
}
|
|
35309
35283
|
get size() {
|
|
35310
35284
|
return this.#n;
|
|
35311
35285
|
}
|
|
35312
35286
|
get fetchMethod() {
|
|
35313
|
-
return this.#
|
|
35287
|
+
return this.#M;
|
|
35314
35288
|
}
|
|
35315
35289
|
get memoMethod() {
|
|
35316
|
-
return this.#
|
|
35290
|
+
return this.#U;
|
|
35317
35291
|
}
|
|
35318
35292
|
get dispose() {
|
|
35319
35293
|
return this.#w;
|
|
35320
35294
|
}
|
|
35321
35295
|
get onInsert() {
|
|
35322
|
-
return this.#
|
|
35296
|
+
return this.#x;
|
|
35323
35297
|
}
|
|
35324
35298
|
get disposeAfter() {
|
|
35325
35299
|
return this.#S;
|
|
35326
35300
|
}
|
|
35327
|
-
constructor(
|
|
35328
|
-
let { max:
|
|
35329
|
-
if (
|
|
35330
|
-
if (this.#m =
|
|
35331
|
-
let
|
|
35332
|
-
if (!
|
|
35333
|
-
if (this.#o =
|
|
35334
|
-
if (!this.#
|
|
35301
|
+
constructor(e) {
|
|
35302
|
+
let { max: t = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n, updateAgeOnGet: o, updateAgeOnHas: r, allowStale: h, dispose: l, onInsert: c, disposeAfter: f, noDisposeOnSet: g, noUpdateTTL: p, maxSize: T = 0, maxEntrySize: w = 0, sizeCalculation: y, fetchMethod: a, memoMethod: m, noDeleteOnFetchRejection: _, noDeleteOnStaleGet: b, allowStaleOnFetchRejection: d, allowStaleOnFetchAbort: A, ignoreFetchAbort: z, perf: D } = e;
|
|
35303
|
+
if (D !== void 0 && typeof D?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
35304
|
+
if (this.#m = D ?? G$1, t !== 0 && !F$1(t)) throw new TypeError("max option must be a nonnegative integer");
|
|
35305
|
+
let v = t ? U(t) : Array;
|
|
35306
|
+
if (!v) throw new Error("invalid max value: " + t);
|
|
35307
|
+
if (this.#o = t, this.#u = T, this.maxEntrySize = w || this.#u, this.sizeCalculation = y, this.sizeCalculation) {
|
|
35308
|
+
if (!this.#u && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
35335
35309
|
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
|
|
35336
35310
|
}
|
|
35337
|
-
if (
|
|
35338
|
-
if (this.#
|
|
35339
|
-
if (this.#
|
|
35340
|
-
if (this.#
|
|
35341
|
-
if (!
|
|
35342
|
-
this.#
|
|
35311
|
+
if (m !== void 0 && typeof m != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
35312
|
+
if (this.#U = m, a !== void 0 && typeof a != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
35313
|
+
if (this.#M = a, this.#W = !!a, this.#s = /* @__PURE__ */ new Map(), this.#i = Array.from({ length: t }).fill(void 0), this.#t = Array.from({ length: t }).fill(void 0), this.#a = new v(t), this.#c = new v(t), this.#l = 0, this.#h = 0, this.#y = R$1.create(t), this.#n = 0, this.#b = 0, typeof l == "function" && (this.#w = l), typeof c == "function" && (this.#x = c), typeof f == "function" ? (this.#S = f, this.#r = []) : (this.#S = void 0, this.#r = void 0), this.#T = !!this.#w, this.#j = !!this.#x, this.#f = !!this.#S, this.noDisposeOnSet = !!g, this.noUpdateTTL = !!p, this.noDeleteOnFetchRejection = !!_, this.allowStaleOnFetchRejection = !!d, this.allowStaleOnFetchAbort = !!A, this.ignoreFetchAbort = !!z, this.maxEntrySize !== 0) {
|
|
35314
|
+
if (this.#u !== 0 && !F$1(this.#u)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
35315
|
+
if (!F$1(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
35316
|
+
this.#X();
|
|
35343
35317
|
}
|
|
35344
|
-
if (this.allowStale = !!
|
|
35345
|
-
if (!
|
|
35346
|
-
this.#
|
|
35318
|
+
if (this.allowStale = !!h, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!r, this.ttlResolution = F$1(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n, this.ttl = i || 0, this.ttl) {
|
|
35319
|
+
if (!F$1(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
35320
|
+
this.#H();
|
|
35347
35321
|
}
|
|
35348
|
-
if (this.#o === 0 && this.ttl === 0 && this.#
|
|
35349
|
-
if (!this.ttlAutopurge && !this.#o && !this.#
|
|
35322
|
+
if (this.#o === 0 && this.ttl === 0 && this.#u === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
35323
|
+
if (!this.ttlAutopurge && !this.#o && !this.#u) {
|
|
35350
35324
|
let E = "LRU_CACHE_UNBOUNDED";
|
|
35351
|
-
|
|
35352
|
-
}
|
|
35353
|
-
}
|
|
35354
|
-
getRemainingTTL(
|
|
35355
|
-
return this.#s.has(
|
|
35356
|
-
}
|
|
35357
|
-
#
|
|
35358
|
-
let
|
|
35359
|
-
this.#d =
|
|
35360
|
-
let i = this.ttlAutopurge ?
|
|
35361
|
-
this.#g = i, this.#N = (
|
|
35362
|
-
|
|
35363
|
-
|
|
35364
|
-
|
|
35365
|
-
|
|
35366
|
-
|
|
35367
|
-
|
|
35368
|
-
|
|
35369
|
-
|
|
35370
|
-
|
|
35371
|
-
|
|
35372
|
-
|
|
35373
|
-
|
|
35374
|
-
|
|
35375
|
-
|
|
35325
|
+
H(E) && (M.add(E), P("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", E, u));
|
|
35326
|
+
}
|
|
35327
|
+
}
|
|
35328
|
+
getRemainingTTL(e) {
|
|
35329
|
+
return this.#s.has(e) ? Infinity : 0;
|
|
35330
|
+
}
|
|
35331
|
+
#H() {
|
|
35332
|
+
let e = new O$1(this.#o), t = new O$1(this.#o);
|
|
35333
|
+
this.#d = e, this.#F = t;
|
|
35334
|
+
let i = this.ttlAutopurge ? Array.from({ length: this.#o }) : void 0;
|
|
35335
|
+
this.#g = i, this.#N = (r, h, l = this.#m.now()) => {
|
|
35336
|
+
t[r] = h !== 0 ? l : 0, e[r] = h, s(r, h);
|
|
35337
|
+
}, this.#D = (r) => {
|
|
35338
|
+
t[r] = e[r] !== 0 ? this.#m.now() : 0, s(r, e[r]);
|
|
35339
|
+
};
|
|
35340
|
+
let s = this.ttlAutopurge ? (r, h) => {
|
|
35341
|
+
if (i?.[r] && (clearTimeout(i[r]), i[r] = void 0), h && h !== 0 && i) {
|
|
35342
|
+
let l = setTimeout(() => {
|
|
35343
|
+
this.#p(r) && this.#v(this.#i[r], "expire");
|
|
35344
|
+
}, h + 1);
|
|
35345
|
+
l.unref && l.unref(), i[r] = l;
|
|
35346
|
+
}
|
|
35347
|
+
} : () => {};
|
|
35348
|
+
this.#E = (r, h) => {
|
|
35349
|
+
if (e[h]) {
|
|
35350
|
+
let l = e[h], c = t[h];
|
|
35351
|
+
if (!l || !c) return;
|
|
35352
|
+
r.ttl = l, r.start = c, r.now = n || o();
|
|
35353
|
+
r.remainingTTL = l - (r.now - c);
|
|
35376
35354
|
}
|
|
35377
35355
|
};
|
|
35378
|
-
let
|
|
35379
|
-
let
|
|
35356
|
+
let n = 0, o = () => {
|
|
35357
|
+
let r = this.#m.now();
|
|
35380
35358
|
if (this.ttlResolution > 0) {
|
|
35381
|
-
|
|
35382
|
-
let
|
|
35383
|
-
|
|
35359
|
+
n = r;
|
|
35360
|
+
let h = setTimeout(() => n = 0, this.ttlResolution);
|
|
35361
|
+
h.unref && h.unref();
|
|
35384
35362
|
}
|
|
35385
|
-
return
|
|
35363
|
+
return r;
|
|
35386
35364
|
};
|
|
35387
|
-
this.getRemainingTTL = (
|
|
35388
|
-
let
|
|
35389
|
-
if (
|
|
35390
|
-
let
|
|
35391
|
-
if (!
|
|
35392
|
-
return
|
|
35393
|
-
}, this.#p = (
|
|
35394
|
-
let
|
|
35395
|
-
return !!
|
|
35365
|
+
this.getRemainingTTL = (r) => {
|
|
35366
|
+
let h = this.#s.get(r);
|
|
35367
|
+
if (h === void 0) return 0;
|
|
35368
|
+
let l = e[h], c = t[h];
|
|
35369
|
+
if (!l || !c) return Infinity;
|
|
35370
|
+
return l - ((n || o()) - c);
|
|
35371
|
+
}, this.#p = (r) => {
|
|
35372
|
+
let h = t[r], l = e[r];
|
|
35373
|
+
return !!l && !!h && (n || o()) - h > l;
|
|
35396
35374
|
};
|
|
35397
35375
|
}
|
|
35398
|
-
#
|
|
35399
|
-
#
|
|
35376
|
+
#D = () => {};
|
|
35377
|
+
#E = () => {};
|
|
35400
35378
|
#N = () => {};
|
|
35401
35379
|
#p = () => !1;
|
|
35402
|
-
#
|
|
35403
|
-
let
|
|
35404
|
-
this.#
|
|
35405
|
-
this.#
|
|
35406
|
-
}, this.#
|
|
35380
|
+
#X() {
|
|
35381
|
+
let e = new O$1(this.#o);
|
|
35382
|
+
this.#b = 0, this.#_ = e, this.#R = (t) => {
|
|
35383
|
+
this.#b -= e[t], e[t] = 0;
|
|
35384
|
+
}, this.#k = (t, i, s, n) => {
|
|
35407
35385
|
if (this.#e(i)) return 0;
|
|
35408
|
-
if (!
|
|
35409
|
-
if (typeof
|
|
35410
|
-
if (s =
|
|
35386
|
+
if (!F$1(s)) if (n) {
|
|
35387
|
+
if (typeof n != "function") throw new TypeError("sizeCalculation must be a function");
|
|
35388
|
+
if (s = n(i, t), !F$1(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
35411
35389
|
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
35412
35390
|
return s;
|
|
35413
|
-
}, this.#
|
|
35414
|
-
if (t
|
|
35415
|
-
let
|
|
35416
|
-
for (; this.#
|
|
35391
|
+
}, this.#I = (t, i, s) => {
|
|
35392
|
+
if (e[t] = i, this.#u) {
|
|
35393
|
+
let n = this.#u - e[t];
|
|
35394
|
+
for (; this.#b > n;) this.#G(!0);
|
|
35417
35395
|
}
|
|
35418
|
-
this.#
|
|
35396
|
+
this.#b += e[t], s && (s.entrySize = i, s.totalCalculatedSize = this.#b);
|
|
35419
35397
|
};
|
|
35420
35398
|
}
|
|
35421
|
-
#
|
|
35422
|
-
#
|
|
35423
|
-
#
|
|
35399
|
+
#R = (e) => {};
|
|
35400
|
+
#I = (e, t, i) => {};
|
|
35401
|
+
#k = (e, t, i, s) => {
|
|
35424
35402
|
if (i || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
35425
35403
|
return 0;
|
|
35426
35404
|
};
|
|
35427
|
-
*#
|
|
35428
|
-
if (this.#n) for (let
|
|
35405
|
+
*#A({ allowStale: e = this.allowStale } = {}) {
|
|
35406
|
+
if (this.#n) for (let t = this.#h; this.#V(t) && ((e || !this.#p(t)) && (yield t), t !== this.#l);) t = this.#c[t];
|
|
35429
35407
|
}
|
|
35430
|
-
*#
|
|
35431
|
-
if (this.#n) for (let
|
|
35408
|
+
*#z({ allowStale: e = this.allowStale } = {}) {
|
|
35409
|
+
if (this.#n) for (let t = this.#l; this.#V(t) && ((e || !this.#p(t)) && (yield t), t !== this.#h);) t = this.#a[t];
|
|
35432
35410
|
}
|
|
35433
|
-
#
|
|
35434
|
-
return
|
|
35411
|
+
#V(e) {
|
|
35412
|
+
return e !== void 0 && this.#s.get(this.#i[e]) === e;
|
|
35435
35413
|
}
|
|
35436
35414
|
*entries() {
|
|
35437
|
-
for (let
|
|
35415
|
+
for (let e of this.#A()) this.#t[e] !== void 0 && this.#i[e] !== void 0 && !this.#e(this.#t[e]) && (yield [this.#i[e], this.#t[e]]);
|
|
35438
35416
|
}
|
|
35439
35417
|
*rentries() {
|
|
35440
|
-
for (let
|
|
35418
|
+
for (let e of this.#z()) this.#t[e] !== void 0 && this.#i[e] !== void 0 && !this.#e(this.#t[e]) && (yield [this.#i[e], this.#t[e]]);
|
|
35441
35419
|
}
|
|
35442
35420
|
*keys() {
|
|
35443
|
-
for (let
|
|
35444
|
-
let
|
|
35445
|
-
|
|
35421
|
+
for (let e of this.#A()) {
|
|
35422
|
+
let t = this.#i[e];
|
|
35423
|
+
t !== void 0 && !this.#e(this.#t[e]) && (yield t);
|
|
35446
35424
|
}
|
|
35447
35425
|
}
|
|
35448
35426
|
*rkeys() {
|
|
35449
|
-
for (let
|
|
35450
|
-
let
|
|
35451
|
-
|
|
35427
|
+
for (let e of this.#z()) {
|
|
35428
|
+
let t = this.#i[e];
|
|
35429
|
+
t !== void 0 && !this.#e(this.#t[e]) && (yield t);
|
|
35452
35430
|
}
|
|
35453
35431
|
}
|
|
35454
35432
|
*values() {
|
|
35455
|
-
for (let
|
|
35433
|
+
for (let e of this.#A()) this.#t[e] !== void 0 && !this.#e(this.#t[e]) && (yield this.#t[e]);
|
|
35456
35434
|
}
|
|
35457
35435
|
*rvalues() {
|
|
35458
|
-
for (let
|
|
35436
|
+
for (let e of this.#z()) this.#t[e] !== void 0 && !this.#e(this.#t[e]) && (yield this.#t[e]);
|
|
35459
35437
|
}
|
|
35460
35438
|
[Symbol.iterator]() {
|
|
35461
35439
|
return this.entries();
|
|
35462
35440
|
}
|
|
35463
35441
|
[Symbol.toStringTag] = "LRUCache";
|
|
35464
|
-
find(
|
|
35465
|
-
for (let i of this.#
|
|
35466
|
-
let s = this.#t[i],
|
|
35467
|
-
if (
|
|
35442
|
+
find(e, t = {}) {
|
|
35443
|
+
for (let i of this.#A()) {
|
|
35444
|
+
let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
|
|
35445
|
+
if (n !== void 0 && e(n, this.#i[i], this)) return this.#C(this.#i[i], t);
|
|
35468
35446
|
}
|
|
35469
35447
|
}
|
|
35470
|
-
forEach(
|
|
35471
|
-
for (let i of this.#
|
|
35472
|
-
let s = this.#t[i],
|
|
35473
|
-
|
|
35448
|
+
forEach(e, t = this) {
|
|
35449
|
+
for (let i of this.#A()) {
|
|
35450
|
+
let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
|
|
35451
|
+
n !== void 0 && e.call(t, n, this.#i[i], this);
|
|
35474
35452
|
}
|
|
35475
35453
|
}
|
|
35476
|
-
rforEach(
|
|
35477
|
-
for (let i of this.#
|
|
35478
|
-
let s = this.#t[i],
|
|
35479
|
-
|
|
35454
|
+
rforEach(e, t = this) {
|
|
35455
|
+
for (let i of this.#z()) {
|
|
35456
|
+
let s = this.#t[i], n = this.#e(s) ? s.__staleWhileFetching : s;
|
|
35457
|
+
n !== void 0 && e.call(t, n, this.#i[i], this);
|
|
35480
35458
|
}
|
|
35481
35459
|
}
|
|
35482
35460
|
purgeStale() {
|
|
35483
|
-
let
|
|
35484
|
-
for (let
|
|
35485
|
-
return
|
|
35486
|
-
}
|
|
35487
|
-
info(
|
|
35488
|
-
let
|
|
35489
|
-
if (
|
|
35490
|
-
let i = this.#t[
|
|
35461
|
+
let e = !1;
|
|
35462
|
+
for (let t of this.#z({ allowStale: !0 })) this.#p(t) && (this.#v(this.#i[t], "expire"), e = !0);
|
|
35463
|
+
return e;
|
|
35464
|
+
}
|
|
35465
|
+
info(e) {
|
|
35466
|
+
let t = this.#s.get(e);
|
|
35467
|
+
if (t === void 0) return;
|
|
35468
|
+
let i = this.#t[t], s = this.#e(i) ? i.__staleWhileFetching : i;
|
|
35491
35469
|
if (s === void 0) return;
|
|
35492
|
-
let
|
|
35493
|
-
if (this.#d && this.#
|
|
35494
|
-
let
|
|
35495
|
-
if (
|
|
35470
|
+
let n = { value: s };
|
|
35471
|
+
if (this.#d && this.#F) {
|
|
35472
|
+
let o = this.#d[t], r = this.#F[t];
|
|
35473
|
+
if (o && r) n.ttl = o - (this.#m.now() - r), n.start = Date.now();
|
|
35496
35474
|
}
|
|
35497
|
-
return this.#
|
|
35475
|
+
return this.#_ && (n.size = this.#_[t]), n;
|
|
35498
35476
|
}
|
|
35499
35477
|
dump() {
|
|
35500
|
-
let
|
|
35501
|
-
for (let
|
|
35502
|
-
let i = this.#i[
|
|
35503
|
-
if (
|
|
35504
|
-
let
|
|
35505
|
-
if (this.#d && this.#
|
|
35506
|
-
|
|
35507
|
-
let
|
|
35508
|
-
|
|
35478
|
+
let e = [];
|
|
35479
|
+
for (let t of this.#A({ allowStale: !0 })) {
|
|
35480
|
+
let i = this.#i[t], s = this.#t[t], n = this.#e(s) ? s.__staleWhileFetching : s;
|
|
35481
|
+
if (n === void 0 || i === void 0) continue;
|
|
35482
|
+
let o = { value: n };
|
|
35483
|
+
if (this.#d && this.#F) {
|
|
35484
|
+
o.ttl = this.#d[t];
|
|
35485
|
+
let r = this.#m.now() - this.#F[t];
|
|
35486
|
+
o.start = Math.floor(Date.now() - r);
|
|
35509
35487
|
}
|
|
35510
|
-
this.#
|
|
35488
|
+
this.#_ && (o.size = this.#_[t]), e.unshift([i, o]);
|
|
35511
35489
|
}
|
|
35512
|
-
return
|
|
35490
|
+
return e;
|
|
35513
35491
|
}
|
|
35514
|
-
load(
|
|
35492
|
+
load(e) {
|
|
35515
35493
|
this.clear();
|
|
35516
|
-
for (let [
|
|
35494
|
+
for (let [t, i] of e) {
|
|
35517
35495
|
if (i.start) {
|
|
35518
35496
|
let s = Date.now() - i.start;
|
|
35519
35497
|
i.start = this.#m.now() - s;
|
|
35520
35498
|
}
|
|
35521
|
-
this
|
|
35499
|
+
this.#O(t, i.value, i);
|
|
35522
35500
|
}
|
|
35523
35501
|
}
|
|
35524
|
-
set(
|
|
35525
|
-
|
|
35526
|
-
|
|
35527
|
-
|
|
35528
|
-
|
|
35529
|
-
|
|
35502
|
+
set(e, t, i = {}) {
|
|
35503
|
+
let { status: s = S$1.hasSubscribers ? {} : void 0 } = i;
|
|
35504
|
+
i.status = s, s && (s.op = "set", s.key = e, t !== void 0 && (s.value = t));
|
|
35505
|
+
let n = this.#O(e, t, i);
|
|
35506
|
+
return s && S$1.hasSubscribers && S$1.publish(s), n;
|
|
35507
|
+
}
|
|
35508
|
+
#O(e, t, i = {}) {
|
|
35509
|
+
let { ttl: s = this.ttl, start: n, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: r = this.sizeCalculation, status: h } = i;
|
|
35510
|
+
if (t === void 0) return h && (h.set = "deleted"), this.delete(e), this;
|
|
35511
|
+
let { noUpdateTTL: l = this.noUpdateTTL } = i;
|
|
35512
|
+
h && !this.#e(t) && (h.value = t);
|
|
35513
|
+
let c = this.#k(e, t, i.size || 0, r, h);
|
|
35514
|
+
if (this.maxEntrySize && c > this.maxEntrySize) return this.#v(e, "set"), h && (h.set = "miss", h.maxEntrySizeExceeded = !0), this;
|
|
35515
|
+
let f = this.#n === 0 ? void 0 : this.#s.get(e);
|
|
35516
|
+
if (f === void 0) f = this.#n === 0 ? this.#h : this.#y.length !== 0 ? this.#y.pop() : this.#n === this.#o ? this.#G(!1) : this.#n, this.#i[f] = e, this.#t[f] = t, this.#s.set(e, f), this.#a[this.#h] = f, this.#c[f] = this.#h, this.#h = f, this.#n++, this.#I(f, c, h), h && (h.set = "add"), l = !1, this.#j && this.#x?.(t, e, "add");
|
|
35530
35517
|
else {
|
|
35531
|
-
this.#
|
|
35532
|
-
let
|
|
35533
|
-
if (
|
|
35534
|
-
if (this.#
|
|
35535
|
-
|
|
35536
|
-
let { __staleWhileFetching:
|
|
35537
|
-
|
|
35538
|
-
|
|
35539
|
-
|
|
35518
|
+
this.#L(f);
|
|
35519
|
+
let g = this.#t[f];
|
|
35520
|
+
if (t !== g) {
|
|
35521
|
+
if (this.#W && this.#e(g)) {
|
|
35522
|
+
g.__abortController.abort(/* @__PURE__ */ new Error("replaced"));
|
|
35523
|
+
let { __staleWhileFetching: p } = g;
|
|
35524
|
+
p !== void 0 && !o && (this.#T && this.#w?.(p, e, "set"), this.#f && this.#r?.push([
|
|
35525
|
+
p,
|
|
35526
|
+
e,
|
|
35540
35527
|
"set"
|
|
35541
35528
|
]));
|
|
35542
|
-
} else
|
|
35543
|
-
|
|
35544
|
-
|
|
35529
|
+
} else o || (this.#T && this.#w?.(g, e, "set"), this.#f && this.#r?.push([
|
|
35530
|
+
g,
|
|
35531
|
+
e,
|
|
35545
35532
|
"set"
|
|
35546
35533
|
]));
|
|
35547
|
-
if (this.#
|
|
35548
|
-
|
|
35549
|
-
let
|
|
35550
|
-
|
|
35534
|
+
if (this.#R(f), this.#I(f, c, h), this.#t[f] = t, h) {
|
|
35535
|
+
h.set = "replace";
|
|
35536
|
+
let p = g && this.#e(g) ? g.__staleWhileFetching : g;
|
|
35537
|
+
p !== void 0 && (h.oldValue = p);
|
|
35551
35538
|
}
|
|
35552
|
-
} else
|
|
35553
|
-
this.#
|
|
35539
|
+
} else h && (h.set = "update");
|
|
35540
|
+
this.#j && this.onInsert?.(t, e, t === g ? "update" : "replace");
|
|
35554
35541
|
}
|
|
35555
|
-
if (s !== 0 && !this.#d && this.#
|
|
35556
|
-
let
|
|
35557
|
-
for (;
|
|
35542
|
+
if (s !== 0 && !this.#d && this.#H(), this.#d && (l || this.#N(f, s, n), h && this.#E(h, f)), !o && this.#f && this.#r) {
|
|
35543
|
+
let g = this.#r, p;
|
|
35544
|
+
for (; p = g?.shift();) this.#S?.(...p);
|
|
35558
35545
|
}
|
|
35559
35546
|
return this;
|
|
35560
35547
|
}
|
|
35561
35548
|
pop() {
|
|
35562
35549
|
try {
|
|
35563
35550
|
for (; this.#n;) {
|
|
35564
|
-
let
|
|
35565
|
-
if (this.#
|
|
35566
|
-
if (
|
|
35567
|
-
} else if (
|
|
35551
|
+
let e = this.#t[this.#l];
|
|
35552
|
+
if (this.#G(!0), this.#e(e)) {
|
|
35553
|
+
if (e.__staleWhileFetching) return e.__staleWhileFetching;
|
|
35554
|
+
} else if (e !== void 0) return e;
|
|
35568
35555
|
}
|
|
35569
35556
|
} finally {
|
|
35570
35557
|
if (this.#f && this.#r) {
|
|
35571
|
-
let
|
|
35572
|
-
for (;
|
|
35558
|
+
let e = this.#r, t;
|
|
35559
|
+
for (; t = e?.shift();) this.#S?.(...t);
|
|
35573
35560
|
}
|
|
35574
35561
|
}
|
|
35575
35562
|
}
|
|
35576
|
-
#
|
|
35577
|
-
let
|
|
35578
|
-
return this.#
|
|
35563
|
+
#G(e) {
|
|
35564
|
+
let t = this.#l, i = this.#i[t], s = this.#t[t];
|
|
35565
|
+
return this.#W && this.#e(s) ? s.__abortController.abort(/* @__PURE__ */ new Error("evicted")) : (this.#T || this.#f) && (this.#T && this.#w?.(s, i, "evict"), this.#f && this.#r?.push([
|
|
35579
35566
|
s,
|
|
35580
35567
|
i,
|
|
35581
35568
|
"evict"
|
|
35582
|
-
])), this.#
|
|
35583
|
-
}
|
|
35584
|
-
has(
|
|
35585
|
-
let {
|
|
35586
|
-
|
|
35587
|
-
|
|
35588
|
-
|
|
35589
|
-
|
|
35590
|
-
|
|
35569
|
+
])), this.#R(t), this.#g?.[t] && (clearTimeout(this.#g[t]), this.#g[t] = void 0), e && (this.#i[t] = void 0, this.#t[t] = void 0, this.#y.push(t)), this.#n === 1 ? (this.#l = this.#h = 0, this.#y.length = 0) : this.#l = this.#a[t], this.#s.delete(i), this.#n--, t;
|
|
35570
|
+
}
|
|
35571
|
+
has(e, t = {}) {
|
|
35572
|
+
let { status: i = S$1.hasSubscribers ? {} : void 0 } = t;
|
|
35573
|
+
t.status = i, i && (i.op = "has", i.key = e);
|
|
35574
|
+
let s = this.#Y(e, t);
|
|
35575
|
+
return S$1.hasSubscribers && S$1.publish(i), s;
|
|
35576
|
+
}
|
|
35577
|
+
#Y(e, t = {}) {
|
|
35578
|
+
let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = t, n = this.#s.get(e);
|
|
35579
|
+
if (n !== void 0) {
|
|
35580
|
+
let o = this.#t[n];
|
|
35581
|
+
if (this.#e(o) && o.__staleWhileFetching === void 0) return !1;
|
|
35582
|
+
if (this.#p(n)) s && (s.has = "stale", this.#E(s, n));
|
|
35583
|
+
else return i && this.#D(n), s && (s.has = "hit", this.#E(s, n)), !0;
|
|
35591
35584
|
} else s && (s.has = "miss");
|
|
35592
35585
|
return !1;
|
|
35593
35586
|
}
|
|
35594
|
-
peek(
|
|
35595
|
-
let {
|
|
35596
|
-
|
|
35597
|
-
let
|
|
35598
|
-
return
|
|
35599
|
-
}
|
|
35600
|
-
#
|
|
35601
|
-
let
|
|
35602
|
-
if (this.#
|
|
35603
|
-
|
|
35604
|
-
|
|
35605
|
-
|
|
35606
|
-
|
|
35587
|
+
peek(e, t = {}) {
|
|
35588
|
+
let { status: i = x() ? {} : void 0 } = t;
|
|
35589
|
+
i && (i.op = "peek", i.key = e), t.status = i;
|
|
35590
|
+
let s = this.#J(e, t);
|
|
35591
|
+
return S$1.hasSubscribers && S$1.publish(i), s;
|
|
35592
|
+
}
|
|
35593
|
+
#J(e, t) {
|
|
35594
|
+
let { status: i, allowStale: s = this.allowStale } = t, n = this.#s.get(e);
|
|
35595
|
+
if (n === void 0 || !s && this.#p(n)) {
|
|
35596
|
+
i && (i.peek = n === void 0 ? "miss" : "stale");
|
|
35597
|
+
return;
|
|
35598
|
+
}
|
|
35599
|
+
let o = this.#t[n], r = this.#e(o) ? o.__staleWhileFetching : o;
|
|
35600
|
+
return i && (r !== void 0 ? (i.peek = "hit", i.value = r) : i.peek = "miss"), r;
|
|
35601
|
+
}
|
|
35602
|
+
#P(e, t, i, s) {
|
|
35603
|
+
let n = t === void 0 ? void 0 : this.#t[t];
|
|
35604
|
+
if (this.#e(n)) return n;
|
|
35605
|
+
let o = new AbortController(), { signal: r } = i;
|
|
35606
|
+
r?.addEventListener("abort", () => o.abort(r.reason), { signal: o.signal });
|
|
35607
|
+
let h = {
|
|
35608
|
+
signal: o.signal,
|
|
35607
35609
|
options: i,
|
|
35608
35610
|
context: s
|
|
35609
|
-
},
|
|
35610
|
-
let { aborted:
|
|
35611
|
-
if (i.status && (
|
|
35612
|
-
let
|
|
35613
|
-
return (
|
|
35614
|
-
},
|
|
35615
|
-
let { aborted:
|
|
35616
|
-
if (this.#t[
|
|
35617
|
-
if (
|
|
35618
|
-
},
|
|
35619
|
-
let
|
|
35620
|
-
|
|
35621
|
-
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (
|
|
35611
|
+
}, l = (w, y = !1) => {
|
|
35612
|
+
let { aborted: a } = o.signal, m = i.ignoreFetchAbort && w !== void 0, _ = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && w !== void 0);
|
|
35613
|
+
if (i.status && (a && !y ? (i.status.fetchAborted = !0, i.status.fetchError = o.signal.reason, m && (i.status.fetchAbortIgnored = !0)) : i.status.fetchResolved = !0), a && !m && !y) return f(o.signal.reason, _);
|
|
35614
|
+
let b = p, d = this.#t[t];
|
|
35615
|
+
return (d === p || d === void 0 && m && y) && (w === void 0 ? b.__staleWhileFetching !== void 0 ? this.#t[t] = b.__staleWhileFetching : this.#v(e, "fetch") : (i.status && (i.status.fetchUpdated = !0), this.#O(e, w, h.options))), w;
|
|
35616
|
+
}, c = (w) => (i.status && (i.status.fetchRejected = !0, i.status.fetchError = w), f(w, !1)), f = (w, y) => {
|
|
35617
|
+
let { aborted: a } = o.signal, m = a && i.allowStaleOnFetchAbort, _ = m || i.allowStaleOnFetchRejection, b = _ || i.noDeleteOnFetchRejection, d = p;
|
|
35618
|
+
if (this.#t[t] === p && (!b || !y && d.__staleWhileFetching === void 0 ? this.#v(e, "fetch") : m || (this.#t[t] = d.__staleWhileFetching)), _) return i.status && d.__staleWhileFetching !== void 0 && (i.status.returnedStale = !0), d.__staleWhileFetching;
|
|
35619
|
+
if (d.__returned === d) throw w;
|
|
35620
|
+
}, g = (w, y) => {
|
|
35621
|
+
let a = this.#M?.(e, n, h);
|
|
35622
|
+
a && a instanceof Promise && a.then((m) => w(m === void 0 ? void 0 : m), y), o.signal.addEventListener("abort", () => {
|
|
35623
|
+
(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (w(void 0), i.allowStaleOnFetchAbort && (w = (m) => l(m, !0)));
|
|
35622
35624
|
});
|
|
35623
35625
|
};
|
|
35624
35626
|
i.status && (i.status.fetchDispatched = !0);
|
|
35625
|
-
let
|
|
35626
|
-
__abortController:
|
|
35627
|
-
__staleWhileFetching:
|
|
35627
|
+
let p = new Promise(g).then(l, c), T = Object.assign(p, {
|
|
35628
|
+
__abortController: o,
|
|
35629
|
+
__staleWhileFetching: n,
|
|
35628
35630
|
__returned: void 0
|
|
35629
35631
|
});
|
|
35630
|
-
return
|
|
35631
|
-
...
|
|
35632
|
+
return t === void 0 ? (this.#O(e, T, {
|
|
35633
|
+
...h.options,
|
|
35632
35634
|
status: void 0
|
|
35633
|
-
}),
|
|
35634
|
-
}
|
|
35635
|
-
#e(
|
|
35636
|
-
if (!this.#
|
|
35637
|
-
let
|
|
35638
|
-
return !!
|
|
35639
|
-
}
|
|
35640
|
-
|
|
35641
|
-
let
|
|
35642
|
-
|
|
35635
|
+
}), t = this.#s.get(e)) : this.#t[t] = T, T;
|
|
35636
|
+
}
|
|
35637
|
+
#e(e) {
|
|
35638
|
+
if (!this.#W) return !1;
|
|
35639
|
+
let t = e;
|
|
35640
|
+
return !!t && t instanceof Promise && t.hasOwnProperty("__staleWhileFetching") && t.__abortController instanceof AbortController;
|
|
35641
|
+
}
|
|
35642
|
+
fetch(e, t = {}) {
|
|
35643
|
+
let i = W.hasSubscribers, { status: s = x() ? {} : void 0 } = t;
|
|
35644
|
+
t.status = s, s && t.context && (s.context = t.context);
|
|
35645
|
+
let n = this.#B(e, t);
|
|
35646
|
+
return s && x() && i && (s.trace = !0, W.tracePromise(() => n, s).catch(() => {})), n;
|
|
35647
|
+
}
|
|
35648
|
+
async #B(e, t = {}) {
|
|
35649
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: r = this.noDisposeOnSet, size: h = 0, sizeCalculation: l = this.sizeCalculation, noUpdateTTL: c = this.noUpdateTTL, noDeleteOnFetchRejection: f = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: g = this.allowStaleOnFetchRejection, ignoreFetchAbort: p = this.ignoreFetchAbort, allowStaleOnFetchAbort: T = this.allowStaleOnFetchAbort, context: w, forceRefresh: y = !1, status: a, signal: m } = t;
|
|
35650
|
+
if (a && (a.op = "fetch", a.key = e, y && (a.forceRefresh = !0)), !this.#W) return a && (a.fetch = "get"), this.#C(e, {
|
|
35643
35651
|
allowStale: i,
|
|
35644
35652
|
updateAgeOnGet: s,
|
|
35645
|
-
noDeleteOnStaleGet:
|
|
35646
|
-
status:
|
|
35653
|
+
noDeleteOnStaleGet: n,
|
|
35654
|
+
status: a
|
|
35647
35655
|
});
|
|
35648
|
-
let
|
|
35656
|
+
let _ = {
|
|
35649
35657
|
allowStale: i,
|
|
35650
35658
|
updateAgeOnGet: s,
|
|
35651
|
-
noDeleteOnStaleGet:
|
|
35652
|
-
ttl:
|
|
35653
|
-
noDisposeOnSet:
|
|
35654
|
-
size:
|
|
35655
|
-
sizeCalculation:
|
|
35656
|
-
noUpdateTTL:
|
|
35657
|
-
noDeleteOnFetchRejection:
|
|
35658
|
-
allowStaleOnFetchRejection:
|
|
35659
|
-
allowStaleOnFetchAbort:
|
|
35660
|
-
ignoreFetchAbort:
|
|
35661
|
-
status:
|
|
35662
|
-
signal:
|
|
35663
|
-
},
|
|
35664
|
-
if (
|
|
35665
|
-
|
|
35666
|
-
let
|
|
35667
|
-
return
|
|
35659
|
+
noDeleteOnStaleGet: n,
|
|
35660
|
+
ttl: o,
|
|
35661
|
+
noDisposeOnSet: r,
|
|
35662
|
+
size: h,
|
|
35663
|
+
sizeCalculation: l,
|
|
35664
|
+
noUpdateTTL: c,
|
|
35665
|
+
noDeleteOnFetchRejection: f,
|
|
35666
|
+
allowStaleOnFetchRejection: g,
|
|
35667
|
+
allowStaleOnFetchAbort: T,
|
|
35668
|
+
ignoreFetchAbort: p,
|
|
35669
|
+
status: a,
|
|
35670
|
+
signal: m
|
|
35671
|
+
}, b = this.#s.get(e);
|
|
35672
|
+
if (b === void 0) {
|
|
35673
|
+
a && (a.fetch = "miss");
|
|
35674
|
+
let d = this.#P(e, b, _, w);
|
|
35675
|
+
return d.__returned = d;
|
|
35668
35676
|
} else {
|
|
35669
|
-
let
|
|
35670
|
-
if (this.#e(
|
|
35671
|
-
let E = i &&
|
|
35672
|
-
return
|
|
35677
|
+
let d = this.#t[b];
|
|
35678
|
+
if (this.#e(d)) {
|
|
35679
|
+
let E = i && d.__staleWhileFetching !== void 0;
|
|
35680
|
+
return a && (a.fetch = "inflight", E && (a.returnedStale = !0)), E ? d.__staleWhileFetching : d.__returned = d;
|
|
35673
35681
|
}
|
|
35674
|
-
let
|
|
35675
|
-
if (!
|
|
35676
|
-
let
|
|
35677
|
-
return
|
|
35682
|
+
let A = this.#p(b);
|
|
35683
|
+
if (!y && !A) return a && (a.fetch = "hit"), this.#L(b), s && this.#D(b), a && this.#E(a, b), d;
|
|
35684
|
+
let z = this.#P(e, b, _, w), v = z.__staleWhileFetching !== void 0 && i;
|
|
35685
|
+
return a && (a.fetch = A ? "stale" : "refresh", v && A && (a.returnedStale = !0)), v ? z.__staleWhileFetching : z.__returned = z;
|
|
35678
35686
|
}
|
|
35679
35687
|
}
|
|
35680
|
-
|
|
35681
|
-
let i =
|
|
35688
|
+
forceFetch(e, t = {}) {
|
|
35689
|
+
let i = W.hasSubscribers, { status: s = x() ? {} : void 0 } = t;
|
|
35690
|
+
t.status = s, s && t.context && (s.context = t.context);
|
|
35691
|
+
let n = this.#K(e, t);
|
|
35692
|
+
return s && x() && i && (s.trace = !0, W.tracePromise(() => n, s).catch(() => {})), n;
|
|
35693
|
+
}
|
|
35694
|
+
async #K(e, t = {}) {
|
|
35695
|
+
let i = await this.#B(e, t);
|
|
35682
35696
|
if (i === void 0) throw new Error("fetch() returned undefined");
|
|
35683
35697
|
return i;
|
|
35684
35698
|
}
|
|
35685
|
-
memo(
|
|
35686
|
-
let i =
|
|
35699
|
+
memo(e, t = {}) {
|
|
35700
|
+
let { status: i = S$1.hasSubscribers ? {} : void 0 } = t;
|
|
35701
|
+
t.status = i, i && (i.op = "memo", i.key = e, t.context && (i.context = t.context));
|
|
35702
|
+
let s = this.#Q(e, t);
|
|
35703
|
+
return i && (i.value = s), S$1.hasSubscribers && S$1.publish(i), s;
|
|
35704
|
+
}
|
|
35705
|
+
#Q(e, t = {}) {
|
|
35706
|
+
let i = this.#U;
|
|
35687
35707
|
if (!i) throw new Error("no memoMethod provided to constructor");
|
|
35688
|
-
let { context: s, forceRefresh:
|
|
35689
|
-
|
|
35690
|
-
let
|
|
35691
|
-
|
|
35708
|
+
let { context: s, status: n, forceRefresh: o, ...r } = t;
|
|
35709
|
+
n && o && (n.forceRefresh = !0);
|
|
35710
|
+
let h = this.#C(e, r), l = o || h === void 0;
|
|
35711
|
+
if (n && (n.memo = l ? "miss" : "hit", l || (n.value = h)), !l) return h;
|
|
35712
|
+
let c = i(e, h, {
|
|
35713
|
+
options: r,
|
|
35692
35714
|
context: s
|
|
35693
35715
|
});
|
|
35694
|
-
return this
|
|
35695
|
-
}
|
|
35696
|
-
get(
|
|
35697
|
-
let {
|
|
35698
|
-
|
|
35699
|
-
|
|
35700
|
-
|
|
35701
|
-
|
|
35716
|
+
return n && (n.value = c), this.#O(e, c, r), c;
|
|
35717
|
+
}
|
|
35718
|
+
get(e, t = {}) {
|
|
35719
|
+
let { status: i = S$1.hasSubscribers ? {} : void 0 } = t;
|
|
35720
|
+
t.status = i, i && (i.op = "get", i.key = e);
|
|
35721
|
+
let s = this.#C(e, t);
|
|
35722
|
+
return i && (s !== void 0 && (i.value = s), S$1.hasSubscribers && S$1.publish(i)), s;
|
|
35723
|
+
}
|
|
35724
|
+
#C(e, t = {}) {
|
|
35725
|
+
let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: o } = t, r = this.#s.get(e);
|
|
35726
|
+
if (r === void 0) {
|
|
35727
|
+
o && (o.get = "miss");
|
|
35728
|
+
return;
|
|
35729
|
+
}
|
|
35730
|
+
let h = this.#t[r], l = this.#e(h);
|
|
35731
|
+
return o && this.#E(o, r), this.#p(r) ? l ? (o && (o.get = "stale-fetching"), i && h.__staleWhileFetching !== void 0 ? (o && (o.returnedStale = !0), h.__staleWhileFetching) : void 0) : (n || this.#v(e, "expire"), o && (o.get = "stale"), i ? (o && (o.returnedStale = !0), h) : void 0) : (o && (o.get = l ? "fetching" : "hit"), this.#L(r), s && this.#D(r), l ? h.__staleWhileFetching : h);
|
|
35702
35732
|
}
|
|
35703
|
-
|
|
35704
|
-
this.#
|
|
35733
|
+
#$(e, t) {
|
|
35734
|
+
this.#c[t] = e, this.#a[e] = t;
|
|
35705
35735
|
}
|
|
35706
|
-
#
|
|
35707
|
-
|
|
35736
|
+
#L(e) {
|
|
35737
|
+
e !== this.#h && (e === this.#l ? this.#l = this.#a[e] : this.#$(this.#c[e], this.#a[e]), this.#$(this.#h, e), this.#h = e);
|
|
35708
35738
|
}
|
|
35709
|
-
delete(
|
|
35710
|
-
return this.#
|
|
35739
|
+
delete(e) {
|
|
35740
|
+
return this.#v(e, "delete");
|
|
35711
35741
|
}
|
|
35712
|
-
#
|
|
35742
|
+
#v(e, t) {
|
|
35743
|
+
S$1.hasSubscribers && S$1.publish({
|
|
35744
|
+
op: "delete",
|
|
35745
|
+
delete: t,
|
|
35746
|
+
key: e
|
|
35747
|
+
});
|
|
35713
35748
|
let i = !1;
|
|
35714
35749
|
if (this.#n !== 0) {
|
|
35715
|
-
let s = this.#s.get(
|
|
35716
|
-
if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g?.[s]), this.#g[s] = void 0), i = !0, this.#n === 1) this.#
|
|
35750
|
+
let s = this.#s.get(e);
|
|
35751
|
+
if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g?.[s]), this.#g[s] = void 0), i = !0, this.#n === 1) this.#q(t);
|
|
35717
35752
|
else {
|
|
35718
|
-
this.#
|
|
35719
|
-
let
|
|
35720
|
-
if (this.#e(
|
|
35721
|
-
|
|
35722
|
-
|
|
35723
|
-
|
|
35724
|
-
])), this.#s.delete(
|
|
35753
|
+
this.#R(s);
|
|
35754
|
+
let n = this.#t[s];
|
|
35755
|
+
if (this.#e(n) ? n.__abortController.abort(/* @__PURE__ */ new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#w?.(n, e, t), this.#f && this.#r?.push([
|
|
35756
|
+
n,
|
|
35757
|
+
e,
|
|
35758
|
+
t
|
|
35759
|
+
])), this.#s.delete(e), this.#i[s] = void 0, this.#t[s] = void 0, s === this.#h) this.#h = this.#c[s];
|
|
35725
35760
|
else if (s === this.#l) this.#l = this.#a[s];
|
|
35726
35761
|
else {
|
|
35727
|
-
let
|
|
35728
|
-
this.#a[
|
|
35729
|
-
let
|
|
35730
|
-
this.#
|
|
35762
|
+
let o = this.#c[s];
|
|
35763
|
+
this.#a[o] = this.#a[s];
|
|
35764
|
+
let r = this.#a[s];
|
|
35765
|
+
this.#c[r] = this.#c[s];
|
|
35731
35766
|
}
|
|
35732
|
-
this.#n--, this.#
|
|
35767
|
+
this.#n--, this.#y.push(s);
|
|
35733
35768
|
}
|
|
35734
35769
|
}
|
|
35735
35770
|
if (this.#f && this.#r?.length) {
|
|
35736
|
-
let s = this.#r,
|
|
35737
|
-
for (;
|
|
35771
|
+
let s = this.#r, n;
|
|
35772
|
+
for (; n = s?.shift();) this.#S?.(...n);
|
|
35738
35773
|
}
|
|
35739
35774
|
return i;
|
|
35740
35775
|
}
|
|
35741
35776
|
clear() {
|
|
35742
|
-
return this.#
|
|
35777
|
+
return this.#q("delete");
|
|
35743
35778
|
}
|
|
35744
|
-
#
|
|
35745
|
-
for (let
|
|
35746
|
-
let i = this.#t[
|
|
35779
|
+
#q(e) {
|
|
35780
|
+
for (let t of this.#z({ allowStale: !0 })) {
|
|
35781
|
+
let i = this.#t[t];
|
|
35747
35782
|
if (this.#e(i)) i.__abortController.abort(/* @__PURE__ */ new Error("deleted"));
|
|
35748
35783
|
else {
|
|
35749
|
-
let s = this.#i[
|
|
35750
|
-
this.#T && this.#w?.(i, s,
|
|
35784
|
+
let s = this.#i[t];
|
|
35785
|
+
this.#T && this.#w?.(i, s, e), this.#f && this.#r?.push([
|
|
35751
35786
|
i,
|
|
35752
35787
|
s,
|
|
35753
|
-
|
|
35788
|
+
e
|
|
35754
35789
|
]);
|
|
35755
35790
|
}
|
|
35756
35791
|
}
|
|
35757
|
-
if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#
|
|
35758
|
-
this.#d.fill(0), this.#
|
|
35759
|
-
for (let
|
|
35792
|
+
if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#F) {
|
|
35793
|
+
this.#d.fill(0), this.#F.fill(0);
|
|
35794
|
+
for (let t of this.#g ?? []) t !== void 0 && clearTimeout(t);
|
|
35760
35795
|
this.#g?.fill(void 0);
|
|
35761
35796
|
}
|
|
35762
|
-
if (this.#
|
|
35763
|
-
let
|
|
35764
|
-
for (; i =
|
|
35797
|
+
if (this.#_ && this.#_.fill(0), this.#l = 0, this.#h = 0, this.#y.length = 0, this.#b = 0, this.#n = 0, this.#f && this.#r) {
|
|
35798
|
+
let t = this.#r, i;
|
|
35799
|
+
for (; i = t?.shift();) this.#S?.(...i);
|
|
35765
35800
|
}
|
|
35766
35801
|
}
|
|
35767
35802
|
};
|
|
@@ -45452,7 +45487,7 @@ const variantNegative$1 = {
|
|
|
45452
45487
|
return {
|
|
45453
45488
|
matcher: matcher.slice(1),
|
|
45454
45489
|
body: (body) => {
|
|
45455
|
-
if (body.
|
|
45490
|
+
if (body.some((v) => v[0] === "$$mini-no-negative")) return;
|
|
45456
45491
|
let changed = false;
|
|
45457
45492
|
body.forEach((v) => {
|
|
45458
45493
|
const value = v[1]?.toString();
|
|
@@ -45926,7 +45961,7 @@ function variantAttributify(options = {}) {
|
|
|
45926
45961
|
const [, bodyVariant, bracketValue] = content.match(variantsValueRE) || [];
|
|
45927
45962
|
if (bracketValue) return `${bodyVariant}${variants}${name}-${bracketValue}`;
|
|
45928
45963
|
}
|
|
45929
|
-
if (variants &&
|
|
45964
|
+
if (variants && /^[\d.]+$/.test(body)) {
|
|
45930
45965
|
const variantParts = variants.split(/([^:]*:)/g).filter(Boolean);
|
|
45931
45966
|
const _body = variantParts.pop() + body;
|
|
45932
45967
|
const _variants = variantParts.join("");
|
|
@@ -46564,7 +46599,7 @@ function encodeSvgForCss(svg) {
|
|
|
46564
46599
|
return encodeSVGforURL(useSvg);
|
|
46565
46600
|
}
|
|
46566
46601
|
//#endregion
|
|
46567
|
-
//#region ../../packages-presets/preset-icons/dist/core-
|
|
46602
|
+
//#region ../../packages-presets/preset-icons/dist/core-DIrlUwzK.mjs
|
|
46568
46603
|
function getEnvFlags() {
|
|
46569
46604
|
const isNode = typeof process !== "undefined" && process.stdout;
|
|
46570
46605
|
return {
|
|
@@ -46660,6 +46695,7 @@ var collections_default = [
|
|
|
46660
46695
|
"gala",
|
|
46661
46696
|
"game-icons",
|
|
46662
46697
|
"garden",
|
|
46698
|
+
"gcp",
|
|
46663
46699
|
"geo",
|
|
46664
46700
|
"gg",
|
|
46665
46701
|
"gis",
|
|
@@ -46945,7 +46981,7 @@ async function parseIconWithLoader(body, loader, options = {}, safeCollectionsNa
|
|
|
46945
46981
|
};
|
|
46946
46982
|
}
|
|
46947
46983
|
//#endregion
|
|
46948
|
-
//#region ../../packages-presets/preset-icons/dist/cdn-
|
|
46984
|
+
//#region ../../packages-presets/preset-icons/dist/cdn-DYTPkoFm.mjs
|
|
46949
46985
|
async function createCDNLoader(cdnBase) {
|
|
46950
46986
|
const { $fetch } = await Promise.resolve().then(() => require("./node-3wiZdXIz.cjs"));
|
|
46951
46987
|
return createCDNFetchLoader($fetch, cdnBase);
|
|
@@ -48632,7 +48668,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
48632
48668
|
return target;
|
|
48633
48669
|
};
|
|
48634
48670
|
//#endregion
|
|
48635
|
-
//#region ../../packages-presets/preset-wind4/dist/utils-
|
|
48671
|
+
//#region ../../packages-presets/preset-wind4/dist/utils-B60b98El.mjs
|
|
48636
48672
|
const PRESET_NAME = "@unocss/preset-wind4";
|
|
48637
48673
|
const CONTROL_NO_NEGATIVE = "$$mini-no-negative";
|
|
48638
48674
|
const SpecialColorKey = {
|
|
@@ -48766,6 +48802,7 @@ const unitOnlyMap = {
|
|
|
48766
48802
|
};
|
|
48767
48803
|
const bracketTypeRe = /^\[(color|image|length|size|position|quoted|string|number|family):/i;
|
|
48768
48804
|
const splitComma = /,(?![^()]*\))/g;
|
|
48805
|
+
const cssVarsRE = /(?<!var\()--([\w.-]+)(\([^)]+\)|,[#.\s\w]+)?/g;
|
|
48769
48806
|
var handlers_exports = /* @__PURE__ */ __exportAll({
|
|
48770
48807
|
auto: () => auto,
|
|
48771
48808
|
bracket: () => bracket,
|
|
@@ -48900,13 +48937,23 @@ function fraction(str) {
|
|
|
48900
48937
|
return `${round(num * 100)}%`;
|
|
48901
48938
|
}
|
|
48902
48939
|
}
|
|
48903
|
-
|
|
48904
|
-
|
|
48940
|
+
/**
|
|
48941
|
+
* Process a theme variable reference and retrieve its value and corresponding CSS variable key.
|
|
48942
|
+
*
|
|
48943
|
+
* @example theme => Theme object
|
|
48944
|
+
* @example themeKey => 'colors
|
|
48945
|
+
* @example themeKeyPaths => ['blue', '500']
|
|
48946
|
+
* @example varPaths => 'colors.blue.500'
|
|
48947
|
+
*
|
|
48948
|
+
* @returns An object containing the resolved value from the theme and the corresponding CSS variable key.
|
|
48949
|
+
*/
|
|
48950
|
+
function processThemeVariable(theme, themeKey, themeKeyPaths, varPaths) {
|
|
48951
|
+
const valOrObj = getThemeByKey(theme, themeKey, themeKeyPaths);
|
|
48905
48952
|
const hasDefault = typeof valOrObj === "object" && "DEFAULT" in valOrObj;
|
|
48906
|
-
if (hasDefault)
|
|
48953
|
+
if (hasDefault) themeKeyPaths.push("DEFAULT");
|
|
48907
48954
|
const val = hasDefault ? valOrObj.DEFAULT : valOrObj;
|
|
48908
|
-
const varKey = hasDefault &&
|
|
48909
|
-
if (val != null) themeTracking(
|
|
48955
|
+
const varKey = hasDefault && themeKey !== "spacing" ? `${varPaths}.DEFAULT` : varPaths;
|
|
48956
|
+
if (val != null) themeTracking(themeKey, themeKeyPaths.length ? themeKeyPaths : void 0);
|
|
48910
48957
|
return {
|
|
48911
48958
|
val,
|
|
48912
48959
|
varKey
|
|
@@ -48925,23 +48972,24 @@ function bracketWithType(str, requiredType, theme) {
|
|
|
48925
48972
|
}
|
|
48926
48973
|
if (!base) return;
|
|
48927
48974
|
if (base === "=\"\"") return;
|
|
48928
|
-
if (base
|
|
48929
|
-
|
|
48930
|
-
|
|
48931
|
-
|
|
48932
|
-
|
|
48933
|
-
const
|
|
48934
|
-
|
|
48935
|
-
|
|
48936
|
-
|
|
48937
|
-
|
|
48938
|
-
|
|
48939
|
-
|
|
48940
|
-
|
|
48941
|
-
|
|
48942
|
-
|
|
48943
|
-
}
|
|
48975
|
+
if (theme) base = transformThemeFn(base, theme);
|
|
48976
|
+
const matches = Array.from(base.matchAll(cssVarsRE));
|
|
48977
|
+
for (const match of matches) {
|
|
48978
|
+
const [full, varPaths, _value] = match;
|
|
48979
|
+
if (theme) {
|
|
48980
|
+
const [key, ...paths] = varPaths.split(".");
|
|
48981
|
+
const { val, varKey } = processThemeVariable(theme, key, paths, varPaths);
|
|
48982
|
+
if (val != null) {
|
|
48983
|
+
const cssVar = `--${varKey.replaceAll(".", "-")}`;
|
|
48984
|
+
if (_value && !_value.startsWith(",")) base = base.replace(full, `calc(var(${cssVar}) * ${_value.slice(1, -1)})`);
|
|
48985
|
+
else {
|
|
48986
|
+
const fallback = _value?.slice(1);
|
|
48987
|
+
base = base.replace(full, `var(${cssVar}${fallback ? `, ${fallback}` : ""})`);
|
|
48988
|
+
}
|
|
48989
|
+
continue;
|
|
48990
|
+
}
|
|
48944
48991
|
}
|
|
48992
|
+
base = base.replace(full, `var(${full})`);
|
|
48945
48993
|
}
|
|
48946
48994
|
let curly = 0;
|
|
48947
48995
|
for (const i of base) if (i === "[") curly += 1;
|
|
@@ -49323,7 +49371,7 @@ function propertyTracking(property, value) {
|
|
|
49323
49371
|
if (!trackedProperties.has(property)) trackedProperties.set(property, value);
|
|
49324
49372
|
}
|
|
49325
49373
|
//#endregion
|
|
49326
|
-
//#region ../../packages-presets/preset-wind4/dist/container-
|
|
49374
|
+
//#region ../../packages-presets/preset-wind4/dist/container-m1WfKD7R.mjs
|
|
49327
49375
|
const containerParent = [[/^@container(?:\/(\w+))?(?:-(normal))?$/, ([, l, v]) => {
|
|
49328
49376
|
return {
|
|
49329
49377
|
"container-type": v ?? "inline-size",
|
|
@@ -51147,7 +51195,7 @@ function getSizeValue(theme, hw, prop) {
|
|
|
51147
51195
|
themeTracking(`spacing`);
|
|
51148
51196
|
v = `calc(var(--spacing) * ${h.number(prop)})`;
|
|
51149
51197
|
}
|
|
51150
|
-
return v ?? h.bracket.cssvar.global.auto.none.fraction.rem(prop);
|
|
51198
|
+
return v ?? h.bracket.cssvar.global.auto.none.fraction.rem(prop, theme);
|
|
51151
51199
|
}
|
|
51152
51200
|
const sizes = [
|
|
51153
51201
|
[/^size-(min-|max-)?(.+)$/, ([, m, s], { theme }) => ({
|
|
@@ -53353,7 +53401,7 @@ const theme = {
|
|
|
53353
53401
|
supports
|
|
53354
53402
|
};
|
|
53355
53403
|
//#endregion
|
|
53356
|
-
//#region ../../packages-presets/preset-wind4/dist/variants-
|
|
53404
|
+
//#region ../../packages-presets/preset-wind4/dist/variants-B5PDncV-.mjs
|
|
53357
53405
|
const variantAria = {
|
|
53358
53406
|
name: "aria",
|
|
53359
53407
|
match(matcher, ctx) {
|
|
@@ -53841,7 +53889,7 @@ const variantNegative = {
|
|
|
53841
53889
|
return {
|
|
53842
53890
|
matcher: matcher.slice(1),
|
|
53843
53891
|
body: (body) => {
|
|
53844
|
-
if (body.
|
|
53892
|
+
if (body.some((v) => v[0] === "$$mini-no-negative")) return;
|
|
53845
53893
|
let changed = false;
|
|
53846
53894
|
for (const v of body) {
|
|
53847
53895
|
const [prop, rawValue, meta] = v;
|